Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 // This file format is treated differently from all the others in that if the
20 // file extension is not recognised then the file is not recognised.
21 // Only once the extension is recognised does it try to match any header data.
23 void TRAMParser::DoRecognise(const TDesC& aFileExt, CReader& aReader, TMatch& aMatch)
25 TBool extMatch = (aFileExt.MatchF(TPtrC(KExtRAM)) != KErrNotFound);
28 aMatch.iMime = KMimeRAM;
29 TPtrC8 header = MAKE_TPtrC8(KSigRAM);
31 if (aReader.Match(header))
33 aMatch.iConfidence = KConfProbable;
37 aMatch.iConfidence = KConfPossible;
44 // SDP and XPS have almost identical header signatures, so when it comes to
45 // recognise an SDP file with a bad extension, it can be incorrectly identified
48 void TSDPParser::DoRecognise(const TDesC& aFileExt, CReader& aReader, TMatch& aMatch)
50 TBool extMatch = (aFileExt.MatchF(TPtrC(KExtSDP)) != KErrNotFound);
53 aMatch.iMime = KMimeSDP;
54 TPtrC8 header = MAKE_TPtrC8(KSigSDP);
56 if (aReader.Match(header))
58 aMatch.iConfidence = KConfProbable;
62 aMatch.iConfidence = KConfPossible;
69 // See TSDPParser::DoRecognise comment.
71 void TXPSParser::DoRecognise(const TDesC& aFileExt, CReader& aReader, TMatch& aMatch)
73 TBool extMatch = (aFileExt.MatchF(TPtrC(KExtXPS)) != KErrNotFound);
76 aMatch.iMime = KMimeXPS;
77 TPtrC8 header = MAKE_TPtrC8(KSigXPS);
79 if (aReader.Match(header))
81 aMatch.iConfidence = KConfProbable;
85 aMatch.iConfidence = KConfPossible;