1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: comdep.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <tools/fsys.hxx>
36 #define ACCESSDELIM(e) ( (e == FSYS_STYLE_MAC) ? ":" : \
37 ( ( e == FSYS_STYLE_VFAT || e == FSYS_STYLE_HPFS || \
38 e == FSYS_STYLE_FAT ) || e == FSYS_STYLE_NTFS ) \
40 #define ACCESSDELIM_C(e)(char)\
41 ( (e == FSYS_STYLE_MAC) ? ':' : \
42 ( ( e == FSYS_STYLE_VFAT || e == FSYS_STYLE_HPFS || \
43 e == FSYS_STYLE_FAT ) || e == FSYS_STYLE_NTFS ) \
45 #define SEARCHDELIM(e) ( (e == FSYS_STYLE_SYSV || e == FSYS_STYLE_BSD) ? ":" \
47 #define SEARCHDELIM_C(e)(char)\
48 ( (e == FSYS_STYLE_SYSV || e == FSYS_STYLE_BSD) ? ':' \
50 #define ACTPARENT(e) ( (e == FSYS_STYLE_MAC) ? ":" : ".." )
51 #define ACTCURRENT(e) ( (e == FSYS_STYLE_MAC) ? "" : "." )
61 //--------------------------------------------------------------------
64 DIR *opendir( const char* pPfad
);
65 dirent
*readdir( DIR *pDir
);
66 int closedir( DIR *pDir
);
67 char *volumeid( const char* pPfad
);
70 //--------------------------------------------------------------------
83 DirReader_Impl( Dir
&rDir
)
87 aPath( GUI2FSYS(rDir
.GetFull()) ),
93 FSysRedirector::DoRedirect( aPath
);
96 // nur den String der Memer-Var nehmen!
98 #if defined(UNX) || defined(OS2) //for further exlpanation see DirReader_Impl::Read() in unx.cxx
101 aBypass
= ByteString(aPath
, osl_getThreadTextEncoding());
102 pDosDir
= opendir( (char*) aBypass
.GetBuffer() );
105 // Parent f"ur die neuen DirEntries ermitteln
106 pParent
= pDir
->GetFlag() == FSYS_FLAG_NORMAL
||
107 pDir
->GetFlag() == FSYS_FLAG_ABSROOT
114 { if( pDosDir
) closedir( pDosDir
); }
116 // die folgenden sind systemabh"angig implementiert
117 USHORT
Init(); // initialisiert, liest ggf. devices
118 USHORT
Read(); // liest 1 Eintrag, F2ugt ein falls ok
121 //--------------------------------------------------------------------
123 struct FileCopier_Impl
125 FSysAction nActions
; // was zu tun ist (Copy/Move/recur)
126 Link aErrorLink
; // bei Fehlern zu rufen
127 ErrCode eErr
; // aktueller Fehlercode im Error-Handler
128 const DirEntry
* pErrSource
; // fuer Error-Handler falls Source-Fehler
129 const DirEntry
* pErrTarget
; // fuer Error-Handler falls Target-Fehler
132 : nActions( 0 ), eErr( 0 ),
133 pErrSource( 0 ), pErrTarget( 0 )
135 FileCopier_Impl( const FileCopier_Impl
&rOrig
)
136 : nActions( rOrig
.nActions
), eErr( 0 ),
137 pErrSource( 0 ), pErrTarget( 0 )
140 FileCopier_Impl
& operator=( const FileCopier_Impl
&rOrig
)
142 nActions
= rOrig
.nActions
;
143 eErr
= 0; pErrSource
= 0; pErrTarget
= 0;
148 //--------------------------------------------------------------------
150 #if defined WNT || defined OS2
151 BOOL
IsRedirectable_Impl( const ByteString
&rPath
);
153 #define IsRedirectable_Impl( rPath ) TRUE
156 //--------------------------------------------------------------------