Open CASCADE Technology  7.7.0.dev
Public Types | Public Member Functions | Protected Types | Protected Attributes

PCDM_ReaderFilter Class Reference

Class represents a document reading filter. More...

#include <PCDM_ReaderFilter.hxx>

Inheritance diagram for PCDM_ReaderFilter:
Inheritance graph
[legend]

Public Types

enum  AppendMode { AppendMode_Forbid = 0 , AppendMode_Protect = 1 , AppendMode_Overwrite = 2 }
 Supported modes of appending the file content into existing document. More...
 
- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 

Public Member Functions

 PCDM_ReaderFilter ()
 Creates an empty filter, so, all will be retrieved if nothing else is defined. More...
 
 PCDM_ReaderFilter (const Handle< Standard_Type > &theSkipped)
 Creates a filter to skip only one type of attributes. More...
 
 PCDM_ReaderFilter (const TCollection_AsciiString &theEntryToRead)
 Creates a filter to read only sub-labels of a label-path. Like, for "0:2" it will read all attributes for labels "0:2", "0:2:1", etc. More...
 
 PCDM_ReaderFilter (const AppendMode theAppend)
 Creates a filter to append the content of file to open to existing document. More...
 
 ~PCDM_ReaderFilter ()
 Destructor for the filter content. More...
 
void AddSkipped (const Handle< Standard_Type > &theSkipped)
 Adds skipped attribute by type. More...
 
void AddSkipped (const TCollection_AsciiString &theSkipped)
 Adds skipped attribute by type name. More...
 
void AddRead (const Handle< Standard_Type > &theRead)
 Adds attribute to read by type. Disables the skipped attributes added. More...
 
void AddRead (const TCollection_AsciiString &theRead)
 Adds attribute to read by type name. Disables the skipped attributes added. More...
 
void AddPath (const TCollection_AsciiString &theEntryToRead)
 Adds sub-tree path (like "0:2"). More...
 
void Clear ()
 Makes filter pass all data. More...
 
virtual Standard_Boolean IsPassed (const Handle< Standard_Type > &theAttributeID) const
 Returns true if attribute must be read. More...
 
virtual Standard_Boolean IsPassedAttr (const TCollection_AsciiString &theAttributeType) const
 Returns true if attribute must be read. More...
 
virtual Standard_Boolean IsPassed (const TCollection_AsciiString &theEntry) const
 Returns true if content of the label must be read. More...
 
virtual Standard_Boolean IsSubPassed (const TCollection_AsciiString &theEntry) const
 Returns true if some sub-label of the given label is passed. More...
 
virtual Standard_Boolean IsPartTree ()
 Returns true if only part of the document tree will be retrieved. More...
 
AppendModeMode ()
 Returns the append mode. More...
 
Standard_Boolean IsAppendMode ()
 Returns true if appending to the document is performed. More...
 
virtual void StartIteration ()
 Starts the tree iterator. It is used for fast searching of passed labels if the whole tree of labels is parsed. So, on each iteration step the methods Up and Down must be called after the iteration start. More...
 
virtual void Up ()
 Iteration to the child label. More...
 
virtual void Down (const int &theTag)
 Iteration to the child with defined tag. More...
 
virtual Standard_Boolean IsPassed () const
 Returns true if content of the currently iterated label must be read. More...
 
virtual Standard_Boolean IsSubPassed () const
 Returns true if some sub-label of the currently iterated label is passed. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Protected Types

typedef NCollection_DataMap< Standard_Integer, Standard_AddressTagTree
 Map from tag of a label to sub-tree of this tag. Used for fast browsing the tree and compare with entities that must be read. More...
 

Protected Attributes

AppendMode myAppend
 Append mode for reading files into existing document. More...
 
NCollection_Map< TCollection_AsciiStringmySkip
 Class names of attributes that must be skipped during the read. More...
 
NCollection_Map< TCollection_AsciiStringmyRead
 Class names of only attributes to read (if it is not empty, mySkip is unused) More...
 
NCollection_List< TCollection_AsciiStringmySubTrees
 Paths to the labels that must be read. If it is empty, read all. More...
 
TagTree myTree
 Whole tree that correspond to retrieved document. More...
 
TagTreemyCurrent
 Pointer to the current node of the iterator. More...
 
Standard_Integer myCurrentDepth
 If a node does not described in the read-entries, the iterator goes inside of this subtree just by keeping the depth of iteration. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Detailed Description

Class represents a document reading filter.

It allows to set attributes (by class names) that must be skipped during the document reading or attributes that must be retrieved only. In addition it is possible to define one or several subtrees (by entry) which must be retrieved during the reading. Other labels are created, but no one attribute on them.

Member Typedef Documentation

◆ TagTree

Map from tag of a label to sub-tree of this tag. Used for fast browsing the tree and compare with entities that must be read.

Member Enumeration Documentation

◆ AppendMode

Supported modes of appending the file content into existing document.

Enumerator
AppendMode_Forbid 

do not allow append, default mode

AppendMode_Protect 

keeps existing attributes, reads only new ones

AppendMode_Overwrite 

overwrites the existing attributes by the loaded ones

Constructor & Destructor Documentation

◆ PCDM_ReaderFilter() [1/4]

PCDM_ReaderFilter::PCDM_ReaderFilter ( )
inline

