sl@0: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __STRINGPOOL_INL__ sl@0: #define __STRINGPOOL_INL__ sl@0: sl@0: sl@0: #include sl@0: sl@0: inline RStringTokenBase::RStringTokenBase() sl@0: : iVal(0) sl@0: /** Default constructor. */ sl@0: { sl@0: } sl@0: sl@0: sl@0: inline RStringTokenBase RStringTokenBase::operator=(RStringBase aVal) sl@0: /** Assignment operator, which makes a string token from a string. sl@0: sl@0: @param aVal The value of the string to copy. sl@0: @return The string token base. */ sl@0: { sl@0: iVal = aVal.iVal; sl@0: return *this; sl@0: } sl@0: sl@0: sl@0: inline TBool RStringTokenBase::IsNull() const sl@0: /** Tests if the string is null or not. sl@0: sl@0: @return ETrue if the string is null, otherwise EFalse. */ sl@0: { sl@0: return (iVal == 0); sl@0: } sl@0: sl@0: sl@0: inline TBool RStringToken::operator==(RStringToken aVal) const sl@0: /** Equality operator. sl@0: sl@0: @param aVal The string to compare. sl@0: @return ETrue if the strings are the same, otherwise EFalse. */ sl@0: { sl@0: return iVal == aVal.iVal; sl@0: } sl@0: sl@0: sl@0: inline TBool RStringToken::operator!=(RStringToken aVal) const sl@0: /** Inequality operator. sl@0: sl@0: @param aVal The string to compare. sl@0: @return ETrue if the strings are different, else EFalse */ sl@0: { sl@0: return iVal != aVal.iVal; sl@0: } sl@0: sl@0: sl@0: inline RStringToken RStringToken::operator=(RString aVal) sl@0: /** Assignment operator, which makes a string token from a string. sl@0: sl@0: @param aVal The string to copy. sl@0: @return The string token. */ sl@0: { sl@0: iVal = aVal.iVal; sl@0: return *this; sl@0: } sl@0: sl@0: sl@0: inline TBool RStringTokenF::operator==(RStringTokenF aVal) const sl@0: /** Equality operator. sl@0: sl@0: @param aVal The string to compare. sl@0: @return ETrue if the strings are the same, otherwise EFalse. */ sl@0: { sl@0: return iVal == aVal.iVal; sl@0: } sl@0: sl@0: sl@0: inline TBool RStringTokenF::operator!=(RStringTokenF aVal) const sl@0: /** Inequality operator. sl@0: sl@0: @param aVal The string to compare. sl@0: @return ETrue if any strings are different, else EFalse */ sl@0: { sl@0: return iVal != aVal.iVal; sl@0: } sl@0: sl@0: sl@0: inline RStringTokenF RStringTokenF::operator=(RStringF aVal) sl@0: /** Assignment operator that makes a string token from a string. sl@0: sl@0: @param aVal The string to compare. sl@0: @return The string token. */ sl@0: { sl@0: iVal = aVal.iVal; sl@0: return *this; sl@0: } sl@0: sl@0: sl@0: inline RStringBase::RStringBase() sl@0: : iVal(0) sl@0: /** Default constructor. */ sl@0: { sl@0: } sl@0: sl@0: /** Returns a compact string equivalent to the string */ sl@0: inline RStringBase::operator RStringTokenBase() const sl@0: { sl@0: RStringTokenBase s; sl@0: s.iVal = iVal; sl@0: return s; sl@0: } sl@0: sl@0: inline RString RString::Copy() sl@0: /** Copies a string. sl@0: sl@0: Both the original and the copy must be separately closed. sl@0: sl@0: @return The string to copy. */ sl@0: { sl@0: RStringBase::Copy(); sl@0: return *this; sl@0: } sl@0: sl@0: /** Returns a compact string equivalent to the string (for case-sensitive strings) */ sl@0: inline RString::operator RStringToken() const sl@0: { sl@0: RStringToken s; sl@0: s.iVal = iVal; sl@0: return s; sl@0: } sl@0: sl@0: inline RStringF RStringF::Copy() sl@0: /** Copies a string. sl@0: sl@0: Both the original and the copy must be separately closed. sl@0: sl@0: @return The string to copy. */ sl@0: { sl@0: RStringBase::Copy(); sl@0: return *this; sl@0: } sl@0: sl@0: sl@0: inline TBool RStringF::operator==(const RStringF& aVal) const sl@0: /** Equality operator. sl@0: sl@0: @param aVal The string to compare. sl@0: @return ETrue if the strings are equal, else EFalse */ sl@0: { sl@0: __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed)); sl@0: return (iVal == aVal.iVal); sl@0: } sl@0: sl@0: sl@0: inline TBool RStringF::operator!=(const RStringF& aVal) const sl@0: /** Inequality operator. sl@0: sl@0: @param aVal The string to compare. sl@0: @return ETrue if the strings are not equal, else EFalse */ sl@0: { sl@0: __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed)); sl@0: return (iVal != aVal.iVal); sl@0: } sl@0: sl@0: sl@0: inline RStringF::operator RStringTokenF() const sl@0: { sl@0: RStringTokenF s; sl@0: s.iVal = iVal; sl@0: return s; sl@0: } sl@0: sl@0: sl@0: inline RStringPool RStringBase::Pool() const sl@0: /** Gets the string pool. sl@0: sl@0: @return The string pool. */ sl@0: { sl@0: return iPool; sl@0: } sl@0: sl@0: sl@0: inline TBool RString::operator==(const RString& aVal) const sl@0: /** Equality operator. sl@0: sl@0: @param aVal The string to compare. sl@0: @return ETrue if the strings are equal, else EFalse */ sl@0: { sl@0: __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed)); sl@0: return (iVal == aVal.iVal); sl@0: } sl@0: sl@0: sl@0: inline TBool RString::operator!=(const RString& aVal) const sl@0: /** Inequality operator. sl@0: sl@0: @param aVal The string to compare. sl@0: @return ETrue if the strings are not equal, else EFalse */ sl@0: { sl@0: __ASSERT_DEBUG(iPool.iImplementation==aVal.iPool.iImplementation || aVal.iVal==0 || iVal==0, StringPoolPanic::Panic(StringPoolPanic::EComparisonBetweenTwoStringPoolsNotAllowed)); sl@0: return (iVal != aVal.iVal); sl@0: } sl@0: sl@0: inline RStringPool::RStringPool() sl@0: : iImplementation(0) sl@0: /** Default constructor. */ sl@0: { sl@0: } sl@0: sl@0: sl@0: #endif // __STRINGPOOL_INL__