2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
14 class CProfileManager
;
16 // static class for path translation from our special:// URLs.
18 /* paths are as follows:
20 special://xbmc/ - the main XBMC folder (i.e. where the app resides).
21 special://home/ - a writeable version of the main XBMC folder
23 OS X: ~/Library/Application Support/Kodi/
24 Win32: ~/Application Data/XBMC/
25 special://envhome/ - on posix systems this will be equal to the $HOME
26 special://userhome/ - a writable version of the user home directory
28 Win32: home directory of user
29 special://masterprofile/ - the master users userdata folder - usually special://home/userdata
30 Linux: ~/.kodi/userdata/
31 OS X: ~/Library/Application Support/Kodi/UserData/
32 Win32: ~/Application Data/XBMC/UserData/
33 special://profile/ - the current users userdata folder - usually special://masterprofile/profiles/<current_profile>
34 Linux: ~/.kodi/userdata/profiles/<current_profile>
35 OS X: ~/Library/Application Support/Kodi/UserData/profiles/<current_profile>
36 Win32: ~/Application Data/XBMC/UserData/profiles/<current_profile>
38 special://temp/ - the temporary directory.
41 Win32: ~/Application Data/XBMC/cache
44 class CSpecialProtocol
47 static void RegisterProfileManager(const CProfileManager
&profileManager
);
48 static void UnregisterProfileManager();
50 static void SetProfilePath(const std::string
&path
);
51 static void SetXBMCPath(const std::string
&path
);
52 static void SetXBMCBinPath(const std::string
&path
);
53 static void SetXBMCBinAddonPath(const std::string
&path
);
54 static void SetXBMCAltBinAddonPath(const std::string
&path
);
55 static void SetXBMCFrameworksPath(const std::string
&path
);
56 static void SetHomePath(const std::string
&path
);
57 static void SetUserHomePath(const std::string
&path
);
58 static void SetEnvHomePath(const std::string
&path
);
59 static void SetMasterProfilePath(const std::string
&path
);
60 static void SetTempPath(const std::string
&path
);
61 static void SetLogPath(const std::string
&dir
);
63 static bool ComparePath(const std::string
&path1
, const std::string
&path2
);
64 static void LogPaths();
66 static std::string
TranslatePath(const std::string
&path
);
67 static std::string
TranslatePath(const CURL
&url
);
68 static std::string
TranslatePathConvertCase(const std::string
& path
);
71 static const CProfileManager
*m_profileManager
;
73 static void SetPath(const std::string
&key
, const std::string
&path
);
74 static std::string
GetPath(const std::string
&key
);
76 static std::map
<std::string
, std::string
> m_pathMap
;
80 #define PATH_SEPARATOR_CHAR '\\'
81 #define PATH_SEPARATOR_STRING "\\"
83 #define PATH_SEPARATOR_CHAR '/'
84 #define PATH_SEPARATOR_STRING "/"