Lines Matching refs:s
35 std::vector<std::string> SplitString(const std::string &s, char c) { in SplitString() argument
40 while ((matchPos = s.find(c, startPos)) != std::string::npos) { in SplitString()
41 components.push_back(s.substr(startPos, matchPos - startPos)); in SplitString()
45 if (startPos <= s.length()) { in SplitString()
46 components.push_back(s.substr(startPos)); in SplitString()
65 bool parse(const std::string &s, std::vector<T> *objs) { in parse() argument
66 std::vector<std::string> v = SplitString(s, ','); in parse()
80 bool parseEnum(const std::string &s, E *e, const Array &strings) { in parseEnum() argument
82 if (s == strings.at(i)) { in parseEnum()
91 bool parse(const std::string &s, ENUM *hf) { \
92 return parseEnum(s, hf, g##ENUM##Strings); \
120 bool parse(const std::string& s, Level* l) { in parse() argument
121 if (s.empty()) { in parse()
125 if (s == "legacy") { in parse()
130 if (!ParseUint(s, &value)) { in parse()
156 bool parseKernelConfigIntHelper(const std::string &s, T *i) { in parseKernelConfigIntHelper() argument
159 unsigned long long int ulli = strtoull(s.c_str(), &end, 0 /* base */); in parseKernelConfigIntHelper()
162 if (errno == 0 && s.c_str() != end && *end == '\0') { in parseKernelConfigIntHelper()
169 bool parseKernelConfigInt(const std::string &s, int64_t *i) { in parseKernelConfigInt() argument
170 return parseKernelConfigIntHelper(s, i); in parseKernelConfigInt()
173 bool parseKernelConfigInt(const std::string &s, uint64_t *i) { in parseKernelConfigInt() argument
174 return parseKernelConfigIntHelper(s, i); in parseKernelConfigInt()
177 bool parseRange(const std::string &s, KernelConfigRangeValue *range) { in parseRange() argument
178 auto pos = s.find('-'); in parseRange()
182 return parseKernelConfigInt(s.substr(0, pos), &range->first) in parseRange()
183 && parseKernelConfigInt(s.substr(pos + 1), &range->second); in parseRange()
186 bool parse(const std::string &s, KernelConfigKey *key) { in parse() argument
187 *key = s; in parse()
191 bool parseKernelConfigValue(const std::string &s, KernelConfigTypedValue *kctv) { in parseKernelConfigValue() argument
194 kctv->mStringValue = s; in parseKernelConfigValue()
197 return parseKernelConfigInt(s, &kctv->mIntegerValue); in parseKernelConfigValue()
199 return parseRange(s, &kctv->mRangeValue); in parseKernelConfigValue()
201 return parse(s, &kctv->mTristateValue); in parseKernelConfigValue()
205 bool parseKernelConfigTypedValue(const std::string& s, KernelConfigTypedValue* kctv) { in parseKernelConfigTypedValue() argument
206 if (s.size() > 1 && s[0] == '"' && s.back() == '"') { in parseKernelConfigTypedValue()
208 kctv->mStringValue = s.substr(1, s.size()-2); in parseKernelConfigTypedValue()
211 if (parseKernelConfigInt(s, &kctv->mIntegerValue)) { in parseKernelConfigTypedValue()
215 if (parse(s, &kctv->mTristateValue)) { in parseKernelConfigTypedValue()
223 bool parse(const std::string &s, Version *ver) { in parse() argument
224 std::vector<std::string> v = SplitString(s, '.'); in parse()
239 bool parse(const std::string& s, SepolicyVersion* sepolicyVer) { in parse() argument
242 if (ParseUint(s, &major)) { in parse()
248 if (!parse(s, &ver)) return false; in parse()
266 const std::string& s, VersionRange* vr, in parseVersionRange() argument
268 std::vector<std::string> v = SplitString(s, '-'); in parseVersionRange()
288 bool parse(const std::string& s, VersionRange* vr) { in parse() argument
290 return parseVersionRange(s, vr, versionParser); in parse()
294 bool parse(const std::string& s, SepolicyVersionRange* svr) { in parse() argument
296 if (parse(s, &sepolicyVersion)) { in parse()
302 if (parse(s, &vr)) { in parse()
326 bool parse(const std::string &s, VndkVersionRange *vr) { in parse() argument
327 std::vector<std::string> v = SplitString(s, '-'); in parse()
357 bool parse(const std::string &s, KernelVersion *kernelVersion) { in parse() argument
358 std::vector<std::string> v = SplitString(s, '.'); in parse()
392 std::string s; in expandInstances() local
395 if (count > 0) s += " AND "; in expandInstances()
400 s += toFQNameString(matrixInstance.interface(), instance) + " (@" + in expandInstances()
406 s += toFQNameString(vr, matrixInstance.interface(), instance); in expandInstances()
413 s += "@" + to_string(vr); in expandInstances()
416 s = "(" + s + ")"; in expandInstances()
418 return s; in expandInstances()
443 bool parse(const std::string &s, KernelSepolicyVersion *ksv){ in parse() argument
444 return ParseUint(s, &ksv->value); in parse()
526 bool parse(const std::string& s, FqInstance* fqInstance) { in parse() argument
527 return fqInstance->setTo(s); in parse()
543 bool parseAidlVersion(const std::string& s, Version* version) { in parseAidlVersion() argument
545 return android::base::ParseUint(s, &version->minorVer); in parseAidlVersion()
555 bool parseAidlVersionRange(const std::string& s, VersionRange* vr) { in parseAidlVersionRange() argument
556 return parseVersionRange(s, vr, parseAidlVersion); in parseAidlVersionRange()