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

C++ deleteRecord函数代码示例

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

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



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

示例1: return

int FileSystem::addInformationToFile()
{//Обозначаем переменные
	string FileName;
	int InformationCount;//Кол-во добавляемой информации, 
	int CountLength=8;
	int resultCode = 1;
	int lenCritical = 48;
	int CntCritical = 2 ^ 16;
	//int BlockNf, SegmNf, BlockNs, SegmNs; //Номер блока , номер сегмента
	FileDescriptor AddFile;
	FileDescriptor NextFile;
	//FileDescriptor LastFile;
	int ResultCount;
	int freeSpace; //кол-во свободных блоков перед следующим файлом
	int RecordNumber,NextRecordNumber; //Номер изменяемой записи, номер следующей записи
	int i; //Счетчик

	//Собствено функция
	cout << "Введите имя файла" << endl;
	cin >> FileName;
	if (getRecordNumber(FileName)==0)//Проверка ввода имени
		return(1);

	cout << "Введите кол-во добавляемой информации" << endl;
	cin >> InformationCount;
	InformationCount=InformationCount/512+1;

	AddFile = getRecord(FileName);
	if ((AddFile.descriptorType) == "0010000000000000")					//!!!!!!!в дескрипторе число блоков сделал интом!!!!!!
		return(1);
	RecordNumber=getRecordNumber(FileName);
	NextRecordNumber=RecordNumber+1;
	NextFile=getRecord(NextRecordNumber);
	
	
	if ((toInt(AddFile.firstBlockNumber) + AddFile.blockCount + InformationCount) > (toInt(NextFile.firstBlockNumber)))
	{
		//LastFile=AddFile;
		//LastFile.blockCount+=InformationCount;
		AddFile.blockCount+=InformationCount;
		for(i=217;((getRecord(i).fileType)=="");i--)
		//LastFile.firstBlockNumber=toString((toInt(getRecord(i).firstBlockNumber)+getRecord(i).blockCount+1),8);
		AddFile.firstBlockNumber=toString((toInt(getRecord(i).firstBlockNumber)+getRecord(i).blockCount+1),8);
		deleteRecord(FileName);
		//writeRecord(LastFile);
		writeRecord(AddFile);
		resultCode=0;
	}
	else 
	{
		AddFile.blockCount=(AddFile.blockCount+InformationCount);
		deleteRecord(FileName);
		writeRecord(AddFile,RecordNumber);
		resultCode=0;
	}
	return(resultCode);
};
开发者ID:Guuugol,项目名称:FileSystem,代码行数:57,代码来源:addInformationToFile.cpp


示例2: QWidget

void StocksDialog::createDataPage ()
{
    QWidget *w = new QWidget(this);

    Q3VBoxLayout *vbox = new Q3VBoxLayout(w);
    vbox->setMargin(5);
    vbox->setSpacing(0);

    barEdit = new BarEdit(w);
    QString s = tr("Open");
    QString s2 = "Open";
    barEdit->createField(s, s2, FALSE);
    s = tr("High");
    s2 = "High";
    barEdit->createField(s, s2, FALSE);
    s = tr("Low");
    s2 = "Low";
    barEdit->createField(s, s2, FALSE);
    s = tr("Close");
    s2 = "Close";
    barEdit->createField(s, s2, FALSE);
    s = tr("Volume");
    s2 = "Volume";
    barEdit->createField(s, s2, FALSE);
    connect(barEdit, SIGNAL(signalDeleteRecord()), this, SLOT(deleteRecord()));
    connect(barEdit, SIGNAL(signalSaveRecord()), this, SLOT(saveRecord()));
    connect(barEdit, SIGNAL(signalSearch(QDateTime)), this, SLOT(slotDateSearch(QDateTime)));
    connect(barEdit, SIGNAL(signalFirstRecord()), this, SLOT(slotFirstRecord()));
    connect(barEdit, SIGNAL(signalLastRecord()), this, SLOT(slotLastRecord()));
    connect(barEdit, SIGNAL(signalPrevRecord()), this, SLOT(slotPrevRecord()));
    connect(barEdit, SIGNAL(signalNextRecord()), this, SLOT(slotNextRecord()));
    vbox->addWidget(barEdit);

    addTab(w, tr("Data"));
}
开发者ID:redrhino,项目名称:qtstalker-qt4,代码行数:35,代码来源:StocksDialog.cpp


