Add readString inputHelper
This commit is contained in:
@@ -1 +1,11 @@
|
|||||||
|
/*
|
||||||
|
Author: Joel Mathew Thomas
|
||||||
|
Date: 19-02-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "inputHelper.h"
|
#include "inputHelper.h"
|
||||||
|
|
||||||
|
void util::readString(std::string& value)
|
||||||
|
{
|
||||||
|
getline(std::cin >> std::ws, value);
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ Date: 18-02-2026
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <limits>
|
||||||
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace util
|
namespace util
|
||||||
@@ -20,4 +22,6 @@ namespace util
|
|||||||
throw std::runtime_error("Invalid Console Input");
|
throw std::runtime_error("Invalid Console Input");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void readString(std::string&);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user