summaryrefslogtreecommitdiff
path: root/symbian/PerlUtil.pod
blob: 095d5923dd2c3d844b08086624bf3a883b4e7b11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
=head1 NAME

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

=head1 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;

=cut