Split LinkageType into separate h/cpp
MODIFY
include/PostBuildLint_BuildInfo.h
include/PostBuildLint_BuildInfo.h
#include <regex>
#include "PostBuildLint_BuildPolicies.h"
#include "opt_bool.h"
+#include "PostBuildLint_LinkageType.h"
namespace vcpkg::PostBuildLint
{
- enum class LinkageType
- {
- DYNAMIC,
- STATIC,
- UNKNOWN
- };
-
- LinkageType linkage_type_value_of(const std::string& as_string);
-
- std::string to_string(const LinkageType& build_info);
-
enum class ConfigurationType
{
DEBUG = 1,

ADD
include/PostBuildLint_LinkageType.h
+#pragma once
+#include <string>
+
+namespace vcpkg::PostBuildLint
+{
+ enum class LinkageType
+ {
+ DYNAMIC,
+ STATIC,
+ UNKNOWN
+ };
+
+ LinkageType linkage_type_value_of(const std::string& as_string);
+
+ std::string to_string(const LinkageType& build_info);
+}

MODIFY
src/PostBuildLint_BuildInfo.cpp
src/PostBuildLint_BuildInfo.cpp
@@ -68,35 +68,6 @@ namespace vcpkg::PostBuildLint
const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])");
const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])");
- LinkageType linkage_type_value_of(const std::string& as_string)
-
- {
- if (as_string == "dynamic")
- {
- return LinkageType::DYNAMIC;
- }
-
- if (as_string == "static")
- {
- return LinkageType::STATIC;
- }
-
- return LinkageType::UNKNOWN;
- }
-
- std::string to_string(const LinkageType& build_info)
- {
- switch (build_info)
- {
- case LinkageType::STATIC:
- return "static";
- case LinkageType::DYNAMIC:
- return "dynamic";
- default:
- Checks::unreachable();
- }
- }
-
std::string to_string(const ConfigurationType& conf)
{
switch (conf)

ADD
src/PostBuildLint_LinkageType.cpp
+#include "pch.h"
+#include "PostBuildLint_LinkageType.h"
+#include "vcpkg_Checks.h"
+
+namespace vcpkg::PostBuildLint
+{
+ LinkageType linkage_type_value_of(const std::string& as_string)
+ {
+ if (as_string == "dynamic")
+ {
+ return LinkageType::DYNAMIC;
+ }
+
+ if (as_string == "static")
+ {
+ return LinkageType::STATIC;
+ }
+
+ return LinkageType::UNKNOWN;
+ }
+
+ std::string to_string(const LinkageType& build_info)
+ {
+ switch (build_info)
+ {
+ case LinkageType::STATIC:
+ return "static";
+ case LinkageType::DYNAMIC:
+ return "dynamic";
+ default:
+ Checks::unreachable();
+ }
+ }
+}

MODIFY
vcpkglib/vcpkglib.vcxproj
vcpkglib/vcpkglib.vcxproj
<ClInclude Include="..\include\Paragraphs.h" />
<ClInclude Include="..\include\pch.h" />
<ClInclude Include="..\include\PostBuildLint.h" />
+ <ClInclude Include="..\include\PostBuildLint_LinkageType.h" />
<ClInclude Include="..\include\SourceParagraph.h" />
<ClInclude Include="..\include\StatusParagraph.h" />
<ClInclude Include="..\include\StatusParagraphs.h" />
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\src\PostBuildLint.cpp" />
+ <ClCompile Include="..\src\PostBuildLint_LinkageType.cpp" />
<ClCompile Include="..\src\Stopwatch.cpp" />
<ClCompile Include="..\src\vcpkglib.cpp" />
<ClCompile Include="..\src\package_spec.cpp" />

MODIFY
vcpkglib/vcpkglib.vcxproj.filters
vcpkglib/vcpkglib.vcxproj.filters
<ClCompile Include="..\src\PostBuildLint_BuildPolicies.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\src\PostBuildLint_LinkageType.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\package_spec.h">
<ClInclude Include="..\include\PostBuildLint_BuildPolicies.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\include\PostBuildLint_LinkageType.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file

Split LinkageType into separate h/cpp