VirtualBox

Changeset 74093 in vbox for trunk


Ignore:
Timestamp:
Sep 5, 2018 7:30:01 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/rest: Implemented the hybrid RTCRestAnyObject chameleon. bugref:9167

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cpp/restbase.h

    r74075 r74093  
    877877};
    878878
    879 
    880 /**
    881  * Dynamic REST object.
    882  *
    883  * @todo figure this one out. it's possible this is only used in maps and
    884  *       could be a specialized map implementation.
    885  */
    886 class /*RT_DECL_CLASS*/ RTCRestObject : public RTCRestObjectBase
    887 {
    888 public:
    889     /** Default constructor. */
    890     RTCRestObject();
    891     /** Destructor. */
    892     virtual ~RTCRestObject();
    893 
    894     /** Copy constructor. */
    895     RTCRestObject(RTCRestObject const &a_rThat);
    896     /** Copy assignment operator. */
    897     RTCRestObject &operator=(RTCRestObject const &a_rThat);
    898     /** Safe Safe copy assignment method. */
    899     int assignCopy(RTCRestObject const &a_rThat);
    900 
    901     /* Overridden methods: */
    902     virtual int setNull(void) RT_OVERRIDE;
    903     virtual int resetToDefault() RT_OVERRIDE;
    904     virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE;
    905     virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE;
    906     virtual int toString(RTCString *a_pDst, uint32_t a_fFlags = kCollectionFormat_Unspecified) const RT_OVERRIDE;
    907     virtual int fromString(RTCString const &a_rValue, const char *a_pszName, PRTERRINFO a_pErrInfo = NULL,
    908                            uint32_t a_fFlags = kCollectionFormat_Unspecified) RT_OVERRIDE;
    909     virtual kTypeClass typeClass(void) const RT_OVERRIDE;
    910     virtual const char *typeName(void) const RT_OVERRIDE;
    911 
    912     /** Factory method. */
    913     static DECLCALLBACK(RTCRestObjectBase *) createInstance(void);
    914 
    915 protected:
    916     /** @todo figure out the value stuff here later... */
    917 };
    918 
    919 
    920879/** @} */
    921880
  • trunk/include/iprt/err.h

    r74023 r74093  
    32203220
    32213221/** Internal error \#1. */
    3222 #define VERR_REST_INTERAL_ERROR_1                       (-25791)
     3222#define VERR_REST_INTERNAL_ERROR_1                      (-25791)
    32233223/** Internal error \#2. */
    3224 #define VERR_REST_INTERAL_ERROR_2                       (-25792)
     3224#define VERR_REST_INTERNAL_ERROR_2                      (-25792)
    32253225/** Internal error \#3. */
    3226 #define VERR_REST_INTERAL_ERROR_3                       (-25793)
     3226#define VERR_REST_INTERNAL_ERROR_3                      (-25793)
    32273227/** Internal error \#4. */
    3228 #define VERR_REST_INTERAL_ERROR_4                       (-25794)
     3228#define VERR_REST_INTERNAL_ERROR_4                      (-25794)
    32293229/** Internal error \#5. */
    3230 #define VERR_REST_INTERAL_ERROR_5                       (-25795)
     3230#define VERR_REST_INTERNAL_ERROR_5                      (-25795)
    32313231/** Internal error \#6. */
    3232 #define VERR_REST_INTERAL_ERROR_6                       (-25796)
     3232#define VERR_REST_INTERNAL_ERROR_6                      (-25796)
    32333233/** Internal error \#7. */
    3234 #define VERR_REST_INTERAL_ERROR_7                       (-25797)
     3234#define VERR_REST_INTERNAL_ERROR_7                      (-25797)
    32353235/** Internal error \#8. */
    3236 #define VERR_REST_INTERAL_ERROR_8                       (-25798)
     3236#define VERR_REST_INTERNAL_ERROR_8                      (-25798)
    32373237/** Internal error \#9. */
    3238 #define VERR_REST_INTERAL_ERROR_9                       (-25799)
     3238#define VERR_REST_INTERNAL_ERROR_9                      (-25799)
    32393239/** @} */
    32403240
  • trunk/src/VBox/Runtime/Makefile.kmk

    r74052 r74093  
    16531653        generic/http-curl.cpp \
    16541654        common/rest/rest-primary-object-types.cpp \
     1655        common/rest/RTCRestAnyObject.cpp \
    16551656        common/rest/RTCRestArrayBase.cpp \
    16561657        common/rest/RTCRestClientApiBase.cpp \
  • trunk/src/VBox/Runtime/common/rest/RTCRestClientRequestBase.cpp

    r74070 r74093  
    152152                 */
    153153                AssertReturn(a_papQueryParamObjs[i]->typeClass() == RTCRestObjectBase::kTypeClass_Array,
    154                              VERR_REST_INTERAL_ERROR_2);
     154                             VERR_REST_INTERNAL_ERROR_2);
    155155                RTCRestArrayBase const *pArray = (RTCRestArrayBase const *)a_papQueryParamObjs[i];
    156156                for (size_t j = 0; j < pArray->size(); j++)
     
    204204                 */
    205205                AssertReturn(a_papHeaderParamObjs[i]->typeClass() == RTCRestObjectBase::kTypeClass_StringMap,
    206                              VERR_REST_INTERAL_ERROR_1);
     206                             VERR_REST_INTERNAL_ERROR_1);
    207207                RTCRestStringMapBase const *pMap    = (RTCRestStringMapBase const *)a_papHeaderParamObjs[i];
    208208                const size_t                cchName = strlen(a_paHeaderParams[i].pszName);
  • trunk/src/VBox/Runtime/common/rest/rest-primary-object-types.cpp

    r74040 r74093  
    12561256            size_t              cEntries  = 0;
    12571257            ENUMMAPENTRY const *paEntries = getMappingTable(&cEntries);
    1258             AssertReturn((unsigned)(m_iEnumValue - 1) < cEntries, VERR_REST_INTERAL_ERROR_3);
     1258            AssertReturn((unsigned)(m_iEnumValue - 1) < cEntries, VERR_REST_INTERNAL_ERROR_3);
    12591259            Assert(paEntries[m_iEnumValue - 1].iValue == m_iEnumValue);
    12601260
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette