VirtualBox

Changeset 74348 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Sep 18, 2018 5:06:05 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/rest: Trying to make the basepath stuff more flexible. However, it's not peferect yet and requires the host to be set. Sigh. bugref:9167

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/rest/RTCRestClientApiBase.cpp

    r74250 r74348  
    3838
    3939/**
     40 * Default constructor.
     41 */
     42RTCRestClientApiBase::RTCRestClientApiBase()
     43    : m_hHttp(NIL_RTHTTP)
     44{
     45}
     46
     47
     48/**
    4049 * The destructor.
    4150 */
     
    4857        m_hHttp = NIL_RTHTTP;
    4958    }
     59}
     60
     61
     62const char *RTCRestClientApiBase::getHost() const
     63{
     64    return m_strHost.isEmpty() ? getDefaultHost() : m_strHost.c_str();
     65}
     66
     67int RTCRestClientApiBase::setHost(const char *a_pszHost)
     68{
     69    return m_strHost.assignNoThrow(a_pszHost);
     70}
     71
     72
     73int RTCRestClientApiBase::setHost(RTCString const &a_strPath)
     74{
     75    return setHost(a_strPath.c_str());
     76}
     77
     78
     79const char *RTCRestClientApiBase::getBasePath(void) const
     80{
     81    return m_strBasePath.isEmpty() ? getDefaultBasePath() : m_strBasePath.c_str();
     82}
     83
     84
     85int RTCRestClientApiBase::setBasePath(const char *a_pszPath)
     86{
     87    return m_strBasePath.assignNoThrow(a_pszPath);
     88}
     89
     90
     91int RTCRestClientApiBase::setBasePath(RTCString const &a_strPath)
     92{
     93    return setBasePath(a_strPath.c_str());
    5094}
    5195
     
    126170                     */
    127171                    RTCString strFullUrl;
    128                     rc = strFullUrl.assignNoThrow(m_strBasePath);
     172                    rc = strFullUrl.assignNoThrow(getHost());
     173                    if (RT_SUCCESS(rc))
     174                        rc = strFullUrl.appendNoThrow(getBasePath());
    129175                    if (strExtraPath.isNotEmpty())
    130176                    {
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