applayerprotocols/ftpengine/consui/CONSUI.CPP
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Author: Philippe Gabriel
       
    15 // A simple test program which uses the statically linked dll  "ftpprot.dll"
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file CONSUI.CPP
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 //standard example header
       
    25 //#include "defs.h"
       
    26 //#include "debug.h"
       
    27 #include <e32base.h>
       
    28 #include <es_sock.h>
       
    29 #include "CONSUI.H"
       
    30 #include "FTPSESS.H"
       
    31 #include "CONSOLE.H"
       
    32 #include "FTPUI.H"
       
    33 
       
    34 TBuf<1512> myBuffer;
       
    35 CFTPSession* myCFTPSession;
       
    36 CmdConsole* myCmdConsole;
       
    37 CFtpUI *myFtpUI;
       
    38 
       
    39 LOCAL_C void doExampleL()
       
    40     {
       
    41 //
       
    42 //	TInetAddr myaddr(INET_ADDR(194,129,2,141),21);// myaddr
       
    43 //	TPtrC	DNSName(_L("ftp.microsoft.com"));
       
    44 //	TPtrC	DNSName(_L("ftp.sun.com"));
       
    45 //	TPtrC	DNSName(_L("ftp.netscape.com"));
       
    46 //	TPtrC	DNSName(_L("ftp.insignia.com"));
       
    47 //	TPtrC	DNSName(_L("sparky"));
       
    48 //	TPtrC	DNSName(_L("radian.ee.ic.ac.uk"));
       
    49 //
       
    50 
       
    51 	myFtpUI = new (ELeave) CFtpUI;
       
    52     CleanupStack::PushL(myFtpUI);
       
    53 	CActiveScheduler* exampleScheduler=new (ELeave) CActiveScheduler;
       
    54     CleanupStack::PushL(exampleScheduler);
       
    55     CActiveScheduler::Install(exampleScheduler);
       
    56 	myCFTPSession = CFTPSession::NewL(myFtpUI);
       
    57     CleanupStack::PushL(myCFTPSession);
       
    58 	myCmdConsole = CmdConsole::NewL(myFtpUI,__FTPDebugConsole);
       
    59     CleanupStack::PushL(myCmdConsole);
       
    60 	// Initialise FtpUI console
       
    61 	myFtpUI->SetConsole(__FTPDebugConsole);
       
    62 	// Initialise FtpUI Cmd console
       
    63 	myFtpUI->SetCmdConsole(myCmdConsole);
       
    64 	// Initialise FtpUI FTPSession
       
    65 	myFtpUI->SetFTPSession(myCFTPSession);
       
    66 	// Display some info
       
    67 	myFtpUI->Help();
       
    68 	// Get a console
       
    69 	myCmdConsole->Reset();
       
    70 	myCmdConsole->Start();
       
    71 	CActiveScheduler::Start();
       
    72 	//Delete my objects
       
    73 	CleanupStack::Pop();
       
    74 	delete myCmdConsole;
       
    75 	CleanupStack::Pop();
       
    76 	delete myCFTPSession;
       
    77 	CleanupStack::Pop();
       
    78 	delete myFtpUI;
       
    79 	CleanupStack::Pop();
       
    80 	delete exampleScheduler;
       
    81 	}
       
    82 
       
    83