os/ossrv/lowlevellibsandfws/apputils/inc/StringTableSupport.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/lowlevellibsandfws/apputils/inc/StringTableSupport.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,67 @@
     1.4 +/*
     1.5 +* Copyright (c) 2001 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 +#ifndef __STRINGTABLESUPPORT_H__
    1.23 +#define __STRINGTABLESUPPORT_H__
    1.24 +
    1.25 +/**
    1.26 +@internalComponent
    1.27 +*/
    1.28 +#define _STLIT8(name,s) const static TStLitC8<sizeof(s)> name={sizeof(s)-1,s}
    1.29 +
    1.30 +// A class that differs from TLitC only in that it does not have a
    1.31 +// dereference operator defined
    1.32 +//##ModelId=3B1E52AB0100
    1.33 +template <TInt S>
    1.34 +class TStLitC8
    1.35 +/**
    1.36 +@internalComponent
    1.37 +*/
    1.38 +	{
    1.39 +public:
    1.40 +	inline operator const TDesC8&() const;
    1.41 +	inline const TDesC8& operator()() const;
    1.42 +	inline operator const __TRefDesC8() const;
    1.43 +public:
    1.44 +	//##ModelId=3B1E52AB0120
    1.45 +	TUint iTypeLength;
    1.46 +	//##ModelId=3B1E52AB0117
    1.47 +	TText8 iBuf[__Align8(S)];
    1.48 +	};
    1.49 +
    1.50 +template <TInt S>
    1.51 +inline const TDesC8& TStLitC8<S>::operator()() const
    1.52 +	{
    1.53 +	return *REINTERPRET_CAST(const TDesC8*,this);
    1.54 +	}
    1.55 +
    1.56 +template <TInt S>
    1.57 +inline TStLitC8<S>::operator const TDesC8&() const
    1.58 +	{
    1.59 +	return *REINTERPRET_CAST(const TDesC8*,this);
    1.60 +	}
    1.61 +
    1.62 +template <TInt S>
    1.63 +inline TStLitC8<S>::operator const __TRefDesC8() const
    1.64 +	{
    1.65 +	return *REINTERPRET_CAST(const TDesC8*,this);
    1.66 +	}
    1.67 +
    1.68 +struct TStringTable;
    1.69 +
    1.70 +#endif // __STRINGTABLESUPPORT_H__