Fixes #202 This PR fixes code style for the project files. The Problem Different files in the project use different code style. That is not consistent and leads to harder maintenance of the project. Description of the changes: Have investigated and determined the most used code style across the given codebase Have configured IDE and applied code style to all project files. Have crafted clang-formatter config. see https://clang.llvm.org/docs/ClangFormat.html https://clang.llvm.org/docs/ClangFormatStyleOptions.html Some cases were fixed manually How changes were validated: manual/ad-hoc testing, automated testing All tests pass as before because these are only code style changes. Additional Please review, and let me know if I have any mistake in the code style. In case of any mistake, I will change the configuration and re-apply it to the project.
58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#pragma once
|
|
|
|
#include <memory> // for std::shared_ptr
|
|
#include "CalculatorVector.h"
|
|
#include "Command.h"
|
|
|
|
class ISerializeCommandVisitor;
|
|
|
|
class IExpressionCommand
|
|
{
|
|
public:
|
|
virtual CalculationManager::CommandType GetCommandType() const = 0;
|
|
virtual void Accept(_In_ ISerializeCommandVisitor& commandVisitor) = 0;
|
|
};
|
|
|
|
class IOperatorCommand : public IExpressionCommand
|
|
{
|
|
public:
|
|
virtual void SetCommand(int command) = 0;
|
|
};
|
|
|
|
class IUnaryCommand : public IOperatorCommand
|
|
{
|
|
public:
|
|
virtual const std::shared_ptr<CalculatorVector<int>>& GetCommands() const = 0;
|
|
virtual void SetCommands(int command1, int command2) = 0;
|
|
};
|
|
|
|
class IBinaryCommand : public IOperatorCommand
|
|
{
|
|
public:
|
|
virtual void SetCommand(int command) override = 0;
|
|
virtual int GetCommand() const = 0;
|
|
};
|
|
|
|
class IOpndCommand : public IExpressionCommand
|
|
{
|
|
public:
|
|
virtual const std::shared_ptr<CalculatorVector<int>>& GetCommands() const = 0;
|
|
virtual void AppendCommand(int command) = 0;
|
|
virtual void ToggleSign() = 0;
|
|
virtual void RemoveFromEnd() = 0;
|
|
virtual bool IsNegative() const = 0;
|
|
virtual bool IsSciFmt() const = 0;
|
|
virtual bool IsDecimalPresent() const = 0;
|
|
virtual const std::wstring& GetToken(wchar_t decimalSymbol) = 0;
|
|
virtual void SetCommands(std::shared_ptr<CalculatorVector<int>> const& commands) = 0;
|
|
};
|
|
|
|
class IParenthesisCommand : public IExpressionCommand
|
|
{
|
|
public:
|
|
virtual int GetCommand() const = 0;
|
|
};
|