Hey Embers,
The title more or less says it all. I’ve got a vector<vector<float>>
that contains some data I need in order to simulate some behavior. I looked around ‘teh webz’ a bit and found this helpful stackoverflow answer that pointed me towards boost serialization.
The only problem is that I have no idea how (or even if it’s possible) to go from a DataSource
to an ifstream
. I tried putting together the following code instead
auto csvFileRef = ci::app::loadResource( RES_FFT_DATA );
auto csvDataString = ci::loadString( csvFileRef );
std::istringstream test( csvDataString );
boost::archive::binary_iarchive ia( test );
//boost::archive::binary_iarchive ia( in );
ia >> features;
//in.close();
But the csvDataString
ends up only containing a single char, and then probably fails because the data isn’t actually originally a string.
Any ideas of how to pass the binary data from an asset into a format I can pipe into an ifstream
would be much appreciated!
Cheers,
Gazoo