Apache Log4cxx  Version 1.3.1
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 (log4cxx::helpers::Pool &p) const
 Determines if file exists.
 
size_t length (log4cxx::helpers::Pool &p) const
 Determines length of file.
 
log4cxx_time_t lastModified (log4cxx::helpers::Pool &p) const
 Determines last modification date.
 
LogString getName () const
 Get final portion of file path.
 
LogString getPath () const
 Get file path.
 
FilesetPath (const LogString &)
 Set file path.
 
log4cxx_status_t open (apr_file_t **file, int flags, int perm, log4cxx::helpers::Pool &p) const
 Open file.
 
std::vector< LogStringlist (log4cxx::helpers::Pool &p) const
 List files if current file is a directory.
 
bool deleteFile (log4cxx::helpers::Pool &p) const
 Delete file.
 
bool renameTo (const File &dest, log4cxx::helpers::Pool &p) const
 Rename file.
 
LogString getParent (log4cxx::helpers::Pool &p) const
 Get path of parent directory.
 
bool mkdirs (log4cxx::helpers::Pool &p) const
 Make directories recursively.
 
void setAutoDelete (bool autoDelete)
 Set the file to be deleted when this object is destroyed.
 
bool getAutoDelete () const
 Return the value of the autodelete setting.
 

Detailed Description

An abstract representation of file and directory path names.

Examples
com/foo/config3.cpp.

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()

bool log4cxx::File::deleteFile ( log4cxx::helpers::Pool p) const

Delete file.

Parameters
ppool.
Returns
true if file successfully deleted.

◆ exists()

bool log4cxx::File::exists ( log4cxx::helpers::Pool p) const

Determines if file exists.

Parameters
ppool.
Returns
true if file exists.
Examples
com/foo/config3.cpp.

◆ getAutoDelete()

bool log4cxx::File::getAutoDelete ( ) const

Return 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

Get final portion of file path.

Returns
file name.

◆ getParent()

LogString log4cxx::File::getParent ( log4cxx::helpers::Pool p) const

Get path of parent directory.

Parameters
ppool.
Returns
path of parent directory.

◆ getPath()

LogString log4cxx::File::getPath ( ) const

Get file path.

Returns
file path.
Examples
com/foo/config3.cpp.

◆ lastModified()

log4cxx_time_t log4cxx::File::lastModified ( log4cxx::helpers::Pool p) const

Determines last modification date.

Parameters
ppool.
Returns
length of file.

◆ length()

size_t log4cxx::File::length ( log4cxx::helpers::Pool p) const

Determines length of file.

May not be accurate if file is current open.

Parameters
ppool.
Returns
length of file.

◆ list()

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

List files if current file is a directory.

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

◆ mkdirs()

bool log4cxx::File::mkdirs ( log4cxx::helpers::Pool p) const

Make directories recursively.

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

◆ open()

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

Open file.

See apr_file_open for details.

Parameters
fileAPR file handle.
flagsflags.
permpermissions.
ppool.
Returns
APR_SUCCESS if successful.

◆ operator=()

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

Assignment operator.

◆ renameTo()

bool log4cxx::File::renameTo ( const File dest,
log4cxx::helpers::Pool p 
) const

Rename file.

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

◆ setAutoDelete()

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

Set the file to be deleted when this object is destroyed.

Parameters
autoDeleteIf true, delete file upon destruction. If true, do not delete file.

◆ setPath()

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

Set file path.


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