axmol/cocos/platform/CCFileStream.h

33 lines
647 B
C
Raw Normal View History

2020-08-27 00:21:44 +08:00
// Copyright (c) 2018-2019 HALX99
// Copyright (c) 2020 c4games.com
#pragma once
#include <string>
#include "platform/CCPlatformConfig.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN
2020-08-27 00:21:44 +08:00
class CC_DLL FileStream {
public:
FileStream() = default;
virtual ~FileStream() = default;
2020-08-27 10:19:21 +08:00
enum class Mode {
READ,
WRITE,
APPEND,
};
virtual int close() = 0;
virtual int seek(long offset, int origin) = 0;
virtual int read(void* buf, unsigned int size) = 0;
virtual int write(const void* buf, unsigned int size) = 0;
virtual int tell() = 0;
virtual bool isOpen() const = 0;
};
NS_CC_END