NAME
Image::Synchronize::GroupedInfo - a data collection in support of Image::Synchronize
METHODS
new
$egi = new Image::Synchronize::GroupedInfo;
Create a new instance of the class.
set
$egi->set($tag, $value);
$egi->set($group, $tag, $value);
Associated the $value
with the $tag
and (optionally) $group
. The $group
and $tag
must be scalars, but the $value
may be of any type. Returns $egi
.
get_context
$value = $egi->get_context($group, $tag);
# get_context value from preferred group
$value = $egi->get_context($tag);
# list context: also return group name
($group, $value) = $egi->get_context($group, $tag);
($group, $value) = $egi->get_context($tag);
Returns the value for the specified $tag
in the specified $group
or in the preferred group. In list mode, returns the group and the value. Returns undef
if the value is undefined or if there is no value for that tag and group.
get
$value = $egi->get($group, $tag);
# get value from preferred group
$value = $egi->get($tag);
Returns the value for the specified $tag
in the specified $group
or in the preferred group. Returns undef
if the value is undefined or if there is no value for that tag and group.
Is like "get_context" but always returns just the value.
delete
$egi->delete($tag);
$egi->delete($group, $tag);
Deletes data associated with the $tag
. If the $group
is specified, then deletes the tag's data for that group only. Otherwise deletes the tag's data for any group. Returns $egi
.
tags
@tags = $egi->tags;
Returns a list of all tags for which a value was specified.
tags_count
$count = $egi->tags_count;
Returns the count of tags for which a value was specified.
groups
@groups = $egi->groups($tag);
Returns a list of all groups for which a value was specified for the $tag
.
stringify
$text = $egi->stringify;
$text = "$egi";
Returns a text version of the contents of $egi
.
AUTHOR
Louis Strous <LS@quae.nl>
LICENSE AND COPYRIGHT
Copyright (c) 2020 Louis Strous.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.