gecko-dev/xpcom/ds/nsByteBuffer.h

38 строки
1.0 KiB
C
Исходник Обычный вид История

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2012-05-21 15:12:37 +04:00
/* 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/. */
1999-05-19 01:43:13 +04:00
#ifndef nsByteBuffer_h__
#define nsByteBuffer_h__
#include "mozilla/Attributes.h"
1999-05-19 01:43:13 +04:00
#include "nsIByteBuffer.h"
class ByteBufferImpl MOZ_FINAL : public nsIByteBuffer {
1999-05-19 01:43:13 +04:00
public:
ByteBufferImpl(void);
NS_DECL_ISUPPORTS
static nsresult
1999-05-19 01:43:13 +04:00
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
NS_IMETHOD Init(uint32_t aBufferSize);
NS_IMETHOD_(uint32_t) GetLength(void) const;
NS_IMETHOD_(uint32_t) GetBufferSize(void) const;
1999-05-19 01:43:13 +04:00
NS_IMETHOD_(char*) GetBuffer() const;
NS_IMETHOD_(bool) Grow(uint32_t aNewSize);
NS_IMETHOD_(int32_t) Fill(nsresult* aErrorCode, nsIInputStream* aStream,
uint32_t aKeep);
1999-05-19 01:43:13 +04:00
char* mBuffer;
uint32_t mSpace;
uint32_t mLength;
private:
~ByteBufferImpl();
1999-05-19 01:43:13 +04:00
};
#endif // nsByteBuffer_h__