<commit_before>#ifndef TWS_META_H
#define TWS_META_H

#include "ibtws/Contract.h"

#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/QHash>




namespace Test {




/// stupid static helper
QString ibDate2ISO( const QString &ibDate );

extern const QHash<QString, const char*> short_wts;
extern const QHash<QString, const char*> short_bar_size;








class ContractDetailsRequest
{
	public:
		bool initialize( const IB::Contract& );
		bool fromStringList( const QList<QString>& );
		
		IB::Contract ibContract;
};








class HistRequest
{
	public:
		bool initialize( const IB::Contract&, const QString &endDateTime,
			const QString &durationStr, const QString &barSizeSetting,
			const QString &whatToShow, int useRTH, int formatDate );
		bool fromString( const QString& );
		QString toString() const;
		void clear();
		
		IB::Contract ibContract;
		QString endDateTime;
		QString durationStr;
		QString barSizeSetting;
		QString whatToShow;
		int useRTH;
		int formatDate;
};







class GenericRequest
{
	public:
		enum ReqType {
			NONE,
			CONTRACT_DETAILS_REQUEST,
			HIST_REQUEST
		};
		
		enum ReqState {
			PENDING,
			FINISHED
		};
		
		GenericRequest();
		
		void nextRequest( ReqType );
		
		ReqType reqType;
		ReqState reqState;
		int reqId;
};








class HistTodo
{
	public:
		int fromFile( const QString & fileName );
		void dump( FILE *stream ) const;
		
		QList<HistRequest> histRequests;
		
	private:
		int read_file( const QString & fileName, QList<QByteArray> *list ) const;
};








class ContractDetailsTodo
{
	public:
		int fromConfig( const QList< QList<QString> > &contractSpecs );
		
		QList<ContractDetailsRequest> contractDetailsRequests;
};








class PacketContractDetails
{
	public:
		QList<IB::ContractDetails> cdList;
};








class PacketHistData
{
	public:
		class Row
		{
			public:
				void clear();
				
				QString date;
				double open;
				double high;
				double low;
				double close;
				int volume;
				int count;
				double WAP;
				bool hasGaps;
		};
		
		bool isFinished() const;
		void clear();
		void append( int reqId, const QString &date,
			double open, double high, double low, double close,
			int volume, int count, double WAP, bool hasGaps );
		void dump( const HistRequest&, bool printFormatDates );
		
	private:
		int reqId;
		QList<Row> rows;
		Row finishRow;
};




} // namespace Test
#endif<commit_msg>twsDL, PacketHistData's sublass Row is private<commit_after>#ifndef TWS_META_H
#define TWS_META_H

#include "ibtws/Contract.h"

#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/QHash>




namespace Test {




/// stupid static helper
QString ibDate2ISO( const QString &ibDate );

extern const QHash<QString, const char*> short_wts;
extern const QHash<QString, const char*> short_bar_size;








class ContractDetailsRequest
{
	public:
		bool initialize( const IB::Contract& );
		bool fromStringList( const QList<QString>& );
		
		IB::Contract ibContract;
};








class HistRequest
{
	public:
		bool initialize( const IB::Contract&, const QString &endDateTime,
			const QString &durationStr, const QString &barSizeSetting,
			const QString &whatToShow, int useRTH, int formatDate );
		bool fromString( const QString& );
		QString toString() const;
		void clear();
		
		IB::Contract ibContract;
		QString endDateTime;
		QString durationStr;
		QString barSizeSetting;
		QString whatToShow;
		int useRTH;
		int formatDate;
};







class GenericRequest
{
	public:
		enum ReqType {
			NONE,
			CONTRACT_DETAILS_REQUEST,
			HIST_REQUEST
		};
		
		enum ReqState {
			PENDING,
			FINISHED
		};
		
		GenericRequest();
		
		void nextRequest( ReqType );
		
		ReqType reqType;
		ReqState reqState;
		int reqId;
};








class HistTodo
{
	public:
		int fromFile( const QString & fileName );
		void dump( FILE *stream ) const;
		
		QList<HistRequest> histRequests;
		
	private:
		int read_file( const QString & fileName, QList<QByteArray> *list ) const;
};








class ContractDetailsTodo
{
	public:
		int fromConfig( const QList< QList<QString> > &contractSpecs );
		
		QList<ContractDetailsRequest> contractDetailsRequests;
};








class PacketContractDetails
{
	public:
		QList<IB::ContractDetails> cdList;
};








class PacketHistData
{
	public:
		bool isFinished() const;
		void clear();
		void append( int reqId, const QString &date,
			double open, double high, double low, double close,
			int volume, int count, double WAP, bool hasGaps );
		void dump( const HistRequest&, bool printFormatDates );
		
	private:
		class Row
		{
			public:
				void clear();
				
				QString date;
				double open;
				double high;
				double low;
				double close;
				int volume;
				int count;
				double WAP;
				bool hasGaps;
		};
		
		int reqId;
		QList<Row> rows;
		Row finishRow;
};




} // namespace Test
#endif
{'fraction_non_alphanumeric': 0.09235866639055705, 'fraction_numerical': 0.0004141644232760406, 'mean_word_length': 3.447513812154696, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4389892', 'n_tokens_mistral': 1917, 'n_tokens_neox': 1546, 'n_words': 454}