CallumMonzaku - 2019-04-01

Basically I'm trying to store a value, map<string, date*=""> m_dates, into a data file. This map uses a string and Date, with a Date class being composed of:</string,>

tm m_due;
vector<tm> m_warning;
string event;
tm m_alert;

Because this is a class with tm values and not a single tm value, I don't think converting it to time_t is going to work here.

Is there a way I can simply store the tm values?

As an example.

tm m_time;
std::string filename(boost::archive::tmpdir());
filename4 += "/settingsStoreTime.txt";
std::ofstream ofs(filename);
boost::archive::text_oarchive oa(ofs);
oa << m_time;

The result is

'serialize': is not a member of 'tm'

I get a similar result with m_dates, since it has tm values. Changing a single tm value to a time_t value and back upon restoration isn't too hard, but doing it for this map of classes with multiple tm values doesn't seem feasible.

In this case, with m_dates...

std::string filename(boost::archive::tmpdir());
filename += "/scheduleDate.txt";
std::ofstream ofs(filename);
boost::archive::text_oarchive oa(ofs);
oa << m_dates;

I get the error:

'serialize': is not a member of 'std::map<std::string,Schedule::Date *,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>'