本文整理汇总了C++中SkString::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ SkString::contains方法的具体用法?C++ SkString::contains怎么用?C++ SkString::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkString
的用法示例。
在下文中一共展示了SkString::contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: it
ThermalManager::ThermalManager(int32_t threshold, uint32_t sleepIntervalMs, uint32_t timeoutMs)
: fSleepIntervalMs(sleepIntervalMs)
, fTimeoutMs(timeoutMs) {
static const char* kThermalZonePath = "/sys/class/thermal/";
SkOSFile::Iter it(kThermalZonePath);
SkString path;
while (it.next(&path, true)) {
if (!path.contains("thermal_zone")) {
continue;
}
SkString fullPath(kThermalZonePath);
fullPath.append(path);
SkOSFile::Iter thermalZoneIt(fullPath.c_str());
SkString filename;
while (thermalZoneIt.next(&filename)) {
if (!(filename.contains("trip_point") && filename.contains("temp"))) {
continue;
}
fTripPoints.push_back(TripPoint(fullPath, filename, threshold));
}
}
}
示例2: string_contains_any_of
/// Returns true if string contains any of these substrings.
static bool string_contains_any_of(const SkString& string,
const StringArray& substrings) {
for (int i = 0; i < substrings.count(); i++) {
if (string.contains(substrings[i]->c_str())) {
return true;
}
}
return false;
}
示例3: SkAppendScalar
void SkAppendScalar(SkString* str, SkScalar value, SkScalarAsStringType asType) {
switch (asType) {
case kHex_SkScalarAsStringType:
str->appendf("SkBits2Float(0x%08x)", SkFloat2Bits(value));
break;
case kDec_SkScalarAsStringType: {
SkString tmp;
tmp.printf("%g", value);
if (tmp.contains('.')) {
tmp.appendUnichar('f');
}
str->append(tmp);
break;
}
}
}