Wolframe, 0.0.3

Class for parsing ascii character by character from a source in an unicode based encoding. More...

#include <asciiCharParser.hpp>

Public Types

enum  Encoding {
  NONE, UCS1, UCS2BE, UCS2LE,
  UCS4BE, UCS4LE
}
 

Public Member Functions

 AsciiCharParser ()
 Constructor. More...
 
void putInput (const char *src, std::size_t srcsize)
 Feed next input block. More...
 
unsigned char getNext ()
 Get the next ASCII character or 0, if at the end of the current input block or an error occurred (to check with lastError()const) More...
 
const char * lastError () const
 Get the last error occurred. More...
 

Private Types

enum  { BufSize =8 }
 

Private Member Functions

bool prepareChar (unsigned int chrsize)
 
void consumeChar (unsigned int chrsize)
 

Private Attributes

const char * m_src
 
std::size_t m_itr
 
std::size_t m_end
 
const char * m_lastError
 
Encoding m_encoding
 
unsigned char m_buf [BufSize]
 
std::size_t m_bufsize
 

Detailed Description

Class for parsing ascii character by character from a source in an unicode based encoding.

Member Enumeration Documentation

anonymous enum
private
Enumerator
BufSize 
Enumerator
NONE 
UCS1 
UCS2BE 
UCS2LE 
UCS4BE 
UCS4LE 

Constructor & Destructor Documentation

_Wolframe::utils::AsciiCharParser::AsciiCharParser ( )
inline

Constructor.

Member Function Documentation

void _Wolframe::utils::AsciiCharParser::consumeChar ( unsigned int  chrsize)
private
unsigned char _Wolframe::utils::AsciiCharParser::getNext ( )

Get the next ASCII character or 0, if at the end of the current input block or an error occurred (to check with lastError()const)

const char* _Wolframe::utils::AsciiCharParser::lastError ( ) const
inline

Get the last error occurred.

bool _Wolframe::utils::AsciiCharParser::prepareChar ( unsigned int  chrsize)
private
void _Wolframe::utils::AsciiCharParser::putInput ( const char *  src,
std::size_t  srcsize 
)

Feed next input block.

Remarks
The previous block has been consumed completely

Member Data Documentation

unsigned char _Wolframe::utils::AsciiCharParser::m_buf[BufSize]
private
std::size_t _Wolframe::utils::AsciiCharParser::m_bufsize
private
Encoding _Wolframe::utils::AsciiCharParser::m_encoding
private
std::size_t _Wolframe::utils::AsciiCharParser::m_end
private
std::size_t _Wolframe::utils::AsciiCharParser::m_itr
private
const char* _Wolframe::utils::AsciiCharParser::m_lastError
private
const char* _Wolframe::utils::AsciiCharParser::m_src
private

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