#ifndef PARSEBUFFER_HPP
# define PARSEBUFFER_HPP

# include <string>
# include <vector>
# include "IrcMessage.hpp"

class ParseBuffer
{
	private:
		std::string					_buffer;
		size_t						_maxLineSize;

		bool						extractOneLine(std::string &line);

	public:
		ParseBuffer(void);
		explicit ParseBuffer(size_t maxLineSize);
		ParseBuffer(const ParseBuffer &other);
		ParseBuffer &operator=(const ParseBuffer &other);
		~ParseBuffer(void);

		void						append(const char *data, size_t len);
		std::vector<IrcMessage>		extractMessages(void);
		void						clear(void);

		const std::string			&raw(void) const;
		size_t						size(void) const;
};

#endif
