Quick Links: |
#include <bdlde_base64encoderoptions.h>
Public Types | |
enum | { k_MIME_MAX_LINE_LENGTH = 76 } |
Public Member Functions | |
void | setAlphabet (Base64Alphabet::Enum value) |
void | setIsPadded (bool value) |
void | setMaxLineLength (int value) |
bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
Base64Alphabet::Enum | alphabet () const |
bool | isPadded () const |
int | maxLineLength () const |
Static Public Member Functions | |
static Base64EncoderOptions | custom (int maxLineLength, Base64Alphabet::Enum alphabet, bool padded) |
static Base64EncoderOptions | mime () |
static Base64EncoderOptions | standard (bool padded=true) |
static Base64EncoderOptions | urlSafe (bool padded=false) |
This class
stores the configuration of a Base64Encoder
.
See Component bdlde_base64encoderoptions
static Base64EncoderOptions bdlde::Base64EncoderOptions::custom | ( | int | maxLineLength, | |
Base64Alphabet::Enum | alphabet, | |||
bool | padded | |||
) | [static] |
Return a Base64EncoderOptions
object having the specified maxLineLength, alphabet, and 'isPadded
attribute values. The behavior is unless 0 <= maxLineLength
and 'alphabet is a defined value of Base64Alphabet::Enum
.
static Base64EncoderOptions bdlde::Base64EncoderOptions::mime | ( | ) | [static] |
Return a Base64EncoderOptions
object having the attributes maxLineLength == 76
, alphabet == Base64Alphabet::e_BASIC
, and isPadded == true
. This conforms to RFC 2045.
static Base64EncoderOptions bdlde::Base64EncoderOptions::standard | ( | bool | padded = true |
) | [static] |
Return a Base64EncoderOptions
object having the attributes maxLineLength == 0
, alphabet == Base64Alphabet::e_BASIC
, and isPadded == false
. If padded
is not specified, it defaults to true
. This conforms to RFC 4648 section 4.
static Base64EncoderOptions bdlde::Base64EncoderOptions::urlSafe | ( | bool | padded = false |
) | [static] |
Return a Base64EncoderOptions
object having the attributes maxLineLength == 0
, alphabet == Base64Alphabet::e_URL
, and the specified padded
. If padded
is not specified, it defaults to false
. This conforms to RFC 4648 section 5.
void bdlde::Base64EncoderOptions::setAlphabet | ( | Base64Alphabet::Enum | value | ) |
Set the alphabet
attribute to the specified value
. The behavior is undefined unless value
is either e_BASIC
or e_UTL
.
void bdlde::Base64EncoderOptions::setIsPadded | ( | bool | value | ) |
Set the isPadded
attribute to the specified value
.
void bdlde::Base64EncoderOptions::setMaxLineLength | ( | int | value | ) |
Set the maxLineLength
attribute to the specified value
. The behavior is undefined unless 0 <= value
.
bsl::ostream& bdlde::Base64EncoderOptions::print | ( | bsl::ostream & | stream, | |
int | level = 0 , |
|||
int | spacesPerLevel = 4 | |||
) | const |
Format this object to the specified output stream
at the optionally specified indentation level
and return a reference to the modifiable stream
. If level
is specified, optionally specify spacesPerLevel
, the number of spaces per indentation level for this and all of its nested objects. Each line is indented by the absolute value of level * spacesPerLevel
. If level
is negative, suppress indentation of the first line. If spacesPerLevel
is negative, suppress line breaks and format the entire output on one line. If stream
is initially invalid, this operation has no effect. Note that a trailing newline is provided in multiline mode only.
Base64Alphabet::Enum bdlde::Base64EncoderOptions::alphabet | ( | ) | const |
Return the value of the alphabet
attribute.
bool bdlde::Base64EncoderOptions::isPadded | ( | ) | const |
Return the value of the isPadded
attribute.
int bdlde::Base64EncoderOptions::maxLineLength | ( | ) | const |
Return the value of the maxLineLength
attribute.