Molassembler  2.0.1
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 namespace Molassembler {
18 
19 // Forward-declarations
20 class Molecule;
21 
22 namespace IO {
23 
25 struct BinaryHandler {
26  using BinaryType = std::vector<std::uint8_t>;
27 
29  static bool canRead(const std::string& filename);
30 
35  static void write(
36  const std::string& filename,
37  const BinaryType& binary
38  );
39 
44  static BinaryType read(const std::string& filename);
45 };
46 
47 } // namespace IO
48 } // namespace Molassembler
49 } // namespace Scine
50 
51 #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:25