A restricted string (C identifier, which is a component of a Path). More...
#include <Symbol.hpp>
Public Member Functions | |
Symbol (const std::basic_string< char > &symbol) | |
Construct a Symbol from an std::string. | |
Symbol (const char *csymbol) | |
Construct a Symbol from a C string. | |
const char * | c_str () const |
bool | operator== (const Symbol &other) const |
bool | operator!= (const Symbol &other) const |
bool | operator< (const Symbol &other) const |
Static Public Member Functions | |
static bool | is_valid (const std::basic_string< char > &symbol) |
static std::string | symbolify (const std::basic_string< char > &str) |
Convert a string to a valid symbol. |
A restricted string (C identifier, which is a component of a Path).
A Symbol is a very restricted string suitable for use as an identifier. It is a valid LV2 symbol, URI fragment, filename, OSC path fragment, and identifier for most programming languages (including C).
Valid characters are _, a-z, A-Z, 0-9, except the first character which must not be 0-9.
Raul::Symbol::Symbol | ( | const std::basic_string< char > & | symbol | ) | [inline] |
Raul::Symbol::Symbol | ( | const char * | csymbol | ) | [inline] |
string Raul::Symbol::symbolify | ( | const std::basic_string< char > & | str | ) | [static] |
Convert a string to a valid symbol.
This will make a best effort at turning str into a complete, valid Symbol, and will always return one.
References Raul::Path::replace_invalid_chars().