nlib
Base64OutputStream.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_BASE64OUTPUTSTREAM_H_
17 #define INCLUDE_NN_NLIB_BASE64OUTPUTSTREAM_H_
18 
19 #include "nn/nlib/OutputStream.h"
21 #include "nn/nlib/Base64.h"
22 
23 NLIB_NAMESPACE_BEGIN
25  public:
26  // NOTE: define NewLineMode (not typedef) again for doxygen.
28  enum NewLineMode {
29  kNewLineModeNone = 0,
32  NEWLINEMODE_NONE = kNewLineModeNone,
33  NEWLINEMODE_CRLF = kNewLineModeCrlf,
34  NEWLINEMODE_LF = kNewLineModeLf
35  };
36  NLIB_CEXPR Base64OutputStream() NLIB_NOEXCEPT : prv_(nullptr) {}
37  errno_t Init(CharOption char_option) NLIB_NOEXCEPT;
38  errno_t Init() NLIB_NOEXCEPT {
39  return Init(Base64Encoder::kBase64Default);
40  }
41  virtual ~Base64OutputStream() NLIB_NOEXCEPT NLIB_OVERRIDE;
42  void SetNewLineMode(NewLineMode mode) NLIB_NOEXCEPT;
43 
44  private:
45  struct Base64OutputStreamPrivate;
46  Base64OutputStreamPrivate* prv_;
48 };
49 NLIB_NAMESPACE_END
50 
51 #endif // INCLUDE_NN_NLIB_BASE64OUTPUTSTREAM_H_
#define NLIB_OVERRIDE
Defines override if it is available for use. If not, holds an empty string.
Definition: Config.h:244
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
Definition: Config.h:179
Sets a newline every 76 characters using LF.
CharOption
Variations for the 62nd and 63rd characters in Base64 can be specified.
Definition: Base64.h:29
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:89
The base class for classes that act internally like OutputStream to convert data. ...
Defines the class for encoding and decoding Base64.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Definition: Config.h:105
Sets a newline every 76 characters using CRLF. This is what is expected of RFC 2045.
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
Definition: Config.h:107
errno_t Init() noexcept
Runs Init(Base64Encoder::kBase64Default).
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Definition: Config.h:245
NewLineMode
The newline options for the output Base64 text. The default is kNewLineModeNone.
The class for writing data after encoding it in Base64.
Defines the base class for output streams.
int errno_t
Indicates with an int-type typedef that a POSIX error value is returned as the return value...
Definition: NMalloc.h:37