Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::xml Namespace Reference

Classes

struct  ElementMatcher
 
struct  IdentifierReplacement
 
class  Kind
 

Functions

IVW_CORE_API bool copyMatchingSubPropsIntoComposite (TxElement *node, const CompositeProperty &prop)
 
IVW_CORE_API bool hasProp (TxElement *node, const Property &prop)
 
IVW_CORE_API std::vector< TxElement * > getMatchingElements (TxElement *processornode, std::string_view key)
 
IVW_CORE_API bool findMatchingSubPropertiesForComposites (TxElement *node, const std::vector< const CompositeProperty * > &props)
 
IVW_CORE_API TxElement * getElement (TxElement *node, std::string_view path)
 
IVW_CORE_API bool copyMatchingCompositeProperty (TxElement *node, const CompositeProperty &prop)
 
template<typename Visitor >
void visitMatchingNodes (TxElement *root, const std::vector< ElementMatcher > &selector, Visitor visitor)
 
template<typename Visitor >
void visitMatchingNodesRecursive (TxElement *root, const ElementMatcher &selector, Visitor visitor)
 
template<typename Visitor >
void visitMatchingNodesRecursive (TxElement *root, const std::vector< ElementMatcher > &selectors, Visitor visitor)
 
IVW_CORE_API bool changeTag (TxElement *root, const std::vector< Kind > &path, const std::string &oldName, const std::string &newName)
 
IVW_CORE_API bool changeAttribute (TxElement *root, const std::vector< Kind > &path, const std::string &attribute, const std::string &oldValue, const std::string &newValue)
 
IVW_CORE_API bool changeAttributeRecursive (TxElement *root, const std::vector< Kind > &path, const std::string &attribute, const std::string &oldValue, const std::string &newValue)
 
IVW_CORE_API bool changeIdentifier (TxElement *root, const std::vector< Kind > &path, const std::string &oldId, const std::string &newId)
 
IVW_CORE_API bool changeIdentifiers (TxElement *root, const std::vector< IdentifierReplacement > &replacements)
 
IVW_CORE_API TxElement * createNode (std::string_view desc, TxElement *parent=nullptr)
 
IVW_CORE_API void logNode (TxElement *root)
 
IVW_CORE_API bool renamePortIdentifier (TxElement *root, std::string_view processorClassId, std::string_view portIdentifier, std::string_view newIdentifier)
 
IVW_CORE_API bool renamePropertyIdentifier (TxElement *root, std::string_view processorClassId, std::string_view propertyPath, std::string_view newIdentifier)
 

Detailed Description

xml

Function Documentation

◆ changeAttribute()

IVW_CORE_API bool inviwo::xml::changeAttribute ( TxElement * root,
const std::vector< Kind > & path,
const std::string & attribute,
const std::string & oldValue,
const std::string & newValue )

Utility function to change an attribute processor network element, i.e a processor, port, or property.

Parameters
rootThe xml node to start from.
pathThe elements that you want to change (
See also
Kind).
Parameters
attributeThe name of the attribute to change
oldValueThe old attribute value. This is also used for identifying the elements.
newValueThe new attribute value

◆ changeIdentifier()

IVW_CORE_API bool inviwo::xml::changeIdentifier ( TxElement * root,
const std::vector< Kind > & path,
const std::string & oldId,
const std::string & newId )

Change identifier attribute.

See also
changeAttribute

◆ changeTag()

IVW_CORE_API bool inviwo::xml::changeTag ( TxElement * root,
const std::vector< Kind > & path,
const std::string & oldName,
const std::string & newName )

Utility function to change an xml tag matching oldName.

Parameters
rootThe xml node to start from.
pathThe elements that you want to change (
See also
Kind).
Parameters
oldNameThe old tag value. This is also used for identifying the elements.
newNameThe new tag value

◆ visitMatchingNodes()

template<typename Visitor >
void inviwo::xml::visitMatchingNodes ( TxElement * root,
const std::vector< ElementMatcher > & selector,
Visitor visitor )

This will traverse the nodes of an xml tree starting at root that match the selectors given. and apply a visitor. The selector is specified by a vector or ElementMatchers, matching on the node name and the list of given attribute name and value pairs.

◆ visitMatchingNodesRecursive()

template<typename Visitor >
void inviwo::xml::visitMatchingNodesRecursive ( TxElement * root,
const ElementMatcher & selector,
Visitor visitor )

This will traverse all the nodes of root and apply the visitor to all nodes that match the selector.