41 #ifndef FIX8_HAVE_GMTOFF
64 time_t tval(startTime->
secs());
65 struct tm *ptim(use_gm ? gmtime(&tval) : localtime (&tval));
68 time_t tval(startTime->
secs());
69 use_gm ? gmtime_r(&tval, &tim) : localtime_r(&tval, &tim);
75 oss << setfill(
'0') << setw(4) << (ptim->tm_year + 1900) <<
'-';
76 oss << setw(2) << (ptim->tm_mon + 1) <<
'-' << setw(2) << ptim->tm_mday <<
' ' << setw(2) << ptim->tm_hour;
77 oss <<
':' << setw(2) << ptim->tm_min <<
':';
80 const double secs((startTime->
secs() % 60) + static_cast<double>(startTime->
nsecs()) / Tickval::billion);
81 oss.setf(ios::showpoint);
83 oss << setw(3 + dplaces) << setfill(
'0') << setprecision(dplaces) << secs;
86 oss << setfill(
'0') << setw(2) << ptim->tm_sec;
87 return result = oss.str();
100 startTime = &gotTime;
104 time_t tval(startTime->
secs());
105 struct tm *ptim(localtime (&tval));
107 struct tm tim, *ptim;
108 time_t tval(startTime->
secs());
109 localtime_r(&tval, &tim);
115 oss << setfill(
'0') << setw(2) << ((ptim->tm_year + 1900) % 100) <<
'-';
116 oss << setw(2) << (ptim->tm_mon + 1) <<
'-' << setw(2) << ptim->tm_mday <<
' ' << setw(2) << ptim->tm_hour;
117 oss <<
':' << setw(2) << ptim->tm_min <<
':' << setfill(
'0') << setw(2) << ptim->tm_sec;
118 return result = oss.str();
124 if (!src.empty() && *src.rbegin() !=
'/')
133 for (
auto& itr : src)
142 for (string::iterator itr(src.begin()); itr != src.end(); ++itr)
143 if (iset.find(*itr) == string::npos)
151 for (
auto& itr : src)
167 const size_t max_str(256);
168 char buf[max_str] {};
177 ostr << str <<
": " << buf;
187 const int mask(_umask(0));
190 const int mask(umask(0));
200 for(string::const_iterator pos(path.begin()); pos != path.end(); ++pos)
203 if(*pos ==
'/' || *pos ==
'\\' || pos + 1 == path.end())
206 _mkdir(new_path.c_str());
208 mkdir(new_path.c_str(), 0777);
217 using Day = pair<char, int>;
218 using Daymap = multimap<char, int>;
219 static const string day_names[] {
"su",
"mo",
"tu",
"we",
"th",
"fr",
"sa" };
220 static const Day days[] { {
's',0}, {
'm',1}, {
't',2}, {
'w',3}, {
't',4}, {
'f',5}, {
's', 6} };
221 static const Daymap daymap(days, days +
sizeof(days)/
sizeof(Day));
229 if (isdigit(source[0]) && source.size() == 1 && source[0] >=
'0' && source[0] <=
'6')
230 return source[0] -
'0';
231 pair<Daymap::const_iterator, Daymap::const_iterator> result(daymap.equal_range(source[0]));
232 switch(distance(result.first, result.second))
235 return result.first->second;
237 if (source.size() == 1)
242 return day_names[result.first->second][1] == source[1]
243 || day_names[(++result.first)->second][1] == source[1] ? result.first->second : -1;
254 #if defined FIX8_PACKAGE_BUGREPORT
257 #if defined FIX8_PACKAGE_URL
281 #if defined FIX8_SLEEP_NO_YIELD
282 {
"FIX8_SLEEP_NO_YIELD",
STRINGIFY(FIX8_SLEEP_NO_YIELD) },
284 #if defined FIX8_CODECTIMING
287 #if defined FIX8_HAVE_OPENSSL
288 {
"FIX8_HAVE_OPENSSL",
STRINGIFY(FIX8_HAVE_OPENSSL) },
290 #if defined FIX8_HAVE_EXTENDED_METADATA
291 {
"FIX8_HAVE_EXTENDED_METADATA",
STRINGIFY(FIX8_HAVE_EXTENDED_METADATA) },
293 #if defined FIX8_DEBUG
const string & GetTimeAsStringMS(string &result, const Tickval *tv, const unsigned dplaces, bool use_gm)
#define FIX8_DEFAULT_PRECISION
F8API std::string Str_error(const int err, const char *str=0)
#define FIX8_MAX_FLD_LENGTH
string & InPlaceReplaceInSet(const string &iset, string &src, const char repl)
int decode_dow(const string &from)
#define FIX8_MINOR_VERSION_NUM
string & CheckAddTrailingSlash(string &src)
#define FIX8_PATCH_VERSION_NUM
#define FIX8_CONFIGURE_TIME
#define FIX8_PACKAGE_BUGREPORT
#define FIX8_CONFIGURE_TIME_NUM
#define FIX8_THREAD_SYSTEM
F8API f8String find_package_info_string(const f8String &what)
string & InPlaceStrToLower(string &src)
#define FIX8_THREAD_STDTHREAD
#define FIX8_MAX_MSG_LENGTH
F8API const Package_info & package_info()
string & InPlaceStrToUpper(string &src)
#define FIX8_CONFIGURE_SDATE
#define FIX8_MAJOR_VERSION_NUM
string StrToLower(const string &src)
const string & GetTimeAsStringMini(string &result, const Tickval *tv)
void create_path(const string &path)
#define FIX8_CONFIGURE_OPTIONS
#define FIX8_THREAD_PTHREAD
std::map< f8String, f8String > Package_info