|
static const std::string & | s_class () |
|
|
static int | _open (const char *a_name, int a_flags, uint32 a_mode) |
|
static std::string | sout (const std::string &a_string) |
|
Definition at line 31 of file file.
◆ file() [1/2]
tools::rroot::file::file |
( |
std::ostream & |
a_out, |
|
|
const std::string & |
a_path, |
|
|
bool |
a_verbose = false |
|
) |
| |
|
inline |
Definition at line 115 of file file.
136 mem::increment(
s_class().c_str());
141 O_RDONLY | O_BINARY,S_IREAD | S_IWRITE
147 m_out <<
"tools::rroot::file::file :"
148 <<
" can't open " <<
sout(a_path) <<
"."
◆ ~file()
virtual tools::rroot::file::~file |
( |
| ) |
|
|
inlinevirtual |
Definition at line 154 of file file.
157 mem::decrement(
s_class().c_str());
◆ file() [2/2]
tools::rroot::file::file |
( |
const file & |
a_from | ) |
|
|
inlineprotected |
Definition at line 161 of file file.
170 mem::increment(
s_class().c_str());
◆ _open()
static int tools::rroot::file::_open |
( |
const char * |
a_name, |
|
|
int |
a_flags, |
|
|
uint32 |
a_mode |
|
) |
| |
|
inlinestaticprotected |
Definition at line 224 of file file.
225 #if defined(__linux__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2)
226 return ::open64(a_name,a_flags,a_mode);
228 return ::open(a_name,a_flags,a_mode);
◆ add_unziper()
bool tools::rroot::file::add_unziper |
( |
char |
a_key, |
|
|
decompress_func |
a_func |
|
) |
| |
|
inline |
Definition at line 190 of file file.
191 std::map<char,decompress_func>::const_iterator it =
m_unzipers.find(a_key);
◆ byte_swap()
virtual bool tools::rroot::file::byte_swap |
( |
| ) |
const |
|
inlinevirtual |
◆ close()
void tools::rroot::file::close |
( |
| ) |
|
|
inline |
Definition at line 181 of file file.
◆ dir() [1/2]
Definition at line 187 of file file.
◆ dir() [2/2]
const directory& tools::rroot::file::dir |
( |
| ) |
const |
|
inline |
Definition at line 188 of file file.
◆ dump_streamer_infos()
bool tools::rroot::file::dump_streamer_infos |
( |
| ) |
|
|
inline |
Definition at line 201 of file file.
205 streamer_info* info = safe_cast<iro,streamer_info>(*(*it));
206 if(!info)
return false;
◆ error_number()
int tools::rroot::file::error_number |
( |
| ) |
|
|
inlineprotected |
Definition at line 485 of file file.
◆ find_streamer_info()
streamer_info* tools::rroot::file::find_streamer_info |
( |
const std::string & |
a_class | ) |
|
|
inlinevirtual |
Implements tools::rroot::ifile.
Definition at line 211 of file file.
215 streamer_info* info = safe_cast<iro,streamer_info>(*(*it));
217 if(info->name()==a_class)
return info;
◆ initialize()
bool tools::rroot::file::initialize |
( |
| ) |
|
|
inlineprotected |
Definition at line 232 of file file.
234 m_out <<
"tools::rroot::file::initialize :"
235 <<
" can't read header."
257 char* header =
new char[nbytes];
258 char* buffer = header;
260 m_out <<
"tools::rroot::file::initialize :"
261 <<
" can't set position."
267 m_out <<
"tools::rroot::file::initialize :"
268 <<
" can't read buffer."
274 const char* eob = header+nbytes;
276 m_out <<
"tools::rroot::file::initialize :"
277 <<
" can't read buffer (2)."
293 if(!rb.read(cname)) {
294 m_out <<
"tools::rroot::file::initialize :"
295 <<
" can't read buffer (3)."
301 m_out <<
"tools::rroot::file::initialize : TFile expected." << std::endl;
306 m_out <<
"tools::rroot::file::initialize :"
307 <<
" " <<
sout(
"TFile") <<
" found."
310 if(!rb.read(cname)) {
311 m_out <<
"tools::rroot::file::initialize :"
312 <<
" can't read buffer (4)."
318 m_out <<
"tools::rroot::file::initialize :"
319 <<
" found file name " <<
sout(cname)
323 m_out <<
"tools::rroot::file::initialize :"
324 <<
" can't read buffer (5)."
331 m_out <<
"tools::rroot::file::initialize :"
336 if (dirNbytesName < 10 || dirNbytesName > 1000) {
337 m_out <<
"tools::rroot::file::initialize :"
338 <<
" can't read directory info."
346 m_out <<
"tools::rroot::file::initialize :"
347 <<
" can't read keys."
352 m_out <<
"tools::rroot::file::initialize :"
354 <<
" probably not closed."
362 m_out <<
"tools::rroot::file::initialize :"
363 <<
" read_streamer_infos_key() failed."
368 m_out <<
"tools::rroot::file::initialize :"
370 <<
" probably not closed."
◆ is_open()
bool tools::rroot::file::is_open |
( |
| ) |
const |
|
inline |
Definition at line 177 of file file.
178 return (
m_file==not_open()?
false:
true);
◆ operator=()
file& tools::rroot::file::operator= |
( |
const file & |
| ) |
|
|
inlineprotected |
Definition at line 173 of file file.
◆ out()
virtual std::ostream& tools::rroot::file::out |
( |
| ) |
const |
|
inlinevirtual |
◆ path()
virtual const std::string& tools::rroot::file::path |
( |
| ) |
const |
|
inlinevirtual |
◆ read_buffer()
virtual bool tools::rroot::file::read_buffer |
( |
char * |
a_buffer, |
|
|
uint32 |
a_length |
|
) |
| |
|
inlinevirtual |
Implements tools::rroot::ifile.
Definition at line 76 of file file.
83 while ((siz = ::
read(
m_file,a_buffer,a_length)) < 0 &&
86 m_out <<
"tools::rroot::file::read_buffer :"
87 <<
" error reading from file " <<
sout(
m_path) <<
"."
91 if (siz != ssize_t(a_length)) {
92 m_out <<
"tools::rroot::file::read_buffer :"
93 <<
" error reading all requested bytes from file "
◆ read_header()
bool tools::rroot::file::read_header |
( |
| ) |
|
|
inlineprotected |
Definition at line 377 of file file.
378 static const uint32 kBegin = 64;
383 if(::strncmp(header,
"root", 4)) {
384 m_out <<
"tools::rroot::file::read_header :"
385 <<
" " <<
sout(
m_path) <<
" not a file at the CERN-ROOT format."
390 m_out <<
"tools::rroot::file::read_header :"
391 <<
" file signature is " <<
sout(
"root")
394 char* buffer = header + 4;
395 const char* eob = header + kBegin;
398 if(!rb.read(v))
return false;
401 if(!rb.read(i))
return false;
404 if(!rb.read(
m_END))
return false;
408 if(!rb.read(i))
return false;
411 if(!rb.read(i))
return false;
415 m_out <<
"tools::rroot::file::read_header :"
421 if(!rb.read(v))
return false;
424 if(!rb.read(nfree))
return false;
426 if(!rb.read(v))
return false;
430 if(!rb.read(fUnits))
return false;}
432 if(!rb.read(fCompress))
return false;}
437 if(!rb.read(i))
return false;
◆ read_streamer_infos_data()
bool tools::rroot::file::read_streamer_infos_data |
( |
| ) |
|
|
inlineprotected |
Definition at line 463 of file file.
465 if(k.object_class()!=
"TList") {
466 m_out <<
"tools::rroot::file::read_streamer_infos_data : key not a TList." << std::endl;
470 char* buf = k.get_object_buffer(*
this,sz);
472 m_out <<
"tools::rroot::file::read_streamer_infos :"
473 <<
" can't get data buffer of " << k.object_name() <<
"."
◆ read_streamer_infos_key()
bool tools::rroot::file::read_streamer_infos_key |
( |
| ) |
|
|
inlineprotected |
Definition at line 445 of file file.
◆ reset_error_number()
void tools::rroot::file::reset_error_number |
( |
| ) |
|
|
inlineprotected |
Definition at line 486 of file file.
◆ s_class()
static const std::string& tools::rroot::file::s_class |
( |
| ) |
|
|
inlinestatic |
Definition at line 35 of file file.
36 static const std::string s_v(
"tools::rroot::file");
◆ s_cls()
virtual const std::string& tools::rroot::file::s_cls |
( |
| ) |
const |
|
inlinevirtual |
Definition at line 39 of file file.
◆ set_pos()
virtual bool tools::rroot::file::set_pos |
( |
seek |
a_offset = 0 , |
|
|
from |
a_from = begin |
|
) |
| |
|
inlinevirtual |
Implements tools::rroot::ifile.
Definition at line 47 of file file.
61 #if defined(__linux__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2)
62 if (::lseek64(
m_file, a_offset, whence) < 0) {
63 #elif defined(_MSC_VER)
64 if (::_lseeki64(
m_file, a_offset, whence) < 0) {
66 if (::lseek(
m_file, a_offset, whence) < 0) {
68 m_out <<
"tools::rroot::file::set_pos :"
69 <<
" cannot set position " << a_offset
◆ sinfos_key()
virtual key& tools::rroot::file::sinfos_key |
( |
| ) |
|
|
inlinevirtual |
◆ sout()
static std::string tools::rroot::file::sout |
( |
const std::string & |
a_string | ) |
|
|
inlinestaticprotected |
Definition at line 231 of file file.
231 {
return "\""+a_string+
"\"";}
◆ unziper()
virtual bool tools::rroot::file::unziper |
( |
char |
a_key, |
|
|
decompress_func & |
a_func |
|
) |
| const |
|
inlinevirtual |
◆ verbose()
virtual bool tools::rroot::file::verbose |
( |
| ) |
const |
|
inlinevirtual |
◆ version()
uint32 tools::rroot::file::version |
( |
| ) |
const |
|
inline |
Definition at line 175 of file file.
◆ m_BEGIN
seek tools::rroot::file::m_BEGIN |
|
protected |
Definition at line 503 of file file.
◆ m_bytes_read
uint64 tools::rroot::file::m_bytes_read |
|
protected |
Definition at line 494 of file file.
◆ m_END
seek tools::rroot::file::m_END |
|
protected |
Definition at line 504 of file file.
◆ m_file
int tools::rroot::file::m_file |
|
protected |
Definition at line 493 of file file.
◆ m_nbytes_free
uint32 tools::rroot::file::m_nbytes_free |
|
protected |
Definition at line 507 of file file.
◆ m_nbytes_info
uint32 tools::rroot::file::m_nbytes_info |
|
protected |
Definition at line 508 of file file.
◆ m_nbytes_name
uint32 tools::rroot::file::m_nbytes_name |
|
protected |
Definition at line 510 of file file.
◆ m_out
std::ostream& tools::rroot::file::m_out |
|
protected |
Definition at line 490 of file file.
◆ m_path
std::string tools::rroot::file::m_path |
|
protected |
Definition at line 491 of file file.
◆ m_root_directory
directory tools::rroot::file::m_root_directory |
|
protected |
Definition at line 495 of file file.
◆ m_seek_free
seek tools::rroot::file::m_seek_free |
|
protected |
Definition at line 505 of file file.
◆ m_seek_info
seek tools::rroot::file::m_seek_info |
|
protected |
Definition at line 506 of file file.
◆ m_streamer_fac
Definition at line 497 of file file.
◆ m_streamer_infos
obj_list tools::rroot::file::m_streamer_infos |
|
protected |
Definition at line 498 of file file.
◆ m_streamer_infos_key
key tools::rroot::file::m_streamer_infos_key |
|
protected |
Definition at line 496 of file file.
◆ m_title
std::string tools::rroot::file::m_title |
|
protected |
Definition at line 500 of file file.
◆ m_unzipers
Definition at line 499 of file file.
◆ m_verbose
bool tools::rroot::file::m_verbose |
|
protected |
Definition at line 492 of file file.
◆ m_version
uint32 tools::rroot::file::m_version |
|
protected |
Definition at line 502 of file file.
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/rroot/file