/'* \file fb-doc_options.bi
\brief Header file for options

This file contains the declaration of the \ref Options class. It's 
used to scan options and parameters in the command line.

'/

#INCLUDE ONCE "dir.bi"

#DEFINE MSG_LINE(_T_) PRINT SPC(28 - LEN(_T_)); _T_;


/'* \brief File name for callees list '/
CONST CALLEES_FILE = "fb-doc.lfn"

/'* \brief 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.

'/
TYPE Options
Public:

/'* \brief fb-doc operation modes. '/
  ENUM RunModes

/'* \brief Operate as Doxygen filter

Read a file and generate C-source to StdOut. (Default mode). '/
    DOXYFILTER

/'* \brief 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 
\em --fileoutput). '/
    FILE_OUT

/'* \brief 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 \em 
--geany). '/
    GEANYFILTER

/'* \brief Operate in list mode

Read input from one or more files, write output to a single file \em 
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 \em --list). '/
    SCAN_LIST 

/'* \brief Print version information

Print out the version information and stop (Option \em --version). '/
    VERSION_MESSAGE

/'* \brief 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 \em --help). '/
    HELP_MESSAGE
  END ENUM
  
/'* \brief 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 \em --emitter. The parameter 
gets checked against the EmitterIF::Nam string (or parts of it). '/
  ENUM EmitterTypes
    C_SOURCE          '*< emit pseudo C source (default and option \em --fileoutput)
    DOXYGEN_CALLEES   '*< emit a list of callees for Doxygen (option \em --list)
    GTK_DOC_TEMPLATES '*< emit templates for gtk-doc (option \em --geany gtk)
    DOXYGEN_TEMPLATES '*< emit templates for Doxygen (option \em --geany doxy)
  END ENUM
  
  
/'* \brief 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. '/
  ENUM TypesStyle
    C_STYLE  '*< types gets translated to C
    FB_STYLE '*< pseudo FB types are used
  END ENUM

/'* \brief The style of the documentation output in the C source '/
  ENUM BackEnds
    DOXYGEN  '*< emit multi line comments as-is (no leading * )
    GTK_DOC  '*< emit multi line comments with a leading * for each line
  END ENUM

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

  DECLARE CONSTRUCTOR()
  DECLARE DESTRUCTOR()
  DECLARE SUB chooseEmitter(BYREF AS INTEGER)
  DECLARE SUB Pattern()
  DECLARE FUNCTION checkDir(BYREF P AS STRING) AS INTEGER
END TYPE


/'* \brief The global struct for all parameters red from the command line '/
DIM SHARED AS Options PTR OPT
