dependency -> Dependency

This commit is contained in:
Alexander Karatarakis 2017-04-03 15:12:42 -07:00
parent bdf80d63c6
commit d33e191ce4
3 changed files with 12 additions and 12 deletions

View File

@ -7,13 +7,13 @@ namespace vcpkg
{
struct Triplet;
struct dependency
struct Dependency
{
std::string name;
std::string qualifier;
};
std::ostream& operator<<(std::ostream& os, const dependency& p);
std::ostream& operator<<(std::ostream& os, const Dependency& p);
struct SourceParagraph
{
@ -25,11 +25,11 @@ namespace vcpkg
std::string version;
std::string description;
std::string maintainer;
std::vector<dependency> depends;
std::vector<Dependency> depends;
};
std::vector<std::string> filter_dependencies(const std::vector<vcpkg::dependency>& deps, const Triplet& t);
std::vector<std::string> filter_dependencies(const std::vector<Dependency>& deps, const Triplet& t);
std::vector<vcpkg::dependency> expand_qualified_dependencies(const std::vector<std::string>& depends);
std::vector<Dependency> expand_qualified_dependencies(const std::vector<std::string>& depends);
std::vector<std::string> parse_depends(const std::string& depends_string);
}

View File

@ -64,14 +64,14 @@ namespace vcpkg
}
}
std::vector<dependency> vcpkg::expand_qualified_dependencies(const std::vector<std::string>& depends)
std::vector<Dependency> vcpkg::expand_qualified_dependencies(const std::vector<std::string>& depends)
{
auto convert = [&](const std::string& depend_string) -> dependency {
auto convert = [&](const std::string& depend_string) -> Dependency {
auto pos = depend_string.find(' ');
if (pos == std::string::npos)
return{ depend_string, "" };
// expect of the form "\w+ \[\w+\]"
dependency dep;
Dependency dep;
dep.name = depend_string.substr(0, pos);
if (depend_string.c_str()[pos + 1] != '[' || depend_string[depend_string.size() - 1] != ']')
{
@ -82,7 +82,7 @@ namespace vcpkg
return dep;
};
std::vector<vcpkg::dependency> ret;
std::vector<vcpkg::Dependency> ret;
for (auto&& depend_string : depends)
{
@ -125,7 +125,7 @@ namespace vcpkg
return out;
}
std::vector<std::string> filter_dependencies(const std::vector<vcpkg::dependency>& deps, const Triplet& t)
std::vector<std::string> filter_dependencies(const std::vector<vcpkg::Dependency>& deps, const Triplet& t)
{
std::vector<std::string> ret;
for (auto&& dep : deps)
@ -138,7 +138,7 @@ namespace vcpkg
return ret;
}
std::ostream & operator<<(std::ostream & os, const dependency & p)
std::ostream & operator<<(std::ostream & os, const Dependency & p)
{
os << p.name;
return os;

View File

@ -33,7 +33,7 @@ namespace vcpkg::Commands::Search
const std::string name = replace_dashes_with_underscore(source_paragraph.name);
s.append(Strings::format("%s;", name));
for (const dependency& d : source_paragraph.depends)
for (const Dependency& d : source_paragraph.depends)
{
const std::string dependency_name = replace_dashes_with_underscore(d.name);
s.append(Strings::format("%s -> %s;", name, dependency_name));