8#ifndef INCLUDED_BDLB_STRING
9#define INCLUDED_BDLB_STRING
119#include <bdlscm_version.h>
127#include <bsl_climits.h>
128#include <bsl_cstddef.h>
129#include <bsl_cstring.h>
130#include <bsl_string.h>
151 const char *rhsString,
157 const char *rhsString);
160 const char *rhsString,
166 const char *rhsString);
168 const char *rhsString,
197 static char *
copy(
const char *
string,
213 const char *rhsString,
220 const char *rhsString);
223 const char *rhsString,
230 const char *rhsString);
232 const char *rhsString,
254 static void ltrim(std::string *
string);
255#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
256 static void ltrim(std::pmr::string *
string);
267 static void ltrim(
char *
string,
int *length);
269 static void pad(
bsl::string *
string,
int length,
char padChar =
' ');
275 static void pad(std::string *
string,
int length,
char padChar =
' ');
277#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
282 static void pad(std::pmr::string *
string,
283 std::pmr::string::size_type length,
295 static void rtrim(std::string *
string);
296#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
297 static void rtrim(std::pmr::string *
string);
306 static void rtrim(
const char *
string,
int *length);
316 static const char *
strstr(
const char *
string,
318 const char *subString,
332 const char *subString,
344 static const char *
strrstr(
const char *
string,
346 const char *subString,
360 const char *subString,
367 static int strnlen(
const char *
string,
int maximumLength);
380 const char *srcString,
385 static void toLower(
char *
string,
int length);
391 static void toLower(std::string *
string);
392#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
393 static void toLower(std::pmr::string *
string);
397 static void toUpper(
char *
string,
int length);
403 static void toUpper(std::string *
string);
404#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
405 static void toUpper(std::pmr::string *
string);
408 static void trim(
char *
string);
417 static void trim(std::string *
string);
418#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
419 static void trim(std::pmr::string *
string);
431 static void trim(
char *
string,
int *length);
450 const char *rhsString,
457 const char *rhsString);
460 const char *rhsString,
466 const char *rhsString);
468 const char *rhsString,
501 static_cast<int>(rhsString.
size()));
507 const char *rhsString)
528 static_cast<int>(rhsString.
size()));
533 const char *rhsString)
540 static_cast<int>(lhsString.
size()));
545 const char *rhsString,
553 static_cast<int>(lhsString.
size()),
566 static_cast<int>(lhsString.
size()),
568 static_cast<int>(rhsString.
size()));
579 static_cast<int>(bsl::strlen(
string)),
590 return copy(
string.data(),
591 static_cast<int>(
string.size()),
604 static_cast<int>(rhsString.
size()));
610 const char *rhsString)
631 static_cast<int>(rhsString.
size()));
636 const char *rhsString)
643 static_cast<int>(lhsString.
size()));
648 const char *rhsString,
656 static_cast<int>(lhsString.
size()),
669 static_cast<int>(lhsString.
size()),
671 static_cast<int>(rhsString.
size()));
680 int length =
static_cast<int>(
string->size());
682 ltrim(&(*
string)[0], &length);
683 string->resize(length);
692 int length =
static_cast<int>(
string->size());
694 ltrim(&(*
string)[0], &length);
695 string->resize(length);
698#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
705 int length =
static_cast<int>(
string->size());
707 ltrim(&(*
string)[0], &length);
708 string->resize(length);
718 if (string->size() <
static_cast<bsl::size_t
>(length)) {
719 string->resize(length, padChar);
729 if (string->size() <
static_cast<bsl::size_t
>(length)) {
730 string->resize(length, padChar);
734#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
737 std::pmr::string::size_type length,
742 if (string->size() < length) {
743 string->resize(length, padChar);
754 int length =
static_cast<int>(
string->size());
756 rtrim(&(*
string)[0], &length);
757 string->resize(length);
766 int length =
static_cast<int>(
string->size());
768 rtrim(&(*
string)[0], &length);
769 string->resize(length);
772#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
779 int length =
static_cast<int>(
string->size());
781 rtrim(&(*
string)[0], &length);
782 string->resize(length);
792 toLower(&(*
string)[0],
static_cast<int>(string->size()));
801 toLower(&(*
string)[0],
static_cast<int>(string->size()));
804#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
811 toLower(&(*
string)[0],
static_cast<int>(string->size()));
821 toUpper(&(*
string)[0],
static_cast<int>(string->size()));
830 toUpper(&(*
string)[0],
static_cast<int>(string->size()));
833#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
840 toUpper(&(*
string)[0],
static_cast<int>(string->size()));
851 rtrim(
string, length);
852 ltrim(
string, length);
861 int length =
static_cast<int>(
string->size());
863 rtrim(&(*
string)[0], &length);
864 ltrim(&(*
string)[0], &length);
865 string->resize(length);
874 int length =
static_cast<int>(
string->size());
876 rtrim(&(*
string)[0], &length);
877 ltrim(&(*
string)[0], &length);
878 string->resize(length);
881#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
888 int length =
static_cast<int>(
string->size());
890 rtrim(&(*
string)[0], &length);
891 ltrim(&(*
string)[0], &length);
892 string->resize(length);
905 static_cast<int>(rhsString.
size()));
911 const char *rhsString)
932 static_cast<int>(rhsString.
size()));
937 const char *rhsString)
944 static_cast<int>(lhsString.
size()));
949 const char *rhsString,
957 static_cast<int>(lhsString.
size()),
970 static_cast<int>(lhsString.
size()),
972 static_cast<int>(rhsString.
size()));
Definition bslstl_string.h:1281
size_type size() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:6592
CHAR_TYPE * data() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:6477
Definition bslma_allocator.h:457
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlb_algorithmworkaroundutil.h:74
Definition bdlb_string.h:145
static char * copy(const char *string, int length, bslma::Allocator *basicAllocator)
static bool areEqualCaseless(const char *lhsString, int lhsLength, const char *rhsString, int rhsLength)
static void toFixedLength(char *dstString, int dstLength, const char *srcString, int srcLength, char padChar=' ')
static void toLower(char *string)
static void skipLeadingTrailing(const char **begin, const char **end)
static const char * strrstr(const char *string, int stringLen, const char *subString, int subStringLen)
static char * copy(const char *string, bslma::Allocator *basicAllocator)
Definition bdlb_string.h:572
static void ltrim(char *string)
static bool areEqualCaseless(const char *lhsString, const char *rhsString)
static void toUpper(char *string)
static const char * strstr(const char *string, int stringLen, const char *subString, int subStringLen)
static void trim(char *string)
static void pad(bsl::string *string, int length, char padChar=' ')
Definition bdlb_string.h:713
static int lowerCaseCmp(const char *lhsString, const char *rhsString, int rhsLength)
static bool areEqualCaseless(const char *lhsString, const char *rhsString, int rhsLength)
static const char * strrstrCaseless(const char *string, int stringLen, const char *subString, int subStringLen)
static void rtrim(const char *string, int *length)
static void toUpper(char *string, int length)
static int lowerCaseCmp(const char *lhsString, int lhsLength, const char *rhsString, int rhsLength)
static int upperCaseCmp(const char *lhsString, int lhsLength, const char *rhsString, int rhsLength)
static int lowerCaseCmp(const char *lhsString, const char *rhsString)
static int upperCaseCmp(const char *lhsString, const char *rhsString, int rhsLength)
static const char * strstrCaseless(const char *string, int stringLen, const char *subString, int subStringLen)
static void rtrim(char *string)
static void toLower(char *string, int length)
static int upperCaseCmp(const char *lhsString, const char *rhsString)
static void ltrim(char *string, int *length)
static int strnlen(const char *string, int maximumLength)