Refactor numerical parsing in XML.
PiperOrigin-RevId: 653979240 Change-Id: I4d39f4041b88396193eb35f0cc393141d64f6fc0
This commit is contained in:
committed by
Copybara-Service
parent
e92af73cbf
commit
8a8a44a4db
@@ -163,21 +163,9 @@ class mjXUtil {
|
||||
static bool ReadAttrInt(tinyxml2::XMLElement* elem, const char* attr, int* data,
|
||||
bool required = false);
|
||||
|
||||
// convert string to vector
|
||||
template<typename T>
|
||||
static std::vector<T> String2Vector(const std::string& s);
|
||||
|
||||
// write vector<string> to string
|
||||
static void Vector2String(std::string& txt, const std::vector<std::string>& vec);
|
||||
|
||||
// write vector<double> to string
|
||||
static void Vector2String(std::string& txt, const std::vector<double>& vec);
|
||||
|
||||
// write vector<float> to string
|
||||
static void Vector2String(std::string& txt, const std::vector<float>& vec, int ncol = 0);
|
||||
|
||||
// write vector<int> to string
|
||||
static void Vector2String(std::string& txt, const std::vector<int>& vec);
|
||||
|
||||
// find subelement with given name, make sure it is unique
|
||||
static tinyxml2::XMLElement* FindSubElem(tinyxml2::XMLElement* elem, std::string name,
|
||||
@@ -212,8 +200,6 @@ class mjXUtil {
|
||||
template<typename T>
|
||||
static bool ReadAttrValues(tinyxml2::XMLElement* elem, const char* attr,
|
||||
std::function<void (int, T)> push, int max = -1);
|
||||
template<typename T> static T StrToNum(char* str, char** c);
|
||||
|
||||
};
|
||||
|
||||
#endif // MUJOCO_SRC_XML_XML_UTIL_H_
|
||||
|
||||
Reference in New Issue
Block a user