mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
classref: Add property overview and setter/getter like in editor docs
Output from godotengine/godot#22013. Fixes #1729.
This commit is contained in:
@@ -8,6 +8,7 @@ XMLParser
|
||||
=========
|
||||
|
||||
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
|
||||
|
||||
**Category:** Core
|
||||
|
||||
Brief Description
|
||||
@@ -59,7 +60,7 @@ Enumerations
|
||||
|
||||
.. _enum_XMLParser_NodeType:
|
||||
|
||||
enum **NodeType**
|
||||
enum **NodeType**:
|
||||
|
||||
- **NODE_NONE** = **0** --- There's no node (no file or buffer opened)
|
||||
- **NODE_ELEMENT** = **1** --- Element (tag)
|
||||
@@ -69,7 +70,6 @@ enum **NodeType**
|
||||
- **NODE_CDATA** = **5** --- CDATA content
|
||||
- **NODE_UNKNOWN** = **6** --- Unknown node
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -78,106 +78,105 @@ This class can serve as base to make custom XML parsers. Since XML is a very fle
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_XMLParser_get_attribute_count:
|
||||
.. _class_XMLParser_get_attribute_count:
|
||||
|
||||
- :ref:`int<class_int>` **get_attribute_count** **(** **)** const
|
||||
|
||||
Get the amount of attributes in the current element.
|
||||
|
||||
.. _class_XMLParser_get_attribute_name:
|
||||
.. _class_XMLParser_get_attribute_name:
|
||||
|
||||
- :ref:`String<class_String>` **get_attribute_name** **(** :ref:`int<class_int>` idx **)** const
|
||||
|
||||
Get the name of the attribute specified by the index in ``idx`` argument.
|
||||
|
||||
.. _class_XMLParser_get_attribute_value:
|
||||
.. _class_XMLParser_get_attribute_value:
|
||||
|
||||
- :ref:`String<class_String>` **get_attribute_value** **(** :ref:`int<class_int>` idx **)** const
|
||||
|
||||
Get the value of the attribute specified by the index in ``idx`` argument.
|
||||
|
||||
.. _class_XMLParser_get_current_line:
|
||||
.. _class_XMLParser_get_current_line:
|
||||
|
||||
- :ref:`int<class_int>` **get_current_line** **(** **)** const
|
||||
|
||||
Get the current line in the parsed file (currently not implemented).
|
||||
|
||||
.. _class_XMLParser_get_named_attribute_value:
|
||||
.. _class_XMLParser_get_named_attribute_value:
|
||||
|
||||
- :ref:`String<class_String>` **get_named_attribute_value** **(** :ref:`String<class_String>` name **)** const
|
||||
|
||||
Get the value of a certain attribute of the current element by name. This will raise an error if the element has no such attribute.
|
||||
|
||||
.. _class_XMLParser_get_named_attribute_value_safe:
|
||||
.. _class_XMLParser_get_named_attribute_value_safe:
|
||||
|
||||
- :ref:`String<class_String>` **get_named_attribute_value_safe** **(** :ref:`String<class_String>` name **)** const
|
||||
|
||||
Get the value of a certain attribute of the current element by name. This will return an empty :ref:`String<class_String>` if the attribute is not found.
|
||||
|
||||
.. _class_XMLParser_get_node_data:
|
||||
.. _class_XMLParser_get_node_data:
|
||||
|
||||
- :ref:`String<class_String>` **get_node_data** **(** **)** const
|
||||
|
||||
Get the contents of a text node. This will raise an error in any other type of node.
|
||||
|
||||
.. _class_XMLParser_get_node_name:
|
||||
.. _class_XMLParser_get_node_name:
|
||||
|
||||
- :ref:`String<class_String>` **get_node_name** **(** **)** const
|
||||
|
||||
Get the name of the current element node. This will raise an error if the current node type is not ``NODE_ELEMENT`` nor ``NODE_ELEMENT_END``
|
||||
|
||||
.. _class_XMLParser_get_node_offset:
|
||||
.. _class_XMLParser_get_node_offset:
|
||||
|
||||
- :ref:`int<class_int>` **get_node_offset** **(** **)** const
|
||||
|
||||
Get the byte offset of the current node since the beginning of the file or buffer.
|
||||
|
||||
.. _class_XMLParser_get_node_type:
|
||||
.. _class_XMLParser_get_node_type:
|
||||
|
||||
- :ref:`NodeType<enum_XMLParser_NodeType>` **get_node_type** **(** **)**
|
||||
|
||||
Get the type of the current node. Compare with ``NODE_*`` constants.
|
||||
|
||||
.. _class_XMLParser_has_attribute:
|
||||
.. _class_XMLParser_has_attribute:
|
||||
|
||||
- :ref:`bool<class_bool>` **has_attribute** **(** :ref:`String<class_String>` name **)** const
|
||||
|
||||
Check whether or not the current element has a certain attribute.
|
||||
|
||||
.. _class_XMLParser_is_empty:
|
||||
.. _class_XMLParser_is_empty:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_empty** **(** **)** const
|
||||
|
||||
Check whether the current element is empty (this only works for completely empty tags, e.g. <element \\>).
|
||||
|
||||
.. _class_XMLParser_open:
|
||||
.. _class_XMLParser_open:
|
||||
|
||||
- :ref:`Error<enum_@GlobalScope_Error>` **open** **(** :ref:`String<class_String>` file **)**
|
||||
|
||||
Open a XML file for parsing. This returns an error code.
|
||||
|
||||
.. _class_XMLParser_open_buffer:
|
||||
.. _class_XMLParser_open_buffer:
|
||||
|
||||
- :ref:`Error<enum_@GlobalScope_Error>` **open_buffer** **(** :ref:`PoolByteArray<class_PoolByteArray>` buffer **)**
|
||||
|
||||
Open a XML raw buffer for parsing. This returns an error code.
|
||||
|
||||
.. _class_XMLParser_read:
|
||||
.. _class_XMLParser_read:
|
||||
|
||||
- :ref:`Error<enum_@GlobalScope_Error>` **read** **(** **)**
|
||||
|
||||
Read the next node of the file. This returns an error code.
|
||||
|
||||
.. _class_XMLParser_seek:
|
||||
.. _class_XMLParser_seek:
|
||||
|
||||
- :ref:`Error<enum_@GlobalScope_Error>` **seek** **(** :ref:`int<class_int>` position **)**
|
||||
|
||||
Move the buffer cursor to a certain offset (since the beginning) and read the next node there. This returns an error code.
|
||||
|
||||
.. _class_XMLParser_skip_section:
|
||||
.. _class_XMLParser_skip_section:
|
||||
|
||||
- void **skip_section** **(** **)**
|
||||
|
||||
Skips the current section. If the node contains other elements, they will be ignored and the cursor will go to the closing of the current element.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user