1.1 --- a/epoc32/include/vstaticutils.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/vstaticutils.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,86 @@
1.4 -vstaticutils.h
1.5 +// Copyright (c) 1997-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 __VSTATICUTILS_H__
1.21 +#define __VSTATICUTILS_H__
1.22 +
1.23 +// System includes
1.24 +#include <e32base.h>
1.25 +
1.26 +// User includes
1.27 +#include <versit.h>
1.28 +
1.29 +// Classes referenced
1.30 +class CVersitAdditionalPropertyStorage;
1.31 +
1.32 +class VersitUtils
1.33 +/** A utility class which provides functions for handling character set conversions,
1.34 +and for the parsing of character strings.
1.35 +@publishedAll
1.36 +@released
1.37 +*/
1.38 + {
1.39 +public:
1.40 + IMPORT_C static TBool EightBitEncoding(Versit::TVersitCharSet aCharSet);
1.41 + IMPORT_C static TBool EightBitEncoding(TUint aCharSetId);
1.42 + IMPORT_C static TUid ConArcEncodingUid(Versit::TVersitEncoding aEncoding);
1.43 + IMPORT_C static const TDesC8& IANACharacterSetName(Versit::TVersitCharSet aCharSet);
1.44 + IMPORT_C static const TDesC8& IANAEncodingName(Versit::TVersitEncoding aEncoding);
1.45 + IMPORT_C static TUid CharConvCharSetUid(Versit::TVersitCharSet aVersitSet);
1.46 + static Versit::TVersitCharSet CharSet(TUint aCharConvCharSetUid);
1.47 + IMPORT_C static TBool DescriptorContainsOnlySevenBitCharacters(const TDesC& aText);
1.48 + IMPORT_C static TBool RequiresEncoding(const TDesC& aText);
1.49 + IMPORT_C static void UncodeToNarrowL(const TDesC& aUnicode, TDes8& aNarrow, const Versit::TEncodingAndCharset& aEncodingCharset);
1.50 + IMPORT_C static void AddEscapedString(TDes& aDestination,const TDesC& aTextToEscape,Versit::TVersitCharSet aCharSet);
1.51 + IMPORT_C static void AddEscapedString(TDes& aDestination,const TDesC& aTextToEscape,TUint aCharSetId);
1.52 + IMPORT_C static void ConArcEncodeL(RReadStream& aSource, CBufBase& aTarget, TUid aConArcEncodingUid);
1.53 + IMPORT_C static void WrapLinesL(CBufBase& aBuffer, TInt aMaxLineLength);
1.54 + IMPORT_C static TBool CheckAndIgnoreCustomErrorL(TInt aError);
1.55 + IMPORT_C static void RemoveEscapeChars(TPtr8& aText);
1.56 + IMPORT_C static void RemoveEscapeChars(HBufC16& aText);
1.57 + IMPORT_C static void RemoveEscapeChars(HBufC16& aText, TUint aCharSetUid);
1.58 + IMPORT_C static void RemoveEscapeChars(TPtr16& aText, TUint aCharSetUid);
1.59 + IMPORT_C static TBool IsNoneWhiteSpaceChar(const TDesC8& aString);
1.60 + IMPORT_C static void StripWhiteSpace(TPtr8& aString);
1.61 + IMPORT_C static void StripWhiteSpace(TPtr16& aString);
1.62 + static inline TBool IsWhiteSpace(TUint aChar);
1.63 + static inline TBool IsBeginOrEnd(TUid aUid);
1.64 + IMPORT_C static TBool IsNoneWhiteSpaceWideChar(const TDesC16& aString);
1.65 + IMPORT_C static CDesCArray* ParseForArrayPropertiesL(TPtr16 aStringValue, TUint aLineCharacterSetId);
1.66 + //
1.67 + IMPORT_C static void AllocateAdditionalPropertyStorageL(CVersitTlsData& aTlsData, CParserProperty& aProperty, TPtr16& aStringValue, TUint aLineCharacterSetId);
1.68 + IMPORT_C static void FreeAdditionalPropertyStorageL(const CParserProperty& aProperty);
1.69 + IMPORT_C static CParserPropertyValue* AdditionalPropertyValueFromStorageL(const CParserProperty& aProperty);
1.70 +
1.71 +private:
1.72 + static void AddEscapedString(TBool aIsShiftJis,TDes& aDestination,const TDesC& aTextToEscape);
1.73 + static const TDesC &VersitUtils::EscapeChar(TBool aIsShiftJis);
1.74 + };
1.75 +
1.76 +inline TBool VersitUtils::IsWhiteSpace(TUint aChar)
1.77 +/** Tests whether the specified character is white space
1.78 +(either a tab or a space character).
1.79 +
1.80 +@param aChar The character to test.
1.81 +@return ETrue if the character is white space, otherwise EFalse. */
1.82 + {return (aChar==CVersitParser::ESpace || aChar==CVersitParser::EHTab);}
1.83 +inline TBool VersitUtils::IsBeginOrEnd(TUid aUid)
1.84 +/** Tests whether the specified UID is the Versit Begin or End UID (KVersitTokenBeginUid
1.85 +or KVersitTokenEndUid).
1.86 +
1.87 +@param aUid The UID to test.
1.88 +@return ETrue if the UID is the Begin or End UID, otherwise EFalse. */
1.89 + {return (aUid.iUid==KVersitTokenBeginUid || aUid.iUid==KVersitTokenEndUid);}
1.90 +#endif