USB_Config_Vendor/CC_SDK/Include/Module/File/CCFIleInStream.h

39 lines
1.2 KiB
C
Raw Normal View History

2026-02-03 14:36:30 +08:00
#ifndef CCFIleInStream_H
#define CCFIleInStream_H
#include "CC.h"
using CCInStream = std::ifstream;
namespace CTL {
class FileInputStream final :public CCInStream{
public:
private:
public:
using std::ifstream::basic_ifstream;
FileInputStream();
explicit FileInputStream(const CTL::String& filename);
explicit FileInputStream(const CTL::String& filename, std::ios_base::openmode mode = std::ios::in);
explicit FileInputStream(const std::FILE* file);
static CTL::String ReadFileDataAll(const CTL::String& filename);
static CCVector<char> ReadBinaryFile(const CTL::String& filename);
static CTL::ByteArray ReadFileData(const CTL::String& filename);
static bool ReadData(FileInputStream &file,CTL::String &line);
bool ReadData(CTL::ByteArray &data,size_t size = 1024);
int read();
int read(char* buffer, size_t size);
int read(CTL::ByteArray& buffer);
int read(CTL::ByteArray& buffer, size_t offset, size_t length);
long skip(long n);
int available();
bool open(const String& filename, std::ios_base::openmode mode = std::ios::in);
protected:
};
}
typedef CTL::FileInputStream CCFileInStream;
#endif