equal
deleted
inserted
replaced
|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-0EECEF02-EC6A-53D5-8B27-C0732DA0160A" xml:lang="en"><title>How to |
|
13 replace a C++ array with a wrapper</title><shortdesc>This document shows briefly how to replace a C++ array with a Symbian |
|
14 platform object.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <p>C++ arrays can always be replaced with a <codeph>TFixedArray<class T,TInt |
|
16 S></codeph>. For example:</p> |
|
17 <codeblock id="GUID-5DFFA9D5-C18B-5BF9-B3A4-77B7ABB4CD1B" xml:space="preserve">TChar iSeparators[EMaxSeparators]; |
|
18 CCoeControl* iControls[ENumControls];</codeblock> |
|
19 <p>becomes:</p> |
|
20 <codeblock id="GUID-388DFDE7-4E2F-5E69-8F12-48A337B1A206" xml:space="preserve">TFixedArray<TChar,EMaxSeparators> iSeparators; |
|
21 TFixedArray<CCoeControl*,ENumControls> iControls;</codeblock> |
|
22 <p>The contained class <i>must</i> have a default constructor. The array can |
|
23 also be initialised from a C++ array (using a bitwise copy).</p> |
|
24 </conbody></concept> |