Skip to content

Commit 218e7d9

Browse files
committed
Stop generating the convenience header
1 parent 875843c commit 218e7d9

File tree

6 files changed

+0
-172
lines changed

6 files changed

+0
-172
lines changed

include/SchemaGenerator.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class Generator
3838
std::string getHeaderDir() const noexcept;
3939
std::string getSourceDir() const noexcept;
4040
std::string getHeaderPath() const noexcept;
41-
std::string getObjectHeaderPath() const noexcept;
4241
std::string getSourcePath() const noexcept;
4342

4443
bool outputHeader() const noexcept;
@@ -80,7 +79,6 @@ class Generator
8079
const std::string _headerDir;
8180
const std::string _sourceDir;
8281
const std::string _headerPath;
83-
const std::string _objectHeaderPath;
8482
const std::string _sourcePath;
8583
};
8684

samples/learn/schema/StarWarsObjects.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

samples/today/nointrospection/TodayObjects.h

Lines changed: 0 additions & 32 deletions
This file was deleted.

samples/today/schema/TodayObjects.h

Lines changed: 0 additions & 32 deletions
This file was deleted.

samples/validation/schema/ValidationObjects.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/SchemaGenerator.cpp

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Generator::Generator(std::optional<SchemaOptions>&& customSchema, GeneratorOptio
5353
, _headerDir(getHeaderDir())
5454
, _sourceDir(getSourceDir())
5555
, _headerPath(getHeaderPath())
56-
, _objectHeaderPath(getObjectHeaderPath())
5756
, _sourcePath(getSourcePath())
5857
{
5958
}
@@ -90,19 +89,6 @@ std::string Generator::getHeaderPath() const noexcept
9089
return fullPath.string();
9190
}
9291

93-
std::string Generator::getObjectHeaderPath() const noexcept
94-
{
95-
if (!_options.mergeFiles)
96-
{
97-
fs::path fullPath { _headerDir };
98-
99-
fullPath /= (std::string { _loader.getFilenamePrefix() } + "Objects.h");
100-
return fullPath.string();
101-
}
102-
103-
return _headerPath;
104-
}
105-
10692
std::string Generator::getSourcePath() const noexcept
10793
{
10894
fs::path fullPath { _sourceDir };
@@ -1731,8 +1717,6 @@ Operations::Operations()cpp";
17311717
{
17321718
sourceFile << std::endl;
17331719

1734-
const std::vector<std::string_view> emptyInterfaces {};
1735-
17361720
for (const auto& interfaceType : _loader.getInterfaceTypes())
17371721
{
17381722
if (!_options.mergeFiles)
@@ -2745,47 +2729,6 @@ std::vector<std::string> Generator::outputSeparateFiles() const noexcept
27452729
}
27462730
}
27472731

2748-
// Output a convenience header
2749-
std::ofstream objectHeaderFile(_objectHeaderPath, std::ios_base::trunc);
2750-
IncludeGuardScope includeGuard { objectHeaderFile,
2751-
fs::path(_objectHeaderPath).filename().string() };
2752-
2753-
objectHeaderFile << R"cpp(#include ")cpp" << fs::path(_headerPath).filename().string()
2754-
<< R"cpp("
2755-
2756-
)cpp";
2757-
2758-
for (const auto& interfaceType : _loader.getInterfaceTypes())
2759-
{
2760-
const auto headerFilename = std::string(interfaceType.cppType) + "Object.h";
2761-
2762-
objectHeaderFile << R"cpp(#include ")cpp" << headerFilename << R"cpp("
2763-
)cpp";
2764-
}
2765-
2766-
for (const auto& unionType : _loader.getUnionTypes())
2767-
{
2768-
const auto headerFilename = std::string(unionType.cppType) + "Object.h";
2769-
2770-
objectHeaderFile << R"cpp(#include ")cpp" << headerFilename << R"cpp("
2771-
)cpp";
2772-
}
2773-
2774-
for (const auto& objectType : _loader.getObjectTypes())
2775-
{
2776-
const auto headerFilename = std::string(objectType.cppType) + "Object.h";
2777-
2778-
objectHeaderFile << R"cpp(#include ")cpp" << headerFilename << R"cpp("
2779-
)cpp";
2780-
}
2781-
2782-
if (_options.verbose)
2783-
{
2784-
files.push_back({ _objectHeaderPath });
2785-
}
2786-
2787-
const std::vector<std::string_view> emptyInterfacesAndUnions {};
2788-
27892732
for (const auto& interfaceType : _loader.getInterfaceTypes())
27902733
{
27912734
const auto headerFilename = std::string(interfaceType.cppType) + "Object.h";

0 commit comments

Comments
 (0)