VIPRA Documentation
Loading...
Searching...
No Matches
include
vipra
util
file_operations.hpp
1
#pragma once
2
3
#include <fstream>
4
#include <ios>
5
#include <stdexcept>
6
#include <string>
7
8
namespace
VIPRA::Util {
9
inline
void
append_to_file(std::string
const
& filepath, std::string_view output)
10
{
11
std::ofstream file(filepath, std::ios_base::app);
12
13
if
( ! file.is_open() )
throw
std::runtime_error(
"Unable to open file: "
+ filepath);
14
15
file << output;
16
}
17
}
// namespace VIPRA::Util
Generated by
1.13.2