25 |
25 |
26 CMetadataUtilityItf* CMetadataUtilityItf::New(char* uri) |
26 CMetadataUtilityItf* CMetadataUtilityItf::New(char* uri) |
27 { |
27 { |
28 CMetadataUtilityItf* p_mdutilitf = new CMetadataUtilityItf; |
28 CMetadataUtilityItf* p_mdutilitf = new CMetadataUtilityItf; |
29 |
29 |
30 TInt ret = p_mdutilitf->ParseSource(uri); |
30 p_mdutilitf->ParseSource(uri); //ignore error |
31 |
31 |
32 if(ret == KErrNone) |
32 return p_mdutilitf; |
33 { |
|
34 return p_mdutilitf; |
|
35 } |
|
36 |
|
37 delete p_mdutilitf; |
|
38 return NULL; |
|
39 } |
33 } |
40 |
34 |
41 TInt CMetadataUtilityItf::OpenSource(char* pOrigUri) |
35 TInt CMetadataUtilityItf::OpenSource(char* pOrigUri) |
42 { |
36 { |
43 //Make a local copy for uri |
37 //Make a local copy for uri |
111 return outLen * 2; //return size |
122 return outLen * 2; //return size |
112 } |
123 } |
113 |
124 |
114 TInt CMetadataUtilityItf::CalculateNumMetadataItems(TUint*numItems) |
125 TInt CMetadataUtilityItf::CalculateNumMetadataItems(TUint*numItems) |
115 { |
126 { |
|
127 *numItems = 0; |
|
128 |
116 if(m_pS60Util) |
129 if(m_pS60Util) |
117 { |
130 { |
118 return m_pS60Util->CalculateNumMetadataItems(numItems); |
131 return m_pS60Util->CalculateNumMetadataItems(numItems); |
119 } |
132 } |
120 else |
133 else if(m_pHXUtil) |
121 { |
134 { |
122 return m_pHXUtil->CalculateNumMetadataItems(numItems); |
135 return m_pHXUtil->CalculateNumMetadataItems(numItems); |
123 } |
136 } |
|
137 |
|
138 return KErrNone; |
124 } |
139 } |
125 |
140 |
126 char* CMetadataUtilityItf::GetKey(TInt index) |
141 char* CMetadataUtilityItf::GetKey(TInt index) |
127 { |
142 { |
128 if(m_pS60Util) |
143 if(m_pS60Util) |
129 { |
144 { |
130 return m_pS60Util->GetKey(index); |
145 return m_pS60Util->GetKey(index); |
131 } |
146 } |
132 else |
147 else if(m_pHXUtil) |
133 { |
148 { |
134 return m_pHXUtil->GetKey(index); |
149 return m_pHXUtil->GetKey(index); |
135 } |
150 } |
|
151 |
|
152 return NULL; |
136 } |
153 } |
137 |
154 |
138 TInt CMetadataUtilityItf::GetValueSize(TInt index) |
155 TInt CMetadataUtilityItf::GetValueSize(TInt index) |
139 { |
156 { |
140 if(m_pS60Util) |
157 if(m_pS60Util) |
141 { |
158 { |
142 return m_pS60Util->GetValueSize(index); |
159 return m_pS60Util->GetValueSize(index); |
143 } |
160 } |
144 else |
161 else if(m_pHXUtil) |
145 { |
162 { |
146 return m_pHXUtil->GetValueSize(index); |
163 return m_pHXUtil->GetValueSize(index); |
147 } |
164 } |
|
165 |
|
166 return 0; |
148 } |
167 } |
149 |
168 |
150 TInt CMetadataUtilityItf::GetValue(TInt index, char* data, TInt maxLength, TInt* outSize, TInt* encodingType) |
169 TInt CMetadataUtilityItf::GetValue(TInt index, char* data, TInt maxLength, TInt* outSize, TInt* encodingType) |
151 { |
170 { |
152 if(m_pS60Util) |
171 if(m_pS60Util) |
153 { |
172 { |
154 return m_pS60Util->GetValue(index, data, maxLength, outSize, encodingType); |
173 return m_pS60Util->GetValue(index, data, maxLength, outSize, encodingType); |
155 } |
174 } |
156 else |
175 else if(m_pHXUtil) |
157 { |
176 { |
158 return m_pHXUtil->GetValue(index, data, maxLength, outSize, encodingType); |
177 return m_pHXUtil->GetValue(index, data, maxLength, outSize, encodingType); |
159 } |
178 } |
|
179 |
|
180 return 0; |
160 } |
181 } |
161 |
182 |
162 TInt CMetadataUtilityItf::ParseSource(char* uri) |
183 TInt CMetadataUtilityItf::ParseSource(char* uri) |
163 { |
184 { |
164 char* tempPtr = NULL; |
185 char* tempPtr = NULL; |