🏗️」 wip: started file up

This commit is contained in:
2025-05-15 11:04:49 +02:00
parent 773e7855b0
commit 3300dcd057
2 changed files with 34 additions and 33 deletions

View File

@ -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,13 +18,10 @@
namespace webserv {
namespace server {
enum clientResType {
CGI,
UP_FILE
};
enum clientResType { CGI, UP_FILE };
class AClientResource {
public:
public:
virtual ~AClientResource() {}
bool operator==(int i) const {
@ -33,18 +30,17 @@ public:
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);
virtual clientResType type(void) const ;
int getId(void) const { return _res_id; }
protected:
struct pollfd _fd;
protected:
struct pollfd *_fd;
int _res_id;
};
} // -namepsace server
} // -namespace webserv
} // namespace server
} // namespace webserv

View File

@ -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