Gnash
0.8.10
|
This class holds ownership of (a copy of) an NPVariant. More...
#include <GnashNPVariant.h>
Public Member Functions | |
GnashNPVariant () | |
GnashNPVariant (const GnashNPVariant &var) | |
GnashNPVariant (const NPVariant &var) | |
GnashNPVariant & | operator= (const GnashNPVariant &var) |
void | copy (NPVariant &dest) const |
Copy the contained NPVariant into another NPVariant. | |
const NPVariant & | get () const |
Obtain a reference to the contained NPVariant. | |
~GnashNPVariant () |
This class holds ownership of (a copy of) an NPVariant.
The user of this class must keep in mind that it does not take ownership of already-allocated resources. The user must supply an NPVariant to construct a GnashNPVariant, and must subsequently release any resources associated with the original NPVariant.
When an object of type GnashNPVariant goes out of scope, the resources associated with the copied NPVariant will be released.
gnash::GnashNPVariant::GnashNPVariant | ( | ) | [inline] |
gnash::GnashNPVariant::GnashNPVariant | ( | const GnashNPVariant & | var | ) | [inline] |
References gnash::CopyVariantValue().
gnash::GnashNPVariant::GnashNPVariant | ( | const NPVariant & | var | ) | [inline] |
Construct a GnashNPVariant by copying an NPVariant.
var | The NPVariant to copy from. |
References gnash::CopyVariantValue().
gnash::GnashNPVariant::~GnashNPVariant | ( | ) | [inline] |
References NPN_ReleaseVariantValue().
void gnash::GnashNPVariant::copy | ( | NPVariant & | dest | ) | const [inline] |
Copy the contained NPVariant into another NPVariant.
This is useful to return a GnashNPVariant to an external API.
dest | The NPVariant to copy the value into. |
References gnash::CopyVariantValue().
Referenced by gnash::GetVariableCallback(), gnash::TotalFrames(), gnash::remoteCallback(), and gnash::GnashPluginScriptObject::GetProperty().
const NPVariant& gnash::GnashNPVariant::get | ( | ) | const [inline] |
Obtain a reference to the contained NPVariant.
This method returns a const reference to avoid the temptation to modify ownership, which could lead to memory errors. Use copy() if you want to alter the contained NPVariant.
Referenced by gnash::IsPlaying(), gnash::PercentLoaded(), gnash::TotalFrames(), gnash::remoteCallback(), gnash::GnashPluginScriptObject::GetVariable(), and main().
GnashNPVariant& gnash::GnashNPVariant::operator= | ( | const GnashNPVariant & | var | ) | [inline] |
References NPN_ReleaseVariantValue(), and gnash::CopyVariantValue().