core/builtins/gobble.cpp
author Tom Sutcliffe <thomas.sutcliffe@accenture.com>
Mon, 25 Oct 2010 10:37:01 +0100
changeset 75 6bffbe8be665
parent 58 377ac716dabb
permissions -rw-r--r--
Added bsym file format spec.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     1
// gobble.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) 2007 - 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
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    13
#include "gobble.h"
58
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    14
#include <fshell/ltkutils.h>
0
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
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    17
CCommandBase* CCmdGobble::NewLC()
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
	CCmdGobble* self = new(ELeave) CCmdGobble();
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    20
	CleanupStack::PushL(self);
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    21
	self->BaseConstructL();
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    22
	return self;
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    23
	}
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    24
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    25
CCmdGobble::~CCmdGobble()
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
	}
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
CCmdGobble::CCmdGobble()
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    30
	: iBlockSize(512)
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
	}
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
const TDesC& CCmdGobble::Name() const
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    35
	{
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    36
	_LIT(KName, "gobble");
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    37
	return KName;
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    38
	}
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    39
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    40
void CCmdGobble::DoRunL()
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    41
	{
58
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    42
	RFs& fs = FsL();
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    43
	if (iAmount == 0)
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    44
		{
58
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    45
		TInt drive = EDriveC;
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    46
		if (iFileName.Length() == 0) LeaveIfErr(KErrBadName, _L("Bad file name"));
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    47
		RFs::CharToDrive(iFileName[0], drive);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    48
		TVolumeInfo volInfo;
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    49
		LeaveIfErr(fs.Volume(volInfo, drive), _L("Couldn't get volume information for drive %c"), iFileName[0]);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    50
		iAmount = volInfo.iFree;
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    51
		}
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    52
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    53
	if (!iNoWrite && iAmount < iBlockSize)
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    54
		{
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    55
		LeaveIfErr(KErrArgument, _L("The amount to consume must be greater than the block size (%d)"), iBlockSize);
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    56
		}
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    57
	if (iAmount & 0x80000000)
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    58
		{
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    59
		LeaveIfErr(KErrArgument, _L("The amount to consume is too large (maximum is %d)"), KMaxTInt);
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
	if (iBlockSize & 0x80000000)
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
		LeaveIfErr(KErrArgument, _L("The block size is too large (maximum is %d)"), KMaxTInt);
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
	fs.MkDirAll(iFileName);
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    66
	RFile file;
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    67
	TInt err = file.Open(fs, iFileName, EFileWrite);
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    68
	if (err == KErrNotFound)
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
		err = file.Create(fs, iFileName, EFileWrite);
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    71
		}
58
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    72
	LeaveIfErr(err, _L("Couldn't create file %S"), &iFileName);
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    73
	CleanupClosePushL(file);
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    74
58
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    75
	if (iNoWrite)
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    76
		{
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    77
		TInt size = 0;
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    78
		LeaveIfErr(file.Size(size), _L("Couldn't get file size"));
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    79
		size += iAmount;
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    80
		LeaveIfErr(file.SetSize(size), _L("Couldn't set filesize to %d"), size);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    81
		}
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    82
	else
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    83
		{
58
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    84
		TInt pos = 0;
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    85
		User::LeaveIfError(file.Seek(ESeekEnd, pos));
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    86
		HBufC8* buf = HBufC8::NewLC(iBlockSize);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    87
		TPtr8 ptr(buf->Des());
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    88
		ptr.Fill(TChar('x'), iBlockSize);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    89
		
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    90
		TInt toWrite = static_cast<TInt>(iAmount);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    91
		do
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    92
			{
58
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    93
			TInt writeSize;
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    94
			if (toWrite > static_cast<TInt>(iBlockSize))
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    95
				{
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    96
				writeSize = static_cast<TInt>(iBlockSize);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    97
				}
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    98
			else
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    99
				{
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   100
				writeSize = toWrite;
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   101
				}
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   102
			ptr.SetLength(writeSize);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   103
			err = file.Write(ptr);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   104
			if (err == KErrNone)
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   105
				{
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   106
				if (iVerbose)
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   107
					{
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   108
					Printf(_L("\rWrote %d"), iAmount - toWrite);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   109
					}
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   110
				toWrite -= writeSize;
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   111
				}
0
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
		while ((err == KErrNone) && (toWrite > 0));
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   114
		if (iVerbose)
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
			Printf(_L("\rWrote %d"), iAmount - toWrite);
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   117
			}
58
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   118
		CleanupStack::PopAndDestroy(buf);
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   119
		}
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   120
	CleanupStack::PopAndDestroy(&file);
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   121
	}
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   122
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   123
void CCmdGobble::OptionsL(RCommandOptionList& aOptions)
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   124
	{
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   125
	_LIT(KCmdOptVerbose, "verbose");
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   126
	aOptions.AppendBoolL(iVerbose, KCmdOptVerbose);
58
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   127
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   128
	_LIT(KCmdOptNoWrite, "no-write");
377ac716dabb Added --no-write to gobble, fixed crash in start --timeout.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   129
	aOptions.AppendBoolL(iNoWrite, KCmdOptNoWrite);
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   130
	}
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   131
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   132
void CCmdGobble::ArgumentsL(RCommandArgumentList& aArguments)
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   133
	{
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   134
	_LIT(KArgFileName, "file_name");
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   135
	aArguments.AppendFileNameL(iFileName, KArgFileName);
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   136
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   137
	_LIT(KArgAmount, "amount");
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   138
	aArguments.AppendUintL(iAmount, KArgAmount);
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   139
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   140
	_LIT(KArgBlockSize, "block_size");
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   141
	aArguments.AppendUintL(iBlockSize, KArgBlockSize);
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   142
	}
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   143
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   144
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   145
#ifdef EXE_BUILD
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   146
EXE_BOILER_PLATE(CCmdGobble)
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   147
#endif
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   148