示例3: while

/*
 * destructor, free all ressources
 *
 */
AutoFocus::~AutoFocus()
{
	for (uint32_t i=0; i<hashSize; i++) {
		if (listIPRecords[i].size()==0) continue;

		list<IPRecord*>::iterator iter = listIPRecords[i].begin();
		while (iter != listIPRecords[i].end()) {
			std::map<report_enum,af_attribute*>::iterator iter2 = (*iter)->m_attributes.begin();

			while (iter2 != (*iter)->m_attributes.end())	
			{
				delete (iter2->second);	
				iter2++;
			}
			delete *iter;
			iter++;
		}
		listIPRecords[i].clear();
	}

	delete[] listIPRecords;

	for (uint32_t i = 0; i < numTrees;i++)
	{
		if (m_treeRecords[i] != NULL)
			deleteRecord(i);

	}
	msg(MSG_FATAL,"Autofocus is done");
}
开发者ID:BackupTheBerlios,项目名称:vermont-svn,代码行数:34,代码来源:AutoFocus.cpp


示例4: iter

    void RocksRecordStore::cappedDeleteAsNeeded(OperationContext* txn) {
        if (!cappedAndNeedDelete())
            return;
        // This persistent iterator is necessary since you can't read your own writes
        boost::scoped_ptr<rocksdb::Iterator> iter( _db->NewIterator( _readOptions( txn ),
                                                                     _columnFamily ) );
        iter->SeekToFirst();

        // XXX TODO there is a bug here where if the size of the write batch exceeds the cap size
        // then iter will not be valid and it will crash. To fix this we need the ability to
        // query the write batch, and delete the oldest record in the write batch until the
        // size of the write batch is less than the cap

        // XXX PROBLEMS
        // 2 threads could delete the same document
        // multiple inserts using the same snapshot will delete the same document
        while ( cappedAndNeedDelete() && iter->Valid() ) {
            invariant(_numRecords > 0);

            rocksdb::Slice slice = iter->key();
            DiskLoc oldest = _makeDiskLoc( slice );

            if ( _cappedDeleteCallback )
                uassertStatusOK(_cappedDeleteCallback->aboutToDeleteCapped(txn, oldest));

            deleteRecord(txn, oldest);
            iter->Next();
        }
    }
开发者ID:chmanie,项目名称:mongo,代码行数:29,代码来源:rocks_record_store.cpp


示例5: Q_ASSERT

QList<QAction *> DataTableEditController::createEditActions()
{
    Q_ASSERT(addAction==0);

    QList<QAction*> actions;

    addAction = new QAction(IconUtil::getIcon("add"), tr("Add record"), this);
    connect(addAction, SIGNAL(triggered()), this, SLOT(addRecord()));
    actions.append(addAction);

    deleteAction = new QAction(IconUtil::getIcon("delete"), tr("Delete record"), this);
    connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteRecord()));
    actions.append(deleteAction);

    actions.append(WidgetHelper::createSeparatorAction(this));

    commitAction = new QAction(IconUtil::getIcon("commit"), tr("Commit changes"), this);
    connect(commitAction, SIGNAL(triggered()), this, SLOT(commit()));
    actions.append(commitAction);

    rollbackAction = new QAction(IconUtil::getIcon("rollback"), tr("Reset changes"), this);
    connect(rollbackAction, SIGNAL(triggered()), this, SLOT(reset()));
    actions.append(rollbackAction);

    showDmlAction = new QAction(IconUtil::getIcon("query"), tr("Show commit DML"), this);
    connect(showDmlAction, SIGNAL(triggered()), this, SLOT(showDml()));
    actions.append(showDmlAction);

    return actions;
}
开发者ID:rovshan-b,项目名称:oraexp,代码行数:30,代码来源:datatableeditcontroller.cpp


