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

C++ FlushBuffer函数代码示例

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

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



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

示例1: GetOutputStream

void wxStreamBuffer::PutChar(char c)
{
    wxOutputStream *outStream = GetOutputStream();

    wxCHECK_RET( outStream, _T("should have a stream in wxStreamBuffer") );

    // if we don't have buffer at all, just forward this call to the stream,
    if ( !HasBuffer() )
    {
        outStream->OnSysWrite(&c, sizeof(c));
    }
    else
    {
        // otherwise check we have enough space left
        if ( !GetDataLeft() && !FlushBuffer() )
        {
            // we don't
            SetError(wxSTREAM_WRITE_ERROR);
        }
        else
        {
            PutToBuffer(&c, sizeof(c));
            m_stream->m_lastcount = 1;
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:26,代码来源:stream.cpp


示例2: PushBuffer

void PushBuffer(WCHAR c) {
    if (shifted && c >= FIRST_G1 && c <= LAST_G1)
        c = G1[c - FIRST_G1];
    ChBuffer[nCharInBuffer] = c;
    if (++nCharInBuffer == BUFFER_SIZE)
        FlushBuffer();
}
开发者ID:Dean1987,项目名称:LES_DOC,代码行数:7,代码来源:Win32_ANSI.c


示例3: FlushBuffer

NS_IMETHODIMP nsEncoderSupport::Convert(const PRUnichar * aSrc,
                                        PRInt32 * aSrcLength,
                                        char * aDest,
                                        PRInt32 * aDestLength)
{
  // we do all operations using pointers internally
  const PRUnichar * src = aSrc;
  const PRUnichar * srcEnd = aSrc + *aSrcLength;
  char * dest = aDest;
  char * destEnd = aDest + *aDestLength;

  PRInt32 bcr, bcw; // byte counts for read & write;
  nsresult res;

  res = FlushBuffer(&dest, destEnd);
  if (res == NS_OK_UENC_MOREOUTPUT) goto final;

  bcr = srcEnd - src;
  bcw = destEnd - dest;
  res = ConvertNoBuff(src, &bcr, dest, &bcw);
  src += bcr;
  dest += bcw;
  if ((res == NS_OK_UENC_MOREOUTPUT) && (dest < destEnd)) {
    // convert exactly one character into the internal buffer
    // at this point, there should be at least a char in the input
    for (;;) {
      bcr = 1;
      bcw = mBufferCapacity;
      res = ConvertNoBuff(src, &bcr, mBuffer, &bcw);

      if (res == NS_OK_UENC_MOREOUTPUT) {
        delete [] mBuffer;
        mBufferCapacity *= 2;
        mBuffer = new char [mBufferCapacity];
      } else {
        src += bcr;
        mBufferStart = mBufferEnd = mBuffer;
        mBufferEnd += bcw;
        break;
      }
    }

    res = FlushBuffer(&dest, destEnd);
  }

final:
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:46,代码来源:nsUCSupport.cpp


示例4: FlushBuffer

void BufferedEmailParser::End()
{
	m_endOfStream = true;

	if (!m_paused) {
		FlushBuffer();
	}
}
开发者ID:hatsada1,项目名称:app-services,代码行数:8,代码来源:BufferedEmailParser.cpp


示例5: ASSERT_TRUE

void ImmutableIndexWriter::Add(Buffer key, Buffer value) {
  ASSERT_TRUE(key.isValidData() && !key.isEmpty());
  ASSERT_TRUE(value.isValidData());
  record_buffer.push_back(std::pair<Buffer,Buffer>(key,value));
  data_in_buffer++;

  if(data_in_buffer >= chunk_size)
    FlushBuffer();
}
开发者ID:MagnusTiberius,项目名称:WalkerRoad,代码行数:9,代码来源:index_writer.cpp


示例6: RtfWindowStartNextOutput

// Invoked before starting printing GHCi output for a command
VOID RtfWindowStartNextOutput()
{
    RtfWindowPutS(TEXT("\n"));
    FlushBuffer(TRUE);;
    BufFormat = DefFormat;
    NowFormat = DefFormat;
    BackSpaces = 0;
    StartOfOutput = RtfWindowTextLength();
}
开发者ID:ElfridaDwi,项目名称:winghci,代码行数:10,代码来源:RtfWindow.c


示例7: FlushBuffer

// Destructor
BufferedFile::~BufferedFile()
{
    // Flush in case there's data
    if (pFile)
        FlushBuffer();
    // Get rid of buffer
    if (pBuffer)
        OVR_FREE(pBuffer);
}
开发者ID:ArthurTorrente,项目名称:4A_Anim_Numerique_Genetic_Algorithm,代码行数:10,代码来源:OVR_File.cpp


示例8: FlushBuffer

void CObjectOStream::DefaultFlush(void)
{
    if ( GetFlags() & fFlagNoAutoFlush ) {
        FlushBuffer();
    }
    else {
        Flush();
    }
}
开发者ID:swuecho,项目名称:igblast,代码行数:9,代码来源:objostr.cpp


示例9: UpdatePosition

void BFTimeCtrl::TextCtrl::ApplyIncrement (bool bPositiv)
{
	UpdatePosition();
	SelectPart();	
	UpdateBuffer();
	Increment(bPositiv);
	FlushBuffer();
	SelectPart();
}
开发者ID:BackupTheBerlios,项目名称:blackfisk-svn,代码行数:9,代码来源:BFTimeCtrl.cpp


示例10: FlushBuffer

void CFileStream::Close(void)
{
	if (m_hFile != INVALID_HANDLE_VALUE)
	{
		FlushBuffer();
		CloseHandle(m_hFile);
		ResetFile(GetLastError());
	}
}
开发者ID:BeaconDev,项目名称:xray-16,代码行数:9,代码来源:FileStream.cpp


示例11: tPiqueteC_Timer

void tPiqueteC_Timer() {
	bool NuevaA;
	/* ' Dim NuevoL As Boolean */
	int GI;
	int i;

	for (i = (1); i <= (LastUser); i++) {
		if (UserList[i].flags.UserLogged) {
			if (MapData[UserList[i].Pos.Map][UserList[i].Pos.X][UserList[i].Pos.Y].trigger
					== eTrigger_ANTIPIQUETE) {
				if (UserList[i].flags.Muerto == 0) {
					UserList[i].Counters.PiqueteC = UserList[i].Counters.PiqueteC + 1;
					WriteConsoleMsg(i, "¡¡¡Estás obstruyendo la vía pública, muévete o serás encarcelado!!!",
							FontTypeNames_FONTTYPE_INFO);

					if (UserList[i].Counters.PiqueteC > 23) {
						UserList[i].Counters.PiqueteC = 0;
						Encarcelar(i, TIEMPO_CARCEL_PIQUETE);
					}
				} else {
					UserList[i].Counters.PiqueteC = 0;
				}
			} else {
				UserList[i].Counters.PiqueteC = 0;
			}

			/* 'ustedes se preguntaran que hace esto aca? */
			/* 'bueno la respuesta es simple: el codigo de AO es una mierda y encontrar */
			/* 'todos los puntos en los cuales la alineacion puede cambiar es un dolor de */
			/* 'huevos, asi que lo controlo aca, cada 6 segundos, lo cual es razonable */

			GI = UserList[i].GuildIndex;
			if (GI > 0) {
				NuevaA = false;
				/* ' NuevoL = False */
				if (!m_ValidarPermanencia(i, true, NuevaA)) {
					WriteConsoleMsg(i,
							"Has sido expulsado del clan. ¡El clan ha sumado un punto de antifacción!",
							FontTypeNames_FONTTYPE_GUILD);
				}
				if (NuevaA) {
					SendData(SendTarget_ToGuildMembers, GI,
							dakara::protocol::server::BuildConsoleMsg(
									"¡El clan ha pasado a tener alineación " + GuildAlignment(GI) + "!",
									FontTypeNames_FONTTYPE_GUILD));
					LogClanes("¡El clan cambio de alineación!");
				}
				/* '                    If NuevoL Then */
				/* '                        Call SendData(SendTarget.ToGuildMembers, GI, PrepareMessageConsoleMsg("¡El clan tiene un nuevo líder!", FontTypeNames.FONTTYPE_GUILD)) */
				/* '                        Call LogClanes("¡El clan tiene nuevo lider!") */
				/* '                    End If */
			}

			FlushBuffer(i);
		}
	}
}
开发者ID:Chaitooler,项目名称:dakara-server,代码行数:57,代码来源:Timers.cpp


示例12: FlushBuffer

void c4_SaveContext::StoreValue(t4_i32 v_) {
  if (_walk == 0)
    return ;

  if (_curr + 10 >= _limit)
    FlushBuffer();

  d4_assert(_curr + 10 < _limit);
  c4_Column::PushValue(_curr, v_);
}
开发者ID:aosm,项目名称:tcl,代码行数:10,代码来源:persist.cpp


示例13: FlushBuffer

void CConsole::SetBuffer(const wchar_t* szMessage)
{
	int oldBufferPos = m_iBufferPos;	// remember since FlushBuffer will set it to 0

	FlushBuffer();

	wcsncpy(m_szBuffer, szMessage, CONSOLE_BUFFER_SIZE);
	m_iBufferLength = (int)wcslen(m_szBuffer);
	m_iBufferPos = std::min(oldBufferPos, m_iBufferLength);
}
开发者ID:TiriliPiitPiit,项目名称:0ad,代码行数:10,代码来源:CConsole.cpp


示例14: scoped_lock

/**
 * @brief close one logging session
 *
 * Writes the buffered data to file after filtering it through addr2line.
 */
void CLogger::CloseSession()
{
	boost::mutex::scoped_lock scoped_lock(logmutex);

	if (logfile || !buffer.empty()) {
		FlushBuffer();
		fclose(logfile);
		logfile = NULL;
	}
}
开发者ID:niavok,项目名称:spring,代码行数:15,代码来源:Logger.cpp


示例15: SetBufferSize

/**
 * @param nBufferSize - buffer size.
 */
void CFileStream::SetBufferSize(int nBufferSize)
{
	if (m_nBufferSize != nBufferSize)
	{
		if (! FlushBuffer())
			return;
		delete[] m_pBuffer;
		InitBuffer(nBufferSize);
	}
}
开发者ID:BeaconDev,项目名称:xray-16,代码行数:13,代码来源:FileStream.cpp


示例16: strLine

void CHTRichEditCtrl::Add(LPCTSTR pszMsg, int iLen)
{
	if (m_hWnd == NULL){
		CString strLine(pszMsg);
		m_astrBuff.Add(strLine);
	}
	else{
		FlushBuffer();
		AddLine(pszMsg, iLen);
	}
}
开发者ID:kevinzhwl,项目名称:easyMuleVeryCD,代码行数:11,代码来源:HTRichEditCtrl.cpp


示例17: BufferSizeAdvise

static PGPError
BufferSizeAdvise(PGPPipeline *myself, unsigned long size)
{
	AddHdrContext *context;
	PGPError	error;
	int i;

	pgpAssert(myself);
	pgpAssert(myself->magic == ADDHEADERMAGIC);

	context = (AddHdrContext *)myself->priv;
	pgpAssert(context);
	pgpAssert(context->tail);
	pgpAssert(context->buffer);

	/* Do not pass non-zero sizeAdvise -- I can't do that! */
	if (size || context->scope_depth)
		return( kPGPError_NoErr );

	/* Okay, we're at end of input. */
	if (context->buflen) {
		/* We have a bug when file length is zero; we get here without having
		 * flushed the header.  We can't easily distinguish between a zero
		 * length file and the EOF sizeadvise, but we don't need to.
		 */
		error = FlushHeader(context);
		if (error)
			return error;
		if (context->dowrite) {
			error = FlushBuffer(context);
		} else if (context->midflush) {
			error = ForceFlush(context);
		} else {
			i = context->buflen;
			if (PKTLEN_ONE_BYTE(i)) {
				context->bufptr--;
				context->buflen++;
				context->bufptr[0] = PKTLEN_1BYTE(i);
			} else {
				context->bufptr -= 2;
				context->buflen += 2;
				context->bufptr[0] = PKTLEN_BYTE0(i);
				context->bufptr[1] = PKTLEN_BYTE1(i);
			}
			context->midflush = context->buflen;
			error = ForceFlush(context);
		}
		if (error)
			return error;
	}
	
	return context->tail->sizeAdvise(context->tail, 0);
}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:53,代码来源:pgpAddHdr.c


示例18: FlushBuffer

void ecRunTestsDialog::OnIdle(wxIdleEvent& event)
{
    FlushBuffer();

    if (m_testsAreComplete)
    {
        m_testsAreComplete = FALSE;
        SubmitTests();
    }

    event.Skip();
}
开发者ID:perryhg,项目名称:terkos,代码行数:12,代码来源:runtestsdlg.cpp


示例19: BufferReset

void IO_ProfileSimResults::WriteOneCase(const ProfileSimCaseResults& caseRes,
                                         int&                nextRec)
{
    BufferReset(nextRec);
    WriteString(caseRes.caseID, ProfileSimCaseResults::caseIDLen);
    WriteDouble(caseRes.staticPressure);
    WriteBool(caseRes.caseDataIsExtended);

    WriteInt(caseRes.caseValues.Size());
    for (int i = 0; i < caseRes.caseValues.Size(); i++)
        WriteDouble(caseRes.caseValues[i]);

    if (!caseRes.caseDataIsExtended)
    {
        const DC_GridData& currGrid = caseRes.caseData;
        WriteString(currGrid.gridID, DC_GridData::gridIDLen);
        WriteString(currGrid.xData.dataID, DC_DataCoord::dataIDLen);
        WriteString(currGrid.yData.dataID, DC_DataCoord::dataIDLen);

        WriteBool(currGrid.xData.dataIsLog);
        WriteBool(currGrid.yData.dataIsLog);

        WriteInt(currGrid.xData.Size());
        WriteInt(currGrid.yData.Size());
        WriteDoubleArray(currGrid.xData);
        WriteDoubleArray(currGrid.yData);
        for (int i = 0; i < currGrid.Size(); i++)
            WriteDouble(currGrid[i]);
    }
    else
    {
        const ExtendedProfile& currPro = caseRes.extendedCaseData;
        WriteInt(currPro.ntotalVert);
        WriteInt(currPro.nradial);
        WriteInt(currPro.nconstantVert);
        WriteInt(currPro.nvariableVert);
//      WriteDouble(currPro.constantVertThick);  // v1
        WriteDoubleArray(currPro.constantVertZPos);
        WriteDoubleArray(currPro.nodeRadii);
        WriteInt(currPro.Size());
        for (int i = 0; i < currPro.Size(); i++)
        {
            const ExtendedProfileTimeData& currSing = currPro[i];
            WriteDouble(currSing.profileTime);
            if (currPro.nvariableVert > 0)
                WriteDoubleArray(currSing.waterTablePos);
            WriteDoubleMatrix(currSing.nodalPressures);
        }
    }


    FlushBuffer(nextRec);
}
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:53,代码来源:IO_ProfileSimResults.cpp


示例20: shared_from_this

void Player::Update() {
	m_inventory->SendUpdate( shared_from_this() );

	FlushBuffer();
	HandleSocketData();

	ObjectPtr agent( m_agent.lock() );
	if( !agent ) {
		LogConsole( "Player agent deleted, deleting player." );
		Delete();
		return;
	}
}
开发者ID:Tym17tools,项目名称:Wyrm,代码行数:13,代码来源:player.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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