26 lines
943 B
C++
26 lines
943 B
C++
/// @file
|
|
/// @brief Task2: Abstract base class used as interface to implement serialization of XML elements
|
|
|
|
#pragma once
|
|
|
|
#include <string> // std::string
|
|
|
|
namespace task2 {
|
|
|
|
///@brief XML element interface
|
|
struct Element {
|
|
|
|
virtual std::string open() const = 0; ///< returns the opening or self-closing tag of an XML element
|
|
virtual std::string text() const = 0; ///< returns the content tag of an XML element
|
|
virtual std::string close() const = 0; ///< returns the closing tag of an XML element
|
|
|
|
virtual ~Element() = default; ///< enable deletion of derived object instances via a base pointer
|
|
|
|
protected: ///< only accessible form within a derived class
|
|
Element() = default; ///< default constructor
|
|
Element(const Element&) = default; ///< copy constructor
|
|
Element& operator=(const Element&) = default; ///< copy assignment
|
|
};
|
|
|
|
} // namespace task2
|