#include "../array.h" #include "../text.h" #include "time.h" void main() { clock_t tic = clock(); text * sometext = new text(" my first text"); struct text a = new text(" Mooi "); for ( int i = 0; i < 100; ++i ) { sometext->appendObject( a )->append("something")->appendObject( new text(" and this") ); } printf("append: %s \n\n", sometext->buffer); clock_t toc = clock(); printf("Multiply: %f seconds\n", (double)( toc - tic ) / CLOCKS_PER_SEC); char * testText = "a,"; array * splitParts = testText->concatenate( "b, " )->concatenate("c,d,e")->concatenate(",f ")->split(",g"); char * compareString = "something"; splitParts.unshift((char *) "first"); splitParts.unshift((char *) "this first"); printf( "joined: %s\n\n", splitParts.join(", ") ); char * lastElement = splitParts->pop(); printf( "pop joined: %s\n\n", splitParts.join(", ") ); printf( "pop removed element: %s\n\n", lastElement ); if( compareString.compare("something") ) { printf("this is true\n"); } else { printf("this is not true\n"); } printf("first: %s \n\n", splitParts.get( 0 ) ); int splitCount = splitParts->length(); printf("splitCount: %i\n", splitCount); for (int i = 0; i < splitCount; ++i) { char * splitPart = splitParts.get( i ); //printf("splitPart: %s \n\n", splitPart->trim() ); } }