Changeset 74347 in vbox for trunk/include/iprt/cpp
- Timestamp:
- Sep 18, 2018 4:10:34 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 125160
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/restbase.h
r74263 r74347 252 252 253 253 /** 254 * Abstract base class for REST data objects. 254 * Abstract base class for REST primitive types and data objects (via 255 * RTCRestDataObject). 255 256 * 256 257 * The only information this keeps is the null indicator. … … 371 372 kTypeClass_Uuid, /**< UUID. */ 372 373 kTypeClass_Binary, /**< Binary blob. */ 373 kTypeClass_Object, /**< Object (any kind of data model object). */ 374 kTypeClass_DataObject, /**< Data object child (RTCRestDataObject). */ 375 kTypeClass_AnyObject, /**< Any kind of object (RTCRestAnyObject). */ 374 376 kTypeClass_Array, /**< Array (containing any kind of object). */ 375 377 kTypeClass_StringMap, /**< String map (containing any kind of object). */ … … 380 382 * Returns the object type class. 381 383 */ 382 virtual kTypeClass typeClass(void) const ;384 virtual kTypeClass typeClass(void) const = 0; 383 385 384 386 /** … … 980 982 981 983 984 /** 985 * Abstract base class for REST data model objects. 986 */ 987 class RT_DECL_CLASS RTCRestDataObject : public RTCRestObjectBase 988 { 989 public: 990 RTCRestDataObject(); 991 RTCRestDataObject(RTCRestDataObject const &a_rThat); 992 virtual ~RTCRestDataObject(); 993 994 /* Overridden methods:*/ 995 virtual int resetToDefault() RT_OVERRIDE; 996 virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE; 997 virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE; 998 virtual kTypeClass typeClass(void) const RT_OVERRIDE; 999 1000 /** Safe copy assignment method. */ 1001 virtual int assignCopy(RTCRestDataObject const &a_rThat); 1002 1003 /** 1004 * Serialize the members as JSON. 1005 * 1006 * @returns Leading separator prefix (empty string or comma string). 1007 * @param a_rDst The destination for the serialization. 1008 * @param a_pszSep Leading separator prefix (empty or comma). 1009 */ 1010 virtual const char *serializeMembersAsJson(RTCRestOutputBase &a_rDst, const char *a_pszSep) const; 1011 1012 /** 1013 * Deserialize object from the given JSON iterator. 1014 * 1015 * @returns IPRT status code. 1016 * @retval VERR_NOT_FOUND if field is unknown. Top level caller will do 1017 * invoke unknownField() on it. 1018 * 1019 * @param a_rCursor The JSON cursor with the current member. 1020 * @param a_cchName The length of a_rCursor.m_pszName. 1021 */ 1022 virtual int deserializeMemberFromJson(RTCRestJsonCursor const &a_rCursor, size_t a_cchName); 1023 1024 protected: 1025 /** The is-set bits for all the fields. */ 1026 uint64_t m_fIsSet; 1027 1028 /** Copy assignment operator. */ 1029 RTCRestDataObject &operator=(RTCRestDataObject const &a_rThat); 1030 }; 1031 1032 982 1033 /** @} */ 983 1034
Note:
See TracChangeset
for help on using the changeset viewer.