This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for 8348ac19a3c3
[perl5.git] / symbian / PerlUtil.pod
1 =head1 NAME
2
3 PerlUtil - a C++ utility class for Perl/Symbian
4
5 =head1 SYNOPSIS
6
7    // in your App.mmp
8    USERINCLUDE  \symbian\perl\x.y.z\include
9    LIBRARY      perlXYZ.lib
10
11    // in your App
12    #include "PerlUtil.h" // includes also EXTERN.h and perl.h
13
14    // Static methods for moving between Perl strings (SvPV)
15    // and Symbian strings (HBufC and TDes).
16
17    static SV*      newSvPVfromTDesC8(const TDesC8& aDes);
18    static void     setSvPVfromTDesC8(SV* sv, const TDesC8& aDes);
19    static HBufC8*  newHBufC8fromSvPV(SV* sv);
20    static void     setTDes8fromSvPV(TDes8* aDes8, SV* sv);
21
22    static SV*      newSvPVfromTDesC16(const TDesC16& aDes);
23    static void     setSvPVfromTDesC16(SV* sv, const TDesC16& aDes);
24    static HBufC16* newHBufC16fromSvPV(SV* sv);
25    static void     setTDes16fromSvPV(TDes16* aDes16, SV* sv);
26
27    static HBufC8*  newHBufC8fromPVn(const U8* s, STRLEN n);
28    static void     setTDes8fromPVn(TDes8* aDes8, const U8* s, STRLEN n);
29    static HBufC16* newHBufC16fromPVn(const U8* s, STRLEN n, bool utf8);
30    static void  setTDes16fromPVn(TDes16* aDes16, const U8* s, STRLEN n);
31
32    // An example
33
34    const U8* s = (const U8 *)"foo";
35    HBufC16* b = PerlUtil::newHBufC16fromPVn(s, 3, 0);
36    someCallWithConstTDesCRefArgument(*b);
37    delete b;
38
39 =cut
40
41
42