galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
FileUtils.cpp File Reference
#include <fstream>
#include <nlohmann/json.hpp>
#include <SDL3/SDL_misc.h>
#include "galaxy/logging/Log.hpp"
#include "FileUtils.hpp"
+ Include dependency graph for FileUtils.cpp:

Go to the source code of this file.

Namespaces

namespace  galaxy
 Animated.cpp galaxy.
 
namespace  galaxy::fileutils
 

Functions

std::optional< std::string > galaxy::fileutils::extension (const std::string &filepath) noexcept
 Get a file or path's extension.
 
std::expected< std::string, FileErrorgalaxy::fileutils::read (const std::string &filepath)
 Read a non-binary file on disk.
 
std::optional< FileErrorgalaxy::fileutils::write (const std::string &filepath, const std::string &data)
 Writes a non-binary file to disk.
 
std::optional< nlohmann::json > galaxy::fileutils::read_json (const std::string &filepath)
 Read a json file from disk.
 
bool galaxy::fileutils::write_json (const std::string &filepath, const nlohmann::json &json)
 Write json to disk.
 
void galaxy::fileutils::open_url (const std::string &url) noexcept
 Open URL in default webbrowser.