35 |
#include <vector> |
#include <vector> |
36 |
#include <map> |
#include <map> |
37 |
#include <time.h> |
#include <time.h> |
38 |
|
#include <stdarg.h> |
39 |
|
|
40 |
#ifndef __has_extension |
#ifndef __has_extension |
41 |
# define __has_extension(x) 0 |
# define __has_extension(x) 0 |
323 |
*/ |
*/ |
324 |
typedef std::vector<UID> UIDChain; |
typedef std::vector<UID> UIDChain; |
325 |
|
|
326 |
|
#if LIBGIG_SERIALIZATION_INTERNAL |
327 |
// prototyping of private internal friend functions |
// prototyping of private internal friend functions |
328 |
static String _encodePrimitiveValue(const Object& obj); |
static String _encodePrimitiveValue(const Object& obj); |
329 |
static DataType _popDataTypeBlob(const char*& p, const char* end); |
static DataType _popDataTypeBlob(const char*& p, const char* end); |
334 |
// | |
// | |
335 |
template<typename T> |
template<typename T> |
336 |
static T _primitiveObjectValueToNumber(const Object& obj); |
static T _primitiveObjectValueToNumber(const Object& obj); |
337 |
|
#endif // LIBGIG_SERIALIZATION_INTERNAL |
338 |
|
|
339 |
/** @brief Abstract reflection of a native C++ data type. |
/** @brief Abstract reflection of a native C++ data type. |
340 |
* |
* |
457 |
int m_size; |
int m_size; |
458 |
bool m_isPointer; |
bool m_isPointer; |
459 |
|
|
460 |
|
#if LIBGIG_SERIALIZATION_INTERNAL |
461 |
friend DataType _popDataTypeBlob(const char*& p, const char* end); |
friend DataType _popDataTypeBlob(const char*& p, const char* end); |
462 |
|
#endif |
463 |
friend class Archive; |
friend class Archive; |
464 |
}; |
}; |
465 |
|
|
509 |
String m_name; |
String m_name; |
510 |
DataType m_type; |
DataType m_type; |
511 |
|
|
512 |
|
#if LIBGIG_SERIALIZATION_INTERNAL |
513 |
friend Member _popMemberBlob(const char*& p, const char* end); |
friend Member _popMemberBlob(const char*& p, const char* end); |
514 |
|
#endif |
515 |
}; |
}; |
516 |
|
|
517 |
/** @brief Abstract reflection of some native serialized C/C++ data. |
/** @brief Abstract reflection of some native serialized C/C++ data. |
577 |
RawData m_data; |
RawData m_data; |
578 |
std::vector<Member> m_members; |
std::vector<Member> m_members; |
579 |
|
|
580 |
|
#if LIBGIG_SERIALIZATION_INTERNAL |
581 |
friend String _encodePrimitiveValue(const Object& obj); |
friend String _encodePrimitiveValue(const Object& obj); |
582 |
friend Object _popObjectBlob(const char*& p, const char* end); |
friend Object _popObjectBlob(const char*& p, const char* end); |
583 |
friend void _popPrimitiveValue(const char*& p, const char* end, Object& obj); |
friend void _popPrimitiveValue(const char*& p, const char* end, Object& obj); |
584 |
friend String _primitiveObjectValueToString(const Object& obj); |
friend String _primitiveObjectValueToString(const Object& obj); |
585 |
|
// | |
586 |
template<typename T> |
template<typename T> |
587 |
friend T _primitiveObjectValueToNumber(const Object& obj); |
friend T _primitiveObjectValueToNumber(const Object& obj); |
588 |
|
#endif // LIBGIG_SERIALIZATION_INTERNAL |
589 |
|
|
590 |
friend class Archive; |
friend class Archive; |
591 |
}; |
}; |
1182 |
public: |
public: |
1183 |
String Message; |
String Message; |
1184 |
|
|
1185 |
Exception(String Message) { Exception::Message = Message; } |
Exception(String format, ...); |
1186 |
|
Exception(String format, va_list arg); |
1187 |
void PrintMessage(); |
void PrintMessage(); |
1188 |
virtual ~Exception() {} |
virtual ~Exception() {} |
1189 |
|
|
1190 |
|
protected: |
1191 |
|
Exception(); |
1192 |
|
static String assemble(String format, va_list arg); |
1193 |
}; |
}; |
1194 |
|
|
1195 |
} // namespace Serialization |
} // namespace Serialization |