本文整理汇总了C++中fc::path::filename方法的典型用法代码示例。如果您正苦于以下问题:C++ path::filename方法的具体用法?C++ path::filename怎么用?C++ path::filename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fc::path
的用法示例。
在下文中一共展示了path::filename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: open
void profile::open( const fc::path& profile_dir, const std::string& password )
{ try {
ilog("opening profile: ${profile_dir}",("profile_dir",profile_dir));
my->_profile_name = profile_dir.filename().generic_wstring();
fc::create_directories( profile_dir );
fc::create_directories( profile_dir / "addressbook" );
fc::create_directories( profile_dir / "idents" );
fc::create_directories( profile_dir / "mail" );
fc::create_directories( profile_dir / "mail" / "inbox" );
fc::create_directories( profile_dir / "mail" / "draft" );
fc::create_directories( profile_dir / "mail" / "pending" );
fc::create_directories( profile_dir / "mail" / "sent" );
fc::create_directories( profile_dir / "chat" );
fc::create_directories( profile_dir / "request" );
fc::create_directories( profile_dir / "authorization" );
ilog("loading master key file:" KEYHOTEE_MASTER_KEY_FILE);
auto profile_cfg_key = fc::sha512::hash( password.c_str(), password.size() );
std::vector<char> stretched_seed_data;
try {
stretched_seed_data = fc::aes_load( profile_dir / KEYHOTEE_MASTER_KEY_FILE, profile_cfg_key );
}
catch (fc::exception& /* e */)
{ //try to open legacy name for key file
wlog("Could not open " KEYHOTEE_MASTER_KEY_FILE ", trying to open legacy key file (.strecthed_seed).");
stretched_seed_data = fc::aes_load( profile_dir / ".stretched_seed", profile_cfg_key );
}
ilog("opening profile databases");
my->_keychain.set_seed( fc::raw::unpack<fc::sha512>(stretched_seed_data) );
my->_addressbook->open( profile_dir / "addressbook", profile_cfg_key );
my->_idents.open( profile_dir / "idents" );
my->_inbox_db->open( profile_dir / "mail" / "inbox", profile_cfg_key );
my->_draft_db->open( profile_dir / "mail" / "draft", profile_cfg_key );
my->_pending_db->open( profile_dir / "mail" / "pending", profile_cfg_key );
my->_sent_db->open( profile_dir / "mail" / "sent", profile_cfg_key );
my->_chat_db->open( profile_dir / "chat", profile_cfg_key );
my->_request_db->open( profile_dir / "request", profile_cfg_key );
my->_auth_db->open( profile_dir / "authorization", profile_cfg_key );
my->_last_sync_time.open( profile_dir / "mail" / "last_recv", true );
if( *my->_last_sync_time == fc::time_point())
{
*my->_last_sync_time = fc::time_point::now() - fc::days(5);
ilog("set last_sync_time to ${t}",("t",*my->_last_sync_time));
}
else
ilog("loaded last_sync_time = ${t}",("t",*my->_last_sync_time));
ilog("finished opening profile");
} FC_RETHROW_EXCEPTIONS( warn, "", ("profile_dir",profile_dir) ) }