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)
18 // Prefer this if possible because GNU libstdc++ has usable
19 // std::ctype<wchar_t> locale facets but not
20 // std::ctype<boost::uint32_t>. gcc older than 3.4 is also missing
21 // usable std::char_traits<boost::uint32_t>.
22 namespace lyx { typedef wchar_t char_type; }
28 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
29 namespace lyx { typedef uint32_t char_type; }
30 #include "support/numpunct_lyx_char_type.h" // implementation for our char_type needed
32 namespace lyx { typedef std::uint32_t char_type; }
37 // Forward definitions do not work with libc++
38 // For gcc5 with the new std::string ABI forward declarations would work in
39 // principle, but I am not sure whether we want non-standard
40 // "namespace __cxx11" in our sources.
41 #if defined(USE_LLVM_LIBCPP) || defined(USE_GLIBCXX_CXX11_ABI)
47 template<typename Alloc> class allocator;
49 template<typename Char> struct char_traits;
50 template<> struct char_traits<char>;
52 template<> struct char_traits<wchar_t>;
55 template<typename Char, typename Traits, typename Alloc> class basic_string;
56 typedef basic_string<char, char_traits<char>, allocator<char> > string;
58 template<class Char, class Traits> class basic_istream;
59 template<class Char, class Traits> class basic_ostream;
60 template<class Char, class Traits, class Allocator> class basic_ostringstream;
62 typedef basic_istream<char, char_traits<char> > istream;
63 typedef basic_ostream<char, char_traits<char> > ostream;
64 typedef basic_ostringstream<char, char_traits<char>, allocator<char> > ostringstream;
77 * String type for storing the main text in UCS4 encoding.
78 * Use std::string only in cases 7-bit ASCII is to be manipulated
79 * within the variable.
81 typedef std::basic_string<char_type, std::char_traits<char_type>,
82 std::allocator<char_type> > docstring;
84 /// Base class for UCS4 input streams
85 typedef std::basic_istream<char_type, std::char_traits<char_type> > idocstream;
87 /// Base class for UCS4 output streams
88 typedef std::basic_ostream<char_type, std::char_traits<char_type> > odocstream;
90 /// UCS4 output stringstream
91 typedef std::basic_ostringstream<char_type, std::char_traits<char_type>, std::allocator<char_type> > odocstringstream;
93 #if ! defined(USE_WCHAR_T)
94 extern odocstream & operator<<(odocstream &, char);
97 // defined in lstrings.cpp
98 docstring const & empty_docstring();
99 std::string const & empty_string();
100 // defined in docstring.cpp
101 bool operator==(docstring const &, char const *);
103 #ifdef STD_STRING_USES_COW
104 template<typename Char> class trivial_string;
105 typedef trivial_string<char> trivstring;
106 typedef trivial_string<char_type> trivdocstring;
108 typedef std::string trivstring;
109 typedef docstring trivdocstring;