18#include <matrix/vlVector.h>
19#include <matrix/vlTaitBryan.h>
21#include <vlutil/vlString.h>
27#include <boost/signals2/signal.hpp>
28#include <boost/signals2/connection.hpp>
133std::vector<std::string>
UTIL_DLL tokenize(
const std::string&
string,
const std::string& delimiter =
" ");
154 const std::string&
string,
const std::string& start,
const std::string& end,
const std::string& replacement);
166 std::string&
string,
const std::string& start,
const std::string& end,
const std::string& replacement);
178 const std::string&
string,
const std::string& target,
const std::string& replacement);
267 else if (value > max)
354 bool read(
const DtFilename& filename);
355 bool write(
const DtFilename& filename);
376template <
class Signal,
class F>
379 return sig.connect_extended(
380 [func = std::forward<F>(f)](
const boost::signals2::connection& c,
auto&&... args)
mutable {
381 func(std::forward<
decltype(args)>(args)...);
384 boost::signals2::at_back);
400template <
class Signal,
class F>
403 return sig.connect_extended(
404 [func = std::forward<F>(f)](
const boost::signals2::connection& c,
auto&&... args)
mutable {
405 func(std::forward<
decltype(args)>(args)...);
408 boost::signals2::at_front);
Definition utilFunctions.h:352
bool read(const DtFilename &filename)
bool write(const DtFilename &filename)
Defines export macros for the VREngage Utility library.
#define UTIL_DLL
Export/import macro for non-Windows platforms.
Definition export.h:39
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
double UTIL_DLL randReal(double min, double max)
Generates a random number within a specified range.
int UTIL_DLL randomInt(int min, int max)
Generates a random integer within a specified range.
void UTIL_DLL fixMissingBoostClosingTag(DtString &xml)
template double UTIL_DLL clampValue< double >(double, double, double)
Explicit instantiation for double clampValue.
unsigned long UInt32
Unsigned 32-bit integer type.
Definition utilFunctions.h:38
std::vector< std::string > UTIL_DLL tokenize(const std::string &string, const std::string &delimiter=" ")
Splits a string into tokens.
std::string UTIL_DLL subStrReplaced(const std::string &string, const std::string &target, const std::string &replacement)
Creates a new string with all occurrences of a substring replaced.
unsigned long long UTIL_DLL stoull(const std::string &in)
Converts a string to an unsigned long long integer.
std::string UTIL_DLL lowerCase(const std::string &in)
Creates a new string with all characters converted to lowercase.
template float UTIL_DLL clampValue< float >(float, float, float)
Explicit instantiation for float clampValue.
std::string UTIL_DLL trim(const std::string &str)
Removes leading and trailing whitespace from a string.
void UTIL_DLL clampLength(std::string &string, size_t length, const std::string &tail="...")
Clamps a string to a maximum length in-place.
unsigned long long UInt64
Unsigned 64-bit integer type.
Definition utilFunctions.h:42
double UTIL_DLL DtWallClockTime()
Gets a high-resolution time in seconds.
bool UTIL_DLL stob(const std::string &in)
Converts a string to a boolean value.
unsigned short UInt16
Unsigned 16-bit integer type.
Definition utilFunctions.h:34
short Int16
Signed 16-bit integer type.
Definition utilFunctions.h:36
UInt64 UTIL_DLL DtVreTimestamp()
Gets a high-resolution CPU timestamp.
boost::signals2::connection connectOnceFront(Signal &sig, F &&f)
Helper: connect a slot to a Boost.Signals2 signal to run only once (front).
Definition utilFunctions.h:401
bool UTIL_DLL DtIsEnvironmentVariableSet(const std::string &env, const std::string &testValue="")
Checks if an environment variable is set.
long long UTIL_DLL stoll(const std::string &in)
Converts a string to a long long integer.
void UTIL_DLL makeLower(std::string &str)
Converts a string to lowercase in-place.
double invFreq
Inverse of CPU frequency for time calculations.
std::string UTIL_DLL lengthClamped(const std::string &string, size_t length, const std::string &tail="...")
Creates a new string clamped to a maximum length.
unsigned int UTIL_DLL DtGetThreadId()
Gets the current thread ID.
std::string UTIL_DLL rtoa(float r)
Converts a floating-point value to a string (radians to angle string)
bool UTIL_DLL DtInitializeTimer()
Initializes the high-resolution timer.
bool timerIsInitialized
Flag indicating if the high-resolution timer is initialized.
float UTIL_DLL stof(const std::string &in)
Converts a string to a float.
double UTIL_DLL clampToPrecision(double val, double precision)
Clamps a value to a specified precision.
int UTIL_DLL stoi(const std::string &in)
Converts a string to an integer.
void UTIL_DLL replaceSubStr(std::string &string, const std::string &target, const std::string &replacement)
Replaces all occurrences of a substring in-place.
double UTIL_DLL stod(const std::string &in)
Converts a string to a double.
T clampValue(T value, T min, T max)
Clamps a value between a minimum and maximum range.
Definition utilFunctions.h:261
void UTIL_DLL replaceSubStrRange(std::string &string, const std::string &start, const std::string &end, const std::string &replacement)
Replaces a substring range in-place.
template int UTIL_DLL clampValue< int >(int, int, int)
Explicit instantiation for int clampValue.
std::string UTIL_DLL subStrRangeReplaced(const std::string &string, const std::string &start, const std::string &end, const std::string &replacement)
Creates a new string with a substring range replaced.
unsigned long UTIL_DLL stoul(const std::string &in)
Converts a string to an unsigned long integer.
boost::signals2::connection connectOnce(Signal &sig, F &&f)
Helper: connect a slot to a Boost.Signals2 signal to run only once (back).
Definition utilFunctions.h:377
long long Int64
Signed 64-bit integer type.
Definition utilFunctions.h:44
long Int32
Signed 32-bit integer type.
Definition utilFunctions.h:40
long UTIL_DLL stol(const std::string &in)
Converts a string to a long integer.
UInt64 ticksPerSecond
Number of CPU ticks per second.
bool UTIL_DLL findArg(const char *arg, int argc, char **argv, const char *param[])
Finds a command-line argument and its parameter.