本文整理汇总了C++中IString类的典型用法代码示例。如果您正苦于以下问题:C++ IString类的具体用法?C++ IString怎么用?C++ IString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: verifyAndSave
//*****************************************************************************
// CLASS GeneralPage :: verifyAndSave() - save database info
//*****************************************************************************
IBase :: Boolean GeneralPage :: verifyAndSave( IString& theString,
IString& theEntry,
const IString theName )
{
/* verify data for correctness */
if ((theName.length() == 0) && (employeeId.text().length() == 0 ))
return true;
// save person information
if ((theName.length() == 0 ) && (theName.isAlphanumeric()))
Key = employeeId.text();
else
Key = theName;
// prime the page from data area
setEmployeeData();
//-------------------------------------------------------------------------
// Save the query
// The key is either what was passed in or the employee number
//-------------------------------------------------------------------------
if (theName.length()>0)
employeeData.save(theName);
else
if ( (!isAquery) &&
(Key.length()> 0 ))
employeeData.save(Key);
return true;
}
示例2: isLike
bool IString::isLike(IString s){
IString _localpattern = "*?";
IString::iterator _lcstrIterator;
IString::iterator _lcptrIterator;
int _strIndex = 0;
_lcstrIterator = this->begin();
_lcptrIterator = s.begin();
while ( _lcptrIterator != s.end() && _lcstrIterator != this->end() ) {
if ( *_lcptrIterator == '*' ) {
if ( *_lcstrIterator == *(_lcptrIterator+1) ) {
_lcptrIterator++;
_lcptrIterator++;
_lcstrIterator++;
} else _lcstrIterator++;
}
if ( *_lcptrIterator == '?' ) {
_lcptrIterator++;
_lcstrIterator++;
}
if ( *_lcptrIterator != '*' && *_lcptrIterator != '?' ) {
if ( *_lcptrIterator != *_lcstrIterator )return false;
_lcptrIterator++;
_lcstrIterator++;
}
}
return true;
}
示例3: SendLightsInfo
void IShaderManager::SendLightsInfo()
{
return;
IString str;
//printf("light count %d\n",ILight::m_aLights.Count());
for (unsigned int i=0; i<m_pShaderList.Count(); i++)
{
if (m_pShaderList[i] && m_pShaderList[i]->IsCompiled())
{
//m_pShaderList[i]->UseShader();
int ok = m_pShaderList[i]->SetParameterInt("m_nLightsCount",ILight::m_aLights.Count());
//printf("Send light count %d\n",ok);
if (ok)
for (unsigned int j=0; j<ILight::m_aLights.Count(); j++)
{
//Send color
str.Printf("m_v3LightsColor[%d]",j);
ok=m_pShaderList[i]->SetParameter3Float(str,ILight::m_aLights[j]->m_cColor);
//Send position
str.Printf("m_v3LightsPos[%d]",j);
ok=m_pShaderList[i]->SetParameter3Float(str,ILight::m_aLights[j]->m_vPosition);
//Send radius
str.Printf("m_fLightsRadius[%d]",j);
ok=m_pShaderList[i]->SetParameterFloat(str,ILight::m_aLights[j]->m_fRadius);
}
}
}
}
示例4: if
void CAndorSDK3Camera::PerformReleaseVersionCheck()
{
//Release 2 / 2.1 checks
try
{
IString * firmwareVersion = cameraDevice->GetString(L"FirmwareVersion");
if (firmwareVersion && firmwareVersion->IsImplemented())
{
wstring ws = firmwareVersion->Get();
if (ws == g_RELEASE_2_0_FIRMWARE_VERSION)
{
LogMessage("Warning: Release 2.0 Camera firmware detected! Please upgrade your camera to Release 3");
}
else if (ws == g_RELEASE_2_1_FIRMWARE_VERSION)
{
LogMessage("Warning: Release 2.1 Camera firmware detected! Please upgrade your camera to Release 3");
}
}
cameraDevice->Release(firmwareVersion);
}
catch (NotImplementedException & e)
{
LogMessage(e.what());
}
}
示例5: verifyAndSave
/******************************************************************************
* Class AccountPage :: verifyAndSave - Save page information to the database *
******************************************************************************/
bool AccountPage::verifyAndSave( IString& theString,
IString& theEntry,
const IString saveName )
{
/*-----------------------------------------------------------------------------
| If there is no data or is a query, return. |
-----------------------------------------------------------------------------*/
if ( ( ! saveName.length() )
&& ( ! Key.length() )
|| isAquery )
return true;
/*-----------------------------------------------------------------------------
| If able to retrieve the container information, |
| save the information to the database based on the key or query name. |
-----------------------------------------------------------------------------*/
if ( setAcctData() )
{
if ( ( saveName.length() > 0 ) && ( saveName.isAlphanumeric() ) )
acctData.save( saveName );
else
if ( ( Key.length() > 0 ) && ( Key.isAlphanumeric() ) )
acctData.save( Key );
}
return true;
};
示例6: inRange
// -------------------------------------------------------------------------
// QueryInfo Class :: inRange() - match check having a range
// -------------------------------------------------------------------------
IBase :: Boolean QueryInfo :: inRange(const IString &c1
,const IString &c2
,const IString &range)
{
if (c2.length() == 0)
return false;
IString matchItem, compareItem;
matchItem = chopOff(c1);
compareItem = chopOff(c2);
if ( (c1.isDigits()) && (c2.isDigits()) ) {
// compare 2 numbers
long d1=c1.asInt();
long d2=c2.asInt();
return compareIt(d1, d2, range);
}
else {
ADate *date1 = new ADate(c1);
ADate *date2 = new ADate(c2);
return compareIt(date1, date2, range);
} /* endif */
};
示例7: vertical
/*
* v e r t i c a l
*
* show select results in vertical direction
*/
static void vertical(KSqlCursor *csr, int cols)
{
int pcnt = 0;
while (csr->fetch()) {
log("");
if (pausechk(pcnt)) break;
for (int col = 0; col < cols; col++) {
ostrstream* out = new ostrstream();
*out << setiosflags(ios::left) << setw(20) << setfill('.')
<< csr->selectColumnName(col)
<< setiosflags(0) << setw(0) << setfill(' ') << ": ";
int width = dispWidth(csr,col);
int scale = csr->selectColumnScale(col);
if (scale>=0) {
out->setf(ios::fixed);
out->precision(scale);
} //
if (numeric(csr,col)) {
double val;
*csr >> val;
*out << val;
} else {
IString val;
*csr >> val;
*out << val.subString(1,width).strip() << setiosflags(0);
} /* endif */
char* ss = out->str();
ss[out->pcount()] = 0;
log(ss);
delete ss;
delete out;
if (pausechk(pcnt)) return;
} // for
} // while
示例8: chopOff
// -------------------------------------------------------------------------
// QueryInfo Class :: chopOff() - ignore decimal points
// -------------------------------------------------------------------------
IString QueryInfo :: chopOff( const IString& c2) {
unsigned i = c2.indexOf(".");
if (i > 0)
return (c2.subString(1, i-1));
return c2;
};
示例9: compareIt
// -------------------------------------------------------------------------
// QueryInfo Class :: compareItData() - compare integers for a match
// -------------------------------------------------------------------------
IBase :: Boolean QueryInfo :: compareIt( const long d1
,const long d2
,const IString& range)
{
Boolean retCode = false;
// now compare the date or integer
if (d1 == d2 )
if (range.indexOfAnyOf("="))
retCode=true;
else
retCode=false;
else
if (d2 > d1 )
if (range.indexOfAnyOf(">"))
retCode=true;
else
retCode=false;
else
if (d2 < d1 )
if (range.indexOfAnyOf("<"))
retCode=true;
else
retCode=false;
return retCode;
};
示例10: setMovieWindowHandle
void setMovieWindowHandle(IWindowHandle movieWindowHandle)
{
if (movieWindowHandle)
{
IString unqualifiedFileName = movieFrame->quickFlick->fileName();
unsigned long lastDelimiterIndex = unqualifiedFileName.lastIndexOf('\\');
unqualifiedFileName = unqualifiedFileName.subString(lastDelimiterIndex + 1, unqualifiedFileName.length() - lastDelimiterIndex);
movieFrame->title.setObjectText("QuickFlick");
movieFrame->title.setViewText(unqualifiedFileName);
movieFrame->addToWindowList();
movieFrame->movieWindow = IWindow::windowWithHandle(movieWindowHandle);
IDMHandler::enableDropOn(movieFrame->movieWindow);
movieFrame->movieWindow->setItemProvider(movieFrame);
}
if (movieFrame->quickFlick->logoWindowHandle())
{
movieFrame->logo = IWindow::windowWithHandle(movieFrame->quickFlick->logoWindowHandle());
IDMHandler::enableDropOn(movieFrame->logo);
movieFrame->logo->setItemProvider(movieFrame);
}
if (movieWindowHandle && QuickFlick::nonEmbeddedDisplay() == QF_NONEMBED_TOFIT)
movieFrame->reset();
else
movieFrame->showWindow();
}
示例11: ItemToButton
void LumosGame::ItemToButton( const GameItem* item, gamui::Button* button )
{
CStr<64> text;
// Set the text to the proper name, if we have it.
// Then an icon for what it is, and a check
// mark if the object is in use.
int value = item->GetValue();
const char* name = item->ProperName() ? item->ProperName() : item->Name();
if ( value ) {
text.Format( "%s\n%d", name, value );
}
else {
text.Format( "%s\n ", name );
}
button->SetText( text.c_str() );
IString decoName = item->keyValues.GetIString( "uiIcon" );
RenderAtom atom = LumosGame::CalcUIIconAtom( decoName.c_str(), true );
atom.renderState = (const void*) UIRenderer::RENDERSTATE_UI_DECO_DISABLED;
RenderAtom atomD = LumosGame::CalcUIIconAtom( decoName.c_str(), false );
atomD.renderState = (const void*) UIRenderer::RENDERSTATE_UI_DECO_DISABLED;
button->SetDeco( atom, atomD );
}
示例12: words
IString IString::words(int _firstWord, int _numWords ) {
IString returnString;
for ( int index = _firstWord; index < _numWords; index++ ) {
returnString.append(this->word(index));
}
return returnString;
}
示例13: WinLoadFileIcon
Verzeichnis::Verzeichnis (IString const &n)
{
Path = n;
IString name = n;
HPOINTER p = WinLoadFileIcon (n, FALSE);
if ( p )
setIcon (IPointerHandle (p));
else
setIcon (ISystemPointerHandle (ISystemPointerHandle::folder));
setIconText (name.remove (1, Path.lastIndexOf ('\\')));
}
示例14: Citizens
int CoreScript::DoTick(U32 delta)
{
int nScoreTicks = scoreTicker.Delta(delta);
int nAITicks = aiTicker.Delta(delta);
Citizens(0); // if someone was deleted, the spawn tick will reset.
int nSpawnTicks = spawnTick.Delta(delta);
// Clean rock off the core.
Vector2I pos2i = ToWorld2I(parentChit->Position());
const WorldGrid& wg = Context()->worldMap->GetWorldGrid(pos2i);
if (wg.RockHeight()) {
Context()->worldMap->SetRock(pos2i.x, pos2i.y, 0, false, 0);
}
if (InUse()) {
DoTickInUse(delta, nSpawnTicks);
UpdateScore(nScoreTicks);
}
else {
DoTickNeutral(delta, nSpawnTicks);
}
workQueue->DoTick();
if (nAITicks) {
UpdateAI();
}
for (int i = 0; i < MAX_SQUADS; ++i) {
if (squads[i].Empty()) {
waypoints[i].Clear();
}
}
if (strategicTicker.Delta(delta)) {
if (this->InUse() && Context()->chitBag->GetHomeCore() != this) {
DoStrategicTick();
}
}
RenderComponent* rc = parentChit->GetRenderComponent();
if (rc) {
int team = parentChit->Team();
CStr<40> str = "";
if (this->InUse() && Team::IsDenizen(team)) {
IString teamName = Team::Instance()->TeamName(team);
str.Format("%s", teamName.safe_str());
}
rc->SetDecoText(str.safe_str());
}
return Min(spawnTick.Next(), aiTicker.Next(), scoreTicker.Next());
}
示例15: Context
Chit* LumosChitBag::NewDenizen( const grinliz::Vector2I& pos, int team )
{
const ChitContext* context = Context();
IString itemName;
switch (Team::Group(team)) {
case TEAM_HOUSE: itemName = (random.Bit()) ? ISC::humanFemale : ISC::humanMale; break;
case TEAM_GOB: itemName = ISC::gobman; break;
case TEAM_KAMAKIRI: itemName = ISC::kamakiri; break;
default: GLASSERT(0); break;
}
Chit* chit = NewChit();
const GameItem& root = ItemDefDB::Instance()->Get(itemName.safe_str());
chit->Add( new RenderComponent(root.ResourceName()));
chit->Add( new PathMoveComponent());
const char* altName = 0;
if (Team::Group(team) == TEAM_HOUSE) {
altName = "human";
}
AddItem(root.Name(), chit, context->engine, team, 0, 0, altName);
ReserveBank::Instance()->WithdrawDenizen(chit->GetWallet());
chit->GetItem()->GetTraitsMutable()->Roll( random.Rand() );
chit->GetItem()->GetPersonalityMutable()->Roll( random.Rand(), &chit->GetItem()->Traits() );
chit->GetItem()->FullHeal();
IString nameGen = chit->GetItem()->keyValues.GetIString( "nameGen" );
if ( !nameGen.empty() ) {
LumosChitBag* chitBag = chit->Context()->chitBag;
if ( chitBag ) {
chit->GetItem()->SetProperName(chitBag->NameGen(nameGen.c_str(), chit->ID()));
}
}
AIComponent* ai = new AIComponent();
chit->Add( ai );
chit->Add( new HealthComponent());
chit->SetPosition( (float)pos.x+0.5f, 0, (float)pos.y+0.5f );
chit->GetItem()->SetSignificant(GetNewsHistory(), ToWorld2F(pos), NewsEvent::DENIZEN_CREATED, NewsEvent::DENIZEN_KILLED, 0);
if (XenoAudio::Instance()) {
Vector3F pos3 = ToWorld3F(pos);
XenoAudio::Instance()->PlayVariation(ISC::rezWAV, random.Rand(), &pos3);
}
return chit;
}