Nui
json.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <nui/frontend/val.hpp>
4 
5 #include <string>
6 
7 namespace Nui
8 {
9  class JSON
10  {
11  public:
12  static Nui::val parse(std::string const& jsonString)
13  {
14  return Nui::val::global("JSON").call<Nui::val>("parse", jsonString);
15  }
16  static Nui::val parse(Nui::val const& val)
17  {
18  return Nui::val::global("JSON").call<Nui::val>("parse", val);
19  }
20  static std::string stringify(Nui::val const& json)
21  {
22  return Nui::val::global("JSON").call<std::string>("stringify", json);
23  }
24  static std::string stringify(Nui::val const& json, Nui::val const& replacer, int indent)
25  {
26  return Nui::val::global("JSON").call<std::string>("stringify", json, replacer, indent);
27  }
28  static std::string stringify(Nui::val const& json, int indent)
29  {
30  return Nui::val::global("JSON").call<std::string>("stringify", json, Nui::val::null(), indent);
31  }
32  };
33 }
Definition: json.hpp:10
static std::string stringify(Nui::val const &json, int indent)
Definition: json.hpp:28
static Nui::val parse(Nui::val const &val)
Definition: json.hpp:16
static std::string stringify(Nui::val const &json, Nui::val const &replacer, int indent)
Definition: json.hpp:24
static Nui::val parse(std::string const &jsonString)
Definition: json.hpp:12
static std::string stringify(Nui::val const &json)
Definition: json.hpp:20
Definition: file_dialog.hpp:6
emscripten::val val
Definition: val.hpp:5