Changeset 271 for bdm/uibuilder.h
- Timestamp:
- 02/16/09 10:03:13 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/uibuilder.h
r270 r271 14 14 #define UIREGISTER(UI) UI* UI##_global_instance = new UI(); 15 15 16 #define UICATCH catch ( SettingTypeException e ) {it_error ( "Setting " +string ( e.getPath() ) +" is of incorrect Type" );} catch ( SettingNotFoundException e ) {it_error ( "Setting " + string ( e.getPath() ) +" was not found" );} 17 16 18 ////////// GLOBAL VAriables 17 19 … … 25 27 UIFile ( const char * fname ) :Config() { 26 28 try{Config::readFile ( fname );} 29 catch ( FileIOException f ) {it_error ( "File " + string ( fname ) + " not found" );} 27 30 catch ( ParseException& P ) { 28 31 char msg[200]; … … 30 33 it_error ( msg ); 31 34 } 32 catch ( FileIOException f ) {it_error ( "File " + string ( fname ) + " not found" );}33 35 } 34 36 }; … … 95 97 return tmp; 96 98 }; 97 public: 99 const Array<string> get_as ( Setting& S ) const { 100 CHECK_UITYPE ( S,TypeArray ); 101 Array<string> tmp; 102 tmp.set_size ( S.getLength() ); 103 for ( int i=0;i<S.getLength();i++ ) {tmp(i)=(const char*)S[i];} 104 return tmp; 105 }; 106 public: 98 107 //!Constructor needs to be run only once macro UIREGISTER 99 108 UIbuilder ( const string &typ ) {__uimap__.insert ( make_pair ( typ,this ) );} … … 135 144 ret = dynamic_cast<T*> ( iter->second->build ( S ) ); 136 145 } 137 catch ( SettingTypeException e ) { 138 UI_DBG(S,""); 139 it_error ( "Setting " +string ( e.getPath() ) +" is of incorrect Type" );} 140 catch ( SettingNotFoundException e ) { 141 UI_DBG(S,""); 142 it_error ( "Setting " + string ( e.getPath() ) +" was not found" );} 146 UICATCH; 143 147 }; 144 148