2024-05-15 00:49:09 -04:00
|
|
|
// Copyright 2024 xensik. All rights reserved.
|
2024-02-27 01:34:37 -05:00
|
|
|
//
|
|
|
|
// Use of this source code is governed by a GNU GPLv3 license
|
|
|
|
// that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace xsk::gsc
|
|
|
|
{
|
|
|
|
|
|
|
|
struct lookahead
|
|
|
|
{
|
|
|
|
char const* buffer_pos;
|
|
|
|
usize available;
|
|
|
|
char last_byte;
|
|
|
|
char curr_byte;
|
|
|
|
|
|
|
|
lookahead(char const* data, usize size);
|
|
|
|
auto advance() -> void;
|
|
|
|
auto ended() { return available == 0; };
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace xsk::gsc
|