1 // cccc_itm.h 2 #ifndef __CCCC_ITM_H 3 #define __CCCC_ITM_H 4 5 #include "cccc.h" 6 7 // Class CCCC_Item is a wrapper for a C++ standard string which allows 8 // insertion and extraction of fields using a standard delimiter. 9 // It is intended for use in the following contexts: 10 // 1. for transmission of extent information from the parser to the database 11 // 2. for transmission of option information from the main line to the database 12 // 3. for storage from the database to a flat file 13 // 4. for reloading from a flat file to the database. 14 15 class CCCC_Item 16 { 17 private: 18 char delimiter; 19 string buffer; 20 bool good; 21 22 public: 23 CCCC_Item(const string& s, char c); 24 CCCC_Item(const string& s); 25 CCCC_Item(); 26 27 bool Insert(const string& s); 28 bool Insert(const char* cptr); 29 bool Extract(string& s); 30 bool Insert(int n); 31 bool Extract(int& n); 32 bool Insert(char c); 33 bool Extract(char& c); 34 bool Insert(float f); 35 bool Extract(float& f); 36 37 bool ToFile(ofstream& ofstr); 38 bool FromFile(ifstream& ifstr); 39 }; 40 41 #endif 42 43 44 45