Skip to content

Commit be92b75

Browse files
committed
Minimize exported public headers
1 parent 9bb198e commit be92b75

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ install(TARGETS graphqlpeg graphqlservice schemagen
106106
ARCHIVE DESTINATION lib
107107
LIBRARY DESTINATION lib)
108108

109-
install(FILES GraphQLService.h Introspection.h IntrospectionSchema.h
109+
install(FILES GraphQLService.h GraphQLTree.h Introspection.h IntrospectionSchema.h
110110
DESTINATION include/graphqlservice)
111111

112112
if(WIN32)

GraphQLGrammar.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ namespace peg {
1414

1515
using namespace tao::pegtl;
1616

17+
template <typename _Rule>
18+
void for_each_child(const ast_node& n, std::function<bool(const ast_node&)>&& func)
19+
{
20+
for (const auto& child : n.children)
21+
{
22+
if (child->is<_Rule>()
23+
&& !func(*child))
24+
{
25+
return;
26+
}
27+
}
28+
}
29+
1730
// https://facebook.github.io/graphql/June2018/#sec-Source-Text
1831
struct source_character
1932
: sor<one<0x0009, 0x000A, 0x000D>

GraphQLService.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "GraphQLService.h"
55
#include "GraphQLTree.h"
6+
#include "GraphQLGrammar.h"
67

78
#include <iostream>
89
#include <algorithm>

GraphQLTree.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
#include "GraphQLTree.h"
5+
#include "GraphQLGrammar.h"
56

67
#include <tao/pegtl/contrib/unescape.hpp>
78

GraphQLTree.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
#pragma once
55

6-
#include "GraphQLGrammar.h"
7-
6+
#include <tao/pegtl.hpp>
87
#include <tao/pegtl/contrib/parse_tree.hpp>
98

109
#include <string>
@@ -22,19 +21,6 @@ struct ast_node
2221
std::string unescaped;
2322
};
2423

25-
template <typename _Rule>
26-
void for_each_child(const ast_node& n, std::function<bool(const ast_node&)>&& func)
27-
{
28-
for (const auto& child : n.children)
29-
{
30-
if (child->is<_Rule>()
31-
&& !func(*child))
32-
{
33-
return;
34-
}
35-
}
36-
}
37-
3824
std::unique_ptr<ast_node> parseString(const char* text);
3925
std::unique_ptr<ast_node> parseFile(file_input<>&& in);
4026

SchemaGenerator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "SchemaGenerator.h"
55
#include "GraphQLTree.h"
6+
#include "GraphQLGrammar.h"
67

78
#include <stdexcept>
89
#include <iostream>

tests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "Today.h"
77
#include "GraphQLTree.h"
8+
#include "GraphQLGrammar.h"
89

910
#include <tao/pegtl/analyze.hpp>
1011

0 commit comments

Comments
 (0)