|
| string | gutilities::removeLeadingAndTrailingSpacesFromString (const std::string &input) |
| | Removes leading and trailing spaces and tabs from a string.
|
| |
| std::string_view | gutilities::removeLeadingAndTrailingSpacesFromString (std::string_view s) |
| |
| string | gutilities::removeAllSpacesFromString (const std::string &str) |
| | Removes all spaces from a string.
|
| |
| string | gutilities::getFileFromPath (const std::string &path) |
| | Extracts the filename from a given file path.
|
| |
| string | gutilities::getDirFromPath (const std::string &path) |
| | Extracts the directory path from a given file path.
|
| |
| std::optional< std::string > | gutilities::searchForFileInLocations (const std::vector< std::string > &locations, std::string_view filename) |
| |
| vector< std::string > | gutilities::getStringVectorFromString (const std::string &input) |
| | Splits a string into a vector of strings using spaces as delimiters.
|
| |
| string | gutilities::replaceCharInStringWithChars (const std::string &input, const std::string &toReplace, const std::string &replacement) |
| | Replaces all occurrences of specified characters in a string with another string.
|
| |
| string | gutilities::replaceAllStringsWithString (const string &source, const string &from, const string &to) |
| | Replaces all occurrences of a substring with another string.
|
| |
| string | gutilities::fillDigits (const string &word, const string &c, int ndigits) |
| | Pads a string with a specified character until it reaches a desired length.
|
| |
| double | gutilities::getG4Number (const string &v, bool warnIfNotUnit=false) |
| | Converts a string representation of a number with optional units to a double.
|
| |
| double | gutilities::getG4Number (double input, const string &unit) |
| | Converts a numeric value with a unit into a G4 number format and returns the converted value.
|
| |
| vector< double > | gutilities::getG4NumbersFromStringVector (const vector< string > &vstring, bool warnIfNotUnit=false) |
| | Converts a vector of strings representing numbers with units to a vector of doubles.
|
| |
| vector< double > | gutilities::getG4NumbersFromString (const string &vstring, bool warnIfNotUnit=false) |
| | Converts a comma-separated string of numbers with units to a vector of doubles.
|
| |
| string | gutilities::parseFileAndRemoveComments (const string &filename, const string &commentChars="#", int verbosity=0) |
| | Parses a file and removes all lines containing specified comment characters.
|
| |
| string | gutilities::retrieveStringBetweenChars (const string &input, const string &firstDelimiter, const string &secondDelimiter) |
| | Retrieves a substring between two specified delimiters in a string.
|
| |
| vector< string > | gutilities::getStringVectorFromStringWithDelimiter (const string &input, const string &x) |
| | Splits a string into a vector of substrings using a specified delimiter.
|
| |
| bool | gutilities::directoryExists (const std::string &path) |
| | Checks if a directory exists at the given path.
|
| |
| string | gutilities::searchForDirInLocations (const string &dirName, const vector< string > &possibleLocations) |
| | Searches for a directory within a list of possible locations.
|
| |
| bool | gutilities::hasExtension (const string &filename, const vector< string > &extensions) |
| | Checks if a filename has one of the specified extensions.
|
| |
| vector< string > | gutilities::getListOfFilesInDirectory (const string &dirName, const vector< string > &extensions) |
| | Retrieves a list of files with specific extensions from a directory.
|
| |
| string | gutilities::convertToLowercase (const string &str) |
| | Converts a string to lowercase.
|
| |
| template<class KEY , class VALUE > |
| vector< KEY > | gutilities::getKeys (const map< KEY, VALUE > &map) |
| | Retrieves all keys from a map.
|
| |
| randomModel | gutilities::stringToRandomModel (const std::string &str) |
| | Converts a string to a corresponding randomModel enum value.
|
| |
| constexpr const char * | gutilities::to_string (randomModel m) noexcept |
| |
| G4Colour | gutilities::makeG4Colour (std::string_view code, double opacity) |
| | Convert a hex colour string to G4Colour.
|
| |
| std::filesystem::path | gutilities::executable_path () |
| |
| std::filesystem::path | gutilities::gemc_root () |
| |
| bool | gutilities::is_unset (std::string_view s) |
| |
| std::string | gutilities::success_or_fail (bool condition) |
| |
| void | gutilities::apply_uimanager_commands (const std::string &command) |
| |