[Xpp] Deleted an unused local

[Xpp] Deleted an unused local

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//

USING System
USING System.Collections.Generic
USING System.Collections.Concurrent
USING System.Text
USING System.Xml
USING System.Linq

BEGIN NAMESPACE XSharp.XPP

    /// Helper class that is used by the XML functions

	CLASS XDocument
#region Static
        PROTECTED STATIC aDocuments AS List<XDocument>
        PROTECTED STATIC aErrors    AS List<XError>
        PROTECTED STATIC nextHandle AS INT64
        PROTECTED STATIC gate       AS OBJECT
        STATIC CONSTRUCTOR()
            Initialize()
            gate       := OBJECT{}

           /// Initialize the static variables
         STATIC METHOD Initialize() AS VOID
            aDocuments := List<XDocument>{}
            aErrors    := List<XError>{}
            nextHandle := 1
            RETURN

        /// Find an open XDocument object by its unique handle
        STATIC METHOD GetDocument (nHandle AS INT64) AS XDocument
            FOREACH VAR doc IN aDocuments
                IF doc:DocHandle == nHandle
                    RETURN doc
                ENDIF
            NEXT
            RETURN NULL

        /// Allocate new XDocument handle
        STATIC METHOD NewHandle() AS INT64
            BEGIN LOCK gate
                RETURN nextHandle++
            END LOCK

        /// Find error by ID
        STATIC METHOD FindError(nError AS INT64) AS XError
            RETURN aErrors:Where( {x => x:Id == nError}):FirstOrDefault()

         /// Get list of all errors
        STATIC METHOD GetErrors() AS IEnumerable<XError>
            RETURN aErrors

        /// Get error for a specific document
        STATIC METHOD GetErrorsForDocument(nDocHandle AS INT64) AS IEnumerable<XError>
            RETURN aErrors:Where ( { x=> x:DocHandle == nDocHandle })

       /// Get ID for the parent of an XML node
       STATIC METHOD FindParent(nId AS INT64) AS INT64
            LOCAL oNode AS XmlNode
            LOCAL oDoc  AS XDocument
            oNode := FindNode(nId, OUT oDoc)
            IF oNode != NULL
                oNode := oNode:ParentNode
                IF oDoc:Nodes:ContainsKey(oNode)
                    RETURN oDoc:Nodes[oNode]
                ENDIF
            ENDIF
            RETURN 0

       /// Get XML node and document by ID
        STATIC PRIVATE METHOD FindNode(nID AS INT64, oDocResult OUT XDocument) AS XmlNode
            LOCAL oFoundNode := NULL AS XmlNode
            oDocResult := NULL
            BEGIN LOCK gate
                FOREACH oDoc AS XDocument IN aDocuments
                    IF oDoc:NodeIds:ContainsKey(nID)
                        oFoundNode := oDoc:NodeIds[nID]
                        oDocResult := oDoc
                        RETURN oFoundNode
                    ENDIF
                NEXT
            END LOCK
            RETURN NULL

        /// Get a list of the tags in an XML Node
        STATIC METHOD FindTag(nId AS INT64) AS ARRAY
            LOCAL oNode AS XmlNode
            oNode := FindNode(nId, OUT VAR oDoc)
            IF oNode != NULL
                RETURN AsXmlArray(oNode, oDoc)
            ENDIF
            RETURN NULL_ARRAY

        /// Find a child tag in an XML Node
        STATIC METHOD FindChildTag(nId AS INT64, cChildName AS STRING, lFirst AS LOGIC) AS USUAL
            IF lFirst
                RETURN FindFirstChildTag(nId, cChildName)
            ELSE
                RETURN FindAllChildTags(nId, cChildName)
            ENDIF

        /// Find a child tag in an XML Node
        STATIC METHOD FindFirstChildTag(nId AS INT64, cChildName AS STRING) AS INT64
            LOCAL oNode AS XmlNode
            oNode := FindNode(nId, OUT VAR oDoc)
            IF oNode != NULL
                FOREACH oChild AS XmlNode IN oNode:ChildNodes
                    IF String.Compare(oChild:Name, cChildName, TRUE) == 0
                        IF oDoc:Nodes:ContainsKey(oChild)
                            RETURN oDoc:Nodes[oChild]
                        ENDIF
                    ENDIF
                NEXT
            ENDIF
            // When not found we return -1
            RETURN -1

        STATIC METHOD FindAllChildTags(nId AS INT64, cChildName AS STRING) AS ARRAY
            LOCAL oNode AS XmlNode
            // When lFirst = TRUE then  return the id of that node or -1
            // When lFirst = FALSE then return an array of nodes
            oNode := FindNode(nId, OUT VAR oDoc)
            IF oNode != NULL
                LOCAL aResult := {} AS ARRAY
                FOREACH oChild AS XmlNode IN oNode:ChildNodes
                    IF String.Compare(oChild:Name, cChildName, TRUE) == 0
                        IF oDoc:Nodes:ContainsKey(oChild)
                            AAdd(aResult, oDoc:Nodes[oChild])
                        ENDIF
                    ENDIF
                NEXT
                IF ALen(aResult) > 0
                    RETURN aResult
                ENDIF
            ENDIF
            RETURN NULL_ARRAY
    /// Return the children of a node as a XPP specific XML array

        STATIC METHOD AsXmlArray(oNode AS XmlNode, oFoundDoc AS XDocument) AS ARRAY
            LOCAL aResult AS ARRAY
            LOCAL aChildren AS ARRAY
            LOCAL aAttributes AS ARRAY
            aChildren := {}
            IF oNode:HasChildNodes
                FOREACH oChild AS XmlNode IN oNode:ChildNodes
                    IF oFoundDoc:Nodes:ContainsKey(oChild)
                        AAdd(aChildren,oFoundDoc:Nodes[oChild])
                    ENDIF
                NEXT
            ENDIF
            aAttributes := {}
            IF oNode:Attributes != NULL
                FOREACH oAttr AS XmlAttribute IN oNode:Attributes
                    AAdd(aAttributes , {oAttr:Name, oAttr:Value, oAttr})
                NEXT
            ENDIF
            aResult := ArrayNew(XMLTAG_N_MEMBER)
            aResult [XMLTAG_NAME   ] := oNode:Name
            aResult [XMLTAG_CONTENT] := oNode:InnerXml
            aResult [XMLTAG_CHILD  ] := IIF(ALen(aChildren) == 0, NIL, aChildren)
            aResult [XMLTAG_ACTION ] := NIL
            aResult [XMLTAG_ATTRIB ] := IIF(ALen(aAttributes) == 0, NIL, aAttributes)
            aResult [XMLTAG_OBJECT ] := oNode
            RETURN aResult

        ///
       STATIC METHOD RegisterError(nError AS USUAL) AS VOID
            RETURN

         /// Close all open document
       STATIC METHOD CloseAllDocuments() AS LOGIC
            Initialize()
            RETURN TRUE

         /// Clear all errors
       STATIC METHOD ClearAllErrors() AS LOGIC
            aErrors:Clear()
            RETURN TRUE

