intl/uconv/nsConverterInputStream.h
author B2G Bumper Bot <release+b2gbumper@mozilla.com>
Wed, 16 Sep 2015 16:17:19 -0700
changeset 295440 22d612235e76cc48ad9c40d605bf9669fee0ae7d
parent 217666 4feaed7d41deb55fec4a214dba3db252a48e641b
child 412434 e155fa765af299f0e8cfb42e0a1709e5b04928b9
permissions -rw-r--r--
Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/720b99002d54 Author: Hubert Figuière <hub@figuiere.net> Desc: Merge pull request #31871 from hfiguiere/bug1205152-shadow-root-marionette Bug 1205152 - Use switchToShadowRoot() instead of executeScript() r=justindarc ======== https://hg.mozilla.org/integration/gaia-central/rev/17f4a87de64d Author: Hubert Figuière <hub@figuiere.net> Desc: Bug 1205152 - Use switchToShadowRoot() instead of executeScript() ======== https://hg.mozilla.org/integration/gaia-central/rev/13a9289c2ccc Author: Gabriele Svelto <gsvelto@mozilla.com> Desc: Merge pull request #31641 from gabrielesvelto/bug-1190790-fix-dialer-navigation Bug 1190790 - Make sure that panels are populated correctly when navigating to them r=drs ======== https://hg.mozilla.org/integration/gaia-central/rev/a17e5c5becb9 Author: Gabriele Svelto <gsvelto@mozilla.com> Desc: Bug 1190790 - Make sure that panels are populated correctly when navigating to them r=drs

/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsConverterInputStream_h
#define nsConverterInputStream_h

#include "nsIInputStream.h"
#include "nsIConverterInputStream.h"
#include "nsIUnicharLineInputStream.h"
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsIUnicodeDecoder.h"
#include "nsReadLine.h"

#define NS_CONVERTERINPUTSTREAM_CONTRACTID "@mozilla.org/intl/converter-input-stream;1"

// {2BC2AD62-AD5D-4b7b-A9DB-F74AE203C527}
#define NS_CONVERTERINPUTSTREAM_CID \
  { 0x2bc2ad62, 0xad5d, 0x4b7b, \
   { 0xa9, 0xdb, 0xf7, 0x4a, 0xe2, 0x3, 0xc5, 0x27 } }



class nsConverterInputStream : public nsIConverterInputStream,
                               public nsIUnicharLineInputStream {

 public:
    NS_DECL_ISUPPORTS
    NS_DECL_NSIUNICHARINPUTSTREAM
    NS_DECL_NSIUNICHARLINEINPUTSTREAM
    NS_DECL_NSICONVERTERINPUTSTREAM

    nsConverterInputStream() :
        mLastErrorCode(NS_OK),
        mLeftOverBytes(0),
        mUnicharDataOffset(0),
        mUnicharDataLength(0),
        mReplacementChar(DEFAULT_REPLACEMENT_CHARACTER),
        mLineBuffer(nullptr) { }

 private:
    virtual ~nsConverterInputStream() { Close(); }

    uint32_t Fill(nsresult *aErrorCode);
    
    nsCOMPtr<nsIUnicodeDecoder> mConverter;
    FallibleTArray<char> mByteData;
    FallibleTArray<char16_t> mUnicharData;
    nsCOMPtr<nsIInputStream> mInput;

    nsresult  mLastErrorCode;
    uint32_t  mLeftOverBytes;
    uint32_t  mUnicharDataOffset;
    uint32_t  mUnicharDataLength;
    char16_t mReplacementChar;

    nsAutoPtr<nsLineBuffer<char16_t> > mLineBuffer;
};

#endif