#include <DbiOutRowStream.h>
Inheritance diagram for DbiOutRowStream:

Public Member Functions | |
| DbiOutRowStream (const DbiTableMetaData *metaData) | |
| virtual | ~DbiOutRowStream () |
| Bool_t | HasGoodData () const |
| const string & | GetCSV () const |
| Bool_t | IsComplete () const |
| DbiOutRowStream & | operator<< (Bool_t src) |
| DbiOutRowStream & | operator<< (Char_t src) |
| DbiOutRowStream & | operator<< (const Char_t *src) |
| DbiOutRowStream & | operator<< (Short_t src) |
| DbiOutRowStream & | operator<< (UShort_t src) |
| DbiOutRowStream & | operator<< (Int_t src) |
| DbiOutRowStream & | operator<< (UInt_t src) |
| DbiOutRowStream & | operator<< (Float_t src) |
| DbiOutRowStream & | operator<< (Double_t src) |
| DbiOutRowStream & | operator<< (const string &src) |
| DbiOutRowStream & | operator<< (const VldTimeStamp &src) |
| void | Clear () |
Private Member Functions | |
| void | Store (const string &str) |
| Bool_t | StoreDefaultIfInvalid (Dbi::DataTypes type) |
Private Attributes | |
| Bool_t | fBadData |
| Set KTRUE if streamed bad data. | |
| string | fCSV |
| Comma separated list of values. | |
Friends | |
| class | DbiConfigSet |
DatabaseInterface
Contact: n.west1@physics.ox.ac.uk
Definition at line 35 of file DbiOutRowStream.h.
|
|
Definition at line 52 of file DbiOutRowStream.cxx. 00052 : 00053 DbiRowStream(metaData), 00054 fBadData(kFALSE) 00055 { 00056 // 00057 // 00058 // Purpose: Default constructor 00059 // 00060 // Arguments: 00061 // metaData in Meta data for table to be written to.. 00062 00063 LEA_CTOR //Leak Checker 00064 00065 MSG("Dbi", Msg::kVerbose) << "Creating DbiOutRowStream" << endl; 00066 00067 }
|
|
|
Definition at line 72 of file DbiOutRowStream.cxx. 00072 {
00073 //
00074 //
00075 // Purpose: Destructor
00076
00077 LEA_DTOR //Leak Checker
00078
00079 MSG("Dbi", Msg::kVerbose) << "Destroying DbiOutRowStream" << endl;
00080
00081 }
|
|
|
Definition at line 67 of file DbiOutRowStream.h. References DbiRowStream::ClearCurCol(), fBadData, and fCSV. 00067 { fBadData = kFALSE; fCSV.erase(); ClearCurCol();}
|
|
|
Definition at line 48 of file DbiOutRowStream.h. Referenced by DbiSqlValPacket::AddRow(), and DbiSqlValPacket::Recreate(). 00048 { return fCSV; }
|
|
|
Definition at line 47 of file DbiOutRowStream.h. References fBadData, and IsComplete(). Referenced by DbiSqlValPacket::AddRow(). 00047 { return ! fBadData && IsComplete(); }
|
|
|
Definition at line 49 of file DbiOutRowStream.h. References DbiRowStream::CurColNum(), and DbiRowStream::NumCols(). Referenced by DbiSqlValPacket::AddRow(), and HasGoodData().
|
|
|
Definition at line 115 of file DbiOutRowStream.cxx. References Store(), and StoreDefaultIfInvalid(). 00115 {
00116 if ( ! StoreDefaultIfInvalid(Dbi::kDate) )
00117 Store(Dbi::MakeDateTimeString(src).c_str());
00118 return *this;
00119 }
|
|
|
Definition at line 112 of file DbiOutRowStream.cxx. References OUT. 00112 {
00113 OUT(Dbi::kString,src); return *this;}
|
|
|
Definition at line 109 of file DbiOutRowStream.cxx. References OUT. 00109 {
00110 OUT(Dbi::kDouble,src); return *this;}
|
|
|
Definition at line 106 of file DbiOutRowStream.cxx. References OUT. 00106 {
00107 OUT(Dbi::kFloat,src); return *this;}
|
|
|
Definition at line 103 of file DbiOutRowStream.cxx. References OUT2. 00103 {
00104 OUT2(Dbi::kUInt,src); return *this;}
|
|
|
Definition at line 100 of file DbiOutRowStream.cxx. References OUT. 00100 {
00101 OUT(Dbi::kInt,src); return *this;}
|
|
|
Definition at line 97 of file DbiOutRowStream.cxx. References OUT2. 00097 {
00098 OUT2(Dbi::kUShort,src); return *this;}
|
|
|
Definition at line 94 of file DbiOutRowStream.cxx. References OUT. 00094 {
00095 OUT(Dbi::kShort,src); return *this;}
|
|
|
Definition at line 91 of file DbiOutRowStream.cxx. References OUT. 00091 {
00092 OUT(Dbi::kString,src); return *this;}
|
|
|
Definition at line 88 of file DbiOutRowStream.cxx. References OUT. 00088 {
00089 OUT(Dbi::kChar,src); return *this;}
|
|
|
Definition at line 85 of file DbiOutRowStream.cxx. References OUT. 00085 {
00086 OUT(Dbi::kBool,src); return *this;}
|
|
|
Definition at line 170 of file DbiOutRowStream.cxx. References DbiRowStream::CurColFieldType(), DbiRowStream::CurColNum(), fCSV, DbiFieldType::GetConcept(), DbiRowStream::IncrementCurCol(), and UtilString::MakePrintable(). Referenced by operator<<(), DbiConfigSet::Store(), and StoreDefaultIfInvalid(). 00170 {
00171 //
00172 //
00173 // Purpose: Store string value as comma separated values but exclude SeqNo.
00174 //
00175 // Arguments:
00176 // str in Value to be stored.
00177 //
00178 // Return:
00179 //
00180 // Contact: N. West
00181 //
00182 // Specification:-
00183 // =============
00184 //
00185 // o Store string value in CSV with separator from
00186 // previous value and increment fNumValues. If required
00187 // enclose value in quotes. If storing the SeqNo column then
00188 // store a single '?' instead which will be replace during
00189 // SQL generation - see
00190
00191 // Program Notes:-
00192 // =============
00193
00194 // None.
00195
00196 UInt_t concept = CurColFieldType().GetConcept();
00197 string delim = "";
00198 if ( concept == Dbi::kString
00199 || concept == Dbi::kDate
00200 || concept == Dbi::kChar ) delim = "\'";
00201
00202 if ( CurColNum()> 1 ) fCSV += ',';
00203 fCSV += delim;
00204 if ( concept != Dbi::kString ) fCSV += str;
00205 // When exporting strings, take care of special characters.
00206 else {
00207 UtilString::MakePrintable(str.c_str(),fCSV);
00208 }
00209 fCSV += delim;
00210 IncrementCurCol();
00211 }
|
|
|
Definition at line 126 of file DbiOutRowStream.cxx. References DbiFieldType::AsString(), DbiRowStream::CurColFieldType(), DbiRowStream::CurColName(), DbiRowStream::CurColNum(), fBadData, DbiFieldType::IsCompatible(), MAXMSG, Store(), DbiRowStream::TableNameTc(), and DbiFieldType::UndefinedValue(). Referenced by operator<<(). 00126 {
00127 //
00128 //
00129 // Purpose: Store default value if illegal type supplied.
00130 //
00131 // Arguments:
00132 // type in Type of supplied value.
00133 //
00134 // Return: kTRUE if illegal type supplied.
00135 //
00136 // Contact: N. West
00137 //
00138 // Specification:-
00139 // =============
00140 //
00141 // o If type of supplied value is incompatible with current column
00142 // type store default value, report error and return kTRUE, otherwise
00143 // return kFALSE.
00144
00145 // Program Notes:-
00146 // =============
00147
00148 // None.
00149
00150 DbiFieldType typeSupplied(type);
00151 DbiFieldType typeRequired(CurColFieldType());
00152 if ( typeSupplied.IsCompatible(typeRequired) ) return kFALSE;
00153
00154 string udef = typeRequired.UndefinedValue();
00155 MAXMSG("Dbi",Msg::kError,20)
00156 << "In table " << TableNameTc()
00157 << " column "<< CurColNum()
00158 << " (" << CurColName() << ")"
00159 << " of type " << typeRequired.AsString()
00160 << " is incompatible with user type " << typeSupplied.AsString()
00161 << ", value \"" << udef
00162 << "\" will be substituted." << endl;
00163 Store(udef.c_str());
00164 fBadData = kTRUE;
00165 return kTRUE;
00166
00167 }
|
|
|
Definition at line 38 of file DbiOutRowStream.h. |
|
|
Set KTRUE if streamed bad data.
Definition at line 80 of file DbiOutRowStream.h. Referenced by Clear(), HasGoodData(), and StoreDefaultIfInvalid(). |
|
|
Comma separated list of values.
Definition at line 83 of file DbiOutRowStream.h. |
1.3.9.1