riCOM_cpp
This repository contains the C++ implementation of the riCOM (Real Time Centre Of Mass) algorithm for 4D Scanning electron microscopy.
FileConnector.h
Go to the documentation of this file.
1 /* Copyright (C) 2021 Thomas Friedrich, Chu-Ping Yu,
2  * University of Antwerp - All Rights Reserved.
3  * You may use, distribute and modify
4  * this code under the terms of the GPL3 license.
5  * You should have received a copy of the GPL3 license with
6  * this file. If not, please visit:
7  * https://www.gnu.org/licenses/gpl-3.0.en.html
8  *
9  * Authors:
10  * Thomas Friedrich <thomas.friedrich@uantwerpen.be>
11  * Chu-Ping Yu <chu-ping.yu@uantwerpen.be>
12  */
13 
14 #ifndef FILE_CONNECTOR_H
15 #define FILE_CONNECTOR_H
16 
17 #include <iostream>
18 #include <limits>
19 #include <string>
20 #include <fstream>
21 #include <filesystem>
22 
24 {
25 public:
26  std::filesystem::path path;
27  void open_file();
28  void close_file();
29  void read_data(char *buffer, size_t data_size);
30  FileConnector();
31 
32 private:
33  std::ifstream stream;
34  std::uintmax_t file_size;
35  std::uintmax_t pos;
36  void reset_file();
37 };
38 #endif // FILE_CONNECTOR_H
void read_data(char *buffer, size_t data_size)
std::filesystem::path path
Definition: FileConnector.h:26