Show
Ignore:
Timestamp:
01/07/08 18:28:27 (2 years ago)
Author:
tapted
Message:

Add hello world and support strings as unititialised

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • mylib/trunk/rconfig/rconfig.h

    r691 r692  
    6767void rcfile_tell(const char* name, unsigned &ref, const char* context = 0); 
    6868void rcfile_tell(const char* name, std::string &ref, const char* context = 0); 
     69void rcfile_tellstr(const char* name, std::string &ref, const char* defval = 0, const char* context = 0); 
    6970//void rcfile_tell(const char* name, std::vector<bool> &ref); 
    7071void rcfile_tell(const char* name, std::vector<int> &ref, const char* context = 0); 
     
    7576//@} 
    7677 
    77 template<class T> 
    78     T rcfile_initwrap(const char* name, T& ref, const T& initval, const char* context = 0) { 
    79         ref = initval; 
     78template<class T, class V> 
     79    T rcfile_initwrap(const char* name, T& ref, const V& initval, const char* context = 0) { 
     80        ref = initval; //this only works for primitive types 
    8081        rcfile_tell(name, ref, context); 
     82        return initval; 
     83    } 
     84 
     85template<class V> 
     86    std::string rcfile_initwrap(const char* name, std::string& ref, const V& initval, const char* context = 0) { 
     87        rcfile_tellstr(name, ref, initval, context); 
    8188        return initval; 
    8289    }