summaryrefslogtreecommitdiff
path: root/src/tests/stdstream.cpp
blob: 3aa9005782151e51d904846eaca388880f889ef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright (C) 2007-2008 Xagasoft, All rights reserved.
 *
 * This file is part of the libbu++ library and is released under the
 * terms of the license contained in the file LICENSE.
 */

#include "bu/sio.h"

using Bu::sio;
using Bu::Fmt;

int main()
{
	sio << "Hello there" << sio.nl;

	sio << "sizeof(Fmt) = " << sizeof(Fmt) << sio.nl;

	sio << -123 << ", " << 0 << ", " << 123 << sio.nl;

	sio << "+----------+" << sio.nl;
	sio << "|" << Fmt( 10, 10, Fmt::Center ) << "Test" << "|" << sio.nl;
	sio << "+----------+" << sio.nl;
	sio << "|" << Fmt( 10, 10, Fmt::Left ) << 123 << "|" << sio.nl;
	sio << "|" << Fmt( 10, 10, Fmt::Center ) << 123 << "|" << sio.nl;
	sio << "|" << Fmt( 10, 10, Fmt::Right ) << 123 << "|" << sio.nl;
	sio << "+----------+" << sio.nl;

	sio << Fmt(10,Fmt::Left) << "Hexcode:" << Fmt::ptr() << (&sio) << sio.nl;

	sio << 0.123 << sio.nl;
	sio << true << " and then " << false << sio.nl;

	for( int j = 2; j <= 36; j++ )
		sio << "radix(" << j << ") = " << Fmt().radix( j ).width( 8 ).align( Fmt::Right ) << 255 << sio.nl;

	return 0;
}