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

Go to the source code of this file.

Macros

#define LINE_BUFFER_SIZE   1000
 
#define SEP   '@'
 

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)
 
template void DisposeOfImportRecord (CCCC_Module *record_ptr, int fromfile_status)
 
template void DisposeOfImportRecord (CCCC_Member *record_ptr, int fromfile_status)
 
template void DisposeOfImportRecord (CCCC_UseRelationship *record_ptr, int fromfile_status)
 
template void DisposeOfImportRecord (CCCC_Extent *record_ptr, int fromfile_status)
 

Variables

CCCC_Projectcurrent_loading_project =NULL
 
CCCC_Modulecurrent_loading_module =NULL
 
CCCC_Membercurrent_loading_extent =NULL
 
CCCC_UseRelationshipcurrent_loading_userel =NULL
 
int ifstr_line
 
CCCC_Projectprj
 
static string last_supplier =""
 

Macro Definition Documentation

#define LINE_BUFFER_SIZE   1000

Definition at line 30 of file cccc_db.cc.

#define SEP   '@'

Definition at line 44 of file cccc_db.cc.

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:

template void DisposeOfImportRecord ( CCCC_Module record_ptr,
int  fromfile_status 
)
template void DisposeOfImportRecord ( CCCC_Member record_ptr,
int  fromfile_status 
)
template void DisposeOfImportRecord ( CCCC_UseRelationship record_ptr,
int  fromfile_status 
)
template void DisposeOfImportRecord ( CCCC_Extent record_ptr,
int  fromfile_status 
)
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 =NULL

Definition at line 27 of file cccc_db.cc.

CCCC_Module* current_loading_module =NULL

Definition at line 26 of file cccc_db.cc.

CCCC_Project* current_loading_project =NULL

Definition at line 25 of file cccc_db.cc.

CCCC_UseRelationship* current_loading_userel =NULL

Definition at line 28 of file cccc_db.cc.

int ifstr_line

Definition at line 32 of file cccc_db.cc.

string last_supplier =""
static

Definition at line 40 of file cccc_db.cc.

Definition at line 49 of file ccccmain.cc.