2#ifndef WVSTREAMSDEBUGGER_H
3#define WVSTREAMSDEBUGGER_H
8#include "wvstringlist.h"
19 typedef wv::function<void(WvStringParm, WvStringList&)> ResultCallback;
29 typedef wv::function<
void*(WvStringParm)> InitCallback;
30 typedef wv::function<WvString(WvStringParm, WvStringList&,
31 ResultCallback,
void*)> RunCallback;
33 typedef wv::function<void(WvStringParm,
void*)> CleanupCallback;
37 typedef wv::function<void(WvStringParm,
void*)> ForeachCallback;
45 CleanupCallback cleanup_cb;
47 Command(InitCallback _init_cb, RunCallback _run_cb,
48 CleanupCallback _cleanup_cb)
52 cleanup_cb = _cleanup_cb;
55 typedef std::map<WvString, Command> CommandMap;
56 static CommandMap *commands;
57 typedef std::map<WvString, void*> CommandDataMap;
58 CommandDataMap command_data;
60 void *get_command_data(WvStringParm cmd, Command *command);
61 friend class WvStreamsDebuggerStaticInitCleanup;
68 WvString run(WvStringParm cmd, WvStringList &args,
69 ResultCallback result_cb);
71 static bool add_command(WvStringParm cmd,
74 CleanupCallback cleanup_cb);
76 static bool foreach(WvStringParm cmd, ForeachCallback foreach_cb);
80 static WvString help_run_cb(WvStringParm cmd,
82 ResultCallback result_cb,
void *);
Functions to handle "tcl-style" strings and lists.