Improve include meta-element to load included resourced from the directory relative to the included XML file, fully backwards compatible.
PiperOrigin-RevId: 608312069 Change-Id: I80eadb32d7d78fb35bd24975f2e514021c2aa009
This commit is contained in:
committed by
Copybara-Service
parent
b77dfc683a
commit
24eb4c9f09
+4
-1
@@ -35,7 +35,6 @@ using tinyxml2::XMLElement;
|
||||
XMLElement* FirstChildElement(XMLElement* e, const char* name = nullptr);
|
||||
XMLElement* NextSiblingElement(XMLElement* e, const char* name = nullptr);
|
||||
|
||||
|
||||
// XML Error info
|
||||
class [[nodiscard]] mjXError {
|
||||
public:
|
||||
@@ -109,6 +108,10 @@ class mjXUtil {
|
||||
static std::optional<std::string> ReadAttrStr(tinyxml2::XMLElement* elem, const char* attr,
|
||||
bool required = false);
|
||||
|
||||
// if attribute is present, return attribute as a filename
|
||||
static std::optional<std::string> ReadAttrFile(tinyxml2::XMLElement* elem, const char* attr,
|
||||
const std::string& dir = "", bool required = false);
|
||||
|
||||
// if attribute is present, return numerical value of attribute
|
||||
template<typename T>
|
||||
static std::optional<T> ReadAttrNum(tinyxml2::XMLElement* elem, const char* attr,
|
||||
|
||||
Reference in New Issue
Block a user