#include <conexus/file.h>
Inheritance diagram for Conexus::File:
Public Types | |
typedef ConexusPointer< File > | pointer |
typedef ConexusPointer< File > | pointer |
typedef ConexusPointer< File > | pointer |
Public Member Functions | |
virtual void | open (const std::string name, long unsigned mode=FILE_UNCHANGED) throw ( open_exception) |
Opens the named file in the specified mode. | |
virtual void | open () throw ( open_exception ) |
Will attempt to open the file if a filename has been specified. | |
std::string | filename () |
Will return the filename. | |
long unsigned | mode () |
bool | eof () |
bool | throw_eof () |
void | set_throw_eof (bool teof=true) |
void | set_filename (std::string d, long unsigned mode=FILE_UNCHANGED) throw ( open_exception ) |
Sets the filename. | |
sigc::signal< void > | signal_filename_changed () |
virtual void | open (const std::string name, long unsigned mode=FILE_UNCHANGED) throw (open_exception) |
Opens the named file in the specified mode. | |
virtual void | open () throw (open_exception) |
Will attempt to open the file if a filename has been specified. | |
std::string | filename () |
Will return the filename. | |
long unsigned | mode () |
bool | eof () |
bool | throw_eof () |
void | set_throw_eof (bool teof=true) |
void | set_filename (std::string d, long unsigned mode=FILE_UNCHANGED) throw (open_exception) |
Sets the filename. | |
sigc::signal< void > | signal_filename_changed () |
virtual const std::string & | object_type () |
virtual void | open (const std::string name, long unsigned mode=FILE_UNCHANGED) throw (open_exception) |
Opens the named file in the specified mode. | |
virtual void | open () throw (open_exception) |
Will attempt to open the file if a filename has been specified. | |
std::string | filename () |
Will return the filename. | |
long unsigned | mode () |
bool | eof () |
bool | throw_eof () |
void | set_throw_eof (bool teof=true) |
void | set_filename (std::string d, long unsigned mode=FILE_UNCHANGED) throw (open_exception) |
Sets the filename. | |
sigc::signal< void > | signal_filename_changed () |
virtual const std::string & | object_type () |
Static Public Member Functions | |
static File::pointer | create (const std::string &filename=std::string(), long unsigned mode=FILE_READ|FILE_WRITE|FILE_CREATE|FILE_TRUNCATE) |
static File::pointer | create (const std::string &filename=std::string(), long unsigned mode=FILE_READ|FILE_WRITE) |
static File::pointer | create (const std::string &filename=std::string(), long unsigned mode=FILE_READ|FILE_WRITE) |
Protected Member Functions | |
File (const std::string &filename, long unsigned mode) | |
virtual Data | read_data (long int timeout, size_t s=0) throw ( read_exception ) |
File (const std::string &filename=std::string(), long unsigned mode=FILE_READ|FILE_WRITE) | |
virtual Data::pointer | read_data (long int timeout, size_t s=0) throw (read_exception) |
File (const std::string &filename=std::string(), long unsigned mode=FILE_READ|FILE_WRITE) | |
virtual Data::pointer | read_data (long int timeout, size_t s=0) throw (read_exception) |
Protected Attributes | |
std::string | m_filename |
long unsigned | m_mode |
bool | m_eof |
bool | m_throw_eof |
sigc::signal< void > | m_signal_filename_changed |
sigc::signal< void > | m_signal_filename_changed |
sigc::signal< void > | m_signal_filename_changed |
void Conexus::File::open | ( | ) | throw ( open_exception ) [virtual] |
Will attempt to open the file if a filename has been specified.
Otherwise an exception will be thrown.
Implements Conexus::Endpoint.
void Conexus::File::set_filename | ( | std::string | d, | |
long unsigned | mode = FILE_UNCHANGED | |||
) | throw ( open_exception ) |
Sets the filename.
If the file is currently open and d is not equal to the current filename, the current file will be closed.
Also, if auto_open is set, the new file will be immediately opened.
Additionally, this method checks whether the parameter d is the same as the current filename, and parameter mode is the same as the current mode. If both are equal, the file will not be closed and reopened unless force=true.
virtual void Conexus::File::open | ( | ) | throw (open_exception) [virtual] |
Will attempt to open the file if a filename has been specified.
Otherwise an exception will be thrown.
Implements Conexus::Endpoint.
void Conexus::File::set_filename | ( | std::string | d, | |
long unsigned | mode = FILE_UNCHANGED | |||
) | throw (open_exception) |
Sets the filename.
If the file is currently open and d is not equal to the current filename, the current file will be closed.
Also, if auto_open is set, the new file will be immediately opened.
Additionally, this method checks whether the parameter d is the same as the current filename, and parameter mode is the same as the current mode. If both are equal, the file will not be closed and reopened unless force=true.
virtual void Conexus::File::open | ( | ) | throw (open_exception) [virtual] |
Will attempt to open the file if a filename has been specified.
Otherwise an exception will be thrown.
Implements Conexus::Endpoint.
void Conexus::File::set_filename | ( | std::string | d, | |
long unsigned | mode = FILE_UNCHANGED | |||
) | throw (open_exception) |
Sets the filename.
If the file is currently open and d is not equal to the current filename, the current file will be closed.
Also, if auto_open is set, the new file will be immediately opened.
Additionally, this method checks whether the parameter d is the same as the current filename, and parameter mode is the same as the current mode. If both are equal, the file will not be closed and reopened unless force=true.