Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

FileProperty Class Reference

A subclass of LocalProperty that uses a file as the backing store of the property data. More...

#include <vos/metaobjects/property/fileproperty.hh>

Inheritance diagram for FileProperty:

LocalProperty Property MetaObject ObjectExciseListener List of all members.

Public Member Functions

Static Public Member Functions


Detailed Description

A subclass of LocalProperty that uses a file as the backing store of the property data.

All changes to this property will be reflected in the file (so be careful with access control!), and any changes to the file will be seen in the property data. Use setFileBackend() to set the filename and datatype.

Definition at line 39 of file fileproperty.hh.


Constructor & Destructor Documentation

FileProperty::FileProperty MetaObject superobject  ) 
 

For internal use only.

Definition at line 35 of file fileproperty.cc.

Referenced by new_FileProperty().

FileProperty::FileProperty MetaObject superobject,
const string &  filename,
const string &  datatype = "?"
 

For internal use only.

Definition at line 40 of file fileproperty.cc.

FileProperty::~FileProperty  ) 
 

Definition at line 46 of file fileproperty.cc.


Member Function Documentation

string FileProperty::getFileBackend  )  [virtual]
 

Get filename string.

Definition at line 127 of file fileproperty.cc.

Referenced by Directory::sync().

int FileProperty::getRawLength  )  throw (FileAccessError) [virtual]
 

Get length (bytes) of undecoded, raw data.

Reimplemented from Property.

Definition at line 132 of file fileproperty.cc.

MetaObject * FileProperty::new_FileProperty MetaObject superobject,
const string &  type
[static]
 

For internal use only.

Definition at line 64 of file fileproperty.cc.

Referenced by registerExtenders().

void FileProperty::read string &  target,
int  start,
int  length
throw (FileAccessError) [virtual]
 

Read a substring of decoded data into target, possibly performing decode if necesary.

Parameters:
target Place data in this string
start Byte offset to start reading
length Number of bytes to read. If this parameter is -1, read until the end of the data.

Reimplemented from Property.

Definition at line 153 of file fileproperty.cc.

void FileProperty::readRaw string &  target,
int  start,
int  length
throw (FileAccessError) [virtual]
 

Read substring of raw data into target.

This is the fundamental method which the other read() methods are based on, so you only have to override this.

Parameters:
target The data is copied into this string.
start Offset (bytes) from which to start reading.
length Number of bytes to read. If this is -1, read until the end of the data.

Reimplemented from Property.

Definition at line 139 of file fileproperty.cc.

void FileProperty::registerExtenders  )  [static]
 

Register extender with factoory.

You should also call Property::registerExtenders().

Reimplemented from Property.

Definition at line 51 of file fileproperty.cc.

void FileProperty::replace const string &  newdata,
const string &  newtype = "?"
throw (FileAccessError) [virtual]
 

Completely change the value and type of data stored in this property.

Parameters:
newdata New data.
newtype The type of the new datatype. If no type identifier was supplied, the previous one is kept. NOTE: the initial datatype (set by the constructor) is "?" which is (or should be) an invalid value for any application.

Reimplemented from LocalProperty.

Definition at line 178 of file fileproperty.cc.

void FileProperty::setFileBackend const string &  filename,
const string &  filetype = "?"
throw (FileAccessError) [virtual]
 

Open a file and start using it as the backend store for the property.

Exceptions:
FileAccessError If there was an error opening the file.

Definition at line 112 of file fileproperty.cc.

Referenced by FileProperty().

void FileProperty::write int  start,
const string &  newdata
throw (FileAccessError) [virtual]
 

Write newdata into property value, starting at byte position start.

Reimplemented from LocalProperty.

Definition at line 165 of file fileproperty.cc.


The documentation for this class was generated from the following files:
Generated on Tue Aug 12 03:55:53 2003 for Interreality Project - VOS by doxygen 1.3.2