summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/FileUtils.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /xbmc/utils/FileUtils.h
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/utils/FileUtils.h')
-rw-r--r--xbmc/utils/FileUtils.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/xbmc/utils/FileUtils.h b/xbmc/utils/FileUtils.h
new file mode 100644
index 0000000..667d4b3
--- /dev/null
+++ b/xbmc/utils/FileUtils.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2010-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+class CFileItem;
+class CDateTime;
+
+class CFileUtils
+{
+public:
+ static bool CheckFileAccessAllowed(const std::string &filePath);
+ static bool DeleteItem(const std::shared_ptr<CFileItem>& item);
+ static bool DeleteItem(const std::string &strPath);
+ static bool Exists(const std::string& strFileName, bool bUseCache = true);
+ static bool RenameFile(const std::string &strFile);
+ static bool RemoteAccessAllowed(const std::string &strPath);
+ static unsigned int LoadFile(const std::string &filename, void* &outputBuffer);
+ /*! \brief Get the modified date of a file if its invalid it returns the creation date - this behavior changes when you set bUseLatestDate
+ \param strFileNameAndPath path to the file
+ \param bUseLatestDate use the newer datetime of the files mtime and ctime
+ \return Returns the file date, can return a invalid date if problems occur
+ */
+ static CDateTime GetModificationDate(const std::string& strFileNameAndPath, const bool& bUseLatestDate);
+ static CDateTime GetModificationDate(const int& code, const std::string& strFileNameAndPath);
+};