You.i Engine
CYIAssetScript Class Reference

Detailed Description

Represents the contents of a script source file.

This asset represents the contents of a script source file and is used to load script source code into a CYIBindingContext.

Note
Because they lack a magic number, script files cannot be decoded from memory when using the CYIAssetLoader class. They can, however, be decoded from memory when using this decoder directly.
See also
CYIAssetDecoderScript
CYIAssetLoader

#include <asset/YiAssetScript.h>

Inheritance diagram for CYIAssetScript:

Public Member Functions

 CYIAssetScript ()
 
 CYIAssetScript (const CYIString &path, PathType pathType=PathType::Relative)
 
virtual ~CYIAssetScript ()
 
void SetScript (const CYIString &script)
 
const CYIStringGetScript ()
 
- Public Member Functions inherited from CYIAsset
virtual ~CYIAsset ()
 
const CYIStringGetPath () const
 
CYIAssetLoadParamsGetLoadParameters () const
 
virtual std::pair< size_t, size_tGetApproximateSize () 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

◆ CYIAssetScript() [1/2]

CYIAssetScript::CYIAssetScript ( )

◆ CYIAssetScript() [2/2]

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

◆ ~CYIAssetScript()

virtual CYIAssetScript::~CYIAssetScript ( )
virtual

Member Function Documentation

◆ GetScript()

const CYIString& CYIAssetScript::GetScript ( )

Returns the script source code contained in this asset.

◆ OnUnload()

virtual void CYIAssetScript::OnUnload ( )
overrideprotectedvirtual

Reimplemented from CYIAsset.

◆ SetScript()

void CYIAssetScript::SetScript ( const CYIString script)

Sets the script source code contained in this asset.


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