Arcane  v3.15.0.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
Dom.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* Dom.h (C) 2000-2024 */
9/* */
10/* Implémentation d'un DOM1+DOM2+DOM3(core). */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_DOM_H
13#define ARCANE_DOM_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/DomDeclaration.h"
18#include "arcane/utils/String.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25class IStringImpl;
26class IXmlDocumentHolder;
27}
28
29namespace Arcane::dom
30{
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
38extern NodePrv* toNodePrv(const Node& node);
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
43typedef String DOMString;
44
45/*---------------------------------------------------------------------------*/
46/*---------------------------------------------------------------------------*/
47
48/*! @name ExceptionCode
49 An integer indicating the type of error generated.
50 \note Other numeric codes are reserved for W3C for possible future
51 use.
52 \relate DOMException
53*/
54//@{
55/*! If index or size is negative, or greater than the allowed value */
56const UShort INDEX_SIZE_ERR = 1;
57/*! If the specified range of text does not fit into a DOMString */
58const UShort DOMSTRING_SIZE_ERR = 2;
59//! If any node is inserted somewhere it doesn't belong
60const UShort HIERARCHY_REQUEST_ERR = 3;
61/*! If a node is used in a different document than the one that
62 created it (that doesn't support it) */
63const UShort WRONG_DOCUMENT_ERR = 4;
64/*! If an invalid or illegal character is specified, such as in a
65 name. See production 2 in the XML specification for the definition of
66 a legal character, and production 5 for the definition of a legal name
67 character. */
68const UShort INVALID_CHARACTER_ERR = 5;
69//! If data is specified for a node which does not support data
70const UShort NO_DATA_ALLOWED_ERR = 6;
71/*! If an attempt is made to modify an object where modifications are
72 not allowed */
73const UShort NO_MODIFICATION_ALLOWED_ERR = 7;
74/*! If an attempt is made to reference a node in a context where it
75 does not exist */
76const UShort NOT_FOUND_ERR = 8;
77/*! If the implementation does not support the requested type of
78 object or operation */
79const UShort NOT_SUPPORTED_ERR = 9;
80/*! If an attempt is made to add an attribute that is already in use
81 elsewhere */
82const UShort INUSE_ATTRIBUTE_ERR = 10;
83/*! If an attempt is made to use an object that is not, or is no
84 longer, usable */
85const UShort INVALID_STATE_ERR = 11;
86/*! If an invalid or illegal string is specified */
87const UShort SYNTAX_ERR = 12;
88/*! If an attempt is made to modify the type of the underlying object */
89const UShort INVALID_MODIFICATION_ERR = 13;
90/*! If an attempt is made to create or change an object in a way which
91 is incorrect with regard to namespaces */
92const UShort NAMESPACE_ERR = 14;
93/*! If a parameter or an operation is not supported by the underlying
94 object */
95const UShort INVALID_ACCESS_ERR = 15;
96//@}
97
98const UShort NOT_IMPLEMENTED_ERR = 2500;
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
103class ARCANE_CORE_EXPORT DOMException
104{
105 public:
106 DOMException(UShort _code) : code(_code) {}
107 public:
108 UShort code; //!< The code of the exception
109};
110
111/*---------------------------------------------------------------------------*/
112/*---------------------------------------------------------------------------*/
113
114class ARCANE_CORE_EXPORT DOMWriter
115{
116 public:
117 /*! @name Constructors and Destructors */
118 //@{
119 DOMWriter();
120 DOMWriter(DOMWriterPrv*);
121 DOMWriter(const DOMWriter& dw);
122 ~DOMWriter();
123 //@}
124 const DOMWriter& operator=(const DOMWriter& from);
125 public:
126 ByteUniqueArray writeNode(const Node& node) const;
127 void encoding(const String& encoding);
128 String encoding() const;
129 private:
130 DOMWriterPrv* m_p;
131 DOMWriterPrv* _impl() const;
132 bool _null() const;
133 void _checkValid() const;
134};
135
136/*---------------------------------------------------------------------------*/
137/*---------------------------------------------------------------------------*/
138
139class ARCANE_CORE_EXPORT DOMImplementation
140{
141 public:
142
143 /*! @name DOM Level 1 operations */
144 //@{
145 bool hasFeature(const DOMString& feature,const DOMString& version) const;
146 //@}
147
148 /*! @name DOM Level 2 operations */
149 //@{
150 DocumentType createDocumentType(const DOMString& qualified_name,const DOMString& public_id,
151 const DOMString& system_id) const;
152
153 private:
154 Document createDocument(const DOMString& namespace_uri,const DOMString& qualified_name,
155 const DocumentType& doctype) const;
156 public:
157 //@}
158
159 /*! @name DOM Level 3 operations */
160 //@{
161 DOMImplementation getInterface(const DOMString& feature) const;
162 //@}
163
164 DOMWriter createDOMWriter() const;
165
166 public:
167 /*! @name Constructors and Destructors */
168 //@{
170 DOMImplementation(ImplementationPrv*);
172 //@}
173
174 public:
175 //! Les méthodes suivantes sont internes à Arcane.
176 //@{
177 IXmlDocumentHolder* _newDocument();
178 IXmlDocumentHolder* _load(const String& fname,ITraceMng* msg,const String& schemaname);
179 IXmlDocumentHolder* _load(const String& fname,ITraceMng* msg,const String& schemaname, ByteConstArrayView schema_data);
180 IXmlDocumentHolder* _load(ByteConstSpan buffer,const String& name,ITraceMng* trace);
181 void _save(ByteArray& bytes,const Document& document,int indent_level);
182 String _implementationName() const;
183 //@}
184 public:
185 static void initialize();
186 static void terminate();
187 private:
188 ImplementationPrv* m_p;
189 ImplementationPrv* _impl() const;
190 void _checkValid() const;
191};
192
193/*---------------------------------------------------------------------------*/
194/*---------------------------------------------------------------------------*/
195
196ARCANE_CORE_EXPORT bool operator==(const Node& n1,const Node& n2);
197ARCANE_CORE_EXPORT bool operator!=(const Node& n1,const Node& n2);
198//class NodePrv;
199
200/*!
201 * \internal
202 * \ingroup Xml
203 */
204class ARCANE_CORE_EXPORT Node
205{
206 public:
207
208 /*! @name NodeType
209 An integer indicating which type of node this is.
210 \note Numeric codes up to 200 are reserved to W3C for possible future use.
211 */
212 //@{
213 //! The node is an Element
214 static const UShort ELEMENT_NODE = 1;
215 //! The node is an Attr
216 static const UShort ATTRIBUTE_NODE = 2;
217 //! The node is a Text node
218 static const UShort TEXT_NODE = 3;
219 //! The node is a CDATASection
220 static const UShort CDATA_SECTION_NODE = 4;
221 //! The node is an EntityReference
222 static const UShort ENTITY_REFERENCE_NODE = 5;
223 //! The node is an Entity
224 static const UShort ENTITY_NODE = 6;
225 //! The node is a ProcessingInstruction
226 static const UShort PROCESSING_INSTRUCTION_NODE = 7;
227 //! The node is a Comment
228 static const UShort COMMENT_NODE = 8;
229 //! The node is a Document
230 static const UShort DOCUMENT_NODE = 9;
231 //! The node is a DocumentType
232 static const UShort DOCUMENT_TYPE_NODE = 10;
233 //! The node is a DocumentFragment
234 static const UShort DOCUMENT_FRAGMENT_NODE = 11;
235 //! The node is a Notation
236 static const UShort NOTATION_NODE = 12;
237 //@}
238
239 public:
240
241 /*! @name Attribute nodeName (DOM Level 1) */
242 //@{
243 DOMString nodeName() const;
244 //@}
245
246 /*! @name Attribute nodeValue (DOM Level 1) */
247 //@{
248 DOMString nodeValue() const;
249 void nodeValue(const DOMString& value) const;
250 //@}
251
252 /*! @name Attribute nodeType (DOM Level 1) */
253 //@{
254 UShort nodeType() const;
255 //@}
256
257 /*! @name Attribute parentNode (DOM Level 1) */
258 //@{
259 Node parentNode() const;
260 //@}
261
262 /*! @name Attribute childNodes (DOM Level 1) */
263 //@{
264 NodeList childNodes() const;
265 //@}
266
267 /*! @name Attribute firstChild() (DOM Level 1) */
268 //@{
269 Node firstChild() const;
270 //@}
271
272 /*! @name Attribute lastChild() (DOM Level 1) */
273 //@{
274 Node lastChild() const;
275 //@}
276
277 /*! @name Attribute previousSibling() (DOM Level 1) */
278 //@{
279 Node previousSibling() const;
280 //@}
281
282 /*! @name Attribute nextSibling() (DOM Level 1) */
283 //@{
284 Node nextSibling() const;
285 //@}
286
287 /*! @name Attribute attributes() (DOM Level 1) */
288 //@{
289 NamedNodeMap attributes() const;
290 //@}
291
292 /*! @name Attribute ownerDocument() (DOM Level 2) */
293 //@{
294 Document ownerDocument() const;
295 //@}
296
297 /*! @name DOM Level 1 operations */
298 //@{
299 Node insertBefore(const Node& new_child,const Node& ref_child) const;
300 Node replaceChild(const Node& new_child,const Node& old_child) const;
301 Node removeChild(const Node& old_child) const;
302 Node appendChild(const Node& new_child) const;
303 bool hasChildNodes() const;
304 Node cloneNode(bool deep) const;
305 //@}
306
307 /*! @name Attribute prefix() (DOM Level 2). */
308 //@{
309 DOMString prefix() const;
310 void prefix(const DOMString& new_prefix) const;
311 //@}
312
313 /*! @name DOM Level 2 operations */
314 //@{
315 void normalize() const;
316 bool isSupported(const DOMString& feature,const DOMString& version) const;
317 DOMString namespaceURI() const;
318
319 DOMString localName() const;
320 //@}
321
322 /*! @name TreePosition
323 A bitmask indicating the relative tree position of a node with
324 respect to another node.
325
326 Issue TreePosition-1:
327 Should we use fewer bits?
328
329 Issue TreePosition-2:
330 How does a node compare to itself?
331 */
332 //@{
333 //! The node precedes the reference node
334 static const UShort TREE_POSITION_PRECEDING = 0x01;
335 //! The node follows the reference node
336 static const UShort TREE_POSITION_FOLLOWING = 0x02;
337 //! The node is an ancestor of the reference node
338 static const UShort TREE_POSITION_ANCESTOR = 0x04;
339 //! The node is a descendant of the reference node
340 static const UShort TREE_POSITION_DESCENDANT = 0x08;
341 /*! The two nodes have the same position. This is the case of two
342 attributes that have the same ownerElement() */
343 static const UShort TREE_POSITION_SAME = 0x10;
344 /*! The two nodes have the exact same position. This is never the
345 case of two attributes, even when they have the same
346 ownerElement. Two nodes that have the exact same position have the
347 same position, though the reverse may not be true.
348 */
349 static const UShort TREE_POSITION_EXACT_SAME = 0x20;
350 //! The two nodes are disconnected, they do not have any common ancestor
351 static const UShort TREE_POSITION_DISCONNECTED = 0x00;
352 //@}
353
354 /*! @name Attribute textContent() (DOM Level 3) */
355 //@{
356 DOMString textContent() const;
357 void textContent(const DOMString& value) const;
358 //@}
359
360 /*! @name Attribute baseURI() (DOM Level 3) */
361 //@{
362 DOMString baseURI() const;
363 //@}
364
365
366 /*! @name DOM Level 3 operations */
367 //@{
368 bool isSameNode(const Node& node) const;
369 UShort compareTreePosition(const Node& other) const;
370 bool isEqualNode(const Node& other) const;
371 Node getInterface(const DOMString& feature) const;
372 DOMString lookupNamespacePrefix(const DOMString& namespace_uri,bool use_default) const;
373 bool isDefaultNamespace(const DOMString& namespace_uri) const;
374 DOMString lookupNamespaceURI(const DOMString& prefix) const;
375 //void normalizeNS() const;
376 DOMObject setUserData(const DOMString& key,const DOMObject& data,
377 const UserDataHandler& handler) const;
378 DOMObject getUserData(const DOMString& key) const;
379 //@}
380
381 /*!
382 * \brief Détruit le noeud.
383 *
384 * Le noeud ne doit pas appartenir à un document.
385 *
386 * Le noeud ne doit plus être utilisé par la suite.
387 *
388 * Cette méthode ne fait pas partie du DOM mais est nécessaire pour
389 * certaines implémentation pour supprimer la mémoire associée à un noeud.
390 */
391 void releaseNode();
392
393 public:
394
395 bool _null() const;
396
397 public:
398
399 friend class IDOM_Node;
400 friend class IDOM_Document;
401 friend class Attr;
402 friend class Element;
403 friend class Document;
404 friend class DOMImplementation;
405 friend class NamedNodeMap;
406 friend class CharacterData;
407 friend class Text;
408 friend class DOMWriter;
409 friend bool ARCANE_CORE_EXPORT operator==(const Node& n1,const Node& n2);
410
411 protected:
412
413 NodePrv* m_p; //!< Implémentation de la classe.
414 //void* m_p;
415 void _assign(const Node&);
416
417 public:
418 Node();
419 Node(const Node&);
420 virtual ~Node();
421 const Node& operator=(const Node& from);
422 public:
423 Node(NodePrv*);
424 protected:
425 void _checkValid() const;
426 protected:
427 NodePrv* _impl() const;
428 friend NodePrv* toNodePrv(const Node& node);
429};
430
431/*---------------------------------------------------------------------------*/
432/*---------------------------------------------------------------------------*/
433
434/*!
435 * \internal
436 * \ingroup Xml
437 */
438class ARCANE_CORE_EXPORT Document
439: public Node
440{
441 public:
442
443 /*! @name Attribute doctype() (DOM Level 1) */
444 //@{
445 DocumentType doctype() const;
446 //@}
447
448 /*! @name Attribute implementation() (DOM Level 1) */
449 //@{
450 DOMImplementation implementation() const;
451 //@}
452
453 /*! @name Attribute documentElement() (DOM Level 1) */
454 //@{
455 Element documentElement() const;
456 //@}
457
458 //! @name DOM Level 1 operations
459 //@{
460 Element createElement(const DOMString& tag_name) const;
461 DocumentFragment createDocumentFragment() const;
462 Text createTextNode(const DOMString& data) const;
463 Comment createComment(const DOMString& data) const;
464 CDATASection createCDATASection(const DOMString& data) const;
465 ProcessingInstruction createProcessingInstruction(const DOMString& target,
466 const DOMString& data) const;
467 Attr createAttribute(const DOMString& name) const;
468 EntityReference createEntityReference(const DOMString& name) const;
469 NodeList getElementsByTagName(const DOMString& tagname) const;
470 //@}
471
472 //! @name DOM Level 2 operations
473 //@{
474 Node importNode(const Node& imported_node,bool deep) const;
475 Element createElementNS(const DOMString& namespace_uri,const DOMString& qualified_name) const;
476 Attr createAttributeNS(const DOMString& namespace_uri,const DOMString& qualified_name) const;
477 NodeList getElementsByTagNameNS(const DOMString& namespace_uri,const DOMString& local_name) const;
478 Element getElementById(const DOMString& element_id) const;
479 //@}
480
481 /*! @name Attribute actualEncoding() (DOM Level 3) */
482 //@{
483 DOMString actualEncoding() const;
484 void actualEncoding(const DOMString&) const;
485 //@}
486
487 /*! @name Attribute encoding() (DOM Level 3) */
488 //@{
489 DOMString encoding() const;
490 void encoding(const DOMString&) const;
491 //@}
492
493 /*! @name Attribute standalone() (DOM Level 3) */
494 //@{
495 bool standalone() const;
496 void standalone(bool) const;
497 //@}
498
499 /*! @name Attribute strictErrorChecking() (DOM Level 3) */
500 //@{
501 bool strictErrorChecking() const;
502 void strictErrorChecking(bool) const;
503 //@}
504
505 /*! @name version() (DOM Level 3) */
506 //@{
507 DOMString version() const;
508 void version(const DOMString&) const;
509 //@}
510
511 /*! @name Attribute errorHandler() (DOM Level 3) */
512 //@{
513 DOMErrorHandler errorHandler() const;
514 void errorHandler(const DOMErrorHandler&) const;
515 //@}
516
517 /*! @name Attribute documentURI() (DOM Level 3) */
518 //@{
519 DOMString documentURI() const;
520 void documentURI(const DOMString&) const;
521 //@}
522
523 //! @name DOM Level 3 operations
524 //@{
525 Node adoptNode(const Node& source) const;
526 void normalizeDocument();
527 /*
528 void setNormalizationFeature(const DOMString& name,bool state);
529 bool getNormalizationFeature(const DOMString& name) const;
530 */
531 Node renameNode(const Node& node,const DOMString& namespace_uri,
532 const DOMString& name);
533 //@}
534
535 public:
536 friend class IDOM_Document;
537 friend class DOMImplementation;
538 public:
539 Document();
540 Document(const Node&);
541 Document(DocumentPrv*);
542 private:
543 DocumentPrv* _impl() const;
544};
545
546class ARCANE_CORE_EXPORT DocumentFragment
547: public Node
548{
549 public:
551 DocumentFragment(DocumentFragmentPrv*);
552};
553
554/*---------------------------------------------------------------------------*/
555/*---------------------------------------------------------------------------*/
556
557/*!
558 * \internal
559 * \ingroup Xml
560 */
561class ARCANE_CORE_EXPORT NodeList
562{
563 public:
564 //! @name DOM Level 1 operations
565 //@{
566 Node item(ULong index) const;
567 ULong length() const;
568 //@}
569 public:
570 NodeList();
571 NodeList(NodeListPrv*);
572 private:
573 NodeListPrv* _impl() const;
574 NodeListPrv* m_p;
575 void _checkValid() const;
576};
577
578/*---------------------------------------------------------------------------*/
579/*---------------------------------------------------------------------------*/
580
581/*!
582 * \internal
583 * \ingroup Xml
584 */
585class ARCANE_CORE_EXPORT CharacterData
586: public Node
587{
588 public:
589 /*! @name Attribute data (DOM Level 1) */
590 //@{
591 DOMString data() const;
592 void data(const DOMString&) const;
593 //@}
594
595 /*! @name Attribute length (DOM Level 1) */
596 //@{
597 ULong length() const;
598 //@}
599
600 //! @name DOM Level 1 operations
601 //@{
602 DOMString substringData(ULong offset,ULong count) const;
603 void appendData(const DOMString& arg) const;
604 void insertData(ULong offset,const DOMString& arg) const;
605 void deleteData(ULong offset,ULong count) const;
606 void replaceData(ULong offset,ULong count,const DOMString& arg) const;
607 //@}
608 protected:
610 CharacterData(const Node& from);
611 CharacterData(const CharacterData& from);
612 CharacterData(CharacterDataPrv*);
613 CharacterDataPrv* _impl() const;
614};
615
616class ARCANE_CORE_EXPORT Attr
617: public Node
618{
619 public:
620 /*! @name Attribute name (DOM Level 1) */
621 //@{
622 DOMString name() const;
623 //@}
624
625 /*! @name Attribute specified (DOM Level 1) */
626 //@{
627 bool specified() const;
628 //@}
629
630 /*! @name Attribute value (DOM Level 1) */
631 //@{
632 DOMString value() const;
633 void value(const DOMString& str) const;
634 //@}
635
636 /*! @name Attribute ownerElement (DOM Level 2) */
637 //@{
638 Element ownerElement() const;
639 //@}
640
641 public:
642 friend class IDOM_Attr;
643 friend class IDOM_Node;
644 friend class Element;
645 public:
646 Attr() = default;
647 Attr(const Node&);
648 Attr(AttrPrv*);
649 private:
650 AttrPrv* _impl() const;
651};
652
653/*---------------------------------------------------------------------------*/
654/*---------------------------------------------------------------------------*/
655
656class ARCANE_CORE_EXPORT Element
657: public Node
658{
659 public:
660
661 /*! @name Attribut tagName (DOM Level 1) */
662 //@{
663 DOMString tagName() const;
664 //@}
665
666 /*! @name DOM Level 1 operations */
667 //@{
668 DOMString getAttribute(const DOMString& name) const;
669 void setAttribute(const DOMString& name,const DOMString& value) const;
670 void removeAttribute(const DOMString& name) const;
671 Attr getAttributeNode(const DOMString& name) const;
672 Attr setAttributeNode(const Attr& new_attr) const;
673 Attr removeAttributeNode(const Attr& old_attr) const;
674 NodeList getElementsByTagName(const DOMString& name) const;
675 //@}
676 //@{ @name DOM Level 2 operations
677 DOMString getAttributeNS(const DOMString& namespace_uri,const DOMString& local_name) const;
678 void setAttributeNS(const DOMString& namespace_uri,const DOMString& qualified_name,
679 const DOMString& value) const;
680 void removeAttributeNS(const DOMString& namespace_uri,const DOMString& local_name) const;
681 Attr getAttributeNodeNS(const DOMString& namespace_uri,const DOMString& local_name) const;
682 Attr setAttributeNodeNS(const Attr& new_attr) const;
683 NodeList getElementsByTagNameNS(const DOMString& namespace_uri,const DOMString& local_name) const;
684 bool hasAttribute(const DOMString& name) const;
685 bool hasAttributeNS(const DOMString& namespace_uri,const DOMString& local_name) const;
686 //@}
687 public:
688 Element();
689 Element(const Element&);
690 Element(const Node&);
691 private:
692 Element(ElementPrv*);
693 friend class IDOM_Element;
694 friend class Attr;
695 friend class Document;
696 ElementPrv* _impl() const;
697};
698
699/*---------------------------------------------------------------------------*/
700/*---------------------------------------------------------------------------*/
701
702class ARCANE_CORE_EXPORT Text
703: public CharacterData
704{
705 public:
706 /*! @name DOM Level 1 operations */
707 //@{
708 Text splitText(ULong offset) const;
709 //@}
710 /*! @name Attribute isWhiteSpaceInElementContent (DOM Level 3) */
711 //@{
712 bool isWhiteSpaceInElementContent() const;
713 //@}
714 /*! @name Attribute wholeText() (DOM Level 3) */
715 //@{
716 DOMString wholeText() const;
717 //@}
718 /*! @name DOM Level 3 operations */
719 //@{
720 Text replaceWholeText(const DOMString& content) const;
721 //@}
722 public:
723 Text();
724 Text(const Text&);
725 Text(const Node&);
726 Text(TextPrv*);
727 TextPrv* _impl() const;
728 friend class Document;
729};
730
731/*---------------------------------------------------------------------------*/
732/*---------------------------------------------------------------------------*/
733
734class ARCANE_CORE_EXPORT Comment
735: public CharacterData
736{
737 public:
738 Comment();
739 Comment(CommentPrv*);
740 private:
741 CommentPrv* _impl() const;
742};
743
744class ARCANE_CORE_EXPORT CDATASection
745: public Text
746{
747 public:
748 CDATASection();
749 CDATASection(CDATASectionPrv*);
750 private:
751 CDATASectionPrv* _impl() const;
752};
753
755: public Node
756{
757 public:
758 /*! @name Attribute name() (DOM Level 1) */
759 //@{
760 DOMString name() const;
761 //@}
762
763 /*! @name Attribute entities() (DOM Level 1) */
764 //@{
765 NamedNodeMap entities() const;
766 //@}
767
768 /*! @name Attribute notations() (DOM Level 1) */
769 //@{
770 NamedNodeMap notations() const;
771 //@}
772 /*! @name Attribute publicId() (DOM Level 2) */
773 //@{
774 DOMString publicId() const;
775 //@}
776
777 /*! @name Attribute systemId() (DOM Level 2) */
778 //@{
779 DOMString systemId() const;
780 //@}
781
782 /*! @name Attribute internalSubset() (DOM Level 2) */
783 //@{
784 DOMString internalSubset() const;
785 //@}
786 public:
787 DocumentType(DocumentTypePrv*);
788 DocumentType();
789 private:
791 DocumentTypePrv* _impl() const;
792};
793
794/*---------------------------------------------------------------------------*/
795/*---------------------------------------------------------------------------*/
796
797class ARCANE_CORE_EXPORT Notation
798: public Node
799{
800 public:
801 /*! @name Attribute publicId() (DOM Level 1) */
802 //@{
803 DOMString publicId() const;
804 //@}
805
806 /*! @name Attribute systemId() (DOM Level 1) */
807 //@{
808 DOMString systemId() const;
809 //@}
810 private:
811 NotationPrv* _impl() const;
812};
813
814/*---------------------------------------------------------------------------*/
815/*---------------------------------------------------------------------------*/
816
817class ARCANE_CORE_EXPORT Entity
818: public Node
819{
820 public:
821 /*! @name Attribute publicId() (DOM Level 1) */
822 //@{
823 DOMString publicId() const;
824 //@}
825
826 /*! @name Attribute systemId() (DOM Level 1) */
827 //@{
828 DOMString systemId() const;
829 //@}
830
831 /*! @name Attribute notationName() (DOM Level 1) */
832 //@{
833 DOMString notationName() const;
834 //@}
835 /*! @name Attribute actualEncoding() (DOM Level 3) */
836 //@{
837 DOMString actualEncoding() const;
838 void actualEncoding(const DOMString&) const;
839 //@}
840
841 /*! @name Attribute encoding() (DOM Level 3) */
842 //@{
843 DOMString encoding() const;
844 void encoding(const DOMString&) const;
845 //@}
846
847 /*! @name Attribute version() (DOM Level 3) */
848 //@{
849 DOMString version() const;
850 void version(const DOMString&) const;
851 //@}
852 private:
853 EntityPrv* _impl() const;
854};
855
856/*---------------------------------------------------------------------------*/
857/*---------------------------------------------------------------------------*/
858
860: public Node
861{
862 public:
864 EntityReference(EntityReferencePrv*);
865 private:
866 EntityReferencePrv* _impl() const;
867};
868
869/*---------------------------------------------------------------------------*/
870/*---------------------------------------------------------------------------*/
871
872class ARCANE_CORE_EXPORT ProcessingInstruction
873: public Node
874{
875 public:
876
877 /*! @name Attribute target() (DOM Level 1) */
878 //@{
879 DOMString target() const;
880 //@}
881
882 /*! @name Attribute data() (DOM Level 1) */
883 //@{
884 DOMString data() const;
885 void data(const DOMString& value) const;
886 //@}
887 public:
889 ProcessingInstruction(ProcessingInstructionPrv*);
890 private:
891 ProcessingInstructionPrv* _impl() const;
892};
893
894/*---------------------------------------------------------------------------*/
895/*---------------------------------------------------------------------------*/
896
897class ARCANE_CORE_EXPORT NamedNodeMap
898{
899 public:
900 /*! @name Attribute length (DOM Level 1)*/
901 //@{
902 ULong length() const;
903 //@}
904 /*! @name DOM Level 1 operations */
905 //@{
906 Node getNamedItem(const DOMString& name) const;
907 Node setNamedItem(const Node& arg) const;
908 Node removeNamedItem(const DOMString& name) const;
909 Node item(ULong index) const;
910 //@}
911 /*! @name DOM Level 2 operations */
912 //@{
913 Node getNamedItemNS(const DOMString& namespace_uri,const DOMString& local_name) const;
914 Node setNamedItemNS(const Node& arg) const;
915 Node removeNamedItemNS(const DOMString& namespace_uri,const DOMString& local_name) const;
916 //@}
917 public:
918 bool _null() const;
919 public:
920 friend class IDOM_Node;
921 friend class IDOM_Element;
922 NamedNodeMap();
923 NamedNodeMap(NamedNodeMapPrv*);
925 NamedNodeMap(const NamedNodeMap& from);
926 const NamedNodeMap& operator=(const NamedNodeMap& from);
927 private:
928 //AutoRefT<NamedNodeMapPrv> m_p;
929 NamedNodeMapPrv* m_p;
930 NamedNodeMapPrv* _impl() const;
931};
932
933/*---------------------------------------------------------------------------*/
934/*---------------------------------------------------------------------------*/
935
937{
938 public:
939 DOMImplementation getDOMImplementation(const DOMString& features) const;
940};
941
942/*---------------------------------------------------------------------------*/
943/*---------------------------------------------------------------------------*/
944
946{
947 public:
948 //! @name OperationType
949 //@{
950 //! The node is cloned.
951 static const UShort CLONED = 1;
952 //! The node is imported.
953 static const UShort IMPORTED = 2;
954 //! The node is deleted.
955 static const UShort DELETED = 3;
956 //@}
957
958 void handle(UShort operation,const DOMString& key,const DOMObject& data,
959 const Node& src,const Node& dest) const;
960};
961
962/*---------------------------------------------------------------------------*/
963/*---------------------------------------------------------------------------*/
964
966{
967 public:
968 //! @name ErrorType
969 //@{
970 //! The severity of the error described by the DOMError is warning
971 static const UShort SEVERITY_WARNING = 0;
972 //! The severity of the error described by the DOMError is error
973 static const UShort SEVERITY_ERROR = 1;
974 //! The severity of the error described by the DOMError is fatal error
975 static const UShort SEVERITY_FATAL_ERROR = 2;
976 //@}
977
978 /*! @name Attribute severity (DOM Level 3) */
979 //@{
980 UShort severity() const;
981 //@}
982
983 /*! @name Attribute message (DOM Level 3) */
984 //@{
985 DOMString message() const;
986 //@}
987
988 /*! @name Attribute exception (DOM Level 3) */
989 //@{
990 DOMObject relatedException() const;
991 //@}
992
993 /*! @name Attribute location (DOM Level 3) */
994 //@{
995 DOMLocator location() const;
996 //@}
997 public:
998 DOMError();
999 DOMError(DOMErrorPrv*);
1000 ~DOMError();
1001 DOMError(const DOMError& from);
1002 const DOMError& operator=(const DOMError& from);
1003 private:
1004 DOMErrorPrv* m_p;
1005 DOMErrorPrv* _impl() const;
1006 bool _null() const;
1007 void _checkValid() const;
1008};
1009
1010/*---------------------------------------------------------------------------*/
1011/*---------------------------------------------------------------------------*/
1012
1014{
1015 public:
1016 /*! @name DOM Level 3 operations */
1017 //@{
1018 bool handleError(const DOMError& error) const;
1019 //@}
1020};
1021
1022/*---------------------------------------------------------------------------*/
1023/*---------------------------------------------------------------------------*/
1024
1026{
1027 public:
1028 /*! @name Attribute lineNumber (DOM Level 3) */
1029 //@{
1030 long lineNumber() const;
1031 //@}
1032 /*! @name Attribute columnNumber (DOM Level 3) */
1033 //@{
1034 long columnNumber() const;
1035 //@}
1036 /*! @name Attribute offset (DOM Level 3) */
1037 //@{
1038 long offset() const;
1039 //@}
1040 /*! @name Attribute errorNode (DOM Level 3) */
1041 //@{
1042 Node errorNode() const;
1043 //@}
1044 /*! @name Attribute uri (DOM Level 3) */
1045 //@{
1046 DOMString uri() const;
1047 //@}
1048 public:
1049 friend class DOMError;
1050 DOMLocator();
1051 DOMLocator(DOMLocatorPrv*);
1052 ~DOMLocator();
1053 DOMLocator(const DOMLocator& from);
1054 const DOMLocator& operator=(const DOMLocator& from);
1055 private:
1056 DOMLocatorPrv* m_p;
1057 DOMLocatorPrv* _impl() const;
1058 bool _null() const;
1059 void _checkValid() const;
1060};
1061
1062/*---------------------------------------------------------------------------*/
1063/*---------------------------------------------------------------------------*/
1064
1065//! @name XPathExceptionCode
1066//@{
1067/*!
1068 If the expression is not a legal expression according to the rules
1069 of the specific XPathEvaluator or contains namespace prefixes which
1070 are not in scope according to the specified XPathNSResolver. If the
1071 XPathEvaluator was obtained by casting the document, the expression
1072 must be XPath 1.0 with no special extension functions.
1073*/
1074const unsigned short INVALID_EXPRESSION_ERR = 1;
1075/*!
1076 If the expression cannot be converted to return the specified type.
1077 Interface XPathEvaluator
1078*/
1079const unsigned short TYPE_ERR = 2;
1080//@}
1081
1082/*---------------------------------------------------------------------------*/
1083/*---------------------------------------------------------------------------*/
1084
1086{
1087 public:
1088 unsigned short code;
1089};
1090
1091/*---------------------------------------------------------------------------*/
1092/*---------------------------------------------------------------------------*/
1093
1095{
1096 public:
1097 XPathExpression createExpression(const DOMString& expression,
1098 const XPathNSResolver& resolver) const;
1099 XPathResult createResult() const;
1100 XPathNSResolver createNSResolver(const Node& node_resolver) const;
1101 XPathResult evaluate(const DOMString& expression,
1102 const Node& context_node,
1103 const XPathNSResolver& resolver,
1104 UShort type,
1105 const XPathResult& result) const;
1106
1107 XPathResult evaluateExpression(const XPathExpression& expression,
1108 const Node& context_node,
1109 UShort type,
1110 const XPathResult& result) const;
1111};
1112
1113/*---------------------------------------------------------------------------*/
1114/*---------------------------------------------------------------------------*/
1115
1117{
1118};
1119
1120/*---------------------------------------------------------------------------*/
1121/*---------------------------------------------------------------------------*/
1122
1124{
1125 public:
1126 DOMString lookupNamespaceURI(const DOMString& prefix) const;
1127};
1128
1129/*---------------------------------------------------------------------------*/
1130/*---------------------------------------------------------------------------*/
1131
1133{
1134 public:
1135 //! @name XPathResultType
1136 //@{
1137 /*!
1138 This code does not represent a specific type. An evaluation of an
1139 XPath expression will never produce this type. If this type is
1140 requested, then the evaluation must return whatever type Integerly
1141 results from evaluation of the expression.
1142 */
1143 static const UShort ANY_TYPE = 0;
1144 //! The result is a number as defined by XPath 1.0.
1145 static const UShort NUMBER_TYPE = 1;
1146 //! The result is a string as defined by XPath 1.0.
1147 static const UShort STRING_TYPE = 2;
1148 //! The result is a boolean as defined by XPath 1.0.
1149 static const UShort BOOLEAN_TYPE = 3;
1150 //! The result is a node set as defined by XPath 1.0.
1151 static const UShort NODE_SET_TYPE = 4;
1152 /*!
1153 The result is a single node, which may be any node of the node set
1154 defined by XPath 1.0, or null if the node set is empty. This is a
1155 convenience that permits optimization where the caller knows that
1156 no more than one such node exists because evaluation can stop
1157 after finding the one node of an expression that would otherwise
1158 return a node set (of type NODE_SET_TYPE).
1159
1160 Where it is possible that multiple nodes may exist and the first
1161 node in document order is required, a NODE_SET_TYPE should be
1162 processed using an ordered iterator, because there is no order
1163 guarantee for a single node.
1164 */
1165 static const UShort SINGLE_NODE_TYPE = 5;
1166 //@}
1167
1168 /*! @name Attribute resultType (DOM Level 3) */
1169 //@{
1170 UShort resultType() const;
1171 //@}
1172
1173 /*! @name Attribute numberValue (DOM Level 3) */
1174 //@{
1175 double numberValue() const;
1176 //@}
1177
1178 /*! @name AttributestringValue (DOM Level 3) */
1179 //@{
1180 DOMString stringValue() const;
1181 //@}
1182
1183 /*! @name Attribute booleanValue (DOM Level 3) */
1184 //@{
1185 bool booleanValue() const;
1186 //@}
1187
1188 /*! @name Attribute singleNodeValue (DOM Level 3) */
1189 //@{
1190 Node singleNodeValue() const;
1191 //@}
1192
1193 /*! @name DOM Level 3 operations */
1194 //@{
1195 XPathSetIterator getSetIterator(bool ordered) const;
1196 XPathSetSnapshot getSetSnapshot(bool ordered) const;
1197 //@}
1198};
1199
1200/*---------------------------------------------------------------------------*/
1201/*---------------------------------------------------------------------------*/
1202
1204{
1205 public:
1206
1207 Node nextNode() const;
1208};
1209
1211{
1212 public:
1213 /*! @name Attribute length (DOM Level 3) */
1214 //@{
1215 ULong length() const;
1216 //@}
1217
1218 /*! @name DOM Level 3 operations */
1219 //@{
1220 Node item(ULong index) const;
1221 //@}
1222};
1223
1224/*---------------------------------------------------------------------------*/
1225/*---------------------------------------------------------------------------*/
1226
1228: public Node
1229{
1230 public:
1231 //! @name XPathNodeType
1232 //@{
1233 //! The node is a Namespace.
1234 static const UShort XPATH_NAMESPACE_NODE = 13;
1235 //@}
1236
1237 /*! @name Attribute ownerElement (DOM Level 3) */
1238 //@{
1239 Element ownerElement() const;
1240 //@}
1241};
1242
1243/*---------------------------------------------------------------------------*/
1244/*---------------------------------------------------------------------------*/
1245
1246}
1247
1248/*---------------------------------------------------------------------------*/
1249/*---------------------------------------------------------------------------*/
1250
1251#endif
1252
Gestionnaire d'un document DOM.
static const UShort SEVERITY_ERROR
The severity of the error described by the DOMError is error.
Definition Dom.h:973
static const UShort SEVERITY_WARNING
The severity of the error described by the DOMError is warning.
Definition Dom.h:971
static const UShort SEVERITY_FATAL_ERROR
The severity of the error described by the DOMError is fatal error.
Definition Dom.h:975
UShort code
The code of the exception.
Definition Dom.h:108
NodePrv * m_p
Implémentation de la classe.
Definition Dom.h:413
static const UShort IMPORTED
The node is imported.
Definition Dom.h:953
static const UShort CLONED
The node is cloned.
Definition Dom.h:951
static const UShort DELETED
The node is deleted.
Definition Dom.h:955
static const UShort XPATH_NAMESPACE_NODE
The node is a Namespace.
Definition Dom.h:1234
static const UShort NUMBER_TYPE
The result is a number as defined by XPath 1.0.
Definition Dom.h:1145
static const UShort SINGLE_NODE_TYPE
Definition Dom.h:1165
static const UShort STRING_TYPE
The result is a string as defined by XPath 1.0.
Definition Dom.h:1147
static const UShort ANY_TYPE
Definition Dom.h:1143
static const UShort BOOLEAN_TYPE
The result is a boolean as defined by XPath 1.0.
Definition Dom.h:1149
static const UShort NODE_SET_TYPE
The result is a node set as defined by XPath 1.0.
Definition Dom.h:1151
Classe de base des vecteurs 1D de données.
Vue constante d'un tableau de type T.
Interface du gestionnaire de traces.
Chaîne de caractères unicode.
Vecteur 1D de données avec sémantique par valeur (style STL).
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Span< const std::byte > ByteConstSpan
Vue en lecture seule d'un tableau à une dimension de caractères.
Definition UtilsTypes.h:759