nlib
Base64OutputStream.h
Go to the documentation of this file.
1 
2 #pragma once
3 #ifndef INCLUDE_NN_NLIB_BASE64OUTPUTSTREAM_H_
4 #define INCLUDE_NN_NLIB_BASE64OUTPUTSTREAM_H_
5 
6 #include "nn/nlib/OutputStream.h"
8 #include "nn/nlib/Base64.h"
9 
10 NLIB_NAMESPACE_BEGIN
12  public:
13  // NOTE: define NewLineMode (not typedef) again for doxygen.
15  enum NewLineMode { NEWLINEMODE_NONE = 0, NEWLINEMODE_CRLF, NEWLINEMODE_LF };
16  Base64OutputStream() NLIB_NOEXCEPT : prv_(NULL) {}
17  errno_t Init(CharOption char_option) NLIB_NOEXCEPT;
18  errno_t Init() NLIB_NOEXCEPT {
19  return Init(Base64Encoder::BASE64_DEFAULT);
20  }
21  virtual ~Base64OutputStream() NLIB_NOEXCEPT NLIB_OVERRIDE;
22  void SetNewLineMode(NewLineMode mode) NLIB_NOEXCEPT;
23 
24  private:
25  struct Base64OutputStreamPrivate;
26  Base64OutputStreamPrivate* prv_;
28 };
29 NLIB_NAMESPACE_END
30 
31 #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:210
#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:145
CharOption
Variations for the 62nd and 63rd characters in Base64 can be specified.
Definition: Base64.h:12
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:61
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:86
errno_t Init() noexcept
Runs Init(Base64Encoder::BASE64_DEFAULT).
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Definition: Config.h:211
NewLineMode
The newline options for the output Base64 text. The default is NEWLINEMODE_NONE.
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:24