Polyphase Game Engine
Loading...
Searching...
No Matches
ClaudeCodeParser.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include "AnsiStripper.h"
7
8#include <deque>
9#include <string>
10
63class ClaudeCodeParser : public ITerminalOutputParser
64{
65public:
66 ClaudeCodeParser();
67
68 std::string Process(const char* data, size_t len) override;
69 void Reset() override;
70 const char* GetName() const override { return "claude-code"; }
71
72private:
79 void ScanAltScreenToggles(const char* data, size_t len);
80
86 std::string PostProcess(std::string stripped);
87
93 static void RewriteUnrenderableGlyphs(std::string& s);
94
96 AnsiStripper mStripper;
97
99 bool mAltScreen = false;
100
106 std::string mPeephole;
107
109 bool mEndsWithNewline = true;
110
123 std::deque<std::string> mRecentEmittedLines;
124 static constexpr size_t kRecentEmittedMax = 64;
125};
126
127#endif