/[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 3198 by schoenebeck, Sun May 21 12:46:05 2017 UTC revision 3476 by schoenebeck, Wed Feb 20 19:12:49 2019 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2017 Christian Schoenebeck                              *   *   Copyright (C) 2017-2019 Christian Schoenebeck                         *
4   *                      <cuse@users.sourceforge.net>                       *   *                           <cuse@users.sourceforge.net>                  *
5   *                                                                         *   *                                                                         *
6   *   This library is part of libgig.                                       *   *   This library is part of libgig.                                       *
7   *                                                                         *   *                                                                         *
# Line 323  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 333  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 439  namespace Serialization { Line 441  namespace Serialization {
441          template<typename T>          template<typename T>
442          static String rawCppTypeNameOf(const T& data) {          static String rawCppTypeNameOf(const T& data) {
443              #if defined _MSC_VER // Microsoft compiler ...              #if defined _MSC_VER // Microsoft compiler ...
444              # warning type_info::raw_name() demangling has not been tested yet with Microsoft compiler! Feedback appreciated!              String name = typeid(data).raw_name();
             String name = typeid(data).raw_name(); //NOTE: I haven't checked yet what MSC actually outputs here exactly  
445              #else // i.e. especially GCC and clang ...              #else // i.e. especially GCC and clang ...
446              String name = typeid(data).name();              String name = typeid(data).name();
447              #endif              #endif
# Line 455  namespace Serialization { Line 456  namespace Serialization {
456          int m_size;          int m_size;
457          bool m_isPointer;          bool m_isPointer;
458    
459    #if LIBGIG_SERIALIZATION_INTERNAL
460          friend DataType _popDataTypeBlob(const char*& p, const char* end);          friend DataType _popDataTypeBlob(const char*& p, const char* end);
461    #endif
462          friend class Archive;          friend class Archive;
463      };      };
464    
# Line 505  namespace Serialization { Line 508  namespace Serialization {
508          String m_name;          String m_name;
509          DataType m_type;          DataType m_type;
510    
511    #if LIBGIG_SERIALIZATION_INTERNAL
512          friend Member _popMemberBlob(const char*& p, const char* end);          friend Member _popMemberBlob(const char*& p, const char* end);
513    #endif
514      };      };
515    
516      /** @brief Abstract reflection of some native serialized C/C++ data.      /** @brief Abstract reflection of some native serialized C/C++ data.
# Line 571  namespace Serialization { Line 576  namespace Serialization {
576          RawData m_data;          RawData m_data;
577          std::vector<Member> m_members;          std::vector<Member> m_members;
578    
579    #if LIBGIG_SERIALIZATION_INTERNAL
580          friend String _encodePrimitiveValue(const Object& obj);          friend String _encodePrimitiveValue(const Object& obj);
581          friend Object _popObjectBlob(const char*& p, const char* end);          friend Object _popObjectBlob(const char*& p, const char* end);
582          friend void _popPrimitiveValue(const char*& p, const char* end, Object& obj);          friend void _popPrimitiveValue(const char*& p, const char* end, Object& obj);
583          friend String _primitiveObjectValueToString(const Object& obj);          friend String _primitiveObjectValueToString(const Object& obj);
584            // |
585          template<typename T>          template<typename T>
586          friend T _primitiveObjectValueToNumber(const Object& obj);          friend T _primitiveObjectValueToNumber(const Object& obj);
587    #endif // LIBGIG_SERIALIZATION_INTERNAL
588    
589          friend class Archive;          friend class Archive;
590      };      };

Legend:
Removed from v.3198  
changed lines
  Added in v.3476

  ViewVC Help
Powered by ViewVC