Merge pull request #1219 from vmiklos/pagecompiler-wshadow-fixes

GH #1050 PageCompiler: fix gcc -Wshadow warnings
This commit is contained in:
Aleksandar Fabijanic 2016-03-29 22:00:49 -07:00
commit 8f8e637fde
6 changed files with 51 additions and 51 deletions

View File

@ -103,8 +103,8 @@ void RecordSet::reset(const Statement& stmt)
_totalRowCount = UNKNOWN_TOTAL_ROW_COUNT; _totalRowCount = UNKNOWN_TOTAL_ROW_COUNT;
RowMap::iterator it = _rowMap.begin(); RowMap::iterator it = _rowMap.begin();
RowMap::iterator end = _rowMap.end(); RowMap::iterator itEnd = _rowMap.end();
for (; it != end; ++it) delete it->second; for (; it != itEnd; ++it) delete it->second;
_rowMap.clear(); _rowMap.clear();
Statement::operator = (stmt); Statement::operator = (stmt);

View File

@ -63,52 +63,52 @@ protected:
// add your own reinitialization code here // add your own reinitialization code here
} }
void defineOptions(OptionSet& options) void defineOptions(OptionSet& rOptions)
{ {
Application::defineOptions(options); Application::defineOptions(rOptions);
options.addOption( rOptions.addOption(
Option("help", "h", "Display help information on command line arguments.") Option("help", "h", "Display help information on command line arguments.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleHelp))); .callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleHelp)));
options.addOption( rOptions.addOption(
Option("contentType", "t", "Specify a content type.") Option("contentType", "t", "Specify a content type.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.argument("MIME-Type") .argument("MIME-Type")
.callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleContentType))); .callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleContentType)));
options.addOption( rOptions.addOption(
Option("contentLanguage", "l", "Specify a content language.") Option("contentLanguage", "l", "Specify a content language.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.argument("language") .argument("language")
.callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleContentLang))); .callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleContentLang)));
options.addOption( rOptions.addOption(
Option("class", "c", "Specify the handler class name.") Option("class", "c", "Specify the handler class name.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.argument("class-name") .argument("class-name")
.callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleClassName))); .callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleClassName)));
options.addOption( rOptions.addOption(
Option("namespace", "n", "Specify the handler class namespace name.") Option("namespace", "n", "Specify the handler class namespace name.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.argument("namespace-name") .argument("namespace-name")
.callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleNamespace))); .callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleNamespace)));
options.addOption( rOptions.addOption(
Option("output", "o", "Specify the output file name.") Option("output", "o", "Specify the output file name.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.argument("path") .argument("path")
.callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleOutput))); .callback(OptionCallback<File2PageApp>(this, &File2PageApp::handleOutput)));
options.addOption( rOptions.addOption(
Option("path", "p", "Specify the server path of the file.") Option("path", "p", "Specify the server path of the file.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
@ -116,39 +116,39 @@ protected:
.callback(OptionCallback<File2PageApp>(this, &File2PageApp::handlePath))); .callback(OptionCallback<File2PageApp>(this, &File2PageApp::handlePath)));
} }
void handleHelp(const std::string& name, const std::string& value) void handleHelp(const std::string& rName, const std::string& value)
{ {
_helpRequested = true; _helpRequested = true;
displayHelp(); displayHelp();
stopOptionsProcessing(); stopOptionsProcessing();
} }
void handleContentType(const std::string& name, const std::string& value) void handleContentType(const std::string& rName, const std::string& value)
{ {
_contentType = value; _contentType = value;
} }
void handleContentLang(const std::string& name, const std::string& value) void handleContentLang(const std::string& rName, const std::string& value)
{ {
_contentLang = value; _contentLang = value;
} }
void handleClassName(const std::string& name, const std::string& value) void handleClassName(const std::string& rName, const std::string& value)
{ {
_clazz = value; _clazz = value;
} }
void handleNamespace(const std::string& name, const std::string& value) void handleNamespace(const std::string& rName, const std::string& value)
{ {
_namespace = value; _namespace = value;
} }
void handleOutput(const std::string& name, const std::string& value) void handleOutput(const std::string& rName, const std::string& value)
{ {
_output = value; _output = value;
} }
void handlePath(const std::string& name, const std::string& value) void handlePath(const std::string& rName, const std::string& value)
{ {
_path = value; _path = value;
} }

