本文整理汇总了C++中AnsiString::Length方法的典型用法代码示例。如果您正苦于以下问题:C++ AnsiString::Length方法的具体用法?C++ AnsiString::Length怎么用?C++ AnsiString::Length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnsiString
的用法示例。
在下文中一共展示了AnsiString::Length方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFilePath
AnsiString __fastcall TFTPFile::GetFilePath(AnsiString ServerString)
{
int pos = ServerString.LowerCase().Pos("ftp://");
if(pos < 1)
return "";
ServerString = ServerString.SubString(pos + 6,ServerString.Length() - pos);
pos = StrLScan(ServerString.c_str(),"/");
if(pos < 0)
return "";
ServerString = ServerString.SubString(pos + 2,ServerString.Length() - pos - 1);
pos = StrRScan(ServerString.c_str(),"/");
if(pos < 0)
return "/";
ServerString = ServerString.SubString(1,pos);
if(ServerString.SubString(1,1) != "/")
ServerString = "/" + ServerString;
if(ServerString.SubString(ServerString.Length(),1) != "/")
ServerString = ServerString + "/";
return ServerString;
}
示例2:
void __fastcall TDB_packer::ExtBtn3Click(TObject *Sender)
{
TElShellTreeItem* itm = shellTree->ItemFocused;
if(!itm->IsFolder)
{
AnsiString str = itm->FullName;
int root_len = xr_strlen(m_root_folder);
int len = str.Length();
lbIncludeFiles->Items->Add( str.SubString(root_len+1,len-root_len) );
}
}
示例3: GetUserName
AnsiString __fastcall TFTPFile::GetUserName(AnsiString ServerString)
{
int pos = ServerString.LowerCase().Pos("ftp://");
if(pos < 1)
return "";
ServerString = ServerString.SubString(pos + 6,ServerString.Length() - pos);
pos = StrLScan(ServerString.c_str(),":");
if(pos < 0)
return "";
return DecryFTPPassword(ServerString.SubString(1,pos));
}
示例4: AddANewModule
//---------------------------------------------------------------------------
void TfrmMainFormServer::AddANewModule(){
AnsiString name = InputBox("New Virtual Directory",
"Enter an alias WITHOUT spaces",
"ANewName");
if(name.Length() > 0){
adapter.AddANewModule(name);
LoadModuleNames();
}
}
示例5: GeraCampoLivre
//---------------------------------------------------------------------------
AnsiString __fastcall TBolBradesco::GeraCampoLivre(void)
{
AnsiString CampoLivre = Agencia.SubString(1,4) +
Carteira + GetNumeroDocumento() +
CodigoCedente.SubString(1,7) +
"0";
if(CampoLivre.Length() != 25)
{
throw Exception("Campo livre deve conter 25 caracteres para o Banco Bradesco.");
}
return(CampoLivre);
}
示例6: wxFileConfig
//----------------------------------------------------------------------------
//class TMemIniFile : public TCustomIniFile
//----------------------------------------------------------------------------
// TIniFileのバグ回避版らしい・・・が、TIniFileと同じことをやる。ドン
TMemIniFile::TMemIniFile(const AnsiString& str) : m_pStream(NULL), m_pConfig(NULL)
{
if ( str.AnsiPos("\\\\?\\") )
m_strIniFile = str.SubString( 4, str.Length() - 4).c_str();
else
m_strIniFile = str.c_str();
// m_pStream = new wxFileInputStream( m_strIniFile );
// m_pConfig = new wxFileConfig(*m_pStream);
// m_pConfig = new wxFileConfig(wxEmptyString, wxEmptyString, m_strIniFile, wxEmptyString, wxCONFIG_USE_LOCAL_FILE);
m_pConfig = new wxFileConfig(wxT("krkr"), wxT("ym"), m_strIniFile, wxEmptyString, wxCONFIG_USE_LOCAL_FILE);
}
示例7: MyPlaySound
//---------------------------------------------------------------------------
void MyPlaySound(AnsiString file)
{
if( file.Length() == 0 )
return;
if( ! FileExists(file) )
{
WriteToLogError("WARNING\tPlay sound: file \"%s\" not found !", file.c_str());
return;
}
if( ::PlaySound(file.c_str(), NULL, SND_FILENAME | SND_NODEFAULT | SND_NOWAIT | SND_SYNC) == FALSE )
WriteToLogError("ERROR\tPlay sound: \"%s\"", FormatLastError2(GetLastError()).c_str());
}
示例8: CheckFileBool
//---------------------------------------------------------------------------
bool TUtilities::CheckFileBool(std::ifstream &InFile)
//no need to worry about leading '\n' characters as the skipws (skip white space) flag is
//set automatically
{
AnsiString BoolString;
if(!CheckAndReadFileString(InFile, BoolString)) return false;
if(InFile.fail()) return false;
if(BoolString == "") return false;
if((BoolString.Length() > 1) || (BoolString == "")) return false;
if((BoolString != "0") && (BoolString != "1")) return false;
return true;
}
示例9: StringToTokiensA
//---------------------------------------------------------------------------
void StringToTokiensA( AnsiString Words, AnsiString Dlmtr, TStrings *Making )
{
AnsiString Work = Words.Trim();
int spos;
while ((spos = Work.AnsiPos(Dlmtr)) != 0) {
Making->Add(Work.SubString( 1, spos-1));
Work = Work.SubString( spos+1, Work.Length() - spos);
Work = Work.Trim();
} // while
if (Work != "")
Making->Add(Work);
}
示例10: PuttyInitialize
//---------------------------------------------------------------------------
void __fastcall PuttyInitialize()
{
SaveRandomSeed = true;
InitializeCriticalSection(&putty_section);
// 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 = SshVersionString();
assert(!VersionString.IsEmpty() && (static_cast<size_t>(VersionString.Length()) < LENOF(sshver)));
strcpy(sshver, VersionString.c_str());
AnsiString AppName = AppNameString();
assert(!AppName.IsEmpty() && (static_cast<size_t>(AppName.Length()) < LENOF(appname_)));
strcpy(appname_, AppName.c_str());
}
示例11: GetFileList
//---------------------------------------------------------------------------
bool __fastcall TRelDirSearchForm::GetFileList(AnsiString folder)
{
try
{
GetFileList(folder, folder.Length());
}
catch(...)
{
return false;
}
return true;
}
示例12: InValidDouble
bool __fastcall TEntryForm::InValidDouble(AnsiString label, TEditPlus *edit)
{
AnsiString ud = edit->Text;
if (ud[1] == '-')
ud.Delete(1,1);
if (strspn(ud.c_str(), "0123456789.") == (unsigned)ud.Length())
return false;
AnsiString msg = "The field "+label+" contains the value '"+edit->Text+"'."
+" This is invalid for a non null double field";
Application->MessageBox(msg.c_str(), "Invalid Double", ID_OK);
return true;
}
示例13: DostosujZnakiSpecjalne
//---------------------------------------------------------------------------
/// Metoda odpowiedzialna za dostosowanie znaków specjalnych w tekœcie (apostrofy itp.),
/// poprzez dodanie dodanie "\"
void __fastcall ParsujDane::DostosujZnakiSpecjalne(AnsiString &AText)
{
AnsiString str;
int pozycjaZnacznik = 0;
while(pozycjaZnacznik != AText.Length())
{
str = AText[pozycjaZnacznik];
if (str == "\'" || str == "\"") AText.Insert("\\", pozycjaZnacznik - 1);
pozycjaZnacznik++;
}
}
示例14: Bezogonkow
AnsiString Global::Bezogonkow(AnsiString str, bool _)
{ // wyciêcie liter z ogonkami, bo OpenGL nie umie wyœwietliæ
for (int i = 1; i <= str.Length(); ++i)
if (str[i] & 0x80)
str[i] = bezogonkowo[str[i] & 0x7F];
else if (str[i] < ' ') // znaki steruj¹ce nie s¹ obs³ugiwane
str[i] = ' ';
else if (_)
if (str[i] == '_') // nazwy stacji nie mog¹ zawieraæ spacji
str[i] = ' '; // wiêc trzeba wyœwietlaæ inaczej
return str;
}
示例15: StringToAudHours
//---------------------------------------------------------------------------
void __fastcall TFormReportUchebKartStud::StringToAudHours(AnsiString h[12], AnsiString &str_hours)
{
int cur_sem = 0;
int begin = 1;
for(int pos = 1; pos <= str_hours.Length(); pos++)
{
if (str_hours[pos] == ';')
{
h[cur_sem++] = str_hours.SubString(begin, pos - begin);
begin = pos + 1;
}
}
}