1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
8 #include "osl/diagnose.h"
9 #include "rtl/ustring.h"
10 #include "rtl/byteseq.h"
15 int main (int argc
, char ** argv
)
20 oslFileHandle hFile
= 0;
22 rtl_uString
* pSystemPath
= 0;
23 rtl_uString
* pFileUrl
= 0;
25 rtl_uString_newFromAscii (&pSystemPath
, argv
[1]);
27 result
= osl_getFileURLFromSystemPath (pSystemPath
, &pFileUrl
);
28 rtl_uString_release (pSystemPath
), pSystemPath
= 0;
29 if (result
!= osl_File_E_None
)
32 result
= osl_openFile (pFileUrl
, &hFile
, osl_File_OpenFlag_Read
);
33 rtl_uString_release (pFileUrl
), pFileUrl
= 0;
34 if (result
== osl_File_E_None
)
36 sal_Sequence
* pBuffer
= 0;
41 result
= osl_readLine (hFile
, &pBuffer
);
42 if (result
!= osl_File_E_None
)
44 for (i
= 0, n
= pBuffer
->nElements
; i
< n
; i
++)
45 printf ("%c", (char)(pBuffer
->elements
[i
]));
49 rtl_byte_sequence_release (pBuffer
), pBuffer
= 0;
50 (void) osl_closeFile (hFile
);
56 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */