Loading src/Examples/CMakeLists.txt +13 −6 Original line number Diff line number Diff line Loading @@ -29,23 +29,30 @@ ADD_EXECUTABLE( MathExample MathExample.cpp ) ADD_EXECUTABLE( ParameterContainerExample ParameterContainerExample.cpp ) ADD_EXECUTABLE( StringExample StringExample.cpp ) EXECUTE_PROCESS( COMMAND StringExample OUTPUT_FILE StringExample.out ) ADD_CUSTOM_COMMAND( COMMAND StringExample > StringExample.out OUTPUT StringExample.out ) ADD_EXECUTABLE( StringExampleGetAllocatedSize StringExampleGetAllocatedSize.cpp ) EXECUTE_PROCESS( COMMAND StringExampleGetAllocatedSize OUTPUT_FILE StringExampleGetAllocatedSize.out ) ADD_CUSTOM_COMMAND( COMMAND StringExampleGetAllocatedSize > StringExampleGetAllocatedSize.out OUTPUT StringExampleGetAllocatedSize.out ) ADD_EXECUTABLE( StringExampleReplace StringExampleReplace.cpp ) EXECUTE_PROCESS( COMMAND StringExampleReplace OUTPUT_FILE StringExampleReplace.out ) ADD_CUSTOM_COMMAND( COMMAND StringExampleReplace > StringExampleReplace.out OUTPUT StringExampleReplace.out ) ADD_EXECUTABLE( StringExampleSetSize StringExampleSetSize.cpp ) EXECUTE_PROCESS( COMMAND StringExampleSetSize OUTPUT_FILE StringExampleSetSize.out ) ADD_CUSTOM_COMMAND( COMMAND StringExampleSetSize > StringExampleSetSize.out OUTPUT StringExampleSetSize.out ) ADD_EXECUTABLE( StringExampleSplit StringExampleSplit.cpp ) EXECUTE_PROCESS( COMMAND StringExampleSpli OUTPUT_FILE StringExampleSplit.out ) ADD_CUSTOM_COMMAND( COMMAND StringExampleSplit > StringExampleSplit.out OUTPUT StringExampleSplit.out ) ADD_EXECUTABLE( StringExampleStrip StringExampleStrip.cpp ) EXECUTE_PROCESS( COMMAND StringExampleStrip OUTPUT_FILE StringExampleStrip.out ) ADD_CUSTOM_COMMAND( COMMAND StringExampleStrip > StringExampleStrip.out OUTPUT StringExampleStrip.out ) ADD_EXECUTABLE( TimerExample TimerExample.cpp ) ADD_EXECUTABLE( VectorExample VectorExample.cpp ) ADD_CUSTOM_TARGET( run ALL DEPENDS StringExample.out StringExampleGetAllocatedSize.out StringExampleReplace.out StringExampleSplit.out StringExampleStrip.out ) src/Examples/StringExample.cpp +1 −11 Original line number Diff line number Diff line Loading @@ -45,14 +45,4 @@ int main( int argc, char* argv[] ) cout << "emptyString is empty" << endl; if( string1 ) cout << "string1 is not empty" << endl; // save File myFile; myFile << String("Header"); // saves "Header" into myFile // load String strg; myFile >> strg; cout << "strg:" << strg << endl; } src/Examples/StringExampleSplit.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ int main() String cars("Subaru,Mazda,,Skoda," ); vector< String > list3 = cars.split(',', String::SkipEmpty ); cout << "split with true:" << list3[0] << ", " << list3[1] << ", " << list3[2] << endl; cout << "split with String::SkipEmpty = " << list3[0] << ", " << list3[1] << ", " << list3[2] << endl; std::vector<String> list5 = cars.split(','); cout << "split with false:" << list5[0] << ", " << list5[1] << ", " << list5[2] << ", " << list5[3] << endl; cout << "split without String::SkipEmpty = " << list5[0] << ", " << list5[1] << ", " << list5[2] << ", " << list5[3] << endl; } No newline at end of file src/Examples/StringExampleStrip.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,6 @@ int main() { String names( " Josh Martin John Marley Charles " ); String names2( ".......Josh Martin...John..Marley.Charles..." ); cout << "better_names:" << names.strip() << endl; cout << "better_names:" << names.strip( '.' ) << endl; cout << "names strip is: " << names.strip() << endl; cout << "names2 strip is: " << names.strip( '.' ) << endl; } No newline at end of file Loading
src/Examples/CMakeLists.txt +13 −6 Original line number Diff line number Diff line Loading @@ -29,23 +29,30 @@ ADD_EXECUTABLE( MathExample MathExample.cpp ) ADD_EXECUTABLE( ParameterContainerExample ParameterContainerExample.cpp ) ADD_EXECUTABLE( StringExample StringExample.cpp ) EXECUTE_PROCESS( COMMAND StringExample OUTPUT_FILE StringExample.out ) ADD_CUSTOM_COMMAND( COMMAND StringExample > StringExample.out OUTPUT StringExample.out ) ADD_EXECUTABLE( StringExampleGetAllocatedSize StringExampleGetAllocatedSize.cpp ) EXECUTE_PROCESS( COMMAND StringExampleGetAllocatedSize OUTPUT_FILE StringExampleGetAllocatedSize.out ) ADD_CUSTOM_COMMAND( COMMAND StringExampleGetAllocatedSize > StringExampleGetAllocatedSize.out OUTPUT StringExampleGetAllocatedSize.out ) ADD_EXECUTABLE( StringExampleReplace StringExampleReplace.cpp ) EXECUTE_PROCESS( COMMAND StringExampleReplace OUTPUT_FILE StringExampleReplace.out ) ADD_CUSTOM_COMMAND( COMMAND StringExampleReplace > StringExampleReplace.out OUTPUT StringExampleReplace.out ) ADD_EXECUTABLE( StringExampleSetSize StringExampleSetSize.cpp ) EXECUTE_PROCESS( COMMAND StringExampleSetSize OUTPUT_FILE StringExampleSetSize.out ) ADD_CUSTOM_COMMAND( COMMAND StringExampleSetSize > StringExampleSetSize.out OUTPUT StringExampleSetSize.out ) ADD_EXECUTABLE( StringExampleSplit StringExampleSplit.cpp ) EXECUTE_PROCESS( COMMAND StringExampleSpli OUTPUT_FILE StringExampleSplit.out ) ADD_CUSTOM_COMMAND( COMMAND StringExampleSplit > StringExampleSplit.out OUTPUT StringExampleSplit.out ) ADD_EXECUTABLE( StringExampleStrip StringExampleStrip.cpp ) EXECUTE_PROCESS( COMMAND StringExampleStrip OUTPUT_FILE StringExampleStrip.out ) ADD_CUSTOM_COMMAND( COMMAND StringExampleStrip > StringExampleStrip.out OUTPUT StringExampleStrip.out ) ADD_EXECUTABLE( TimerExample TimerExample.cpp ) ADD_EXECUTABLE( VectorExample VectorExample.cpp ) ADD_CUSTOM_TARGET( run ALL DEPENDS StringExample.out StringExampleGetAllocatedSize.out StringExampleReplace.out StringExampleSplit.out StringExampleStrip.out )
src/Examples/StringExample.cpp +1 −11 Original line number Diff line number Diff line Loading @@ -45,14 +45,4 @@ int main( int argc, char* argv[] ) cout << "emptyString is empty" << endl; if( string1 ) cout << "string1 is not empty" << endl; // save File myFile; myFile << String("Header"); // saves "Header" into myFile // load String strg; myFile >> strg; cout << "strg:" << strg << endl; }
src/Examples/StringExampleSplit.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ int main() String cars("Subaru,Mazda,,Skoda," ); vector< String > list3 = cars.split(',', String::SkipEmpty ); cout << "split with true:" << list3[0] << ", " << list3[1] << ", " << list3[2] << endl; cout << "split with String::SkipEmpty = " << list3[0] << ", " << list3[1] << ", " << list3[2] << endl; std::vector<String> list5 = cars.split(','); cout << "split with false:" << list5[0] << ", " << list5[1] << ", " << list5[2] << ", " << list5[3] << endl; cout << "split without String::SkipEmpty = " << list5[0] << ", " << list5[1] << ", " << list5[2] << ", " << list5[3] << endl; } No newline at end of file
src/Examples/StringExampleStrip.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,6 @@ int main() { String names( " Josh Martin John Marley Charles " ); String names2( ".......Josh Martin...John..Marley.Charles..." ); cout << "better_names:" << names.strip() << endl; cout << "better_names:" << names.strip( '.' ) << endl; cout << "names strip is: " << names.strip() << endl; cout << "names2 strip is: " << names.strip( '.' ) << endl; } No newline at end of file