本文整理汇总了C++中AnsiString::data方法的典型用法代码示例。如果您正苦于以下问题:C++ AnsiString::data方法的具体用法?C++ AnsiString::data怎么用?C++ AnsiString::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnsiString
的用法示例。
在下文中一共展示了AnsiString::data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateImage
//---------------------------------------------------------------------------
void TPictureViewer::UpdateImage(const AnsiString FileName, const bool Transparent)
{
ZoomPageB->Visible = false;
ZoomOneB->Visible = false;
FullViewB->Visible = false;
ShapeZoomPageB->Visible = false;
ShapeZoomOneB->Visible = false;
ShapeFullViewB->Visible = false;
if (FileName.data()) {
LoadTransparentBitmap(Image, FileName, Transparent);
if (Image->Picture->Bitmap->Width > Width || Image->Picture->Bitmap->Height > Height) {
ZoomPageB->Visible = true;
ZoomOneB->Visible = true;
FullViewB->Visible = true;
ShapeZoomPageB->Visible = true;
ShapeZoomOneB->Visible = true;
ShapeFullViewB->Visible = true;
Image->Center = false;
ZoomPageBClick(NULL);
} else {
Image->Center = true;
ZoomOneBClick(NULL);
}
Image->Visible = true;
} else {
Image->Visible = false;
}
}
示例2: SaveKey
//---------------------------------------------------------------------------
void __fastcall TKeyGenerator::SaveKey(const AnsiString FileName,
const AnsiString Passphrase, TKeyFormat Format)
{
DebugAssert(FSSH2Key);
DebugAssert(FState == kgComplete);
DebugAssert((Format != kfOpenSSH && Format != kfSSHCom) || IsSSH2);
int Result;
if (IsSSH2)
{
switch (Format)
{
case kfPutty:
Result = ssh2_save_userkey(FileName.c_str(), FSSH2Key,
(char*)Passphrase.data());
break;
case kfOpenSSH:
Result = export_ssh2(FileName.c_str(), SSH_KEYTYPE_OPENSSH, FSSH2Key,
(char*)Passphrase.data());
break;
case kfSSHCom:
Result = export_ssh2(FileName.c_str(), SSH_KEYTYPE_SSHCOM, FSSH2Key,
(char*)Passphrase.data());
break;
default:
DebugFail();
}
}
else
{
DebugAssert(Format == kfPutty);
Result = saversakey(FileName.c_str(), FRSAKey,
(char*)Passphrase.data());
}
if (Result <= 0)
throw Exception(FMTLOAD(SAVE_KEY_ERROR, (FileName)));
}
示例3: ansi_to_unicode
void ansi_to_unicode(UnicodeString& u_str, const AnsiString& a_str) {
unsigned size = a_str.size() + 1;
int res = MultiByteToWideChar(CP_ACP, 0, a_str.data(), size, u_str.buf(a_str.size()), size);
if (res == 0) FAIL(SystemError());
u_str.set_size(res - 1);
}