示例6: getId

bool DataOp::updateRecord(QString record)
{
    QString id, oldRecord;
    id  = getId(record);
    //保存旧数据
    oldRecord = selectRecord(id);
    if(oldRecord==""){
        qDebug() << "更新失败,未找到该条数据"<< record;
        return 0;
    }
    //删除原记录
    if(!deleteRecord(getId(record))){
        return 0;
    }
    //添加新记录
    if(!insertRecord(record)){
        qDebug() << "更新失败,尝试恢复旧数据";
        if(!insertRecord(oldRecord)){
            qDebug() << "数据重大错误";
        }
        return 0;
    }else{
        return 1;
    }
    return 0;
}
开发者ID:NitefullWind,项目名称:SomeApp,代码行数:26,代码来源:dataOp.cpp


示例7: switch

void
ReportEdit::doubleClicked( const QModelIndex & index )
{
	const int row = index.row();

	const QDateTime key = m_model->index( row, 0 ).data().toDateTime();

	switch ( index.column() ) {
		case 1:
			if ( QMessageBox::question( this, "Подтверджение", "Удалить запись?",
						QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) == QMessageBox::Yes ) {
				deleteRecord( key, row );
			}
			break;

		case 2:
			modifyNumText( key, row );
			break;

		case 3:
			modifyNum( key, row );
			break;

		case 4: {
			toggleZakaz( key );
			break;
		}

		default:
			;
	}
}
开发者ID:masakra,项目名称:konverter,代码行数:32,代码来源:ReportEdit.cpp


示例8: test3

/*
 * test3 -- 削除
 */
Result test3()
{
    Condition condition;

    /*
     * 以下のクエリを実行
     * delete from TABLE_NAME where name != 'Mickey'
     */
    strcpy(condition.name, "name");
    condition.dataType = TYPE_VARCHAR;
    condition.operator = OPR_NOT_EQUAL;
    strcpy(condition.val.stringVal, "Mickey");

    if (deleteRecord(TABLE_NAME, &condition) != OK) {
        fprintf(stderr, "Cannot delete records.\n");
        return NG;
    }

    printf("delete from TABLE_NAME where name != 'Mickey'\n");
    /* データを表示する */
    printTableData(TABLE_NAME);

    printf("\n");

    /*
     * 以下のクエリを実行
     * delete from TABLE_NAME
     */
    strcpy(condition.name, "");
    condition.dataType = TYPE_UNKNOWN;
    condition.operator = OPR_UNKNOWN;
    strcpy(condition.val.stringVal, "");
    condition.val.intVal = 0;

    if (deleteRecord(TABLE_NAME, &condition) != OK) {
        fprintf(stderr, "Cannot delete records.\n");
        return NG;
    }

    printf("delete from TABLE_NAME\n");
    /* データを表示する */
    printTableData(TABLE_NAME);

    return OK;
}
开发者ID:tcyyky,项目名称:jikkenA,代码行数:48,代码来源:test-datamanip.c


示例9: CardUI

Card::Card(QSqlQueryModel *personModel, QSqlQueryModel *responseModel, QWidget *parent) : CardUI(parent){
    setFormPersonMap(personModel);
    setFormResponseMap(responseModel);

    connect(submitNew, SIGNAL(clicked()), this, SLOT(addRecord()));
    connect(submitEdit, SIGNAL(clicked()), this, SLOT(editRecord()));
    connect(submitReset, SIGNAL(clicked()), this, SLOT(clearFields()));
    connect(submitDelete,SIGNAL(clicked()), this, SLOT(deleteRecord()));
}
开发者ID:TheMindCompany,项目名称:Tracker,代码行数:9,代码来源:card.cpp


示例10: main

