You.i Engine
CYIAssetJSON Class Reference

Detailed Description

Represents the contents of a JSON file or string.

This asset provides access to the parsed data from a JSON file or string.

See also
CYIAssetDecoderJSON
CYIAssetLoader

#include <asset/YiAssetJSON.h>

Inheritance diagram for CYIAssetJSON:

Public Member Functions

 CYIAssetJSON ()
 
 CYIAssetJSON (const CYIString &path, PathType pathType=PathType::Relative)
 
virtual ~CYIAssetJSON ()
 
void SetJSONDocument (const std::shared_ptr< yi::rapidjson::Document > &pDocument)
 
const std::shared_ptr< yi::rapidjson::Document > & GetJSONDocument () const
 
virtual std::pair< size_t, size_tGetApproximateSize () const override
 
- Public Member Functions inherited from CYIAsset
virtual ~CYIAsset ()
 
const CYIStringGetPath () const
 
CYIAssetLoadParamsGetLoadParameters () const
 
bool SetName (const CYIString &name)
 
const CYIStringGetName () const
 
bool Load ()
 
void Unload ()
 
bool IsLoaded () const
 
bool Equals (const std::shared_ptr< CYIAsset > &pAsset)
 
virtual bool Prepare ()
 

Protected Member Functions

virtual void OnUnload () override
 
- Protected Member Functions inherited from CYIAsset
 CYIAsset ()
 
ssize_t GetID () const
 
void SetPath (const CYIString &path, PathType pathType)
 
void SetApproximateSize (size_t size)
 
void SetLoaded (bool assetLoaded)
 
void SetLoadParameters (std::unique_ptr< CYIAssetLoadParams > pParams)
 
virtual void OnLoad ()
 

Additional Inherited Members

- Public Types inherited from CYIAsset
enum  PathType {
  PathType::Absolute = 0,
  PathType::Relative
}
 
- Static Protected Attributes inherited from CYIAsset
static ssize_t INVALID_ID
 

Constructor & Destructor Documentation

◆ CYIAssetJSON() [1/2]

CYIAssetJSON::CYIAssetJSON ( )

◆ CYIAssetJSON() [2/2]

CYIAssetJSON::CYIAssetJSON ( const CYIString path,
PathType  pathType = PathType::Relative 
)

◆ ~CYIAssetJSON()

virtual CYIAssetJSON::~CYIAssetJSON ( )
virtual

Member Function Documentation

◆ GetApproximateSize()

virtual std::pair<size_t, size_t> CYIAssetJSON::GetApproximateSize ( ) const
overridevirtual

Calculates and returns the approximate number of bytes currently used by this asset. The first item of the returned pair object represents the memory currently taken in the CPU main memory, and the second item of the returned pair object represents the memory currently taken in the GPU memory.

Note
This function only returns an approximate memory consumption as the exact memory consumption changes depending on the used C++ libraries and on the specific GPU infrastructure and drivers used by the system.

Reimplemented from CYIAsset.

◆ GetJSONDocument()

const std::shared_ptr<yi::rapidjson::Document>& CYIAssetJSON::GetJSONDocument ( ) const

Returns the parsed JSON document associated with this asset.

◆ OnUnload()

virtual void CYIAssetJSON::OnUnload ( )
overrideprotectedvirtual

Reimplemented from CYIAsset.

◆ SetJSONDocument()

void CYIAssetJSON::SetJSONDocument ( const std::shared_ptr< yi::rapidjson::Document > &  pDocument)

Sets the parsed JSON documented associated with this asset.


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