Changeset 73968 in vbox
- Timestamp:
- Aug 29, 2018 7:32:50 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/restbase.h
r73965 r73968 606 606 * @returns true if @a a_idx is valid, false if out of range. 607 607 * @param a_idx The index of the element to remove. 608 * The value ~(size_t)0 is an alias for the final element. 608 609 */ 609 610 bool removeAt(size_t a_idx); … … 660 661 * @returns VINF_SUCCESS or VWRN_ALREADY_EXISTS on success. 661 662 * VERR_ALREADY_EXISTS, VERR_NO_MEMORY or VERR_NO_STR_MEMORY on failure. 662 * @param a_idx Where to insert it. 663 * @param a_idx Where to insert it. The value ~(size_t)0 is an alias for m_cElements. 663 664 * @param a_pValue The value to insert. Ownership is transferred to the map on success. 664 665 * @param a_fReplace Whether to replace existing entry rather than insert. … … 671 672 * @returns VINF_SUCCESS or VWRN_ALREADY_EXISTS on success. 672 673 * VERR_ALREADY_EXISTS, VERR_NO_MEMORY or VERR_NO_STR_MEMORY on failure. 673 * @param a_idx Where to insert it. 674 * @param a_idx Where to insert it. The value ~(size_t)0 is an alias for m_cElements. 674 675 * @param a_rValue The value to copy into the map. 675 676 * @param a_fReplace Whether to replace existing key-value pair with matching key. … … 1403 1404 * Getter for m_pErrInfo. 1404 1405 */ 1405 PCRTERRINFO getErrIfno(void) const { return m_pErrInfo; }1406 PCRTERRINFO getErrInfo(void) const { return m_pErrInfo; } 1406 1407 1407 1408 /** … … 1421 1422 RTCString m_strContentType; 1422 1423 1423 PRTERRINFO getErrInfo (void);1424 PRTERRINFO getErrInfoInternal(void); 1424 1425 void deleteErrInfo(void); 1425 1426 void copyErrInfo(PCRTERRINFO pErrInfo); -
trunk/src/VBox/Runtime/common/rest/RTCRestArrayBase.cpp
r73965 r73968 310 310 311 311 if (a_idx == ~(size_t)0) 312 a_idx = m_cElements - 1;312 a_idx = m_cElements; 313 313 314 314 if (a_idx <= m_cElements) … … 333 333 m_papElements[a_idx] = a_pValue; 334 334 m_cElements++; 335 } 336 else 337 { 338 /* Replace element. */ 339 delete m_papElements[a_idx]; 340 m_papElements[a_idx] = a_pValue; 341 return VWRN_ALREADY_EXISTS; 342 } 335 return VINF_SUCCESS; 336 } 337 338 /* Replace element. */ 339 delete m_papElements[a_idx]; 340 m_papElements[a_idx] = a_pValue; 341 return VWRN_ALREADY_EXISTS; 343 342 } 344 343 return VERR_OUT_OF_RANGE; -
trunk/src/VBox/Runtime/common/rest/RTCRestClientResponseBase.cpp
r73933 r73968 125 125 126 126 127 PRTERRINFO RTCRestClientResponseBase::getErrInfo (void)127 PRTERRINFO RTCRestClientResponseBase::getErrInfoInternal(void) 128 128 { 129 129 if (m_pErrInfo) … … 162 162 int RTCRestClientResponseBase::addError(int rc, const char *pszFormat, ...) 163 163 { 164 PRTERRINFO pErrInfo = getErrInfo ();164 PRTERRINFO pErrInfo = getErrInfoInternal(); 165 165 if (pErrInfo) 166 166 { … … 354 354 RTCRestClientResponseBase::PrimaryJsonCursorForBody::PrimaryJsonCursorForBody(RTJSONVAL hValue, const char *pszName, 355 355 RTCRestClientResponseBase *a_pThat) 356 : RTCRestJsonPrimaryCursor(hValue, pszName, a_pThat->getErrInfo ())356 : RTCRestJsonPrimaryCursor(hValue, pszName, a_pThat->getErrInfoInternal()) 357 357 , m_pThat(a_pThat) 358 358 { … … 383 383 void RTCRestClientResponseBase::deserializeBody(RTCRestObjectBase *a_pDst, const char *a_pchData, size_t a_cbData) 384 384 { 385 if (m_strContentType.startsWith("application/json ;"))385 if (m_strContentType.startsWith("application/json")) 386 386 { 387 387 int rc = RTStrValidateEncodingEx(a_pchData, a_cbData, RTSTR_VALIDATE_ENCODING_EXACT_LENGTH);
Note:
See TracChangeset
for help on using the changeset viewer.