Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

iconvstream Class Reference

#include <cxxtools/iconvstream.h>

List of all members.

Public Member Functions

 iconvstream (std::ostream &sink, const char *tocode, const char *fromcode)
void open (std::ostream &sink_, const char *tocode, const char *fromcode)
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();
    }

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6