xpcom/io/nsScriptableBase64Encoder.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/io/nsScriptableBase64Encoder.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsScriptableBase64Encoder.h"
    1.10 +#include "mozilla/Base64.h"
    1.11 +
    1.12 +using namespace mozilla;
    1.13 +
    1.14 +NS_IMPL_ISUPPORTS(nsScriptableBase64Encoder, nsIScriptableBase64Encoder)
    1.15 +
    1.16 +/* ACString encodeToCString (in nsIInputStream stream, in unsigned long length); */
    1.17 +NS_IMETHODIMP
    1.18 +nsScriptableBase64Encoder::EncodeToCString(nsIInputStream *aStream,
    1.19 +                                           uint32_t aLength,
    1.20 +                                           nsACString & _retval)
    1.21 +{
    1.22 +  Base64EncodeInputStream(aStream, _retval, aLength);
    1.23 +  return NS_OK;
    1.24 +}
    1.25 +
    1.26 +/* AString encodeToString (in nsIInputStream stream, in unsigned long length); */
    1.27 +NS_IMETHODIMP
    1.28 +nsScriptableBase64Encoder::EncodeToString(nsIInputStream *aStream,
    1.29 +                                          uint32_t aLength,
    1.30 +                                          nsAString & _retval)
    1.31 +{
    1.32 +  Base64EncodeInputStream(aStream, _retval, aLength);
    1.33 +  return NS_OK;
    1.34 +}

mercurial