ArmNN
 25.11
Loading...
Searching...
No Matches
Filesystem.hpp
Go to the documentation of this file.
1//
2// Copyright © 2020,2022 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7#if !defined(ARMNN_DISABLE_FILESYSTEM)
8
9#if defined(_MSC_VER)
10// ghc includes Windows.h directly, bringing in macros that we don't want (e.g. min/max).
11// By including Windows.h ourselves first (with appropriate options), we prevent this.
12#include <common/include/WindowsWrapper.hpp>
13#endif
14#include <ghc/filesystem.hpp>
15#include <string>
16
17namespace fs = ghc::filesystem;
18
19namespace armnnUtils
20{
21namespace Filesystem
22{
23
24using FileContents = std::string;
25
26/// Returns a path to a file in the system temporary folder. If the file existed it will be deleted.
27fs::path NamedTempFile(const char* fileName);
28
29/// Returns full path to temporary folder
30std::string CreateDirectory(std::string sPath);
31
32FileContents ReadFileContentsIntoString(const std::string& path);
33
34void RemoveDirectoryAndContents(const std::string& path);
35
36} // namespace armnnUtils
37} // namespace Filesystem
38
39#endif // !defined(ARMNN_DISABLE_FILESYSTEM)
std::string CreateDirectory(std::string sPath)
Returns full path to temporary folder.
FileContents ReadFileContentsIntoString(const std::string &path)
fs::path NamedTempFile(const char *fileName)
Returns a path to a file in the system temporary folder. If the file existed it will be deleted.
void RemoveDirectoryAndContents(const std::string &path)
Remove a directory and its contents.