25#include <rtl/ustring.hxx>
26#include <rtl/string.hxx>
36 LogFile( JNIEnv* env, jstring streamName,
const char* _pAsciiSuffix );
39 void writeString(
const char* _pString,
bool _bEndLine =
true );
40 void create() { getLogFile(); }
47 class OperationLogFile :
public LogFile
50 OperationLogFile( JNIEnv* env, jstring streamName,
const char* _pAsciiSuffix )
51 :LogFile(
env, streamName, ( OString( _pAsciiSuffix ) +=
".op" ).getStr() )
55 void logOperation(
const char* _pOp )
60 void logOperation(
const char* _pOp, jlong _nLongArg )
62 OString sLine( _pOp );
64 sLine += OString::number( _nLongArg );
69 void logReturn( jlong _nRetVal )
71 OString sLine(
" -> " );
72 sLine += OString::number( _nRetVal );
76 void logReturn( jint _nRetVal )
78 OString sLine(
" -> " );
79 sLine += OString::number( _nRetVal );
85 writeString(
"-------------------------------",
true );
91 class DataLogFile :
public LogFile
94 DataLogFile( JNIEnv* env, jstring streamName,
const char* _pAsciiSuffix )
95 :LogFile(
env, streamName, _pAsciiSuffix )
99 void write( jint value )
101 fputc( value, getLogFile() );
102 fflush( getLogFile() );
105 void write(
const sal_Int8* buffer, sal_Int32 bytesRead )
107 fwrite( buffer,
sizeof(
sal_Int8), bytesRead, getLogFile() );
108 fflush( getLogFile() );
111 sal_Int64 seek( sal_Int64 pos )
113 FILE* pFile = getLogFile();
114 fseek( pFile, 0, SEEK_END );
115 if ( ftell( pFile ) < pos )
118 while ( ftell( pFile ) < pos )
119 fwrite( &filler,
sizeof(
sal_Int8 ), 1, pFile );
122 fseek( pFile, pos, SEEK_SET );
123 return ftell( pFile );
128 return ftell( getLogFile() );
const css::uno::Reference< css::xml::crypto::XSecurityEnvironment > & env
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
sal_uInt32 writeString(sal_uInt8 *buffer, const sal_Unicode *v)