Show
Ignore:
Timestamp:
08/05/09 14:40:03 (15 years ago)
Author:
mido
Message:

panove, vite, jak jsem peclivej na upravu kodu.. snad se vam bude libit:) konfigurace je v souboru /system/astylerc

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/user_info.h

    r474 r477  
    165165the UIFile dealocation). And that is exactly the mechanism implemented within SettingResolver class. It assures, 
    166166that the #result Setting reference is valid within the scope of SettingResolver instance. 
    167          
     167 
    168168\ref ui_page 
    169169 */ 
     
    288288 
    289289        //! This methods converts a Setting into a new templated array of type Array<T> 
    290         template<class T> static void from_setting ( Array<T> &array_to_load, const Setting &element ) { 
     290        template<class T> static void from_setting ( T &variable_to_load, const Setting &element ) { 
    291291                const SettingResolver link ( element ); 
    292292 
     
    306306        //! The exception can help to find the place where the template is misused and also to correct it. 
    307307        template<class T> static void from_setting ( T &array_to_load, const Setting &element ) { 
    308                 throw UIException( "from_setting is not implemented for this type", element ); 
     308                throw UIException ( "from_setting is not implemented for this type", element ); 
    309309        } 
    310310 
     
    318318public: 
    319319 
    320         //! Enumerical type used to determine whether the data for concrete Settingis is compulsory or optional  
     320        //! Enumerical type used to determine whether the data for concrete Settingis is compulsory or optional 
    321321        enum SettingPresence { optional, compulsory } ; 
    322322 
     
    329329        //! If there is not any sub-element named #name, the null pointer is returned. 
    330330        template<class T> static T* build ( const Setting &element, const string &name, SettingPresence settingPresence = optional ) { 
    331                 if ( !element.exists ( name ) ) 
    332                 { 
    333                         if( settingPresence == optional ) 
     331                if ( !element.exists ( name ) ) { 
     332                        if ( settingPresence == optional ) 
    334333                                return NULL; 
    335334                        else 
     
    346345        //! If there is not any sub-element indexed by #index, the null pointer is returned. 
    347346        template<class T> static T* build ( const Setting &element, const int index, SettingPresence settingPresence = optional ) { 
    348                 if ( element.getLength() <= index ) 
    349                 { 
    350                         if( settingPresence == optional ) 
     347                if ( element.getLength() <= index ) { 
     348                        if ( settingPresence == optional ) 
    351349                                return NULL; 
    352                         else 
    353                         { 
     350                        else { 
    354351                                stringstream stream; 
    355352                                stream << index; 
    356                                 throw UIException ( "the compulsory Setting with the index " + stream.str()+ " is missing", element ); 
     353                                throw UIException ( "the compulsory Setting with the index " + stream.str() + " is missing", element ); 
    357354                        } 
    358355                } 
     
    380377        //! If there is not any sub-element named #name, this method returns false. 
    381378        template<class T> static bool get ( T &instance, const Setting &element, const string &name, SettingPresence settingPresence = optional ) { 
    382                 if ( !element.exists ( name ) ) 
    383                 { 
    384                         if( settingPresence == optional ) 
     379                if ( !element.exists ( name ) ) { 
     380                        if ( settingPresence == optional ) 
    385381                                return false; 
    386382                        else 
     
    395391        //! If there is not any sub-element indexed by #index, this method returns false. 
    396392        template<class T> static bool get ( T &instance, const Setting &element, const int index, SettingPresence settingPresence = optional ) { 
    397                 if ( element.getLength() <= index ) 
    398                 { 
    399                         if( settingPresence == optional ) 
     393                if ( element.getLength() <= index ) { 
     394                        if ( settingPresence == optional ) 
    400395                                return false; 
    401                         else 
    402                         { 
     396                        else { 
    403397                                stringstream stream; 
    404398                                stream << index; 
    405                                 throw UIException ( "the compulsory Setting with the index " + stream.str()+ " is missing", element ); 
     399                                throw UIException ( "the compulsory Setting with the index " + stream.str() + " is missing", element ); 
    406400                        } 
    407401                }