mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 11:09:37 -06:00
Remove generateJson function from the DocumentationGenerator and move sortJson function to json_helper
This commit is contained in:
@@ -89,7 +89,7 @@ public:
|
||||
*/
|
||||
static DocumentationEngine& ref();
|
||||
|
||||
std::string generateJson() const override;
|
||||
std::string generateJson() const;
|
||||
|
||||
nlohmann::json generateJsonJson() const;
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ public:
|
||||
*/
|
||||
virtual std::string generateJson() const = 0;
|
||||
|
||||
void sortJson(nlohmann::json& json) const;
|
||||
private:
|
||||
const std::string _name;
|
||||
const std::string _jsonName;
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
|
||||
void keyboardCallback(Key key, KeyModifier modifier, KeyAction action);
|
||||
|
||||
std::string generateJson() const override;
|
||||
std::string generateJson() const;
|
||||
nlohmann::json generateJsonJson() const;
|
||||
|
||||
const std::multimap<KeyWithModifier, std::string>& keyBindings() const;
|
||||
|
||||
@@ -297,7 +297,7 @@ public:
|
||||
void removeTag(const std::string& tag);
|
||||
|
||||
// Generate JSON for documentation
|
||||
std::string generateJson() const override;
|
||||
std::string generateJson() const;
|
||||
|
||||
nlohmann::json generateJsonJson() const;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace openspace {
|
||||
class SceneLicenseWriter : public DocumentationGenerator {
|
||||
public:
|
||||
SceneLicenseWriter();
|
||||
std::string generateJson() const override;
|
||||
std::string generateJson() const;
|
||||
nlohmann::json generateJsonJson() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
|
||||
std::vector<std::string> allLuaFunctions() const;
|
||||
|
||||
std::string generateJson() const override;
|
||||
std::string generateJson() const;
|
||||
nlohmann::json generateJsonJson() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
template <class T>
|
||||
ghoul::TemplateFactory<T>* factory() const;
|
||||
|
||||
std::string generateJson() const override;
|
||||
std::string generateJson() const;
|
||||
nlohmann::json generateJsonJson() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define __OPENSPACE_CORE___JSON_HELPER___H__
|
||||
|
||||
#include <string>
|
||||
#include <openspace/json.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
@@ -65,6 +66,16 @@ std::string formatJsonNumber(double d);
|
||||
template <typename T>
|
||||
std::string formatJson(T value);
|
||||
|
||||
/**
|
||||
* Sort a json object that is an array of objects with the structure
|
||||
* [ key = {}, key = {} ...]. Sorts it by the provided key
|
||||
*
|
||||
* \param json The json to sort
|
||||
* \param key The key the json should be sorted by
|
||||
* \return The sorted JSON
|
||||
*/
|
||||
void sortJson(nlohmann::json& json, const std::string& key);
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#include "json_helper.inl"
|
||||
|
||||
Reference in New Issue
Block a user