TWiki::Attrs
%TAG{"joe" fred="bad" joe="mad"}%
An attribute set is a hash containing an entry for each parameter. The
default parameter (unnamed quoted string) is named _DEFAULT
in the hash.
Attributes declared later in the string will override those of the same
name defined earlier. The one exception to this is the _DEFAULT key, where
the first instance is always taken.
As well as the default TWiki syntax (parameter values double-quoted)
this class also parses single-quoted values, unquoted spaceless
values, spaces around the =, and commas as well as spaces separating values.
The extended syntax has to be enabled by passing the $friendly
parameter
to new
.
$string
- String containing attribute specification
$friendly
- if true, the parse will be according to the extended syntax pioneered by the original Contrib::Attrs. Otherwise it will be strict as per traditional TWiki syntax.
my $attrs = new TWiki::Attrs('the="time \\"has come", "the walrus" said to=speak of=\'many \\'things\', 1);In this example:
the
will be time "has come
__default__
will be the walrus
said
will be on
to
will be speak
of
will be many 'things
$key
- Attribute to remove
remove
the attribute is no longer defined.
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Microchip and others, are registered trademarks or trademarks of Microchip Technology Inc. and its subsidiaries.
Arm® and others are registered trademarks or trademarks of Arm Limited (or its affiliates). Other terms and product names may be trademarks of others.
Ideas, requests, contributions ? Connect to LinksToCommunities page.