kraken-assessment/src/parse/parse.hh

23 lines
485 B
C++
Raw Normal View History

2022-03-12 01:54:51 +01:00
#pragma once
#include <iosfwd>
#include <stdexcept>
#include <vector>
#include "book/order.hh"
#include "csv/csv.hh"
2022-03-12 01:54:51 +01:00
namespace kraken::parse {
struct ParseError : public std::runtime_error {
using std::runtime_error::runtime_error;
};
/// Convert a single CSV input line to an `Order`.
Order parse_single_order(csv::csv_line_type const& order);
/// Parse orders from an input stream as CSV.
2022-03-12 01:54:51 +01:00
std::vector<Order> parse_orders(std::istream& input);
} // namespace kraken::parse