ProcessingInstruction.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. //
  2. // ProcessingInstruction.h
  3. //
  4. // Library: XML
  5. // Package: DOM
  6. // Module: DOM
  7. //
  8. // Definition of the DOM ProcessingInstruction class.
  9. //
  10. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef DOM_ProcessingInstruction_INCLUDED
  16. #define DOM_ProcessingInstruction_INCLUDED
  17. #include "Poco/XML/XML.h"
  18. #include "Poco/DOM/AbstractNode.h"
  19. #include "Poco/XML/XMLString.h"
  20. namespace Poco {
  21. namespace XML {
  22. class XML_API ProcessingInstruction: public AbstractNode
  23. /// The ProcessingInstruction interface represents a "processing instruction",
  24. /// used in XML as a way to keep processor-specific information in the text
  25. /// of the document.
  26. {
  27. public:
  28. const XMLString& target() const;
  29. /// Returns the target of this processing instruction.
  30. /// XML defines this as being the first token following
  31. /// the markup that begins the processing instruction.
  32. const XMLString& data() const;
  33. /// Returns the content of this processing instruction. This is from the first non
  34. /// white space character after the target to the character immediately preceding
  35. /// the ?>.
  36. const XMLString& getData() const;
  37. /// Returns the content of this processing instruction. This is from the first non
  38. /// white space character after the target to the character immediately preceding
  39. /// the ?>.
  40. void setData(const XMLString& data);
  41. /// Sets the content of this processing instruction.
  42. // Node
  43. const XMLString& nodeName() const;
  44. const XMLString& getNodeValue() const;
  45. void setNodeValue(const XMLString& data);
  46. unsigned short nodeType() const;
  47. protected:
  48. ProcessingInstruction(Document* pOwnerDocument, const XMLString& target, const XMLString& data);
  49. ProcessingInstruction(Document* pOwnerDocument, const ProcessingInstruction& processingInstruction);
  50. ~ProcessingInstruction();
  51. Node* copyNode(bool deep, Document* pOwnerDocument) const;
  52. private:
  53. XMLString _target;
  54. XMLString _data;
  55. friend class Document;
  56. };
  57. //
  58. // inlines
  59. //
  60. inline const XMLString& ProcessingInstruction::target() const
  61. {
  62. return _target;
  63. }
  64. inline const XMLString& ProcessingInstruction::data() const
  65. {
  66. return _data;
  67. }
  68. inline const XMLString& ProcessingInstruction::getData() const
  69. {
  70. return _data;
  71. }
  72. } } // namespace Poco::XML
  73. #endif // DOM_ProcessingInstruction_INCLUDED