ArmNN
 22.11
Filesystem.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020 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 namespace fs = ghc::filesystem;
16 
17 namespace armnnUtils
18 {
19 namespace Filesystem
20 {
21 
22 using FileContents = std::string;
23 
24 /// Returns a path to a file in the system temporary folder. If the file existed it will be deleted.
25 fs::path NamedTempFile(const char* fileName);
26 
27 /// Returns full path to temporary folder
28 std::string CreateDirectory(std::string sPath);
29 
30 FileContents ReadFileContentsIntoString(const std::string path);
31 
32 } // namespace armnnUtils
33 } // namespace Filesystem
34 
35 #endif // !defined(ARMNN_DISABLE_FILESYSTEM)
std::string FileContents
Definition: Filesystem.hpp:22
FileContents ReadFileContentsIntoString(const std::string path)
Definition: Filesystem.cpp:69
std::string CreateDirectory(std::string sPath)
Returns full path to temporary folder.
Definition: Filesystem.cpp:46
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...
Definition: Filesystem.cpp:25