Example #1
0
    openWeatherJSONregexParserReturnableData parse() {
        if(regex_search(jsonData, resultate, skyPattern))
            data.sky = resultate.str(1);
        if(regex_search(jsonData, resultate, humidityPattern))
            data.humidity = resultate.str(1);
        if(regex_search(jsonData, resultate, windPattern))
            data.wind = resultate.str(1);
        if(regex_search(jsonData, resultate, tempPattern))
            data.temp = resultate.str(1);

        return data;
    }
Example #2
0
void splitMatch(const std::smatch& match, Splits& nextSplits) {
  Split s1, s2, s3;

  if (match.prefix().length() > 0) {
    s1.part = match.prefix();
    s1.tokenizable = true;
    nextSplits.push_back(s1);
  }

  s2.part = match[0];
  s2.tokenizable = false;
  nextSplits.push_back(s2);

  if (match.suffix().length() > 0) {
    s3.part = match.suffix();
    s3.tokenizable = true;
    nextSplits.push_back(s3);
  }
}
Example #3
0
void test(std::smatch tokens)
{
    std::cout << "not implemented" << std::endl;
    for (size_t i = 0; i < tokens.size(); i++)
        std::cout << std::dec << i << " : " << tokens.str(i) << std::endl;
}