CCCC - C and C++ Code Counter  9999-git
CCCC Development version (post-3.1.4)
Typedefs | Functions | Variables
cccc_opt.cc File Reference
#include "cccc.h"
#include <fstream>
#include "cccc_opt.h"
#include "cccc_utl.h"
#include "cccc_met.h"
#include <map>
Include dependency graph for cccc_opt.cc:

Go to the source code of this file.

Typedefs

typedef std::map< string, string > file_extension_language_map_t
 
typedef std::map< string, Metric_Treatment * > metric_treatment_map_t
 
typedef std::pair< string, string > dialect_keyword_t
 
typedef std::map< dialect_keyword_t, string > dialect_keyword_map_t
 

Functions

static void add_file_extension (CCCC_Item &fileext_line)
 
void add_treatment (CCCC_Item &treatment_line)
 
static void add_dialect_keyword (CCCC_Item &dialect_keyword_line)
 

Variables

static file_extension_language_map_t extension_map
 
static metric_treatment_map_t treatment_map
 
static dialect_keyword_map_t dialect_keyword_map
 
const char * default_fileext_options []
 
const char * default_treatment_options []
 
const char * default_dialect_options []
 

Typedef Documentation

typedef std::map<dialect_keyword_t,string> dialect_keyword_map_t

Definition at line 32 of file cccc_opt.cc.

typedef std::pair<string,string> dialect_keyword_t

Definition at line 31 of file cccc_opt.cc.

typedef std::map<string,string> file_extension_language_map_t

Definition at line 29 of file cccc_opt.cc.

typedef std::map<string,Metric_Treatment*> metric_treatment_map_t

Definition at line 30 of file cccc_opt.cc.

Function Documentation

static void add_dialect_keyword ( CCCC_Item dialect_keyword_line)
static

Definition at line 75 of file cccc_opt.cc.

76 {
77  string dialect, keyword, policy;
78  if(
79  dialect_keyword_line.Extract(dialect) &&
80  dialect_keyword_line.Extract(keyword) &&
81  dialect_keyword_line.Extract(policy)
82  )
83  {
84  dialect_keyword_map_t::key_type kt(dialect,keyword);
85  dialect_keyword_map_t::value_type vt(kt,policy);
86  dialect_keyword_map.insert(vt);
87  }
88 }
bool Extract(string &s)
Definition: cccc_itm.cc:47
static dialect_keyword_map_t dialect_keyword_map
Definition: cccc_opt.cc:36

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_file_extension ( CCCC_Item fileext_line)
static

Definition at line 43 of file cccc_opt.cc.

44 {
45  string ext, lang;
46  if(
47  fileext_line.Extract(ext) &&
48  fileext_line.Extract(lang)
49  )
50  {
51  file_extension_language_map_t::value_type extension_pair(ext,lang);
52  extension_map.insert(extension_pair);
53  }
54 }
static file_extension_language_map_t extension_map
Definition: cccc_opt.cc:34
bool Extract(string &s)
Definition: cccc_itm.cc:47

Here is the call graph for this function:

Here is the caller graph for this function:

void add_treatment ( CCCC_Item treatment_line)

Definition at line 56 of file cccc_opt.cc.

57 {
58  Metric_Treatment *new_treatment=new Metric_Treatment(treatment_line);
59  metric_treatment_map_t::iterator iter=
60  treatment_map.find(new_treatment->code);
61 
62  if(iter!=treatment_map.end())
63  {
64  delete (*iter).second;
65  (*iter).second=new_treatment;
66  }
67  else
68  {
69  metric_treatment_map_t::value_type
70  treatment_pair(new_treatment->code,new_treatment);
71  treatment_map.insert(treatment_pair);
72  }
73 }
static metric_treatment_map_t treatment_map
Definition: cccc_opt.cc:35

Here is the caller graph for this function:

Variable Documentation

const char * default_dialect_options
Initial value:
=
{
"c++.mfc@BEGIN_MESSAGE_MAP@start_skipping@",
"c++.mfc@END_MESSAGE_MAP@stop_skipping@",
"c++.stl@__STL_BEGIN_NAMESPACE@ignore@",
"c++.stl@__STL_END_NAMESPACE@ignore@",
NULL
}

Definition at line 391 of file cccc_opt.cc.

const char * default_fileext_options

Definition at line 277 of file cccc_opt.cc.

const char * default_treatment_options

Definition at line 325 of file cccc_opt.cc.

dialect_keyword_map_t dialect_keyword_map
static

Definition at line 36 of file cccc_opt.cc.

file_extension_language_map_t extension_map
static

Definition at line 34 of file cccc_opt.cc.

metric_treatment_map_t treatment_map
static

Definition at line 35 of file cccc_opt.cc.