Skip to content

Commit

Permalink
Merge pull request #24 from dwd/revert-enum-sort-of
Browse files Browse the repository at this point in the history
Import node_type into rapidxml namespace
  • Loading branch information
dwd authored Sep 10, 2024
2 parents 821208b + 329519d commit 28b12fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
5 changes: 1 addition & 4 deletions rapidxml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ namespace rapidxml
node_pi, //!< A PI node. Name contains target. Value contains instructions.
node_literal //!< Value is unencoded text (used for inserting pre-rendered XML).
};
using enum node_type; // Import this into the rapidxml namespace as before.

///////////////////////////////////////////////////////////////////////
// Parsing flags
Expand Down Expand Up @@ -871,8 +872,6 @@ namespace rapidxml
template<typename Ch = char>
class xml_node: public xml_base<Ch>
{
using enum node_type;

public:
using view_type = std::basic_string_view<Ch>;
using ptr = optional_ptr<xml_node<Ch>>;
Expand Down Expand Up @@ -1594,8 +1593,6 @@ namespace rapidxml
template<class Ch = char>
class xml_document: public xml_node<Ch>, public memory_pool<Ch>
{
using enum node_type;

public:
using view_type = std::basic_string_view<Ch>;
using ptr = optional_ptr<xml_document<Ch>>;
Expand Down
2 changes: 0 additions & 2 deletions rapidxml_print.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,6 @@ namespace rapidxml
// Print proper node type
switch (node->type())
{
using enum node_type;

// Document
case node_document:
out = print_children(out, node, flags, indent);
Expand Down
8 changes: 4 additions & 4 deletions test/manipulations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace {

TEST(Create, Node) {
rapidxml::xml_document<> doc;
auto node = doc.allocate_node(rapidxml::node_type::node_element, "fish", "cakes");
auto node = doc.allocate_node(rapidxml::node_element, "fish", "cakes");
doc.append_node(node);

EXPECT_EQ(
Expand All @@ -28,7 +28,7 @@ TEST(Create, Node) {

TEST(Create, NodeEmpty) {
rapidxml::xml_document<> doc;
auto node = doc.allocate_node(rapidxml::node_type::node_element, "fish");
auto node = doc.allocate_node(rapidxml::node_element, "fish");
doc.append_node(node);

EXPECT_EQ(
Expand All @@ -39,7 +39,7 @@ TEST(Create, NodeEmpty) {

TEST(Create, Node2) {
rapidxml::xml_document<> doc;
auto node = doc.allocate_node(rapidxml::node_type::node_element, "fish", "cakes");
auto node = doc.allocate_node(rapidxml::node_element, "fish", "cakes");
doc.append_node(node);

EXPECT_EQ(
Expand All @@ -56,7 +56,7 @@ std::string const & fn() {

TEST(Create, NodeAttr) {
rapidxml::xml_document<> doc;
auto node = doc.allocate_node(rapidxml::node_type::node_element, "fish", "cakes");
auto node = doc.allocate_node(rapidxml::node_element, "fish", "cakes");
auto haddock = doc.allocate_attribute("id", "haddock");
node->append_attribute(haddock);
doc.append_node(node);
Expand Down

0 comments on commit 28b12fe

Please sign in to comment.