EPANET  3.0
EPANET Development Project
Static Public Member Functions | List of all members
Utilities Class Reference

Utility functions used throughout EPANET. More...

#include <utilities.h>

Static Public Member Functions

template<class Seq >
static void purge (Seq &c)
 Template function to purge the contents of a container class.
 
static bool getTmpFileName (std::string &fname)
 Generates the name of a temporary file.
 
static std::string getFileName (const std::string s)
 Extracts a file name from a full path.
 
static std::string upperCase (const std::string &s)
 Converts a string to upper case.
 
static int findMatch (const std::string &s, const char *slist[])
 Matches a string with those in a list (case insensitive).
 
static int findFullMatch (const std::string &s, const char *slist[])
 Matches full string with those in a list.
 
static bool match (const std::string &s1, const std::string &s2)
 Checks if one string is a leading substring of another (case insensitive).
 
static int getSeconds (const std::string &strTime, const std::string &strUnits)
 Converts a string representation of time into a number of seconds.
 
static void removeQuotes (std::string &s)
 Removes double quotes that surround a string.
 
static std::string getTime (int seconds)
 Converts number of seconds into hr:min:sec string.
 
static int sign (double x)
 Returns the sign of a number (-1 or +1)
 
static void split (std::vector< std::string > &tokens, const std::string &str)
 Splits a string into tokens separated by whitespace.
 
static std::vector< std::string > split (const std::string &str)
 
template<typename T >
static std::string to_string (T const &value)
 Converts a number to a string.
 
template<typename T >
static bool parseNumber (const std::string &s, T &x)
 Converts a numeric string into a floating point value.
 

Detailed Description

Utility functions used throughout EPANET.


The documentation for this class was generated from the following files: