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

CoderPaths.cpp « Common « Archive « 7zip - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d2e75de60a5e14c730ffd1914d07ec14301c8565 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// CodersPath.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("Compress\\");
}