|
Util--
1.1
|
Generic string using unique instance memory. More...
#include <utilmm/types/bits/basic_symbol.hh>
Public Types | |
| typedef std::basic_string < CharT, Traits, Alloc > | str_type |
| equivalent string type More... | |
Public Member Functions | |
| basic_symbol (str_type const &str=str_type()) | |
| Constructor. More... | |
| basic_symbol (CharT const *str) | |
| Constructor. More... | |
| basic_symbol (basic_symbol const &other) | |
| Copy constructor. More... | |
| ~basic_symbol () | |
| Destructor. More... | |
| basic_symbol & | operator= (basic_symbol const &other) |
| Assignment operator. More... | |
| bool | empty () const |
| Check if empty. More... | |
| size_t | length () const |
| length of symbol More... | |
| bool | operator== (basic_symbol const &other) const |
| Equality test. More... | |
| bool | operator!= (basic_symbol const &other) const |
| Difference test. More... | |
| bool | operator< (basic_symbol const &other) const |
| Ordering operator. More... | |
| bool | operator> (basic_symbol const &other) const |
| Ordering operator. More... | |
| bool | operator<= (basic_symbol const &other) const |
| Ordering operator. More... | |
| bool | operator>= (basic_symbol const &other) const |
| Ordering operator. More... | |
| bool | starts_with (basic_symbol const &sub) const |
| Check for beginning. More... | |
| basic_symbol & | append (basic_symbol const &other) |
| Append function. More... | |
| basic_symbol & | operator+= (basic_symbol const &other) |
| Append operator. More... | |
| basic_symbol | operator+ (basic_symbol const &other) const |
| Append operation. More... | |
| str_type const & | str () const |
| Name of the symbol. More... | |
Friends | |
| template<typename Ty > | |
| struct | hash |
Related Functions | |
(Note that these are not member functions.) | |
| template<class CharT , class Traits , class Alloc > | |
| std::ostream & | operator<< (std::ostream &out, basic_symbol< CharT, Traits, Alloc > const &s) |
| printing function More... | |
Generic string using unique instance memory.
This class implements constant string named symbols based on utilmm::smart::uniq_pointer
| CharT | The char type for the string |
| Traits | The character traits for CharT |
| Alloc | allocator for the string |
| typedef std::basic_string<CharT, Traits, Alloc> utilmm::basic_symbol< CharT, Traits, Alloc >::str_type |
equivalent string type
|
inline |
Constructor.
| str | name of the symbol |
Create a new symbol instance with name str
|
inline |
Constructor.
| str | name of the symbol |
Create a new symbol instance with name str
|
inline |
Copy constructor.
|
inline |
Destructor.
| basic_symbol& utilmm::basic_symbol< CharT, Traits, Alloc >::append | ( | basic_symbol< CharT, Traits, Alloc > const & | other | ) |
Append function.
| other | A symbol |
Thsi function appends to the end of current symbol name the name of other
Referenced by utilmm::basic_symbol< CharT, Traits, Alloc >::operator+=().
|
inline |
Check if empty.
This function test if this symbol is an empty one (ie it has no name)
| true | if symbol is empty |
| false | else |
References utilmm::smart::pointer< Manager >::null().
Referenced by utilmm::basic_symbol< CharT, Traits, Alloc >::length().
|
inline |
length of symbol
References utilmm::basic_symbol< CharT, Traits, Alloc >::empty().
|
inline |
Difference test.
| other | a symbol |
!operator==(other) References utilmm::basic_symbol< CharT, Traits, Alloc >::operator==().
| basic_symbol utilmm::basic_symbol< CharT, Traits, Alloc >::operator+ | ( | basic_symbol< CharT, Traits, Alloc > const & | other | ) | const |
Append operation.
| other | a symbol |
Thsi function creat a new symbol with a name that is the concatenation of the name of current insdtance and the name of other
|
inline |
Append operator.
This is an alias for append
References utilmm::basic_symbol< CharT, Traits, Alloc >::append().
| bool utilmm::basic_symbol< CharT, Traits, Alloc >::operator< | ( | basic_symbol< CharT, Traits, Alloc > const & | other | ) | const |
Ordering operator.
Referenced by utilmm::basic_symbol< CharT, Traits, Alloc >::operator>=().
|
inline |
Ordering operator.
References utilmm::basic_symbol< CharT, Traits, Alloc >::operator>().
|
inline |
Assignment operator.
|
inline |
Equality test.
| other | a symbol |
| true | if current symbol has the same name as other |
| false | else |
basic_symbol is based on utilmm::smart::uniq_pointer this test is made in constant time Referenced by utilmm::basic_symbol< CharT, Traits, Alloc >::operator!=().
|
inline |
Ordering operator.
Referenced by utilmm::basic_symbol< CharT, Traits, Alloc >::operator<=().
|
inline |
Ordering operator.
References utilmm::basic_symbol< CharT, Traits, Alloc >::operator<().
| bool utilmm::basic_symbol< CharT, Traits, Alloc >::starts_with | ( | basic_symbol< CharT, Traits, Alloc > const & | sub | ) | const |
Check for beginning.
| sub | a symbol |
| true | if the name of current insatnce starts with the name of sub |
| false | else |
|
inline |
Name of the symbol.
| utilmm::smart::null_access | The name of the symbol is empty |
|
related |
printing function
| out | An output stream |
| s | A symbol |
This operator writes the names of s in out
1.8.6