当前位置: 首页>>代码示例>>C++>>正文


C++ QueryData::end方法代码示例

本文整理汇总了C++中QueryData::end方法的典型用法代码示例。如果您正苦于以下问题:C++ QueryData::end方法的具体用法?C++ QueryData::end怎么用?C++ QueryData::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueryData的用法示例。


在下文中一共展示了QueryData::end方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addUniqueRowToQueryData

bool addUniqueRowToQueryData(QueryData& q, const Row& r) {
  if (std::find(q.begin(), q.end(), r) != q.end()) {
    return false;
  }
  q.push_back(r);
  return true;
}
开发者ID:AidHamza,项目名称:osquery,代码行数:7,代码来源:database.cpp

示例2: diff

DiffResults diff(const QueryData& old_, const QueryData& new_) {
  DiffResults r;
  QueryData overlap;

  for (const auto& i : new_) {
    auto item = std::find(old_.begin(), old_.end(), i);
    if (item != old_.end()) {
      overlap.push_back(i);
    } else {
      r.added.push_back(i);
    }
  }

  std::multiset<Row> overlap_set(overlap.begin(), overlap.end());

  std::multiset<Row> old_set(old_.begin(), old_.end());

  std::set_difference(old_set.begin(),
                      old_set.end(),
                      overlap_set.begin(),
                      overlap_set.end(),
                      std::back_inserter(r.removed));

  return r;
}
开发者ID:Daheon,项目名称:osquery,代码行数:25,代码来源:results.cpp

示例3: pidsFromContext

QueryData pidsFromContext(const QueryContext& context, bool all) {
  QueryData procs;
  if (context.hasConstraint("pid", EQUALS)) {
    context.forEachConstraint(
        "pid", EQUALS, ([&procs](const std::string& expr) {
          auto proc = SQL::selectAllFrom("processes", "pid", EQUALS, expr);
          procs.insert(procs.end(), procs.begin(), procs.end());
        }));
  } else if (!all) {
    procs = SQL::selectAllFrom(
        "processes", "pid", EQUALS, std::to_string(platformGetPid()));
  } else {
    procs = SQL::selectAllFrom("processes");
  }
  return procs;
}
开发者ID:friedbutter,项目名称:osquery,代码行数:16,代码来源:system_utils.cpp

示例4: genShellHistory

QueryData genShellHistory(QueryContext& context) {
  QueryData results;

  // Select only the home directory for this user.
  QueryData users;
  if (!context.constraints["username"].exists(EQUALS)) {
    users =
        SQL::selectAllFrom("users", "uid", EQUALS, std::to_string(getuid()));
  } else {
    auto usernames = context.constraints["username"].getAll(EQUALS);
    for (const auto& username : usernames) {
      // Use a predicated select all for each user.
      auto user = SQL::selectAllFrom("users", "username", EQUALS, username);
      users.insert(users.end(), user.begin(), user.end());
    }
  }

  // Iterate over each user
  for (const auto& row : users) {
    if (row.count("username") > 0 && row.count("directory") > 0) {
      genShellHistoryForUser(row.at("username"), row.at("directory"), results);
    }
  }

  return results;
}
开发者ID:151706061,项目名称:osquery,代码行数:26,代码来源:shell_history.cpp

示例5: usersFromContext

QueryData usersFromContext(const QueryContext& context, bool all) {
  QueryData users;
  if (context.hasConstraint("uid", EQUALS)) {
    context.forEachConstraint(
        "uid", EQUALS, ([&users](const std::string& expr) {
          auto user = SQL::selectAllFrom("users", "uid", EQUALS, expr);
          users.insert(users.end(), user.begin(), user.end());
        }));
  } else if (!all) {
    users = SQL::selectAllFrom(
        "users", "uid", EQUALS, std::to_string(platformGetUid()));
  } else {
    users = SQL::selectAllFrom("users");
  }
  return users;
}
开发者ID:friedbutter,项目名称:osquery,代码行数:16,代码来源:system_utils.cpp

示例6: genEtcHosts

QueryData genEtcHosts(QueryContext& context) {
  std::string content;
  QueryData qres = {};

  if (readFile(kEtcHosts, content).ok()) {
    qres = parseEtcHostsContent(content);
  }

#ifdef WIN32
  content.clear();
  QueryData qres_ics = {};
  if (readFile(kEtcHostsIcs, content).ok()) {
    qres_ics = parseEtcHostsContent(content);
    qres.insert(qres.end(), qres_ics.begin(), qres_ics.end());
  }
#endif

  return qres;
}
开发者ID:FritzX6,项目名称:osquery,代码行数:19,代码来源:etc_hosts.cpp


注:本文中的QueryData::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。