-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrzip.hpp
53 lines (32 loc) · 788 Bytes
/
srzip.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef SRZIP_HPP_
#define SRZIP_HPP_
#include <cstddef>
#include <string>
#include <vector>
#include <fstream>
const size_t SAMPLES_LIMIT = 0x280000;
class SiglentAnalogReader
{
public:
SiglentAnalogReader(size_t skip, size_t len);
void open(const std::string& filename);
std::vector<uint8_t> chunk(size_t chunk_size);
private:
std::ifstream f;
size_t offset;
const size_t seek;
const size_t samples;
};
class SiglentDigitalReader
{
public:
SiglentDigitalReader(size_t skip, size_t channels, size_t len);
void open(const std::string& filename);
std::vector<uint16_t> chunk(size_t chunk_size);
private:
std::vector<std::ifstream> fs;
size_t octets_read;
const size_t seek;
const size_t octets;
};
#endif // SRZIP_HPP_