本文整理汇总了C++中Stream::Flush方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::Flush方法的具体用法?C++ Stream::Flush怎么用?C++ Stream::Flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stream
的用法示例。
在下文中一共展示了Stream::Flush方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Log
void ThreadPlanTracer::Log() {
SymbolContext sc;
bool show_frame_index = false;
bool show_fullpaths = false;
Stream *stream = GetLogStream();
if (stream) {
m_thread.GetStackFrameAtIndex(0)->Dump(stream, show_frame_index,
show_fullpaths);
stream->Printf("\n");
stream->Flush();
}
}
示例2: ReadToStream
bool Stream::ReadToStream(Environment &env, Stream &streamDst,
size_t bytesUnit, bool finalizeFlag, const Function *pFuncFilter)
{
Signal &sig = env.GetSignal();
if (!CheckReadable(sig) || !streamDst.CheckWritable(sig)) return false;
Attribute attr;
bool validAttrFlag = false;
if (finalizeFlag) {
validAttrFlag = GetAttribute(attr);
}
AutoPtr<Memory> pMemory(new MemoryHeap(bytesUnit));
char *buff = reinterpret_cast<char *>(pMemory->GetPointer());
for (;;) {
size_t bytesRead = Read(sig, buff, bytesUnit);
if (bytesRead == 0) break;
if (pFuncFilter != nullptr) {
Value value(new Object_binary(env, buff, bytesUnit, false));
AutoPtr<Argument> pArgSub(new Argument(pFuncFilter));
if (!pArgSub->StoreValue(env, value)) return false;
Value rtn = pFuncFilter->Eval(env, *pArgSub);
if (sig.IsSignalled()) return false;
if (rtn.Is_binary()) {
const Binary &buffRtn = rtn.GetBinary();
streamDst.Write(sig, buffRtn.data(), buffRtn.size());
if (sig.IsSignalled()) return false;
continue;
}
}
streamDst.Write(sig, buff, bytesRead);
if (sig.IsSignalled()) return false;
}
if (sig.IsSignalled()) return false;
if (finalizeFlag) {
streamDst.Close();
if (sig.IsSignalled()) return false;
if (validAttrFlag) streamDst.SetAttribute(attr);
return true;
}
if (!streamDst.Flush(sig)) return false;
return true;
}
示例3:
void
MachException::Message::Dump(Stream &stream) const
{
stream.Printf("exc_msg { bits = 0x%8.8x size = 0x%8.8x remote-port = "
"0x%8.8x local-port = 0x%8.8x reserved = 0x%8.8x "
"id = 0x%8.8x }\n",
exc_msg.hdr.msgh_bits,
exc_msg.hdr.msgh_size,
exc_msg.hdr.msgh_remote_port,
exc_msg.hdr.msgh_local_port,
exc_msg.hdr.msgh_reserved,
exc_msg.hdr.msgh_id);
stream.Printf("reply_msg { bits = 0x%8.8x size = 0x%8.8x remote-port "
"= 0x%8.8x local-port = 0x%8.8x reserved = 0x%8.8x "
"id = 0x%8.8x }",
reply_msg.hdr.msgh_bits,
reply_msg.hdr.msgh_size,
reply_msg.hdr.msgh_remote_port,
reply_msg.hdr.msgh_local_port,
reply_msg.hdr.msgh_reserved,
reply_msg.hdr.msgh_id);
stream.Flush();
}
示例4: Flush
virtual void Flush() { m_Stream->Flush(); }