本文整理汇总了C++中deleteData函数的典型用法代码示例。如果您正苦于以下问题:C++ deleteData函数的具体用法?C++ deleteData怎么用?C++ deleteData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deleteData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dictDelete
/*************************************************************
* Function : dictDelete
* Author : bulldozer.ma
* Date : 2015-11-01
* Input : char *str, dict *pHeader, unsigned int len
* Output : N/A
* Return : int
* Other : N/A
* Description : dictDelete
**************************************************************/
int dictDelete(char *str, dict *pHeader, unsigned int len)
{
if (NULL == str || NULL == pHeader|| 0 >= len)
{
return DICT_ERROR;
}
int iRet = DICT_ERROR;
dictht *ht = pHeader->ht[0];
iRet = deleteData(ht, str, len);
if (DICT_ERROR == iRet)
{
return deleteData( pHeader->ht[1], str, len);
}
return iRet;
}
示例2: ftell
// Reads a .tga file and creates an LLImageTGA with its data.
bool LLImageTGA::loadFile( const LLString& path )
{
S32 len = path.size();
if( len < 5 )
{
return false;
}
LLString extension = path.substr( len - 4, 4 );
LLString::toLower(extension);
if( ".tga" != extension )
{
return false;
}
FILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */
if( !file )
{
llwarns << "Couldn't open file " << path << llendl;
return false;
}
S32 file_size = 0;
if (!fseek(file, 0, SEEK_END))
{
file_size = ftell(file);
fseek(file, 0, SEEK_SET);
}
U8* buffer = allocateData(file_size);
S32 bytes_read = fread(buffer, 1, file_size, file);
if( bytes_read != file_size )
{
deleteData();
llwarns << "Couldn't read file " << path << llendl;
return false;
}
fclose( file );
if( !updateData() )
{
llwarns << "Couldn't decode file " << path << llendl;
deleteData();
return false;
}
return true;
}
示例3: LL_WARNS
// Reads a .tga file and creates an LLImageTGA with its data.
bool LLImageTGA::loadFile( const std::string& path )
{
S32 len = path.size();
if( len < 5 )
{
return false;
}
std::string extension = gDirUtilp->getExtension(path);
if( "tga" != extension )
{
return false;
}
LLFILE* file = LLFile::fopen(path, "rb"); /* Flawfinder: ignore */
if( !file )
{
LL_WARNS() << "Couldn't open file " << path << LL_ENDL;
return false;
}
S32 file_size = 0;
if (!fseek(file, 0, SEEK_END))
{
file_size = ftell(file);
fseek(file, 0, SEEK_SET);
}
U8* buffer = allocateData(file_size);
S32 bytes_read = fread(buffer, 1, file_size, file);
if( bytes_read != file_size )
{
deleteData();
LL_WARNS() << "Couldn't read file " << path << LL_ENDL;
fclose(file);
return false;
}
fclose( file );
if( !updateData() )
{
LL_WARNS() << "Couldn't decode file " << path << LL_ENDL;
deleteData();
return false;
}
return true;
}
示例4: connect
void urinalysis::initConnect()
{
//从串口获取数据
connect(m_port, SIGNAL(dataInfo(float,float)), this, SLOT(getPortData(float,float)));
//给ARC赋值
connect(ui->ALBLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setARC(QString)));
connect(ui->CRELineEdit, SIGNAL(textChanged(QString)), this, SLOT(setARC(QString)));
//清除
connect(ui->clearPushButton, SIGNAL(clicked()), this, SLOT(clearForms()));
//查询
connect(ui->searchButton, SIGNAL(clicked()), this, SLOT(fillTableWidget()));
//保存数据
connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(saveData()));
//显示tablewidget内容
connect(ui->tableWidget, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(setForms(int,int)));
//关闭窗口
connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close()));
//删除数据
connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteData()));
//打印
connect(ui->printButton, SIGNAL(clicked()), this, SLOT(print()));
}
示例5: mt1
// virtual
U8* LLImageBase::allocateData(S32 size)
{
LLMemType mt1((LLMemType::EMemType)mMemType);
if (size < 0)
{
size = mWidth * mHeight * mComponents;
if (size <= 0)
{
llerrs << llformat("LLImageBase::allocateData called with bad dimentions: %dx%dx%d",mWidth,mHeight,mComponents) << llendl;
}
}
else if (size <= 0 || (size > 4096*4096*16 && sSizeOverride == FALSE))
{
llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
}
if (!mData || size != mDataSize)
{
deleteData(); // virtual
mBadBufferAllocation = FALSE ;
mData = new U8[size];
if (!mData)
{
llwarns << "allocate image data: " << size << llendl;
size = 0 ;
mWidth = mHeight = 0 ;
mBadBufferAllocation = TRUE ;
}
mDataSize = size;
}
return mData;
}
示例6: deleteData
void Widget::mainProcedure(double** tempA, double* tempB, double* tempF)
{
//перевірка нетут, або взагалі непотрібна
// if(!(nEq<nArgs))
// {
// QMessageBox::critical(NULL,tr(""),tr("Невірні дані\nКількість невідомих повинна бути строго більше кількості рівнянь."),QMessageBox::Ok);
// return;
// }
//перевіряємо обмеження
for(int i=0;i<nEq;i++)
{
if(tempB[i]<0)
{
QMessageBox::critical(NULL,tr(""),tr("Невірні дані\nПеревірте вектор В."),QMessageBox::Ok);
return;
}
}
if(direction==tr("min"))
{
for(int i=0;i<nArgs;i++)
tempF[i]=-tempF[i];
}
//чистимо минулі данні
deleteData();
//відправляємо дані на аналіз та створення першої симплекс таблиці
genFirstSTable(tempA,tempF,tempB,rel);
//запускаємо обчислення
m_result=calc();
showHideInput(false);
fillTables();
p2->setChecked(false);
}
示例7: main
int main (int argc, char** argv) {
struct usb_device *dev;
if (argc < 2) {
perr ("Should be called with one argument: 'read' or 'delete'\n", 2);
}
while (1) {
if ((dev = findDev(0x0e6a, 0x0101)) == NULL) {
perr ("Waiting for device...\n", 0);
} else {
break;
}
usleep (300000);
}
usb_dev_handle *hdl = open_device (dev);
if (!strcmp(argv[1], "read")) {
readData (hdl);
} else if (!strcmp(argv[1], "delete")) {
deleteData (hdl);
} else {
perr ("Invalid command line argument.\n", 3);
}
close_device (hdl);
return 0;
}
示例8: deleteData
LLImageRaw::~LLImageRaw()
{
// NOTE: ~LLimageBase() call to deleteData() calls LLImageBase::deleteData()
// NOT LLImageRaw::deleteData()
deleteData();
--sRawImageCount;
}
示例9: mt1
// virtual
U8* LLImageBase::allocateData(S32 size)
{
LLMemType mt1(mMemType);
if (size < 0)
{
size = mWidth * mHeight * mComponents;
if (size <= 0)
{
llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << llendl;
}
}
else if (size <= 0 || (size > 4096*4096*16 && !mAllowOverSize))
{
llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
}
if (!mData || size != mDataSize)
{
deleteData(); // virtual
mBadBufferAllocation = false ;
mData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
if (!mData)
{
llwarns << "allocate image data: " << size << llendl;
size = 0 ;
mWidth = mHeight = 0 ;
mBadBufferAllocation = true ;
}
mDataSize = size;
}
return mData;
}
示例10: QWidget
Widget::Widget(QWidget *parent) : QWidget (parent)
{
mainLayout=new QVBoxLayout(this);
m_input=new inputWidget;
m_help=new QWebView;
m_help->load(QUrl("help/help.html"));
QHBoxLayout* v=new QHBoxLayout;
QPushButton* p1=new QPushButton(tr("Почати розрахунки"));
QPushButton* pF=new QPushButton(tr("Завантажити з файлу"));
p2=new QPushButton(tr("Показати поля вводу"));
p2->setCheckable(true);
p2->setChecked(true);
QPushButton* p3=new QPushButton(tr("Очистити результати"));
QPushButton* pH=new QPushButton(tr("Допомога"));
p1->setMinimumWidth(160);
p2->setMinimumWidth(200);
p3->setMinimumWidth(200);
v->addWidget(p1);
v->addWidget(pF);
v->addWidget(p2);
v->addWidget(p3);
v->addWidget(pH);
m_buttonGroupBox=new QGroupBox;
m_buttonGroupBox->setLayout(v);
connect(p1,SIGNAL(clicked()),this,SLOT(getDatasFromForm()));
connect(p2,SIGNAL(clicked(bool)),this,SLOT(showHideInput(bool)));
connect(p3,SIGNAL(clicked()),this,SLOT(deleteData()));
connect(pF,SIGNAL(clicked()),this,SLOT(getDatasFromFile()));
connect(pH,SIGNAL(clicked()),this,SLOT(showHelp()));
connect(m_input,SIGNAL(nEqChanged(QSize)),this,SLOT(myResize(QSize)));
#ifdef WITH_EFFECTS
QCheckBox* ch=new QCheckBox(tr("Увімкнути ефекти"));
ch->setChecked(true);
connect(ch,SIGNAL(clicked(bool)),this,SLOT(changeEffects(bool)));
//v->addWidget(ch);
m_enableEffects=true;
m_ani=new QPropertyAnimation(this,"size");
#endif
mainLayout->addWidget(m_buttonGroupBox,0,Qt::AlignTop);
QVBoxLayout* m_inputL=new QVBoxLayout;
m_inputL->addWidget(m_input);
m_inputGB=new QGroupBox;
m_inputGB->setLayout(m_inputL);
mainLayout->addWidget(m_inputGB,0,Qt::AlignTop);
mainLayout->addStretch(1);
f=NULL;
tablesScrollArea=NULL;
tablesGroupBox=NULL;
tablesLayout=NULL;
m_isTables=false;
m_isData=false;
}
示例11: deleteData
LLImageRaw::~LLImageRaw()
{
// NOTE: ~LLimageBase() call to deleteData() calls LLImageBase::deleteData()
// NOT LLImageRaw::deleteData()
deleteData();
--sRawImageCount;
setInCache(false);
}
示例12: DOM_DOMException
void CharacterDataImpl::replaceData(unsigned int offset, unsigned int count,
const DOMString &dat)
{
if (isReadOnly())
throw DOM_DOMException(
DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
deleteData(offset, count);
insertData(offset, dat);
};
示例13: mycudaCompute
int mycudaCompute()
{
// ri scrivo la funzione di update presente in dll "seriale"
// utilizzando "GPUCompute(boidSet)" come chiamata cuda anzichè la normale "compute()"
unsigned int simulationLenght,progress;
int exitValue;
int test=0;
progress=0;
simulationLenght=(unsigned int)ceil(simParameters.fps * simParameters.lenght);
_Output(&cacheFileOption);
while((!abortSimulation) && (progress<=simulationLenght))
{
Channel *channels;
channels=(Channel*)malloc(sizeof(Channel)*info.option);
GPUCompute(boidSet);
// data management
cachingData(channels);
// write data
writeData(progress,channels);
// update the index job progress
simulationProgress = ((int)(100*progress)/simulationLenght);
//advance to the next frame
progress++;
test++;
// free channels memory
freeChannel(channels);
}
simulationProgress=100;
closeMethod();
if(abortSimulation)
{
printf("Simulation interrupted\n");
deleteData();
exitValue=INTERRUPTED_SIM;
}
// restoring abortSimulation flag
abortSimulation=FALSE;
exitValue=SUCCESS_SIM;
// free resources
free(boidSet);
return exitValue;
}
示例14: DOMException
void DOMCharacterDataImpl::replaceData(const DOMNode *node, XMLSize_t offset, XMLSize_t count,
const XMLCh *dat)
{
if (castToNodeImpl(node)->isReadOnly())
throw DOMException(
DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMCharacterDataImplMemoryManager);
deleteData(node, offset, count);
insertData(node, offset, dat);
}
示例15: parentNode
Text* CDATASection::splitText(unsigned long offset)
{
Node* pParent = parentNode();
if (!pParent) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
int n = length() - offset;
Text* pNew = ownerDocument()->createCDATASection(substringData(offset, n));
deleteData(offset, n);
pParent->insertBefore(pNew, nextSibling())->release();
return pNew;
}