本文整理汇总了C++中CString::SubString方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::SubString方法的具体用法?C++ CString::SubString怎么用?C++ CString::SubString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CString
的用法示例。
在下文中一共展示了CString::SubString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFunctionKeyCount
//-----------------------------------------------------------
//return no of times function key {xx y} will be pressed
//strip out count charcters
int GetFunctionKeyCount(CString &fk)
{
int rv=1;
int numstart=fk.LastDelimiter(" ");
if (numstart!=0 && numstart<fk.GetLength())
{
//extract count
rv=StrToIntDef(fk.SubString(numstart,999),-1);
//valid numeric characters?
if (rv>=0)
{
//strip out count characters
fk=fk.SubString(1,numstart-1);
}
else
{
rv=1;
}
}
return rv;
}
示例2: Parse
void CHttpParameter::Parse(const CString& val)
{
int pos = val.FindFirstOf('=');
//check validity here
if(pos == -1)
{
_name.Clear();
_value.Clear();
return;
}
_name = val.SubString(0,pos);
_value = val.SubString(pos + 1,val.GetLength() - pos - 1);
}
示例3: OnKeyHandler
//.........这里部分代码省略.........
if (rl==0)
return;
//process returned shiftstate
//**************
//changed?
if (KeyState!=CopyOfKeyState)
{
//set key states
SetKeyStates(KeyState);
}
//process keys returned
//***************************
IsSleep=uk.Pos("{SLEEP")==1;
//clear clipboard
IsClearClip=uk.Pos("{EMPTYCLIP")==1;
//run
IsRun=uk.Pos("{RUN ")==1;
//single key(s)?
if (rl<3)
{
PushAString(returned);
}
else
{
if (returned[1]=='{' && returned[rl]=='}')
{
//strip out braces
CString fk=returned.SubString(2,rl-2).UpperCase();
bool IsNL=k=="{NEWLINE}" || uk=="{NL}";
//is it a function key?
if(IsAFunctionKey(fk) && !IsNL)
{
PushFnKey(fk);
}
//CRLF
else if (IsNL)
{
// New line = Carriage return & Line Feed = ^M^J
for (int i=0;i<count;i++)
{
if (DOSKey)//ANSI equivalent
{
PushCTRLKey('M');
PushCTRLKey('J');
}
else
{
UINT ScanKey = MapVirtualKey(VK_RETURN, 0);
PressKey(VK_RETURN,ScanKey);
ScanKey = MapVirtualKey(VK_LINEFEED, 0);
PressKey(VK_LINEFEED,ScanKey);
}
}
}
//direct {\xxxx}
else if(fk.Pos("\\")==1 && fk.GetLength()>1)
{
if (fk.GetLength()>1)