|
1 /* |
|
2 * Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of class TAiwVariant. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 #ifdef _DEBUG |
|
24 #include <e32svr.h> |
|
25 #endif |
|
26 #include "AiwVariant.h" |
|
27 |
|
28 |
|
29 // ============================= LOCAL FUNCTIONS =============================== |
|
30 |
|
31 namespace { |
|
32 |
|
33 // CONSTANTS |
|
34 /// TAiwVariant streaming version |
|
35 const TInt KVersion = 10; // Version 1.0 |
|
36 |
|
37 // Debug helpers |
|
38 #ifdef _DEBUG |
|
39 |
|
40 enum TPanicCode |
|
41 { |
|
42 EPanicPostCond_Constructor = 1, |
|
43 EPanicPostCond_Reset, |
|
44 EPanicPostCond_Set_TInt32, |
|
45 EPanicPostCond_Set_TUid, |
|
46 EPanicPostCond_Set_TTime, |
|
47 EPanicPostCond_Set_TDesC, |
|
48 EPanicPostCond_CopyL, |
|
49 EPanicInvariant_InvalidDesCState, |
|
50 EPanicPostCond_Set_TDesC8, |
|
51 EPanicPreCond_DataSizeMismatch |
|
52 }; |
|
53 |
|
54 void Panic(TPanicCode aCode) |
|
55 { |
|
56 _LIT(KPanicText, "TAiwVariant"); |
|
57 User::Panic(KPanicText, aCode); |
|
58 } |
|
59 |
|
60 #endif // #ifdef _DEBUG |
|
61 |
|
62 } // namespace |
|
63 |
|
64 |
|
65 // ============================ MEMBER FUNCTIONS =============================== |
|
66 |
|
67 #ifdef _DEBUG |
|
68 void TAiwVariant::__DbgTestInvariant() const |
|
69 { |
|
70 if (iTypeId==EVariantTypeDesC && iData.iBufC) |
|
71 { |
|
72 __ASSERT_ALWAYS(iData.iBufC->Ptr() == iPtrC.Ptr(), |
|
73 Panic(EPanicInvariant_InvalidDesCState)); |
|
74 |
|
75 } |
|
76 } |
|
77 #endif // #ifdef _DEBUG |
|
78 |
|
79 inline void TAiwVariant::SInt64::InternalizeL(RReadStream& aStream) |
|
80 { |
|
81 TInt32 low = aStream.ReadInt32L(); |
|
82 iHigh = aStream.ReadInt32L(); |
|
83 iLow = low; |
|
84 } |
|
85 |
|
86 inline void TAiwVariant::SInt64::ExternalizeL(RWriteStream& aStream) const |
|
87 { |
|
88 aStream.WriteInt32L(iLow); |
|
89 aStream.WriteInt32L(iHigh); |
|
90 } |
|
91 |
|
92 inline void TAiwVariant::SInt64::Set(const TInt64& aTInt64) |
|
93 { |
|
94 iLow = I64LOW(aTInt64); |
|
95 iHigh = I64HIGH(aTInt64); |
|
96 } |
|
97 |
|
98 inline TAiwVariant::SInt64::operator TInt64() const |
|
99 { |
|
100 return MAKE_TINT64(iHigh,iLow); |
|
101 } |
|
102 |
|
103 inline TBool TAiwVariant::SInt64::operator==(const SInt64& aRhs) const |
|
104 { |
|
105 return (iHigh==aRhs.iHigh && iLow==aRhs.iLow); |
|
106 } |
|
107 |
|
108 |
|
109 EXPORT_C TAiwVariant::TAiwVariant(const TAiwVariant& aSrc) : |
|
110 iTypeId(aSrc.iTypeId), iData(aSrc.iData), iPtrC(), iPtrC8() |
|
111 { |
|
112 if (iTypeId == EVariantTypeDesC) |
|
113 { |
|
114 iPtrC.Set(aSrc.iPtrC); |
|
115 // Do not take ownership of data |
|
116 iData.iBufC = NULL; |
|
117 } |
|
118 else if ( iTypeId == EVariantTypeDesC8 ) |
|
119 { |
|
120 iPtrC8.Set( aSrc.iPtrC8 ); |
|
121 // Do not take ownership of data |
|
122 iData.iBufC8 = NULL; |
|
123 } |
|
124 } |
|
125 |
|
126 EXPORT_C TAiwVariant& TAiwVariant::operator=(const TAiwVariant& aSrc) |
|
127 { |
|
128 // Check self-assignment first. |
|
129 if (this == &aSrc) |
|
130 { |
|
131 return *this; |
|
132 } |
|
133 |
|
134 iTypeId = aSrc.iTypeId; |
|
135 iData = aSrc.iData; |
|
136 if (iTypeId == EVariantTypeDesC) |
|
137 { |
|
138 iPtrC.Set(aSrc.iPtrC); |
|
139 // Do not take ownership of data |
|
140 iData.iBufC = NULL; |
|
141 } |
|
142 else if ( iTypeId == EVariantTypeDesC8 ) |
|
143 { |
|
144 iPtrC8.Set( aSrc.iPtrC8 ); |
|
145 // Do not take ownership of data |
|
146 iData.iBufC8 = NULL; |
|
147 } |
|
148 return *this; |
|
149 } |
|
150 |
|
151 EXPORT_C TBool TAiwVariant::Get(TInt32& aValue) const |
|
152 { |
|
153 __TEST_INVARIANT; |
|
154 if (iTypeId == EVariantTypeTInt32) |
|
155 { |
|
156 aValue = iData.iInt32; |
|
157 return ETrue; |
|
158 } |
|
159 return EFalse; |
|
160 } |
|
161 |
|
162 EXPORT_C TBool TAiwVariant::Get(TUid& aValue) const |
|
163 { |
|
164 __TEST_INVARIANT; |
|
165 if (iTypeId == EVariantTypeTUid) |
|
166 { |
|
167 aValue = TUid::Uid(iData.iInt32); |
|
168 return ETrue; |
|
169 } |
|
170 return EFalse; |
|
171 } |
|
172 |
|
173 EXPORT_C TBool TAiwVariant::Get(TPtrC& aValue) const |
|
174 { |
|
175 __TEST_INVARIANT; |
|
176 if (iTypeId == EVariantTypeDesC) |
|
177 { |
|
178 aValue.Set(iPtrC); |
|
179 return ETrue; |
|
180 } |
|
181 return EFalse; |
|
182 } |
|
183 |
|
184 EXPORT_C TBool TAiwVariant::Get(TTime& aValue) const |
|
185 { |
|
186 __TEST_INVARIANT; |
|
187 if (iTypeId == EVariantTypeTTime) |
|
188 { |
|
189 aValue = TTime(iData.iInt64); |
|
190 return ETrue; |
|
191 } |
|
192 return EFalse; |
|
193 } |
|
194 |
|
195 |
|
196 EXPORT_C TBool TAiwVariant::Get(TPtrC8& aValue) const |
|
197 { |
|
198 __TEST_INVARIANT; |
|
199 if (iTypeId == EVariantTypeDesC8) |
|
200 { |
|
201 aValue.Set(iPtrC8); |
|
202 return ETrue; |
|
203 } |
|
204 |
|
205 return EFalse; |
|
206 } |
|
207 |
|
208 |
|
209 EXPORT_C TBool TAiwVariant::Get(RFile& aValue) const |
|
210 { |
|
211 __TEST_INVARIANT; |
|
212 if (iTypeId == EVariantTypeFileHandle) |
|
213 { |
|
214 aValue = *((RFile*)&iData.iInt64); |
|
215 return ETrue; |
|
216 } |
|
217 |
|
218 return EFalse; |
|
219 } |
|
220 |
|
221 |
|
222 EXPORT_C TInt32 TAiwVariant::AsTInt32() const |
|
223 { |
|
224 TInt32 value = 0; |
|
225 Get(value); |
|
226 return value; |
|
227 } |
|
228 |
|
229 EXPORT_C TUid TAiwVariant::AsTUid() const |
|
230 { |
|
231 __TEST_INVARIANT; |
|
232 TUid value = {0}; |
|
233 Get(value); |
|
234 return value; |
|
235 } |
|
236 |
|
237 EXPORT_C TPtrC TAiwVariant::AsDes() const |
|
238 { |
|
239 __TEST_INVARIANT; |
|
240 TPtrC value; |
|
241 Get(value); |
|
242 return value; |
|
243 } |
|
244 |
|
245 EXPORT_C TTime TAiwVariant::AsTTime() const |
|
246 { |
|
247 __TEST_INVARIANT; |
|
248 TTime value(Time::NullTTime()); |
|
249 Get(value); |
|
250 return value; |
|
251 } |
|
252 |
|
253 |
|
254 EXPORT_C TPtrC8 TAiwVariant::AsData() const |
|
255 { |
|
256 __TEST_INVARIANT; |
|
257 TPtrC8 value; |
|
258 Get(value); |
|
259 return value; |
|
260 } |
|
261 |
|
262 |
|
263 EXPORT_C RFile TAiwVariant::AsFileHandle() const |
|
264 { |
|
265 __TEST_INVARIANT; |
|
266 RFile value; |
|
267 Get(value); |
|
268 return value; |
|
269 } |
|
270 |
|
271 |
|
272 EXPORT_C void TAiwVariant::Reset() |
|
273 { |
|
274 __TEST_INVARIANT; |
|
275 |
|
276 if (iTypeId == EVariantTypeDesC) |
|
277 { |
|
278 // Delete any owned buffer |
|
279 delete iData.iBufC; |
|
280 iData.iBufC = NULL; |
|
281 } |
|
282 else if (iTypeId == EVariantTypeDesC8) |
|
283 { |
|
284 delete iData.iBufC8; |
|
285 iData.iBufC8 = NULL; |
|
286 } |
|
287 // No need to clear other data, because Get methods wont't do anything if type |
|
288 // is Null. |
|
289 iTypeId = EVariantTypeNull; |
|
290 |
|
291 __ASSERT_DEBUG(IsEmpty(), Panic(EPanicPostCond_Reset)); |
|
292 __TEST_INVARIANT; |
|
293 } |
|
294 |
|
295 EXPORT_C void TAiwVariant::Set(TInt32 aValue) |
|
296 { |
|
297 __TEST_INVARIANT; |
|
298 |
|
299 Reset(); |
|
300 iTypeId = EVariantTypeTInt32; |
|
301 iData.iInt32 = aValue; |
|
302 |
|
303 __ASSERT_DEBUG(this->AsTInt32()==aValue, Panic(EPanicPostCond_Set_TInt32)); |
|
304 __TEST_INVARIANT; |
|
305 } |
|
306 |
|
307 EXPORT_C void TAiwVariant::Set(const TUid& aValue) |
|
308 { |
|
309 __TEST_INVARIANT; |
|
310 |
|
311 Reset(); |
|
312 iTypeId = EVariantTypeTUid; |
|
313 iData.iInt32 = aValue.iUid; |
|
314 |
|
315 __ASSERT_DEBUG(this->AsTUid()==aValue, Panic(EPanicPostCond_Set_TUid)); |
|
316 __TEST_INVARIANT; |
|
317 } |
|
318 |
|
319 EXPORT_C void TAiwVariant::Set(const TTime& aValue) |
|
320 { |
|
321 __TEST_INVARIANT; |
|
322 |
|
323 Reset(); |
|
324 iTypeId = EVariantTypeTTime; |
|
325 iData.iInt64.Set(aValue.Int64()); |
|
326 |
|
327 __ASSERT_DEBUG(this->AsTTime()==aValue, Panic(EPanicPostCond_Set_TTime)); |
|
328 __TEST_INVARIANT; |
|
329 } |
|
330 |
|
331 EXPORT_C void TAiwVariant::Set(const TDesC& aValue) |
|
332 { |
|
333 __TEST_INVARIANT; |
|
334 |
|
335 Reset(); |
|
336 iTypeId = EVariantTypeDesC; |
|
337 iData.iBufC = NULL; // not owned |
|
338 iPtrC.Set(aValue); |
|
339 |
|
340 __ASSERT_DEBUG(this->AsDes()==aValue, Panic(EPanicPostCond_Set_TDesC)); |
|
341 __TEST_INVARIANT; |
|
342 } |
|
343 |
|
344 |
|
345 |
|
346 EXPORT_C void TAiwVariant::Set(const TDesC8& aValue) |
|
347 { |
|
348 __TEST_INVARIANT; |
|
349 |
|
350 Reset(); |
|
351 iTypeId = EVariantTypeDesC8; |
|
352 iData.iBufC8 = NULL; // not owned |
|
353 iPtrC8.Set(aValue); |
|
354 |
|
355 __ASSERT_DEBUG(this->AsData()==aValue, Panic(EPanicPostCond_Set_TDesC)); |
|
356 __TEST_INVARIANT; |
|
357 } |
|
358 |
|
359 |
|
360 |
|
361 EXPORT_C void TAiwVariant::Set(const RFile& aValue) |
|
362 { |
|
363 __TEST_INVARIANT; |
|
364 __ASSERT_DEBUG(sizeof(SInt64) == sizeof(RFile), Panic(EPanicPreCond_DataSizeMismatch)); |
|
365 |
|
366 Reset(); |
|
367 iTypeId = EVariantTypeFileHandle; |
|
368 *((RFile*)&iData.iInt64) = aValue; |
|
369 |
|
370 __TEST_INVARIANT; |
|
371 } |
|
372 |
|
373 |
|
374 void TAiwVariant::SetL(const TAiwVariant& aValue) |
|
375 { |
|
376 __TEST_INVARIANT; |
|
377 |
|
378 if (aValue.iTypeId == EVariantTypeDesC) |
|
379 { |
|
380 // Take an own copy of the string value |
|
381 HBufC* buf = aValue.iPtrC.AllocL(); |
|
382 Reset(); |
|
383 iTypeId = EVariantTypeDesC; |
|
384 iData.iBufC = buf; |
|
385 iPtrC.Set(*iData.iBufC); |
|
386 } |
|
387 else if (aValue.iTypeId == EVariantTypeDesC8) |
|
388 { |
|
389 // Take an own copy of the data |
|
390 HBufC8* buf = aValue.iPtrC8.AllocL(); |
|
391 Reset(); |
|
392 iTypeId = EVariantTypeDesC8; |
|
393 iData.iBufC8 = buf; |
|
394 iPtrC8.Set(*iData.iBufC8); |
|
395 } |
|
396 else |
|
397 { |
|
398 Reset(); |
|
399 iTypeId = aValue.iTypeId; |
|
400 // Copy the data union as one block |
|
401 iData = aValue.iData; |
|
402 } |
|
403 |
|
404 __ASSERT_DEBUG(*this == aValue, Panic(EPanicPostCond_CopyL)); |
|
405 __TEST_INVARIANT; |
|
406 } |
|
407 |
|
408 void TAiwVariant::Destroy() |
|
409 { |
|
410 __TEST_INVARIANT; |
|
411 |
|
412 if (iTypeId == EVariantTypeDesC) |
|
413 { |
|
414 // Delete any owned buffer |
|
415 delete iData.iBufC; |
|
416 iData.iBufC = NULL; |
|
417 } |
|
418 else if (iTypeId == EVariantTypeDesC8) |
|
419 { |
|
420 delete iData.iBufC8; |
|
421 iData.iBufC8 = NULL; |
|
422 } |
|
423 } |
|
424 |
|
425 void TAiwVariant::InternalizeL(RReadStream& aStream) |
|
426 { |
|
427 __TEST_INVARIANT; |
|
428 |
|
429 aStream.ReadInt8L(); // version |
|
430 // if older version adapt to changes (who knows if |
|
431 // parameters would be also persistent...) |
|
432 |
|
433 const TUint8 typeId = aStream.ReadUint8L(); |
|
434 switch (typeId) |
|
435 { |
|
436 case EVariantTypeNull: |
|
437 { |
|
438 Reset(); |
|
439 break; |
|
440 } |
|
441 case EVariantTypeTInt32: // FALLTHROUGH |
|
442 case EVariantTypeTUid: |
|
443 { |
|
444 TInt32 value = aStream.ReadInt32L(); |
|
445 Reset(); |
|
446 iTypeId = typeId; |
|
447 iData.iInt32 = value; |
|
448 break; |
|
449 } |
|
450 case EVariantTypeFileHandle: // FALLTHROUGH |
|
451 case EVariantTypeTTime: |
|
452 { |
|
453 SInt64 value; |
|
454 value.InternalizeL(aStream); |
|
455 Reset(); |
|
456 iTypeId = typeId; |
|
457 iData.iInt64 = value; |
|
458 break; |
|
459 } |
|
460 case EVariantTypeDesC: |
|
461 { |
|
462 const TInt len = aStream.ReadInt32L(); |
|
463 HBufC* buf = HBufC::NewL(aStream,len); |
|
464 Reset(); |
|
465 iTypeId = typeId; |
|
466 iData.iBufC = buf; |
|
467 iPtrC.Set(*iData.iBufC); |
|
468 break; |
|
469 } |
|
470 case EVariantTypeDesC8: |
|
471 { |
|
472 const TInt len = aStream.ReadInt32L(); |
|
473 HBufC8* buf = HBufC8::NewL(aStream,len); |
|
474 Reset(); |
|
475 iTypeId = typeId; |
|
476 iData.iBufC8 = buf; |
|
477 iPtrC8.Set(*iData.iBufC8); |
|
478 break; |
|
479 } |
|
480 default: |
|
481 { |
|
482 // Corrupted data stream. |
|
483 #ifdef _DEBUG |
|
484 RDebug::Print(_L("***ERROR TAiwVariant::InternalizeL")); |
|
485 #endif |
|
486 User::Leave(KErrCorrupt); |
|
487 return; |
|
488 } |
|
489 } |
|
490 |
|
491 __TEST_INVARIANT; |
|
492 } |
|
493 |
|
494 void TAiwVariant::ExternalizeL(RWriteStream& aStream) const |
|
495 { |
|
496 __TEST_INVARIANT; |
|
497 |
|
498 aStream.WriteInt8L(KVersion); |
|
499 // if older version adapt to changes (who knows if parameters would be also persistent...) |
|
500 |
|
501 aStream.WriteUint8L(iTypeId); |
|
502 switch (iTypeId) |
|
503 { |
|
504 case EVariantTypeTInt32: // FALLTHROUGH |
|
505 case EVariantTypeTUid: |
|
506 { |
|
507 aStream.WriteInt32L(iData.iInt32); |
|
508 break; |
|
509 } |
|
510 case EVariantTypeFileHandle: // FALLTHROUGH |
|
511 case EVariantTypeTTime: |
|
512 { |
|
513 iData.iInt64.ExternalizeL(aStream); |
|
514 break; |
|
515 } |
|
516 case EVariantTypeDesC: |
|
517 { |
|
518 aStream.WriteInt32L(iPtrC.Length()); |
|
519 aStream << iPtrC; |
|
520 break; |
|
521 } |
|
522 case EVariantTypeDesC8: |
|
523 { |
|
524 aStream.WriteInt32L(iPtrC8.Length()); |
|
525 aStream << iPtrC8; |
|
526 break; |
|
527 } |
|
528 default: |
|
529 break; |
|
530 } |
|
531 |
|
532 __TEST_INVARIANT; |
|
533 } |
|
534 |
|
535 TInt TAiwVariant::Size() const |
|
536 { |
|
537 __TEST_INVARIANT; |
|
538 |
|
539 TInt size = sizeof (TInt8); // version |
|
540 size += sizeof (TUint8); // iTypeId |
|
541 switch (iTypeId) |
|
542 { |
|
543 case EVariantTypeTInt32: // FALLTHROUGH |
|
544 case EVariantTypeTUid: |
|
545 { |
|
546 size += sizeof (TInt32); |
|
547 break; |
|
548 } |
|
549 case EVariantTypeFileHandle: // FALLTHROUGH |
|
550 case EVariantTypeTTime: |
|
551 { |
|
552 size += sizeof (TInt64); |
|
553 break; |
|
554 } |
|
555 case EVariantTypeDesC: |
|
556 { |
|
557 size += sizeof (TInt32); // length |
|
558 size += iPtrC.Size(); |
|
559 break; |
|
560 } |
|
561 case EVariantTypeDesC8: |
|
562 { |
|
563 size += sizeof (TInt32); // length |
|
564 size += iPtrC8.Size(); |
|
565 break; |
|
566 } |
|
567 default: |
|
568 break; |
|
569 } |
|
570 return size; |
|
571 } |
|
572 |
|
573 // ============================ EXTERNAL FUNCTIONS =============================== |
|
574 |
|
575 EXPORT_C TBool operator==(const TAiwVariant& aLhs, const TAiwVariant& aRhs) |
|
576 { |
|
577 if (aLhs.iTypeId == aRhs.iTypeId) |
|
578 { |
|
579 switch (aLhs.iTypeId) |
|
580 { |
|
581 case EVariantTypeNull: |
|
582 { |
|
583 // Null equals Null |
|
584 return ETrue; |
|
585 } |
|
586 case EVariantTypeTInt32: // FALLTHROUGH |
|
587 case EVariantTypeTUid: |
|
588 { |
|
589 return (aLhs.iData.iInt32 == aRhs.iData.iInt32); |
|
590 } |
|
591 case EVariantTypeDesC: |
|
592 { |
|
593 return (aLhs.iPtrC == aRhs.iPtrC); |
|
594 } |
|
595 case EVariantTypeDesC8: |
|
596 { |
|
597 return (aLhs.iPtrC8 == aRhs.iPtrC8); |
|
598 } |
|
599 case EVariantTypeFileHandle: // FALLTHROUGH |
|
600 case EVariantTypeTTime: |
|
601 { |
|
602 return (aLhs.iData.iInt64 == aRhs.iData.iInt64); |
|
603 } |
|
604 default: |
|
605 { |
|
606 break; |
|
607 } |
|
608 } |
|
609 } |
|
610 return EFalse; |
|
611 } |
|
612 |
|
613 #ifdef _DEBUG |
|
614 |
|
615 void Dump(const TAiwVariant& aVariant) |
|
616 { |
|
617 switch (aVariant.TypeId()) |
|
618 { |
|
619 case EVariantTypeNull: |
|
620 { |
|
621 RDebug::Print(_L(" TAiwVariant::Dump = Null")); |
|
622 break; |
|
623 } |
|
624 case EVariantTypeTInt32: |
|
625 { |
|
626 RDebug::Print(_L(" TAiwVariant::Dump(TInt32) = %d"), aVariant.AsTInt32()); |
|
627 break; |
|
628 } |
|
629 case EVariantTypeTUid: |
|
630 { |
|
631 const TUidName& uidName = aVariant.AsTUid().Name(); |
|
632 RDebug::Print(_L(" TAiwVariant::Dump(TUid) = %S"), &uidName); |
|
633 break; |
|
634 } |
|
635 case EVariantTypeDesC: |
|
636 { |
|
637 TPtrC des = aVariant.AsDes(); |
|
638 RDebug::Print(_L(" TAiwVariant::Dump(TBufC) = %S"), &des); |
|
639 break; |
|
640 } |
|
641 case EVariantTypeDesC8: |
|
642 { |
|
643 TPtrC8 des = aVariant.AsData(); |
|
644 RDebug::Print(_L(" TAiwVariant::Dump(TBufC8) = %S"), &des); |
|
645 break; |
|
646 } |
|
647 case EVariantTypeTTime: |
|
648 { |
|
649 TDateTime dt = aVariant.AsTTime().DateTime(); |
|
650 RDebug::Print(_L(" TAiwVariant::Dump(TTime): day=%d,mon=%d,year=%d,hh=%d,mm=%d,ss=%d"), |
|
651 dt.Day()+1, dt.Month()+1, dt.Year(), |
|
652 dt.Hour(),dt.Minute(), dt.Second()); |
|
653 break; |
|
654 } |
|
655 case EVariantTypeFileHandle: |
|
656 { |
|
657 RDebug::Print(_L(" TAiwVariant::Dump(RFile): Value is file handle.")); |
|
658 break; |
|
659 } |
|
660 default: |
|
661 { |
|
662 RDebug::Print(_L(" *** TAiwVariant::Dump(Unknown) ***")); |
|
663 break; |
|
664 } |
|
665 } |
|
666 } |
|
667 |
|
668 #endif // ifdef _DEBUG |