ePages 6.17.13 - DE_EPAGES/Core/API/Object/ConfStructure.pm

Package DE_EPAGES::Core::API::Object::ConfStructure

configuration structures are objects to simulate configuration files.

Functions

addSection
addSectionComment
addSectionKey
existsSection
existsSectionComment
existsSectionKey
exportConf
getConfType
getSectionCommentInfo
getSectionCommentLastAppearence
getSectionCommentPosition
getSectionComments
getSectionCommentsIDs
getSectionCommentsMaxPosition
getSectionKeyCommentsMaxPosition
getSectionKeyPosition
getSectionKeyValue
getSectionKeys
getSectionPosition
getSections
getSectionsMaxPosition
importConfStructure
new
removeSection
removeSectionKey
setSectionKeyValue

addSection

add section to structure

Syntax
$ConfStruct->addSection($Section,$Position);
Input
$Section (string)
name of section
$Position (integer)
position of section

addSectionComment

add section key to structure

Syntax
$ConfStruct->addSectionComment($Section,$Comment,$Position);
Input
$Section (string)
name of section
$Comment (string)
name of section key
$Position (integer)
position of section

addSectionKey

add section key to structure

Syntax
$ConfStruct->addSectionKey($Section, $Key, $Position);
Input
$Section (string)
name of section
$Key (string)
name of section key
$Position (integer)
position of section

existsSection

return true if the section exists

Syntax
my $ExistsSection = $ConfStruct->existsSection($Section);
Input
$Section (string)
name of section
Return
$ExistsSection (bool)
true if section exists

existsSectionComment

return true if the section key exists

Syntax
my $ExistsSectionComment = $ConfStruct->existsSectionComment($Section);
Input
$Section (string)
name of section
$Comment (string)
name of section key
Return
$ExistsSectionComment (bool)
true if section key exists

existsSectionKey

return true if the section key exists

Syntax
my $ExistsSectionKey = $ConfStruct->existsSectionKey($Section,$Key);
Input
$Section (string)
name of section
$Key (string)
name of section key
Return
$ExistsSectionKey (bool)
true if section key exists

exportConf

exports the structure into config file

Syntax
$ConfStruct->exportConf($FileName);
Input
$FileName (string)
name of file

getConfType

returns the type of conf [epages|standard]

Syntax
my $ConfType = $self->getConfType();
Return
$ConfType (string)
name of configuration type

getSectionCommentInfo

returns infos about section comments, all sections listed with related position

Syntax
$SectionCommentInfos = $ConfStruct->getSectionCommentInfo($Section);
Input
$Section (string)
name of section
Return
$SectionCommentInfos (integer)
position of section

getSectionCommentLastAppearence

get last appearence of section comment, maybe there are multiple comments in section that are identical

Syntax
my $LastAppearence = $ConfStruct->getSectionCommentLastAppearence($Section,$Comment);
Input
$Section (string)
name of section
$Comment (string)
comment in section
Return
$LastAppearence (integer)
last appearence of comment in section

getSectionCommentPosition

return the section comment position

Syntax
my $Position = $ConfStruct->getSectionCommentPosition($Section,$CommentID);
Input
$Section (string)
name of section
$CommentID (string)
id of section comment,
normally comment itselfs with trailing appearence e.g. #comment .. _ConfStruct-Appearence(3)
Return
$SectionKeyPosition (string)
section comment position

getSectionComments

get list with section comments

Syntax
my $aSectionComments = $ConfStruct->getSectionComments($Section);
Input
$Section (string)
name of section
Return
$aSectionComments (ref.array.string)
list of section comment

getSectionCommentsIDs

get list with section comments identifier

Syntax
my $aCommentsIDs = $ConfStruct->getSectionCommentsIDs($Section);
Input
$Section (string)
name of section
Return
$aSectionCommentsIDs (ref.array.string)
list of section comment

getSectionCommentsMaxPosition

get max position of section keys

Syntax
$ConfStruct->getSectionCommentsMaxPosition($Section);
Input
$Section (string)
name of section
Return
$Position (integer)
maximum position

getSectionKeyCommentsMaxPosition

get max position of section keys

Syntax
$ConfStruct->getSectionKeyCommentsMaxPosition($Section);
Input
$Section (string)
name of section
Return
$Position (integer)
maximum position

getSectionKeyPosition

return the section key position

Syntax
my $Position = $ConfStruct->getSectionKeyPosition($Section,$Key);
Input
$Section (string)
name of section
$Key (string)
name of section key
Return
$SectionKeyPosition (string)
section key position

getSectionKeyValue

return the section key value

Syntax
my $Value = $ConfStruct->getSectionKeyValue($Section,$Key);
Input
$Section (string)
name of section
$Key (string)
name of section key
Return
$SectionKeyValue (string)
section key value

getSectionKeys

return a list with the lines of section

Syntax
$aSectionKeys = $ConfStruct->getSectionKeys($Section);
Input
$Section (string)
name of section
Return
$aSectionKeys (ref.array.string)
reference to array that contains the the keys of a section

getSectionPosition

return the section position

Syntax
my $Position = $ConfStruct->getSectionPosition($Section);
Input
$Section (string)
name of section
$Key (string)
name of section key
Return
$SectionCommentPosition (string)
section key position

getSections

return a list with the names of all sections in the configuration structure.

Syntax
$aSections = $ConfStruct->getSections();
Example
my @Sections = @{$ConfStruct->getSections()};
Return
$aSections (ref.array)
reference to array that contains the names of all sections
in the configuration structure

getSectionsMaxPosition

get max position of section keys

Syntax
$ConfStruct->getSectionsMaxPosition();
Return
$Position (integer)
maximum position

importConfStructure

imports all sections and comments from given config structure

Syntax
$ConfStruct->importConfStructure($ImportConfStruct);
Input
$ImportConfStruct (object)
import config structure

new

constructor for config structure object.

Syntax
$self->new($ConfType);
Input
$ConfType (string)
type of configuration file, normally 'epages' or 'standard'
Return
$ConfStruct (object)
configuration structure object

removeSection

remove section from structure

Syntax
$ConfStruct->removeSection($Section);
Input
$Section (string)
name of section

removeSectionKey

remove the section key

Syntax
$ConfStruct->removeSectionKey($Section,$Key);
Input
$Section (string)
name of section
$Key (string)
name of section key

setSectionKeyValue

set section key value

Syntax
$ConfStruct->setSectionKeyValue($Section,$Key, $Value);
Input
$Section (string)
name of section
$Key (string)
name of section key
$SectionKeyValue (bool)
section key value