Creates an empty filter, so, all will be retrieved if nothing else is defined.

◆ PCDM_ReaderFilter() [2/4]

PCDM_ReaderFilter::PCDM_ReaderFilter ( const Handle< Standard_Type > &  theSkipped)

Creates a filter to skip only one type of attributes.

◆ PCDM_ReaderFilter() [3/4]

PCDM_ReaderFilter::PCDM_ReaderFilter ( const TCollection_AsciiString theEntryToRead)

Creates a filter to read only sub-labels of a label-path. Like, for "0:2" it will read all attributes for labels "0:2", "0:2:1", etc.

◆ PCDM_ReaderFilter() [4/4]

PCDM_ReaderFilter::PCDM_ReaderFilter ( const AppendMode  theAppend)

Creates a filter to append the content of file to open to existing document.

◆ ~PCDM_ReaderFilter()

PCDM_ReaderFilter::~PCDM_ReaderFilter ( )

Destructor for the filter content.

Member Function Documentation

◆ AddPath()

void PCDM_ReaderFilter::AddPath ( const TCollection_AsciiString theEntryToRead)
inline

Adds sub-tree path (like "0:2").

◆ AddRead() [1/2]

void PCDM_ReaderFilter::AddRead ( const Handle< Standard_Type > &  theRead)
inline

Adds attribute to read by type. Disables the skipped attributes added.

◆ AddRead() [2/2]

void PCDM_ReaderFilter::AddRead ( const TCollection_AsciiString theRead)
inline

Adds attribute to read by type name. Disables the skipped attributes added.

◆ AddSkipped() [1/2]

void PCDM_ReaderFilter::AddSkipped ( const Handle< Standard_Type > &  theSkipped)
inline

Adds skipped attribute by type.

◆ AddSkipped() [2/2]

void PCDM_ReaderFilter::AddSkipped ( const TCollection_AsciiString theSkipped)
inline

Adds skipped attribute by type name.

◆ Clear()

void PCDM_ReaderFilter::Clear ( )

Makes filter pass all data.

◆ Down()

virtual void PCDM_ReaderFilter::Down ( const int &  theTag)
virtual

Iteration to the child with defined tag.

◆ IsAppendMode()

Standard_Boolean PCDM_ReaderFilter::IsAppendMode ( )
inline

Returns true if appending to the document is performed.

◆ IsPartTree()

virtual Standard_Boolean PCDM_ReaderFilter::IsPartTree ( )
virtual

Returns true if only part of the document tree will be retrieved.

◆ IsPassed() [1/3]

virtual Standard_Boolean PCDM_ReaderFilter::IsPassed ( ) const
virtual

Returns true if content of the currently iterated label must be read.

◆ IsPassed() [2/3]

virtual Standard_Boolean PCDM_ReaderFilter::IsPassed ( const Handle< Standard_Type > &  theAttributeID) const
virtual

Returns true if attribute must be read.

◆ IsPassed() [3/3]

virtual Standard_Boolean PCDM_ReaderFilter::IsPassed ( const TCollection_AsciiString theEntry) const
virtual

Returns true if content of the label must be read.

◆ IsPassedAttr()

virtual Standard_Boolean PCDM_ReaderFilter::IsPassedAttr ( const TCollection_AsciiString theAttributeType) const
virtual

Returns true if attribute must be read.

◆ IsSubPassed() [1/2]

virtual Standard_Boolean PCDM_ReaderFilter::IsSubPassed ( ) const
virtual

Returns true if some sub-label of the currently iterated label is passed.

◆ IsSubPassed() [2/2]

virtual Standard_Boolean PCDM_ReaderFilter::IsSubPassed ( const TCollection_AsciiString theEntry) const
virtual

Returns true if some sub-label of the given label is passed.

◆ Mode()

AppendMode& PCDM_ReaderFilter::Mode ( )
inline

Returns the append mode.

◆ StartIteration()

virtual void PCDM_ReaderFilter::StartIteration ( )
virtual

Starts the tree iterator. It is used for fast searching of passed labels if the whole tree of labels is parsed. So, on each iteration step the methods Up and Down must be called after the iteration start.

◆ Up()

virtual void PCDM_ReaderFilter::Up ( )
virtual

Iteration to the child label.

Field Documentation

◆ myAppend

AppendMode PCDM_ReaderFilter::myAppend
protected

Append mode for reading files into existing document.

◆ myCurrent

TagTree* PCDM_ReaderFilter::myCurrent
protected

Pointer to the current node of the iterator.

◆ myCurrentDepth

Standard_Integer PCDM_ReaderFilter::myCurrentDepth
protected

If a node does not described in the read-entries, the iterator goes inside of this subtree just by keeping the depth of iteration.

◆ myRead

NCollection_Map<TCollection_AsciiString> PCDM_ReaderFilter::myRead
protected

Class names of only attributes to read (if it is not empty, mySkip is unused)

◆ mySkip

NCollection_Map<TCollection_AsciiString> PCDM_ReaderFilter::mySkip
protected

Class names of attributes that must be skipped during the read.

◆ mySubTrees

NCollection_List<TCollection_AsciiString> PCDM_ReaderFilter::mySubTrees
protected

Paths to the labels that must be read. If it is empty, read all.

◆ myTree

TagTree PCDM_ReaderFilter::myTree
protected

Whole tree that correspond to retrieved document.


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