4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef LYX_DOCSTREAM_H
13 #define LYX_DOCSTREAM_H
15 #include "support/docstring.h"
22 /// Base class for UCS4 input streams
23 typedef std::basic_istream<char_type> idocstream;
25 /** Base class for UCS4 output streams.
26 If you want to output a single UCS4 character, use \code
30 \endcode . The latter will not output the character, but the code point
31 as number. This is because we can't overload operator<< (our character
32 type is not a real type but a typedef). Narrow characters of type char
33 can be output as usual.
35 typedef std::basic_ostream<char_type> odocstream;
37 /// File stream for reading UTF8-encoded files with automatic conversion to
39 class idocfstream : public std::basic_ifstream<char_type> {
40 typedef std::basic_ifstream<char_type> base;
43 explicit idocfstream(const char* s,
44 std::ios_base::openmode mode = std::ios_base::in);
48 /// File stream for writing UTF8-encoded files with automatic conversion from
50 class odocfstream : public std::basic_ofstream<char_type> {
51 typedef std::basic_ofstream<char_type> base;
54 explicit odocfstream(const char* s,
55 std::ios_base::openmode mode = std::ios_base::out|std::ios_base::trunc);
59 /// UCS4 input stringstream
60 typedef std::basic_istringstream<char_type> idocstringstream;
62 /// UCS4 output stringstream
63 typedef std::basic_ostringstream<char_type> odocstringstream;
66 odocstream & operator<<(odocstream & os, char c)