CAD::Firemen::Common - Shared functions used by other scripts from the Firemen module.
version 0.7.2
Strips out whitespaces at the beginning and the end of the given string. It also removes double whitespaces.
to untaint the string, it strip outs any escape sequences (without \n), to make the string more secure (taint mode)
Prints the string within the first parameter on the far left of the screen. The second paremeter is printed on the far right of the screen in the color of optional third parameter. See Term::ANSIColor for the names of the colors.
Prints the content of the first parameter on the far left screen side and "PASSED" in green on the far right.
Prints the content of the first parameter on the far right side and "FAILED" in red on the far right.
Returns the lenght of the longest string within the given array as first parameter.
Prints the given text in the given color. The main reason to use this function is to use Win32::Console within this module.
Prints a text block with an specified indentation.
Builds a bar of = to display a percentage value of the ratio between $value and $max.
Method parses $ENV{PATH} and tries to filter out all Firemen related paths. Afterwards, if more than one is found, the user can select which one he wants to use. This one is returned than.
The returned path DOES NOT ends with a slash!
Uses getInstallationConfigPath() to return the full path to the related config.cdb. You may specify the installation path to get the related config.pro. If not given, it uses getInstallationPath() to guess or ask one.
Uses getInstallationConfigPath() to return the full path to the related config.pro. You may specify the installation path to get the related config.pro. If not given, it uses getInstallationPath() to guess or ask one.
Returns the path to the shared directory where all modules and scripts of this distribution places their files.
If it does not exists, it creates it.
Compuates an installation identifier out of the creo installation path. This ID is used e. g. to create the database name.
Creates a connection to the database and returns the reference to the DBI object or 0 if an error occurs. If the database does not exists an empty database file is created.
If you want to insert data, make sure that you use the commit function, since AutoCommit is disabled.
The database layout is described in fm_create_help.
Loads the settings from config file and returns a reference to the hash.
Most possible settings are explained at CAD::Firemen (Use perldoc CAD::Firemen).
Saves the Hash, which reference is given into the config file.
Method to delete all .svn directories borrowed from http://snipplr.com/view/27050/ with small change (introduced rmtree)
Returns the file path to the config file. Use loadSettings() and saveSettings() to get and store settings
Returns the terminal width.
Joachim Langenbach <langenbach@imw.tu-clausthal.de>
This software is Copyright (c) 2015 by TU Clausthal, Institut fuer Maschinenwesen.
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991
To install CAD::Firemen, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CAD::Firemen
CPAN shell
perl -MCPAN -e shell install CAD::Firemen
For more information on module installation, please visit the detailed CPAN module installation guide.