|
MADARA_Export bool | madara::utility::approx_equal (double value1, double value2, double epsilon=0.0001) |
| Checks two doubles for approximate equality. More...
|
|
MADARA_Export bool | madara::utility::begins_with (const std::string &input, const std::string &prefix) |
| Check if input contains prefix at the beginning. More...
|
|
MADARA_Export int | madara::utility::bind_to_ephemeral_port (ACE_SOCK_Dgram &socket, std::string &host, unsigned short &port, bool increase_until_bound=true) |
| Binds to an ephemeral port. More...
|
|
template<typename T > |
T | madara::utility::bitmask_add (T mask, T values) |
| Adds values to a bit mask. More...
|
|
template<typename T > |
bool | madara::utility::bitmask_check (T mask, T values) |
| Returns true if mask contains values. More...
|
|
template<typename T > |
T | madara::utility::bitmask_remove (T mask, T values) |
| Removes values from a bit mask. More...
|
|
MADARA_Export std::string | madara::utility::clean_dir_name (const std::string &target) |
| Substitutes the appropriate directory delimiter, which may help with portability between operating systems. More...
|
|
MADARA_Export std::string & | madara::utility::dds_topicify (std::string &input) |
| Changes periods to underscores in compliance with OpenSplice needs. More...
|
|
MADARA_Export uint64_t | madara::utility::endian_swap (uint64_t value) |
| Converts a host format uint64_t into big endian. More...
|
|
MADARA_Export int64_t | madara::utility::endian_swap (int64_t value) |
| Converts a host format signed madara::knowledge::KnowledgeRecord::Integer into big endian. More...
|
|
MADARA_Export uint32_t | madara::utility::endian_swap (uint32_t value) |
| Converts a host format uint64_t into big endian. More...
|
|
MADARA_Export int32_t | madara::utility::endian_swap (int32_t value) |
| Converts a host format signed madara::knowledge::KnowledgeRecord::Integer into big endian. More...
|
|
MADARA_Export uint16_t | madara::utility::endian_swap (uint16_t value) |
| Converts a host format signed madara::knowledge::KnowledgeRecord::Integer into big endian. More...
|
|
MADARA_Export int16_t | madara::utility::endian_swap (int16_t value) |
| Converts a host format signed madara::knowledge::KnowledgeRecord::Integer into big endian. More...
|
|
MADARA_Export double | madara::utility::endian_swap (double value) |
| Converts a host format double precision into big endian. More...
|
|
MADARA_Export bool | madara::utility::ends_with (const std::string &input, const std::string &ending) |
| Check if input contains a pattern at the end. More...
|
|
MADARA_Export std::string | madara::utility::expand_envs (const std::string &source) |
| Expands environment variables referenced in the string. More...
|
|
MADARA_Export std::string | madara::utility::extract_filename (const std::string &name) |
| Extracts the file name of an absolute or relative path. More...
|
|
MADARA_Export std::string | madara::utility::extract_path (const std::string &name) |
| Extracts the path of a filename. More...
|
|
MADARA_Export bool | madara::utility::file_exists (const std::string &filename) |
| Checks if a file exists. More...
|
|
MADARA_Export unsigned int | madara::utility::file_size (const std::string &filename) |
| Returns the size of a file. More...
|
|
MADARA_Export std::string | madara::utility::file_to_string (const std::string &filename) |
| Reads a file into a string. More...
|
|
MADARA_Export int64_t | madara::utility::get_time (void) |
| Returns a time of day in nanoseconds. More...
|
|
MADARA_Export uint32_t | madara::utility::get_uint_version (void) |
| Gets the MADARA version number. More...
|
|
char * | madara::utility::get_var (const std::string &source, size_t cur, size_t &end) |
| Helper function for madara::utility::expand_envs which retrieves an environment variable. More...
|
|
MADARA_Export std::string | madara::utility::get_version (void) |
| Gets the MADARA version number. More...
|
|
template<typename T > |
bool | madara::utility::greater_compare (const T &left, const T &right) |
| Returns true if right < left. More...
|
|
template<typename T > |
void | madara::utility::heap_sort (T *input, int size, bool(*comparator)(const T &left, const T &right)=greater_compare< T >) |
| Sorts an array with heap sort. More...
|
|
template<typename T > |
void | madara::utility::heapify (T *input, int size, bool(*comparator)(const T &left, const T &right)=greater_compare< T >) |
| Builds a heap out of an array of elements. More...
|
|
template<typename T > |
bool | madara::utility::less_compare (const T &left, const T &right) |
| Returns true if left < right. More...
|
|
MADARA_Export std::string & | madara::utility::lower (std::string &input) |
| Converts the string to lower. More...
|
|
MADARA_Export int | madara::utility::merge_hostport_identifier (std::string &key, const std::string &host, const std::string &port) |
| Merges a host and port into a host:port key. More...
|
|
MADARA_Export int | madara::utility::merge_hostport_identifier (std::string &key, const std::string &host, unsigned short u_port) |
| Merges a host and port into a host:port key. More...
|
|
MADARA_Export int64_t | madara::utility::nearest_int (double input) |
| Rounds a double to the nearest integer. More...
|
|
MADARA_Export double | madara::utility::rand_double (double floor=0.0, double ceiling=1.0, bool set_seed_to_time=true) |
| Returns a random double between floor and ceiling. More...
|
|
MADARA_Export int64_t | madara::utility::rand_int (int64_t floor=0, int64_t ceiling=RAND_MAX, bool set_seed_to_time=true) |
| Returns a random integer between a floor and ceiling. More...
|
|
MADARA_Export int | madara::utility::read_file (const std::string &filename, void *&buffer, size_t &size, bool add_zero_char=false) |
| Reads a file into a provided void pointer. More...
|
|
template<typename T > |
void | madara::utility::sift_down (T *input, int start, int end, bool(*comparator)(const T &left, const T &right)=greater_compare< T >) |
| Sifts elements down a heap according to a comparator. More...
|
|
MADARA_Export double | madara::utility::sleep (double sleep_time) |
| Sleeps for a certain amount of time. More...
|
|
MADARA_Export ACE_Time_Value | madara::utility::sleep (const ACE_Time_Value &sleep_time) |
| Sleeps for a certain amount of time. More...
|
|
MADARA_Export int | madara::utility::split_hostport_identifier (const std::string &key, std::string &host, std::string &port) |
| Splits a key of host:port into a corresponding host and port. More...
|
|
MADARA_Export std::string & | madara::utility::string_remove (std::string &input, char unwanted) |
| Strips an unwanted character. More...
|
|
MADARA_Export size_t | madara::utility::string_replace (std::string &source, const std::string &old_phrase, const std::string &new_phrase, bool replace_all=true) |
| Replaces an old phrase with a new phrase within a string. More...
|
|
MADARA_Export std::string & | madara::utility::strip_comments (std::string &input) |
| Strips all comments (single-line and multi-line). More...
|
|
MADARA_Export std::string & | madara::utility::strip_extra_white_space (std::string &input) |
| Strips whitespace from front and end of string and also condenses multiple whitespace into a single space. More...
|
|
MADARA_Export std::string | madara::utility::strip_prefix (const std::string &input, const std::string &prefix) |
| Strips a prefix from an input string and returns the result. More...
|
|
MADARA_Export std::string & | madara::utility::strip_white_space (std::string &input) |
| Strips all whitespace characters from a string. More...
|
|
MADARA_Export std::string | madara::utility::to_string_version (uint32_t version) |
| Converts a MADARA uint32_t version number to human-readable. More...
|
|
MADARA_Export void | madara::utility::tokenizer (const std::string &input, const ::std::vector< std::string > &splitters,::std::vector< std::string > &tokens,::std::vector< std::string > &pivot_list) |
| Splits an input string into tokens. More...
|
|
MADARA_Export std::string & | madara::utility::upper (std::string &input) |
| Converts the string to upper. More...
|
|
MADARA_Export bool | madara::utility::wait_false (knowledge::KnowledgeBase &knowledge, const std::string &variable, const knowledge::WaitSettings &settings=knowledge::WaitSettings()) |
| Waits on a knowledge record to be false without needing KaRL language. More...
|
|
MADARA_Export bool | madara::utility::wait_true (knowledge::KnowledgeBase &knowledge, const std::string &variable, const knowledge::WaitSettings &settings=knowledge::WaitSettings()) |
| Waits on a knowledge record to be true without needing KaRL language. More...
|
|
MADARA_Export ssize_t | madara::utility::write_file (const std::string &filename, void *buffer, size_t size) |
| Writes a file with provided contents. More...
|
|