CXSIFilter Class Reference

Base class for filters. More...

#include <CXSIFilter.h>

Inheritance diagram for CXSIFilter:

CASCIIFilter CBINFilter CBufferFilter CLegacyFilter CMemoryFilter List of all members.

Public Member Functions

  CXSIFilter ()
virtual  ~CXSIFilter ()
void  SetName (const CSIBCString &in_szName)
CSIBCString  GetName ()
void  SetID (const CSIBCString &in_szID)
CSIBCString GetID ()
virtual void  SetHeader (CSIBCString in_szHeader)
CSIBCString  GetHeader ()
virtual void  WriteHeader ()
virtual int  Open (CSIBCString in_szFilename, _SI_FILE_MODE in_Mode)
virtual int  Close ()
virtual int  Read (SI_Char *out_pBuffer, SI_Long in_lSize)
virtual int  Write (SI_Char *in_pBuffer, SI_Long in_lSize)
virtual int  Eof ()
virtual int  Tell ()
void  SetSubFilter (CXSIFilter *in_pSub)
CXSIFilter GetSubFilter ()

Detailed Description

Base class for filters.

This base class defines the basis for all filters in the system. A filter will be used both for reading and writing to/from a file. Filters can be chained so we can create constructs like, BUFFERING | ASCII or COMPRESS for example.


Constructor & Destructor Documentation

CXSIFilter (  ) 

Constructor

virtual ~CXSIFilter (  )  [virtual]

Destructor


Member Function Documentation

void SetName ( const CSIBCString in_szName  ) 

Sets the name of the file to be used, needed because the Crosswalk SDK receives the name, but it is the last filter that will open the file, so it has to be passed down from filter to filter.

Parameters:
in_szName  Name of the filter.

CSIBCString GetName (  ) 

Returns the name of the file used

Returns:
name of the file.

void SetID ( const CSIBCString in_szID  ) 

Sets the ID for the filter. This ID will appear inside the dotXSI header

Parameters:
in_szID  string ID. Valid values include:
  • "txt"
  • "bin"

CSIBCString& GetID (  ) 

Returns the current ID

Returns:
current ID

virtual void SetHeader ( CSIBCString  in_szHeader  )  [virtual]

Sets the file header to be used (for example, "xsi 0360txt")

Parameters:
in_szHeader  string to use for the file header

Reimplemented in CMemoryFilter.

CSIBCString GetHeader (  ) 

Returns the current file header

Returns:
current header

Reimplemented in CMemoryFilter.

virtual void WriteHeader (  )  [virtual]

Writes out the file header, called when we are about to write the file, to make sure the header is the first thing written in the file.

Reimplemented in CMemoryFilter.

virtual int Open ( CSIBCString  in_szFilename,
_SI_FILE_MODE  in_Mode  
) [virtual]

Opens the file for either reading or writing

Parameters:
in_szFilename  filename
in_Mode  mode

Reimplemented in CASCIIFilter, CBINFilter, CBufferFilter, CLegacyFilter, and CMemoryFilter.

virtual int Close (  )  [virtual]

Closes the file when finished

Reimplemented in CASCIIFilter, CBINFilter, CBufferFilter, CLegacyFilter, and CMemoryFilter.

virtual int Read ( SI_Char *  out_pBuffer,
SI_Long  in_lSize  
) [virtual]

Reads the specified number of bytes into the buffer passed in.

Return values:
out_pBuffer  output buffer
Parameters:
in_lSize  number of bytes to read
Returns:
number of bytes read

Reimplemented in CASCIIFilter, CBINFilter, CBufferFilter, CLegacyFilter, and CMemoryFilter.

virtual int Write ( SI_Char *  in_pBuffer,
SI_Long  in_lSize  
) [virtual]

Writes the specified number of bytes to the file

Parameters:
in_pBuffer  input buffer
in_lSize  number of bytes to write
Returns:
number of bytes written

Reimplemented in CASCIIFilter, CBINFilter, CBufferFilter, CLegacyFilter, and CMemoryFilter.

virtual int Eof (  )  [virtual]

Tests to see if we have reached the end of file

Returns:
1 if we are at the end of the file

0 otherwise

Reimplemented in CASCIIFilter, CBINFilter, CBufferFilter, CLegacyFilter, and CMemoryFilter.

virtual int Tell (  )  [virtual]

Returns the current position in the file.

Returns:
position in the file (0 - beginning)

Reimplemented in CASCIIFilter, CBINFilter, CBufferFilter, CLegacyFilter, and CMemoryFilter.

void SetSubFilter ( CXSIFilter in_pSub  )  [inline]

Sets the sub filter, used during construction.

Parameters:
in_pSub  sub filter to use.

CXSIFilter* GetSubFilter (  )  [inline]

Returns the current subfilter

Returns:
current subfilter


The documentation for this class was generated from the following file: