TOP --> CcDoc
- class CCcDocPhase3PkgTree
- extends CJdlVector < CCcDocPhase3PkgTree * > as public
This class manages the package tree and generates the nifty
drawing of the package tree.
Nodes with the name "[NULL]" will be ignored which means that
you can use the pkg name "[NULL]" for a file that defines
packages.
This class is used as follows:
// Generate a tree that looks like this:
// [ROOT] +--> A1 +--> A1B1
// |
// +--> A2 +--> A2B1
// |
// +--> A2B2
CCcDocPhase3PkgTree* root = new CCcDocPhase3PkgTree("[ROOT]",0);
CCcDocPhase3PkgTree* A1 = new CCcDocPhase3PkgTree("A1",root);
CCcDocPhase3PkgTree* A2 = new CCcDocPhase3PkgTree("A2",root);
CCcDocPhase3PkgTree* A1B1 = new CCcDocPhase3PkgTree("A1B1",A1);
CCcDocPhase3PkgTree* A2B1 = new CCcDocPhase3PkgTree("A2B1",A2);
CCcDocPhase3PkgTree* A2B2 = new CCcDocPhase3PkgTree("A2B2",A2);
root->Compile();
root->Write(stdout,false); // don't print anchors
- Author:
-
Joe Linoff
- Version:
-
$Id: ccdocphase3.h,v 1.6 1999/06/12 18:10:33 jdl Exp $
- Source:
-
../../ccdoc/src/ccdocphase3.h:50
- CCcDocPhase3PkgTree
- [public] Constructor.
- ~CCcDocPhase3PkgTree
- [public] Destructor.
- Compile
- [public] Compile the tree.
- Dump
- [public] Dump the contents of the tree for debugging.
- Find
- [public] Find a child node with the specified name.
- GetName
- [public] Get the name of this node.
- GetParent
- [public] Get the parent node.
- GetPath
- [public] Get the hierachical name of this node. Each level hierarchy
is separated by a ".".
- IsNull
- [public] Is this a NULL package? A NULL package is one whose name is "[NULL]".
They exist to allow documentation developers to create package
documentation in a separate "documentation only" file. The contents
of these files are used but the files are not associated with any package
in the system.
- SetRef
- [public] Set the external reference. If this is not set, the reference
is generated automatically from the tree path.
- Write
- [public] Write the tree out to a file.
- WriteAnchor
- [public] Write out the HTML anchor statement. Use the external reference if it was set.
- WritePath
- [public] Write out the path of the current node. This is a simple, straightline
representation of the hierarchy associated with the node.
CCcDocPhase3PkgTree
public CCcDocPhase3PkgTree ( const char * name ,
CCcDocPhase3PkgTree * parent ) ;
Constructor.
- Parameters:
-
name
| The node name.
| parent
| The parent node.
|
CCcDocPhase3PkgTree
public ~ CCcDocPhase3PkgTree ( ) ;
Destructor.
Compile
public void Compile ( ulong level = 0 ,
ulong phase = 0 ) ;
Compile the tree.
Compilation must be completed prior to any write operations.
There are three compilation phases:
- Phase 0: Initialize the max level indicator.
- Phase 1: Order the child nodes and set the preliminary column widths.
- Phase 2: Fix the column widths to guarantee that we get the max.
- Parameters:
-
level
| The current level.
| phase
| The current compilation phase.
|
Write
public void Write ( FILE * fp = stderr ,
bool anchorFlag = true ,
const char * prefix = 0 ) ;
Write the tree out to a file.
- Parameters:
-
fp
| The file pointer.
| anchorFlag
| If true, generate the HTML anchor statements for
each pkg. If false, print it out as plaintext for
debugging. Setting the environment variable
CCDOC_PHASE3_TREE_ANCHORS_OFF set this flag to
false.
| prefix
| An optional prefix.
|
WritePath
public void WritePath ( FILE * fp = stderr ,
bool anchorFlag = true ,
bool anchorLastFlag = true ,
const char * prefix = 0 ) ;
Write out the path of the current node. This is a simple, straightline
representation of the hierarchy associated with the node.
- Parameters:
-
fp
| The file pointer.
| anchorFlag
| If true, generate the HTML anchor statements for
each pkg. If false, print it out as plaintext for
debugging. Setting the environment variable
CCDOC_PHASE3_TREE_ANCHORS_OFF set this flag to
false.
| anchorLastFlag
| If true, generate the HTML anchor statement
for the last entry. For the pkg index lists we
want this to be false.
| prefix
| An optional prefix.
|
Find
public CCcDocPhase3PkgTree * Find ( const char * name ) const ;
Find a child node with the specified name.
- Parameters:
-
name
| The name of the child.
|
- Return:
-
The child node or NULL if the child node does not exist.
GetParent
public CCcDocPhase3PkgTree * GetParent ( ) const ;
Get the parent node.
- Return:
-
The parent node or NULL if this is the top node.
GetName
public const char * GetName ( ) const ;
Get the name of this node.
- Return:
-
The node name.
GetPath
public void GetPath ( CJdlString & path ) const ;
Get the hierachical name of this node. Each level hierarchy
is separated by a ".".
- Return:
-
The hierachical node name.
IsNull
public bool IsNull ( ) const ;
Is this a NULL package? A NULL package is one whose name is "[NULL]".
They exist to allow documentation developers to create package
documentation in a separate "documentation only" file. The contents
of these files are used but the files are not associated with any package
in the system.
- Return:
-
True if this is NULL package or false otherwise.
Dump
public void Dump ( FILE * fp = stderr ,
const char * prefix = 0 ,
ulong level = 0 ) ;
Dump the contents of the tree for debugging.
- Parameters:
-
fp
| The output file pointer.
| prefix
| An optional prefix.
| level
| The current level. This should not be set by the programmer.
|
SetRef
public void SetRef ( const char * ref ) ;
Set the external reference. If this is not set, the reference
is generated automatically from the tree path.
- Parameters:
-
ref
| The name of the reference.
|
WriteAnchor
public void WriteAnchor ( FILE * fp ,
bool indexFlag = true ) ;
Write out the HTML anchor statement. Use the external reference if it was set.
- Parameters:
-
fp
| The output file.
| indexFlag
| If true, reference the [ROOT] node as ccdoc.index.html otherwise
reference it as ccdoc.xref.html.
|
This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.
Click here to return to the top of the page.
|