本文整理汇总了C++中PrintfSpecifier::setIsSensitive方法的典型用法代码示例。如果您正苦于以下问题:C++ PrintfSpecifier::setIsSensitive方法的具体用法?C++ PrintfSpecifier::setIsSensitive怎么用?C++ PrintfSpecifier::setIsSensitive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PrintfSpecifier
的用法示例。
在下文中一共展示了PrintfSpecifier::setIsSensitive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParsePrintfSpecifier
//.........这里部分代码省略.........
else if (PrivacyFlags !=
clang::analyze_os_log::OSLogBufferItem::IsSensitive &&
MatchedStr.equals("private"))
PrivacyFlags = clang::analyze_os_log::OSLogBufferItem::IsPrivate;
else if (PrivacyFlags == 0 && MatchedStr.equals("public"))
PrivacyFlags = clang::analyze_os_log::OSLogBufferItem::IsPublic;
} else {
size_t CommaOrBracePos =
Str.find_if([](char c) { return c == ',' || c == '}'; });
if (CommaOrBracePos == StringRef::npos) {
// Neither a comma nor the closing brace was found.
if (Warn)
H.HandleIncompleteSpecifier(Start, E - Start);
return true;
}
I += CommaOrBracePos + 1;
}
// Continue until the closing brace is found.
} while (*(I - 1) == ',');
// Set the privacy flag.
switch (PrivacyFlags) {
case 0:
break;
case clang::analyze_os_log::OSLogBufferItem::IsPrivate:
FS.setIsPrivate(MatchedStr.data());
break;
case clang::analyze_os_log::OSLogBufferItem::IsPublic:
FS.setIsPublic(MatchedStr.data());
break;
case clang::analyze_os_log::OSLogBufferItem::IsSensitive:
FS.setIsSensitive(MatchedStr.data());
break;
default:
llvm_unreachable("Unexpected privacy flag value");
}
}
// Look for flags (if any).
bool hasMore = true;
for ( ; I != E; ++I) {
switch (*I) {
default: hasMore = false; break;
case '\'':
// FIXME: POSIX specific. Always accept?
FS.setHasThousandsGrouping(I);
break;
case '-': FS.setIsLeftJustified(I); break;
case '+': FS.setHasPlusPrefix(I); break;
case ' ': FS.setHasSpacePrefix(I); break;
case '#': FS.setHasAlternativeForm(I); break;
case '0': FS.setHasLeadingZeros(I); break;
}
if (!hasMore)
break;
}
if (I == E) {
// No more characters left?
if (Warn)
H.HandleIncompleteSpecifier(Start, E - Start);
return true;
}