KeywordValidation.hpp
Go to the documentation of this file.
56 std::optional<std::string> message; // An optional message to show if an illegal item is encountered
64 using PartiallySupportedKeywordItems = std::map<std::size_t, PartiallySupportedKeywordProperties<T>>;
79 std::optional<std::string> user_message; // An optional message to show if a problem is encountered
92 // These are special case validation functions for keyword which do not fit nicely into the general
93 // validation framework. The validation function itself is void, but error conditions are signalled by
104 const std::unordered_map<std::string, std::function<void(const DeckKeyword& keyword, std::vector<ValidationError>& errors)>>& special_validation)
125 void validateDeckKeyword(const DeckKeyword& keyword, std::vector<ValidationError>& errors) const;
147 const std::unordered_map<std::string, std::function<void(const DeckKeyword& keyword, std::vector<ValidationError>& errors)>> m_special_validation;
165 return std::find(m_allowed_values.begin(), m_allowed_values.end(), value) != m_allowed_values.end();
Definition: KeywordValidation.hpp:98 KeywordValidator(const UnsupportedKeywords &keywords, const PartiallySupportedKeywords< std::string > &string_items, const PartiallySupportedKeywords< int > &int_items, const PartiallySupportedKeywords< double > &double_items, const std::unordered_map< std::string, std::function< void(const DeckKeyword &keyword, std::vector< ValidationError > &errors)> > &special_validation) Definition: KeywordValidation.hpp:100 void validateDeck(const Deck &deck, const ParseContext &parse_context, const bool treat_critical_as_noncritical, ErrorGuard &error_guard) const void validateDeckKeyword(const DeckKeyword &keyword, std::vector< ValidationError > &errors) const Definition: KeywordValidation.hpp:154 bool operator()(const T &value) const Definition: KeywordValidation.hpp:163 allow_values(const std::initializer_list< T > &allowed_values) Definition: KeywordValidation.hpp:156 void validateBRINE(const DeckKeyword &keyword, std::vector< ValidationError > &errors) std::string get_error_report(const std::vector< ValidationError > &errors, const bool include_noncritical, const bool include_critical) std::map< std::size_t, PartiallySupportedKeywordProperties< T > > PartiallySupportedKeywordItems Definition: KeywordValidation.hpp:64 std::map< std::string, UnsupportedKeywordProperties > UnsupportedKeywords Definition: KeywordValidation.hpp:60 std::map< std::string, PartiallySupportedKeywordItems< T > > PartiallySupportedKeywords Definition: KeywordValidation.hpp:68 Definition: blackoilboundaryratevector.hh:37 Definition: KeywordValidation.hpp:53 std::function< bool(T)> validator Definition: KeywordValidation.hpp:55 bool critical Definition: KeywordValidation.hpp:54 std::optional< std::string > message Definition: KeywordValidation.hpp:56 Definition: KeywordValidation.hpp:46 bool critical Definition: KeywordValidation.hpp:47 std::optional< std::string > message Definition: KeywordValidation.hpp:48 Definition: KeywordValidation.hpp:73 KeywordLocation location Definition: KeywordValidation.hpp:75 std::optional< std::string > user_message Definition: KeywordValidation.hpp:79 std::optional< std::size_t > item_number Definition: KeywordValidation.hpp:77 std::optional< std::string > item_value Definition: KeywordValidation.hpp:78 std::size_t record_number Definition: KeywordValidation.hpp:76 |