|
1 // tlast.cpp |
|
2 // |
|
3 // Copyright (c) 2010 Accenture. All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Accenture - Initial contribution |
|
11 // |
|
12 |
|
13 #include <fshell/ioutils.h> |
|
14 #include <fshell/common.mmh> |
|
15 |
|
16 using namespace IoUtils; |
|
17 |
|
18 class CCmdTlast : public CCommandBase |
|
19 { |
|
20 public: |
|
21 static CCommandBase* NewLC(); |
|
22 ~CCmdTlast(); |
|
23 private: |
|
24 CCmdTlast(); |
|
25 private: // From CCommandBase. |
|
26 virtual const TDesC& Name() const; |
|
27 virtual const TDesC& Description() const; |
|
28 virtual void DoRunL(); |
|
29 virtual void ArgumentsL(RCommandArgumentList& aArguments); |
|
30 private: |
|
31 HBufC* iArg; |
|
32 }; |
|
33 |
|
34 EXE_BOILER_PLATE(CCmdTlast) |
|
35 |
|
36 CCommandBase* CCmdTlast::NewLC() |
|
37 { |
|
38 CCmdTlast* self = new(ELeave) CCmdTlast(); |
|
39 CleanupStack::PushL(self); |
|
40 self->BaseConstructL(); |
|
41 return self; |
|
42 } |
|
43 |
|
44 CCmdTlast::~CCmdTlast() |
|
45 { |
|
46 delete iArg; |
|
47 } |
|
48 |
|
49 CCmdTlast::CCmdTlast() |
|
50 { |
|
51 } |
|
52 |
|
53 const TDesC& CCmdTlast::Name() const |
|
54 { |
|
55 _LIT(KName, "tlast"); |
|
56 return KName; |
|
57 } |
|
58 |
|
59 const TDesC& CCmdTlast::Description() const |
|
60 { |
|
61 _LIT(KDescription, "Test of fshell's parsing of commands with the 'last' attribute"); |
|
62 return KDescription; |
|
63 } |
|
64 |
|
65 void CCmdTlast::ArgumentsL(RCommandArgumentList& aArguments) |
|
66 { |
|
67 aArguments.AppendStringL(iArg, _L("arg"), _L("test arg"), KValueTypeFlagLast); |
|
68 } |
|
69 |
|
70 void CCmdTlast::DoRunL() |
|
71 { |
|
72 Printf(_L("arg = %S\r\n"), iArg); |
|
73 } |