From 5e18c8eccf4ba05c9cce5672d8495c3904b66cd0 Mon Sep 17 00:00:00 2001 From: Denis Evsyukov Date: Sat, 22 Feb 2020 21:03:52 +0300 Subject: [+] prefix function --- src/main.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index cc1144f..343b9d8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,9 +1,10 @@ #include +#include #include "functions.hpp" #include "opts/cxxopts.hpp" -using namespace std; +std::unordered_map tasks = {}; int main(int argc, char *argv[]) { cxxopts::Options options("MyProgram", "One line description of MyProgram"); @@ -37,7 +38,16 @@ int main(int argc, char *argv[]) { str += s + " "; } auto src_str = trim(str); - cout << "sha256('" << str << "'): " << sha256_hash(str) << endl; + // tasks[sha256_hash(str)] = str; + std::string hash = sha256_hash(str); + std::cout << "sha256('" << str << "'): " << hash << std::endl; + + // for (const auto &n : tasks) { + // std::cout << "Key:[" << n.first << "] Value:[" << n.second << "]\n"; + // } + + std::string p = prefix(hash, tasks); + std::cout << "prefix: " << p << std::endl; } std::string taskdir; if (result.count("taskdir")) { -- cgit v1.2.3