aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/SourceParagraph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/SourceParagraph.cpp')
-rw-r--r--toolsrc/src/SourceParagraph.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp
index 11b83aedf..ac88e54ac 100644
--- a/toolsrc/src/SourceParagraph.cpp
+++ b/toolsrc/src/SourceParagraph.cpp
@@ -1,10 +1,11 @@
#include "pch.h"
+
#include "SourceParagraph.h"
-#include "vcpkglib_helpers.h"
-#include "vcpkg_System.h"
-#include "vcpkg_Maps.h"
#include "Triplet.h"
#include "vcpkg_Checks.h"
+#include "vcpkg_Maps.h"
+#include "vcpkg_System.h"
+#include "vcpkglib_helpers.h"
namespace vcpkg
{
@@ -24,15 +25,12 @@ namespace vcpkg
static const std::vector<std::string>& get_list_of_valid_fields()
{
- static const std::vector<std::string> valid_fields =
- {
- SourceParagraphRequiredField::SOURCE,
- SourceParagraphRequiredField::VERSION,
+ static const std::vector<std::string> valid_fields = { SourceParagraphRequiredField::SOURCE,
+ SourceParagraphRequiredField::VERSION,
- SourceParagraphOptionalField::DESCRIPTION,
- SourceParagraphOptionalField::MAINTAINER,
- SourceParagraphOptionalField::BUILD_DEPENDS
- };
+ SourceParagraphOptionalField::DESCRIPTION,
+ SourceParagraphOptionalField::MAINTAINER,
+ SourceParagraphOptionalField::BUILD_DEPENDS };
return valid_fields;
}
@@ -57,7 +55,8 @@ namespace vcpkg
const std::string remaining_fields_as_string = Strings::join("\n ", remaining_fields);
const std::string valid_fields_as_string = Strings::join("\n ", valid_fields);
- System::println(System::Color::error, "Error: There are invalid fields in the Source Paragraph of %s", this->name);
+ System::println(
+ System::Color::error, "Error: There are invalid fields in the Source Paragraph of %s", this->name);
System::println("The following fields were not expected:\n\n %s\n\n", remaining_fields_as_string);
System::println("This is the list of valid fields (case-sensitive): \n\n %s\n", valid_fields_as_string);
Checks::exit_fail(VCPKG_LINE_INFO);
@@ -68,15 +67,14 @@ namespace vcpkg
{
auto convert = [&](const std::string& depend_string) -> Dependency {
auto pos = depend_string.find(' ');
- if (pos == std::string::npos)
- return{ depend_string, "" };
+ if (pos == std::string::npos) return { depend_string, "" };
// expect of the form "\w+ \[\w+\]"
Dependency dep;
dep.name = depend_string.substr(0, pos);
if (depend_string.c_str()[pos + 1] != '[' || depend_string[depend_string.size() - 1] != ']')
{
// Error, but for now just slurp the entire string.
- return{ depend_string, "" };
+ return { depend_string, "" };
}
dep.qualifier = depend_string.substr(pos + 2, depend_string.size() - pos - 3);
return dep;
@@ -96,7 +94,7 @@ namespace vcpkg
{
if (depends_string.empty())
{
- return{};
+ return {};
}
std::vector<std::string> out;
@@ -138,8 +136,5 @@ namespace vcpkg
return ret;
}
- const std::string& to_string(const Dependency& dep)
- {
- return dep.name;
- }
+ const std::string& to_string(const Dependency& dep) { return dep.name; }
}