本文整理汇总了C++中PathCharString::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ PathCharString::Set方法的具体用法?C++ PathCharString::Set怎么用?C++ PathCharString::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathCharString
的用法示例。
在下文中一共展示了PathCharString::Set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildSharedFilesPath
void SharedMemoryHelpers::BuildSharedFilesPath(PathCharString& destination, const char *suffix, int suffixCharCount)
{
_ASSERTE(strlen(suffix) == suffixCharCount);
VerifyStringOperation(destination.Set(*gSharedFilesPath));
VerifyStringOperation(destination.Append(suffix, suffixCharCount));
}
示例2: if
/*++
Function:
GetCurrentDirectoryA
--*/
DWORD
GetCurrentDirectoryA(PathCharString& lpBuffer)
{
DWORD dwDirLen = 0;
DWORD dwLastError = 0;
char *current_dir;
PERF_ENTRY(GetCurrentDirectoryA);
ENTRY("GetCurrentDirectoryA(lpBuffer=%p)\n", lpBuffer.GetString());
current_dir = lpBuffer.OpenStringBuffer(MAX_PATH);
/* NULL first arg means getcwd will allocate the string */
current_dir = PAL__getcwd( current_dir, MAX_PATH);
if (current_dir != NULL )
{
dwDirLen = strlen( current_dir );
lpBuffer.CloseBuffer(dwDirLen);
goto done;
}
else if ( errno == ERANGE )
{
lpBuffer.CloseBuffer(0);
current_dir = PAL__getcwd( NULL, 0);
}
if ( !current_dir )
{
WARN("Getcwd failed with errno=%d [%s]\n", errno, strerror(errno));
dwLastError = DIRGetLastErrorFromErrno();
dwDirLen = 0;
goto done;
}
dwDirLen = strlen( current_dir );
lpBuffer.Set(current_dir, dwDirLen);
PAL_free(current_dir);
done:
if ( dwLastError )
{
SetLastError(dwLastError);
}
LOGEXIT("GetCurrentDirectoryA returns DWORD %u\n", dwDirLen);
PERF_EXIT(GetCurrentDirectoryA);
return dwDirLen;
}
示例3: CopySharedMemoryBasePath
bool SharedMemoryManager::CopySharedMemoryBasePath(PathCharString& destination)
{
return destination.Set(*s_sharedMemoryDirectoryPath) != FALSE;
}