Public Member Functions | Private Attributes | List of all members
EntryNav Class Reference

#include <entry.h>

Public Member Functions

 EntryNav (EntryNav *parent, Entry *e)
 
 ~EntryNav ()
 
void addChild (EntryNav *)
 
bool loadEntry (FileStorage *storage)
 
bool saveEntry (Entry *e, FileStorage *storage)
 
void setEntry (Entry *e)
 
void releaseEntry ()
 
void changeSection (int section)
 
void setFileDef (FileDef *fd)
 
Entryentry () const
 
int section () const
 
SrcLangExt lang () const
 
const QCStringtype () const
 
const QCStringname () const
 
TagInfotagInfo () const
 
const QList< EntryNav > * children () const
 
EntryNavparent () const
 
FileDeffileDef () const
 

Private Attributes

EntryNavm_parent
 parent node in the tree More...
 
QList< EntryNav > * m_subList
 entries that are children of this one More...
 
int m_section
 entry type (see Sections); More...
 
QCString m_type
 member type More...
 
QCString m_name
 member name More...
 
TagInfom_tagInfo
 tag file info More...
 
FileDefm_fileDef
 
SrcLangExt m_lang
 programming language in which this entry was found More...
 
Entrym_info
 
int64 m_offset
 
bool m_noLoad
 

Detailed Description

Wrapper for a node in the Entry tree.

Allows navigating through the Entry tree and load and storing Entry objects persistently to disk.

Definition at line 333 of file entry.h.

Constructor & Destructor Documentation

EntryNav::EntryNav ( EntryNav parent,
Entry e 
)

Definition at line 331 of file entry.cpp.

332  : m_parent(parent), m_subList(0), m_section(e->section), m_type(e->type),
333  m_name(e->name), m_fileDef(0), m_lang(e->lang),
334  m_info(0), m_offset(-1), m_noLoad(FALSE)
335 {
336  if (e->tagInfo)
337  {
338  m_tagInfo = new TagInfo;
342  if (e->tagInfo)
343  {
344  //printf("tagInfo %p: tagName=%s fileName=%s anchor=%s\n",
345  // e->tagInfo,
346  // e->tagInfo->tagName.data(),
347  // e->tagInfo->fileName.data(),
348  // e->tagInfo->anchor.data());
349  }
350  }
351  else
352  {
353  m_tagInfo = 0;
354  }
355 }
TagInfo * tagInfo
tag file info
Definition: entry.h:238
TagInfo * m_tagInfo
tag file info
Definition: entry.h:366
QList< EntryNav > * m_subList
entries that are children of this one
Definition: entry.h:360
const bool FALSE
Definition: qglobal.h:370
QCString m_type
member type
Definition: entry.h:364
QCString name
member name
Definition: entry.h:237
Definition: entry.h:50
QCString anchor
Definition: entry.h:54
QCString tagName
Definition: entry.h:52
EntryNav * m_parent
parent node in the tree
Definition: entry.h:359
FileDef * m_fileDef
Definition: entry.h:367
Entry * m_info
Definition: entry.h:370
QCString m_name
member name
Definition: entry.h:365
QCString fileName
Definition: entry.h:53
SrcLangExt m_lang
programming language in which this entry was found
Definition: entry.h:368
int64 m_offset
Definition: entry.h:371
SrcLangExt lang
programming language in which this entry was found
Definition: entry.h:286
int m_section
entry type (see Sections);
Definition: entry.h:363
QCString type
member type
Definition: entry.h:236
int section
entry type (see Sections);
Definition: entry.h:235
bool m_noLoad
Definition: entry.h:372
EntryNav::~EntryNav ( )

Definition at line 357 of file entry.cpp.

358 {
359  delete m_subList;
360  delete m_info;
361  delete m_tagInfo;
362 }
TagInfo * m_tagInfo
tag file info
Definition: entry.h:366
QList< EntryNav > * m_subList
entries that are children of this one
Definition: entry.h:360
Entry * m_info
Definition: entry.h:370

Member Function Documentation

void EntryNav::addChild ( EntryNav e)

Definition at line 364 of file entry.cpp.

365 {
366  if (m_subList==0)
367  {
370  }
371  m_subList->append(e);
372 }
QList< EntryNav > * m_subList
entries that are children of this one
Definition: entry.h:360
void append(const type *d)
Definition: qlist.h:73
void setAutoDelete(bool enable)
Definition: qlist.h:99
const bool TRUE
Definition: qglobal.h:371
void EntryNav::changeSection ( int  section)
inline

Definition at line 343 of file entry.h.

343 { m_section = section; }
int section() const
Definition: entry.h:347
int m_section
entry type (see Sections);
Definition: entry.h:363
const QList<EntryNav>* EntryNav::children ( ) const
inline

Definition at line 352 of file entry.h.

352 { return m_subList; }
QList< EntryNav > * m_subList
entries that are children of this one
Definition: entry.h:360
Entry* EntryNav::entry ( ) const
inline

Definition at line 346 of file entry.h.

346 { return m_info; }
Entry * m_info
Definition: entry.h:370
FileDef* EntryNav::fileDef ( ) const
inline

Definition at line 354 of file entry.h.

354 { return m_fileDef; }
FileDef * m_fileDef
Definition: entry.h:367
SrcLangExt EntryNav::lang ( ) const
inline

Definition at line 348 of file entry.h.

