本文整理汇总了C++中QueryData::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ QueryData::clear方法的具体用法?C++ QueryData::clear怎么用?C++ QueryData::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryData
的用法示例。
在下文中一共展示了QueryData::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attachTableInternal
TEST_F(VirtualTableTests, test_table_cache) {
// Get a database connection.
Registry::add<cacheTablePlugin>("table", "cache");
auto dbc = SQLiteDBManager::getUnique();
{
auto cache = std::make_shared<cacheTablePlugin>();
attachTableInternal("cache", cache->columnDefinition(), dbc);
}
QueryData results;
// Run a query with a join within.
std::string statement = "SELECT c2.data as data FROM cache c1, cache c2;";
auto status = queryInternal(statement, results, dbc->db());
dbc->clearAffectedTables();
EXPECT_TRUE(status.ok());
ASSERT_EQ(results.size(), 1U);
EXPECT_EQ(results[0]["data"], "more_awesome_data");
// Run the query again, the virtual table cache should have been expired.
results.clear();
statement = "SELECT data from cache c1";
queryInternal(statement, results, dbc->db());
ASSERT_EQ(results.size(), 1U);
ASSERT_EQ(results[0]["data"], "awesome_data");
}
示例2: genWinPythonPackages
void genWinPythonPackages(const std::string& keyGlob, QueryData& results) {
#ifdef WIN32
std::set<std::string> installPathKeys;
expandRegistryGlobs(keyGlob, installPathKeys);
QueryData pythonInstallLocation;
for (const auto& installKey : installPathKeys) {
queryKey(installKey, pythonInstallLocation);
for (const auto& p : pythonInstallLocation) {
if (p.at("name") != "(Default)") {
continue;
}
genSiteDirectories(p.at("data"), results);
}
pythonInstallLocation.clear();
}
#endif
}