ultimatepp/tutorial/Core05/Core05.cpp
mdelfede d2b54f7989 changed svn layout
git-svn-id: svn://ultimatepp.org/upp/trunk@281 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-06-07 22:31:27 +00:00

40 lines
663 B
C++

#include <Core/Core.h>
using namespace Upp;
struct BinFoo {
int x;
String ToString() const { return FormatIntBase(x, 2); }
BinFoo(int x) : x(x) {}
};
struct RomanFoo {
int x;
RomanFoo(int x) : x(x) {}
};
namespace Upp {
template <> String AsString(const RomanFoo& a) { return FormatIntRoman(a.x); }
};
CONSOLE_APP_MAIN
{
FileOut fout(ConfigFile("test.txt"));
String sout;
fout << 1.23 << ' ' << GetSysDate() << ' ' << GetSysTime();
sout << 1.23 << ' ' << GetSysDate() << ' ' << GetSysTime();
DUMP(sout);
sout.Clear();
fout << '\n';
sout << BinFoo(30) << ' ' << RomanFoo(30);
fout << BinFoo(30) << ' ' << RomanFoo(30);
DUMP(sout);
}