cxxtools::iconvstream Class Reference

std::ostream-Interface for iconv(3) and related. More...

#include <cxxtools/iconvstream.h>

Public Member Functions

 iconvstream (std::ostream &sink, const char *tocode, const char *fromcode)
 iconvstream (std::ostream &sink, const char *tocode, const char *fromcode, iconvstreambuf::mode_t mode)
 iconvstream ()
void open (std::ostream &sink_, const char *tocode, const char *fromcode)
void open (std::ostream &sink_, const char *tocode, const char *fromcode, iconvstreambuf::mode_t mode_)
void close () throw ()

Detailed Description

std::ostream-Interface for iconv(3) and related.

iconv converts charactersets.

To perform a character set conversion from one characterset to another, instantiate a iconvstream with a std::ostream as a sink. Write the data to the iconvstream and the converted stream is written to the sink.

example (unix2win-filter):

int main(int argc, char* argv[])
{
cxxtools::iconvstream out(std::cout, "LATIN1", "WINDOWS-1251");
// copy input to output:
out << std::cin.rdbuf();
}

Constructor & Destructor Documentation

cxxtools::iconvstream::iconvstream ( std::ostream &  sink,
const char *  tocode,
const char *  fromcode 
)
inline
cxxtools::iconvstream::iconvstream ( std::ostream &  sink,
const char *  tocode,
const char *  fromcode,
iconvstreambuf::mode_t  mode 
)
inline
cxxtools::iconvstream::iconvstream ( )
inline

Member Function Documentation

void cxxtools::iconvstream::close ( ) throw ()
inline
void cxxtools::iconvstream::open ( std::ostream &  sink_,
const char *  tocode,
const char *  fromcode 
)
void cxxtools::iconvstream::open ( std::ostream &  sink_,
const char *  tocode,
const char *  fromcode,
iconvstreambuf::mode_t  mode_ 
)

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