gu_util
|
#include <vector>
#include <string>
#include <cstring>
#include <cmath>
#include <map>
#include <sys/param.h>
Go to the source code of this file.
Macros | |
#define | _POSIX_SOURCE 200112L |
#define | _XOPEN_SOURCE |
#define | DBG(x) |
#define | DPRINTF(x) |
#define | protected_msleep(ms) protected_usleep(1000LL*(ms)) |
#define | protected_sleep(s) protected_usleep(1000000LL*(s)) |
#define | __block _xblock |
#define | __block __attribute__((__blocks__(byref))) |
#define | NULLPTR nullptr |
#define | OVERRIDE override |
#define | NOEXCEPT noexcept |
#define | atoi16(s) static_cast<int16_t>(atoi(s)) |
#define | atou16(s) static_cast<uint16_t>(atoi(s)) |
#define | atoi32(s) static_cast<int32_t>(atoi(s)) |
#define | atou32(s) static_cast<uint32_t>(atoi(s)) |
#define | atoi64(s) static_cast<int64_t>(atoll(s)) |
#define | atou64(s) static_cast<uint64_t>(atoll(s)) |
#define | DOXY_MASK(n) /** Control bit (mask) for _ ##n (Used Internally) */ |
#define | DOXY_S(n) /** property setter for _ ##n (see Protected Attributes below) */ |
#define | DOXY_SS(n, s) /** property setter for _ ##n[s] (see Protected Attributes below) */ |
#define | DOXY_G(n) /** property getter for _ ##n (see Protected Attributes below) @return _ ##n value */ |
#define | DOXY_SG(n, s) /** property getter for _ ##n[s] (see Protected Attributes below) @return _ ##n[s] value */ |
#define | DOXY_GC(n) /** property getter for a constant referance to _ ##n (see Protected Attributes below) @return _ ##n value */ |
#define | DOXY_SGC(n, s) /** property getter for a constant referance to _ ##n[s] (see Protected Attributes below) @return _ ##n[s] value */ |
#define | DOXY_ARRAY_G(n) /** property getter for an element of the array _ ##n (see Protected Attributes below) @param e element index @return _ ##n value */ |
#define | DOXY_ARRAY_GC(n) /** property getter for a constant referance to an element of the array _ ##n (see Protected Attributes below) @param e element index @return _ ##n value */ |
#define | DOXY_VERSION_NEW(n) /** Checks if ##n##'s version number in the current message is greater then the local version number @return true if the version number is greater, false otherwise*/ |
#define | DOXY_BAPG(n) /** property getter for an element of the bit array _ ##n (see Protected Attributes below) @param b element index @return _ ##n value */ |
#define | DOXY_BAPGC(n) /** property getter for a constant referance to an element of the bit array _ ##n (see Protected Attributes below) @param b element index @return _ ##n value */ |
#define | DOXY_BAPS(n) /** property setter for an element of bit array _ ##n (see Protected Attributes below) @param b element index @param v element's value */ |
#define | PROPERTY_DECLARATION(t, n) protected: t _##n; |
#define | PROPERTY_GETTER(t, n) public: DOXY_G(n) t &n () { return _##n ; } DOXY_GC(n) const t &n () const { return _##n ; } |
#define | PROPERTY_SETTER(t, n) public: DOXY_S(n) void set_##n (const t &n ) { _##n = n ; } |
#define | PROPERTY(type, name) PROPERTY_DECLARATION(type,name) PROPERTY_GETTER(type,name) PROPERTY_SETTER(type,name) |
#define | BIT_DECLARATION(n) protected: unsigned int _##n : 1; |
#define | BIT_GETTER(n) public: DOXY_G(n) unsigned int n () DOXY_GC(n) const { return _##n ; } |
#define | BIT_SETTER(n) public: DOXY_S(n) void set_##n (const unsigned int n = true) { _##n = n ; } |
#define | BIT_PROPERTY(name) BIT_DECLARATION(name) BIT_GETTER(name) BIT_SETTER(name) |
#define | ARRAY_PROPERTY_DECLARATION(t, n, s) protected: t _##n[s]; |
#define | ARRAY_PROPERTY_GETTER(t, n, s) public: DOXY_ARRAY_G(n) t &n (int e) { return _##n[e] ; } DOXY_ARRAY_GC(n) const t &n (int e) const { return _##n[e] ; } const t* n() const { return _##n; } size_t n##_size() { return s; } |
#define | ARRAY_PROPERTY_SETTER(t, n) public: DOXY_S(n) void set_##n (const t &v, int e ) { _##n[e] = v ; } |
#define | ARRAY_PROPERTY(type, name, size) ARRAY_PROPERTY_DECLARATION(type,name,size) ARRAY_PROPERTY_GETTER(type,name,size) ARRAY_PROPERTY_SETTER(type,name) |
#define | STRING_PROPERTY_DECLARATION(n, s) protected: char _##n[s]; |
#define | STRING_PROPERTY_GETTER(n, s) public: DOXY_SG(n,s) char* n () { return &(_##n[0]); } DOXY_SGC(n,s) const char* n () const { return &(_##n[0]); } |
#define | STRING_PROPERTY_SETTER(n, s) public: DOXY_SS(n,s) void set_##n (const char* n ) { gu_strlcpy(_##n,n,(s)); } |
#define | STRING_PROPERTY(name, size) STRING_PROPERTY_DECLARATION(name, size) STRING_PROPERTY_GETTER(name, size) STRING_PROPERTY_SETTER(name, size) |
#define | BIT_ARRAY_PROPERTY_DECLARATION(n, s) protected: uint8_t _##n[((s-1)/8)+1]; |
#define | BIT_ARRAY_PROPERTY_GETTER(n) public: DOXY_BAPG(n) uint8_t n (int b) { return ( (_##n[( b/8) ] & (1 << (b%8) ) ) >> (b%8)); } DOXY_BAPGC(n) const uint8_t n (int b) const { return ( (_##n[(b/8)] & (1 << (b%8))) >>(b%8) ); } |
#define | BIT_ARRAY_PROPERTY_SETTER(n) public: DOXY_BAPS(n) void set_##n (int b, const unsigned int v = true ) { ( (v)&1 ? _##n[(b/8)] |= (1 << (b%8)) : _##n[(b/8)] &= ~(1 << (b%8)) ); } |
#define | BIT_ARRAY_PROPERTY(name, size) BIT_ARRAY_PROPERTY_DECLARATION(name, size) BIT_ARRAY_PROPERTY_GETTER(name) BIT_ARRAY_PROPERTY_SETTER(name) |
#define | CONTROLLED_SETTER(t, n) public: DOXY_S(n) void set_##n (const t &n ) { _##n = n ; _##n##_mask = 1;} |
#define | CONTROLLED_PROPERTY(type, name) PROPERTY_DECLARATION(type, name) PROPERTY_GETTER(type, name) CONTROLLED_SETTER(type, name) |
#define | CONTROLLED_ARRAY_PROPERTY_SETTER(t, n, s) public: DOXY_S(n) void set_##n(const t* n, size_t size) { _##n##_mask = 1; if(size <= s) memcpy(_##n, n, size); else { memcpy(_##n, n, size); printf("WARNING: wb msg array property setter out of bounds");}} |
#define | CONTROLLED_ARRAY_PROPERTY(type, name, size) ARRAY_PROPERTY_DECLARATION(type, name, size) ARRAY_PROPERTY_GETTER(type, name,size) CONTROLLED_ARRAY_PROPERTY_SETTER(type, name, size) |
#define | CONTROL_BIT(name) DOXY_MASK(n) BIT_DECLARATION(name##_mask) BIT_GETTER(name##_mask) BIT_SETTER(name##_mask) |
#define | VERSION_DECLARATION(n) private: int _##n##_version; static int* get_##n##_classVersion() { static int _##n##_classVersion = 0; return &_##n##_classVersion;} |
#define | VERSION_PROPERTY_SETTER(t, n) public: DOXY_S(n) void set_##n (const t &n ) { _##n = n; (*get_##n##_classVersion())+=1; _##n##_version = *get_##n##_classVersion();} private: void reset_##n##_version() {(*get_##n##_classVersion())=0;} |
#define | VERSION_PROPERTY_GETTER(t, n) public: DOXY_G(n) t &n () {(*get_##n##_classVersion()) = _##n##_version; return _##n ; } |
#define | VERSION_PROPERTY_CHECK(n) public: DOXY_VERSION_NEW(n) bool new_##n () {if(_##n##_version > (*get_##n##_classVersion())) return true; return false;} |
#define | VERSION_PROPERTY_INITIALIZATION(n) _##n##_version = 0; |
#define | VERSIONED_PROPERTY(type, name) PROPERTY_DECLARATION(type,name) VERSION_DECLARATION(name) VERSION_PROPERTY_SETTER(type,name) VERSION_PROPERTY_GETTER(type,name) VERSION_PROPERTY_CHECK(name) |
#define | SET_CONTROL_VAL(o, a, v) do { (o).set_##a(v); (o)set_##a##_mask(true); } while (0) |
#define | CHECK_ENUM(s, p, v) if (strstr((s), #v)) set_##p(v) |
#define | STREAM_ENUM_CASE(s, v) case v: s << #v; break |
#define | DEG_OVER_RAD (180.0f / static_cast<float>(M_PI)) |
#define | RAD_OVER_DEG (static_cast<float>(M_PI) / 180.0f) |
#define | DEG_OVER_RAD_10 (DEG_OVER_RAD * 10.0f) |
#define | RAD_OVER_DEG_10 (RAD_OVER_DEG / 10.0f) |
#define | RAD2DEG(x) ((x) * DEG_OVER_RAD) |
#define | DEG2RAD(x) ((x) * RAD_OVER_DEG) |
Functions | |
size_t | gu_strlcpy (char *dst, const char *src, size_t size) |
size_t | gu_strlcat (char *dst, const char *src, size_t size) |
bool | file_exists (const char *fileName) |
Return whether a file exists. More... | |
char * | new_string_from_file (const char *fileName) |
Load the contents of a given file into a string. More... | |
int | int_from_file (const char *fileName) |
Load the contents of a given file into an int. More... | |
double | double_from_file (const char *fileName) |
Load the contents of a given file into a double. More... | |
char * | gu_strdup (const char *str) |
Duplicate a string. More... | |
char * | concatenate_path (const char *head, const char *tail) |
Create a new string by concatenating two path components. More... | |
long long | get_utime (void) |
Get the current time of day in microseconds. More... | |
void | protected_usleep (long long us) |
Protected usleep() – guaranteed to sleep for the given time! param us number of microseconds to sleep. More... | |
char * | gu_strtrim (const char *s) |
Return a trimmed copy of the current string by removing all leading and trailing whitespace characters (needs to be free()d) More... | |
int | mipal_err_file (const char *filename) |
Set the log file for the current module. More... | |
void | mipal_warn (const char *fmt,...) |
Print a warning to the file mipal_err_file() has been set for (or stderr if none has been set) More... | |
const char * | gu_getprogname (void) |
get the basename of the current program More... | |
int | getplayernumber (void) |
get player number More... | |
std::string | string_from_file (const char *fileName) |
Load the contents of a given file into a string. More... | |
std::string | string_by_concatenating_path_components (const std::string &head, const std::string &tail) |
Concatenate two path components into a new string. More... | |
std::string & | gu_trim (std::string &s) |
Trim whitespace characters from both ends of a string. More... | |
std::string | gu_ltos (long val) |
Convert a long value to a string. More... | |
std::string | gu_ultos (unsigned long val) |
Convert an unsigned long value to a string. More... | |
std::string | gu_dtos (double val) |
Convert a double value to a string. More... | |
std::vector< std::string > | components_of_string_separated (const std::string &str, char sep='\n', bool trim=false) |
Split a string based on the token. More... | |
std::map< std::string, std::string > | read_configuration (const std::string &filename) |
Read simple key = value pairs into a c++ map. More... | |
int | inc (void *num) |
Increment a number Used to increment an enum value without warnings. More... | |
int | dec (void *num) |
Decrement a number Used to decrement a enum value without warnings. More... | |
#define ARRAY_PROPERTY | ( | type, | |
name, | |||
size | |||
) | ARRAY_PROPERTY_DECLARATION(type,name,size) ARRAY_PROPERTY_GETTER(type,name,size) ARRAY_PROPERTY_SETTER(type,name) |
#define ARRAY_PROPERTY_DECLARATION | ( | t, | |
n, | |||
s | |||
) | protected: t _##n[s]; |
#define ARRAY_PROPERTY_GETTER | ( | t, | |
n, | |||
s | |||
) | public: DOXY_ARRAY_G(n) t &n (int e) { return _##n[e] ; } DOXY_ARRAY_GC(n) const t &n (int e) const { return _##n[e] ; } const t* n() const { return _##n; } size_t n##_size() { return s; } |
#define ARRAY_PROPERTY_SETTER | ( | t, | |
n | |||
) | public: DOXY_S(n) void set_##n (const t &v, int e ) { _##n[e] = v ; } |
#define BIT_ARRAY_PROPERTY | ( | name, | |
size | |||
) | BIT_ARRAY_PROPERTY_DECLARATION(name, size) BIT_ARRAY_PROPERTY_GETTER(name) BIT_ARRAY_PROPERTY_SETTER(name) |
#define BIT_ARRAY_PROPERTY_DECLARATION | ( | n, | |
s | |||
) | protected: uint8_t _##n[((s-1)/8)+1]; |
#define BIT_ARRAY_PROPERTY_GETTER | ( | n | ) | public: DOXY_BAPG(n) uint8_t n (int b) { return ( (_##n[( b/8) ] & (1 << (b%8) ) ) >> (b%8)); } DOXY_BAPGC(n) const uint8_t n (int b) const { return ( (_##n[(b/8)] & (1 << (b%8))) >>(b%8) ); } |
#define BIT_ARRAY_PROPERTY_SETTER | ( | n | ) | public: DOXY_BAPS(n) void set_##n (int b, const unsigned int v = true ) { ( (v)&1 ? _##n[(b/8)] |= (1 << (b%8)) : _##n[(b/8)] &= ~(1 << (b%8)) ); } |
#define BIT_DECLARATION | ( | n | ) | protected: unsigned int _##n : 1; |
#define BIT_PROPERTY | ( | name | ) | BIT_DECLARATION(name) BIT_GETTER(name) BIT_SETTER(name) |
#define BIT_SETTER | ( | n | ) | public: DOXY_S(n) void set_##n (const unsigned int n = true) { _##n = n ; } |
#define CHECK_ENUM | ( | s, | |
p, | |||
v | |||
) | if (strstr((s), #v)) set_##p(v) |
#define CONTROL_BIT | ( | name | ) | DOXY_MASK(n) BIT_DECLARATION(name##_mask) BIT_GETTER(name##_mask) BIT_SETTER(name##_mask) |
#define CONTROLLED_ARRAY_PROPERTY | ( | type, | |
name, | |||
size | |||
) | ARRAY_PROPERTY_DECLARATION(type, name, size) ARRAY_PROPERTY_GETTER(type, name,size) CONTROLLED_ARRAY_PROPERTY_SETTER(type, name, size) |
#define CONTROLLED_ARRAY_PROPERTY_SETTER | ( | t, | |
n, | |||
s | |||
) | public: DOXY_S(n) void set_##n(const t* n, size_t size) { _##n##_mask = 1; if(size <= s) memcpy(_##n, n, size); else { memcpy(_##n, n, size); printf("WARNING: wb msg array property setter out of bounds");}} |
#define CONTROLLED_PROPERTY | ( | type, | |
name | |||
) | PROPERTY_DECLARATION(type, name) PROPERTY_GETTER(type, name) CONTROLLED_SETTER(type, name) |
#define CONTROLLED_SETTER | ( | t, | |
n | |||
) | public: DOXY_S(n) void set_##n (const t &n ) { _##n = n ; _##n##_mask = 1;} |
#define DEG2RAD | ( | x | ) | ((x) * RAD_OVER_DEG) |
#define DEG_OVER_RAD_10 (DEG_OVER_RAD * 10.0f) |
#define DOXY_ARRAY_G | ( | n | ) | /** property getter for an element of the array _ ##n (see Protected Attributes below) @param e element index @return _ ##n value */ |
#define DOXY_ARRAY_GC | ( | n | ) | /** property getter for a constant referance to an element of the array _ ##n (see Protected Attributes below) @param e element index @return _ ##n value */ |
#define DOXY_BAPG | ( | n | ) | /** property getter for an element of the bit array _ ##n (see Protected Attributes below) @param b element index @return _ ##n value */ |
#define DOXY_BAPGC | ( | n | ) | /** property getter for a constant referance to an element of the bit array _ ##n (see Protected Attributes below) @param b element index @return _ ##n value */ |
#define DOXY_BAPS | ( | n | ) | /** property setter for an element of bit array _ ##n (see Protected Attributes below) @param b element index @param v element's value */ |
#define DOXY_G | ( | n | ) | /** property getter for _ ##n (see Protected Attributes below) @return _ ##n value */ |
#define DOXY_GC | ( | n | ) | /** property getter for a constant referance to _ ##n (see Protected Attributes below) @return _ ##n value */ |
#define DOXY_MASK | ( | n | ) | /** Control bit (mask) for _ ##n (Used Internally) */ |
#define DOXY_S | ( | n | ) | /** property setter for _ ##n (see Protected Attributes below) */ |
#define DOXY_SG | ( | n, | |
s | |||
) | /** property getter for _ ##n[s] (see Protected Attributes below) @return _ ##n[s] value */ |
#define DOXY_SGC | ( | n, | |
s | |||
) | /** property getter for a constant referance to _ ##n[s] (see Protected Attributes below) @return _ ##n[s] value */ |
#define DOXY_SS | ( | n, | |
s | |||
) | /** property setter for _ ##n[s] (see Protected Attributes below) */ |
#define DOXY_VERSION_NEW | ( | n | ) | /** Checks if ##n##'s version number in the current message is greater then the local version number @return true if the version number is greater, false otherwise*/ |
#define PROPERTY | ( | type, | |
name | |||
) | PROPERTY_DECLARATION(type,name) PROPERTY_GETTER(type,name) PROPERTY_SETTER(type,name) |
#define PROPERTY_SETTER | ( | t, | |
n | |||
) | public: DOXY_S(n) void set_##n (const t &n ) { _##n = n ; } |
#define protected_msleep | ( | ms | ) | protected_usleep(1000LL*(ms)) |
#define protected_sleep | ( | s | ) | protected_usleep(1000000LL*(s)) |
#define RAD2DEG | ( | x | ) | ((x) * DEG_OVER_RAD) |
#define RAD_OVER_DEG_10 (RAD_OVER_DEG / 10.0f) |
#define SET_CONTROL_VAL | ( | o, | |
a, | |||
v | |||
) | do { (o).set_##a(v); (o)set_##a##_mask(true); } while (0) |
#define STRING_PROPERTY | ( | name, | |
size | |||
) | STRING_PROPERTY_DECLARATION(name, size) STRING_PROPERTY_GETTER(name, size) STRING_PROPERTY_SETTER(name, size) |
#define STRING_PROPERTY_DECLARATION | ( | n, | |
s | |||
) | protected: char _##n[s]; |
#define STRING_PROPERTY_SETTER | ( | n, | |
s | |||
) | public: DOXY_SS(n,s) void set_##n (const char* n ) { gu_strlcpy(_##n,n,(s)); } |
#define VERSION_DECLARATION | ( | n | ) | private: int _##n##_version; static int* get_##n##_classVersion() { static int _##n##_classVersion = 0; return &_##n##_classVersion;} |
#define VERSION_PROPERTY_CHECK | ( | n | ) | public: DOXY_VERSION_NEW(n) bool new_##n () {if(_##n##_version > (*get_##n##_classVersion())) return true; return false;} |
#define VERSION_PROPERTY_GETTER | ( | t, | |
n | |||
) | public: DOXY_G(n) t &n () {(*get_##n##_classVersion()) = _##n##_version; return _##n ; } |
#define VERSION_PROPERTY_INITIALIZATION | ( | n | ) | _##n##_version = 0; |
#define VERSION_PROPERTY_SETTER | ( | t, | |
n | |||
) | public: DOXY_S(n) void set_##n (const t &n ) { _##n = n; (*get_##n##_classVersion())+=1; _##n##_version = *get_##n##_classVersion();} private: void reset_##n##_version() {(*get_##n##_classVersion())=0;} |
#define VERSIONED_PROPERTY | ( | type, | |
name | |||
) | PROPERTY_DECLARATION(type,name) VERSION_DECLARATION(name) VERSION_PROPERTY_SETTER(type,name) VERSION_PROPERTY_GETTER(type,name) VERSION_PROPERTY_CHECK(name) |
std::vector< std::string > components_of_string_separated | ( | const std::string & | str, |
char | sep = '\n' , |
||
bool | trim = false |
||
) |
Split a string based on the token.
str | The string to split |
sep | Token separator character |
trim | Boolean to specify whether the result should be trimmed |
Definition at line 348 of file gu_util.cpp.
References gu_trim().
Referenced by read_configuration().
char * concatenate_path | ( | const char * | head, |
const char * | tail | ||
) |
Create a new string by concatenating two path components.
head | parent directory |
tail | child path component |
Definition at line 125 of file gu_util.cpp.
References gu_strdup(), and string_by_concatenating_path_components().
int dec | ( | void * | num | ) |
Decrement a number Used to decrement a enum value without warnings.
num | A pointer to the number to decrement |
Definition at line 395 of file gu_util.cpp.
double double_from_file | ( | const char * | fileName | ) |
Load the contents of a given file into a double.
fileName | Name of the file to load |
Definition at line 98 of file gu_util.cpp.
References new_string_from_file().
bool file_exists | ( | const char * | fileName | ) |
Return whether a file exists.
fileName | Name of the file to test |
Definition at line 54 of file gu_util.cpp.
long long get_utime | ( | void | ) |
Get the current time of day in microseconds.
Definition at line 130 of file gu_util.cpp.
Referenced by protected_usleep().
int getplayernumber | ( | void | ) |
std::string gu_dtos | ( | double | val | ) |
Convert a double value to a string.
val | Value to convert |
Definition at line 339 of file gu_util.cpp.
const char * gu_getprogname | ( | void | ) |
get the basename of the current program
Definition at line 210 of file gu_util.cpp.
std::string gu_ltos | ( | long | val | ) |
Convert a long value to a string.
val | Value to convert |
Definition at line 321 of file gu_util.cpp.
char * gu_strdup | ( | const char * | str | ) |
Duplicate a string.
str | original string |
Definition at line 111 of file gu_util.cpp.
Referenced by concatenate_path(), and gu_strtrim().
size_t gu_strlcat | ( | char * | dst, |
const char * | src, | ||
size_t | size | ||
) |
Definition at line 252 of file gu_util.cpp.
size_t gu_strlcpy | ( | char * | dst, |
const char * | src, | ||
size_t | size | ||
) |
Definition at line 245 of file gu_util.cpp.
char * gu_strtrim | ( | const char * | s | ) |
Return a trimmed copy of the current string by removing all leading and trailing whitespace characters (needs to be free()d)
s | the string to trim |
Definition at line 150 of file gu_util.cpp.
References gu_strdup(), and gu_trim().
std::string & gu_trim | ( | std::string & | s | ) |
Trim whitespace characters from both ends of a string.
This operation is in-place, so the original string gets modified!
s | the string to trim (in place) |
Definition at line 305 of file gu_util.cpp.
References WHITESPACE.
Referenced by components_of_string_separated(), and gu_strtrim().
std::string gu_ultos | ( | unsigned long | val | ) |
Convert an unsigned long value to a string.
val | Value to convert |
Definition at line 330 of file gu_util.cpp.
int inc | ( | void * | num | ) |
Increment a number Used to increment an enum value without warnings.
num | A pointer to the number to increment |
Definition at line 389 of file gu_util.cpp.
int int_from_file | ( | const char * | fileName | ) |
Load the contents of a given file into an int.
fileName | Name of the file to load |
Definition at line 84 of file gu_util.cpp.
References new_string_from_file().
int mipal_err_file | ( | const char * | filename | ) |
Set the log file for the current module.
filename | name of the file to open. If the file contains a slash '/', it will create the directory the file should go in with mode 01777 if non-existent |
Definition at line 158 of file gu_util.cpp.
void mipal_warn | ( | const char * | fmt, |
... | |||
) |
Print a warning to the file mipal_err_file() has been set for (or stderr if none has been set)
fmt | printf() style format string |
Definition at line 187 of file gu_util.cpp.
Referenced by read_configuration().
char * new_string_from_file | ( | const char * | fileName | ) |
Load the contents of a given file into a string.
fileName | Name of the file to load |
Definition at line 60 of file gu_util.cpp.
Referenced by double_from_file(), int_from_file(), and string_from_file().
void protected_usleep | ( | long long | us | ) |
Protected usleep() – guaranteed to sleep for the given time! param us number of microseconds to sleep.
Definition at line 140 of file gu_util.cpp.
References get_utime().
std::map< std::string, std::string > read_configuration | ( | const std::string & | filename | ) |
Read simple key = value
pairs into a c++ map.
filename | Path to configuration file |
Definition at line 363 of file gu_util.cpp.
References components_of_string_separated(), and mipal_warn().
std::string string_by_concatenating_path_components | ( | const std::string & | head, |
const std::string & | tail | ||
) |
Concatenate two path components into a new string.
head | parent directory |
tail | child path component |
Definition at line 280 of file gu_util.cpp.
Referenced by concatenate_path().
std::string string_from_file | ( | const char * | fileName | ) |
Load the contents of a given file into a string.
fileName | Name of the file to load |
Definition at line 267 of file gu_util.cpp.
References new_string_from_file().