ParamKit
A small library helping to parse commandline parameters (for Windows).
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
strings_util.h
Go to the documentation of this file.
1 
6 #pragma once
7 #include <string>
8 
9 namespace paramkit {
10 
11  namespace util {
12 
14  SIM_NONE = 0,
17  SIM_HIST
18  };
19 
20  std::string to_lowercase(std::string);
21 
22  bool is_cstr_equal(char const *a, char const *b, const size_t max_len, bool ignoreCase = true);
23  bool strequals(const std::string& a, const std::string& b, bool ignoreCase = true);
24 
25  // Calculate Levenshtein distance of two strings
26  size_t levenshtein_distance(const char s1[], const char s2[]);
27 
28  // Check a similarity in strings histograms
29  bool has_similar_histogram(const char s1[], const char s2[]);
30 
31  stringsim_type has_keyword(const std::string param, const std::string filter);
32 
33  stringsim_type is_string_similar(const std::string &param, const std::string &filter);
34  }; //namespace util
35 
36 }; // namespace paramkit
bool has_similar_histogram(const char s1[], const char s2[])
size_t levenshtein_distance(const char s1[], const char s2[])
stringsim_type is_string_similar(const std::string &param, const std::string &filter)
stringsim_type has_keyword(const std::string param, const std::string filter)
std::string to_lowercase(std::string)
Definition: strings_util.cpp:8
bool strequals(const std::string &a, const std::string &b, bool ignoreCase=true)
bool is_cstr_equal(char const *a, char const *b, const size_t max_len, bool ignoreCase=true)