sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Header RECORD.CPP sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include "RECORD.H" sl@0: sl@0: EXPORT_C Record::Record() sl@0: : iLabel(), iStreamId(0) sl@0: { sl@0: } sl@0: sl@0: void RecordList::ExternalizeIds(ostream& out) sl@0: { sl@0: int32 i; sl@0: int32 size = Size(); sl@0: out.write((char*) &size, sizeof(size)); sl@0: for (i = 0; i < size; i++) sl@0: { sl@0: ::ExternalizeStreamOff(out, (*this)[i]->iStreamId); sl@0: } sl@0: } sl@0: sl@0: void RecordList::Externalize(ostream& out) sl@0: { sl@0: int32 size = Size(); sl@0: out.write ((char*) &size, sizeof(size)); sl@0: for (int i = 0; i < size; i++) sl@0: (*this)[i]->Externalize(out); sl@0: } sl@0: sl@0: void RecordList::ExternalizeComponents(ostream& out) sl@0: { sl@0: int32 size = Size(); sl@0: for (int i = 0; i < size; i++) sl@0: (*this)[i]->ExternalizeComponents(out); sl@0: } sl@0: sl@0: EXPORT_C void RecordList::Add(Record* aRecord) sl@0: { sl@0: if (!LabelToRecord(aRecord->iLabel)) sl@0: List::Add(aRecord); sl@0: } sl@0: sl@0: EXPORT_C Record *RecordList::LabelToRecord(const String& aLabel) sl@0: { sl@0: int32 size = Size(); sl@0: Record *record=NULL; sl@0: if (aLabel.Length()) sl@0: for (int i = 0; i < size; i++) sl@0: if ((*this)[i]->iLabel == aLabel) sl@0: record = (*this)[i]; sl@0: return record; sl@0: } sl@0: sl@0: EXPORT_C void RecordList::Destroy() sl@0: { sl@0: List::Destroy(); sl@0: } sl@0: sl@0: EXPORT_C RecordList::~RecordList() sl@0: { sl@0: } sl@0: sl@0: EXPORT_C Typeface::Typeface() sl@0: : iName(), iFlags(0) sl@0: { sl@0: } sl@0: sl@0: void Typeface::Externalize(ostream& out) sl@0: { sl@0: iName.Externalize(out); sl@0: out.put((char) iFlags); sl@0: } sl@0: sl@0: void Point::Externalize(ostream& out) sl@0: { sl@0: out.write((char*) &iX, sizeof(iX)); sl@0: out.write((char*) &iY, sizeof(iY)); sl@0: }