Skip to content

Commit a984012

Browse files
authored
Merge pull request #75 from mensinda/fixObjNs
Fix closing object namespace (fixes #74)
2 parents 14ee4b9 + aff1536 commit a984012

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/SchemaGenerator.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace fs = std::filesystem;
2222

2323

2424
namespace graphql::schema {
25-
25+
2626
NamespaceScope::NamespaceScope(std::ostream& outputFile, std::string_view cppNamespace, bool deferred /*= false*/) noexcept
2727
: _outputFile(outputFile)
2828
, _cppNamespace(cppNamespace)
@@ -1663,8 +1663,10 @@ class Schema;
16631663
outputObjectDeclaration(headerFile, objectType, objectType.type == queryType);
16641664
headerFile << std::endl;
16651665
}
1666+
}
16661667

1667-
objectNamespace.exit();
1668+
if (objectNamespace.exit())
1669+
{
16681670
headerFile << std::endl;
16691671
}
16701672

@@ -3242,7 +3244,7 @@ std::vector<std::string> Generator::outputSeparateFiles() const noexcept
32423244
{
32433245
files.push_back({ _objectHeaderPath });
32443246
}
3245-
3247+
32463248
for (const auto& objectType : _objectTypes)
32473249
{
32483250
std::ostringstream ossNamespace;
@@ -3468,7 +3470,7 @@ int main(int argc, char** argv)
34683470
<< " column: " << position.byte_in_line
34693471
<< std::endl;
34703472
}
3471-
3473+
34723474
return 1;
34733475
}
34743476
catch (const std::runtime_error& ex)

0 commit comments

Comments
 (0)