PSTime/src/TimeFormat.cpp File Reference

#include "PSTime/TimeFormat.h"
#include <stdio.h>
#include <string.h>
#include <boost/regex.hpp>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include "PSTime/Exceptions.h"
#include "PSTime/TimeUtils.h"

Go to the source code of this file.

Namespaces

namespace  PSTime
namespace  PSTime::TimeFormat

Defines

#define DATE_RE   "(\\d{4})(?:-?(\\d{2})(?:-?(\\d{2}))?)?"
#define TIME_RE   "(\\d{1,2})(?::?(\\d{2})(?::?(\\d{2})(?:[.](\\d{1,9}))?)?)?"
#define TZ_RE   "Z|(?:([-+])(\\d{2})(?::?(\\d{2}))?)"

Functions

boost::regex dtre ("^"DATE_RE"(?:(?: +|T)(?:"TIME_RE")?("TZ_RE")?)?$")
boost::regex secre ("^S(\\d{0,10})(?:[.](\\d{1,9}))?$")
long getNsec (const std::string &nsecStr)
bool cmp_tm (struct tm *lhs, struct tm *rhs)
void formatNsec (uint32_t nsec, int prec, std::ostream &str)
Time PSTime::TimeFormat::parseTime (const std::string &timeStr)
 Parse the time string and return time.
std::string PSTime::TimeFormat::format (const Time &time, const std::string &afmt, Time::Zone zone)
 Convert time to string according to format.
void PSTime::TimeFormat::format (std::ostream &str, const Time &time, const std::string &afmt, Time::Zone zone)
 Format to standard stream object instead of string, same parametes as for previous method.


Define Documentation

#define DATE_RE   "(\\d{4})(?:-?(\\d{2})(?:-?(\\d{2}))?)?"

Definition at line 43 of file TimeFormat.cpp.

#define TIME_RE   "(\\d{1,2})(?::?(\\d{2})(?::?(\\d{2})(?:[.](\\d{1,9}))?)?)?"

Definition at line 44 of file TimeFormat.cpp.

#define TZ_RE   "Z|(?:([-+])(\\d{2})(?::?(\\d{2}))?)"

Definition at line 45 of file TimeFormat.cpp.


Function Documentation

bool @24::cmp_tm ( struct tm *  lhs,
struct tm *  rhs 
) [static]

Definition at line 70 of file TimeFormat.cpp.

Referenced by PSTime::TimeFormat::parseTime().

boost::regex @24::dtre ( "^"DATE_RE"(?:(?: +|T)(?:"TIME_RE")?("TZ_RE")?)?$"   )  [static]

Referenced by PSTime::TimeFormat::parseTime().

void @24::formatNsec ( uint32_t  nsec,
int  prec,
std::ostream &  str 
) [static]

Definition at line 86 of file TimeFormat.cpp.

Referenced by PSTime::TimeFormat::format().

long @24::getNsec ( const std::string &  nsecStr  )  [static]

Definition at line 57 of file TimeFormat.cpp.

Referenced by PSTime::TimeFormat::parseTime().

boost::regex @24::secre ( "^S(\\d{0,10})(?:[.](\\d{1,9}))?$"   )  [static]

Referenced by PSTime::TimeFormat::parseTime().


Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7