diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-03 14:48:24 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-04 16:44:41 -0700 |
| commit | 7ee180ebdd7ec93a4ba3c34c38fd467109365ad6 (patch) | |
| tree | 4a1cc5eec64304e59819fdd712fbbcc40d786ced | |
| parent | 83cde513345f5544325520b89ec3f1f27bd8b2a6 (diff) | |
| download | vcpkg-7ee180ebdd7ec93a4ba3c34c38fd467109365ad6.tar.gz vcpkg-7ee180ebdd7ec93a4ba3c34c38fd467109365ad6.zip | |
paragraph_parse_result -> ParagraphParseResult
| -rw-r--r-- | toolsrc/include/ParagraphParseResult.h (renamed from toolsrc/include/paragraph_parse_result.h) | 12 | ||||
| -rw-r--r-- | toolsrc/src/ParagraphParseResult.cpp | 45 | ||||
| -rw-r--r-- | toolsrc/src/Paragraphs.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/paragraph_parse_result.cpp | 45 | ||||
| -rw-r--r-- | toolsrc/vcpkglib/vcpkglib.vcxproj | 4 | ||||
| -rw-r--r-- | toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 12 |
6 files changed, 61 insertions, 61 deletions
diff --git a/toolsrc/include/paragraph_parse_result.h b/toolsrc/include/ParagraphParseResult.h index 47f20c08e..0d1f13f61 100644 --- a/toolsrc/include/paragraph_parse_result.h +++ b/toolsrc/include/ParagraphParseResult.h @@ -3,13 +3,13 @@ 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 { }; } diff --git a/toolsrc/src/ParagraphParseResult.cpp b/toolsrc/src/ParagraphParseResult.cpp new file mode 100644 index 000000000..c2da78d30 --- /dev/null +++ b/toolsrc/src/ParagraphParseResult.cpp @@ -0,0 +1,45 @@ +#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()); + } +} diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index d6784bc63..0d91e95a9 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -1,7 +1,7 @@ #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) diff --git a/toolsrc/src/paragraph_parse_result.cpp b/toolsrc/src/paragraph_parse_result.cpp deleted file mode 100644 index 4715f7a16..000000000 --- a/toolsrc/src/paragraph_parse_result.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#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()); - } -} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index e596254cc..724e73cd7 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -140,7 +140,7 @@ <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" /> @@ -187,7 +187,7 @@ <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" /> diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 17cafd4a7..f295305bc 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -162,9 +162,6 @@ <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> @@ -180,6 +177,9 @@ <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"> @@ -287,9 +287,6 @@ <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> @@ -314,5 +311,8 @@ <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 |