#endregion
        /// Unique handle for the document.
        INTERNAL  PROPERTY DocHandle AS INT64 AUTO
        INTERNAL PROPERTY Nodes     AS Dictionary<XmlNode, INT64> AUTO
        INTERNAL PROPERTY NodeIds   AS Dictionary<INT64, XmlNode> AUTO
        INTERNAL PROPERTY RootId    AS INT64 AUTO
        INTERNAL PROPERTY LastError AS INT64 AUTO
        PROTECT  oDoc 	   AS XmlDocument
        PROTECT  cFileName AS STRING
        PROTECT  Actions   AS List<XAction>
        CONSTRUCTOR
            NodeIds    := Dictionary<INT64, XmlNode>{}
            Nodes      := Dictionary<XmlNode, INT64>{}
            Actions    := List<XAction>{}
            DocHandle  := 0
            LastError  := 0
            RETURN

        PRIVATE METHOD AddError(e AS Exception) AS INT64
            LOCAL oError        := XError{cFileName, XMLDOC_ERROR_PROCESS} AS XError
            oError:Additional   := e:Message
            oError:DocHandle    := SELF:DocHandle
            VAR id              := NewHandle()
            aErrors:Add( oError)
            RETURN id

        PRIVATE METHOD AddOpenError(e AS XmlException) AS INT64
            LOCAL oError    := XError{cFileName, XMLDOC_ERROR_INVALID_XML} AS XError
            oError:Line     := e:LineNumber
            oError:Column   := e:LinePosition
            oError:Additional := e:Message
            oError:DocHandle := SELF:DocHandle
            IF e:Message:ToLower():Contains("does not match")
                oError:Id := XMLDOC_ERROR_ENDTAG_MISSING
            ENDIF
            aErrors:Add(oError)
            RETURN oError:Handle

        PRIVATE METHOD AddOpenError(oError AS XError) AS INT64
            aErrors:Add(oError)
            RETURN oError:Handle

        PRIVATE METHOD ClearError() AS VOID
            LastError  := 0

        PRIVATE METHOD Read(oReader AS System.IO.TextReader) AS LOGIC
            LOCAL lOk := FALSE AS LOGIC
            TRY
                oDoc := XmlDocument{}
                oDoc:Load(oReader)
                DocHandle := NewHandle()
                BEGIN LOCK gate
                    aDocuments:Add(SELF)
                END LOCK
                lOk := TRUE
            CATCH e AS XmlException
                LastError := AddOpenError(e)
            CATCH e AS Exception
                LastError := AddError(e)
                BEGIN LOCK gate
                    IF aDocuments:Contains(SELF)
                        aDocuments:Remove(SELF)
                    ENDIF
                END LOCK
                lOk := FALSE
            END TRY
            RETURN lOk

         /// Open an XML File
        METHOD OpenFile(cFile AS STRING) AS LOGIC
            LOCAL lOk := FALSE AS LOGIC
            SELF:ClearError()
            SELF:cFileName := cFile
            IF String.IsNullOrEmpty(cFile)
                LastError := AddOpenError(XError{cFile, XMLDOC_ERROR_NO_FILENAME})
                RETURN FALSE
            ENDIF
            IF !System.IO.File.Exists(cFile)
                LastError := AddOpenError(XError{cFile, XMLDOC_ERROR_FILE_NOT_FOUND})
                RETURN FALSE
            ENDIF
            TRY
                BEGIN USING VAR oReader := System.IO.StreamReader{cFile,TRUE}
                    lOk := SELF:Read(oReader)
                    oReader:Close()
                END USING
                SELF:Process()
            CATCH e AS Exception
                LastError := AddError(e)
                lOk := FALSE
            END TRY
            RETURN lOk

        /// Open a XML document from a string
        METHOD OpenText(cContents AS STRING) AS LOGIC
            LOCAL lOk := FALSE AS LOGIC
            SELF:ClearError()
            TRY
                BEGIN USING VAR oReader := System.IO.StringReader{cContents}
                    lOk := SELF:Read(oReader)
                    oReader:Close()
                END USING
                SELF:Process()
            CATCH
                lOk := FALSE
            END TRY
            RETURN lOk

        /// CLose an opened XML document

        METHOD Close() AS LOGIC
            LOCAL lOk := FALSE AS LOGIC
            IF aDocuments:Contains(SELF)
                aDocuments:Remove(SELF)
                lOk := TRUE
            ENDIF
            RETURN lOk

        /// Process an opened XML document
        METHOD Process() AS VOID
            TRY
                SELF:NodeIds:Clear()
                SELF:Nodes:Clear()
                SELF:WalkNode(oDoc)
                VAR root := oDoc:DocumentElement
                SELF:RootId := Nodes[root]
            CATCH e AS XmlException
                LastError := AddOpenError(e)
            CATCH e AS Exception
                LastError := AddError(e)
            END TRY
            RETURN

        /// Loop through all the actions and process each node that matches the actions
        METHOD ProcessNodes() AS LOGIC
            LOCAL lOk := FALSE AS LOGIC
            TRY
                LOCAL root := oDoc:DocumentElement AS XmlNode
                FOREACH VAR action IN Actions
                    VAR nodes := root:SelectNodes(action:Name)
                    IF nodes:Count >0
                        FOREACH node AS XmlNode IN nodes
                            lOk := SELF:PerformActions(node, action)
                            IF ! lOk
                                RETURN FALSE
                            ENDIF
                        NEXT
                    ENDIF
                NEXT
                lOk := TRUE
            CATCH e AS XmlException
                LastError := AddOpenError(e)
                lOk := FALSE
            CATCH e AS Exception
                LastError := AddError(e)
                lOk := FALSE
            END TRY
            RETURN lOk

        /// Select Nodes via XPath selection
        METHOD SelectNodes(cSelect AS STRING) AS ARRAY
            LOCAL aResult AS ARRAY
            TRY
                LOCAL root := oDoc:DocumentElement AS XmlNode
                VAR nodes := root:SelectNodes(cSelect)
                aResult := {}
                IF nodes:Count >0
                    FOREACH node AS XmlNode IN nodes
                        AAdd(aResult, SELF:Nodes[node])
                    NEXT
                ENDIF
            CATCH
                RETURN NULL_ARRAY
            END TRY
            RETURN aResult

        /// Perform actions on an XML node.
        METHOD PerformActions(oNode AS XmlNode, oAction AS XAction) AS LOGIC
            LOCAL bBlock        AS CODEBLOCK
            LOCAL nTag          AS INT64
            LOCAL aAttributes   := NIL AS USUAL
            LOCAL nResult       AS USUAL
            LOCAL oWork         AS XmlNode
            LOCAL sb            AS StringBuilder
            bBlock := oAction:Block
            nTag   := SELF:Nodes[oNode]
            sb     := StringBuilder{oNode:Name}
            oWork  := oNode:ParentNode
            DO WHILE oWork != NULL .AND. ! oWork IS XmlDocument
                sb:Insert(0,oWork:Name+"/")
                oWork := oWork:ParentNode
            ENDDO
            sb:Insert(0, "/")
            IF oNode:Attributes != NULL
                aAttributes := {}
                FOREACH oAttr AS XmlAttribute IN oNode:Attributes
                    AAdd(aAttributes , {oAttr:Name, oAttr:Value})
                NEXT
            ENDIF
            nResult := Eval(bBlock, sb:ToString(), oNode:InnerXml, aAttributes, nTag)
            IF IsLong(nResult)
                IF nResult == XML_PROCESS_ABORT
                    RETURN FALSE
                ENDIF
            ELSE
                RETURN FALSE
            ENDIF
            RETURN TRUE

        /// Walk all nodes and add them to the collections on the document class
        METHOD WalkNode(oNode AS XmlNode) AS VOID
            LOCAL nID AS INT64
            IF !SELF:Nodes:ContainsKey(oNode)
                nID := NewHandle()
                Nodes:Add(oNode, nID)
                NodeIds:Add(nID, oNode)
            ENDIF
	        FOREACH oChild AS XmlNode IN oNode:ChildNodes
		        SELF:WalkNode(oChild)
	        NEXT
	        RETURN

        /// Clear all actions on a document
        METHOD ClearActions() AS VOID
            SELF:Actions:Clear()
            RETURN

        /// Set an action on a XML node
        METHOD SetAction(cNode AS STRING, bAction AS CODEBLOCK) AS LONG
            SELF:Actions:Add(XAction{cNode, bAction})
            LOCAL root := oDoc:DocumentElement AS XmlNode
            VAR nodes := root:SelectNodes(cNode)
            RETURN nodes:Count

	END CLASS

    /// Helper class that stores errors for an XML document
    CLASS XError
        /// Filename where the error occurred.
        PROPERTY FileName AS STRING AUTO
        /// Linenumber where the error occurred.
        PROPERTY Line     AS LONG AUTO
        /// Column where the error occurred.
        PROPERTY Column   AS LONG AUTO
        /// Id for the node where the error occurred.
        PROPERTY Id       AS INT64 AUTO
        /// Additional info about the error.
        PROPERTY Additional AS USUAL AUTO
        /// Document Handle for which the error occurred.
        PROPERTY DocHandle AS INT64 AUTO
        /// Error Handle.
        PROPERTY Handle    AS INT64 AUTO
        CONSTRUCTOR(cFile AS STRING, nId AS INT64)
            SELF:FileName := cFile
            SELF:Id       := nId
            SELF:Additional := ""
            SELF:Handle := XDocument.NewHandle()
        /// Convert error object to XBase++ compatible error array.
        METHOD ToArray() AS ARRAY
            VAR aResult := ArrayNew(XML_ERROR_ADDINFO)
            aResult[XML_ERROR_ID]       := SELF:Id
            aResult[XML_ERROR_FILE]     := SELF:FileName
            aResult[XML_ERROR_LINE]     := SELF:Line
            aResult[XML_ERROR_COLUMN]   := SELF:Column
            aResult[XML_ERROR_ADDINFO]  := SELF:Additional
            RETURN aResult

    END CLASS

    /// Helper class that stores actions (codeblocks) for XML nodes
    CLASS XAction
        /// XML node name for which the action runs.
        PROPERTY Name AS STRING AUTO
        /// Codeblock to run for the action
        PROPERTY Block AS CODEBLOCK AUTO
        CONSTRUCTOR(cName AS STRING, oBlock AS CODEBLOCK)
            Name := cName
            Block := oBlock
            RETURN
    END CLASS

