Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 688f490ec1 | |||
| 6f6ea77e69 |
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
enum class OpType
|
||||
{
|
||||
Addition, Subtraction, Multiplication, Division, Modulo, Special
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "Operation.h"
|
||||
class BaseCalculator
|
||||
{
|
||||
|
||||
+4
-1
@@ -1,6 +1,7 @@
|
||||
#include "input_resolver.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#define delimiter " "
|
||||
|
||||
@@ -63,7 +64,9 @@ Command resolveCommand()
|
||||
auto validation_result = validate_token(token);
|
||||
if (!validation_result.ok())
|
||||
{
|
||||
throw std::runtime_error{"invalid token " + validation_result.incorrect_token()};
|
||||
std::ostringstream os;
|
||||
os << "invalid token "<< validation_result.incorrect_token();
|
||||
throw std::runtime_error{os.str()};
|
||||
}
|
||||
|
||||
bool shouldQuit = token.find("q") != token.npos;
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include "command.h"
|
||||
Command resolveCommand();
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "basecalc.h"
|
||||
|
||||
class SpecialCalculator: public BaseCalculator
|
||||
|
||||
Reference in New Issue
Block a user