summaryrefslogtreecommitdiff
path: root/src/filtercontainer.cpp
blob: 3cda7615fb5af474dd1de97cfbee5b2ddd509c20 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <filtercontainer.h>

namespace newsbeuter {

filtercontainer::~filtercontainer() { }

action_handler_status filtercontainer::handle_action(const std::string& action, const std::vector<std::string>& params) {
	/*
	 * filtercontainer does nothing but to save (filter name, filter expression) tuples.
	 * These tuples are used for enabling the user to predefine filter expressions and
	 * then select them from a list by their name.
	 */
	if (action == "define-filter") {
		if (params.size() >= 2) {
			filters.push_back(filter_name_expr_pair(params[0],params[1]));
			return AHS_OK;
		} else {
			return AHS_TOO_FEW_PARAMS;
		}
	}
	return AHS_INVALID_COMMAND;
}

}