aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorDenis Evsyukov <[email protected]>2020-02-22 21:03:52 +0300
committerDenis Evsyukov <[email protected]>2020-02-22 21:03:52 +0300
commit5e18c8eccf4ba05c9cce5672d8495c3904b66cd0 (patch)
treec7d4aa2484a769b3285af24bddbb3af6281e9d9e /src/main.cpp
parent[~] hash to function (diff)
downloadt-5e18c8eccf4ba05c9cce5672d8495c3904b66cd0.tar.xz
t-5e18c8eccf4ba05c9cce5672d8495c3904b66cd0.zip
[+] prefix function
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp14
1 files changed, 12 insertions, 2 deletions
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 <filesystem>
+#include <unordered_map>
#include "functions.hpp"
#include "opts/cxxopts.hpp"
-using namespace std;
+std::unordered_map<std::string, std::string> 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")) {