本文整理汇总了C++中Registry::Construct方法的典型用法代码示例。如果您正苦于以下问题:C++ Registry::Construct方法的具体用法?C++ Registry::Construct怎么用?C++ Registry::Construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registry
的用法示例。
在下文中一共展示了Registry::Construct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
void VKUAuthConfig::Read() {
String regPath(VKUApp::GetInstance()->GetAppDataPath() + L"auth.ini");
String authSection(L"auth");
Registry reg;
reg.Construct(regPath, false);
if(accessTokenValue != null) {
delete accessTokenValue;
}
accessTokenValue = new String();
reg.GetValue(authSection, "access_token", *accessTokenValue);
reg.GetValue(authSection, "expires_in", expiresInValue);
reg.GetValue(authSection, "user_id", userIdValue);
}
示例2: GetHeader
result
UserProfileForm::OnInitializing(void)
{
BaseForm::OnInitializing();
AppResource* pAppResource = Application::GetInstance()->GetAppResource();
__pLeftItemBitmap = pAppResource->GetBitmapN(L"facebook_icon1.png");
ButtonItem buttonLeftItem;
buttonLeftItem.Construct(BUTTON_ITEM_STYLE_ICON,NULL);
buttonLeftItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, __pLeftItemBitmap);
Header* pHeader = GetHeader();
pHeader->SetStyle(HEADER_STYLE_TITLE);
pHeader->SetButton(BUTTON_POSITION_LEFT, buttonLeftItem);
pHeader->SetTitleText(L"Your Profile Page");
result r = E_SUCCESS;
//Read Access Token
Registry reg;
r = reg.Construct(L"/Home/FacebookReg.ini", false );
String token;
String section = L"Facebook";
String entry = L"AccessToken";
r = reg.GetValue(section, entry , token);
if(r == E_SUCCESS)
AppLog("token is %ls",token.GetPointer());
else
AppLog("Reading failed: %s", GetErrorMessage(r));
__accessToken =token;
String profileurl;
profileurl.Append(L"https://graph.facebook.com/me?");
profileurl.Append(L"access_token=");
profileurl.Append(__accessToken);
SendRequestGet(profileurl);
return r;
}
示例3: Replace
void VKUAuthConfig::Replace(const String &accessToken, const String &expiresIn, const String userId) {
if(IsExists()) {
Delete();
}
String regPath(VKUApp::GetInstance()->GetAppDataPath() + L"auth.ini");
String authSection(L"auth");
Registry reg;
reg.Construct(regPath, true);
reg.AddSection(authSection);
if(accessTokenValue != null) {
delete accessTokenValue;
}
accessTokenValue = new String(accessToken);
reg.AddValue(authSection, L"access_token", accessToken);
Integer::Parse(expiresIn, expiresInValue);
reg.AddValue(authSection, L"expires_in", expiresInValue);
Integer::Parse(userId, userIdValue);
reg.AddValue(authSection, L"user_id", userIdValue);
reg.Flush();
}