SLProject 4.0.000
SLFileStorage.h File Reference
#include <Utils.h>
#include <string>
#include <fstream>
Include dependency graph for SLFileStorage.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  SLIOBuffer
 Utility struct that holds a pointer and its length. More...
 
class  SLIOStream
 Interface for accessing external data using streams. More...
 

Namespaces

namespace  SLFileStorage
 Collection of functions to open, use and close streams.
 

Macros

#define SL_STORAGE_FS
 

Enumerations

enum  SLIOStreamKind { IOK_generic , IOK_image , IOK_model , IOK_shader , IOK_font , IOK_config }
 Enum of file kinds. More...
 
enum  SLIOStreamMode { IOM_read , IOM_write }
 Enum of stream opening modes. More...
 

Functions

SLIOStreamSLFileStorage::open (std::string path, SLIOStreamKind kind, SLIOStreamMode mode)
 Opens a file stream for I/O operations. More...
 
void SLFileStorage::close (SLIOStream *stream)
 Closes and deletes a stream. More...
 
bool SLFileStorage::exists (std::string path, SLIOStreamKind kind)
 Checks whether a given file exists. More...
 
SLIOBuffer SLFileStorage::readIntoBuffer (std::string path, SLIOStreamKind kind)
 Reads an entire file into memory. More...
 
void SLFileStorage::deleteBuffer (SLIOBuffer &buffer)
 Deallocates the data of a buffer returned by SLFileStorage::readIntoBuffer. More...
 
std::string SLFileStorage::readIntoString (std::string path, SLIOStreamKind kind)
 Reads an entire file into a string. More...
 
void SLFileStorage::writeString (std::string path, SLIOStreamKind kind, const std::string &string)
 Writes a string to a file. More...
 

Macro Definition Documentation

◆ SL_STORAGE_FS

#define SL_STORAGE_FS

Enumeration Type Documentation

◆ SLIOStreamKind

Enum of file kinds.

Enumerator
IOK_generic 
IOK_image 
IOK_model 
IOK_shader 
IOK_font 
IOK_config 

◆ SLIOStreamMode

Enum of stream opening modes.

Enumerator
IOM_read 
IOM_write