Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Archive/Nsis/NsisIn.h')
-rwxr-xr-xCPP/7zip/Archive/Nsis/NsisIn.h48
1 files changed, 21 insertions, 27 deletions
diff --git a/CPP/7zip/Archive/Nsis/NsisIn.h b/CPP/7zip/Archive/Nsis/NsisIn.h
index 4257b687..1fa6b4a6 100755
--- a/CPP/7zip/Archive/Nsis/NsisIn.h
+++ b/CPP/7zip/Archive/Nsis/NsisIn.h
@@ -3,16 +3,17 @@
#ifndef __ARCHIVE_NSIS_IN_H
#define __ARCHIVE_NSIS_IN_H
-#include "Common/MyCom.h"
-#include "Common/IntToString.h"
#include "Common/Buffer.h"
+#include "Common/IntToString.h"
+#include "Common/MyCom.h"
+#include "Common/StringConvert.h"
+
+#include "../../Common/CreateCoder.h"
#include "../../IStream.h"
#include "NsisDecode.h"
-#include "../../Common/CreateCoder.h"
-
// #define NSIS_SCRIPT
namespace NArchive {
@@ -81,32 +82,25 @@ struct CItem
return (PrefixA.Length() >= 3 || PrefixU.Length() >= 3);
}
- AString GetReducedNameA() const
- {
- AString prefix = PrefixA;
- if (prefix.Length() > 0)
- if (prefix[prefix.Length() - 1] != '\\')
- prefix += '\\';
- AString s2 = prefix + NameA;
- const int len = 9;
- if (s2.Left(len).CompareNoCase("$INSTDIR\\") == 0)
- s2 = s2.Mid(len);
- return s2;
- }
-
- UString GetReducedNameU() const
+ UString GetReducedName(bool unicode) const
{
- UString prefix = PrefixU;
- if (prefix.Length() > 0)
- if (prefix[prefix.Length() - 1] != L'\\')
- prefix += L'\\';
- UString s2 = prefix + NameU;
+ UString s;
+ if (unicode)
+ s = PrefixU;
+ else
+ s = MultiByteToUnicodeString(PrefixA);
+ if (s.Length() > 0)
+ if (s[s.Length() - 1] != L'\\')
+ s += L'\\';
+ if (unicode)
+ s += NameU;
+ else
+ s += MultiByteToUnicodeString(NameA);
const int len = 9;
- if (s2.Left(len).CompareNoCase(L"$INSTDIR\\") == 0)
- s2 = s2.Mid(len);
- return s2;
+ if (s.Left(len).CompareNoCase(L"$INSTDIR\\") == 0)
+ s = s.Mid(len);
+ return s;
}
-
};
class CInArchive