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 |
|
|
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 |
|
|