35 lines
998 B
C++
35 lines
998 B
C++
// D:\Dev\Mosis\MosisService\designer\src\desktop_file_interface.h
|
|
#pragma once
|
|
|
|
#include <RmlUi/Core/FileInterface.h>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <cstdint>
|
|
|
|
namespace mosis {
|
|
|
|
class DesktopFileInterface : public Rml::FileInterface {
|
|
public:
|
|
DesktopFileInterface() = default;
|
|
~DesktopFileInterface() override = default;
|
|
|
|
// Asset path management
|
|
void SetAssetsPath(const std::string& path);
|
|
std::string GetAssetsPath() const { return m_assets_path; }
|
|
|
|
// RmlUi FileInterface
|
|
Rml::FileHandle Open(const Rml::String& path) override;
|
|
void Close(Rml::FileHandle file) override;
|
|
size_t Read(void* buffer, size_t size, Rml::FileHandle file) override;
|
|
bool Seek(Rml::FileHandle file, long offset, int origin) override;
|
|
size_t Tell(Rml::FileHandle file) override;
|
|
size_t Length(Rml::FileHandle file) override;
|
|
|
|
private:
|
|
std::string ResolvePath(const std::string& path) const;
|
|
|
|
std::string m_assets_path;
|
|
};
|
|
|
|
} // namespace mosis
|