Taskolib
1.3.3
|
A variable name is a string with limited functionality and some limitations on the allowed characters.
Basically, a variable name may only contain alphanumeric characters plus the underscore ("_"). It must start with a letter. Variable names are case sensitive and may not be more than 64 characters long.
#include <VariableName.h>
Public Types | |
using | SizeType = std::string::size_type |
using | size_type = std::string::size_type |
Public Member Functions | |
VariableName (const char *name) | |
Construct a variable name from a C string. More... | |
VariableName (const std::string &name) | |
Construct a variable name from a string. More... | |
VariableName (std::string &&name) | |
SizeType | length () const noexcept |
Return the length of the variable name string. More... | |
VariableName & | operator+= (gul14::string_view suffix) |
Append a suffix to a VariableName. More... | |
operator const std::string & () const | |
Convert the VariableName to a std::string. More... | |
SizeType | size () const noexcept |
Return the length of the variable name string. More... | |
const std::string & | string () const noexcept |
Return a const reference to the internal string member. More... | |
Private Attributes | |
std::string | name_ |
Friends | |
bool | operator== (const VariableName &a, const VariableName &b) noexcept |
Determine if two variable names are identical. More... | |
bool | operator!= (const VariableName &a, const VariableName &b) noexcept |
Determine if two variable names differ. More... | |
bool | operator< (const VariableName &a, const VariableName &b) noexcept |
Determine if the left variable name is lexicographically less than the right one. More... | |
bool | operator> (const VariableName &a, const VariableName &b) noexcept |
Determine if the left variable name is lexicographically greater than the right one. More... | |
bool | operator<= (const VariableName &a, const VariableName &b) noexcept |
Determine if the left variable name is lexicographically less than or equal to the right one. More... | |
bool | operator>= (const VariableName &a, const VariableName &b) noexcept |
Determine if the left variable name is lexicographically greater than or equal to the right one. More... | |
std::string & | operator+= (std::string &lhs, const VariableName &rhs) |
Append a VariableName to a std::string. More... | |
std::string | operator+ (const VariableName &lhs, gul14::string_view rhs) |
Concatenate a VariableName and a string_view. More... | |
std::string | operator+ (gul14::string_view lhs, const VariableName &rhs) |
Concatenate a string_view and a VariableName. More... | |
using task::VariableName::size_type = std::string::size_type |
using task::VariableName::SizeType = std::string::size_type |
task::VariableName::VariableName | ( | const char * | name | ) |
|
explicit |
|
explicit |
References name_.
|
inlinenoexcept |
Return the length of the variable name string.
References name_.
|
inlineexplicit |
Convert the VariableName to a std::string.
References name_.
VariableName & task::VariableName::operator+= | ( | gul14::string_view | suffix | ) |
Append a suffix to a VariableName.
Error | is thrown if the resulting variable name is not valid. |
References name_.
|
inlinenoexcept |
Return the length of the variable name string.
References name_.
|
inlinenoexcept |
Return a const reference to the internal string member.
References name_.
|
friend |
Determine if two variable names differ.
|
friend |
Concatenate a VariableName and a string_view.
|
friend |
Concatenate a string_view and a VariableName.
|
friend |
Append a VariableName to a std::string.
|
friend |
Determine if the left variable name is lexicographically less than the right one.
|
friend |
Determine if the left variable name is lexicographically less than or equal to the right one.
|
friend |
Determine if two variable names are identical.
|
friend |
Determine if the left variable name is lexicographically greater than the right one.
|
friend |
Determine if the left variable name is lexicographically greater than or equal to the right one.
|
private |
Referenced by length(), operator const std::string &(), operator+=(), size(), string(), and VariableName().