291 lines
4.9 KiB
C++
291 lines
4.9 KiB
C++
#ifndef _HTTP_STOCKQUOTE_HPP_
|
|
#define _HTTP_STOCKQUOTE_HPP_
|
|
#ifndef _COMMON_STRING_HPP_
|
|
#include <common/string.hpp>
|
|
#endif
|
|
|
|
class StockQuote
|
|
{
|
|
public:
|
|
StockQuote(void);
|
|
StockQuote(const StockQuote &someStockQuote);
|
|
virtual ~StockQuote();
|
|
StockQuote &operator=(const StockQuote &someStockQuote);
|
|
WORD operator==(const StockQuote &someStockQuote)const;
|
|
const String &description(void)const;
|
|
void description(const String &description);
|
|
const String &symbol(void)const;
|
|
void symbol(const String &symbol);
|
|
float lastTraded(void)const;
|
|
void lastTraded(float lastTraded);
|
|
float dollarChange(void)const;
|
|
void dollarChange(float dollarChange);
|
|
float percentChange(void)const;
|
|
void percentChange(float percentChange);
|
|
int volume(void)const;
|
|
void volume(int volume);
|
|
int trades(void)const;
|
|
void trades(int trades);
|
|
float openingPrice(void)const;
|
|
void openingPrice(float openingPrice);
|
|
float previousClose(void)const;
|
|
void previousClose(float previousClose);
|
|
float bid(void)const;
|
|
void bid(float bid);
|
|
float ask(void)const;
|
|
void ask(float ask);
|
|
float dayLow(void)const;
|
|
void dayLow(float dayLow);
|
|
float dayHigh(void)const;
|
|
void dayHigh(float dayHigh);
|
|
float low52(void)const;
|
|
void low52(float low52);
|
|
float high52(void)const;
|
|
void high52(float high52);
|
|
private:
|
|
String mDescription;
|
|
String mSymbol;
|
|
float mLastTraded;
|
|
float mDollarChange;
|
|
float mPercentChange;
|
|
int mVolume;
|
|
int mTrades;
|
|
float mOpeningPrice;
|
|
float mPreviousClose;
|
|
|
|
float mBid;
|
|
float mAsk;
|
|
float mDayLow;
|
|
float mDayHigh;
|
|
float mLow52;
|
|
float mHigh52;
|
|
};
|
|
|
|
inline
|
|
StockQuote::StockQuote(void)
|
|
: mLastTraded(0.00), mDollarChange(0.00), mPercentChange(0.00), mVolume(0), mTrades(0),
|
|
mOpeningPrice(0.00), mPreviousClose(0.00),
|
|
mBid(0.00), mAsk(0.00), mDayLow(0.00), mDayHigh(0.00), mLow52(0.00), mHigh52(0.00)
|
|
{
|
|
}
|
|
|
|
inline
|
|
StockQuote::StockQuote(const StockQuote &someStockQuote)
|
|
{
|
|
*this=someStockQuote;
|
|
}
|
|
|
|
inline
|
|
StockQuote::~StockQuote()
|
|
{
|
|
}
|
|
|
|
inline
|
|
StockQuote &StockQuote::operator=(const StockQuote &someStockQuote)
|
|
{
|
|
description(someStockQuote.description());
|
|
symbol(someStockQuote.symbol());
|
|
lastTraded(someStockQuote.lastTraded());
|
|
dollarChange(someStockQuote.dollarChange());
|
|
percentChange(someStockQuote.percentChange());
|
|
volume(someStockQuote.volume());
|
|
trades(someStockQuote.trades());
|
|
openingPrice(someStockQuote.openingPrice());
|
|
previousClose(someStockQuote.previousClose());
|
|
|
|
bid(someStockQuote.bid());
|
|
ask(someStockQuote.ask());
|
|
dayLow(someStockQuote.dayLow());
|
|
dayHigh(someStockQuote.dayHigh());
|
|
low52(someStockQuote.low52());
|
|
high52(someStockQuote.high52());
|
|
return *this;
|
|
}
|
|
|
|
inline
|
|
WORD StockQuote::operator==(const StockQuote &someStockQuote)const
|
|
{
|
|
return (symbol()==someStockQuote.symbol()&&
|
|
description()==someStockQuote.description());
|
|
}
|
|
|
|
inline
|
|
const String &StockQuote::description(void)const
|
|
{
|
|
return mDescription;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::description(const String &description)
|
|
{
|
|
mDescription=description;
|
|
}
|
|
|
|
inline
|
|
const String &StockQuote::symbol(void)const
|
|
{
|
|
return mSymbol;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::symbol(const String &symbol)
|
|
{
|
|
mSymbol=symbol;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::lastTraded(void)const
|
|
{
|
|
return mLastTraded;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::lastTraded(float lastTraded)
|
|
{
|
|
mLastTraded=lastTraded;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::dollarChange(void)const
|
|
{
|
|
return mDollarChange;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::dollarChange(float dollarChange)
|
|
{
|
|
mDollarChange=dollarChange;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::percentChange(void)const
|
|
{
|
|
return mPercentChange;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::percentChange(float percentChange)
|
|
{
|
|
mPercentChange=percentChange;
|
|
}
|
|
|
|
inline
|
|
int StockQuote::volume(void)const
|
|
{
|
|
return mVolume;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::volume(int volume)
|
|
{
|
|
mVolume=volume;
|
|
}
|
|
|
|
inline
|
|
int StockQuote::trades(void)const
|
|
{
|
|
return mTrades;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::trades(int trades)
|
|
{
|
|
mTrades=trades;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::openingPrice(void)const
|
|
{
|
|
return mOpeningPrice;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::openingPrice(float openingPrice)
|
|
{
|
|
mOpeningPrice=openingPrice;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::previousClose(void)const
|
|
{
|
|
return mPreviousClose;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::previousClose(float previousClose)
|
|
{
|
|
mPreviousClose=previousClose;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::bid(void)const
|
|
{
|
|
return mBid;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::bid(float bid)
|
|
{
|
|
mBid=bid;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::ask(void)const
|
|
{
|
|
return mAsk;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::ask(float ask)
|
|
{
|
|
mAsk=ask;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::dayLow(void)const
|
|
{
|
|
return mDayLow;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::dayLow(float dayLow)
|
|
{
|
|
mDayLow=dayLow;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::dayHigh(void)const
|
|
{
|
|
return mDayHigh;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::dayHigh(float dayHigh)
|
|
{
|
|
mDayHigh=dayHigh;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::low52(void)const
|
|
{
|
|
return mLow52;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::low52(float low52)
|
|
{
|
|
mLow52=low52;
|
|
}
|
|
|
|
inline
|
|
float StockQuote::high52(void)const
|
|
{
|
|
return mHigh52;
|
|
}
|
|
|
|
inline
|
|
void StockQuote::high52(float high52)
|
|
{
|
|
mHigh52=high52;
|
|
}
|
|
#endif |