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 '7zip/Archive/Common/CodecsPath.cpp')
-rwxr-xr-x7zip/Archive/Common/CodecsPath.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/7zip/Archive/Common/CodecsPath.cpp b/7zip/Archive/Common/CodecsPath.cpp
new file mode 100755
index 00000000..d2d27ed3
--- /dev/null
+++ b/7zip/Archive/Common/CodecsPath.cpp
@@ -0,0 +1,34 @@
+// CodecsPath.cpp
+
+#include "StdAfx.h"
+#include "../../../Common/String.h"
+
+extern HINSTANCE g_hInstance;
+
+static CSysString GetLibraryPath()
+{
+ TCHAR fullPath[MAX_PATH + 1];
+ ::GetModuleFileName(g_hInstance, fullPath, MAX_PATH);
+ return fullPath;
+}
+
+static CSysString GetLibraryFolderPrefix()
+{
+ CSysString path = GetLibraryPath();
+ int pos = path.ReverseFind(TEXT('\\'));
+ return path.Left(pos + 1);
+}
+
+CSysString GetBaseFolderPrefix()
+{
+ CSysString libPrefix = GetLibraryFolderPrefix();
+ CSysString temp = libPrefix;
+ temp.Delete(temp.Length() - 1);
+ int pos = temp.ReverseFind(TEXT('\\'));
+ return temp.Left(pos + 1);
+}
+
+CSysString GetCodecsFolderPrefix()
+{
+ return GetBaseFolderPrefix() + TEXT("Codecs\\");
+}