Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
Fling::JsonFile Class Reference

A JsonFile provides an interface for easily using JSON files. More...

#include <JsonFile.h>

Inherits Fling::Resource.

Inherited by Fling::Material.

Public Member Functions

 JsonFile (Guid t_ID)
 Construct a new JsonFile object. More...
 
virtual ~JsonFile ()=default
 
FORCEINLINE nlohmann::json & GetJsonData ()
 Get a reference to the current JSON data that is loaded from this file. More...
 
void Write ()
 Write the contents of this JSON file out to given name. More...
 
- Public Member Functions inherited from Fling::Resource
 Resource (Fling::Guid t_ID)
 
virtual ~Resource ()=default
 
Fling::Guid_Handle GetGuidHandle () const
 Get GUID handle (just an int) for this resources guid. More...
 
const std::string & GetGuidString () const
 Get the human-readable string representation of this GUID. More...
 
std::string GetFilepathReleativeToAssets () const
 Returns the full file path that is relative to the assets path based on the GUID of this resource. More...
 

Static Public Member Functions

static std::shared_ptr< Fling::JsonFileCreate (Guid t_ID)
 

Protected Member Functions

void LoadJsonFile ()
 Loads the JsonFile based on Guid path. More...
 

Protected Attributes

nlohmann::json m_JsonData
 
- Protected Attributes inherited from Fling::Resource
Fling::Guid m_Guid
 
std::string m_HumanReadableName
 

Detailed Description

A JsonFile provides an interface for easily using JSON files.

Constructor & Destructor Documentation

◆ JsonFile()

Fling::JsonFile::JsonFile ( Guid  t_ID)
explicit

Construct a new JsonFile object.

Parameters
t_IDThe GUID that represents the file path to this JsonFile.

◆ ~JsonFile()

virtual Fling::JsonFile::~JsonFile ( )
virtualdefault

Member Function Documentation

◆ Create()

std::shared_ptr< Fling::JsonFile > Fling::JsonFile::Create ( Guid  t_ID)
static

◆ GetJsonData()

FORCEINLINE nlohmann::json& Fling::JsonFile::GetJsonData ( )
inline

Get a reference to the current JSON data that is loaded from this file.

Returns
Reference to the current json data

◆ LoadJsonFile()

void Fling::JsonFile::LoadJsonFile ( )
protected

Loads the JsonFile based on Guid path.

Note
All Guid paths are relative to the assets directory.

◆ Write()

void Fling::JsonFile::Write ( )

Write the contents of this JSON file out to given name.

Field Documentation

◆ m_JsonData

nlohmann::json Fling::JsonFile::m_JsonData
protected

The documentation for this class was generated from the following files: