Tools Module
The tools class is the primary utility base class, providing static helpers
for file-system operations, string manipulation, hashing, base-64 encoding, and
generic container algorithms. Most framework classes inherit tools so that
these helpers are always available via this->.
Class: tools
Header: <tools/tools.h>
Inheritance: (base class — no parents)
File-System Methods
Signature |
Description |
|---|---|
|
Recursively creates the given directory path ( |
|
Deletes the file or directory at path (calls |
|
Returns |
|
Renames / moves start to target. |
|
Returns the canonical absolute path of path. |
|
Lists all files under path whose extension matches ext (empty = all files). |
String Methods
Signature |
Description |
|---|---|
|
Converts a double to its string representation. |
|
Converts a double to a string with prec significant digits. |
|
Replaces the first occurrence of repl_str in |
|
Returns |
|
Returns |
|
Returns |
|
Splits in on the delimiter delim and returns the tokens. |
|
Splits in into substrings of length n. |
|
Returns a lower-cased copy of the input string. |
Hashing and Encoding
Signature |
Description |
|---|---|
|
Returns a hex string of length len derived from input via SHA-256.
The default |
|
Base-64 encodes |
|
Base-64 encodes a raw byte buffer of len bytes. |
|
Base-64 decodes |
|
Base-64 decodes the const-reference string s. |
Template Utilities
Signature |
Description |
|---|---|
|
Splits v into consecutive chunks of at most N elements. |
|
Returns the maximum value in inpt. |
|
Returns the minimum value in inpt. |
|
Accumulates and returns the sum of all elements in inpt. |
|
Returns a new vector by gathering elements of src at the indices trg. |
|
In-place version: clears out and fills it by gathering from src at trg.
Also sets |
|
Appends elements of inx that are not already in oth to oth (union deduplication by value). |