SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
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:

Go to the source code of 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

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

Detailed Description

Date
October 2022
Authors
Marino von Wattenwyl
Remarks
Please use clangformat to format the code. See more code style on https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style

Definition in file SLFileStorage.h.

Macro Definition Documentation

◆ SL_STORAGE_FS

#define SL_STORAGE_FS

Definition at line 17 of file SLFileStorage.h.

Enumeration Type Documentation

◆ SLIOStreamKind

Enum of file kinds.

Enumerator
IOK_generic 
IOK_image 
IOK_model 
IOK_shader 
IOK_font 
IOK_config 

Definition at line 37 of file SLFileStorage.h.

38 {
40  IOK_image,
41  IOK_model,
42  IOK_shader,
43  IOK_font,
45 };
@ IOK_font
Definition: SLFileStorage.h:43
@ IOK_config
Definition: SLFileStorage.h:44
@ IOK_image
Definition: SLFileStorage.h:40
@ IOK_shader
Definition: SLFileStorage.h:42
@ IOK_generic
Definition: SLFileStorage.h:39
@ IOK_model
Definition: SLFileStorage.h:41

◆ SLIOStreamMode

Enum of stream opening modes.

Enumerator
IOM_read 
IOM_write 

Definition at line 48 of file SLFileStorage.h.

49 {
50  IOM_read,
51  IOM_write
52 };
@ IOM_read
Definition: SLFileStorage.h:50
@ IOM_write
Definition: SLFileStorage.h:51