#pragma once
#include <string>
#include <windows.h>

namespace System::IO {
    class FileStream {
    private:
        HANDLE hFile;
        std::wstring path;
    public:
        FileStream(const std::wstring& filePath, 
                   DWORD access, 
                   DWORD creationDisposition, 
                   DWORD shareMode = 0, 
                   DWORD flagsAndAttributes = FILE_ATTRIBUTE_NORMAL);
        ~FileStream();

        bool Read(void* buffer, DWORD numBytesToRead, DWORD& numBytesRead);
        bool Write(const void* buffer, DWORD numBytesToWrite, DWORD& numBytesWritten);
        bool Seek(LARGE_INTEGER offset, DWORD moveMethod, ULARGE_INTEGER& newPos);
        bool SetEnd();

        HANDLE GetHandle() const { return hFile; }
        std::wstring GetPath() const { return path; }
    };
}
