Taskolib
1.3.3
|
The machine-readable name of a Sequence.
A sequence name has constraints on its length and the contained characters. It may be at most max_length bytes long and it may only contain upper- and lowercase letters, digits, the minus and underscore characters, and periods. It may not start with a period.
#include <SequenceName.h>
Public Member Functions | |
SequenceName ()=default | |
Default-construct an empty sequence name. More... | |
SequenceName (gul14::string_view str) | |
Construct a sequence name from a string. More... | |
const std::string & | string () const noexcept |
Return the sequence name as a string. More... | |
Static Public Member Functions | |
static gul14::optional< SequenceName > | from_string (gul14::string_view str) |
Create a sequence name from the given string, returning an empty optional if the string violates the length or character constraints of a sequence name. More... | |
Static Public Attributes | |
static constexpr std::size_t | max_length = 64 |
Maximum number of bytes of a sequence name. More... | |
static const gul14::string_view | valid_characters |
A string containing all of the valid characters of a sequence name. More... | |
Static Private Member Functions | |
static gul14::string_view | check_validity (gul14::string_view) |
Throw an exception if the given string violates the length or character constraints of a sequence name; otherwise, return the unmodified string view. More... | |
Private Attributes | |
std::string | str_ |
Friends | |
bool | operator== (const SequenceName &a, const SequenceName &b) |
Determine if two sequence names are equal. More... | |
bool | operator!= (const SequenceName &a, const SequenceName &b) |
Determine if two sequence names are different. More... | |
|
default |
Default-construct an empty sequence name.
|
explicit |
Construct a sequence name from a string.
Error | is thrown if the string is too long or if it contains invalid characters. |
|
staticprivate |
Throw an exception if the given string violates the length or character constraints of a sequence name; otherwise, return the unmodified string view.
References max_length, and valid_characters.
|
static |
Create a sequence name from the given string, returning an empty optional if the string violates the length or character constraints of a sequence name.
Referenced by task::SequenceManager::parse_folder_name().
|
inlinenoexcept |
Return the sequence name as a string.
References str_.
Referenced by task::make_sequence_filename().
|
friend |
Determine if two sequence names are different.
|
friend |
Determine if two sequence names are equal.
|
staticconstexpr |
Maximum number of bytes of a sequence name.
Referenced by check_validity(), and task::SequenceManager::make_sequence_name_from_label().
|
private |
Referenced by string().
|
static |
A string containing all of the valid characters of a sequence name.
Referenced by check_validity(), and task::SequenceManager::make_sequence_name_from_label().