Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::TemporaryFile Class Reference

#include <TemporaryFile.h>

Inheritance diagram for Poco::TemporaryFile:

Poco::File

List of all members.


Detailed Description

The TemporaryFile class helps with the handling of temporary files. A unique name for the temporary file is automatically chosen and the file is placed in the directory reserved for temporary files (see Path::temp()). Obtain the path by calling the path() method (inherited from File).

The TemporaryFile class does not actually create the file - this is up to the application. The class does, however, delete the temporary file - either in the destructor, or immediately before the application terminates.

Definition at line 50 of file TemporaryFile.h.


Public Types

typedef FileSizeImpl FileSize

Public Member Functions

bool canRead () const
 Returns true iff the file exists.
bool canWrite () const
 Returns true iff the file is readable.
void copyTo (const std::string &path) const
Timestamp created () const
 Returns true iff the file is a directory.
void createDirectories ()
bool createDirectory ()
bool createFile ()
bool exists () const
 Returns the path.
Timestamp getLastModified () const
 Returns the creation date of the file.
FileSize getSize () const
 Sets the modification date of the file.
bool isDirectory () const
 Returns true iff the file is a symbolic link.
bool isFile () const
 Returns true iff the file is writeable.
bool isLink () const
 Returns true iff the file is a regular file.
void keep ()
void keepUntilExit ()
void list (std::vector< File > &files) const
void list (std::vector< std::string > &files) const
void moveTo (const std::string &path)
bool operator!= (const File &file) const
bool operator< (const File &file) const
bool operator<= (const File &file) const
bool operator== (const File &file) const
bool operator> (const File &file) const
bool operator>= (const File &file) const
const std::string & path () const
 Swaps the file with another one.
void remove (bool recursive=false)
 Renames the file to the new name.
void renameTo (const std::string &path)
void setLastModified (const Timestamp &ts)
 Returns the modification date of the file.
void setReadOnly (bool flag=true)
void setSize (FileSize size)
 Returns the size of the file in bytes.
void setWriteable (bool flag=true)
void swap (File &file)
 Assignment operator.
 ~TemporaryFile ()
 Creates the TemporaryFile.

Static Public Member Functions

static void registerForDeletion (const std::string &path)
static std::string tempName ()

Private Attributes

bool _keep

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

Generated by  Doxygen 1.6.0   Back to index