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

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

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

revision 3185 by schoenebeck, Wed May 17 15:42:58 2017 UTC revision 3392 by schoenebeck, Sun Dec 3 17:49:22 2017 UTC
# Line 35  Line 35 
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
# Line 322  namespace Serialization { Line 323  namespace Serialization {
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);
# Line 332  namespace Serialization { Line 334  namespace Serialization {
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       *       *
# Line 454  namespace Serialization { Line 457  namespace Serialization {
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    
# Line 504  namespace Serialization { Line 509  namespace Serialization {
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.
# Line 570  namespace Serialization { Line 577  namespace Serialization {
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      };      };
# Line 1173  namespace Serialization { Line 1182  namespace Serialization {
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

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

  ViewVC Help
Powered by ViewVC