LCOV - code coverage report
Current view: top level - libs/parser - parser.cpp (source / functions) Hit Total Coverage
Test: cleared_cor.info Lines: 0 13 0.0 %
Date: 2019-03-07 14:46:43 Functions: 0 4 0.0 %

          Line data    Source code
       1             : /**
       2             :  * Copyright Soramitsu Co., Ltd. All Rights Reserved.
       3             :  * SPDX-License-Identifier: Apache-2.0
       4             :  */
       5             : 
       6             : #include "parser/parser.hpp"
       7             : 
       8             : #include <cctype>
       9             : #include <ciso646>
      10             : 
      11             : namespace parser {
      12             : 
      13             :   bool isIntNumber(const std::string &s) {
      14           0 :     return !s.empty()
      15           0 :         && std::find_if(
      16             :                s.begin(), s.end(), [](char c) { return not std::isdigit(c); })
      17           0 :         == s.end();
      18             :   }
      19             : 
      20             :   boost::optional<std::string> parseFirstCommand(std::string line) {
      21           0 :     auto vec = split(line);
      22           0 :     if (vec.size() == 0) {
      23           0 :       return boost::none;
      24             :     }
      25           0 :     return vec[0];
      26           0 :   }
      27             : 
      28             :   std::vector<std::string> split(std::string line) {
      29           0 :     std::transform(line.begin(), line.end(), line.begin(), ::tolower);
      30           0 :     std::istringstream iss(line);
      31           0 :     return {std::istream_iterator<std::string>{iss},
      32           0 :             std::istream_iterator<std::string>{}};
      33           0 :   }
      34             : }  // namespace parser

Generated by: LCOV version 1.13