saveJSONObject()

Output / Files

Description

Saves a JSONValue to a file as formatted JSON.

Syntax

bool saveJSONObject(std::string path, JSONValue v, int indent)

Parameters

NameTypeDescription
pathstd::stringpath to write to
vJSONValuethe JSON value
indentintindentation spaces (default 2)

Returns

bool

Related

Under the Hood

From Processing.h:

static bool saveJSONObject(const std::string& path, const JSONValue& v, int indent=2);

Under the Hood

From Processing.cpp:

bool PApplet::saveJSONObject(const std::string& path,const JSONValue& v,int indent){ std::ofstream f(path); if(!f)return false; f<<toJSONString(v,indent); return true; } return saveJSONObject(path,v,indent);