VirtualBox

Changeset 73968 in vbox


Ignore:
Timestamp:
Aug 29, 2018 7:32:50 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/rest: Bug fixes. Pet listing works. bugref:9167

Location:
trunk
Files:
3 edited

Legend:

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

    r73965 r73968  
    606606     * @returns true if @a a_idx is valid, false if out of range.
    607607     * @param   a_idx       The index of the element to remove.
     608     *                      The value ~(size_t)0 is an alias for the final element.
    608609     */
    609610    bool removeAt(size_t a_idx);
     
    660661     * @returns VINF_SUCCESS or VWRN_ALREADY_EXISTS on success.
    661662     *          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.
    663664     * @param   a_pValue        The value to insert.  Ownership is transferred to the map on success.
    664665     * @param   a_fReplace      Whether to replace existing entry rather than insert.
     
    671672     * @returns VINF_SUCCESS or VWRN_ALREADY_EXISTS on success.
    672673     *          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.
    674675     * @param   a_rValue        The value to copy into the map.
    675676     * @param   a_fReplace      Whether to replace existing key-value pair with matching key.
     
    14031404     * Getter for m_pErrInfo.
    14041405     */
    1405     PCRTERRINFO  getErrIfno(void) const { return m_pErrInfo; }
     1406    PCRTERRINFO getErrInfo(void) const { return m_pErrInfo; }
    14061407
    14071408    /**
     
    14211422    RTCString   m_strContentType;
    14221423
    1423     PRTERRINFO  getErrInfo(void);
     1424    PRTERRINFO  getErrInfoInternal(void);
    14241425    void        deleteErrInfo(void);
    14251426    void        copyErrInfo(PCRTERRINFO pErrInfo);
  • trunk/src/VBox/Runtime/common/rest/RTCRestArrayBase.cpp

    r73965 r73968  
    310310
    311311    if (a_idx == ~(size_t)0)
    312         a_idx = m_cElements - 1;
     312        a_idx = m_cElements;
    313313
    314314    if (a_idx <= m_cElements)
     
    333333            m_papElements[a_idx] = a_pValue;
    334334            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;
    343342    }
    344343    return VERR_OUT_OF_RANGE;
  • trunk/src/VBox/Runtime/common/rest/RTCRestClientResponseBase.cpp

    r73933 r73968  
    125125
    126126
    127 PRTERRINFO RTCRestClientResponseBase::getErrInfo(void)
     127PRTERRINFO RTCRestClientResponseBase::getErrInfoInternal(void)
    128128{
    129129    if (m_pErrInfo)
     
    162162int RTCRestClientResponseBase::addError(int rc, const char *pszFormat, ...)
    163163{
    164     PRTERRINFO pErrInfo = getErrInfo();
     164    PRTERRINFO pErrInfo = getErrInfoInternal();
    165165    if (pErrInfo)
    166166    {
     
    354354RTCRestClientResponseBase::PrimaryJsonCursorForBody::PrimaryJsonCursorForBody(RTJSONVAL hValue, const char *pszName,
    355355                                                                              RTCRestClientResponseBase *a_pThat)
    356     : RTCRestJsonPrimaryCursor(hValue, pszName, a_pThat->getErrInfo())
     356    : RTCRestJsonPrimaryCursor(hValue, pszName, a_pThat->getErrInfoInternal())
    357357    , m_pThat(a_pThat)
    358358{
     
    383383void RTCRestClientResponseBase::deserializeBody(RTCRestObjectBase *a_pDst, const char *a_pchData, size_t a_cbData)
    384384{
    385     if (m_strContentType.startsWith("application/json;"))
     385    if (m_strContentType.startsWith("application/json"))
    386386    {
    387387        int rc = RTStrValidateEncodingEx(a_pchData, a_cbData, RTSTR_VALIDATE_ENCODING_EXACT_LENGTH);
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