StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StDbXmlReader.h
1 /***************************************************************************
2  *
3  * $Id: StDbXmlReader.h,v 1.10 2016/05/25 20:17:51 dmitry Exp $
4  *
5  * Author: R. Jeff Porter
6  ***************************************************************************
7  *
8  * Description: implement typeAcceptor for READING XML files of DB-tables
9  *
10  ***************************************************************************
11  *
12  * $Log: StDbXmlReader.h,v $
13  * Revision 1.10 2016/05/25 20:17:51 dmitry
14  * coverity - uninit ctor
15  *
16  * Revision 1.9 2004/01/15 00:02:25 fisyak
17  * Replace ostringstream => StString, add option for alpha
18  *
19  * Revision 1.8 2003/09/16 22:44:18 porter
20  * got rid of all ostrstream objects; replaced with StString+string.
21  * modified rules.make and added file stdb_streams.h for standalone compilation
22  *
23  * Revision 1.7 2003/09/02 17:57:50 perev
24  * gcc 3.2 updates + WarnOff
25  *
26  * Revision 1.6 2001/10/24 04:05:20 porter
27  * added long long type to I/O and got rid of obsolete dataIndex table
28  *
29  * Revision 1.5 2001/02/09 23:06:25 porter
30  * replaced ostrstream into a buffer with ostrstream creating the
31  * buffer. The former somehow clashed on Solaris with CC5 iostream (current .dev)
32  *
33  * Revision 1.4 2000/01/10 20:37:55 porter
34  * expanded functionality based on planned additions or feedback from Online work.
35  * update includes:
36  * 1. basis for real transaction model with roll-back
37  * 2. limited SQL access via the manager for run-log & tagDb
38  * 3. balance obtained between enumerated & string access to databases
39  * 4. 3-levels of diagnostic output: Quiet, Normal, Verbose
40  * 5. restructured Node model for better XML support
41  *
42  * Revision 1.3 1999/12/03 17:03:24 porter
43  * added multi-row support for the Xml reader & writer
44  *
45  * Revision 1.2 1999/09/30 02:06:12 porter
46  * add StDbTime to better handle timestamps, modify SQL content (mysqlAccessor)
47  * allow multiple rows (StDbTable), & Added the comment sections at top of
48  * each header and src file
49  *
50  **************************************************************************/
51 #ifndef STDBXmlReader_HH
52 #define STDBXmlReader_HH
53 #include <stdlib.h>
54 #include <string.h>
55 
56 #include "typeAcceptor.hh"
57 #include "stdb_streams.h"
58 
59 
60 class dbTable;
61 class elem;
62 class accessor;
63 
64 class StDbXmlReader : public typeAcceptor {
65 
66 protected:
67 
68 
69  char* loca[20024];
70  dbTable* tab = 0;
71  int maxlines = 0;
72 
73  void buildDbTable();
74  void buildStruct();
75  void fillElements(accessor* a);
76  elem* findElement(char* name);
77 
78 public:
79 
80  StDbXmlReader();
81  // StDbXmlReader(ofstream& ofs){ os=&ofs;};
82  virtual ~StDbXmlReader();
83 
84  void readTable(ifstream &is);
85 
86  virtual void pass(char* name, short& i, int& len) ;
87  virtual void pass(char* name, int& i, int& len);
88  virtual void pass(char* name, long& i, int& len);
89  virtual void pass(char* name, unsigned short& i, int& len) ;
90  virtual void pass(char* name, unsigned int& i, int& len) ;
91  virtual void pass(char* name, unsigned long& i, int& len) ;
92  virtual void pass(char* name, long long& i, int& len) ;
93 
94  virtual void pass(char* name, float& i, int& len);
95  virtual void pass(char* name, double& i, int& len);
96  virtual void pass(char* name, char*& i, int& len);
97  virtual void pass(char* name, unsigned char& i, int& len) ;
98  virtual void pass(char* name, unsigned char*& i, int& len) ;
99  virtual void pass(char* name, short*& i, int& len) ;
100  virtual void pass(char* name, int*& i, int& len);
101  virtual void pass(char* name, long*& i, int& len);
102  virtual void pass(char* name, unsigned short*& i, int& len) ;
103  virtual void pass(char* name, unsigned int*& i, int& len) ;
104  virtual void pass(char* name, unsigned long*& i, int& len) ;
105  virtual void pass(char* name, long long*& i, int& len) ;
106  virtual void pass(char* name, float*& i, int& len);
107  virtual void pass(char* name, double*& i, int& len);
108 
109  //ClassDef(StDbXmlReader,1)
110 
111 };
112 
113 #endif
114 
115 
116 
117 
118 
119 
Definition: dbStruct.hh:78