• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ download函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中download函数的典型用法代码示例。如果您正苦于以下问题:C++ download函数的具体用法?C++ download怎么用?C++ download使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了download函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch

int DownloadManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: downloadComplete(); break;
        case 1: progress((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: downloadStatus((*reinterpret_cast< float(*)>(_a[1]))); break;
        case 3: downloadStarted(); break;
        case 4: cancel(); break;
        case 5: download((*reinterpret_cast< QUrl(*)>(_a[1]))); break;
        case 6: pause(); break;
        case 7: resume(); break;
        case 8: download((*reinterpret_cast< QNetworkRequest(*)>(_a[1]))); break;
        case 9: finished(); break;
        case 10: downloadProgress((*reinterpret_cast< qint64(*)>(_a[1])),(*reinterpret_cast< qint64(*)>(_a[2]))); break;
        case 11: error((*reinterpret_cast< QNetworkReply::NetworkError(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 12;
    }
    return _id;
}
开发者ID:Allstar12345,项目名称:Star-Player-Symbian,代码行数:25,代码来源:moc_downloadmanager.cpp


示例2: InitCode

InitCode() {
	  void *d1, *d2, *maind;
	  extern void *download();
    d1 = download( RPC_io_code, sizeof( RPC_io_code));
    d2 = download( RPC_mo_code, sizeof( RPC_io_code));
    drop(d1, d2);
}
开发者ID:metacore,项目名称:spin,代码行数:7,代码来源:rpc.c


示例3: catch

cached<T>::cached(context_t& context, const std::string& collection, const std::string& name) {
    api::category_traits<api::storage_t>::ptr_type cache;

    try {
        cache = api::storage(context, "cache");
    } catch(const api::repository_error_t& e) {
        download(context, collection, name);
        return;
    }

    T& object = static_cast<T&>(*this);

    try {
        object = cache->get<T>(collection, name);
    } catch(const storage_error_t& e) {
        download(context, collection, name);

        try {
            cache->put(collection, name, object, std::vector<std::string>());
        } catch(const storage_error_t& e) {
            throw storage_error_t("unable to cache object '%s' in '%s' - %s", name, collection, e.what());
        }

        return;
    }

    m_source = sources::cache;
}
开发者ID:andrewpsp,项目名称:cocaine-core,代码行数:28,代码来源:cached.hpp


示例4: connect

void ListEngine::connectDownloader()
{
    connect(this, SIGNAL(download(QUrl,QUrl)), m_parent->downloader(), SLOT(download(QUrl,QUrl)));
    connect(m_parent->downloader(), SIGNAL(downloadComplete(QUrl,QUrl)), this, SLOT(downloadComplete(QUrl,QUrl)));
    connect(this, SIGNAL(listDir(QUrl)), m_parent->downloader(), SLOT(listDir(QUrl)));
    connect(m_parent->downloader(), SIGNAL(listingComplete(QUrl)), this, SLOT(listingComplete(QUrl)));
}
开发者ID:KDE,项目名称:bangarang,代码行数:7,代码来源:listengine.cpp


示例5: downloadMarkerPath

void LLUpdateDownloader::Implementation::resume(void)
{
	mCancelled = false;

	if(isDownloading()) {
		mClient.downloadError("download in progress");
	}

	mDownloadRecordPath = downloadMarkerPath();
	llifstream dataStream(mDownloadRecordPath);
	if(!dataStream) {
		mClient.downloadError("no download marker");
		return;
	}
	
	LLSDSerialize::fromXMLDocument(mDownloadData, dataStream);
	
	if(!mDownloadData.asBoolean()) {
		mClient.downloadError("no download information in marker");
		return;
	}
	
	std::string filePath = mDownloadData["path"].asString();
	try {
		if(LLFile::isfile(filePath)) {		
			llstat fileStatus;
			LLFile::stat(filePath, &fileStatus);
			if(fileStatus.st_size != mDownloadData["size"].asInteger()) {
				resumeDownloading(fileStatus.st_size);
			} else if(!validateDownload()) {
				LLFile::remove(filePath);
				download(LLURI(mDownloadData["url"].asString()), 
						 mDownloadData["hash"].asString(),
						 mDownloadData["update_version"].asString(),
						 mDownloadData["required"].asBoolean());
			} else {
				mClient.downloadComplete(mDownloadData);
			}
		} else {
			download(LLURI(mDownloadData["url"].asString()), 
					 mDownloadData["hash"].asString(),
					 mDownloadData["update_version"].asString(),
					 mDownloadData["required"].asBoolean());
		}
	} catch(DownloadError & e) {
		mClient.downloadError(e.what());
	}
}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:48,代码来源:llupdatedownloader.cpp


示例6: _dlinfos

RsCollectionDialog::RsCollectionDialog(const QString& CollectionFileName,const std::vector<RsCollectionFile::DLinfo>& dlinfos)
	: _dlinfos(dlinfos),_filename(CollectionFileName)
{
	setupUi(this) ;

	setWindowFlags(Qt::Window); // for maximize button
	setWindowFlags(windowFlags() & ~Qt::WindowMinimizeButtonHint);

	setWindowTitle(QString("%1 - %2").arg(windowTitle()).arg(QFileInfo(_filename).completeBaseName()));

	// 1 - add all elements to the list.

	_fileEntriesTW->setColumnCount(3) ;

	QTreeWidgetItem *headerItem = _fileEntriesTW->headerItem();
	headerItem->setText(0, tr("File"));
	headerItem->setText(1, tr("Size"));
	headerItem->setText(2, tr("Hash"));

	uint32_t size = dlinfos.size();

	uint64_t total_size ;
	uint32_t total_files ;

	for(uint32_t i=0;i<size;++i)
	{
		const RsCollectionFile::DLinfo &dlinfo = dlinfos[i];

		QTreeWidgetItem *item = new QTreeWidgetItem;

		item->setFlags(Qt::ItemIsUserCheckable | item->flags());
		item->setCheckState(0, Qt::Checked);
		item->setData(0, Qt::UserRole, i);
		item->setText(0, dlinfo.path + "/" + dlinfo.name);
		item->setText(1, misc::friendlyUnit(dlinfo.size));
		item->setText(2, dlinfo.hash);

		_fileEntriesTW->addTopLevelItem(item);

		total_size += dlinfo.size ;
		total_files++ ;
	}

	_filename_TL->setText(_filename) ;
	for (int column = 0; column < _fileEntriesTW->columnCount(); ++column) {
		_fileEntriesTW->resizeColumnToContents(column);
	}

	updateSizes() ;

	// 2 - connect necessary signals/slots

	connectUpdate(true);
	connect(_selectAll_PB,SIGNAL(clicked()),this,SLOT(selectAll())) ;
	connect(_deselectAll_PB,SIGNAL(clicked()),this,SLOT(deselectAll())) ;
	connect(_cancel_PB,SIGNAL(clicked()),this,SLOT(cancel())) ;
	connect(_download_PB,SIGNAL(clicked()),this,SLOT(download())) ;

	_fileEntriesTW->installEventFilter(this);
}
开发者ID:coyotama,项目名称:retroshare,代码行数:60,代码来源:RsCollectionDialog.cpp


示例7: open_fpkl

static FILE* open_fpkl()
{
	if (system("mkdir -p /data/FeOS/FPM") != 0)
		return NULL;

	time_t srvTime;
	if (!get_cur_pkgtime(&srvTime))
		return NULL;

	time_t localTime = 0;

	do
	{
		FILE* f = fopen("/data/FeOS/FPM/time", "rb");
		if (!f) break;

		fread(&localTime, sizeof(localTime), 1, f);
		fclose(f);
	} while(0);

	if (srvTime > localTime)
	{
		// Need to upgrade!
		printf("Downloading package list...\n");
		if (!download("/fpkg/", "/data/FeOS/FPM/packages.fpkl", NULL))
			return NULL;
		FILE* f = fopen("/data/FeOS/FPM/time", "wb");
		if (!f)
			return NULL;
		fwrite(&srvTime, sizeof(srvTime), 1, f);
		fclose(f);
	}

	return fopen("/data/FeOS/FPM/packages.fpkl", "rb");
}
开发者ID:fincs,项目名称:FeOS,代码行数:35,代码来源:pkglist.c


示例8: sbcl_bin_download

int sbcl_bin_download(struct install_options* param) {
  int result;
  char* home=configdir();
  char* arch=arch_(param);
  char* uri=get_opt("sbcl-bin-uri",0);
  cond_printf(1,"sbcl_bin_download\n");
  int retry=10;
  do {
    param->expand_path=cat(home,"src",SLASH,"sbcl","-",param->version,"-",arch,SLASH,NULL);
    impls_sbcl_bin.uri=cat(uri?uri:SBCL_BIN_URI ,param->version,"/sbcl-",param->version,
                           "-",arch,"-binary",sbcl_bin_extention(param),NULL);
    result = download(param);
    if(!result && param->version_not_specified) {
      int len = strlen(param->version)-1;
      if('1'<= param->version[len] && param->version[len] <= '9') {
        param->version[len]--;
        s(param->expand_path),s(impls_sbcl_bin.uri);
      }else if('2' <= param->version[len-1] && param->version[len-1] <= '9') {
        param->version[len-1]--;
        param->version[len] = '9';
        s(param->expand_path),s(impls_sbcl_bin.uri);
      }else if('1' == param->version[len-1]) {
        param->version[len-1] = '9';
        param->version[len] = '\0';
        s(param->expand_path),s(impls_sbcl_bin.uri);
      }else{
        s(arch),s(home);
        return 0;
      }
    }
  }while (!result && retry--);
  s(arch),s(home);
  return !!result;
}
开发者ID:roswell,项目名称:roswell,代码行数:34,代码来源:install-sbcl-bin.c


示例9: tileForCoordinate

void SlippyMap::invalidate()
{
    if (width <= 0 || height <= 0)
        return;

    const QPointF ct = tileForCoordinate(latitude, longitude, zoom);
    const qreal tx = ct.x();
    const qreal ty = ct.y();

    // top-left corner of the center tile
    const int xp = width / 2 - (tx - floor(tx)) * tdim;
    const int yp = height / 2 - (ty - floor(ty)) * tdim;

    // first tile vertical and horizontal
    const int xa = (xp + tdim - 1) / tdim;
    const int ya = (yp + tdim - 1) / tdim;
    const int xs = static_cast<int>(tx) - xa;
    const int ys = static_cast<int>(ty) - ya;

    // offset for top-left tile
    m_offset = QPoint(xp - xa * tdim, yp - ya * tdim);

    // last tile vertical and horizontal
    const int xe = static_cast<int>(tx) + (width - xp - 1) / tdim;
    const int ye = static_cast<int>(ty) + (height - yp - 1) / tdim;

    // build a rect
    m_tilesRect = QRect(xs, ys, xe - xs + 1, ye - ys + 1);

    if (m_url.isEmpty())
        download();

    emit updated(QRect(0, 0, width, height));
}
开发者ID:caybro,项目名称:pedikree,代码行数:34,代码来源:slippymap.cpp


示例10: qDebug

void CachedImage::_setProperties()
{
    if (!_headReply)
        return;

    if (_headReply->error() != QNetworkReply::NoError)
    {
        _headReply->deleteLater();
        _headReply = nullptr;

        return;
    }

    auto mime = _headReply->header(QNetworkRequest::ContentTypeHeader).toString().split('/');
    if (mime.isEmpty())
        mime << "";

    if (!mime.first().isEmpty() && mime.first().toLower() != "image")
        qDebug() << "mime:" << mime.first() << "\nurl:" << _url;

    setExtension(mime.last());

    auto length = _headReply->header(QNetworkRequest::ContentLengthHeader).toInt();
    _kbytesTotal = length / 1024;

    emit totalChanged();

    _headReply->deleteLater();
    _headReply = nullptr;

    if (_man->autoload(_kbytesTotal))
        download();
}
开发者ID:sevings,项目名称:Taaasty,代码行数:33,代码来源:cachedimage.cpp


示例11: decodeName

void BrowserDialog::linkClicked(const QUrl& url)
{
    do {
        if (url.host() != DOWNLOAD_HOST_BASE) {
            break;
        }
        if (url.path() != "/dict/download_cell.php") {
            break;
        }
        QString id = url.queryItemValue("id");
        QByteArray name = url.encodedQueryItemValue("name");
        QString sname = decodeName(name);

        m_name = sname;

        if (!id.isEmpty() && !sname.isEmpty()) {
            download(url);
            return;
        }
    } while(0);

    if (url.host() != HOST_BASE) {
        QMessageBox::information(this, _("Wrong Link"),
                                 _("No browsing outside pinyin.sogou.com, now redirect to home page."));
        m_ui->webView->load(QUrl(URL_BASE));
    } else {
        m_ui->webView->load(url);
    }
}
开发者ID:HenryHu,项目名称:fcitx-libpinyin,代码行数:29,代码来源:browserdialog.cpp


示例12: fileInfo

void DownloadM::download( QUrl url , QString matchMd5 )
{
    url0 = url;
    QFileInfo fileInfo(url.path());
    QString filename;
    filename=fileInfo.fileName();

    curentMd5 = matchMd5;

    dDlSizeAtPause = 0;
    dCurrentRequest = QNetworkRequest(url);

    // remove the older file that has the same name
    if(filename.contains(".pk3", Qt::CaseInsensitive) || filename.contains(".cfg", Qt::CaseInsensitive)
            || filename.contains(".txt", Qt::CaseInsensitive))

        QFile::remove(assetsDir+"/"+filename);

    else
        QFile::remove(filename);

    dFile = new QFile(filename);
    dFile->open(QIODevice::ReadWrite);

    downloadTime.start();

    download(dCurrentRequest);
}
开发者ID:Barbatos,项目名称:UrbanTerror-Updater-v3,代码行数:28,代码来源:download.cpp


示例13: CCLOG

void AssetsUpdateLayer::update(float delta)
{
    if (1 || m_curBigVersion >= m_endBigVersion && m_curSmallVersion >= m_endSmallVersion)
    {
        CCLOG("Version check Ok");
        unscheduleUpdate();
        //MD5Check();
        gameEnter();
        return;
    }
    if (!m_isDownloading && checkUpdate())
    {
        createLayerItem();

        char str[128];
        sprintf(str, "%s%s%d.%d.%d.zip", SERVER_ADDRESS, ASSETS_SERVER_PATH, m_curBigVersion, m_curMidVersion, m_curSmallVersion + 1);
        getAssetsManager()->setPackageUrl(str);
        sprintf(str, "%d.%d.%d", m_curBigVersion, m_curMidVersion, m_curSmallVersion + 1);
        getAssetsManager()->setVersionFileUrl(str);
        getAssetsManager()->setStoragePath(m_pathToSave.c_str());

        //sprintf(str, Localization::getInstance()->getValueByKey("Loading_download_restBag_num"), m_endSmallVersion - m_curSmallVersion);
        //m_packegNumberLabel->setString(str);

        m_curPackageLength = 0;
        //getAssetsManager()->getPackageLength((long&)m_packageLength);

        m_isDownloading = true;
        download();
    }
}
开发者ID:sharpfforg,项目名称:us,代码行数:31,代码来源:AssetsUpdateLayer.cpp


示例14: selectedRow

void LibrariesForm::on_downloadButton_clicked()
{
    int row = selectedRow();
    if (row == -1)
        return;
    download(librariesModel->get()[row]);
}
开发者ID:TheMrButcher,项目名称:gamebase_manager,代码行数:7,代码来源:librariesform.cpp


示例15: allocateBuffer

    PixelBox GL3PlusHardwarePixelBuffer::lockImpl( const Image::Box &lockBox, LockOptions options )
    {
        //Allocate memory for the entire image, as the buffer
        //maynot be freed and be reused in subsequent calls.
        allocateBuffer( PixelUtil::getMemorySize( mWidth, mHeight, mDepth, mFormat ) );

        mBuffer = PixelBox( lockBox.getWidth(), lockBox.getHeight(),
                            lockBox.getDepth(), mFormat, mBuffer.data );
        mCurrentLock = mBuffer;
        mCurrentLock.left    = lockBox.left;
        mCurrentLock.right  += lockBox.left;
        mCurrentLock.top     = lockBox.top;
        mCurrentLock.bottom += lockBox.top;

        if(options != HardwareBuffer::HBL_DISCARD)
        {
            // Download the old contents of the texture
            download( mCurrentLock );
        }
        mCurrentLockOptions = options;
        mLockedBox = lockBox;
        mCurrentLock = mBuffer;

        return mBuffer;
    }
开发者ID:devxkh,项目名称:FrankE,代码行数:25,代码来源:OgreGL3PlusHardwarePixelBuffer.cpp


示例16: download

std::string
Downloader::download(const std::string& url)
{
  std::string result;
  download(url, my_curl_string_append, &result);
  return result;
}
开发者ID:eegorov,项目名称:supertux,代码行数:7,代码来源:downloader.cpp


示例17: dcassert

void DirectoryListing::download(const string& aDir, const string& aTarget, bool highPrio) {
    dcassert(aDir.size() > 2);
    dcassert(aDir[aDir.size() - 1] == '\\'); // This should not be PATH_SEPARATOR
    Directory* d = find(aDir, getRoot());
    if(d != NULL)
        download(d, aTarget, highPrio);
}
开发者ID:bhaavanmerchant,项目名称:eiskaltdcpp,代码行数:7,代码来源:DirectoryListing.cpp


示例18: unit_test_create_cmds

void unit_test_create_cmds()
{
    std::vector<std::string> articles;
    for (int i=0; i<10000; ++i)
        articles.push_back(boost::lexical_cast<std::string>(i));

    std::size_t cmd_number = 0;

    nf::download download({"alt.binaries.foobar"}, articles, "", "test");
    nf::session session;
    session.on_send = [&](const std::string& cmd) {
        BOOST_REQUIRE(cmd == "BODY " +
            boost::lexical_cast<std::string>(cmd_number) + "\r\n");
        ++cmd_number;
    };

    session.enable_pipelining(true);

    for (;;)
    {
        auto cmds = download.create_commands();
        if (!cmds)
            break;

        cmds->submit_data_commands(session);
        session.send_next();
    }
    BOOST_REQUIRE(cmd_number == articles.size());

}
开发者ID:ensisoft,项目名称:newsflash-plus,代码行数:30,代码来源:unit_test_download.cpp


示例19: Out

	void MetadataDownload::downloadNext()
	{
        Out(SYS_GEN|LOG_NOTICE) << "Metadata download, requesting " << pieces.getNumBits() << " pieces" << endl;
		for (Uint32 i = 0;i < pieces.getNumBits();i++)
			if (!pieces.get(i))
				download(i);
	}
开发者ID:dreamsxin,项目名称:libktorrent,代码行数:7,代码来源:metadatadownload.cpp


示例20: QRegion

QRegion TCacheResource::download(TTile &tile)
{
	if (!checkTile(tile))
		return QRegion();

	return download(TPoint(tile.m_pos.x, tile.m_pos.y), tile.getRaster());
}
开发者ID:GREYFOXRGR,项目名称:opentoonz,代码行数:7,代码来源:tcacheresource.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ downloadFile函数代码示例发布时间:2022-05-30
下一篇:
C++ down_write_nested函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap