SymbolViewer Class Reference

A Viewer for the symbol table stored in a CppTagDB as created by the program, cpptagdb.exe. More...

#include <symbolviewer.h>

Inheritance diagram for SymbolViewer:
Inheritance graph
[legend]
Collaboration diagram for SymbolViewer:
Collaboration graph
[legend]

List of all members.

Public Types

enum  cmd_constant {
  activate,
  deactivate,
  resize
}
 

values that will be passed to the function call operator method.

More...
typedef CursorWindow::input_event input_event
 typename alias
typedef std::list< std::string > paste_buffer_type
 The data type of the paste buffer.
typedef CursorWindow::row_col row_col
 typename alias
typedef CursorWindow::viewport viewport
 Returns true if there are unsaved edit changes in this viewer. the default return value is false. Override this function if your viewer has the ability to have unsaved edit changes -- most don't.

Public Member Functions

void addChild (TreeViewerNode &parent, CppTagDB::SymbolInfo const &)
 Note that the databaseFilename can be either of the following forms:
virtual std::string const & application_name () const
 Return a const references to a string which defines the name of the application being implemented in the viewer. This function must always return the same address and the string at that address must never change;.
void commitPasteBuffer () const
 write the paste buffer to the os clipboard.
virtual std::string description () const
 Get a description of this viewer. Typically, this just returns the name of the directory or the name of the file the viewer is being applied to. However, with FTP viewers, POP3 viewers, etc this may not refer to any real file.
virtual bool fetchAllLines (std::list< std::string > &output)
 An optional method that fetches all the lines in this viewer object into a caller supplied list of strings.
void fetchPasteBuffer ()
 read the paste buffer from the os clipboard
void flatten ()
virtual bool handle_event (CursorWindow::input_event const *e, CursorWindow::viewport *vp)
 Handle input events -- and return true if the event is meant to terminate the viewer -- and make it go away. When handling key events -- either FunctionKey or DataKey, you will want to consult the CursorWindow::func mapping to figure out if the key corresponds to 'system wide' edit function. For example,.
virtual void help ()
 The interface to the help system.
void helpHeader (std::list< std::string > &help_text)
 Add symbol viewer specific help info to the help text list.
virtual bool is_dirty () const
ViewerManagermanager ()
virtual void operator() (CursorWindow::viewport *vp, int cmd)
 Handle screen repaint commands.
paste_buffer_typepaste_buffer ()
 Get a pointer to the viewer manager's paste buffer.
virtual void set_row_col_hint (size_t line, size_t column, bool repaint=false)
 The set_row_col_hint() method lets you specify the location where the cursor should be positioned. It is called a 'hint' because mistakes in the calling parameters are silently ignored. Also, obedience to the hint is optional. The 'repaint' parameter indicates that the screen should be immediately updated to reflect the change.
void setApplicationName (std::string const &name)
void setRootDir (FileName const &dirname)
 Set the root directory for file opens.
 SymbolViewer (ViewerManager *vm, std::string databaseFilename)
TreeViewerNodetopNode ()
 Get pointer to the top node.

Static Public Member Functions

static Viewerapp (ViewerManager *vm, std::string &fullname)
 Application "hook" function for the SymbolViewer class. Use it as a parameter to add_app, like this:

Public Attributes

std::string application_name_

Protected Attributes

ViewerManagermanager_

Private Attributes

CppTagDB::Info database_
FileName databaseName_

Detailed Description

A Viewer for the symbol table stored in a CppTagDB as created by the program, cpptagdb.exe.

Definition at line 68 of file symbolviewer.h.


Member Typedef Documentation

typename alias

Definition at line 192 of file viewer.h.

typedef std::list<std::string> paste_buffer_type [inherited]

The data type of the paste buffer.

Definition at line 194 of file viewer.h.

typedef CursorWindow::row_col row_col [inherited]

typename alias

Definition at line 191 of file viewer.h.

typedef CursorWindow::viewport viewport [inherited]

Returns true if there are unsaved edit changes in this viewer. the default return value is false. Override this function if your viewer has the ability to have unsaved edit changes -- most don't.

typename alias

Definition at line 190 of file viewer.h.


Member Enumeration Documentation

enum cmd_constant [inherited]

values that will be passed to the function call operator method.

Enumerator:
activate 

means you have been activated

deactivate 

some other viewport has taken focus

resize 

only the size has changed

Definition at line 793 of file cursorwindow.h.


Constructor & Destructor Documentation

SymbolViewer ( ViewerManager vm,
std::string  databaseFilename 
)

Definition at line 22 of file symbolviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

void addChild ( TreeViewerNode parent,
CppTagDB::SymbolInfo const &  symbol 
)

Note that the databaseFilename can be either of the following forms:

  • a normal pathname for the host you are running on
  • dir/!.cpptagpp
  • dir/filename.cpptagpp

These formats are interpreted as follows:

  1. Normal pathnames are just files which will be read as if they were C++ source.
  2. dir/!.cpptagpp means that *.h* and *.c* in directory dir will be read as if they were C++ source
  3. dir/file.cpptagpp means to read dir/file as if it were normal C++ source

Definition at line 206 of file symbolviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

Viewer * app ( ViewerManager vm,
std::string &  fullname 
) [static]

Application "hook" function for the SymbolViewer class. Use it as a parameter to add_app, like this:

           vm.add_app(SymbolViewer::app, "CppTagDBViewer");

