ddc
List of all members
ddcIconv Class Reference

Interface to iconv.h character-conversion routines. More...

#include <ddcIconv.h>

Public Member Functions

Constructors etc.
 ddcIconv (const std::string &srcEncoding="", const std::string &dstEncoding="")
 
 ~ddcIconv (void)
 
Open/Close
bool empty (void) const
 
bool valid (void) const
 
bool good (void) const
 
bool open (const std::string &srcEncoding, const std::string dstEncoding)
 
bool close (void)
 
void reset (void)
 
Conversions
bool convert (const char *idata, const size_t ilen, string &out)
 
bool convert (const string &in, string &out)
 
std::string convert (const std::string &in)
 

Public Attributes

User-level data
string enc_src
 source encoding More...
 
string enc_dst
 destination encoding More...
 
Low-level data
iconv_t ic
 underlying iconv object More...
 
char ibuf [256]
 input buffer More...
 
char obuf [256]
 output buffer More...
 
pthread_mutex_t mut
 pthread mutex More...
 

Detailed Description

Interface to iconv.h character-conversion routines.

Constructor & Destructor Documentation

◆ ddcIconv()

ddcIconv::ddcIconv ( const std::string &  srcEncoding = "",
const std::string &  dstEncoding = "" 
)
inline

Default constructor, given optional source and destination encodings

References PTOP.

◆ ~ddcIconv()

ddcIconv::~ddcIconv ( void  )
inline

Default destructor

References PTOP.

Member Function Documentation

◆ empty()

bool ddcIconv::empty ( void  ) const
inline

Check whether selected conversion is a null-op.

◆ valid()

bool ddcIconv::valid ( void  ) const
inline

Check whether selected converter is valid.

◆ good()

bool ddcIconv::good ( void  ) const
inline

Check whether selected converter is a either valid or a null-op

Referenced by CLemmatizer::initIconv().

Here is the caller graph for this function:

◆ open()

bool ddcIconv::open ( const std::string &  srcEncoding,
const std::string  dstEncoding 
)
inline

Open a (new) encoding. Either srcEncoding or dstEncoding may be empty or "-", indicating a null-op.

References PTOP.

◆ close()

bool ddcIconv::close ( void  )
inline

Close a conversion. Should be ok to call more than once

References PTOP.

◆ reset()

void ddcIconv::reset ( void  )
inline

Reset converter state (should already have mut lock in threaded applications)

◆ convert() [1/3]

bool ddcIconv::convert ( const char *  idata,
const size_t  ilen,
string &  out 
)
inline

Perform selected conversion from in to out (low-level)

References DDC_ICONV_BUFLEN, and PTOP.

Referenced by CQueryTokenNode::BuildRegExp(), CStringIndexSet::QueryTokenListUsingRegExp(), CLemmatizer::recode_ext2int(), and CLemmatizer::recode_int2ext().

Here is the caller graph for this function:

◆ convert() [2/3]

bool ddcIconv::convert ( const string &  in,
string &  out 
)
inline

Perform selected conversion from in to out

◆ convert() [3/3]

std::string ddcIconv::convert ( const std::string &  in)
inline

Perform selected conversion from in to a (new) string

Member Data Documentation

◆ enc_src

string ddcIconv::enc_src

source encoding

◆ enc_dst

string ddcIconv::enc_dst

destination encoding

◆ ic

iconv_t ddcIconv::ic

underlying iconv object

◆ ibuf

char ddcIconv::ibuf[256]

input buffer

◆ obuf

char ddcIconv::obuf[256]

output buffer

◆ mut

pthread_mutex_t ddcIconv::mut

pthread mutex


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