00001 00002 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 00003 // All rights reserved. 00004 // This component and the accompanying materials are made available 00005 // under the terms of "Eclipse Public License v1.0" 00006 // which accompanies this distribution, and is available 00007 // at the URL "http://www.eclipse.org/legal/epl-v10.html". 00008 // 00009 // Initial Contributors: 00010 // Nokia Corporation - initial contribution. 00011 // 00012 // Contributors: 00013 // 00014 // Description: 00015 // ExampleInetProtUtil is a sample code for understanding the applicability of InetProtUtil. 00016 // It is intended as an example and introduction to the INETPROTUTIL API's. 00017 // Users should have a brief understanding of URIs and the different concepts 00018 // associated with it, like, URLs and URI components. 00019 // 00020 00021 00022 00023 // System includes 00024 // 00025 #include <uri8.h> 00026 #include <delimitedparser8.h> 00027 #include <inetprottextutils.h> 00028 #include <escapeutils.h> 00029 #include <e32cons.h> 00030 00031 00033 // CExampleInetProtUtil // 00035 00036 class CExampleInetProtUtil : public CBase 00037 { 00038 public : 00039 00040 CExampleInetProtUtil(); 00041 00042 virtual ~CExampleInetProtUtil(); 00043 00044 void ConstructL(); 00045 00046 static void NewL(); 00047 00048 //Create an URI 00049 void CreateUriL(); 00050 00051 //Modify URI components 00052 void ModifyUriComponentsL(); 00053 00054 //Resolve 00055 void ResolveUriL(); 00056 00057 //Parse the URI 00058 void ParseUriL(); 00059 00060 //Validate URI components 00061 void ValidateUriComponentsL(); 00062 00063 //Extract URI components 00064 void ExtractUriComponentsL(); 00065 00066 //Retrieve Filename from a given Uri 00067 void RetrieveFileNameL(); 00068 00069 //Add and Trim delimiters 00070 void ModifyDelimiterL(); 00071 00072 //Text Utilities 00073 void WhiteSpaceRemover(); 00074 00075 //Escape encode and decode 00076 void EscapeEncodeDecodeL(); 00077 00078 private: 00079 CConsoleBase* iConsole; 00080 00081 }; 00082 00083 00084 00086 // CExampleDelimiterModifier // 00088 00089 00090 class CExampleDelimiterModifier : public TDelimitedParserBase8 //, public CDelimitedDataBase8 00091 { 00092 public: // Methods 00093 00094 inline TBool CheckFrontDelimiter() const; 00095 00096 inline TBool CheckBackDelimiter() const; 00097 00098 CExampleDelimiterModifier(); 00099 00100 inline void Parse(const TDesC8& aData); 00101 00102 inline void SetDelimiter(TChar ); 00103 00104 }; 00105 00106 void CExampleDelimiterModifier::SetDelimiter(TChar aChar) 00107 { 00108 TDelimitedParserBase8::SetDelimiter(aChar); 00109 } 00110 00111 void CExampleDelimiterModifier::Parse(const TDesC8& aData) 00112 { 00113 TDelimitedParserBase8::Parse(aData); 00114 } 00115 00116 CExampleDelimiterModifier::CExampleDelimiterModifier() 00117 { 00118 00119 } 00120 00121 TBool CExampleDelimiterModifier::CheckFrontDelimiter() const 00122 { 00123 TBool frontDelimiter = FrontDelimiter(); 00124 return frontDelimiter; 00125 } 00126 00127 TBool CExampleDelimiterModifier::CheckBackDelimiter() const 00128 { 00129 TBool backDelimiter = BackDelimiter(); 00130 return backDelimiter; 00131 }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.