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


C++ FlushBuffer函数代码示例

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


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


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