Files
aoccpp2025/utils.h
2025-12-04 17:41:43 -05:00

20 lines
443 B
C++

//
// Created by Grant Horner on 12/4/25.
//
#pragma once
#include <fstream>
#include <sstream>
#include <string_view>
constexpr std::string_view to_string_view(const std::ranges::subrange<const char *> cs) {
return std::string_view{cs.data(), cs.size()};
}
inline std::string read_file(std::string_view path) {
std::ifstream input(path.data());
std::stringstream buffer;
buffer << input.rdbuf();
return buffer.str();
}