Symbian3/SDK/Source/GUID-0D1E30D8-D900-5FD9-BD1F-1B93BAD8AEF5.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     6
<!-- Initial Contributors:
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     7
    Nokia Corporation - initial contribution.
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     8
Contributors: 
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     9
-->
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
    10
<!DOCTYPE concept
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
    12
<concept xml:lang="en" id="GUID-0D1E30D8-D900-5FD9-BD1F-1B93BAD8AEF5"><title>What are fields</title><shortdesc>This topic describes the structure of a field. A field is an item that can be stored in the Comms Database. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> <p>A field is a container and an element. A field is the basic unit of information in the Comms Database. </p> <p>A field is represented by the templated class <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>CMDBField</apiname></xref> <codeph>&lt;T&gt;</codeph>. The template parameter defines the type of data that the field contains. For example <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>TInt</apiname></xref>, <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>TDesC</apiname></xref>, <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>TBool</apiname></xref>   </p> <p>Fields are collected into records. </p> <fig id="GUID-39CDC3FB-156B-539B-A513-7B725A97D3B9"><image href="GUID-DA070DA3-CE2E-5B4E-834F-32BED736E01D_d0e79469_href.png" placement="inline"/></fig> <p><b>Getting data from a field </b> </p> <p>An overloaded conversion operator converts the data value in a <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>CMDBField</apiname></xref> <codeph>&lt;T&gt;</codeph> object to the template type. The template type is the type defined by the characters <codeph>T</codeph>. The operator allows you to use a <codeph>CMDBField&lt;T&gt;</codeph> object on the right-hand side of an assignment call. The operator also allows you to pass a <codeph>CMDBField&lt;T&gt;</codeph> object into a function that requires items of the template type. </p> <p>The value of a field in memory is NULL: </p> <ul><li id="GUID-1500B567-B899-5769-97D8-E7949B6034CA"><p>if the caller has not set the value </p> </li> <li id="GUID-2766C253-443B-5BD1-977F-69EB4E2349CD"><p>if the field as not been loaded from the Comms Database </p> </li> </ul> <p>If the value of a field is NULL after the field has been successfully loaded from the Comms Database, the field has been explicitly set to NULL by the writer of the record. </p> <p><b>Setting data into a field </b> </p> <p>A field has an assignment operator. A type <codeph>T</codeph> field accepts a type <codeph>T</codeph> item on the right-hand side of an assignment. </p> <p>A descriptor has variable length data. You need to set the size of the buffer that the field uses to store data. You must call <codeph>SetMaxLengthL()</codeph> on the <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>CMDBField</apiname></xref> <codeph>&lt;T&gt;</codeph> object and pass the length of the data to be added. You then use the assignment operator. The length that you set must be enough or the assignment operator does not work. The <codeph>SetL()</codeph> function is an alternative method. This function calculates the length of a descriptor parameter for a descriptor field type and performs the allocation and assignment. </p> </conbody></concept>