3#include <ossia/detail/config.hpp>
5#include <ossia/detail/string_view.hpp>
6#include <ossia/preset/exception.hpp>
25namespace ossia::presets
27using preset = std::vector<std::pair<std::string, ossia::value>>;
29using instance_functions = std::vector<
30 std::pair<std::regex, std::function<void(
const ossia::net::node_base&)>>>;
32using preset_pair = std::pair<std::string, ossia::value>;
34OSSIA_EXPORT preset read_json(
const std::string&,
bool skip_first_level =
true);
35OSSIA_EXPORT std::string write_json(
const std::string& devicename,
const preset&);
37OSSIA_EXPORT std::string to_string(
const preset&);
38OSSIA_EXPORT preset from_string(
const std::string_view& str);
46struct preset_save_options
58OSSIA_EXPORT std::string write_json(
const ossia::net::device_base& deviceBase);
65OSSIA_EXPORT
void write_file(std::string_view
string, std::string_view filename);
67OSSIA_EXPORT
const std::string read_file(
const std::string& filename);
76OSSIA_EXPORT
const std::string
77make_json_preset(
const ossia::net::node_base& node, preset_save_options = {});
79typedef void (*func_t)(ossia::net::node_base* n);
89apply_json(
const std::string& json, ossia::net::node_base& node, func_t fn =
nullptr);
100apply_preset(
const std::string& kiss, ossia::net::node_base& node, func_t fn =
nullptr);
103OSSIA_EXPORT
void apply_preset(
104 ossia::net::node_base&,
const presets::preset&, keep_arch_type t = keep_arch_on,
105 presets::instance_functions = {},
bool allow_nonterminal =
false,
106 bool remove_first =
true);
108OSSIA_EXPORT presets::preset
109make_preset(ossia::net::node_base&, preset_save_options = {});
111OSSIA_EXPORT ossia::net::node_base* get_node(ossia::net::node_base&,
const std::string&);
113OSSIA_EXPORT std::string to_string(
const ossia::net::device_base& ossiadev);
Root of a device tree.
Definition ossia/network/base/device.hpp:58
The node_base class.
Definition node.hpp:48
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
The value class.
Definition value.hpp:173