mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
fix: 用 to_string 和 string 加法取代 std::format 以通过非 win 平台编译
asst::ResultOrError 是 std::expected 的下位替代(同时又类似于 std::optional)
(cherry picked from commit 55875a2eb5)
28 lines
703 B
C++
28 lines
703 B
C++
#pragma once
|
|
|
|
#include <optional>
|
|
#include <vector>
|
|
|
|
#include "Config/TaskData.h"
|
|
#include "TaskDataSymbol.h"
|
|
#include "TaskDataTypes.hpp"
|
|
|
|
namespace asst
|
|
{
|
|
class TaskDataSymbolStream final
|
|
{
|
|
public:
|
|
using Symbol = TaskDataSymbol;
|
|
using Symbols = TaskDataSymbol::Symbols;
|
|
using SymbolsOrError = TaskDataSymbol::SymbolsOrError;
|
|
using AppendPrefixFunc = std::function<SymbolsOrError(const Symbol&, const Symbol&)>;
|
|
|
|
private:
|
|
Symbols m_symbolstream;
|
|
|
|
public:
|
|
ResultOrError<bool> parse(std::string_view task_expr);
|
|
SymbolsOrError decode(AppendPrefixFunc append_prefix, std::string_view self_name) const;
|
|
};
|
|
} // namespace asst
|