OpenIG  2.0.4
cross-platform open-source OpenSceneGraph Image Generator
Public Types | Static Public Member Functions | List of all members
OpenIG::Base::FileSystem Class Reference

The FileSystem class. More...

#include <FileSystem.h>

Public Types

enum  PathType {
  None, Plugins, Data, Resources,
  PathList
}
 

Static Public Member Functions

static bool fileExists (const std::string &strFileName)
 Checks if a given file exists. More...
 
static std::string readFileIntoString (const std::string &strFileName)
 Reads a whole file into a string. More...
 
static std::string fileFullPath (const std::string &strFileName)
 Returns the full path of a file. More...
 
static std::string path (PathType type, const std::string &path="")
 Returns the full path of a given type based on the host system. More...
 
static bool match (const OpenIG::Base::StringUtils::StringList &patterns, const std::string &simpleFileName)
 Returns the matched existing file from a given FileList. You can use wild cards. More...
 
static time_t lastWriteTime (const std::string &fileName)
 Returns the time stamp of the last write. More...
 

Detailed Description

The FileSystem class.

Handy class to do few filesystem opertaions

Author
Poojan Prabhu openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Thu Oct 22 2015

Member Function Documentation

static bool OpenIG::Base::FileSystem::fileExists ( const std::string &  strFileName)
static

Checks if a given file exists.

Checks if a given file exists

Parameters
strFileNamethe name of the file
Returns
true if a file exists false otherwise
Author
Poojan Prabhu openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Thu Oct 22 2015
static std::string OpenIG::Base::FileSystem::fileFullPath ( const std::string &  strFileName)
static

Returns the full path of a file.

Returns the full path of a file

Parameters
strFileNamethe name of the file
Returns
the full path
Author
Poojan Prabhu openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Thu Oct 22 2015
static time_t OpenIG::Base::FileSystem::lastWriteTime ( const std::string &  fileName)
static

Returns the time stamp of the last write.

Returns the time stamp of the last write

Parameters
fileNamethe file name to check
Returns
the time stamp
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Thu Jan 14 2016
static bool OpenIG::Base::FileSystem::match ( const OpenIG::Base::StringUtils::StringList &  patterns,
const std::string &  simpleFileName 
)
static

Returns the matched existing file from a given FileList. You can use wild cards.

Returns the matched existing file from a given FileList. You can use wild cards and regex

Parameters
patternsStringList containing file names with path. You can use wildcard
Returns
the full path of the file found
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sat Oct 31 2015
static std::string OpenIG::Base::FileSystem::path ( PathType  type,
const std::string &  path = "" 
)
static

Returns the full path of a given type based on the host system.

Returns the full path of a given type based on the host system

Parameters
typethe enum above
pathoptional additional path to be appended
Returns
the full path based on ENV vars and host system, differs for Linux, Windows and Mac
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Thu Oct 22 2015
static std::string OpenIG::Base::FileSystem::readFileIntoString ( const std::string &  strFileName)
static

Reads a whole file into a string.

Reads a whole file into a string

Parameters
strFileNamethe name of the file
Returns
the file as a string
Author
Poojan Prabhu openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Thu Oct 22 2015

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