nlib
ConsoleOutputStream.h
Go to the documentation of this file.
1 
2 /*--------------------------------------------------------------------------------*
3  Project: CrossRoad
4  Copyright (C)Nintendo All rights reserved.
5 
6  These coded instructions, statements, and computer programs contain proprietary
7  information of Nintendo and/or its licensed developers and are protected by
8  national and international copyright laws. They may not be disclosed to third
9  parties or copied or duplicated in any form, in whole or in part, without the
10  prior written consent of Nintendo.
11 
12  The content herein is highly confidential and should be handled accordingly.
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_
The class for creating a stream to output to the console as a text string using nlib_printf.
bool Flush() noexcept
Flushes the stream.
Definition: OutputStream.h:101
#define NLIB_OVERRIDE
Defines override if it is available for use. If not, holds an empty string.
Definition: Config.h:228
bool Close() noexcept
Closes the stream after it has been flushed. Returns true if successful.
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:89
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Definition: Config.h:99
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Definition: Config.h:229
Defines the base class for output streams.
The base class for output streams. This class cannot be instantiated.
Definition: OutputStream.h:30