Public Attributes | List of all members
moot::mootXMLRecoder Class Reference

Special 2-phase recoder object for XML text.

Collaboration diagram for moot::mootXMLRecoder:
Collaboration graph
[legend]

Public Member Functions

Constructors etc.
 mootXMLRecoder (const std::string &src="", const std::string &dst="")
 
 ~mootXMLRecoder (void)
 
Requests
void scan_request (const std::string &reqstr)
 
void scan_request (const std::string &src, const std::string &dst)
 
Recoding: *2file()
bool buffer2file (const char *in, size_t in_size, FILE *out)
 
bool string2file (const char *in, FILE *out)
 
bool string2file (const std::string &in, FILE *out)
 
Recoding: *2buffer()
bool buffer2buffer (const char *in, size_t in_size, char **out, size_t *out_used, size_t *out_alloc)
 
bool string2buffer (const char *s, char **out, size_t *out_used, size_t *out_alloc)
 
bool string2buffer (const std::string &in, char **out, size_t *out_used, size_t *out_alloc)
 
Recoding: *2string()
bool buffer2string (const char *in, size_t in_size, std::string &out)
 
bool string2string (const char *s, std::string &out)
 
bool string2string (const std::string &in, std::string &out)
 
Recoding: *2mstream()
bool buffer2mstream (const char *in, size_t in_size, mootio::mostream *out)
 
bool string2mstream (const char *s, mootio::mostream *out)
 
bool string2mstream (const std::string &in, mootio::mostream *out)
 

Public Attributes

bool standalone
 whether we should bother More...
 
mootRecoder rc1
 first-stage recoder More...
 
mootRecoder rc2
 second-stage recoder More...
 
char * buf1
 buffer for intermediate recoding results More...
 
size_t buf1_used
 number of bytes used in buf1 More...
 
size_t buf1_alloc
 allocated size of buf1 More...
 
char * buf2
 buffer for final recoding results More...
 
size_t buf2_used
 number of bytes used in buf2 More...
 
size_t buf2_alloc
 allocated size of buf2 More...
 

Constructor & Destructor Documentation

◆ mootXMLRecoder()

moot::mootXMLRecoder::mootXMLRecoder ( const std::string &  src = "",
const std::string &  dst = "" 
)
inline

Default constructor, given optional requests

References moot::mootRecoder::ensure_outer(), and moot::mootRecoder::rc_outer.

◆ ~mootXMLRecoder()

moot::mootXMLRecoder::~mootXMLRecoder ( void  )
inline

Default destructor

< don't double-free shared outer

References moot::mootRecoder::rc_outer.

Member Function Documentation

◆ scan_request() [1/2]

void moot::mootXMLRecoder::scan_request ( const std::string &  reqstr)
inline

Scan a recode request string (i.e. one of the form "SRC..DST")

Referenced by moot::TokenWriterExpat::setEncoding().

◆ scan_request() [2/2]

void moot::mootXMLRecoder::scan_request ( const std::string &  src,
const std::string &  dst 
)
inline

Generate and scan a simple request

References moot::mootRecoder::scan_request().

◆ buffer2file()

bool moot::mootXMLRecoder::buffer2file ( const char *  in,
size_t  in_size,
FILE *  out 
)
inline

Recode a C buffer to a C stream

References moot::mootRecoder::buffer2buffer(), and moot::mootRecoder::buffer2file().

◆ string2file() [1/2]

bool moot::mootXMLRecoder::string2file ( const char *  in,
FILE *  out 
)
inline

Recode a C string to a C stream

◆ string2file() [2/2]

bool moot::mootXMLRecoder::string2file ( const std::string &  in,
FILE *  out 
)
inline

Recode an STL string to a C stream

◆ buffer2buffer()

bool moot::mootXMLRecoder::buffer2buffer ( const char *  in,
size_t  in_size,
char **  out,
size_t *  out_used,
size_t *  out_alloc 
)
inline

Recode a C buffer to a different C buffer

References moot::mootRecoder::buffer2buffer().

◆ string2buffer() [1/2]

bool moot::mootXMLRecoder::string2buffer ( const char *  s,
char **  out,
size_t *  out_used,
size_t *  out_alloc 
)
inline

Recode a C string to a C buffer

◆ string2buffer() [2/2]

bool moot::mootXMLRecoder::string2buffer ( const std::string &  in,
char **  out,
size_t *  out_used,
size_t *  out_alloc 
)
inline

Recode an STL string to a C buffer

◆ buffer2string()

bool moot::mootXMLRecoder::buffer2string ( const char *  in,
size_t  in_size,
std::string &  out 
)
inline

Recode a C buffer to an STL string (append)

References moot::mootRecoder::buffer2buffer(), and moot::mootRecoder::buffer2string().

◆ string2string() [1/2]

bool moot::mootXMLRecoder::string2string ( const char *  s,
std::string &  out 
)
inline

Recode a C buffer to an STL string (append)

◆ string2string() [2/2]

bool moot::mootXMLRecoder::string2string ( const std::string &  in,
std::string &  out 
)
inline

Recode an STL string to an STL string (append)

◆ buffer2mstream()

bool moot::mootXMLRecoder::buffer2mstream ( const char *  in,
size_t  in_size,
mootio::mostream out 
)
inline

Recode a C buffer to an STL string (append)

References moot::mootRecoder::buffer2buffer(), and mootio::mostream::write().

◆ string2mstream() [1/2]

bool moot::mootXMLRecoder::string2mstream ( const char *  s,
mootio::mostream out 
)
inline

Recode a C buffer to an STL string (append)

◆ string2mstream() [2/2]

bool moot::mootXMLRecoder::string2mstream ( const std::string &  in,
mootio::mostream out 
)
inline

Recode an STL string to an STL string (append)

Member Data Documentation

◆ standalone

bool moot::mootXMLRecoder::standalone

◆ rc1

mootRecoder moot::mootXMLRecoder::rc1

◆ rc2

mootRecoder moot::mootXMLRecoder::rc2

◆ buf1

char* moot::mootXMLRecoder::buf1

◆ buf1_used

size_t moot::mootXMLRecoder::buf1_used

◆ buf1_alloc

size_t moot::mootXMLRecoder::buf1_alloc

◆ buf2

char* moot::mootXMLRecoder::buf2

◆ buf2_used

size_t moot::mootXMLRecoder::buf2_used

◆ buf2_alloc

size_t moot::mootXMLRecoder::buf2_alloc

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