summaryrefslogtreecommitdiffstats
path: root/MDK/Common/String.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-08-03 00:34:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-08-03 00:34:48 +0000
commit1696c19c569ce62fbe585a52ce3cf55a9bedb919 (patch)
tree30d5a8d9bb6dd39acde4d2ad0354d1ac29da9c8c /MDK/Common/String.pm
parenteddfce0641e5c1ca09cbb79143d10795b2faf08d (diff)
downloadperl-MDK-Common-1696c19c569ce62fbe585a52ce3cf55a9bedb919.tar
perl-MDK-Common-1696c19c569ce62fbe585a52ce3cf55a9bedb919.tar.gz
perl-MDK-Common-1696c19c569ce62fbe585a52ce3cf55a9bedb919.tar.bz2
perl-MDK-Common-1696c19c569ce62fbe585a52ce3cf55a9bedb919.tar.xz
perl-MDK-Common-1696c19c569ce62fbe585a52ce3cf55a9bedb919.zip
much doc added
Diffstat (limited to 'MDK/Common/String.pm')
-rw-r--r--MDK/Common/String.pm58
1 files changed, 58 insertions, 0 deletions
diff --git a/MDK/Common/String.pm b/MDK/Common/String.pm
index 74b8e2b..3faa270 100644
--- a/MDK/Common/String.pm
+++ b/MDK/Common/String.pm
@@ -1,3 +1,61 @@
+=head1 NAME
+
+MDK::Common::String - formatting functions
+
+=head1 SYNOPSIS
+
+ use MDK::Common::String qw(:all);
+
+=head1 EXPORTS
+
+=over
+
+=item bestMatchSentence(STRING, LIST)
+
+finds in the list the best corresponding string
+
+=item formatList(INT, LIST)
+
+if the list size is bigger than INT, replace the remaining elements with "...".
+
+formatList(3, qw(a b c d e)) # => "a, b, c, ..."
+
+=item formatError(STRING)
+
+the string is something like "error at foo.pl line 2" that you get when
+catching an exception. formatError will remove the "at ..." so that you can
+nicely display the returned string to the user
+
+=item formatTimeRaw(TIME)
+
+the TIME is an epoch as returned by C<time>, the formatted time looks like "23:59:00"
+
+=item formatLines(STRING)
+
+remove "\n"s when the next line doesn't start with a space. Otherwise keep
+"\n"s to keep the indentation.
+
+=item formatAlaTeX(STRING)
+
+handle carriage return just like LaTeX: merge lines that are not separated by
+an empty line
+
+=item warp_text(STRING, INT)
+
+return a list of lines which do not exceed INT characters
+
+=item warp_text(STRING)
+
+warp_text at a default width (80)
+
+=back
+
+=head1 SEE ALSO
+
+L<MDK::Common>
+
+=cut
+
package MDK::Common::String;
use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK);