Cogs.Core
DefaultIOHandler.h
1#pragma once
2
3#include "../IEffects.h"
4
5namespace Cogs
6{
8 {
9 bool openFile(const StringView & fileName, std::string & content) override;
10
11 bool resolveFile(const StringView & source, const StringView & fileName, std::string & content) override;
12
13 bool exists(FileType type, const StringView & fileName) override;
14 bool writeBinaryFile(FileType type, const StringView & fileName, const void * content, size_t contentSize) override;
15 bool openBinaryFile(FileType type, const StringView & fileName, std::vector<uint8_t>& content) override;
16
17 void pushSearchPaths() override;
18 void addSearchPath(const StringView & path) override;
19 void popSearchPaths() override;
20
21 private:
22 std::vector<std::string> searchPaths = {
23#ifdef __EMSCRIPTEN__
24 "", "/Data/"
25#else
26 "", "../Data/", "../Data/Shaders/"
27#endif
28 };
29 std::vector<std::string> pushedSearchPaths;
30
31
32 };
33}
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
bool openFile(const StringView &fileName, std::string &content) override
Callback method used to open files.
bool resolveFile(const StringView &source, const StringView &fileName, std::string &content) override
Callback method used to resolve include statements in shader code and get the contents to include.
I/O handler.
Definition: IEffects.h:106