AAAAAAAAAAAAAAAAAAAAAAAAAAAh

This commit is contained in:
Kbz-8
2024-02-05 16:26:22 +01:00
parent 3638fb92eb
commit 56a6d23581
2 changed files with 17 additions and 13 deletions

View File

@@ -6,7 +6,7 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/21 10:36:21 by maldavid #+# #+# */
/* Updated: 2024/02/05 14:52:42 by vvaas ### ########.fr */
/* Updated: 2024/02/05 16:26:14 by maldavid ### ########.fr */
/* */
/******************************************************************************/
@@ -16,7 +16,6 @@
#include <errorscode.hpp>
#include <cstdlib>
#include <unstd/string.hpp>
#include <iostream>
namespace irc
{

View File

@@ -6,7 +6,7 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/21 11:38:34 by maldavid #+# #+# */
/* Updated: 2024/02/05 16:09:12 by maldavid ### ########.fr */
/* Updated: 2024/02/05 16:23:31 by maldavid ### ########.fr */
/* */
/******************************************************************************/
@@ -37,8 +37,11 @@ namespace irc
it++;
}
}
elems.push_back(token);
for(std::vector<std::string>::iterator vit = elems.begin(); vit != elems.end();)
{
bool isempty = true;
for(std::string::const_iterator it = token.begin(); it != token.end(); ++it)
for(std::string::const_iterator it = vit->begin(); it != vit->end(); ++it)
{
if(!std::isspace(*it))
{
@@ -46,8 +49,11 @@ namespace irc
break;
}
}
if(!isempty)
elems.push_back(token);
if(isempty)
vit = elems.erase(vit);
else
vit++;
}
}
std::vector<std::string> split(const std::string& s)
@@ -77,11 +83,10 @@ namespace irc
if((*it)[0] == ':')
it->erase(it->begin());
_reason.append(*it);
if(it != tokens.end() - 1)
_reason.push_back(' ');
}
}
if (!_reason.empty())
_reason.erase(_reason.end() - 1);
}
Message::~Message() {}