serviceapifw_plat/liw_generic_parameter_api/inc/liwvariant.inl
changeset 57 61b27eec6533
parent 45 7aa6007702af
equal deleted inserted replaced
45:7aa6007702af 57:61b27eec6533
     1 /*
       
     2 * Copyright (c) 2003-2005 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 the License "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:       Inline function implementations of class TLiwVariant.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 inline TLiwVariant::TLiwVariant() : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    26     {
       
    27     iData.iBufC = NULL;
       
    28     iData.iBufC8 = NULL;
       
    29     Reset();
       
    30     }
       
    31 
       
    32 inline TLiwVariant::TLiwVariant(TInt32 aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    33     {   
       
    34     Set(aValue);
       
    35     }
       
    36 
       
    37 inline TLiwVariant::TLiwVariant(TInt64 aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    38     {   
       
    39     Set(aValue);
       
    40     }
       
    41 
       
    42 inline TLiwVariant::TLiwVariant(TBool aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    43     {   
       
    44     Set(aValue);
       
    45     }
       
    46     
       
    47 inline TLiwVariant::TLiwVariant(TUint aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    48     {   
       
    49     Set(aValue);
       
    50     }
       
    51 inline TLiwVariant::TLiwVariant(TReal aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    52     {   
       
    53     Set(aValue);
       
    54     }
       
    55 inline TLiwVariant::TLiwVariant(const CLiwBuffer* aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    56     {   
       
    57     Set(aValue);
       
    58     }
       
    59         
       
    60 inline TLiwVariant::TLiwVariant(const TUid& aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    61     {
       
    62     Set(aValue);
       
    63     }
       
    64 
       
    65 inline TLiwVariant::TLiwVariant(const TDesC& aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    66     {
       
    67     iData.iBufC = NULL;
       
    68     Set(aValue);
       
    69     }
       
    70 
       
    71 inline TLiwVariant::TLiwVariant(const HBufC* aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    72     {
       
    73     iData.iBufC = NULL;
       
    74     if(aValue)
       
    75         Set(*aValue);
       
    76     else
       
    77         Reset();    
       
    78     }
       
    79 
       
    80 inline TLiwVariant::TLiwVariant(const TTime& aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    81     {
       
    82     Set(aValue);
       
    83     }
       
    84 
       
    85 inline TLiwVariant::TLiwVariant(const TDesC8& aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    86     {
       
    87     iData.iBufC8 = NULL;
       
    88     Set(aValue);
       
    89     }
       
    90 
       
    91 
       
    92 inline TLiwVariant::TLiwVariant(const RFile& aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    93     {
       
    94     Set(aValue);
       
    95     }
       
    96 
       
    97 
       
    98 inline TLiwVariant::TLiwVariant(const CLiwList* aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
    99     {
       
   100     Set(aValue);        
       
   101     }                   
       
   102 
       
   103 inline TLiwVariant::TLiwVariant(const CLiwMap* aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
   104     {
       
   105     Set(aValue);        
       
   106     }
       
   107                    
       
   108 inline TLiwVariant::TLiwVariant(const MLiwInterface* aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
   109     {
       
   110     Set(aValue);        
       
   111     }
       
   112 
       
   113 inline TLiwVariant::TLiwVariant(const CLiwIterable* aValue) : iTypeId(LIW::EVariantTypeNull), iPtrC(), iPtrC8()
       
   114     {
       
   115     Set(aValue);        
       
   116     }                   
       
   117 
       
   118 inline LIW::TVariantTypeId TLiwVariant::TypeId() const
       
   119     {
       
   120     return static_cast<LIW::TVariantTypeId>(iTypeId);
       
   121     }
       
   122 
       
   123 inline TBool TLiwVariant::IsEmpty() const
       
   124     {
       
   125     return (iTypeId == LIW::EVariantTypeNull);
       
   126     }
       
   127 
       
   128 inline void TLiwVariant::Set(const HBufC* aValue)
       
   129     {
       
   130     Set(*aValue);
       
   131     }
       
   132 
       
   133 inline TLiwVariant& TLiwVariant::operator=(TInt32 aValue)
       
   134     {
       
   135     Set(aValue);
       
   136     return *this;
       
   137     }
       
   138 
       
   139 inline TLiwVariant& TLiwVariant::operator=(TInt64 aValue)
       
   140     {
       
   141     Set(aValue);
       
   142     return *this;
       
   143     }
       
   144     
       
   145 inline TLiwVariant& TLiwVariant::operator=(TReal aValue)
       
   146     {
       
   147     Set(aValue);
       
   148     return *this;
       
   149     }
       
   150 inline TLiwVariant& TLiwVariant::operator=(const CLiwBuffer* aValue)
       
   151     {
       
   152     Set(aValue);
       
   153     return *this;
       
   154     }
       
   155     
       
   156 inline TLiwVariant& TLiwVariant::operator=(TBool aValue)
       
   157     {
       
   158     Set(aValue);
       
   159     return *this;
       
   160     }
       
   161 
       
   162 inline TLiwVariant& TLiwVariant::operator=(TUint aValue)
       
   163     {
       
   164     Set(aValue);
       
   165     return *this;
       
   166     }
       
   167 
       
   168 inline TLiwVariant& TLiwVariant::operator=(const TUid& aValue)
       
   169     {
       
   170     Set(aValue);
       
   171     return *this;
       
   172     }
       
   173 
       
   174 inline TLiwVariant& TLiwVariant::operator=(const TDesC& aValue)
       
   175     {
       
   176     Set(aValue);
       
   177     return *this;
       
   178     }
       
   179 
       
   180 inline TLiwVariant& TLiwVariant::operator=(const HBufC* aValue)
       
   181     {
       
   182     Set(*aValue);
       
   183     return *this;
       
   184     }
       
   185 
       
   186 inline TLiwVariant& TLiwVariant::operator=(const TTime& aValue)
       
   187     {
       
   188     Set(aValue);
       
   189     return *this;
       
   190     }
       
   191 
       
   192 
       
   193 inline TLiwVariant& TLiwVariant::operator=(const TDesC8& aValue)
       
   194     {
       
   195     Set(aValue);    
       
   196     return *this;
       
   197     }
       
   198 
       
   199 
       
   200 inline TLiwVariant& TLiwVariant::operator=(const RFile& aValue)
       
   201     {
       
   202     Set(aValue);
       
   203     return *this;
       
   204     }
       
   205 
       
   206 
       
   207 inline TLiwVariant& TLiwVariant::operator=(const CLiwList* aValue)
       
   208     {
       
   209     Set(aValue);
       
   210     return *this;
       
   211     }
       
   212 
       
   213 inline TLiwVariant& TLiwVariant::operator=(const CLiwMap* aValue)
       
   214     {
       
   215     Set(aValue);
       
   216     return *this;
       
   217     }
       
   218 
       
   219 inline TLiwVariant& TLiwVariant::operator=(const MLiwInterface* aValue)
       
   220     {
       
   221     Set(aValue);
       
   222     return *this;
       
   223     }
       
   224 
       
   225 inline TLiwVariant& TLiwVariant::operator=(const CLiwIterable* aValue)
       
   226     {
       
   227     Set(aValue);
       
   228     return *this;
       
   229     }
       
   230 
       
   231 inline TBool operator!=(const TLiwVariant& aLhs, const TLiwVariant& aRhs)
       
   232     {
       
   233     return !(aLhs == aRhs);
       
   234     }
       
   235 
       
   236 
       
   237 inline void CLiwContainer::IncRef()
       
   238     {
       
   239     iRefCount++;
       
   240     }
       
   241     
       
   242 inline void CLiwContainer::DecRef()
       
   243     {
       
   244     if (--iRefCount == 0)
       
   245         delete this;
       
   246     }
       
   247 // End of file