X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fprint.h;h=10fb02eedba2f11ff2ad9417c8daa1adb576012e;hp=16f92258d2ee3ad0259185dcf7b65bfbb492e7d9;hb=33a5613489bbb9d4eab5c8761af88f4c1352aad4;hpb=5ed3d4f2ff489d02661aaabb24d4182f76499926 diff --git a/source/print.h b/source/print.h index 16f9225..10fb02e 100644 --- a/source/print.h +++ b/source/print.h @@ -10,6 +10,7 @@ Distributed under the LGPL #include #include "base.h" +#include "console.h" namespace Msp { namespace IO { @@ -23,23 +24,48 @@ inline unsigned print(Base &o, const std::string &f) template inline unsigned print(Base &o, const std::string &f, A1 a1) -{ return o.write(format(f, a1)); } +{ return print(o, format(f, a1)); } template inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2) -{ return o.write(format(f, a1, a2)); } +{ return print(o, format(f, a1, a2)); } template inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2, A3 a3) -{ return o.write(format(f, a1, a2, a3)); } +{ return print(o, format(f, a1, a2, a3)); } template inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4) -{ return o.write(format(f, a1, a2, a3, a4)); } +{ return print(o, format(f, a1, a2, a3, a4)); } template inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -{ return o.write(format(f, a1, a2, a3, a4, a5)); } +{ return print(o, format(f, a1, a2, a3, a4, a5)); } + +/* The following functions print to console */ + +inline unsigned print(const std::string &f) +{ return print(cout, f); } + +template +inline unsigned print(const std::string &f, A1 a1) +{ return print(cout, f, a1); } + +template +inline unsigned print(const std::string &f, A1 a1, A2 a2) +{ return print(cout, f, a1, a2); } + +template +inline unsigned print(const std::string &f, A1 a1, A2 a2, A3 a3) +{ return print(cout, f, a1, a2, a3); } + +template +inline unsigned print(const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4) +{ return print(cout, f, a1, a2, a3, a4); } + +template +inline unsigned print(const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) +{ return print(cout, f, a1, a2, a3, a4, a5); } } // namespace IO } // namespace Msp