1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_NET_QUOTED_PRINTABLE_H_ 6 #define CHROME_BROWSER_NET_QUOTED_PRINTABLE_H_ 7 #pragma once 8 9 #include <string> 10 11 // Some functions to encode/decode with the quoted-printable encoding. 12 // See http://tools.ietf.org/html/rfc2045#section-6.7 13 14 namespace chrome { 15 namespace browser { 16 namespace net { 17 18 // Encodes the input string with the quoted-printable encoding. 19 void QuotedPrintableEncode(const std::string& input, std::string* output); 20 21 // Decodes the quoted-printable input string. Returns true if the input string 22 // was wellformed quoted-printable, false otherwise, in which case it still 23 // decodes as much of the message as possible. 24 bool QuotedPrintableDecode(const std::string& input, std::string* output); 25 26 // Returns 0 if |iter| does not point to an end-of-line, the number of chars 27 // that constitutes that EOL otherwise (1 for LF, 2 for CR-LF). 28 // Exposed as it is also used in unit-tests. 29 int IsEOL(const std::string::const_iterator& iter, const std::string& input); 30 31 } // namespace net 32 } // namespace browser 33 } // namespace chrome 34 35 #endif // CHROME_BROWSER_NET_QUOTED_PRINTABLE_H_ 36