GlistEngine
Loading...
Searching...
No Matches
gFile Class Reference

#include <gFile.h>

Inheritance diagram for gFile:
Collaboration diagram for gFile:

Public Types

enum  Mode { FILEMODE_READONLY , FILEMODE_WRITEONLY , FILEMODE_READWRITE , FILEMODE_APPEND }
 
enum  CopyOptions { NONE , SKIP_EXISTING , OVERWRITE_EXISTING , RECURSIVE }
 

Public Member Functions

 gFile ()
 
 gFile (const std::string &fullPath, int fileMode=FILEMODE_READONLY, bool isBinary=true)
 
virtual ~gFile ()
 
bool load (const std::string &fullPath, int fileMode=FILEMODE_READONLY, bool isBinary=true)
 
bool loadFile (const std::string &filePath, int fileMode=FILEMODE_READONLY, bool isBinary=true)
 
void close ()
 
fs::path getPath ()
 
int getMode ()
 
bool isBinary ()
 
void write (const std::string &content)
 
void write (std::vector< char > newBytes)
 
void write (const char *bytes, size_t length)
 
std::vector< char > getBytes ()
 
const std::vector< char > & getBytesConst ()
 
std::string getText ()
 
int getSize ()
 
std::string getFilename ()
 
std::string getDirectory ()
 
bool exists ()
 
bool isFile ()
 
bool isLink ()
 
bool isDirectory ()
 
bool isDevice ()
 
bool isOpen ()
 
- Public Member Functions inherited from gObject
 gObject ()
 
void logi (std::string message)
 
void logd (std::string message)
 
void logw (std::string message)
 
void loge (std::string message)
 
void logi (std::string tag, std::string message)
 
void logd (std::string tag, std::string message)
 
void logw (std::string tag, std::string message)
 
void loge (std::string tag, std::string message)
 

Static Public Member Functions

static bool doesFileExist (const std::string &fullPath)
 
static bool doesFileExistInAssets (const std::string &filePath)
 
static bool isFile (const std::string &fullPath)
 
static bool isFileInAssets (const std::string &filePath)
 
static bool isLink (const std::string &fullPath)
 
static bool isLinkInAssets (const std::string &filePath)
 
static bool isDirectory (const std::string &fullPath)
 
static bool isDirectoryInAssets (const std::string &filePath)
 
static bool isDevice (const fs::path &path)
 
static std::string getFilename (const fs::path &path)
 
static std::string getDirectory (const fs::path &path)
 
static std::string addComplementarySlashIfNeeded (const fs::path &filePath)
 
static void copy (const std::string &fromFullPath, const std::string &toFullPath, int copyOption=CopyOptions::NONE)
 
static bool copyFile (const std::string &fromFullPath, const std::string &toFullPath, int copyOption=CopyOptions::NONE)
 
static void copySymlink (const std::string &existingSymlinkFullPath, const std::string &newSymlinkFullPath)
 
static bool createDirectory (const std::string &fullPath)
 
static void createDirectorySymlink (const std::string &toFullPath, const std::string &symlinkFullPath)
 
static void createSymlink (const std::string &toFullPath, const std::string &symlinkFullPath)
 
static bool isEmpty (const std::string &fullPath)
 
static bool isEquivalent (const std::string &fullPath1, const std::string &fullPath2)
 
static bool isSymlink (const std::string &fullPath)
 
static bool remove (const std::string &fullPath)
 
static bool removeAll (const std::string &fullPath)
 
static void rename (const std::string &fromFullPath, const std::string &toFullPath)
 
static std::vector< std::string > getDirectoryContent (const std::string &fullPath)
 
- Static Public Member Functions inherited from gObject
static std::string gGetAppDir ()
 
static std::string gGetAssetsDir ()
 
static void gSetAssetsDir (std::string assetsDir)
 
static std::string gGetFilesDir ()
 
static std::string gGetImagesDir ()
 
static std::string gGetFontsDir ()
 
static std::string gGetModelsDir ()
 
static std::string gGetTexturesDir ()
 
static std::string gGetShadersDir ()
 
static std::string gGetSoundsDir ()
 
static std::string gGetDatabasesDir ()
 
static std::string gGetVideosDir ()
 
static void setCurrentResolution (int scalingNo, int currentResolutionNo)
 

Additional Inherited Members

- Static Public Attributes inherited from gObject
static const int LOGLEVEL_SILENT
 
static const int LOGLEVEL_DEBUG
 
static const int LOGLEVEL_INFO
 
static const int LOGLEVEL_WARNING
 
static const int LOGLEVEL_ERROR
 
- Static Protected Attributes inherited from gObject
static int renderpassnum
 
static int renderpassno
 
static int releasescaling
 
static int releaseresolution
 

Member Enumeration Documentation

◆ CopyOptions

Enumerator
NONE 
SKIP_EXISTING 
OVERWRITE_EXISTING 
RECURSIVE 

◆ Mode

