E-MailRelay
Static Public Member Functions | List of all members
G::Xtext Class Reference

An xtext codec class, encoding space as "+20" etc. More...

#include <gxtext.h>

Static Public Member Functions

static std::string encode (std::string_view)
 Encodes the given string. More...
 
static std::string decode (std::string_view)
 Decodes the given string. More...
 
static bool valid (std::string_view, bool strict=false)
 Returns true if a valid encoding, or empty. More...
 

Detailed Description

An xtext codec class, encoding space as "+20" etc.

See also
RFC-1891 section 5

Definition at line 37 of file gxtext.h.

Member Function Documentation

◆ decode()

std::string G::Xtext::decode ( std::string_view  s)
static

Decodes the given string.

Input strings must be un-strictly valid(), otherwise the result is undefined.

Definition at line 119 of file gxtext.cpp.

◆ encode()

std::string G::Xtext::encode ( std::string_view  s)
static

Encodes the given string.

Definition at line 97 of file gxtext.cpp.

◆ valid()

bool G::Xtext::valid ( std::string_view  s,
bool  strict = false 
)
static

Returns true if a valid encoding, or empty.

If strict then 'equals' and 'space' are disallowed and hex characters must be uppercase (eg. "+1A").

Definition at line 77 of file gxtext.cpp.


The documentation for this class was generated from the following files: