|
static const std::string & | s_class () |
|
Definition at line 26 of file directory.
◆ directory() [1/4]
tools::wroot::directory::directory |
( |
ifile & |
a_file | ) |
|
|
inline |
◆ directory() [2/4]
tools::wroot::directory::directory |
( |
ifile & |
a_file, |
|
|
const std::string & |
a_name, |
|
|
const std::string & |
a_title |
|
) |
| |
|
inline |
Definition at line 54 of file directory.
67 mem::increment(
s_class().c_str());
73 m_file.
out() <<
"tools::wroot::directory::directory :"
74 <<
" directory name cannot be \"\"."
78 if(
m_name.find(
'/')!=std::string::npos) {
79 m_file.
out() <<
"tools::wroot::directory::directory :"
80 <<
" directory name " << sout(
m_name)
81 <<
" cannot contain a slash."
◆ directory() [3/4]
tools::wroot::directory::directory |
( |
ifile & |
a_file, |
|
|
directory * |
a_parent, |
|
|
const std::string & |
a_name, |
|
|
const std::string & |
a_title |
|
) |
| |
|
inline |
Definition at line 88 of file directory.
104 mem::increment(
s_class().c_str());
110 m_file.
out() <<
"tools::wroot::directory::directory :"
111 <<
" directory name cannot be \"\"."
115 if(
m_name.find(
'/')!=std::string::npos) {
116 m_file.
out() <<
"tools::wroot::directory::directory :"
117 <<
" directory name " << sout(
m_name)
118 <<
" cannot contain a slash."
126 m_file.
out() <<
"tools::wroot::directory::directory :"
127 <<
" directory " << sout(
m_name) <<
" exists already."
140 m_file.
out() <<
"tools::wroot::directory::directory :"
146 {
char* buffer = key->data_buffer();
149 m_file.
out() <<
"tools::wroot::directory::directory :"
150 <<
" directory name " << sout(
m_name)
151 <<
" cannot fill buffer."
157 key->set_cycle(cycle);
158 if(!key->write_self(
m_file)) {
159 m_file.
out() <<
"tools::wroot::directory::directory :"
160 <<
" key.write_self() failed."
165 if(!key->write_file(
m_file,n)) {
166 m_file.
out() <<
"tools::wroot::directory::directory :"
167 <<
" directory name " << sout(
m_name)
168 <<
" cannot write key to file."
◆ ~directory()
virtual tools::wroot::directory::~directory |
( |
| ) |
|
|
inlinevirtual |
◆ directory() [4/4]
tools::wroot::directory::directory |
( |
const directory & |
a_from | ) |
|
|
inlineprotected |
◆ append_key()
uint16 tools::wroot::directory::append_key |
( |
key * |
a_key | ) |
|
|
inlineprotected |
Definition at line 380 of file directory.
382 if((*it)->object_name()==a_key->object_name()) {
384 return ((*it)->cycle() + 1);
◆ append_object()
virtual void tools::wroot::directory::append_object |
( |
iobject * |
a_object | ) |
|
|
inlinevirtual |
◆ clear_dirs()
void tools::wroot::directory::clear_dirs |
( |
| ) |
|
|
inline |
◆ clear_keys()
void tools::wroot::directory::clear_keys |
( |
| ) |
|
|
inlineprotected |
Definition at line 333 of file directory.
334 std::list<key*>::iterator it;
◆ clear_objs()
void tools::wroot::directory::clear_objs |
( |
| ) |
|
|
inline |
◆ close()
bool tools::wroot::directory::close |
( |
| ) |
|
|
inline |
◆ file()
virtual ifile& tools::wroot::directory::file |
( |
| ) |
|
|
inlinevirtual |
◆ find_key()
key* tools::wroot::directory::find_key |
( |
const std::string & |
a_name | ) |
|
|
inlineprotected |
Definition at line 366 of file directory.
368 m_file.
out() <<
"tools::wroot::directory::find_key :"
369 <<
" " << sout(a_name) <<
" ..."
373 if((*it)->object_name()==a_name)
return *it;
◆ is_valid()
bool tools::wroot::directory::is_valid |
( |
| ) |
const |
|
inline |
◆ keys()
const std::list<key*>& tools::wroot::directory::keys |
( |
| ) |
const |
|
inline |
◆ mkdir()
directory* tools::wroot::directory::mkdir |
( |
const std::string & |
a_name, |
|
|
const std::string & |
a_title = "" |
|
) |
| |
|
inline |
Definition at line 201 of file directory.
205 m_file.
out() <<
"tools::wroot::directory::mkdir :"
206 <<
" directory name cannot be \"\"."
210 if(a_name.find(
'/')!=std::string::npos) {
211 m_file.
out() <<
"tools::wroot::directory::mkdir :"
212 <<
" " << sout(a_name)
213 <<
" cannot contain a slash."
218 if(!dir->is_valid()) {
219 m_file.
out() <<
"tools::wroot::directory::mkdir :"
220 <<
" directory badly created."
◆ operator=()
◆ record_size()
uint32 tools::wroot::directory::record_size |
( |
| ) |
const |
|
inline |
Definition at line 232 of file directory.
233 uint32 nbytes =
sizeof(short);
234 nbytes +=
sizeof(
date);
235 nbytes +=
sizeof(
date);
239 nbytes +=
sizeof(
seek);
240 nbytes +=
sizeof(
seek);
241 nbytes +=
sizeof(
seek);
◆ s_class()
static const std::string& tools::wroot::directory::s_class |
( |
| ) |
|
|
inlinestatic |
Definition at line 29 of file directory.
30 static const std::string s_v(
"tools::wroot::directory");
◆ save()
bool tools::wroot::directory::save |
( |
| ) |
|
|
inlineprotected |
Definition at line 343 of file directory.
346 if(!(*it)->save())
return false;
◆ save_self()
bool tools::wroot::directory::save_self |
( |
| ) |
|
|
inlineprotected |
◆ seek_directory()
virtual seek tools::wroot::directory::seek_directory |
( |
| ) |
const |
|
inlinevirtual |
◆ seek_keys()
seek tools::wroot::directory::seek_keys |
( |
| ) |
const |
|
inlineprotected |
◆ set_nbytes_name()
void tools::wroot::directory::set_nbytes_name |
( |
uint32 |
a_n | ) |
|
|
inline |
◆ set_seek_directory()
void tools::wroot::directory::set_seek_directory |
( |
seek |
a_seek | ) |
|
|
inline |
◆ to_buffer()
bool tools::wroot::directory::to_buffer |
( |
wbuf & |
a_wb | ) |
|
|
inline |
Definition at line 253 of file directory.
256 short version = class_version();
258 if(!a_wb.write(
version))
return false;
259 if(!a_wb.write(
m_date_C))
return false;
260 if(!a_wb.write(
m_date_M))
return false;
269 m_file.
out() <<
"tools::wroot::key::to_buffer :"
◆ write()
bool tools::wroot::directory::write |
( |
uint32 & |
a_nbytes | ) |
|
|
inline |
Definition at line 277 of file directory.
285 m_file.
out() <<
"tools::wroot::directory::write :"
297 if(!(*it)->write(n))
return false;
304 m_file.
out() <<
"tools::wroot::directory::write :"
305 <<
" for directory " << sout(
m_name)
306 <<
", write_object " << sout((*it)->name())
315 m_file.
out() <<
"tools::wroot::directory::write :"
316 <<
" for directory " << sout(
m_name)
317 <<
", save_self failed."
◆ write_header()
bool tools::wroot::directory::write_header |
( |
| ) |
|
|
inlineprotected |
Definition at line 449 of file directory.
452 char* header =
new char[nbytes];
453 char* buffer = header;
◆ write_keys()
bool tools::wroot::directory::write_keys |
( |
| ) |
|
|
inlineprotected |
Definition at line 392 of file directory.
405 uint32 nbytes =
sizeof(nkeys);
408 nbytes += (*it)->key_length();
412 if(!headerkey.seek_key())
return false;
414 {
char* buffer = headerkey.data_buffer();
416 if(!wb.write(nkeys))
return false;
425 m_file.
out() <<
"tools::wroot::directory::write_keys :"
426 <<
" write header key"
437 headerkey.set_cycle(1);
438 if(!headerkey.write_self(
m_file)) {
439 m_file.
out() <<
"tools::wroot::directory::write_keys :"
440 <<
" key.write_self() failed."
446 return headerkey.write_file(
m_file,n);
◆ write_object()
bool tools::wroot::directory::write_object |
( |
iobject & |
a_obj, |
|
|
uint32 & |
a_nbytes |
|
) |
| |
|
inlineprotected |
Definition at line 479 of file directory.
481 if(!a_obj.stream(bref)) {
482 m_file.
out() <<
"tools::wroot::directory::write_object :"
483 <<
" cannot stream object of store class name "
484 <<
" " << sout(a_obj.store_class_name()) <<
"."
490 std::string name = a_obj.name();
497 a_obj.title(),a_obj.store_class_name(),
500 if(!key->seek_key()) {
505 if(!bref.displace_mapped(key->key_length())) {
512 bool kdelete =
false;
515 ::memcpy(key->data_buffer(),kbuf,klen);
516 if(kdelete)
delete [] kbuf;
518 {
uint32 nkey = key->key_length()+klen;
520 key->set_number_of_bytes(nkey);}
523 key->set_cycle(cycle);
525 if(!key->write_self(
m_file)) {
526 m_file.
out() <<
"tools::wroot::directory::write_object :"
527 <<
" key.write_self() failed."
535 m_file.
out() <<
"tools::wroot::directory::_write_buffer :"
536 <<
" " << sout(a_obj.name()) <<
"."
540 return key->write_file(
m_file,a_nbytes);
◆ m_date_C
date tools::wroot::directory::m_date_C |
|
protected |
◆ m_date_M
date tools::wroot::directory::m_date_M |
|
protected |
◆ m_dirs
std::vector<directory*> tools::wroot::directory::m_dirs |
|
protected |
◆ m_file
ifile& tools::wroot::directory::m_file |
|
protected |
◆ m_is_valid
bool tools::wroot::directory::m_is_valid |
|
protected |
◆ m_keys
std::list<key*> tools::wroot::directory::m_keys |
|
protected |
◆ m_name
std::string tools::wroot::directory::m_name |
|
protected |
◆ m_nbytes_keys
uint32 tools::wroot::directory::m_nbytes_keys |
|
protected |
◆ m_nbytes_name
uint32 tools::wroot::directory::m_nbytes_name |
|
protected |
◆ m_objs
std::vector<iobject*> tools::wroot::directory::m_objs |
|
protected |
◆ m_parent
◆ m_seek_directory
seek tools::wroot::directory::m_seek_directory |
|
protected |
◆ m_seek_keys
seek tools::wroot::directory::m_seek_keys |
|
protected |
◆ m_seek_parent
seek tools::wroot::directory::m_seek_parent |
|
protected |
◆ m_title
std::string tools::wroot::directory::m_title |
|
protected |
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/wroot/directory
#define tools_lforcit(a__T, a__l, a__it)
#define tools_vforit(a__T, a__v, a__it)
#define tools_lforit(a__T, a__l, a__it)
#define tools_vforcit(a__T, a__v, a__it)