NAME
OLE::Storage::Property - maintain Properties for OLE::Storage::Var
$Revision: 1.1.1.1 $ $Date: 1998/02/25 21:13:00 $
SYNOPSIS
OLE::Storage and OLE::PropertySet are returning from time to time a kind of variables called Properties ($Prop). Properties could be handled as follows:
sub work {
my $Prop = shift;
if (is_scalar $Prop) {
do_something_with ($Prop); # $Prop definitively is a scalar.
} else {
foreach $P (@{array $Prop}) {
work ($P); # $P could be an array itself.
}
}
}
$string = $Prop -> string()
$NewProp = $OldProp -> cast ("string
")
DESCRIPTION
OLE::Storage::Property is maintaining the Properties, that are initially instantiated by other packages. It gives storage places to OLE::Storage::Var, manages Property to Property conversions, Property to scalar conversions and type information. Though you will use the member functions of OLE::Storage::Property quite often, you should never create a Property directly with this package. Therefore "use OLE::Storage::Property" even was useless.
Type implementation itself is done at OLE::Storage::Var, that offers some private methods for OLE::Storage::Property. Both, type conversions and type availability are quite far from being complete (as you will notice when looking at Var.pm). For this release I cared only to have the something->string conversions working, and therefore only them are documented above.
- array
-
\@Properties = $Prop -> array()
Returns a reference to a Property list. You have to use this to find out, which properties are hiding inside an array property.
- Conversion: Property to perl scalar
-
$scalar = $Prop -> method()
Returns a scalar variable, that perl understands. Momentarily method() should be string() only.
- Conversion: Property to Property
-
$NewProp = $OldProp -> cast ("
method
")Returns a Property of type
method
. - is_scalar
-
1
||0
== $Prop -> is_scalar()Returns 1 if $Prop is a scalar variable, 0 otherwise. A property is scalar, if it is not an array.
- is_array
-
1
||0
== $Prop -> is_array()Returns 1 if $Prop is some array variable, 0 otherwise.
- is_varray
-
1
||0
== $Prop -> is_varray()Returns 1 if $Prop is a variant array variable, 0 otherwise. A variant array is an array, that consists out of elements with different types.
- stype
-
$type = $Prop -> stype()
Returns the scalar type of property $Prop. This is useful if $Prop is an array and you want to know, what kind of variables it consists of.
- type
-
$type = $Prop -> type()
Returns the type of the Property. It is a number if it is a real property type, and it is a string, if it is an internal property type.
- typestr
-
$typestr = $Prop -> typestr()
Returns the name of the property type as string.
KNOWN BUGS
Property handling is very slow.
SEE ALSO
OLE::Storage::Var, demonstration program "ldat"
AUTHOR
Martin Schwartz <schwartz@cs.tu-berlin.de>.