View File

@ -14,8 +14,8 @@
#include "Page.h" #include "Page.h"
ApacheCodeWriter::ApacheCodeWriter(const Page& page, const std::string& clazz): ApacheCodeWriter::ApacheCodeWriter(const Page& rPage, const std::string& rClazz):
CodeWriter(page, clazz) CodeWriter(rPage, rClazz)
{ {
} }

View File

@ -21,9 +21,9 @@ using Poco::Path;
using Poco::StringTokenizer; using Poco::StringTokenizer;
CodeWriter::CodeWriter(const Page& page, const std::string& clazz): CodeWriter::CodeWriter(const Page& rPage, const std::string& rClazz):
_page(page), _page(rPage),
_class(clazz) _class(rClazz)
{ {
} }

View File

@ -15,8 +15,8 @@
#include "Poco/NumberParser.h" #include "Poco/NumberParser.h"
OSPCodeWriter::OSPCodeWriter(const Page& page, const std::string& clazz): OSPCodeWriter::OSPCodeWriter(const Page& rPage, const std::string& rClazz):
CodeWriter(page, clazz) CodeWriter(rPage, rClazz)
{ {
} }

View File

@ -71,17 +71,17 @@ protected:
Application::initialize(self); Application::initialize(self);
} }
void defineOptions(OptionSet& options) void defineOptions(OptionSet& rOptions)
{ {
Application::defineOptions(options); Application::defineOptions(rOptions);
options.addOption( rOptions.addOption(
Option("help", "h", "Display help information on command line arguments.") Option("help", "h", "Display help information on command line arguments.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleHelp))); .callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleHelp)));
options.addOption( rOptions.addOption(
Option("define", "D", Option("define", "D",
"Define a configuration property. A configuration property " "Define a configuration property. A configuration property "
"defined with this option can be referenced in the input " "defined with this option can be referenced in the input "
@ -91,109 +91,109 @@ protected:
.argument("<name>=<value>") .argument("<name>=<value>")
.callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleDefine))); .callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleDefine)));
options.addOption( rOptions.addOption(
Option("config-file", "f", "Load configuration data from the given file.") Option("config-file", "f", "Load configuration data from the given file.")
.required(false) .required(false)
.repeatable(true) .repeatable(true)
.argument("<file>") .argument("<file>")
.callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleConfig))); .callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleConfig)));
options.addOption( rOptions.addOption(
Option("output-dir", "o", "Write output files to directory <dir>.") Option("output-dir", "o", "Write output files to directory <dir>.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.argument("<dir>") .argument("<dir>")
.callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleOutputDir))); .callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleOutputDir)));
options.addOption( rOptions.addOption(
Option("header-output-dir", "H", "Write header file to directory <dir>.") Option("header-output-dir", "H", "Write header file to directory <dir>.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.argument("<dir>") .argument("<dir>")
.callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleHeaderOutputDir))); .callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleHeaderOutputDir)));
options.addOption( rOptions.addOption(
Option("header-prefix", "P", "Prepend the given <prefix> to the header file name in the generated #include directive.") Option("header-prefix", "P", "Prepend the given <prefix> to the header file name in the generated #include directive.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.argument("<prefix>") .argument("<prefix>")
.callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleHeaderPrefix))); .callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleHeaderPrefix)));
options.addOption( rOptions.addOption(
Option("base-file-name", "b", "Use <name> instead of the class name for the output file name.") Option("base-file-name", "b", "Use <name> instead of the class name for the output file name.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.argument("<name>") .argument("<name>")
.callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleBase))); .callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleBase)));
options.addOption( rOptions.addOption(
Option("osp", "O", "Add factory class definition and implementation for use with the Open Service Platform.") Option("osp", "O", "Add factory class definition and implementation for use with the Open Service Platform.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleOSP))); .callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleOSP)));
options.addOption( rOptions.addOption(
Option("apache", "A", "Add factory class definition and implementation, and shared library manifest for use with ApacheConnector.") Option("apache", "A", "Add factory class definition and implementation, and shared library manifest for use with ApacheConnector.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleApache))); .callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleApache)));
options.addOption( rOptions.addOption(
Option("noline", "N", "Do not include #line directives in generated code.") Option("noline", "N", "Do not include #line directives in generated code.")
.required(false) .required(false)
.repeatable(false) .repeatable(false)
.callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleNoLine))); .callback(OptionCallback<CompilerApp>(this, &CompilerApp::handleNoLine)));
} }
void handleHelp(const std::string& name, const std::string& value) void handleHelp(const std::string& rName, const std::string& value)
{ {
_helpRequested = true; _helpRequested = true;
stopOptionsProcessing(); stopOptionsProcessing();
} }
void handleDefine(const std::string& name, const std::string& value) void handleDefine(const std::string& rName, const std::string& value)
{ {
defineProperty(value); defineProperty(value);
} }
void handleConfig(const std::string& name, const std::string& value) void handleConfig(const std::string& rName, const std::string& value)
{ {
loadConfiguration(value); loadConfiguration(value);
} }
void handleOutputDir(const std::string& name, const std::string& value) void handleOutputDir(const std::string& rName, const std::string& value)
{ {
_outputDir = value; _outputDir = value;
} }
void handleHeaderOutputDir(const std::string& name, const std::string& value) void handleHeaderOutputDir(const std::string& rName, const std::string& value)
{ {
_headerOutputDir = value; _headerOutputDir = value;
} }
void handleHeaderPrefix(const std::string& name, const std::string& value) void handleHeaderPrefix(const std::string& rName, const std::string& value)
{ {
_headerPrefix = value; _headerPrefix = value;
if (!_headerPrefix.empty() && _headerPrefix[_headerPrefix.size() - 1] != '/') if (!_headerPrefix.empty() && _headerPrefix[_headerPrefix.size() - 1] != '/')
_headerPrefix += '/'; _headerPrefix += '/';
} }
void handleBase(const std::string& name, const std::string& value) void handleBase(const std::string& rName, const std::string& value)
{ {
_base = value; _base = value;
} }
void handleOSP(const std::string& name, const std::string& value) void handleOSP(const std::string& rName, const std::string& value)
{ {
_generateOSPCode = true; _generateOSPCode = true;
} }
void handleApache(const std::string& name, const std::string& value) void handleApache(const std::string& rName, const std::string& value)
{ {
_generateApacheCode = true; _generateApacheCode = true;
} }
void handleNoLine(const std::string& name, const std::string& value) void handleNoLine(const std::string& rName, const std::string& value)
{ {
_emitLineDirectives = false; _emitLineDirectives = false;
} }
@ -223,16 +223,16 @@ protected:
void defineProperty(const std::string& def) void defineProperty(const std::string& def)
{ {
std::string name; std::string configName;
std::string value; std::string value;
std::string::size_type pos = def.find('='); std::string::size_type pos = def.find('=');
if (pos != std::string::npos) if (pos != std::string::npos)
{ {
name.assign(def, 0, pos); configName.assign(def, 0, pos);
value.assign(def, pos + 1, def.length() - pos); value.assign(def, pos + 1, def.length() - pos);
} }
else name = def; else configName = def;
config().setString(name, value); config().setString(configName, value);
} }
int main(const std::vector<std::string>& args) int main(const std::vector<std::string>& args)