Changeset 74348 in vbox for trunk/include/iprt/cpp
- Timestamp:
- Sep 18, 2018 5:06:05 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/restclient.h
r74250 r74348 632 632 { 633 633 public: 634 RTCRestClientApiBase() 635 : m_hHttp(NIL_RTHTTP) 636 {} 634 RTCRestClientApiBase(); 637 635 virtual ~RTCRestClientApiBase(); 638 636 639 /** @name Base path (URL) handling.637 /** @name Host and Base path (URL) handling. 640 638 * @{ */ 641 639 /** 642 * Gets the base path we're using. 643 * 644 * @returns Base URL string. If empty, we'll be using the default one. 645 */ 646 inline RTCString const &getBasePath(void) const 647 { 648 return m_strBasePath; 649 } 640 * Gets the default host (start of URL) as specified in the specs. 641 * 642 * @returns Host string (start of URL). 643 */ 644 virtual const char *getDefaultHost() const = 0; 645 646 /** 647 * Gets the host we're using. 648 * 649 * @returns Host URL string. 650 */ 651 const char *getHost(void) const; 652 653 /** 654 * Sets the host (URL) to use when talking to the server. 655 * 656 * Setting the host is only required if there is a desire to use a 657 * different server from the one specified in the API specification, like 658 * for instance regional one. 659 * 660 * @returns IPRT status code. 661 * @param a_pszHost The base path to use. 662 */ 663 virtual int setHost(const char *a_pszHost); 650 664 651 665 /** … … 656 670 * for instance regional one. 657 671 * 672 * @returns IPRT status code. 673 * @param a_strHost The base path to use. 674 * @note Defers to the C-string variant. 675 */ 676 int setHost(RTCString const &a_strHost); 677 678 679 /** 680 * Gets the default base path (relative to getHost()) as specified in the specs. 681 * 682 * @returns Base path string. 683 */ 684 virtual const char *getDefaultBasePath() const = 0; 685 686 /** 687 * Gets the base path we're using (relative to getHost). 688 * 689 * @returns Base path string. 690 */ 691 const char *getBasePath(void) const; 692 693 /** 694 * Sets the base path (relative to getHost()) to use when talking to the server. 695 * 696 * It is assumed that the base path is at the minimum a lone slash, so an 697 * empty (or NULL) string is understood to mean reverting to the default 698 * (see getDefaultBasePath()). 699 * 658 700 * @param a_pszPath The base path to use. 659 701 */ 660 virtual void setBasePath(const char *a_pszPath) 661 { 662 m_strBasePath = a_pszPath; 663 } 664 665 /** 666 * Sets the base path (URL) to use when talking to the server. 667 * 668 * Setting the base path is only required if there is a desire to use a 669 * different server from the one specified in the API specification, like 670 * for instance regional one. 702 virtual int setBasePath(const char *a_pszPath); 703 704 /** 705 * Sets the base path (relative to getHost()) to use when talking to the server. 671 706 * 672 707 * @param a_strPath The base path to use. 673 708 * @note Defers to the C-string variant. 674 709 */ 675 inline void setBasePath(RTCString const &a_strPath) { setBasePath(a_strPath.c_str()); } 676 677 /** 678 * Gets the default base path (URL) as specified in the specs. 679 * 680 * @returns Base path (URL) string. 681 */ 682 virtual const char *getDefaultBasePath() = 0; 710 int setBasePath(RTCString const &a_strPath); 711 683 712 /** @} */ 684 713 … … 692 721 /** Handle to the HTTP connection object. */ 693 722 RTHTTP m_hHttp; 694 /** The base path to use. */ 723 /** The host to use. If empty use the default. */ 724 RTCString m_strHost; 725 /** The base path to use. If empty use the default. */ 695 726 RTCString m_strBasePath; 696 727
Note:
See TracChangeset
for help on using the changeset viewer.