summaryrefslogtreecommitdiffstats
path: root/Source/CPack/IFW/cmCPackIFWCommon.cxx
diff options
context:
space:
mode:
authorKonstantin Podsvirov <konstantin@podsvirov.pro>2017-04-22 00:20:43 (GMT)
committerKonstantin Podsvirov <konstantin@podsvirov.pro>2017-05-12 23:34:15 (GMT)
commit72ac7ad98da17f5f13dba9ab70ccddc18bd12ff5 (patch)
tree3bf05605aef6200bccec803c59b8c0d73ac1894a /Source/CPack/IFW/cmCPackIFWCommon.cxx
parent836cb52e9aec83f88841cb5b45abb1d32bb02214 (diff)
downloadCMake-72ac7ad98da17f5f13dba9ab70ccddc18bd12ff5.zip
CMake-72ac7ad98da17f5f13dba9ab70ccddc18bd12ff5.tar.gz
CMake-72ac7ad98da17f5f13dba9ab70ccddc18bd12ff5.tar.bz2
CPackIFW: Internationalization Support
Changes: - DISPLAY_NAME and DESCRIPTION in CPackIFW module now is MULTI_ARGS; - Added internationalization support for DisplayName and Description properties in cmCPackIFWPackage class; - Added documentation to CPackIFW module; - Added release note.
Diffstat (limited to 'Source/CPack/IFW/cmCPackIFWCommon.cxx')
-rw-r--r--Source/CPack/IFW/cmCPackIFWCommon.cxx46
1 files changed, 46 insertions, 0 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx
index 436f4d3..e8f05bd 100644
--- a/Source/CPack/IFW/cmCPackIFWCommon.cxx
+++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx
@@ -11,6 +11,8 @@
#include "cmXMLWriter.h"
#include <sstream>
+#include <utility>
+#include <vector>
cmCPackIFWCommon::cmCPackIFWCommon()
: Generator(CM_NULLPTR)
@@ -72,6 +74,50 @@ bool cmCPackIFWCommon::IsVersionEqual(const char* version)
version);
}
+void cmCPackIFWCommon::ExpandListArgument(
+ const std::string& arg, std::map<std::string, std::string>& argsOut)
+{
+ std::vector<std::string> args;
+ cmSystemTools::ExpandListArgument(arg, args, false);
+ if (args.empty()) {
+ return;
+ }
+
+ std::size_t i = 0;
+ std::size_t c = args.size();
+ if (c % 2) {
+ argsOut[""] = args[i];
+ ++i;
+ }
+
+ --c;
+ for (; i < c; i += 2) {
+ argsOut[args[i]] = args[i + 1];
+ }
+}
+
+void cmCPackIFWCommon::ExpandListArgument(
+ const std::string& arg, std::multimap<std::string, std::string>& argsOut)
+{
+ std::vector<std::string> args;
+ cmSystemTools::ExpandListArgument(arg, args, false);
+ if (args.empty()) {
+ return;
+ }
+
+ std::size_t i = 0;
+ std::size_t c = args.size();
+ if (c % 2) {
+ argsOut.insert(std::pair<std::string, std::string>("", args[i]));
+ ++i;
+ }
+
+ --c;
+ for (; i < c; i += 2) {
+ argsOut.insert(std::pair<std::string, std::string>(args[i], args[i + 1]));
+ }
+}
+
void cmCPackIFWCommon::WriteGeneratedByToStrim(cmXMLWriter& xout)
{
if (!this->Generator) {