这篇教程C++ Commit函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Commit函数的典型用法代码示例。如果您正苦于以下问题:C++ Commit函数的具体用法?C++ Commit怎么用?C++ Commit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Commit函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: YASSERTbool TOptsParser::ParseUnknownShortOptWithinArg(size_t pos, size_t sop) { YASSERT(pos < Argc_); const TStringBuf arg(Argv_[pos]); YASSERT(sop > 0); YASSERT(sop < arg.length()); YASSERT(EIO_NONE != IsOpt(arg)); if (!Opts_->AllowUnknownCharOptions_) ythrow TUsageException() << "unknown option '" << EscapeC(arg[sop]) << "' in '" << arg << "'"; TempCurrentOpt_.Reset(new TOpt); TempCurrentOpt_->AddShortName(arg[sop]); sop += 1; // mimic behavior of Opt: unknown option has arg only if char is last within arg if (sop < arg.length()) { return Commit(TempCurrentOpt_.Get(), 0, pos, sop); } pos += 1; sop = 0; if (pos == Argc_ || EIO_NONE != IsOpt(Argv_[pos])) { return Commit(TempCurrentOpt_.Get(), 0, pos, 0); } return Commit(TempCurrentOpt_.Get(), Argv_[pos], pos + 1, 0);}
开发者ID:Frankie-666,项目名称:tomita-parser,代码行数:29,
示例2: CommitCommit Object::toCommit() const{ if(isCommit()) { return Commit(*this); } else return Commit();}
开发者ID:balooloo,项目名称:libgit2pp,代码行数:9,
示例3: _MANAGERvoid Manager::CloseAll(){ _MANAGER(CleverSysLog clv(L"Manager::CloseAll()")); while(!m_modalWindows.empty()) { DeleteWindow(m_modalWindows.back()); Commit(); } while(!m_windows.empty()) { DeleteWindow(m_windows.back()); Commit(); } m_windows.clear();}
开发者ID:Firebie,项目名称:FarManager,代码行数:15,
示例4: ASSERTstatus_tInode::Write(OpenFileCookie* cookie, off_t pos, const void* _buffer, size_t* _length){ ASSERT(cookie != NULL); ASSERT(_buffer != NULL); ASSERT(_length != NULL); if (pos < 0) pos = 0; if ((cookie->fMode & O_RWMASK) == O_RDONLY) return B_NOT_ALLOWED; if ((cookie->fMode & O_APPEND) != 0) pos = fMaxFileSize; uint64 fileSize = pos + *_length; if (fileSize > fMaxFileSize) { status_t result = file_cache_set_size(fFileCache, fileSize); if (result != B_OK) return result; fMaxFileSize = fileSize; fMetaCache.GrowFile(fMaxFileSize); } if ((cookie->fMode & O_NOCACHE) != 0) { WriteDirect(cookie, pos, _buffer, _length); Commit(); } return file_cache_write(fFileCache, cookie, pos, _buffer, _length);}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:33,
示例5: bbvoid BillboardSet::SetNumBillboards(unsigned num){ // Prevent negative value being assigned from the editor if (num > M_MAX_INT) num = 0; if (num > MAX_BILLBOARDS) num = MAX_BILLBOARDS; unsigned oldNum = billboards_.Size(); billboards_.Resize(num); // Set default values to new billboards for (unsigned i = oldNum; i < num; ++i) { SharedPtr<Billboard> bb(new Billboard()); bb->position_ = Vector3::ZERO; bb->size_ = Vector2::ONE; bb->uv_ = Rect::POSITIVE; bb->color_ = Color(1.0f, 1.0f, 1.0f); bb->rotation_ = 0.0f; bb->enabled_ = false; billboards_[i] = bb; } bufferSizeDirty_ = true; Commit();}
开发者ID:AliAkbarMontazeri,项目名称:AtomicGameEngine,代码行数:28,
示例6: TRACESTDMETHODIMP CStreamSwitcherAllocator::GetBuffer( IMediaSample** ppBuffer, REFERENCE_TIME* pStartTime, REFERENCE_TIME* pEndTime, DWORD dwFlags){ HRESULT hr = VFW_E_NOT_COMMITTED; if (!m_bCommitted) { return hr; } /* TRACE(_T("CStreamSwitcherAllocator::GetBuffer m_pPin->m_evBlock.Wait() + %x/n"), this); m_pPin->m_evBlock.Wait(); TRACE(_T("CStreamSwitcherAllocator::GetBuffer m_pPin->m_evBlock.Wait() - %x/n"), this); */ if (m_fMediaTypeChanged) { if (!m_pPin || !m_pPin->m_pFilter) { return hr; } CStreamSwitcherOutputPin* pOut = (static_cast<CStreamSwitcherFilter*>(m_pPin->m_pFilter))->GetOutputPin(); if (!pOut || !pOut->CurrentAllocator()) { return hr; } ALLOCATOR_PROPERTIES Properties, Actual; if (FAILED(pOut->CurrentAllocator()->GetProperties(&Actual))) { return hr; } if (FAILED(GetProperties(&Properties))) { return hr; } if (!m_bCommitted || Properties.cbBuffer < Actual.cbBuffer) { Properties.cbBuffer = Actual.cbBuffer; if (FAILED(Decommit())) { return hr; } if (FAILED(SetProperties(&Properties, &Actual))) { return hr; } if (FAILED(Commit())) { return hr; } ASSERT(Actual.cbBuffer >= Properties.cbBuffer); if (Actual.cbBuffer < Properties.cbBuffer) { return hr; } } } hr = CMemAllocator::GetBuffer(ppBuffer, pStartTime, pEndTime, dwFlags); if (m_fMediaTypeChanged && SUCCEEDED(hr)) { (*ppBuffer)->SetMediaType(&m_mt); m_fMediaTypeChanged = false; } return hr;}
开发者ID:EchoLiao,项目名称:mpc-hc,代码行数:60,
示例7: data /// <summary>Commits the document</summary> /// <param name="title">Revision title</param> /// <returns></returns> BOOL ScriptDocument::OnCommitDocument(const wstring& title) { WorkerData data(Operation::LoadSaveDocument); try { // Feedback Console << Cons::UserAction << "Committing script: " << FullPath << ENDL; data.SendFeedback(ProgressType::Operation, 0, VString(L"Committing script '%s'", FullPath.c_str())); // Get project auto proj = ProjectDocument::GetActive(); // Verify document is part of project if (!proj) throw InvalidOperationException(HERE, L"No current project"); else if (!proj->Contains(FullPath)) throw InvalidOperationException(HERE, L"Document is not a member of current project"); // Commit if (proj->Commit(*this, title)) data.SendFeedback(Cons::Success, ProgressType::Succcess, 0, L"Script committed successfully"); else data.SendFeedback(Cons::Error, ProgressType::Failure, 0, L"Script commit aborted"); return TRUE; } catch (ExceptionBase& e) { Console.Log(HERE, e, VString(L"Failed to commit script '%s'", FullPath.c_str())); data.SendFeedback(Cons::Error, ProgressType::Failure, 0, L"Failed to commit script"); return FALSE; } }
开发者ID:CyberSys,项目名称:X-Studio-2,代码行数:37,
示例8: _TResultType Clipboard::Set(LPCTSTR aBuf, UINT_PTR aLength)// Returns OK or FAIL.{ // It was already open for writing from a prior call. Return failure because callers that do this // are probably handling things wrong: if (IsReadyForWrite()) return FAIL; if (!aBuf) { aBuf = _T(""); aLength = 0; } else if (aLength == UINT_MAX) // Caller wants us to determine the length. aLength = (UINT)_tcslen(aBuf); if (aLength) { if (!PrepareForWrite(aLength + 1)) return FAIL; // It already displayed the error. tcslcpy(mClipMemNewLocked, aBuf, aLength + 1); // Copy only a substring, if aLength specifies such. } // else just do the below to empty the clipboard, which is different than setting // the clipboard equal to the empty string: it's not truly empty then, as reported // by IsClipboardFormatAvailable(CF_TEXT) -- and we want to be able to make it truly // empty for use with functions such as ClipWait: return Commit(); // It will display any errors.}
开发者ID:HotKeyIt,项目名称:ahkdll,代码行数:28,
示例9: Clearbool TMuseumClipboard::AddItem( BMessage *theItem ){ if ( Lock() ) { // Clear clipboard data Clear(); // Get pointer to clipboard data BMessage *clipData = Data(); // Determine type of data being placed on clipboard switch( theItem->what) { case CUE_LIST_MSG: { clipData->AddPointer("CueList", theItem); } break; default: break; } // Inform clipboard to save data Commit(); Unlock(); } return true; }
开发者ID:ModeenF,项目名称:UltraDV,代码行数:31,
示例10: _MANAGERvoid Manager::RefreshFrame(Frame *Refreshed){ _MANAGER(CleverSysLog clv(L"Manager::RefreshFrame(Frame *Refreshed)")); _MANAGER(SysLog(L"Refreshed=%p",Refreshed)); if (ActivatedFrame) return; if (Refreshed) { RefreshedFrame=Refreshed; } else { RefreshedFrame=CurrentFrame; } if (IndexOf(Refreshed)==-1 && IndexOfStack(Refreshed)==-1) return; /* $ 13.04.2002 KM - Вызываем принудительный Commit() для фрейма имеющего члена NextModal, это означает что активным сейчас является VMenu, а значит Commit() сам не будет вызван после возврата из функции. Устраняет ещё один момент неперерисовки, когда один над другим находится несколько объектов VMenu. Пример: настройка цветов. Теперь AltF9 в диалоге настройки цветов корректно перерисовывает меню. */ if (RefreshedFrame && RefreshedFrame->NextModal) Commit();}
开发者ID:CyberShadow,项目名称:FAR,代码行数:33,
示例11: Commitvoid CLogger::Log(ELogLevel a_level, const std::string& a_message){ if((m_minLogLevel & (int)a_level) == 0) { return; } boost::posix_time::time_duration l_timestamp = (boost::posix_time::microsec_clock::local_time() - m_startTime); std::string l_entry = boost::str( boost::format("%08d [%08x] ") % l_timestamp.total_milliseconds() % boost::this_thread::get_id()) + a_message; m_lock.lock(); uint64_t l_logId = (m_logEntryId++); m_queue.push(boost::str(boost::format("%08d ") % l_logId) + l_entry); if(a_level == LL_CRITICAL) { Commit(); } m_lock.unlock();}
开发者ID:cmstest,项目名称:buzz-ftpd,代码行数:29,
示例12: Commit /// <summary>Commits changes</summary> void PreferencesPage::OnOK() { // Save Commit(); __super::OnOK(); }
开发者ID:CyberSys,项目名称:X-Studio-2,代码行数:8,
示例13: ASSERTstatus_tInode::Write(OpenFileCookie* cookie, off_t pos, const void* _buffer, size_t* _length){ ASSERT(cookie != NULL); ASSERT(_buffer != NULL); ASSERT(_length != NULL); struct stat st; status_t result = Stat(&st); if (result != B_OK) return result; if ((cookie->fMode & O_APPEND) != 0) pos = st.st_size; uint64 fileSize = max_c(st.st_size, pos + *_length); fMaxFileSize = max_c(fMaxFileSize, fileSize); if ((cookie->fMode & O_NOCACHE) != 0) { WriteDirect(cookie, pos, _buffer, _length); Commit(); } result = file_cache_set_size(fFileCache, fileSize); if (result != B_OK) return result; return file_cache_write(fFileCache, cookie, pos, _buffer, _length);}
开发者ID:sahil9912,项目名称:haiku,代码行数:30,
示例14: pLockBOOL CHashDatabase::StoreED2K(DWORD nIndex, CED2K* pSet){ CSingleLock pLock( &m_pSection, TRUE ); if ( m_bOpen == FALSE ) return FALSE; DWORD nLength = pSet->GetSerialSize(); HASHDB_INDEX* pIndex = PrepareToStore( nIndex, HASH_ED2K, nLength ); if ( pIndex == NULL ) return FALSE; try { m_pFile.Seek( pIndex->nOffset, 0 ); CArchive ar( &m_pFile, CArchive::store ); pSet->Serialize( ar ); } catch ( CException* pException ) { pException->Delete(); } Commit(); return TRUE;}
开发者ID:ericfillipe1,项目名称:shareaza-code,代码行数:25,
示例15: Colorvoid BillboardSet::SetNumBillboards(unsigned num){ // Prevent negative value being assigned from the editor if (num > M_MAX_INT) num = 0; unsigned oldNum = billboards_.Size(); if (num == oldNum) return; billboards_.Resize(num); // Set default values to new billboards for (unsigned i = oldNum; i < num; ++i) { billboards_[i].position_ = Vector3::ZERO; billboards_[i].size_ = Vector2::ONE; billboards_[i].uv_ = Rect::POSITIVE; billboards_[i].color_ = Color(1.0f, 1.0f, 1.0f); billboards_[i].rotation_ = 0.0f; billboards_[i].direction_ = Vector3::UP; billboards_[i].enabled_ = false; billboards_[i].screenScaleFactor_ = 1.0f; } bufferSizeDirty_ = true; Commit();}
开发者ID:gogoprog,项目名称:Urho3D,代码行数:28,
示例16: OutStrBaseFormat& BaseFormat::Put(LPCWSTR Data, size_t Length){ if (Precision == fmt::Precision::GetDefault()) { Precision = Length; } string OutStr(Data, Min(Precision, Length)); if (Align == fmt::A_RIGHT) { while (OutStr.GetLength() < Width) { OutStr.Insert(0, FillChar); } } else { while (OutStr.GetLength() < Width) { OutStr.Append(FillChar); } } Commit(OutStr); Reset(); return *this;}
开发者ID:rheostat2718,项目名称:conemu-maximus5,代码行数:28,
示例17: _TResultType Clipboard::Set(LPCTSTR aBuf, UINT_PTR aLength) //, bool aTrimIt)// Returns OK or FAIL.{ // It was already open for writing from a prior call. Return failure because callers that do this // are probably handling things wrong: if (IsReadyForWrite()) return FAIL; if (!aBuf) { aBuf = _T(""); aLength = 0; } else if (aLength == UINT_MAX) // Caller wants us to determine the length. aLength = (UINT)_tcslen(aBuf); if (aLength) { if (!PrepareForWrite(aLength + 1)) return FAIL; // It already displayed the error. tcslcpy(mClipMemNewLocked, aBuf, aLength + 1); // Copy only a substring, if aLength specifies such. // Only trim when the caller told us to, rather than always if g_script.mIsAutoIt2 // is true, since AutoIt2 doesn't always trim things (e.g. FileReadLine probably // does not trim the line that was read into its output var). UPDATE: This is // no longer needed because I think AutoIt2 only auto-trims when SetEnv is used: //if (aTrimIt) // trim(mClipMemNewLocked); } // else just do the below to empty the clipboard, which is different than setting // the clipboard equal to the empty string: it's not truly empty then, as reported // by IsClipboardFormatAvailable(CF_TEXT) -- and we want to be able to make it truly // empty for use with functions such as ClipWait: return Commit(); // It will display any errors.}
开发者ID:fincs,项目名称:AutoHotkey_L,代码行数:34,
示例18: CommitDatabaseManager::~DatabaseManager(){ Commit(); mdatabase.close(); if (mptableModel != NULL){ mptableModel->deleteLater(); mptableModel = NULL; } if (mptableModelStr != NULL){ mptableModelStr->deleteLater(); mptableModelStr = NULL; } if (mptableModelRes != NULL){ mptableModelRes->deleteLater(); mptableModelRes = NULL; } if (mptableModelPak != NULL){ mptableModelPak->deleteLater(); mptableModelPak = NULL; } if (mptableModelAppPak != NULL){ mptableModelAppPak->deleteLater(); mptableModelAppPak = NULL; }}
开发者ID:langelee,项目名称:AutopackingAndroid,代码行数:25,
示例19: WriteRGBvoid RGB_Tlc5940::CycleSpectrum() { byte rgbColour[3]; // Start off with red. rgbColour[0] = 255; rgbColour[1] = 0; rgbColour[2] = 0; // Choose the colours to increment and decrement. for (byte decColour = 0; decColour < 3; decColour++) { int incColour = decColour == 2 ? 0 : decColour + 1; // cross-fade the two colours. for(byte i = 0; i < 255; i++) { rgbColour[decColour] -= 1; rgbColour[incColour] += 1; for(byte j=0; j<_numLeds; j++) { WriteRGB(j, rgbColour[0], rgbColour[1], rgbColour[2], false); } Commit(); delay(15); } }}
开发者ID:jwaterworth,项目名称:snooker_scoreboard,代码行数:26,
示例20: throwvoid YCTaskDB2::UpdateTaskRequest(TaskReqInfo& task_req) throw(base::Exception){ XDBO2::CRecordset rs(&m_CDB); rs.EnableWarning(true); std::string sql = "UPDATE " + m_tabTaskReq + " SET TASK_STATUS = ?, STATUS_DESC = ?, TASK_FINISHTIME = ?, TASK_DESC = ? WHERE SEQ_ID = ?"; m_pLog->Output("[DB2] Update task request [%d]", task_req.seq_id); try { rs.Prepare(sql.c_str(), XDBO2::CRecordset::forwardOnly); int index = 1; rs.Parameter(index++) = task_req.status.c_str(); rs.Parameter(index++) = task_req.status_desc.c_str(); rs.Parameter(index++) = task_req.finishtime.c_str(); rs.Parameter(index++) = task_req.desc.c_str(); rs.Parameter(index++) = task_req.seq_id; rs.Execute(); Commit(); rs.Close(); } catch ( const XDBO2::CDBException& ex ) { throw base::Exception(TDB_ERR_UPD_TASK_REQ, "[DB2] Update task request to table '%s' failed! [SEQ:%d, KPI_ID:%s] [CDBException] %s [FILE:%s, LINE:%d]", m_tabTaskReq.c_str(), task_req.seq_id, task_req.kpi_id.c_str(), ex.what(), __FILE__, __LINE__); }}
开发者ID:yip-jek,项目名称:RevenueAudit,代码行数:30,
示例21: buffervoid CustomGeometry::SetGeometryDataAttr(const PODVector<unsigned char>& value){ if (value.Empty()) return; MemoryBuffer buffer(value); SetNumGeometries(buffer.ReadVLE()); elementMask_ = buffer.ReadUInt(); for (unsigned i = 0; i < geometries_.Size(); ++i) { unsigned numVertices = buffer.ReadVLE(); vertices_[i].Resize(numVertices); primitiveTypes_[i] = (PrimitiveType)buffer.ReadUByte(); for (unsigned j = 0; j < numVertices; ++j) { if (elementMask_ & MASK_POSITION) vertices_[i][j].position_ = buffer.ReadVector3(); if (elementMask_ & MASK_NORMAL) vertices_[i][j].normal_ = buffer.ReadVector3(); if (elementMask_ & MASK_COLOR) vertices_[i][j].color_ = buffer.ReadUInt(); if (elementMask_ & MASK_TEXCOORD1) vertices_[i][j].texCoord_ = buffer.ReadVector2(); if (elementMask_ & MASK_TANGENT) vertices_[i][j].tangent_ = buffer.ReadVector4(); } } Commit();}
开发者ID:JimMarlowe,项目名称:AtomicGameEngine,代码行数:33,
示例22: Commitstd::string SvgDeviceContext::GetStringSVG( bool xml_tag ){ if (!m_committed) Commit( xml_tag ); return m_outdata.str();}
开发者ID:raffazizzi,项目名称:verovio,代码行数:7,
示例23: Beginvoid RefactoringStorage::StoreTokens(const wxString& filename, const CppToken::List_t& tokens, bool startTx){ if ( !IsCacheReady() ) { return; } if ( !m_db.IsOpen() ) return; try { if ( startTx ) { Begin(); } DoDeleteFile(filename); CppToken::List_t::const_iterator iter = tokens.begin(); for(; iter != tokens.end(); ++iter ) { iter->store( &m_db ); } DoUpdateFileTimestamp(filename); if ( startTx ) { Commit(); } } catch (wxSQLite3Exception &e) { if ( startTx ) { Rollback(); } wxUnusedVar(e); }}
开发者ID:jfouche,项目名称:codelite,代码行数:34,
示例24: Char TaskResult Char(const KeyInfo& info) override{ auto handleKeyPress = [&](){ m_autoComplete.Forget(); return handle_key_press(info.key, m_textObject->GetTextBuffer()) ? TaskResult::DRAW : TaskResult::NONE; }; if (is_exit_key(info.key)){ return Commit(info.layerType); } else if (info.key.Is(key::tab) && m_settings.Get(ts_ParseExpressions)){ return handle_completion(m_autoComplete, m_textObject->GetTextBuffer()) ? TaskResult::DRAW : handleKeyPress(); } return handle_command_key(info.key, m_textObject).Visit( [&](TextChange& cmd){ m_autoComplete.Forget(); // Fixme: Need to support undo cmd.Do(); m_states.Did(cmd); return TaskResult::DRAW; }, handleKeyPress); }
开发者ID:lukas-ke,项目名称:faint-graphics-editor,代码行数:26,
注:本文中的Commit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CommitTransactionCommand函数代码示例 C++ CommandLineToArgvW函数代码示例 |