author | Tom Sutcliffe <thomas.sutcliffe@accenture.com> |
Thu, 21 Oct 2010 22:32:59 +0100 | |
changeset 73 | dc41da2f70a4 |
parent 0 | 7f656887cf89 |
permissions | -rw-r--r-- |
0
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
1 |
// script_command.cpp |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
2 |
// |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
3 |
// Copyright (c) 2010 Accenture. All rights reserved. |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
4 |
// This component and the accompanying materials are made available |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
5 |
// under the terms of the "Eclipse Public License v1.0" |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
6 |
// which accompanies this distribution, and is available |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
7 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
8 |
// |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
9 |
// Initial Contributors: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
10 |
// Accenture - Initial contribution |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
11 |
// |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
12 |
#include "script_command.h" |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
13 |
#include "fshell.h" // For KScriptArgCount etc |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
14 |
#include <fshell/descriptorutils.h> |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
15 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
16 |
using namespace IoUtils; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
17 |
using namespace LtkUtils; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
18 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
19 |
CScriptCommand* CScriptCommand::NewLC(const TDesC& aScriptPath, TIoHandleSet& aIoHandles) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
20 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
21 |
CScriptCommand* self = new(ELeave) CScriptCommand; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
22 |
CleanupStack::PushL(self); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
23 |
self->ConstructL(aScriptPath, aIoHandles); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
24 |
return self; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
25 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
26 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
27 |
const TDesC& CScriptCommand::Name() const |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
28 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
29 |
return iName; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
30 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
31 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
32 |
void CScriptCommand::DoRunL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
33 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
34 |
// Never actually runs |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
35 |
__DEBUGGER(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
36 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
37 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
38 |
CScriptCommand::CScriptCommand() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
39 |
: CCommandBase() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
40 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
41 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
42 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
43 |
void CScriptCommand::ConstructL(const TDesC& aScriptPath, TIoHandleSet& aIoHandles) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
44 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
45 |
BaseConstructL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
46 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
47 |
// Duplicate some handles in case we need to display the script's help text. |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
48 |
IoSession().SetHandle(aIoHandles.IoSession().Handle()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
49 |
User::LeaveIfError(IoSession().Duplicate(RThread(), EOwnerThread)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
50 |
Stdout().CreateL(IoSession()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
51 |
Stdout().Duplicate(aIoHandles.Stdout()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
52 |
Stderr().CreateL(IoSession()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
53 |
Stderr().Duplicate(aIoHandles.Stderr()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
54 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
55 |
iScriptPath = aScriptPath.AllocL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
56 |
iName.Set(TParsePtrC(*iScriptPath).NameAndExt()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
57 |
RFs fs; // Can't use FsL(), that needs an env set up |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
58 |
CleanupClosePushL(fs); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
59 |
User::LeaveIfError(fs.Connect()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
60 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
61 |
iOwnedCif = CCommandInfoFile::NewL(fs, *iScriptPath); // A script file is also its own cif |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
62 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
63 |
if (iOwnedCif->Name().Length() == 0) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
64 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
65 |
// No cif data - fall back to just creating a basic array of args (for converting into $1 $2 etc) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
66 |
iArguments.AppendStringL(iNonCifScriptArguments, _L("args"), _L("Arguments for the script. These are converted to the environment variables C<$1>, C<$2> etc."), KValueTypeFlagOptional); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
67 |
delete iOwnedCif; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
68 |
iOwnedCif = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
69 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
70 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
71 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
72 |
SetCif(*iOwnedCif); // SetCif doesn't take ownership (which is what iOwnedCif is for) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
73 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
74 |
// Now go through and make up "member variables" to correspond to everything in the CIF so we can fool CCommandBase into |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
75 |
// doing the parsing work for us |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
76 |
const TInt argCount = iOwnedCif->Arguments().Count(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
77 |
for (TInt i = 0; i < argCount; i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
78 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
79 |
SetupArgumentL(iOwnedCif->Arguments()[i]); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
80 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
81 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
82 |
const TInt optCount = iOwnedCif->Options().Count(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
83 |
for (TInt i = 0; i < optCount; i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
84 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
85 |
const TCommandOption& opt = iOwnedCif->Options()[i]; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
86 |
SetupOptionL(opt); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
87 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
88 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
89 |
iOwnedCif->AssignL(iArguments, iOptions); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
90 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
91 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
92 |
iOptions.AppendBoolL(iDisplayHelp, 'h', _L("help"), _L("Display help.")); // Always support --help (cannot do this before the call to CCommandInfoFile::AssignL()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
93 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
94 |
// Our argument data structures should now be fully constructed |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
95 |
CleanupStack::PopAndDestroy(&fs); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
96 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
97 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
98 |
TInt StorageSizeForType(TUint aType) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
99 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
100 |
TInt size = sizeof(TInt); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
101 |
switch (aType) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
102 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
103 |
case KValueTypeReal: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
104 |
size = sizeof(TReal); break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
105 |
case KValueTypeFileName: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
106 |
size = sizeof(TFileName2); break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
107 |
case KValueTypeUint64: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
108 |
case KValueTypeInt64: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
109 |
size = sizeof(TInt64); break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
110 |
default: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
111 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
112 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
113 |
return size; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
114 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
115 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
116 |
void CScriptCommand::SetupArgumentL(const TValue& aValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
117 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
118 |
if (aValue.AcceptsMultiple()) StaticLeaveIfErr(KErrArgument, _L("Arguments with the 'multiple' attribute are not supported for scripts")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
119 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
120 |
const TUint type = aValue.Type(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
121 |
void* valptr = User::AllocZL(StorageSizeForType(type)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
122 |
CleanupStack::PushL(valptr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
123 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
124 |
TPtrC name = aValue.Name(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
125 |
switch (type) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
126 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
127 |
case KValueTypeInt: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
128 |
iArguments.AppendIntL(*(TInt*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
129 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
130 |
case KValueTypeUint: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
131 |
iArguments.AppendUintL(*(TUint*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
132 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
133 |
case KValueTypeString: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
134 |
iArguments.AppendStringL(*(HBufC**)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
135 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
136 |
case KValueTypeFileName: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
137 |
new (valptr) TFileName2; // We only AllocZL'd, we didn't initialise it |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
138 |
iArguments.AppendFileNameL(*(TFileName2*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
139 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
140 |
case KValueTypeEnum: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
141 |
iArguments.AppendEnumL(*(TInt*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
142 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
143 |
case KValueTypeReal: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
144 |
iArguments.AppendRealL(*(TReal*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
145 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
146 |
case KValueTypeUint64: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
147 |
iArguments.AppendUintL(*(TUint64*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
148 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
149 |
case KValueTypeInt64: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
150 |
iArguments.AppendIntL(*(TInt64*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
151 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
152 |
default: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
153 |
StaticLeaveIfErr(KErrArgument, _L("Script argument '%S' is of unsupported type %d"), &name, aValue.Type()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
154 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
155 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
156 |
CleanupStack::Pop(valptr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
157 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
158 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
159 |
void CScriptCommand::SetupOptionL(const IoUtils::TValue& aValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
160 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
161 |
if (aValue.AcceptsMultiple()) StaticLeaveIfErr(KErrArgument, _L("Options with the 'multiple' attribute are not supported for scripts")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
162 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
163 |
const TUint type = aValue.Type(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
164 |
void* valptr = User::AllocZL(StorageSizeForType(type)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
165 |
CleanupStack::PushL(valptr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
166 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
167 |
TPtrC name = aValue.Name(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
168 |
switch (type) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
169 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
170 |
case KValueTypeBool: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
171 |
iOptions.AppendBoolL(*(TBool*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
172 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
173 |
case KValueTypeInt: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
174 |
iOptions.AppendIntL(*(TInt*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
175 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
176 |
case KValueTypeUint: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
177 |
iOptions.AppendUintL(*(TUint*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
178 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
179 |
case KValueTypeString: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
180 |
iOptions.AppendStringL(*(HBufC**)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
181 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
182 |
case KValueTypeFileName: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
183 |
new (valptr) TFileName2; // We only AllocZL'd, we didn't initialise it |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
184 |
iOptions.AppendFileNameL(*(TFileName2*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
185 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
186 |
case KValueTypeEnum: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
187 |
iOptions.AppendEnumL(*(TInt*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
188 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
189 |
case KValueTypeReal: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
190 |
iOptions.AppendRealL(*(TReal*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
191 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
192 |
case KValueTypeUint64: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
193 |
iOptions.AppendUintL(*(TUint64*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
194 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
195 |
case KValueTypeInt64: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
196 |
iOptions.AppendIntL(*(TInt64*)valptr, name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
197 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
198 |
default: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
199 |
StaticLeaveIfErr(KErrArgument, _L("Script argument '%S' is of unsupported type %d"), &name, aValue.Type()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
200 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
201 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
202 |
CleanupStack::Pop(valptr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
203 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
204 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
205 |
CScriptCommand::~CScriptCommand() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
206 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
207 |
if (iOwnedCif) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
208 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
209 |
// We set all these up, we need to delete them |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
210 |
for (TInt i = 0; i < iArguments.Count(); i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
211 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
212 |
const TCommandArgument& arg = ((const RCommandArgumentList&)iArguments)[i]; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
213 |
if (arg.Type() == KValueTypeString) delete *(HBufC**)arg.ValuePtr(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
214 |
delete arg.ValuePtr(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
215 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
216 |
for (TInt i = 0; i < iOptions.Count(); i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
217 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
218 |
const TCommandOption& opt = ((const RCommandOptionList&)iOptions)[i]; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
219 |
if (opt.ValuePtr() != &iDisplayHelp) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
220 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
221 |
if (opt.Type() == KValueTypeString) delete *(HBufC**)opt.ValuePtr(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
222 |
delete opt.ValuePtr(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
223 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
224 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
225 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
226 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
227 |
delete iScriptPath; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
228 |
delete iOwnedCif; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
229 |
iNonCifScriptArguments.ResetAndDestroy(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
230 |
Stderr().Close(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
231 |
Stdout().Close(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
232 |
IoSession().Close(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
233 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
234 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
235 |
void CScriptCommand::ParseCommandLineArgsL(const TDesC& aArgs, CEnvironment& aEnv, RPointerArray<HBufC>* aAdditionalPrefixArguments) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
236 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
237 |
CreateEnvironmentL(&aEnv); // This sets aEnv as our environment. Doesn't copy or take ownership. ParseCommandLineL needs access to the env for things like the escape char setting |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
238 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
239 |
if (aAdditionalPrefixArguments && aAdditionalPrefixArguments->Count()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
240 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
241 |
// Must be a nicer way of doing this... prefix onto aArgs some args that couldn't possibly require escaping (this way we don't have to worry if anything in aAdditionalPrefixArguments actually does need escaping) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
242 |
LtkUtils::RLtkBuf argsBuf; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
243 |
CleanupClosePushL(argsBuf); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
244 |
TInt c = aAdditionalPrefixArguments->Count(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
245 |
while (c--) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
246 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
247 |
argsBuf.AppendL(_L("placeholder ")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
248 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
249 |
argsBuf.AppendL(aArgs); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
250 |
ParseCommandLineL(argsBuf); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
251 |
CleanupStack::PopAndDestroy(&argsBuf); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
252 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
253 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
254 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
255 |
ParseCommandLineL(aArgs); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
256 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
257 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
258 |
if (!iArguments.AllSet()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
259 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
260 |
User::Leave(KErrArgument); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
261 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
262 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
263 |
// Everything is filled in now, just have to setup aEnv with the results |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
264 |
TInt argCount = iArguments.Count(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
265 |
if (iOwnedCif) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
266 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
267 |
for (TInt i = 0; i < argCount; i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
268 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
269 |
const TCommandArgument& arg = ((const RCommandArgumentList&)iArguments)[i]; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
270 |
SetEnvironmentVariableFromValueL(aEnv, arg); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
271 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
272 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
273 |
// Now check for overrides from aAdditionalPrefixArguments |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
274 |
if (aAdditionalPrefixArguments) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
275 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
276 |
for (TInt i = 0; i < aAdditionalPrefixArguments->Count(); i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
277 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
278 |
const TCommandArgument& arg = ((const RCommandArgumentList&)iArguments)[i]; // This const cast shouldn't be needed, I don't think, to make sure that we use the const operator[] |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
279 |
aEnv.SetL(arg.Name(), *(*aAdditionalPrefixArguments)[i]); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
280 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
281 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
282 |
for (TInt i = 0; i < iOptions.Count(); i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
283 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
284 |
const TCommandOption& opt = ((const RCommandOptionList&)iOptions)[i]; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
285 |
if (opt.ValuePtr() != &iDisplayHelp) SetEnvironmentVariableFromValueL(aEnv, opt); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
286 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
287 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
288 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
289 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
290 |
// Just set $1, $2 etc |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
291 |
argCount = iNonCifScriptArguments.Count(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
292 |
for (TInt i = 0; i < argCount; i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
293 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
294 |
TBuf<16> varname; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
295 |
varname.AppendNum(i+1); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
296 |
aEnv.SetLocalL(varname); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
297 |
if (aAdditionalPrefixArguments && i < aAdditionalPrefixArguments->Count()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
298 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
299 |
aEnv.SetL(varname, *(*aAdditionalPrefixArguments)[i]); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
300 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
301 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
302 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
303 |
aEnv.SetL(varname, *iNonCifScriptArguments[i]); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
304 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
305 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
306 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
307 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
308 |
aEnv.SetLocalL(KScriptArgCount); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
309 |
aEnv.SetL(KScriptArgCount, argCount); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
310 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
311 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
312 |
void CScriptCommand::DisplayScriptHelpL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
313 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
314 |
const CTextBuffer* helpText = GetHelpTextL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
315 |
CleanupStack::PushL(const_cast<CTextBuffer*>(helpText)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
316 |
PageL(*helpText); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
317 |
CleanupStack::PopAndDestroy(const_cast<CTextBuffer*>(helpText)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
318 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
319 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
320 |
void CScriptCommand::SetEnvironmentVariableFromValueL(IoUtils::CEnvironment& aEnv, const IoUtils::TValue& aValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
321 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
322 |
const TPtrC name(aValue.Name()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
323 |
aEnv.SetLocalL(name); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
324 |
void* valptr = aValue.ValuePtr(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
325 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
326 |
switch (aValue.Type()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
327 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
328 |
case KValueTypeBool: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
329 |
if (*(TBool*)valptr) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
330 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
331 |
aEnv.SetL(name, 1); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
332 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
333 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
334 |
case KValueTypeInt: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
335 |
aEnv.SetL(name, *(TInt*)valptr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
336 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
337 |
case KValueTypeUint: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
338 |
iTempStr.Num(*(TUint*)valptr, EDecimal); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
339 |
aEnv.SetL(name, iTempStr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
340 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
341 |
case KValueTypeString: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
342 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
343 |
HBufC* val = *(HBufC**)valptr; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
344 |
if (val) aEnv.SetL(name, *val); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
345 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
346 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
347 |
case KValueTypeFileName: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
348 |
aEnv.SetL(name, *(TFileName2*)valptr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
349 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
350 |
case KValueTypeEnum: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
351 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
352 |
TEnum enumObj(aValue.EnumValueList()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
353 |
aEnv.SetL(name, enumObj.GetString(*(TInt*)valptr)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
354 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
355 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
356 |
case KValueTypeReal: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
357 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
358 |
_LIT(KRealFormat, "%g"); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
359 |
iTempStr.Format(KRealFormat, *(TReal*)valptr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
360 |
aEnv.SetL(name, iTempStr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
361 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
362 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
363 |
case KValueTypeUint64: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
364 |
iTempStr.Num(*(TUint64*)valptr, EDecimal); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
365 |
aEnv.SetL(name, iTempStr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
366 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
367 |
case KValueTypeInt64: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
368 |
iTempStr.Num(*(TInt64*)valptr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
369 |
aEnv.SetL(name, iTempStr); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
370 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
371 |
default: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
372 |
StaticLeaveIfErr(KErrArgument, _L("Script argument '%S' is of unsupported type %d"), &name, aValue.Type()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
373 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
374 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
375 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
376 |