Blame xpcom/io/nsIScriptableBase64Encoder.idl
|
Packit |
f0b94e |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
Packit |
f0b94e |
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
Packit |
f0b94e |
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
Packit |
f0b94e |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
#include "nsISupports.idl"
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
interface nsIInputStream;
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
/**
|
|
Packit |
f0b94e |
* nsIScriptableBase64Encoder efficiently encodes the contents
|
|
Packit |
f0b94e |
* of a nsIInputStream to a Base64 string. This avoids the need
|
|
Packit |
f0b94e |
* to read the entire stream into a buffer, and only then do the
|
|
Packit |
f0b94e |
* Base64 encoding.
|
|
Packit |
f0b94e |
*
|
|
Packit |
f0b94e |
* If you already have a buffer full of data, you should use
|
|
Packit |
f0b94e |
* btoa instead!
|
|
Packit |
f0b94e |
*/
|
|
Packit |
f0b94e |
[scriptable, uuid(9479c864-d1f9-45ab-b7b9-28b907bd2ba9)]
|
|
Packit |
f0b94e |
interface nsIScriptableBase64Encoder : nsISupports
|
|
Packit |
f0b94e |
{
|
|
Packit |
f0b94e |
/**
|
|
Packit |
f0b94e |
* These methods take an nsIInputStream and return a narrow or wide
|
|
Packit |
f0b94e |
* string with the contents of the nsIInputStream base64 encoded.
|
|
Packit |
f0b94e |
*
|
|
Packit |
f0b94e |
* The stream passed in must support ReadSegments and must not be
|
|
Packit |
f0b94e |
* a non-blocking stream that will return NS_BASE_STREAM_WOULD_BLOCK.
|
|
Packit |
f0b94e |
* If either of these restrictions are violated we will abort.
|
|
Packit |
f0b94e |
*/
|
|
Packit |
f0b94e |
ACString encodeToCString(in nsIInputStream stream, in unsigned long length);
|
|
Packit |
f0b94e |
AString encodeToString(in nsIInputStream stream, in unsigned long length);
|
|
Packit |
f0b94e |
};
|