E-MailRelay

Static Public Member Functions | List of all members
G::Base64 Class Reference

A base64 codec class. More...

`#include <gbase64.h>`

## Static Public Member Functions
static std::string | encode (const std::string &s, const std::string &line_break=std::string())
| Encodes the given string, optionally inserting line-breaks to limit the line length. More...
static std::string | decode (const std::string &, bool throw_on_invalid=false, bool strict=true)
| Decodes the given string. More...
static bool | valid (const std::string &, bool strict=true)
| Returns true if the string is a valid base64 encoding, possibly allowing for embedded newlines, carriage returns, and space characters. More...

## Detailed Description

A base64 codec class.

See also
  RFC-1341 section 5.2

Definition at line 37 of file gbase64.h.

## Member Function Documentation

## ◆ decode()

std::string G::Base64::decode | ( | const std::string & | s,
|  | bool | throw_on_invalid = `false`,
|  | bool | strict = `true`
| ) |  |
| static

Decodes the given string.

Either throws an exception if not a valid() encoding, or returns the empty string.

Definition at line 89 of file gbase64.cpp.

## ◆ encode()

std::string G::Base64::encode | ( | const std::string & | s,
|  | const std::string & | line_break = `std::string()`
| ) |  |
| static

Encodes the given string, optionally inserting line-breaks to limit the line length.

Definition at line 84 of file gbase64.cpp.

## ◆ valid()

bool G::Base64::valid | ( | const std::string & | s,
|  | bool | strict = `true`
| ) |  |
| static

Returns true if the string is a valid base64 encoding, possibly allowing for embedded newlines, carriage returns, and space characters.

Strict checking permits one or two pad characters at the end to make a multiple of four characters in total, but no newlines, carriage returns or other odd characters. Empty strings are valid; single character strings are not.

Definition at line 94 of file gbase64.cpp.

The documentation for this class was generated from the following files:

- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/glib/gbase64.h
- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/glib/gbase64.cpp