Give a better error if a specified CPL does not exist.
[dcpomatic.git] / src / lib / analytics.cc
index ac0abc22273c182be40e3294934f2d4a701214d8..75146cb45313a60211339197bd72a1c2df119c0c 100644 (file)
 #include "analytics.h"
 #include "compose.hpp"
 #include "exceptions.h"
-#include "warnings.h"
 #include <dcp/raw_convert.h>
+#include <dcp/warnings.h>
 #include <libcxml/cxml.h>
-DCPOMATIC_DISABLE_WARNINGS
+LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 #include <boost/algorithm/string.hpp>
 #include <boost/filesystem.hpp>
 
@@ -96,11 +96,11 @@ Analytics::write () const
        root->add_child("SuccessfulDCPEncodes")->add_child_text(raw_convert<string>(_successful_dcp_encodes));
 
        try {
-               doc.write_to_file_formatted(path("analytics.xml").string());
+               doc.write_to_file_formatted(write_path("analytics.xml").string());
        } catch (xmlpp::exception& e) {
                string s = e.what ();
                trim (s);
-               throw FileError (s, path("analytics.xml"));
+               throw FileError (s, write_path("analytics.xml"));
        }
 }
 
@@ -110,7 +110,7 @@ Analytics::read ()
 try
 {
        cxml::Document f ("Analytics");
-       f.read_file (path("analytics.xml"));
+       f.read_file (read_path("analytics.xml"));
        _successful_dcp_encodes = f.number_child<int>("SuccessfulDCPEncodes");
 } catch (...) {
        /* Never mind */