|
libzypp 17.38.7
|
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
More...
#include <zypp-core/base/String.h>
Public Types | |
| using | size_type = std::string::size_type |
Public Member Functions | |
| C_Str () | |
| C_Str (char *c_str_r) | |
| C_Str (const char *c_str_r) | |
| C_Str (const std::string &str_r) | |
| C_Str (const boost::string_ref &str_r) | |
| bool | isNull () const |
| bool | empty () const |
| size_type | size () const |
| operator const char * () const | |
| const char * | c_str () const |
Private Attributes | |
| const char *const | _val |
| size_type | _sze |
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
Called with a plain char* as argument, the std::string is created form for nothing. The implementation actually does not use the std::string.
Best would be to implement hasPrefix for each combination of char* and std::string arguments:
This is where C_Str can help. Constructible from std::string and char*, it reduces the std::string to its char*. At the same, time it converts (char*)0 into an "" string.
| using zypp::C_Str::size_type = std::string::size_type |
|
inline |