Molassembler  3.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 <cstdint>
12 #include <fstream>
13 #include <string>
14 #include <vector>
15 #include <bitset>
16 
17 namespace Scine {
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 } // namespace Molassembler
50 } // namespace Scine
51 
52 #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