END NAMESPACE // XML

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//

USING System
USING System.Collections.Generic
USING System.Collections.Concurrent
USING System.Text
USING System.Xml
USING System.Linq

BEGIN NAMESPACE XSharp.XPP

    /// Helper class that is used by the XML functions

	CLASS XDocument
#region Static
        PROTECTED STATIC aDocuments AS List<XDocument>
        PROTECTED STATIC aErrors    AS List<XError>
        PROTECTED STATIC nextHandle AS INT64
        PROTECTED STATIC gate       AS OBJECT
        STATIC CONSTRUCTOR()
            Initialize()
            gate       := OBJECT{}

           /// Initialize the static variables
         STATIC METHOD Initialize() AS VOID
            aDocuments := List<XDocument>{}
            aErrors    := List<XError>{}
            nextHandle := 1
            RETURN

        /// Find an open XDocument object by its unique handle
        STATIC METHOD GetDocument (nHandle AS INT64) AS XDocument
            FOREACH VAR doc IN aDocuments
                IF doc:DocHandle == nHandle
                    RETURN doc
                ENDIF
            NEXT
            RETURN NULL

        /// Allocate new XDocument handle
        STATIC METHOD NewHandle() AS INT64
            BEGIN LOCK gate
                RETURN nextHandle++
            END LOCK

        /// Find error by ID
        STATIC METHOD FindError(nError AS INT64) AS XError
            RETURN aErrors:Where( {x => x:Id == nError}):FirstOrDefault()

         /// Get list of all errors
        STATIC METHOD GetErrors() AS IEnumerable<XError>
            RETURN aErrors

        /// Get error for a specific document
        STATIC METHOD GetErrorsForDocument(nDocHandle AS INT64) AS IEnumerable<XError>
            RETURN aErrors:Where ( { x=> x:DocHandle == nDocHandle })

       /// Get ID for the parent of an XML node
       STATIC METHOD FindParent(nId AS INT64) AS INT64
            LOCAL oNode AS XmlNode
            LOCAL oDoc  AS XDocument
            oNode := FindNode(nId, OUT oDoc)
            IF oNode != NULL
                oNode := oNode:ParentNode
                IF oDoc:Nodes:ContainsKey(oNode)
                    RETURN oDoc:Nodes[oNode]
                ENDIF
            ENDIF
            RETURN 0

       /// Get XML node and document by ID
        STATIC PRIVATE METHOD FindNode(nID AS INT64, oDocResult OUT XDocument) AS XmlNode
            LOCAL oFoundNode := NULL AS XmlNode
            oDocResult := NULL
            BEGIN LOCK gate
                FOREACH oDoc AS XDocument IN aDocuments
                    IF oDoc:NodeIds:ContainsKey(nID)
                        oFoundNode := oDoc:NodeIds[nID]
                        oDocResult := oDoc
                        RETURN oFoundNode
                    ENDIF
                NEXT
            END LOCK
            RETURN NULL

        /// Get a list of the tags in an XML Node
        STATIC METHOD FindTag(nId AS INT64) AS ARRAY
            LOCAL oNode AS XmlNode
            oNode := FindNode(nId, OUT VAR oDoc)
            IF oNode != NULL
                RETURN AsXmlArray(oNode, oDoc)
            ENDIF
            RETURN NULL_ARRAY

        /// Find a child tag in an XML Node
        STATIC METHOD FindChildTag(nId AS INT64, cChildName AS STRING, lFirst AS LOGIC) AS USUAL
            IF lFirst
                RETURN FindFirstChildTag(nId, cChildName)
            ELSE
                RETURN FindAllChildTags(nId, cChildName)
            ENDIF

        /// Find a child tag in an XML Node
        STATIC METHOD FindFirstChildTag(nId AS INT64, cChildName AS STRING) AS INT64
            LOCAL oNode AS XmlNode
            oNode := FindNode(nId, OUT VAR oDoc)
            IF oNode != NULL
                LOCAL aResult := {} AS ARRAY
                FOREACH oChild AS XmlNode IN oNode:ChildNodes
                    IF String.Compare(oChild:Name, cChildName, TRUE) == 0
                        IF oDoc:Nodes:ContainsKey(oChild)
                            RETURN oDoc:Nodes[oChild]
                        ENDIF
                    ENDIF
                NEXT
            ENDIF
            // When not found we return -1
            RETURN -1

        STATIC METHOD FindAllChildTags(nId AS INT64, cChildName AS STRING) AS ARRAY
            LOCAL oNode AS XmlNode
            // When lFirst = TRUE then  return the id of that node or -1
            // When lFirst = FALSE then return an array of nodes
            oNode := FindNode(nId, OUT VAR oDoc)
            IF oNode != NULL
                LOCAL aResult := {} AS ARRAY
                FOREACH oChild AS XmlNode IN oNode:ChildNodes
                    IF String.Compare(oChild:Name, cChildName, TRUE) == 0
                        IF oDoc:Nodes:ContainsKey(oChild)
                            AAdd(aResult, oDoc:Nodes[oChild])
                        ENDIF
                    ENDIF
                NEXT
                IF ALen(aResult) > 0
                    RETURN aResult
                ENDIF
            ENDIF
            RETURN NULL_ARRAY
    /// Return the children of a node as a XPP specific XML array

        STATIC METHOD AsXmlArray(oNode AS XmlNode, oFoundDoc AS XDocument) AS ARRAY
            LOCAL aResult AS ARRAY
            LOCAL aChildren AS ARRAY
            LOCAL aAttributes AS ARRAY
            aChildren := {}
            IF oNode:HasChildNodes
                FOREACH oChild AS XmlNode IN oNode:ChildNodes
                    IF oFoundDoc:Nodes:ContainsKey(oChild)
                        AAdd(aChildren,oFoundDoc:Nodes[oChild])
                    ENDIF
                NEXT
            ENDIF
            aAttributes := {}
            IF oNode:Attributes != NULL
                FOREACH oAttr AS XmlAttribute IN oNode:Attributes
                    AAdd(aAttributes , {oAttr:Name, oAttr:Value, oAttr})
                NEXT
            ENDIF
            aResult := ArrayNew(XMLTAG_N_MEMBER)
            aResult [XMLTAG_NAME   ] := oNode:Name
            aResult [XMLTAG_CONTENT] := oNode:InnerXml
            aResult [XMLTAG_CHILD  ] := IIF(ALen(aChildren) == 0, NIL, aChildren)
            aResult [XMLTAG_ACTION ] := NIL
            aResult [XMLTAG_ATTRIB ] := IIF(ALen(aAttributes) == 0, NIL, aAttributes)
            aResult [XMLTAG_OBJECT ] := oNode
            RETURN aResult

        ///
       STATIC METHOD RegisterError(nError AS USUAL) AS VOID
            RETURN

         /// Close all open document
       STATIC METHOD CloseAllDocuments() AS LOGIC
            Initialize()
            RETURN TRUE

         /// Clear all errors
       STATIC METHOD ClearAllErrors() AS LOGIC
            aErrors:Clear()
            RETURN TRUE

