|
@@ -237,6 +237,34 @@ bool YamlDatabase::asString(const YAML::Node &node, const std::string &name, std
|
|
|
return asType<std::string>(node, name, out);
|
|
|
}
|
|
|
|
|
|
+bool YamlDatabase::asUInt16Rate( const YAML::Node& node, const std::string& name, uint16& out, uint16 maximum ){
|
|
|
+ if( this->asUInt16( node, name, out ) ){
|
|
|
+ if( out > maximum ){
|
|
|
+ this->invalidWarning( node[name], "Node \"%s\" with value %" PRIu16 " exceeds maximum of %" PRIu16 ".\n", name.c_str(), out, maximum );
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+bool YamlDatabase::asUInt32Rate( const YAML::Node& node, const std::string& name, uint32& out, uint32 maximum ){
|
|
|
+ if( this->asUInt32( node, name, out ) ){
|
|
|
+ if( out > maximum ){
|
|
|
+ this->invalidWarning( node[name], "Node \"%s\" with value %" PRIu32 " exceeds maximum of %" PRIu32 ".\n", name.c_str(), out, maximum );
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void YamlDatabase::invalidWarning( const YAML::Node &node, const char* fmt, ... ){
|
|
|
va_list ap;
|
|
|
|