當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。