int main()
{ 
   FILE *cfPtr; /* credit.dat file pointer */
   int choice;  /* user's choice */

   /* fopen opens the file; exits if file cannot be opened */
   if ( ( cfPtr = fopen( "credit.dat", "rb+" ) ) == NULL ) {
      printf( "File could not be opened.\n" );
   } /* end if */
   else { 

      /* enable user to specify action */
      while ( ( choice = enterChoice() ) != 6 ) { 

         switch ( choice ) { 

            /* create text file from record file */
            case 1:
               textFile( cfPtr );
               break;

            /* update record */
            case 2:
               updateRecord( cfPtr );
               break;

            /* create record */
            case 3:
               newRecord( cfPtr );
               break;

            /* delete existing record */
            case 4:
               deleteRecord( cfPtr );
               break;

			/* sum up balances of valid records and record sum in text file */
			case 5:
				sumRecords( cfPtr );
				break;

            /* display message if user does not select valid choice */
            default:
               printf( "Incorrect choice\n" );
               break;
       
         } /* end switch */

      } /* end while */

      fclose( cfPtr ); /* fclose closes the file */
   } /* end else */
 
   return 0; /* indicates successful termination */

} /* end main */
开发者ID:AlterTiton,项目名称:bcit-courses,代码行数:56,代码来源:fig11_16_modified.c


示例11: LOG

void IDBServer::deleteRecord(const IDBRequestData& requestData, const IDBKeyRangeData& keyRangeData)
{
    LOG(IndexedDB, "IDBServer::deleteRecord");

    auto transaction = m_transactions.get(requestData.transactionIdentifier());
    if (!transaction)
        return;

    transaction->deleteRecord(requestData, keyRangeData);
}
开发者ID:josecu,项目名称:webkit,代码行数:10,代码来源:IDBServer.cpp


示例12: deleteRecord

//Ìî³äPBFriendAgreeReceive
int cProcUserAgreeFriend::setPBFriendAgreeReceive(PBFriendAgreeReceive& u_PBFriendAgreeReceive,const string& u_strToken,\
							 const unsigned int& u_friendId)
{
	unsigned int u_userId = 0;
	int u_result = 0;
	if (!getUserIdbyToken(u_strToken,u_userId))
	{
		g_cMyGlog.errorlogRecord("procUserAddFriend getUserIdbyToken error:Token:%s\n",u_strToken.c_str());
		return K_ACCOUNT_UNNORMAL;
	}
	if (!isUserExist(u_friendId))
	{
		deleteRecord(u_userId,u_friendId);
		return K_FRIEND_IS_NOT_EXIST;
	}
	if (hasHistoryRecord(u_userId,u_friendId))
	{
		deleteRecord(u_userId,u_friendId);
		return K_OPPOSIT_IS_FRIEND;
	}
	else
	{
		if (!insertRecord(u_userId,u_friendId) || !insertRecord(u_friendId,u_userId))
		{
			u_result = -1;
		}
		else
		{
			deleteRecord(u_userId,u_friendId);
			u_PBFriendAgreeReceive.set_agreeresult(ADD_FRIEND_SUCCESS);
			PBWaitingFriend* u_PBWaitingFriend;
			u_PBWaitingFriend = u_PBFriendAgreeReceive.mutable_waitings();
			g_cProcUserWaitingFriend.getUserWaitingFriend(*u_PBWaitingFriend,u_userId);

			PBAllFriend* u_PBAllFriend;
			u_PBAllFriend = u_PBFriendAgreeReceive.mutable_friends();
			g_cProcUserGetAllFriend.getAllFriendByUserId(*u_PBAllFriend,u_userId);

		}
	}
	return u_result;
	
}
开发者ID:wantao,项目名称:myMagicServerLocal,代码行数:44,代码来源:procUserAgreeFriend.cpp


示例13: deleteRecord

