]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/memory.cpp
Add move semantics to Variant
[libs/core.git] / source / io / memory.cpp
index 19629c446d6c8bfc5e25288e8580deeadbe68c5c..0539fdbc4245f3c9c9ada441bf2aefdbcf0c0707 100644 (file)
@@ -9,14 +9,26 @@ using namespace std;
 namespace Msp {
 namespace IO {
 
-Memory::Memory(char *b, char *e, Mode m)
+Memory::Memory(char *d, std::size_t s, Mode m):
+       Memory(d, d+s, m)
+{ }
+
+Memory::Memory(char *b, char *e, Mode m):
+       begin(b),
+       end(e),
+       pos(begin)
 {
-       begin = b;
-       end = e;
-       pos = begin;
        mode = m;
 }
 
+Memory::Memory(const char *d, std::size_t s):
+       Memory(const_cast<char *>(d), const_cast<char *>(d+s), M_READ)
+{ }
+
+Memory::Memory(const char *b, const char *e):
+       Memory(const_cast<char *>(b), const_cast<char *>(e), M_READ)
+{ }
+
 void Memory::set_block(bool)
 {
        throw unsupported("Memory::set_block");