LCOV - code coverage report
Current view: top level - app/src/utils - string.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 12 0.0 %
Date: 2023-08-17 16:45:52 Functions: 0 2 0.0 %

          Line data    Source code
       1             : #include "utils/string.hpp"
       2             : 
       3             : using namespace std;
       4             : 
       5           0 : bool utils::ends_with(const string &s, const string &p) {
       6           0 :     return s.compare(s.length() - p.length(), p.length(), p) == 0;
       7             : }
       8             : 
       9           0 : vector<string> utils::split(const string &s, const string &delim) {
      10           0 :     vector<string> result;
      11             : 
      12           0 :     size_t start = 0;
      13           0 :     size_t end   = s.find(delim);
      14             : 
      15           0 :     while(end != string::npos) {
      16           0 :         result.emplace_back(s.substr(start, end - start));
      17           0 :         start = end + delim.length();
      18           0 :         end   = s.find(delim, start);
      19             :     }
      20             : 
      21           0 :     result.emplace_back(s.substr(start, end));
      22             : 
      23           0 :     return result;
      24             : }

Generated by: LCOV version 1.14