The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PerlUtil - a C++ utility class for Perl/Symbian

SYNOPSIS

   // in your App.mmp
   USERINCLUDE  \symbian\perl\x.y.z\include
   LIBRARY      perlXYZ.lib

   // in your App
   #include "PerlUtil.h" // includes also EXTERN.h and perl.h

   // Static methods for moving between Perl strings (SvPV)
   // and Symbian strings (HBufC and TDes).

   static SV*      newSvPVfromTDesC8(const TDesC8& aDes);
   static void     setSvPVfromTDesC8(SV* sv, const TDesC8& aDes);
   static HBufC8*  newHBufC8fromSvPV(SV* sv);
   static void     setTDes8fromSvPV(TDes8* aDes8, SV* sv);

   static SV*      newSvPVfromTDesC16(const TDesC16& aDes);
   static void     setSvPVfromTDesC16(SV* sv, const TDesC16& aDes);
   static HBufC16* newHBufC16fromSvPV(SV* sv);
   static void     setTDes16fromSvPV(TDes16* aDes16, SV* sv);

   static HBufC8*  newHBufC8fromPVn(const U8* s, STRLEN n);
   static void     setTDes8fromPVn(TDes8* aDes8, const U8* s, STRLEN n);
   static HBufC16* newHBufC16fromPVn(const U8* s, STRLEN n, bool utf8);
   static void  setTDes16fromPVn(TDes16* aDes16, const U8* s, STRLEN n);

   // An example

   const U8* s = (const U8 *)"foo";
   HBufC16* b = PerlUtil::newHBufC16fromPVn(s, 3, 0);
   someCallWithConstTDesCRefArgument(*b);
   delete b;