blob: 00da50f4f873738f0192387eadd4d79d38517f78 [file] [log] [blame]
Laurent Carlier749294b2020-06-01 09:03:17 +01001//
Jim Flynn6da6a452020-07-14 14:26:27 +01002// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
Rob Hughesbdee4262020-01-07 17:05:24 +00003// SPDX-License-Identifier: MIT
4//
5
6#pragma once
Jim Flynn870b96c2022-03-25 21:24:56 +00007#if !defined(ARMNN_DISABLE_FILESYSTEM)
Rob Hughesbdee4262020-01-07 17:05:24 +00008
Rob Hughes35c31c02020-08-17 15:47:20 +01009#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
Jim Flynnc9631102020-06-24 11:11:20 +010014#include <ghc/filesystem.hpp>
15namespace fs = ghc::filesystem;
16
Rob Hughesbdee4262020-01-07 17:05:24 +000017namespace armnnUtils
18{
19namespace Filesystem
20{
21
Keith Davis15f9c682022-10-14 15:50:33 +010022using FileContents = std::string;
23
Francis Murtagh532a29d2020-06-29 11:50:01 +010024/// Returns a path to a file in the system temporary folder. If the file existed it will be deleted.
25fs::path NamedTempFile(const char* fileName);
Rob Hughesbdee4262020-01-07 17:05:24 +000026
Keith Davis15f9c682022-10-14 15:50:33 +010027/// Returns full path to temporary folder
28std::string CreateDirectory(std::string sPath);
29
30FileContents ReadFileContentsIntoString(const std::string path);
31
Jim Flynn870b96c2022-03-25 21:24:56 +000032} // namespace armnnUtils
33} // namespace Filesystem
34
35#endif // !defined(ARMNN_DISABLE_FILESYSTEM)