use
5.008003;
metaclass
=>
'Moose::Meta::Class'
,
error_class
=>
'WiX3::Util::Error'
,
);
our
$VERSION
=
'0.011'
;
WiX3::XML::Role::GeneratesGUID
WiX3::Role::Traceable
)
;
has
'+child_tags'
=> (
isa
=> ArrayRef [ComponentChildTag] );
has
id
=> (
is
=>
'ro'
,
isa
=> Str,
reader
=>
'get_id'
,
builder
=>
'id_build'
,
lazy
=> 1,
);
has
complusflags
=> (
is
=>
'ro'
,
isa
=> Maybe [Int],
reader
=>
'_get_complusflags'
,
default
=>
undef
,
);
has
directory
=> (
is
=>
'ro'
,
isa
=> Maybe [Str],
reader
=>
'_get_directory'
,
default
=>
undef
,
);
has
disableregistryreflection
=> (
is
=>
'ro'
,
isa
=> YesNoType | Undef,
reader
=>
'_get_disableregistryreflection'
,
default
=>
undef
,
coerce
=> 1,
);
has
diskid
=> (
is
=>
'ro'
,
isa
=> Maybe [Int],
reader
=>
'_get_diskid'
,
default
=>
undef
,
);
has
feature
=> (
is
=>
'ro'
,
isa
=> Maybe [Str],
reader
=>
'_get_feature'
,
default
=>
undef
,
);
has
guid
=> (
is
=>
'ro'
,
isa
=> ComponentGuidType,
reader
=>
'get_guid'
,
lazy
=> 1,
init_arg
=>
undef
,
builder
=>
'guid_build'
,
);
has
keypath
=> (
is
=>
'ro'
,
isa
=> YesNoType | Undef,
reader
=>
'_get_keypath'
,
default
=>
undef
,
coerce
=> 1,
);
has
location
=> (
is
=>
'ro'
,
isa
=> Maybe [Str],
reader
=>
'_get_location'
,
default
=>
undef
,
);
has
neveroverwrite
=> (
is
=>
'ro'
,
isa
=> YesNoType | Undef,
reader
=>
'_get_neveroverwrite'
,
default
=>
undef
,
coerce
=> 1,
);
has
path
=> (
is
=>
'ro'
,
isa
=> Maybe [Str],
reader
=>
'get_path'
,
default
=>
undef
,
);
has
permanent
=> (
is
=>
'ro'
,
isa
=> YesNoType | Undef,
reader
=>
'_get_permanent'
,
default
=>
undef
,
coerce
=> 1,
);
has
shared
=> (
is
=>
'ro'
,
isa
=> YesNoType | Undef,
reader
=>
'_get_shared'
,
default
=>
undef
,
coerce
=> 1,
);
has
shareddllrefcount
=> (
is
=>
'ro'
,
isa
=> YesNoType | Undef,
reader
=>
'_get_shareddllrefcount'
,
default
=>
undef
,
coerce
=> 1,
);
has
transitive
=> (
is
=>
'ro'
,
isa
=> YesNoType | Undef,
reader
=>
'_get_transitive'
,
default
=>
undef
,
coerce
=> 1,
);
has
uninstallwhensuperceded
=> (
is
=>
'ro'
,
isa
=> YesNoType | Undef,
reader
=>
'_get_uninstallwhensuperceded'
,
default
=>
undef
,
coerce
=> 1,
);
has
win64
=> (
is
=>
'ro'
,
isa
=> YesNoType | Undef,
reader
=>
'_get_win64'
,
default
=>
undef
,
coerce
=> 1,
);
sub
BUILDARGS {
my
$class
=
shift
;
my
%args
;
if
(
@_
== 1 &&
'HASH'
eq
ref
$_
[0] ) {
%args
= %{
$_
[0] };
}
elsif
( 0 ==
@_
% 2 ) {
%args
=
@_
;
}
else
{
WiX3::Exception::Parameter::Odd->throw(
"$class->new"
);
}
if
(
defined
$args
{
'guid'
} ) {
}
if
( not(
defined
$args
{
'id'
} or
defined
$args
{
'path'
} ) ) {
WiX3::Exception::Parameter->throw(
"Either id or path required in $class->new"
);
}
if
(
defined
$args
{id} and not
defined
_IDENTIFIER(
"C_$args{id}"
) ) {
print
"Invalid ID: $args{id}\n"
;
WiX3::Exception::Parameter::Invalid->throw(
'id'
);
}
return
\
%args
;
}
sub
as_string {
my
$self
=
shift
;
my
$children
=
$self
->has_child_tags();
my
$child_string
=
$self
->as_string_children();
my
$id
=
'C_'
.
$self
->get_id();
my
$string
;
$string
=
'<Component'
;
my
@attribute
= (
[
'Id'
=>
$id
, ],
[
'Guid'
=>
$self
->get_guid(), ],
[
'ComPlusFlags'
=>
$self
->_get_complusflags(), ],
[
'Directory'
=>
$self
->_get_directory(), ],
[
'DisableRegistryReflection'
=>
$self
->_get_disableregistryreflection(),
],
[
'DiskId'
=>
$self
->_get_diskid(), ],
[
'Feature'
=>
$self
->_get_feature(), ],
[
'Keypath'
=>
$self
->_get_keypath(), ],
[
'Location'
=>
$self
->_get_location(), ],
[
'NeverOverwrite'
=>
$self
->_get_neveroverwrite(), ],
[
'Permanent'
=>
$self
->_get_permanent(), ],
[
'Shared'
=>
$self
->_get_shared(), ],
[
'SharedDllRefCount'
=>
$self
->_get_shareddllrefcount(), ],
[
'Transitive'
=>
$self
->_get_transitive(), ],
[
'UninstallWhenSuperceded'
=>
$self
->_get_uninstallwhensuperceded(),
],
[
'Win64'
=>
$self
->_get_win64(), ],
);
my
(
$k
,
$v
);
foreach
my
$ref
(
@attribute
) {
(
$k
,
$v
) = @{
$ref
};
$string
.=
$self
->print_attribute(
$k
,
$v
);
}
if
(
$children
) {
$string
.=
qq{>\n$child_string\n</Component>\n}
;
}
else
{
$string
.=
qq{ />\n}
;
}
return
$string
;
}
sub
get_namespace {
}
sub
get_directory_id {
my
$self
=
shift
;
my
$id
=
$self
->get_id();
if
(
$self
->noprefix() ) {
return
$id
;
}
else
{
return
"D_$id"
;
}
}
no
Moose;
__PACKAGE__->meta->make_immutable;
1;