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

37 lines
1.1 KiB
C
Raw Permalink Normal View History

2025-09-27 14:24:18 +08:00
#ifndef CCFIleInStream_H
#define CCFIleInStream_H
#include "CC.h"
using CCInStream = std::ifstream;
2025-09-30 16:24:15 +08:00
namespace CTL {
class FileInputStream final :public CCInStream{
public:
2025-09-27 14:24:18 +08:00
2025-09-30 16:24:15 +08:00
private:
public:
using std::ifstream::basic_ifstream;
FileInputStream();
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();
protected:
2025-09-27 14:24:18 +08:00
2025-09-30 16:24:15 +08:00
};
}
typedef CTL::FileInputStream CCFileInStream;
2025-09-27 14:24:18 +08:00
#endif