The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

OODoc::Text - base class for all data which was found in a manual

INHERITANCE

 OODoc::Text
   is a OODoc::Object

 OODoc::Text is extended by
   OODoc::Text::Default
   OODoc::Text::Diagnostic
   OODoc::Text::Example
   OODoc::Text::Option
   OODoc::Text::Structure
   OODoc::Text::Subroutine

SYNOPSIS

 # Cannot be instantiated itself

DESCRIPTION

METHODS

overload: '""' (stringification)

    Returned is the name of the text object.

overload: '==' and '!='

    Numeric comparison is used to compare to objects whether they are identical. String comparison is overloaded to compare the names of the objects.

overload: 'cmp' (string comparison)

    Names are compared.

$obj->name

    The name of this text element. Stringification is overloaded to call this name method.

    Example:

     print $text->name;
     print $text;   # via overload

Attributes

$obj->description

    Returns the description text for this object. Nearly all objects contains some kind of introductory description.

$obj->findDescriptionObject

    From the current object, search in the extends until an object is found which has a content for the description field.

$obj->openDescription

    Returns a reference to the scalar which will contain the description for this object.

    Example:

     my $descr = $text->openDescription;
     $$descr  .= "add a line\n";

$obj->type

    Returns the type name of this data object.

$obj->where

    Returns the source of the text item: the filename name and the line number of the start of it.

Container

$obj->container

    The text element which encapsulaters the text element at hand. This defines the structure of the documentation. Only for chapters, this value will be undefined.

$obj->manual

    Returns the manual object which contains this text element.

Examples

$obj->example(OBJECT)

    Add a new example (a OODoc::Text::Example object) to the list already in this object. You can not look for a specific because they have no real name (only a sequence number).

$obj->examples

    Returns a list of all examples contained in this text element.

Initiation

OODoc::Text->new(OPTIONS)

Inheritance

$obj->extends([OBJECT])

Commonly used functions

$obj->filenameToPackage(FILENAME)

OODoc::Text->filenameToPackage(FILENAME)

$obj->mergeObjects(OPTIONS)

$obj->mkdirhier(DIRECTORY)

OODoc::Text->mkdirhier(DIRECTORY)

$obj->unique

    Returns a unique id for this text item. This is the easiest way to see whether two references to the same (overloaded) objects point to the same thing. The ids are numeric.

    Example:

     if($obj1->unique == $obj2->unique) {...}
     if($obj1 == $obj2) {...}   # same via overload

Manual database

All manuals can be reached everywhere in the program: it is a global collection.

$obj->addManual(MANUAL)

$obj->mainManual(NAME)

$obj->manuals

$obj->manualsForPackage(NAME)

$obj->packageNames

DIAGNOSTICS

Error: manual definition requires manual object

A call to addManual() expects a new manual object (a OODoc::Manual), however an incompatible thing was passed. Usually, intended was a call to manualsForPackage() or mainManual().

Warning: order conflict "$take" before "$insert" in $file line $number

The order of the objects in a sub-class shall be the same as that of the super class, otherwise the result of merging of the information received from both classes is undertermined.