void Assign(const wxString& path,
const wxString& name,
const wxString& ext,
- wxPathFormat format = wxPATH_NATIVE)
- {
- // empty volume
- Assign(wxEmptyString, path, name, ext, format);
- }
+ wxPathFormat format = wxPATH_NATIVE);
void AssignDir(const wxString& dir, wxPathFormat format = wxPATH_NATIVE);
Assign(volume, path, name, ext, format);
}
+void wxFileName::Assign(const wxString& pathOrig,
+ const wxString& name,
+ const wxString& ext,
+ wxPathFormat format)
+{
+ wxString volume,
+ path;
+ SplitVolume(pathOrig, &volume, &path, format);
+
+ Assign(volume, path, name, ext, format);
+}
+
void wxFileName::AssignDir(const wxString& dir, wxPathFormat format)
{
Assign(dir, _T(""), format);
CPPUNIT_ASSERT( fullname == fni.fullname );
CPPUNIT_ASSERT( fn.Normalize(wxPATH_NORM_ALL, _T(""), fni.format) );
+
+ if ( *fni.volume && *fni.path )
+ {
+ // check that specifying the volume separately or as part of the
+ // path doesn't make any difference
+ wxString pathWithVolume = fni.volume;
+ pathWithVolume += wxFileName::GetVolumeSeparator(fni.format);
+ pathWithVolume += fni.path;
+
+ CPPUNIT_ASSERT( fn == wxFileName(pathWithVolume,
+ fni.name,
+ fni.ext,
+ fni.format) );
+ }
}
}