Open CASCADE Technology 7.8.0
|
Class represents a document reading filter. More...
#include <PCDM_ReaderFilter.hxx>
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. | |
AppendMode & | Mode () |
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_Transient & | operator= (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_Transient * | This () 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_Address > | 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. | |
Protected Attributes | |
AppendMode | myAppend |
Append mode for reading files into existing document. | |
NCollection_Map< TCollection_AsciiString > | mySkip |
Class names of attributes that must be skipped during the read. | |
NCollection_Map< TCollection_AsciiString > | myRead |
Class names of only attributes to read (if it is not empty, mySkip is unused) | |
NCollection_List< TCollection_AsciiString > | mySubTrees |
Paths to the labels that must be read. If it is empty, read all. | |
TagTree | myTree |
Whole tree that correspond to retrieved document. | |
TagTree * | myCurrent |
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 char * | get_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. | |
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.
|
protected |
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.
|
inline |
Creates an empty filter, so, all will be retrieved if nothing else is defined.
PCDM_ReaderFilter::PCDM_ReaderFilter | ( | const Handle< Standard_Type > & | theSkipped | ) |
Creates a filter to skip only one type of attributes.
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::PCDM_ReaderFilter | ( | const AppendMode | theAppend | ) |
Creates a filter to append the content of file to open to existing document.
PCDM_ReaderFilter::~PCDM_ReaderFilter | ( | ) |
Destructor for the filter content.
|
inline |
Adds sub-tree path (like "0:2").
|
inline |
Adds attribute to read by type. Disables the skipped attributes added.
|
inline |
Adds attribute to read by type name. Disables the skipped attributes added.
|
inline |
Adds skipped attribute by type.
|
inline |
Adds skipped attribute by type name.
void PCDM_ReaderFilter::Clear | ( | ) |
Makes filter pass all data.
Iteration to the child with defined tag.
|
inline |
Returns true if appending to the document is performed.
|
virtual |
Returns true if only part of the document tree will be retrieved.
|
virtual |
Returns true if content of the currently iterated label must be read.
|
virtual |
Returns true if attribute must be read.
|
virtual |
Returns true if content of the label must be read.
|
virtual |
Returns true if attribute must be read.
|
virtual |
Returns true if some sub-label of the currently iterated label is passed.
|
virtual |
Returns true if some sub-label of the given label is passed.
|
inline |
Returns the append mode.
|
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.
|
virtual |
Iteration to the child label.
|
protected |
Append mode for reading files into existing document.
|
protected |
Pointer to the current node of the iterator.
|
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.
|
protected |
Class names of only attributes to read (if it is not empty, mySkip is unused)
|
protected |
Class names of attributes that must be skipped during the read.
|
protected |
Paths to the labels that must be read. If it is empty, read all.
|
protected |
Whole tree that correspond to retrieved document.