本文整理汇总了C++中ObjectID::getHash方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectID::getHash方法的具体用法?C++ ObjectID::getHash怎么用?C++ ObjectID::getHash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectID
的用法示例。
在下文中一共展示了ObjectID::getHash方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: razorUpgrade
bool CompatibilityManager::razorUpgrade(const String &folder)
{
try
{
if(FileSystem::instance()->directoryExists(folder))
{
StringList portals;
FileSystem::instance()->getDirectories(folder, portals, false);
for(StringList::const_iterator i = portals.begin(); i != portals.end(); ++i)
{
// 000000018F94C9554C8B227CF000C6E30EB281AEAE1A77E7
String name = *i;
if(name.length() == 48)
{
// Portal < Razor
std::string oldID = name.to_ascii();
// Options
String oldPath = utils::standardisePath(folder + oldID);
shared_ptr<PortalOptions> options(OS_NEW PortalOptions());
// Carica le impostazioni del portale
if(options->readFromPath(oldPath) == false)
return false;
shared_ptr<IDbDriver> driver = DatabasesSystem::instance()->getDriver("sqlite");
// Query Database
shared_ptr<IDbConnection> connection = driver->createConnection(oldID, driver->createOptions());
connection->open();
String portalName = options->getName();
//String portalDescription = static_cast<String>(options->getOptionValue("description"));
NotificationsManager::instance()->notify(_S("Migration of '") + portalName + _S("' to 1.0 series"));
PlatformManager::instance()->sleep(500);
//ObjectID userID = static_cast<String>(m_portalOptions.getOption(options::users_reference)).to_ascii();
ObjectID userID = static_cast<String>(options->getOptionValue("users.reference")).to_ascii();
//bool monarchic = (options->getPortalID().getPortalType() == portalTypeMonarchic);
ID oldPortalID(oldID);
uint8 portalType = OS_UINT8_LO(oldPortalID.getHeader().getFirst());
bool monarchic = (portalType == 1);
// Calcolo UserID.
// Se non lo posso dedurre, uso il primo che trovo loggato.
if(userID.empty())
{
if(monarchic)
{
//userID = options->getPortalID().getAdministratorID();
#ifdef OS_NOOBJECTID
userID = oldPortalID.getHash();
#else
userID = ObjectID::generate(portalObjectTypeUser, oldPortalID.getHash());
#endif
}
else
{
String sql = String::EMPTY;
sql += _S(" select tp.profile, tu.reference ");
sql += _S(" from ");
sql += _S(" os_snapshot_profiles tp, ");
sql += _S(" os_snapshot_users tu ");
sql += _S(" where ");
sql += _S(" tp.profile=tu.profile and ");
sql += _S(" tu.score=1 and ");
sql += _S(" tu.follow=1 and ");
sql += _S(" tu.description='Auto valutation'");
shared_ptr<IDbResult> result = connection->query(sql);
DataTable table;
result->init(table);
DataTableRow row = table.addRow();
while(result->end() == false)
{
result->bind(row);
String objectID = static_cast<String>(*row[1]);
userID = objectID.to_ascii();
result->moveNext();
break;
}
}
}
#ifdef OS_NOOBJECTID
PovID povID = userID;
#else
PovID povID = userID.getHash();
#endif
if(userID.empty() == false)
{
// Clean old snapshot
//.........这里部分代码省略.........