/*---------------------------------------------------------------------------* Project: Horizon File: fslow_IArchive.h Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 20645 $ *---------------------------------------------------------------------------*/ #ifndef NN_FSLOW_FSLOW_IFILE_H_ #define NN_FSLOW_FSLOW_IFILE_H_ #include #include #include #include #include namespace nn { namespace fslow { template class IFile { public: virtual Result Close() = 0; virtual Result ReadBytes(s32* pRead, s64 offset, void* buffer, size_t size) = 0; virtual Result WriteBytes(s32* pWritten, s64 offset, const void* buffer, size_t size) = 0; virtual Result GetSize(s64* pOut) = 0; virtual Result SetSize(s64 size) = 0; virtual Result GetAttributes(nn::fs::Attributes* pOut) = 0; virtual Result SetAttributes(nn::fs::Attributes attributes) = 0; protected: virtual ~IFile() {} }; template class ReadOnlyFileBase : public TBase { public: virtual Result WriteBytes(s32*, s64, const void*, size_t) { return nn::fs::ResultUnsupportedOperation(); } virtual Result SetSize(s64) { return nn::fs::ResultUnsupportedOperation(); } virtual Result SetAttributes(nn::fs::Attributes) { return nn::fs::ResultUnsupportedOperation(); } }; }} #endif