Fix the project code style, as it is not consistent. (#236)
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.
This commit is contained in:
committed by
Daniel Belcher
parent
c77f1de84c
commit
2826d37056
@@ -12,7 +12,7 @@ public:
|
||||
CParentheses(_In_ int command);
|
||||
int GetCommand() const override;
|
||||
CalculationManager::CommandType GetCommandType() const override;
|
||||
void Accept(_In_ ISerializeCommandVisitor &commandVisitor) override;
|
||||
void Accept(_In_ ISerializeCommandVisitor& commandVisitor) override;
|
||||
|
||||
private:
|
||||
int m_command;
|
||||
@@ -23,11 +23,11 @@ class CUnaryCommand final : public IUnaryCommand
|
||||
public:
|
||||
CUnaryCommand(int command);
|
||||
CUnaryCommand(int command1, int command2);
|
||||
const std::shared_ptr<CalculatorVector<int>> & GetCommands() const override;
|
||||
const std::shared_ptr<CalculatorVector<int>>& GetCommands() const override;
|
||||
CalculationManager::CommandType GetCommandType() const override;
|
||||
void SetCommand(int command) override;
|
||||
void SetCommands(int command1, int command2) override;
|
||||
void Accept(_In_ ISerializeCommandVisitor &commandVisitor) override;
|
||||
void Accept(_In_ ISerializeCommandVisitor& commandVisitor) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<CalculatorVector<int>> m_command;
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
void SetCommand(int command) override;
|
||||
int GetCommand() const override;
|
||||
CalculationManager::CommandType GetCommandType() const override;
|
||||
void Accept(_In_ ISerializeCommandVisitor &commandVisitor) override;
|
||||
void Accept(_In_ ISerializeCommandVisitor& commandVisitor) override;
|
||||
|
||||
private:
|
||||
int m_command;
|
||||
@@ -49,14 +49,10 @@ private:
|
||||
class COpndCommand final : public IOpndCommand
|
||||
{
|
||||
public:
|
||||
COpndCommand(
|
||||
std::shared_ptr<CalculatorVector<int>> const &commands,
|
||||
bool fNegative,
|
||||
bool fDecimal,
|
||||
bool fSciFmt);
|
||||
COpndCommand(std::shared_ptr<CalculatorVector<int>> const& commands, bool fNegative, bool fDecimal, bool fSciFmt);
|
||||
void Initialize(CalcEngine::Rational const& rat);
|
||||
|
||||
const std::shared_ptr<CalculatorVector<int>> & GetCommands() const override;
|
||||
const std::shared_ptr<CalculatorVector<int>>& GetCommands() const override;
|
||||
void SetCommands(std::shared_ptr<CalculatorVector<int>> const& commands) override;
|
||||
void AppendCommand(int command) override;
|
||||
void ToggleSign() override;
|
||||
@@ -64,9 +60,9 @@ public:
|
||||
bool IsNegative() const override;
|
||||
bool IsSciFmt() const override;
|
||||
bool IsDecimalPresent() const override;
|
||||
const std::wstring & GetToken(wchar_t decimalSymbol) override;
|
||||
const std::wstring& GetToken(wchar_t decimalSymbol) override;
|
||||
CalculationManager::CommandType GetCommandType() const override;
|
||||
void Accept(_In_ ISerializeCommandVisitor &commandVisitor) override;
|
||||
void Accept(_In_ ISerializeCommandVisitor& commandVisitor) override;
|
||||
std::wstring GetString(uint32_t radix, int32_t precision);
|
||||
|
||||
private:
|
||||
@@ -83,8 +79,8 @@ private:
|
||||
class ISerializeCommandVisitor
|
||||
{
|
||||
public:
|
||||
virtual void Visit(_In_ COpndCommand &opndCmd) = 0;
|
||||
virtual void Visit(_In_ CUnaryCommand &unaryCmd) = 0;
|
||||
virtual void Visit(_In_ CBinaryCommand &binaryCmd) = 0;
|
||||
virtual void Visit(_In_ CParentheses ¶Cmd) = 0;
|
||||
virtual void Visit(_In_ COpndCommand& opndCmd) = 0;
|
||||
virtual void Visit(_In_ CUnaryCommand& unaryCmd) = 0;
|
||||
virtual void Visit(_In_ CBinaryCommand& binaryCmd) = 0;
|
||||
virtual void Visit(_In_ CParentheses& paraCmd) = 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user