aboutsummaryrefslogtreecommitdiff
path: root/src/old/tests/fstring.cpp
blob: 271738c8e25a06f79a455d332165724c63249230 (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
40
41
42
43
44
45
46
47
48
#include "hash.h"
#include "fstring.h"

FString genThing()
{
	FString bob;
	bob.append("ab ");
	bob += "cd ";
	bob += "efg";

    printf("---bob------\n%08X: %s\n", (unsigned int)bob.c_str(), bob.c_str() );
	return bob;
}

void thing( FString str )
{
	printf("Hey:  %s\n", str.c_str() );
}

#define pem printf("---------\n%08X: %s\n%08X: %s\n", (unsigned int)str.c_str(), str.c_str(), (unsigned int)str2.c_str(), str2.c_str() );
int main( int argc, char *argv )
{
	FString str("th");

	str.prepend("Hello ");
	str.append("ere.");

	FString str2( str );
	pem;
	str += "  What's up?";
	pem;
	str2 += "  How are you?";
	pem;
	str = str2;
	pem;

	str2 = genThing();
	pem;

	str = str2;
	pem;

	thing( str2 );
	thing("test.");
	
	printf("%d == %d\n", __calcHashCode( str ), __calcHashCode( str.c_str() ) );
}