CCCC - C and C++ Code Counter  9999-git
CCCC Development version (post-3.1.4)
cccc_db.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_db.h
21  */
22 #ifndef CCCC_DB_H
23 #define CCCC_DB_H
24 
25 #include "cccc.h"
26 #include "cccc_ext.h"
27 #include "cccc_rec.h"
28 #include "cccc_prj.h"
29 #include "cccc_mod.h"
30 #include "cccc_mem.h"
31 #include "cccc_use.h"
32 
33 // The various FromFile functions need to indicate to their
34 // caller their status, particularly because the caller will have
35 // allocated an instance of the incoming class on the heap, and needs
36 // to know whether it has to delete it. There are two 'normal' outcomes
37 // plus a potentially infinite range of possible application error
38 // conditions. The normal conditions are where the new instance is
39 // the first encountered of this module/member/relationship/whatever
40 // and the allocated item has been added to the database and must not
41 // be deleted, and when the new instance is of a previously encountered
42 // entity, and the information from the new record has been transcribed
43 // and merged into the instance in the database, and the locally allocated
44 // instance must be deleted.
46 {
50  // error conditions may return RECORD_ERROR, or may use a distinctive
51  // value defined as a literal
52 };
53 
54 // This function provides the ability for the persistence functions
55 // defined below to do a quick peek at the first token on the stream
56 // leaving the get pointer at the start of that token.
57 bool PeekAtNextLinePrefix(ifstream& ifstr, string pfx);
58 
59 
60 
61 // These are global variables because I don't want to have
62 // to pass the project, module, member, relationship down into all of the
63 // FromFile methods.
64 // There is probably a better way for a less lazy programmer than me.
69 
70 // this one tracks the line number in the input file
71 extern int ifstr_line;
72 
73 template <class T> void DisposeOfImportRecord(T *record_ptr, int fromfile_status);
74 
75 void Resolve_Fields(string& field1, string& field2);
76 
77 
78 #endif // CCCC_DB_H
79 
80 
81 
CCCC_Module * current_loading_module
Definition: cccc_db.cc:26
CCCC_UseRelationship * current_loading_userel
Definition: cccc_db.cc:28
bool PeekAtNextLinePrefix(ifstream &ifstr, string pfx)
Definition: cccc_db.cc:51
CCCC_Project * current_loading_project
Definition: cccc_db.cc:25
void DisposeOfImportRecord(T *record_ptr, int fromfile_status)
Definition: cccc_db.cc:66
GeneralFromFileStatuses
Definition: cccc_db.h:45
CCCC_Member * current_loading_extent
Definition: cccc_db.cc:27
int ifstr_line
Definition: cccc_db.cc:32
void Resolve_Fields(string &field1, string &field2)
Definition: cccc_db.cc:105