summaryrefslogtreecommitdiff
path: root/shell/source/win32/shlxthandler/util/utilities.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'shell/source/win32/shlxthandler/util/utilities.cxx')
-rwxr-xr-x[-rw-r--r--]shell/source/win32/shlxthandler/util/utilities.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/shell/source/win32/shlxthandler/util/utilities.cxx b/shell/source/win32/shlxthandler/util/utilities.cxx
index f721c4113aa8..005e4689cdce 100644..100755
--- a/shell/source/win32/shlxthandler/util/utilities.cxx
+++ b/shell/source/win32/shlxthandler/util/utilities.cxx
@@ -148,6 +148,28 @@ bool HasOnlySpaces(const std::wstring& String)
return true;
}
+//---------------------------------
+/** helper function to convert windows pathes to short form.
+ @returns
+ shortend path.
+*/
+
+std::wstring getShortPathName( const std::wstring& aLongName )
+{
+ std::wstring shortName = aLongName;
+ long length = GetShortPathName( aLongName.c_str(), NULL, 0 );
+
+ if ( length != 0 )
+ {
+ TCHAR* buffer = new TCHAR[ length+1 ];
+ length = GetShortPathName( aLongName.c_str(), buffer, length );
+ if ( length != 0 )
+ shortName = std::wstring( buffer );
+ delete [] buffer;
+ }
+ return shortName;
+}
+
/** convert LocaleSet pair into Microsoft List of Locale ID (LCID)
according to ISO-639 and ISO-3166.
http://etext.lib.virginia.edu/tei/iso639.html