summaryrefslogtreecommitdiff
path: root/sal/workben/testfile.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-03-26 15:47:28 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-03-26 15:47:28 +0000
commite6611cc2ef5960e9f32c56da44fafd02446f53e6 (patch)
tree6358ced419ac9412ae39cbb7032f602ff0e7de7c /sal/workben/testfile.cxx
parent243a97038bdab8f2ec448df19c88ac2638035531 (diff)
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'sal/workben/testfile.cxx')
-rw-r--r--sal/workben/testfile.cxx58
1 files changed, 53 insertions, 5 deletions
diff --git a/sal/workben/testfile.cxx b/sal/workben/testfile.cxx
index 07a1bdf48283..15a0bae48ff3 100644
--- a/sal/workben/testfile.cxx
+++ b/sal/workben/testfile.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: testfile.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: obr $ $Date: 2001-09-04 06:52:25 $
+ * last change: $Author: hr $ $Date: 2003-03-26 16:47:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -64,7 +64,6 @@
#include <osl/file.hxx>
#include <osl/process.h>
-#include <osl/thread.h>
#include <osl/time.h>
#include <rtl/alloc.h>
#include <rtl/ustring.hxx>
@@ -115,7 +114,7 @@ void printFileName(::rtl::OUString& str)
{
rtl::OString aString;
- aString = rtl::OUStringToOString( str, osl_getThreadTextEncoding() );
+ aString = rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US );
printf( "%s", aString.getStr() );
@@ -248,7 +247,7 @@ sal_Bool Initialize( void )
while ( (pCount-pBuffer < uBytesRead) && !testLineBreak(pCount,uBytesRead-(pCount-pBuffer), &cLineBrake))
pCount++;
- dir[i]=rtl::OUString(pBegin, pCount-pBegin, osl_getThreadTextEncoding() );
+ dir[i]=rtl::OUString(pBegin, pCount-pBegin, RTL_TEXTENCODING_ASCII_US);
pCount+=cLineBrake;
pBegin=pCount;
@@ -1678,6 +1677,55 @@ void DirectoryItemTest( void )
printf( "\n" );
+ //---------------------------------------------------
+ // get DirectoryItem from a file-handle
+ //--------------------------------------------------
+
+ pFile=new File( file1 );
+
+ rc=pFile->open( OpenFlag_Read );
+ if ( rc==FileBase::E_None )
+ {
+ printf( "Get DirectoryItem from a File-Handle: ");
+ printFileName( file1 );
+ printf( "\n" );
+
+ rc=DirectoryItem::get( *pFile , aItem );
+ print_error( rtl::OString( "GetDirectoryItem" ), rc );
+
+ pStatus=new FileStatus( FileStatusMask_All );
+ rc=aItem.getFileStatus( *pStatus );
+
+ if ( rc==FileBase::E_None )
+ {
+ printf( "GetFileStatus: FileURL: ");
+ printFileName( pStatus->getFileURL() );
+ printf( "\n");
+ }
+
+ delete pStatus;
+
+ pFile->close();
+ }
+
+ delete pFile;
+
+ printf( "\n" );
+
+ //---------------------------------------------------
+ // get DirectoryItem from an empty file-handle
+ //--------------------------------------------------
+
+ pFile=new File( file1 );
+
+ printf( "Get DirectoryItem from an empty File-Handle\n" );
+ rc=DirectoryItem::get( *pFile , aItem );
+ print_error( rtl::OString( "GetDirectoryItem" ), rc );
+
+ delete pFile;
+
+ printf( "\n" );
+
//--------------------------------------------------
// GetNextItem from a directory
//--------------------------------------------------