1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00
Files
OpenRCT2/src/openrct2/core/StringReader.h
73 b9e677945d Replace 20XX with 2022 (#18158)
* Replace 2020 with 2022

Replace all 2020 headers with 2022

* replace other years with 2022

add missing years
2022-10-01 08:42:14 +01:00

39 lines
1.1 KiB
C++

/*****************************************************************************
* Copyright (c) 2014-2022 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "../common.h"
#include "../core/String.hpp"
struct IStringReader
{
virtual ~IStringReader() = default;
virtual bool TryPeek(codepoint_t* outCodepoint) abstract;
virtual bool TryRead(codepoint_t* outCodepoint) abstract;
virtual void Skip() abstract;
virtual bool CanRead() const abstract;
};
class UTF8StringReader final : public IStringReader
{
public:
explicit UTF8StringReader(const utf8* text);
bool TryPeek(codepoint_t* outCodepoint) override;
bool TryRead(codepoint_t* outCodepoint) override;
void Skip() override;
bool CanRead() const override;
private:
const utf8* _text;
const utf8* _current;
};