OnixS C++ SGX Titan ITCH Market Data Handler  1.2.2
API documentation
Replay.cpp
Go to the documentation of this file.
1 /*
2 * Copyright 2002-2010 ONIX SOLUTIONS LIMITED. All rights reserved.
3 *
4 * This software owned by ONIX SOLUTIONS LIMITED [ONIXS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 
21 
22 #include <system/FileSystem.h>
23 #include <system/Path.h>
24 
25 #include <algorithm>
26 
27 using namespace std;
28 using namespace OnixS::System;
29 
30 #include "NamespaceHelper.h"
31 
32 ONIXS_HANDLER_NAMESPACE_BEGIN
33 
34 void gatherLogs(HandlerLogs* gatheredLogs, const std::string& root)
35 {
36  // Step 1. Retrieve file system entries of given pattern.
37  FileSystem::EntriesNames logs;
38 
39  FileSystem::getEntries(root, "*.log", &logs);
40 
41  std::sort(logs.begin(), logs.end());
42 
43  // Step 2. Make each found entry as full path.
44  Path rootPath(root);
45  for (
46  FileSystem::EntriesNames::const_iterator logEntry = logs.begin();
47  logEntry != logs.end(); ++logEntry)
48  {
49  Path fullPath(rootPath);
50 
51  fullPath.append(*logEntry);
52 
53  gatheredLogs->push_back(fullPath.toString());
54  }
55 }
56 
57 ReplayListener::~ReplayListener()
58 {
59 }
60 
61 
62 ONIXS_HANDLER_NAMESPACE_END
STL namespace.
void ONIXS_SGXTITAN_ITCH_API gatherLogs(HandlerLogs *gatheredLogs, const std::string &root)
Gathers log files logs which are stored in a given folder.
Definition: Replay.cpp:34
std::vector< std::string > HandlerLogs
Ordered list of logs to be replayed.
Definition: Replay.h:30