Open CASCADE Technology 7.8.0
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.
 

Public Member Functions

 PCDM_ReaderFilter ()
 Creates an empty filter, so, all will be retrieved if nothing else is defined.
 
 PCDM_ReaderFilter (const Handle< Standard_Type > &theSkipped)
 Creates a filter to skip only one type of attributes.
 
 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 (const AppendMode theAppend)
 Creates a filter to append the content of file to open to existing document.
 
 ~PCDM_ReaderFilter ()
 Destructor for the filter content.
 
void AddSkipped (const Handle< Standard_Type > &theSkipped)
 Adds skipped attribute by type.
 
void AddSkipped (const TCollection_AsciiString &theSkipped)
 Adds skipped attribute by type name.
 
void AddRead (const Handle< Standard_Type > &theRead)
 Adds attribute to read by type. Disables the skipped attributes added.
 
void AddRead (const TCollection_AsciiString &theRead)
 Adds attribute to read by type name. Disables the skipped attributes added.
 
void AddPath (const TCollection_AsciiString &theEntryToRead)
 Adds sub-tree path (like "0:2").
 
void Clear ()
 Makes filter pass all data.
 
virtual Standard_Boolean IsPassed (const Handle< Standard_Type > &theAttributeID) const
 Returns true if attribute must be read.
 
virtual Standard_Boolean IsPassedAttr (const TCollection_AsciiString &theAttributeType) const
 Returns true if attribute must be read.
 
virtual Standard_Boolean IsPassed (const TCollection_AsciiString &theEntry) const
 Returns true if content of the label must be read.
 
virtual Standard_Boolean IsSubPassed (const TCollection_AsciiString &theEntry) const
 Returns true if some sub-label of the given label is passed.
 
virtual Standard_Boolean IsPartTree ()
 Returns true if only part of the document tree will be retrieved.
 
AppendModeMode ()
 Returns the append mode.
 
Standard_Boolean IsAppendMode ()
 Returns true if appending to the document is performed.
 
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.
 
virtual void Up ()
 Iteration to the child label.
 
virtual void Down (const int &theTag)
 Iteration to the child with defined tag.
 
virtual Standard_Boolean IsPassed () const
 Returns true if content of the currently iterated label must be read.
 
virtual Standard_Boolean IsSubPassed () const
 Returns true if some sub-label of the currently iterated label is passed.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
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.
 
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.
 
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.
 
Standard_Integer GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object.
 
Standard_Integer DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

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.
 

Protected Attributes

AppendMode myAppend
 Append mode for reading files into existing document.
 
NCollection_Map< TCollection_AsciiStringmySkip
 Class names of attributes that must be skipped during the read.
 
NCollection_Map< TCollection_AsciiStringmyRead
 Class names of only attributes to read (if it is not empty, mySkip is unused)
 
NCollection_List< TCollection_AsciiStringmySubTrees
 Paths to the labels that must be read. If it is empty, read all.
 
TagTree myTree
 Whole tree that correspond to retrieved document.
 
TagTreemyCurrent
 Pointer to the current node of the iterator.
 
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.
 

Additional Inherited Members

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

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: