michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_file_memorystreams_h__ michael@0: #define mozilla_dom_file_memorystreams_h__ michael@0: michael@0: #include "FileCommon.h" michael@0: michael@0: #include "nsIOutputStream.h" michael@0: michael@0: BEGIN_FILE_NAMESPACE michael@0: michael@0: class MemoryOutputStream : public nsIOutputStream michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSIOUTPUTSTREAM michael@0: michael@0: static already_AddRefed michael@0: Create(uint64_t aSize); michael@0: michael@0: michael@0: const nsCString& michael@0: Data() const michael@0: { michael@0: return mData; michael@0: } michael@0: michael@0: private: michael@0: MemoryOutputStream() michael@0: : mOffset(0) michael@0: { } michael@0: michael@0: virtual ~MemoryOutputStream() michael@0: { } michael@0: michael@0: nsCString mData; michael@0: uint64_t mOffset; michael@0: }; michael@0: michael@0: END_FILE_NAMESPACE michael@0: michael@0: #endif // mozilla_dom_file_memorystreams_h__