SSAGES  0.9.3
Software Suite for Advanced General Ensemble Simulations
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Json::Requirement Class Referenceabstract

Requirements on input files. More...

#include <Requirement.h>

Inheritance diagram for Json::Requirement:
Inheritance graph
[legend]

Public Member Functions

virtual void Parse (Value json, const std::string &path)=0
 Parse JSON value. More...
 
virtual void Validate (const Value &json, const std::string &path)=0
 Validate that JSON value meets requirements. More...
 
virtual void Reset ()=0
 Reset validator.
 
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.
 

Protected Member Functions

void PushError (const std::string &error)
 Add error to list of error messages. More...
 
void PushNotice (const std::string &notice)
 Add message to list of notices. More...
 

Private Attributes

std::vector< std::string > errors_
 List of error messages.
 
std::vector< std::string > notices_
 List of messages.
 

Detailed Description

Requirements on input files.

Definition at line 39 of file Requirement.h.

Member Function Documentation

◆ GetErrors()

std::vector<std::string> Json::Requirement::GetErrors ( )
inline

◆ GetNotices()

std::vector<std::string> Json::Requirement::GetNotices ( )
inline

Get list of notices.

Returns
List of notice messages.

Definition at line 107 of file Requirement.h.

107 {return notices_; };
std::vector< std::string > notices_
List of messages.
Definition: Requirement.h:43

References notices_.

Referenced by Json::ArrayRequirement::Validate(), and Json::ObjectRequirement::Validate().

Here is the caller graph for this function:

◆ HasErrors()

bool Json::Requirement::HasErrors ( )
inline

◆ HasNotices()

virtual bool Json::Requirement::HasNotices ( )
inlinevirtual

Check if notices have been queued.

Returns
True if list of notices is not empty.

Definition at line 101 of file Requirement.h.

101 {return notices_.size() != 0; };

References notices_.

Referenced by Json::ObjectRequirement::Validate().

Here is the caller graph for this function:

◆ Parse()

virtual void Json::Requirement::Parse ( Value  json,
const std::string &  path 
)
pure virtual

◆ PushError()

void Json::Requirement::PushError ( const std::string &  error)
inlineprotected

Add error to list of error messages.

Parameters
errorError message.

This function adds an error message to the list of error messages. The list of error messages can be retrieved by Requirement::GetErrors()

Definition at line 53 of file Requirement.h.

53 { errors_.push_back(error); }

References errors_.

Referenced by Json::BooleanRequirement::Validate(), Json::EnumRequirement::Validate(), Json::NullRequirement::Validate(), Json::AllOfRequirement::Validate(), Json::AnyOfRequirement::Validate(), Json::ArrayRequirement::Validate(), Json::DependencyRequirement::Validate(), Json::IntegerRequirement::Validate(), Json::NotRequirement::Validate(), Json::NumberRequirement::Validate(), Json::ObjectRequirement::Validate(), Json::OneOfRequirement::Validate(), and Json::StringRequirement::Validate().

Here is the caller graph for this function:

◆ PushNotice()

void Json::Requirement::PushNotice ( const std::string &  notice)
inlineprotected

Add message to list of notices.

Parameters
noticeMessage string.

This function adds a new message to the list of messages. The list can be retrieved using Requirement::GetNotices().

Definition at line 62 of file Requirement.h.

62 { notices_.push_back(notice); }

References notices_.

Referenced by Json::AllOfRequirement::Validate(), Json::AnyOfRequirement::Validate(), Json::ArrayRequirement::Validate(), Json::ObjectRequirement::Validate(), and Json::OneOfRequirement::Validate().

Here is the caller graph for this function:

◆ Validate()

virtual void Json::Requirement::Validate ( const Value &  json,
const std::string &  path 
)
pure virtual

The documentation for this class was generated from the following file: