opp_string Class Reference¶
|
API
|
Public Member Functions | |
| opp_string () | |
| opp_string (const char *s) | |
| opp_string (const char *s, int n) | |
| opp_string (const std::string &s) | |
| opp_string (const opp_string &s) | |
| opp_string (opp_string &&s) | |
| ~opp_string () | |
| const char * | c_str () const |
| std::string | str () const |
| bool | empty () const |
| char * | buffer () |
| int | size () const |
| char * | reserve (unsigned size) |
| const char * | operator= (const char *s) |
| opp_string & | operator= (const opp_string &s) |
| opp_string & | operator= (const std::string &s) |
| bool | operator< (const opp_string &s) const |
| bool | operator== (const opp_string &s) const |
| bool | operator!= (const opp_string &s) const |
| opp_string & | operator+= (const char *s) |
| opp_string & | operator+= (const opp_string &s) |
| opp_string & | operator+= (const std::string &s) |
| opp_string | operator+ (const char *s) |
| opp_string | operator+ (const opp_string &s) |
| opp_string | operator+ (const std::string &s) |
Description
Lightweight string class, used internally in some parts of OMNeT++.
In simulation models it is better to use std::string or const char * instead.
opp_string has only one data member, a char* pointer. Allocation and deallocation of the contents takes place via opp_strdup() and operator delete.
Constructor & Destructor Documentation
◆ opp_string() [1/6]
|
inline |
Constructor.
Referenced by operator!=(), operator+(), operator+(), operator+(), operator+=(), operator+=(), operator+=(), operator<(), operator=(), operator=(), operator==(), opp_string(), and opp_string().
◆ opp_string() [2/6]
|
inline |
Constructor.
◆ opp_string() [3/6]
|
inline |
Constructor.
◆ opp_string() [4/6]
|
inline |
Constructor.
◆ opp_string() [5/6]
|
inline |
Copy constructor.
References opp_string().
◆ opp_string() [6/6]
|
inline |
Move constructor.
References opp_string().
◆ ~opp_string()
|
inline |
Destructor.
Member Function Documentation
◆ c_str()
|
inline |
Return pointer to the string.
Referenced by operator+(), operator+(), and cValue::set().
◆ str()
|
inline |
Convert to std::string.
◆ empty()
|
inline |
Null (empty) string or not.
◆ buffer()
|
inline |
Returns pointer to the internal buffer where the string is stored. It is allowed to write into the string via this pointer, but the length of the string should not be exceeded.
◆ size()
|
inline |
Returns the length of the string.
Referenced by reserve().
◆ reserve()
|
inline |
Allocates a buffer of the given size.
References size().
◆ operator=() [1/3]
|
inline |
Deletes the old value and opp_strdup()'s the new value to create the object's own copy.
Referenced by operator+=().
◆ operator=() [2/3]
|
inline |
◆ operator=() [3/3]
|
inline |
◆ operator<()
|
inline |
Comparison.
References opp_string().
◆ operator==()
|
inline |
Comparison.
References opp_string().
◆ operator!=()
|
inline |
Comparison.
References opp_string().
◆ operator+=() [1/3]
|
inline |
Concatenation
References operator=(), and opp_string().
◆ operator+=() [2/3]
|
inline |
◆ operator+=() [3/3]
|
inline |
◆ operator+() [1/3]
|
inline |
Concatenation
References c_str(), and opp_string().
◆ operator+() [2/3]
|
inline |
◆ operator+() [3/3]
|
inline |
Generated on for API by