// $Id: IDbiString.hxx,v 1.1 2011/01/18 05:49:20 finch Exp $ #ifndef DBISTRING #define DBISTRING /** * * $Id: IDbiString.hxx,v 1.1 2011/01/18 05:49:20 finch Exp $ * * \class COMET::IDbiString * * * \brief * Concept Output string stream - string that can be assembled * from basic types. * * \brief * Purpose This is used to assemble SQL commands. It was written * to plug what was then a deficiency in gcc ostrstream. It could be removed * now if I had the energy. * * Contact: A.Finch@lancaster.ac.uk * * */ #include #ifndef ROOT_Rtypes #if !defined(__CINT__) || defined(__MAKECINT__) #include "Rtypes.h" #endif #endif namespace COMET { class IDbiString { public: // Constructors and destructors. IDbiString(); IDbiString(const Char_t* str); IDbiString(const std::string& str); virtual ~IDbiString(); // State testing member functions const Char_t* c_str() const { return fString.c_str(); } const std::string& GetString() const { return fString; } // State changing member functions COMET::IDbiString& operator<<(Int_t data); COMET::IDbiString& operator<<(UInt_t data); COMET::IDbiString& operator<<(Float_t data); COMET::IDbiString& operator<<(Char_t data); COMET::IDbiString& operator<<(const Char_t* data); COMET::IDbiString& operator<<(const std::string& data); void Clear() { fString.clear(); } std::string& GetString() { return fString; } private: // Data members /// The underlying string std::string fString; ClassDef(IDbiString,0) // output string stream }; }; #endif // DBISTRING