X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fdatamap.cc;h=19aaf44c95e788ef85f42fe753dd708810d55c5a;hp=626c47f88d71375a8effc8d3afe727b0cba3dfd7;hb=572bf1ef8d54ef5a7cba7cdf38515cb16c4c312c;hpb=3bfa17f584d9b6ad0bcb468c85b815c5046d7250 diff --git a/src/datamap.cc b/src/datamap.cc index 626c47f..19aaf44 100644 --- a/src/datamap.cc +++ b/src/datamap.cc @@ -4,7 +4,7 @@ #include #include #include -#include +//#include #include "datamap.h" #ifdef WIN32 @@ -15,13 +15,13 @@ static char *clean_line(char *s); -static std::vector> dmap; +//static std::vector> dmap; +static std::vector> dmap; static std::map cache; static std::string root; void datamap_reset() { - root.clear(); dmap.clear(); cache.clear(); } @@ -64,8 +64,10 @@ bool datamap_load_map(const char *fname) } *colon = 0; - std::pair pair; - pair.first = std::regex(line); + //std::pair pair; + //pair.first = std::regex(line); + std::pair pair; + pair.first = std::string(line); char *value = clean_line(colon + 1); if(!value || !*value) { @@ -88,8 +90,10 @@ err: void datamap_map(const char *re, const char *path) { - std::pair mapping; - mapping.first = std::regex(re); + //std::pair mapping; + //mapping.first = std::regex(re); + std::pair mapping; + mapping.first = std::string(re); mapping.second = std::string(path); dmap.push_back(std::move(mapping)); } @@ -108,15 +112,17 @@ int datamap_lookup(const char *in, char *buf, int bsz) res = it->second; } else { // try matching with the available mappings + res = std::string(in); + int num = dmap.size(); for(int i=0; i