Molassembler  1.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BinaryHandler.h
Go to the documentation of this file.
1 
8 #ifndef INCLUDE_MOLASSEMBLER_IO_BINARY_H
9 #define INCLUDE_MOLASSEMBLER_IO_BINARY_H
10 
11 #include <fstream>
12 #include <string>
13 #include <vector>
14 #include <bitset>
15 
16 namespace Scine {
17 
18 namespace Molassembler {
19 
20 // Forward-declarations
21 class Molecule;
22 
23 namespace IO {
24 
26 struct BinaryHandler {
27  using BinaryType = std::vector<std::uint8_t>;
28 
30  static bool canRead(const std::string& filename);
31 
36  static void write(
37  const std::string& filename,
38  const BinaryType& binary
39  );
40 
45  static BinaryType read(const std::string& filename);
46 };
47 
48 } // namespace IO
49 
50 } // namespace Molassembler
51 
52 } // namespace Scine
53 
54 #endif
static void write(const std::string &filename, const BinaryType &binary)
Writes binary to a file.
static bool canRead(const std::string &filename)
Checks whether the file extension is readable.
static BinaryType read(const std::string &filename)
Reads binary from a file.
Binary file IO.
Definition: BinaryHandler.h:26