Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import node_type into rapidxml namespace #24

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading