@@ -18,6 +18,25 @@ namespace YAVL {
18
18
{
19
19
return " string" ;
20
20
}
21
+
22
+ template <>
23
+ std::string ctype2str<long long >()
24
+ {
25
+ return " long long" ;
26
+ }
27
+
28
+ template <>
29
+ std::string ctype2str<unsigned int >()
30
+ {
31
+ return " unsigned int" ;
32
+ }
33
+
34
+ template <>
35
+ std::string ctype2str<int >()
36
+ {
37
+ return " int" ;
38
+ }
39
+
21
40
}
22
41
23
42
ostream& operator << (ostream& os, const Path& path)
@@ -129,6 +148,12 @@ bool Validator::validate_leaf(const YAML::Node &gr, const YAML::Node &doc)
129
148
attempt_to_convert<string>(doc, ok);
130
149
} else if (type == " uint64" ) {
131
150
attempt_to_convert<unsigned long long >(doc, ok);
151
+ } else if (type == " int64" ) {
152
+ attempt_to_convert<long long >(doc, ok);
153
+ } else if (type == " int" ) {
154
+ attempt_to_convert<int >(doc, ok);
155
+ } else if (type == " uint" ) {
156
+ attempt_to_convert<unsigned int >(doc, ok);
132
157
} else if (type == " enum" ) {
133
158
ok = false ;
134
159
string docValue = doc;
@@ -139,7 +164,7 @@ bool Validator::validate_leaf(const YAML::Node &gr, const YAML::Node &doc)
139
164
}
140
165
}
141
166
if (!ok) {
142
- string reason = " enum string " + docValue + " is not allowed." ;
167
+ string reason = " enum string ' " + docValue + " ' is not allowed." ;
143
168
gen_error (Exception (reason, gr_path, doc_path));
144
169
}
145
170
}
0 commit comments