Loading...
Searching...
No Matches
FileReader.h
Go to the documentation of this file.
1// Copyright 2025 Dave R. Smith
2// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
3
4#pragma once
5
8#include <optional>
9#include <string>
10
11namespace ml
12{
30 {
31 public:
37 static std::optional<json> readJson(const std::string& path);
38
43 static std::optional<std::string> readText(const std::string& path);
44 };
45
46} // namespace ml
Read text or JSON data from a file.
Definition FileReader.h:30
static std::optional< std::string > readText(const std::string &path)
Read the entire contents of a file as a string.
static std::optional< json > readJson(const std::string &path)
Parse a JSON file.
#define MALENA_API
Definition Component.h:22