/[svn]/libgig/trunk/src/Serialization.cpp
ViewVC logotype

Diff of /libgig/trunk/src/Serialization.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3183 by schoenebeck, Mon May 15 18:44:32 2017 UTC revision 3185 by schoenebeck, Wed May 17 15:42:58 2017 UTC
# Line 431  namespace Serialization { Line 431  namespace Serialization {
431       *       *
432       * Returns the unique identifier of the original C/C++ member instance of       * Returns the unique identifier of the original C/C++ member instance of
433       * your C++ class. It is important to know that this unique identifier is       * your C++ class. It is important to know that this unique identifier is
434       * not generated particularly for Member objects. That means no matter how       * not meant to be unique for Member instances themselves, but it is rather
435       * many individual Member objects are created, as long as they are       * meant to be unique for the original native C/C++ data these Member
436       * representing the same member variable of the same original native       * instances are representing. So that means no matter how many individual
437         * Member objects are created, as long as they are representing the same
438         * original native member variable of the same original native
439       * instance of your C++ class, then all those separately created Member       * instance of your C++ class, then all those separately created Member
440       * objects return the same unique identifier here.       * objects return the same unique identifier here.
441       *       *
# Line 2080  namespace Serialization { Line 2082  namespace Serialization {
2082              setIntValue(object, atoll(value.c_str()));              setIntValue(object, atoll(value.c_str()));
2083          else if (type.isReal())          else if (type.isReal())
2084              setRealValue(object, atof(value.c_str()));              setRealValue(object, atof(value.c_str()));
2085          else if (type.isBool())          else if (type.isBool()) {
2086              setBoolValue(object, atof(value.c_str()));              String val = toLowerCase(value);
2087          else if (type.isEnum())              if (val == "true" || val == "yes" || val == "1")
2088                    setBoolValue(object, true);
2089                else if (val == "false" || val == "no" || val == "0")
2090                    setBoolValue(object, false);
2091                else
2092                    setBoolValue(object, atof(value.c_str()));
2093            } else if (type.isEnum())
2094              setEnumValue(object, atoll(value.c_str()));              setEnumValue(object, atoll(value.c_str()));
2095          else          else
2096              throw Exception("Not a primitive data type");              throw Exception("Not a primitive data type");

Legend:
Removed from v.3183  
changed lines
  Added in v.3185

  ViewVC Help
Powered by ViewVC