CCCC - C and C++ Code Counter  9999-git
CCCC Development version (post-3.1.4)
cccc_rec.h
Go to the documentation of this file.
1 /*
2  CCCC - C and C++ Code Counter
3  Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com)
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 /*
20  * cccc_rec.h
21  *
22  * defines the database used by CCCC to generate a report
23  */
24 #ifndef CCCC_REC_H
25 #define CCCC_REC_H
26 
27 #include "cccc_tbl.h"
28 #include "cccc_ext.h"
29 #include "cccc_utl.h"
30 
31 // The entities held within the database need to be able to return a variety
32 // of kinds of name including a simple name (typically one word), a fully
33 // qualified local name (i.e as used within a class), and a fully
34 // qualified global name.
35 // Subclasses may also have particular other names, which should be defined
36 // using negative indexes.
39 {
40  friend class CCCC_Html_Stream;
41  friend class CCCC_Xml_Stream;
43  protected:
45  Extent_Table extent_table;
46  string flags;
47  virtual void merge_flags(string& new_flags);
48  public:
49  virtual ~CCCC_Record() {}
50  virtual string name(int level) const;
51  virtual string key() const;
52  AugmentedBool get_flag(PSFlag psf) { return (AugmentedBool) flags[psf]; }
53 
54  virtual void add_extent(CCCC_Item&);
55  virtual void sort() { extent_table.sort(); }
56  virtual int get_count(const char *count_tag)=0;
57  friend int rank_by_string(const void *p1, const void *p2);
59  static void set_active_project(CCCC_Project* prj);
60 };
61 
62 
63 
64 #endif // CCCC_REC_H
65 
66 
67 
68 
69 
70 
void sort()
Definition: cccc_tbl.cc:105
NameLevel
Definition: cccc_rec.h:37
virtual int get_count(const char *count_tag)=0
virtual string name(int level) const
Definition: cccc_rec.cc:75
virtual string key() const
Definition: cccc_rec.cc:76
virtual void sort()
Definition: cccc_rec.h:55
static CCCC_Project * get_active_project()
Definition: cccc_rec.cc:28
virtual ~CCCC_Record()
Definition: cccc_rec.h:49
CCCC_Project * prj
Definition: ccccmain.cc:49
AugmentedBool get_flag(PSFlag psf)
Definition: cccc_rec.h:52
Extent_Table extent_table
Definition: cccc_rec.h:45
static void set_active_project(CCCC_Project *prj)
Definition: cccc_rec.cc:29
CCCC_Table< CCCC_Extent > Extent_Table
Definition: cccc_rec.h:44
virtual void merge_flags(string &new_flags)
Definition: cccc_rec.cc:31
friend int rank_by_string(const void *p1, const void *p2)
PSFlag
Definition: cccc_utl.h:98
AugmentedBool
Definition: cccc_utl.h:59
static CCCC_Project * active_project
Definition: cccc_rec.h:42
string flags
Definition: cccc_rec.h:46
virtual void add_extent(CCCC_Item &)
Definition: cccc_rec.cc:63