void FileRecordMergeMgr::deleteAllMergedItemsButKey(RecordKeyVector &recList) {
	//if the key is also in the list, this method won't delete it.
	for (RecordKeyVector::const_iterator_type iter = recList.begin(); iter != recList.end(); iter = recList.next()) {
		if (*iter == recList.getKey()) {
			continue;
		}
		deleteRecord(*iter);
	}
	recList.clearVector();
}
开发者ID:Annaerial,项目名称:bedtools2,代码行数:10,代码来源:FileRecordMergeMgr.cpp


示例14: head

vector<Address> RecordManager::findAllRecord(string fileName, const vector<int>& op, const vector<vector<char>>& value,
	const vector<int>& begin, const vector<int>& end, const vector<int> &type, int recordSize, 
	vector<vector<char>>& returnRecord, int toDelete){
	vector<Address> returnAddr;
	vector<Address> nullAddr;
	vector<char> nextBlock;
	vector<char> nextOffset;
	vector<char> tempRecord;
	Address addr;

	if (bmanager.getFileBlockNumber(fileName) == 0){
		return nullAddr;
	}

	Address head(fileName, 0, 0);
	int headSize;
	if (recordSize < 20)
		headSize = 20;
	else
		headSize = recordSize;
	vector<char> headRecord = bmanager.read(head, headSize);
	setNextAddr(headRecord, nextBlock, nextOffset, headSize - 8);
	int size = getSize(headRecord);
	//cout << "findallrecord: size: " << size << endl;

	for (int i = 0; i < size; i++){
		addr.setAddr(fileName, char4ToInt(nextBlock), char4ToInt(nextOffset));
		tempRecord = bmanager.read(addr,recordSize);
		int flag = 0;
		for (int j = 0; j < op.size(); j++){//取一条记录i和j个条件比
			int n=compareVc(value[j], tempRecord, begin[j], end[j], type[j]);
			if (n == 0 && (op[j] == 0 || op[j] == 3 || op[j] == 4))
				continue;
			else if (n == 1 && (op[j] == 1 || op[j] == 3 || op[j] == 5))
				continue;
			else if (n == 2 && (op[j] == 2 || op[j] == 4 || op[j] == 5))
				continue;
			else{
				flag = 1;
				break;
			}
		}
		//cout <<"flag: "<< flag << endl;
		if (flag==0){
			if (toDelete){
				//printvc(tempRecord);
				deleteRecord(tempRecord, fileName, recordSize, 1);
			}
			returnRecord.push_back(tempRecord);
			returnAddr.push_back(addr);
		}
		setNextAddr(tempRecord, nextBlock, nextOffset, recordSize - 8);
	}
	return returnAddr;
}
开发者ID:SnowyOwl-KHY,项目名称:MiniSQL-CPlusPlus,代码行数:55,代码来源:RecordManager.cpp


示例15: testTombstone

RC testTombstone(void)
{
	RM_TableData *table = (RM_TableData *)malloc(sizeof(RM_TableData));
	TestRecord inserts[] = {
		{ 1, "aaaa", 3 },
		{ 2, "bbbb", 2 },
		{ 3, "cccc", 1 },
		{ 4, "dddd", 3 },
		{ 5, "eeee", 5 },
		{ 6, "ffff", 1 },
		{ 7, "gggg", 3 },
		{ 8, "hhhh", 3 },
		{ 9, "iiii", 2 },
		{ 10, "jjjj", 5 },
	};
	int numInserts = 10, numUpdates = 3, numDeletes = 5, numFinal = 5, i;
	Record *r;
	RID *rids;
	Schema *schema;
	testName = "test creating a new table and insert,update,delete tuples";
	schema = testSchema();
	rids = (RID *)malloc(sizeof(RID) * numInserts);

	TEST_CHECK(initRecordManager(NULL));
	TEST_CHECK(createTable("test_table_r", schema));
	TEST_CHECK(openTable(table, "test_table_r"));

	// insert rows into table
	for (i = 0; i < numInserts; i++)
	{
		r = fromTestRecord(schema, inserts[i]);
		TEST_CHECK(insertRecord(table, r));
		rids[i] = r->id;
	}

	TEST_CHECK(deleteRecord(table, rids[9]));
	RID id;
	id.page = rids[9].page;
	id.slot = rids[10].slot;
	int isTombstone = checkIfTombstoneEncountered(table, rids[9]);

	TEST_CHECK(closeTable(table));
	TEST_CHECK(deleteTable("test_table_r"));
	TEST_CHECK(shutdownRecordManager());

	free(table);
	if (isTombstone == 1) {
		return RC_OK;
	}
	else {
		return RC_NOT_A_TOMBSTONE;
	}

}
开发者ID:anand700,项目名称:Database,代码行数:54,代码来源:test_assign3_2.c


