Skip to content

InscoperAPI/API/Shared/XML/XMLNode.h

Namespaces

Name
Inscoper
Inscoper namespace.

Classes

Name
class Inscoper::XMLNode
XMLNode class represents a node in an XML document.

Source code

#ifndef XMLNODE_H
#define XMLNODE_H

#include <Global.h>
#include <Shared/XML/XMLAttribute.h>

#include <sstream>
#include <vector>

namespace Inscoper {
class INSCOPER_EXPORT XMLNode {
public:
  XMLNode();

  XMLNode(XMLNode const &node);

  XMLNode(XMLNode &&node);

  XMLNode &operator=(XMLNode const &node);

  XMLNode &operator=(XMLNode &&node);

  ~XMLNode();

  XMLNode addChild(std::string childName = "");

  void removeChild(std::string childName);

  XMLNode getChild(const std::string &name);

  std::vector<XMLNode> getChildren(const std::string &name);

  std::vector<XMLNode> getChildren();

  void setName(const std::string &name);

  std::string getName();

  bool isEmpty();

  void addAttribute(const std::string &name, const std::string &value);

  void addAttribute(const std::string &name, const bool value);

  void addAttribute(const std::string &name, const unsigned int value);

  void addAttribute(const std::string &name, const unsigned short value);

  void addAttribute(const std::string &name, unsigned char value);

  void addAttribute(const std::string &name, char value);

  void addAttribute(const std::string &name, double value);

  Inscoper::XMLAttribute getAttribute(const std::string &name);

  std::vector<Inscoper::XMLAttribute> getAttributes();

  void addCDATA(const std::string &content);

  std::string getText();

private:
  class XMLNodeImpl;
  XMLNodeImpl *pimpl;
  friend class XMLDocument;
};

} // namespace Inscoper

#endif // XMLNODE_H

Updated on 2026-09-03 at 12:14:17 +0200