os/ossrv/stdcpp/tsrc/Stdcpp_test/bcdrivers/twiostreams/src/twiostreams.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/stdcpp/tsrc/Stdcpp_test/bcdrivers/twiostreams/src/twiostreams.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,153 @@
     1.4 +/*
     1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +
    1.24 +// INCLUDE FILES
    1.25 +#include <Stiftestinterface.h>
    1.26 +#include "twiostreams.h"
    1.27 +
    1.28 +// EXTERNAL DATA STRUCTURES
    1.29 +//extern  ?external_data;
    1.30 +
    1.31 +// EXTERNAL FUNCTION PROTOTYPES  
    1.32 +//extern ?external_function( ?arg_type,?arg_type );
    1.33 +
    1.34 +// CONSTANTS
    1.35 +//const ?type ?constant_var = ?constant;
    1.36 +
    1.37 +// MACROS
    1.38 +//#define ?macro ?macro_def
    1.39 +
    1.40 +// LOCAL CONSTANTS AND MACROS
    1.41 +//const ?type ?constant_var = ?constant;
    1.42 +//#define ?macro_name ?macro_def
    1.43 +
    1.44 +// MODULE DATA STRUCTURES
    1.45 +//enum ?declaration
    1.46 +//typedef ?declaration
    1.47 +
    1.48 +// LOCAL FUNCTION PROTOTYPES
    1.49 +//?type ?function_name( ?arg_type, ?arg_type );
    1.50 +
    1.51 +// FORWARD DECLARATIONS
    1.52 +//class ?FORWARD_CLASSNAME;
    1.53 +
    1.54 +// ============================= LOCAL FUNCTIONS ===============================
    1.55 +
    1.56 +// -----------------------------------------------------------------------------
    1.57 +// ?function_name ?description.
    1.58 +// ?description
    1.59 +// Returns: ?value_1: ?description
    1.60 +//          ?value_n: ?description_line1
    1.61 +//                    ?description_line2
    1.62 +// -----------------------------------------------------------------------------
    1.63 +//
    1.64 +/*
    1.65 +?type ?function_name(
    1.66 +    ?arg_type arg,  // ?description
    1.67 +    ?arg_type arg)  // ?description
    1.68 +    {
    1.69 +
    1.70 +    ?code  // ?comment
    1.71 +
    1.72 +    // ?comment
    1.73 +    ?code
    1.74 +    }
    1.75 +*/
    1.76 +
    1.77 +// ============================ MEMBER FUNCTIONS ===============================
    1.78 +
    1.79 +// -----------------------------------------------------------------------------
    1.80 +// Ctwiostreams::Ctwiostreams
    1.81 +// C++ default constructor can NOT contain any code, that
    1.82 +// might leave.
    1.83 +// -----------------------------------------------------------------------------
    1.84 +//
    1.85 +Ctwiostreams::Ctwiostreams( 
    1.86 +    CTestModuleIf& aTestModuleIf ):
    1.87 +        CScriptBase( aTestModuleIf )
    1.88 +    {
    1.89 +    }
    1.90 +
    1.91 +// -----------------------------------------------------------------------------
    1.92 +// Ctwiostreams::ConstructL
    1.93 +// Symbian 2nd phase constructor can leave.
    1.94 +// -----------------------------------------------------------------------------
    1.95 +//
    1.96 +void Ctwiostreams::ConstructL()
    1.97 +    {
    1.98 +    iLog = CStifLogger::NewL( KtwiostreamsLogPath, 
    1.99 +                          KtwiostreamsLogFile,
   1.100 +                          CStifLogger::ETxt,
   1.101 +                          CStifLogger::EFile,
   1.102 +                          EFalse );
   1.103 +
   1.104 +    }
   1.105 +
   1.106 +// -----------------------------------------------------------------------------
   1.107 +// Ctwiostreams::NewL
   1.108 +// Two-phased constructor.
   1.109 +// -----------------------------------------------------------------------------
   1.110 +//
   1.111 +Ctwiostreams* Ctwiostreams::NewL( 
   1.112 +    CTestModuleIf& aTestModuleIf )
   1.113 +    {
   1.114 +    #ifdef __ARMCC__	
   1.115 +    #pragma diag_suppress 830
   1.116 +    #endif
   1.117 +    Ctwiostreams* self = new (ELeave) Ctwiostreams( aTestModuleIf );
   1.118 +    
   1.119 +    
   1.120 +    CleanupStack::PushL( self );
   1.121 +    self->ConstructL();
   1.122 +    CleanupStack::Pop();
   1.123 +
   1.124 +    return self;
   1.125 +
   1.126 +    }
   1.127 +
   1.128 +// Destructor
   1.129 +Ctwiostreams::~Ctwiostreams()
   1.130 +    { 
   1.131 +
   1.132 +    // Delete resources allocated from test methods
   1.133 +    Delete();
   1.134 +
   1.135 +    // Delete logger
   1.136 +    delete iLog; 
   1.137 +
   1.138 +    }
   1.139 +
   1.140 +// ========================== OTHER EXPORTED FUNCTIONS =========================
   1.141 +
   1.142 +// -----------------------------------------------------------------------------
   1.143 +// LibEntryL is a polymorphic Dll entry point.
   1.144 +// Returns: CScriptBase: New CScriptBase derived object
   1.145 +// -----------------------------------------------------------------------------
   1.146 +//
   1.147 +EXPORT_C CScriptBase* LibEntryL( 
   1.148 +    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
   1.149 +    {
   1.150 +
   1.151 +    return ( CScriptBase* ) Ctwiostreams::NewL( aTestModuleIf );
   1.152 +
   1.153 +    }
   1.154 +
   1.155 +
   1.156 +//  End of File