Files
spark/src/server/sparkd/cmds/QuickTest.cpp
T

43 lines
1.2 KiB
C++

#include "QuickTest.h"
#include "ICmd.h"
#include "lib/config/config.h"
#include "lib/config/protos/orders_fills_cleanup.pb.h"
#include "lib/orderman/orders/algo/IAlgoServices.h"
#include "lib/tracing/PerfLog.h"
#include "lib/utils/datetime.h"
#include "lib/domain_model/sod.h"
#include "lib/utils/datetime.h"
#include <boost/algorithm/string.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <iostream>
#include <regex>
namespace bts {
namespace cmd {
using namespace bts::orderman;
int QuickTest::execute(std::vector<std::string> const &) {
auto sftp_file_name = std::string("2019-08-05.adatmny.csv");
std::regex rx("(\\d\\d\\d\\d)");
std::smatch matches;
if (!std::regex_match(sftp_file_name, matches, rx))
return {};
auto y = std::stoi(matches[0]);
auto m = std::stoi(matches[1]);
auto d = std::stoi(matches[2]);
const auto &sod = config::get<config::SODTime>();
std::cout << datetime::make_ptime(y, m, d, sod.sod_hh(), sod.has_sod_mm(), 0, 0) << "\n";
return 1;
}
std::string QuickTest::help() {
return "This is a place holder to make it easy to quickly write discardable "
"test code";
}
} // namespace cmd
} // namespace bts