示例16: QAction

void CustomsManage::createAction()
{

    alterAct=new QAction(QIcon(":/image/alter.png"),tr("修改"),this);
    connect(alterAct,SIGNAL(triggered()),this,SLOT(alterRecord()));

    deleteAct=new QAction(QIcon(":/image/alter.png"),tr("删除"),this);
    connect(deleteAct,SIGNAL(triggered()),this,SLOT(deleteRecord()));


}
开发者ID:gqqcode,项目名称:warehouse-management-system,代码行数:11,代码来源:customsmanage.cpp


示例17: while

    void HeapRecordStore::cappedDeleteAsNeeded(OperationContext* txn) {
        while (cappedAndNeedDelete()) {
            invariant(!_records.empty());

            DiskLoc oldest = _records.begin()->first;

            if (_cappedDeleteCallback)
                uassertStatusOK(_cappedDeleteCallback->aboutToDeleteCapped(txn, oldest));

            deleteRecord(txn, oldest);
        }
    }
开发者ID:DesignByOnyx,项目名称:mongo,代码行数:12,代码来源:record_store_heap.cpp


示例18: getRecordTotalCount

void DatabaseManager::deleteRecordWithCount(const StringPimpl &key,
											const StringPimpl &value)
{
	vector<StringPimpl> files;

	//decrement the size by one
	if(recordCountExists(key, value))
	{
		int size = getRecordTotalCount(key);
		addRecord(m_reserved + key + "[email protected][email protected]", StringPimpl::getString(size - 1));
		deleteRecord(m_reserved + key + "[email protected][email protected]" + value);
	}
}
开发者ID:Tiger66639,项目名称:librebecca,代码行数:13,代码来源:DatabaseManager.cpp


示例19: deleteRecord

    Status KVRecordStore::truncate( OperationContext* txn ) {
        // This is not a very performant implementation of truncate.
        //
        // At the time of this writing, it is only used by 'emptycapped', a test-only command.
        const bool forward = true;
        for (boost::scoped_ptr<KVRecordCursor> iter(getKVCursor(txn, forward));
             !iter->isEOF(); ) {
            RecordId id = iter->getNext();
            deleteRecord(txn, id);
        }

        return Status::OK();
    }
开发者ID:VonRosenchild,项目名称:percona-server-mongodb,代码行数:13,代码来源:kv_record_store.cpp


示例20: LOG

void MemoryObjectStore::deleteRange(const IDBKeyRangeData& inputRange)
{
    LOG(IndexedDB, "MemoryObjectStore::deleteRange");

    ASSERT(m_writeTransaction);

    if (inputRange.isExactlyOneKey()) {
        deleteRecord(inputRange.lowerKey);
        return;
    }

    IDBKeyRangeData range = inputRange;
    while (true) {
        auto key = lowestKeyWithRecordInRange(range);
        if (key.isNull())
            break;

        deleteRecord(key);

        range.lowerKey = key;
        range.lowerOpen = true;
    }
}
开发者ID:valbok,项目名称:WebKitForWayland,代码行数:23,代码来源:MemoryObjectStore.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ deleteTexture函数代码示例发布时间:2022-05-30
下一篇:
C++ deletePreview函数代码示例发布时间: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