CPackWiX: adhere to CMake member naming convention

This commit is contained in:
Nils Gladitz 2013-12-20 18:12:01 +01:00
parent 6820882be5
commit 37a1157aa9
8 changed files with 108 additions and 108 deletions

View File

@ -85,8 +85,8 @@ bool cmCPackWIXGenerator::RunCandleCommand(
command << " -arch " << GetArchitecture();
command << " -out " << QuotePath(objectFile);
for(extension_set_t::const_iterator i = candleExtensions.begin();
i != candleExtensions.end(); ++i)
for(extension_set_t::const_iterator i = CandleExtensions.begin();
i != CandleExtensions.end(); ++i)
{
command << " -ext " << QuotePath(*i);
}
@ -111,8 +111,8 @@ bool cmCPackWIXGenerator::RunLightCommand(const std::string& objectFiles)
command << " -nologo";
command << " -out " << QuotePath(packageFileNames.at(0));
for(extension_set_t::const_iterator i = lightExtensions.begin();
i != lightExtensions.end(); ++i)
for(extension_set_t::const_iterator i = LightExtensions.begin();
i != LightExtensions.end(); ++i)
{
command << " -ext " << QuotePath(*i);
}
@ -211,12 +211,12 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
SetOption("CPACK_WIX_UI_REF", defaultRef.c_str());
}
CollectExtensions("CPACK_WIX_EXTENSIONS", candleExtensions);
CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", candleExtensions);
CollectExtensions("CPACK_WIX_EXTENSIONS", CandleExtensions);
CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", CandleExtensions);
lightExtensions.insert("WixUIExtension");
CollectExtensions("CPACK_WIX_EXTENSIONS", lightExtensions);
CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", lightExtensions);
LightExtensions.insert("WixUIExtension");
CollectExtensions("CPACK_WIX_EXTENSIONS", LightExtensions);
CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", LightExtensions);
const char* patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
if(patchFilePath)
@ -247,9 +247,9 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
AppendUserSuppliedExtraSources();
std::stringstream objectFiles;
for(size_t i = 0; i < wixSources.size(); ++i)
for(size_t i = 0; i < WixSources.size(); ++i)
{
const std::string& sourceFilename = wixSources[i];
const std::string& sourceFilename = WixSources[i];
std::string objectFilename =
cmSystemTools::GetFilenameWithoutExtension(sourceFilename) + ".wixobj";
@ -272,7 +272,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
const char *cpackWixExtraSources = GetOption("CPACK_WIX_EXTRA_SOURCES");
if(!cpackWixExtraSources) return;
cmSystemTools::ExpandListArgument(cpackWixExtraSources, wixSources);
cmSystemTools::ExpandListArgument(cpackWixExtraSources, WixSources);
}
void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
@ -351,7 +351,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
std::string directoryDefinitionsFilename =
cpackTopLevel + "/directories.wxs";
wixSources.push_back(directoryDefinitionsFilename);
WixSources.push_back(directoryDefinitionsFilename);
cmWIXSourceWriter directoryDefinitions(Logger, directoryDefinitionsFilename);
directoryDefinitions.BeginElement("Fragment");
@ -406,7 +406,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
std::string fileDefinitionsFilename =
cpackTopLevel + "/files.wxs";
wixSources.push_back(fileDefinitionsFilename);
WixSources.push_back(fileDefinitionsFilename);
cmWIXSourceWriter fileDefinitions(Logger, fileDefinitionsFilename);
fileDefinitions.BeginElement("Fragment");
@ -414,7 +414,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
std::string featureDefinitionsFilename =
cpackTopLevel +"/features.wxs";
wixSources.push_back(featureDefinitionsFilename);
WixSources.push_back(featureDefinitionsFilename);
cmWIXSourceWriter featureDefinitions(Logger, featureDefinitionsFilename);
featureDefinitions.BeginElement("Fragment");
@ -533,11 +533,11 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
return false;
}
wixSources.push_back(mainSourceFilePath);
WixSources.push_back(mainSourceFilePath);
std::string fragmentList;
for(cmWIXPatchParser::fragment_map_t::const_iterator
i = fragments.begin(); i != fragments.end(); ++i)
i = Fragments.begin(); i != Fragments.end(); ++i)
{
if(!fragmentList.empty())
{
@ -1018,8 +1018,8 @@ std::string cmCPackWIXGenerator::GetRightmostExtension(
std::string cmCPackWIXGenerator::PathToId(const std::string& path)
{
id_map_t::const_iterator i = pathToIdMap.find(path);
if(i != pathToIdMap.end()) return i->second;
id_map_t::const_iterator i = PathToIdMap.find(path);
if(i != PathToIdMap.end()) return i->second;
std::string id = CreateNewIdForPath(path);
return id;
@ -1056,7 +1056,7 @@ std::string cmCPackWIXGenerator::CreateNewIdForPath(const std::string& path)
std::stringstream result;
result << idPrefix << "_" << identifier;
size_t ambiguityCount = ++idAmbiguityCounter[identifier];
size_t ambiguityCount = ++IdAmbiguityCounter[identifier];
if(ambiguityCount > 999)
{
@ -1073,7 +1073,7 @@ std::string cmCPackWIXGenerator::CreateNewIdForPath(const std::string& path)
std::string resultString = result.str();
pathToIdMap[path] = resultString;
PathToIdMap[path] = resultString;
return resultString;
}
@ -1181,15 +1181,15 @@ void cmCPackWIXGenerator::CreateStartMenuFolder(
void cmCPackWIXGenerator::LoadPatchFragments(const std::string& patchFilePath)
{
cmWIXPatchParser parser(fragments, Logger);
cmWIXPatchParser parser(Fragments, Logger);
parser.ParseFile(patchFilePath.c_str());
}
void cmCPackWIXGenerator::ApplyPatchFragment(
const std::string& id, cmWIXSourceWriter& writer)
{
cmWIXPatchParser::fragment_map_t::iterator i = fragments.find(id);
if(i == fragments.end()) return;
cmWIXPatchParser::fragment_map_t::iterator i = Fragments.find(id);
if(i == Fragments.end()) return;
const cmWIXPatchElement& fragment = i->second;
for(cmWIXPatchElement::child_list_t::const_iterator
@ -1198,7 +1198,7 @@ void cmCPackWIXGenerator::ApplyPatchFragment(
ApplyPatchElement(**j, writer);
}
fragments.erase(i);
Fragments.erase(i);
}
void cmCPackWIXGenerator::ApplyPatchElement(

View File

@ -169,14 +169,14 @@ private:
void ApplyPatchElement(const cmWIXPatchElement& element,
cmWIXSourceWriter& writer);
std::vector<std::string> wixSources;
id_map_t pathToIdMap;
ambiguity_map_t idAmbiguityCounter;
std::vector<std::string> WixSources;
id_map_t PathToIdMap;
ambiguity_map_t IdAmbiguityCounter;
extension_set_t candleExtensions;
extension_set_t lightExtensions;
extension_set_t CandleExtensions;
extension_set_t LightExtensions;
cmWIXPatchParser::fragment_map_t fragments;
cmWIXPatchParser::fragment_map_t Fragments;
};
#endif

View File

@ -27,9 +27,9 @@ cmWIXPatchElement::~cmWIXPatchElement()
cmWIXPatchParser::cmWIXPatchParser(
fragment_map_t& fragments, cmCPackLog* logger):
Logger(logger),
state(BEGIN_DOCUMENT),
valid(true),
fragments(fragments)
State(BEGIN_DOCUMENT),
Valid(true),
Fragments(fragments)
{
}
@ -37,22 +37,22 @@ cmWIXPatchParser::cmWIXPatchParser(
void cmWIXPatchParser::StartElement(const char *name, const char **atts)
{
std::string name_str = name;
if(state == BEGIN_DOCUMENT)
if(State == BEGIN_DOCUMENT)
{
if(name_str == "CPackWiXPatch")
{
state = BEGIN_FRAGMENTS;
State = BEGIN_FRAGMENTS;
}
else
{
ReportValidationError("Expected root element 'CPackWiXPatch'");
}
}
else if(state == BEGIN_FRAGMENTS)
else if(State == BEGIN_FRAGMENTS)
{
if(name_str == "CPackWiXFragment")
{
state = INSIDE_FRAGMENT;
State = INSIDE_FRAGMENT;
StartFragment(atts);
}
else
@ -60,9 +60,9 @@ void cmWIXPatchParser::StartElement(const char *name, const char **atts)
ReportValidationError("Expected 'CPackWixFragment' element");
}
}
else if(state == INSIDE_FRAGMENT)
else if(State == INSIDE_FRAGMENT)
{
cmWIXPatchElement &parent = *elementStack.back();
cmWIXPatchElement &parent = *ElementStack.back();
parent.children.resize(parent.children.size() + 1);
cmWIXPatchElement*& currentElement = parent.children.back();
@ -77,7 +77,7 @@ void cmWIXPatchParser::StartElement(const char *name, const char **atts)
currentElement->attributes[key] = value;
}
elementStack.push_back(currentElement);
ElementStack.push_back(currentElement);
}
}
@ -90,14 +90,14 @@ void cmWIXPatchParser::StartFragment(const char **attributes)
if(key == "Id")
{
if(fragments.find(value) != fragments.end())
if(Fragments.find(value) != Fragments.end())
{
std::stringstream tmp;
tmp << "Invalid reuse of 'CPackWixFragment' 'Id': " << value;
ReportValidationError(tmp.str());
}
elementStack.push_back(&fragments[value]);
ElementStack.push_back(&Fragments[value]);
}
else
{
@ -110,16 +110,16 @@ void cmWIXPatchParser::StartFragment(const char **attributes)
void cmWIXPatchParser::EndElement(const char *name)
{
std::string name_str = name;
if(state == INSIDE_FRAGMENT)
if(State == INSIDE_FRAGMENT)
{
if(name_str == "CPackWiXFragment")
{
state = BEGIN_FRAGMENTS;
elementStack.clear();
State = BEGIN_FRAGMENTS;
ElementStack.clear();
}
else
{
elementStack.pop_back();
ElementStack.pop_back();
}
}
}
@ -129,7 +129,7 @@ void cmWIXPatchParser::ReportError(int line, int column, const char* msg)
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error while processing XML patch file at " << line << ":" << column <<
": "<< msg << std::endl);
valid = false;
Valid = false;
}
void cmWIXPatchParser::ReportValidationError(const std::string& message)
@ -141,5 +141,5 @@ void cmWIXPatchParser::ReportValidationError(const std::string& message)
bool cmWIXPatchParser::IsValid() const
{
return valid;
return Valid;
}

View File

@ -40,7 +40,7 @@ class cmWIXPatchParser : public cmXMLParser
public:
typedef std::map<std::string, cmWIXPatchElement> fragment_map_t;
cmWIXPatchParser(fragment_map_t& fragments, cmCPackLog* logger);
cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger);
private:
virtual void StartElement(const char *name, const char **atts);
@ -63,13 +63,13 @@ private:
INSIDE_FRAGMENT
};
ParserState state;
ParserState State;
bool valid;
bool Valid;
fragment_map_t& fragments;
fragment_map_t& Fragments;
std::list<cmWIXPatchElement*> elementStack;
std::list<cmWIXPatchElement*> ElementStack;
};
#endif

View File

@ -16,7 +16,7 @@
cmWIXRichTextFormatWriter::cmWIXRichTextFormatWriter(
const std::string& filename):
file(filename.c_str(), std::ios::binary)
File(filename.c_str(), std::ios::binary)
{
StartGroup();
WriteHeader();
@ -29,8 +29,8 @@ cmWIXRichTextFormatWriter::~cmWIXRichTextFormatWriter()
/* I haven't seen this in the RTF spec but
* wordpad terminates its RTF like this */
file << "\r\n";
file.put(0);
File << "\r\n";
File.put(0);
}
void cmWIXRichTextFormatWriter::AddText(const std::string& text)
@ -44,16 +44,16 @@ void cmWIXRichTextFormatWriter::AddText(const std::string& text)
switch(c)
{
case '\\':
file << "\\\\";
File << "\\\\";
break;
case '{':
file << "\\{";
File << "\\{";
break;
case '}':
file << "\\}";
File << "\\}";
break;
case '\n':
file << "\\par\r\n";
File << "\\par\r\n";
break;
case '\r':
continue;
@ -61,11 +61,11 @@ void cmWIXRichTextFormatWriter::AddText(const std::string& text)
{
if(c <= 0x7F)
{
file << c;
File << c;
}
else
{
file << "[NON-ASCII-" << int(c) << "]";
File << "[NON-ASCII-" << int(c) << "]";
}
}
break;
@ -103,7 +103,7 @@ void cmWIXRichTextFormatWriter::WriteGenerator()
{
StartGroup();
NewControlWord("generator");
file << " CPack WiX Generator (" << cmVersion::GetCMakeVersion() << ");";
File << " CPack WiX Generator (" << cmVersion::GetCMakeVersion() << ");";
EndGroup();
}
@ -118,20 +118,20 @@ void cmWIXRichTextFormatWriter::WriteDocumentPrefix()
void cmWIXRichTextFormatWriter::ControlWord(const std::string& keyword)
{
file << "\\" << keyword;
File << "\\" << keyword;
}
void cmWIXRichTextFormatWriter::NewControlWord(const std::string& keyword)
{
file << "\\*\\" << keyword;
File << "\\*\\" << keyword;
}
void cmWIXRichTextFormatWriter::StartGroup()
{
file.put('{');
File.put('{');
}
void cmWIXRichTextFormatWriter::EndGroup()
{
file.put('}');
File.put('}');
}

View File

@ -40,7 +40,7 @@ private:
void StartGroup();
void EndGroup();
std::ofstream file;
std::ofstream File;
};
#endif

View File

@ -20,9 +20,9 @@ cmWIXSourceWriter::cmWIXSourceWriter(cmCPackLog* logger,
const std::string& filename,
bool isIncludeFile):
Logger(logger),
file(filename.c_str()),
state(DEFAULT),
sourceFilename(filename)
File(filename.c_str()),
State(DEFAULT),
SourceFilename(filename)
{
WriteXMLDeclaration();
@ -40,79 +40,79 @@ cmWIXSourceWriter::cmWIXSourceWriter(cmCPackLog* logger,
cmWIXSourceWriter::~cmWIXSourceWriter()
{
if(elements.size() > 1)
if(Elements.size() > 1)
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
elements.size() - 1 << " WiX elements were still open when closing '" <<
sourceFilename << "'" << std::endl);
Elements.size() - 1 << " WiX elements were still open when closing '" <<
SourceFilename << "'" << std::endl);
return;
}
EndElement(elements.back());
EndElement(Elements.back());
}
void cmWIXSourceWriter::BeginElement(const std::string& name)
{
if(state == BEGIN)
if(State == BEGIN)
{
file << ">";
File << ">";
}
file << "\n";
Indent(elements.size());
file << "<" << name;
File << "\n";
Indent(Elements.size());
File << "<" << name;
elements.push_back(name);
state = BEGIN;
Elements.push_back(name);
State = BEGIN;
}
void cmWIXSourceWriter::EndElement(std::string const& name)
{
if(elements.empty())
if(Elements.empty())
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"can not end WiX element with no open elements in '" <<
sourceFilename << "'" << std::endl);
SourceFilename << "'" << std::endl);
return;
}
if(elements.back() != name)
if(Elements.back() != name)
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"WiX element <" << elements.back() <<
"WiX element <" << Elements.back() <<
"> can not be closed by </" << name << "> in '" <<
sourceFilename << "'" << std::endl);
SourceFilename << "'" << std::endl);
return;
}
if(state == DEFAULT)
if(State == DEFAULT)
{
file << "\n";
Indent(elements.size()-1);
file << "</" << elements.back() << ">";
File << "\n";
Indent(Elements.size()-1);
File << "</" << Elements.back() << ">";
}
else
{
file << "/>";
File << "/>";
}
elements.pop_back();
state = DEFAULT;
Elements.pop_back();
State = DEFAULT;
}
void cmWIXSourceWriter::AddProcessingInstruction(
const std::string& target, const std::string& content)
{
if(state == BEGIN)
if(State == BEGIN)
{
file << ">";
File << ">";
}
file << "\n";
Indent(elements.size());
file << "<?" << target << " " << content << "?>";
File << "\n";
Indent(Elements.size());
File << "<?" << target << " " << content << "?>";
state = DEFAULT;
State = DEFAULT;
}
void cmWIXSourceWriter::AddAttribute(
@ -120,7 +120,7 @@ void cmWIXSourceWriter::AddAttribute(
{
std::string utf8 = WindowsCodepageToUtf8(value);
file << " " << key << "=\"" << EscapeAttributeValue(utf8) << '"';
File << " " << key << "=\"" << EscapeAttributeValue(utf8) << '"';
}
void cmWIXSourceWriter::AddAttributeUnlessEmpty(
@ -172,14 +172,14 @@ std::string cmWIXSourceWriter::WindowsCodepageToUtf8(const std::string& value)
void cmWIXSourceWriter::WriteXMLDeclaration()
{
file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
File << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
}
void cmWIXSourceWriter::Indent(size_t count)
{
for(size_t i = 0; i < count; ++i)
{
file << " ";
File << " ";
}
}

View File

@ -60,13 +60,13 @@ private:
cmCPackLog* Logger;
std::ofstream file;
std::ofstream File;
State state;
State State;
std::vector<std::string> elements;
std::vector<std::string> Elements;
std::string sourceFilename;
std::string SourceFilename;
};
#endif