nlib
ConsoleOutputStream.h
[詳解]
1 
2 /*---------------------------------------------------------------------------*
3 
4  Project: CrossRoad
5  Copyright (C)2012-2016 Nintendo. All rights reserved.
6 
7  These coded instructions, statements, and computer programs contain
8  proprietary information of Nintendo of America Inc. and/or Nintendo
9  Company Ltd., and are protected by Federal copyright law. They may
10  not be disclosed to third parties or copied or duplicated in any form,
11  in whole or in part, without the prior written consent of Nintendo.
12 
13  *---------------------------------------------------------------------------*/
14 
15 #pragma once
16 #ifndef INCLUDE_NN_NLIB_CONSOLEOUTPUTSTREAM_H_
17 #define INCLUDE_NN_NLIB_CONSOLEOUTPUTSTREAM_H_
18 
19 #include "nn/nlib/OutputStream.h"
20 
21 NLIB_NAMESPACE_BEGIN
22 
24  static const size_t kBufSize = 512;
25  char cos_buf_[kBufSize + 1];
26 
27  public:
30  bool result = this->Close();
31  NLIB_UNUSED(result);
32  }
33 
34  private:
35  virtual bool PushBuffer_(const void* p, size_t nbytes,
36  bool do_flush) NLIB_NOEXCEPT NLIB_OVERRIDE;
37  virtual bool Close_() NLIB_NOEXCEPT NLIB_OVERRIDE { return this->Flush(); }
38 };
39 
40 NLIB_NAMESPACE_END
41 
42 #endif // INCLUDE_NN_NLIB_CONSOLEOUTPUTSTREAM_H_
nlib_printfを利用して文字列としてコンソールに出力するストリームを作成します。
bool Flush() noexcept
ストリームをフラッシュします。
Definition: OutputStream.h:98
#define NLIB_OVERRIDE
利用可能であればoverrideが定義されます。そうでない場合は空文字列です。
Definition: Config.h:223
bool Close() noexcept
ストリームをフラッシュした後、ストリームを閉じます。成功した場合にはtrueを返します。 ...
#define NLIB_VIS_PUBLIC
関数やクラス等のシンボルをライブラリの外部に公開します。
Definition: Platform_unix.h:87
#define NLIB_NOEXCEPT
環境に合わせてnoexcept 又は同等の定義がされます。
Definition: Config.h:99
#define NLIB_FINAL
利用可能であればfinalが定義されます。そうでない場合は空文字列です。
Definition: Config.h:224
出力ストリームの基底クラスを定義しています。
出力ストリームの基底クラスです。このクラスを実体化することはできません。
Definition: OutputStream.h:30