spot  2.16
Public Types | Public Member Functions | Protected Attributes | List of all members
spot::open_temporary_file Class Referencefinal

Open temporary file. More...

#include <spot/misc/tmpfile.hh>

Inheritance diagram for spot::open_temporary_file:
Collaboration diagram for spot::open_temporary_file:

Public Types

typedef std::list< temporary_file * >::iterator cleanpos_t
 Iterator position in the cleanup list. More...
 

Public Member Functions

SPOT_LOCAL open_temporary_file (char *name, cleanpos_t cp, int fd)
 Build an open temporary file wrapper. More...
 
virtual ~open_temporary_file () override
 Destroy the temporary file and close the descriptor. More...
 
void close ()
 Close the file descriptor. More...
 
int fd () const
 Return the file descriptor. More...
 
const char * name () const
 Return the file name. More...
 
virtual void print (std::ostream &os, const char *) const final override
 Print the file name. More...
 

Protected Attributes

int fd_
 File descriptor. More...
 
char * name_
 File name. More...
 
cleanpos_t cleanpos_
 Cleanup-list position. More...
 

Detailed Description

Open temporary file.

This is a specialization of temporary_file that also holds an open file descriptor, as created by create_open_tmpfile().

Use the open_temporary_file::close() method if you want to close that descriptor; do not call the POSIX close() function directly.

Member Typedef Documentation

◆ cleanpos_t

typedef std::list<temporary_file*>::iterator spot::temporary_file::cleanpos_t
inherited

Iterator position in the cleanup list.

Constructor & Destructor Documentation

◆ open_temporary_file()

SPOT_LOCAL spot::open_temporary_file::open_temporary_file ( char *  name,
cleanpos_t  cp,
int  fd 
)

Build an open temporary file wrapper.

◆ ~open_temporary_file()

virtual spot::open_temporary_file::~open_temporary_file ( )
overridevirtual

Destroy the temporary file and close the descriptor.

Member Function Documentation

◆ close()

void spot::open_temporary_file::close ( )

Close the file descriptor.

◆ fd()

int spot::open_temporary_file::fd ( ) const
inline

Return the file descriptor.

◆ name()

const char* spot::temporary_file::name ( ) const
inlineinherited

Return the file name.

◆ print()

virtual void spot::temporary_file::print ( std::ostream &  os,
const char *   
) const
inlinefinaloverridevirtualinherited

Print the file name.

Implements spot::printable.

Member Data Documentation

◆ cleanpos_

cleanpos_t spot::temporary_file::cleanpos_
protectedinherited

Cleanup-list position.

◆ fd_

int spot::open_temporary_file::fd_
protected

File descriptor.

◆ name_

char* spot::temporary_file::name_
protectedinherited

File name.


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

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.1