本文整理汇总了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;
}
}
}
示例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();
}
示例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:
示例4: FlushBuffer
void BufferedEmailParser::End()
{
m_endOfStream = true;
if (!m_paused) {
FlushBuffer();
}
}
示例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();
}
示例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();
}
示例7: FlushBuffer
// Destructor
BufferedFile::~BufferedFile()
{
// Flush in case there's data
if (pFile)
FlushBuffer();
// Get rid of buffer
if (pBuffer)
OVR_FREE(pBuffer);
}
示例8: FlushBuffer
void CObjectOStream::DefaultFlush(void)
{
if ( GetFlags() & fFlagNoAutoFlush ) {
FlushBuffer();
}
else {
Flush();
}
}
示例9: UpdatePosition
void BFTimeCtrl::TextCtrl::ApplyIncrement (bool bPositiv)
{
UpdatePosition();
SelectPart();
UpdateBuffer();
Increment(bPositiv);
FlushBuffer();
SelectPart();
}
示例10: FlushBuffer
void CFileStream::Close(void)
{
if (m_hFile != INVALID_HANDLE_VALUE)
{
FlushBuffer();
CloseHandle(m_hFile);
ResetFile(GetLastError());
}
}
示例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);
}
}
}
示例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_);
}
示例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);
}
示例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;
}
}
示例15: SetBufferSize
/**
* @param nBufferSize - buffer size.
*/
void CFileStream::SetBufferSize(int nBufferSize)
{
if (m_nBufferSize != nBufferSize)
{
if (! FlushBuffer())
return;
delete[] m_pBuffer;
InitBuffer(nBufferSize);
}
}