本文整理汇总了C++中SystemInfo::set_name方法的典型用法代码示例。如果您正苦于以下问题:C++ SystemInfo::set_name方法的具体用法?C++ SystemInfo::set_name怎么用?C++ SystemInfo::set_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SystemInfo
的用法示例。
在下文中一共展示了SystemInfo::set_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSystems
Status GetSystems(ServerContext* /*context*/, const Empty* /*request*/, ServerWriter<SystemType>* writer) override {
auto _api = this->options.GetAPI();
for (auto systems : _api) {
SystemType system;
system.set_name(systems.first);
for (auto&& subsystem : systems.second) {
SystemInfo* subInfo = system.add_subsystems();
std::ifstream ifabout(subsystem, std::ios_base::in);
if (!ifabout.is_open()) continue;
ey_data about = parse_eyaml(ifabout, subsystem);
std::string name = about.get("name");
std::string id = about.get("identifier");
std::string desc = about.get("description");
std::string author = about.get("author");
std::string target = about.get("target-platform");
if (id.empty())
id = about.get("id"); // allow alias
if (id.empty()) {
// compilers use filename minus ext as id
boost::filesystem::path ey(subsystem);
id = ey.stem().string();
}
// allow author alias used by compiler descriptors
if (author.empty())
author = about.get("maintainer");
subInfo->set_name(name);
subInfo->set_id(id);
subInfo->set_description(desc);
subInfo->set_author(author);
subInfo->set_target(target);
}
writer->Write(system);
}
return Status::OK;
}