- Timestamp:
- 05/20/09 23:15:05 (16 years ago)
- Location:
- tests/UI
- Files:
-
- 1 modified
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/UI/CMakeLists.txt
r278 r345 1 EXEC( UIbuilder_test)1 EXEC(testUI) -
tests/UI/testUI.cfg
r344 r345 23 23 }; 24 24 elisky : "jardovo"; 25 kati : "skubankovo@ UIbuilder_test_ex.cfg";25 kati : "skubankovo@testUI_ex.cfg"; -
tests/UI/testUI.cpp
r344 r345 1 #include <u ibuilder.h>1 #include <user_info.h> 2 2 #include <string> 3 3 … … 23 23 } 24 24 25 virtual void FromSetting( const Setting &root )25 virtual void from_setting( const Setting &root ) 26 26 { 27 27 root.lookupValue( "year", year ); … … 29 29 } 30 30 31 virtual void ToSetting( Setting &root )31 virtual void to_setting( Setting &root ) 32 32 { 33 33 Setting &year_setting = root.add("year", Setting::TypeInt ); … … 55 55 } 56 56 57 virtual void FromSetting( const Setting &root )57 virtual void from_setting( const Setting &root ) 58 58 { 59 Transport:: FromSetting( root );59 Transport::from_setting( root ); 60 60 61 61 root.lookupValue( "kilometers", kilometers ); 62 62 } 63 63 64 virtual void ToSetting( Setting &root )64 virtual void to_setting( Setting &root ) 65 65 { 66 Transport:: ToSetting( root );66 Transport::to_setting( root ); 67 67 68 68 Setting &kilometers_setting = root.add("kilometers", Setting::TypeInt ); … … 100 100 } 101 101 102 void FromSetting( const Setting &root )102 void from_setting( const Setting &root ) 103 103 { 104 Transport:: FromSetting( root );104 Transport::from_setting( root ); 105 105 106 106 root.lookupValue( "electricLights", electricLights ); 107 107 108 UI:: Get( matr, root, "matr" );108 UI::get( matr, root, "matr" ); 109 109 } 110 110 111 void ToSetting( Setting &root )111 void to_setting( Setting &root ) 112 112 { 113 Transport:: ToSetting( root );113 Transport::to_setting( root ); 114 114 115 115 Setting &electricLights_setting = root.add("electricLights", Setting::TypeBoolean ); 116 116 electricLights_setting = electricLights; 117 117 118 UI:: Save( matr, root, "matr" );118 UI::save( matr, root, "matr" ); 119 119 } 120 120 … … 138 138 Bike author( 1996, "author", true ); 139 139 140 UI File root("UIbuilder_test.cfg");141 UI:: Save( audi, root, "pepikovo");142 UI:: Save( liaz, root, "jardovo");143 UI:: Save( author, root, "ondrejovo");144 root. Save();140 UI_File root("testUI.cfg"); 141 UI::save( audi, root, "pepikovo"); 142 UI::save( liaz, root, "jardovo"); 143 UI::save( author, root, "ondrejovo"); 144 root.save(); 145 145 146 146 cout << "all the transport means were saved correctly" << endl; … … 149 149 150 150 //////////////////////////////////// LOADING //////////////////////////////// 151 UI File root("UIbuilder_test.cfg");152 root. Load();153 Transport *pepikovo = UI:: Build<Transport>( root, "pepikovo");151 UI_File root("testUI.cfg"); 152 root.load(); 153 Transport *pepikovo = UI::build<Transport>( root, "pepikovo"); 154 154 cout << "pepikovo: " << pepikovo->ToString() << endl; 155 Transport *jardovo = UI:: Build<Transport>( root, "jardovo");155 Transport *jardovo = UI::build<Transport>( root, "jardovo"); 156 156 cout << "jardovo: " << jardovo->ToString() << endl; 157 Transport *ondrejovo = UI:: Build<Transport>( root, "ondrejovo");157 Transport *ondrejovo = UI::build<Transport>( root, "ondrejovo"); 158 158 cout << "ondrejovo: " << ondrejovo->ToString() << endl; 159 Transport *elisky = UI:: Build<Transport>( root, "elisky");159 Transport *elisky = UI::build<Transport>( root, "elisky"); 160 160 cout << "elisky: " << elisky->ToString() << endl; 161 Transport *kati = UI:: Build<Transport>( root, "kati");161 Transport *kati = UI::build<Transport>( root, "kati"); 162 162 cout << "kati: " << kati->ToString() << endl; 163 163 getchar();