Skip to content

Instantly share code, notes, and snippets.

Created December 27, 2012 10:49
Show Gist options
  • Save anonymous/4387313 to your computer and use it in GitHub Desktop.
Save anonymous/4387313 to your computer and use it in GitHub Desktop.
std::ofstream cluster_stream(path.string().c_str(), std::ios_base::out | std::ios_base::binary | std::ios_base::trunc);
const typename merged_cell::value_type* first_cell = *(base::cell()->cells().begin());
gcl::Participant* reference_participant = first_cell->connection()->pair().second->participant();
BOOST_FOREACH(const typename merged_cell::value_type* cell, base::cell()->cells()){
boost::filesystem::path reference_paragraphs_directory = boost::filesystem::path(reference_participant->heading()) / "paragraphs";
boost::filesystem::path relative_path = reference_paragraphs_directory / base::cell_name(cell);
boost::filesystem::path absolute_path = root_path / relative_path;
std::ifstream stream(absolute_path.string().c_str(), std::ios_base::in | std::ios_base::binary);
std::copy(std::istream_iterator<char>(stream), std::istream_iterator<char>(), std::ostream_iterator<char>(cluster_stream));
stream.close();
}
cluster_stream.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment