MetroCollect  2.3.4
SourceTools.h File Reference
#include <array>
#include <cctype>
#include <fstream>
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for SourceTools.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MetroCollect::MetricsSource::KeyUnit
 Stuct to associate a field name containing a certain key with a unit. More...
 

Namespaces

 MetroCollect::MetricsSource
 Namespace for sources of metrics objects and operations.
 

Functions

uint64_t MetroCollect::MetricsSource::parseUint (const char *&buffer) noexcept
 Fast and unsafe unsigned integer parser. More...
 
bool MetroCollect::MetricsSource::resetFile (std::ifstream &file, std::vector< char > &buffer, const std::string_view &path)
 Attempts to open a file and set buffer size accordingly. More...
 
bool MetroCollect::MetricsSource::readFile (std::ifstream &file, std::vector< char > &buffer, const std::string_view &path)
 Attempts to read file into buffer. More...
 
template<size_t N>
std::string MetroCollect::MetricsSource::findUnit (const std::string &name, const std::array< KeyUnit, N > &keyUnitAssociation, const std::string_view &defaultUnit)
 Tries to associate a field name with a unit, falling back on the default unit if none matches. More...
 
int MetroCollect::MetricsSource::alphanumCompare (const char *l, const char *r)
 Alphanumeric string comparison. More...