Loading...
Searching...
No Matches
FileWriter.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 <string>
9
10namespace ml
11{
26 {
27 public:
32 static bool writeJson(const std::string& path, const json& data, int indent = 4);
33
38 static bool writeText(const std::string& path, const std::string& text);
39 };
40
41} // namespace ml
Write text or JSON data to a file.
Definition FileWriter.h:26
static bool writeJson(const std::string &path, const json &data, int indent=4)
Serialize data to a pretty-printed JSON file.
static bool writeText(const std::string &path, const std::string &text)
Write a raw string to a file, overwriting any existing content.
nlohmann::json json
Alias for nlohmann::json.
Definition Json.h:32
#define MALENA_API
Definition Component.h:22