cpathstring.cpp
来自「这是一个编辑器 这是一个编辑器」· C++ 代码 · 共 56 行
CPP
56 行
#include "CPathString.h"
CPathString::CPathString()
{}
CPathString::~CPathString()
{}
//
// Returns a pointer to the file name of a file path
//
char* CPathString::ExtractFileName(char* szDir)
{
char* pCH;
pCH = (char*)((DWORD)szDir + lstrlen(szDir) - 1);
while (*pCH != '\\')
pCH--;
pCH++;
return pCH;
}
//
// Pastes a NUL at the start of the file name of the specified file path
//
void CPathString::PathToDir(char* szPath)
{
char *pCH;
pCH = szPath;
pCH += lstrlen(szPath);
while (*pCH != '\\')
--pCH;
*pCH = 0;
return;
}
//
// Pastes a backslash at the end of a string if there isn't already one
//
void CPathString::ForceEndBackslash(char* szStr)
{
char *pCH;
pCH = (char*)((DWORD)szStr + lstrlen(szStr) - 1);
if (*pCH != '\\')
lstrcat(szStr, "\\");
return;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?