Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - Core - IO - Formats - FileFormatGenericBodyC
 

  PUBLIC
FileFormatGenericBodyC::FileFormatGenericBodyC(const StringC &,const type_info &,LoadFuncT,SaveFuncT,LoadFuncFnT,SaveFuncFnT,const StringC &,const StringC &,bool,IntT,const StringC &)
FileFormatGenericBodyC::FileFormatGenericBodyC(const StringC &,const type_info &,LoadFuncFnT,SaveFuncFnT,const StringC &,const StringC &,bool,IntT,const StringC &)
FileFormatGenericBodyC::ProbeLoad(IStreamC &,const type_info &) const
FileFormatGenericBodyC::ProbeLoad(const StringC &,IStreamC &,const type_info &) const
FileFormatGenericBodyC::ProbeSave(const StringC &,const type_info &,bool) const
FileFormatGenericBodyC::CreateInput(const StringC &,const type_info &) const
FileFormatGenericBodyC::CreateOutput(const StringC &,const type_info &) const
FileFormatGenericBodyC::CreateInput(IStreamC &,const type_info &) const
FileFormatGenericBodyC::CreateOutput(OStreamC &,const type_info &) const
FileFormatGenericBodyC::DefaultType(void) const
FileFormatGenericBodyC::Priority(void) const
FileFormatGenericBodyC::IsStream(void) const
FileFormatBodyC::Name(void) const
FileFormatBodyC::Description(void) const
FileFormatBodyC::ProbeLoad(IStreamC &,const type_info &) const
FileFormatBodyC::ProbeLoad(const StringC &,IStreamC &,const type_info &) const
FileFormatBodyC::ProbeLoad(const StringC &,const type_info &) const
FileFormatBodyC::ProbeLoad(const type_info &) const
FileFormatBodyC::ProbeSave(const StringC &,const type_info &,bool) const
FileFormatBodyC::ProbeSave(const type_info &) const
FileFormatBodyC::CreateInput(const StringC &,const type_info &) const
FileFormatBodyC::CreateOutput(const StringC &,const type_info &) const
FileFormatBodyC::CreateInput(IStreamC &,const type_info &) const
FileFormatBodyC::CreateOutput(OStreamC &,const type_info &) const
FileFormatBodyC::DefaultType(void) const
FileFormatBodyC::Priority(void) const
FileFormatBodyC::IsStream(void) const
FileFormatBodyC::ReadString(IStreamC &,StringC &,UIntT)
FileFormatBodyC::ExtractDevice(const StringC &)
FileFormatBodyC::ExtractParams(const StringC &)
FileFormatBodyC::Extension(const StringC &)
DPEntityBodyC::Save(ostream &) const
DPEntityBodyC::Save(BinOStreamC &) const
DPEntityBodyC::Copy(void) const
RCBodyVC::Save(ostream &) const
RCBodyVC::Save(BinOStreamC &) const
RCBodyVC::Copy(void) const
RCBodyVC::DeepCopy(UIntT) const
RCBodyC::References(void) const
RCBodyC::Copy(void) const
RCBodyC::DeepCopy(UIntT) const
RCBodyC::IncRefCounter(void)
RCBodyC::DecRefCounter(void)

   FileFormatGenericBodyC   
 
Generic format loader.
 
include "Ravl/DP/FileFormatGen.hh"
Created:17/07/2000 
Source file:Ravl/Core/IO/FileFormatGen.hh
User Level:Develop
Library:RavlIO
In Scope:RavlN

Comments:
This class provides a simple way of adding new file formats to the system, all it needs is a few points to functions which create the appropriate I/O streams.

Parent Classes: Typedefs:
typedef DPIPortBaseC (*LoadFuncT)(IStreamC & in) ;

Variables:
StringC ext;
Extentsion name of file.

StringC headerData;
Prefix in file header.

IntT priority;

LoadFuncT loadFunc;

SaveFuncT saveFunc;

LoadFuncFnT loadFuncFn;

SaveFuncFnT saveFuncFn;

bool aStream;

const type_info * formatType;

Methods:
FileFormatGenericBodyC(const StringC & nformatName,const type_info & formatType,LoadFuncT nLoadFunc,SaveFuncT nSaveFunc,LoadFuncFnT loadFuncFn,SaveFuncFnT saveFuncFn,const StringC & nDesc = "None.",const StringC & nExt = "",bool naStream = false,IntT priority = 0,const StringC & nHdrData = "")
Constructor.

FileFormatGenericBodyC(const StringC & nformatName,const type_info & formatType,LoadFuncFnT nLoadFunc,SaveFuncFnT nSaveFunc,const StringC & nDesc = "None.",const StringC & nExt = "",bool naStream = false,IntT priority = 0,const StringC & nHdrData = "")
Constructor.

const type_info & ProbeLoad(IStreamC & in,const type_info & obj_type) const
Is stream in this format ?
This asks the question: Can stream 'in' be loaded into object 'obj_type' ? typeid(void) == no, otherwise returns the prefered load type.

const type_info & ProbeLoad(const StringC & filename,IStreamC & in,const type_info & obj_type) const
Is stream in this format ?
This asks the question: Can stream 'in' be loaded into object 'obj_type' ? If used with a empty filename asks: Can load this type of object ? typeid(void) == no, otherwise returns the prefered load type.

const type_info & ProbeSave(const StringC & filename,const type_info & obj_type,bool forceFormat) const
Is Filename in this format ?
This asks the question: Can file 'filename' be saved with object 'obj_type' ? If used with a empty filename asks: Can save this type of object ? typeid(void) == no, otherwise returns the prefered save type.

