xref: /openbmc/google-misc/libcr51sign/subprojects/dhcp-done/file-io.hpp (revision 1e76060a37b960851faa2ea469ce2472f9741bfe)
1*1e76060aSYuxiao Zhang #pragma once
2*1e76060aSYuxiao Zhang 
3*1e76060aSYuxiao Zhang #include <filesystem>
4*1e76060aSYuxiao Zhang #include <string>
5*1e76060aSYuxiao Zhang 
6*1e76060aSYuxiao Zhang namespace fs = std::filesystem;
7*1e76060aSYuxiao Zhang constexpr auto statusFile = "/run/dhcp_status";
8*1e76060aSYuxiao Zhang 
9*1e76060aSYuxiao Zhang // Function to read contents from a file
10*1e76060aSYuxiao Zhang std::string fileRead(const fs::path& filename);
11*1e76060aSYuxiao Zhang 
12*1e76060aSYuxiao Zhang // Function to write contents to a file atomically
13*1e76060aSYuxiao Zhang void fileWrite(const fs::path& filename, const std::string& data);
14