diff options
| author | Fuwn <[email protected]> | 2024-05-31 00:00:12 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-05-31 00:20:41 -0700 |
| commit | 968e1c4af014b7f40bfaa4f57fcc0f38e5e0d847 (patch) | |
| tree | df80525ad0cc9e4b561bfb0772c30ccc5b64b4a2 /source/utility.cc | |
| parent | feat: initial commit (diff) | |
| download | cst_136_assignment_eight-main.tar.xz cst_136_assignment_eight-main.zip | |
Diffstat (limited to 'source/utility.cc')
| -rw-r--r-- | source/utility.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/utility.cc b/source/utility.cc new file mode 100644 index 0000000..0cfd818 --- /dev/null +++ b/source/utility.cc @@ -0,0 +1,23 @@ +#include <iostream> +#include <string> +#include <string_view> + +#include <book_store/utility.hh> + +namespace book_store::utility { +auto prompt(std::string_view message) -> std::string { + std::string input; + + std::cout << message; + + std::getline(std::cin, input); + + return input; +} + +auto clear_cerr() -> void { + if (!std::cerr.good()) { + std::cerr.clear(); + } +} +} // namespace book_store::utility |