/*!
 * Copyright (c) 2015-2018, NADAL Jean-Baptiste. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301 USA
 *
 * @Author:  NADAL Jean-Baptiste
 * @Date: 23/06/2017
 */

#ifndef _WEB_CONTROLLER_H
#define _WEB_CONTROLLER_H

/*------------------------------- INCLUDES ----------------------------------*/

#include <string>

/*--------------------------------- Define ----------------------------------*/

/*----------------------------- Dependencies --------------------------------*/

class WebConnection;
struct uhttpd_ops;
struct client;

/*--------------------------------- CLASS ----------------------------------*/

class WebController
{
  public:
	WebController(void);
	WebController(const std::string &a_path);
	virtual ~WebController(void);

	virtual bool find(const std::string &an_url);

	void set_name(const std::string &a_name);
	const std::string &get_name(void);

	std::string get_path(void);

	virtual WebConnection *new_connection(struct uhttpd_ops *an_ops, struct client *a_client, const std::string &a_parameters);

  private:
	std::string m_name;
	std::string m_path;
};

#endif /* _WEB_CONTROLLER_H */
