Changeset 222 for cpp/frams/util
- Timestamp:
- 04/11/14 23:39:36 (11 years ago)
- Location:
- cpp/frams/util
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified cpp/frams/util/extvalue.cpp ¶
r205 r222 706 706 } 707 707 708 PtrListTempl<ParamInterface*> ExtValue::deserializable_classes; 709 710 void ExtValue::initDeserializableClasses() 711 { 712 deserializable_classes+=&Pt3D_Ext::getStaticParam(); 713 deserializable_classes+=&Orient_Ext::getStaticParam(); 714 deserializable_classes+=&GenoObj::getStaticParam(); 708 PtrListTempl<ParamInterface*> &ExtValue::getDeserializableClasses() 709 { 710 static PtrListTempl<ParamInterface*> classes; 711 return classes; 715 712 } 716 713 717 714 ParamInterface *ExtValue::findDeserializableClass(const char* name) 718 715 { 719 FOREACH(ParamInterface*,cls, deserializable_classes)716 FOREACH(ParamInterface*,cls,getDeserializableClasses()) 720 717 if (!strcmp(cls->getName(),name)) 721 718 return cls; -
TabularUnified cpp/frams/util/extvalue.h ¶
r205 r222 160 160 const char* deserialize(const char* in);//< @return first character after the succesfully parsed string or NULL if failed 161 161 const char* deserialize_inner(const char* in); 162 static PtrListTempl<ParamInterface*> deserializable_classes;163 162 static ParamInterface *findDeserializableClass(const char* name); 164 static void initDeserializableClasses(); 163 static PtrListTempl<ParamInterface*> &getDeserializableClasses(); 164 template<typename T> class AddDeserializable 165 { 166 public: 167 AddDeserializable() {ExtValue::getDeserializableClasses()+=&T::getStaticParam();} 168 }; 169 165 170 static SString format(SString& fmt,const ExtValue **values,int count); 166 171 … … 188 193 }; 189 194 195 #define REGISTER_DESERIALIZABLE(name) ExtValue::AddDeserializable<name> deserializable_autoinit_ ## name; 190 196 191 197 #endif -
TabularUnified cpp/frams/util/sstring.cpp ¶
r198 r222 4 4 5 5 #include "sstring.h" 6 #include <common/nonstd.h> //to be sure the vsnprintf-related stuff gets included 6 7 7 8 #ifdef SSTRING_SIMPLE … … 399 400 return s; 400 401 } 401 402 #ifdef LINUX403 #define VSNPRINTF_RETURNS_REQUIRED_SIZE404 #endif405 #if defined _WIN32 && !defined __BORLANDC__406 #define USE_VSCPRINTF407 #endif408 409 402 410 403 #if 0 //testing _vscprintf
Note: See TracChangeset
for help on using the changeset viewer.