#include <conexus/file.h>
Inheritance diagram for Conexus::File:
Public Types | |
typedef enum Conexus::File::FileState | FileState |
typedef boost::shared_ptr< File > | pointer |
enum | FileState { APPEND = LASTRWFILEDESCRIPTORSTATE<<1, CREATE = LASTRWFILEDESCRIPTORSTATE<<2, DIRECT = LASTRWFILEDESCRIPTORSTATE<<3, LARGE_FILE = LASTRWFILEDESCRIPTORSTATE<<4, NO_ACCESS_TIME = LASTRWFILEDESCRIPTORSTATE<<5, NO_FOLLOW = LASTRWFILEDESCRIPTORSTATE<<6, TRUNCATE = LASTRWFILEDESCRIPTORSTATE<<7, EXCLUSIVE_CREATE = LASTRWFILEDESCRIPTORSTATE<<8, LASTRWFILEDESCRIPTORSTATE = EXCLUSIVE_CREATE } |
Public Member Functions | |
File (const std::string &filename=std::string(), unsigned long readwrite=READ|WRITE|CREATE) | |
virtual void | open (const std::string name, int state=READ|WRITE|CREATE) throw (open_error) |
Opens the named file in the specified mode. | |
virtual void | open () throw (open_error) |
Will attempt to open the file if a filename has been specified. | |
std::string | filename () |
Will return the filename. | |
void | set_filename (std::string d, long unsigned state=READ|WRITE|CREATE) throw (open_error) |
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, unsigned long readwrite=READ|WRITE|CREATE) |
Protected Attributes | |
std::string | m_filename |
sigc::signal< void > | m_signal_filename_changed |
|
Will attempt to open the file if a filename has been specified. Otherwise an error will be thrown. Implements Conexus::Endpoint. |
|
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. |