Reimplemented from TreeViewer.

Definition at line 290 of file symbolviewer.cxx.

Here is the call graph for this function:

std::string const & application_name (  )  const [virtual, inherited]

Return a const references to a string which defines the name of the application being implemented in the viewer. This function must always return the same address and the string at that address must never change;.

Implements Viewer.

Definition at line 1064 of file treeviewer.cxx.

Here is the caller graph for this function:

void commitPasteBuffer (  )  const [inherited]

write the paste buffer to the os clipboard.

Definition at line 625 of file viewer.cxx.

Here is the caller graph for this function:

std::string description (  )  const [virtual, inherited]

Get a description of this viewer. Typically, this just returns the name of the directory or the name of the file the viewer is being applied to. However, with FTP viewers, POP3 viewers, etc this may not refer to any real file.

Implements Viewer.

Definition at line 1077 of file treeviewer.cxx.

bool fetchAllLines ( std::list< std::string > &  output  )  [virtual, inherited]

An optional method that fetches all the lines in this viewer object into a caller supplied list of strings.

Warning:
This is an optional feature, many viewers do not support it.
Parameters:
[out] output The location to store all the lines from this viewer.
Returns:
true to indicate that the data was extracted and false to indicate that this viewer does not support this feature.

Reimplemented in ListViewer.

Definition at line 705 of file viewer.cxx.

Here is the caller graph for this function:

void fetchPasteBuffer (  )  [inherited]

read the paste buffer from the os clipboard

Definition at line 661 of file viewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void flatten (  )  [inherited]

Definition at line 188 of file treeviewer.h.

Here is the call graph for this function:

bool handle_event ( CursorWindow::input_event const *  e,
CursorWindow::viewport vp 
) [virtual, inherited]

Handle input events -- and return true if the event is meant to terminate the viewer -- and make it go away. When handling key events -- either FunctionKey or DataKey, you will want to consult the CursorWindow::func mapping to figure out if the key corresponds to 'system wide' edit function. For example,.

               int edit_func = vp->window()->func[e->value_];
               switch(edit_func)
               {
                  case CursorWindow::func_up:    // the up arrow key

Choose this approach instead of looking at the key values directly to allow for consistence in system wide input remapping that occurs when the application modifies the CursorWindow::func map. Note that the CursorWindow::func_data is returned for all keys not mapped into one of the other named func_* keys.

Usage note: If your handle event creates a new viewport that covers this viewport, make sure that your current viewport doesn't draw anything until the next repaint request. Otherwise, your screen will get very jumbled up!

Implements Viewer.

Definition at line 391 of file treeviewer.cxx.

Here is the call graph for this function:

void help (  )  [virtual, inherited]

The interface to the help system.

Reimplemented from Viewer.

Definition at line 1093 of file treeviewer.cxx.

Here is the call graph for this function:

void helpHeader ( std::list< std::string > &  help_text  )  [virtual]

Add symbol viewer specific help info to the help text list.

Reimplemented from TreeViewer.

Definition at line 302 of file symbolviewer.cxx.

bool is_dirty (  )  const [virtual, inherited]

Reimplemented in TableViewer.

Definition at line 611 of file viewer.cxx.

Here is the caller graph for this function:

ViewerManager* manager (  )  [inherited]

Definition at line 126 of file viewer.h.

Here is the caller graph for this function:

void operator() ( CursorWindow::viewport vp,
int  cmd 
) [virtual, inherited]

Handle screen repaint commands.

Note:
The vp parameter gets deleted regularly, don't save it!

Implements Viewer.

Definition at line 143 of file treeviewer.cxx.

Here is the call graph for this function:

Viewer::paste_buffer_type * paste_buffer (  )  [inherited]

Get a pointer to the viewer manager's paste buffer.

Definition at line 601 of file viewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void set_row_col_hint ( size_t  line,
size_t  column,
bool  repaint = false 
) [virtual, inherited]

The set_row_col_hint() method lets you specify the location where the cursor should be positioned. It is called a 'hint' because mistakes in the calling parameters are silently ignored. Also, obedience to the hint is optional. The 'repaint' parameter indicates that the screen should be immediately updated to reflect the change.

Again, obedience to this function is entirely optional and most viewers will ignore it.

The line and column numbers are 0 base! Contrary to normal user's expectations, so account for this in any input calculations you make.

Definition at line 202 of file viewer.h.

Here is the caller graph for this function:

void setApplicationName ( std::string const &  name  )  [inherited]

Definition at line 451 of file treeviewer.h.

Here is the caller graph for this function:

void setRootDir ( FileName const &  dirname  )  [inherited]

Set the root directory for file opens.

Definition at line 461 of file treeviewer.h.

Here is the caller graph for this function:

TreeViewerNode & topNode (  )  [inherited]

Get pointer to the top node.

Definition at line 405 of file treeviewer.h.

Here is the caller graph for this function:


Member Data Documentation

std::string application_name_ [inherited]

Definition at line 167 of file treeviewer.h.

Definition at line 75 of file symbolviewer.h.

Definition at line 73 of file symbolviewer.h.

ViewerManager* manager_ [protected, inherited]

Definition at line 117 of file viewer.h.


The documentation for this class was generated from the following files:
Generated on Wed Feb 29 22:56:56 2012 for CXXUtilities by  doxygen 1.6.3