-
Notifications
You must be signed in to change notification settings - Fork 0
/
OrderValidator.h
32 lines (23 loc) · 956 Bytes
/
OrderValidator.h
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
29
30
31
#include<iostream>
#include<string>
#include<tuple>
#include<boost/tokenizer.hpp>
#include <boost/core/noncopyable.hpp>
#include "Order.h"
using namespace std;
using namespace boost;
// This is a validator/helper class that implements the validation of building an order object from string by parsing / validating etc.
// If successfull it returns true of else false.
// The status of return is true then the string message will be generally empty and Order object returned can be used further.
// If the status of return is false then the String message indicates validation failure nature and the returned Order will be an invalid one which should not be used further.
#ifndef OrderValidator_H
#define OrderValidator_H
class OrderValidator : private boost::noncopyable
{
private:
static long orderSequenceId;
static size_t orderLayoutTokens;
public:
std::tuple<std::pair<bool,std::string>,Order> validateOrder(const std::string&);
};
#endif