DPIPortBaseC CreateInput(const StringC & filename,const type_info & obj_type) const
Create a input port for loading from file 'filename'.
Will create an Invalid port if not supported.

The default version of this functions opens the file and passes the stream to CreateInput(IStreamC ....)


DPOPortBaseC CreateOutput(const StringC & filename,const type_info & obj_type) const
Create a output port for saving to file 'filename'..
Will create an Invalid port if not supported.

The default version of this functions opens the file and passes the stream to CreateOutput(OStreamC ....)


DPIPortBaseC CreateInput(IStreamC & in,const type_info & obj_type) const
Create a input port for loading from stream 'in'.
Will create an Invalid port if not supported.

DPOPortBaseC CreateOutput(OStreamC & out,const type_info & obj_type) const
Create a output port for saving to stream 'out'.
Will create an Invalid port if not supported.

const type_info & DefaultType() const
Get prefered IO type.
This specifies the native class for representing the data in a file.

typeid(void) if none, indicates an indirect driver.


IntT Priority() const
Find the priority of the format. the higher the better.
Default is zero.

bool IsStream() const
Test if format is a fully streamable.
i.e. check if you can read/write more than object object. (Default value of this function is true).

#include "Ravl/DP/FileFormat.hh"
const StringC & Name() const
Name of file format.

const StringC & Description() const
Description of fileformat.

const type_info & ProbeLoad(IStreamC & in,const type_info & obj_type) const
Is stream in this format ?
This asks the question: Can stream 'in' be loaded into object 'obj_type' ? typeid(void) == no, otherwise returns the prefered load type.

const type_info & ProbeLoad(const StringC & filename,IStreamC & in,const type_info & obj_type) const
Is stream in this format ?
This asks the question: Can stream 'in' be loaded into object 'obj_type' ? If used with a empty filename asks: Can load this type of object ? typeid(void) == no, otherwise returns the prefered load type.

const type_info & ProbeLoad(const StringC & filename,const type_info & obj_type) const
Is stream in this format ?
This asks the question: Can stream 'in' be loaded into object 'obj_type' ? If used with a empty filename asks: Can load this type of object ? typeid(void) == no, otherwise returns the prefered load type.

const type_info & ProbeLoad(const type_info & obj_type) const
Is stream in this format ?
Alias for ProbeLoad("",IStreamC(),obj_type); typeid(void) == no, otherwise returns the prefered load type.

const type_info & ProbeSave(const StringC & filename,const type_info & obj_type,bool forceFormat) const
Is Filename in this format ?
This asks the question: Can file 'filename' be saved with object 'obj_type' ? If used with a empty filename asks: Can save this type of object ? typeid(void) == no, otherwise returns the prefered save type.

const type_info & ProbeSave(const type_info & obj_type) const
Alias for ProbeSave("",IStreamC(),obj_type);
typeid(void) == no, otherwise returns the prefered save type.

DPIPortBaseC CreateInput(const StringC & filename,const type_info & obj_type) const
Create a input port for loading from file 'filename'.
Will create an Invalid port if not supported.

The default version of this functions opens the file and passes the stream to CreateInput(IStreamC ....)


DPOPortBaseC CreateOutput(const StringC & filename,const type_info & obj_type) const
Create a output port for saving to file 'filename'..
Will create an Invalid port if not supported.

The default version of this functions opens the file and passes the stream to CreateOutput(OStreamC ....)


DPIPortBaseC CreateInput(IStreamC & in,const type_info & obj_type) const
Create a input port for loading from stream 'in'.
Will create an Invalid port if not supported.

DPOPortBaseC CreateOutput(OStreamC & out,const type_info & obj_type) const
Create a output port for saving to stream 'out'.
Will create an Invalid port if not supported.

const type_info & DefaultType() const
Get prefered IO type.
This specifies the native class for representing the data in a file.

typeid(void) if none, indicates an indirect driver.


IntT Priority() const
Find the priority of the format. the higher the better.
Default is zero.

bool IsStream() const
Test if format is a fully streamable.
i.e. check if you can read/write more than object object. (Default value of this function is true).

static bool ReadString(IStreamC & is,StringC & buff,UIntT maxLen = 256)
read a string form the input.
returns false if the stream contains non text charators or is longer than the given length. This will also restore the file read position after the read.

static StringC ExtractDevice(const StringC & nm)
Get the device from the full name.
For use in '@X:' style device formats.

static StringC ExtractParams(const StringC & nm)
Get the device from the full name.
For use in '@X:' style device formats.

static StringC Extension(const StringC & afn)
Return the extension of filename 'afn'.

#include "Ravl/DP/Entity.hh"
bool Save(ostream & out) const
Save to ostream.

bool Save(BinOStreamC & out) const
Save to binary stream.

RCBodyVC & Copy() const
Creat a copy of this object.

#include "Ravl/RCHandleV.hh"
bool Save(ostream & out) const
Save to stream 'out'.

bool Save(BinOStreamC & out) const
Save to binary stream 'out'.

RCBodyVC & Copy() const
Make copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

RCBodyC & DeepCopy(UIntT levels = ((UIntT))) const
Make a deep copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

#include "Ravl/RefCounter.hh"
UIntT References() const
Access count of handles open to this object.

RCBodyC & Copy() const
Make copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

RCBodyC & DeepCopy(UIntT levels = ((UIntT))) const
Make a deep copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

void IncRefCounter()
Increment reference counter.

bool DecRefCounter()
Decrement reference counter.


Maintainer:Charles Galambos, Created: 17/07/2000, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002