summaryrefslogtreecommitdiff
path: root/include/textproc.h
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-04-16 01:46:52 +0100
committerSadie Powell <sadie@witchery.services>2025-04-16 01:50:59 +0100
commit74e9a9d2feb3690dc06a310e0477cd6f17e25fab (patch)
treebfde58ac0c6babff941b29459b92e89c22cb9d76 /include/textproc.h
parentd2aee394ea5bc91b132001fb5bf2457eec295432 (diff)
Automatically wrap the help output.
Diffstat (limited to 'include/textproc.h')
-rw-r--r--include/textproc.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/textproc.h b/include/textproc.h
index 62c88bcb4..cfde60637 100644
--- a/include/textproc.h
+++ b/include/textproc.h
@@ -11,14 +11,26 @@
#pragma once
-class TextSplitter final
+class CoreExport HelpWrapper final
+{
+private:
+ std::vector<std::pair<Anope::string, Anope::string>> entries;
+ size_t longest = 0;
+
+public:
+ void AddEntry(const Anope::string &name, const Anope::string &desc);
+ void SendTo(CommandSource &source);
+};
+
+class CoreExport TextSplitter final
{
private:
- Anope::string text;
std::vector<Anope::string> formatting;
+ const size_t max_length;
+ Anope::string text;
public:
- TextSplitter(const Anope::string &t);
+ TextSplitter(const Anope::string &t, size_t ml = 0);
bool GetLine(Anope::string &out);
};