Changeset 73887 in vbox for trunk/include/iprt
- Timestamp:
- Aug 25, 2018 9:51:58 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/restbase.h
r73884 r73887 413 413 } 414 414 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) 416 425 { 417 426 RT_NOREF(a_pvData, a_cbData); … … 419 428 } 420 429 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) 422 440 { 423 441 RT_NOREF(a_pvData, a_cbData); … … 462 480 virtual ~RTCRestClientApiBase(); 463 481 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 /** @} */ 465 527 466 528 protected: 467 529 /** Handle to the HTTP connection object. */ 468 530 RTHTTP m_hHttp; 531 /** The base path to use. */ 532 RTCString m_strBasePath; 469 533 470 534 /* Make non-copyable (RTCNonCopyable causes warnings): */ 471 535 RTCRestClientApiBase(RTCRestOutputToString const &); 472 536 RTCRestClientApiBase *operator=(RTCRestOutputToString const &); 537 538 /** 539 * Re-initializes the HTTP instance. 540 * 541 * @returns IPRT status code. 542 */ 543 virtual int reinitHttpInstance(); 473 544 }; 474 545
Note:
See TracChangeset
for help on using the changeset viewer.