/[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 3777 by schoenebeck, Sat May 23 19:55:32 2020 UTC revision 3778 by schoenebeck, Sun May 24 11:20:11 2020 UTC
# Line 1346  namespace Serialization { Line 1346  namespace Serialization {
1346    
1347      static String _encode(const DataType& type) {      static String _encode(const DataType& type) {
1348          String s;          String s;
1349    
1350            // Srx v1.0 format (mandatory):
1351          s += _encodeBlob(type.baseTypeName());          s += _encodeBlob(type.baseTypeName());
1352          s += _encodeBlob(type.customTypeName());          s += _encodeBlob(type.customTypeName());
         if (!type.customTypeName2().empty())  
             s += _encodeBlob(type.customTypeName2());  
1353          s += _encodeBlob(ToString(type.size()));          s += _encodeBlob(ToString(type.size()));
1354          s += _encodeBlob(ToString(type.isPointer()));          s += _encodeBlob(ToString(type.isPointer()));
1355    
1356            // Srx v1.1 format:
1357            s += _encodeBlob(type.customTypeName2());
1358    
1359          return _encodeBlob(s);          return _encodeBlob(s);
1360      }      }
1361    
# Line 1678  namespace Serialization { Line 1682  namespace Serialization {
1682          end = blob.end;          end = blob.end;
1683    
1684          DataType type;          DataType type;
1685    
1686            // Srx v1.0 format (mandatory):
1687          type.m_baseTypeName   = _popStringBlob(p, end);          type.m_baseTypeName   = _popStringBlob(p, end);
1688          type.m_customTypeName = _popStringBlob(p, end);          type.m_customTypeName = _popStringBlob(p, end);
         if (type.isMap())  
             type.m_customTypeName2 = _popStringBlob(p, end);  
1689          type.m_size           = _popIntBlob<int>(p, end);          type.m_size           = _popIntBlob<int>(p, end);
1690          type.m_isPointer      = _popIntBlob<bool>(p, end);          type.m_isPointer      = _popIntBlob<bool>(p, end);
1691    
1692            // Srx v1.1 format (optional):
1693            if (p < end)
1694                type.m_customTypeName2 = _popStringBlob(p, end);
1695    
1696          return type;          return type;
1697      }      }
1698    

Legend:
Removed from v.3777  
changed lines
  Added in v.3778

  ViewVC Help
Powered by ViewVC