comservatory
Strict validation of CSV files in C++
Loading...
Searching...
No Matches
Type.hpp
Go to the documentation of this file.
1#ifndef COMSERVATORY_TYPE_HPP
2#define COMSERVATORY_TYPE_HPP
3
10namespace comservatory {
11
15enum Type {
16 STRING,
17 NUMBER,
18 COMPLEX,
19 BOOLEAN,
20 UNKNOWN
21};
22
27inline std::string type_to_name (Type type) {
28 switch (type) {
29 case NUMBER:
30 return "NUMBER";
31 case STRING:
32 return "STRING";
33 case BOOLEAN:
34 return "BOOLEAN";
35 case COMPLEX:
36 return "COMPLEX";
37 case UNKNOWN:
38 return "UNKNOWN";
39 default:
40 throw std::runtime_error("unrecognized type for name generation");
41 }
42}
43
44}
45
46#endif
Contains all comservatory functions and classes.
Definition: Field.hpp:16
Type
Definition: Type.hpp:15
std::string type_to_name(Type type)
Definition: Type.hpp:27