82 SubString(
const string &str, string::size_type pos,
83 string::size_type len);
255 string(str, pos, n) {}
269 template<
class InputIterator>
279 String(ostringstream &os);
291 return (*
this =
String(str)); }
302 return static_cast<String&
>(string::operator+=(str)); }
304 return static_cast<String&
>(string::operator+=(s)); }
306 return static_cast<String&
>(string::operator+=(c)); }
315 return string::at(pos); }
317 return string::operator[](pos); }
321 return string::at(pos); }
360 string::resize(n);
return *
this; }
362 string::resize(n, c);
return *
this; }
364 string::reserve(res_arg);
return *
this; }
397 return static_cast<String&
>(string::append(str)); }
399 return static_cast<String&
>(string::append(str, pos, n)); }
401 return static_cast<String&
>(string::append(s, n)); }
403 return static_cast<String&
>(string::append(s)); }
405 return static_cast<String&
>(string::append(n, c)); }
406 template<
class InputIterator>
408 return static_cast<String&
>(string::append(first, last)); }
411 return static_cast<String&
>(string::append(1, c)); }
420 return static_cast<String&
>(string::assign(str)); }
422 return static_cast<String&
>(string::assign(str, pos, n)); }
424 return static_cast<String&
>(string::assign(s, n)); }
426 return static_cast<String&
>(string::assign(s)); }
428 return static_cast<String&
>(string::assign(n, c)); }
429 template<
class InputIterator>
431 return static_cast<String&
>(string::assign(first, last)); }
434 return static_cast<String&
>(string::assign(1, c)); }
444 return static_cast<String&
>(string::insert(pos1, str)); }
447 return static_cast<String&
>(string::insert(pos1, str, pos2, n)); }
449 return static_cast<String&
>(string::insert(pos, s, n)); }
451 return static_cast<String&
>(string::insert(pos, s)); }
453 return static_cast<String&
>(string::insert(pos, n, c)); }
456 return static_cast<String&
>(string::insert(pos, 1, c)); }
459 return string::insert(p, c); }
461 string::insert(p, n, c); }
462 template<
class InputIterator>
464 string::insert(p, first, last); }
468 return static_cast<String&
>(string::insert(p-
begin(), str)); }
470 return static_cast<String&
>(string::insert(p-
begin(), s, n)); }
472 return static_cast<String&
>(string::insert(p-
begin(), s)); }
482 return string::compare(str); }
484 return String(*
this, pos1, n1).compare(str); }
487 return String(*
this, pos1, n1).compare(
String(str, pos2, n2)); }
489 return string::compare(s); }
492 return String(*
this, pos1, n1).compare(
String(s, n2)); }
498 return static_cast<String&
>(string::erase(pos, n)); }
500 return string::erase(position); }
502 return string::erase(first, last); }
536 template<
class InputIterator>
550 void swap(
string& s) { string::swap(s); }
571 return String(*
this, pos, n); }
585 std::istringstream os(*
this);
587 if (os.fail() || !os.eof()) {
616 std::ostringstream os;
639 {
return find(beginString) == 0; }
645 return string::find(str, pos); }
647 return string::find(s, pos); }
649 return string::find(s, pos, n); }
651 return string::find(c, pos); }
654 return string::rfind(str, pos); }
656 return string::rfind(s, pos); }
658 return string::rfind(s, pos, n); }
660 return string::rfind(c, pos); }
663 return string::find_first_of(str, pos); }
665 return string::find_first_of(s, pos); }
667 return string::find_first_of(s, pos, n); }
669 return string::find_first_of(c, pos); }
671 return string::find_last_of(str, pos); }
673 return string::find_last_of(s, pos); }
675 return string::find_last_of(s, pos, n); }
677 return string::find_last_of(c, pos); }
679 return string::find_first_not_of(str, pos); }
681 return string::find_first_not_of(s, pos); }
683 return string::find_first_not_of(s, pos, n); }
685 return string::find_first_not_of(c, pos); }
687 return string::find_last_not_of(str, pos); }
689 return string::find_last_not_of(s, pos); }
691 return string::find_last_not_of(s, pos, n); }
693 return string::find_last_not_of(c, pos); }
729 void prepend(
const string &str);
738 return ((startpos >= 0) ?
find(c, startpos) :
741 return ((startpos >= 0) ?
find(str, startpos) :
744 return ((startpos >= 0) ?
find(s, startpos) :
752 Int freq(
const string &str)
const;
760 return String(*
this, pos, len); }
762 String at(
const string &str,
Int startpos = 0)
const;
774 return at(static_cast<size_type>(pos), static_cast<size_type>(len));
777 return at(static_cast<size_type>(pos), static_cast<size_type>(len));
780 return at(static_cast<size_type>(pos), len);
783 return at(static_cast<size_type>(pos), len);
798 return before(static_cast<size_type>(pos)); };
811 return through(static_cast<size_type>(pos)); }
824 return from(static_cast<size_type>(pos));
838 return after(static_cast<size_type>(pos));
865 del(static_cast<size_type>(pos), static_cast<size_type>(len)); }
872 Int gsub(
const string &pat,
const string &repl);
896 String str(lhs); str.append(rhs);
return str; }
898 String str(lhs); str.append(rhs);
return str; }
900 String str(lhs); str.append(rhs);
return str; }
902 String str(lhs); str.append(rhs);
return str; }
904 String str(lhs); str.append(rhs);
return str; }
953 return x.compare(y); }
955 return x.compare(y); }
957 return x.compare(
String(y)); }
968 Int split(
const string &str,
string res[],
Int maxn,
970 Int split(
const string &str,
string res[],
Int maxn,
972 Int split(
const string &str,
string res[],
Int maxn,
979 String common_prefix(
const string &x,
const string &y,
981 String common_suffix(
const string &x,
const string &y,
992 String reverse(
const string& str);
1012 string::size_type len) :
1013 ref_p(str), pos_p((pos > str.
length()) ? str.
length() : pos),
1014 len_p((len == string::npos || pos_p+len > str.
length()) ?
1015 str.
length()-pos_p : len) {}
1018 return at(pos, len); }
1020 return String(*this).c_str(); }
1032 s << x.
c_str();
return s; }
allocator_type get_allocator() const
Get allocator used Warning: gcc has no get_allocator()
String & assign(size_type n, Char c)
Int compare(const string &x, const string &y)
** Casacore additions of global compares.
String & resize(size_type n, Char c)
String & insert(size_type pos, size_type n, Char c)
String & replace(size_type pos, size_type n1, const Char *s)
void rtrim(char c)
Remove specified character from end of string.
Int compare(const Char *s) const
String & insert(iterator p, const Char *s, size_type n)
static Int toInt(const String &s, Bool chk=False)
Convert a string to an Int, Float or Double.
void reverse()
Maybe forget some.
Elements::const_iterator const_iterator
String & replace(iterator i1, iterator i2, const Char *s, size_type n)
String & replace(iterator i1, iterator i2, size_type n, Char c)
TableExprNode downcase(const TableExprNode &node)
StatsData< AccumType > copy(const StatsData< AccumType > &stats)
size_type rfind(Char c, size_type pos=npos) const
iterator erase(iterator position)
size_type capacity() const
void ltrim(char c)
Remove specified character from beginning of string.
void swap(string &s)
Swap.
size_type rfind(const Char *s, size_type pos, size_type n) const
size_type find_last_of(const string &str, size_type pos=npos) const
String & replace(iterator i1, iterator i2, InputIterator j1, InputIterator j2)
String & append(const Char *s, size_type n)
size_type find_last_not_of(Char c, size_type pos=npos) const
size_type find_first_not_of(const Char *s, size_type pos=0) const
String & operator=(Char c)
const Char * chars() const
Get as (const) C array.
size_type index(Char c, Int startpos=0) const
Return the position of the target in the string or npos for failure.
size_type rfind(const Char *s, size_type pos=npos) const
Int gsub(const string &pat, const string &repl)
Global substitution: substitute all occurrences of pat with repl, and return the number of replacemen...
String & reserve(size_type res_arg=0)
String & append(const Char *s)
String & insert(size_type pos, const Char *s)
size_type find(Char c, size_type pos=0) const
size_type copy(Char *s, size_type n, size_type pos=0) const
Copy.
Bool matches(Char c, Int pos=0) const
string::value_type value_type
each selection effectively specify the desired channel data in a specified spectral window If the user uses the FrequencySelectionChannel class then the selection simply selects a range of channels The other derived class is FrequencySelectionReferential which specifies a range of frequencies in a specified frame of reference(e.g., LSRK).Unlike the other first method
reverse_iterator rbegin()
string::size_type pos_p
Start of sub-string.
size_type find_last_of(const Char *s, size_type pos, size_type n) const
PtrHolder< T > & operator=(const PtrHolder< T > &other)
size_type size() const
Capacity, size.
String & resize(size_type n)
Resize by truncating or extending with copies of <tt>c</tt> (default Char())
reference at(size_type n)
Int compare(const string &str) const
Compare.
SubString after(size_type pos)
Start at startpos and extract the SubString "after" the argument's position, exclusive, to the String's end.
String & assign(InputIterator first, InputIterator last)
String & operator=(const SubString &str)
LatticeExprNode operator!=(const LatticeExprNode &left, const LatticeExprNode &right)
void prepend(const string &str)
Concatenate by prepending the argument onto String.
casacore::String join(Itr begin, Itr end, const casacore::String &delimiter)
Int allocation() const
** Casacore addition – works as a capacity(n) – Note Int
const_reverse_iterator rbegin() const
void upcase()
internal transformation to uppercase of String
String & replace(iterator i1, iterator i2, const Char *s)
String & assign(Char c)
** Casacore addition
SubString at(Int pos, Int len)
Next ones for overloading reasons.
size_type find_first_of(const string &str, size_type pos=0) const
string::size_type length() const
Obtain length.
String & replace(size_type pos, size_type n1, size_type n2, Char c)
ostream & operator<<(ostream &os, const std::pair< T, U > &p)
String at(Int pos, size_type len) const
String & assign(const string &str, size_type pos, size_type n)
const_iterator end() const
string::reference reference
String & insert(iterator p, const string &str)
** Casacore additions
String & replace(iterator i1, iterator i2, Char c)
** Casacore addition
iterator begin()
Iterators.
String & assign(const Char *s, size_type n)
Int freq(Char c) const
Return the number of occurences of target in String.
string::iterator iterator
SubString through(Int pos)
Next one for overloading reasons.
size_type find_first_not_of(const string &str, size_type pos=0) const
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
LatticeExprNode operator>=(const LatticeExprNode &left, const LatticeExprNode &right)
iterator erase(iterator first, iterator last)
SubString before(Int pos) const
Next one for overloading reasons.
string::allocator_type allocator_type
String & assign(const Char *s)
String & replace(size_type pos1, size_type n1, const string &str, size_type pos2, size_type n2)
const string & ref_p
Referenced string.
size_type find(const Char *s, size_type pos=0) const
const_reference at(size_type n) const
Addressing.
Vector< String > & split(const String &s, char delim, Vector< String > &elems)
SubString _substr(size_type first, size_type l) const
Helper functions for at, before etc.
const_iterator begin() const
static Float toFloat(const String &s, Bool chk=False)
String & insert(size_type pos1, const string &str, size_type pos2, size_type n)
size_type find_first_not_of(Char c, size_type pos=0) const
void throwFromStringError() const
Helper function for fromString.
size_type find_last_of(Char c, size_type pos=npos) const
string::const_pointer const_pointer
SubString operator()(size_type pos, size_type len)
Casacore addition: synonym for at(pos, len)
void clear()
Clear the string Warning: clear() executed as erase() due to missing clear() in gcc ...
LatticeExprNode replace(const LatticeExprNode &arg1, const LatticeExprNode &arg2)
This function replaces every masked-off element in the first argument with the corresponding element ...
string::difference_type difference_type
SubString help class to be used in at, before,...
size_type find_first_not_of(const Char *s, size_type pos, size_type n) const
string::size_type size_type
String & insert(size_type pos, Char c)
** Casacore addition
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
size_type rfind(const string &str, size_type pos=npos) const
String & erase(size_type pos, size_type n=npos)
Erase.
TableExprNode trim(const TableExprNode &node)
String & assign(const string &str)
Assign.
Bool startsWith(const string &beginString) const
Does the string start with the specified string?
LatticeExprNode operator<=(const LatticeExprNode &left, const LatticeExprNode &right)
const Char * chars() const
** Casacore synonym
String & insert(size_type pos1, const string &str)
Insert.
const Char * c_str() const
Get char array.
size_type find_last_of(const Char *s, size_type pos=npos) const
void insert(iterator p, InputIterator first, InputIterator last)
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 substr(size_type pos=0, size_type n=npos) const
Get a sub string.
String & operator+=(const string &str)
Concatenate.
SubString & operator=(const SubString &str)
Assignment.
size_type find_first_of(Char c, size_type pos=0) const
const_reverse_iterator rend() const
size_type find_last_not_of(const string &str, size_type pos=npos) const
bool Bool
Define the standard types used by Casacore.
size_type find_first_of(const Char *s, size_type pos=0) const
void trim()
Remove beginning and ending whitespace.
TableExprNode upcase(const TableExprNode &node)
String()
Default constructor.
reference operator[](size_type pos)
static Double toDouble(const String &s, Bool chk=False)
String & operator+=(const Char *s)
void insert(iterator p, size_type n, Char c)
casacore::Bool empty() const
static String format(const char *picture,...)
Create a formatted string using the given printf format string.
string::const_iterator const_iterator
Int compare(const string &x, const Char y)
SubString at(Int pos, size_type len)
string::const_reference const_reference
const_reference operator[](size_type pos) const
Indexing.
void alloc(size_type n)
** Casacore addition – works as a resize(n)
LatticeExprNode operator>(const LatticeExprNode &left, const LatticeExprNode &right)
SubString before(size_type pos) const
Start at startpos and extract the string "before" the argument's position, exclusive.
String & replace(size_type pos1, size_type n1, const string &str)
Replace.
String & insert(size_type pos, const Char *s, size_type n)
string::size_type len_p
Length of sub-string.
Int compare(size_type pos1, size_type n1, const string &str, size_type pos2, size_type n2) const
const_reference elem(size_type pos) const
*** Casacore addition
String at(Int pos, Int len) const
String(size_type n, Char c)
Construct from a single char (repeated n times)
Int compare(const string &x, const Char *y)
String(const Char *s)
Construct from char array.
size_type find(const string &str, size_type pos=0) const
Search functions.
string::reverse_iterator reverse_iterator
String(const SubString &str)
Construct from a SubString.
LatticeExprNode operator+(const LatticeExprNode &expr)
Global functions operating on a LatticeExprNode.
String & append(InputIterator first, InputIterator last)
String & operator=(const string &str)
Assignments (they are all deep copies according to standard)
SubString from(size_type pos)
Start at startpos and extract the SubString "from" the argument's position, inclusive, to the String's end.
void del(Int pos, Int len)
Overload problem.
Bool fromString(T &value, Bool chk=True) const
Convert a String to a value.
String & insert(iterator p, const Char *s)
size_type max_size() const
String & operator+=(Char c)
iterator insert(iterator p, Char c)
String & replace(size_type pos, size_type n1, Char c)
** Casacore addition
Abstract interface class to regular expressions for String.
string::traits_type traits_type
const Double c
Fundamental physical constants (SI units):
String & append(size_type n, Char c)
size_type find_last_not_of(const Char *s, size_type pos, size_type n) const
TableExprNode capitalize(const TableExprNode &node)
Bool matches(const string &str, Int pos=0) const
Matches entire string from pos (or till pos if negative pos).
String: the storage and methods of handling collections of characters.
String & append(Char c)
** Casacore addition
Bool operator==(const MVTime &lh, const MVTime &rh)
is equal operator, uses operator Double which returns days
size_type find_last_not_of(const Char *s, size_type pos=npos) const
LatticeExprNode operator<(const LatticeExprNode &left, const LatticeExprNode &right)
SubString(const string &str, string::size_type pos, string::size_type len)
Constructor (there are no public constructors)
Int compare(size_type pos1, size_type n1, const string &str) const
String(InputIterator begin, InputIterator end)
Construct from iterator.
Bool contains(Char c) const
Containment.
const_iterator begin() const
SubString through(size_type pos)
Start at startpos and extract the SubString "through" to the argument's position, inclusive.
string::const_reverse_iterator const_reverse_iterator
String(Char c)
From single char (** Casacore addition).
static const size_type npos
size_type find_first_of(const Char *s, size_type pos, size_type n) const
const_iterator end() const
const Char * data() const
As pointer to char array.
void downcase()
internal transformation to lowercase of String
size_type find(const Char *s, size_type pos, size_type n) const
String & append(const string &str)
Append.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
String & operator=(const Char *s)
String at(size_type pos, size_type len) const
String(const Char *s, size_type n)
Construct from char* with given length.
Int compare(size_type pos1, size_type n1, const Char *s, size_type n2=npos) const
void del(size_type pos, size_type len)
Delete len chars starting at pos.
String & replace(iterator i1, iterator i2, const string &str)
String & replace(size_type pos, size_type n1, const Char *s, size_type n2)
String & append(const string &str, size_type pos, size_type n)
void capitalize()
internal transformation to capitalization of String.
static String toString(const T &value)
Convert a value to a String.
SubString after(Int pos)
Next one for overloading reasons.
SubString from(Int pos)
Next one for overloading reasons.
Bool empty() const
Test for empty.
Bool matches(const Char *s, Int pos=0) const
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.