lib/DBIndexItem.cpp

Go to the documentation of this file.
00001 /*
00002  *  Qtstalker stock charter
00003  *
00004  *  Copyright (C) 2001-2007 Stefan S. Stratigakos
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00019  *  USA.
00020  */
00021 
00022 #include "DBIndexItem.h"
00023 #include <string.h>
00024 
00025 #define SYMBOL_LENGTH 15
00026 #define TYPE_LENGTH 10
00027 #define TITLE_LENGTH 90
00028 #define PATH_LENGTH 100
00029 #define QUOTEPLUGIN_LENGTH 15
00030 #define FUTURESTYPE_LENGTH 5
00031 #define FUTURESMONTH_LENGTH 2
00032 #define EXCHANGE_LENGTH 10
00033 
00034 
00035 DBIndexItem::DBIndexItem ()
00036 {
00037   memset(&item, 0, sizeof(DBIndexItemItem));
00038 }
00039 
00040 DBIndexItem::~DBIndexItem ()
00041 {
00042 }
00043 
00044 void DBIndexItem::getItem(DBIndexItemItem &d)
00045 {
00046   d = item;
00047 }
00048 
00049 void DBIndexItem::setItem (DBIndexItemItem &d)
00050 {
00051   item = d;
00052 }
00053 
00054 void DBIndexItem::setBarType (bool d)
00055 {
00056   item.barType = d;
00057 }
00058 
00059 bool DBIndexItem::getBarType ()
00060 {
00061   return item.barType;
00062 }
00063 
00064 void DBIndexItem::setSymbol (QString &d)
00065 {
00066   strncpy(item.symbol, d, SYMBOL_LENGTH);
00067 }
00068 
00069 void DBIndexItem::getSymbol (QString &d)
00070 {
00071   d = item.symbol;
00072 }
00073 
00074 void DBIndexItem::setType (QString &d)
00075 {
00076   strncpy(item.type, d, TYPE_LENGTH);
00077 }
00078 
00079 void DBIndexItem::getType (QString &d)
00080 {
00081   d = item.type;
00082 }
00083 
00084 void DBIndexItem::setTitle (QString &d)
00085 {
00086   strncpy(item.title, d, TITLE_LENGTH);
00087 }
00088 
00089 void DBIndexItem::getTitle (QString &d)
00090 {
00091   d = item.title;
00092 }
00093 
00094 void DBIndexItem::setPath (QString &d)
00095 {
00096   strncpy(item.path, d, PATH_LENGTH);
00097 }
00098 
00099 void DBIndexItem::getPath (QString &d)
00100 {
00101   d = item.path;
00102 }
00103 
00104 void DBIndexItem::setQuotePlugin (QString &d)
00105 {
00106   strncpy(item.quotePlugin, d, QUOTEPLUGIN_LENGTH);
00107 }
00108 
00109 void DBIndexItem::getQuotePlugin (QString &d)
00110 {
00111   d = item.quotePlugin;
00112 }
00113 
00114 void DBIndexItem::setFuturesType (QString &d)
00115 {
00116   strncpy(item.futuresType, d, FUTURESTYPE_LENGTH);
00117 }
00118 
00119 void DBIndexItem::getFuturesType (QString &d)
00120 {
00121   d = item.futuresType;
00122 }
00123 
00124 void DBIndexItem::setFuturesMonth (QString &d)
00125 {
00126   strncpy(item.futuresMonth, d, FUTURESMONTH_LENGTH);
00127 }
00128 
00129 void DBIndexItem::getFuturesMonth (QString &d)
00130 {
00131   d = item.futuresMonth;
00132 }
00133 
00134 void DBIndexItem::setExchange (QString &d)
00135 {
00136   strncpy(item.exchange, d, EXCHANGE_LENGTH);
00137 }
00138 
00139 void DBIndexItem::getExchange (QString &d)
00140 {
00141   d = item.exchange;
00142 }
00143