VirtualBox

Changeset 73978 in vbox for trunk/include/iprt/cpp


Ignore:
Timestamp:
Aug 30, 2018 1:19:36 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
124714
Message:

IPRT/rest: Fixed empty array & map handling by making the begin iteration functions return VERR_JSON_IS_EMPTY rather than letter the query method do that. Made query parameter processing table driven and made it use the right escapeing. bugref:9167

File:
1 edited

Legend:

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

    r73977 r73978  
    303303        kCollectionFormat_tsv,              /**< Tab-separated list. */
    304304        kCollectionFormat_pipes,            /**< Pipe-separated list. */
     305        kCollectionFormat_multi,            /**< Special collection type that must be handled by caller of toString. */
    305306        kCollectionFormat_Mask = 7,         /**< Collection type mask. */
    306307
     
    13701371
    13711372    /**
     1373     * Do path parameters.
    13721374     *
    13731375     * @returns IPRT status code
     
    13801382    int doPathParameters(RTCString *a_pStrPath, const char *a_pszPathTemplate, size_t a_cchPathTemplate,
    13811383                         PATHREPLACEENTRY *a_paPathParams, size_t a_cPathParams) const;
     1384
     1385    /** Query parameter descriptor. */
     1386    typedef struct
     1387    {
     1388        const char                 *pszName;    /**< The parameter name. */
     1389        uint32_t                    fFlags;     /**< The toString flags. */
     1390        bool                        fRequired;  /**< Required or not. */
     1391    } QUERYPARAMDESC;
     1392
     1393    /**
     1394     * Do query parameters.
     1395     *
     1396     * @returns IPRT status code
     1397     * @param   a_pStrQuery         The destination string.
     1398     * @param   a_paQueryParams     The query parameter descriptors.
     1399     * @param   a_papQueryParamObjs The query parameter objects, parallel to @a a_paQueryParams.
     1400     * @param   a_cQueryParams      Number of query parameters.
     1401     */
     1402    int doQueryParameters(RTCString *a_pStrQuery, QUERYPARAMDESC const *a_paQueryParams,
     1403                          RTCRestObjectBase const **a_papQueryParamObjs, size_t a_cQueryParams) const;
    13821404};
    13831405
Note: See TracChangeset for help on using the changeset viewer.

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