]> git.lyx.org Git - lyx.git/blob - boost/boost/format/format_fwd.hpp
Boost 1.31.0
[lyx.git] / boost / boost / format / format_fwd.hpp
1 // -*- C++ -*-
2 //  Boost general library 'format'   ---------------------------
3 //  See http://www.boost.org for updates, documentation, and revision history.
4
5 //  (C) Samuel Krempp 2001
6 //  Permission to copy, use, modify, sell and
7 //  distribute this software is granted provided this copyright notice appears
8 //  in all copies. This software is provided "as is" without express or implied
9 //  warranty, and with no claim as to its suitability for any purpose.
10
11 // ideas taken from RĂ¼diger Loos's format class
12 // and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
13
14 // ------------------------------------------------------------------------------
15 // format_fwd.hpp :  forward declarations, for primary header format.hpp
16 // ------------------------------------------------------------------------------
17
18 #ifndef BOOST_FORMAT_FWD_HPP
19 #define BOOST_FORMAT_FWD_HPP
20
21 #include <string>
22 #include <iosfwd>
23
24 #include <boost/format/detail/config_macros.hpp> 
25
26 namespace boost {
27
28     template <class Ch, 
29 #if !( BOOST_WORKAROUND(__GNUC__, <3) &&  defined(__STL_CONFIG_H) )
30         class Tr = BOOST_IO_STD char_traits<Ch> > 
31 #else
32     class Tr = std::string_char_traits<Ch> > 
33 #endif
34     class basic_format;
35
36     typedef basic_format<char >     format;
37
38
39 #if !defined(BOOST_NO_STD_WSTRING)  && !defined(BOOST_NO_STD_WSTREAMBUF) \
40  && !defined(BOOST_NO_STRINGSTREAM) && !defined(BOOST_FORMAT_IGNORE_STRINGSTREAM)
41     //we use either sstream or strstream, and strstream doesnt support wchar
42     typedef basic_format<wchar_t >  wformat;
43 #endif
44
45     template<class Ch, class Tr> 
46     std::basic_string<Ch, Tr>     str(const basic_format<Ch, Tr>& ) ;
47
48 namespace io {
49     using ::boost::str; // it used to bed define in boost::io, keep compatibility 
50
51     enum format_error_bits { bad_format_string_bit = 1, 
52                              too_few_args_bit = 2, too_many_args_bit = 4,
53                              out_of_range_bit = 8,
54                              all_error_bits = 255, no_error_bits=0 };
55                   
56 } // namespace io
57
58
59     template< class Ch, class Tr> 
60     BOOST_IO_STD basic_ostream<Ch, Tr>& 
61     operator<<( BOOST_IO_STD basic_ostream<Ch, Tr>&, const basic_format<Ch, Tr>&);
62
63
64 } // namespace boost
65
66 #endif // BOOST_FORMAT_FWD_HPP