Misc idl_gen_cpp cleanup

- Update to be const-correct where possible.
- Consistently pass |code| as pointer instead of non-const-ref.
- No newlines (\n) characters in the middle of code strings.
- Use if-else if-else statements instead of nested ternary operators.
- Ensure all lines end at 80 chars.
- Make utility functions static.

From cl/143505731.

Change-Id: If0fab9ee75de5af963367a948dddf53af93f73b4
This commit is contained in:
Wouter van Oortmerssen
2017-01-04 10:12:39 -08:00
parent b29ba4c70c
commit cc84240098
8 changed files with 647 additions and 399 deletions

View File

@@ -276,7 +276,7 @@ class GeneralGenerator : public BaseGenerator {
return SaveFile(filename.c_str(), code, false);
}
const Namespace *CurrentNameSpace() { return cur_name_space_; }
const Namespace *CurrentNameSpace() const { return cur_name_space_; }
std::string FunctionStart(char upper) {
return std::string() + (lang_.language == IDLOptions::kJava