本文整理汇总了C++中kjs::Identifier::ustring方法的典型用法代码示例。如果您正苦于以下问题:C++ Identifier::ustring方法的具体用法?C++ Identifier::ustring怎么用?C++ Identifier::ustring使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kjs::Identifier
的用法示例。
在下文中一共展示了Identifier::ustring方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get
KJS::Value JSObjectProxy::get( KJS::ExecState *exec, const KJS::Identifier &p ) const {
if ( !isAllowed( exec->interpreter() ) ) {
kdWarning() << "JS get request from unknown interpreter, ignoring" << endl;
return KJS::Null();
}
if ( !policy->isPropertyAllowed( this, obj, p.ascii() ) )
return ObjectImp::get( exec, p );
if ( !obj ) {
kdDebug( 80001 ) << "JS getting '" << p.ustring().qstring() << "' but qobj has died" << endl;
return ObjectImp::get( exec, p );
}
kdDebug( 80001 ) << "JS getting '" << p.ascii() << endl;
// Properties
QString prop = p.ustring().qstring();
QMetaObject *meta = obj->metaObject();
if ( meta->findProperty( p.ascii(), true ) != -1 ) {
QVariant val = obj->property( prop.ascii() );
kdDebug( 80001 ) << "JS getting '" << p.ascii() << "' ( " << val.typeName() << ")" << endl;
return convertToValue( exec, val );
}
return ObjectImp::get
( exec, p );
}
示例2: constructorList
KJS::List KJSEmbedPart::constructorList() const
{
KJS::List items;
KJS::Object obj = js->globalObject();
KJS::ExecState *exec = js->globalExec();
KJS::ReferenceList l = obj.propList( exec );
KJS::ReferenceListIterator propIt = l.begin();
while ( propIt != l.end() ) {
KJS::Identifier name = propIt->getPropertyName( exec );
if ( obj.hasProperty( exec, name ) ) {
KJS::Value v = obj.get( exec, name );
KJS::Object vobj = v.toObject( exec );
if ( vobj.implementsConstruct() )
items.append( KJS::String( name.ustring() ) );
}
propIt++;
}
return items;
}
示例3: empty
PassRefPtr<StringImpl> AtomicString::add(const KJS::Identifier& identifier)
{
if (identifier.isNull())
return 0;
UString::Rep* string = identifier.ustring().rep();
unsigned length = string->size();
if (!length)
return StringImpl::empty();
HashAndCharacters buffer = { string->computedHash(), string->data(), length };
pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable->add<HashAndCharacters, HashAndCharactersTranslator>(buffer);
if (!addResult.second)
return *addResult.first;
return adoptRef(*addResult.first);
}