]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/slice.cpp
Add move semantics to Variant
[libs/core.git] / source / io / slice.cpp
index 4007a5e22f1e83cd690c8e278c4a584b1d431aa4..9ca5966c30acd1c03a18af313bbad5cc34737c81 100644 (file)
@@ -1,4 +1,4 @@
-#include <stdexcept>
+#include <msp/core/except.h>
 #include "slice.h"
 
 using namespace std;
@@ -9,12 +9,10 @@ namespace IO {
 Slice::Slice(Seekable &b, SeekOffset s, SeekOffset l):
        below(b),
        start_offset(s),
-       length(l),
-       position(0),
-       sync_position(true)
+       length(l)
 {
        if(s<0 || l<0)
-               throw invalid_argument("Slice");
+               throw invalid_argument("Slice::Slice");
 
        Base::Synchronize sync(below);
        mode = below.get_mode()&M_RDWR;
@@ -23,12 +21,12 @@ Slice::Slice(Seekable &b, SeekOffset s, SeekOffset l):
 
 void Slice::set_block(bool)
 {
-       throw logic_error("Slice::set_block");
+       throw unsupported("Slice::set_block");
 }
 
 void Slice::set_inherit(bool)
 {
-       throw logic_error("Slice::set_inherit");
+       throw unsupported("Slice::set_inherit");
 }
 
 void Slice::flush()
@@ -110,7 +108,7 @@ int Slice::get()
 
 const Handle &Slice::get_handle(Mode)
 {
-       throw logic_error("Slice::get_handle");
+       throw unsupported("Slice::get_handle");
 }
 
 SeekOffset Slice::seek(SeekOffset off, SeekType type)