Miscelaneous tools for operating: Listing directories, writing to log files and getting last file modification times.
More...
|
bool | StartupSanityChecks (BelaContext *context) |
| Perform sanity checks on startup, for the parameters that should be set properly in 'settings'. Mainly checks for the sampling frequency and the number of channels. More...
|
|
std::vector< std::string > | list_dir (const char *path) |
| List the contents of a directory path, and return the contents. More...
|
|
time_t | last_modification_time (const std::string &filepath) |
| Determine the last modification time of a file and returns it as a time_t value. More...
|
|
double | retrieveAsNumber (JSONObject &json, const std::string &str) |
| Searches for the key str in the JSON object and returns a the number. Throws a runtime error if the key is not found, or it is not a number. More...
|
|
Miscelaneous tools for operating: Listing directories, writing to log files and getting last file modification times.
Box for helpful functions and classes that do not really have a proper place.
◆ last_modification_time()
time_t last_modification_time |
( |
const std::string & |
filepath | ) |
|
Determine the last modification time of a file and returns it as a time_t value.
- Parameters
-
filepath | The filepath to determine this from |
- Returns
- Time in a time_t value.
Definition at line 123 of file tools.cpp.
◆ list_dir()
std::vector<std::string> list_dir |
( |
const char * |
path | ) |
|
List the contents of a directory path, and return the contents.
- Parameters
-
- Returns
- A vector of strings containing the path content
Definition at line 108 of file tools.cpp.
◆ retrieveAsNumber()
double retrieveAsNumber |
( |
JSONObject & |
json, |
|
|
const std::string & |
str |
|
) |
| |
Searches for the key str
in the JSON object and returns a the number. Throws a runtime error if the key is not found, or it is not a number.
- Parameters
-
json | The JSON object |
str | Key |
- Returns
- The number
Definition at line 195 of file tools.cpp.
◆ StartupSanityChecks()
bool StartupSanityChecks |
( |
BelaContext * |
context | ) |
|
Perform sanity checks on startup, for the parameters that should be set properly in 'settings'. Mainly checks for the sampling frequency and the number of channels.
- Parameters
-
- Returns
- true if everything is OK.
Definition at line 54 of file tools.cpp.