1 #ifndef MSP_DATAFILE_RAWDATA_H_
2 #define MSP_DATAFILE_RAWDATA_H_
5 #include <msp/core/noncopyable.h>
6 #include <msp/io/base.h>
13 class RawData: public NonCopyable
22 IO::Base *in = nullptr;
23 bool in_owned = false;
24 IO::Base *compressed = nullptr;
27 char *owned_data = nullptr;
29 static const char signature[4];
34 static bool detect_signature(const std::string &);
36 void open_file(Collection &, const std::string &);
37 void open_io(IO::Base &, const std::string &);
39 void load_into(void *);
41 void write_io(IO::Base &, bool = false);
43 std::size_t get_size() const { return size; }
44 const void *get_data() const { return data; }
47 } // namespace DataFile