2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsUnicharBuffer_h__
|
|
|
|
#define nsUnicharBuffer_h__
|
|
|
|
|
|
|
|
#include "nsIUnicharBuffer.h"
|
2012-06-05 16:51:58 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-05 16:51:58 -07:00
|
|
|
class UnicharBufferImpl MOZ_FINAL : public nsIUnicharBuffer {
|
2007-03-22 10:30:00 -07:00
|
|
|
public:
|
|
|
|
UnicharBufferImpl();
|
|
|
|
|
|
|
|
static NS_METHOD
|
|
|
|
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_IMETHOD Init(PRUint32 aBufferSize);
|
|
|
|
NS_IMETHOD_(PRInt32) GetLength() const;
|
|
|
|
NS_IMETHOD_(PRInt32) GetBufferSize() const;
|
|
|
|
NS_IMETHOD_(PRUnichar*) GetBuffer() const;
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHOD_(bool) Grow(PRInt32 aNewSize);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
PRUnichar* mBuffer;
|
|
|
|
PRUint32 mSpace;
|
|
|
|
PRUint32 mLength;
|
|
|
|
|
|
|
|
private:
|
|
|
|
~UnicharBufferImpl();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsUnicharBuffer_h__
|