15#include <unordered_map>
33 std::vector<std::unique_ptr<JSONNode>>
children;
std::string value
Definition Settings.cpp:30
Main application class for the JSON Viewer plugin.
Definition undoAppJSON.hpp:60
JSONDocument takeDocument()
Take the open file out whole, to be put back later.
bool initialize()
Initialize the JSON undoApp.
void loadJSONFile(const std::string &path)
Load a JSON file into the viewer.
void renderJSONPanel()
Render the JSON Viewer panel.
std::string m_rawJSONString
Raw JSON string for pretty print.
Definition undoAppJSON.hpp:120
void buildJSONTree(const std::string &jsonString)
Build the JSON tree from a string.
std::unique_ptr< JSONNode > m_jsonRoot
Root of the JSON tree.
Definition undoAppJSON.hpp:115
void renderJSONTree(JSONNode *node, const std::string &filter, int depth=0)
Recursively render the JSON tree with filtering.
bool m_initialized
Initialization flag.
Definition undoAppJSON.hpp:112
static JSONApp & getInstance()
Get the singleton instance of JSONApp.
bool m_jsonSearchActive
True if filtering is active.
Definition undoAppJSON.hpp:117
std::vector< std::string > m_outputLines
Lines to display in the Output panel.
Definition undoAppJSON.hpp:113
void closeFile()
Clear the JSON viewer state.
bool m_showPrettyPrint
True if pretty print is enabled.
Definition undoAppJSON.hpp:119
void setDocument(const JSONDocument &doc)
Show a file taken out by takeDocument()
std::string m_currentFilePath
Path of the loaded JSON file.
Definition undoAppJSON.hpp:118
static ImVec4 getValueColor(const std::string &value)
Helper to get color for value type.
void registerPanels()
Register UI panels with ImGuiManager.
std::string m_jsonSearchFilter
Filter string for searching.
Definition undoAppJSON.hpp:116
void shutdown()
Shutdown the JSON undoApp and release resources.
Definition undoAppCpp.hpp:26
One open JSON file, held while another file is in the viewer.
Definition undoAppJSON.hpp:46
bool pretty
Definition undoAppJSON.hpp:50
std::string rawText
The file as it was read.
Definition undoAppJSON.hpp:48
std::string path
Absolute path, where a later save goes.
Definition undoAppJSON.hpp:47
std::string prettyPrint
The formatted text, if pretty printing is on.
Definition undoAppJSON.hpp:49
Node structure for the JSON tree viewer.
Definition undoAppJSON.hpp:28
bool isArray
True if this node is a JSON array.
Definition undoAppJSON.hpp:32
bool isObject
True if this node is a JSON object.
Definition undoAppJSON.hpp:31
bool expanded
True if node is expanded in the tree.
Definition undoAppJSON.hpp:34
int depth
Node depth in the tree.
Definition undoAppJSON.hpp:35
std::string value
String representation of the value.
Definition undoAppJSON.hpp:30
std::string key
Object key (if part of an object)
Definition undoAppJSON.hpp:29
std::vector< std::unique_ptr< JSONNode > > children
Child nodes.
Definition undoAppJSON.hpp:33