CASM  1.1.0
A Clusters Approach to Statistical Mechanics
Validator.hh
Go to the documentation of this file.
1 #ifndef CASM_Validator
2 #define CASM_Validator
3 
4 #include <set>
5 #include <string>
6 
7 namespace CASM {
8 
10 struct Validator {
11  std::set<std::string> error;
12  std::set<std::string> warning;
13 
14  void clear() {
15  error.clear();
16  warning.clear();
17  }
18 
19  Validator &insert(const Validator &other) {
20  error.insert(other.error.begin(), other.error.end());
21  warning.insert(other.warning.begin(), other.warning.end());
22  return *this;
23  }
24 
25  bool valid() const { return !error.size(); }
26 };
27 
28 } // namespace CASM
29 
30 #endif
Main CASM namespace.
Definition: APICommand.hh:8
Data structure to hold error and warning messages.
Definition: Validator.hh:10
Validator & insert(const Validator &other)
Definition: Validator.hh:19
bool valid() const
Definition: Validator.hh:25
std::set< std::string > error
Definition: Validator.hh:11
std::set< std::string > warning
Definition: Validator.hh:12