本文整理汇总了C++中wxString::AfterFirst方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::AfterFirst方法的具体用法?C++ wxString::AfterFirst怎么用?C++ wxString::AfterFirst使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxString
的用法示例。
在下文中一共展示了wxString::AfterFirst方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: type
ItemRecord::ItemRecord(wxString line)
: type(0)
{
id = wxAtoi(line.BeforeFirst(','));
line = line.AfterFirst(',');
quality = wxAtoi(line.BeforeFirst(','));
line = line.AfterFirst(',');
try {
ItemDB::Record r = itemdb.getById(id);
model = r.getInt(ItemDB::ItemDisplayInfo);
itemclass = r.getInt(ItemDB::Itemclass);
subclass = r.getInt(ItemDB::Subclass);
type = r.getInt(ItemDB::InventorySlot);
switch(r.getInt(ItemDB::Sheath)) {
case SHEATHETYPE_MAINHAND: sheath = ATT_LEFT_BACK_SHEATH; break;
case SHEATHETYPE_LARGEWEAPON: sheath = ATT_LEFT_BACK; break;
case SHEATHETYPE_HIPWEAPON: sheath = ATT_LEFT_HIP_SHEATH; break;
case SHEATHETYPE_SHIELD: sheath = ATT_MIDDLE_BACK_SHEATH; break;
default: sheath = SHEATHETYPE_NONE;
}
discovery = false;
name.Printf(wxT("%s [%d] [%d]"), line.c_str(), id, model);
} catch (ItemDB::NotFound) {}
}
示例2: CompareTimeString
/* compare strings that contains time periods in format 00:00:00 */
static int CompareTimeString(const wxString& first,const wxString& second) {
long dtFirst,dtSecond;
wxString hours,minutes,seconds;
long lHours,lMinutes,lSeconds;
//converting the first string to long value
hours = first.BeforeFirst(':');
seconds = first.AfterLast(':');
minutes = first.AfterFirst(':').BeforeFirst(':');
hours.ToLong(&lHours);
minutes.ToLong(&lMinutes);
seconds.ToLong(&lSeconds);
dtFirst = lSeconds + lMinutes * 60 + lHours * 3600;
//converting the second string
hours = second.BeforeFirst(':');
seconds = second.AfterLast(':');
minutes = second.AfterFirst(':').BeforeFirst(':');
hours.ToLong(&lHours);
minutes.ToLong(&lMinutes);
seconds.ToLong(&lSeconds);
dtSecond = lSeconds + lMinutes * 60 + lHours * 3600;
if(dtFirst < dtSecond) {
return reverseCompareOrder ? 1 : -1 ;
}
if(dtSecond < dtFirst) {
return reverseCompareOrder ? -1 : 1 ;
}
return 0;
}
示例3: ExplodeMessage
void SjLogGui::ExplodeMessage(const wxString& all___, unsigned long& severity, unsigned long& time, wxString& msg, wxString& scope)
{
wxString temp;
// get and strip severity
temp = all___.BeforeFirst(wxT('|'));
temp.ToULong(&severity);
msg = all___.AfterFirst(wxT('|'));
// get and strip time
temp = msg.BeforeFirst(wxT('|'));
temp.ToULong(&time);
msg = msg.AfterFirst(wxT('|'));
// now "msg" is message and optional scope enclosured by "[]"
scope.Empty();
int p = msg.Find(wxT('['), true/*from end*/);
if( p!=-1 )
{
scope = msg.Mid(p+1);
if( scope.Len()>=1 && scope.Last()==wxT(']') )
{
scope = scope.Left(scope.Len()-1);
msg = msg.Left(p).Trim();
}
}
// some finalizing translations (some stuff is logged before the translation system is available)
if( msg.StartsWith(wxT("Loading "), &temp) )
{
msg.Printf(_("Loading %s"), temp.c_str());
}
}
示例4: readconfigdata
wxString readconfigdata(wxString &configstr)
{
configstr=configstr.AfterFirst(':');
wxString data=configstr.BeforeFirst('\n');
configstr=configstr.AfterFirst('\n');
return data;
}
示例5: conv_struct
wxString conv_struct(wxString input)//input contains Structure structname:$\nvariable ...$\n
{
wxString output,structname,temporary;
output.Empty();
structname = input.BeforeFirst('$');//contains Structure structname:
structname = structname.AfterFirst(' ');
structname = structname.BeforeFirst(':');
input = input.AfterFirst('$');//Contains list of data members - either variables or functions and then End Structure
output << "struct " <<structname;
output<<"\n{\n";
while(input.Contains(wxT("End")))//input has /nint ....$/n...$/npublic:$/n
{
temporary = input.BeforeFirst('$');//contains variable or function or public;
if(temporary.Contains(wxT("End"))) break;
else if(temporary.Contains(wxT("Variable")))
{
temporary.Replace("\t ","");
output<<"\t "<< conv_variable(temporary)<<"\n";
}
else if(temporary.Contains(wxT("Function")))
{
temporary.Replace("\t ","");
output<<"\t " << conv_g_func(temporary)<<"\n";
}
input = input.AfterFirst('$');
}//input contains End Struct $\n
output<<"\n};";
return output;
}
示例6: conv_p_elseif
wxString conv_p_elseif(wxString input)//input = else if condition
{
wxString output,condition;
input = input.AfterFirst(' ');
condition = input.AfterFirst(' ');
output.Empty();
output<<"else if( " << condition << " )\n"; //output = else if (condition)\n
return output;
}
示例7: conv_variable
//starting of funcs to conv globals...
wxString conv_variable(wxString input) //converts input of form "Variable vame[23] as datatype*" to datatype* vname[23];
{
wxString output,vname,datatype;
input = input.AfterFirst(' '); //input contains "vame[23] as datatype*"
vname = input.BeforeFirst(' ');
input = input.AfterFirst(' ');//input contains "as datatype*
datatype= input.AfterFirst(' ');
output.Empty();
output<<datatype<<" "<<vname<<";";
return output;
}
示例8: GetStarValues
// Retrieves the Right Ascension, Declination, and Visual Magnitude of the star from the
// line in the file
void GLStars::GetStarValues(wxString buffer, Real *RightAscension, Real *Declination, Real *VisualMag){
wxString str;
unsigned int i = 0;
while (buffer[0] == ' '){
buffer = buffer.AfterFirst(' ');
//i = 0;
}
for (i = 0; i < buffer.Length(); i++){
if (buffer[i] == '+')
continue;
else if (buffer[i] != '\n' && buffer[i] != ' '){
str.Append(buffer[i]);
}
else
break;
}
str.ToDouble(RightAscension);
str.Empty();
buffer = buffer.AfterFirst(' ');
while (buffer[0] == ' '){
buffer = buffer.AfterFirst(' ');
//i = 0;
}
for (i = 0; i < buffer.Length(); i++){
if (buffer[i] == '+')
continue;
else if (buffer[i] != '\n' && buffer[i] != ' '){
str.Append(buffer[i]);
}
else
break;
}
str.ToDouble(Declination);
str.Empty();
buffer = buffer.AfterFirst(' ');
while (buffer[0] == ' '){
buffer = buffer.AfterFirst(' ');
//i = 0;
}
for (i = 0; i < buffer.Length(); i++){
if (buffer[i] == '+')
continue;
else if (buffer[i] != '\n' && buffer[i] != ' '){
str.Append(buffer[i]);
}
else
break;
}
str.ToDouble(VisualMag);
str.Empty();
}
示例9: id
NPCRecord::NPCRecord(wxString line)
: id(0), model(0), type(0)
{
if (line.Len() <= 3)
return;
id = wxAtoi(line.BeforeFirst(','));
line = line.AfterFirst(',');
model = wxAtoi(line.BeforeFirst(','));
line = line.AfterFirst(',');
type = wxAtoi(line.BeforeFirst(','));
line = line.AfterFirst(',');
discovery = false;
name.Printf(wxT("%s [%d] [%d]"), line.c_str(), id, model);
}
示例10: conv_class
wxString conv_class(wxString input)//input contains class classname:$/nprivate:$/nvariable ...$/n
{
wxString output,classname,temporary;
output.Empty();
classname = input.BeforeFirst('$');//contains Class classname:
classname = classname.AfterFirst(' ');
classname = classname.BeforeFirst(':');
input = input.AfterFirst('$');//contains \n\tprivate:$\n.....
output << "class " <<classname;
temporary = input.BeforeFirst('$');//contains \n\tprivate:
output<<"\n{"<<temporary<<"\n";//has private:\n
input= input.AfterFirst('$'); //list of data members - either variables or functions and then $\n\tpublic:$\n
while(input.Contains(wxT("public:")))//input has /nint ....$/n...$/npublic:$/n
{
temporary = input.BeforeFirst('$');//contains variable or function or public;
if(temporary.Contains(wxT("public:"))) break;
else if(temporary.Contains(wxT("Variable")))
{
temporary.Replace("\t ","");
output<<"\t "<< conv_variable(temporary)<<"\n";
}
else if(temporary.Contains(wxT("Function")))
{
temporary.Replace("\t ","");
output<<"\t " << conv_g_func(temporary)<<"\n";
}
input = input.AfterFirst('$');
}//input contains \n\tpublic:$\n ... \nEnd Class$\n
temporary = input.BeforeFirst('$');//contains \n\tpublic:
output<<temporary<<"\n";//output has public:\n
input = input.AfterFirst('$');//input has list of datamembers and then has endclass$\n
while(input.Contains(wxT("End")))//input has /nint ....$/n...$/npublic:$/n
{
temporary = input.BeforeFirst('$');//contains variable or function or public;
if(temporary.Contains(wxT("End"))) break;
else if(temporary.Contains(wxT("Variable")))
{
temporary.Replace("\t ","");
output<<"\t "<< conv_variable(temporary)<<"\n";
}
else if(temporary.Contains(wxT("Function")))
{
temporary.Replace("\t ","");
output<<"\t " << conv_g_func(temporary)<<"\n";
}
input = input.AfterFirst('$');
}
output<<"\n};";
return output;
}
示例11: if
void
hoxChesscapePlayer::_HandleTableCmd( const wxString& cmdStr )
{
const wxString tCmd = cmdStr.BeforeFirst(0x10);
wxString subCmdStr = cmdStr.AfterFirst(0x10);
if (!subCmdStr.empty() && subCmdStr[subCmdStr.size()-1] == 0x10)
subCmdStr = subCmdStr.substr(0, subCmdStr.size()-1);
wxLogDebug("%s: Processing tCmd = [%s]...", __FUNCTION__, tCmd.c_str());
if ( tCmd == "Settings" ) _HandleTableCmd_Settings( subCmdStr );
else if ( tCmd == "Invite" ) _HandleTableCmd_Invite( subCmdStr );
else
{
/* NOTE: The Chesscape server only support 1 table for now. */
hoxTable_SPtr pTable = _GetMyTable();
if ( ! pTable )
{
wxLogDebug("%s: *WARN* This player [%s] not yet joined any table.",
__FUNCTION__, this->GetId().c_str());
return;
}
if ( tCmd == "MvPts" ) _HandleTableCmd_PastMoves( pTable, subCmdStr );
else if ( tCmd == "Move" ) _HandleTableCmd_Move( pTable, subCmdStr );
else if ( tCmd == "GameOver" ) _HandleTableCmd_GameOver( pTable, subCmdStr );
else if ( tCmd == "OfferDraw" ) _HandleTableCmd_OfferDraw( pTable );
else if ( tCmd == "Clients" ) _HandleTableCmd_Clients( pTable, subCmdStr );
else if ( tCmd == "Unjoin" ) _HandleTableCmd_Unjoin( pTable, subCmdStr );
else
{
wxLogDebug("%s: *** Ignore this Table-command = [%s].", __FUNCTION__, tCmd.c_str());
}
}
}
示例12: Get_Server_Item
//---------------------------------------------------------
wxTreeItemId CData_Source_PgSQL::Get_Server_Item(const wxString &Server, bool bCreate)
{
wxString Name = Server.AfterFirst('[').BeforeFirst(']');
wxTreeItemIdValue Cookie; wxTreeItemId Item = GetFirstChild(GetRootItem(), Cookie);
while( Item.IsOk() )
{
if( !Name.Cmp(GetItemText(Item)) )
{
return( Item );
}
Item = GetNextChild(Item, Cookie);
}
if( bCreate )
{
Item = AppendItem(GetRootItem(), Name, IMG_SERVER, IMG_SERVER, new CData_Source_PgSQL_Data(TYPE_SERVER, &Name, &Name));
SortChildren(GetRootItem());
Expand (GetRootItem());
}
return( Item );
}
示例13: SetDisplayMsg
void SjMainFrame::SetDisplayMsg(const wxString& text, long holdMs)
{
m_display.m_msg1 = text.BeforeFirst('\n');
m_display.m_msg2 = text.AfterFirst('\n');
m_display.m_msgCancelAtTimestamp = SjTools::GetMsTicks()+holdMs;
UpdateDisplay();
}
示例14: conv_g_func
wxString conv_g_func(wxString input)//input = Function func_name parameters: int var1,char * var2,int var3 returns char*
{
wxString output,fname,rtype,params;
input = input.AfterFirst(' '); //input contains "func_name parameters: int var1,char * var2,int var3 returns char*"
fname = input.BeforeFirst(' ');
input = input.AfterFirst(' ');//input contains "parameters: int var1,char * var2,int var3 returns char*"
input = input.AfterFirst(' ');//input contains "int var1,char * var2,int var3 returns char*"
input.Replace("returns","%returns");//input contains "int var1,char * var2,int var3 %returns char*"
params = input.BeforeFirst('%');
if(params.Contains(wxT("none"))) params.Empty();
input = input.AfterFirst('%');
rtype = input.AfterFirst(' ');
output.Empty();
output<< rtype <<" " << fname << "(" << params <<");"; //output = char* func_name(int var1,char * var2,int var3);
return output;
}
示例15: conv_p_forloop
wxString conv_p_forloop(wxString input)//input = for loop from i=0 until i<5 update i=i+2
{
wxString output,initial,condition,reinitial;
input.Replace("for loop from","for");
initial = input.AfterFirst(' ');
input = initial;//i=0 until i<5 update i=i+2
initial = initial.BeforeFirst(' ');
input = input.AfterFirst(' ');//until i<5 update i=i+2
input = input.AfterFirst(' ');//i<5 update i=i+2
condition = input.BeforeFirst(' ');
input = input.AfterFirst(' ');//update i=i+2
reinitial = input.AfterFirst(' ');
output.Empty();
output<<"for( "<<initial<<" ; "<< condition << " ; "<< reinitial <<" )\n"; //output = for( int i=0 ; i<5 ; i=i+2 )\n
return output;
}