Source code

CERNY.util

Some general purpose utility functions.

Functions

indent

Create an indentation string, a line feed followed by n spaces, where n = indentation.

indentation (number) : the number of spaces to append to the line feed
return (string) : a string
fillNumber

Return (at least) two digit number as a String. If number smaller than 10 return "0" + number.

number (number) : the number to fill
return (string) : the filled number
cutNumber

Return the last n digits from the decimal String representation of number.

number (number) : the number to get the digits from
n (number) : how many digits to get
return (string) : the last n digits
parseUri

Parses an URI into its components.

Right now it cannot handle: "mailto:mduerst@ifi.unizh.ch" "news:comp.infosystems.www.servers.unix"

uri (string) : the uri to parse
return (object) : an object containing the parts of the uri
getNameFromFqName

Return the short name from a fully qualified name.

fqName (string) : the fully qualified name
return (string) : the short name

History

2007-03-20 : Corrected signature of CERNY.util.indent.
2007-03-15 : Added signatures.
2007-02-23 : Fixed bug in CERNY.parseUri (Result of "dev/".split(/\//) differs in IE and Firefox).
2007-02-23 : Added logger to CERNY.util.
2007-02-19 : Added getNameFromFqName.
2007-02-09 : Added parseUri.
2006-11-12 : Created.

API Documentation for version

1.3

Scripts

Scripts

util