13 #ifndef mitkPropertyKeyPath_h
14 #define mitkPropertyKeyPath_h
26 class IPropertyProvider;
420 MITKCORE_EXPORT std::map<PropertyKeyPath::ItemSelectionIndex, std::string>
Base class for all MITK exceptions.
Interface implemented by classes that provide access to property information.
Exception thrown when an invalid path node index is accessed.
mitkExceptionClassMacro(InvalidPathNodeException, mitk::Exception)
Class that can be used to specify nested or wild carded property keys. E.g. for the use in context of...
PropertyKeyPath()
Default constructor. Creates an empty path.
NodeInfoVectorType m_NodeInfos
bool operator<(const PropertyKeyPath &right) const
Lexicographic less-than comparison.
bool Equals(const PropertyKeyPath &path) const
Check if two PropertyKeyPaths match, processing wildcards.
const NodeInfoVectorType & GetNodes() const
Get a const reference to all node info entries.
PropertyKeyPath & AddElement(const ElementNameType &name)
Append a named element node to the path.
bool operator==(const PropertyKeyPath &path) const
Compare two PropertyKeyPaths for exact structural equality.
static bool PropertyKeyPathsMatch(const PropertyKeyPath &left, const PropertyKeyPath &right)
bool HasItemSelectionWildcardsOnly() const
PropertyKeyPath(const std::initializer_list< ElementNameType > &list)
Construct a path from a list of element names.
PropertyKeyPath & AddSelection(const ElementNameType &name, ItemSelectionIndex index)
Append a named element with a specific selection index to the path.
bool operator>(const PropertyKeyPath &right) const
Lexicographic greater-than comparison.
NodeInfoVectorType::size_type PathIndexType
std::vector< NodeInfo > NodeInfoVectorType
PropertyKeyPath & AddAnySelection(const ElementNameType &name)
Append a named element with wildcard selection to the path.
std::size_t ItemSelectionIndex
PropertyKeyPath(const PropertyKeyPath &path)
Copy constructor.
NodeInfo & GetFirstNode()
const NodeInfo & GetLastNode() const
PathIndexType AddNode(const NodeInfo &newNode)
const NodeInfo & GetFirstNode() const
PathIndexType GetSize() const
PropertyKeyPath & operator=(const PropertyKeyPath &path)
Assignment operator.
PropertyKeyPath & AddAnyElement()
Append a wildcard "any element" node to the path.
bool operator>=(const PropertyKeyPath &right) const
Lexicographic greater-than-or-equal comparison.
void Reset()
Clear the path, removing all nodes.
std::string ElementNameType
const NodeInfo & GetNode(const PathIndexType &index) const
bool operator<=(const PropertyKeyPath &right) const
Lexicographic less-than-or-equal comparison.
NodeInfo & GetNode(const PathIndexType &index)
Find image slices visible on a given plane.
MITKCORE_EXPORT std::string PropertyKeyPathToPersistenceKeyTemplate(const PropertyKeyPath &tagPath)
Convert a PropertyKeyPath to a persistence key template string.
MITKCORE_EXPORT PropertyKeyPath PropertyNameToPropertyKeyPath(const std::string &propertyName)
Convert a property name string to a PropertyKeyPath.
MITKCORE_EXPORT std::string PropertyKeyPathToPersistenceKeyRegEx(const PropertyKeyPath &tagPath)
Convert a PropertyKeyPath to a regex string for matching persistence keys.
MITKCORE_EXPORT std::string PropertyKeyPathToPropertyRegEx(const PropertyKeyPath &tagPath)
Convert a PropertyKeyPath to a regex string for matching property keys.
MITKCORE_EXPORT std::ostream & operator<<(std::ostream &o, DataNode::Pointer &dtn)
Stream output operator for DataNode smart pointers.
MITKCORE_EXPORT std::map< PropertyKeyPath::ItemSelectionIndex, std::string > FindIndexedPropertyNames(const IPropertyProvider *provider, const PropertyKeyPath &path)
Find indexed entries matching a PropertyKeyPath in a property provider.
MITKCORE_EXPORT std::string PropertyKeyPathToPersistenceNameTemplate(const PropertyKeyPath &tagPath)
Convert a PropertyKeyPath to a persistence name template string.
MITKCORE_EXPORT std::string PropertyKeyPathToPropertyName(const PropertyKeyPath &tagPath)
Convert a PropertyKeyPath to its property name string representation.
Information about a single node in a PropertyKeyPath.
NodeInfo(const ElementNameType &name, NodeType type=NodeType::Element, ItemSelectionIndex index=0)
Construct a node with given name, type, and selection index.
NodeInfo()
Default constructor. Creates an Invalid node.
bool operator==(const NodeInfo &right) const
Check for exact equality (same type, name, and selection).
ItemSelectionIndex selection
The selection index for ElementSelection nodes.
NodeType
Types of nodes within a PropertyKeyPath.
bool Matches(const NodeInfo &right) const
Check if this node matches another, respecting wildcards.
ElementNameType name
The element name for this node (empty for AnyElement).
NodeType type
The type of this node.