本文整理汇总了C++中AutoPtr::AddAlias方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoPtr::AddAlias方法的具体用法?C++ AutoPtr::AddAlias怎么用?C++ AutoPtr::AddAlias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutoPtr
的用法示例。
在下文中一共展示了AutoPtr::AddAlias方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdatePropertyServiceTable
void Provider::UpdatePropertyServiceTable()
{
AutoPtr<IProviderService> s;
String serviceName;
String algorithm;
Boolean isEmpty;
if (mChangedProperties == NULL || (mChangedProperties->IsEmpty(&isEmpty), isEmpty)) {
return;
}
AutoPtr<ISet> entrySet;
mChangedProperties->GetEntrySet((ISet**)&entrySet);
AutoPtr<IIterator> it;
entrySet->GetIterator((IIterator**)&it);
Boolean hasNext;
while (it->HasNext(&hasNext), hasNext) {
AutoPtr<IMapEntry> entry;
it->GetNext((IInterface**)&entry);
AutoPtr<IInterface> _key;
AutoPtr<IInterface> _value;
entry->GetKey((IInterface**)&_key);
entry->GetValue((IInterface**)&_value);
if (_key == NULL || _value == NULL || (IString::Probe(_key) == NULL)
|| (IString::Probe(_value) == NULL)) {
continue;
}
String key, value;
ICharSequence::Probe(_key)->ToString(&key);
ICharSequence::Probe(_value)->ToString(&value);
if (key.StartWith("Provider")) {
// Provider service type is reserved
continue;
}
Int32 i;
if (key.StartWith("Alg.Alias.")) {
// Alg.Alias.<crypto_service>.<aliasName>=<standardName>
String aliasName;
String service_alias = key.Substring(10);
i = service_alias.IndexOf('.');
serviceName = service_alias.Substring(0, i);
aliasName = service_alias.Substring(i + 1);
algorithm = value;
String propertyServiceTableKey = Key(serviceName, algorithm);
AutoPtr<IInterface> o;
if (mPropertyServiceTable == NULL) {
CLinkedHashMap::New(128, (ILinkedHashMap**)&mPropertyServiceTable);
}
else {
AutoPtr<ICharSequence> keyObj;
CString::New(propertyServiceTableKey, (ICharSequence**)&keyObj);
mPropertyServiceTable->Get(keyObj, (IInterface**)&o);
}
if (o != NULL) {
s = IProviderService::Probe(o);
s->AddAlias(aliasName);
if (mPropertyAliasTable == NULL) {
CLinkedHashMap::New(256, (ILinkedHashMap**)&mPropertyAliasTable);
}
AutoPtr<ICharSequence> keyObj;
CString::New(Key(serviceName, aliasName), (ICharSequence**)&keyObj);
mPropertyAliasTable->Put(keyObj, s);
}
else {
AutoPtr<ICharSequence> keyObj;
CString::New(serviceName + "." + algorithm, (ICharSequence**)&keyObj);
AutoPtr<IInterface> valueObj;
mChangedProperties->Get(keyObj, (IInterface**)&valueObj);
String className;
ICharSequence::Probe(valueObj)->ToString(&className);
if (!className.IsNull()) {
AutoPtr<IList> l;
CArrayList::New((IList**)&l);
AutoPtr<ICharSequence> aliasNameObj;
CString::New(aliasName, (ICharSequence**)&aliasNameObj);
l->Add(aliasNameObj);
AutoPtr<IMap> attributes;
CHashMap::New((IMap**)&attributes);
s = NULL;
CProviderService::New(this, serviceName, algorithm, className,
l, attributes, (IProviderService**)&s);
keyObj = NULL;
CString::New(propertyServiceTableKey, (ICharSequence**)&keyObj);
mPropertyServiceTable->Put(keyObj, s);
if (mPropertyAliasTable == NULL) {
CLinkedHashMap::New(256, (ILinkedHashMap**)&mPropertyAliasTable);
}
keyObj = NULL;
CString::New(Key(serviceName, aliasName), (ICharSequence**)&keyObj);
mPropertyAliasTable->Put(keyObj, s);
}
}
continue;
}
Int32 j = key.IndexOf('.');
if (j == -1) { // unknown format
continue;
}
i = key.IndexOf(' ');
if (i == -1) { // <crypto_service>.<algorithm_or_type>=<className>
serviceName = key.Substring(0, j);
algorithm = key.Substring(j + 1);
//.........这里部分代码省略.........