Apache Log4cxx  Version 1.7.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 UniChar *path)
 Construct a new instance.
 File (const std::basic_string< UniChar > &path)
 Construct a new instance.
 File (const CFStringRef &path)
 Construct a new instance.
 File (const File &src)
 Copy constructor.
Fileoperator= (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.
FilesetPath (const LogString &newVAlue)
 Use newValue as the file path.
log4cxx_status_t open (apr_file_t **file, int flags, int perm, helpers::Pool &1) const
 Open this file.
std::vector< LogStringlist () 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.
bool exists (helpers::Pool &1) const
size_t length (helpers::Pool &1) const
log4cxx_time_t lastModified (helpers::Pool &1) const
std::vector< LogStringlist (helpers::Pool &1) const
bool deleteFile (helpers::Pool &1) const
bool renameTo (const File &dest, helpers::Pool &1) const
LogString getParent (helpers::Pool &1) const
bool mkdirs (helpers::Pool &1) const

Detailed Description

An abstract representation of file and directory path names.

Constructor & Destructor Documentation

◆ File() [1/9]

log4cxx::File::File ( )

Construct a new instance.

◆ File() [2/9]

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/9]

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/9]

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

Construct a new instance.

Use setPath to specify path using a LogString.

Parameters
pathfile path.

◆ File() [5/9]

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

Construct a new instance.

Use setPath to specify path using a LogString.

Parameters
pathfile path.

◆ File() [6/9]

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

Construct a new instance.

Use setPath to specify path using a LogString.

Parameters
pathfile path.

◆ File() [7/9]

log4cxx::File::File ( const std::basic_string< UniChar > & path)

Construct a new instance.

Use setPath to specify path using a LogString.

Parameters
pathfile path.

◆ File() [8/9]

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

Construct a new instance.

Use setPath to specify path using a LogString.

Parameters
pathfile path.

◆ File() [9/9]

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

Copy constructor.

◆ ~File()

log4cxx::File::~File ( )

Destructor.

Member Function Documentation

◆ deleteFile() [1/2]

bool log4cxx::File::deleteFile ( ) const

Delete this file.

Returns
true if file successfully deleted.

◆ deleteFile() [2/2]

bool log4cxx::File::deleteFile ( helpers::Pool & 1) const
Deprecated
This function is deprecated and will be removed in a future version.

◆ exists() [1/2]

bool log4cxx::File::exists ( ) const

Determines if file exists.

Returns
true if file exists.

◆ exists() [2/2]

bool log4cxx::File::exists ( helpers::Pool & 1) const
Deprecated
This function is deprecated and will be removed in a future version.

◆ 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() [1/2]

LogString log4cxx::File::getParent ( ) const

Provides the path of parent directory.

Returns
path of parent directory.

◆ getParent() [2/2]

LogString log4cxx::File::getParent ( helpers::Pool & 1) const
Deprecated
This function is deprecated and will be removed in a future version.

◆ getPath()

LogString log4cxx::File::getPath ( ) const

Provides the file path.

Returns
file path.

◆ lastModified() [1/2]

log4cxx_time_t log4cxx::File::lastModified ( ) const

Provides the last modification date.

Returns
the filesystem time of last modification.

◆ lastModified() [2/2]

log4cxx_time_t log4cxx::File::lastModified ( helpers::Pool & 1) const
Deprecated
This function is deprecated and will be removed in a future version.

◆ length() [1/2]

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.

◆ length() [2/2]

size_t log4cxx::File::length ( helpers::Pool & 1) const
Deprecated
This function is deprecated and will be removed in a future version.

◆ list() [1/2]

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.

◆ list() [2/2]

std::vector< LogString > log4cxx::File::list ( helpers::Pool & 1) const
Deprecated
This function is deprecated and will be removed in a future version.

◆ mkdirs() [1/2]

bool log4cxx::File::mkdirs ( ) const

Create the directories required for this file path.

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

◆ mkdirs() [2/2]

bool log4cxx::File::mkdirs ( helpers::Pool & 1) const
Deprecated
This function is deprecated and will be removed in a future version.

◆ open()

log4cxx_status_t log4cxx::File::open ( apr_file_t ** file,
int flags,
int perm,
helpers::Pool & 1 ) const

Open this file.

See apr_file_open for details.

Parameters
fileallocated APR file handle.
flagsflags.
permpermissions.
Returns
APR_SUCCESS if successful.
Deprecated
This function is deprecated and will be removed in a future version.

◆ operator=()

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

Assignment operator.

◆ renameTo() [1/2]

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

Rename this file.

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

◆ renameTo() [2/2]

bool log4cxx::File::renameTo ( const File & dest,
helpers::Pool & 1 ) const
Deprecated
This function is deprecated and will be removed in a future version.

◆ setAutoDelete()

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

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

Parameters
autoDeleteIf 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: