Changeset 74181 in vbox for trunk/include/iprt
- Timestamp:
- Sep 10, 2018 12:43:30 PM (6 years ago)
- Location:
- trunk/include/iprt/cpp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/restarray.h
r74025 r74181 66 66 * @return True if there is more than zero items, false otherwise. 67 67 */ 68 bool isEmpty() const68 inline bool isEmpty() const 69 69 { 70 70 return m_cElements == 0; … … 74 74 * Gets the number of entries in the map. 75 75 */ 76 size_t size() const76 inline size_t size() const 77 77 { 78 78 return m_cElements; … … 85 85 * @param a_idx The array index. 86 86 */ 87 RTCRestObjectBase *atBase(size_t a_idx)87 inline RTCRestObjectBase *atBase(size_t a_idx) 88 88 { 89 89 if (a_idx < m_cElements) … … 98 98 * @param a_idx The array index. 99 99 */ 100 RTCRestObjectBase const *atBase(size_t a_idx) const100 inline RTCRestObjectBase const *atBase(size_t a_idx) const 101 101 { 102 102 if (a_idx < m_cElements) … … 247 247 * @param a_pThat The object to insert. The array takes ownership of the object on success. 248 248 */ 249 in t insert(size_t a_idx, ElementType *a_pThat)249 inline int insert(size_t a_idx, ElementType *a_pThat) 250 250 { 251 251 return insertWorker(a_idx, a_pThat, false /*a_fReplace*/); … … 260 260 * @param a_rThat The object to insert a copy of. 261 261 */ 262 in t insertCopy(size_t a_idx, ElementType const &a_rThat)262 inline int insertCopy(size_t a_idx, ElementType const &a_rThat) 263 263 { 264 264 return insertCopyWorker(a_idx, a_rThat, false /*a_fReplace*/); … … 272 272 * @param a_pThat The object to insert. The array takes ownership of the object on success. 273 273 */ 274 in t append(ElementType *a_pThat)274 inline int append(ElementType *a_pThat) 275 275 { 276 276 return insertWorker(~(size_t)0, a_pThat, false /*a_fReplace*/); … … 284 284 * @param a_rThat The object to insert a copy of. 285 285 */ 286 in t appendCopy(ElementType const &a_rThat)286 inline int appendCopy(ElementType const &a_rThat) 287 287 { 288 288 return insertCopyWorker(~(size_t)0, a_rThat, false /*a_fReplace*/); … … 296 296 * @param a_pThat The object to insert. The array takes ownership of the object on success. 297 297 */ 298 in t prepend(ElementType *a_pThat)298 inline int prepend(ElementType *a_pThat) 299 299 { 300 300 return insertWorker(0, a_pThat, false /*a_fReplace*/); … … 308 308 * @param a_rThat The object to insert a copy of. 309 309 */ 310 in t prependCopy(ElementType const &a_rThat)310 inline int prependCopy(ElementType const &a_rThat) 311 311 { 312 312 return insertCopyWorker(0, a_rThat, false /*a_fReplace*/); … … 321 321 * @param a_pThat The replacement object. The array takes ownership of the object on success. 322 322 */ 323 in t replace(size_t a_idx, ElementType *a_pThat)323 inline int replace(size_t a_idx, ElementType *a_pThat) 324 324 { 325 325 return insertWorker(a_idx, a_pThat, true /*a_fReplace*/); … … 334 334 * @param a_rThat The object to insert a copy of. 335 335 */ 336 in t replaceCopy(size_t a_idx, ElementType const &a_rThat)336 inline int replaceCopy(size_t a_idx, ElementType const &a_rThat) 337 337 { 338 338 return insertCopyWorker(a_idx, a_rThat, true /*a_fReplace*/); … … 345 345 * @param a_idx The array index. 346 346 */ 347 ElementType *at(size_t a_idx)347 inline ElementType *at(size_t a_idx) 348 348 { 349 349 if (a_idx < m_cElements) … … 358 358 * @param a_idx The array index. 359 359 */ 360 ElementType const *at(size_t a_idx) const360 inline ElementType const *at(size_t a_idx) const 361 361 { 362 362 if (a_idx < m_cElements) … … 369 369 * @returns The first object, NULL if empty. 370 370 */ 371 ElementType *first()371 inline ElementType *first() 372 372 { 373 373 return at(0); … … 378 378 * @returns The first object, NULL if empty. 379 379 */ 380 ElementType const *first() const380 inline ElementType const *first() const 381 381 { 382 382 return at(0); … … 387 387 * @returns The last object, NULL if empty. 388 388 */ 389 ElementType *last()389 inline ElementType *last() 390 390 { 391 391 return at(m_cElements - 1); … … 396 396 * @returns The last object, NULL if empty. 397 397 */ 398 ElementType const *last() const398 inline ElementType const *last() const 399 399 { 400 400 return at(m_cElements - 1); -
trunk/include/iprt/cpp/restbase.h
r74176 r74181 85 85 * @param uIndent The indentation level. 86 86 */ 87 unsigned setIndent(unsigned uIndent)87 inline unsigned setIndent(unsigned uIndent) 88 88 { 89 89 unsigned const uRet = m_uIndent; … … 97 97 * @returns Previous indentation level. 98 98 */ 99 unsigned incrementIndent()99 inline unsigned incrementIndent() 100 100 { 101 101 unsigned const uRet = m_uIndent; … … 267 267 * @returns true if null, false if not. 268 268 */ 269 bool isNull(void) const { return m_fNullIndicator; };269 inline bool isNull(void) const { return m_fNullIndicator; }; 270 270 271 271 /** … … 730 730 */ 731 731 int assignValue(PCRTTIMESPEC a_pTimeSpec, kFormat a_enmFormat); 732 int assignValueRfc2822(PCRTTIMESPEC a_pTimeSpec); /**< Convenience method . */733 int assignValueRfc7131(PCRTTIMESPEC a_pTimeSpec); /**< Convenience method . */734 int assignValueRfc3339(PCRTTIMESPEC a_pTimeSpec); /**< Convenience method . */732 int assignValueRfc2822(PCRTTIMESPEC a_pTimeSpec); /**< Convenience method for email/whatnot. */ 733 int assignValueRfc7131(PCRTTIMESPEC a_pTimeSpec); /**< Convenience method for HTTP date. */ 734 int assignValueRfc3339(PCRTTIMESPEC a_pTimeSpec); /**< Convenience method for ISO-8601 timstamp. */ 735 735 736 736 /** … … 742 742 */ 743 743 int assignNow(kFormat a_enmFormat); 744 int assignNowRfc2822(); /**< Convenience method . */745 int assignNowRfc7131(); /**< Convenience method . */746 int assignNowRfc3339(); /**< Convenience method . */744 int assignNowRfc2822(); /**< Convenience method for email/whatnot. */ 745 int assignNowRfc7131(); /**< Convenience method for HTTP date. */ 746 int assignNowRfc3339(); /**< Convenience method for ISO-8601 timstamp. */ 747 747 748 748 /** … … 756 756 757 757 /** Check if the value is okay (m_TimeSpec & m_Exploded). */ 758 bool isOkay() const{ return m_fTimeSpecOkay; }758 inline bool isOkay() const { return m_fTimeSpecOkay; } 759 759 /** Get the timespec value. */ 760 RTTIMESPEC const &getTimeSpec() const{ return m_TimeSpec; }760 inline RTTIMESPEC const &getTimeSpec() const { return m_TimeSpec; } 761 761 /** Get the exploded time. */ 762 RTTIME const &getExploded() const { return m_Exploded; } 762 inline RTTIME const &getExploded() const { return m_Exploded; } 763 /** Gets the format. */ 764 inline kFormat getFormat() const { return m_enmFormat; } 763 765 /** Get the formatted/raw string value. */ 764 RTCString const &getString() const { return m_strFormatted; } 766 inline RTCString const &getString() const { return m_strFormatted; } 767 768 /** Get nanoseconds since unix epoch. */ 769 inline int64_t getEpochNano() const { return RTTimeSpecGetNano(&m_TimeSpec); } 770 /** Get seconds since unix epoch. */ 771 inline int64_t getEpochSeconds() const { return RTTimeSpecGetSeconds(&m_TimeSpec); } 772 /** Checks if UTC time. */ 773 inline bool isUtc() const { return (m_Exploded.fFlags & RTTIME_FLAGS_TYPE_MASK) != RTTIME_FLAGS_TYPE_LOCAL; } 774 /** Checks if local time. */ 775 inline bool isLocal() const { return (m_Exploded.fFlags & RTTIME_FLAGS_TYPE_MASK) == RTTIME_FLAGS_TYPE_LOCAL; } 765 776 766 777 protected: … … 841 852 int assignCopy(RTCRestStringEnumBase const &a_rThat); 842 853 /** Safe copy assignment method. */ 843 in t assignCopy(RTCString const &a_rThat) { return setByString(a_rThat); }844 /** Safe copy assignment method. */ 845 in t assignCopy(const char *a_pszThat) { return setByString(a_pszThat); }854 inline int assignCopy(RTCString const &a_rThat) { return setByString(a_rThat); } 855 /** Safe copy assignment method. */ 856 inline int assignCopy(const char *a_pszThat) { return setByString(a_pszThat); } 846 857 847 858 /* Overridden methods: */ … … 940 951 941 952 /** Returns a pointer to the data blob. */ 942 const uint8_t *getPtr() const { return m_pbData; }953 inline const uint8_t *getPtr() const { return m_pbData; } 943 954 /** Gets the size of the data. */ 944 size_t getSize() const { return m_cbData; }955 inline size_t getSize() const { return m_cbData; } 945 956 946 957 /* Overridden methods: */ -
trunk/include/iprt/cpp/restclient.h
r74142 r74181 75 75 * Retrieves the callback data. 76 76 */ 77 void *getCallbackData() const { return m_pvCallbackData; }77 inline void *getCallbackData() const { return m_pvCallbackData; } 78 78 79 79 /** … … 89 89 * Gets the content type that was set. 90 90 */ 91 RTCString const &getContentType() const { return m_strContentType; }91 inline RTCString const &getContentType() const { return m_strContentType; } 92 92 93 93 /** … … 199 199 * Retrieves the callback data. 200 200 */ 201 void *getCallbackData() const { return m_pvCallbackData; }201 inline void *getCallbackData() const { return m_pvCallbackData; } 202 202 203 203 /** … … 216 216 * Gets the content-length value (UINT64_MAX if not available). 217 217 */ 218 uint64_t getContentLength() const { return m_cbContentLength; }218 inline uint64_t getContentLength() const { return m_cbContentLength; } 219 219 220 220 /** … … 340 340 * Checks if there are were any assignment errors. 341 341 */ 342 bool hasAssignmentErrors() const { return m_fErrorSet != 0; }342 inline bool hasAssignmentErrors() const { return m_fErrorSet != 0; } 343 343 344 344 protected: … … 498 498 * @returns Negative numbers are IPRT errors, positive are HTTP status codes. 499 499 */ 500 in t getStatus() { return m_rcStatus; }500 inline int getStatus() { return m_rcStatus; } 501 501 502 502 /** … … 504 504 * @returns HTTP status code or VERR_NOT_AVAILABLE. 505 505 */ 506 in t getHttpStatus() { return m_rcHttp; }506 inline int getHttpStatus() { return m_rcHttp; } 507 507 508 508 /** 509 509 * Getter for m_pErrInfo. 510 510 */ 511 PCRTERRINFO getErrInfo(void) const { return m_pErrInfo; }511 inline PCRTERRINFO getErrInfo(void) const { return m_pErrInfo; } 512 512 513 513 /** 514 514 * Getter for m_strContentType. 515 515 */ 516 RTCString const &getContentType(void) const { return m_strContentType; }516 inline RTCString const &getContentType(void) const { return m_strContentType; } 517 517 518 518 … … 632 632 * @returns Base URL string. If empty, we'll be using the default one. 633 633 */ 634 RTCString const &getBasePath(void) const634 inline RTCString const &getBasePath(void) const 635 635 { 636 636 return m_strBasePath; … … 661 661 * @note Defers to the C-string variant. 662 662 */ 663 void setBasePath(RTCString const &a_strPath) { setBasePath(a_strPath.c_str()); }663 inline void setBasePath(RTCString const &a_strPath) { setBasePath(a_strPath.c_str()); } 664 664 665 665 /** -
trunk/include/iprt/cpp/reststringmap.h
r74029 r74181 160 160 161 161 /** Gets the key string. */ 162 RTCString const &getKey() { return m_pCur->strKey; }162 inline RTCString const &getKey() { return m_pCur->strKey; } 163 163 /** Gets poitner to the value object. */ 164 RTCRestObjectBase const *getValue() { return m_pCur->pValue; }164 inline RTCRestObjectBase const *getValue() { return m_pCur->pValue; } 165 165 166 166 /** Advance to the next map entry. */ 167 ConstIterator &operator++()167 inline ConstIterator &operator++() 168 168 { 169 169 m_pCur = RTListNodeGetNextCpp(&m_pCur->ListEntry, MapEntry, ListEntry); … … 172 172 173 173 /** Advance to the previous map entry. */ 174 ConstIterator &operator--()174 inline ConstIterator &operator--() 175 175 { 176 176 m_pCur = RTListNodeGetPrevCpp(&m_pCur->ListEntry, MapEntry, ListEntry); … … 179 179 180 180 /** Compare equal. */ 181 bool operator==(ConstIterator const &a_rThat) { return m_pCur == a_rThat.m_pCur; }181 inline bool operator==(ConstIterator const &a_rThat) { return m_pCur == a_rThat.m_pCur; } 182 182 /** Compare not equal. */ 183 bool operator!=(ConstIterator const &a_rThat) { return m_pCur != a_rThat.m_pCur; }183 inline bool operator!=(ConstIterator const &a_rThat) { return m_pCur != a_rThat.m_pCur; } 184 184 185 185 /* Map class must be friend so it can use the MapEntry constructor. */ … … 188 188 189 189 /** Returns iterator for the first map entry (unless it's empty and it's also the end). */ 190 ConstIterator begin() const { return ConstIterator(RTListGetFirstCpp(&m_ListHead, MapEntry, ListEntry)); }190 inline ConstIterator begin() const { return ConstIterator(RTListGetFirstCpp(&m_ListHead, MapEntry, ListEntry)); } 191 191 /** Returns iterator for the last map entry (unless it's empty and it's also the end). */ 192 ConstIterator last() const { return ConstIterator(RTListGetLastCpp(&m_ListHead, MapEntry, ListEntry)); }192 inline ConstIterator last() const { return ConstIterator(RTListGetLastCpp(&m_ListHead, MapEntry, ListEntry)); } 193 193 /** Returns the end iterator. This does not ever refer to an actual map entry. */ 194 ConstIterator end() const { return ConstIterator(RT_FROM_CPP_MEMBER(&m_ListHead, MapEntry, ListEntry)); }194 inline ConstIterator end() const { return ConstIterator(RT_FROM_CPP_MEMBER(&m_ListHead, MapEntry, ListEntry)); } 195 195 /** @} */ 196 196 … … 327 327 * @param a_fReplace Whether to replace existing key-value pair with matching key. 328 328 */ 329 in t put(const char *a_pszKey, ValueType *a_pValue, bool a_fReplace = false)329 inline int put(const char *a_pszKey, ValueType *a_pValue, bool a_fReplace = false) 330 330 { 331 331 return putWorker(a_pszKey, a_pValue, a_fReplace); … … 341 341 * @param a_fReplace Whether to replace existing key-value pair with matching key. 342 342 */ 343 in t put(RTCString const &a_rStrKey, ValueType *a_pValue, bool a_fReplace = false)343 inline int put(RTCString const &a_rStrKey, ValueType *a_pValue, bool a_fReplace = false) 344 344 { 345 345 return putWorker(a_rStrKey.c_str(), a_pValue, a_fReplace, a_rStrKey.length()); … … 355 355 * @param a_fReplace Whether to replace existing key-value pair with matching key. 356 356 */ 357 in t putCopy(const char *a_pszKey, const ValueType &a_rValue, bool a_fReplace = false)357 inline int putCopy(const char *a_pszKey, const ValueType &a_rValue, bool a_fReplace = false) 358 358 { 359 359 return putCopyWorker(a_pszKey, a_rValue, a_fReplace); … … 369 369 * @param a_fReplace Whether to replace existing key-value pair with matching key. 370 370 */ 371 in t putCopy(RTCString const &a_rStrKey, const ValueType &a_rValue, bool a_fReplace = false)371 inline int putCopy(RTCString const &a_rStrKey, const ValueType &a_rValue, bool a_fReplace = false) 372 372 { 373 373 return putCopyWorker(a_rStrKey.c_str(), a_rValue, a_fReplace, a_rStrKey.length()); … … 380 380 * @param a_pszKey The key which value to look up. 381 381 */ 382 ValueType *get(const char *a_pszKey)382 inline ValueType *get(const char *a_pszKey) 383 383 { 384 384 return (ValueType *)getWorker(a_pszKey); … … 391 391 * @param a_rStrKey The key which value to look up. 392 392 */ 393 ValueType *get(RTCString const &a_rStrKey)393 inline ValueType *get(RTCString const &a_rStrKey) 394 394 { 395 395 return (ValueType *)getWorker(a_rStrKey.c_str()); … … 402 402 * @param a_pszKey The key which value to look up. 403 403 */ 404 ValueType const *get(const char *a_pszKey) const404 inline ValueType const *get(const char *a_pszKey) const 405 405 { 406 406 return (ValueType const *)getWorker(a_pszKey); … … 413 413 * @param a_rStrKey The key which value to look up. 414 414 */ 415 ValueType const *get(RTCString const &a_rStrKey) const415 inline ValueType const *get(RTCString const &a_rStrKey) const 416 416 { 417 417 return (ValueType const *)getWorker(a_rStrKey.c_str());
Note:
See TracChangeset
for help on using the changeset viewer.