-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSVReader.h
More file actions
28 lines (21 loc) · 812 Bytes
/
CSVReader.h
File metadata and controls
28 lines (21 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include "OrderBookEntry.h"
#include <vector>
#include <string>
/** Reads the data CSV and loads it into the order book
* Note the static classes, no state dependence
*/
class CSVReader
{
public:
CSVReader();
static std::vector<OrderBookEntry> readCSV(std::string csvFile);
static std::vector<std::string> tokenise(std::string csvLine, char separator);
static OrderBookEntry stringsToOBE(std::string price,
std::string amount,
std::string timeStamp,
std::string product,
OrderBookType type);
private:
static OrderBookEntry stringsToOBE(std::vector<std::string> strings);
};