Newer
Older
#pragma once
#include "syringe.h"
Malaurie Bernard
committed
#include "syringefilled.h"
class Cli
{
private:
SyringeFilled& syringe_filled;
String _currentInput;
String _temp;
int _currentWordIndex;
void resetNextWord ();
const char* findNextWord ();
void copyNextToTemp ();
bool kw (const __FlashStringHelper* keyWord, const char* input);
bool kw (const __FlashStringHelper* keyWord);
void syntax (const __FlashStringHelper* cmd);
void syntax (const char* cmd = nullptr);
void answer (bool ok, const String& error_message = emptyString) const;
void check_emergency ();
Cli (SyringeFilled& syringe_filled, int bufferLen = 32): syringe_filled(syringe_filled)
{
_currentInput.reserve(bufferLen);
_temp.reserve(bufferLen);
resetNextWord();
}
void loop (Stream& input);
};