VirtualBox

Ignore:
Timestamp:
Aug 25, 2018 9:51:58 AM (6 years ago)
Author:
vboxsync
Message:

IPRT/swagger: Hacking api source. bugref:9167

File:
1 edited

Legend:

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

    r73884 r73887  
    413413    }
    414414
    415     virtual int consumeHeader(const char *a_pvData, size_t a_cbData) ///< ??
     415    /**
     416     * Callback that consumes HTTP header data from the server.
     417     *
     418     * @returns IPRT status code?
     419     * @param   a_pvData   Body data.
     420     * @param   a_cbData   Amount of body data.
     421     *
     422     * @todo good idea?
     423     */
     424    virtual int consumeHeader(const char *a_pvData, size_t a_cbData)
    416425    {
    417426        RT_NOREF(a_pvData, a_cbData);
     
    419428    }
    420429
    421     virtual int consumeBody(const char *a_pvData, size_t a_cbData)   ///< ??
     430    /**
     431     * Callback that consumes HTTP body data from the server.
     432     *
     433     * @returns IPRT status code?
     434     * @param   a_pvData   Body data.
     435     * @param   a_cbData   Amount of body data.
     436     *
     437     * @todo good idea?
     438     */
     439    virtual int consumeBody(const char *a_pvData, size_t a_cbData)
    422440    {
    423441        RT_NOREF(a_pvData, a_cbData);
     
    462480    virtual ~RTCRestClientApiBase();
    463481
    464     bool    isConnected();
     482    /** @name Base path (URL) handling.
     483     * @{ */
     484    /**
     485     * Gets the base path we're using.
     486     *
     487     * @returns Base URL string.  If empty, we'll be using the default one.
     488     */
     489    RTCString const &getBasePath(void) const
     490    {
     491        return m_strBasePath;
     492    }
     493
     494    /**
     495     * Sets the base path (URL) to use when talking to the server.
     496     *
     497     * Setting the base path is only required if there is a desire to use a
     498     * different server from the one specified in the API specification, like
     499     * for instance regional one.
     500     *
     501     * @param   a_pszPath   The base path to use.
     502     */
     503    virtual void setBasePath(const char *a_pszPath)
     504    {
     505        m_strBasePath = a_pszPath;
     506    }
     507
     508    /**
     509     * Sets the base path (URL) to use when talking to the server.
     510     *
     511     * Setting the base path is only required if there is a desire to use a
     512     * different server from the one specified in the API specification, like
     513     * for instance regional one.
     514     *
     515     * @param   a_strPath   The base path to use.
     516     * @note    Defers to the C-string variant.
     517     */
     518    void setBasePath(RTCString const &a_strPath) { setBasePath(a_strPath.c_str()); }
     519
     520    /**
     521     * Gets the default base path (URL) as specified in the specs.
     522     *
     523     * @returns Base path (URL) string.
     524     */
     525    virtual const char *getDefaultBasePath() = 0;
     526    /** @} */
    465527
    466528protected:
    467529    /** Handle to the HTTP connection object. */
    468530    RTHTTP  m_hHttp;
     531    /** The base path to use. */
     532    RTCString m_strBasePath;
    469533
    470534    /* Make non-copyable (RTCNonCopyable causes warnings): */
    471535    RTCRestClientApiBase(RTCRestOutputToString const &);
    472536    RTCRestClientApiBase *operator=(RTCRestOutputToString const &);
     537
     538    /**
     539     * Re-initializes the HTTP instance.
     540     *
     541     * @returns IPRT status code.
     542     */
     543    virtual int reinitHttpInstance();
    473544};
    474545
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