Conexus::File Class Reference
[Conexus]

#include <conexus/file.h>

Inheritance diagram for Conexus::File:

Inheritance graph
[legend]
List of all members.

Detailed Description

This class encapsulates a file.

Author:
Rick L Vinyard Jr


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


Member Function Documentation

void Conexus::File::open  )  throw (open_error) [virtual]
 

Will attempt to open the file if a filename has been specified.

Otherwise an error will be thrown.

Implements Conexus::Endpoint.

void Conexus::File::set_filename std::string  d,
long unsigned  state = READ|WRITE|CREATE
throw (open_error)
 

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.


The documentation for this class was generated from the following files:
Generated on Sun Aug 6 12:17:02 2006 by  doxygen 1.4.6