EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Static Public Member Functions | List of all members
SecondParser Class Reference

Parse seconds from text, and format seconds into text. More...

#include <epicsTimeHelper.h>

Static Public Member Functions

static bool parse (const stdString &t, double &n, double default_factor=1.0)
 Parse text into number. More...
 
static stdString format (double seconds)
 

Detailed Description

Parse seconds from text, and format seconds into text.

Text may contain just the seconds, or "... seconds" or "... minutes", "... hours", "... days". Times may be abbreviated.

Member Function Documentation

static stdString SecondParser::format ( double  seconds)
static
Returns
Seconds formatted as string, using "... min" etc. when possible.
static bool SecondParser::parse ( const stdString &  t,
double &  n,
double  default_factor = 1.0 
)
static

Parse text into number.

Parameters
tt
nn
default_factorUsually, we assume that a plain number without suffix represents seconds. A factor of 60*60, however, changes that default interpretation to hours.
Returns
true if OK.

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