| 109 | } |
| 110 | |
| 111 | void validateModelName(const std::string& name, int line_number) |
| 112 | { |
| 113 | const auto line_str = std::to_string(line_number); |
| 114 | if(name.empty()) |
| 115 | { |
| 116 | throw RuntimeError("Error at line ", line_str, |
| 117 | ": Model/Node type name cannot be empty"); |
| 118 | } |
| 119 | if(name == "Root" || name == "root") |
| 120 | { |
| 121 | throw RuntimeError("Error at line ", line_str, |
| 122 | ": 'Root' is a reserved name and cannot be used as a node type"); |
| 123 | } |
| 124 | if(char c = findForbiddenChar(name); c != '\0') |
| 125 | { |
| 126 | throw RuntimeError("Error at line ", line_str, ": Model name '", name, |
| 127 | "' contains forbidden character ", formatForbiddenChar(c)); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | void validatePortName(const std::string& name, int line_number) |
| 132 | { |
no test coverage detected