📄 kissdom.h
字号:
//! Creates a text node Text* createTextNode( const DOMString& data); //! Creates a comment Comment* createComment( const DOMString& data); //! Creates a CDATA section CDATASection* createCDATASection( const DOMString& data); //! Creates a processing instruction ProcessingInstruction* createProcessingInstruction( const DOMString& target, const DOMString& data); //! Creates an attribute Attr* createAttribute( const DOMString& name); //! Creates an entity reference EntityReference* createEntityReference( const DOMString& name); //! Gets the elements by tag name NodeList* getElementsByTagName( const DOMString& tagName); // Introduced in DOM Level 2: //! Imports a node Node* importNode( const Node* importNode, const bool& deep); //! Creates an elements namespace Element* createElementNS( const DOMString& namespaceURI, const DOMString& qualifiedName); //! Creates an attributes namespace Attr* createAttributeNS( const DOMString& namespaceURI, const DOMString& qualifiedName); //! Gets elements by tag name's namespace NodeList* getElementsByTagNameNS( const DOMString& namespaceURI, const DOMString& localname); //! Gets elements by id Element* getElementById( const DOMString& elementId); // Introduced in DOM Level 3: //! Determines actual encoding const DOMString* actualEncoding() const; //! Sets actual encoding void setActualEncoding( const DOMString& newActualEncoding); //! Determines encoding const DOMString* encoding() const; //! Sets encoding void setEncoding( const DOMString& newEncoding); //! Specifies if the document is standalone bool standalone() const; //! Sets standalone boolean void setStandalone( const bool& newStandalone); //! Gets strict error checking flag bool strictErrorChecking() const ; //! Sets strict error checking flag void setStrictErrorChecking( const bool& newStrictErrorChecking); //! Gets the version const DOMString* version() const; //! Sets the version void setVersion( const DOMString& newVersion); //! Adopts another node Node* adoptNode( Node* source); //! Sets the base URI void setBaseURI( const DOMString *const baseURI);private : Node* myDoctype; //!< The document type of the Document Node* myDocumentElement; //!< The document element const DOMImplementation* myDOMImplementation; //!< The DOM implementation mutable DOMKey nextKey; //!< The next key DOMString myNamespaceURI; //!< The namespace URI for the document list<Node*> myElementList; //!< The document element list KissNodeList myElementNodeList; //!< The document element node list DOMString myActualEncoding; //!< The actual encoding DOMString myEncoding; //!< The encoding DOMString myVersion; //!< The document(?) version bool myStandalone; //!< Whether or not the document is standalone bool myStrictErrorChecking; //!< Whether or not strict error checking is on};// ******************************************************************************// ******************************************************************************// KissElement// ******************************************************************************// ******************************************************************************//! Element class in KISS DOM implementationclass KissElement : public KissNode, public Element {public : //! Override of KissNode::nodeType() unsigned long nodeType() const; //! Override of KissNode::attributes() const NamedNodeMap* attributes() const; //! Override of KissNode::setOwnerDocument() void setOwnerDocument( const Document *const newOwnerDocument); //! Implementation of Node::cloneNode() Node* cloneNode( const bool& deep) const; //! Override of KissNode::namespaceURI() const DOMString* namespaceURI() const; //! Override of KissNode::prefix() const DOMString* prefix() const; //! Override of KissNode::setPrefix() void setPrefix( const DOMString& newPrefix); //! Override of KissNode::localName() const DOMString* localName() const; //! Override of KissNode::hasAttributes() bool hasAttributes() const; //! Override of KissNode::normalizeNS() void normalizeNS(); //! Constructor for KissElement object KissElement( const Document *const yourOwnerDocument, Node *const yourParentNode, const DOMString& yourNamespaceURI, const DOMString& yourTagName); //! Destructor ~KissElement(); //! Gets the tag name const DOMString* tagName() const; //! Gets the attributes of a tag const DOMString* getAttribute( const DOMString& name) const; //! Sets the attributes of a tag void setAttribute( const DOMString& name, const DOMString& value); //! Removes the attributes of a tag void removeAttribute( const DOMString& name); //! Gets the attribute's node (I think) Attr* getAttributeNode( const DOMString& name); //! Sets the attribute's node (I think) Attr* setAttributeNode( Attr& newAttr); //! Removes the attribute's node (I think) Attr* removeAttributeNode( Attr& oldAttr) ; //! Gets the elements by tag name const NodeList* getElementsByTagName( const DOMString& name, const bool& deep) const; // Introduced in DOM Level 2: //! Gets the attribute's namespace const DOMString* getAttributeNS( const DOMString& namespaceURI, const DOMString& localname) const; //! Sets the attribute's namespace void setAttributeNS( const DOMString& namespaceURI, const DOMString& qualifiedName, const DOMString& value); //! Removes the attribute's namespace void removeAttributeNS( const DOMString& namespaceURI, const DOMString& localname); //! Gets the attribute node's namespace Attr* getAttributeNodeNS( const DOMString& namespaceURI, const DOMString& localname); //! Sets the attribute node's namespace Attr* setAttributeNodeNS( Attr& newAttr); //! Gets the elements by the tag's namespace NodeList* getElementsByTagNameNS( const DOMString& namespaceURI, const DOMString& localname); //! Returns true if element/tag/object/thing has attribute bool hasAttribute( const DOMString& name) const; //! Returns true if element/tag/object/thing has attribute namespace bool hasAttributeNS( const DOMString& namespaceURI, const DOMString& localname) const; private : KissNamedNodeMap myAttributesMap; //!< The node map of attributes of the element KissNodeList myElementNodeList; //!< The element node list const DOMString myNamespaceURI; //!< The namespace URI of the element DOMString myPrefix; //!< The prefix of the current element DOMString myLocalname; //!< The local name of the current element mutable list<Node*> myElementList; //!< The list of (sub?)elements //! Performs a non-default namespace prefix lookup const DOMString* lookupNamespacePrefixNonDefault( const DOMString& namespaceURI) const;};// ******************************************************************************// ******************************************************************************// KissAttr// ******************************************************************************// ******************************************************************************//! Attribute class for the KISS DOM implementationclass KissAttr : public KissNode, public Attr {public : //! Override of KissNode::nodeValue() const DOMString* nodeValue() const; //! Override of Node::setNodeValue() void setNodeValue( const DOMString& newNodeValue); //! Override of KissNode::nodeType() unsigned long nodeType() const; //! Override of KissNode::setParentNode() void setParentNode( Node* newParentNode); //! Implementation of Node::cloneNode() Node* cloneNode( const bool& deep) const; //! Override of KissNode::namespaceURI() const DOMString* namespaceURI() const; //! Override of KissNode::prefix() const DOMString* prefix() const; //! Override of KissNode::setPrefix() void setPrefix( const DOMString& newPrefix); //! Override of KissNode::localName() const DOMString* localName() const; //! Override of KissNode::compareDocumentOrder() Node::DocumentOrder compareDocumentOrder( const Node* other) const; //! Override of KissNode::compareTreePosition() TreePosition compareTreePosition( const Node* other) const; //! Override of KissNode::checkChildAddingConstraints2() void checkChildAddingConstraints2(const Node* newChild) const; //! Constructor of KissAttr object KissAttr( const Document *const yourOwnerDocument, const Element *const yourOwnerElement, const DOMString& yourNamespaceURI, const DOMString& yourAttributeName, const bool& isSpecified); //! Destructor ~KissAttr(); //! Obtains name of something const DOMString* name() const; //! Tells if this attribute is specified in the original document bool specified() const; //! Sets the specified boolean void setSpecified( const bool& newSpecified); //! Obtains the value of something const DOMString* value() const; //! Sets the value of something void setValue( const DOMString& newValue); // Introduced in DOM Level 2: //! Obtains the owner element of an xml element const Element* ownerElement() const; //! Sets the owner element in xml void setOwnerElement( const Element* newOwnerElement);private : const Element* myOwnerElement; //!< The element owning the attribute const DOMString myNamespaceURI; //!< The attribute namespace URI DOMString myPrefix; //!< The attribute prefix DOMString myLocalname; //!< The attribute local name DOMString myAttributeValue; //!< The attribute value bool amSpecified; //!< Whether or not the attribute is specified};// ******************************************************************************// ******************************************************************************// KissCharacterData// ******************************************************************************// ******************************************************************************//! Character data class for KISS DOM implementationclass KissCharacterData : public KissNode, public virtual CharacterData {public : //! Override of KissNode::nodeValue() const DOMString* nodeValue() const; //! Override of Node::setNodeValue() void setNodeValue( const DOMString& newNodeValue); //! Override of KissNode::insertBefore() Node* insertBefore( Node* newChild, Node* refChild); //! Override of KissNode::replaceChild() Node* replaceChild( Node* newChild, Node* oldChild); //! Override of KissNode::removeChild() Node* removeChild( Node* oldChild); //! Override of KissNode::appendChild() Node* appendChild( Node* newChild); //! Override of KissNode::setTextContent() void setTextContent( const DOMString& newTextContent); //! Constructor of KissCharacterData object KissCharacterData( const Document *const yourOwnerDocument, Node *const yourParentNode, const DOMString& yourNodeName, const DOMString& yourData); //! Destructor ~KissCharacterData(); //! Obtains the character data string const DOMString* data() const; //! Returns the length of the data (I believe) unsigned long length() const; //! Obtains the substring data const DOMString* substringData( unsigned long offset, unsigned long count) const; //! Appends data to a string void appendData( const DOMString& arg); //! Inserts data into a string void insertData( unsigned long offset, const DOMString& arg); //! Deletes data from a string void deleteData( unsigned long offset, unsigned long count); //! Replaces data in a string void replaceData( unsigned long offset, unsigned long count, const DOMString& arg); //! Sets a data string void setData( const DOMString& newData);private : DOMString myData; //!< The data of the character string mutable DOMString mySubStringData; //!< The substring data of the character string};// ******************************************************************************// ******************************************************************************// KissTextInt// ******************************************************************************// ******************************************************************************//! Text int (?) class in KISS DOM implementationclass KissTextInt : public KissCharacterData, public virtual Text {public : //! Constructor of KissTextInt object KissTextInt( const Document *const yourOwnerDocument, Node *const yourParentNode, const DOMString& yourNodeName, const DOMString& yourTextContent); //! Destructor ~KissTextInt(); //! Splits text at offset Text* splitText( unsigned long offset); // Introduced in DOM Level 3: //! Determines if whitespace is in the element content bool isWhiteSpaceInElementContent() const; //! Returns the whole text as a DOMString
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -