|
| key (const key &a_from) |
|
uint32 | record_size (uint32 a_version) const |
|
bool | unzip (std::ostream &a_out, ifile &a_file, int a_srcsize, unsigned char *a_src, int a_tgtsize, unsigned char *a_tgt, int &a_irep) |
|
|
static const std::string & | s_class () |
|
Definition at line 37 of file key.
◆ key() [1/3]
tools::rroot::key::key |
( |
std::ostream & |
a_out | ) |
|
|
inline |
Definition at line 49 of file key.
67 mem::increment(
s_class().c_str());
◆ key() [2/3]
tools::rroot::key::key |
( |
std::ostream & |
a_out, |
|
|
seek |
a_pos, |
|
|
uint32 |
a_nbytes |
|
) |
| |
|
inline |
Definition at line 73 of file key.
91 mem::increment(
s_class().c_str());
96 m_out <<
"tools::rroot::key::key(cpcstor) :"
97 <<
" can't alloc " << a_nbytes <<
"."
◆ ~key()
virtual tools::rroot::key::~key |
( |
| ) |
|
|
inlinevirtual |
Definition at line 103 of file key.
106 mem::decrement(
s_class().c_str());
◆ key() [3/3]
tools::rroot::key::key |
( |
const key & |
a_from | ) |
|
|
inlineprotected |
Definition at line 110 of file key.
127 mem::increment(
s_class().c_str());
129 if(a_from.m_buf_size && a_from.m_buffer) {
130 m_buffer =
new char[a_from.m_buf_size];
132 m_out <<
"tools::rroot::key::key(cpcstor) :"
133 <<
" can't alloc " << a_from.m_buf_size <<
"."
137 ::memcpy(
m_buffer,a_from.m_buffer,a_from.m_buf_size);
◆ buf()
char* tools::rroot::key::buf |
( |
| ) |
const |
|
inline |
Definition at line 200 of file key.
◆ buf_size()
uint32 tools::rroot::key::buf_size |
( |
| ) |
const |
|
inline |
Definition at line 203 of file key.
◆ data_buffer()
char* tools::rroot::key::data_buffer |
( |
| ) |
const |
|
inline |
Definition at line 201 of file key.
◆ dump()
void tools::rroot::key::dump |
( |
std::ostream & |
a_out | ) |
const |
|
inline |
Definition at line 411 of file key.
◆ eob()
const char* tools::rroot::key::eob |
( |
| ) |
const |
|
inline |
Definition at line 202 of file key.
◆ from_buffer()
bool tools::rroot::key::from_buffer |
( |
bool |
a_byte_swap, |
|
|
const char * |
aEOB, |
|
|
char *& |
a_pos, |
|
|
bool |
a_verbose |
|
) |
| |
|
inline |
Definition at line 206 of file key.
207 rbuf rb(
m_out,a_byte_swap,aEOB,a_pos);
209 if(!rb.read(_nbytes))
return false;
226 if(!rb.read(
version))
return false;
229 if(!rb.read(v))
return false;
232 if(!rb.read(_date))
return false;
235 if(!rb.read(v))
return false;
238 if(!rb.read(v))
return false;
245 if(!rb.read(i))
return false;
248 if(!rb.read(i))
return false;
255 m_out <<
"tools::rroot::key::from_buffer :"
◆ get_object_buffer()
char* tools::rroot::key::get_object_buffer |
( |
ifile & |
a_file, |
|
|
uint32 & |
a_size |
|
) |
| |
|
inline |
Definition at line 267 of file key.
269 m_out <<
"tools::rroot::key::get_object_buffer :"
270 <<
" WARNING : m_key_length is zero."
279 m_out <<
"tools::rroot::key::get_object_buffer :"
280 <<
" m_nbytes is zero."
289 m_out <<
"tools::rroot::key::get_object_buffer :"
290 <<
" WARNING : m_object_size is zero."
294 if(a_file.verbose()) {
295 m_out <<
"tools::rroot::key::get_object_buffer :"
307 m_out <<
"tools::rroot::key::get_object_buffer :"
308 <<
" WARNING : m_buf_size<m_nbytes."
311 <<
". Raise m_buf_size to " <<
m_nbytes <<
"."
317 m_out <<
"tools::rroot::key::get_object_buffer :"
338 char* decbuf =
new char[decsiz];
340 m_out <<
"tools::rroot::key::get_object_buffer :"
341 <<
" can't alloc " << decsiz
363 unsigned char* objbuf = (
unsigned char*)(decbuf+
m_key_length);
368 int nin = 9 + ((int)bufcur[3] | ((
int)bufcur[4] << 8) | ((
int)bufcur[5] << 16));
369 int nbuf = (int)bufcur[6] | ((
int)bufcur[7] << 8) | ((
int)bufcur[8] << 16);
370 if(!
unzip(
m_out,a_file,nin,bufcur,nbuf,objbuf,nout))
break;
383 m_out <<
"tools::rroot::key::get_object_buffer :"
384 <<
" nothing from decompression."
392 m_out <<
"tools::rroot::key::get_object_buffer :"
393 <<
" decompression mismatch."
394 <<
" noutot " << noutot
◆ key_length()
uint32 tools::rroot::key::key_length |
( |
| ) |
const |
|
inline |
Definition at line 204 of file key.
◆ nbytes()
uint32 tools::rroot::key::nbytes |
( |
| ) |
const |
|
inline |
Definition at line 178 of file key.
◆ object_class()
const std::string& tools::rroot::key::object_class |
( |
| ) |
const |
|
inline |
Definition at line 184 of file key.
◆ object_name()
const std::string& tools::rroot::key::object_name |
( |
| ) |
const |
|
inline |
Definition at line 182 of file key.
◆ object_size()
uint32 tools::rroot::key::object_size |
( |
| ) |
const |
|
inline |
Definition at line 180 of file key.
◆ object_title()
const std::string& tools::rroot::key::object_title |
( |
| ) |
const |
|
inline |
Definition at line 183 of file key.
◆ operator=()
key& tools::rroot::key::operator= |
( |
const key & |
a_from | ) |
|
|
inline |
Definition at line 142 of file key.
143 if(&a_from==
this)
return *
this;
160 if(a_from.m_buf_size && a_from.m_buffer) {
161 m_buffer =
new char[a_from.m_buf_size];
163 m_out <<
"tools::rroot::key::operator=() :"
164 <<
" can't alloc " << a_from.m_buf_size <<
"."
168 ::memcpy(
m_buffer,a_from.m_buffer,a_from.m_buf_size);
◆ out()
std::ostream& tools::rroot::key::out |
( |
| ) |
const |
|
inline |
Definition at line 176 of file key.
◆ read_file()
bool tools::rroot::key::read_file |
( |
ifile & |
a_file | ) |
|
|
inline |
Definition at line 186 of file key.
190 if(a_file.verbose()) {
191 m_out <<
"tools::rroot::key::read_file :"
192 <<
" reading " <<
m_nbytes <<
" bytes"
◆ record_size()
uint32 tools::rroot::key::record_size |
( |
uint32 |
a_version | ) |
const |
|
inlineprotected |
Definition at line 423 of file key.
426 _nbytes +=
sizeof(short);
428 _nbytes +=
sizeof(
date);
432 _nbytes +=
sizeof(
seek);
433 _nbytes +=
sizeof(
seek);
435 _nbytes +=
sizeof(
seek32);
436 _nbytes +=
sizeof(
seek32);
◆ s_class()
static const std::string& tools::rroot::key::s_class |
( |
| ) |
|
|
inlinestaticprotected |
Definition at line 552 of file key.
553 static const std::string s_v(
"tools::rroot::key");
◆ seek_key()
seek tools::rroot::key::seek_key |
( |
| ) |
const |
|
inline |
Definition at line 179 of file key.
◆ std_string_record_size()
static uint32 tools::rroot::key::std_string_record_size |
( |
const std::string & |
x | ) |
|
|
inlinestatic |
Definition at line 40 of file key.
43 return uint32(x.size()+
sizeof(
unsigned char)+
sizeof(
int));
45 return uint32(x.size()+
sizeof(
unsigned char));
◆ unzip()
bool tools::rroot::key::unzip |
( |
std::ostream & |
a_out, |
|
|
ifile & |
a_file, |
|
|
int |
a_srcsize, |
|
|
unsigned char * |
a_src, |
|
|
int |
a_tgtsize, |
|
|
unsigned char * |
a_tgt, |
|
|
int & |
a_irep |
|
) |
| |
|
inlineprotected |
Definition at line 445 of file key.
460 const int HDRSIZE = 9;
462 if (a_srcsize < HDRSIZE) {
463 a_out <<
"tools::rroot::key::unzip : too small source" << std::endl;
467 unsigned char DEFLATE = 8;
469 if ((a_src[0] !=
'C' && a_src[0] !=
'Z') ||
470 (a_src[1] !=
'S' && a_src[1] !=
'L') ||
471 a_src[2] != DEFLATE) {
472 a_out <<
"tools::rroot::key::unzip : error in header" << std::endl;
476 long _ibufcnt = (long)a_src[3] | ((
long)a_src[4] << 8) | ((
long)a_src[5] << 16);
477 long isize = (long)a_src[6] | ((
long)a_src[7] << 8) | ((
long)a_src[8] << 16);
479 if(a_tgtsize<isize) {
480 a_out <<
"tools::rroot::key::unzip : too small target." << std::endl;
484 if(_ibufcnt + HDRSIZE != a_srcsize) {
485 a_out <<
"tools::rroot::key::unzip :"
486 <<
" discrepancy in source length." << std::endl;
492 if (a_src[0] ==
'Z' && a_src[1] ==
'L') {
494 if(!a_file.unziper(
'Z',func)) {
495 a_out <<
"tools::rroot::key::unzip : "
496 <<
" zlib unziper not found." << std::endl;
501 char* src = (
char*)(a_src + HDRSIZE);
503 (
unsigned int)a_srcsize,src,
504 (
unsigned int)a_tgtsize,(
char*)a_tgt,irep)) {
505 a_out <<
"tools::rroot::key::unzip : "
506 <<
" unzip function failed." << std::endl;
513 }
else if (a_src[0] ==
'C' && a_src[1] ==
'S') {
516 csz__Init_Inflate(_ibufcnt,a_src + HDRSIZE,a_tgtsize,a_tgt);
518 if (csz__Inflate()) {
519 a_out <<
"tools::rroot::key::unzip :"
520 <<
" error during decompression." << std::endl;
524 unsigned char* obufptr = csz__obufptr();
528 if (obufptr - a_tgt > a_tgtsize) {
529 a_out <<
"tools::rroot::key::_unzip :"
530 <<
" discrepancy " << (int)(obufptr - a_tgt)
531 <<
" with initial size: " << (int)isize
532 <<
", tgtsize= " << a_tgtsize
534 a_irep = int(obufptr - a_tgt);
543 a_out <<
"tools::rroot::key::_unzip : unknown a_src[0,1]."
544 <<
" [0] = " << a_src[0] <<
", [1] = " << a_src[1]
◆ m_buf_size
uint32 tools::rroot::key::m_buf_size |
|
protected |
Definition at line 558 of file key.
◆ m_buffer
char* tools::rroot::key::m_buffer |
|
protected |
Definition at line 559 of file key.
◆ m_cycle
uint16 tools::rroot::key::m_cycle |
|
protected |
Definition at line 566 of file key.
◆ m_date
date tools::rroot::key::m_date |
|
protected |
Definition at line 564 of file key.
◆ m_key_length
uint16 tools::rroot::key::m_key_length |
|
protected |
Definition at line 565 of file key.
◆ m_nbytes
uint32 tools::rroot::key::m_nbytes |
|
protected |
Definition at line 561 of file key.
◆ m_object_class
std::string tools::rroot::key::m_object_class |
|
protected |
Definition at line 569 of file key.
◆ m_object_name
std::string tools::rroot::key::m_object_name |
|
protected |
Definition at line 570 of file key.
◆ m_object_size
uint32 tools::rroot::key::m_object_size |
|
protected |
Definition at line 563 of file key.
◆ m_object_title
std::string tools::rroot::key::m_object_title |
|
protected |
Definition at line 571 of file key.
◆ m_out
std::ostream& tools::rroot::key::m_out |
|
protected |
Definition at line 557 of file key.
◆ m_seek_key
seek tools::rroot::key::m_seek_key |
|
protected |
Definition at line 567 of file key.
◆ m_seek_parent_dir
seek tools::rroot::key::m_seek_parent_dir |
|
protected |
Definition at line 568 of file key.
◆ m_version
uint32 tools::rroot::key::m_version |
|
protected |
Definition at line 562 of file key.
◆ START_BIG_FILE
const uint32 tools::rroot::key::START_BIG_FILE = 2000000000 |
|
staticprotected |
Definition at line 421 of file key.
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/rroot/key