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