本文整理汇总了C++中SecureString::UnsecuredStringFinished方法的典型用法代码示例。如果您正苦于以下问题:C++ SecureString::UnsecuredStringFinished方法的具体用法?C++ SecureString::UnsecuredStringFinished怎么用?C++ SecureString::UnsecuredStringFinished使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SecureString
的用法示例。
在下文中一共展示了SecureString::UnsecuredStringFinished方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: myLabelcompare
bool myLabelcompare(SecureString a, SecureString b)
{
const char* aStr = a.getUnsecureString();
const char* bStr = b.getUnsecureString();
bool res = _strcmpi(aStr, bStr) < 0;
a.UnsecuredStringFinished();
b.UnsecuredStringFinished();
return res;
}
示例2: myPwdCompare
bool myPwdCompare(Pwd* a, Pwd* b)
{
SecureString aSstr = a->GetDescription();
const char* aStr = aSstr.getUnsecureString();
SecureString bSstr = b->GetDescription();
const char* bStr = bSstr.getUnsecureString();
bool res = _strcmpi(aStr, bStr) < 0;
aSstr.UnsecuredStringFinished();
bSstr.UnsecuredStringFinished();
return res;
}
示例3: Filter
PwdList::PwdVector PwdList::Filter(const SecureString& pattern, const PwdLabelVector& labels)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
PwdVector filtered;
if (pattern.length() > 0)
{
SecureString patternCpy = pattern;
char* strPtrn = (char*)patternCpy.getUnsecureString();
for (auto it = pwds.begin(); it != pwds.end(); it++)
{
SecureString description = (*it)->GetDescription();
if (strcasestr((char*)description.getUnsecureString(), strPtrn) != NULL)
{
filtered.push_back((*it));
}
description.UnsecuredStringFinished();
}
patternCpy.UnsecuredStringFinished();
}
else {
filtered = PwdVector(pwds.begin(), pwds.end());
}
if (labels.size() > 0)
{
for (auto iLabel = labels.begin(); iLabel != labels.end(); iLabel++)
{
PwdVector passed;
for (auto iPwd = filtered.begin(); iPwd != filtered.end(); iPwd++)
{
if ((*iPwd)->HasLabel(*iLabel))
{
passed.push_back(*iPwd);
}
}
filtered = passed;
}
}
pwds.sort(myPwdCompare);
return filtered;
}
示例4: FilterLabels
PwdLabelVector PwdList::FilterLabels(SecureString pattern)
{
std::lock_guard<std::recursive_mutex> lock(mutex_lock);
PwdLabelVector vector;
const char* strPtrn = pattern.getUnsecureString();
for (auto it = existingLabels.begin(); it != existingLabels.end(); it++)
{
if (strstr(strPtrn, (*it).getUnsecureString()) != NULL)
{
vector.push_back((*it));
}
(*it).UnsecuredStringFinished();
}
pattern.UnsecuredStringFinished();
std::sort(vector.begin(), vector.end(), myLabelcompare);
return vector;
}