WinStd
Windows Win32 API using Standard C++
Loading...
Searching...
No Matches
Shell.h
1/*
2 SPDX-License-Identifier: MIT
3 Copyright © 1991-2022 Amebis
4 Copyright © 2016 GÉANT
5*/
6
8
9#pragma once
10
11#include "Common.h"
12#include <Shlwapi.h>
13#include <string>
14
17
19template<class _Traits, class _Ax>
20static BOOL PathCanonicalizeA(_Inout_ std::basic_string<char, _Traits, _Ax> &sValue, _In_ LPCSTR pszPath)
21{
22 char szBuffer[MAX_PATH + 1];
23 BOOL bResult = ::PathCanonicalizeA(szBuffer, pszPath);
24 sValue.assign(szBuffer, bResult ? MAX_PATH : 0);
25 return bResult;
26}
27
33template<class _Traits, class _Ax>
34static BOOL PathCanonicalizeW(_Inout_ std::basic_string<wchar_t, _Traits, _Ax> &sValue, _In_ LPCWSTR pszPath)
35{
36 wchar_t szBuffer[MAX_PATH + 1];
37 BOOL bResult = ::PathCanonicalizeW(szBuffer, pszPath);
38 sValue.assign(szBuffer, bResult ? MAX_PATH : 0);
39 return bResult;
40}
41
static BOOL PathCanonicalizeW(std::basic_string< wchar_t, _Traits, _Ax > &sValue, LPCWSTR pszPath)
Simplifies a path by removing navigation elements such as "." and ".." to produce a direct,...
Definition: Shell.h:34
static BOOL PathCanonicalizeA(std::basic_string< char, _Traits, _Ax > &sValue, LPCSTR pszPath)
Simplifies a path by removing navigation elements such as "." and ".." to produce a direct,...
Definition: Shell.h:20