cxxtools::iconvwrap Class Reference

Wraps iconv. More...

#include <cxxtools/iconvwrap.h>

Public Member Functions

 iconvwrap ()
 Create iconvwrap object.
 iconvwrap (const char *tocode, const char *fromcode)
 Create iconvwrap object and initializes it.
bool close ()
 Close iconvwrap object, release resouces.
bool convert (char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
 Recode input string into output buffer.
bool is_open ()
 Return true if IConv is open, false otherwise.
bool open (const char *tocode, const char *fromcode)
 (Re)initializes iconvwrap object.
 ~iconvwrap ()
 Destroy iconvwrap object.

Protected Attributes

iconv_t cd

Detailed Description

Wraps iconv.

Constructor & Destructor Documentation

cxxtools::iconvwrap::iconvwrap ( )

Create iconvwrap object.

cxxtools::iconvwrap::iconvwrap ( const char *  tocode,
const char *  fromcode 
)

Create iconvwrap object and initializes it.

Parameters
tocodedestination encoding name
fromcodesource encoding name
cxxtools::iconvwrap::~iconvwrap ( )

Destroy iconvwrap object.

Member Function Documentation

bool cxxtools::iconvwrap::close ( )

Close iconvwrap object, release resouces.

Returns
true on succes, otherwise return false and set errno.
bool cxxtools::iconvwrap::convert ( char **  inbuf,
size_t *  inbytesleft,
char **  outbuf,
size_t *  outbytesleft 
)

Recode input string into output buffer.

Parameters
inbuf
inbytesleft
outbuf
outbytesleft
Returns
true if all succesfully converted, on error returns false and se errno
bool cxxtools::iconvwrap::is_open ( )

Return true if IConv is open, false otherwise.

bool cxxtools::iconvwrap::open ( const char *  tocode,
const char *  fromcode 
)

(Re)initializes iconvwrap object.

Parameters
tocodetarget encoding name
fromcodesource encoding name
Returns
true on succes, on error return false and set errno

Member Data Documentation

iconv_t cxxtools::iconvwrap::cd
protected

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