本文整理汇总了C++中Strng::XStrICmp方法的典型用法代码示例。如果您正苦于以下问题:C++ Strng::XStrICmp方法的具体用法?C++ Strng::XStrICmp怎么用?C++ Strng::XStrICmp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Strng
的用法示例。
在下文中一共展示了Strng::XStrICmp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
};