Skip to content

raisim::server::scene_files ​

namespace

Classes ​

  • class Hasher — 64-bit content hash of a file, computed incrementally.

Enumerations ​

Status ​

#include <raisim/server/SceneFileProtocol.hpp>

cpp
enum Status : int32_t

State of the server's file list, sent in every response header.

EnumeratorValueDescription
kNoScene0the world was not built from a .rscene file
kPreparing1the server is listing and hashing the files
kReady2the manifest can be requested
kFailed3the files could not be read; statusMessage says why
kDisabled4RaisimServer::setSceneFileSharing(false).

MessageKind ​

#include <raisim/server/SceneFileProtocol.hpp>

cpp
enum MessageKind : int32_t

Message kinds of the scene-file block.

EnumeratorValue
kManifest1
kChunk2
kError3

Functions ​

pathUtf8 ​

#include <raisim/server/SceneFileProtocol.hpp>

cpp
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>

cpp
bool hashFile(
    const std::filesystem::path &file,
    std::uint64_t &size,
    std::uint64_t &hash)

Hash a whole file.

Parameters

ParameterDescription
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>

cpp
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

ParameterDescription
path (in)relative path from a manifest

Returns true if the path is safe to create

Variables ​

kMaxClientRequestsPerFrame ​

#include <raisim/server/SceneFileProtocol.hpp>

cpp
constexpr int32_t kMaxClientRequestsPerFrame

kMaxFiles ​

#include <raisim/server/SceneFileProtocol.hpp>

cpp
constexpr int32_t kMaxFiles

Most files a manifest may list.

kMaxPathBytes ​

#include <raisim/server/SceneFileProtocol.hpp>

cpp
constexpr std::size_t kMaxPathBytes

Longest relative or server path, in bytes.

kMaxChunkBytes ​

#include <raisim/server/SceneFileProtocol.hpp>

cpp
constexpr int32_t kMaxChunkBytes

Largest chunk a viewer may request, and the most chunk bytes in one response.

kMaxManifestBytes ​

#include <raisim/server/SceneFileProtocol.hpp>

cpp
constexpr std::size_t kMaxManifestBytes

Largest encoded manifest; a scene with a longer list is reported as kFailed.

RaiSim — physics for robotics and AI.