{
boost::asio::io_service io_service;
boost::asio::ip::tcp::resolver resolver (io_service);
- boost::asio::ip::tcp::resolver::query query (serv.host_name(), boost::lexical_cast<string> (Config::instance()->server_port ()));
+ boost::asio::ip::tcp::resolver::query query (serv.host_name(), boost::lexical_cast<string> (Config::instance()->server_port_base ()));
boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
shared_ptr<Socket> socket (new Socket);
add_metadata (root);
stringstream xml;
- doc.write_to_stream (xml);
+ doc.write_to_stream (xml, "UTF-8");
_log->log (String::compose (
N_("Sending to remote; pixel format %1, components %2, lines (%3,%4,%5), line sizes (%6,%7,%8)"),
}
-EncodedData::EncodedData (string file)
+EncodedData::EncodedData (boost::filesystem::path file)
{
_size = boost::filesystem::file_size (file);
_data = new uint8_t[_size];
- FILE* f = fopen (file.c_str(), N_("rb"));
+ FILE* f = fopen (file.string().c_str(), N_("rb"));
if (!f) {
throw FileError (_("could not open file for reading"), file);
}
void
EncodedData::write (shared_ptr<const Film> film, int frame, Eyes eyes) const
{
- string const tmp_j2c = film->j2c_path (frame, eyes, true);
+ boost::filesystem::path const tmp_j2c = film->j2c_path (frame, eyes, true);
- FILE* f = fopen (tmp_j2c.c_str (), N_("wb"));
+ FILE* f = fopen (tmp_j2c.string().c_str (), N_("wb"));
if (!f) {
throw WriteFileError (tmp_j2c, errno);
fwrite (_data, 1, _size, f);
fclose (f);
- string const real_j2c = film->j2c_path (frame, eyes, false);
+ boost::filesystem::path const real_j2c = film->j2c_path (frame, eyes, false);
/* Rename the file from foo.j2c.tmp to foo.j2c now that it is complete */
boost::filesystem::rename (tmp_j2c, real_j2c);
void
EncodedData::write_info (shared_ptr<const Film> film, int frame, Eyes eyes, libdcp::FrameInfo fin) const
{
- string const info = film->info_path (frame, eyes);
- ofstream h (info.c_str());
+ boost::filesystem::path const info = film->info_path (frame, eyes);
+ ofstream h (info.string().c_str());
fin.write (h);
}