1 /* 2 ------------------------------------------------------------------------ 3 Copyright (C) 2002-2004 Keith Stribley 4 5 Distributable under the terms of either the Common Public License or the 6 GNU Lesser General Public License, as specified in the LICENSING.txt file. 7 8 File: TecKitJni.h 9 Responsibility: Keith Stribley 10 Last reviewed: Not yet. 11 12 Description: 13 Implements a JNI interface to the TECkit conversion engine. 14 -------------------------------------------------------------------------*/ 15 16 #ifndef TecKitJni_h 17 #define TecKitJni_h 18 #include "TECkit_Engine.h" 19 20 21 class TecKitJni 22 { 23 public: 24 TecKitJni(); 25 ~TecKitJni() ; 26 bool openMapping(const char * fileName, bool toUnicode); 27 bool openMapping(const char* fileName, bool toUnicode, UInt16 sourceForm, UInt16 targetForm); 28 char * convert(const char * input); 29 char * convert(const char* input, UInt32 inLength); 30 void flush(); getOutputBuffer()31 Byte * getOutputBuffer() { return outputBuffer;}; getOutputLength()32 UInt32 getOutputLength() { return outputLength;}; 33 private: 34 TECkit_Converter converter; 35 bool toUnicode; 36 Byte * mapBuffer; 37 Byte * outputBuffer; 38 UInt32 outputLength; 39 UInt32 maxOutputLength; 40 char * inputBuffer; 41 UInt32 maxInputLength; 42 }; 43 44 #endif 45