We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Could you add the code below in order to support the using namespace directive?
using namespace
diff --git a/pub/cppwriter.h b/pub/cppwriter.h index 5b9e3a81..e2541d48 100644 --- a/pub/cppwriter.h +++ b/pub/cppwriter.h @@ -66,6 +66,9 @@ public: virtual void emitUsingDecl(const CppUsingDecl* usingDecl, std::ostream& stm, CppIndent indentation = CppIndent()) const; + virtual void emitUsingNamespaceDecl(const CppUsingNamespaceDecl* usingDecl, + std::ostream& stm, + CppIndent indentation = CppIndent()) const; virtual void emitTypedefList(const CppTypedefList* typedefList, std::ostream& stm, CppIndent indentation = CppIndent()) const; diff --git a/src/cppwriter.cpp b/src/cppwriter.cpp index 89034bcd..2ed6a738 100644 --- a/src/cppwriter.cpp +++ b/src/cppwriter.cpp @@ -106,6 +106,8 @@ void CppWriter::emit(const CppObj* cppObj, std::ostream& stm, CppIndent indentat return emitDocComment((CppDocComment*) cppObj, stm, indentation); case CppObjType::kUsingDecl: return emitUsingDecl((CppUsingDecl*) cppObj, stm, indentation); + case CppObjType::kUsingNamespaceDecl: + return emitUsingNamespaceDecl((CppUsingNamespaceDecl*) cppObj, stm, indentation); case CppObjType::kTypedefName: return emitTypedef((CppTypedefName*) cppObj, stm, indentation); case CppObjType::kTypedefNameList: @@ -411,6 +413,13 @@ void CppWriter::emitUsingDecl(const CppUsingDecl* usingDecl, stm << ";\n"; } +void CppWriter::emitUsingNamespaceDecl(const CppUsingNamespaceDecl* usingDecl, + std::ostream& stm, + CppIndent indentation /* = CppIndent()*/) const +{ + stm << indentation << "using namespace " << usingDecl->name_ << ";\n"; +} + void CppWriter::emitTypedefList(const CppTypedefList* typedefList, std::ostream& stm, CppIndent indentation /* = CppIndent()*/) const
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Could you add the code below in order to support the
using namespace
directive?The text was updated successfully, but these errors were encountered: