{$MODE OBJFPC}
unit dbuffer;

interface

type
TBuffer = packed object
  Ptr: PByte;
  Size: Integer;
end;

TCursoredBuffer = packed object
  // TODO
end;

operator := (var Data: Integer): TBuffer; inline;

procedure Print(const Buffer: TBuffer); inline;

implementation

operator := (var Data: Integer): TBuffer;
begin
  Result.Ptr := @Data;
  Result.Size := SizeOf(Data);
  Writeln('Size: ', Result.Size);
  Print(Result);
end;

procedure Print(const Buffer: TBuffer);
var
  I: Integer;
begin
  for I := 0 to Buffer.Size -1 do
    Write(Char(Buffer.Ptr[I]));
end;

end.
