File Handle

// File handle.
class RVAPI File
{
public:
    //  Get size.
    ulong GetSize() const;

    // Get current file position.
    ulong GetOffset() const;

    // Read integer value.
    void ReadInt(int &value);

    // Read float value.
    void ReadFloat(float &value);

    // Read [string] value.
    void ReadString(String &value);

    // Write integer [value].
    void WriteInt(int value);

    // Write float [value].
    void WriteFloat(float value);

    // Write string [value].
    void WriteString(wcstr value);

    // Truncate [file].
    void Truncate();

    // Seek [file] position from start of file.
    void SeekFromStart(slong offset);

    // Seek [file] position from current file postion.
    void SeekFromCur(slong offset);

    // Seek [file] position from end of file.
    void SeekFromEnd(slong offset);

    // Open [file] at [path]. [mode] is stdio file mode string. Only binary supported.
    void Open(wcstr path, wcstr mode);

    // Close [file].
    void Close();

    // Internal.
    void *operator () () const { return (void *)wobj; }

    // Open [file] at [path]. [mode] is stdio file mode string. Only binary supported.
    File(wcstr path, wcstr mode) : File() { Open(path, mode); }

    // Constructor.
    File();

    // Destructor.
    ~File();

private:
    byte wobj[64];
};