]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/rawdata.h
Move the definition of Input's operator bool to the header
[libs/datafile.git] / source / rawdata.h
index 2db390bb0cf9aeefe590fd176c57fced4e72796a..c17f907b52fd015d63f077029036dec00a36a7c6 100644 (file)
@@ -4,13 +4,14 @@
 #include <string>
 #include <msp/core/noncopyable.h>
 #include <msp/io/base.h>
+#include "mspdatafile_api.h"
 
 namespace Msp {
 namespace DataFile {
 
 class Collection;
 
-class RawData: public NonCopyable
+class MSPDATAFILE_API RawData: public NonCopyable
 {
 private:
        enum Flags
@@ -26,14 +27,20 @@ private:
        char *data = nullptr;
        char *owned_data = nullptr;
 
+       static const char signature[4];
+
 public:
        ~RawData();
 
+       static bool detect_signature(const std::string &);
+
        void open_file(Collection &, const std::string &);
        void open_io(IO::Base &, const std::string &);
        void load();
        void load_into(void *);
 
+       void write_io(IO::Base &, bool = false);
+
        std::size_t get_size() const { return size; }
        const void *get_data() const { return data; }
 };