Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Abstraction for "an environment" holding pairs of C strings (name, value)
20 #include <stddef.h> //for wchar_t
28 friend class CEnvironment; // who manages my storage
31 void ConstructL(const TDesC16& aName, const wchar_t* aValue);
32 TInt SetValue(const wchar_t* aValue);
33 HBufC16* Match(const TDesC16& aName);
35 const TInt NotEmpty() const { return (TInt)iValue; };
36 static TInt Externalize(const wchar_t* aPair, TDes16& aBuffer);
37 TInt Externalize(TDes16& aBuffer);
38 void ConstructL(const TText16*& aPtr);
40 static TPtrC16 ValuePtr(const wchar_t* aValue);
42 HBufC16* iValue; // data is zero terminated
45 NONSHARABLE_CLASS(CEnvironment) : public CBase
54 wchar_t* getenv(const wchar_t* aName) const;
55 int setenv(const wchar_t* aName, const wchar_t* aValue, int aReplace, int& anErrno);
56 void unsetenv(const wchar_t* aName);
58 void ConstructL(TUint aCount, TDes16& aBuffer);
59 HBufC16* ExternalizeLC(TUint& aCount);
60 HBufC16* ExternalizeLC(TUint& aCount, wchar_t** envp);