CCF
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
files.h File Reference
#include <cstring>
#include <fstream>
#include <glob.h>
#include <iostream>
#include <nlohmann/json.hpp>
#include <optional>
#include <sstream>
#include <string>
#include <vector>
#include <fmt/format.h>
#include <fmt/ostream.h>

Go to the source code of this file.

Namespaces

namespace  files
 

Macros

#define FMT_HEADER_ONLY
 

Functions

bool files::exists (const std::string &file)
 Checks if a path exists.
 
std::vector< uint8_t > files::slurp (const std::string &file, bool optional=false)
 Tries to read a file as byte vector.
 
std::string files::slurp_string (const std::string &file, bool optional=false)
 Tries to read a file as string.
 
std::optional< std::string > files::try_slurp_string (const std::string &file)
 
nlohmann::json files::slurp_json (const std::string &file, bool optional=false)
 Tries to read a file as JSON.
 
void files::dump (const std::vector< uint8_t > &data, const std::string &file)
 Writes the content of a vector to a file.
 
void files::dump (const std::string &data, const std::string &file)
 Writes the content of a string to a file.
 
void files::rename (const fs::path &src, const fs::path &dst)
 

Macro Definition Documentation

◆ FMT_HEADER_ONLY

#define FMT_HEADER_ONLY