本文整理汇总了C++中StrPtr::Atoi方法的典型用法代码示例。如果您正苦于以下问题:C++ StrPtr::Atoi方法的具体用法?C++ StrPtr::Atoi怎么用?C++ StrPtr::Atoi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StrPtr
的用法示例。
在下文中一共展示了StrPtr::Atoi方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OutputStat
void SubmitCommand::OutputStat( StrDict* dict )
{
if ( m_Changeset == NULL )
{
return;
}
StrPtr* submittedChange = dict->GetVar( g_SubmittedChangeTag );
if ( submittedChange )
{
m_Changeset->m_Id = submittedChange->Atoi();
}
uint32_t numFiles = 0;
StrPtr* openFiles = dict->GetVar( g_OpenFilesTag );
if ( openFiles )
{
numFiles = openFiles->Atoi();
}
for( uint32_t i = 0; i < numFiles; ++i )
{
RCS::FilePtr file = new RCS::File();
StrPtr* depotFile = dict->GetVar( g_DepotFileTag, i );
if ( depotFile )
{
bool converted = Helium::ConvertString( depotFile->Text(), file->m_DepotPath );
HELIUM_ASSERT( converted );
}
StrPtr* revision = dict->GetVar( g_RevisionTag );
if ( revision )
{
file->m_LocalRevision = revision->Atoi();
}
StrPtr* action = dict->GetVar( g_ActionTag );
if ( action )
{
tstring actionString;
bool converted = Helium::ConvertString( action->Text(), actionString );
HELIUM_ASSERT( converted );
file->m_Operation = GetOperationEnum( actionString );
}
}
}
示例2: SetCmdRun
void P4ClientAPI::RunCmd( const char *cmd, ClientUser *ui, int argc, char * const *argv )
{
// #if P4APIVER_ID >= 513026
// ClientApi::SetProg() was introduced in 2004.2
client.SetProg( &prog );
// #endif
// #if P4APIVER_ID >= 513282
// ClientApi::SetVersion() was introduced in 2005.2
if( version.Length() )
client.SetVersion( &version );
// #endif
if( IsTag() )
client.SetVar( "tag" );
if( IsStreamsMode() && apiLevel >= 70 )
client.SetVar( "enableStreams" );
// If maxresults or maxscanrows is set, enforce them now
if( maxResults ) client.SetVar( "maxResults", maxResults );
if( maxScanRows ) client.SetVar( "maxScanRows", maxScanRows );
if( maxLockTime ) client.SetVar( "maxLockTime", maxLockTime );
// client.SetBreak( &cb );
client.SetArgv( argc, argv );
client.Run( cmd, ui );
// Have to request server2 protocol *after* a command has been run. I
// don't know why, but that's the way it is.
if ( ! IsCmdRun() )
{
StrPtr *pv = client.GetProtocol( "server2" );
if ( pv )
server2 = pv->Atoi();
pv = client.GetProtocol( P4Tag::v_nocase );
if ( pv )
SetCaseFold();
pv = client.GetProtocol( P4Tag::v_unicode );
if ( pv && pv->Atoi() )
SetUnicode();
}
SetCmdRun();
}
示例3:
//
// RunCmd is a private function to work around an obscure protocol
// bug in 2000.[12] servers. Running a "p4 -Ztag client -o" messes up the
// protocol so if they're running this command then we disconnect and
// reconnect to refresh it. For efficiency, we only do this if the
// server2 protocol is either 9 or 10 as other versions aren't affected.
//
void
P4ClientApi::RunCmd( const char *cmd, ClientUser *ui, int argc, char * const *argv, int table )
{
client.SetProg( &prog );
if( version.Length() )
client.SetVersion( &version );
if( mode & M_TAGGED )
client.SetVar( "tag" );
// If maxresults or maxscanrows is set, enforce them now
if( maxResults ) client.SetVar( "maxResults", maxResults );
if( maxScanRows ) client.SetVar( "maxScanRows", maxScanRows );
if( maxLockTime ) client.SetVar( "maxLockTime", maxLockTime );
client.SetBreak( &cb );
client.SetArgv( argc, argv );
client.Run( cmd, ui );
// Have to request server2 protocol *after* a command has been run. I
// don't know why, but that's the way it is.
if ( ! server2 )
{
StrPtr *pv = client.GetProtocol( "server2" );
if ( pv )
server2 = pv->Atoi();
}
if ( IS_TAGGED(mode) && StrRef( cmd ) == "client" &&
server2 >= 9 && server2 <= 10 )
{
if ( argc && ( StrRef( argv[ 0 ] ) == "-o" ) )
{
if ( P4LUADEBUG_COMMANDS )
printf( "Resetting client to avoid 2000.[12] protocol bug\n" );
Error e;
client.Final( &e );
client.Init( &e );
// Pass any errors down to the UI, so they'll get picked up.
if ( e.Test() )
ui->HandleError( &e );
}
}
}