Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: chrome/browser/net/quoted_printable.h

Issue 6542069: Add an encoder/decoder for quoted-printable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed reviewers' comments Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/net/quoted_printable.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/quoted_printable.h
diff --git a/chrome/browser/net/quoted_printable.h b/chrome/browser/net/quoted_printable.h
new file mode 100644
index 0000000000000000000000000000000000000000..310a7a777556d068bcbc84fbbeb04a3dd5dd40c1
--- /dev/null
+++ b/chrome/browser/net/quoted_printable.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NET_QUOTED_PRINTABLE_H_
+#define CHROME_BROWSER_NET_QUOTED_PRINTABLE_H_
+#pragma once
+
+#include <string>
+
+// Some functions to encode/decode with the quoted-printable encoding.
+// See http://tools.ietf.org/html/rfc2045#section-6.7
+
+namespace chrome {
+namespace browser {
+namespace net {
+
+// Encodes the input string with the quoted-printable encoding.
+void QuotedPrintableEncode(const std::string& input, std::string* output);
+
+// Decodes the quoted-printable input string. Returns true if the input string
+// was wellformed quoted-printable, false otherwise, in which case it still
+// decodes as much of the message as possible.
+bool QuotedPrintableDecode(const std::string& input, std::string* output);
+
+// Returns 0 if |iter| does not point to an end-of-line, the number of chars
+// that constitutes that EOL otherwise (1 for LF, 2 for CR-LF).
+// Exposed as it is also used in unit-tests.
+int IsEOL(const std::string::const_iterator& iter, const std::string& input);
+
+} // namespace net
+} // namespace browser
+} // namespace chrome
+
+#endif // CHROME_BROWSER_NET_QUOTED_PRINTABLE_H_
« no previous file with comments | « no previous file | chrome/browser/net/quoted_printable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698