raisim::server::scene_files
namespace
Classes
classHasher — 64-bit content hash of a file, computed incrementally.
Enumerations
Status
#include <raisim/server/SceneFileProtocol.hpp>
enum Status : int32_tState of the server's file list, sent in every response header.
| Enumerator | Value | Description |
|---|---|---|
kNoScene | 0 | the world was not built from a .rscene file |
kPreparing | 1 | the server is listing and hashing the files |
kReady | 2 | the manifest can be requested |
kFailed | 3 | the files could not be read; statusMessage says why |
kDisabled | 4 | RaisimServer::setSceneFileSharing(false). |
MessageKind
#include <raisim/server/SceneFileProtocol.hpp>
enum MessageKind : int32_tMessage kinds of the scene-file block.
| Enumerator | Value |
|---|---|
kManifest | 1 |
kChunk | 2 |
kError | 3 |
Functions
pathUtf8
#include <raisim/server/SceneFileProtocol.hpp>
std::string pathUtf8(const std::filesystem::path &path)UTF-8 representation used by scene-file protocol paths on every platform.
hashFile
#include <raisim/server/SceneFileProtocol.hpp>
bool hashFile(
const std::filesystem::path &file,
std::uint64_t &size,
std::uint64_t &hash)Hash a whole file.
Parameters
| Parameter | Description |
|---|---|
file (in) | file to read |
size (out) | its size in bytes |
hash (out) | its Hasher digest |
Returns false if the file cannot be read
isSafeRelativePath
#include <raisim/server/SceneFileProtocol.hpp>
bool isSafeRelativePath(const std::string &path)Whether a manifest's relative path can be stored below a directory on every supported platform: '/'-separated, no empty, "." or ".." component, no absolute or drive prefix, no character Windows rejects, and no Windows device name.
Parameters
| Parameter | Description |
|---|---|
path (in) | relative path from a manifest |
Returns true if the path is safe to create
Variables
kMaxClientRequestsPerFrame
#include <raisim/server/SceneFileProtocol.hpp>
constexpr int32_t kMaxClientRequestsPerFramekMaxFiles
#include <raisim/server/SceneFileProtocol.hpp>
constexpr int32_t kMaxFilesMost files a manifest may list.
kMaxPathBytes
#include <raisim/server/SceneFileProtocol.hpp>
constexpr std::size_t kMaxPathBytesLongest relative or server path, in bytes.
kMaxChunkBytes
#include <raisim/server/SceneFileProtocol.hpp>
constexpr int32_t kMaxChunkBytesLargest chunk a viewer may request, and the most chunk bytes in one response.
kMaxManifestBytes
#include <raisim/server/SceneFileProtocol.hpp>
constexpr std::size_t kMaxManifestBytesLargest encoded manifest; a scene with a longer list is reported as kFailed.