CCCC - C and C++ Code Counter  9999-git
CCCC Development version (post-3.1.4)
Enumerations | Functions | Variables
cccc_db.h File Reference
#include "cccc.h"
#include "cccc_ext.h"
#include "cccc_rec.h"
#include "cccc_prj.h"
#include "cccc_mod.h"
#include "cccc_mem.h"
#include "cccc_use.h"
Include dependency graph for cccc_db.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  GeneralFromFileStatuses { RECORD_TRANSCRIBED = 0, RECORD_ADDED = 1, RECORD_ERROR = 2 }
 

Functions

bool PeekAtNextLinePrefix (ifstream &ifstr, string pfx)
 
template<class T >
void DisposeOfImportRecord (T *record_ptr, int fromfile_status)
 
void Resolve_Fields (string &field1, string &field2)
 

Variables

CCCC_Projectcurrent_loading_project
 
CCCC_Modulecurrent_loading_module
 
CCCC_Membercurrent_loading_extent
 
CCCC_UseRelationshipcurrent_loading_userel
 
int ifstr_line
 

Enumeration Type Documentation

Enumerator
RECORD_TRANSCRIBED 
RECORD_ADDED 
RECORD_ERROR 

Definition at line 45 of file cccc_db.h.

46 {
48  RECORD_ADDED = 1,
49  RECORD_ERROR = 2
50  // error conditions may return RECORD_ERROR, or may use a distinctive
51  // value defined as a literal
52 };

Function Documentation

template<class T >
void DisposeOfImportRecord ( T *  record_ptr,
int  fromfile_status 
)

Definition at line 66 of file cccc_db.cc.

67 {
68  switch(fromfile_status)
69  {
70  case RECORD_ADDED:
71  // the newly created object has been added to the
72  // database
73  // we must not delete it
74  break;
75 
76  case RECORD_TRANSCRIBED:
77  // the database already had an object for this item
78  // the content of the new object was merged in, but the object
79  // itself is no longer required
80  delete record_ptr;
81  break;
82 
83  default:
84  // something went wrong, so we mention it
85  cerr << "Import error " << fromfile_status
86  << " at line " << ifstr_line
87  << " for " << record_ptr->key()
88  << endl;
89  delete record_ptr;
90  }
91 }
int ifstr_line
Definition: cccc_db.cc:32

Here is the caller graph for this function:

bool PeekAtNextLinePrefix ( ifstream &  ifstr,
string  pfx 
)

Definition at line 51 of file cccc_db.cc.

52 {
53  bool retval=false;
54  char prefix_buffer[1024];
55  size_t initial_stream_pos=ifstr.tellg();
56  ifstr.getline(prefix_buffer,1023,SEP);
57  if(pfx==prefix_buffer)
58  {
59  retval=true;
60  }
61  ifstr.seekg(initial_stream_pos);
62  return retval;
63 }
#define SEP
Definition: cccc_db.cc:44

Here is the caller graph for this function:

void Resolve_Fields ( string &  field1,
string &  field2 
)

Definition at line 105 of file cccc_db.cc.

106 {
107  if(field1.size()==0)
108  {
109  field1=field2;
110  }
111 }

Here is the caller graph for this function:

Variable Documentation

CCCC_Member* current_loading_extent

Definition at line 27 of file cccc_db.cc.

CCCC_Module* current_loading_module

Definition at line 26 of file cccc_db.cc.

CCCC_Project* current_loading_project

Definition at line 25 of file cccc_db.cc.

CCCC_UseRelationship* current_loading_userel

Definition at line 28 of file cccc_db.cc.

int ifstr_line

Definition at line 32 of file cccc_db.cc.