toolsandutils/buildsystem/test/binaryvariation/VariantStaticDLL.cpp
changeset 0 83f4b4db085c
child 1 d4b442d23379
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     1 // Copyright (c) 2000-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 // This program creates a dll.
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "VariantStaticDLL.h"
       
    19 #include <e32uid.h>
       
    20 
       
    21 // construct/destruct
       
    22 
       
    23 EXPORT_C CVarMessenger* CVarMessenger::NewLC(CConsoleBase& aConsole, const TDesC& aString)
       
    24 	{
       
    25 	CVarMessenger* self=new (ELeave) CVarMessenger(aConsole);
       
    26 	CleanupStack::PushL(self);
       
    27 	self->ConstructL(aString);
       
    28 	return self;
       
    29 	}
       
    30 
       
    31 CVarMessenger::~CVarMessenger() // destruct - virtual, so no export
       
    32 	{
       
    33 	delete iString;
       
    34 	}
       
    35 
       
    36 // useful functions
       
    37 
       
    38 EXPORT_C void CVarMessenger::ShowMessage()
       
    39 	{
       
    40 #ifdef FEATURE_VARIANT_A
       
    41 	_LIT(KFormat1,"FEATURE VARIANT A %S\n");
       
    42 #else
       
    43 	_LIT(KFormat1,"FEATURE VARIANT ~A %S\n");
       
    44 #endif
       
    45 #ifdef FEATURE_VARIANT_B
       
    46 	_LIT(KFormat2,"FEATURE VARIANT B %S\n");
       
    47 #else
       
    48 	_LIT(KFormat2,"FEATURE VARIANT ~B %S\n");
       
    49 #endif
       
    50 	iConsole.Printf(KFormat1, iString); // notify completion
       
    51 	iConsole.Printf(KFormat2, iString); // notify completion
       
    52 	}
       
    53 
       
    54 // constructor support
       
    55 // don't export these, because used only by functions in this DLL, eg our NewLC()
       
    56 
       
    57 CVarMessenger::CVarMessenger(CConsoleBase& aConsole) // first-phase C++ constructor
       
    58 	: iConsole(aConsole)
       
    59 	{
       
    60 	}
       
    61 
       
    62 void CVarMessenger::ConstructL(const TDesC& aString) // second-phase constructor
       
    63 	{
       
    64 	iString=aString.AllocL(); // copy given string into own descriptor
       
    65     }
       
    66 
       
    67 
       
    68 GLDEF_C TInt E32Dll(TInt /*aReason*/)
       
    69 // DLL entry point
       
    70 	{
       
    71 	return(KErrNone);
       
    72 	}