OpenLexocad  27.1
Base::FileInfo Class Reference

#include <FileInfo.h>

Public Member Functions

 FileInfo (const Base::String &FileName=L"")
 Construction. More...
 
void makeTemp (const char *Template)
 generates a unique file name More...
 
void setFile (const Base::String &name)
 set a new file name More...
 
bool exists () const
 Does the file exist? More...
 
Base::String filePath () const
 Returns the file name, including the path (which may be absolute or relative). More...
 
Base::String dirPath () const
 Returns the dir path name (which may be absolute or relative). More...
 
Base::String fileName () const
 Returns the name of the file, excluding the path, including the extension. More...
 
Base::String fileNamePure () const
 Returns the name of the file, excluding the path and the extension. More...
 
Base::String extension (bool complete=false) const
 
bool hasExtension (const Base::String &Ext) const
 checks for a special extension, NOT case sensitive More...
 
bool isReadable () const
 checks if the file exist and is readable More...
 
bool isWritable () const
 checks if the file exist and is writable More...
 
bool isFile () const
 
bool isDir () const
 
unsigned int size () const
 
bool createDirectory (const char *) const
 

Static Public Member Functions

static Base::String getTempPath (void)
 get the path to the dir which is designated to temp files More...
 
static Base::String getTempFileName (void)
 get a unique File Name in the temp path More...
 

Protected Attributes

Base::String FileName
 

Constructor & Destructor Documentation

◆ FileInfo()

Base::FileInfo::FileInfo ( const Base::String FileName = L"")

Construction.

Member Function Documentation

◆ createDirectory()

bool Base::FileInfo::createDirectory ( const char *  ) const

Creates a directory. Returns TRUE if successful; otherwise returns FALSE.

◆ dirPath()

Base::String Base::FileInfo::dirPath ( ) const

Returns the dir path name (which may be absolute or relative).

◆ exists()

bool Base::FileInfo::exists ( ) const

Does the file exist?

◆ extension()

Base::String Base::FileInfo::extension ( bool  complete = false) const

Returns the file's extension name. If complete is TRUE (the default), extension() returns the string of all characters in the file name after (but not including) the first '.' character. If complete is FALSE, extension() returns the string of all characters in the file name after (but not including) the last '.' character. Example:

FileInfo fi( "/tmp/archive.tar.gz" );
std::string ext = fi.extension(true); // ext = "tar.gz"
ext = fi.extension(false); // ext = "gz"
ext = fi.extension(); // ext = "gz"

◆ fileName()

Base::String Base::FileInfo::fileName ( ) const

Returns the name of the file, excluding the path, including the extension.

◆ fileNamePure()

Base::String Base::FileInfo::fileNamePure ( ) const

Returns the name of the file, excluding the path and the extension.

◆ filePath()

Base::String Base::FileInfo::filePath ( ) const

Returns the file name, including the path (which may be absolute or relative).

◆ getTempFileName()

static Base::String Base::FileInfo::getTempFileName ( void  )
static

get a unique File Name in the temp path

◆ getTempPath()

static Base::String Base::FileInfo::getTempPath ( void  )
static

get the path to the dir which is designated to temp files

◆ hasExtension()

bool Base::FileInfo::hasExtension ( const Base::String Ext) const

checks for a special extension, NOT case sensitive

◆ isDir()

bool Base::FileInfo::isDir ( ) const

◆ isFile()

bool Base::FileInfo::isFile ( ) const

◆ isReadable()

bool Base::FileInfo::isReadable ( ) const

checks if the file exist and is readable

◆ isWritable()

bool Base::FileInfo::isWritable ( ) const

checks if the file exist and is writable

◆ makeTemp()

void Base::FileInfo::makeTemp ( const char *  Template)

generates a unique file name

◆ setFile()

void Base::FileInfo::setFile ( const Base::String name)

set a new file name

◆ size()

unsigned int Base::FileInfo::size ( ) const

Member Data Documentation

◆ FileName

Base::String Base::FileInfo::FileName
protected

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