Add VFS handling logic to mj_openResource.

PiperOrigin-RevId: 653124909
Change-Id: I4d031eb0bfb0070f8493753d2aeaac60ac283b85
This commit is contained in:
Kyle Bayes
2024-07-17 00:40:20 -07:00
committed by Copybara-Service
parent 7f46e936f6
commit 2cf352c2e6
13 changed files with 244 additions and 247 deletions
+8
View File
@@ -16,9 +16,11 @@
#define MUJOCO_SRC_USER_USER_UTIL_H_
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
const double mjEPS = 1E-14; // minimum value in various calculations
const double mjMINMASS = 1E-6; // minimum mass allowed
@@ -230,6 +232,9 @@ class FilePath {
std::string path_;
};
// read file into memory buffer
std::vector<uint8_t> FileToMemory(const char* filename);
} // namespace mujoco::user
// strip path from filename
@@ -258,4 +263,7 @@ std::optional<std::string_view> mjuu_parseContentTypeAttrSubtype(std::string_vie
// convert filename extension to content type; return empty string if not found
std::string mjuu_extToContentType(std::string_view filename);
// get the length of the dirname portion of a given path
int mjuu_dirnamelen(const char* path);
#endif // MUJOCO_SRC_USER_USER_UTIL_H_