![]() |
Yoba Perl
|
Scalar reference More...
Inherits Variable.
Public Member Functions | |
Scalar (Perl &perl, SV *sv, bool increase_refcount) | |
Constructor. More... | |
Modify/convert value | |
Scalar & | setValue (const std::string &value) |
Replace scalar value by string. More... | |
Scalar & | setValue (const char *value) |
Scalar & | setValue (IV value) |
Replace scalar value by integer. More... | |
Scalar & | setValue (int value) |
Scalar & | setValue (UV value) |
Replace scalar value by unsigned integer. More... | |
Scalar & | setValue (unsigned value) |
Scalar & | setValue (NV value) |
Replace scalar value by float number. More... | |
Scalar & | setValue (float value) |
Scalar & | setValue (bool value) |
Replace scalar value by boolean. More... | |
std::string | toString () const |
Convert scalar value to C++ string. More... | |
IV | toIV () const |
Convert scalar value to integer. More... | |
UV | toUV () const |
Convert scalar value to unsigned integer. More... | |
NV | toNV () const |
Convert scalar value to float number. More... | |
bool | toBool () const |
Convert scalar value to boolean. More... | |
Scalar | unrefScalar () const |
Dereference scalar. More... | |
Array | unrefArray () const |
Dereference array. More... | |
Hash | unrefHash () const |
Dereference hash. More... | |
Code | unrefCode () const |
Dereference code (without call) More... | |
Misc | |
I32 | getLength () const |
Value length. More... | |
Scalar | makeCopy () const |
Create copy. More... | |
Scalar | makeRef () const |
Take reference. More... | |
bool | isRef () const |
Check if scalar is a reference. More... | |
bool | isScalarRef () const |
Check if scalar is a scalar reference. More... | |
bool | isArrayRef () const |
Check if scalar is an array reference. More... | |
bool | isHashRef () const |
Check if scalar is a hash reference. More... | |
bool | isCodeRef () const |
Check if scalar is a subroutine reference. More... | |
bool | isObject () const |
Check if scalar is a object. More... | |
bool | isObjectOf (const std::string &class_name) const |
Check if scalar is a class object. More... | |
bool | isValidNumber () const |
Check if scalar is a valid number. More... | |
Operators | |
template<typename ValueT > | |
Scalar & | operator= (const ValueT &value) |
Alias to setValue() More... | |
operator bool () const | |
Check if scalar not empty. More... | |
![]() | |
Variable (Perl &perl, SV *sv, bool increase_refcount) | |
Constructor. | |
Variable (const Variable &to_copy) | |
Copy constructor. More... | |
Variable (Variable &&to_move) | |
Move constructor. More... | |
virtual | ~Variable () |
Destructor. More... | |
void | setReadOnly (bool state) |
Add/remove readonly flag. | |
bool | isReadOnly () const |
Check if SV has readonly flag. | |
Perl & | getPerl () const |
Get Perl instance. | |
SV * | getSV () const |
Get raw scalar. | |
SV * | detachSV () |
Nullify object and return SV. More... | |
SV * | detachMortalSV () |
Nullify object and return mortalized SV. More... | |
U32 | getRefcount () const |
Get SV reference count. | |
void | increaseRefcount () |
Increase SV reference count. | |
void | decreaseRefcount () |
Decrease SV reference count. | |
void | dump () const |
Dump SV data to stderr. | |
bool | operator== (const Variable &other) |
Compare SV pointers. | |
bool | operator!= (const Variable &other) |
Scalar & setValue | ( | const std::string & | value | ) |
Replace scalar value by string.
Definition at line 18 of file scalar.cpp.
Scalar & setValue | ( | IV | value | ) |
Replace scalar value by integer.
Definition at line 24 of file scalar.cpp.
Scalar & setValue | ( | UV | value | ) |
Replace scalar value by unsigned integer.
Definition at line 30 of file scalar.cpp.
Scalar & setValue | ( | NV | value | ) |
Replace scalar value by float number.
Definition at line 36 of file scalar.cpp.
Scalar & setValue | ( | bool | value | ) |
Replace scalar value by boolean.
Definition at line 42 of file scalar.cpp.
|
virtual |
Convert scalar value to C++ string.
Implements Variable.
Definition at line 74 of file scalar.cpp.
IV toIV | ( | ) | const |
Convert scalar value to integer.
Definition at line 82 of file scalar.cpp.
UV toUV | ( | ) | const |
Convert scalar value to unsigned integer.
Definition at line 87 of file scalar.cpp.
NV toNV | ( | ) | const |
Convert scalar value to float number.
Definition at line 92 of file scalar.cpp.
bool toBool | ( | ) | const |
Scalar unrefScalar | ( | ) | const |
Array unrefArray | ( | ) | const |
Hash unrefHash | ( | ) | const |
Code unrefCode | ( | ) | const |
I32 getLength | ( | ) | const |
Scalar makeCopy | ( | ) | const |
Scalar makeRef | ( | ) | const |
bool isRef | ( | ) | const |
Check if scalar is a reference.
Definition at line 197 of file scalar.cpp.
bool isScalarRef | ( | ) | const |
Check if scalar is a scalar reference.
Definition at line 202 of file scalar.cpp.
bool isArrayRef | ( | ) | const |
Check if scalar is an array reference.
Definition at line 207 of file scalar.cpp.
bool isHashRef | ( | ) | const |
Check if scalar is a hash reference.
Definition at line 212 of file scalar.cpp.
bool isCodeRef | ( | ) | const |
Check if scalar is a subroutine reference.
Definition at line 217 of file scalar.cpp.
bool isObject | ( | ) | const |
Check if scalar is a object.
Definition at line 222 of file scalar.cpp.
bool isObjectOf | ( | const std::string & | class_name | ) | const |
Check if scalar is a class object.
Definition at line 227 of file scalar.cpp.
bool isValidNumber | ( | ) | const |
Check if scalar is a valid number.
Definition at line 232 of file scalar.cpp.
Scalar & operator= | ( | const ValueT & | value | ) |
operator bool | ( | ) | const |
Check if scalar not empty.
Definition at line 239 of file scalar.cpp.