#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <utility>
#include <cstdint>
#include <filesystem>
Go to the source code of this file.
◆ helpMessage()
Definition at line 48 of file DecodeSCT.cxx.
48 {
49 std::cout<< "'DecodeSCT' takes exactly one argument, the bytestream filename." <<std::endl;
50}
◆ main()
| int main |
( |
int | argc, |
|
|
char ** | argv ) |
Definition at line 53 of file DecodeSCT.cxx.
53 {
54 if (argc < 2){
56 return 1;
57 }
60 std::cerr <<
argv[1] <<
" does not exist."<<std::endl;
61 return 2;
62 }
63 auto length = fs::file_size(input_file);
64 printf(
"Length: %lu\n",
length);
66 if(fd<0) {
67 perror("File open failed");
68 return 3;
69 }
71 if(buffer == MAP_FAILED) {
72 close(fd);
73 perror("mmap failed");
74 return 4;
75 }
79 while(findNextEvent(begin, end, endBuffer, 0xee1234ee)) {
80
81 printf("Event from %li to %li\n", begin-buffer, end-buffer);
83 decodeEvent(begin,
length);
84 }
86 close(fd);
87}
◆ str()
| std::string str |
( |
const char * | word | ) |
|
|
inline |
Definition at line 43 of file DecodeSCT.cxx.
43 {
44 return word ? word : "";
45}