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

Holds the path to a file or directory. More...

#include <file.h>

Public Member Functions

 File ()
 An empty path.
 File (const char *path)
 The file or directory at path.
 File (const std::string &path)
 The file or directory at path.
 File (const wchar_t *path)
 The file or directory at path.
 File (const std::wstring &path)
 The file or directory at path.
 File (const CFStringRef &path)
 The file or directory at path.
 File (const File &other)
 A copy of other.
File & operator= (const File &other)
 Replace this with other.
 ~File ()
 Release resouces used by this.
bool hasPath () const
 Has a path been set?
bool exists () const
 Is this a path to an existing file or directory?
size_t length () const
 The size in bytes of the file indicated by this.
log4cxx_time_t lastModified () const
 The microseconds since 1970-01-01 when the file indicated by this was last modified.
LogString getName () const
 The final portion of the file or directory path.
LogString getPath () const
 The full file or directory path.
const char * getAPRPath () const
 The full file or directory path encoded for APR use.
File & setPath (const LogString &newValue)
 Use newValue as the file path.
std::vector< LogString > list () const
 A list of files if this is a directory, otherwise an empty list.
bool deleteFile () const
 Attempt to remove this file or directory from persistent storage.
bool renameTo (const File &newValue) const
 Move this file or directory to the path in newValue.
LogString getParent () const
 The path without the final portion.
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
 The value of the autodelete setting.

Detailed Description

Holds the path to a file or directory.

Constructor & Destructor Documentation

◆ File() [1/7]

log4cxx::File::File ( )

An empty path.

◆ File() [2/7]

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

The file or directory at path.

◆ File() [3/7]

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

The file or directory at path.

◆ File() [4/7]

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

The file or directory at path.

◆ File() [5/7]

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

The file or directory at path.

◆ File() [6/7]

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

The file or directory at path.

◆ File() [7/7]

log4cxx::File::File ( const File & other)

A copy of other.

◆ ~File()

log4cxx::File::~File ( )

Release resouces used by this.

Member Function Documentation

◆ deleteFile()

bool log4cxx::File::deleteFile ( ) const

Attempt to remove this file or directory from persistent storage.

Returns
true if file successfully deleted.

◆ exists()

bool log4cxx::File::exists ( ) const

Is this a path to an existing file or directory?

◆ getAPRPath()

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

The full file or directory path encoded for APR use.

◆ getAutoDelete()

bool log4cxx::File::getAutoDelete ( ) const

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

The final portion of the file or directory path.

◆ getParent()

LogString log4cxx::File::getParent ( ) const

The path without the final portion.

Returns
path of parent directory.

◆ getPath()

LogString log4cxx::File::getPath ( ) const

The full file or directory path.

◆ hasPath()

bool log4cxx::File::hasPath ( ) const

Has a path been set?

Returns
true if the file name is not empty.

◆ lastModified()

log4cxx_time_t log4cxx::File::lastModified ( ) const

The microseconds since 1970-01-01 when the file indicated by this was last modified.

◆ length()

size_t log4cxx::File::length ( ) const

The size in bytes of the file indicated by this.

May not be accurate if file is current open.

◆ list()

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

A list of files if this is a directory, otherwise an 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 & other)

Replace this with other.

◆ renameTo()

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

Move this file or directory to the path in newValue.

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: