xpcom/io/nsIScriptableBase64Encoder.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsISupports.idl"
michael@0 7
michael@0 8 interface nsIInputStream;
michael@0 9
michael@0 10 /**
michael@0 11 * nsIScriptableBase64Encoder efficiently encodes the contents
michael@0 12 * of a nsIInputStream to a Base64 string. This avoids the need
michael@0 13 * to read the entire stream into a buffer, and only then do the
michael@0 14 * Base64 encoding.
michael@0 15 *
michael@0 16 * If you already have a buffer full of data, you should use
michael@0 17 * btoa instead!
michael@0 18 */
michael@0 19 [scriptable, uuid(9479c864-d1f9-45ab-b7b9-28b907bd2ba9)]
michael@0 20 interface nsIScriptableBase64Encoder : nsISupports
michael@0 21 {
michael@0 22 /**
michael@0 23 * These methods take an nsIInputStream and return a narrow or wide
michael@0 24 * string with the contents of the nsIInputStream base64 encoded.
michael@0 25 *
michael@0 26 * The stream passed in must support ReadSegments and must not be
michael@0 27 * a non-blocking stream that will return NS_BASE_STREAM_WOULD_BLOCK.
michael@0 28 * If either of these restrictions are violated we will abort.
michael@0 29 */
michael@0 30 ACString encodeToCString(in nsIInputStream stream, in unsigned long length);
michael@0 31 AString encodeToString(in nsIInputStream stream, in unsigned long length);
michael@0 32 };

mercurial