aboutsummaryrefslogtreecommitdiff
path: root/src/test/serialize/serialize.cpp
blob: e2337046bea09f3d0c98a5f1225512c9d7593b2a (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
#include "serializerbinary.h"
#include "staticstring.h"
#include <stdio.h>
#include <string>

int main()
{
	int32_t one;
	double two;
	bool three;
	StaticString s("Test string!");
	std::string ss("Another test string");
	SerializerBinary ar("hello.dat", false);
	ar << (int)85;
	ar << (double)2.63434;
	ar << false;
	ar << ss;
	ar.close();

	one = 0; two = 0; three = true; s = "die";
	
	SerializerBinary ar2("hello.dat", true);
	ar2 >> one;
	ar2 >> two;
	ar2 >> three;
	ar2 >> s;

	printf("we got %d - %f - %s - \"%s\"\n", one, two, (three ? "true":"false"), s.getString() );
	return 0;
}