Tomáš Pecka | 491f4f2 | 2020-11-05 15:44:00 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 CESNET, https://photonics.cesnet.cz/ |
| 3 | * |
| 4 | * Written by Tomáš Pecka <tomas.pecka@fit.cvut.cz> |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #pragma once |
| 9 | |
| 10 | #include <filesystem> |
| 11 | #include <string> |
| 12 | #include <vector> |
| 13 | |
| 14 | namespace velia::utils { |
| 15 | |
| 16 | std::string readFileString(const std::filesystem::path& path); |
Tomáš Pecka | 9b1c967 | 2020-11-11 15:24:06 +0100 | [diff] [blame] | 17 | int64_t readFileInt64(const std::filesystem::path& path); |
Tomáš Pecka | 491f4f2 | 2020-11-05 15:44:00 +0100 | [diff] [blame] | 18 | std::vector<uint32_t> readFileWords(const std::filesystem::path& path, int valuesCount); |
Václav Kubernát | babbab9 | 2021-01-27 09:25:05 +0100 | [diff] [blame] | 19 | std::string readFileToString(const std::filesystem::path& path); |
Tomáš Pecka | 5be83e4 | 2021-04-21 17:26:40 +0200 | [diff] [blame] | 20 | void writeFile(const std::string& path, const std::string_view& contents); |
Václav Kubernát | babbab9 | 2021-01-27 09:25:05 +0100 | [diff] [blame] | 21 | void safeWriteFile(const std::string& filename, const std::string_view& contents); |
Tomáš Pecka | 491f4f2 | 2020-11-05 15:44:00 +0100 | [diff] [blame] | 22 | } |