SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
Requirements on strings. More...
#include <StringRequirement.h>
Public Member Functions | |
StringRequirement () | |
Constructor. | |
virtual void | Reset () override |
Reset Requirement. | |
virtual void | Parse (Value json, const std::string &path) override |
Parse JSON value to generate Requirement. More... | |
virtual void | Validate (const Value &json, const std::string &path) override |
Validate string value. More... | |
Public Member Functions inherited from Json::Requirement | |
bool | HasErrors () |
Check if errors have occured. More... | |
std::vector< std::string > | GetErrors () |
Get list of error messages. More... | |
virtual void | ClearErrors () |
Clear list of error messages. | |
virtual bool | HasNotices () |
Check if notices have been queued. More... | |
std::vector< std::string > | GetNotices () |
Get list of notices. More... | |
virtual void | ClearNotices () |
Clear list of notice messages. | |
virtual | ~Requirement () |
Destructor. | |
Private Attributes | |
bool | minSet_ |
If True , minimum length requirement is active. | |
bool | maxSet_ |
If True , maximum length requirement is active. | |
bool | rgxSet_ |
If True , string has to match regular expression. | |
size_t | minLength_ |
Minimum string length;. | |
size_t | maxLength_ |
Maximum string length;. | |
std::regex | regex_ |
Regular expression to match string to. | |
std::string | expr_ |
Expression. | |
std::string | path_ |
Path for JSON path specification. | |
std::vector< std::string > | enum_ |
Enum values. | |
Additional Inherited Members | |
Protected Member Functions inherited from Json::Requirement | |
void | PushError (const std::string &error) |
Add error to list of error messages. More... | |
void | PushNotice (const std::string ¬ice) |
Add message to list of notices. More... | |
Requirements on strings.
Definition at line 37 of file StringRequirement.h.
|
inlineoverridevirtual |
Parse JSON value to generate Requirement.
Implements Json::Requirement.
Definition at line 78 of file StringRequirement.h.
References enum_, expr_, maxLength_, maxSet_, minLength_, minSet_, path_, regex_, Reset(), and rgxSet_.
|
inlineoverridevirtual |
Validate string value.
This function tests if the JSON value is of type string and if the string meets the requirements loaded via StringRequirement::Parse(). If the validation fails, one or more errors are appended to the list of errors.
Implements Json::Requirement.
Definition at line 120 of file StringRequirement.h.
References enum_, expr_, maxLength_, maxSet_, minLength_, minSet_, Json::Requirement::PushError(), regex_, and rgxSet_.