Stricter parsing of XML array attributes.

PiperOrigin-RevId: 451456510
Change-Id: I2556d4365762378261c04d3c9f1942166fbd156e
This commit is contained in:
Alessio Quaglino
2022-05-27 12:50:09 -07:00
committed by Copybara-Service
parent 0741273c86
commit f3453cf87f
4 changed files with 120 additions and 172 deletions
+6
View File
@@ -98,6 +98,12 @@ class mjXUtil {
// find value in map, return key ("": not found)
static std::string FindValue(const mjMap* map, int mapsz, int value);
// read any type from attribute, return number read
template<typename T>
static int ReadAttrCpp(tinyxml2::XMLElement* elem, const char* attr, const int len,
T* data, std::string& text,
bool required = false, bool exact = true);
// read DOUBLE array from attribute, return number read
static int ReadAttr(tinyxml2::XMLElement* elem, const char* attr, const int len,
double* data, std::string& text,