当前位置: 首页>>代码示例>>C++>>正文


C++ List::size方法代码示例

本文整理汇总了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);
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:29,代码来源:bind_datasource.cpp

示例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 *'

}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:13,代码来源:qdir_imp.cpp

示例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 );

}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:14,代码来源:qdir_imp.cpp

示例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 );

}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:14,代码来源:qdir_imp.cpp

示例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;
 }
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:14,代码来源:qdir_imp.cpp

示例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));
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:49,代码来源:bind_datasource.cpp

示例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 );

}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:15,代码来源:qdir_imp.cpp

示例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);
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:26,代码来源:bind_datasource.cpp

示例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);
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:26,代码来源:bind_datasource.cpp

示例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);
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:33,代码来源:bind_kst.cpp

示例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)));
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:19,代码来源:bind_point.cpp

示例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();
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:10,代码来源:bind_kst.cpp


注:本文中的kjs::List::size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。