-FuncRequest::FuncRequest
- (BufferView * view, kb_action act, int ax, int ay, int aextra)
- : view_(view), action(act), argument(), x(ax), y(ay), extra(aextra)
-{}
+mouse_button::state FuncRequest::button() const
+{
+ return button_;
+}
+
+
+void split(vector<string> & args, string str)
+{
+ istringstream is(str);
+ while (is) {
+ char c;
+ string s;
+ is >> c;
+ if (c == '"')
+ getline(is, s, '"');
+ else {
+ is.putback(c);
+ is >> s;
+ }
+ args.push_back(s);
+ }
+}
+
+
+string FuncRequest::getArg(unsigned int i) const
+{
+ vector<string> args;
+ split(args, argument);
+ return i < args.size() ? args[i] : string();
+}