diff options
Diffstat (limited to 'soltools/testSHL/inc')
-rw-r--r-- | soltools/testSHL/inc/tlog.hxx | 100 | ||||
-rw-r--r-- | soltools/testSHL/inc/tstMgr.hxx | 73 | ||||
-rw-r--r-- | soltools/testSHL/inc/tutil.hxx | 49 |
3 files changed, 222 insertions, 0 deletions
diff --git a/soltools/testSHL/inc/tlog.hxx b/soltools/testSHL/inc/tlog.hxx new file mode 100644 index 000000000000..acae18be7e9f --- /dev/null +++ b/soltools/testSHL/inc/tlog.hxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SOLTOOLS_TESTSHL_TLOG_HXX__ +#define _SOLTOOLS_TESTSHL_TLOG_HXX__ + +#include <osl/file.hxx> +#include <rtl/tres.hxx> + +#ifndef _SOLTOOLS_TESTSHL_TUTIL_HXX_ +#include "tutil.hxx" +#endif + +#include <iostream> + +using namespace std; + +// <namespace_tstutl> +namespace tstutl { + +// <class_tLog> +class tLog { + + // <private_members> + ::osl::File* m_logfile; // fileobject + ::rtl::OUString m_logname; // name of log + // </private_members> + + // <private_methods> + void initialize( const ::rtl::OString& name ); + // </private_methods> + +public: + + // <public_ctors> + tLog() : m_logfile( 0 ) { + } + + tLog( const sal_Char* name ) { + if( name ) { + initialize( name ); + } + else { + m_logfile = 0; + } + + } + // </public_ctors> + + // <dtor> + virtual ~tLog() { + if ( m_logfile ) { + m_logfile->close(); + delete( m_logfile ); + } + } // </dtor> + + // <public_methods> + inline ::rtl::OUString& getName() { return m_logname; } + inline ::osl::File* getFile() { return m_logfile; } + + // open logfile for overwrite (default) or append + ::osl::FileBase::RC open( sal_Bool append = sal_False ); + ::osl::FileBase::RC close(); + + ::osl::FileBase::RC writeRes( ::rtl::TestResult& oRes, sal_Bool v = sal_False , + sal_Bool xml = sal_False ); + + // write methods without (default) or with echo on display + ::osl::FileBase::RC write( const sal_Char* buf, sal_Bool v = sal_False ); + // </public_methods> + +}; // </class_tLog> + +} // </namespace_tstutl> + +#endif diff --git a/soltools/testSHL/inc/tstMgr.hxx b/soltools/testSHL/inc/tstMgr.hxx new file mode 100644 index 000000000000..208714322395 --- /dev/null +++ b/soltools/testSHL/inc/tstMgr.hxx @@ -0,0 +1,73 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SOLTOOLS_TESTSHL_TSTMGR_HXX__ +#define _SOLTOOLS_TESTSHL_TSTMGR_HXX__ + +#include <sal/types.h> + +#include <vector> + +using namespace std; + +// <namespace_tstutl> +namespace tstutl { + +// <class_tstMgr> +class tstMgr { + + // <private_members> + struct tstMgr_Impl; + tstMgr_Impl* pImpl; + // </private_members> + + // <private_methods> + void cleanup(); + // </private_methods> + +public: + + // <dtor> + ~tstMgr(){ + cleanup(); + } // </dtor> + + + // <public_methods> + sal_Bool initialize( sal_Char* moduleName, sal_Bool boom = sal_False ); + sal_Bool test_Entry( sal_Char* entry, sal_Char* logName = 0 ); + sal_Bool test_Entries( vector< sal_Char* > entries, sal_Char* logName = 0 ); + sal_Bool test_EntriesFromFile( sal_Char* fName, sal_Char* logName = 0 ); + // </public_methods> + +}; // </class_tstMgr> + +} // </namespace_tstutl> + +#endif + + + diff --git a/soltools/testSHL/inc/tutil.hxx b/soltools/testSHL/inc/tutil.hxx new file mode 100644 index 000000000000..37398a72381a --- /dev/null +++ b/soltools/testSHL/inc/tutil.hxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SOLTOOLS_TESTSHL_TUTIL_HXX_ +#define _SOLTOOLS_TESTSHL_TUTIL_HXX__ + +#include <osl/file.hxx> + +using namespace std; + +#include <vector> + +// <namespace_tstutl> +namespace tstutl { + +sal_uInt32 getEntriesFromFile( sal_Char* fName, vector< sal_Char* >& entries ); +::rtl::OUString cnvrtPth( ::rtl::OString sysPth ); + +// string copy, cat, len methods +sal_Char* cpy( sal_Char** dest, const sal_Char* src ); +sal_Char* cat( const sal_Char* str1, const sal_Char* str2 ); +sal_uInt32 ln( const sal_Char* str ); + +} // </namespace_tstutl> + +#endif |