|
#pragma once
#include "./dir_separator.hpp"
namespace pstade { namespace tomato {
#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
#pragma comment(lib, "shlwapi.lib")
inline LPTSTR path_find_file_name(LPCTSTR pszPath)
{
return ::PathFindFileName(pszPath);
}
#else
inline LPTSTR path_find_file_name(LPCTSTR pszPath)
{
LPCTSTR pszFileName = pszPath; // beginning of the path if failed
for (LPCTSTR psz = pszPath; *psz != null_tchar::value; psz = ::CharNext(psz)) {
if (*psz == dir_separator::value) {
psz = ::CharNext(psz);
if (*psz != _T('\0')) {
ATLASSERT(*psz != dir_separator::value);
pszFileName = psz;
}
}
}
return const_cast<LPTSTR>(pszFileName);
}
#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
} } // namespace pstade::tomato
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here