rds2cpp
C++ library for parsing RDS files
Loading...
Searching...
No Matches
RdsFile.hpp
Go to the documentation of this file.
1#ifndef RDS2CPP_RDSFILE_HPP
2#define RDS2CPP_RDSFILE_HPP
3
4#include <array>
5#include "RObject.hpp"
6#include "Environment.hpp"
7#include "ExternalPointer.hpp"
8#include "Symbol.hpp"
9
16namespace rds2cpp {
17
21struct RdsFile {
22 RdsFile() {
23 format_version = 3;
24
25 writer_version[0] = 4;
26 writer_version[1] = 2;
27 writer_version[2] = 0;
28
29 reader_version[0] = 3;
30 reader_version[1] = 5;
31 reader_version[2] = 0;
32
33 encoding = "UTF-8";
34 }
35
39 // Avoid any initialization.
40 RdsFile(bool) {}
49
53 std::array<unsigned char, 3> writer_version;
54
58 std::array<unsigned char, 3> reader_version;
59
63 std::string encoding;
64
68 std::unique_ptr<RObject> object;
69
74 std::vector<Environment> environments;
75
80 std::vector<Symbol> symbols;
81
86 std::vector<ExternalPointer> external_pointers;
87};
88
89}
90
91#endif
Representation of an R environment.
Representations of unserialized R objects.
Representation of an R symbol.
Parse an RDS file in C++.
Definition StringEncoding.hpp:10
RdsFile parse_rds(Reader_ &reader)
Definition parse_rds.hpp:34
Contents of the parsed RDS file.
Definition RdsFile.hpp:21
std::array< unsigned char, 3 > writer_version
Definition RdsFile.hpp:53
std::unique_ptr< RObject > object
Definition RdsFile.hpp:68
std::vector< Symbol > symbols
Definition RdsFile.hpp:80
std::vector< ExternalPointer > external_pointers
Definition RdsFile.hpp:86
std::string encoding
Definition RdsFile.hpp:63
uint32_t format_version
Definition RdsFile.hpp:48
std::vector< Environment > environments
Definition RdsFile.hpp:74
std::array< unsigned char, 3 > reader_version
Definition RdsFile.hpp:58