mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-06-25 09:33:36 +02:00
「🏗️」 wip: started file up
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/29 14:20:09 by mmoussou #+# #+# */
|
||||
/* Updated: 2025/05/13 10:11:34 by adjoly ### ########.fr */
|
||||
/* Updated: 2025/05/13 18:27:46 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -18,33 +18,29 @@
|
||||
namespace webserv {
|
||||
namespace server {
|
||||
|
||||
enum clientResType {
|
||||
CGI,
|
||||
UP_FILE
|
||||
};
|
||||
enum clientResType { CGI, UP_FILE };
|
||||
|
||||
class AClientResource {
|
||||
public:
|
||||
virtual ~AClientResource() {}
|
||||
public:
|
||||
virtual ~AClientResource() {}
|
||||
|
||||
bool operator==(int i) const {
|
||||
bool operator==(int i) const {
|
||||
if (i == _res_id)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void addFileDescriptor(struct pollfd fd);
|
||||
struct pollfd getFileDescriptor();
|
||||
void setFileDescriptor(struct pollfd *fd) { _fd = fd; }
|
||||
struct pollfd getFileDescriptor(void) const { return *_fd; }
|
||||
|
||||
virtual clientResType type(void);
|
||||
int getId(void) const { return _res_id; }
|
||||
virtual clientResType type(void) const ;
|
||||
int getId(void) const { return _res_id; }
|
||||
|
||||
protected:
|
||||
struct pollfd _fd;
|
||||
|
||||
int _res_id;
|
||||
protected:
|
||||
struct pollfd *_fd;
|
||||
|
||||
int _res_id;
|
||||
};
|
||||
|
||||
} // -namepsace server
|
||||
} // -namespace webserv
|
||||
} // namespace server
|
||||
} // namespace webserv
|
||||
|
@ -1,27 +1,32 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* AResource.cpp :+: :+: :+: */
|
||||
/* FileUpload.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/29 14:42:01 by mmoussou #+# #+# */
|
||||
/* Updated: 2025/04/29 15:45:19 by adjoly ### ########.fr */
|
||||
/* Created: 2025/05/13 18:14:45 by adjoly #+# #+# */
|
||||
/* Updated: 2025/05/13 18:56:25 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <server/AResource.hpp>
|
||||
#pragma once
|
||||
|
||||
using namespace webserv;
|
||||
using namespace server;
|
||||
#include "server/AResource.hpp"
|
||||
|
||||
void AClientResource::addFileDescriptor(struct pollfd fd)
|
||||
{
|
||||
this->_fd = fd;
|
||||
}
|
||||
namespace webserv {
|
||||
namespace server {
|
||||
|
||||
class FileUpload : public AClientResource {
|
||||
public:
|
||||
FileUpload(int id) { _res_id = id; }
|
||||
~FileUpload(void) {}
|
||||
|
||||
struct pollfd AClientResource::getFileDescriptor()
|
||||
{
|
||||
return (this->_fd);
|
||||
}
|
||||
clientResType type(void) const { return UP_FILE; }
|
||||
|
||||
protected:
|
||||
private:
|
||||
};
|
||||
|
||||
} // namespace server
|
||||
} // namespace webserv
|
Reference in New Issue
Block a user