diff options
author | Alexander Wilms <f.alexander.wilms@gmail.com> | 2014-02-22 21:20:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-23 03:38:49 +0000 |
commit | 0ce0c369aa8880dff9fe874ba85ec6f52ee37ddf (patch) | |
tree | 5024cba9f9ea5e3b23ea26025323f6aef39488d0 /sal/workben | |
parent | b81ac16e65b311d6e43c05c22c65d2040c9d7e04 (diff) |
Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sal/workben')
-rw-r--r-- | sal/workben/clipboardwben/testcopy/XTDataObject.cxx | 100 | ||||
-rw-r--r-- | sal/workben/clipboardwben/testcopy/cbcpytest.cxx | 28 | ||||
-rw-r--r-- | sal/workben/clipboardwben/testpaste/cbptest.cxx | 12 | ||||
-rw-r--r-- | sal/workben/clipboardwben/testviewer/cbvtest.cxx | 4 | ||||
-rw-r--r-- | sal/workben/testfile.cxx | 428 |
5 files changed, 286 insertions, 286 deletions
diff --git a/sal/workben/clipboardwben/testcopy/XTDataObject.cxx b/sal/workben/clipboardwben/testcopy/XTDataObject.cxx index 317bc460273a..063cccdcf022 100644 --- a/sal/workben/clipboardwben/testcopy/XTDataObject.cxx +++ b/sal/workben/clipboardwben/testcopy/XTDataObject.cxx @@ -24,35 +24,35 @@ #include <windows.h> #include <ole2.h> -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + //============================================================================ // OTWrapperDataObject //============================================================================ -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + CXTDataObject::CXTDataObject( LONG nRefCntInitVal ) : m_nRefCnt( nRefCntInitVal ) { } -//------------------------------------------------------------------------ + // dtor -//------------------------------------------------------------------------ + CXTDataObject::~CXTDataObject( ) { } -//------------------------------------------------------------------------ + // IUnknown->QueryInterface -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject ) { @@ -75,18 +75,18 @@ STDMETHODIMP CXTDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject ) return hr; } -//------------------------------------------------------------------------ + // IUnknown->AddRef -//------------------------------------------------------------------------ + STDMETHODIMP_(ULONG) CXTDataObject::AddRef( ) { return static_cast< ULONG >( InterlockedIncrement( &m_nRefCnt ) ); } -//------------------------------------------------------------------------ + // IUnknown->Release -//------------------------------------------------------------------------ + STDMETHODIMP_(ULONG) CXTDataObject::Release( ) { @@ -103,10 +103,10 @@ STDMETHODIMP_(ULONG) CXTDataObject::Release( ) return nRefCnt; } -//------------------------------------------------------------------------ + // IDataObject->GetData // warning: 'goto' ahead (to easy error handling without using exceptions) -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::GetData(LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium ) { @@ -178,9 +178,9 @@ STDMETHODIMP CXTDataObject::GetData(LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium return hr; } -//------------------------------------------------------------------------ + // IDataObject->EnumFormatEtc -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc ) { @@ -201,72 +201,72 @@ STDMETHODIMP CXTDataObject::EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** p return hr; } -//------------------------------------------------------------------------ + // IDataObject->QueryGetData -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::QueryGetData( LPFORMATETC pFormatetc ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->GetDataHere -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::GetDataHere( LPFORMATETC, LPSTGMEDIUM ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->GetCanonicalFormatEtc -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::GetCanonicalFormatEtc( LPFORMATETC, LPFORMATETC ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->SetData -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::SetData( LPFORMATETC, LPSTGMEDIUM, BOOL ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->DAdvise -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::DAdvise( LPFORMATETC, DWORD, LPADVISESINK, DWORD * ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->DUnadvise -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::DUnadvise( DWORD ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->EnumDAdvise -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::EnumDAdvise( LPENUMSTATDATA * ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // for our convenience -//------------------------------------------------------------------------ + CXTDataObject::operator IDataObject*( ) { @@ -279,9 +279,9 @@ CXTDataObject::operator IDataObject*( ) //============================================================================ -//---------------------------------------------------------------------------- + // ctor -//---------------------------------------------------------------------------- + CEnumFormatEtc::CEnumFormatEtc( LPUNKNOWN pUnkDataObj ) : m_nRefCnt( 0 ), @@ -292,17 +292,17 @@ CEnumFormatEtc::CEnumFormatEtc( LPUNKNOWN pUnkDataObj ) : m_cfFormats[1] = CF_TEXT; } -//---------------------------------------------------------------------------- + // dtor -//---------------------------------------------------------------------------- + CEnumFormatEtc::~CEnumFormatEtc( ) { } -//---------------------------------------------------------------------------- + // IUnknown->QueryInterface -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::QueryInterface( REFIID iid, LPVOID* ppvObject ) { @@ -323,9 +323,9 @@ STDMETHODIMP CEnumFormatEtc::QueryInterface( REFIID iid, LPVOID* ppvObject ) return hr; } -//---------------------------------------------------------------------------- + // IUnknown->AddRef -//---------------------------------------------------------------------------- + STDMETHODIMP_(ULONG) CEnumFormatEtc::AddRef( ) { @@ -334,9 +334,9 @@ STDMETHODIMP_(ULONG) CEnumFormatEtc::AddRef( ) return InterlockedIncrement( &m_nRefCnt ); } -//---------------------------------------------------------------------------- + // IUnknown->Release -//---------------------------------------------------------------------------- + STDMETHODIMP_(ULONG) CEnumFormatEtc::Release( ) { @@ -353,9 +353,9 @@ STDMETHODIMP_(ULONG) CEnumFormatEtc::Release( ) return nRefCnt; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Next -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Next( ULONG celt, LPFORMATETC rgelt, ULONG* pceltFetched ) { @@ -397,9 +397,9 @@ STDMETHODIMP CEnumFormatEtc::Next( ULONG celt, LPFORMATETC rgelt, ULONG* pceltFe return hr; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Skip -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Skip( ULONG celt ) { @@ -414,9 +414,9 @@ STDMETHODIMP CEnumFormatEtc::Skip( ULONG celt ) return hr; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Reset -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Reset( ) { @@ -424,9 +424,9 @@ STDMETHODIMP CEnumFormatEtc::Reset( ) return S_OK; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Clone -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Clone( IEnumFORMATETC** ppenum ) { diff --git a/sal/workben/clipboardwben/testcopy/cbcpytest.cxx b/sal/workben/clipboardwben/testcopy/cbcpytest.cxx index 030faaa9d98e..b359d48687ff 100644 --- a/sal/workben/clipboardwben/testcopy/cbcpytest.cxx +++ b/sal/workben/clipboardwben/testcopy/cbcpytest.cxx @@ -67,9 +67,9 @@ HWND g_hWnd; HANDLE g_hEvent; BOOL g_bEnd; -//---------------------------------------------------- + // a thread function -//---------------------------------------------------- + unsigned int _stdcall ThreadProc(LPVOID pParam) { @@ -82,9 +82,9 @@ unsigned int _stdcall ThreadProc(LPVOID pParam) return 0; } -//---------------------------------------------------- + // WinMain -//---------------------------------------------------- + int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, @@ -142,7 +142,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, -//---------------------------------------------------------------- + // FUNCTION: MyRegisterClass() // // PURPOSE: Registers the window class. @@ -152,7 +152,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, // needs to be compatible with Win32 systems prior to 'RegisterClassEx' // function, which was added to Windows 95. If it important to call // this function to allow the use of small icons in the correct proportions. -//---------------------------------------------------------------- + ATOM MyRegisterClass( HINSTANCE hInstance ) { @@ -175,7 +175,7 @@ ATOM MyRegisterClass( HINSTANCE hInstance ) return RegisterClassEx(&wcex); } -//---------------------------------------------------------------- + // FUNCTION: InitInstance(HANDLE, int) // // PURPOSE: Saves instance access number and creates main window @@ -183,7 +183,7 @@ ATOM MyRegisterClass( HINSTANCE hInstance ) // Comments: // In this function, the instance access number is stored in a global variable // and the main program window is displayed. -//---------------------------------------------------------------- + BOOL InitInstance( HINSTANCE hInstance, int nCmdShow ) { @@ -203,7 +203,7 @@ BOOL InitInstance( HINSTANCE hInstance, int nCmdShow ) return TRUE; } -//---------------------------------------------------------------- + // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) // // PURPOSE: Processes messages for the main window. @@ -211,7 +211,7 @@ BOOL InitInstance( HINSTANCE hInstance, int nCmdShow ) // WM_COMMAND - Handle application menu // WM_PAINT - Display main windows // WM_DESTROY - Output completion message and return -//---------------------------------------------------------------- + LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { @@ -279,9 +279,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) return 0; } -//---------------------------------------------- + // copy data into the clipboard -//---------------------------------------------- + void CopyClipboardData( HWND hWnd ) { @@ -293,9 +293,9 @@ void CopyClipboardData( HWND hWnd ) #endif } -//---------------------------------------------- + // flush the content into the clipboard -//---------------------------------------------- + void FlushClipboard( ) { diff --git a/sal/workben/clipboardwben/testpaste/cbptest.cxx b/sal/workben/clipboardwben/testpaste/cbptest.cxx index 9db93203d006..f4cf9cd94ea2 100644 --- a/sal/workben/clipboardwben/testpaste/cbptest.cxx +++ b/sal/workben/clipboardwben/testpaste/cbptest.cxx @@ -55,9 +55,9 @@ LPSTREAM g_pStm = NULL; char* pTextBuff = NULL; DWORD lData = 0; -//---------------------------------------------------- + // a thread function -//---------------------------------------------------- + unsigned int _stdcall ThreadProc(LPVOID pParam) { @@ -119,9 +119,9 @@ unsigned int _stdcall ThreadProc(LPVOID pParam) return 0; } -//---------------------------------------------------- + // WinMain -//---------------------------------------------------- + int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, @@ -348,9 +348,9 @@ void PasteClipboardData2(HWND hwndParent) } } -//---------------------------------------------------- + // clipboard handling -//---------------------------------------------------- + /* void PasteClipboardData(HWND hwndParent) diff --git a/sal/workben/clipboardwben/testviewer/cbvtest.cxx b/sal/workben/clipboardwben/testviewer/cbvtest.cxx index 663a083cc99d..e39a71e6405e 100644 --- a/sal/workben/clipboardwben/testviewer/cbvtest.cxx +++ b/sal/workben/clipboardwben/testviewer/cbvtest.cxx @@ -65,9 +65,9 @@ void CALLBACK OnClipboardContentChange( void ); LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ); LRESULT CALLBACK About( HWND, UINT, WPARAM, LPARAM ); -//---------------------------------------------------- + // WinMain -//---------------------------------------------------- + int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, diff --git a/sal/workben/testfile.cxx b/sal/workben/testfile.cxx index f4b1df974112..b4392a4136b1 100644 --- a/sal/workben/testfile.cxx +++ b/sal/workben/testfile.cxx @@ -78,9 +78,9 @@ void printFileName(const ::rtl::OUString& str) return; } -//-------------------------------------------------- + // Initialization -//-------------------------------------------------- + sal_Bool testLineBreak( sal_Char *pCount , sal_uInt64 nLen , sal_uInt32 *cLineBreak ) { @@ -267,9 +267,9 @@ sal_Bool Initialize( void ) return sal_True; } -//-------------------------------------------------- + // Shutdown -//-------------------------------------------------- + sal_Bool Shutdown( void ) { @@ -318,9 +318,9 @@ sal_Bool Shutdown( void ) return fSuccess; } -//-------------------------------------------------- + // helper functions -//-------------------------------------------------- + // Show FileType void showFileType( FileStatus::Type aType ) @@ -440,9 +440,9 @@ TimeValue getSystemTime() } -//-------------------------------------------------- + // DirectoryOpenAndCloseTest -//-------------------------------------------------- + void DirectoryOpenAndCloseTest( void ) { @@ -453,9 +453,9 @@ void DirectoryOpenAndCloseTest( void ) printf( "Directory-Open-And-Close-Test\n"); printf( "--------------------------------------------\n\n"); - //-------------------------------------------------- + // open an existing directory - //-------------------------------------------------- + pDir=new Directory( dir1 ); printf( "Open an existing directory: "); @@ -477,9 +477,9 @@ void DirectoryOpenAndCloseTest( void ) delete pDir; printf( "\n" ); - //-------------------------------------------------- + // open a not existing directory - //-------------------------------------------------- + pDir=new Directory( dir_not_exist ); @@ -495,9 +495,9 @@ void DirectoryOpenAndCloseTest( void ) printf( "\n" ); - //-------------------------------------------------- + // open a directory with a wrong semantic - //-------------------------------------------------- + pDir=new Directory( dir_wrong_semantic ); printf( "Open a directory with a wrong semantic: "); @@ -511,9 +511,9 @@ void DirectoryOpenAndCloseTest( void ) printf( "\n" ); - //-------------------------------------------------- + // open an existing directory on a server - //-------------------------------------------------- + pDir=new Directory( dir_on_server ); @@ -531,9 +531,9 @@ void DirectoryOpenAndCloseTest( void ) delete pDir; printf( "\n" ); - //-------------------------------------------------- + // open a not existing directory on a server - //-------------------------------------------------- + pDir=new Directory( dir_not_exist_on_server ); @@ -547,9 +547,9 @@ void DirectoryOpenAndCloseTest( void ) delete pDir; printf( "\n" ); - //-------------------------------------------------- + // Close a not existing directory - //-------------------------------------------------- + pDir=new Directory( dir_not_exist ); printf( "Close a not existing directory: "); @@ -564,9 +564,9 @@ void DirectoryOpenAndCloseTest( void ) } -//-------------------------------------------------- + // DirectoryCreateAndRemoveTest -//-------------------------------------------------- + void DirectoryCreateAndRemoveTest( void ) { @@ -577,9 +577,9 @@ void DirectoryCreateAndRemoveTest( void ) printf( "Directory-Create-And-Remove-Test\n" ); printf( "--------------------------------------------\n\n" ); - //-------------------------------------------------- + // Create directory - //-------------------------------------------------- + printf( "Create a not existing directory: "); printFileName( dir_not_exist ); printf( "\n" ); @@ -597,9 +597,9 @@ void DirectoryCreateAndRemoveTest( void ) printf( "\n" ); - //-------------------------------------------------- + // Create a directory on a server - //-------------------------------------------------- + printf( "Create a not existing directory on a server: "); printFileName( dir_not_exist_on_server ); @@ -617,9 +617,9 @@ void DirectoryCreateAndRemoveTest( void ) printf( "\n" ); - //-------------------------------------------------- + // Remove Directories - //-------------------------------------------------- + printf( "Remove the created directories: \n" ); @@ -636,9 +636,9 @@ void DirectoryCreateAndRemoveTest( void ) printf( "\n" ); - //-------------------------------------------------- + // Remove a not existing directory - //-------------------------------------------------- + printf( "Remove a not existing directory: "); printFileName( dir_not_exist ); @@ -651,9 +651,9 @@ void DirectoryCreateAndRemoveTest( void ) return; } -//-------------------------------------------------- + // FileOpenAndCloseTest -//-------------------------------------------------- + static void FileOpenAndCloseTest( void ) { @@ -671,41 +671,41 @@ static void FileOpenAndCloseTest( void ) printFileName( file1 ); printf( "\n" ); - //-------------------------------------------------- + // open an existing file (Read) - //-------------------------------------------------- + rc=pFile->open( osl_File_OpenFlag_Read ); print_error( rtl::OString( "Open File (Read)" ), rc ); - //-------------------------------------------------- + // close the file - //-------------------------------------------------- + rc=pFile->close(); print_error( rtl::OString( "Close File" ), rc ); printf( "\n" ); - //-------------------------------------------------- + // open an existing file (Write) - //-------------------------------------------------- + rc=pFile->open( osl_File_OpenFlag_Write ); print_error( rtl::OString( "Open File (Write)" ), rc ); - //-------------------------------------------------- + // close the file - //-------------------------------------------------- + rc=pFile->close(); print_error( rtl::OString( "Close File" ), rc ); printf( "\n" ); - //-------------------------------------------------- + // close the file a second time - //-------------------------------------------------- + rc=pFile->close(); print_error( rtl::OString( "Close the file a second time" ), rc ); @@ -714,9 +714,9 @@ static void FileOpenAndCloseTest( void ) PressKey(); } -//-------------------------------------------------- + // FileCreateAndRemoveTest -//-------------------------------------------------- + void FileCreateAndRemoveTest() { @@ -733,39 +733,39 @@ void FileCreateAndRemoveTest() printFileName( file_not_exist ); printf( "\n" ); - //---------------------------------------------------- + // open (create) a not existing file (Read and write) - //---------------------------------------------------- + rc = pFile->open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ); print_error( rtl::OString( "Create and Open File (Read & Write)" ), rc ); - //---------------------------------------------------- + // close the file - //---------------------------------------------------- + rc=pFile->close(); print_error( rtl::OString( "Close File" ), rc ); - //---------------------------------------------------- + // remove the file - //---------------------------------------------------- + rc=pFile->remove( file_not_exist ); print_error( rtl::OString(" Remove File" ), rc ); printf( "\n" ); - //---------------------------------------------------- + // remove the same file a second time - //---------------------------------------------------- + rc=pFile->remove( file_not_exist ); print_error( rtl::OString( "Remove a not existing File" ), rc ); - //---------------------------------------------------- + // remove an open file - //---------------------------------------------------- + pFile->open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ); @@ -780,9 +780,9 @@ void FileCreateAndRemoveTest() return; } -//-------------------------------------------------- + // FileWriteAndReadTest -//-------------------------------------------------- + void FileWriteAndReadTest( void ) { @@ -806,9 +806,9 @@ void FileWriteAndReadTest( void ) printFileName( file_not_exist ); printf("\n"); - //---------------------------------------------------- + // open (create) a not existing file (Read and write) - //---------------------------------------------------- + rc = pFile->open( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ); @@ -816,9 +816,9 @@ void FileWriteAndReadTest( void ) printf( "\n" ); - //---------------------------------------------------- + // write a string to the file - //---------------------------------------------------- + rc=pFile->write( pWriteBuffer , nLen , uWritten ); print_error( rtl::OString( "Write File" ), rc ); @@ -829,18 +829,18 @@ void FileWriteAndReadTest( void ) printf( "\n" ); - //---------------------------------------------------- + // move the filepointer to the beginning - //---------------------------------------------------- + rc=pFile->setPos( osl_Pos_Absolut , 0 ); print_error( rtl::OString( "Set FilePointer to the beginning of the file" ), rc ); printf( "\n" ); - //---------------------------------------------------- + // read the string - //---------------------------------------------------- + pReadBuffer=(sal_Char*) rtl_allocateMemory( (sal_uInt32)(nLen+1)*sizeof(sal_Char) ); memset( pReadBuffer, 0, (sal_uInt32)(nLen+1)*sizeof(sal_Char) ); @@ -873,9 +873,9 @@ void FileWriteAndReadTest( void ) } -//-------------------------------------------------- + // FileCopyMoveTest -//-------------------------------------------------- + void FileCopyAndMoveTest( void ) { @@ -889,9 +889,9 @@ void FileCopyAndMoveTest( void ) File *pFile; rtl::OUString destPath(dir2); - //-------------------------------------------------- + // FileCopyTest - //-------------------------------------------------- + destPath+=rtl::OUString("/"); destPath+=file3; @@ -922,9 +922,9 @@ void FileCopyAndMoveTest( void ) printf( "\n" ); - //-------------------------------------------------- + // Copy a file to a not existing directory - //-------------------------------------------------- + destPath=rtl::OUString( dir_not_exist ); destPath+=rtl::OUString("/"); @@ -940,9 +940,9 @@ void FileCopyAndMoveTest( void ) printf( "\n" ); - //-------------------------------------------------- + // Copy a directory - //-------------------------------------------------- + printf( "Copy the directory: "); printFileName( dir1 ); @@ -955,9 +955,9 @@ void FileCopyAndMoveTest( void ) printf( "\n" ); - //-------------------------------------------------- + // FileMoveTest - //-------------------------------------------------- + destPath=rtl::OUString( dir2 ); destPath+=rtl::OUString("/"); @@ -1004,9 +1004,9 @@ void FileCopyAndMoveTest( void ) printf( "\n" ); - //-------------------------------------------------- + // Move a file to a not existing directory - //-------------------------------------------------- + destPath=rtl::OUString( dir_not_exist ); destPath+=rtl::OUString("/"); @@ -1024,9 +1024,9 @@ void FileCopyAndMoveTest( void ) printf( "\n" ); - //-------------------------------------------------- + // Move a directory - //-------------------------------------------------- + printf( "Move a directory: \n"); @@ -1050,9 +1050,9 @@ void FileCopyAndMoveTest( void ) return; } -//---------------------------------------------------- + // FileSizeTest -//---------------------------------------------------- + void FileSizeTest( void ) { @@ -1077,9 +1077,9 @@ void FileSizeTest( void ) if ( rc == FileBase::E_None ) { - //---------------------------------------------------- + // Set Filesize to 5000 - //---------------------------------------------------- + printf( "Set FileSize to 5000\n" ); rc=aFile.setSize( 5000 ); @@ -1088,9 +1088,9 @@ void FileSizeTest( void ) printf( "\n" ); printf( "Verify:\n" ); - //---------------------------------------------------- + // Check whether Filesize is set to 5000 - //---------------------------------------------------- + rc=DirectoryItem::get( file_not_exist, aItem ); print_error( rtl::OString( "Get DirectoryItem" ), rc ); @@ -1114,9 +1114,9 @@ void FileSizeTest( void ) printf( "\n" ); - //---------------------------------------------------- + // Set Filesize to -1 - //---------------------------------------------------- + printf( "Set FileSize to -1\n" ); rc=aFile.setSize( -1 ); @@ -1139,9 +1139,9 @@ void FileSizeTest( void ) } -//---------------------------------------------------- + // FilePointerTest -//---------------------------------------------------- + void FilePointerTest( void ) { @@ -1166,9 +1166,9 @@ void FilePointerTest( void ) if ( rc==FileBase::E_None ) { - //---------------------------------------------------- + // get the position of the filepointer - //---------------------------------------------------- + rc =rFile.getPos( filepointer ); print_error( rtl::OString( "GetPos" ), rc ); @@ -1176,9 +1176,9 @@ void FilePointerTest( void ) printf( "\n" ); - //---------------------------------------------------- + // set the filepointer at the end of a file - //---------------------------------------------------- + printf( "Set FileSize to 5000\n" ); rFile.setSize( 5000 ); @@ -1218,9 +1218,9 @@ void FilePointerTest( void ) return; } -//-------------------------------------------------- + // FileAttributesTest -//-------------------------------------------------- + void verifyFileAttributes( void ) { @@ -1408,9 +1408,9 @@ void FileAttributesTest( void ) } #endif -//-------------------------------------------------- + // FileTimeTest -//-------------------------------------------------- + void FileTimeTest( void ) { @@ -1472,17 +1472,17 @@ void FileTimeTest( void ) printf( "\nModifyTime \t : "); showTime( aModifyTime ); - //-------------------------------------------------- + // setTime - //-------------------------------------------------- + printf( "\n" ); rc=File::setTime( file1 , aCreationTime , aAccessTime , aModifyTime ); print_error( rtl::OString( "SetTime" ), rc ); - //-------------------------------------------------- + // Verify - //-------------------------------------------------- + FileStatus rStatus( osl_FileStatus_Mask_CreationTime | osl_FileStatus_Mask_AccessTime | osl_FileStatus_Mask_ModifyTime); @@ -1499,9 +1499,9 @@ void FileTimeTest( void ) if ( rc==FileBase::E_None ) { - //-------------------------------------------------- + // GetCreationTime - //-------------------------------------------------- + aCreationTimeRead=rStatus.getCreationTime(); #ifdef WNT @@ -1513,9 +1513,9 @@ void FileTimeTest( void ) showTime( aCreationTimeRead ); printf( "\n" ); #endif - //-------------------------------------------------- + // GetAccessTime - //-------------------------------------------------- + aAccessTimeRead=rStatus.getAccessTime(); @@ -1527,9 +1527,9 @@ void FileTimeTest( void ) showTime( aAccessTimeRead ); printf( "\n" ); - //-------------------------------------------------- + // GetModifyTime - //-------------------------------------------------- + aModifyTimeRead=rStatus.getModifyTime(); @@ -1548,9 +1548,9 @@ void FileTimeTest( void ) } -//-------------------------------------------------- + // DirectoryItemTest -//-------------------------------------------------- + void DirectoryItemTest( void ) { @@ -1564,9 +1564,9 @@ void DirectoryItemTest( void ) printf( "Directory-Item-Test\n" ); printf( "--------------------------------------------\n\n" ); - //-------------------------------------------------- + // get DirectoryItem from an existing directory - //-------------------------------------------------- + printf( "Get DirectoryItem from an existing Directory: "); printFileName( dir1 ); @@ -1589,9 +1589,9 @@ void DirectoryItemTest( void ) printf( "\n" ); - //-------------------------------------------------- + // get DirectoryItem from a not existing directory - //-------------------------------------------------- + printf( "Get DirectoryItem from a not existing Directory: "); printFileName( dir_not_exist ); @@ -1602,9 +1602,9 @@ void DirectoryItemTest( void ) printf( "\n" ); - //-------------------------------------------------- + // get DirectoryItem from an existing file - //-------------------------------------------------- + printf( "Get DirectoryItem from an existing File: "); printFileName( file1 ); @@ -1627,9 +1627,9 @@ void DirectoryItemTest( void ) printf( "\n" ); - //-------------------------------------------------- + // get DirectoryItem from a not existing file - //-------------------------------------------------- + printf( "Get DirectoryItem from a not existing File: "); printFileName( file_not_exist ); @@ -1640,9 +1640,9 @@ void DirectoryItemTest( void ) printf( "\n" ); - //---------------------------------------------------------- + // get DirectoryItem from a directory with a wrong semantic - //---------------------------------------------------------- + printf( "Get DirectoryItem from a Directory with a wrong semantic: "); printFileName( dir_not_exist ); @@ -1653,9 +1653,9 @@ void DirectoryItemTest( void ) printf( "\n" ); - //--------------------------------------------------- + // get DirectoryItem from a file-handle - //-------------------------------------------------- + pFile=new File( file1 ); @@ -1688,9 +1688,9 @@ void DirectoryItemTest( void ) printf( "\n" ); - //--------------------------------------------------- + // get DirectoryItem - //-------------------------------------------------- + printf( "Get DirectoryItem from an empty File-Handle\n" ); rc=DirectoryItem::get( file1 , aItem ); @@ -1698,9 +1698,9 @@ void DirectoryItemTest( void ) printf( "\n" ); - //-------------------------------------------------- + // GetNextItem from a directory - //-------------------------------------------------- + pDir=new Directory( dir1 ); printf( "Get next DirectoryItem from a directory: "); @@ -1714,9 +1714,9 @@ void DirectoryItemTest( void ) if ( pDir->isOpen() ) { - //-------------------------------------------------- + // get all files from the directory - //-------------------------------------------------- + rtl::OUString str; rtl::OUString str1[2]; @@ -1743,9 +1743,9 @@ void DirectoryItemTest( void ) printf( "\n" ); - //-------------------------------------------------- + // Reset-Test - //-------------------------------------------------- + for (int i=0; i<2; i++) { @@ -1774,9 +1774,9 @@ void DirectoryItemTest( void ) printf( "\n"); - //-------------------------------------------------- + // GetNextItem from a closed directory - //-------------------------------------------------- + printf( "Get next DirectoryItem from a closed directory: "); printFileName( dir1 ); @@ -1792,15 +1792,15 @@ void DirectoryItemTest( void ) return; } -//-------------------------------------------------- + // FileStatusTest (for different types) -//-------------------------------------------------- + void FileStatusTest( FileStatus *pStatus ) { - //-------------------------------------------------- + // GetFileType of the directory - //-------------------------------------------------- + FileStatus::Type aType; @@ -1808,9 +1808,9 @@ void FileStatusTest( FileStatus *pStatus ) aType=pStatus->getFileType(); showFileType( aType ); - //-------------------------------------------------- + // GetAttributes - //-------------------------------------------------- + sal_uInt64 uAttributes; @@ -1818,9 +1818,9 @@ void FileStatusTest( FileStatus *pStatus ) uAttributes=pStatus->getAttributes(); showAttributes( uAttributes ); - //-------------------------------------------------- + // GetCreationTime - //-------------------------------------------------- + TimeValue aCreationTime; @@ -1830,9 +1830,9 @@ void FileStatusTest( FileStatus *pStatus ) printf( "CreationTime: " ); showTime( aCreationTime ); - //-------------------------------------------------- + // GetAccessTime - //-------------------------------------------------- + TimeValue aAccessTime; @@ -1842,9 +1842,9 @@ void FileStatusTest( FileStatus *pStatus ) printf( "AccessTime: " ); showTime( aAccessTime ); - //-------------------------------------------------- + // GetModifyTime - //-------------------------------------------------- + TimeValue aModifyTime; @@ -1854,9 +1854,9 @@ void FileStatusTest( FileStatus *pStatus ) printf( "ModifyTime: " ); showTime( aModifyTime ); - //-------------------------------------------------- + // GetFileSize - //-------------------------------------------------- + sal_uInt64 FileSize; @@ -1865,9 +1865,9 @@ void FileStatusTest( FileStatus *pStatus ) FileSize=pStatus->getFileSize(); printf( "FileSize: %" SAL_PRIuUINT64 "\n", FileSize); - //-------------------------------------------------- + // GetFileName - //-------------------------------------------------- + rtl::OUString FileName; @@ -1878,9 +1878,9 @@ void FileStatusTest( FileStatus *pStatus ) printFileName( FileName ); printf( "\n" ); - //-------------------------------------------------- + // GetFileURL - //-------------------------------------------------- + rtl::OUString FileURL; @@ -1891,9 +1891,9 @@ void FileStatusTest( FileStatus *pStatus ) printFileName( FileURL ); printf( "\n" ); - //-------------------------------------------------- + // GetLinkTargetURL - //-------------------------------------------------- + rtl::OUString LinkTargetURL; @@ -1907,9 +1907,9 @@ void FileStatusTest( FileStatus *pStatus ) return; } -//-------------------------------------------------- + // DirectoryFileStatusTest -//-------------------------------------------------- + void DirectoryFileStatusTest( void ) { @@ -1946,9 +1946,9 @@ void DirectoryFileStatusTest( void ) return; } -//-------------------------------------------------- + // FileFileStatusTest -//-------------------------------------------------- + void FileFileStatusTest( void ) { @@ -1985,9 +1985,9 @@ void FileFileStatusTest( void ) return; } -//-------------------------------------------------- + // VolumeFileStatusTest -//-------------------------------------------------- + void VolumeFileStatusTest( void ) { @@ -2025,9 +2025,9 @@ void VolumeFileStatusTest( void ) } -//-------------------------------------------------- + // VolumeInfoTest -//-------------------------------------------------- + void VolumeInfoTest( void ) { @@ -2048,67 +2048,67 @@ void VolumeInfoTest( void ) printf( "\n" ); - //-------------------------------------------------- + // getRemoteFlag - //-------------------------------------------------- + if ( rInfo.getRemoteFlag() ) printf( "RemoteFlag: Yes\n" ); else printf( "RemoteFlag: No\n" ); - //-------------------------------------------------- + // getRemoveableFlag - //-------------------------------------------------- + if ( rInfo.getRemoveableFlag() ) printf( "RemoveableFlag: Yes\n" ); else printf( "RemoveableFlag: No\n" ); - //-------------------------------------------------- + // getTotalSpace - //-------------------------------------------------- + sal_uInt64 TotalSpace; TotalSpace=rInfo.getTotalSpace(); printf( "Total Space: %" SAL_PRIuUINT64 "\n",TotalSpace ); - //-------------------------------------------------- + // getFreeSpace - //-------------------------------------------------- + sal_uInt64 FreeSpace; FreeSpace=rInfo.getFreeSpace(); printf( "Free Space: %" SAL_PRIuUINT64 "\n",FreeSpace ); - //-------------------------------------------------- + // getUsedSpace - //-------------------------------------------------- + sal_uInt64 UsedSpace; UsedSpace=rInfo.getUsedSpace(); printf( "Used Space: %" SAL_PRIuUINT64 "\n",UsedSpace ); - //-------------------------------------------------- + // getMaxNameLength - //-------------------------------------------------- + sal_uInt32 MaxNameLength; MaxNameLength=rInfo.getMaxNameLength(); printf( "MaxNameLength: %" SAL_PRIuUINT32 "\n",MaxNameLength ); - //-------------------------------------------------- + // getMaxPathLength - //-------------------------------------------------- + sal_uInt32 MaxPathLength; MaxPathLength=rInfo.getMaxPathLength(); printf( "MaxPathLength: %" SAL_PRIuUINT32 "\n",MaxPathLength ); - //-------------------------------------------------- + // getFileSystemName - //-------------------------------------------------- + rtl::OUString FileSystemName; FileSystemName=rInfo.getFileSystemName(); @@ -2120,9 +2120,9 @@ void VolumeInfoTest( void ) return; } -//-------------------------------------------------- + // FileBaseTest -//-------------------------------------------------- + void ConvertPathTest(rtl::OUString& strPath) { @@ -2133,9 +2133,9 @@ void ConvertPathTest(rtl::OUString& strPath) rtl::OUString strNormPathFromFileURL; rtl::OUString strSystemPath; - //-------------------------------------------------- + // normalizePath - //-------------------------------------------------- + rc=FileBase::getFileURLFromSystemPath( strPath, strNormPath ); @@ -2148,9 +2148,9 @@ void ConvertPathTest(rtl::OUString& strPath) else printf( "normalizePath: Error \n" ); - //-------------------------------------------------- + // getFileURLFromSystemPath - //-------------------------------------------------- + if ( !strNormPath.isEmpty() ) { @@ -2168,9 +2168,9 @@ void ConvertPathTest(rtl::OUString& strPath) else printf( "getFileURLFromSystemPath: not tested \n" ); - //-------------------------------------------------- + // getNormalizedPathFromFileURL - //-------------------------------------------------- + if ( !strFileURL.isEmpty() ) { @@ -2189,9 +2189,9 @@ void ConvertPathTest(rtl::OUString& strPath) printf( "getNormalizedPathFromFileURL: not tested \n" ); - //-------------------------------------------------- + // getSystemPathFromFileURL - //-------------------------------------------------- + if ( !strNormPath.isEmpty() ) { @@ -2209,9 +2209,9 @@ void ConvertPathTest(rtl::OUString& strPath) else printf( "getSystemPathFromFileURL: not tested \n" ); - //-------------------------------------------------- + // Verify - //-------------------------------------------------- + if ( strNormPathFromFileURL == strNormPath ) printf( "\nVerify: OK ! ( Normalized-Path == Normalized-Path-From-File-URL )\n" ); @@ -2227,9 +2227,9 @@ void FileBaseTest() printf( "FileBase-Test\n" ); printf( "--------------------------------------------\n\n" ); - //-------------------------------------------------- + // ConvertPath-Test (Local File) - //-------------------------------------------------- + printf( "- Local File: "); printFileName( file1 ); @@ -2237,9 +2237,9 @@ void FileBaseTest() ConvertPathTest(file1); - //-------------------------------------------------- + // ConvertPath-Test (File on a server) - //-------------------------------------------------- + printf( "\n- File on server: "); printFileName( file_on_server ); @@ -2252,9 +2252,9 @@ void FileBaseTest() } -//-------------------------------------------------- + // AbsolutePathTest -//-------------------------------------------------- + void DoAbsolutePathTest(rtl::OUString strDirBase, rtl::OUString strRelative) { FileBase::RC rc; @@ -2304,9 +2304,9 @@ void AbsolutePathTest(void) } -//-------------------------------------------------- + // searchPathTest -//-------------------------------------------------- + void SearchPathTest(void) { @@ -2327,9 +2327,9 @@ void SearchPathTest(void) rc=FileBase::getSystemPathFromFileURL( strNormPath, strSystemPath ); print_error( rtl::OString( "getSystemPathFromFileURL" ), rc ); - //-------------------------------------------------- + // searchFileURL (with a normalized path) - //-------------------------------------------------- + if ( !strNormPath.isEmpty() ) { @@ -2351,9 +2351,9 @@ void SearchPathTest(void) else printf( "searchFileURL (with a normalized path): not tested\n" ); - //-------------------------------------------------- + // searchFileURL (with a File-URL) - //-------------------------------------------------- + if ( !strFileURL.isEmpty() ) { @@ -2375,9 +2375,9 @@ void SearchPathTest(void) else printf( "searchFileURL (with a FileURL path): not tested\n" ); - //-------------------------------------------------- + // searchFileURL (with a systempath) - //-------------------------------------------------- + if ( !strSystemPath.isEmpty() ) { @@ -2399,9 +2399,9 @@ void SearchPathTest(void) else printf( "searchFileURL (with a systempath): not tested\n" ); - //-------------------------------------------------- + // searchFileURL (File and no searchpath) - //-------------------------------------------------- + printf( "\nsearchFileURL: File (no searchpath) : "); printFileName( file3 ); @@ -2418,9 +2418,9 @@ void SearchPathTest(void) else printf( "searchFileURL: File not found: OK ! \n" ); - //-------------------------------------------------- + // searchFileURL (File and Path) - //-------------------------------------------------- + printf( "\nsearchFileURL: File : "); printFileName( file3 ); @@ -2439,9 +2439,9 @@ void SearchPathTest(void) else printf( "searchFileURL: File not found: Error\n" ); - //------------------------------------------------------------ + // searchFileURL (File and searchpath with two entries) - //------------------------------------------------------------ + rtl::OUString strSearchPath( dir_not_exist ); strSearchPath+=rtl::OUString(";"); @@ -2464,9 +2464,9 @@ void SearchPathTest(void) else printf( "searchFileURL: File not found: Error\n" ); - //------------------------------------------------------------------- + // searchFileURL (File and searchpath (with a wrong semantic)) - //------------------------------------------------------------------- + strSearchPath=rtl::OUString( dir_wrong_semantic ); @@ -2486,9 +2486,9 @@ void SearchPathTest(void) return; } -//-------------------------------------------------- + // CanonicalNameTest -//-------------------------------------------------- + void getCanonicalNameTest(rtl::OUString strPath) { @@ -2531,9 +2531,9 @@ void CanonicalNameTest(void) return; } -//-------------------------------------------------- + // print_error -//-------------------------------------------------- + void print_error( const ::rtl::OString& str, FileBase::RC rc ) { @@ -2680,9 +2680,9 @@ void print_error( const ::rtl::OString& str, FileBase::RC rc ) return; } -//-------------------------------------------------- + // main -//-------------------------------------------------- + #if defined WNT #define MAIN _cdecl main #else |