225 bool absolute_path(
string path);
242 bool absolute_path_unix(
string path);
259 bool absolute_path_windows(
string path);
263 const ParenMap = (
")":
"(",
"}":
"{",
"]":
"[",);
264 const FwdParenMap = map {$1.value: $1.key}, ParenMap.pairIterator();
267 const ET_RawString = 0;
268 const ET_QuotedString = 1;
269 const ET_BracketString = 2;
273 ET_RawString:
"raw string",
274 ET_QuotedString:
"quoted string",
275 ET_BracketString:
"bracket expression",
281 list scan_exp(
string arg);
285 hash eval_text(
string arg,
bool err =
False);
291 auto parse_to_basic_value(*
string arg);
385 string make_uri_query(hash<UriQueryInfo> h,
string arg_separator =
";");
417 const StorageNames = (
"Kilo",
"Mega",
"Giga",
"Tera",
"Peta",
"Exa",
"Zetta",
"Yotta",
"Bronto");
516 const RE_FLOAT =
'^\s*[-+]?('
517 '\d+\.\d*(e[-+]?\d+)?'
543 const RE_NUMBER =
'^\s*[-+]?('
544 '\d+\.\d*(e[-+]?\d+)?'
587 string lpad(softstring text,
int length,
string padding =
' ');
606 string rpad(softstring text,
int length,
string padding =
' ');
644 string plural(
int count,
string base,
string singular =
"",
string plural =
"s");
string get_exception_string(hash ex)
returns a multi-line string from the exception hash argument suitable for logging or output on the co...
string normalize_dir_windows(string dir, string cwd=getcwd())
returns a normalized Windows path name (eliminates ".", "..", and "//")
the return value of the parse_uri_query() function
Definition: Util.qm.dox.h:126
string normalize_dir(string dir, string cwd=getcwd())
returns a platform-specific normalized path name (starting from /, eliminates ".", "..", and "//")
bool is_number(string text, bool pure=False)
Checks whether string represents a (true) number value.
string plural(int count, string base, string singular="", string plural="s")
Returns string with number and proper singular/plural form of noun.
string glob_to_regex(string pat)
Translates a shell pattern to a regular expression.
string method
the part of the URI path before the first "?" character or the entire path if no "?" character is present in the path
Definition: Util.qm.dox.h:128
string rpad(softstring text, int length, string padding= ' ')
Returns a string right-padded to a specified length with the specified characters.
list zip()
Returns a list of lists, where the i-th list contains the i-th element from each of the argument list...
string get_byte_size(softnumber n, int decimals=2)
returns a string giving a user-friendly real storage size (ie based on 1KiB = 1024 bytes) in KiB...
string normalize_dir_unix(string dir, string cwd=getcwd())
returns a normalized UNIX path name (starting from /, eliminates ".", "..", and "//") ...
string tmp_location()
Returns a path for temporary files.
const StorageNames
storage names (Geop, which would normally follow Bronto, is excluded as the abbreviation would be GB/...
Definition: Util.qm.dox.h:417
string lpad(softstring text, int length, string padding= ' ')
Returns a string left-padded to a specified length with the specified characters. ...
hash< UriQueryInfo > parse_uri_query(string path)
parses a URI path for a arguments and a method; where the method is the part of the path before the f...
bool is_float(string text, bool pure=False)
Checks whether string represents a (true) float value.
string regex_escape(string text)
Escapes (backslashes) all non-alphanumeric characters in a string.
bool same(list l)
checks whether given list has only uniq element
list flatten(softlist arg)
Flattens a nested list (the nesting can be to any depth).
*hash params
(only present if a "?" character is present in the input); the part of the path after the first "...
Definition: Util.qm.dox.h:131
int compare_version(string lv, string rv)
compares complex versions by breaking down strings into component parts
string ordinal(int i)
Returns string with partially textual representation of ordinal integer value.
string get_random_string(softint len=15, int level=3)
function that returns a random string
list uniq(softlist arg)
Returns a duplicate-free version of the list.
list slice(list l, softlist indices)
list slice implementation
auto parse_to_qore_value(string arg)
tries to convert a string (such as an argument given from the command-line) to a Qore value ...
int length(softstring str)
string make_uri_query(hash< UriQueryInfo > h, string arg_separator=";")
returns a serialized string for a UriQueryInfo hash
string get_marketing_byte_size(softnumber n, int decimals=2)
returns a string giving a user-friendly "marketing storage" size (ie based on 1KB = 1000 bytes) in KB...
bool is_int(string text, bool pure=False)
Checks whether string represents a (true) integer value.