Add content_type attribute that takes a MIME type to specify the file contents for meshes, hfields, and textures.
PiperOrigin-RevId: 549302344 Change-Id: I30a8adfef5b5d87bb20479329f3396892f5137ff
This commit is contained in:
committed by
Copybara-Service
parent
5f327b0c31
commit
5fcdae771b
+10
-1
@@ -15,6 +15,7 @@
|
||||
#ifndef MUJOCO_SRC_USER_USER_UTIL_H_
|
||||
#define MUJOCO_SRC_USER_USER_UTIL_H_
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
@@ -23,7 +24,6 @@ extern const double mjNAN; // used to mark undefined fields
|
||||
const double mjEPS = 1E-14; // minimum value in various calculations
|
||||
const double mjMINMASS = 1E-6; // minimum mass allowed
|
||||
|
||||
|
||||
// check if numeric variable is defined: !_isnan(num)
|
||||
bool mjuu_defined(const double num);
|
||||
|
||||
@@ -152,4 +152,13 @@ bool mjuu_isabspath(std::string path);
|
||||
// assemble full filename
|
||||
std::string mjuu_makefullname(std::string filedir, std::string meshdir, std::string filename);
|
||||
|
||||
// return type from content_type format {type}/{subtype}[;{parameter}={value}]
|
||||
std::optional<std::string_view> mjuu_parseContentTypeAttrType(std::string_view text);
|
||||
|
||||
// return subtype from content_type format {type}/{subtype}[;{parameter}={value}]
|
||||
std::optional<std::string_view> mjuu_parseContentTypeAttrSubtype(std::string_view text);
|
||||
|
||||
// convert filename extension to content type; return empty string if not found
|
||||
std::string mjuu_extToContentType(std::string_view filename);
|
||||
|
||||
#endif // MUJOCO_SRC_USER_USER_UTIL_H_
|
||||
|
||||
Reference in New Issue
Block a user