#endregion
        /// Unique handle for the document.
        INTERNAL  PROPERTY DocHandle AS INT64 AUTO
        INTERNAL PROPERTY Nodes     AS Dictionary<XmlNode, INT64> AUTO
        INTERNAL PROPERTY NodeIds   AS Dictionary<INT64, XmlNode> AUTO
        INTERNAL PROPERTY RootId    AS INT64 AUTO
        INTERNAL PROPERTY LastError AS INT64 AUTO
        PROTECT  oDoc 	   AS XmlDocument
        PROTECT  cFileName AS STRING
        PROTECT  Actions   AS List<XAction>
        CONSTRUCTOR
            NodeIds    := Dictionary<INT64, XmlNode>{}
            Nodes      := Dictionary<XmlNode, INT64>{}
            Actions    := List<XAction>{}
            DocHandle  := 0
            LastError  := 0
            RETURN

        PRIVATE METHOD AddError(e AS Exception) AS INT64
            LOCAL oError        := XError{cFileName, XMLDOC_ERROR_PROCESS} AS XError
            oError:Additional   := e:Message
            oError:DocHandle    := SELF:DocHandle
            VAR id              := NewHandle()
            aErrors:Add( oError)
            RETURN id

        PRIVATE METHOD AddOpenError(e AS XmlException) AS INT64
            LOCAL oError    := XError{cFileName, XMLDOC_ERROR_INVALID_XML} AS XError
            oError:Line     := e:LineNumber
            oError:Column   := e:LinePosition
            oError:Additional := e:Message
            oError:DocHandle := SELF:DocHandle
            IF e:Message:ToLower():Contains("does not match")
                oError:Id := XMLDOC_ERROR_ENDTAG_MISSING
            ENDIF
            aErrors:Add(oError)
            RETURN oError:Handle

        PRIVATE METHOD AddOpenError(oError AS XError) AS INT64
            aErrors:Add(oError)
            RETURN oError:Handle

        PRIVATE METHOD ClearError() AS VOID
            LastError  := 0

        PRIVATE METHOD Read(oReader AS System.IO.TextReader) AS LOGIC
            LOCAL lOk := FALSE AS LOGIC
            TRY
                oDoc := XmlDocument{}
                oDoc:Load(oReader)
                DocHandle := NewHandle()
                BEGIN LOCK gate
                    aDocuments:Add(SELF)
                END LOCK
                lOk := TRUE
            CATCH e AS XmlException
                LastError := AddOpenError(e)
            CATCH e AS Exception
                LastError := AddError(e)
                BEGIN LOCK gate
                    IF aDocuments:Contains(SELF)
                        aDocuments:Remove(SELF)
                    ENDIF
                END LOCK
                lOk := FALSE
            END TRY
            RETURN lOk

         /// Open an XML File
        METHOD OpenFile(cFile AS STRING) AS LOGIC
            LOCAL lOk := FALSE AS LOGIC
            SELF:ClearError()
            SELF:cFileName := cFile
            IF String.IsNullOrEmpty(cFile)
                LastError := AddOpenError(XError{cFile, XMLDOC_ERROR_NO_FILENAME})
                RETURN FALSE
            ENDIF
            IF !System.IO.File.Exists(cFile)
                LastError := AddOpenError(XError{cFile, XMLDOC_ERROR_FILE_NOT_FOUND})
                RETURN FALSE
            ENDIF
            TRY
                BEGIN USING VAR oReader := System.IO.StreamReader{cFile,TRUE}
                    lOk := SELF:Read(oReader)
                    oReader:Close()
                END USING
                SELF:Process()
            CATCH e AS Exception
                LastError := AddError(e)
                lOk := FALSE
            END TRY
            RETURN lOk

        /// Open a XML document from a string
        METHOD OpenText(cContents AS STRING) AS LOGIC
            LOCAL lOk := FALSE AS LOGIC
            SELF:ClearError()
            TRY
                BEGIN USING VAR oReader := System.IO.StringReader{cContents}
                    lOk := SELF:Read(oReader)
                    oReader:Close()
                END USING
                SELF:Process()
            CATCH
                lOk := FALSE
            END TRY
            RETURN lOk

        /// CLose an opened XML document

        METHOD Close() AS LOGIC
            LOCAL lOk := FALSE AS LOGIC
            IF aDocuments:Contains(SELF)
                aDocuments:Remove(SELF)
                lOk := TRUE
            ENDIF
            RETURN lOk

        /// Process an opened XML document
        METHOD Process() AS VOID
            TRY
                SELF:NodeIds:Clear()
                SELF:Nodes:Clear()
                SELF:WalkNode(oDoc)
                VAR root := oDoc:DocumentElement
                SELF:RootId := Nodes[root]
            CATCH e AS XmlException
                LastError := AddOpenError(e)
            CATCH e AS Exception
                LastError := AddError(e)
            END TRY
            RETURN

        /// Loop through all the actions and process each node that matches the actions
        METHOD ProcessNodes() AS LOGIC
            LOCAL lOk := FALSE AS LOGIC
            TRY
                LOCAL root := oDoc:DocumentElement AS XmlNode
                FOREACH VAR action IN Actions
                    VAR nodes := root:SelectNodes(action:Name)
                    IF nodes:Count >0
                        FOREACH node AS XmlNode IN nodes
                            lOk := SELF:PerformActions(node, action)
                            IF ! lOk
                                RETURN FALSE
                            ENDIF
                        NEXT
                    ENDIF
                NEXT
                lOk := TRUE
            CATCH e AS XmlException
                LastError := AddOpenError(e)
                lOk := FALSE
            CATCH e AS Exception
                LastError := AddError(e)
                lOk := FALSE
            END TRY
            RETURN lOk

        /// Select Nodes via XPath selection
        METHOD SelectNodes(cSelect AS STRING) AS ARRAY
            LOCAL aResult AS ARRAY
            TRY
                LOCAL root := oDoc:DocumentElement AS XmlNode
                VAR nodes := root:SelectNodes(cSelect)
                aResult := {}
                IF nodes:Count >0
                    FOREACH node AS XmlNode IN nodes
                        AAdd(aResult, SELF:Nodes[node])
                    NEXT
                ENDIF
            CATCH
                RETURN NULL_ARRAY
            END TRY
            RETURN aResult

        /// Perform actions on an XML node.
        METHOD PerformActions(oNode AS XmlNode, oAction AS XAction) AS LOGIC
            LOCAL bBlock        AS CODEBLOCK
            LOCAL nTag          AS INT64
            LOCAL aAttributes   := NIL AS USUAL
            LOCAL nResult       AS USUAL
            LOCAL oWork         AS XmlNode
            LOCAL sb            AS StringBuilder
            bBlock := oAction:Block
            nTag   := SELF:Nodes[oNode]
            sb     := StringBuilder{oNode:Name}
            oWork  := oNode:ParentNode
            DO WHILE oWork != NULL .AND. ! oWork IS XmlDocument
                sb:Insert(0,oWork:Name+"/")
                oWork := oWork:ParentNode
            ENDDO
            sb:Insert(0, "/")
            IF oNode:Attributes != NULL
                aAttributes := {}
                FOREACH oAttr AS XmlAttribute IN oNode:Attributes
                    AAdd(aAttributes , {oAttr:Name, oAttr:Value})
                NEXT
            ENDIF
            nResult := Eval(bBlock, sb:ToString(), oNode:InnerXml, aAttributes, nTag)
            IF IsLong(nResult)
                IF nResult == XML_PROCESS_ABORT
                    RETURN FALSE
                ENDIF
            ELSE
                RETURN FALSE
            ENDIF
            RETURN TRUE

        /// Walk all nodes and add them to the collections on the document class
        METHOD WalkNode(oNode AS XmlNode) AS VOID
            LOCAL nID AS INT64
            IF !SELF:Nodes:ContainsKey(oNode)
                nID := NewHandle()
                Nodes:Add(oNode, nID)
                NodeIds:Add(nID, oNode)
            ENDIF
	        FOREACH oChild AS XmlNode IN oNode:ChildNodes
		        SELF:WalkNode(oChild)
	        NEXT
	        RETURN

        /// Clear all actions on a document
        METHOD ClearActions() AS VOID
            SELF:Actions:Clear()
            RETURN

        /// Set an action on a XML node
        METHOD SetAction(cNode AS STRING, bAction AS CODEBLOCK) AS LONG
            SELF:Actions:Add(XAction{cNode, bAction})
            LOCAL root := oDoc:DocumentElement AS XmlNode
            VAR nodes := root:SelectNodes(cNode)
            RETURN nodes:Count

	END CLASS

    /// Helper class that stores errors for an XML document
    CLASS XError
        /// Filename where the error occurred.
        PROPERTY FileName AS STRING AUTO
        /// Linenumber where the error occurred.
        PROPERTY Line     AS LONG AUTO
        /// Column where the error occurred.
        PROPERTY Column   AS LONG AUTO
        /// Id for the node where the error occurred.
        PROPERTY Id       AS INT64 AUTO
        /// Additional info about the error.
        PROPERTY Additional AS USUAL AUTO
        /// Document Handle for which the error occurred.
        PROPERTY DocHandle AS INT64 AUTO
        /// Error Handle.
        PROPERTY Handle    AS INT64 AUTO
        CONSTRUCTOR(cFile AS STRING, nId AS INT64)
            SELF:FileName := cFile
            SELF:Id       := nId
            SELF:Additional := ""
            SELF:Handle := XDocument.NewHandle()
        /// Convert error object to XBase++ compatible error array.
        METHOD ToArray() AS ARRAY
            VAR aResult := ArrayNew(XML_ERROR_ADDINFO)
            aResult[XML_ERROR_ID]       := SELF:Id
            aResult[XML_ERROR_FILE]     := SELF:FileName
            aResult[XML_ERROR_LINE]     := SELF:Line
            aResult[XML_ERROR_COLUMN]   := SELF:Column
            aResult[XML_ERROR_ADDINFO]  := SELF:Additional
            RETURN aResult

    END CLASS

    /// Helper class that stores actions (codeblocks) for XML nodes
    CLASS XAction
        /// XML node name for which the action runs.
        PROPERTY Name AS STRING AUTO
        /// Codeblock to run for the action
        PROPERTY Block AS CODEBLOCK AUTO
        CONSTRUCTOR(cName AS STRING, oBlock AS CODEBLOCK)
            Name := cName
            Block := oBlock
            RETURN
    END CLASS