Enumerator
FILEMODE_READONLY 
FILEMODE_WRITEONLY 
FILEMODE_READWRITE 
FILEMODE_APPEND 

Constructor & Destructor Documentation

◆ gFile() [1/2]

gFile::gFile ( )

◆ gFile() [2/2]

gFile::gFile ( const std::string &  fullPath,
int  fileMode = FILEMODE_READONLY,
bool  isBinary = true 
)

◆ ~gFile()

virtual gFile::~gFile ( )
virtual

Member Function Documentation

◆ addComplementarySlashIfNeeded()

static std::string gFile::addComplementarySlashIfNeeded ( const fs::path &  filePath)
static

◆ close()

void gFile::close ( )

◆ copy()

static void gFile::copy ( const std::string &  fromFullPath,
const std::string &  toFullPath,
int  copyOption = CopyOptions::NONE 
)
static

◆ copyFile()

static bool gFile::copyFile ( const std::string &  fromFullPath,
const std::string &  toFullPath,
int  copyOption = CopyOptions::NONE 
)
static

◆ copySymlink()

static void gFile::copySymlink ( const std::string &  existingSymlinkFullPath,
const std::string &  newSymlinkFullPath 
)
static

◆ createDirectory()

static bool gFile::createDirectory ( const std::string &  fullPath)
static

◆ createDirectorySymlink()

static void gFile::createDirectorySymlink ( const std::string &  toFullPath,
const std::string &  symlinkFullPath 
)
static

◆ createSymlink()

static void gFile::createSymlink ( const std::string &  toFullPath,
const std::string &  symlinkFullPath 
)
static

◆ doesFileExist()

static bool gFile::doesFileExist ( const std::string &  fullPath)
static

◆ doesFileExistInAssets()

static bool gFile::doesFileExistInAssets ( const std::string &  filePath)
static

◆ exists()

bool gFile::exists ( )

◆ getBytes()

std::vector< char > gFile::getBytes ( )

◆ getBytesConst()

const std::vector< char > & gFile::getBytesConst ( )
inline

◆ getDirectory() [1/2]

std::string gFile::getDirectory ( )

◆ getDirectory() [2/2]

static std::string gFile::getDirectory ( const fs::path &  path)
static

◆ getDirectoryContent()

static std::vector< std::string > gFile::getDirectoryContent ( const std::string &  fullPath)
static

◆ getFilename() [1/2]

std::string gFile::getFilename ( )

◆ getFilename() [2/2]

static std::string gFile::getFilename ( const fs::path &  path)
static

◆ getMode()

int gFile::getMode ( )

◆ getPath()

fs::path gFile::getPath ( )

◆ getSize()

int gFile::getSize ( )

◆ getText()

std::string gFile::getText ( )

◆ isBinary()

bool gFile::isBinary ( )

◆ isDevice() [1/2]

bool gFile::isDevice ( )

◆ isDevice() [2/2]

static bool gFile::isDevice ( const fs::path &  path)
static

◆ isDirectory() [1/2]

bool gFile::isDirectory ( )

◆ isDirectory() [2/2]

static bool gFile::isDirectory ( const std::string &  fullPath)
static

◆ isDirectoryInAssets()

static bool gFile::isDirectoryInAssets ( const std::string &  filePath)
static

◆ isEmpty()

static bool gFile::isEmpty ( const std::string &  fullPath)
static

◆ isEquivalent()

static bool gFile::isEquivalent ( const std::string &  fullPath1,
const std::string &  fullPath2 
)
static

◆ isFile() [1/2]

bool gFile::isFile ( )

◆ isFile() [2/2]

static bool gFile::isFile ( const std::string &  fullPath)
static

◆ isFileInAssets()

static bool gFile::isFileInAssets ( const std::string &  filePath)
static

◆ isLink() [1/2]

bool gFile::isLink ( )

◆ isLink() [2/2]

static bool gFile::isLink ( const std::string &  fullPath)
static

◆ isLinkInAssets()

static bool gFile::isLinkInAssets ( const std::string &  filePath)
static

◆ isOpen()

bool gFile::isOpen ( )

◆ isSymlink()

static bool gFile::isSymlink ( const std::string &  fullPath)
static

◆ load()

bool gFile::load ( const std::string &  fullPath,
int  fileMode = FILEMODE_READONLY,
bool  isBinary = true 
)

◆ loadFile()

bool gFile::loadFile ( const std::string &  filePath,
int  fileMode = FILEMODE_READONLY,
bool  isBinary = true 
)

◆ remove()

static bool gFile::remove ( const std::string &  fullPath)
static

◆ removeAll()

static bool gFile::removeAll ( const std::string &  fullPath)
static

◆ rename()

static void gFile::rename ( const std::string &  fromFullPath,
const std::string &  toFullPath 
)
static

◆ write() [1/3]

void gFile::write ( const char *  bytes,
size_t  length 
)

◆ write() [2/3]

void gFile::write ( const std::string &  content)

◆ write() [3/3]

void gFile::write ( std::vector< char >  newBytes)

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