sbsv1/buildsystem/test/binaryvariation/VariantStaticDLL.cpp
author lorewang
Wed, 01 Dec 2010 16:05:36 +0800
changeset 715 e0739b8406dd
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Specify extenal tool with path
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     2
// All rights reserved.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     3
// This component and the accompanying materials are made available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     5
// which accompanies this distribution, and is available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     7
//
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     8
// Initial Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    10
//
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    11
// Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    12
//
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    13
// Description:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    14
// This program creates a dll.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
// 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
//
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
#include "VariantStaticDLL.h"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
#include <e32uid.h>
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
// construct/destruct
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
EXPORT_C CVarMessenger* CVarMessenger::NewLC(CConsoleBase& aConsole, const TDesC& aString)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
	CVarMessenger* self=new (ELeave) CVarMessenger(aConsole);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
	CleanupStack::PushL(self);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
	self->ConstructL(aString);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
	return self;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
CVarMessenger::~CVarMessenger() // destruct - virtual, so no export
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
	delete iString;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
// useful functions
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
EXPORT_C void CVarMessenger::ShowMessage()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
#ifdef FEATURE_VARIANT_A
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
	_LIT(KFormat1,"FEATURE VARIANT A %S\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
#else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
	_LIT(KFormat1,"FEATURE VARIANT ~A %S\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
#endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
#ifdef FEATURE_VARIANT_B
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
	_LIT(KFormat2,"FEATURE VARIANT B %S\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
#else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
	_LIT(KFormat2,"FEATURE VARIANT ~B %S\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
#endif
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
	iConsole.Printf(KFormat1, iString); // notify completion
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
	iConsole.Printf(KFormat2, iString); // notify completion
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
// constructor support
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
// don't export these, because used only by functions in this DLL, eg our NewLC()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
CVarMessenger::CVarMessenger(CConsoleBase& aConsole) // first-phase C++ constructor
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
	: iConsole(aConsole)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
void CVarMessenger::ConstructL(const TDesC& aString) // second-phase constructor
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
	iString=aString.AllocL(); // copy given string into own descriptor
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
GLDEF_C TInt E32Dll(TInt /*aReason*/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
// DLL entry point
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
	return(KErrNone);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
	}