Apache Log4cxx  Version 2.0.0
Loading...
Searching...
No Matches
log4cxx::File Class Reference

An abstract representation of file and directory path names. More...

#include <file.h>

Public Member Functions

 File ()
 Construct a new instance.
 File (const char *path)
 Construct a new instance.
 File (const std::string &path)
 Construct a new instance.
 File (const wchar_t *path)
 Construct a new instance.
 File (const std::wstring &path)
 Construct a new instance.
 File (const CFStringRef &path)
 Construct a new instance.
 File (const File &src)
 Copy constructor.
File & operator= (const File &src)
 Assignment operator.
 ~File ()
 Destructor.
bool exists () const
 Determines if file exists.
size_t length () const
 Provides the length of the file.
log4cxx_time_t lastModified () const
 Provides the last modification date.
LogString getName () const
 Provides the final portion of file path.
LogString getPath () const
 Provides the file path.
const char * getAPRPath () const
 Provides the file path.
File & setPath (const LogString &newVAlue)
 Use newValue as the file path.
std::vector< LogString > list () const
 List files if current file is a directory.
bool deleteFile () const
 Delete this file.
bool renameTo (const File &dest) const
 Rename this file.
LogString getParent () const
 Provides the path of parent directory.
bool mkdirs () const
 Create the directories required for this file path.
void setAutoDelete (bool newValue)
 Use newValue for whether the file is to be deleted when this object is destroyed.
bool getAutoDelete () const
 Provides the value of the autodelete setting.

Detailed Description

An abstract representation of file and directory path names.

Constructor & Destructor Documentation

◆ File() [1/7]

log4cxx::File::File ( )

Construct a new instance.

◆ File() [2/7]

log4cxx::File::File ( const char * path)

Construct a new instance.

Use setPath to specify path using a LogString.

Parameters
pathfile path in local encoding.

◆ File() [3/7]

log4cxx::File::File ( const std::string & path)

Construct a new instance.

Use setPath to specify path using a LogString.

Parameters
pathfile path in current encoding.

◆ File() [4/7]

log4cxx::File::File ( const wchar_t * path)

Construct a new instance.

Use setPath to specify path using a LogString.

Parameters
pathfile path.

◆ File() [5/7]

log4cxx::File::File ( const std::wstring & path)

Construct a new instance.

Use setPath to specify path using a LogString.

Parameters
pathfile path.

◆ File() [6/7]

log4cxx::File::File ( const CFStringRef & path)

Construct a new instance.

Use setPath to specify path using a LogString.

Parameters
pathfile path.

◆ File() [7/7]

log4cxx::File::File ( const File & src)

Copy constructor.

◆ ~File()

log4cxx::File::~File ( )

Destructor.

Member Function Documentation

◆ deleteFile()

bool log4cxx::File::deleteFile ( ) const

Delete this file.

Returns
true if file successfully deleted.

◆ exists()

bool log4cxx::File::exists ( ) const

Determines if file exists.

Returns
true if file exists.

◆ getAPRPath()

const char * log4cxx::File::getAPRPath ( ) const

Provides the file path.

Returns
file path.

◆ getAutoDelete()

bool log4cxx::File::getAutoDelete ( ) const

Provides the value of the autodelete setting.

If true, this file will be deleted when the destructor is called.

Returns
True if the file is deleted upon destruction.

◆ getName()

LogString log4cxx::File::getName ( ) const

Provides the final portion of file path.

Returns
file name.

◆ getParent()

LogString log4cxx::File::getParent ( ) const

Provides the path of parent directory.

Returns
path of parent directory.

◆ getPath()

LogString log4cxx::File::getPath ( ) const

Provides the file path.

Returns
file path.

◆ lastModified()

log4cxx_time_t log4cxx::File::lastModified ( ) const

Provides the last modification date.

Returns
the filesystem time of last modification.

◆ length()

size_t log4cxx::File::length ( ) const

Provides the length of the file.

May not be accurate if file is current open.

Returns
length of file.

◆ list()

std::vector< LogString > log4cxx::File::list ( ) const

List files if current file is a directory.

Returns
list of files in this directory, operation of non-directory returns empty list.

◆ mkdirs()

bool log4cxx::File::mkdirs ( ) const

Create the directories required for this file path.

Returns
true if all requested directories existed or have been created.

◆ operator=()

File & log4cxx::File::operator= ( const File & src)

Assignment operator.

◆ renameTo()

bool log4cxx::File::renameTo ( const File & dest) const

Rename this file.

Parameters
destnew path for file.
Returns
true if file successfully renamed.

◆ setAutoDelete()

void log4cxx::File::setAutoDelete ( bool newValue)

Use newValue for whether the file is to be deleted when this object is destroyed.

Parameters
newValueIf true, delete file upon destruction.

◆ setPath()

File & log4cxx::File::setPath ( const LogString & newVAlue)

Use newValue as the file path.


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