Wwise SDK
_host_xml_8h_source
Version
menu_open
HostXml.h
Go to the documentation of this file.
51 };
79 };
92 };
105 };
116 };
125 * The XML plug-in persistence is useful when a plug-in provides custom data handling. Normally, plug-in data
126 * is stored through the property sets (see \ref wwiseplugin_propertyset "PropertySet" and \ref wwiseplugin_objectstore "ObjectStore").
127 * However, a plug-in might provide its own custom handling. For complex interfaces, it might be worthwhile to use the
128 * \ref wwiseplugin_complexproperty "CustomData" interface. Loading and saving can then be done through this XML interface.
130 * The XML interface represents a cursor pointing to a node (element), alongside methods to navigate through
134 * One unique XML interface is provided for both reading and writing XML. Depending on the instance being
162 * The string is available until the next Host operation. If storing is required, a copy should be made
181 AK::Wwise::Plugin::XmlNodeType::NodeType(*GetNodeType)(const struct ak_wwise_plugin_host_xml_reader_instance_v1* in_this);
194 * This returns the textual representation of the current node's value. What the XML parser considers
198 * For example, this \c Item node has three content elements: <tt><Item>1&number;3</Item></tt>
200 * For normal string retrieval, the \ref ReadElementString will actually return the value of an XML with
204 * The string is available until the next Host operation. If storing is required, a copy should be made
228 * This is useful in some cases, where an error message might be written, or for debugging purposes.
236 * \brief Retrieves the column in the line that contains the start of the current node being read.
238 * This is useful in some cases, where an error message might be written, or for debugging purposes.
248 * If the node is not a content node, the reader skips ahead to the next content entity until the
271 * content is available, it will return \ref AK::Wwise::Plugin::XmlNodeType::EndElement "EndElement"
278 AK::Wwise::Plugin::XmlNodeType::NodeType(*MoveToContent)(struct ak_wwise_plugin_host_xml_reader_instance_v1* in_this);
293 * Since strings can span multiple content elements, this method will read all the sequential string-like
294 * elements and append them, returning one simple string. This function also works with empty nodes and
297 * If no processing or incrementing is warranted, \ref Read, \ref MoveToContent and \ref GetValue
303 * The string is available until the next Host operation. If storing is required, a copy should be made
314 * \brief Reads all the contents of an Element or Attribute as a string, including markup. Increments the pointer.
316 * This returns the raw contents of the file except the enclosing elements. It can be considered the
322 * The string is available until the next Host operation. If storing is required, a copy should be made
330 void(*ReadInnerXml)(struct ak_wwise_plugin_host_xml_reader_instance_v1* in_this, const char ** out_csXml);
335 * This returns the raw contents of the file including the enclosing elements. It can be considered the
341 * The string is available until the next Host operation. If storing is required, a copy should be made
346 * \param[out] out_csXml All the XML content, including markup and enclosing tags, of the current node.
349 void(*ReadOuterXml)(struct ak_wwise_plugin_host_xml_reader_instance_v1* in_this, const char ** out_csXml);
395 AK::Wwise::Plugin::XmlWriteReady::WriteReady(*GetReadyState)(const struct ak_wwise_plugin_host_xml_writer_instance_v1* in_this);
407 bool(*Append)(struct ak_wwise_plugin_host_xml_writer_instance_v1* in_this, struct ak_wwise_plugin_host_xml_writer_instance_v1* in_pWriterToAppend);
418 AK::Wwise::Plugin::XmlWriteState::WriteState(*GetWriteState)(const struct ak_wwise_plugin_host_xml_writer_instance_v1* in_this);
543 };
553 };
559 * The string is available until the next Host operation. If storing is required, a copy should be made
576 inline AK::Wwise::Plugin::XmlNodeType::NodeType GetNodeType() const { return g_cinterface->GetNodeType(this); }
588 * This returns the textual representation of the current node's value. What the XML parser considers
592 * For example, this \c Item node has three content elements: <tt><Item>1&number;3</Item></tt>
594 * For normal string retrieval, the \ref ReadElementString will actually return the value of an XML with
598 * The string is available until the next Host operation. If storing is required, a copy should be made
620 * This is useful in some cases, where an error message might be written, or for debugging purposes.
627 * \brief Retrieves the column in the line that contains the start of the current node being read.
629 * This is useful in some cases, where an error message might be written, or for debugging purposes.
638 * If the node is not a content node, the reader skips ahead to the next content entity until the
661 * content is available, it will return \ref AK::Wwise::Plugin::XmlNodeType::EndElement "EndElement"
667 inline AK::Wwise::Plugin::XmlNodeType::NodeType MoveToContent() { return g_cinterface->MoveToContent(this); }
681 * Since strings can span multiple content elements, this method will read all the sequential string-like
682 * elements and append them, returning one simple string. This function also works with empty nodes and
685 * If no processing or incrementing is warranted, \ref Read, \ref MoveToContent and \ref GetValue
691 * The string is available until the next Host operation. If storing is required, a copy should be made
701 * \brief Reads all the contents of an Element or Attribute as a string, including markup. Increments the pointer.
703 * This returns the raw contents of the file except the enclosing elements. It can be considered the
709 * The string is available until the next Host operation. If storing is required, a copy should be made
716 inline void ReadInnerXml(const char *& out_csXml) { g_cinterface->ReadInnerXml(this, &out_csXml); }
721 * This returns the raw contents of the file including the enclosing elements. It can be considered the
727 * The string is available until the next Host operation. If storing is required, a copy should be made
731 * \param[out] out_csXml All the XML content, including markup and enclosing tags, of the current node.
734 inline void ReadOuterXml(const char *& out_csXml) { g_cinterface->ReadOuterXml(this, &out_csXml); }
751 inline bool GetAttribute(const char * in_rcsAttributeName, const char *& out_rcsValue) { return MKBOOL(g_cinterface->GetAttribute(this, in_rcsAttributeName, &out_rcsValue)); }
769 };
779 };
799 inline AK::Wwise::Plugin::XmlWriteReady::WriteReady GetReadyState() const { return g_cinterface->GetReadyState(this); }
810 inline bool Append(XmlWriter& in_writerToAppend) { return MKBOOL(g_cinterface->Append(this, &in_writerToAppend)); }
821 inline AK::Wwise::Plugin::XmlWriteState::WriteState GetWriteState() const { return g_cinterface->GetWriteState(this); }
844 * \param[in] in_rcsElementName Node name, as retrieved on the reader with \ref AK::Wwise::Plugin::XmlReader::GetName "GetName".
847 inline void WriteStartElement(const char * in_rcsElementName, AK::Wwise::Plugin::XmlElementType::ElementType in_eType) { g_cinterface->WriteStartElement(this, in_rcsElementName, in_eType); }
860 inline void WriteAttributeString(const char * in_rcsAttribute, const char * in_rcsValue) { g_cinterface->WriteAttributeString(this, in_rcsAttribute, in_rcsValue); }
867 inline void WriteString(const char * in_rcsValue) { g_cinterface->WriteString(this, in_rcsValue); }
876 inline void WriteCData(const char * in_rcsValue) { g_cinterface->WriteCData(this, in_rcsValue); }
887 /// Use this class to handle the WriteStartElement/WriteEndElement pair automatically in a C++ scope.
893 AutoStartEndElement( const char * in_rcsElementName, XmlWriter* in_pWriter, AK::Wwise::Plugin::XmlElementType::ElementType in_eType = AK::Wwise::Plugin::XmlElementType::Map )
899 AutoStartEndElement( const char * in_rcsElementName, XmlWriter& in_pWriter, AK::Wwise::Plugin::XmlElementType::ElementType in_eType = AK::Wwise::Plugin::XmlElementType::Map )
void(* WriteStartElement)(struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this, const char *in_rcsElementName, AK::Wwise::Plugin::XmlElementType::ElementType in_eType)
Creates a new inner node.
Definition: HostXml.h:449
RequestedHostInterface< XmlReader > RequestXml
Requests the XML processing interface.
Definition: HostXml.h:927
void(* ReadInnerXml)(struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this, const char **out_csXml)
Reads all the contents of an Element or Attribute as a string, including markup. Increments the point...
Definition: HostXml.h:330
void WriteRaw(const char *in_rcsValue)
Appends a raw string at this precise point of the XML file.
Definition: HostXml.h:885
int(* GetLinePosition)(const struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Retrieves the column in the line that contains the start of the current node being read.
Definition: HostXml.h:243
AK::Wwise::Plugin::XmlWriteState::WriteState(* GetWriteState)(const struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this)
Retrieves the state of the node the writer is currently populating.
Definition: HostXml.h:418
bool(* Read)(struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Sets the reading pointer to the next node, recursively.
Definition: HostXml.h:288
static GluedInterface * g_cinterface
The unique instance of the CInterface interface. Defined at nullptr first, overridden by the Host onc...
Definition: PluginInfoGenerator.h:89
void ReadInnerXml(const char *&out_csXml)
Reads all the contents of an Element or Attribute as a string, including markup. Increments the point...
Definition: HostXml.h:716
bool GetAttribute(const char *in_rcsAttributeName, const char *&out_rcsValue)
Reads the value of a particular attribute under the current node.
Definition: HostXml.h:751
AK::Wwise::Plugin::XmlNodeType::NodeType MoveToContent()
Makes sure the cursor points to a content-type entity while reading XML.
Definition: HostXml.h:667
decltype(BaseInterface::m_version) InterfaceVersion
PluginInfoGenerator: Type for the m_version value in BaseInterface.
Definition: PluginInfoGenerator.h:50
AK::Wwise::Plugin::XmlWriteReady::WriteReady(* GetReadyState)(const struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this)
Determines the state of readiness of the writer.
Definition: HostXml.h:395
bool(* IsReady)(const struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this)
Determines if the writer is ready to be used.
Definition: HostXml.h:384
AK::Wwise::Plugin::XmlWriteState::WriteState GetWriteState() const
Retrieves the state of the node the writer is currently populating.
Definition: HostXml.h:821
const char * GetName() const
Returns the name of the current node being read.
Definition: HostXml.h:566
int GetLineNumber() const
Retrieves the line number that contains the start of the current node being read.
Definition: HostXml.h:624
void(* WriteCData)(struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this, const char *in_rcsValue)
Appends a raw CDATA string as value to the current node.
Definition: HostXml.h:494
const char * GetValue() const
Returns the value of the current node being read.
Definition: HostXml.h:605
AutoStartEndElement(const char *in_rcsElementName, XmlWriter *in_pWriter, AK::Wwise::Plugin::XmlElementType::ElementType in_eType=AK::Wwise::Plugin::XmlElementType::Map)
Calls WriteStartElement automatically.
Definition: HostXml.h:893
bool(* IsEOF)(const struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Tests whether the end of file is reached while reading the XML.
Definition: HostXml.h:223
void WriteAttributeString(const char *in_rcsAttribute, const char *in_rcsValue)
Adds an attribute to the current node.
Definition: HostXml.h:860
@ AK_WWISE_PLUGIN_INTERFACE_TYPE_HOST_XML
2021.1 XML reading and writing host services. ak_wwise_plugin_host_xml_v1
Definition: PluginBaseInterface.h:83
AK::Wwise::Plugin::XmlNodeType::NodeType(* MoveToContent)(struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Makes sure the cursor points to a content-type entity while reading XML.
Definition: HostXml.h:278
AK::Wwise::Plugin::XmlWriteReady::WriteReady GetReadyState() const
Determines the state of readiness of the writer.
Definition: HostXml.h:799
void(* WriteAttributeString)(struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this, const char *in_rcsAttribute, const char *in_rcsValue)
Adds an attribute to the current node.
Definition: HostXml.h:469
AK::Wwise::Plugin::XmlNodeType::NodeType GetNodeType() const
Returns the type of the current node being read.
Definition: HostXml.h:576
void ReadOuterXml(const char *&out_csXml)
Reads the Element or Attribute as a string, including markup. Increments the pointer.
Definition: HostXml.h:734
API interface for XML-based plug-in persistence.
Definition: HostXml.h:145
void(* WriteString)(struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this, const char *in_rcsValue)
Appends a string as value to the current node.
Definition: HostXml.h:481
Wwise Authoring Plug-ins - C++ class helper to automatically determine the plug-in interfaces used in...
bool IsEOF() const
Tests whether the end of file is reached while reading the XML.
Definition: HostXml.h:615
int GetLinePosition() const
Retrieves the column in the line that contains the start of the current node being read.
Definition: HostXml.h:633
PluginInfoGenerator: Associates an existing C Interface with a variable that can be used....
Definition: PluginInfoGenerator.h:104
void(* WriteEndElement)(struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this)
Closes the previous node.
Definition: HostXml.h:460
bool IsEmptyElement() const
Tests whether the current node being read is empty.
Definition: HostXml.h:583
void(* ReadOuterXml)(struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this, const char **out_csXml)
Reads the Element or Attribute as a string, including markup. Increments the pointer.
Definition: HostXml.h:349
bool(* IsEmptyElement)(const struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Tests whether the current node being read is empty.
Definition: HostXml.h:189
API interface for XML-based plug-in persistence.
Definition: HostXml.h:530
std::underlying_type< InterfaceType >::type InterfaceTypeValue
PluginInfoGenerator: Underlying storage type for the m_interface value in BaseInterface.
Definition: PluginInfoGenerator.h:49
void WriteCData(const char *in_rcsValue)
Appends a raw CDATA string as value to the current node.
Definition: HostXml.h:876
int(* GetLineNumber)(const struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Retrieves the line number that contains the start of the current node being read.
Definition: HostXml.h:233
void(* WriteRaw)(struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this, const char *in_rcsValue)
Appends a raw string at this precise point of the XML file.
Definition: HostXml.h:507
const char *(* GetName)(const struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Returns the name of the current node being read.
Definition: HostXml.h:170
void WriteString(const char *in_rcsValue)
Appends a string as value to the current node.
Definition: HostXml.h:867
void(* WriteStartDocument)(struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this)
Starts a new XML document.
Definition: HostXml.h:428
void WriteStartElement(const char *in_rcsElementName, AK::Wwise::Plugin::XmlElementType::ElementType in_eType)
Creates a new inner node.
Definition: HostXml.h:847
AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_VERSION(AudioPlugin)
#define AK_WWISE_PLUGIN_SPECIALIZE_HOST_INTERFACE_NO_BASE_INSTANCE(in_name, in_varname)
PluginInfoGenerator: Creates a C++ host specialization for interface class specified in in_name.
Definition: PluginInfoGenerator.h:262
Use this class to handle the WriteStartElement/WriteEndElement pair automatically in a C++ scope.
Definition: HostXml.h:889
ElementType
These element types have an impact when outputting in alternate formats such as JSON.
Definition: HostXml.h:112
void(* WriteEndDocument)(struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this)
Ends a completed XML document.
Definition: HostXml.h:438
Interface description and base class for every Wwise Authoring plug-in interface.
Definition: PluginBaseInterface.h:120
Base host-provided instance type for reading XML files through ak_wwise_plugin_host_xml_v1.
Definition: PluginDef.h:678
bool(* GetAttribute)(struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this, const char *in_rcsAttributeName, const char **out_rcsValue)
Reads the value of a particular attribute under the current node.
Definition: HostXml.h:368
AutoStartEndElement(const char *in_rcsElementName, XmlWriter &in_pWriter, AK::Wwise::Plugin::XmlElementType::ElementType in_eType=AK::Wwise::Plugin::XmlElementType::Map)
Definition: HostXml.h:899
const char * ReadElementString()
Reads simple text-only elements, and increments the pointer.
Definition: HostXml.h:698
void Skip()
Sets the reading pointer past the current node, skipping any inner content.
Definition: HostXml.h:741
const char *(* ReadElementString)(struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Reads simple text-only elements, and increments the pointer.
Definition: HostXml.h:311
const char *(* GetValue)(const struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Returns the value of the current node being read.
Definition: HostXml.h:212
bool(* Append)(struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_this, struct ak_wwise_plugin_host_xml_writer_instance_v1 *in_pWriterToAppend)
Appending a first XML writer to a second XML writer.
Definition: HostXml.h:407
void(* Skip)(struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Sets the reading pointer past the current node, skipping any inner content.
Definition: HostXml.h:357
API interface for XML-based plug-in persistence.
Definition: HostXml.h:756
Base host-provided instance type for writing XML files through ak_wwise_plugin_host_xml_v1.
Definition: PluginDef.h:687
AK::Wwise::Plugin::XmlNodeType::NodeType(* GetNodeType)(const struct ak_wwise_plugin_host_xml_reader_instance_v1 *in_this)
Returns the type of the current node being read.
Definition: HostXml.h:181
bool Append(XmlWriter &in_writerToAppend)
Appending a first XML writer to a second XML writer.
Definition: HostXml.h:810
ak_wwise_plugin_host_xml_v1()
Definition: HostXml.h:151
AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_CLASS(AudioPlugin)
Definition: AudioPlugin.h:111
Was this page helpful?
Need Support?
Questions? Problems? Need more info? Contact us, and we can help!
Visit our Support pageTell us about your project. We're here to help.
Register your project and we'll help you get started with no strings attached!
Get started with Wwise