configlib/dbmsjdbc/src/native/StoreInputStream.cpp
author terytkon
Thu, 11 Mar 2010 18:20:56 +0200
changeset 1 b538b70cbe51
permissions -rw-r--r--
Move rest of the swconfigmdw package components to oss repository. -Changed sfl licences to epl.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     1
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     2
// All rights reserved.
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     3
// This component and the accompanying materials are made available
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     5
// which accompanies this distribution, and is available
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     7
//
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     8
// Initial Contributors:
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    10
//
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    11
// Contributors:
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    12
//
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    13
// Description:
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    14
//
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    15
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    16
#include <jni.h>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    17
#include <stdio.h>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    18
#include "dbmsjni/com_symbian_store_StoreInputStream.h"
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    19
#include "StoreInputStream.h"
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    20
#include "Utils.h"
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    21
#include "errortranslator.h"
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    22
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    23
#define THROW_IOE_IF_ERROR(a,jni) if ( a != KErrNone ) {\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    24
	TBuf8<256> exception;\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    25
	TBuf8<256> message;\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    26
	GetException(a, exception, message);\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    27
	exception.Append('\0');\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    28
	message.Append('\0');\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    29
	ThrowExc(jni, exception, message);\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    30
	return a;\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    31
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    32
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    33
#define THROW_IOE_IF_ERROR_STR(a,jni) if ( a != KErrNone ) {\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    34
	TBuf8<256> exception;\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    35
	TBuf8<256> message;\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    36
	GetException(a, exception, message);\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    37
	exception.Append('\0');\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    38
	message.Append('\0');\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    39
	ThrowExc(jni, exception, message);\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    40
	return NULL;\
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    41
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    42
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    43
// //
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    44
// StoreInputStream class implementation
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    45
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    46
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    47
// //
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    48
// JNI implementations
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    49
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    50
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    51
JNIEXPORT void JNICALL Java_com_symbian_store_StoreInputStream__1close
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    52
  (JNIEnv *, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    53
	StoreInputStream* stream = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    54
	stream->iInput->Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    55
	delete stream->iInput;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    56
	delete stream;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    57
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    58
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    59
//*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    60
// * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    61
// * Method:    _create
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    62
// * Signature: (I)I
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    63
// */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    64
//JNIEXPORT jint JNICALL Java_com_symbian_store_StoreInputStream__1create
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    65
//  (JNIEnv *, jobject, jint aStorePeerHandle, jint aStrId) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    66
//	StreamStore* streamStore = (StreamStore*)aStorePeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    67
//	StoreInputStream* inStream = new StoreInputStream();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    68
//	inStream->iInput = new RStoreReadStream();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    69
//	TStreamId id ( aStrId);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    70
//	TRAPD(error, inStream->iInput->OpenL(*(streamStore->iStore), id));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    71
//	if ( error < 0 ) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    72
//		return error;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    73
//	}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    74
//	return (jint)inStream;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    75
//}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    76
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    77
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    78
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    79
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    80
 * Method:    _readByte
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    81
 * Signature: (I)I
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    82
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    83
JNIEXPORT jint JNICALL Java_com_symbian_store_StoreInputStream__1readByte
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    84
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    85
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    86
	jint result = 0;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    87
	TRAPD(err, result = os->iInput->ReadInt8L());
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    88
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    89
	return result;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    90
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    91
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    92
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    93
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    94
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    95
 * Method:    _readBytes
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    96
 * Signature: (I[BII)I
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    97
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    98
JNIEXPORT jint JNICALL Java_com_symbian_store_StoreInputStream__1readBytes
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    99
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jbyteArray aBuffer, jint aFrom, jint aLen) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   100
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   101
	RBuf8 buf;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   102
	TRAPD(err, buf.CreateL(aLen));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   103
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   104
	TRAP(err, os->iInput->ReadL(buf));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   105
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   106
	aEnv->SetByteArrayRegion(aBuffer, aFrom, aLen, (jbyte*)(buf.Ptr()));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   107
	buf.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   108
	return aLen;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   109
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   110
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   111
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   112
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   113
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   114
 * Method:    _readInt16
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   115
 * Signature: (I)S
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   116
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   117
JNIEXPORT jshort JNICALL Java_com_symbian_store_StoreInputStream__1readInt16
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   118
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   119
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   120
	jshort result = 0;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   121
	TRAPD(err, result = os->iInput->ReadInt16L());
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   122
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   123
	return result;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   124
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   125
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   126
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   127
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   128
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   129
 * Method:    _readInt32
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   130
 * Signature: (I)I
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   131
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   132
JNIEXPORT jint JNICALL Java_com_symbian_store_StoreInputStream__1readInt32
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   133
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   134
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   135
	jint result = 0;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   136
	TRAPD(err, result = os->iInput->ReadInt32L());
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   137
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   138
	return result;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   139
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   140
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   141
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   142
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   143
 * Method:    _readInt8
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   144
 * Signature: (I)B
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   145
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   146
JNIEXPORT jbyte JNICALL Java_com_symbian_store_StoreInputStream__1readInt8
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   147
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   148
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   149
	jbyte result = 0;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   150
	TRAPD(err, result = os->iInput->ReadInt8L());
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   151
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   152
	return result;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   153
  }
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   154
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   155
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   156
 * Method:    _readReal32
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   157
 * Signature: (I)F
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   158
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   159
JNIEXPORT jfloat JNICALL Java_com_symbian_store_StoreInputStream__1readReal32
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   160
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   161
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   162
	jfloat result = 0;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   163
	TRAPD(err, result = os->iInput->ReadReal32L());
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   164
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   165
	return result;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   166
  }
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   167
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   168
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   169
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   170
 * Method:    _readReal64
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   171
 * Signature: (I)D
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   172
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   173
JNIEXPORT jdouble JNICALL Java_com_symbian_store_StoreInputStream__1readReal64
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   174
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   175
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   176
	jdouble result = 0;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   177
	TRAPD(err, result = os->iInput->ReadReal64L());
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   178
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   179
	return result;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   180
  }
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   181
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   182
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   183
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   184
 * Method:    _readUInt32
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   185
 * Signature: (I)J
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   186
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   187
JNIEXPORT jlong JNICALL Java_com_symbian_store_StoreInputStream__1readUInt32
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   188
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   189
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   190
	jlong result = 0;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   191
	TRAPD(err, result = os->iInput->ReadUint32L());
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   192
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   193
	return result;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   194
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   195
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   196
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   197
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   198
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   199
 * Method:    _readUInt16
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   200
 * Signature: (I)I
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   201
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   202
JNIEXPORT jint JNICALL Java_com_symbian_store_StoreInputStream__1readUInt16
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   203
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   204
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   205
	jint result = 0;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   206
	TRAPD(err, result = os->iInput->ReadUint16L());
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   207
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   208
	return result;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   209
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   210
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   211
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   212
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   213
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   214
 * Method:    _readUInt8
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   215
 * Signature: (I)S
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   216
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   217
JNIEXPORT jshort JNICALL Java_com_symbian_store_StoreInputStream__1readUInt8
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   218
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   219
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   220
	jshort result = 0;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   221
	TRAPD(err, result = os->iInput->ReadUint8L());
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   222
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   223
	return result;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   224
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   225
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   226
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   227
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   228
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   229
 * Method:    _readDes16
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   230
 * Signature: (II)Ljava/lang/String;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   231
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   232
JNIEXPORT jstring JNICALL Java_com_symbian_store_StoreInputStream__1readDes16__II
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   233
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jint aLen) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   234
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   235
	RBuf16 buf;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   236
	TRAPD(err, buf.CreateL(aLen));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   237
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   238
	TRAP(err, os->iInput->ReadL(buf, aLen));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   239
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   240
	jstring string = CreateJavaString(aEnv, buf);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   241
	buf.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   242
	return string;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   243
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   244
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   245
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   246
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   247
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   248
 * Method:    _readDes16
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   249
 * Signature: (I[SI)I
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   250
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   251
JNIEXPORT jint JNICALL Java_com_symbian_store_StoreInputStream__1readDes16__I_3SI
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   252
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jshortArray aBuffer, jint aLen) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   253
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   254
	RBuf16 buf;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   255
	TRAPD(err, buf.CreateL(aLen));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   256
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   257
	TRAP(err, os->iInput->ReadL(buf));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   258
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   259
	aEnv->SetShortArrayRegion(aBuffer, 0, aLen, (jshort*)(buf.Ptr()));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   260
	buf.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   261
	return aLen;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   262
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   263
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   264
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   265
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   266
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   267
 * Method:    _readDes16
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   268
 * Signature: (IC)Ljava/lang/String;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   269
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   270
JNIEXPORT jstring JNICALL Java_com_symbian_store_StoreInputStream__1readDes16__IC
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   271
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jchar aDelimiter) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   272
	THROW_IOE_IF_ERROR_STR(KErrNotSupported, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   273
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   274
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   275
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   276
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   277
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   278
 * Method:    _readDes16
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   279
 * Signature: (I[SC)I
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   280
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   281
JNIEXPORT jint JNICALL Java_com_symbian_store_StoreInputStream__1readDes16__I_3SC
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   282
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jshortArray aArray, jchar aDelimiter) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   283
	THROW_IOE_IF_ERROR(KErrNotSupported, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   284
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   285
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   286
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   287
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   288
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   289
 * Method:    _readDes8
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   290
 * Signature: (I[BC)I
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   291
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   292
JNIEXPORT jint JNICALL Java_com_symbian_store_StoreInputStream__1readDes8
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   293
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jbyteArray aArray, jchar aDelimiter) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   294
	THROW_IOE_IF_ERROR(KErrNotSupported, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   295
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   296
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   297
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   298
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   299
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   300
 * Method:    _readDes8String
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   301
 * Signature: (IC)Ljava/lang/String;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   302
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   303
JNIEXPORT jstring JNICALL Java_com_symbian_store_StoreInputStream__1readDes8String__IC
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   304
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jchar aDelimiter) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   305
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   306
	RBuf16 buf;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   307
	RBuf8 buf8;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   308
	TInt mxlen = 8192;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   309
	TRAPD(err, buf.CreateL(mxlen));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   310
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   311
	TRAP(err, buf8.CreateL(mxlen));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   312
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   313
	TChar ch(aDelimiter);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   314
	TRAP(err, os->iInput->ReadL(buf8, ch));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   315
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   316
	buf.Copy(buf8);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   317
	jstring string = CreateJavaString(aEnv, buf);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   318
	buf.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   319
	buf8.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   320
	return string;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   321
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   322
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   323
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   324
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   325
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   326
 * Method:    _readDes8String
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   327
 * Signature: (II)Ljava/lang/String;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   328
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   329
JNIEXPORT jstring JNICALL Java_com_symbian_store_StoreInputStream__1readDes8String__II
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   330
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jint aLen) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   331
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   332
	RBuf16 buf;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   333
	RBuf8 buf8;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   334
	TRAPD(err, buf.CreateL(aLen));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   335
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   336
	TRAP(err, buf8.CreateL(aLen));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   337
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   338
	TRAP(err, os->iInput->ReadL(buf8));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   339
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   340
	buf.Copy(buf8);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   341
	jstring string = CreateJavaString(aEnv, buf);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   342
	buf.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   343
	buf8.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   344
	return string;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   345
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   346
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   347
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   348
void doReadCardinalityL(JNIEnv *aEnv, jobject, jint aPeerHandle, TCardinality& card) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   349
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   350
	(*(os->iInput))>>card;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   351
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   352
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   353
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   354
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   355
 * Method:    _readCardinality
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   356
 * Signature: (I)I
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   357
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   358
JNIEXPORT jint JNICALL Java_com_symbian_store_StoreInputStream__1readCardinality
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   359
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   360
	TCardinality card;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   361
	TRAPD(err, doReadCardinalityL(aEnv, NULL, aPeerHandle, card));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   362
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   363
	return card;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   364
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   365
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   366
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   367
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   368
 * Method:    _readBuf8
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   369
 * Signature: (I)Ljava/lang/String;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   370
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   371
JNIEXPORT jstring JNICALL Java_com_symbian_store_StoreInputStream__1readBuf8
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   372
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jint aMaxSize) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   373
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   374
	RBuf8 buf;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   375
	TRAPD(err, buf.CreateL(aMaxSize));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   376
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   377
	TRAP(err, InternalizeL(buf, *(os->iInput)) );
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   378
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   379
	RBuf buf16;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   380
	TRAP(err, buf16.CreateL(aMaxSize));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   381
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   382
	buf16.Copy(buf);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   383
	jstring string = CreateJavaString(aEnv, buf16);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   384
	buf.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   385
	buf16.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   386
	return string;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   387
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   388
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   389
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   390
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   391
 * Method:    _readBuf16
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   392
 * Signature: (I)Ljava/lang/String;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   393
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   394
JNIEXPORT jstring JNICALL Java_com_symbian_store_StoreInputStream__1readBuf16
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   395
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jint aMaxSize) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   396
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   397
	RBuf16 buf;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   398
	TRAPD(err, buf.CreateL(aMaxSize));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   399
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   400
	TRAP(err, InternalizeL(buf, *(os->iInput)) );
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   401
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   402
	jstring string = CreateJavaString(aEnv, buf);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   403
	buf.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   404
	return string;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   405
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   406
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   407
JNIEXPORT jbyteArray JNICALL Java_com_symbian_store_StoreInputStream__1readBuf8Raw
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   408
  (JNIEnv *aEnv, jobject, jint aPeerHandle, jint aMaxSize) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   409
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   410
	RBuf8 buf;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   411
	TRAPD(err, buf.CreateL(aMaxSize));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   412
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   413
	TRAP(err, InternalizeL(buf, *(os->iInput)) );
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   414
	THROW_IOE_IF_ERROR_STR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   415
	jbyteArray buffer = aEnv->NewByteArray(buf.Length());
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   416
	aEnv->SetByteArrayRegion(buffer, 0, buf.Length(), (jbyte *)(buf.Ptr()));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   417
	buf.Close();
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   418
	return buffer;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   419
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   420
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   421
void doReadInt64L(JNIEnv *aEnv, jobject, jint aPeerHandle, TInt64& value) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   422
	StoreInputStream* os = (StoreInputStream*)aPeerHandle;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   423
	(*(os->iInput))>>value;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   424
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   425
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   426
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   427
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   428
 * Method:    _readInt64
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   429
 * Signature: (I)J
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   430
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   431
JNIEXPORT jlong JNICALL Java_com_symbian_store_StoreInputStream__1readInt64
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   432
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   433
	TInt64 value;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   434
	TRAPD(err, doReadInt64L(aEnv, NULL, aPeerHandle, value));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   435
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   436
	return (jlong)value;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   437
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   438
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   439
/*
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   440
 * Class:     com_symbian_store_StoreInputStream
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   441
 * Method:    _readUInt64
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   442
 * Signature: (I)J
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   443
 */
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   444
JNIEXPORT jlong JNICALL Java_com_symbian_store_StoreInputStream__1readUInt64
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   445
  (JNIEnv *aEnv, jobject, jint aPeerHandle) {
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   446
	// cant read TUint64 as that is not supported by stream. Must read Int64 instead
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   447
	TInt64 value;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   448
	TRAPD(err, doReadInt64L(aEnv, NULL, aPeerHandle, value));
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   449
	THROW_IOE_IF_ERROR(err, aEnv);
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   450
	return (jlong)value;
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   451
}
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   452