| fb-doc 0.2 documentation tool for FreeBasic

- Main Page
- Tutorial
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Data Fields

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Data Fields
Options Class Reference

Parameters red from the command line. More...

Collaboration diagram for Options:
[legend]

## Public Types

enum | RunModes { DOXYFILTER, FILE_OUT, GEANYFILTER, SCAN_LIST, VERSION_MESSAGE, HELP_MESSAGE }
| fb-doc operation modes. More...
enum | EmitterTypes { C_SOURCE, DOXYGEN_CALLEES, GTK_DOC_TEMPLATES, DOXYGEN_TEMPLATES }
| In-build emitters. More...
enum | TypesStyle { C_STYLE, FB_STYLE }
| The style of the types in the C source. More...
enum | BackEnds { DOXYGEN, GTK_DOC }
| The style of the documentation output in the C source. More...

## Public Member Functions

| Options ()
| Read options and parameters from the command line. More...
| ~Options ()
| The destructor. More...
SUB | chooseEmitter (BYREF_AS_INTEGER)
| Check next parameter for emitter name. More...
SUB | Pattern ()
| Operate on all files matching a pattern. More...
FUNCTION_AS_INTEGER | checkDir (BYREF_AS_STRING P)
| Create folder (if not exists) More...

## Data Fields

enum Options::RunModes | RunModes
enum Options::EmitterTypes | EmitterTypes
enum Options::TypesStyle | TypesStyle
enum Options::BackEnds | BackEnds
RunModes | RunMode = DOXYFILTER
| the mode how we operate (DOXYFILTER is default) More...
BackEnds | Asterix = DOXYGEN
| the style how the emitter should export comment blocks (DOXYGEN is default) More...
TypesStyle | Types = FB_STYLE
| the style for the type generation (FB_STYLE is default) More...
Parser_PTR | Pars = 0
| the parser we use More...
EmitterIF_PTR | EmitIF = Emitters(C_SOURCE)
| the emitter we use (C_source is default) More...
ANY_PTR | DllEmitter = 0
| the pointer for an external emitter More...
STRING | EmitFile = "emit.txt"
| the file name for the template for empty blocks (use in –geany) More...
STRING | InFile = ""
| name or pattern of input file[s] More...
STRING | Callees = ""
| names of SUBs, FUNCTIONs and PROPERTYs More...
STRING | InPattern = ""
| pattern for input files More...
STRING | OutPath = ""
| path for file output (option –path) More...
INTEGER | AllCallees = 0
| export external callee names as well (option –list) More...
INTEGER | InRecursiv = 0
| flag set when InFile should get scaned recursiv More...
INTEGER | InTree = 0
| flag set when InFile should get scaned recursiv More...
INTEGER | OutFiles = 0
| flag set when output should be written to files More...
UBYTE | JoComm = ASC("*")
| the character to start a documentation comment More...
UBYTE | AdLine = ASC("&")
| the character to start a comment for export More...
EmitFunc | Function_
| emitter for a function declaration with parameter list More...
EmitFunc | Variable_
| emitter for a variable declaration More...

## Detailed Description

Parameters red from the command line.

The class to scan options and parameters from command line. the command line gets parsed once at the program start. Since this structure is global, the settings are available in all internal modules.

Definition at line 25 of file fb-doc_options.bi.

## Member Enumeration Documentation

enum RunModes

fb-doc operation modes.

Enumerator
DOXYFILTER | Operate as Doxygen filter. Read a file and generate C-source to StdOut. (Default mode).
FILE_OUT | Operate in scan mode. Read input from one or more files, write output to files. Usually this is to generate pseudo C source output, but an alternative emitter can be specified. When no file name or pattern is specified, all *.bas and *.bi files in the current folder gets parsed. (Option –fileoutput).
GEANYFILTER | Operate as Geany filter. Read from StdIn and output on StdOut. Usually this is to generate templates in Geany, but it also can be used with pipes. (Option –geany).
SCAN_LIST | Operate in list mode. Read input from one or more files, write output to a single file fb-doc.lfn. Generate a list of callee names in this file. When no file name or patter is specified, all *.bas and *.bi files in the current folder gets parsed. (Option –list).
VERSION_MESSAGE | Print version information. Print out the version information and stop (Option –version).
HELP_MESSAGE | Print the helptext. Stop after printing out some help information on how to start fb-doc and how to use options at the command line. (Option –help).

Definition at line 29 of file fb-doc_options.bi.

enum EmitterTypes

In-build emitters.

By default these four emitters are available in fb-doc. The enumerators are used for default settings in the Options class. The user can choose the emitter by option –emitter. The parameter gets checked against the EmitterIF::Nam string (or parts of it).

Enumerator
C_SOURCE | emit pseudo C source (default and option –fileoutput)
DOXYGEN_CALLEES | emit a list of callees for Doxygen (option –list)
GTK_DOC_TEMPLATES | emit templates for gtk-doc (option –geany gtk)
DOXYGEN_TEMPLATES | emit templates for Doxygen (option –geany doxy)

Definition at line 78 of file fb-doc_options.bi.

enum TypesStyle

The style of the types in the C source.

A FB type can be translated to a C type or it can be shown as a pseudo type. Ie instead of the C type void the pseudo type SUB can be used.

