blob: e2ab09b9c2995ddc91f7bcc1590e101eb2488393 [file] [log] [blame]
Tomáš Pecka491f4f22020-11-05 15:44:00 +01001/*
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
14namespace velia::utils {
15
16std::string readFileString(const std::filesystem::path& path);
Tomáš Pecka9b1c9672020-11-11 15:24:06 +010017int64_t readFileInt64(const std::filesystem::path& path);
Tomáš Pecka491f4f22020-11-05 15:44:00 +010018std::vector<uint32_t> readFileWords(const std::filesystem::path& path, int valuesCount);
Václav Kubernátbabbab92021-01-27 09:25:05 +010019std::string readFileToString(const std::filesystem::path& path);
Tomáš Pecka5be83e42021-04-21 17:26:40 +020020void writeFile(const std::string& path, const std::string_view& contents);
Václav Kubernátbabbab92021-01-27 09:25:05 +010021void safeWriteFile(const std::string& filename, const std::string_view& contents);
Tomáš Pecka491f4f22020-11-05 15:44:00 +010022}