Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cInstallDir.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cInstallDir_H
7 #define _INC_cInstallDir_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "../GrayLibBase.h"
14 
15 namespace GrayLib
16 {
17 #define RESNAME(_n) _n
18 
20  {
28 
29  protected:
31 
32  // all other directories are assumed to be based on this unless they begin with / or C:/ i.e. Rooted()
34 
35  public:
36  cInstallDir(void);
37  ~cInstallDir(void);
38 
39  bool isInstallValid() const
40  {
41  return m_bInstallValid;
42  }
43  cStringF get_InstallDir() const // Get the base data directory for map and resource files.
44  {
45  return m_sInstallDir;
46  }
47  HRESULT put_InstallDir(cStringF sInstallDir); // Get the base data directory for map and resource files.
48 
49  static cStringF GRAYCALL GetDefaultInstallDirBase();
50  static bool GRAYCALL IsInstallDirRestricted(const FILECHAR_t* pszName);
51 
52  bool IsInInstall(const FILECHAR_t* pszPath) const;
53  cStringF MakeFilePath(cStringF sPath) const;
54  cStringF MakeRelativePath(const FILECHAR_t* pszFullPath) const
55  {
57  return cFilePath::MakeRelativePath(pszFullPath, m_sInstallDir);
58  }
59  };
60 }
61 
62 #endif
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cInstallDir.h:20
cStringF m_sInstallDir
main common data directory.
Definition: cInstallDir.h:33
cStringF MakeRelativePath(const FILECHAR_t *pszFullPath) const
Definition: cInstallDir.h:54
bool m_bInstallValid
The install has actually placed at least one file.
Definition: cInstallDir.h:30
bool isInstallValid() const
Definition: cInstallDir.h:39
cStringF get_InstallDir() const
Definition: cInstallDir.h:43
static cStringF __stdcall MakeRelativePath(const FILECHAR_t *pszFullPath, const FILECHAR_t *pszRootDir)
Definition: cFilePath.cpp:659
Definition: cMesh.h:22
char FILECHAR_t
a UTF8 char in a file name. like TCHAR
Definition: FileName.h:22