2012-09-02 22:11:28 +00:00
|
|
|
/*
|
|
|
|
* ET: Legacy
|
|
|
|
* Copyright (C) 2012 Jan Simek <mail@etlegacy.com>
|
|
|
|
*
|
|
|
|
* This file is part of ET: Legacy - http://www.etlegacy.com
|
|
|
|
*
|
|
|
|
* ET: Legacy is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* ET: Legacy is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with ET: Legacy. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef ETPARSER_H
|
|
|
|
#define ETPARSER_H
|
|
|
|
|
2012-09-14 11:18:17 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
2012-10-13 22:05:40 +00:00
|
|
|
#include <sstream>
|
2012-09-14 11:18:17 +00:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include <boost/tokenizer.hpp>
|
|
|
|
#include <boost/algorithm/string.hpp>
|
|
|
|
|
2012-09-02 22:11:28 +00:00
|
|
|
class ETParser
|
|
|
|
{
|
|
|
|
public:
|
2012-09-14 11:18:17 +00:00
|
|
|
ETParser(std::vector<std::string> packets);
|
2012-09-02 22:11:28 +00:00
|
|
|
|
2012-09-14 11:18:17 +00:00
|
|
|
void ParseResponse(std::string rsp_to_parse);
|
|
|
|
void SplitVariables(std::string rsp_to_split);
|
2012-09-02 22:11:28 +00:00
|
|
|
|
2012-09-14 11:18:17 +00:00
|
|
|
void set_response_name(std::string rsp_header);
|
|
|
|
std::string get_variable(std::string key);
|
|
|
|
void add_variable(std::string key, std::string value);
|
|
|
|
private:
|
2012-10-13 23:15:31 +00:00
|
|
|
std::multimap<std::string, std::string> response_variables_;
|
2012-09-02 22:11:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ETPARSER_H
|