本文整理汇总了C++中kjs::List::size方法的典型用法代码示例。如果您正苦于以下问题:C++ List::size方法的具体用法?C++ List::size怎么用?C++ List::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kjs::List
的用法示例。
在下文中一共展示了List::size方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: frameCount
KJS::Value KstBindDataSource::frameCount(KJS::ExecState *exec, const KJS::List& args) {
QString field;
if (args.size() == 1) {
if (args[0].type() != KJS::StringType) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return KJS::Number(0);
}
field = args[0].toString(exec).qstring();
} else if (args.size() != 0) {
KJS::Object eobj = KJS::Error::create(exec, KJS::SyntaxError, "Requires at most one argument.");
exec->setException(eobj);
return KJS::Number(0);
}
KstDataSourcePtr s = makeSource(_d);
if (!s) {
KJS::Object eobj = KJS::Error::create(exec, KJS::GeneralError);
exec->setException(eobj);
return KJS::Number(0);
}
s->writeLock();
int rc = s->frameCount(field);
s->unlock();
return KJS::Number(rc);
}
示例2: Value
KJS::Value QDirImp::entryInfoList_30( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args )
{
int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1;
int arg1 = (args.size() >= 2) ? args[1].toInteger(exec) : -1;
instance->entryInfoList(
arg0,
arg1 );
return KJS::Value(); // Returns 'const QFileInfoList *'
}
示例3: Boolean
KJS::Value QDirImp::exists_43( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args )
{
QString arg0 = (args.size() >= 1) ? args[0].toString(exec).qstring() : QString::null;
bool arg1 = (args.size() >= 2) ? args[1].toBoolean(exec) : false;
bool ret;
ret = instance->exists(
arg0,
arg1 );
return KJS::Boolean( ret );
}
示例4: String
KJS::Value QDirImp::absFilePath_13( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args )
{
QString arg0 = (args.size() >= 1) ? args[0].toString(exec).qstring() : QString::null;
bool arg1 = (args.size() >= 2) ? args[1].toBoolean(exec) : false;
QString ret;
ret = instance->absFilePath(
arg0,
arg1 );
return KJS::String( ret );
}
示例5: createBinding
KJS::Object QDirLoader::createBinding(KJSEmbedPart *jspart, KJS::ExecState *exec, const KJS::List &args) const
{
JSOpaqueProxy * prx;
if ( args.size() == 0 ) {
prx = new JSOpaqueProxy( new QDir( QDir::current() ), "QDir" );
} else {
QString arg0 = ( args.size() >= 1 ) ? args[ 0 ].toString( exec ).qstring() : QString::null;
prx = new JSOpaqueProxy( new QDir( arg0 ), "QDir" );
}
prx->setOwner( JSProxy::JavaScript );
KJS::Object proxyObj( prx );
addBindings( jspart, exec, proxyObj );
return proxyObj;
}
示例6: construct
KJS::Object KstBindDataSource::construct(KJS::ExecState *exec, const KJS::List& args) {
if (args.size() < 1) {
KJS::Object eobj = KJS::Error::create(exec, KJS::SyntaxError);
exec->setException(eobj);
return KJS::Object();
}
if (args[0].type() != KJS::StringType) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return KJS::Object();
}
QString file = args[0].toString(exec).qstring();
QString type;
if (args.size() == 2) {
if (args[1].type() != KJS::StringType) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return KJS::Object();
}
type = args[1].toString(exec).qstring();
}
bool newSource = false;
KST::dataSourceList.lock().readLock();
KstDataSourcePtr ds = *KST::dataSourceList.findFileName(file);
KST::dataSourceList.lock().unlock();
if (!ds) {
ds = KstDataSource::loadSource(file, type);
newSource = true;
}
if (!ds) {
KJS::Object eobj = KJS::Error::create(exec, KJS::GeneralError);
exec->setException(eobj);
return KJS::Object();
}
if (newSource) {
KST::dataSourceList.lock().writeLock();
KST::dataSourceList.append(ds);
KST::dataSourceList.lock().unlock();
}
return KJS::Object(new KstBindDataSource(exec, ds));
}
示例7: convertToValue
KJS::Value QDirImp::entryList_28( KJS::ExecState *exec, KJS::Object &obj, const KJS::List &args )
{
int arg0 = (args.size() >= 1) ? args[0].toInteger(exec) : -1;
int arg1 = (args.size() >= 2) ? args[1].toInteger(exec) : -1;
QStringList ret;
ret = instance->entryList(
arg0,
arg1 );
return convertToValue( exec, ret );
}
示例8: samplesPerFrame
KJS::Value KstBindDataSource::samplesPerFrame(KJS::ExecState *exec, const KJS::List& args) {
if (args.size() != 1) {
KJS::Object eobj = KJS::Error::create(exec, KJS::SyntaxError, "Requires exactly one argument.");
exec->setException(eobj);
return KJS::Number(0);
}
if (args[0].type() != KJS::StringType) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return KJS::Number(0);
}
KstDataSourcePtr s = makeSource(_d);
if (!s) {
KJS::Object eobj = KJS::Error::create(exec, KJS::GeneralError);
exec->setException(eobj);
return KJS::Number(0);
}
s->writeLock();
int rc = s->samplesPerFrame(args[0].toString(exec).qstring());
s->unlock();
return KJS::Number(rc);
}
示例9: isValidField
KJS::Value KstBindDataSource::isValidField(KJS::ExecState *exec, const KJS::List& args) {
if (args.size() != 1) {
KJS::Object eobj = KJS::Error::create(exec, KJS::SyntaxError, "Requires exactly one argument.");
exec->setException(eobj);
return KJS::Boolean(false);
}
if (args[0].type() != KJS::StringType) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return KJS::Boolean(false);
}
KstDataSourcePtr s = makeSource(_d);
if (!s) {
KJS::Object eobj = KJS::Error::create(exec, KJS::GeneralError);
exec->setException(eobj);
return KJS::Boolean(false);
}
s->writeLock();
bool rc = s->isValidField(args[0].toString(exec).qstring());
s->unlock();
return KJS::Boolean(rc);
}
示例10: loadScript
KJS::Value KstBindKst::loadScript(KJS::ExecState *exec, const KJS::List& args) {
if (args.size() != 1) {
KJS::Object eobj = KJS::Error::create(exec, KJS::SyntaxError);
exec->setException(eobj);
return KJS::Undefined();
}
if (args[0].type() != KJS::StringType) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return KJS::Undefined();
}
QString fn = args[0].toString(exec).qstring();
if (!QFile::exists(fn)) { // One day make this support KIO FIXME
return KJS::Boolean(false);
}
if (_ext->part()->runFile(fn)) {
// FIXME: add to the script registry
} else {
KJS::Completion c = _ext->part()->completion();
if (!c.isNull()) {
QString err = c.toString(_ext->part()->globalExec()).qstring();
KstDebug::self()->log(i18n("Error running script %1: %2").arg(fn).arg(err), KstDebug::Error);
} else {
KstDebug::self()->log(i18n("Unknown error running script %1.").arg(fn), KstDebug::Error);
}
return KJS::Boolean(false);
}
return KJS::Boolean(true);
}
示例11: construct
KJS::Object KstBindPoint::construct(KJS::ExecState *exec, const KJS::List& args) {
if (args.size() == 0) {
return KJS::Object(new KstBindPoint(exec, 0, 0));
}
if (args.size() != 2) {
KJS::Object eobj = KJS::Error::create(exec, KJS::SyntaxError);
exec->setException(eobj);
return KJS::Object();
}
if (args[0].type() != KJS::NumberType || args[1].type() != KJS::NumberType) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return KJS::Object();
}
return KJS::Object(new KstBindPoint(exec, args[0].toNumber(exec), args[1].toNumber(exec)));
}
示例12: purge
KJS::Value KstBindKst::purge(KJS::ExecState *exec, const KJS::List& args) {
if (args.size() != 0) {
KJS::Object eobj = KJS::Error::create(exec, KJS::SyntaxError);
exec->setException(eobj);
return KJS::Undefined();
}
KstApp::inst()->document()->purge();
return KJS::Undefined();
}