rntviewer/src/rntuple.cpp

39 lines
1.5 KiB
C++
Raw Normal View History

2024-07-11 12:00:43 +00:00
internal
String8 rntuple_description(Arena *arena, const RNTuple_Info &ntuple)
2024-07-11 12:00:43 +00:00
{
String8 desc = push_str8f(arena, "version %u.%u.%u.%u",
ntuple.version.epoch,
ntuple.version.major,
ntuple.version.minor,
ntuple.version.patch);
2024-07-11 12:00:43 +00:00
return desc;
}
internal
2024-07-11 14:49:18 +00:00
RNTuple_Info get_rntuple_info(const char *fname, const char *ntpl_name)
2024-07-11 12:00:43 +00:00
{
2024-07-11 12:27:19 +00:00
RNTuple_Info info = {};
2024-07-11 12:00:43 +00:00
2024-07-11 14:29:44 +00:00
// TODO: proper error handling
root::RMicroFileReader file_reader { fname };
root::RNTuple_File_Info file_info = file_reader.GetNTupleProper(ntpl_name);
2024-07-12 07:53:01 +00:00
if (!file_info.failed) {
info.version.epoch = file_info.anchor.fVersionEpoch;
info.version.major = file_info.anchor.fVersionMajor;
info.version.minor = file_info.anchor.fVersionMinor;
info.version.patch = file_info.anchor.fVersionPatch;
2024-07-12 07:53:01 +00:00
info.rng_header.start = file_info.anchor.fSeekHeader;
info.rng_header.len = file_info.anchor.fNBytesHeader;
info.rng_footer.start = file_info.anchor.fSeekFooter;
info.rng_footer.len = file_info.anchor.fNBytesFooter;
2024-07-11 14:29:44 +00:00
info.rng_anchor.start = file_info.anchor_seek;
info.rng_anchor.len = file_info.anchor_nbytes;
info.rng_anchor_key.start = file_info.anchor_key_seek;
info.rng_anchor_key.len = file_info.anchor_key_nbytes;
info.rblob_header_size = file_info.rblob_key_header_nbytes;
info.root_file_header_size = file_info.tfile_header_nbytes;
}
2024-07-11 12:00:43 +00:00
return info;
}