1
Fork 0
This repository has been archived on 2025-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
puzzle-wuzzle-generator/lib/data.cpp

22 lines
536 B
C++

#include "data.hpp"
#include "dynamic_grid.hpp"
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <fstream>
AnalyzedGrid<DynamicGridBase> grid_from_file(std::string file_path){
std::ifstream file(file_path);
boost::archive::text_iarchive ar(file);
AnalyzedGrid<DynamicGridBase> ret;
ar >> ret;
return ret;
}
void grid_to_file(const AnalyzedGrid<DynamicGridBase>& grid, std::string file_path){
std::ofstream file(file_path);
boost::archive::text_oarchive ar(file);
ar << grid;
}