| Perl-Dist-WiX documentation | Contained in the Perl-Dist-WiX distribution. |
Perl::Dist::WiX::PropertyList - A list of <Property> and <WixVariable> tags.
This document describes Perl::Dist::WiX::PropertyList version 1.500.
# Create an icon array
my $list = Perl::Dist::WiX::PropertyList->new();
# Add an property to the list, then go looking for it.
my $property_tag = $list->add_simple_property('ARPNOMODIFY', '1');
# Print out all the icons in XML format.
my $xml = $list->as_string();
TODO
The object is not a singleton - maybe it should be?
my $list = Perl::Dist::WiX::PropertyList->new();
Creates a new Perl::Dist::WiX::PropertyList object.
Takes no parameters.
my $property_tag = $list->add_simple_property('ARPNOMODIFY', '1');
The add_simple_property routine adds a property to the list
identified by the first parameter, with its value being the second
parameter.
URI values are stringified.
TODO
my $xml = $list->as_string();
The as_string method returns XML code for all properties
included in this object.
TODO
See Perl::Dist::WiX::Diagnostics (Perl::Dist::WiX::Diagnostics) for a list of exceptions that this module can throw.
Bugs should be reported via:
1) The CPAN bug tracker at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Dist-WiX if you have an account there.
2) Email to <bug-Perl-Dist-WiX@rt.cpan.org> if you do not.
For other issues, contact the topmost author.
Curtis Jewell <csjewell@cpan.org>
Adam Kennedy <adamk@cpan.org>
Copyright 2010 Curtis Jewell.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this distribution.
| Perl-Dist-WiX documentation | Contained in the Perl-Dist-WiX distribution. |
package Perl::Dist::WiX::PropertyList;
use 5.010; use Moose 0.90; use Params::Util qw( _STRING _INSTANCE ); use WiX3::XML::Property qw(); use WiX3::XML::WixVariable qw(); with 'WiX3::Role::Traceable', 'WiX3::XML::Role::TagAllowsChildTags'; our $VERSION = '1.500'; $VERSION =~ s/_//ms;
sub add_simple_property { my ( $self, $id, $value ) = @_; if ( defined _INSTANCE( $value, 'URI' ) ) { $value = $value->as_string(); } if ( defined _INSTANCE( $value, 'Path::Class::File' ) ) { $value = $value->stringify(); } if ( defined _INSTANCE( $value, 'Path::Class::Dir' ) ) { $value = $value->stringify(); } if ( not defined _STRING($id) ) { PDWiX::Parameter->throw( parameter => 'id', where => '::PropertyList->add_simple_property' ); } if ( not defined _STRING($value) ) { PDWiX::Parameter->throw( parameter => 'value', where => '::PropertyList->add_simple_property' ); } my $property = WiX3::XML::Property->new( id => $id, inner_text => $value, ); $self->add_child_tag($property); return $property; } ## end sub add_simple_property
sub add_wixvariable { my ( $self, $id, $value ) = @_; if ( defined _INSTANCE( $value, 'URI' ) ) { $value = $value->as_string(); } if ( defined _INSTANCE( $value, 'Path::Class::File' ) ) { $value = $value->stringify(); } if ( defined _INSTANCE( $value, 'Path::Class::Dir' ) ) { $value = $value->stringify(); } if ( not defined _STRING($id) ) { PDWiX::Parameter->throw( parameter => 'id', where => '::PropertyList->add_wixvariable' ); } if ( not defined _STRING($value) ) { PDWiX::Parameter->throw( parameter => 'value', where => '::PropertyList->add_wixvariable' ); } my $var = WiX3::XML::WixVariable->new( id => $id, value => $value, ); $self->add_child_tag($var); return $var; } ## end sub add_wixvariable
sub as_string { my $self = shift; # Short-circuit if ( 0 == $self->count_child_tags() ) { return q{}; } return $self->indent( 2, $self->as_string_children() ); }
sub get_namespace { return q{xmlns='http://schemas.microsoft.com/wix/2006/wi'}; } no Moose; __PACKAGE__->meta()->make_immutable(); 1; __END__