END NAMESPACE // XML


QtMacExtras: data for code generation updated

Modified:
codegen/QtMacExtras/QMacPasteboardMime.prg

$header

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QVARIANT
REQUEST QBYTEARRAY
#endif

CLASS QMacPasteboardMime

   DATA pointer
   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete
   METHOD convertorName
   METHOD canConvert
   METHOD mimeFor
   METHOD flavorFor
   METHOD convertToMime
   METHOD convertFromMime
   METHOD count

   METHOD newFrom
   METHOD newFromObject
   METHOD newFromPointer
   METHOD selfDestruction
   METHOD setSelfDestruction

   DESTRUCTOR destroyObject

END CLASS

$destructor

#pragma BEGINDUMP

$includes=5,2,0

/*
QMacPasteboardMime(char)
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEW )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  char par1 = ISCHAR(1)? (char) hb_parc(1)[0] : (ISNUM(1)? hb_parni(1) : 0);
  QMacPasteboardMime * o = new QMacPasteboardMime ( par1 );
  _qt5xhb_storePointerAndFlag( o, false );
#endif
}

$deleteMethod=5,2,0

/*
virtual QString convertorName() = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTORNAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    RQSTRING( obj->convertorName () );
  }
#endif
}

/*
virtual bool canConvert(const QString &mime, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CANCONVERT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    RBOOL( obj->canConvert ( PQSTRING(1), PQSTRING(2) ) );
  }
#endif
}

/*
virtual QString mimeFor(QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_MIMEFOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    RQSTRING( obj->mimeFor ( PQSTRING(1) ) );
  }
#endif
}

/*
virtual QString flavorFor(const QString &mime) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_FLAVORFOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    RQSTRING( obj->flavorFor ( PQSTRING(1) ) );
  }
#endif
}

/*
virtual QVariant convertToMime(const QString &mime, QList<QByteArray> data, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTTOMIME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QList<QByteArray> par2;
    PHB_ITEM aList2 = hb_param(2, HB_IT_ARRAY);
    int i2;
    int nLen2 = hb_arrayLen(aList2);
    for (i2=0;i2<nLen2;i2++)
    {
      par2 << *(QByteArray *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList2, i2+1 ), "POINTER", 0 ) );
    }
    QVariant * ptr = new QVariant( obj->convertToMime ( PQSTRING(1), par2, PQSTRING(3) ) );
    _qt5xhb_createReturnClass ( ptr, "QVARIANT", true );
  }
#endif
}

/*
virtual QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTFROMMIME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QList<QByteArray> list = obj->convertFromMime ( PQSTRING(1), *PQVARIANT(2), PQSTRING(3) );
    PHB_DYNS pDynSym;
    #ifdef __XHARBOUR__
    pDynSym = hb_dynsymFind( "QBYTEARRAY" );
    #else
    pDynSym = hb_dynsymFindName( "QBYTEARRAY" );
    #endif
    PHB_ITEM pArray;
    pArray = hb_itemArrayNew(0);
    int i;
    for(i=0;i<list.count();i++)
    {
      if( pDynSym )
      {
        #ifdef __XHARBOUR__
        hb_vmPushSymbol( pDynSym->pSymbol );
        #else
        hb_vmPushDynSym( pDynSym );
        #endif
        hb_vmPushNil();
        hb_vmDo( 0 );
        PHB_ITEM pObject = hb_itemNew( NULL );
        hb_itemCopy( pObject, hb_stackReturnItem() );
        PHB_ITEM pItem = hb_itemNew( NULL );
        hb_itemPutPtr( pItem, (QByteArray *) new QByteArray ( list[i] ) );
        hb_objSendMsg( pObject, "_POINTER", 1, pItem );
        hb_itemRelease( pItem );
        hb_arrayAddForward( pArray, pObject );
        hb_itemRelease( pObject );
      }
    }
    hb_itemReturnRelease(pArray);
  }
#endif
}

/*
virtual int count(QMimeData *mimeData)
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_COUNT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QMimeData * par1 = (QMimeData *) _qt5xhb_itemGetPtr(1);
    RINT( obj->count ( par1 ) );
  }
#endif
}

$extraMethods

#pragma ENDDUMP

/*

  Qt5xHb - bibliotecas de ligao entre Harbour/xHarbour e Qt Framework 5

  Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>

*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QVARIANT
REQUEST QBYTEARRAY
#endif

CLASS QMacPasteboardMime

   DATA pointer
   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete
   METHOD convertorName
   METHOD canConvert
   METHOD mimeFor
   METHOD flavorFor
   METHOD convertToMime
   METHOD convertFromMime
   METHOD count

   METHOD newFrom
   METHOD newFromObject
   METHOD newFromPointer
   METHOD selfDestruction
   METHOD setSelfDestruction

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QMacPasteboardMime
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <Qt>

#ifndef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
#include <QMacPasteboardMime>
#endif
#endif

#include "qt5xhb_common.h"
#include "qt5xhb_macros.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
#include <QMacPasteboardMime>
#endif
#endif

/*
QMacPasteboardMime(char)
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEW )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  char par1 = ISCHAR(1)? (char) hb_parc(1)[0] : (ISNUM(1)? hb_parni(1) : 0);
  QMacPasteboardMime * o = new QMacPasteboardMime ( par1 );
  _qt5xhb_storePointerAndFlag( o, false );
#endif
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_DELETE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
virtual QString convertorName() = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTORNAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    RQSTRING( obj->convertorName () );
  }
#endif
}

/*
virtual bool canConvert(const QString &mime, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CANCONVERT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    RBOOL( obj->canConvert ( PQSTRING(1), PQSTRING(2) ) );
  }
#endif
}

/*
virtual QString mimeFor(QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_MIMEFOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    RQSTRING( obj->mimeFor ( PQSTRING(1) ) );
  }
#endif
}

/*
virtual QString flavorFor(const QString &mime) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_FLAVORFOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    RQSTRING( obj->flavorFor ( PQSTRING(1) ) );
  }
#endif
}

/*
virtual QVariant convertToMime(const QString &mime, QList<QByteArray> data, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTTOMIME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QList<QByteArray> par2;
    PHB_ITEM aList2 = hb_param(2, HB_IT_ARRAY);
    int i2;
    int nLen2 = hb_arrayLen(aList2);
    for (i2=0;i2<nLen2;i2++)
    {
      par2 << *(QByteArray *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList2, i2+1 ), "POINTER", 0 ) );
    }
    QVariant * ptr = new QVariant( obj->convertToMime ( PQSTRING(1), par2, PQSTRING(3) ) );
    _qt5xhb_createReturnClass ( ptr, "QVARIANT", true );
  }
#endif
}

/*
virtual QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTFROMMIME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QList<QByteArray> list = obj->convertFromMime ( PQSTRING(1), *PQVARIANT(2), PQSTRING(3) );
    PHB_DYNS pDynSym;
    #ifdef __XHARBOUR__
    pDynSym = hb_dynsymFind( "QBYTEARRAY" );
    #else
    pDynSym = hb_dynsymFindName( "QBYTEARRAY" );
    #endif
    PHB_ITEM pArray;
    pArray = hb_itemArrayNew(0);
    int i;
    for(i=0;i<list.count();i++)
    {
      if( pDynSym )
      {
        #ifdef __XHARBOUR__
        hb_vmPushSymbol( pDynSym->pSymbol );
        #else
        hb_vmPushDynSym( pDynSym );
        #endif
        hb_vmPushNil();
        hb_vmDo( 0 );
        PHB_ITEM pObject = hb_itemNew( NULL );
        hb_itemCopy( pObject, hb_stackReturnItem() );
        PHB_ITEM pItem = hb_itemNew( NULL );
        hb_itemPutPtr( pItem, (QByteArray *) new QByteArray ( list[i] ) );
        hb_objSendMsg( pObject, "_POINTER", 1, pItem );
        hb_itemRelease( pItem );
        hb_arrayAddForward( pArray, pObject );
        hb_itemRelease( pObject );
      }
    }
    hb_itemReturnRelease(pArray);
  }
#endif
}

/*
virtual int count(QMimeData *mimeData)
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_COUNT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QMimeData * par1 = (QMimeData *) _qt5xhb_itemGetPtr(1);
    RINT( obj->count ( par1 ) );
  }
#endif
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEWFROM )
{
  PHB_ITEM self = hb_stackSelfItem();
  if( hb_pcount() == 1 && ISOBJECT(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else if( hb_pcount() == 1 && ISPOINTER(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  hb_itemReturn( self );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEWFROMOBJECT )
{
  HB_FUNC_EXEC( QMACPASTEBOARDMIME_NEWFROM );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEWFROMPOINTER )
{
  HB_FUNC_EXEC( QMACPASTEBOARDMIME_NEWFROM );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_SELFDESTRUCTION )
{
  hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_SETSELFDESTRUCTION )
{
  PHB_ITEM self = hb_stackSelfItem();
  if( hb_pcount() == 1 && ISLOG(1) )
  {
    PHB_ITEM des = hb_itemPutL( NULL, hb_parl(1) );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  hb_itemReturn( self );
}

#pragma ENDDUMP


QtScript: data for code generation updated

Modified:
codegen/QtScript/QScriptEngine.prg

%%
%% Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5
%%
%% Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$header

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QSCRIPTENGINEAGENT
REQUEST QSCRIPTCONTEXT
REQUEST QSCRIPTVALUE
REQUEST QSCRIPTSTRING
REQUEST QSCRIPTSYNTAXCHECKRESULT
#endif

CLASS QScriptEngine INHERIT QObject

   METHOD new
   METHOD delete
   METHOD abortEvaluation
   METHOD agent
   METHOD availableExtensions
   METHOD clearExceptions
   METHOD collectGarbage
   METHOD currentContext
   METHOD defaultPrototype
   METHOD evaluate
   METHOD globalObject
   METHOD hasUncaughtException
   METHOD importExtension
   METHOD importedExtensions
   METHOD installTranslatorFunctions
   METHOD isEvaluating
   METHOD newArray
   METHOD newDate
   METHOD newObject
   METHOD newQMetaObject
   METHOD newQObject
   METHOD newRegExp
   METHOD newVariant
   METHOD nullValue
   METHOD popContext
   METHOD processEventsInterval
   METHOD pushContext
   METHOD reportAdditionalMemoryCost
   METHOD setAgent
   METHOD setDefaultPrototype
   METHOD setGlobalObject
   METHOD setProcessEventsInterval
   METHOD toObject
   METHOD toStringHandle
   METHOD uncaughtException
   METHOD uncaughtExceptionBacktrace
   METHOD uncaughtExceptionLineNumber
   METHOD undefinedValue
   METHOD checkSyntax

   METHOD onSignalHandlerException

   DESTRUCTOR destroyObject

END CLASS

$destructor

#pragma BEGINDUMP

$includes

#include <QStringList>

$prototype=QScriptEngine()
$internalConstructor=|new1|

$prototype=QScriptEngine(QObject * parent)
$internalConstructor=|new2|QObject *

//[1]QScriptEngine()
//[2]QScriptEngine(QObject * parent)

HB_FUNC_STATIC( QSCRIPTENGINE_NEW )
{
  if( ISNUMPAR(0) )
  {
    QScriptEngine_new1();
  }
  else if( ISNUMPAR(1) && ISQOBJECT(1) )
  {
    QScriptEngine_new2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$deleteMethod

$prototype=void abortEvaluation(const QScriptValue & result = QScriptValue())
$method=|void|abortEvaluation|const QScriptValue &=QScriptValue()

$prototype=QScriptEngineAgent * agent() const
$method=|QScriptEngineAgent *|agent|

$prototype=QStringList availableExtensions() const
$method=|QStringList|availableExtensions|

$prototype=void clearExceptions()
$method=|void|clearExceptions|

$prototype=void collectGarbage()
$method=|void|collectGarbage|

$prototype=QScriptContext * currentContext() const
$method=|QScriptContext *|currentContext|

$prototype=QScriptValue defaultPrototype(int metaTypeId) const
$method=|QScriptValue|defaultPrototype|int

$prototype=QScriptValue evaluate(const QString & program, const QString & fileName = QString(), int lineNumber = 1)
$internalMethod=|QScriptValue|evaluate,evaluate1|const QString &,const QString &=QString(),int=1

$prototype=QScriptValue evaluate(const QScriptProgram & program)
$internalMethod=|QScriptValue|evaluate,evaluate2|const QScriptProgram &

//[1]QScriptValue evaluate(const QString & program, const QString & fileName = QString(), int lineNumber = 1)
//[2]QScriptValue evaluate(const QScriptProgram & program)

HB_FUNC_STATIC( QSCRIPTENGINE_EVALUATE )
{
  if( ISBETWEEN(1,3) && ISCHAR(1) && ISOPTCHAR(2) && ISOPTNUM(3) )
  {
    QScriptEngine_evaluate1();
  }
  else if( ISNUMPAR(1) && ISQSCRIPTPROGRAM(1) )
  {
    QScriptEngine_evaluate2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue globalObject() const
$method=|QScriptValue|globalObject|

$prototype=bool hasUncaughtException() const
$method=|bool|hasUncaughtException|

$prototype=QScriptValue importExtension(const QString & extension)
$method=|QScriptValue|importExtension|const QString &

$prototype=QStringList importedExtensions() const
$method=|QStringList|importedExtensions|

$prototype=void installTranslatorFunctions(const QScriptValue & object = QScriptValue())
$method=|void|installTranslatorFunctions|const QScriptValue &=QScriptValue()

$prototype=bool isEvaluating() const
$method=|bool|isEvaluating|

$prototype=QScriptValue newArray(uint length = 0)
$method=|QScriptValue|newArray|uint=0

$prototype=QScriptValue newDate(const QDateTime & value)
$method=|QScriptValue|newDate|const QDateTime &

$prototype=QScriptValue newObject()
$internalMethod=|QScriptValue|newObject,newObject1|

$prototype=QScriptValue newObject(QScriptClass * scriptClass, const QScriptValue & data = QScriptValue())
$internalMethod=|QScriptValue|newObject,newObject2|QScriptClass *,const QScriptValue &=QScriptValue()

//[1]QScriptValue newObject()
//[2]QScriptValue newObject(QScriptClass * scriptClass, const QScriptValue & data = QScriptValue())

HB_FUNC_STATIC( QSCRIPTENGINE_NEWOBJECT )
{
  if( ISNUMPAR(0) )
  {
    QScriptEngine_newObject1();
  }
  else if( ISBETWEEN(1,2) && ISQSCRIPTCLASS(1) && (ISQSCRIPTVALUE(2)||ISNIL(2))  )
  {
    QScriptEngine_newObject2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue newQMetaObject(const QMetaObject * metaObject, const QScriptValue & ctor = QScriptValue())
$method=|QScriptValue|newQMetaObject|const QMetaObject *,const QScriptValue &=QScriptValue()

$prototype=QScriptValue newQObject(QObject * object, ValueOwnership ownership = QtOwnership, const QObjectWrapOptions & options = 0)
%% TODO: revisar
$internalMethod=|QScriptValue|newQObject,newQObject1|QObject *,QScriptEngine::ValueOwnership=QScriptEngine::QtOwnership,QScriptEngine::QObjectWrapOptions=0

$prototype=QScriptValue newQObject(const QScriptValue & scriptObject, QObject * qtObject, ValueOwnership ownership = QtOwnership, const QObjectWrapOptions & options = 0)
%% TODO: revisar
$internalMethod=|QScriptValue|newQObject,newQObject2|const QScriptValue &,QObject *,QScriptEngine::ValueOwnership=QScriptEngine::QtOwnership,QScriptEngine::QObjectWrapOptions=0

//[1]QScriptValue newQObject(QObject * object, ValueOwnership ownership = QtOwnership, const QObjectWrapOptions & options = 0)
//[2]QScriptValue newQObject(const QScriptValue & scriptObject, QObject * qtObject, ValueOwnership ownership = QtOwnership, const QObjectWrapOptions & options = 0)

HB_FUNC_STATIC( QSCRIPTENGINE_NEWQOBJECT )
{
  if( ISBETWEEN(1,3) && ISQOBJECT(1) && ISOPTNUM(2) && (ISNUM(3)||ISNIL(3)) )
  {
    QScriptEngine_newQObject1();
  }
  else if( ISBETWEEN(2,4) && ISQSCRIPTVALUE(1) && ISQOBJECT(2) && ISOPTNUM(3) && (ISNUM(4)||ISNIL(4)) )
  {
    QScriptEngine_newQObject2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue newRegExp(const QRegExp & regexp)
$internalMethod=|QScriptValue|newRegExp,newRegExp1|const QRegExp &

$prototype=QScriptValue newRegExp(const QString & pattern, const QString & flags)
$internalMethod=|QScriptValue|newRegExp,newRegExp2|const QString &,const QString &

//[1]QScriptValue newRegExp(const QRegExp & regexp)
//[2]QScriptValue newRegExp(const QString & pattern, const QString & flags)

HB_FUNC_STATIC( QSCRIPTENGINE_NEWREGEXP )
{
  if( ISNUMPAR(1) && ISQREGEXP(1) )
  {
    QScriptEngine_newRegExp1();
  }
  else if( ISNUMPAR(2) && ISCHAR(1) && ISCHAR(2) )
  {
    QScriptEngine_newRegExp2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue newVariant(const QVariant & value)
$internalMethod=|QScriptValue|newVariant,newVariant1|const QVariant &

$prototype=QScriptValue newVariant(const QScriptValue & object, const QVariant & value)
$internalMethod=|QScriptValue|newVariant,newVariant2|const QScriptValue &,const QVariant &

//[1]QScriptValue newVariant(const QVariant & value)
//[2]QScriptValue newVariant(const QScriptValue & object, const QVariant & value)

HB_FUNC_STATIC( QSCRIPTENGINE_NEWVARIANT )
{
  if( ISNUMPAR(1) && ISQVARIANT(1) )
  {
    QScriptEngine_newVariant1();
  }
  else if( ISNUMPAR(2) && ISQSCRIPTVALUE(1) && ISQVARIANT(2) )
  {
    QScriptEngine_newVariant2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue nullValue()
$method=|QScriptValue|nullValue|

$prototype=void popContext()
$method=|void|popContext|

$prototype=int processEventsInterval() const
$method=|int|processEventsInterval|

$prototype=QScriptContext * pushContext()
$method=|QScriptContext *|pushContext|

$prototype=void reportAdditionalMemoryCost(int size)
$method=|void|reportAdditionalMemoryCost|int

$prototype=void setAgent(QScriptEngineAgent * agent)
$method=|void|setAgent|QScriptEngineAgent *

$prototype=void setDefaultPrototype(int metaTypeId, const QScriptValue & prototype)
$method=|void|setDefaultPrototype|int,const QScriptValue &

$prototype=void setGlobalObject(const QScriptValue & object)
$method=|void|setGlobalObject|const QScriptValue &

$prototype=void setProcessEventsInterval(int interval)
$method=|void|setProcessEventsInterval|int

$prototype=QScriptValue toObject(const QScriptValue & value)
$method=|QScriptValue|toObject|const QScriptValue &

$prototype=QScriptString toStringHandle(const QString & str)
$method=|QScriptString|toStringHandle|const QString &

$prototype=QScriptValue uncaughtException() const
$method=|QScriptValue|uncaughtException|

$prototype=QStringList uncaughtExceptionBacktrace() const
$method=|QStringList|uncaughtExceptionBacktrace|

$prototype=int uncaughtExceptionLineNumber() const
$method=|int|uncaughtExceptionLineNumber|

$prototype=QScriptValue undefinedValue()
$method=|QScriptValue|undefinedValue|

$prototype=static QScriptSyntaxCheckResult checkSyntax(const QString & program)
$staticMethod=|QScriptSyntaxCheckResult|checkSyntax|const QString &

$beginSignals
$signalMethod=|signalHandlerException(QScriptValue)
$endSignals

#pragma ENDDUMP

%%
%% Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5
%%
%% Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$header

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QSCRIPTENGINEAGENT
REQUEST QSCRIPTCONTEXT
REQUEST QSCRIPTVALUE
REQUEST QSCRIPTSTRING
REQUEST QSCRIPTSYNTAXCHECKRESULT
#endif

CLASS QScriptEngine INHERIT QObject

   METHOD new
   METHOD delete
   METHOD abortEvaluation
   METHOD agent
   METHOD availableExtensions
   METHOD clearExceptions
   METHOD collectGarbage
   METHOD currentContext
   METHOD defaultPrototype
   METHOD evaluate
   METHOD globalObject
   METHOD hasUncaughtException
   METHOD importExtension
   METHOD importedExtensions
   METHOD installTranslatorFunctions
   METHOD isEvaluating
   METHOD newArray
   METHOD newDate
   METHOD newObject
   METHOD newQMetaObject
   METHOD newQObject
   METHOD newRegExp
   METHOD newVariant
   METHOD nullValue
   METHOD popContext
   METHOD processEventsInterval
   METHOD pushContext
   METHOD reportAdditionalMemoryCost
   METHOD setAgent
   METHOD setDefaultPrototype
   METHOD setGlobalObject
   METHOD setProcessEventsInterval
   METHOD toObject
   METHOD toStringHandle
   METHOD uncaughtException
   METHOD uncaughtExceptionBacktrace
   METHOD uncaughtExceptionLineNumber
   METHOD undefinedValue
   METHOD checkSyntax

   METHOD onSignalHandlerException

   DESTRUCTOR destroyObject

END CLASS

$destructor

#pragma BEGINDUMP

$includes

#include <QStringList>

$prototype=QScriptEngine()
$internalConstructor=|new1|

$prototype=QScriptEngine(QObject * parent)
$internalConstructor=|new2|QObject *

//[1]QScriptEngine()
//[2]QScriptEngine(QObject * parent)

HB_FUNC_STATIC( QSCRIPTENGINE_NEW )
{
  if( ISNUMPAR(0) )
  {
    QScriptEngine_new1();
  }
  else if( ISNUMPAR(1) && ISQOBJECT(1) )
  {
    QScriptEngine_new2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$deleteMethod

$prototype=void abortEvaluation(const QScriptValue & result = QScriptValue())
$method=|void|abortEvaluation|const QScriptValue &=QScriptValue()

$prototype=QScriptEngineAgent * agent() const
$method=|QScriptEngineAgent *|agent|

$prototype=QStringList availableExtensions() const
$method=|QStringList|availableExtensions|

$prototype=void clearExceptions()
$method=|void|clearExceptions|

$prototype=void collectGarbage()
$method=|void|collectGarbage|

$prototype=QScriptContext * currentContext() const
$method=|QScriptContext *|currentContext|

$prototype=QScriptValue defaultPrototype(int metaTypeId) const
$method=|QScriptValue|defaultPrototype|int

$prototype=QScriptValue evaluate(const QString & program, const QString & fileName = QString(), int lineNumber = 1)
$internalMethod=|QScriptValue|evaluate,evaluate1|const QString &,const QString &=QString(),int=1

$prototype=QScriptValue evaluate(const QScriptProgram & program)
$internalMethod=|QScriptValue|evaluate,evaluate2|const QScriptProgram &

//[1]QScriptValue evaluate(const QString & program, const QString & fileName = QString(), int lineNumber = 1)
//[2]QScriptValue evaluate(const QScriptProgram & program)

HB_FUNC_STATIC( QSCRIPTENGINE_EVALUATE )
{
  if( ISBETWEEN(1,3) && ISCHAR(1) && ISOPTCHAR(2) && ISOPTNUM(3) )
  {
    QScriptEngine_evaluate1();
  }
  else if( ISNUMPAR(1) && ISQSCRIPTPROGRAM(1) )
  {
    QScriptEngine_evaluate2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue globalObject() const
$method=|QScriptValue|globalObject|

$prototype=bool hasUncaughtException() const
$method=|bool|hasUncaughtException|

$prototype=QScriptValue importExtension(const QString & extension)
$method=|QScriptValue|importExtension|const QString &

$prototype=QStringList importedExtensions() const
$method=|QStringList|importedExtensions|

$prototype=void installTranslatorFunctions(const QScriptValue & object = QScriptValue())
$method=|void|installTranslatorFunctions|const QScriptValue &=QScriptValue()

$prototype=bool isEvaluating() const
$method=|bool|isEvaluating|

$prototype=QScriptValue newArray(uint length = 0)
$method=|QScriptValue|newArray|uint=0

$prototype=QScriptValue newDate(const QDateTime & value)
$method=|QScriptValue|newDate|const QDateTime &

$prototype=QScriptValue newObject()
$internalMethod=|QScriptValue|newObject,newObject1|

$prototype=QScriptValue newObject(QScriptClass * scriptClass, const QScriptValue & data = QScriptValue())
$internalMethod=|QScriptValue|newObject,newObject2|QScriptClass *,const QScriptValue &=QScriptValue()

//[1]QScriptValue newObject()
//[2]QScriptValue newObject(QScriptClass * scriptClass, const QScriptValue & data = QScriptValue())

HB_FUNC_STATIC( QSCRIPTENGINE_NEWOBJECT )
{
  if( ISNUMPAR(0) )
  {
    QScriptEngine_newObject1();
  }
  else if( ISBETWEEN(1,2) && ISQSCRIPTCLASS(1) && (ISQSCRIPTVALUE(2)||ISNIL(2))  )
  {
    QScriptEngine_newObject2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue newQMetaObject(const QMetaObject * metaObject, const QScriptValue & ctor = QScriptValue())
$method=|QScriptValue|newQMetaObject|const QMetaObject *,const QScriptValue &=QScriptValue()

$prototype=QScriptValue newQObject(QObject * object, ValueOwnership ownership = QtOwnership, const QObjectWrapOptions & options = 0)
%% TODO: revisar
$internalMethod=|QScriptValue|newQObject,newQObject1|QObject *,QScriptEngine::ValueOwnership=QScriptEngine::QtOwnership,QScriptEngine::QObjectWrapOptions=0

$prototype=QScriptValue newQObject(const QScriptValue & scriptObject, QObject * qtObject, ValueOwnership ownership = QtOwnership, const QObjectWrapOptions & options = 0)
%% TODO: revisar
$internalMethod=|QScriptValue|newQObject,newQObject2|const QScriptValue &,QObject *,QScriptEngine::ValueOwnership=QScriptEngine::QtOwnership,QScriptEngine::QObjectWrapOptions=0

//[1]QScriptValue newQObject(QObject * object, ValueOwnership ownership = QtOwnership, const QObjectWrapOptions & options = 0)
//[2]QScriptValue newQObject(const QScriptValue & scriptObject, QObject * qtObject, ValueOwnership ownership = QtOwnership, const QObjectWrapOptions & options = 0)

HB_FUNC_STATIC( QSCRIPTENGINE_NEWQOBJECT )
{
  if( ISBETWEEN(1,3) && ISQOBJECT(1) && ISOPTNUM(2) && (ISNUM(3)||ISNIL(3)) )
  {
    QScriptEngine_newQObject1();
  }
  else if( ISBETWEEN(2,4) && ISQSCRIPTVALUE(1) && ISQOBJECT(2) && ISOPTNUM(3) && (ISNUM(4)||ISNIL(4)) )
  {
    QScriptEngine_newQObject2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue newRegExp(const QRegExp & regexp)
$internalMethod=|QScriptValue|newRegExp,newRegExp1|const QRegExp &

$prototype=QScriptValue newRegExp(const QString & pattern, const QString & flags)
$internalMethod=|QScriptValue|newRegExp,newRegExp2|const QString &,const QString &

//[1]QScriptValue newRegExp(const QRegExp & regexp)
//[2]QScriptValue newRegExp(const QString & pattern, const QString & flags)

HB_FUNC_STATIC( QSCRIPTENGINE_NEWREGEXP )
{
  if( ISNUMPAR(1) && ISQREGEXP(1) )
  {
    QScriptEngine_newRegExp1();
  }
  else if( ISNUMPAR(2) && ISCHAR(1) && ISCHAR(2) )
  {
    QScriptEngine_newRegExp2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue newVariant(const QVariant & value)
$internalMethod=|QScriptValue|newVariant,newVariant1|const QVariant &

$prototype=QScriptValue newVariant(const QScriptValue & object, const QVariant & value)
$internalMethod=|QScriptValue|newVariant,newVariant2|const QScriptValue &,const QVariant &

//[1]QScriptValue newVariant(const QVariant & value)
//[2]QScriptValue newVariant(const QScriptValue & object, const QVariant & value)

HB_FUNC_STATIC( QSCRIPTENGINE_NEWVARIANT )
{
  if( ISNUMPAR(1) && ISQVARIANT(1) )
  {
    QScriptEngine_newVariant1();
  }
  else if( ISNUMPAR(2) && ISQSCRIPTVALUE(1) && ISQVARIANT(2) )
  {
    QScriptEngine_newVariant2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue nullValue()
$method=|QScriptValue|nullValue|

$prototype=void popContext()
$method=|void|popContext|

$prototype=int processEventsInterval() const
$method=|int|processEventsInterval|

$prototype=QScriptContext * pushContext()
$method=|QScriptContext *|pushContext|

$prototype=void reportAdditionalMemoryCost(int size)
$method=|void|reportAdditionalMemoryCost|int

$prototype=void setAgent(QScriptEngineAgent * agent)
$method=|void|setAgent|QScriptEngineAgent *

$prototype=void setDefaultPrototype(int metaTypeId, const QScriptValue & prototype)
$method=|void|setDefaultPrototype|int,const QScriptValue &

$prototype=void setGlobalObject(const QScriptValue & object)
$method=|void|setGlobalObject|const QScriptValue &

$prototype=void setProcessEventsInterval(int interval)
$method=|void|setProcessEventsInterval|int

$prototype=QScriptValue toObject(const QScriptValue & value)
$method=|QScriptValue|toObject|const QScriptValue &

$prototype=QScriptString toStringHandle(const QString & str)
$method=|QScriptString|toStringHandle|const QString &

$prototype=QScriptValue uncaughtException() const
$method=|QScriptValue|uncaughtException|

$prototype=QStringList uncaughtExceptionBacktrace() const
$method=|QStringList|uncaughtExceptionBacktrace|

$prototype=int uncaughtExceptionLineNumber() const
$method=|int|uncaughtExceptionLineNumber|

$prototype=QScriptValue undefinedValue()
$method=|QScriptValue|undefinedValue|

$prototype=static QScriptSyntaxCheckResult checkSyntax(const QString & program)
$staticMethod=|QScriptSyntaxCheckResult|checkSyntax|const QString &

$connectSignalFunction

$signalMethod=|signalHandlerException(QScriptValue)

#pragma ENDDUMP