Cogs.Core
Public Types | Public Member Functions | List of all members
Cogs::IIOHandler Struct Referenceabstract

I/O handler. More...

#include <IEffects.h>

Inheritance diagram for Cogs::IIOHandler:
Cogs::Core::IOHandler Cogs::DefaultIOHandler

Public Types

enum class  FileType { ShaderDump = 0 , ShaderCache , PipelineCache }
 

Public Member Functions

virtual bool openFile (const StringView &fileName, std::string &content)=0
 Callback method used to open files.
 
virtual bool resolveFile (const StringView &source, const StringView &fileName, std::string &content)=0
 Callback method used to resolve include statements in shader code and get the contents to include.
 
virtual bool exists (FileType type, const StringView &fileName)=0
 
virtual bool writeBinaryFile (FileType type, const StringView &fileName, const void *content, size_t contentSize)=0
 
virtual bool openBinaryFile (FileType type, const StringView &fileName, std::vector< uint8_t > &content)=0
 
virtual void pushSearchPaths ()=0
 
virtual void addSearchPath (const StringView &path)=0
 
virtual void popSearchPaths ()=0
 

Detailed Description

I/O handler.

Definition at line 105 of file IEffects.h.

Member Enumeration Documentation

◆ FileType

enum class Cogs::IIOHandler::FileType
strong

Definition at line 127 of file IEffects.h.

Constructor & Destructor Documentation

◆ ~IIOHandler()

virtual Cogs::IIOHandler::~IIOHandler ( )
inlinevirtual

Definition at line 107 of file IEffects.h.

Member Function Documentation

◆ openFile()

virtual bool Cogs::IIOHandler::openFile ( const StringView fileName,
std::string &  content 
)
pure virtual

Callback method used to open files.

Parameters
fileNameFile name of the file that should be opened.
contentReference to a string that should receive the contents of the file.

Implemented in Cogs::Core::IOHandler, and Cogs::DefaultIOHandler.

◆ resolveFile()

virtual bool Cogs::IIOHandler::resolveFile ( const StringView source,
const StringView fileName,
std::string &  content 
)
pure virtual

Callback method used to resolve include statements in shader code and get the contents to include.

Parameters
sourceName of the source being compiled. This can e.g. be used to lookup include files based on the path of the currently compiling file.
fileNameFile name of the file that is being resolved.
contentReference to a string that should receive the contents of the file.

Implemented in Cogs::Core::IOHandler, and Cogs::DefaultIOHandler.


The documentation for this struct was generated from the following file: