Electroneum
Loading...
Searching...
No Matches
epee::serialization::convert_to_integral< std::string, uint64_t, false > Struct Reference

#include <portable_storage_val_converters.h>

Static Public Member Functions

static void convert (const std::string &from, uint64_t &to)

Detailed Description

Definition at line 141 of file portable_storage_val_converters.h.

Member Function Documentation

◆ convert()

void epee::serialization::convert_to_integral< std::string, uint64_t, false >::convert ( const std::string & from,
uint64_t & to )
inlinestatic

Definition at line 143 of file portable_storage_val_converters.h.

144 {
145 MTRACE("Converting std::string to uint64_t. Source: " << from);
146 // String only contains digits
149 // MyMonero ISO 8061 timestamp (2017-05-06T16:27:06Z)
150 else if (boost::regex_match (from, boost::regex("\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\dZ")))
151 {
152 // Convert to unix timestamp
153#ifdef HAVE_STRPTIME
154 struct tm tm;
155 if (strptime(from.c_str(), "%Y-%m-%dT%H:%M:%S", &tm))
156#else
157 std::tm tm = {};
159 if (ss >> std::get_time(&tm, "%Y-%m-%dT%H:%M:%S"))
160#endif
161 to = std::mktime(&tm);
162 } else
164 }
#define MTRACE(x)
Definition misc_log_ex.h:77
#define ASSERT_AND_THROW_WRONG_CONVERSION()
Here is the call graph for this function:

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