Trippin Cyril
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
trippingcyril::TempFile Class Reference

An easy way to get temporary files in /tmp which will be deleted upon destruction of the object. More...

#include <Files.h>

Inheritance diagram for trippingcyril::TempFile:
[legend]
Collaboration diagram for trippingcyril::TempFile:
[legend]

Public Member Functions

 TempFile ()
 
 TempFile (const TempFile &that)
 
virtual ~TempFile ()
 
FileType GetType () const override
 
- Public Member Functions inherited from trippingcyril::File
 File (const String &path)
 
virtual ~File ()
 
virtual bool Exists () const
 
virtual off_t GetSize () const
 
virtual time_t GetATime () const
 
virtual time_t GetMTime () const
 
virtual time_t GetCTime () const
 
virtual uid_t GetUID () const
 
virtual gid_t GetGID () const
 
bool IsOpen () const
 
String GetName () const
 
String GetShortName () const
 
virtual bool Delete ()
 
virtual bool Move (const String &newpath, bool overwrite=false)
 
virtual bool Copy (const String &newpath, bool overwrite=false)
 
virtual bool Chmod (mode_t mode)
 
virtual bool Seek (off_t pos, int whence=SEEK_SET)
 
virtual off_t Tell ()
 
virtual bool Truncate (off_t len=0)
 
virtual bool Sync ()
 
virtual bool Open (int flags=O_RDONLY, mode_t mode=0644)
 
virtual int Read (char *buffer, size_t len)
 
virtual bool ReadLine (String &data, const String &delimiter="\n")
 
virtual bool ReadFile (String &data, size_t maxSize=512 *1024)
 
virtual int Write (const char *buffer, size_t len) override
 
void Close () override
 
- Public Member Functions inherited from trippingcyril::Writer
int WriteString (const String &data)
 
virtual bool shouldDelete () const override
 

Additional Inherited Members

- Public Types inherited from trippingcyril::File
enum  FileType {
  REGULAR, DIRECTORY, CHARACTER, BLOCK,
  FIFO, LINK, SOCK, TEMPORARY,
  UNKNOWN
}
 
- Static Public Attributes inherited from trippingcyril::Writer
static const int BUFFER_SIZE
 

Detailed Description

An easy way to get temporary files in /tmp which will be deleted upon destruction of the object.

Constructor & Destructor Documentation

trippingcyril::TempFile::TempFile ( )

Creates a temporary file in /tmp

trippingcyril::TempFile::TempFile ( const TempFile that)

Copy constructor, which will open the temporary file once again

virtual trippingcyril::TempFile::~TempFile ( )
virtual

This deconstructor will remove the file

Member Function Documentation

FileType trippingcyril::TempFile::GetType ( ) const
inlineoverridevirtual
Returns
Will always return TEMPORARY

Reimplemented from trippingcyril::File.


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