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


C++ Commit函数代码示例

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


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

示例1: YASSERT

bool 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,代码来源:last_getopt.cpp

示例2: Commit

Commit Object::toCommit() const
{
	if(isCommit())
	{
		return Commit(*this);
	}
	else
		return Commit();
}
开发者ID:balooloo,项目名称:libgit2pp,代码行数:9,代码来源:object.cpp

示例3: _MANAGER

void 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,代码来源:manager.cpp

示例4: ASSERT

status_t
Inode::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,代码来源:InodeRegular.cpp

示例5: bb

void 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,代码来源:BillboardSet.cpp

示例6: TRACE

STDMETHODIMP 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,代码来源:StreamSwitcher.cpp

示例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,代码来源:ScriptDocument.cpp

示例8: _T

ResultType 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,代码来源:clipboard.cpp

示例9: Clear

bool 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,代码来源:TMuseumClipboard.cpp

示例10: _MANAGER

void 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,代码来源:manager.cpp

示例11: Commit

void 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,代码来源:Logger.cpp

示例12: Commit

   /// <summary>Commits changes</summary>
   void PreferencesPage::OnOK()
   {
      // Save
      Commit();

      __super::OnOK();
   }
开发者ID:CyberSys,项目名称:X-Studio-2,代码行数:8,代码来源:PreferencesPage.cpp

示例13: ASSERT

status_t
Inode::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,代码来源:InodeRegular.cpp

示例14: pLock

BOOL 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,代码来源:HashDatabase.cpp

示例15: Color

void 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,代码来源:BillboardSet.cpp


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