Projet Bee-Honey't  1.0
BTS SN 2019
Fonctions | Variables
Référence du fichier quotedprintable.cpp
#include "quotedprintable.h"

Fonctions

static bool requiresEscape (unsigned char input, bool rfc2047)
 

Variables

const unsigned char MinPrintableRange = 0x20
 
const unsigned char MaxPrintableRange = 0x7e
 
const unsigned char HorizontalTab = 0x09
 
const unsigned char FormFeed = 0x0c
 
const unsigned char Space = 0x20
 
const unsigned char Equals = 0x3d
 
const unsigned char ExclamationMark = 0x21
 
const unsigned char Asterisk = 0x2a
 
const unsigned char Plus = 0x2b
 
const unsigned char Minus = 0x2d
 
const unsigned char Slash = 0x2f
 
const unsigned char Underscore = 0x5f
 

Documentation des fonctions

◆ requiresEscape()

static bool requiresEscape ( unsigned char  input,
bool  rfc2047 
)
static

Références Asterisk, Equals, ExclamationMark, FormFeed, HorizontalTab, MaxPrintableRange, MinPrintableRange, Minus, Plus, Slash, Space, et Underscore.

Référencé par SimpleMail::QuotedPrintable::encode().

39 {
40  // For both, we need to escape '=' and anything unprintable
41  bool escape = ((input > MaxPrintableRange) ||
42  ((input < MinPrintableRange) && (input != HorizontalTab) && (input != FormFeed)) ||
43  (input == Equals));
44 
45  // For RFC 2047, we need to escape '?', '_', ' ' & '\t'
46  // In fact, since the output may be used in a header field 'word', then the only characters
47  // that can be used un-escaped are: alphanumerics, '!', '*', '+' '-', '/' and '_'
48  if (!escape && rfc2047)
49  {
50  // We can also ignore space, since it will become an underscore
51  if ((input != ExclamationMark) && (input != Asterisk) && (input != Plus) &&
52  (input != Minus) && (input != Slash) && (input != Underscore) && (input != Space))
53  {
54  escape = !isalnum(input);
55  }
56  }
57 
58  return escape;
59 }
const unsigned char ExclamationMark
Definition: quotedprintable.cpp:31
const unsigned char Underscore
Definition: quotedprintable.cpp:36
const unsigned char Slash
Definition: quotedprintable.cpp:35
const unsigned char Space
Definition: quotedprintable.cpp:29
const unsigned char Asterisk
Definition: quotedprintable.cpp:32
const unsigned char MaxPrintableRange
Definition: quotedprintable.cpp:24
const unsigned char MinPrintableRange
Definition: quotedprintable.cpp:23
const unsigned char HorizontalTab
Definition: quotedprintable.cpp:25
const unsigned char FormFeed
Definition: quotedprintable.cpp:27
const unsigned char Plus
Definition: quotedprintable.cpp:33
const unsigned char Equals
Definition: quotedprintable.cpp:30
const unsigned char Minus
Definition: quotedprintable.cpp:34

Documentation des variables

◆ Asterisk

const unsigned char Asterisk = 0x2a

Référencé par requiresEscape().

◆ Equals

const unsigned char Equals = 0x3d

Référencé par requiresEscape().

◆ ExclamationMark

const unsigned char ExclamationMark = 0x21

Référencé par requiresEscape().

◆ FormFeed

const unsigned char FormFeed = 0x0c

Référencé par requiresEscape().

◆ HorizontalTab

const unsigned char HorizontalTab = 0x09

Référencé par requiresEscape().

◆ MaxPrintableRange

const unsigned char MaxPrintableRange = 0x7e

Référencé par requiresEscape().

◆ MinPrintableRange

const unsigned char MinPrintableRange = 0x20

Référencé par requiresEscape().

◆ Minus

const unsigned char Minus = 0x2d

Référencé par requiresEscape().

◆ Plus

const unsigned char Plus = 0x2b

Référencé par requiresEscape().

◆ Slash

const unsigned char Slash = 0x2f

Référencé par requiresEscape().

◆ Space

const unsigned char Space = 0x20

Référencé par requiresEscape().

◆ Underscore

const unsigned char Underscore = 0x5f

Référencé par requiresEscape().