Data::Sofu::Value - A Sofu Value
Provides a interface similar to the original SofuD (sofu.sf.net)
require Data::Sofu::Value; my $v = Data::Sofu::Value->new(); $v->set("Hello World");
This Module is pure OO, exports nothing
Also look at
Data::Sofu::Object for methods, cause Value inherits from it
Creates a new
Data::Sofu::Value and returns it
Converts DATA to a string if DATA is given.
$val = Data::Sofu::Value->new("Hello World");
Sets the contents of this Value (replaces the old contents).
Note: DATA will be converted to a string.
Returns itself, used to make sure this Value is really a Value (Data::Sofu::Map and Data::Sofu::List will die if called with this method)
Returns this Value as a perl Scalar (same as toString)
Returns this as a string
Not working in Perl (cause there is no wchar, char, dchar stuff going on, if you need to convert strings use "Encode")
They just return the same as toString()
Return the Value as an Integer
$v->toInt() === int $v->toString();
Return the Value as a Float
$v->toFloat() === $v->toString()+0;
Return the Value as a Long
$v->toLong() === int $v->toString();
Return the Value as a Double
$v->toDouble() === $v->toString()+0;
Returns a string representation of this Value.
LEVEL and TREE are ignored...
Returns the binary version of this Value using the BINARY DRIVER. Don't call this one, use binaryPack instead.
most of the methods do the same, because perl does the converting for you.