OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StringOps_Namespace::anonymous_namespace{StringOps.cpp} Namespace Reference

Functions

bool is_normal (char const c)
 
bool is_singular (char const c)
 
size_t count_percents (std::string const &str)
 
int nibble (char const hex)
 

Function Documentation

size_t StringOps_Namespace::anonymous_namespace{StringOps.cpp}::count_percents ( std::string const &  str)

Definition at line 892 of file StringOps.cpp.

892  {
893  size_t n_percents = 0u;
894  if (2u < str.size()) {
895  for (size_t i = 0u; i < str.size() - 2u; ++i) {
896  if (str[i] == '%') {
897  ++n_percents;
898  i += 2u;
899  }
900  }
901  }
902  return n_percents;
903 }
bool StringOps_Namespace::anonymous_namespace{StringOps.cpp}::is_normal ( char const  c)

Definition at line 882 of file StringOps.cpp.

Referenced by is_singular().

882  {
883  return std::isalnum(c) || c == '-' || c == '.' || c == '_' || c == '~';
884 }

+ Here is the caller graph for this function:

bool StringOps_Namespace::anonymous_namespace{StringOps.cpp}::is_singular ( char const  c)

Definition at line 887 of file StringOps.cpp.

References is_normal().

887  {
888  return is_normal(c) || c == ' ';
889 }

+ Here is the call graph for this function:

int StringOps_Namespace::anonymous_namespace{StringOps.cpp}::nibble ( char const  hex)

Definition at line 906 of file StringOps.cpp.

906  {
907  return 'A' <= hex ? std::toupper(hex) + (10 - 'A') : hex - '0';
908 }