lowlevellibsandfws/apputils/inc/StringTableSupport.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 * Copyright (c) 2001 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __STRINGTABLESUPPORT_H__
       
    20 #define __STRINGTABLESUPPORT_H__
       
    21 
       
    22 /**
       
    23 @internalComponent
       
    24 */
       
    25 #define _STLIT8(name,s) const static TStLitC8<sizeof(s)> name={sizeof(s)-1,s}
       
    26 
       
    27 // A class that differs from TLitC only in that it does not have a
       
    28 // dereference operator defined
       
    29 //##ModelId=3B1E52AB0100
       
    30 template <TInt S>
       
    31 class TStLitC8
       
    32 /**
       
    33 @internalComponent
       
    34 */
       
    35 	{
       
    36 public:
       
    37 	inline operator const TDesC8&() const;
       
    38 	inline const TDesC8& operator()() const;
       
    39 	inline operator const __TRefDesC8() const;
       
    40 public:
       
    41 	//##ModelId=3B1E52AB0120
       
    42 	TUint iTypeLength;
       
    43 	//##ModelId=3B1E52AB0117
       
    44 	TText8 iBuf[__Align8(S)];
       
    45 	};
       
    46 
       
    47 template <TInt S>
       
    48 inline const TDesC8& TStLitC8<S>::operator()() const
       
    49 	{
       
    50 	return *REINTERPRET_CAST(const TDesC8*,this);
       
    51 	}
       
    52 
       
    53 template <TInt S>
       
    54 inline TStLitC8<S>::operator const TDesC8&() const
       
    55 	{
       
    56 	return *REINTERPRET_CAST(const TDesC8*,this);
       
    57 	}
       
    58 
       
    59 template <TInt S>
       
    60 inline TStLitC8<S>::operator const __TRefDesC8() const
       
    61 	{
       
    62 	return *REINTERPRET_CAST(const TDesC8*,this);
       
    63 	}
       
    64 
       
    65 struct TStringTable;
       
    66 
       
    67 #endif // __STRINGTABLESUPPORT_H__