| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

JsonFile.h
Go to the documentation of this file.
1 #pragma once
2
3 #include "Resource.h"
4
5 #include <sstream>
6 #include <iostream>
7 #include <fstream>
8 #include <iomanip>
9 #include <nlohmann/json.hpp>
10
11 namespace Fling
12 {
16 class JsonFile : public Resource
17 {
18 public:
19
20 static std::shared_ptr<Fling::JsonFile> Create(Guid t_ID);
21
27 explicit JsonFile(Guid t_ID);
28
29 virtual ~JsonFile() = default;
30
35 FORCEINLINE nlohmann::json& GetJsonData() { return m_JsonData; }
36
40 void Write();
41
42 protected:
43
44 nlohmann::json m_JsonData;
45
50 void LoadJsonFile();
51 };
52 } // namespace Fling
Fling::JsonFile::m_JsonData
nlohmann::json m_JsonData
Definition: JsonFile.h:44
Fling::Resource
Base class that represents a loaded resource in the engine.
Definition: Resource.h:11
Fling::JsonFile::LoadJsonFile
void LoadJsonFile()
Loads the JsonFile based on Guid path.
Definition: JsonFile.cpp:36
Fling::JsonFile::Write
void Write()
Write the contents of this JSON file out to given name.
Definition: JsonFile.cpp:18
Fling::JsonFile::~JsonFile
virtual ~JsonFile()=default
Resource.h
Fling::Guid
entt::hashed_string Guid
Definition: FlingTypes.h:26
Fling::JsonFile
A JsonFile provides an interface for easily using JSON files.
Definition: JsonFile.h:16
Fling::JsonFile::JsonFile
JsonFile(Guid t_ID)
Construct a new JsonFile object.
Definition: JsonFile.cpp:12
Fling::JsonFile::Create
static std::shared_ptr< Fling::JsonFile > Create(Guid t_ID)
Definition: JsonFile.cpp:7
Fling::JsonFile::GetJsonData
FORCEINLINE nlohmann::json & GetJsonData()
Get a reference to the current JSON data that is loaded from this file.
Definition: JsonFile.h:35
Fling
Definition: Engine.h:29