FEDEM Model Database  R8.0
Source code of the FEDEM model database
Functions
FmFileSys Namespace Reference

File system utilities. More...

Functions

unsigned int getFileSize (const std::string &filename)
 Returns the number of bytes in the file filename. More...
 
std::string fileLastModified (const std::string &filename)
 Returns the date and time of last change of the file filename. More...
 
std::string getHomeDir ()
 Returns the home directory of the running process. More...
 
bool isFile (const std::string &path)
 Returns true if path is an existing file. More...
 
bool isDirectory (const std::string &path)
 Returns true if path is an existing directory. More...
 
bool isReadable (const std::string &filename)
 Returns true if filename can be opened for reading. More...
 
bool isWritable (const std::string &filename)
 Returns true if filename can be opened for writing. More...
 
bool deleteFile (const std::string &filename)
 Deletes the file filename from disk. More...
 
bool renameFile (const std::string &from, const std::string &to)
 Rename the file named from to to. More...
 
bool copyFile (const std::string &from, const std::string &to)
 Copies the file named from to to. More...
 
bool copyFile (const std::string &filename, const std::string &from, const std::string &to)
 Copies the file filename in directory from to to. More...
 
bool verifyDirectory (const std::string &dirName, bool create=true)
 Check that the directory dirName exists - if not create it. More...
 
int removeDir (const std::string &dirName, bool removeFiles=true)
 Recursively remove the directory dirName. More...
 
int getNextDirIncrement (const std::string &dirName, const std::string &baseDirName)
 File name checks - get unique number on a directory. More...
 
int getNextIncrement (const std::string &dirName, const char *extension, int startInc=1, const char *filter=NULL)
 File name checks - get unique number on a file. More...
 
int getNextIncrement (const std::vector< std::string > &dirNames, const char *extension)
 File name checks - get unique number on files. More...
 
bool getDirs (std::vector< std::string > &foundDirs, const std::string &searchPath, const char *filter=NULL, bool fullPath=false)
 Find all subdirectories in a named directory. More...
 
bool getFiles (std::vector< std::string > &foundFiles, const std::string &searchPath, const char *filter=NULL, bool fullPath=false)
 Find all files in a named directory. More...
 

Detailed Description

File system utilities.

Function Documentation

◆ copyFile() [1/2]

bool FmFileSys::copyFile ( const std::string &  filename,
const std::string &  from,
const std::string &  to 
)

Copies the file filename in directory from to to.

◆ copyFile() [2/2]

bool FmFileSys::copyFile ( const std::string &  from,
const std::string &  to 
)

Copies the file named from to to.

◆ deleteFile()

bool FmFileSys::deleteFile ( const std::string &  filename)

Deletes the file filename from disk.

◆ fileLastModified()

std::string FmFileSys::fileLastModified ( const std::string &  filename)

Returns the date and time of last change of the file filename.

◆ getDirs()

bool FmFileSys::getDirs ( std::vector< std::string > &  foundDirs,
const std::string &  searchPath,
const char *  filter = NULL,
bool  fullPath = false 
)

Find all subdirectories in a named directory.

◆ getFiles()

bool FmFileSys::getFiles ( std::vector< std::string > &  foundFiles,
const std::string &  searchPath,
const char *  filter = NULL,
bool  fullPath = false 
)

Find all files in a named directory.

◆ getFileSize()

unsigned int FmFileSys::getFileSize ( const std::string &  filename)

Returns the number of bytes in the file filename.

◆ getHomeDir()

std::string FmFileSys::getHomeDir ( )

Returns the home directory of the running process.

◆ getNextDirIncrement()

int FmFileSys::getNextDirIncrement ( const std::string &  dirName,
const std::string &  baseDirName 
)

File name checks - get unique number on a directory.

◆ getNextIncrement() [1/2]

int FmFileSys::getNextIncrement ( const std::string &  dirName,
const char *  extension,
int  startInc = 1,
const char *  filter = NULL 
)

File name checks - get unique number on a file.

◆ getNextIncrement() [2/2]

int FmFileSys::getNextIncrement ( const std::vector< std::string > &  dirNames,
const char *  extension 
)

File name checks - get unique number on files.

◆ isDirectory()

bool FmFileSys::isDirectory ( const std::string &  path)

Returns true if path is an existing directory.

◆ isFile()

bool FmFileSys::isFile ( const std::string &  path)

Returns true if path is an existing file.

◆ isReadable()

bool FmFileSys::isReadable ( const std::string &  filename)

Returns true if filename can be opened for reading.

◆ isWritable()

bool FmFileSys::isWritable ( const std::string &  filename)

Returns true if filename can be opened for writing.

◆ removeDir()

int FmFileSys::removeDir ( const std::string &  dirName,
bool  removeFiles = true 
)

Recursively remove the directory dirName.

◆ renameFile()

bool FmFileSys::renameFile ( const std::string &  from,
const std::string &  to 
)

Rename the file named from to to.

◆ verifyDirectory()

bool FmFileSys::verifyDirectory ( const std::string &  dirName,
bool  create = true 
)

Check that the directory dirName exists - if not create it.