=encoding utf8

=head1 NAME

OODoc::Manifest - maintain the information inside a manifest file.

=head1 INHERITANCE

 OODoc::Manifest
   is an OODoc::Object

=head1 SYNOPSIS

  my $manifest = OODoc::Manifest->new(filename => ...);

=head1 DESCRIPTION

Extends L<"DESCRIPTION" in OODoc::Object|OODoc::Object/"DESCRIPTION">.

=head1 OVERLOADED

Extends L<"OVERLOADED" in OODoc::Object|OODoc::Object/"OVERLOADED">.

=over 4

=item overload: B<'==' and '!=' (numeric comparison)>

Inherited, see L<OODoc::Object/"OVERLOADED">

=item overload: B<'bool'>

Inherited, see L<OODoc::Object/"OVERLOADED">

=item overload: B<@{}>

Referencing this object as array will produce all filenames from the
manifest.

=back

=head1 METHODS

Extends L<"METHODS" in OODoc::Object|OODoc::Object/"METHODS">.

=head2 Constructors

Extends L<"Constructors" in OODoc::Object|OODoc::Object/"Constructors">.

=over 4

=item $class-E<gt>B<new>(%options)

Inherited, see L<OODoc::Object/"Constructors">

 -Option  --Default
  filename  undef

=over 2

=item filename => $filename

The C<$filename> where the manifest is in.  When the name is not defined,
the data will not be written.

=back

=back

=head2 Attributes

Extends L<"Attributes" in OODoc::Object|OODoc::Object/"Attributes">.

=over 4

=item $obj-E<gt>B<filename>()

The name of the file which is read or will be written.

=item $obj-E<gt>B<unique>()

Inherited, see L<OODoc::Object/"Attributes">

=back

=head2 Manual Repository

Extends L<"Manual Repository" in OODoc::Object|OODoc::Object/"Manual Repository">.

=over 4

=item $obj-E<gt>B<addManual>($manual)

Inherited, see L<OODoc::Object/"Manual Repository">

=item $obj-E<gt>B<findManual>($name)

Inherited, see L<OODoc::Object/"Manual Repository">

=item $obj-E<gt>B<mainManual>($name)

Inherited, see L<OODoc::Object/"Manual Repository">

=item $obj-E<gt>B<manuals>()

Inherited, see L<OODoc::Object/"Manual Repository">

=item $obj-E<gt>B<manualsForPackage>($name)

Inherited, see L<OODoc::Object/"Manual Repository">

=item $obj-E<gt>B<packageNames>()

Inherited, see L<OODoc::Object/"Manual Repository">

=item $obj-E<gt>B<publicationIndex>()

Inherited, see L<OODoc::Object/"Manual Repository">

=item $obj-E<gt>B<publish>(\%options)

Inherited, see L<OODoc::Object/"Manual Repository">

=back

=head2 The manifest list

=over 4

=item $obj-E<gt>B<add>(@filenames)

Adds the C<@filenames> to the manifest, doubles are ignored.

=item $obj-E<gt>B<files>()

Returns an unsorted list with all filenames in this manifest.

=back

=head2 Internals

=over 4

=item $obj-E<gt>B<modified>( [BOOLEAN] )

Whether filenames have been added to the list after initiation.

=item $obj-E<gt>B<read>()

Read the MANIFEST file.  The comments are stripped from the lines.

=item $obj-E<gt>B<relative>($filename)

Returns the name of the file relative to the location of the MANIFEST
file.  The MANIFEST file should always be in top of the directory tree,
so the C<$filename> should be in the same directory and below.

=item $obj-E<gt>B<write>()

Write the MANIFEST file if it has changed.  The file will automatically
be written when the object leaves scope.

=back

=head1 DIAGNOSTICS

=over 4

=item Warning: MANIFEST file $file lists filename outside (sub)directory: $out

The MANIFEST file of a distributed package should be located in the top
directory of that packages.  All files of the distribution are in that
same directory, or one of its sub-directories, otherwise they will not
be packaged.

=item Fault: cannot read manifest file $file: $!

The manifest file could not be opened for reading.

=item Fault: cannot write manifest $file: $!

Z<>

=item Error: manual definition requires manual object

A call to L<addManual()|OODoc::Object/"Manual Repository"> expects a new manual object (a L<OODoc::Manual|OODoc::Manual>),
however an incompatible thing was passed.  Usually, intended was a call
to L<manualsForPackage()|OODoc::Object/"Manual Repository"> or L<mainManual()|OODoc::Object/"Manual Repository">.

=back

=head1 SEE ALSO

This module is part of OODoc version 3.02,
built on August 15, 2025. Website: F<https://perl.overmeer.net/oodoc/>

=head1 LICENSE

For contributors see file ChangeLog.

This software is copyright (c) 2003-2025 by Mark Overmeer.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

