Add and use SPL::swap().
[dcpomatic.git] / src / lib / spl.h
index fa8f38105efce48279d0a09d3424f9b0f008c461..d7c746d1e39d1121bdbfdd3886682d4d05aa7d1e 100644 (file)
 
 */
 
+
 #ifndef DCPOMATIC_SPL_H
 #define DCPOMATIC_SPL_H
 
+
 #include "spl_entry.h"
 #include <dcp/util.h>
 #include <boost/signals2.hpp>
+#include <algorithm>
+
 
 class ContentStore;
 
+
 class SPL
 {
 public:
@@ -60,6 +65,8 @@ public:
 
        SPLEntry const & operator[] (std::size_t index) const {
                return _spl[index];
+       void swap(size_t a, size_t b) {
+               std::iter_swap(_spl.begin() + a, _spl.begin() + b);
        }
 
        void read (boost::filesystem::path path, ContentStore* store);