本文整理汇总了C++中Timestamp::getUnixTime64方法的典型用法代码示例。如果您正苦于以下问题:C++ Timestamp::getUnixTime64方法的具体用法?C++ Timestamp::getUnixTime64怎么用?C++ Timestamp::getUnixTime64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timestamp
的用法示例。
在下文中一共展示了Timestamp::getUnixTime64方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: packs
Ref<Database> PackageService::buildLookupDB(const String& path, StreamSourceMap& packCfgs)
{
Ref<Database> db = Database::open(path);
db->exec("DROP TABLE IF EXISTS packs; CREATE TABLE packs (name PRIMARY KEY, timestamp INT)");
db->exec("DROP TABLE IF EXISTS lookup; CREATE TABLE lookup (type, key, subtype, pack, entry, PRIMARY KEY (type, key))");
db->exec("DROP INDEX IF EXISTS lookup_packidx; CREATE INDEX lookup_packidx ON lookup (pack ASC)");
Ref<Database::Query> packInsert =
db->prepare("INSERT INTO packs (name, timestamp) VALUES (?, ?)");
Ref<Database::Query> lookupInsert =
db->prepare("INSERT INTO lookup (type, key, subtype, pack, entry) VALUES ($type, $key, $subtype, $pack, $entry)");
for (StreamSourceMap::iterator itr = packCfgs.begin(), end = packCfgs.end(); itr != end; ++itr)
{
const String& packName = itr->first;
Ref<Settings> cfg = Settings::load(itr->second);
if (cfg == NULL)
{
LOG(0, "*** can't load '%s'\n", cfg->getUrl().c_str());
continue;
}
Timestamp time = itr->second->getTimestamp();
packInsert->reset();
packInsert->bind(1, packName);
packInsert->bind(2, time.getUnixTime64());
packInsert->step();
Ref<Settings> section = cfg->getSection("lookup");
if (section == NULL)
continue;
for (Settings::Iterator itr = section->begin(), end = section->end(); itr != end; ++itr)
{
String type = itr->first;
String key = itr->second;
String sub, entry;
splitLookupEntry(type, key, sub, entry);
lookupInsert->reset();
lookupInsert->bind("$type", type);
lookupInsert->bind("$key", key);
lookupInsert->bind("$subtype", sub);
lookupInsert->bind("$entry", entry);
lookupInsert->bind("$pack", packName);
lookupInsert->step();
}
}
return db;
}