coan  6.0.1
A C/C++ Configuration Analyzer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
directive_base Struct Reference

template struct directive_base is a base for specializations of template struct directive<Type> More...

#include <directive.h>

Inheritance diagram for directive_base:
no_copy directive< Type > directive< HASH_INCLUDE >

Static Public Member Functions

static line_type eval (std::string keyword, chewer< parse_buffer > &chew)
 Evaluate a directive. More...
 
static void erase_all ()
 Forget all directives table used by the operative command.
 

Static Protected Member Functions

static void report (std::string const &keyword, std::string const &arg)
 Report a directive. More...
 
static void report (bool seen, std::string const &keyword, std::string const &arg)
 Report a directive. More...
 
static line_type eval (directive_type type, chewer< parse_buffer > &chew)
 Evaluate a directive. More...
 
static line_type eval_ifdef_or_ifndef (directive_type type, chewer< parse_buffer > &chew)
 Evaluate an #ifdef or #ifndef directive. More...
 

Private Types

using evaluator = line_type(*)(chewer< parse_buffer > &)
 Type of evaluation functions applied to directive bodies.
 

Static Private Member Functions

static directive_type get_type (std::string const &keyword)
 Get the directive_type of a directive given a keyword.
 

Static Private Attributes

static std::map< std::string,
directive_type
_keyword_to_type_map_
 Map from keywords to directive types.
 
static std::vector< evaluator_evaluator_tab_
 Table of evaluation functions for directive types, indexed by directive_type.
 

Detailed Description

template struct directive_base is a base for specializations of template struct directive<Type>

Definition at line 54 of file directive.h.

Member Function Documentation

static line_type directive_base::eval ( std::string  keyword,
chewer< parse_buffer > &  chew 
)
inlinestatic

Evaluate a directive.

Parameters
keywordThe keyword indicating the directive type.
chewOn entry, a chewer<parse_buffer> positioned to the offset in the associated parse_buffer from which to to scan. On return receives chew is positioned to the first offset not consumed.
Returns
A line_type determined by evaluation denoting the action to be taken on this line.

Definition at line 65 of file directive.h.

static line_type directive_base::eval ( directive_type  type,
chewer< parse_buffer > &  chew 
)
staticprotected

Evaluate a directive.

Parameters
typeThe directive_type of the directive.
chewOn entry, a chewer<parse_buffer> positioned to the offset in the associated parse_buffer from which to scan. On return chew is positioned to the first offset not consumed.
Returns
A line_type determined by evaluation.
static line_type directive_base::eval_ifdef_or_ifndef ( directive_type  type,
chewer< parse_buffer > &  chew 
)
staticprotected

Evaluate an #ifdef or #ifndef directive.

Parameters
typeThe directive_type of the directive.
chewOn entry, a chewer<parse_buffer> positioned to the offset in the associated parse_buffer from which to scan. On return chew is positioned to the first offset not consumed.
Returns
A line_type determined by evaluation.
static void directive_base::report ( std::string const &  keyword,
std::string const &  arg 
)
staticprotected

Report a directive.

Parameters
keywordThe keyword indicating the directive type.
argThe body of the directive.
static void directive_base::report ( bool  seen,
std::string const &  keyword,
std::string const &  arg 
)
staticprotected

Report a directive.

Parameters
seenHas this directive already been seen?
keywordThe keyword indicating the directive type.
argThe body of the directive.

The member function reports the directive if it has not already been seen or if option --once-only is not in effect.


The documentation for this struct was generated from the following file: