Add mj_parseXML and mj_saveXML to xml_api.
PiperOrigin-RevId: 640099466 Change-Id: I75f763523c5bc8f6f7c2f2de6806d82ba37ebd4e
This commit is contained in:
committed by
Saran Tunyasuvunakool
parent
1bf90af0e0
commit
b35ae973e1
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <mujoco/mjexport.h>
|
||||
#include <mujoco/mjmodel.h>
|
||||
#include "user/user_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -43,6 +44,14 @@ MJAPI int mj_printSchema(const char* filename, char* buffer, int buffer_sz,
|
||||
// if vfs is not NULL, look up file in vfs before reading from disk
|
||||
MJAPI mjModel* mj_loadModel(const char* filename, const mjVFS* vfs);
|
||||
|
||||
// parse spec from file or XML string.
|
||||
MJAPI mjSpec* mj_parseXML(const char* filename, const mjVFS* vfs, char* error, int error_sz);
|
||||
MJAPI mjSpec* mj_parseXMLString(const char* xml, const mjVFS* vfs, char* error, int error_sz);
|
||||
|
||||
// Save spec to XML file and/or string, return 1 on success, 0 otherwise.
|
||||
MJAPI int mj_saveXML(const mjSpec* s, const char* filename, char* error, int error_sz);
|
||||
MJAPI int mj_saveXMLString(const mjSpec* s, char* xml, int xml_sz, char* error, int error_sz);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user