// mConsole.h
// ````````````

#pragma once

#include <string>

struct mConsoleData;

class mConsole {
private:

	// Implementation details
	mConsoleData* _d;

	// Erases the current line and returns the cursor
	void _eraseCurrentLine();
	
	// Replace the input buffer
	void _redrawInputBuffer();
	
	// Displays the input buffer
	void _displayInputBuffer();
	
public:

	// Constructor
	mConsole();
	
	// Deconstructor
	~mConsole();
	
	// Print string without interfering with the input line
	void puts(const char* text);
	
	// Print string without interfering with the input line
	void puts_nonewline(const char* text);

	// Print formatted string without interfering with the input line
	void printf(const char* fmt, ...);
	
	// Manage input events
	bool manageInput();
	
	// Set input buffer
	void setLine(const char* inBuff);
	
	// Retrieve buffer
	void getLine(std::string& outBuff);
		
	// Assigns the prompt
	void setPrompt(const char* prompt_str);

	// Retrieve the prompt
	void getPrompt(std::string& outBuff);
};
