X-Git-Url: https://code.wpia.club/?p=cassiopeia.git;a=blobdiff_plain;f=src%2Fconfig.cpp;fp=src%2Fconfig.cpp;h=8b175967de13ad74c672ab90fc0ffcae5b205324;hp=ccd2f246aaa3b2b574256266c120dc14e7cda3b1;hb=605acfca533ba9eb66e192a18a3af5a847568a03;hpb=d387c2b5e1ac4a8810537e67a4f09c3e2c8a685d diff --git a/src/config.cpp b/src/config.cpp index ccd2f24..8b17596 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -92,6 +92,20 @@ int parseProfiles() { prof.id = std::stoi( id ); prof.eku = map->at( "eku" ); prof.ku = map->at( "ku" ); + { + std::string include = map->at( "include" ); + size_t pos = 0; + size_t end = 0; + std::unordered_set include_set; + + while( ( end = include.find( ",", pos ) ) != std::string::npos ) { + include_set.emplace( include.substr( pos, end - pos ) ); + pos = end + 1; + } + + include_set.emplace( include.substr( pos ) ); + prof.include = include_set; + } prof.maxValidity = std::stoi( map->at( "days" ) ) * /* DAYS */24 * 60 * 60;