Commit 0328deda authored by lakedaemon's avatar lakedaemon

clangFormating base class

parent b22db6e8
...@@ -39,8 +39,8 @@ class BaseGenerator { ...@@ -39,8 +39,8 @@ class BaseGenerator {
protected: protected:
BaseGenerator(const Parser &parser, const std::string &path, BaseGenerator(const Parser &parser, const std::string &path,
const std::string &file_name, const std::string &file_name,
const std::string qualifying_start, const std::string qualifying_start,
const std::string qualifying_separator) const std::string qualifying_separator)
: parser_(parser), : parser_(parser),
path_(path), path_(path),
...@@ -86,15 +86,18 @@ class BaseGenerator { ...@@ -86,15 +86,18 @@ class BaseGenerator {
const std::string LastNamespacePart(const Namespace &ns) { const std::string LastNamespacePart(const Namespace &ns) {
auto &namespaces = ns.components; auto &namespaces = ns.components;
if (namespaces.size()) return *(namespaces.end() - 1); else return std::string(""); if (namespaces.size())
return *(namespaces.end() - 1);
else
return std::string("");
} }
// tracks the current namespace for early exit in WrapInNameSpace // tracks the current namespace for early exit in WrapInNameSpace
// c++, java and csharp returns a different namespace from // c++, java and csharp returns a different namespace from
// the following default (no early exit, always fully qualify), // the following default (no early exit, always fully qualify),
// which works for js and php // which works for js and php
virtual const Namespace *CurrentNameSpace() { return nullptr; } virtual const Namespace *CurrentNameSpace() { return nullptr; }
// Ensure that a type is prefixed with its namespace whenever it is used // Ensure that a type is prefixed with its namespace whenever it is used
// outside of its namespace. // outside of its namespace.
std::string WrapInNameSpace(const Namespace *ns, const std::string &name) { std::string WrapInNameSpace(const Namespace *ns, const std::string &name) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment