22 static void UnregisterAdvancedSettings();
24 static std::string GetDirectory(
const std::string &strFilePath);
26 static std::string GetFileName(
const CURL& url);
27 static std::string GetFileName(
const std::string& strFileNameAndPath);
29 static std::string GetExtension(
const CURL& url);
30 static std::string GetExtension(
const std::string& strFileName);
46 static bool HasExtension(
const std::string& strFileName);
58 static bool HasExtension(
const std::string& strFileName,
const std::string& strExtensions);
61 static void RemoveExtension(std::string& strFileName);
62 static std::string ReplaceExtension(
const std::string& strFile,
63 const std::string& strNewExtension);
64 static void Split(
const std::string& strFileNameAndPath,
65 std::string& strPath, std::string& strFileName);
66 static std::vector<std::string>
SplitPath(
const std::string& strPath);
68 static void GetCommonPath(std::string& strParent,
const std::string& strPath);
69 static std::string GetParentPath(
const std::string& strPath);
70 static bool GetParentPath(
const std::string& strPath, std::string& strParent);
76 static std::string
GetBasePath(
const std::string& strPath);
85 static std::string ChangeBasePath(
const std::string &fromPath,
const std::string &fromFile,
const std::string &toPath,
const bool &bAddPath =
true);
87 static CURL SubstitutePath(
const CURL& url,
bool reverse =
false);
88 static std::string SubstitutePath(
const std::string& strPath,
bool reverse =
false);
97 static bool IsProtocol(
const std::string& url,
const std::string& type);
108 static bool PathHasParent(std::string path, std::string parent,
bool translate =
false);
118 static bool PathEquals(std::string path1, std::string path2,
bool ignoreTrailingSlash =
false,
bool ignoreURLOptions =
false);
120 static bool IsAddonsPath(
const std::string& strFile);
121 static bool IsSourcesPath(
const std::string& strFile);
122 static bool IsCDDA(
const std::string& strFile);
123 static bool IsDAV(
const std::string& strFile);
124 static bool IsDOSPath(
const std::string &path);
125 static bool IsDVD(
const std::string& strFile);
126 static bool IsFTP(
const std::string& strFile);
127 static bool IsHTTP(
const std::string& strFile,
bool bTranslate =
false);
128 static bool IsUDP(
const std::string& strFile);
129 static bool IsTCP(
const std::string& strFile);
130 static bool IsHD(
const std::string& strFileName);
131 static bool IsInArchive(
const std::string& strFile);
132 static bool IsInRAR(
const std::string& strFile);
133 static bool IsInternetStream(
const std::string& path,
bool bStrictCheck =
false);
134 static bool IsInternetStream(
const CURL& url,
bool bStrictCheck =
false);
136 static bool IsNetworkFilesystem(
const std::string& strPath);
137 static bool IsInAPK(
const std::string& strFile);
138 static bool IsInZIP(
const std::string& strFile);
139 static bool IsISO9660(
const std::string& strFile);
140 static bool IsLiveTV(
const std::string& strFile);
141 static bool IsPVRRecording(
const std::string& strFile);
142 static bool IsPVRRecordingFileOrFolder(
const std::string& strFile);
143 static bool IsPVRTVRecordingFileOrFolder(
const std::string& strFile);
144 static bool IsPVRRadioRecordingFileOrFolder(
const std::string& strFile);
145 static bool IsMultiPath(
const std::string& strPath);
146 static bool IsMusicDb(
const std::string& strFile);
147 static bool IsNfs(
const std::string& strFile);
148 static bool IsOnDVD(
const std::string& strFile);
149 static bool IsOnLAN(
const std::string& strFile);
150 static bool IsHostOnLAN(
const std::string& hostName,
bool offLineCheck =
false);
151 static bool IsPlugin(
const std::string& strFile);
152 static bool IsScript(
const std::string& strFile);
153 static bool IsRAR(
const std::string& strFile);
154 static bool IsRemote(
const std::string& strFile);
155 static bool IsSmb(
const std::string& strFile);
156 static bool IsSpecial(
const std::string& strFile);
157 static bool IsStack(
const std::string& strFile);
158 static bool IsFavourite(
const std::string& strFile);
159 static bool IsUPnP(
const std::string& strFile);
160 static bool IsURL(
const std::string& strFile);
161 static bool IsVideoDb(
const std::string& strFile);
162 static bool IsAPK(
const std::string& strFile);
163 static bool IsZIP(
const std::string& strFile);
164 static bool IsArchive(
const std::string& strFile);
165 static bool IsBluray(
const std::string& strFile);
166 static bool IsAndroidApp(
const std::string& strFile);
167 static bool IsLibraryFolder(
const std::string& strFile);
168 static bool IsLibraryContent(
const std::string& strFile);
169 static bool IsPVR(
const std::string& strFile);
170 static bool IsPVRChannel(
const std::string& strFile);
171 static bool IsPVRChannelGroup(
const std::string& strFile);
172 static bool IsPVRGuideItem(
const std::string& strFile);
174 static std::string AppendSlash(std::string strFolder);
175 static void AddSlashAtEnd(std::string& strFolder);
176 static bool HasSlashAtEnd(
const std::string& strFile,
bool checkURL =
false);
177 static void RemoveSlashAtEnd(std::string& strFolder);
178 static bool CompareWithoutSlashAtEnd(
const std::string& strPath1,
const std::string& strPath2);
179 static std::string FixSlashesAndDups(
const std::string& path,
const char slashCharacter =
'/',
const size_t startFrom = 0);
191 static std::string
CanonicalizePath(
const std::string& path,
const char slashCharacter =
'\\');
193 static CURL CreateArchivePath(
const std::string& type,
194 const CURL& archiveUrl,
195 const std::string& pathInArchive =
"",
196 const std::string& password =
"");
198 static std::string AddFileToFolder(
const std::string& strFolder,
const std::string& strFile);
199 template <
typename... T>
200 static std::string AddFileToFolder(
const std::string& strFolder,
const std::string& strFile, T... args)
202 auto newPath = AddFileToFolder(strFolder, strFile);
203 return AddFileToFolder(newPath, args...);
206 static bool HasParentInHostname(
const CURL& url);
207 static bool HasEncodedHostname(
const CURL& url);
208 static bool HasEncodedFilename(
const CURL& url);
222 static std::string
GetRealPath(
const std::string &path);
237 static std::string resolvePath(
const std::string &path);
static std::string GetRealPath(const std::string &path)
Cleans up the given path by resolving "." and ".." and returns it.
Definition: URIUtils.cpp:1397
static bool PathEquals(std::string path1, std::string path2, bool ignoreTrailingSlash=false, bool ignoreURLOptions=false)
Check whether a path equals another path. Comparison is case-sensitive.
Definition: URIUtils.cpp:551
Definition: TestNfsFile.cpp:22
static bool PathHasParent(std::string path, std::string parent, bool translate=false)
Check whether a path has a given parent. Comparison is case-sensitive. Use IsProtocol() to compare th...
Definition: URIUtils.cpp:531
static bool IsProtocol(const std::string &url, const std::string &type)
Check whether a URL is a given URL scheme. Comparison is case-insensitive as per RFC1738.
Definition: URIUtils.cpp:526
static bool HasPluginPath(const CFileItem &item)
Check if the CFileItem has a plugin path.
Definition: URIUtils.cpp:69
static std::string GetBasePath(const std::string &strPath)
Retrieve the base path, accounting for stacks and files in rars.
Definition: URIUtils.cpp:421
static bool IsStreamedFilesystem(const std::string &strPath)
Definition: URIUtils.cpp:1041
Definition: AdvancedSettings.h:107
static std::string CanonicalizePath(const std::string &path, const char slashCharacter='\\')
Convert path to form without duplicated slashes and without relative directories Strip duplicated sla...
Definition: URIUtils.cpp:1293
Definition: URIUtils.h:18
static bool HasExtension(const std::string &strFileName)
Check if there is a file extension.
Definition: URIUtils.cpp:74
static bool UpdateUrlEncoding(std::string &strFilename)
Updates the URL encoded hostname of the given path.
Definition: URIUtils.cpp:1455
Represents a file on a share.
Definition: FileItem.h:102