casa
$Rev:20696$
|
String: the storage and methods of handling collections of characters. More...
#include <String.h>
Inherits string.
Public Types | |
typedef string::traits_type | traits_type |
typedef string::value_type | value_type |
typedef string::allocator_type | allocator_type |
typedef string::size_type | size_type |
typedef string::difference_type | difference_type |
typedef string::reference | reference |
typedef string::const_reference | const_reference |
typedef string::pointer | pointer |
typedef string::const_pointer | const_pointer |
typedef string::iterator | iterator |
typedef string::const_iterator | const_iterator |
typedef string::reverse_iterator | reverse_iterator |
typedef string::const_reverse_iterator | const_reverse_iterator |
Public Member Functions | |
String () | |
Default constructor. | |
String (const string &str, size_type pos=0, size_type n=npos) | |
Construct from std string Construct from (part of) other string: acts as copy constructor. | |
String (const Char *s, size_type n) | |
Construct from char* with given length. | |
String (const Char *s) | |
Construct from char array. | |
String (size_type n, Char c) | |
Construct from a single char (repeated n times) | |
template<class InputIterator > | |
String (InputIterator begin, InputIterator end) | |
Construct from iterator. | |
String (Char c) | |
From single char (** aips++ addition). | |
String (const SubString &str) | |
Construct from a SubString. | |
String (ostringstream &os) | |
Construct from a stream. | |
~String () | |
Destructor. | |
String & | operator= (const string &str) |
Assignments (they are all deep copies according to standard) | |
String & | operator= (const SubString &str) |
String & | operator= (const Char *s) |
String & | operator= (Char c) |
SubString | operator() (size_type pos, size_type len) |
aips++ addition: synonym for at(pos, len) | |
String & | operator+= (const string &str) |
Concatenate. | |
String & | operator+= (const Char *s) |
String & | operator+= (Char c) |
const_reference | operator[] (size_type pos) const |
Indexing. | |
reference | operator[] (size_type pos) |
const_reference | elem (size_type pos) const |
*** aips++ addition | |
Char | firstchar () const |
Char | lastchar () const |
iterator | begin () |
Iterators. | |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_type | size () const |
Capacity, size. | |
size_type | length () const |
size_type | max_size () const |
size_type | capacity () const |
Int | allocation () const |
** aips++ addition -- works as a capacity(n) -- Note Int | |
String & | resize (size_type n) |
Resize by truncating or extending with copies of c (default Char()) | |
String & | resize (size_type n, Char c) |
String & | reserve (size_type res_arg=0) |
void | alloc (size_type n) |
** aips++ addition -- works as a resize(n) | |
void | clear () |
Clear the string Warning: clear() executed as erase() due to missing clear() in gcc | |
Bool | empty () const |
Test for empty. | |
const_reference | at (size_type n) const |
Addressing. | |
reference | at (size_type n) |
String & | append (const string &str) |
Append. | |
String & | append (const string &str, size_type pos, size_type n) |
String & | append (const Char *s, size_type n) |
String & | append (const Char *s) |
String & | append (size_type n, Char c) |
template<class InputIterator > | |
String & | append (InputIterator first, InputIterator last) |
String & | append (Char c) |
** aips++ addition | |
String & | assign (const string &str) |
Assign. | |
String & | assign (const string &str, size_type pos, size_type n) |
String & | assign (const Char *s, size_type n) |
String & | assign (const Char *s) |
String & | assign (size_type n, Char c) |
template<class InputIterator > | |
String & | assign (InputIterator first, InputIterator last) |
String & | assign (Char c) |
** aips++ addition | |
String & | insert (size_type pos1, const string &str) |
Insert. | |
String & | insert (size_type pos1, const string &str, size_type pos2, size_type n) |
String & | insert (size_type pos, const Char *s, size_type n) |
String & | insert (size_type pos, const Char *s) |
String & | insert (size_type pos, size_type n, Char c) |
String & | insert (size_type pos, Char c) |
** aips++ addition | |
iterator | insert (iterator p, Char c) |
void | insert (iterator p, size_type n, Char c) |
template<class InputIterator > | |
void | insert (iterator p, InputIterator first, InputIterator last) |
String & | insert (iterator p, const string &str) |
** aips++ additions | |
String & | insert (iterator p, const Char *s, size_type n) |
String & | insert (iterator p, const Char *s) |
Int | compare (const string &str) const |
Compare. | |
Int | compare (size_type pos1, size_type n1, const string &str) const |
Int | compare (size_type pos1, size_type n1, const string &str, size_type pos2, size_type n2) const |
Int | compare (const Char *s) const |
Int | compare (size_type pos1, size_type n1, const Char *s, size_type n2=npos) const |
String & | erase (size_type pos, size_type n=npos) |
Erase. | |
iterator | erase (iterator position) |
iterator | erase (iterator first, iterator last) |
String & | replace (size_type pos1, size_type n1, const string &str) |
Replace. | |
String & | replace (size_type pos1, size_type n1, const string &str, size_type pos2, size_type n2) |
String & | replace (size_type pos, size_type n1, const Char *s, size_type n2) |
String & | replace (size_type pos, size_type n1, const Char *s) |
String & | replace (size_type pos, size_type n1, size_type n2, Char c) |
String & | replace (size_type pos, size_type n1, Char c) |
** aips++ addition | |
String & | replace (iterator i1, iterator i2, const string &str) |
String & | replace (iterator i1, iterator i2, const Char *s, size_type n) |
String & | replace (iterator i1, iterator i2, const Char *s) |
String & | replace (iterator i1, iterator i2, size_type n, Char c) |
String & | replace (iterator i1, iterator i2, Char c) |
** aips++ addition | |
template<class InputIterator > | |
String & | replace (iterator i1, iterator i2, InputIterator j1, InputIterator j2) |
size_type | copy (Char *s, size_type n, size_type pos=0) const |
Copy. | |
void | swap (string &s) |
Swap. | |
const Char * | c_str () const |
Get char array. | |
const Char * | data () const |
As pointer to char array. | |
const Char * | chars () const |
** aips++ synonym | |
allocator_type | get_allocator () const |
Get allocator used Warning: gcc has no get_allocator() | |
String | substr (size_type pos=0, size_type n=npos) const |
Get a sub string. | |
void | trim () |
Remove beginning and ending whitespace. | |
void | trim (char c[], uInt n) |
Remove specified chars from beginning and end of string. | |
void | ltrim (char c) |
Remove specified character from beginning of string. | |
void | rtrim (char c) |
Remove specified character from end of string. | |
Bool | startsWith (const string &beginString) const |
Does the string start with the specified string? | |
size_type | find (const string &str, size_type pos=0) const |
Search functions. | |
size_type | find (const Char *s, size_type pos=0) const |
size_type | find (const Char *s, size_type pos, size_type n) const |
size_type | find (Char c, size_type pos=0) const |
size_type | find (const RegexBase &r, size_type pos=0) const |
size_type | rfind (const string &str, size_type pos=0) const |
size_type | rfind (const Char *s, size_type pos=0) const |
size_type | rfind (const Char *s, size_type pos, size_type n) const |
size_type | rfind (Char c, size_type pos=0) const |
size_type | rfind (const RegexBase &r, size_type pos=0) const |
size_type | find_first_of (const string &str, size_type pos=0) const |
size_type | find_first_of (const Char *s, size_type pos=0) const |
size_type | find_first_of (const Char *s, size_type pos, size_type n) const |
size_type | find_first_of (Char c, size_type pos=0) const |
size_type | find_last_of (const string &str, size_type pos=npos) const |
size_type | find_last_of (const Char *s, size_type pos=npos) const |
size_type | find_last_of (const Char *s, size_type pos, size_type n) const |
size_type | find_last_of (Char c, size_type pos=npos) const |
size_type | find_first_not_of (const string &str, size_type pos=0) const |
size_type | find_first_not_of (const Char *s, size_type pos=0) const |
size_type | find_first_not_of (const Char *s, size_type pos, size_type n) const |
size_type | find_first_not_of (Char c, size_type pos=0) const |
size_type | find_last_not_of (const string &str, size_type pos=npos) const |
size_type | find_last_not_of (const Char *s, size_type pos=npos) const |
size_type | find_last_not_of (const Char *s, size_type pos, size_type n) const |
size_type | find_last_not_of (Char c, size_type pos=npos) const |
void | reverse () |
Maybe forget some. | |
void | capitalize () |
internal transformation to capitalization of String. | |
void | upcase () |
internal transformation to uppercase of String | |
void | downcase () |
internal transformation to lowercase of String | |
void | del (size_type pos, size_type len) |
Delete len chars starting at pos. | |
Bool | contains (Char c) const |
Containment. | |
Bool | contains (const string &str) const |
Bool | contains (const Char *s) const |
Bool | contains (const RegexBase &r) const |
Bool | contains (Char c, Int pos) const |
Containment after (or before if pos negative) pos. | |
Bool | contains (const string &str, Int pos) const |
Bool | contains (const Char *s, Int pos) const |
Bool | contains (const RegexBase &r, Int pos) const |
Bool | matches (const string &str, Int pos=0) const |
Matches entire string from pos (or till pos if negative pos). | |
Bool | matches (Char c, Int pos=0) const |
Bool | matches (const Char *s, Int pos=0) const |
Bool | matches (const RegexBase &r, Int pos=0) const |
void | prepend (const string &str) |
Concatenate by prepending the argument onto String. | |
void | prepend (const Char *s) |
void | prepend (Char c) |
size_type | index (Char c, Int startpos=0) const |
Return the position of the target in the string or npos for failure. | |
size_type | index (const string &str, Int startpos=0) const |
size_type | index (const Char *s, Int startpos=0) const |
size_type | index (const RegexBase &r, Int startpos=0) const |
Int | freq (Char c) const |
Return the number of occurences of target in String. | |
Int | freq (const string &str) const |
Int | freq (const Char *s) const |
SubString | at (size_type pos, size_type len) |
Extract the string "at" the argument's position. | |
String | at (size_type pos, size_type len) const |
SubString | at (const string &str, Int startpos=0) |
String | at (const string &str, Int startpos=0) const |
SubString | at (const Char *s, Int startpos=0) |
String | at (const Char *s, Int startpos=0) const |
SubString | at (Char c, Int startpos=0) |
String | at (Char c, Int startpos=0) const |
SubString | at (const RegexBase &r, Int startpos=0) |
String | at (const RegexBase &r, Int startpos=0) const |
SubString | at (Int pos, Int len) |
Next ones for overloading reasons. | |
String | at (Int pos, Int len) const |
SubString | at (Int pos, size_type len) |
String | at (Int pos, size_type len) const |
SubString | before (size_type pos) |
Start at startpos and extract the string "before" the argument's position, exclusive. | |
SubString | before (const string &str, Int startpos=0) |
SubString | before (const Char *s, Int startpos=0) |
SubString | before (Char c, Int startpos=0) |
SubString | before (const RegexBase &r, Int startpos=0) |
SubString | before (Int pos) |
Next one for overloading reasons. | |
SubString | through (size_type pos) |
Start at startpos and extract the SubString "through" to the argument's position, inclusive. | |
SubString | through (const string &str, Int startpos=0) |
SubString | through (const Char *s, Int startpos=0) |
SubString | through (Char c, Int startpos=0) |
SubString | through (const RegexBase &r, Int startpos=0) |
SubString | through (Int pos) |
Next one for overloading reasons. | |
SubString | from (size_type pos) |
Start at startpos and extract the SubString "from" the argument's position, inclusive, to the String's end. | |
SubString | from (const string &str, Int startpos=0) |
SubString | from (const Char *s, Int startpos=0) |
SubString | from (Char c, Int startpos=0) |
SubString | from (const RegexBase &r, Int startpos=0) |
SubString | from (Int pos) |
Next one for overloading reasons. | |
SubString | after (size_type pos) |
Start at startpos and extract the SubString "after" the argument's position, exclusive, to the String's end. | |
SubString | after (const string &str, Int startpos=0) |
SubString | after (const Char *s, Int startpos=0) |
SubString | after (Char c, Int startpos=0) |
SubString | after (const RegexBase &r, Int startpos=0) |
SubString | after (Int pos) |
Next one for overloading reasons. | |
void | del (const string &str, size_type startpos=0) |
Delete the first occurrence of target after startpos. | |
void | del (const Char *s, size_type startpos=0) |
void | del (Char c, size_type startpos=0) |
void | del (const RegexBase &r, size_type startpos=0) |
void | del (Int pos, Int len) |
Overload problem. | |
Int | gsub (const string &pat, const string &repl) |
Global substitution: substitute all occurrences of pat with repl, and return the number of replacements. | |
Int | gsub (const Char *pat, const string &repl) |
Int | gsub (const Char *pat, const Char *repl) |
Int | gsub (const RegexBase &pat, const string &repl) |
Static Public Member Functions | |
static Double | toDouble (const String &string) |
Convert a string to a Double. | |
static Float | toFloat (const String &string) |
Convert a string to a Float. | |
static Int | toInt (const String &string) |
Convert a string to an Int. | |
static String | format (const char *picture,...) |
Create a formatted string using the given printf format string. | |
template<typename T > | |
static String | toString (const T &value) |
Convert a value to a String. | |
Static Public Attributes | |
static const size_type | npos |
Private Member Functions | |
SubString | _substr (size_type first, size_type l) |
Helper functions for at, before etc. |
String: the storage and methods of handling collections of characters.
Public interface
The String class name is a continuation of the "C" language custom of refering to collections of characters as "strings of characters".
The String class is the aips++ implementation of a string class. It is closely based on the standard library string class, and all operations and behaviour of strings as defined in the standard are available for a String. The only difference is the extension with additional functions in the aips++ String class as compared to the standard string class.
The String class may be instantiated in many ways:
String myChar('C');
String myWord("Yowza");
String myFoo("fooey", 3);
As well as the copy and default constructors and iterator based ones.
A String may be concatinated with another object (String, or char*) with either prepending or postpending. A search for the position of a character within a String may return its position, a Bool that it is contained within or a Bool confirming your guess at the character's position is correct. A check of the frequency of occurance of a string within a String will return the number of occurances.
Strings may be extracted from Strings at, before, through, from and after a starting position within the String. Deletion of characters is possible after a given position within the String. Global substitution of characters within a String is provided, as well. Splitting of Strings into a carray of Strings is possible, based upon a given separator character, with a return value of the number of elements split. The joining together of the elements of an array of Strings into one String is possible.
Finally, transformations of case and conversions of type are provided.
The standard string class provides the following functionality:
The aips++ addition are:
at(1,2) = ";"
) // Let's start with a simple string. String myString("the time"); // add some more on the end..\. myString += " for all good men"; // prepend some on the front..\. myString.prepend("Now is "); // do some concatination..\. String evenMore; evenMore += myString + " to come to"; // do some three way concatination String allKeys, finishIt(" their country."); allKeys = evenMore + "the aid of" + finishIt; // find the spot where we put something earlier String::size_type position = allKeys.index(finishIt); // find if the word is in the String..\. Bool query = myString.contains("good men"); // ask if the position we think is true is correct..\. Bool answer = allKeys.matches(finishIt, position); // How many spaces are in our phrase? Int spacesCount = allKeys.freq(" ");
The String class eases the handling of characters within the AIPS++ environment.
typedef string::allocator_type casa::String::allocator_type |
typedef string::const_iterator casa::String::const_iterator |
typedef string::const_pointer casa::String::const_pointer |
typedef string::const_reference casa::String::const_reference |
typedef string::const_reverse_iterator casa::String::const_reverse_iterator |
typedef string::difference_type casa::String::difference_type |
typedef string::iterator casa::String::iterator |
typedef string::pointer casa::String::pointer |
typedef string::reference casa::String::reference |
typedef string::reverse_iterator casa::String::reverse_iterator |
typedef string::size_type casa::String::size_type |
typedef string::traits_type casa::String::traits_type |
typedef string::value_type casa::String::value_type |
casa::String::String | ( | ) | [inline] |
casa::String::String | ( | const string & | str, |
size_type | pos = 0 , |
||
size_type | n = npos |
||
) | [inline] |
casa::String::String | ( | const Char * | s, |
size_type | n | ||
) | [inline] |
casa::String::String | ( | const Char * | s | ) | [inline] |
casa::String::String | ( | size_type | n, |
Char | c | ||
) | [inline] |
casa::String::String | ( | InputIterator | begin, |
InputIterator | end | ||
) | [inline] |
casa::String::String | ( | Char | c | ) | [inline, explicit] |
casa::String::String | ( | const SubString & | str | ) | [inline] |
casa::String::String | ( | ostringstream & | os | ) |
Construct from a stream.
casa::String::~String | ( | ) | [inline] |
SubString casa::String::_substr | ( | size_type | first, |
size_type | l | ||
) | [inline, private] |
Start at startpos and extract the SubString "after" the argument's position, exclusive, to the String's end.
Referenced by casa::VPManager::antTypeFromAntDesc().
SubString casa::String::after | ( | const string & | str, |
Int | startpos = 0 |
||
) |
SubString casa::String::after | ( | const Char * | s, |
Int | startpos = 0 |
||
) |
SubString casa::String::after | ( | Char | c, |
Int | startpos = 0 |
||
) |
SubString casa::String::after | ( | const RegexBase & | r, |
Int | startpos = 0 |
||
) |
SubString casa::String::after | ( | Int | pos | ) | [inline] |
void casa::String::alloc | ( | size_type | n | ) | [inline] |
Int casa::String::allocation | ( | ) | const [inline] |
** aips++ addition -- works as a capacity(n) -- Note Int
Definition at line 347 of file String.h.
References capacity().
String& casa::String::append | ( | const string & | str | ) | [inline] |
Append.
Warning: The standard has a void push_back(const Char)
which is completely undefined; It probably is a remnant of the full list of container functions pop/push back/front;
Definition at line 396 of file String.h.
Referenced by append().
String& casa::String::append | ( | const string & | str, |
size_type | pos, | ||
size_type | n | ||
) | [inline] |
String& casa::String::append | ( | const Char * | s, |
size_type | n | ||
) | [inline] |
String& casa::String::append | ( | const Char * | s | ) | [inline] |
String& casa::String::append | ( | size_type | n, |
Char | c | ||
) | [inline] |
String& casa::String::append | ( | InputIterator | first, |
InputIterator | last | ||
) | [inline] |
String& casa::String::append | ( | Char | c | ) | [inline] |
String& casa::String::assign | ( | const string & | str | ) | [inline] |
String& casa::String::assign | ( | const string & | str, |
size_type | pos, | ||
size_type | n | ||
) | [inline] |
String& casa::String::assign | ( | const Char * | s, |
size_type | n | ||
) | [inline] |
String& casa::String::assign | ( | const Char * | s | ) | [inline] |
String& casa::String::assign | ( | size_type | n, |
Char | c | ||
) | [inline] |
String& casa::String::assign | ( | InputIterator | first, |
InputIterator | last | ||
) | [inline] |
String& casa::String::assign | ( | Char | c | ) | [inline] |
const_reference casa::String::at | ( | size_type | n | ) | const [inline] |
Addressing.
Definition at line 382 of file String.h.
Referenced by at(), elem(), firstchar(), lastchar(), and operator[]().
reference casa::String::at | ( | size_type | n | ) | [inline] |
SubString casa::String::at | ( | size_type | pos, |
size_type | len | ||
) |
String casa::String::at | ( | size_type | pos, |
size_type | len | ||
) | const [inline] |
SubString casa::String::at | ( | const string & | str, |
Int | startpos = 0 |
||
) |
String casa::String::at | ( | const string & | str, |
Int | startpos = 0 |
||
) | const |
SubString casa::String::at | ( | const Char * | s, |
Int | startpos = 0 |
||
) |
String casa::String::at | ( | const Char * | s, |
Int | startpos = 0 |
||
) | const |
SubString casa::String::at | ( | Char | c, |
Int | startpos = 0 |
||
) |
String casa::String::at | ( | Char | c, |
Int | startpos = 0 |
||
) | const |
SubString casa::String::at | ( | const RegexBase & | r, |
Int | startpos = 0 |
||
) |
String casa::String::at | ( | const RegexBase & | r, |
Int | startpos = 0 |
||
) | const |
SubString casa::String::at | ( | Int | pos, |
Int | len | ||
) | [inline] |
String casa::String::at | ( | Int | pos, |
Int | len | ||
) | const [inline] |
SubString casa::String::at | ( | Int | pos, |
size_type | len | ||
) | [inline] |
String casa::String::at | ( | Int | pos, |
size_type | len | ||
) | const [inline] |
Start at startpos and extract the string "before" the argument's position, exclusive.
Referenced by casa::VPManager::telFromAntDesc().
SubString casa::String::before | ( | const string & | str, |
Int | startpos = 0 |
||
) |
SubString casa::String::before | ( | const Char * | s, |
Int | startpos = 0 |
||
) |
SubString casa::String::before | ( | Char | c, |
Int | startpos = 0 |
||
) |
SubString casa::String::before | ( | const RegexBase & | r, |
Int | startpos = 0 |
||
) |
SubString casa::String::before | ( | Int | pos | ) | [inline] |
iterator casa::String::begin | ( | ) | [inline] |
const_iterator casa::String::begin | ( | ) | const [inline] |
const Char* casa::String::c_str | ( | ) | const [inline] |
Get char array.
As a proper null terminated C-string
Definition at line 555 of file String.h.
Referenced by chars(), casa::QtDBusXML::constructXML(), casa::QtDBusXML::fromString(), casa::QtDBusXML::fromXMLString(), casa::utilj::getEnv(), casa::PlotMSTab::highlightifyText(), casa::FunctionMarshallable::loadFuncType(), casa::QtDBusXML::methodParamBool(), casa::QtDBusXML::methodParamDouble(), casa::QtDBusXML::methodParamInt(), casa::QtDBusXML::methodParamRecord(), casa::QtDBusXML::methodParamString(), casa::QtDBusXML::methodParamType(), casa::QtDBusXML::methodParamUInt(), casa::operator<<(), casa::PlotMSTab::setChooser(), casa::QtDBusXML::setFrom(), casa::QtDBusXML::setMethodName(), casa::QtDBusXML::setMethodParam(), casa::QtDBusXML::setReturnedValue(), casa::QtDBusXML::setTo(), casa::DS9Region::valueIsValid(), and casa::AipsError::what().
size_type casa::String::capacity | ( | ) | const [inline] |
Definition at line 345 of file String.h.
Referenced by allocation().
void casa::String::capitalize | ( | ) |
internal transformation to capitalization of String.
const Char* casa::String::chars | ( | ) | const [inline] |
** aips++ synonym
Definition at line 559 of file String.h.
References c_str().
Referenced by casa::VariableArrayFITSFieldCopier< recordType, fitsType >::copyToFITS(), and casa::GLPCDisplayListElement::name().
void casa::String::clear | ( | ) | [inline] |
Int casa::String::compare | ( | const string & | str | ) | const [inline] |
Int casa::String::compare | ( | size_type | pos1, |
size_type | n1, | ||
const string & | str | ||
) | const [inline] |
Int casa::String::compare | ( | const Char * | s | ) | const [inline] |
Bool casa::String::contains | ( | Char | c | ) | const [inline] |
Containment.
Definition at line 667 of file String.h.
Referenced by casa::VPManager::antTypeFromAntDesc(), and casa::VPManager::telFromAntDesc().
Bool casa::String::contains | ( | const string & | str | ) | const [inline] |
Bool casa::String::contains | ( | const Char * | s | ) | const [inline] |
Bool casa::String::contains | ( | const RegexBase & | r | ) | const |
Bool casa::String::contains | ( | Char | c, |
Int | pos | ||
) | const [inline] |
Bool casa::String::contains | ( | const string & | str, |
Int | pos | ||
) | const [inline] |
Bool casa::String::contains | ( | const Char * | s, |
Int | pos | ||
) | const [inline] |
Bool casa::String::contains | ( | const RegexBase & | r, |
Int | pos | ||
) | const [inline] |
size_type casa::String::copy | ( | Char * | s, |
size_type | n, | ||
size_type | pos = 0 |
||
) | const [inline] |
const Char* casa::String::data | ( | ) | const [inline] |
void casa::String::del | ( | size_type | pos, |
size_type | len | ||
) |
Delete len chars starting at pos.
** aips++ addition
void casa::String::del | ( | const string & | str, |
size_type | startpos = 0 |
||
) |
void casa::String::del | ( | const Char * | s, |
size_type | startpos = 0 |
||
) |
void casa::String::del | ( | Char | c, |
size_type | startpos = 0 |
||
) |
void casa::String::del | ( | const RegexBase & | r, |
size_type | startpos = 0 |
||
) |
void casa::String::del | ( | Int | pos, |
Int | len | ||
) | [inline] |
void casa::String::downcase | ( | ) |
internal transformation to lowercase of String
Referenced by casa::PlotKeyEvent::modifier().
const_reference casa::String::elem | ( | size_type | pos | ) | const [inline] |
Bool casa::String::empty | ( | ) | const [inline] |
Test for empty.
Definition at line 375 of file String.h.
Referenced by casa::VPManager::antennaDescription(), casa::TempLatticeImpl< typename NumericTraits< T >::ConjugateType >::canReferenceArray(), casa::TableKeyword::isFixed(), casa::TempLatticeImpl< typename NumericTraits< T >::ConjugateType >::isPaged(), casa::TableMeasRefDesc::isRefCodeVariable(), casa::PMS_PP_MSData::isSet(), casa::TableQuantumDesc::isUnitVariable(), casa::TaqlRegex::match(), and casa::RSPolygon::type().
iterator casa::String::end | ( | ) | [inline] |
const_iterator casa::String::end | ( | ) | const [inline] |
String& casa::String::erase | ( | size_type | pos, |
size_type | n = npos |
||
) | [inline] |
iterator casa::String::erase | ( | iterator | position | ) | [inline] |
iterator casa::String::erase | ( | iterator | first, |
iterator | last | ||
) | [inline] |
size_type casa::String::find | ( | const string & | str, |
size_type | pos = 0 |
||
) | const [inline] |
size_type casa::String::find | ( | const Char * | s, |
size_type | pos = 0 |
||
) | const [inline] |
size_type casa::String::find | ( | const Char * | s, |
size_type | pos, | ||
size_type | n | ||
) | const [inline] |
size_type casa::String::find | ( | Char | c, |
size_type | pos = 0 |
||
) | const [inline] |
size_type casa::String::find | ( | const RegexBase & | r, |
size_type | pos = 0 |
||
) | const |
size_type casa::String::find_first_not_of | ( | const string & | str, |
size_type | pos = 0 |
||
) | const [inline] |
Definition at line 646 of file String.h.
Referenced by find_first_not_of().
size_type casa::String::find_first_not_of | ( | const Char * | s, |
size_type | pos = 0 |
||
) | const [inline] |
Definition at line 648 of file String.h.
References find_first_not_of().
size_type casa::String::find_first_not_of | ( | const Char * | s, |
size_type | pos, | ||
size_type | n | ||
) | const [inline] |
Definition at line 650 of file String.h.
References find_first_not_of().
size_type casa::String::find_first_not_of | ( | Char | c, |
size_type | pos = 0 |
||
) | const [inline] |
Definition at line 652 of file String.h.
References find_first_not_of().
size_type casa::String::find_first_of | ( | const string & | str, |
size_type | pos = 0 |
||
) | const [inline] |
Definition at line 630 of file String.h.
Referenced by find_first_of().
size_type casa::String::find_first_of | ( | const Char * | s, |
size_type | pos = 0 |
||
) | const [inline] |
Definition at line 632 of file String.h.
References find_first_of().
size_type casa::String::find_first_of | ( | const Char * | s, |
size_type | pos, | ||
size_type | n | ||
) | const [inline] |
Definition at line 634 of file String.h.
References find_first_of().
size_type casa::String::find_first_of | ( | Char | c, |
size_type | pos = 0 |
||
) | const [inline] |
Definition at line 636 of file String.h.
References find_first_of().
size_type casa::String::find_last_not_of | ( | const string & | str, |
size_type | pos = npos |
||
) | const [inline] |
Definition at line 654 of file String.h.
Referenced by find_last_not_of().
size_type casa::String::find_last_not_of | ( | const Char * | s, |
size_type | pos = npos |
||
) | const [inline] |
Definition at line 656 of file String.h.
References find_last_not_of().
size_type casa::String::find_last_not_of | ( | const Char * | s, |
size_type | pos, | ||
size_type | n | ||
) | const [inline] |
Definition at line 658 of file String.h.
References find_last_not_of().
size_type casa::String::find_last_not_of | ( | Char | c, |
size_type | pos = npos |
||
) | const [inline] |
Definition at line 660 of file String.h.
References find_last_not_of().
size_type casa::String::find_last_of | ( | const string & | str, |
size_type | pos = npos |
||
) | const [inline] |
Definition at line 638 of file String.h.
Referenced by find_last_of().
size_type casa::String::find_last_of | ( | const Char * | s, |
size_type | pos = npos |
||
) | const [inline] |
Definition at line 640 of file String.h.
References find_last_of().
size_type casa::String::find_last_of | ( | const Char * | s, |
size_type | pos, | ||
size_type | n | ||
) | const [inline] |
Definition at line 642 of file String.h.
References find_last_of().
size_type casa::String::find_last_of | ( | Char | c, |
size_type | pos = npos |
||
) | const [inline] |
Definition at line 644 of file String.h.
References find_last_of().
Char casa::String::firstchar | ( | ) | const [inline] |
static String casa::String::format | ( | const char * | picture, |
... | |||
) | [static] |
Create a formatted string using the given printf format string.
Int casa::String::freq | ( | Char | c | ) | const |
Return the number of occurences of target in String.
Int casa::String::freq | ( | const string & | str | ) | const |
Int casa::String::freq | ( | const Char * | s | ) | const |
SubString casa::String::from | ( | size_type | pos | ) |
SubString casa::String::from | ( | const string & | str, |
Int | startpos = 0 |
||
) |
SubString casa::String::from | ( | const Char * | s, |
Int | startpos = 0 |
||
) |
SubString casa::String::from | ( | Char | c, |
Int | startpos = 0 |
||
) |
SubString casa::String::from | ( | const RegexBase & | r, |
Int | startpos = 0 |
||
) |
SubString casa::String::from | ( | Int | pos | ) | [inline] |
allocator_type casa::String::get_allocator | ( | ) | const [inline] |
Get allocator used
Warning: gcc has no get_allocator()
Int casa::String::gsub | ( | const string & | pat, |
const string & | repl | ||
) |
Int casa::String::gsub | ( | const Char * | pat, |
const string & | repl | ||
) |
Int casa::String::gsub | ( | const Char * | pat, |
const Char * | repl | ||
) |
Int casa::String::gsub | ( | const RegexBase & | pat, |
const string & | repl | ||
) |
size_type casa::String::index | ( | Char | c, |
Int | startpos = 0 |
||
) | const [inline] |
size_type casa::String::index | ( | const string & | str, |
Int | startpos = 0 |
||
) | const [inline] |
size_type casa::String::index | ( | const Char * | s, |
Int | startpos = 0 |
||
) | const [inline] |
size_type casa::String::index | ( | const RegexBase & | r, |
Int | startpos = 0 |
||
) | const |
String& casa::String::insert | ( | size_type | pos1, |
const string & | str | ||
) | [inline] |
String& casa::String::insert | ( | size_type | pos1, |
const string & | str, | ||
size_type | pos2, | ||
size_type | n | ||
) | [inline] |
String& casa::String::insert | ( | size_type | pos, |
const Char * | s, | ||
size_type | n | ||
) | [inline] |
String& casa::String::insert | ( | size_type | pos, |
const Char * | s | ||
) | [inline] |
String& casa::String::insert | ( | size_type | pos, |
size_type | n, | ||
Char | c | ||
) | [inline] |
String& casa::String::insert | ( | size_type | pos, |
Char | c | ||
) | [inline] |
iterator casa::String::insert | ( | iterator | p, |
Char | c | ||
) | [inline] |
void casa::String::insert | ( | iterator | p, |
size_type | n, | ||
Char | c | ||
) | [inline] |
void casa::String::insert | ( | iterator | p, |
InputIterator | first, | ||
InputIterator | last | ||
) | [inline] |
String& casa::String::insert | ( | iterator | p, |
const string & | str | ||
) | [inline] |
String& casa::String::insert | ( | iterator | p, |
const Char * | s, | ||
size_type | n | ||
) | [inline] |
String& casa::String::insert | ( | iterator | p, |
const Char * | s | ||
) | [inline] |
Char casa::String::lastchar | ( | ) | const [inline] |
size_type casa::String::length | ( | ) | const [inline] |
Definition at line 343 of file String.h.
Referenced by casa::VariableArrayFITSFieldCopier< recordType, fitsType >::copyToFITS(), and lastchar().
void casa::String::ltrim | ( | char | c | ) |
Remove specified character from beginning of string.
If the character is repeated more than once on the left, all instances will be removed; e.g. ltrim(',') results in ",,xy" becoming "xy".
Bool casa::String::matches | ( | const string & | str, |
Int | pos = 0 |
||
) | const |
Matches entire string from pos (or till pos if negative pos).
Referenced by casa::TaqlRegex::match(), and matches().
Bool casa::String::matches | ( | Char | c, |
Int | pos = 0 |
||
) | const [inline] |
Bool casa::String::matches | ( | const Char * | s, |
Int | pos = 0 |
||
) | const [inline] |
Bool casa::String::matches | ( | const RegexBase & | r, |
Int | pos = 0 |
||
) | const |
size_type casa::String::max_size | ( | ) | const [inline] |
aips++ addition: synonym for at(pos, len)
Definition at line 991 of file String.h.
References casa::SubString::String.
String& casa::String::operator+= | ( | const string & | str | ) | [inline] |
Definition at line 303 of file String.h.
References operator+=().
Definition at line 305 of file String.h.
References operator+=().
String& casa::String::operator= | ( | const string & | str | ) | [inline] |
Assignments (they are all deep copies according to standard)
Definition at line 288 of file String.h.
Referenced by operator=().
Definition at line 292 of file String.h.
References operator=().
Definition at line 294 of file String.h.
References operator=().
const_reference casa::String::operator[] | ( | size_type | pos | ) | const [inline] |
Definition at line 316 of file String.h.
References operator[]().
void casa::String::prepend | ( | const string & | str | ) |
Concatenate by prepending the argument onto String.
void casa::String::prepend | ( | const Char * | s | ) |
void casa::String::prepend | ( | Char | c | ) |
reverse_iterator casa::String::rbegin | ( | ) | [inline] |
const_reverse_iterator casa::String::rbegin | ( | ) | const [inline] |
reverse_iterator casa::String::rend | ( | ) | [inline] |
const_reverse_iterator casa::String::rend | ( | ) | const [inline] |
String& casa::String::replace | ( | size_type | pos1, |
size_type | n1, | ||
const string & | str | ||
) | [inline] |
String& casa::String::replace | ( | size_type | pos, |
size_type | n1, | ||
const Char * | s | ||
) | [inline] |
String& casa::String::replace | ( | size_type | pos, |
size_type | n1, | ||
Char | c | ||
) | [inline] |
String& casa::String::replace | ( | iterator | i1, |
iterator | i2, | ||
const string & | str | ||
) | [inline] |
String& casa::String::replace | ( | iterator | i1, |
iterator | i2, | ||
const Char * | s | ||
) | [inline] |
String& casa::String::replace | ( | iterator | i1, |
iterator | i2, | ||
Char | c | ||
) | [inline] |
String& casa::String::replace | ( | iterator | i1, |
iterator | i2, | ||
InputIterator | j1, | ||
InputIterator | j2 | ||
) | [inline] |
String& casa::String::reserve | ( | size_type | res_arg = 0 | ) | [inline] |
String& casa::String::resize | ( | size_type | n | ) | [inline] |
Resize by truncating or extending with copies of c
(default Char())
Tip: The reserve length given is non-binding on the implementation
String& casa::String::resize | ( | size_type | n, |
Char | c | ||
) | [inline] |
void casa::String::reverse | ( | ) |
Maybe forget some.
** aips++ addition
internal transformation to reverse order of String.
size_type casa::String::rfind | ( | const string & | str, |
size_type | pos = 0 |
||
) | const [inline] |
size_type casa::String::rfind | ( | const Char * | s, |
size_type | pos = 0 |
||
) | const [inline] |
size_type casa::String::rfind | ( | const Char * | s, |
size_type | pos, | ||
size_type | n | ||
) | const [inline] |
size_type casa::String::rfind | ( | Char | c, |
size_type | pos = 0 |
||
) | const [inline] |
size_type casa::String::rfind | ( | const RegexBase & | r, |
size_type | pos = 0 |
||
) | const |
void casa::String::rtrim | ( | char | c | ) |
Remove specified character from end of string.
If the character is repeated more than once on the right, all instances will be removed; e.g. rtrim(',') results in "xy,," becoming "xy".
size_type casa::String::size | ( | ) | const [inline] |
Bool casa::String::startsWith | ( | const string & | beginString | ) | const [inline] |
String casa::String::substr | ( | size_type | pos = 0 , |
size_type | n = npos |
||
) | const [inline] |
void casa::String::swap | ( | string & | s | ) | [inline] |
Start at startpos and extract the SubString "through" to the argument's position, inclusive.
SubString casa::String::through | ( | const string & | str, |
Int | startpos = 0 |
||
) |
SubString casa::String::through | ( | const Char * | s, |
Int | startpos = 0 |
||
) |
SubString casa::String::through | ( | Char | c, |
Int | startpos = 0 |
||
) |
SubString casa::String::through | ( | const RegexBase & | r, |
Int | startpos = 0 |
||
) |
SubString casa::String::through | ( | Int | pos | ) | [inline] |
static Double casa::String::toDouble | ( | const String & | string | ) | [static] |
Convert a string to a Double.
If the specified string does not represent a Double, 0 is returned.
static Float casa::String::toFloat | ( | const String & | string | ) | [static] |
Convert a string to a Float.
If the specified string does not represent a Float, 0 is returned.
static Int casa::String::toInt | ( | const String & | string | ) | [static] |
Convert a string to an Int.
If the specified string does not represent an Int, 0 is returned.
static String casa::String::toString | ( | const T & | value | ) | [inline, static] |
Convert a value to a String.
It uses a shift into an ostringstream, so that operator must be defined for the data type used.
Definition at line 848 of file String.h.
References casa::value().
void casa::String::trim | ( | ) |
Remove beginning and ending whitespace.
void casa::String::trim | ( | char | c[], |
uInt | n | ||
) |
Remove specified chars from beginning and end of string.
void casa::String::upcase | ( | ) |
internal transformation to uppercase of String
const size_type casa::String::npos [static] |