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: filetest.cxx,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 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_configmgr.hxx"
34 #include<osl/file.hxx>
36 #include <rtl/ustring.hxx>
37 #include <com/sun/star/uno/Sequence.hxx>
39 // -----------------------------------------------------------------------------
40 // --------------------------------- namespaces ---------------------------------
41 // -----------------------------------------------------------------------------
42 using namespace com::sun::star::uno
;
44 using ::rtl::OUString
;
46 // -----------------------------------------------------------------------------
47 // ---------------------------------- defines ----------------------------------
48 // -----------------------------------------------------------------------------
49 #define ASCII(x) OUString::createFromAscii(x)
52 // -----------------------------------------------------------------------------
53 // ------------------------------------ main ------------------------------------
54 // -----------------------------------------------------------------------------
57 OUString operator+(const OUString &a, const OUString &b)
65 #if (defined UNX) || (defined OS2)
66 int main( int argc
, char * argv
[] )
68 int _cdecl
main( int argc
, char * argv
[] )
71 OUString aPath
= ASCII("f:/local/SRC598/configmgr/workben/local_io");
72 OUString aFilename
= ASCII("com.sun.star.office.Setup");
73 OUString aExtension
= ASCII("xml");
75 OUString aFullname
= aPath
+ ASCII("/") + aFilename
+ ASCII(".") + aExtension
;
77 // Filename convertieren
79 File
aConvert(ASCII(""));
80 aConvert
.normalizePath(aFullname
, aURL
);
84 aFile
.open(osl_File_OpenFlag_Read
);
86 sal_uInt64 nBytesRead
;
87 Sequence
< sal_Int8
> aBufferSeq(2000);
88 sal_Int8
*pBuff
= aBufferSeq
.getArray();
89 aFile
.read(pBuff
, 2000, nBytesRead
);