1.1 --- a/epoc32/include/stringpool.inl Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stringpool.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,222 @@
1.4 -stringpool.inl
1.5 +// Copyright (c) 2001-2009 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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 +#ifndef __STRINGPOOL_INL__
1.21 +#define __STRINGPOOL_INL__
1.22 +
1.23 +
1.24 +
1.25 +inline RStringTokenBase::RStringTokenBase()
1.26 + : iVal(0)
1.27 +/** Default constructor. */
1.28 + {
1.29 + }
1.30 +
1.31 +
1.32 +inline RStringTokenBase RStringTokenBase::operator=(RStringBase aVal)
1.33 +/** Assignment operator, which makes a string token from a string.
1.34 +
1.35 +@param aVal The value of the string to copy.
1.36 +@return The string token base. */
1.37 + {
1.38 + iVal = aVal.iVal;
1.39 + return *this;
1.40 + }
1.41 +
1.42 +
1.43 +inline TBool RStringTokenBase::IsNull() const
1.44 +/** Tests if the string is null or not.
1.45 +
1.46 +@return ETrue if the string is null, otherwise EFalse. */
1.47 + {
1.48 + return (iVal == 0);
1.49 + }
1.50 +
1.51 +
1.52 +inline TBool RStringToken::operator==(RStringToken aVal) const
1.53 +/** Equality operator.
1.54 +
1.55 +@param aVal The string to compare.
1.56 +@return ETrue if the strings are the same, otherwise EFalse. */
1.57 + {
1.58 + return iVal == aVal.iVal;
1.59 + }
1.60 +
1.61 +
1.62 +inline TBool RStringToken::operator!=(RStringToken aVal) const
1.63 +/** Inequality operator.
1.64 +
1.65 +@param aVal The string to compare.
1.66 +@return ETrue if the strings are different, else EFalse */
1.67 + {
1.68 + return iVal != aVal.iVal;
1.69 + }
1.70 +
1.71 +
1.72 +inline RStringToken RStringToken::operator=(RString aVal)
1.73 +/** Assignment operator, which makes a string token from a string.
1.74 +
1.75 +@param aVal The string to copy.
1.76 +@return The string token. */
1.77 + {
1.78 + iVal = aVal.iVal;
1.79 + return *this;
1.80 + }
1.81 +
1.82 +
1.83 +inline TBool RStringTokenF::operator==(RStringTokenF aVal) const
1.84 +/** Equality operator.
1.85 +
1.86 +@param aVal The string to compare.
1.87 +@return ETrue if the strings are the same, otherwise EFalse. */
1.88 + {
1.89 + return iVal == aVal.iVal;
1.90 + }
1.91 +
1.92 +
1.93 +inline TBool RStringTokenF::operator!=(RStringTokenF aVal) const
1.94 +/** Inequality operator.
1.95 +
1.96 +@param aVal The string to compare.
1.97 +@return ETrue if any strings are different, else EFalse */
1.98 + {
1.99 + return iVal != aVal.iVal;
1.100 + }
1.101 +
1.102 +
1.103 +inline RStringTokenF RStringTokenF::operator=(RStringF aVal)
1.104 +/** Assignment operator that makes a string token from a string.
1.105 +
1.106 +@param aVal The string to compare.
1.107 +@return The string token. */
1.108 + {
1.109 + iVal = aVal.iVal;
1.110 + return *this;
1.111 + }
1.112 +
1.113 +
1.114 +inline RStringBase::RStringBase()
1.115 + : iVal(0)
1.116 +/** Default constructor. */
1.117 + {
1.118 + }
1.119 +
1.120 +/** Returns a compact string equivalent to the string */
1.121 +inline RStringBase::operator RStringTokenBase() const
1.122 + {
1.123 + RStringTokenBase s;
1.124 + s.iVal = iVal;
1.125 + return s;
1.126 + }
1.127 +
1.128 +inline RString RString::Copy()
1.129 +/** Copies a string.
1.130 +
1.131 +Both the original and the copy must be separately closed.
1.132 +
1.133 +@return The string to copy. */
1.134 + {
1.135 + RStringBase::Copy();
1.136 + return *this;
1.137 + }
1.138 +
1.139 +/** Returns a compact string equivalent to the string (for case-sensitive strings) */
1.140 +inline RString::operator RStringToken() const
1.141 + {
1.142 + RStringToken s;
1.143 + s.iVal = iVal;
1.144 + return s;
1.145 + }
1.146 +
1.147 +inline RStringF RStringF::Copy()
1.148 +/** Copies a string.
1.149 +
1.150 +Both the original and the copy must be separately closed.
1.151 +
1.152 +@return The string to copy. */
1.153 + {
1.154 + RStringBase::Copy();
1.155 + return *this;
1.156 + }
1.157 +
1.158 +
1.159 +inline TBool RStringF::operator==(const RStringF& aVal) const
1.160 +/** Equality operator.
1.161 +
1.162 +@param aVal The string to compare.
1.163 +@return ETrue if the strings are equal, else EFalse */
1.164 + {
1.165 + __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed));
1.166 + return (iVal == aVal.iVal);
1.167 + }
1.168 +
1.169 +
1.170 +inline TBool RStringF::operator!=(const RStringF& aVal) const
1.171 +/** Inequality operator.
1.172 +
1.173 +@param aVal The string to compare.
1.174 +@return ETrue if the strings are not equal, else EFalse */
1.175 + {
1.176 + __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed));
1.177 + return (iVal != aVal.iVal);
1.178 + }
1.179 +
1.180 +
1.181 +inline RStringF::operator RStringTokenF() const
1.182 + {
1.183 + RStringTokenF s;
1.184 + s.iVal = iVal;
1.185 + return s;
1.186 + }
1.187 +
1.188 +
1.189 +inline RStringPool RStringBase::Pool() const
1.190 +/** Gets the string pool.
1.191 +
1.192 +@return The string pool. */
1.193 + {
1.194 + return iPool;
1.195 + }
1.196 +
1.197 +
1.198 +inline TBool RString::operator==(const RString& aVal) const
1.199 +/** Equality operator.
1.200 +
1.201 +@param aVal The string to compare.
1.202 +@return ETrue if the strings are equal, else EFalse */
1.203 + {
1.204 + __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed));
1.205 + return (iVal == aVal.iVal);
1.206 + }
1.207 +
1.208 +
1.209 +inline TBool RString::operator!=(const RString& aVal) const
1.210 +/** Inequality operator.
1.211 +
1.212 +@param aVal The string to compare.
1.213 +@return ETrue if the strings are not equal, else EFalse */
1.214 + {
1.215 + __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed));
1.216 + return (iVal != aVal.iVal);
1.217 + }
1.218 +
1.219 +inline RStringPool::RStringPool()
1.220 + : iImplementation(0)
1.221 +/** Default constructor. */
1.222 + {
1.223 + }
1.224 +
1.225 +
1.226 +#endif // __STRINGPOOL_INL__