Use an enum class for Marker.
[libdcp.git] / src / util.h
index b66832654d02812da85ef9e04b908df11831395c..232b91ccb44a80b13883fc0a29bd12754716a0f7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
  *  @brief Utility methods.
  */
 
+
+#include "array_data.h"
 #include "types.h"
-#include "data.h"
 #include "local_time.h"
-#include <boost/shared_ptr.hpp>
+#include <asdcp/KM_log.h>
+#include <memory>
 #include <boost/function.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/optional.hpp>
@@ -63,11 +65,11 @@ class OpenJPEGImage;
 
 extern std::string make_uuid ();
 extern std::string make_digest (boost::filesystem::path filename, boost::function<void (float)>);
-extern std::string make_digest (Data data);
+extern std::string make_digest (ArrayData data);
 extern bool empty_or_white_space (std::string s);
 extern bool ids_equal (std::string a, std::string b);
 extern std::string remove_urn_uuid (std::string raw);
-extern void init ();
+extern void init (boost::optional<boost::filesystem::path> tags_directory = boost::optional<boost::filesystem::path>());
 
 extern int base64_decode (std::string const & in, unsigned char* out, int out_length);
 extern boost::optional<boost::filesystem::path> relative_to_root (boost::filesystem::path root, boost::filesystem::path file);
@@ -80,7 +82,22 @@ extern std::string spaces (int n);
 extern void indent (xmlpp::Element* element, int initial);
 extern bool day_less_than_or_equal (LocalTime a, LocalTime b);
 extern bool day_greater_than_or_equal (LocalTime a, LocalTime b);
-extern std::string unique_string (std::list<std::string> existing, std::string base);
+extern std::string unique_string (std::vector<std::string> existing, std::string base);
+extern ASDCP::Dictionary const* asdcp_smpte_dict;
+
+
+class ASDCPErrorSuspender
+{
+public:
+       ASDCPErrorSuspender();
+       ~ASDCPErrorSuspender();
+
+private:
+       Kumu::LogEntryList _log;
+       Kumu::ILogSink& _old;
+       Kumu::EntryListLogSink* _sink;
+};
+
 
 }