]> git.lyx.org Git - lyx.git/blob - src/support/strfwd.h
324560952fd4bb4cbb5e52b6ffa32f28d8041ad7
[lyx.git] / src / support / strfwd.h
1 // -*- C++ -*-
2
3 // Heavily inspired by /usr/include/c++/4.1/bits
4 //
5 // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
6 //
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)
11 // any later version.
12
13 #ifndef STRFWD_H
14 #define STRFWD_H
15
16 #ifdef USE_WCHAR_T
17
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; }
23
24 #else
25
26 #include <boost/cstdint.hpp>
27 namespace lyx { typedef boost::uint32_t char_type; }
28
29 #endif
30
31
32 namespace std {
33
34 template<typename Char> struct char_traits;
35 template<> struct char_traits<char>;
36 template<> struct char_traits<lyx::char_type>;
37
38 template<typename Alloc> class allocator;
39
40 template<typename Char, typename Traits, typename Alloc> class basic_string;
41
42 typedef basic_string<char, char_traits<char>, allocator<char> > string;
43
44 template<class Char, class Traits> class basic_istream;
45 template<class Char, class Traits> class basic_ostream;
46
47 typedef basic_istream<char, char_traits<char> > istream;
48 typedef basic_ostream<char, char_traits<char> > ostream;
49
50 }
51
52
53 namespace lyx {
54
55 typedef std::basic_string<char_type, std::char_traits<char_type>,
56         std::allocator<char_type> > docstring;
57
58 /// Base class for UCS4 input streams
59 typedef std::basic_istream<char_type, std::char_traits<char_type> >
60         idocstream;
61
62 /// Base class for UCS4 output streams
63 typedef std::basic_ostream<char_type, std::char_traits<char_type> >
64         odocstream;
65
66
67 } // namespace lyx
68
69 #endif