本文整理汇总了C++中AnsiString::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ AnsiString::IsEmpty方法的具体用法?C++ AnsiString::IsEmpty怎么用?C++ AnsiString::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnsiString
的用法示例。
在下文中一共展示了AnsiString::IsEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
DKIMSigner::Sign(boost::shared_ptr<Message> message)
{
AnsiString senderAddress = message->GetFromAddress();
AnsiString senderDomain = StringParser::ExtractDomain(senderAddress);
// Check if signing is enabled for this domain.
boost::shared_ptr<const Domain> pDomain = CacheContainer::Instance()->GetDomain(senderDomain);
if (!pDomain || !pDomain->GetDKIMEnabled())
return;
LOG_DEBUG("Signing message using DKIM...");
AnsiString selector = pDomain->GetDKIMSelector();
AnsiString domain = pDomain->GetName();
AnsiString privateKeyFile = pDomain->GetDKIMPrivateKeyFile();
if (selector.IsEmpty() || privateKeyFile.IsEmpty())
{
ErrorManager::Instance()->ReportError(ErrorManager::Medium, 5305, "DKIMSigner::Sign", "Either the selector or private key file was not specified.");
return;
}
Canonicalization::CanonicalizeMethod headerMethod = (Canonicalization::CanonicalizeMethod) pDomain->GetDKIMHeaderCanonicalizationMethod();
Canonicalization::CanonicalizeMethod bodyMethod = (Canonicalization::CanonicalizeMethod) pDomain->GetDKIMBodyCanonicalizationMethod();
HashCreator::HashType algorithm = (HashCreator::HashType) pDomain->GetDKIMSigningAlgorithm();
DKIM dkim;
if (!dkim.Sign(message, domain, selector, privateKeyFile, algorithm, headerMethod, bodyMethod))
{
ErrorManager::Instance()->ReportError(ErrorManager::Medium, 5306, "DKIMSigner::Sign", "Message signing using DKIM failed.");
}
}
示例2: FloatTimeToStrTime
AnsiString FloatTimeToStrTime(float v, bool _h, bool _m, bool _s, bool _ms)
{
AnsiString buf = "";
int h = 0, m = 0, s = 0, ms;
AnsiString t;
if (_h) { h = iFloor(v / 3600); t.sprintf("%02d", h); buf += t; }
if (_m) { m = iFloor((v - h * 3600) / 60); t.sprintf("%02d", m); buf += buf.IsEmpty() ? t : ":" + t; }
if (_s) { s = iFloor(v - h * 3600 - m * 60); t.sprintf("%02d", s); buf += buf.IsEmpty() ? t : ":" + t; }
if (_ms) { ms = iFloor((v - h * 3600 - m * 60 - s)*1000.f); t.sprintf("%03d", ms); buf += buf.IsEmpty() ? t : "." + t; }
return buf;
}
示例3: bbtnEnterResultClick
void __fastcall TfrmCompetitorCategoryResultEdit::bbtnEnterResultClick(
TObject *Sender)
{
//Сохранить результаты текущего участника
if(resultModified){
resetCallback();
//Выбрать нового участника
int currentCompetitorId = TResult::getCurrentCompetitorId();
//Установить полученный результаты в выпадющем списке
AnsiString fwok = cmboxFightWOKnifeRank->Text;
AnsiString fwk = cmboxFightWKnifeRank->Text;
AnsiString sht = cmboxShootRank->Text;
AnsiString cmmn = cmboxCommonRank->Text;
if(fwok.IsEmpty()){fwok = "0";}
if(fwk.IsEmpty()){fwk = "0";}
if(sht.IsEmpty()){sht = "0";}
if(cmmn.IsEmpty()){cmmn = "0";}
currentCompetitor.result.setFightWOKnifeRank(
StrToInt(fwok));
currentCompetitor.result.setFightWKnifeRank(
StrToInt(fwk));
currentCompetitor.result.setShootRank(
StrToInt(sht));
currentCompetitor.result.setCommonRank(
StrToInt(cmmn));
//Сохраним результат участника
currentCompetitor.storeResult(currentCategory->getId());
//Отобразить список участников снова
ShowCompetitorList(currentCategory);
//Установить выбранную запись как текущуую
TResult::setCurrentCompetitorById(currentCompetitorId);
cmboxFightWOKnifeRank->Text = !fwok.AnsiCompare("0") ? AnsiString("") : fwok;
cmboxFightWKnifeRank->Text = !fwk.AnsiCompare("0") ? AnsiString("") : fwk;
cmboxShootRank->Text = !sht.AnsiCompare("0") ? AnsiString("") : sht;
cmboxCommonRank->Text = !cmmn.AnsiCompare("0") ? AnsiString("") : cmmn;
showResultScores();
HideResultChange();
setCallback();
}
}
示例4: UpdateDatesInStatusBar
//---------------------------------------------------------------------------
void __fastcall TFormOptsOplata::UpdateDatesInStatusBar(int selrow)
{
AnsiString Str;
Str=StrGridOpts->Cells[1][selrow];
if (Str.IsEmpty()) Str="???";
StatusBar->Panels->Items[1]->Text=Str;
Str=StrGridOpts->Cells[2][selrow];
if (Str.IsEmpty()) Str="??? - ???";
StatusBar->Panels->Items[4]->Text=Str;
Str=StrGridOpts->Cells[3][selrow];
if (Str.IsEmpty()) Str="???";
StatusBar->Panels->Items[7]->Text=Str;
}
示例5: AddPhoto
//---------------------------------------------------------------------------
void __fastcall TMainForm::AddPhoto(AnsiString existingFileName)
{
AnsiString photoFile = "";
AnsiString hash = "";
if (existingFileName.IsEmpty()) {
Randomize();
hash = GetMD5Hash(AnsiString(Random(99999999999999999999999999999999)));
photoFile = GetAppPath()+"Photo\\"+hash+".jpg";
} else {
hash = existingFileName;
}
photoFile = GetAppPath()+"Photo\\"+hash+".jpg";
if (OpenPictureDialog->Execute()) {
if (!OpenPictureDialog->FileName.IsEmpty()) {
if (FileExists(OpenPictureDialog->FileName)) {
int ID = DBGrid->Fields[14]->AsInteger;
AnsiString query = "UPDATE tblMembers SET mPhoto = '" + hash + "' WHERE ID = " + AnsiString(ID);
CMData->ADOQuery->SQL->Clear();
CMData->ADOQuery->SQL->Add(query);
CMData->ADOQuery->ExecSQL();
query = AnsiString("select mSur, mName, mPat, mBD, mCD, mNat, mAdd, mTel, mFam, mPro, ") +
AnsiString ("mLife, mSug, mEtc, mPhoto, ID from tblMembers order by mSur, mName, mPat");
CMData->ADOQuery->SQL->Clear();
CMData->ADOQuery->SQL->Add(query);
CMData->ADOQuery->Open();
CopyFile(OpenPictureDialog->FileName.c_str(), photoFile.c_str(), false);
} else {
MessageDlg("Файл '" + OpenPictureDialog->FileName + "' не найден!", mtError, TMsgDlgButtons() << mbOK, 0);
}
}
}
}
示例6: AppendLightControl
void ESceneLightTools::AppendLightControl(LPCSTR nm, u32* idx)
{
AnsiString name = nm; _Trim(name);
if (name.IsEmpty()) return;
if (FindLightControl(name.c_str())) return;
lcontrols.push_back (xr_rtoken(name.c_str(),idx?*idx:lcontrol_last_idx++));
}
示例7: RealUpdateProperties
void TClipMaker::RealUpdateProperties()
{
m_RTFlags.set (flRT_UpdateProperties,FALSE);
// clip props
PropItemVec p_items;
PropValue* V = 0;
PHelper().CreateCaption (p_items,"Length", FloatTimeToStrTime(m_TotalLength,true,true,true,true).c_str());
V=PHelper().CreateFloat (p_items,"Zoom", &m_Zoom, 1.f,1000.f,0.1f,1);
V->OnChangeEvent.bind (this,&TClipMaker::OnZoomChange);
if (sel_clip){
ListItem* l_owner = m_ClipList->FindItem(*sel_clip->name); VERIFY(l_owner);
V=PHelper().CreateName (p_items,"Current Clip\\Name", &sel_clip->name, l_owner);
V->OnChangeEvent.bind (this,&TClipMaker::OnNameChange);
V=PHelper().CreateFloat (p_items,"Current Clip\\Length",&sel_clip->length, 0.f,10000.f,0.1f,2);
V->OnChangeEvent.bind (this,&TClipMaker::OnClipLengthChange);
for (u16 k=0; k<4; k++){
AnsiString mname = sel_clip->CycleName(k);
u16 slot = sel_clip->CycleSlot(k);
if (mname.IsEmpty())continue;
CMotionDef* MD = ATools->m_RenderObject.FindMotionDef (mname.c_str(),slot);
CMotion* MI = ATools->m_RenderObject.FindMotionKeys (mname.c_str(),slot);
SBonePart* BP = (k<(u16)m_CurrentObject->BoneParts().size())?&m_CurrentObject->BoneParts()[k]:0;
shared_str tmp;
if (MI) tmp.sprintf("%s [%3.2fs, %s]",mname.c_str(),MI->GetLength()/MD->Speed(),MD->bone_or_part?"stop at end":"looped");
if (BP) PHelper().CreateCaption (p_items,PrepareKey("Current Clip\\Cycles",BP->alias.c_str()), tmp);
}
if (sel_clip->fx.valid())PHelper().CreateFloat (p_items,PrepareKey("Current Clip\\FXs",*sel_clip->fx.name), &sel_clip->fx_power, 0.f, 1000.f);
}
m_ClipProps->AssignItems(p_items);
}
示例8: InValidInteger
bool __fastcall TEntryForm::InValidInteger(AnsiString label, TEditPlus *edit, int length)
{
if (edit->ReadOnly == true)
return false;
AnsiString ud = edit->Text;
if (ud.IsEmpty() == true)
{
AnsiString msg = "The field "+label+" contains the value '"+edit->Text+"'."
+" This is invalid for a non null integer field allowing"
+" for "+length+" bytes of data";
Application->MessageBox(msg.c_str(), "No Data Entered", ID_OK);
return true;
}
if (ud[1] == '-')
ud.Delete(1,1);
int n = ud.Length();
if (n <= length
&& strspn(ud.c_str(), "0123456789") == (unsigned)n)
return false;
AnsiString msg = "The field "+label+" contains the value '"+edit->Text+"'."
+" This is invalid for a non null integer field allowing"
+" for "+length+" bytes of data";
Application->MessageBox(msg.c_str(), "Invalid Number", ID_OK);
return true;
}
示例9:
String
MimeHeader::GetUnicodeFieldValue(const AnsiString &pszFieldName, const AnsiString &sRawFieldValue)
{
AnsiString sWideStr;
sWideStr = "";
if (sRawFieldValue.IsEmpty())
{
if (IniFileSettings::Instance()->GetLogLevel() > 99) LOG_DEBUG("MimeHeader::GetUnicodeFieldValue - sRawFieldValue.IsEmpty");
return sWideStr;
}
// De-code the value to plain text.
AnsiString sRetVal;
FieldCodeBase* pCoder = MimeEnvironment::CreateFieldCoder(pszFieldName);
pCoder->SetInput(sRawFieldValue, sRawFieldValue.GetLength(), false);
pCoder->GetOutput(sRetVal);
AnsiString sCharset = pCoder->GetCharset();
delete pCoder;
sWideStr = Charset::ToWideChar(sRetVal, sCharset);
if (IniFileSettings::Instance()->GetLogLevel() > 99) LOG_DEBUG("MimeHeader::GetUnicodeFieldValue - sWideStr: " + sWideStr);
return sWideStr;
}
示例10: LoadTimer
void __fastcall TfrmMain::LoadTimer(TObject *Sender)
{
LoadSetting();
if (FileExists(String(LoginerPath) +"\\Data\\"+ GameAccount + "\\Items.dat"))
{
TStringList *list = new TStringList();
list->LoadFromFile(String(LoginerPath) +"\\Data\\"+ GameAccount + "\\Items.dat");
for (int i = 0; i < list->Count; i++)
{
unsigned int ItemID;
ItemID = _wtoi(list->Strings[i].w_str());
AnsiString name = String(GetItemName(ItemID));
if (name.IsEmpty())
{
name.sprintf(TEXT("未知物品(編號:%d)"), ItemID);
}
int index = list_drop->Items->IndexOfObject((TObject *)ItemID);
if (index > -1)
list_drop->Items->Delete(index);
index = list_filter->Items->IndexOfObject((TObject *)ItemID);
if (index < 0)
list_filter->Items->AddObject(name, (TObject *)ItemID);
}
delete list;
}
Load->Enabled = false;
}
示例11: InsertTextCP
void TfrmText::InsertTextCP(const AnsiString& line, bool bCommas)
{
AnsiString txt = (bCommas)?AnsiString("\"")+line+AnsiString("\""):line;
if (!txt.IsEmpty()){
AnsiString h = mmText->Lines->Strings[mmText->CaretPos.y];
h.Insert (txt,mmText->CaretPos.x+1);
mmText->Lines->Strings[mmText->CaretPos.y] = h;
}
}
示例12: GetParameter
String
MimeHeader::GetRawFilename() const
{
AnsiString sRawValue = GetParameter(CMimeConst::ContentDisposition(), CMimeConst::Filename());
if (sRawValue.IsEmpty())
sRawValue = GetParameter(CMimeConst::ContentType(), CMimeConst::Name());
return sRawValue;
}
示例13: LoadSelection
void TItemList::LoadSelection(TFormStorage* storage)
{
last_selected_items.clear();
int cnt = storage->ReadInteger("sel_cnt",0);
for (int k=0; k<cnt;k++){
AnsiString tmp = storage->ReadString(AnsiString().sprintf("sel%d",k),"");
if (!tmp.IsEmpty())last_selected_items.push_back(tmp.c_str());
}
}
示例14: GetNewName
//---------------------------------------------------------------------------
AnsiString __fastcall TCopyProgress::GetNewName(AnsiString mask, AnsiString source)
{
//TODO: Add your source code here
AnsiString temp = ExtractFileName(source);
source = ExtractFilePath(source);
if(source.IsEmpty())
return mask;
return source + "\\" + mask;//???
}
示例15: PuttyInitialize
void PuttyInitialize()
{
SaveRandomSeed = true;
// make sure random generator is initialised, so random_save_seed()
// in destructor can proceed
random_ref();
flags = FLAG_VERBOSE/* | FLAG_SYNCAGENT*/; // verbose log
sk_init();
AnsiString VersionString = AnsiString(GetSshVersionString());
DebugAssert(!VersionString.IsEmpty() && (static_cast<size_t>(VersionString.Length()) < _countof(sshver)));
strncpy(sshver, VersionString.c_str(), sizeof(sshver));
AnsiString AppName = AnsiString(GetAppNameString());
DebugAssert(!AppName.IsEmpty() && (static_cast<size_t>(AppName.Length()) < _countof(appname_)));
strncpy(appname_, AppName.c_str(), sizeof(appname_));
}