1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: fs_MemoryInputStream.h 4 5 Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 46347 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NN_FS_FS_MEMORYINPUTSTREAM_H_ 17 #define NN_FS_FS_MEMORYINPUTSTREAM_H_ 18 19 #include <nn/fs/fs_MemoryStream.h> 20 21 namespace nn { namespace fs { 22 23 class MemoryInputStream : public IInputStream, private detail::MemoryStreamBase, private nn::util::NonCopyable<MemoryInputStream> 24 { 25 private: 26 typedef detail::MemoryStreamBase Base; 27 public: MemoryInputStream(const bit8 * buffer,size_t size)28 MemoryInputStream(const bit8* buffer, size_t size) : Base(const_cast<bit8*>(buffer), size) {} 29 TrySeek(s64 position,PositionBase base)30 virtual Result TrySeek(s64 position, PositionBase base) { return Base::TrySeek(position, base); } Seek(s64 position,PositionBase base)31 virtual void Seek(s64 position, PositionBase base) { Base::Seek(position, base); } 32 TryGetPosition(s64 * pOut)33 virtual Result TryGetPosition(s64* pOut) const { return Base::TryGetPosition(pOut); } GetPosition()34 virtual s64 GetPosition() const { return Base::GetPosition(); } 35 TrySetPosition(s64 position)36 virtual Result TrySetPosition(s64 position) { return Base::TrySetPosition(position); } SetPosition(s64 position)37 virtual void SetPosition(s64 position) { Base::SetPosition(position); } 38 TryGetSize(s64 * pOut)39 virtual Result TryGetSize(s64* pOut) const { return Base::TryGetSize(pOut); } GetSize()40 virtual s64 GetSize() const { return Base::GetSize(); } 41 TryRead(s32 * pOut,void * buffer,size_t size)42 virtual Result TryRead(s32* pOut, void* buffer, size_t size) { return Base::TryRead(pOut, buffer, size); } Read(void * buffer,size_t size)43 virtual s32 Read(void* buffer, size_t size) { return Base::Read(buffer, size); } 44 45 }; 46 47 }} 48 49 #endif 50