本文整理汇总了C++中CStr::Right方法的典型用法代码示例。如果您正苦于以下问题:C++ CStr::Right方法的具体用法?C++ CStr::Right怎么用?C++ CStr::Right使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStr
的用法示例。
在下文中一共展示了CStr::Right方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetProjectIcon
// -----------------------------------------------------------------------
// Change the icon associated with the project
void SetProjectIcon(void)
{
CStr LdFile;
CStr OpFilters;
CStr IconDir;
OpFilters = "Icon files (*.ico)|*.ico";
LdFile = ComDlgGetOpenFileName(FRMPrjPropshWnd, OpFilters, LastPrjIconDir, 0, CurrentDir);
if(LdFile.Len() == 0) return;
IconDir = FileGetDirectory(LdFile);
if(strcmp(IconDir.Right(1).Get_String(), "\\") == 0) IconDir = IconDir.Left(IconDir.Len() - 1);
LastPrjIconDir = IconDir;
NewIconFile = LdFile;
PictureBoxChangeIcon(FRMPrjPropsIcon, (HICON) LoadImage(0, LdFile.Get_String(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE));
}
示例2: CMapStrToString
void
CIniFile::Parse( LPCTSTR cont )
{
CStr content = cont;
CStr sectionName, key, value;
CMapStrToString *section = NULL;
BOOL hasEmptySection = FALSE;
Sections.RemoveAll();
while ( content.GetLength() > 0 )
{
CStr line;
int pos = content.Find( _T("\n") );
if ( pos != -1 )
{
line = content.Left( pos );
content = content.Mid( pos+1 );
}
else
{
line = content;
content = _T("");
}
line.TrimLeft(); line.TrimRight();
if ( line.GetLength() > 0 && line.GetAt(0) != '#' && line.GetAt(0) != ';' )
{
if ( line.GetAt(0) == '[' && line.Right(1) == L"]" )
{
sectionName = line.Mid( 1, line.GetLength()-2 );
sectionName.MakeLower();
section = new CMapStrToString();
Sections.SetAt( sectionName, section );
}
else
{
int eqPos = line.Find( '=' );
if ( eqPos != -1 )
{
key = line.Left( eqPos );
key.TrimLeft(); key.TrimRight();
value = line.Mid( eqPos+1 );
value.TrimLeft(); value.TrimRight();
if ( value.Left(1) == L"\"" && value.Right(1) == L"\"" )
{
value = value.Mid( 1, value.GetLength()-2 );
}
key.MakeLower();
if ( section == NULL && hasEmptySection == FALSE )
{
section = new CMapStrToString();
Sections.SetAt( L"", section );
hasEmptySection = TRUE;
}
section->SetAt( key, value );
}
}
}
}
}
示例3: DisplayAPI
// -----------------------------------------------------------------------
// Display an API function
// (for API name displaying purposes)
CStr DisplayAPI(long dx, long dy)
{
CStr ReturnValue;
CStr StArgs;
CStr FirstSplit;
CStr SecondSplit;
int i = 0;
int j = 0;
long FoundLibLen = 0;
CStr BufString;
APIX = 0;
APIY = 0;
APIDescription = GetApiDescription(APIFile.Get_String(), APIFnc.Get_String());
if(APIDescription != 0)
{
FoundLibLen = strlen(APIDescription);
APIFuckStr = APIFuckStr.String(FoundLibLen + 1, 1);
RtlCopyMemory(APIFuckStr.Get_String(), (void *) APIDescription, FoundLibLen);
APIBlock = StringSplit(APIFuckStr, "^^");
APIFound = 0;
if(StringGetSplitUBound(APIBlock) != -1)
{
for(i = 0; i <= StringGetSplitUBound(APIBlock); i++)
{
FirstSplit = StringGetSplitElement(APIFuckStr, APIBlock, i);
APIInfos = StringSplit(FirstSplit, "|");
if(_strcmpi(APIFnc.Get_String(), StringGetSplitElement(FirstSplit, APIInfos, 0).Upper_Case().Get_String()) == 0)
{
APIFound = 1;
break;
}
// Not found: release it
StringReleaseSplit(APIInfos);
APIInfos = 0;
}
StringReleaseSplit(APIBlock);
if(APIFound == 1)
{
// Firstsplit = last found entry
SecondSplit = StringGetSplitElement(FirstSplit, APIInfos, 3);
APIArgs = StringSplit(SecondSplit, ",");
if(StringGetSplitUBound(APIArgs) == 0) if(strcmp(StringGetSplitElement(SecondSplit, APIArgs, 0).Get_String(), "-") == 0) goto NoArgs;
for(i = 0; i <= StringGetSplitUBound(APIArgs); i++)
{
if(i == 2) break;
StArgs = StArgs + (CStr) StringGetSplitElement(SecondSplit, APIArgs, i).Get_String() + (CStr) ",";
}
StArgs = StArgs + "\r\n";
while(i <= StringGetSplitUBound(APIArgs))
{
for(j = 0; j <= StringGetSplitUBound(APIArgs); j++)
{
if(j == 2) break;
if((i + j) > StringGetSplitUBound(APIArgs)) break;
StArgs = StArgs + StringGetSplitElement(SecondSplit, APIArgs, i + j).Get_String() + (CStr) ",";
}
i = j + i;
StArgs = StArgs + "\r\n";
}
if(strcmp(StArgs.Right(3).Get_String(), ",\r\n") == 0) StArgs = StArgs.Left(StArgs.Len() - 3).Get_String() + (CStr) "\r\n";
NoArgs:
APIString = "Function: " + (CStr) StringGetSplitElement(FirstSplit, APIInfos, 0).Get_String() + (CStr) "\r\n";
APIString = APIString + "Import lib: " + (CStr) StringGetSplitElement(FirstSplit, APIInfos, 1).Get_String() + (CStr) "\r\n";
APIString = APIString + "Return: " + (CStr) StringGetSplitElement(FirstSplit, APIInfos, 2).Get_String() + (CStr) "\r\n";
if(StringGetSplitUBound(APIArgs) == 0) if(strcmp(StringGetSplitElement(SecondSplit, APIArgs, 0).Get_String(), "-") == 0) goto NoStoreArgs;
APIString = APIString + "Arguments (" + (CStr) (StringGetSplitUBound(APIArgs) + 1) + (CStr) ") : \r\n" + (CStr) StArgs + (CStr) "\r\n";
goto StoreArgs;
NoStoreArgs: APIString = APIString + "-\r\n\r\n";
StoreArgs: MaxAPIArgs = StringGetSplitUBound(APIArgs);
StringReleaseSplit(APIArgs);
APIString = APIString + "Note: " + (CStr) StringGetSplitElement(FirstSplit, APIInfos, 4).Get_String() + (CStr) "\r\n";
APIString = APIString + "WinNT: " + (CStr) StringGetSplitElement(FirstSplit, APIInfos, 5).Get_String() + (CStr) "\r\n";
APIString = APIString + "Win95: " + (CStr) StringGetSplitElement(FirstSplit, APIInfos, 6).Get_String() + (CStr) "\r\n";
APIString = APIString + "Win32s: " + (CStr) StringGetSplitElement(FirstSplit, APIInfos, 7).Get_String();
if(APIhText == 0)
{
ChildStruct = LoadStructure(CurrentForm);
CreateSplashDialog(dx, dy, 1, 1, "", ChildStruct->hChildCodeMax, 0, 0, &FRMAPIInitProc, &FRMAPIWinHook, 0, WS_DISABLED, SW_HIDE);
}
if(APIhText != 0)
{
APIArrParse = StringSplit(APIString, "\r\n");
if(APIhFont != 0) DeleteObject(APIhFont);
APIhFont = GDIObtainFont(CurFontName, CurFontSize, hMDIform.hWnd, 0, 0);
if(APIhFontBold == 0) DeleteObject(APIhFontBold);
APIhFontBold = GDIObtainFont(CurFontName, CurFontSize, hMDIform.hWnd, 1, 0);
ControlVisible(APIhText, 1);
SendMessage(APIhText, WM_PAINT, 0, 0);
}
// Save API name
BufString = StringGetSplitElement(FirstSplit, APIInfos, 0);
}
if(APIInfosLib != 0) StringReleaseSplit(APIInfos);
}
FreeMem((long) APIDescription);
}
//.........这里部分代码省略.........