348 { return m_lang; }
SrcLangExt m_lang
programming language in which this entry was found
Definition: entry.h:368
bool EntryNav::loadEntry ( FileStorage storage)

Definition at line 374 of file entry.cpp.

375 {
376  if (m_noLoad)
377  {
378  return TRUE;
379  }
380  if (m_offset==-1)
381  {
382  //printf("offset not set!\n");
383  return FALSE;
384  }
385  //delete m_info;
386  //printf("EntryNav::loadEntry: new entry %p: %s\n",m_info,m_name.data());
387  //m_info->tagInfo = m_tagInfo;
388  //if (m_parent)
389  //{
390  // m_info->parent = m_parent->m_info;
391  //}
392  //m_info->parent = 0;
393  //printf("load entry: seek to %llx\n",m_offset);
394  if (!storage->seek(m_offset))
395  {
396  //printf("seek failed!\n");
397  return FALSE;
398  }
399  if (m_info) delete m_info;
400  m_info = unmarshalEntry(storage);
401  m_info->name = m_name;
402  m_info->type = m_type;
404  return TRUE;
405 }
bool seek(int64 pos)
Definition: filestorage.h:37
const bool FALSE
Definition: qglobal.h:370
QCString m_type
member type
Definition: entry.h:364
QCString name
member name
Definition: entry.h:237
Entry * unmarshalEntry(StorageIntf *s)
Definition: marshal.cpp:727
Entry * m_info
Definition: entry.h:370
QCString m_name
member name
Definition: entry.h:365
int64 m_offset
Definition: entry.h:371
const bool TRUE
Definition: qglobal.h:371
int m_section
entry type (see Sections);
Definition: entry.h:363
QCString type
member type
Definition: entry.h:236
int section
entry type (see Sections);
Definition: entry.h:235
bool m_noLoad
Definition: entry.h:372
const QCString& EntryNav::name ( ) const
inline

Definition at line 350 of file entry.h.

350 { return m_name; }
QCString m_name
member name
Definition: entry.h:365
EntryNav* EntryNav::parent ( ) const
inline

Definition at line 353 of file entry.h.

353 { return m_parent; }
EntryNav * m_parent
parent node in the tree
Definition: entry.h:359
void EntryNav::releaseEntry ( )

Definition at line 415 of file entry.cpp.

416 {
417  if (!m_noLoad)
418  {
419  //printf("EntryNav::releaseEntry %p\n",m_info);
420  delete m_info;
421  m_info=0;
422  }
423 }
Entry * m_info
Definition: entry.h:370
bool m_noLoad
Definition: entry.h:372
bool EntryNav::saveEntry ( Entry e,
FileStorage storage 
)

Definition at line 407 of file entry.cpp.

408 {
409  m_offset = storage->pos();
410  //printf("EntryNav::saveEntry offset=%llx\n",m_offset);
411  marshalEntry(storage,e);
412  return TRUE;
413 }
int64 pos() const
Definition: filestorage.h:38
void marshalEntry(StorageIntf *s, Entry *e)
Definition: marshal.cpp:347
int64 m_offset
Definition: entry.h:371
const bool TRUE
Definition: qglobal.h:371
int EntryNav::section ( ) const
inline

Definition at line 347 of file entry.h.

347 { return m_section; }
int m_section
entry type (see Sections);
Definition: entry.h:363
void EntryNav::setEntry ( Entry e)

Definition at line 425 of file entry.cpp.

426 {
427  delete m_info;
428  m_info = e;
429  //printf("EntryNav::setEntry %p\n",e);
430  m_noLoad=TRUE;
431 }
const double e
Entry * m_info
Definition: entry.h:370
const bool TRUE
Definition: qglobal.h:371
bool m_noLoad
Definition: entry.h:372
void EntryNav::setFileDef ( FileDef fd)
inline

Definition at line 344 of file entry.h.

344 { m_fileDef = fd; }
FileDef * m_fileDef
Definition: entry.h:367
TagInfo* EntryNav::tagInfo ( ) const
inline

Definition at line 351 of file entry.h.

351 { return m_tagInfo; }
TagInfo * m_tagInfo
tag file info
Definition: entry.h:366
const QCString& EntryNav::type ( ) const
inline

Definition at line 349 of file entry.h.

349 { return m_type; }
QCString m_type
member type
Definition: entry.h:364

Member Data Documentation

FileDef* EntryNav::m_fileDef
private

Definition at line 367 of file entry.h.

Entry* EntryNav::m_info
private

Definition at line 370 of file entry.h.

SrcLangExt EntryNav::m_lang
private

programming language in which this entry was found

Definition at line 368 of file entry.h.

QCString EntryNav::m_name
private

member name

Definition at line 365 of file entry.h.

bool EntryNav::m_noLoad
private

Definition at line 372 of file entry.h.

int64 EntryNav::m_offset
private

Definition at line 371 of file entry.h.

EntryNav* EntryNav::m_parent
private

parent node in the tree

Definition at line 359 of file entry.h.

int EntryNav::m_section
private

entry type (see Sections);

Definition at line 363 of file entry.h.

QList<EntryNav>* EntryNav::m_subList
private

entries that are children of this one

Definition at line 360 of file entry.h.

TagInfo* EntryNav::m_tagInfo
private

tag file info

Definition at line 366 of file entry.h.

QCString EntryNav::m_type
private

member type

Definition at line 364 of file entry.h.


The documentation for this class was generated from the following files: