//--------------------------------------------------------------------------
// Copyright (C) 2014-2015 Cisco and/or its affiliates. All rights reserved.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License Version 2 as published
// by the Free Software Foundation.  You may not use, modify or distribute
// this program under any other version of the GNU General Public License.
//
// This program 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 this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
//--------------------------------------------------------------------------
// rule_http_encode.cc author Josh Rosenbaum <jrosenba@cisco.com>

#include <sstream>
#include <vector>

#include "conversion_state.h"
#include "helpers/converter.h"
#include "rule_states/rule_api.h"
#include "helpers/s2l_util.h"

namespace rules
{
namespace
{
class HttpEncode : public ConversionState
{
public:
    HttpEncode(Converter& c) : ConversionState(c) { }
    virtual ~HttpEncode() { }
    virtual bool convert(std::istringstream& data);
};
} // namespace

bool HttpEncode::convert(std::istringstream& data_stream)
{
    std::string tmp;
    rule_api.add_comment("option deleted: http_encode");
    tmp = util::get_rule_option_args(data_stream);
    return set_next_rule_state(data_stream);
}

/**************************
 *******  A P I ***********
 **************************/

static ConversionState* ctor(Converter& c)
{ return new HttpEncode(c); }

static const std::string http_encode = "http_encode";
static const ConvertMap http_encode_api =
{
    http_encode,
    ctor,
};

const ConvertMap* http_encode_map = &http_encode_api;
} // namespace rules

