about summary refs log tree commit diff
path: root/boost/format/format_fwd.hpp
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-06-27T13·41+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-06-27T13·41+0000
commitbb03c45ca03e038c8b74fc1410f48d02ade4c59b (patch)
tree131afdf9d4b308e4d1fff6089f2ab1923c862e02 /boost/format/format_fwd.hpp
parentd4c3edfaba91a0e5e1e9528749e5b1e178511a6d (diff)
* Added the Boost format library which provides a safe printf
  replacement.

Diffstat (limited to 'boost/format/format_fwd.hpp')
-rw-r--r--boost/format/format_fwd.hpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/boost/format/format_fwd.hpp b/boost/format/format_fwd.hpp
new file mode 100644
index 000000000000..bad2f7238537
--- /dev/null
+++ b/boost/format/format_fwd.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+//  Boost general library 'format'   ---------------------------
+//  See http://www.boost.org for updates, documentation, and revision history.
+
+//  (C) Samuel Krempp 2001
+//                  krempp@crans.ens-cachan.fr
+//  Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// ideas taken from Rüdiger Loos's format class
+// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
+
+// ------------------------------------------------------------------------------
+// format_fwd.hpp :  forward declarations, for primary header format.hpp
+// ------------------------------------------------------------------------------
+
+#ifndef BOOST_FORMAT_FWD_HPP
+#define BOOST_FORMAT_FWD_HPP
+
+#include <string>
+#include <iosfwd>
+
+namespace boost {
+
+template<class charT, class Traits = BOOST_IO_STD char_traits<charT> > class basic_format;
+
+typedef basic_format<char >     format;
+
+#if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_STD_WSTREAMBUF)
+typedef basic_format<wchar_t >  wformat;
+#endif
+
+namespace io {
+enum format_error_bits { bad_format_string_bit = 1, 
+                         too_few_args_bit = 2, too_many_args_bit = 4,
+                         out_of_range_bit = 8,
+                         all_error_bits = 255, no_error_bits=0 };
+                  
+// Convertion:  format   to   string
+template<class Ch, class Tr> 
+std::basic_string<Ch, Tr>     str(const basic_format<Ch, Tr>& ) ;
+
+} // namespace io
+
+
+template< class Ch, class Tr> 
+BOOST_IO_STD basic_ostream<Ch, Tr>& 
+operator<<( BOOST_IO_STD basic_ostream<Ch, Tr>&, const basic_format<Ch, Tr>&);
+
+
+} // namespace boost
+
+#endif // BOOST_FORMAT_FWD_HPP