paragraph_parse_result -> ParagraphParseResult
RENAME
include/paragraph_parse_result.h
include/ParagraphParseResult.h
namespace vcpkg
{
- enum class paragraph_parse_result
+ enum class ParagraphParseResult
{
SUCCESS = 0,
EXPECTED_ONE_PARAGRAPH
};
- struct paragraph_parse_result_category_impl final : std::error_category
+ struct ParagraphParseResultCategoryImpl final : std::error_category
{
virtual const char* name() const noexcept override;
@@ -18,18 +18,18 @@ namespace vcpkg
const std::error_category& paragraph_parse_result_category();
- std::error_code make_error_code(paragraph_parse_result e);
+ std::error_code make_error_code(ParagraphParseResult e);
- paragraph_parse_result to_paragraph_parse_result(int i);
+ ParagraphParseResult to_paragraph_parse_result(int i);
- paragraph_parse_result to_paragraph_parse_result(std::error_code ec);
+ ParagraphParseResult to_paragraph_parse_result(std::error_code ec);
}
// Enable implicit conversion to std::error_code
namespace std
{
template <>
- struct is_error_code_enum<vcpkg::paragraph_parse_result> : ::std::true_type
+ struct is_error_code_enum<vcpkg::ParagraphParseResult> : ::std::true_type
{
};
}

ADD
src/ParagraphParseResult.cpp
+#include "pch.h"
+#include "vcpkg_Checks.h"
+#include "ParagraphParseResult.h"
+
+namespace vcpkg
+{
+ const char* ParagraphParseResultCategoryImpl::name() const noexcept
+ {
+ return "ParagraphParseResult";
+ }
+
+ std::string ParagraphParseResultCategoryImpl::message(int ev) const noexcept
+ {
+ switch (static_cast<ParagraphParseResult>(ev))
+ {
+ case ParagraphParseResult::SUCCESS:
+ return "OK";
+ case ParagraphParseResult::EXPECTED_ONE_PARAGRAPH:
+ return "There should be exactly one paragraph";
+ default:
+ Checks::unreachable(VCPKG_LINE_INFO);
+ }
+ }
+
+ const std::error_category& paragraph_parse_result_category()
+ {
+ static ParagraphParseResultCategoryImpl instance;
+ return instance;
+ }
+
+ std::error_code make_error_code(ParagraphParseResult e)
+ {
+ return std::error_code(static_cast<int>(e), paragraph_parse_result_category());
+ }
+
+ ParagraphParseResult to_paragraph_parse_result(int i)
+ {
+ return static_cast<ParagraphParseResult>(i);
+ }
+
+ ParagraphParseResult to_paragraph_parse_result(std::error_code ec)
+ {
+ return to_paragraph_parse_result(ec.value());
+ }
+}

MODIFY
src/Paragraphs.cpp
src/Paragraphs.cpp
#include "pch.h"
#include "Paragraphs.h"
#include "vcpkg_Files.h"
-#include "paragraph_parse_result.h"
+#include "ParagraphParseResult.h"
namespace vcpkg::Paragraphs
{
@@ -203,7 +203,7 @@ namespace vcpkg::Paragraphs
return p.at(0);
}
- return std::error_code(paragraph_parse_result::EXPECTED_ONE_PARAGRAPH);
+ return std::error_code(ParagraphParseResult::EXPECTED_ONE_PARAGRAPH);
}
expected<std::vector<std::unordered_map<std::string, std::string>>> parse_paragraphs(const std::string& str)

DELETE
src/paragraph_parse_result.cpp
-#include "pch.h"
-#include "vcpkg_Checks.h"
-#include "paragraph_parse_result.h"
-
-namespace vcpkg
-{
- const char* paragraph_parse_result_category_impl::name() const noexcept
- {
- return "paragraph_parse_result";
- }
-
- std::string paragraph_parse_result_category_impl::message(int ev) const noexcept
- {
- switch (static_cast<paragraph_parse_result>(ev))
- {
- case paragraph_parse_result::SUCCESS:
- return "OK";
- case paragraph_parse_result::EXPECTED_ONE_PARAGRAPH:
- return "There should be exactly one paragraph";
- default:
- Checks::unreachable(VCPKG_LINE_INFO);
- }
- }
-
- const std::error_category& paragraph_parse_result_category()
- {
- static paragraph_parse_result_category_impl instance;
- return instance;
- }
-
- std::error_code make_error_code(paragraph_parse_result e)
- {
- return std::error_code(static_cast<int>(e), paragraph_parse_result_category());
- }
-
- paragraph_parse_result to_paragraph_parse_result(int i)
- {
- return static_cast<paragraph_parse_result>(i);
- }
-
- paragraph_parse_result to_paragraph_parse_result(std::error_code ec)
- {
- return to_paragraph_parse_result(ec.value());
- }
-}

MODIFY
vcpkglib/vcpkglib.vcxproj
vcpkglib/vcpkglib.vcxproj
<ClInclude Include="..\include\CStringView.h" />
<ClInclude Include="..\include\lazy.h" />
<ClInclude Include="..\include\LineInfo.h" />
- <ClInclude Include="..\include\paragraph_parse_result.h" />
+ <ClInclude Include="..\include\ParagraphParseResult.h" />
<ClInclude Include="..\include\PostBuildLint_BuildInfo.h" />
<ClInclude Include="..\include\PostBuildLint_BuildPolicies.h" />
<ClInclude Include="..\include\coff_file_reader.h" />
<ClCompile Include="..\src\commands_ci.cpp" />
<ClCompile Include="..\src\commands_env.cpp" />
<ClCompile Include="..\src\LineInfo.cpp" />
- <ClCompile Include="..\src\paragraph_parse_result.cpp" />
+ <ClCompile Include="..\src\ParagraphParseResult.cpp" />
<ClCompile Include="..\src\PostBuildLint_BuildInfo.cpp" />
<ClCompile Include="..\src\PostBuildLint_BuildPolicies.cpp" />
<ClCompile Include="..\src\coff_file_reader.cpp" />

MODIFY
vcpkglib/vcpkglib.vcxproj.filters
vcpkglib/vcpkglib.vcxproj.filters
<ClCompile Include="..\src\LineInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\src\paragraph_parse_result.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\include\version_t.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\PackageSpecParseResult.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\src\ParagraphParseResult.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\SourceParagraph.h">
<ClInclude Include="..\include\LineInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\include\paragraph_parse_result.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\include\vcpkg_expected.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\PackageSpecParseResult.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\include\ParagraphParseResult.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file

paragraph_parse_result -> ParagraphParseResult