libosmscout 1.1.1
Loading...
Searching...
No Matches
utf8helper::Parser Struct Reference

Parse and transform an UTF8 string. More...

#include <libosmscout/include/osmscout/util/utf8helper.h>

Collaboration diagram for utf8helper::Parser:

Public Types

enum  Exit { Done = 0 , Continue , Error }

Public Member Functions

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

Public Attributes

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

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

◆ Parser() [2/2]

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

Member Function Documentation

◆ Reset()

void utf8helper::Parser::Reset ( )

Member Data Documentation

◆ b

byte utf8helper::Parser::b[3]

◆ context

int utf8helper::Parser::context

◆ func

utf8helper::Transform utf8helper::Parser::func

◆ run

Exit(* utf8helper::Parser::run) (Parser *, byte)

◆ u

codepoint utf8helper::Parser::u

◆ u_size

char utf8helper::Parser::u_size

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