libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
utf8helper::Parser Struct Reference

Parse and transform an UTF8 string. More...

#include <utf8helper.h>

Public Types

enum  Exit { Done = 0, Continue, Error }
 

Public Member Functions

 Parser (const Parser &)=default
 
 Parser (utf8helper::Transform func)
 
void Reset ()
 

Public Attributes

byte b [3]
 
int context
 
utf8helper::Transform func
 
Exit(* run )(Parser *, byte)
 
codepoint u
 
char u_size
 

Detailed Description

Parse and transform an UTF8 string.

See https://tools.ietf.org/html/rfc3629

UTF8 encoding standard provides backward compatibility with the ASCII string. Illegal sequences will be discarded for security reason: see RFC 3629 #10. For each valid sequence, It picks the corresponding predefined table, If none has been defined, then the sequence is dumped as it is. Otherwise, the functor is called for the found character and the new sequence will be dumped instead.

Member Enumeration Documentation

◆ Exit

Enumerator
Done 
Continue 
Error 

Constructor & Destructor Documentation

◆ Parser() [1/2]

utf8helper::Parser::Parser ( utf8helper::Transform  func)
explicit

References Reset().

◆ Parser() [2/2]

utf8helper::Parser::Parser ( const Parser )
default

Member Function Documentation

◆ Reset()

Member Data Documentation

◆ b

◆ context

int utf8helper::Parser::context

◆ func

◆ run

◆ u

◆ u_size


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