Changeset 73930 in vbox for trunk/include/iprt
- Timestamp:
- Aug 28, 2018 6:09:54 PM (6 years ago)
- Location:
- trunk/include/iprt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/restbase.h
r73922 r73930 707 707 int getHttpStatus() { return m_rcHttp; } 708 708 709 /** 710 * Getter for m_pErrInfo. 711 */ 712 PCRTERRINFO getErrIfno(void) const { return m_pErrInfo; } 713 714 /** 715 * Getter for m_strContentType. 716 */ 717 RTCString const &getContentType(void) const { return m_strContentType; } 718 719 709 720 protected: 710 721 /** Negative numbers are IPRT errors, positive are HTTP status codes. */ 711 int m_rcStatus;722 int m_rcStatus; 712 723 /** The HTTP status code, VERR_NOT_AVAILABLE if not set. */ 713 int m_rcHttp;724 int m_rcHttp; 714 725 /** Error information. */ 715 PRTERRINFO m_pErrInfo;726 PRTERRINFO m_pErrInfo; 716 727 /** The value of the Content-Type header field. */ 717 RTCString m_strContentType;718 719 PRTERRINFO allocErrInfo(void);728 RTCString m_strContentType; 729 730 PRTERRINFO getErrInfo(void); 720 731 void deleteErrInfo(void); 721 732 void copyErrInfo(PCRTERRINFO pErrInfo); 733 734 /** 735 * Reports an error (or warning if a_rc non-negative). 736 * 737 * @returns a_rc 738 * @param a_rc The status code to report and return. The first 739 * error status is assigned to m_rcStatus, subsequent 740 * ones as well as informational statuses are not 741 * recorded by m_rcStatus. 742 * @param a_pszFormat The message format string. 743 * @param ... Message arguments. 744 */ 745 int addError(int a_rc, const char *a_pszFormat, ...); 722 746 723 747 /** … … 735 759 int extractHeaderFromBlob(const char *a_pszField, size_t a_cchField, const char *a_pchData, size_t a_cbData, 736 760 RTCString *a_pStrDst); 761 762 /** 763 * Helper that does the deserializing of the response body. 764 * 765 * @param a_pDst The destination object for the body content. 766 * @param a_pchData The body blob. 767 * @param a_cbData The size of the body blob. 768 */ 769 void deserializeBody(RTCRestObjectBase *a_pDst, const char *a_pchData, size_t a_cbData); 770 771 /** 772 * Primary json cursor for parsing bodies. 773 */ 774 class PrimaryJsonCursorForBody : public RTCRestJsonPrimaryCursor 775 { 776 public: 777 RTCRestClientResponseBase *m_pThat; /**< Pointer to response object. */ 778 PrimaryJsonCursorForBody(RTJSONVAL hValue, const char *pszName, RTCRestClientResponseBase *a_pThat); 779 virtual int addError(RTCRestJsonCursor const &a_rCursor, int a_rc, const char *a_pszFormat, ...) RT_OVERRIDE; 780 virtual int unknownField(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE; 781 }; 737 782 }; 738 783 … … 821 866 virtual void doCall(RTCRestClientRequestBase const &a_rRequest, RTHTTPMETHOD a_enmHttpMethod, 822 867 RTCRestClientResponseBase *a_pResponse); 868 823 869 }; 824 870 -
trunk/include/iprt/err.h
r73929 r73930 3194 3194 /** Internal processing error \#5. */ 3195 3195 #define VERR_ISOFS_IPE_5 (-25395) 3196 3197 3196 /** @} */ 3198 3197 … … 3204 3203 /** The chosen baudrate is invalid or not supported by the given serial port. */ 3205 3204 #define VERR_SERIALPORT_INVALID_BAUDRATE (-25501) 3206 3205 /** @} */ 3206 3207 3208 /** @name RTCRest status codes 3209 * @{ */ 3210 /** Do not know how to handle the content type in the server response. */ 3211 #define VERR_REST_RESPONSE_CONTENT_TYPE_NOT_SUPPORTED (-25700) 3212 /** Invalid UTF-8 encoding in the response. */ 3213 #define VERR_REST_RESPONSE_INVALID_UTF8_ENCODING (-25701) 3214 /** Server response contains embedded zero character(s). */ 3215 #define VERR_REST_RESPONSE_EMBEDDED_ZERO_CHAR (-25702) 3207 3216 /** @} */ 3208 3217 -
trunk/include/iprt/json.h
r73874 r73930 88 88 * @param cbBuf Size of the buffer. 89 89 * @param pErrInfo Where to store extended error info. Optional. 90 * 91 * @todo r=bird: The use of uint8_t makes no sense here since the parser 92 * expects ASCII / UTF-8. What's more, if this is a real buffer the 93 * type should be 'const void *' rather than 'const uint8_t *'. 94 * This function should be modified to reflect that it's really for 95 * handling unterminated strings. 90 96 */ 91 97 RTDECL(int) RTJsonParseFromBuf(PRTJSONVAL phJsonVal, const uint8_t *pbBuf, size_t cbBuf, PRTERRINFO pErrInfo);
Note:
See TracChangeset
for help on using the changeset viewer.