|
1 // Copyright (c) 2004-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // TCmdProcessorFactory class. |
|
15 // |
|
16 // |
|
17 |
|
18 #include "cn_main.h" |
|
19 #include "cn_bin2txt.h" |
|
20 #include "cn_txt2bin.h" |
|
21 |
|
22 /** |
|
23 Factory method for CCmdProcessor interface implementations. |
|
24 It creates and returns either CSPExport or CSPImport instance, depending on |
|
25 the value of aCmdLinePrm.iAction data member. |
|
26 @param aFs File server session object reference. |
|
27 @param aCmdLinePrm It contains parsed command line arguments. |
|
28 @return A pointer to just created CCmdProcessor interface implementation. |
|
29 @leave CSPBin2Txt::NewLC() and CSPTxt2Bin::NewLC() leaving error codes. |
|
30 @see CCmdProcessor |
|
31 @see CSPBin2Txt |
|
32 @see CSPTxt2Bin |
|
33 */ |
|
34 CCmdProcessor* TCmdProcessorFactory::NewLC(RFs& aFs, const TCmdLinePrm& aCmdLinePrm) |
|
35 { |
|
36 CCmdProcessor* proc = NULL; |
|
37 if(aCmdLinePrm.iAction == TCmdLinePrm::EBin2Txt) |
|
38 { |
|
39 proc = CSPBin2Txt::NewLC(aFs, aCmdLinePrm); |
|
40 } |
|
41 else if(aCmdLinePrm.iAction == TCmdLinePrm::ETxt2Bin) |
|
42 { |
|
43 proc = CSPTxt2Bin::NewLC(aFs, aCmdLinePrm); |
|
44 } |
|
45 return proc; |
|
46 } |