This interface provides write access to an XML-node.
More...
#include <libCZI_Metadata.h>
This interface provides write access to an XML-node.
◆ AppendChildNode()
virtual std::shared_ptr< IXmlNodeRw > libCZI::IXmlNodeWrite::AppendChildNode |
( |
const char * |
name | ) |
|
|
pure virtual |
Appends a child node with the specified name.
- Parameters
-
name | The name of the node to add. |
- Returns
- The newly added node.
◆ GetChildNode() [1/2]
virtual std::shared_ptr< IXmlNodeRw > libCZI::IXmlNodeWrite::GetChildNode |
( |
const char * |
path | ) |
|
|
pure virtual |
Gets an existing child node. The path is specified as node-names separated by slashes. A path "A/B/C" selects (or creates) a node-structure like this
Attributes can be specified with a node, in the form 'NodeName[attr1=abc,attr2=xyz]'. This will search for nodes with the specified attributes, and if not found, create one. In this example "A/B[Id=ab,Name=xy]/C" we will get
<A>
<B Id="ab" Name="xy">
<C/>
</B>
</A>
It is also possible to specify a number inside the square brackets, which indicates that the n-th element is to be selected. This index is zero-based. In this example
<A>
<B Id="ab" Name="xy">
<C Id="first"></C>
<C Id="second"></C>
<C Id="third"></C>
</B>
</A>
the path "A/B/C[1]" will select the second node of name 'C'. If the path does not exist, then a nullptr is returned. This method may throw an exception if the path is not well-formed and syntactically valid.
- Parameters
-
path | The path (in UTF8-encoding). |
- Returns
- The existing node conforming to the path if it exists, null otherwise.
◆ GetChildNode() [2/2]
std::shared_ptr< IXmlNodeRw > libCZI::IXmlNodeWrite::GetChildNode |
( |
const std::string & |
path | ) |
|
|
inline |
Gets a child node for the specified path.
- Parameters
-
path | Path of the childnode (in UTF8-encoding). |
- Returns
- The child node.
◆ GetOrCreateChildNode() [1/2]
virtual std::shared_ptr< IXmlNodeRw > libCZI::IXmlNodeWrite::GetOrCreateChildNode |
( |
const char * |
path | ) |
|
|
pure virtual |
Gets or create a child node. The path is specified as node-names separated by slashes. A path "A/B/C" selects (or creates) a node-structure like this
Attributes can be specified with a node, in the form 'NodeName[attr1=abc,attr2=xyz]'. This will search for nodes with the specified attributes, and if not found, create one. In this example "A/B[Id=ab,Name=xy]/C" we will get
<A>
<B Id="ab" Name="xy">
<C/>
</B>
</A>
- Parameters
-
path | The path (in UTF8-encoding). |
- Returns
- Either an existing node or a newly created one.
◆ GetOrCreateChildNode() [2/2]
std::shared_ptr< IXmlNodeRw > libCZI::IXmlNodeWrite::GetOrCreateChildNode |
( |
const std::string & |
path | ) |
|
|
inline |
Gets or create a child node. The path is specified as node-names separated by slashes. At path "A/B/C" selects (or creates) a node-structure like this
Attributes can be specified with a node, in the form 'NodeName[attr1=abc,attr2=xyz]'. This will search for nodes with the specified attributes, and if not found, create one. In this example "A/B[Id=ab,Name=xy]/C" we will get
<A>
<B Id="ab" Name="xy">
<C/>
</B>
</A>
- Parameters
-
- Returns
- Either an existing node or a newly created one.
◆ RemoveAttribute()
virtual bool libCZI::IXmlNodeWrite::RemoveAttribute |
( |
const char * |
name | ) |
|
|
pure virtual |
Removes the attribute with the specified name. In case that there a multiple attributes with the specified name, then only the first is removed.
- Parameters
-
name | The name of the attribute to be removed. |
- Returns
- True if the attribute was found and successfully removed; false otherwise (i.e. if it did not exist).
◆ RemoveChild()
virtual bool libCZI::IXmlNodeWrite::RemoveChild |
( |
const char * |
name | ) |
|
|
pure virtual |
Removes the child node with the specified name. In case that there a multiple children with the specified name, then only the first is removed.
- Parameters
-
name | The name of the node to be removed. |
- Returns
- True if the node was found and successfully removed; false otherwise (i.e. if it did not exist).
◆ SetAttribute() [1/2]
virtual void libCZI::IXmlNodeWrite::SetAttribute |
( |
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
|
pure virtual |
Sets the attribute with the specified name to the specified value.
- Parameters
-
name | The name of the attribute (as UTF8-encoded string). |
value | The value (as UTF8-encoded string). |
◆ SetAttribute() [2/2]
virtual void libCZI::IXmlNodeWrite::SetAttribute |
( |
const wchar_t * |
name, |
|
|
const wchar_t * |
value |
|
) |
| |
|
pure virtual |
Sets the attribute with the specified name to the specified value.
- Parameters
-
name | The name of the attribute. |
value | The value. |
◆ SetValue() [1/4]
virtual void libCZI::IXmlNodeWrite::SetValue |
( |
const char * |
str | ) |
|
|
pure virtual |
Sets the node value - which is specified as an UTF8-string.
- Parameters
-
str | The UTF8-encoded string. |
◆ SetValue() [2/4]
void libCZI::IXmlNodeWrite::SetValue |
( |
const std::string & |
str | ) |
|
|
inline |
Sets the node value - which is specified as an UTF8-string.
- Parameters
-
str | The UTF8-encoded string. |
◆ SetValue() [3/4]
void libCZI::IXmlNodeWrite::SetValue |
( |
const std::wstring & |
str | ) |
|
|
inline |
Sets the node value to the specified string.
- Parameters
-
◆ SetValue() [4/4]
virtual void libCZI::IXmlNodeWrite::SetValue |
( |
const wchar_t * |
str | ) |
|
|
pure virtual |
Sets the node value to the specified string.
- Parameters
-
◆ SetValueBool()
virtual void libCZI::IXmlNodeWrite::SetValueBool |
( |
bool |
value | ) |
|
|
pure virtual |
Sets value of the node with the specified boolean.
- Parameters
-
value | The boolean to write into the node. |
◆ SetValueDbl()
virtual void libCZI::IXmlNodeWrite::SetValueDbl |
( |
double |
value | ) |
|
|
pure virtual |
Sets value of the node with the specified double.
- Parameters
-
value | The double to write into the node. |
◆ SetValueFlt()
virtual void libCZI::IXmlNodeWrite::SetValueFlt |
( |
float |
value | ) |
|
|
pure virtual |
Sets value of the node with the specified float.
- Parameters
-
value | The float to write into the node. |
◆ SetValueI32()
virtual void libCZI::IXmlNodeWrite::SetValueI32 |
( |
int |
value | ) |
|
|
pure virtual |
Sets value of the node with the specified integer.
- Parameters
-
value | The integer to write into the node. |
◆ SetValueI64()
virtual void libCZI::IXmlNodeWrite::SetValueI64 |
( |
long long |
value | ) |
|
|
pure virtual |
Sets value of the node with the specified long integer.
- Parameters
-
value | The long integer to write into the node. |
◆ SetValueUI32()
virtual void libCZI::IXmlNodeWrite::SetValueUI32 |
( |
unsigned int |
value | ) |
|
|
pure virtual |
Sets value of the node with the specified unsigned integer.
- Parameters
-
value | The unsigned integer to write into the node. |
◆ SetValueUI64()
virtual void libCZI::IXmlNodeWrite::SetValueUI64 |
( |
unsigned long long |
value | ) |
|
|
pure virtual |
Sets value of the node with the specified unsigned long integer.
- Parameters
-
value | The unsigned long integer to write into the node. |
The documentation for this class was generated from the following file: