3 // Heavily inspired by /usr/include/c++/4.1/bits
5 // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
7 // This file is part of the GNU ISO C++ Library. This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 2, or (at your option)
16 // This includes does nothing but defining _LIBCPP_VERSION
17 // if libc++ is used (rather than libstdc++) - we first
18 // check if we have at least a c++03 standard before
20 #if (__cplusplus > 199711L)
26 // Prefer this if possible because GNU libstdc++ has usable
27 // std::ctype<wchar_t> locale facets but not
28 // std::ctype<boost::uint32_t>. gcc older than 3.4 is also missing
29 // usable std::char_traits<boost::uint32_t>.
30 namespace lyx { typedef wchar_t char_type; }
34 #include <boost/cstdint.hpp>
35 namespace lyx { typedef boost::uint32_t char_type; }
39 // Forward definitions do not work with libc++
40 #ifdef _LIBCPP_VERSION
46 template<typename Alloc> class allocator;
48 template<typename Char> struct char_traits;
49 template<> struct char_traits<char>;
51 template<> struct char_traits<wchar_t>;
54 template<typename Char, typename Traits, typename Alloc> class basic_string;
55 typedef basic_string<char, char_traits<char>, allocator<char> > string;
57 template<class Char, class Traits> class basic_istream;
58 template<class Char, class Traits> class basic_ostream;
59 template<class Char, class Traits, class Allocator> class basic_ostringstream;
61 typedef basic_istream<char, char_traits<char> > istream;
62 typedef basic_ostream<char, char_traits<char> > ostream;
63 typedef basic_ostringstream<char, char_traits<char>, allocator<char> > ostringstream;
72 * String type for storing the main text in UCS4 encoding.
73 * Use std::string only in cases 7-bit ASCII is to be manipulated
74 * within the variable.
76 typedef std::basic_string<char_type, std::char_traits<char_type>,
77 std::allocator<char_type> > docstring;
79 /// Base class for UCS4 input streams
80 typedef std::basic_istream<char_type, std::char_traits<char_type> > idocstream;
82 /// Base class for UCS4 output streams
83 typedef std::basic_ostream<char_type, std::char_traits<char_type> > odocstream;
85 /// UCS4 output stringstream
86 typedef std::basic_ostringstream<char_type, std::char_traits<char_type>, std::allocator<char_type> > odocstringstream;
88 #if ! defined(USE_WCHAR_T)
89 extern odocstream & operator<<(odocstream &, char);
92 // defined in lstrings.cpp
93 docstring const & empty_docstring();
94 std::string const & empty_string();
95 // defined in docstring.cpp
96 bool operator==(docstring const &, char const *);