Enumerator
C_STYLE | types gets translated to C
FB_STYLE | pseudo FB types are used

Definition at line 91 of file fb-doc_options.bi.

enum BackEnds

The style of the documentation output in the C source.

Enumerator
DOXYGEN | emit multi line comments as-is (no leading * )
GTK_DOC | emit multi line comments with a leading * for each line

Definition at line 97 of file fb-doc_options.bi.

## Constructor & Destructor Documentation

Options | ( | ) |  |

Read options and parameters from the command line.

The constructor scans all command line arguments and checks for options and their parameters (, see Options for details). Options may be specified in short form (starting with a single minus character) or in human readable long form (starting with two minus characters). Some options max have an additinal parameter.

Each command line argument that is neither an option nor a parameter gets interpreted as a file name or pattern. fb-doc collects them in a queue and operates on this queue afterwards. The queue may have mixed entries (names and patterns). It's recommended to specify queue entries in single or double quotes.

Definition at line 27 of file fb-doc_options.bas.

Here is the call graph for this function:

~Options | ( | ) |  |

The destructor.

Delete the memory used for an external emitter (if any) and for the Parser.

Definition at line 91 of file fb-doc_options.bas.

## Member Function Documentation

SUB chooseEmitter | ( | BYREF_AS_INTEGER | I) |  |

Check next parameter for emitter name.

Parameters

  I | the index of the current parameter

This function checks the following command line parameter (I + 1) against the names of the internal emitters. The check is not case-sensitve and is done for a fragment as well, so it's enough to specify some of the start characters of the emitter name (ie dox instead of DoxygenTemplates).

In case of no match it tries to load an external emitter.

In case of a match of an internal or external emitter the index gets increased.

Definition at line 112 of file fb-doc_options.bas.

Here is the caller graph for this function:

SUB Pattern | ( | ) |  |

Operate on all files matching a pattern.

In case of file input this SUB scans a directory for matching file names (and its subfolders if option –recursiv is given). It opens the output file (when option –fileoutput is given) and calls the Parser to operate on the file.

Definition at line 171 of file fb-doc_options.bas.

Here is the call graph for this function:

Here is the caller graph for this function:

FUNCTION_AS_INTEGER checkDir | ( | BYREF_AS_STRING | P) |  |

Create folder (if not exists)

Parameters

  P | the folder name

Returns
  -1 on error, else 0

This SUB gets called when a recursiv scan walks through subfolders in a source tree. It creates matching subfolders in the target directory for the output files.

Definition at line 146 of file fb-doc_options.bas.

Here is the caller graph for this function:

## Field Documentation

enum Options::RunModes RunModes

enum Options::EmitterTypes EmitterTypes

enum Options::TypesStyle TypesStyle

enum Options::BackEnds BackEnds

RunModes RunMode = DOXYFILTER

the mode how we operate (DOXYFILTER is default)

Definition at line 102 of file fb-doc_options.bi.

BackEnds Asterix = DOXYGEN

the style how the emitter should export comment blocks (DOXYGEN is default)

Definition at line 103 of file fb-doc_options.bi.

TypesStyle Types = FB_STYLE

the style for the type generation (FB_STYLE is default)

Definition at line 104 of file fb-doc_options.bi.

Parser_PTR Pars = 0

the parser we use

Definition at line 105 of file fb-doc_options.bi.

EmitterIF_PTR EmitIF = Emitters(C_SOURCE)

the emitter we use (C_source is default)

Definition at line 106 of file fb-doc_options.bi.

ANY_PTR DllEmitter = 0

the pointer for an external emitter

Definition at line 107 of file fb-doc_options.bi.

STRING EmitFile = "emit.txt"

the file name for the template for empty blocks (use in –geany)

Definition at line 108 of file fb-doc_options.bi.

STRING InFile = ""

name or pattern of input file[s]

Definition at line 109 of file fb-doc_options.bi.

STRING Callees = ""

names of SUBs, FUNCTIONs and PROPERTYs

Definition at line 110 of file fb-doc_options.bi.

STRING InPattern = ""

pattern for input files

Definition at line 111 of file fb-doc_options.bi.

STRING OutPath = ""

path for file output (option –path)

Definition at line 112 of file fb-doc_options.bi.

INTEGER AllCallees = 0

export external callee names as well (option –list)

Definition at line 113 of file fb-doc_options.bi.

INTEGER InRecursiv = 0

flag set when InFile should get scaned recursiv

Definition at line 114 of file fb-doc_options.bi.

INTEGER InTree = 0

flag set when InFile should get scaned recursiv

Definition at line 115 of file fb-doc_options.bi.

INTEGER OutFiles = 0

flag set when output should be written to files

Definition at line 116 of file fb-doc_options.bi.

UBYTE JoComm = ASC("*")

the character to start a documentation comment

Definition at line 117 of file fb-doc_options.bi.

UBYTE AdLine = ASC("&")

the character to start a comment for export

Definition at line 118 of file fb-doc_options.bi.

EmitFunc Function_

emitter for a function declaration with parameter list

Definition at line 120 of file fb-doc_options.bi.

EmitFunc Variable_

emitter for a variable declaration

Definition at line 120 of file fb-doc_options.bi.

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

- fb-doc_options.bi
- fb-doc_options.bas