Cleanup: using sorting.
[libdcp.git] / src / mono_picture_asset.cc
index cdfcb0df543efef7b762f8e82bf9af73ab2a2f4e..a72fd7d47b3487065f0165391fd51cb21da16053 100644 (file)
  */
 
 
+#include "compose.hpp"
+#include "dcp_assert.h"
+#include "equality_options.h"
+#include "exceptions.h"
+#include "filesystem.h"
 #include "mono_picture_asset.h"
-#include "mono_picture_asset_writer.h"
 #include "mono_picture_asset_reader.h"
-#include "exceptions.h"
-#include "dcp_assert.h"
+#include "mono_picture_asset_writer.h"
 #include "mono_picture_frame.h"
-#include "compose.hpp"
 #include <asdcp/AS_DCP.h>
 #include <asdcp/KM_fileio.h>
 
 
-using std::string;
-using std::vector;
+using std::dynamic_pointer_cast;
 using std::list;
+using std::make_shared;
 using std::pair;
 using std::shared_ptr;
-using std::dynamic_pointer_cast;
-using std::make_shared;
+using std::string;
+using std::vector;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
@@ -65,7 +67,7 @@ MonoPictureAsset::MonoPictureAsset (boost::filesystem::path file)
        : PictureAsset (file)
 {
        ASDCP::JP2K::MXFReader reader;
-       auto r = reader.OpenRead (file.string().c_str());
+       auto r = reader.OpenRead(dcp::filesystem::fix_long_path(file).string().c_str());
        if (ASDCP_FAILURE(r)) {
                boost::throw_exception (MXFFileError("could not open MXF file for reading", file.string(), r));
        }
@@ -101,7 +103,7 @@ storing_note_handler (list<pair<NoteType, string>>& notes, NoteType t, string s)
 
 
 bool
-MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHandler note) const
+MonoPictureAsset::equals(shared_ptr<const Asset> other, EqualityOptions const& opt, NoteHandler note) const
 {
        if (!dynamic_pointer_cast<const MonoPictureAsset>(other)) {
                return false;
@@ -109,14 +111,14 @@ MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, No
 
        ASDCP::JP2K::MXFReader reader_A;
        DCP_ASSERT (_file);
-       auto r = reader_A.OpenRead (_file->string().c_str());
+       auto r = reader_A.OpenRead(dcp::filesystem::fix_long_path(*_file).string().c_str());
        if (ASDCP_FAILURE(r)) {
                boost::throw_exception (MXFFileError("could not open MXF file for reading", _file->string(), r));
        }
 
        ASDCP::JP2K::MXFReader reader_B;
        DCP_ASSERT (other->file ());
-       r = reader_B.OpenRead (other->file()->string().c_str());
+       r = reader_B.OpenRead(dcp::filesystem::fix_long_path(*other->file()).string().c_str());
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError ("could not open MXF file for reading", other->file()->string(), r));
        }