+// Return the short form of the path (returns identity on non-Windows platforms)
+wxString wxFileName::GetShortPath() const
+{
+#if defined(__WXMSW__) && defined(__WIN32__)
+ wxString path(GetFullPath());
+
+ wxChar outBuf[MAX_PATH];
+
+ // TODO: can't work out how to determine if the function failed
+ // (positive value if either it succeeded or the buffer was too small)
+
+ int bufSz = ::GetShortPathName((const wxChar*) path, outBuf, MAX_PATH*sizeof(wxChar));
+
+ if (bufSz == 0)
+ {
+ return wxEmptyString;
+ }
+ else
+ {
+ return wxString(outBuf);
+ }
+#else
+ return GetFullPath();
+#endif
+}
+
+// Return the long form of the path (returns identity on non-Windows platforms)
+wxString wxFileName::GetLongPath() const
+{
+#if defined(__WXMSW__) && defined(__WIN32__)
+ wxString path(GetFullPath());
+
+ wxChar outBuf[MAX_PATH];
+
+ // TODO: can't work out how to determine if the function failed
+ // (positive value if either it succeeded or the buffer was too small)
+
+ int bufSz = ::GetLongPathName((const wxChar*) path, outBuf, MAX_PATH*sizeof(wxChar));
+
+ if (bufSz == 0)
+ {
+ return wxEmptyString;
+ }
+ else
+ {
+ return wxString(outBuf);
+ }
+#else
+ return GetFullPath();
+#endif
+}
+