# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # XML_NO_INDENTATION = -1 # Represents XML node type. # # # class XmlNodeType < Wx::Enum # # XML_ELEMENT_NODE = Wx::XmlNodeType.new(1) # # XML_ATTRIBUTE_NODE = Wx::XmlNodeType.new(2) # # XML_TEXT_NODE = Wx::XmlNodeType.new(3) # # XML_CDATA_SECTION_NODE = Wx::XmlNodeType.new(4) # # XML_ENTITY_REF_NODE = Wx::XmlNodeType.new(5) # # XML_ENTITY_NODE = Wx::XmlNodeType.new(6) # # XML_PI_NODE = Wx::XmlNodeType.new(7) # # XML_COMMENT_NODE = Wx::XmlNodeType.new(8) # # XML_DOCUMENT_NODE = Wx::XmlNodeType.new(9) # # XML_DOCUMENT_TYPE_NODE = Wx::XmlNodeType.new(10) # # XML_DOCUMENT_FRAG_NODE = Wx::XmlNodeType.new(11) # # XML_NOTATION_NODE = Wx::XmlNodeType.new(12) # # XML_HTML_DOCUMENT_NODE = Wx::XmlNodeType.new(13) end # XmlNodeType # # # # class XmlDocumentLoadFlag < Wx::Enum # # XMLDOC_NONE = Wx::XmlDocumentLoadFlag.new(0) # # XMLDOC_KEEP_WHITESPACE_NODES = Wx::XmlDocumentLoadFlag.new(1) end # XmlDocumentLoadFlag # Represents a node in an XML document. # See {Wx::XmlDocument}. # Each node is named and depending on the node type it may also hold content or be given attributes. # The two most common node types are {Wx::XmlNodeType::XML_ELEMENT_NODE} and {Wx::XmlNodeType::XML_TEXT_NODE}. {Wx::XmlNodeType::XML_ELEMENT_NODE} represents a pair of XML element tags, whilst {Wx::XmlNodeType::XML_TEXT_NODE} represents the text value that can belong to the element. # A {Wx::XmlNodeType::XML_ELEMENT_NODE} has a title, and optionally attributes, but does not have any content. A {Wx::XmlNodeType::XML_TEXT_NODE} does not have a title or attributes but should normally have content. # For example: in the XML fragment hi there is an element node with the name title and a single text node child with the text hi as content. # A {Wx::XmlNodeType::XML_PI_NODE} represents a Processing Instruction (PI) node with the name parameter set as the target and the contents parameter set as the instructions. Note that whilst the PI instructions are often in the form of pseudo-attributes, these do not use the node's attribute member. It is the user's responsibility to code and decode the PI instruction text. # The {Wx::XmlNodeType::XML_DOCUMENT_TYPE_NODE} is not implemented at this time. Instead, you should get and set the DOCTYPE values using the {Wx::XmlDocument} class. # If {Wx::Setup::USE_UNICODE} is 0, all strings are encoded in the encoding given to Wx::XmlDocument::Load (default is UTF-8). # Once a {Wx::XmlNode} has been added to a {Wx::XmlDocument} it becomes owned by the document and this has two implications. Firstly, the {Wx::XmlDocument} takes responsibility for deleting the node so the user should not delete it; and secondly, a {Wx::XmlNode} must always be created on the heap and never on the stack. # # === # # Category: {Wx::XML} # @see Wx::XmlDocument # @see Wx::XmlDoctype # @see Wx::XmlAttribute # # # # @note This class is untracked and should not be derived from nor instances extended! class XmlNode < ::Object # @overload initialize(type, name, content=(''), lineNo=-1) # A simplified version of the first constructor form, assuming a NULL parent. # @param type [Wx::XmlNodeType] One of the {Wx::XmlNodeType} enumeration value. # @param name [String] The name of the node. This is the string which appears between angular brackets. # @param content [String] The content of the node. Only meaningful when type is {Wx::XmlNodeType::XML_TEXT_NODE} or {Wx::XmlNodeType::XML_CDATA_SECTION_NODE}. # @param lineNo [Integer] Number of line this node was present at in input file or -1. # @return [Wx::XmlNode] # @overload initialize(node) # Copy constructor. # Note that this does NOT copy siblings and parent pointer, i.e. {Wx::XmlNode#get_parent} and {Wx::XmlNode#get_next} will return NULL after using copy ctor and are never unmodified by {Wx::operator=()}. On the other hand, it DOES copy children and attributes. # @param node [Wx::XmlNode] # @return [Wx::XmlNode] def initialize(*args) end # Appends an attribute with given name and value to the list of attributes for this node. # @param name [String] # @param value [String] # @return [void] def add_attribute(name, value) end # Adds node child as the last child of this node. # Once added, the XML tree takes ownership of this object and there is no need to delete it. # Note that this function works in O(n) time where n is the number of existing children. Consequently, adding large number of child nodes using this method can be expensive, because it has O(n^2) time complexity in number of nodes to be added. Use {Wx::XmlNode#insert_child_after} to populate XML tree in linear time. # @see Wx::XmlNode#insert_child # @see Wx::XmlNode#insert_child_after # @param child [Wx::XmlNode] # @return [void] def add_child(child) end # Removes the first attributes which has the given name from the list of attributes for this node. # @param name [String] # @return [Boolean] def delete_attribute(name) end # Returns the value of the attribute named attrName if it does exist. # If it does not exist, the defaultVal is returned. # @param attrName [String] # @param defaultVal [String] # @return [String] def get_attribute(attrName, defaultVal=('')) end alias_method :attribute, :get_attribute # Returns the first child of this node. # To get a pointer to the second child of this node (if it does exist), use the {Wx::XmlNode#get_next} function on the returned value. # @return [Wx::XmlNode] def get_children; end alias_method :children, :get_children # Returns the content of this node. # Can be an empty string. Be aware that for nodes of type {Wx::XmlNodeType::XML_ELEMENT_NODE} (the most used node type) the content is an empty string. See {Wx::XmlNode#get_node_content} for more details. # @return [Wx::String] def get_content; end alias_method :content, :get_content # Returns the number of nodes which separate this node from grandparent. # This function searches only the parents of this node until it finds grandparent or the NULL node (which is the parent of non-linked nodes or the parent of a {Wx::XmlDocument}'s root element node). # @param grandparent [Wx::XmlNode] # @return [Integer] def get_depth(grandparent=nil) end alias_method :depth, :get_depth # Returns a flag indicating whether encoding conversion is necessary when saving. # The default is false. # You can improve saving efficiency considerably by setting this value. # @return [Boolean] def get_no_conversion; end alias_method :no_conversion, :get_no_conversion # Returns line number of the node in the input XML file or -1 if it is unknown. # @return [Integer] def get_line_number; end alias_method :line_number, :get_line_number # Returns the name of this node. # Can be an empty string (e.g. for nodes of type {Wx::XmlNodeType::XML_TEXT_NODE} or {Wx::XmlNodeType::XML_CDATA_SECTION_NODE}). # @return [Wx::String] def get_name; end alias_method :name, :get_name # Returns a pointer to the sibling of this node or NULL if there are no siblings. # @return [Wx::XmlNode] def get_next; end alias_method :next_, :get_next # Returns the content of the first child node of type {Wx::XmlNodeType::XML_TEXT_NODE} or {Wx::XmlNodeType::XML_CDATA_SECTION_NODE}. # This function is very useful since the XML snippet "tagcontent" is represented by expat with the following tag tree: # # ``` # wxXML_ELEMENT_NODE name="tagname", content="" # |-- wxXML_TEXT_NODE name="", content="tagcontent" # ``` # # or eventually: # # ``` # wxXML_ELEMENT_NODE name="tagname", content="" # |-- wxXML_CDATA_SECTION_NODE name="", content="tagcontent" # ``` # # An empty string is returned if the node has no children of type {Wx::XmlNodeType::XML_TEXT_NODE} or {Wx::XmlNodeType::XML_CDATA_SECTION_NODE}, or if the content of the first child of such types is empty. # @return [String] def get_node_content; end alias_method :node_content, :get_node_content # Returns a pointer to the parent of this node or NULL if this node has no parent. # @return [Wx::XmlNode] def get_parent; end alias_method :parent, :get_parent # Returns the type of this node. # @return [Wx::XmlNodeType] def get_type; end alias_method :type, :get_type # Returns true if this node has a attribute named attrName. # @param attrName [String] # @return [Boolean] def has_attribute(attrName) end alias_method :has_attribute?, :has_attribute # Inserts the child node immediately before followingNode in the children list. # Once inserted, the XML tree takes ownership of the new child and there is no need to delete it. # true if followingNode has been found and the child node has been inserted. # # For historical reasons, followingNode may be NULL. In that case, then child is prepended to the list of children and becomes the first child of this node, i.e. it behaves identically to using the first children (as returned by {Wx::XmlNode#get_children}) for followingNode). # @see Wx::XmlNode#add_child # @see Wx::XmlNode#insert_child_after # @param child [Wx::XmlNode] # @param followingNode [Wx::XmlNode] # @return [Boolean] def insert_child(child, followingNode) end # Inserts the child node immediately after precedingNode in the children list. # Once inserted, the XML tree takes ownership of the new child and there is no need to delete it. # true if precedingNode has been found and the child node has been inserted. # @see Wx::XmlNode#insert_child # @see Wx::XmlNode#add_child # @param child [Wx::XmlNode] The child to insert. # @param precedingNode [Wx::XmlNode] The node to insert child after. As a special case, this can be NULL if this node has no children yet in that case, child will become this node's only child node. # @return [Boolean] def insert_child_after(child, precedingNode) end # Returns true if the content of this node is a string containing only whitespaces (spaces, tabs, new lines, etc). # Note that this function is locale-independent since the parsing of XML documents must always produce the exact same tree regardless of the locale it runs under. # @return [Boolean] def is_whitespace_only; end alias_method :whitespace_only?, :is_whitespace_only # Sets the content of this node. # @param con [String] # @return [void] def set_content(con) end alias_method :content=, :set_content # Sets the name of this node. # @param name [String] # @return [void] def set_name(name) end alias_method :name=, :set_name # Sets a flag to indicate whether encoding conversion is necessary when saving. # The default is false. # You can improve saving efficiency considerably by setting this value. # @param noconversion [Boolean] # @return [void] def set_no_conversion(noconversion) end alias_method :no_conversion=, :set_no_conversion # Sets the type of this node. # @param type [Wx::XmlNodeType] # @return [void] def set_type(type) end alias_method :type=, :set_type end # XmlNode end