Public Member Functions | |
OFString () | |
Default constructor. | |
OFString (const OFString &str, size_t pos=0, size_t n=OFString_npos) | |
Constructs a string from the given input string str. | |
OFString (const char *s, size_t n) | |
This constructor copies n characters starting at s, and constructs a string object initialized with the corresponding characters. | |
OFString (const char *s) | |
Constructs a string object from the array pointed to by the input pointer s. | |
OFString (size_t rep, char c) | |
Constructs a string object with the character c repeated rep times. | |
~OFString () | |
destructor | |
OFString & | operator= (const OFString &rhs) |
assigns the input string to the current string. | |
OFString & | operator= (const char *s) |
constructs a temporary string from the input s and assigns it to the current string. | |
OFString & | operator= (char s) |
constructs a temporary string from the input s and assigns it to the current string. | |
OFString & | operator+= (const OFString &rhs) |
Appends the input string to the current string. | |
OFString & | operator+= (const char *s) |
constructs a temporary string from the input s and appends it to the current string. | |
OFString & | operator+= (char s) |
constructs a temporary string from the input s and appends it to the current string. | |
OFString & | append (const OFString &str, size_t pos=0, size_t n=OFString_npos) |
Appends characters from the input string str to the current string object. | |
OFString & | append (const char *s, size_t n) |
constructs a temporary string from the input and appends it to the current string. | |
OFString & | append (const char *s) |
constructs a temporary string from the input and appends it to the current string. | |
OFString & | append (size_t rep, char c) |
constructs a temporary string from the input and appends it to the current string. | |
OFString & | assign (const OFString &str, size_t pos=0, size_t n=OFString_npos) |
Assigns characters from the input string str to the current string object. | |
OFString & | assign (const char *s, size_t n) |
constructs a temporary string from the input and assigns it to the current string. | |
OFString & | assign (const char *s) |
constructs a temporary string from the input and assigns it to the current string. | |
OFString & | assign (size_t rep, char c) |
constructs a temporary string from the input and assigns it to the current string. | |
OFString & | insert (size_t pos1, const OFString &str, size_t pos2=0, size_t n=OFString_npos) |
Inserts at most n characters, starting at position pos2 of the input string str, into the current string. | |
OFString & | insert (size_t pos, const char *s, size_t n) |
constructs a temporary string from the input and inserts it into the current string. | |
OFString & | insert (size_t pos, const char *s) |
constructs a temporary string from the input and inserts it into the current string. | |
OFString & | insert (size_t pos, size_t rep, char c) |
constructs a temporary string from the input and inserts it into the current string. | |
OFString & | erase (size_t pos=0, size_t n=OFString_npos) |
Removes up to n characters from the string starting from position pos. | |
OFString & | replace (size_t pos1, size_t n1, const OFString &str, size_t pos2=0, size_t n2=OFString_npos) |
replaces a range of characters in the current string with a range of characters taken from the input string str. | |
OFString & | replace (size_t pos, size_t n, const char *s, size_t n2) |
constructs a temporary string from the input and replaces the range [pos, n] in the current string with the constructed string. | |
OFString & | replace (size_t pos, size_t n, const char *s) |
constructs a temporary string from the input and replaces the range [pos, n] in the current string with the constructed string. | |
OFString & | replace (size_t pos, size_t n, size_t rep, char s) |
constructs a temporary string from the input and replaces the range [pos, n] in the current string with the constructed string. | |
const char & | at (size_t pos) const |
returns a constant reference to the character at position pos of the current string. | |
char & | at (size_t pos) |
returns a non-const reference to the character at position pos of the current string. | |
char | operator[] (size_t pos) const |
returns the element at position pos of the current string. | |
char & | operator[] (size_t pos) |
returns the element at position pos of the current string. | |
const char * | c_str () const |
returns a pointer to the initial element of an array of length size()+1 whose first size() elements equal the corresponding elements of the current string and whose last element is a null character. | |
const char * | data () const |
if size() is nonzero, this function returns a pointer to the initial element of an array whose first size() elements equal the corresponding elements of the string controlled by *this. | |
size_t | size () const |
returns a count of the number of char-like objects currently in the string. | |
size_t | length () const |
returns a count of the number of char-like objects currently in the string. | |
OFBool | empty () const |
return true if the string is empty, false otherwise. | |
void | resize (size_t n, char c= '\0') |
if n <= size(), truncates the string to length n else it pads the extra locations with c. | |
size_t | capacity () const |
returns the size of the allocated storage in the string. | |
size_t | max_size () const |
returns the maximum size of a string which could possibly by allocated. | |
void | clear () |
empty the string of all contents | |
void | reserve (size_t res_arg) |
directive that informs a string of a planned change in size, so that it can manage the storage allocation accordingly. | |
size_t | copy (char *s, size_t n, size_t pos=0) const |
replaces the string designated by s with a copy of a range of characters from the current string. | |
OFString | substr (size_t pos=0, size_t n=OFString_npos) const |
returns a copy the substring consisting of at most n characters starting at position pos of the current string. | |
void | swap (OFString &s) |
swaps the contents of the two strings. | |
int | compare (const OFString &str) const |
determines the effective length rlen of the strings to compare as the smallest of size() and str.size(). | |
int | compare (size_t pos1, size_t n1, const OFString &str) const |
constructs a temporary string from the input and compares it with the current string | |
int | compare (size_t pos1, size_t n1, const OFString &str, size_t pos2, size_t n2) const |
constructs a temporary string from this object and another temporary from the input and compares the two temporaries | |
int | compare (const char *s) const |
constructs a temporary string from the input and compares it with the current string | |
int | compare (size_t pos1, size_t n1, const char *s, size_t n2=OFString_npos) const |
constructs a temporary string from this object and another temporary from the input and compares the two temporaries | |
size_t | find (const OFString &pattern, size_t pos=0) const |
determines the earliest occurrence of the input pattern in the current string object, starting from position pos in the current string. | |
size_t | find (const char *pattern, size_t pos, size_t n) const |
creates a pattern string from the input and determines the earliest occurrence of the pattern in the current string object, starting from position pos in the current string. | |
size_t | find (const char *pattern, size_t pos=0) const |
creates a pattern string from the input and determines the earliest occurrence of the pattern in the current string object, starting from position pos in the current string. | |
size_t | find (char pattern, size_t pos=0) const |
creates a pattern string from the input and determines the earliest occurrence of the pattern in the current string object, starting from position pos in the current string. | |
size_t | rfind (const OFString &pattern, size_t pos=OFString_npos) const |
scans the current string backwards, and finds the first occurrence of pattern in the string (from the back). | |
size_t | rfind (const char *pattern, size_t pos, size_t n) const |
scans the current string backwards, and finds the first occurrence of pattern in the string (from the back). | |
size_t | rfind (const char *pattern, size_t pos=OFString_npos) const |
scans the current string backwards, and finds the first occurrence of pattern in the string (from the back). | |
size_t | rfind (char pattern, size_t pos=OFString_npos) const |
scans the current string backwards, and finds the first occurrence of pattern in the string (from the back). | |
size_t | find_first_of (const OFString &str, size_t pos=0) const |
determines the first location, loc, between pos and the end of the current string, such that the character at loc matches at least one character from the set of characters. | |
size_t | find_first_of (const char *s, size_t pos, size_t n) const |
determines the first location, loc, between pos and the end of the current string, such that the character at loc matches at least one character from the set of characters. | |
size_t | find_first_of (const char *s, size_t pos=0) const |
determines the first location, loc, between pos and the end of the current string, such that the character at loc matches at least one character from the set of characters. | |
size_t | find_first_of (char s, size_t pos=0) const |
determines the first location, loc, between pos and the end of the current string, such that the character at loc matches the given character. | |
size_t | find_last_of (const OFString &str, size_t pos=OFString_npos) const |
determines the highest location, loc, up to pos, such that the character at loc matches at least one character from the set of characters. | |
size_t | find_last_of (const char *s, size_t pos, size_t n) const |
determines the highest location, loc, up to pos, such that the character at loc matches at least one character from the set of characters. | |
size_t | find_last_of (const char *s, size_t pos=OFString_npos) const |
determines the highest location, loc, up to pos, such that the character at loc matches at least one character from the set of characters. | |
size_t | find_last_of (char s, size_t pos=OFString_npos) const |
determines the highest location, loc, up to pos, such that the character at loc matches the given character. | |
size_t | find_first_not_of (const OFString &str, size_t pos=0) const |
determines the first location loc, between pos and the end of the current string, such that the character at loc does not match any character from the set of characters. | |
size_t | find_first_not_of (const char *s, size_t pos, size_t n) const |
determines the first location loc, between pos and the end of the current string, such that the character at loc does not match any character from the set of characters. | |
size_t | find_first_not_of (const char *s, size_t pos=0) const |
determines the first location loc, between pos and the end of the current string, such that the character at loc does not match any character from the set of characters. | |
size_t | find_first_not_of (char c, size_t pos=0) const |
determines the first location loc, between pos and the end of the current string, such that the character at loc does not match the given character. | |
size_t | find_last_not_of (const OFString &str, size_t pos=OFString_npos) const |
scans the current string up to the position pos and determines the highest location, loc, such that the character at loc does not match any character from the set of characters. | |
size_t | find_last_not_of (const char *s, size_t pos, size_t n) const |
scans the current string up to the position pos and determines the highest location, loc, such that the character at loc does not match any character from the set of characters. | |
size_t | find_last_not_of (const char *s, size_t pos=OFString_npos) const |
scans the current string up to the position pos and determines the highest location, loc, such that the character at loc does not match any character from the set of characters. | |
size_t | find_last_not_of (char c, size_t pos=OFString_npos) const |
scans the current string up to the position pos and determines the highest location, loc, such that the character at loc does not match the given character. | |
Private Attributes | |
char * | theCString |
the "C" string pointer | |
size_t | theCapacity |
the capacity of str |
It does not implement iterators or traits and is not optimized for speed.
Definition at line 84 of file ofstring.h.
|
Default constructor. Constructs an empty string. |
|
Constructs a string from the given input string str. The effective length rlen of the constructed string is the smaller of n and str.size() - pos, and the string is constructed by copying rlen characters starting at position pos of the input string str. The function throws an out-of-range error if pos > str.size().
|
|
This constructor copies n characters starting at s, and constructs a string object initialized with the corresponding characters. NOTE: If n > length(s), then junk characters are appended to the end of the string. i.e. n characters are copied regardless of the exact length of the array pointed to by the input pointer s.
|
|
Constructs a string object from the array pointed to by the input pointer s. It is assumed that s is not a null pointer.
|
|
Constructs a string object with the character c repeated rep times. Reports a length error if rep equals npos.
|
|
constructs a temporary string from the input and appends it to the current string.
|
|
constructs a temporary string from the input and appends it to the current string.
|
|
constructs a temporary string from the input and appends it to the current string.
|
|
Appends characters from the input string str to the current string object. At most n characters, starting at position pos of str, are appended. The function reports an out-of-range error if pos > str.size().
|
|
constructs a temporary string from the input and assigns it to the current string.
|
|
constructs a temporary string from the input and assigns it to the current string.
|
|
constructs a temporary string from the input and assigns it to the current string.
|
|
Assigns characters from the input string str to the current string object. At most n characters, starting at position pos of str, are appended. The function reports an out-of-range error if pos > str.size().
|
|
returns a non-const reference to the character at position pos of the current string. if pos >= size(), throws out_of_range exception.
Definition at line 346 of file ofstring.h. |
|
returns a constant reference to the character at position pos of the current string. if pos >= size(), throws out_of_range exception.
Definition at line 334 of file ofstring.h. |
|
returns a pointer to the initial element of an array of length size()+1 whose first size() elements equal the corresponding elements of the current string and whose last element is a null character.
Definition at line 384 of file ofstring.h. Referenced by DcmUIDHandler::c_str(), DVInterface::getAnnotationText(), DVPSCurve::getCurveAxisUnitsX(), DVPSCurve::getCurveAxisUnitsY(), DVPSCurve::getCurveDescription(), DVPSCurve::getCurveLabel(), DiOverlayPlane::getDescription(), DiBaseLUT::getExplanation(), DVInstanceCache::getFilename(), OFConfigFileNode::getKeyword(), DiOverlayPlane::getLabel(), DcmPresentationContextItem::getTransferSyntaxKey(), DVPSFilmSession::getUID(), OFConfigFileNode::getValue(), and DiMonoImage::getVoiTransformationExplanation(). |
|
returns the size of the allocated storage in the string.
Definition at line 434 of file ofstring.h. |
|
constructs a temporary string from this object and another temporary from the input and compares the two temporaries
|
|
constructs a temporary string from the input and compares it with the current string
|
|
constructs a temporary string from this object and another temporary from the input and compares the two temporaries
|
|
constructs a temporary string from the input and compares it with the current string
|
|
determines the effective length rlen of the strings to compare as the smallest of size() and str.size(). The function then compares the two strings by calling strcmp(data(), str.data(), rlen). Returns: the nonzero result if the result of the comparison is nonzero. Otherwise, returns a value < 0 if size() < str.size(), a value of 0 if size() == str.size(), or a value > 0 if size() > str.size().
|
|
replaces the string designated by s with a copy of a range of characters from the current string. The range copied begins at position pos of the current string and extends for n characters or up to the end of the current string, whichever comes first. Does not append a null object to the end of the string designated by s.
|
|
if size() is nonzero, this function returns a pointer to the initial element of an array whose first size() elements equal the corresponding elements of the string controlled by *this. If size() is zero, the member returns a non-null pointer that is copyable and can have zero added to it.
|
|
return true if the string is empty, false otherwise.
Definition at line 419 of file ofstring.h. Referenced by DiOverlayPlane::getDescription(), DiBaseLUT::getExplanation(), and DiOverlayPlane::getLabel(). |
|
Removes up to n characters from the string starting from position pos.
|
|
creates a pattern string from the input and determines the earliest occurrence of the pattern in the current string object, starting from position pos in the current string. If find can determine such an occurrence, it returns the starting index of pattern in the current string. Otherwise, it returns string::npos.
|
|
creates a pattern string from the input and determines the earliest occurrence of the pattern in the current string object, starting from position pos in the current string. If find can determine such an occurrence, it returns the starting index of pattern in the current string. Otherwise, it returns string::npos.
|
|
creates a pattern string from the input and determines the earliest occurrence of the pattern in the current string object, starting from position pos in the current string. If find can determine such an occurrence, it returns the starting index of pattern in the current string. Otherwise, it returns string::npos.
|
|
determines the earliest occurrence of the input pattern in the current string object, starting from position pos in the current string. If find can determine such an occurrence, it returns the starting index of pattern in the current string. Otherwise, it returns string::npos.
|
|
determines the first location loc, between pos and the end of the current string, such that the character at loc does not match the given character. If such a location is found, it is returned. Otherwise, the function returns string::npos.
|
|
determines the first location loc, between pos and the end of the current string, such that the character at loc does not match any character from the set of characters. If such a location is found, it is returned. Otherwise, the function returns string::npos.
|
|
determines the first location loc, between pos and the end of the current string, such that the character at loc does not match any character from the set of characters. If such a location is found, it is returned. Otherwise, the function returns string::npos.
|
|
determines the first location loc, between pos and the end of the current string, such that the character at loc does not match any character from the set of characters. If such a location is found, it is returned. Otherwise, the function returns string::npos.
|
|
determines the first location, loc, between pos and the end of the current string, such that the character at loc matches the given character. If such a location can be determined, it is returned. Otherwise, the function returns string::npos.
|
|
determines the first location, loc, between pos and the end of the current string, such that the character at loc matches at least one character from the set of characters. If such a location can be determined, it is returned. Otherwise, the function returns string::npos.
|
|
determines the first location, loc, between pos and the end of the current string, such that the character at loc matches at least one character from the set of characters. If such a location can be determined, it is returned. Otherwise, the function returns string::npos.
|
|
determines the first location, loc, between pos and the end of the current string, such that the character at loc matches at least one character from the set of characters. If such a location can be determined, it is returned. Otherwise, the function returns string::npos.
|
|
scans the current string up to the position pos and determines the highest location, loc, such that the character at loc does not match the given character. If such a location is found, it is returned. Otherwise, the function returns string::npos.
|
|
scans the current string up to the position pos and determines the highest location, loc, such that the character at loc does not match any character from the set of characters. If such a location is found, it is returned. Otherwise, the function returns string::npos.
|
|
scans the current string up to the position pos and determines the highest location, loc, such that the character at loc does not match any character from the set of characters. If such a location is found, it is returned. Otherwise, the function returns string::npos.
|
|
scans the current string up to the position pos and determines the highest location, loc, such that the character at loc does not match any character from the set of characters. If such a location is found, it is returned. Otherwise, the function returns string::npos.
|
|
determines the highest location, loc, up to pos, such that the character at loc matches the given character. If such a location can be determined, it is returned. Otherwise, the function returns string::npos.
|
|
determines the highest location, loc, up to pos, such that the character at loc matches at least one character from the set of characters. If such a location can be determined, it is returned. Otherwise, the function returns string::npos.
|
|
determines the highest location, loc, up to pos, such that the character at loc matches at least one character from the set of characters. If such a location can be determined, it is returned. Otherwise, the function returns string::npos.
|
|
determines the highest location, loc, up to pos, such that the character at loc matches at least one character from the set of characters. If such a location can be determined, it is returned. Otherwise, the function returns string::npos.
|
|
constructs a temporary string from the input and inserts it into the current string.
|
|
constructs a temporary string from the input and inserts it into the current string.
|
|
constructs a temporary string from the input and inserts it into the current string.
|
|
Inserts at most n characters, starting at position pos2 of the input string str, into the current string. The characters are inserted starting at position pos1 in the current string. The function reports an out-of-range error if pos > str.size().
|
|
returns a count of the number of char-like objects currently in the string.
Definition at line 411 of file ofstring.h. |
|
returns the maximum size of a string which could possibly by allocated.
Definition at line 442 of file ofstring.h. |
|
constructs a temporary string from the input s and appends it to the current string.
|
|
constructs a temporary string from the input s and appends it to the current string.
|
|
Appends the input string to the current string.
|
|
constructs a temporary string from the input s and assigns it to the current string.
|
|
constructs a temporary string from the input s and assigns it to the current string.
|
|
assigns the input string to the current string.
|
|
returns the element at position pos of the current string. The reference returned is invalid after a subsequent call to any non-const member function for the object.
Definition at line 373 of file ofstring.h. |
|
returns the element at position pos of the current string. Returns '' if pos == size().
Definition at line 357 of file ofstring.h. |
|
constructs a temporary string from the input and replaces the range [pos, n] in the current string with the constructed string.
|
|
constructs a temporary string from the input and replaces the range [pos, n] in the current string with the constructed string.
|
|
constructs a temporary string from the input and replaces the range [pos, n] in the current string with the constructed string.
|
|
replaces a range of characters in the current string with a range of characters taken from the input string str. The range to be replaced starts at position pos1 in the current string, and extends for n1 characters, or up to the end of the string, whichever comes first. The range of characters inserted starts at position pos2 of the input string str, and extends for n2 characters, or up to the end of the string str, whichever comes first.
|
|
directive that informs a string of a planned change in size, so that it can manage the storage allocation accordingly. Reallocation of a string happens if and only if the current capacity is less than res_arg. After this call, capacity() is greater than or equal to res_arg if reallocation happens and equal to the previous value of capacity() otherwise.
|
|
if n <= size(), truncates the string to length n else it pads the extra locations with c. Reports a length error if n equals OFString_npos.
|
|
scans the current string backwards, and finds the first occurrence of pattern in the string (from the back). The starting index of the matched position in the current string should be less than or equal to the parameter pos. If a match is found, the starting index is returned; otherwise, the function returns string::npos.
|
|
scans the current string backwards, and finds the first occurrence of pattern in the string (from the back). The starting index of the matched position in the current string should be less than or equal to the parameter pos. If a match is found, the starting index is returned; otherwise, the function returns string::npos.
|
|
scans the current string backwards, and finds the first occurrence of pattern in the string (from the back). The starting index of the matched position in the current string should be less than or equal to the parameter pos. If a match is found, the starting index is returned; otherwise, the function returns string::npos.
|
|
scans the current string backwards, and finds the first occurrence of pattern in the string (from the back). The starting index of the matched position in the current string should be less than or equal to the parameter pos. If a match is found, the starting index is returned; otherwise, the function returns string::npos.
|
|
returns a count of the number of char-like objects currently in the string.
Definition at line 402 of file ofstring.h. |
|
returns a copy the substring consisting of at most n characters starting at position pos of the current string.
|
|
swaps the contents of the two strings. The time complexity of this function is linear.
|