Public Types | Public Member Functions | Public Attributes

utf8_char_t Struct Reference
[Utility Library]

a UTF-8 character. More...

#include <parsing.h>

List of all members.

Public Types

enum  eConstants {
  eHighBit = 0x80,
  eTwoHigh = 0xC0,
  eMaxChars = 6,
  eBufferSize = 8
}

Public Member Functions

 utf8_char_t (void) throw ()
void clear (void) throw ()
int getByteCount (void) const throw ()
int getValue (void) const throw ()
void setToReplacement (void) throw ()
void dump (IN const char *title) const throw ()
bool operator! (void) const throw ()
 "!c" means c is a null character, or invalid
 operator bool (void) const throw ()
 inversion of ! operator: c is true if it is valid and non-null
bool isValid (void) const throw ()
 is this valid? Can be both valid and null!
bool operator== (IN char a) const throw ()
 single-byte character comparison

Public Attributes

char value [eBufferSize]
int nBytes

Detailed Description

a UTF-8 character.

Note that this is multiple 8-bit chars in a sequence. See http://en.wikipedia.org/wiki/Utf8

Definition at line 54 of file parsing.h.


Member Enumeration Documentation

Enumerator:
eHighBit 

high bit set

eTwoHigh 

both high bits set

eMaxChars 

from RFC 3629

eBufferSize 

internal use only--keep dword align

Definition at line 55 of file parsing.h.


Constructor & Destructor Documentation

utf8_char_t::utf8_char_t ( void   )  throw () [inline]

Definition at line 63 of file parsing.h.


Member Function Documentation

void utf8_char_t::clear ( void   )  throw () [inline]

Definition at line 64 of file parsing.h.

int utf8_char_t::getByteCount ( void   )  const throw () [inline]

Definition at line 68 of file parsing.h.

int utf8_char_t::getValue ( void   )  const throw ()

Definition at line 79 of file parsing.cpp.

void utf8_char_t::setToReplacement ( void   )  throw ()

Definition at line 60 of file parsing.cpp.

void utf8_char_t::dump ( IN const char *  title  )  const throw ()

Definition at line 115 of file parsing.cpp.

bool utf8_char_t::operator! ( void   )  const throw () [inline]

"!c" means c is a null character, or invalid

Definition at line 74 of file parsing.h.

utf8_char_t::operator bool ( void   )  const throw () [inline]

inversion of ! operator: c is true if it is valid and non-null

Definition at line 79 of file parsing.h.

bool utf8_char_t::isValid ( void   )  const throw () [inline]

is this valid? Can be both valid and null!

Definition at line 84 of file parsing.h.

bool utf8_char_t::operator== ( IN char  a  )  const throw () [inline]

single-byte character comparison

Definition at line 91 of file parsing.h.


Member Data Documentation

char utf8_char_t::value[eBufferSize]

Definition at line 96 of file parsing.h.

Definition at line 97 of file parsing.h.


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