testexecmgmt/ucc/Source/Uccs.v2/Core/CRetrieveCommandFromConsole.cpp
changeset 0 3da2a79470a7
equal deleted inserted replaced
-1:000000000000 0:3da2a79470a7
       
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 * System Includes
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #include <stdio.h>
       
    22 
       
    23 
       
    24 /***********************************************************************************
       
    25  *
       
    26  * Local Includes
       
    27  *
       
    28  **********************************************************************************/
       
    29 #include "CRetrieveCommandFromConsole.h"
       
    30 #include "UCCS_ErrorCodes.h"
       
    31 
       
    32 
       
    33 /***********************************************************************************
       
    34  *
       
    35  * Construction
       
    36  *
       
    37  **********************************************************************************/
       
    38 CRetrieveCommandFromConsole::CRetrieveCommandFromConsole()
       
    39 {
       
    40 	iFile = NULL;
       
    41 }
       
    42 
       
    43 CRetrieveCommandFromConsole::~CRetrieveCommandFromConsole()
       
    44 {
       
    45 	if( iFile != NULL ) {
       
    46 		fclose( iFile );
       
    47 		iFile = NULL;
       
    48 	}
       
    49 }
       
    50 
       
    51 
       
    52 /***********************************************************************************
       
    53  *
       
    54  * StartUseCase
       
    55  *
       
    56  **********************************************************************************/
       
    57 int CRetrieveCommandFromConsole::StartUseCase( int aUsecaseID )
       
    58 {
       
    59 	fprintf( stdout, "_______________________________________________________________________\n\n");
       
    60 	fprintf( stdout, "Use Case Controller -- Interactive Usecase Description\n" );
       
    61 	fprintf( stdout, "_______________________________________________________________________\n\n");
       
    62 	iFile = stdin;
       
    63 	iUsecaseID = aUsecaseID;
       
    64 	return UCCS_OK;
       
    65 }
       
    66 
       
    67 
       
    68 /***********************************************************************************
       
    69  *
       
    70  * EndUseCase
       
    71  *
       
    72  **********************************************************************************/
       
    73 int CRetrieveCommandFromConsole::EndUseCase()
       
    74 {
       
    75 	fprintf( stdout, "END OF USE CASE\n" );
       
    76 	return UCCS_OK;
       
    77 }
       
    78 
       
    79 
       
    80 /***********************************************************************************
       
    81  *
       
    82  * GetNextCommand
       
    83  *
       
    84  **********************************************************************************/
       
    85 int CRetrieveCommandFromConsole::GetNextCommand( char *aBuffer, int aLength )
       
    86 {
       
    87 	fprintf( stdout, "> " );
       
    88 	fgets( aBuffer, aLength, iFile );
       
    89 	return UCCS_OK;
       
    90 }
       
    91 
       
    92