- ;
- }
-
- return result;
-#endif // Win32/16
-}
-
-#elif defined(__WXPM__)
-
-wxString wxFindFirstFile(const wxChar *spec, int flags)
-{
- wxString result;
-
- /*
- // TODO: figure something out here for OS/2
- gs_strFileSpec = spec;
- gs_findFlags = flags;
-
- // Find path only so we can concatenate found file onto path
- wxString path(wxPathOnly(gs_strFileSpec));
- if ( !path.IsEmpty() )
- result << path << wxT('\\');
-
- int flag = _A_NORMAL;
- if (flags & wxDIR)
- flag = _A_SUBDIR;
-
- if (_dos_findfirst(WXSTRINGCAST spec, flag, &gs_findDataStruct) == 0)
- {
- char attrib;
- attrib = gs_findDataStruct.attrib;
-
- if (attrib & _A_SUBDIR) {
- if (!(gs_findFlags & wxDIR))
- return wxFindNextFile();
- } else if (gs_findFlags && !(gs_findFlags & wxFILE))
- return wxFindNextFile();
-
- result += gs_findDataStruct.name;
- }
- */
- return result;
-}
-
-wxString wxFindNextFile()
-{
- wxString result;
- // TODO:
- return result;
-}
-
-#endif // Unix/Windows/OS/2
-
-// Get current working directory.
-// If buf is NULL, allocates space using new, else
-// copies into buf.
-wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
-{
- if (!buf)
- buf = new wxChar[sz+1];
-#if wxUSE_UNICODE
- char *cbuf = new char[sz+1];
-#ifdef _MSC_VER
- if (_getcwd(cbuf, sz) == NULL) {
-#elif defined( __WXMAC__)
- enum
- {
- SFSaveDisk = 0x214, CurDirStore = 0x398
- };
- FSSpec cwdSpec ;
-
- FSMakeFSSpec( - *(short *) SFSaveDisk , *(long *) CurDirStore , NULL , &cwdSpec ) ;
- wxString res = wxMacFSSpec2UnixFilename( &cwdSpec ) ;
- strcpy( buf , res ) ;
- if (0) {
-#else
- if (getcwd(cbuf, sz) == NULL) {
-#endif
- delete [] cbuf;
-#else // wxUnicode
-#ifdef _MSC_VER
- if (_getcwd(buf, sz) == NULL) {
-#elif defined( __WXMAC__)
- enum
- {
- SFSaveDisk = 0x214, CurDirStore = 0x398
- };
- FSSpec cwdSpec ;
-
- FSMakeFSSpec( - *(short *) SFSaveDisk , *(long *) CurDirStore , NULL , &cwdSpec ) ;
- wxString res = wxMacFSSpec2UnixFilename( &cwdSpec ) ;
- strcpy( buf , res ) ;
- if (0) {
-#elif(__VISAGECPP__)
- APIRET rc;
- rc = ::DosQueryCurrentDir( 0 // current drive
- ,buf
- ,(PULONG)&sz
- );
- if (rc != 0) {
-#else
- if (getcwd(buf, sz) == NULL) {
-#endif
-#endif
- buf[0] = wxT('.');
- buf[1] = wxT('\0');
- }
-#if wxUSE_UNICODE
- else {
- wxConvFile.MB2WC(buf, cbuf, sz);
- delete [] cbuf;
- }
-#endif
- return buf;