Skip to content

Commit

Permalink
Move RADIX_TYPE enum into its own header (#25)
Browse files Browse the repository at this point in the history
This change moves the RADIX_TYPE enum into its own header. This resolves a compilation error and reduces the dependency graph by allowing RadixToStringConverter to include just the enum header rather than the entire CalcEngine header.

Change verified by ensuring Calculator build locally.
  • Loading branch information
joshkoon authored Feb 20, 2019
1 parent 995f077 commit 2e18f6f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/CalcManager/CalcManager.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
<ClInclude Include="Header Files\CalcInput.h" />
<ClInclude Include="Header Files\IHistoryDisplay.h" />
<ClInclude Include="Header Files\Number.h" />
<ClInclude Include="Header Files\RadixType.h" />
<ClInclude Include="Header Files\Rational.h" />
<ClInclude Include="Header Files\scimath.h" />
<ClInclude Include="pch.h" />
Expand Down
3 changes: 3 additions & 0 deletions src/CalcManager/CalcManager.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,8 @@
<ClInclude Include="Header Files\Rational.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Header Files\RadixType.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
10 changes: 1 addition & 9 deletions src/CalcManager/Header Files/CalcEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "../Command.h"
#include "../CalculatorVector.h"
#include "../ExpressionCommand.h"
#include "RadixType.h"
#include "History.h" // for History Collector
#include "CalcInput.h"
#include "ICalcDisplay.h"
Expand All @@ -38,15 +39,6 @@ enum eNUM_WIDTH {
typedef enum eNUM_WIDTH NUM_WIDTH;
static constexpr size_t NUM_WIDTH_LENGTH = 4;

// This is expected to be in same order as IDM_HEX, IDM_DEC, IDM_OCT, IDM_BIN
enum eRADIX_TYPE {
HEX_RADIX,
DEC_RADIX,
OCT_RADIX,
BIN_RADIX
};
typedef enum eRADIX_TYPE RADIX_TYPE;

namespace CalculationManager
{
class IResourceProvider;
Expand Down
2 changes: 1 addition & 1 deletion src/CalcManager/Header Files/Number.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#pragma once

#include "RatPack/ratpak.h"
#include "Ratpack/ratpak.h"

namespace CalcEngine
{
Expand Down
13 changes: 13 additions & 0 deletions src/CalcManager/Header Files/RadixType.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#pragma once

// This is expected to be in same order as IDM_HEX, IDM_DEC, IDM_OCT, IDM_BIN
enum eRADIX_TYPE {
HEX_RADIX,
DEC_RADIX,
OCT_RADIX,
BIN_RADIX
};
typedef enum eRADIX_TYPE RADIX_TYPE;
2 changes: 1 addition & 1 deletion src/Calculator/Converters/RadixToStringConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "pch.h"
#include "RadixToStringConverter.h"
#include "CalcManager/Header Files/CalcEngine.h"
#include "CalcManager/Header Files/RadixType.h"
#include "CalcViewModel/Common/AppResourceProvider.h"

using namespace Platform;
Expand Down

0 comments on commit 2e18f6f

Please sign in to comment.