Lines Matching defs:str
45 impl::duplicate(const char* str)
47 char* copy = new char[std::strlen(str) + 1];
48 std::strcpy(copy, str);
53 impl::match(const std::string& str, const std::string& regex)
59 found = str.empty();
67 const int res = ::regexec(&preg, str.c_str(), 0, NULL, 0);
79 impl::to_lower(const std::string& str)
82 for (std::string::const_iterator iter = str.begin(); iter != str.end();
89 impl::split(const std::string& str, const std::string& delim)
94 while (pos < str.length() && newpos != std::string::npos) {
95 newpos = str.find(delim, pos);
97 words.push_back(str.substr(pos, newpos - pos));
105 impl::trim(const std::string& str)
107 std::string::size_type pos1 = str.find_first_not_of(" \t");
108 std::string::size_type pos2 = str.find_last_not_of(" \t");
113 return str.substr(0, str.length() - pos2);
115 return str.substr(pos1);
117 return str.substr(pos1, pos2 - pos1 + 1);
121 impl::to_bool(const std::string& str)
123 const std::string lower = to_lower(str);
131 "'" + str + "' to boolean", EINVAL);
136 impl::to_bytes(std::string str)
138 if (str.empty())
141 const char unit = str[str.length() - 1];
155 str.erase(str.length() - 1);
157 return to_type< int64_t >(str) * multiplier;