3 This file is part of libmspio
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_IO_PRINT_H_
9 #define MSP_IO_PRINT_H_
11 #include <msp/strings/formatter.h>
19 Writes a string to an I/O object. Same as o.write(f). Provided for
20 completeness with the other print functions.
22 inline unsigned print(Base &o, const std::string &f)
23 { return o.write(f); }
26 inline unsigned print(Base &o, const std::string &f, A1 a1)
27 { return print(o, format(f, a1)); }
29 template<typename A1, typename A2>
30 inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2)
31 { return print(o, format(f, a1, a2)); }
33 template<typename A1, typename A2, typename A3>
34 inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2, A3 a3)
35 { return print(o, format(f, a1, a2, a3)); }
37 template<typename A1, typename A2, typename A3, typename A4>
38 inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4)
39 { return print(o, format(f, a1, a2, a3, a4)); }
41 template<typename A1, typename A2, typename A3, typename A4, typename A5>
42 inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
43 { return print(o, format(f, a1, a2, a3, a4, a5)); }
45 /* The following functions print to console */
47 inline unsigned print(const std::string &f)
48 { return print(cout, f); }
51 inline unsigned print(const std::string &f, A1 a1)
52 { return print(cout, f, a1); }
54 template<typename A1, typename A2>
55 inline unsigned print(const std::string &f, A1 a1, A2 a2)
56 { return print(cout, f, a1, a2); }
58 template<typename A1, typename A2, typename A3>
59 inline unsigned print(const std::string &f, A1 a1, A2 a2, A3 a3)
60 { return print(cout, f, a1, a2, a3); }
62 template<typename A1, typename A2, typename A3, typename A4>
63 inline unsigned print(const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4)
64 { return print(cout, f, a1, a2, a3, a4); }
66 template<typename A1, typename A2, typename A3, typename A4, typename A5>
67 inline unsigned print(const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
68 { return print(cout, f, a1, a2, a3, a4, a5); }