Added parser class

This commit is contained in:
ouafabulous 2025-05-19 15:25:33 +02:00
parent 86531035a8
commit 53a83308de
6 changed files with 105 additions and 17 deletions

View file

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* core.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* By: omoudni <omoudni@student.42paris.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/12 14:16:03 by rparodi #+# #+# */
/* Updated: 2025/05/13 12:45:24 by rparodi ### ########.fr */
/* Updated: 2025/05/19 15:07:26 by omoudni ### ########.fr */
/* */
/* ************************************************************************** */
@ -23,5 +23,6 @@
#include "color.hpp"
#include "server.hpp"
#include "parser.hpp"
unsigned short int valid_port(char *input);

30
include/core/parser.hpp Normal file
View file

@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parser.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: omoudni <omoudni@student.42paris.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/19 14:47:46 by omoudni #+# #+# */
/* Updated: 2025/05/19 15:14:31 by omoudni ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include "core.hpp"
#include <string>
class Parser {
private:
unsigned short int _port;
std::string _password;
bool _valid;
std::string _errorMsg;
public:
Parser(int argc, char* argv[]);
bool isValid() const;
unsigned short int getPort() const;
const std::string& getPassword() const;
const std::string& getErrorMsg() const;
};