[Gcblue-commits] gcb_wx/include/database tcItemDBObject.h,NONE,1.1 CsvTranslator.h,1.6,1.7 tcDBStrin
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-06-12 20:47:08
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv593/include/database Modified Files: CsvTranslator.h tcDBString.h tcDatabaseObject.h tcSqlReader.h tcStoresDBObject.h Added Files: tcItemDBObject.h Log Message: Drag and drop icon gui updates Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcDatabaseObject.h 11 Jun 2005 21:01:42 -0000 1.23 --- tcDatabaseObject.h 12 Jun 2005 20:46:27 -0000 1.24 *************** *** 114,117 **** --- 114,118 ---- #define DTYPE_TORPEDO 15 #define DTYPE_SONOBUOY 16 + #define DTYPE_ITEM 17 #define DTYPE_NULL 0xFFFFFFFF *************** *** 164,168 **** tcDatabaseObject(); ! tcDatabaseObject(tcDatabaseObject& obj); ///< copy constructor virtual ~tcDatabaseObject(); protected: --- 165,169 ---- tcDatabaseObject(); ! tcDatabaseObject(const tcDatabaseObject& obj); ///< copy constructor virtual ~tcDatabaseObject(); protected: Index: tcStoresDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcStoresDBObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcStoresDBObject.h 1 Jun 2005 00:13:26 -0000 1.3 --- tcStoresDBObject.h 12 Jun 2005 20:46:27 -0000 1.4 *************** *** 45,49 **** enum {MAX_STORES = 4}; std::string displayName; ! unsigned int capacity; float moveTime; ///< time to unload to or load from stores --- 45,49 ---- enum {MAX_STORES = 4}; std::string displayName; ! unsigned long capacity; float moveTime; ///< time to unload to or load from stores Index: tcDBString.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDBString.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcDBString.h 1 Jun 2005 00:13:25 -0000 1.6 --- tcDBString.h 12 Jun 2005 20:46:27 -0000 1.7 *************** *** 55,58 **** --- 55,59 ---- tcDBString(); tcDBString(const char *buff); + tcDBString(const tcDBString& src); ~tcDBString(); }; Index: tcSqlReader.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcSqlReader.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSqlReader.h 1 Jun 2005 00:13:26 -0000 1.3 --- tcSqlReader.h 12 Jun 2005 20:46:27 -0000 1.4 *************** *** 53,63 **** { public: ! double GetDouble(std::string& field); double GetDouble(const char* fmt, ...); ! int GetInt(std::string& field); int GetInt(const char* fmt, ...); ! std::string GetString(std::string& field); std::string GetString(const char* fmt, ...); --- 53,66 ---- { public: ! double GetDouble(const std::string& field); double GetDouble(const char* fmt, ...); ! int GetInt(const std::string& field); int GetInt(const char* fmt, ...); ! long GetLong(const std::string& field); ! long GetLong(const char* fmt, ...); ! ! std::string GetString(const std::string& field); std::string GetString(const char* fmt, ...); *************** *** 72,76 **** void BuildColumnLookup(sqlite::reader& tableInfo); ! unsigned int LookupFieldIndex(std::string& field); }; --- 75,79 ---- void BuildColumnLookup(sqlite::reader& tableInfo); ! unsigned int LookupFieldIndex(const std::string& field); }; --- NEW FILE: tcItemDBObject.h --- /** ** @file tcItemDBObject.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _ITEMDBOBJECT_H_ #define _ITEMDBOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "tcDatabaseObject.h" #include <vector> class TiXmlElement; namespace database { class tcSqlReader; /** * Database object to describe generic item like fuel */ class tcItemDBObject : public tcDatabaseObject { public: virtual const char* GetClassName() {return "Item";} ///< returns class name of database object bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings static void AddSqlColumns(std::string& columnString); void ReadSql(tcSqlReader& entry); void WriteSql(std::string& valueString); tcItemDBObject(); tcItemDBObject(const tcItemDBObject& obj); virtual ~tcItemDBObject(); }; } // namespace database #endif Index: CsvTranslator.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/CsvTranslator.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CsvTranslator.h 1 Jun 2005 00:13:25 -0000 1.6 --- CsvTranslator.h 12 Jun 2005 20:46:26 -0000 1.7 *************** *** 49,52 **** --- 49,53 ---- float GetFieldAsFloat(int n); int GetFieldAsInt(int n); + long GetFieldAsLong(int n); int GetFieldCount() const { return nfield; } void SetInputStream(std::istream* _inputStream) {inputStream = _inputStream;} *************** *** 64,68 **** CsvTranslator& operator>>(unsigned int& val); CsvTranslator& operator>>(unsigned short& val); ! CsvTranslator& operator>>(long& val); CsvTranslator& operator>>(std::string& s); --- 65,70 ---- CsvTranslator& operator>>(unsigned int& val); CsvTranslator& operator>>(unsigned short& val); ! CsvTranslator& operator>>(long& val); ! CsvTranslator& operator>>(unsigned long& val); CsvTranslator& operator>>(std::string& s); |