本文整理汇总了C++中Strng类的典型用法代码示例。如果您正苦于以下问题:C++ Strng类的具体用法?C++ Strng怎么用?C++ Strng使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Strng类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildDataDefn
void CEC_FinalConc::BuildDataDefn(DataDefnBlk & DDB)
{
Strng T;
T.Set("Final Conc %s", m_Spc.m_Name());
DDB.Text (T());
DDEF_Flags VFlags=DDB.GetVisibility();
DDB.String("ExtentType", "", DC_, "", xid_RCTExtentType, &Eq, SetOnChange|isParm, DDBExtentTypes);
DDB.SetVisibility(VFlags);
if (m_Spc.m_ReactTerm>=0 || m_Spc.m_ProdTerm>=0)
{
CCnvIndex dc;
pchar pCnvTxt;
SDB.AddSpCnv(DC_Conc, SDB[m_Spc.m_SpcId].SymOrTag(), "g/L", dc, pCnvTxt);
Strng S,C("Rct"),R("Reqd");
if (Valid(m_dRqdTemp))
S.Set("@%.2f", K2C(m_dRqdTemp));
else
S="@FinalT";
C+=S;
R+=S;
m_ddRqdConc.BuildDataDefn(DDB, "Conc_Rqd", "", dc, pCnvTxt, xid_RCTExtent, &Eq, C(), R());
DDB.Double("Conc_MeasTemp", "", DC_T, "C", xid_RCTFinalConcT, &Eq, isResult|noFile|noSnap|InitHidden);
DDB.Double("Conc_EOStep", "Conc_Act", DC_, "", &m_dKEOStep, &Eq, isResult);
DDB.TagComment(S());
DDB.Double("Conc_Final", "", DC_, "", &m_dKFinal, &Eq, isResult|NAN_OK);
DDB.TagComment(S());
DDB.Double("ExtentError", "", DC_Frac, "%", xid_ExtentError, &Eq, isResult|noFile|noSnap|NAN_OK);
}
};
示例2: while
void CCopyTagBlkDlg::BldTreeSelList(HTREEITEM h, char* TagPrefix, int& Cnt, CSVector& List)
{
CString s;
int i;
while (h)
{
BOOL b = m_CopyTree.GetItemSelected(h);
if (b)
{
//rAccNdData d = AW.Data[LOWORD(dw)];
//s = d.sFullTag();
s = m_CopyTree.GetItemText(h);
i = s.Find(" (");
if (i>=0)
s = s.Left(i);
List[Cnt].Set("%s%s", TagPrefix, (const char*)s);
Cnt++;
}
if (m_CopyTree.ItemHasChildren(h))
{
if (!b)
{
s = m_CopyTree.GetItemText(h);
i = s.Find(" (");
if (i>=0)
s = s.Left(i);
}
Strng ss;
ss.Set("%s%s.", TagPrefix, (const char*)s);
BldTreeSelList(m_CopyTree.GetChildItem(h), ss(), Cnt, List);
}
h = m_CopyTree.GetNextSiblingItem(h);
}
}
示例3: Direct
void CEC_FracExt::SetUp()
{
flag OK=m_Spc.SetUp(RB, Eq);
//if (RB.m_RctBase->Nd())
{
if (m_bDoRate && RB.Nd()->SolveDirectMethod())
{
CReactionBlock::Error(&RB, 'B', -1, "Extent:Fraction with 'Rate' not allowed in Direct (no surge) solver mode");
}
else if (m_bDoRate && !RB.UsingStateSemantics())
{
CReactionBlock::Error(&RB, 'B', -1, "'Rate' only allowed in surge unit");
}
else if (!m_bDoRate && RB.Nd()->NetDynamicMethod() && RB.UsingStateSemantics())
{
CReactionBlock::Error(&RB, 'B', -1, "Extent:Fraction requires 'Rate' term in surge unit in dynamic mode");
}
}
if (OK)
{
if (m_Spc.m_ReactTerm<0)
{
Strng S;
S.Set("Fraction specie %s not a Reactant", m_Spc.m_Name());
CReactionBlock::Error(&RB, 'B', -1, S());
}
CEqnSpRef RSpc(m_Spc.m_Name());
OK=RSpc.SetUp(RB, Eq);
// Set Extent Reqd
Eq.SetExtent(RSpc.m_SpcId, m_dRqdExtentLcl);
}
};
示例4: BuildBlockTagsList
void CCopyBlock::BuildBlockTagsList(char* ModelClass, char* BlockName, BOOL FromDatalib, CSVector& List)
{
int Cnt = 0;
List.SetSize(16);
Strng Section;
Section.Set("%s(%s)", BlockName, ModelClass);
char Buff[16384];
CProfINIFile PF(FromDatalib ? CfgFiles() : PrjFiles(), (char*)CopyBlkFileName);
CheckCopyBlockVer(PF);
DWORD dw = PF.RdSection(Section(), Buff, sizeof(Buff));
ASSERT(dw<sizeof(Buff)-2); //section too large!!!
char* p = Buff;
while (p[0])
{
int len = strlen(p);
char* Nextp = p;
Nextp += (len + 1);
char* pp = strchr(p, '=');
if (pp)
{
if (Cnt>=List.GetSize())
List.SetSize(List.GetSize()+8);
pp[0] = 0;
char* pValue = &pp[1];
char* ppp = strchr(p, '.');
if (ppp)
List[Cnt].Set("x%s (%s)", ppp, pValue);
else
List[Cnt].Set("%s (%s)", p, pValue);
Cnt++;
}
p = Nextp;
}
List.SetSize(Cnt);
}
示例5: SetPathName
void DocRoot::SetPathName(LPCTSTR pszPathName, BOOL bAddToMRU/* = TRUE*/)
{
Strng T;
T.FnExt((pchar)pszPathName);
CDocument::SetPathName(pszPathName, (_stricmp(T() ? T():"", ".spj")==0));
CExploreScd::RefreshIt(true);
}
示例6: FindItem
void MRngChkCntxt::AddRngChkMsg(LPCSTR Name, TaggedObject * pSrc, LPCSTR Msg)
{
MRngChkItem * pItem = FindItem(Name, pSrc->FullObjTag());
bool IsNew = pItem->m_Iter != gs_RngChecks.m_Iter;
if (IsNew)
{
pItem->m_iCnv = 0;
pItem->m_IsMsg = true;
pItem->m_LTMin = false;
pItem->m_GTMax = false;
pItem->m_Iter = gs_RngChecks.m_Iter;
pItem->m_sMsg = Msg;
if (m_Iter!=gs_RngChecks.m_Iter)
{
if (m_pObject)
{
m_pObject->ClrCI(1);
for (int i=0; i<m_ValidCount; i++)
m_pObject->ClrCI(FirstRngChkCI+i);
}
m_ValidCount = 1;
}
else
m_ValidCount++;
m_Iter=gs_RngChecks.m_Iter;
if (m_pObject)
{
if (sm_iCndRngChks>=CRC_Basic)
{
m_pObject->SetCI(1);
if (sm_iCndRngChks>=CRC_All)
{
if (IsNew && m_ValidCount<=MaxRngChksPerNode)
{
pItem->FormatDisplay(0);
Strng S;
S.Set("Wr\t %s", pItem->m_sDisplay);
m_pObject->SetCI(FirstRngChkCI+m_ValidCount-1, "%s", S);
}
}
}
}
dbgpln("MRngChkMngr::AddRngChkMsg() %4i %08x %-30s %-20s %-20s %s",
m_Iter, this, pItem->m_Key.m_sCntxt, pItem->m_Key.m_sName, Name, Msg);
}
};
示例7: RemoveBlock
void CCopyBlock::RemoveBlock(char* ModelClass, char* BlockName)
{
Strng s;
s.Set("%s(%s)", BlockName, ModelClass);
char Buff[16];
for (int i=0; i<2; i++)
{
CProfINIFile PF(i==0 ? CfgFiles() : PrjFiles(), (char*)CopyBlkFileName);
if (CheckCopyBlockVer(PF, true) && PF.RdSection(s(), Buff, sizeof(Buff))>0)
{
Buff[0] = 0;
Buff[1] = 0;
PF.WrSection(s(), Buff);
}
}
}
示例8: switch
void C2DPoly::Load(FxdEdtInfo &EI, Strng & Str)
{
if (CurrentBlk(EI))
{
switch (EI.FieldId)
{
case Id_Order: Str.Set("%i", Order); break;
}
}
LoadParmsBlk(EI, Str);
}
示例9: MoveBlockLocation
void CCopyBlock::MoveBlockLocation(char* ModelClass, char* BlockName, BOOL ToDatalib)
{
Strng s;
s.Set("%s(%s)", BlockName, ModelClass);
char Buff1[16];
CProfINIFile SrcPF(ToDatalib ? CfgFiles() : PrjFiles(), (char*)CopyBlkFileName);
if (!CheckCopyBlockVer(SrcPF, true))
return;
if (SrcPF.RdSection(s(), Buff1, sizeof(Buff1))>0)
{
char Buff[16384];
DWORD dw = SrcPF.RdSection(s(), Buff, sizeof(Buff));
ASSERT(dw<sizeof(Buff)-2); //section too large!!!
CProfINIFile DstPF(ToDatalib ? PrjFiles() : CfgFiles(), (char*)CopyBlkFileName);
if (!CheckCopyBlockVer(DstPF, true))
return;
DstPF.WrSection(s(), Buff);
Buff1[0] = 0;
Buff1[1] = 0;
SrcPF.WrSection(s(), Buff1);
}
}
示例10: OpenFile
bool CTokenFileInfo::OpenFile(Strng FnFull)
{
gs_EncryptNDemos.CheckForDemo(NULL);
Strng encFnFull;
encFnFull = FnFull;
encFnFull.Append(".x");
File[iFileIndex] = fopen(encFnFull(), "rt");
if (File[iFileIndex] == NULL)
{ // Encrypted file nonexistent.
m_Buffer[iFileIndex] = NULL;
File[iFileIndex] = fopen(FnFull(), "rt");
if (File[iFileIndex] == NULL)
return False;
}
else
{ // Encrypted file found.
gs_EncryptNDemos.encryptedPGM = true;
DecryptToBuffer(encFnFull);
}
return true;
}
示例11: m_Name
flag CEqnSpRef::SetUp(CReactionBlock & RB, CR_Eqn & Eq)
{
flag OK=1;
if (m_Name.Length()>0)
{
m_SpcId=SDB.Find(m_Name());
if (m_SpcId<0)
{
CReactionBlock::Error(&RB, 'B', 3, m_Name());
OK=0;
}
m_ProdTerm=Eq.SpecieProductIndex(m_Name);
m_ReactTerm=Eq.SpecieReactantIndex(m_Name);
if (m_ProdTerm<0 && m_ReactTerm<0)
{
Strng S;
S.Set("%s not in this Reaction", m_Name());
CReactionBlock::Error(&RB, 'B', -1, S());
OK=0;
}
return True;
}
return False;
};
示例12: GetTagList
int CGrfDoc::DeleteTags(bool WithPrompts)
{
Strng_List MyTags;
GetTagList(MyTags);
int nTags=MyTags.Length();
int nTagsMultPgs=0;
if (nTags>0)
{
CMap<LPTSTR, LPTSTR, Strng*, Strng*> MyTagMap;
MyTagMap.InitHashTable(FindNextPrimeNumber(MyTags.Length()));
for (Strng *pTag=MyTags.First(); pTag; pTag=MyTags.Next())
{
pTag->SetIndex(0);
MyTagMap.SetAt(pTag->Str(), pTag);
}
for (int iTmpl=iGraphTemplate; iTmpl<=iVisioTemplate; iTmpl++)
{
if (ScdApp()->TemplateExists(iTmpl))
{
POSITION Pos = ScdApp()->Template(iTmpl).GetFirstDocPosition();
while (Pos)
{
CGrfDoc* pOtherDoc = (CGrfDoc*)(ScdApp()->Template(iTmpl).GetNextDoc(Pos));
if (pOtherDoc!=this)
{
Strng *pTag;
Strng_List OtherTags;
int NGrfTags = pOtherDoc->GetTagList(OtherTags);
for (Strng *pOtherTag=OtherTags.First(); pOtherTag; pOtherTag=OtherTags.Next())
if (MyTagMap.Lookup(pOtherTag->Str(), pTag))
pTag->SetIndex(pTag->Index()+1);
}
}
}
}
for (Strng *pTag=MyTags.First(); pTag; pTag=MyTags.Next())
{
if (pTag->Index()>0)
nTagsMultPgs++;
}
int Ret=IDYES;
if (WithPrompts)
{
CString S;
if (nTagsMultPgs)
S.Format("Do you want Delete %i Units (%i Units have Multiple References)", nTags-nTagsMultPgs, nTagsMultPgs);
else
S.Format("Do you want Delete %i Units", nTags);
Ret=AfxMessageBox(S, MB_ICONQUESTION|MB_YESNOCANCEL);
}
if (Ret==IDCANCEL)
return -1;
if (Ret==IDYES)
{
Strng_List DelTags;
int nMdlDeletes=0;
int nDeletesFailedCnt=0;
for (Strng *pTag=MyTags.First(); pTag; pTag=MyTags.Next())
{
if (pTag->Index()==0)
{
DelTags.Append(pTag->Str());
}
}
int RetCode = gs_Exec.DeleteTags(DelTags);
for (Strng *pTag=DelTags.First(); pTag; pTag=MyTags.Next())
{
if (pTag->Index()!=EODT_DONE)
{
//dbgpln("Mdl Not Deleted %s", pTag->Str());
LogError(pTag->Str(), 0, "Model not deleted");
nDeletesFailedCnt++;
}
else
{
//dbgpln("Mdl Deleted %s", pTag->Str());
nMdlDeletes++;
}
}
if (nDeletesFailedCnt)
{
CString S;
S.Format("%i Units Failed to Delete", nDeletesFailedCnt);
AfxMessageBox(S, MB_ICONEXCLAMATION|MB_OK);
}
}
}
return nTags;
};
示例13: TestSymbolNameUnique
flag GrfComCmdBlk::TestSymbolNameUnique(Strng &Sym, CUniqueTagRulesBlk & TRB/*pchar pHdr, char SepChar*/, Strng &UniqueSym)
{
UniqueSym.Set("%s%c?",TRB.BaseTag(),TRB.SepChar());
return False;
};
示例14: sprintf
void CActuator::BuildDataDefn(DataDefnBlk & DDB)
{
DDB.BeginStruct(this, "CActuator", NULL, DDB_NoPage);
DDB.Text("");
DDB.CheckBoxBtn("On", "", DC_, "", &bOn, this, isParmStopped, DDBYesNo);
DDB.CheckBoxBtn("ShowCnv", "", DC_, "", &bWithCnvComment,this, isParmStopped, DDBYesNo);
DDB.Visibility();
DDB.Long("", "Ac_Cnt", DC_, "", idmCount, this, isParmStopped/*|AffectsStruct*/);
DDB.Text("");
if (m_DataBlk.GetSize()>0)
{
DDB.Button("Check_tags", "", DC_, "", idmCheckBtn, this, isParmStopped);
DDB.Text("");
DDB.String("State", "", DC_, "", &m_StateLine[0], this, noSnap|noFile);
DDB.Text("Error:");
DDB.String("Msg_1", "", DC_, "", &m_StateLine[1], this, noSnap|noFile);
DDB.String("Msg_2", "", DC_, "", &m_StateLine[2], this, noSnap|noFile);
DDB.Text("");
}
DDB.Text("----------------------------------------");
static DDBValueLst DDBFail[]={
{Fail_None, "None" },
{Fail_Hold, "Hold" },
{Fail_Hold|Fail_Noise, "Hold,Noise" },
{Fail_MinVal, "MinVal" },
{Fail_MaxVal, "MaxVal" },
{Fail_LoVal, "LoVal" },
{Fail_HiVal, "HiVal" },
{Fail_MinVal|Fail_Ramp, "MinVal,Ramp" },
{Fail_MaxVal|Fail_Ramp, "MaxVal,Ramp" },
{Fail_LoVal|Fail_Ramp, "LoVal,Ramp" },
{Fail_HiVal|Fail_Ramp, "HiVal,Ramp" },
{Fail_MinVal|Fail_Noise, "MinVal,Noise" },
{Fail_MaxVal|Fail_Noise, "MaxVal,Noise" },
{Fail_LoVal|Fail_Noise, "LoVal,Noise" },
{Fail_HiVal|Fail_Noise, "HiVal,Noise" },
{Fail_MinVal|Fail_Ramp|Fail_Noise, "MinVal,Ramp,Noise"},
{Fail_MaxVal|Fail_Ramp|Fail_Noise, "MaxVal,Ramp,Noise"},
{Fail_LoVal|Fail_Ramp|Fail_Noise, "LoVal,Ramp,Noise" },
{Fail_HiVal|Fail_Ramp|Fail_Noise, "HiVal,Ramp,Noise" },
{0}};
static DDBValueLst DDBXForms[]={
{XF_None, "None" },
{XF_Linear, "Linear" },
//{XF_Sqr, "Sqr" },
//{XF_Sqrt, "Sqrt" },
{0}};
static DDBValueLst DDBFilters[]={
{Flt_None, "None" },
{Flt_FirstOrder, "FirstOrder" },
{0}};
static DDBValueLst DDBRawXLates[]={
{XL_None, "None" },
{XL_AtoD, "AtoD" },
{XL_Linear, "Linear" },
//{XL_PulseEncode "PulseWidth" },
{0}};
char Buff[128];
Strng Tag;
if (DDB.BeginArray(this, "Cfg", "Ac_Cfg", m_DataBlk.GetSize()))
{
for (int i=0; i<m_DataBlk.GetSize(); i++)
{
if (1)// i>0 && (i % 2)==1)
{
sprintf(Buff, "%d", i);
DDB.Page(Buff, DDB_OptPage);
}
DDB.BeginElement(this, i);
CActuatorBlk * T = m_DataBlk[i];
Strng CnvTxt;
if (bWithCnvComment && XRefsValid() && T->m_bValid)
GetValidCnvTxt(T->m_OutputVar, CnvTxt);
DDB.String("ID", "", DC_, "", idmCfgTags+(i*NoOfCfgTags)+1, this, isParmStopped|isTag);
DDB.String("OutputTag", "", DC_, "", idmCfgTags+(i*NoOfCfgTags)+2, this, isParmStopped|isTag);
//DDB.Double("RequiredValue", "ReqdVal", DC_, "", &T->m_dReqdValue, this, isResult|noFileAtAll);
DDB.Double("RequiredValue", "Rqd", DC_, "", &T->m_dReqdValue, this, isResult|noFileAtAll);
if (CnvTxt.Len())
DDB.TagComment(CnvTxt());
// DDB.Byte ("Transform", "", DC_, "", &T->m_Xform.m_iType, this, isParm|SetOnChange, DDBXForms);
// DDB.Visibility(NSHM_All, T->m_Xform.m_iType);
// DDB.Float ("Xf.Factor", "", DC_, "", &T->m_Xform.m_dFactor, this, isParm);
// DDB.Float ("Xf.Bias", "", DC_, "", &T->m_Xform.m_dBias, this, isParm);
//
// DDB.Visibility();
//
// DDB.Byte ("Filter", "", DC_, "", &T->m_Flt.m_iType, this, isParm|SetOnChange, DDBFilters);
// DDB.Visibility(NSHM_All, T->m_Flt.m_iType == Flt_FirstOrder);
// DDB.Float ("Flt.TimeConst", "Flt.Tau", DC_Time, "s", &T->m_Flt.m_dTau, this, isParm);
// DDB.Double("Flt.PrevValue", "", DC_, "", &T->m_Flt.m_dPrevValue, this, InitHidden);
// DDB.Visibility();
//
// DDB.Byte ("Fail.Mode", "", DC_, "", &T->m_Fail.m_iType, this, isParm|SetOnChange, DDBFail);
// DDB.Float ("Fail.LoValue", "", DC_, "", &T->m_Fail.m_dLoValue, this, isParm);
// DDB.Float ("Fail.HiValue", "", DC_, "", &T->m_Fail.m_dHiValue, this, isParm);
// DDB.Float ("Fail.NoiseStdDev", "", DC_, "%", &T->m_Fail.m_dNoiseStdDevFrac, this, isParm);
// DDB.Float ("Fail.SlewTime", "", DC_Time, "s", &T->m_Fail.m_dSlewTime, this, isParm);
//
//.........这里部分代码省略.........
示例15: Parse
long CSlotConnPrf::Parse(LPCSTR File)
{
if (!FileExists((LPTSTR)File))
return 1;
//m_sTag.FnName((LPTSTR)File);
m_bYReversed=false;
long RetCode=0;
Strng Ext;
Ext.FnExt((LPTSTR)File);
if (Ext.XStrICmp(".txt")==0 || Ext.XStrICmp(".csv")==0)
{
FILE *h=fopen(File, "rt");
if (h)
{
char Buff[4096];
CSVColArray c;
int Quote;
int nFlds = 0;
Buff[0]=0;
while (strlen(Buff)==0 && fgets(Buff, sizeof(Buff), h))
XStrLTrim(Buff, " \t\n");
nFlds = ParseCSVTokens(Buff, c, Quote);
if (nFlds>0)
{
if (_stricmp(Buff, "ABS")==0)
m_Mode=eABS;
else if (_stricmp(Buff, "SCL")==0)
m_Mode=eSCL;
else if (_stricmp(Buff, "SCL%")==0)
m_Mode=eSCLPERC;
else if (_stricmp(Buff, "CONTRONIC")==0)
m_Mode=eCONTRONIC;
else
{
return 4;
goto Leave;
}
if (m_Mode==eCONTRONIC)
{
while (fgets(Buff, sizeof(Buff), h))
{
int nFlds = ParseTokenList(Buff, c, "=:");
if (nFlds>=3)
{
CSlotConnPrfPt Pt;
Pt.X=(float)SafeAtoF(c[1]);
Pt.Y=(float)SafeAtoF(c[2]);
m_Points.Add(Pt);
}
else if (m_Points.GetSize()>0)
break;
}
}
else
{
while (fgets(Buff, sizeof(Buff), h))
{
int nFlds = ParseCSVTokens(Buff, c, Quote);
if (nFlds>=2)
{
CSlotConnPrfPt Pt;
Pt.X=(float)SafeAtoF(c[0]);
Pt.Y=(float)SafeAtoF(c[1]);
m_Points.Add(Pt);
}
else if (m_Points.GetSize()>0)
break;
}
}
if (m_Points.GetSize()<2)
{
RetCode=5;
goto Leave;
}
m_bYReversed=m_Points[0].Y> m_Points[m_Points.GetUpperBound()].Y;
fclose(h);
}
else
RetCode=4;
}
else
RetCode=2;
Leave:
if (h)
fclose(h);
return RetCode;
}
else
return 3;
};