update dev300-m58
[ooovba.git] / configmgr / workben / local_io / filetest.cxx
blob52ecdf555e565e7d88610a06566ccc8aa6e2906f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filetest.cxx,v $
10 * $Revision: 1.4 $
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"
33 #include <iostream>
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;
45 using ::osl::File;
46 // -----------------------------------------------------------------------------
47 // ---------------------------------- defines ----------------------------------
48 // -----------------------------------------------------------------------------
49 #define ASCII(x) OUString::createFromAscii(x)
52 // -----------------------------------------------------------------------------
53 // ------------------------------------ main ------------------------------------
54 // -----------------------------------------------------------------------------
57 OUString operator+(const OUString &a, const OUString &b)
59 OUString c = a;
60 c += b;
61 return c;
65 #if (defined UNX) || (defined OS2)
66 int main( int argc, char * argv[] )
67 #else
68 int _cdecl main( int argc, char * argv[] )
69 #endif
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
78 OUString aURL;
79 File aConvert(ASCII(""));
80 aConvert.normalizePath(aFullname, aURL);
82 // File oeffnen
83 File aFile(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);
91 aFile.close();
92 return 0;