Artifact
51328d8c1533f26dea282341f92a5174529a1926:
0000: 2f 2f 20 72 65 73 75 6c 74 6c 6f 61 64 65 72 2e // resultloader.
0010: 68 0d 0a 2f 2f 20 c8 ed f2 e5 f0 f4 e5 e9 f1 20 h..// .........
0020: e4 eb ff 20 e7 e0 e3 f0 f3 e7 ea e8 20 f0 e5 e7 ... ........ ...
0030: f3 eb fc f2 e0 f2 e0 20 e7 e0 ef f0 ee f1 e0 20 ....... .......
0040: e2 20 ee e1 fa e5 ea f2 2d ef f0 e8 e5 ec ed e8 . ......-.......
0050: ea 0d 0a 73 74 72 75 63 74 20 73 71 6c 69 74 65 ...struct sqlite
0060: 33 3b 0d 0a 0d 0a 63 6c 61 73 73 20 49 53 51 4c 3;....class ISQL
0070: 69 74 65 52 65 73 75 6c 74 4c 6f 61 64 65 72 0d iteResultLoader.
0080: 0a 7b 0d 0a 70 75 62 6c 69 63 3a 0d 0a 09 76 69 .{..public:...vi
0090: 72 74 75 61 6c 20 7e 49 53 51 4c 69 74 65 52 65 rtual ~ISQLiteRe
00a0: 73 75 6c 74 4c 6f 61 64 65 72 28 29 7b 7d 0d 0a sultLoader(){}..
00b0: 09 2f 2f 20 cf ee e4 e3 ee f2 ee e2 ea e0 20 ef .// .......... .
00c0: f0 e8 e5 ec ed e8 ea e0 20 ea 20 ef f0 e8 e5 ec ........ . .....
00d0: f3 20 f0 e5 e7 f3 eb fc f2 e0 f2 ee e2 0d 0a 09 . ..............
00e0: 2f 2f 20 c4 ee eb e6 e5 ed 20 e2 ee e7 e2 f0 e0 // ...... ......
00f0: f9 e0 f2 fc 20 ea ee eb e8 f7 e5 f1 f2 e2 ee 20 .... ..........
0100: ea ee eb ee ed ee ea 2c 20 ea ee f2 ee f0 ee e5 ......., .......
0110: 20 e3 ee f2 ee e2 20 ef f0 e8 ed ff f2 fc 20 ef ..... ....... .
0120: f0 e8 e5 ec ed e8 ea 2e 0d 0a 09 76 69 72 74 75 ...........virtu
0130: 61 6c 20 44 57 4f 52 44 20 69 6e 69 74 28 44 57 al DWORD init(DW
0140: 4f 52 44 20 63 6f 6c 43 6f 75 6e 74 49 6e 52 65 ORD colCountInRe
0150: 73 75 6c 74 2c 20 73 71 6c 69 74 65 33 2a 20 70 sult, sqlite3* p
0160: 42 61 73 65 2c 20 43 56 61 6c 75 65 2a 20 70 50 Base, CValue* pP
0170: 61 72 61 6d 29 20 3d 20 30 3b 0d 0a 09 2f 2f 20 aram) = 0;...//
0180: c4 ee e1 e0 e2 eb e5 ed e8 e5 20 ea ee eb ee ed .......... .....
0190: ea e8 20 e2 20 f0 e5 e7 f3 eb fc f2 e0 f2 20 e7 .. . ......... .
01a0: e0 ef f0 ee f1 e0 0d 0a 09 76 69 72 74 75 61 6c .........virtual
01b0: 20 76 6f 69 64 20 73 65 74 43 6f 6c 75 6d 6e 28 void setColumn(
01c0: 44 57 4f 52 44 20 63 6f 6c 49 64 78 2c 20 63 6f DWORD colIdx, co
01d0: 6e 73 74 20 43 53 74 72 69 6e 67 26 20 63 6f 6c nst CString& col
01e0: 4e 61 6d 65 2c 20 63 6f 6e 73 74 20 43 54 79 70 Name, const CTyp
01f0: 65 26 20 74 79 70 65 29 20 3d 20 30 3b 0d 0a 09 e& type) = 0;...
0200: 2f 2f 20 c4 ee e1 e0 e2 eb e5 ed e8 e5 20 f1 f2 // .......... ..
0210: f0 ee ea e8 20 e2 20 f0 e5 e7 f3 eb fc f2 e0 f2 .... . .........
0220: 20 e7 e0 ef f0 ee f1 e0 2e 0d 0a 09 2f 2f 20 cf ...........// .
0230: e0 f0 e0 ec e5 f2 f0 20 2d 20 ec e0 f1 f1 e8 e2 ....... - ......
0240: 20 f3 ea e0 e7 e0 f2 e5 eb e5 e9 20 ed e0 20 43 .......... .. C
0250: 56 61 6c 75 65 2c 20 ea ee eb e8 f7 e5 f1 f2 e2 Value, .........
0260: ee ec 20 f0 e0 e2 ed fb e9 20 ea ee eb e8 f7 e5 .. ...... ......
0270: f1 f2 e2 f3 0d 0a 09 2f 2f 20 e4 ee e1 e0 e2 eb .......// ......
0280: e5 ed ed fb f5 20 ea ee eb ee ed ee ea 0d 0a 09 ..... ..........
0290: 76 69 72 74 75 61 6c 20 76 6f 69 64 20 61 64 64 virtual void add
02a0: 56 61 6c 75 65 73 28 43 56 61 6c 75 65 2a 2a 20 Values(CValue**
02b0: 70 70 56 61 6c 75 65 73 29 20 3d 20 30 3b 0d 0a ppValues) = 0;..
02c0: 09 2f 2f 20 cf f0 e8 f1 e2 ee e5 ed e8 e5 20 e2 .// .......... .
02d0: ee e7 e2 f0 e0 f9 e0 e5 ec ee e3 ee 20 e7 ed e0 ............ ...
02e0: f7 e5 ed e8 ff 0d 0a 09 76 69 72 74 75 61 6c 20 ........virtual
02f0: 76 6f 69 64 20 61 73 73 69 67 6e 52 65 74 56 61 void assignRetVa
0300: 6c 75 65 28 43 56 61 6c 75 65 26 20 72 65 74 56 lue(CValue& retV
0310: 61 6c 29 20 3d 20 30 3b 0d 0a 7d 3b 0d 0a 0d 0a al) = 0;..};....
0320: 63 6c 61 73 73 20 49 56 54 52 65 73 75 6c 74 4c class IVTResultL
0330: 6f 61 64 65 72 20 3a 20 70 75 62 6c 69 63 20 49 oader : public I
0340: 53 51 4c 69 74 65 52 65 73 75 6c 74 4c 6f 61 64 SQLiteResultLoad
0350: 65 72 0d 0a 7b 0d 0a 70 75 62 6c 69 63 3a 0d 0a er..{..public:..
0360: 09 49 56 54 52 65 73 75 6c 74 4c 6f 61 64 65 72 .IVTResultLoader
0370: 28 29 20 3a 20 6d 5f 70 43 6f 6e 74 28 4e 55 4c () : m_pCont(NUL
0380: 4c 29 20 7b 7d 0d 0a 09 7e 49 56 54 52 65 73 75 L) {}...~IVTResu
0390: 6c 74 4c 6f 61 64 65 72 28 29 20 7b 20 69 66 28 ltLoader() { if(
03a0: 6d 5f 70 43 6f 6e 74 29 20 6d 5f 70 43 6f 6e 74 m_pCont) m_pCont
03b0: 2d 3e 44 65 63 72 52 65 66 28 29 3b 20 7d 0d 0a ->DecrRef(); }..
03c0: 0d 0a 09 2f 2f 20 cf ee e4 e3 ee f2 ee e2 ea e0 ...// ..........
03d0: 20 ef f0 e8 e5 ec ed e8 ea e0 20 ea 20 ef f0 e8 ......... . ...
03e0: e5 ec f3 20 f0 e5 e7 f3 eb fc f2 e0 f2 ee e2 0d ... ............
03f0: 0a 09 76 69 72 74 75 61 6c 20 44 57 4f 52 44 20 ..virtual DWORD
0400: 69 6e 69 74 28 44 57 4f 52 44 20 63 6f 6c 43 6f init(DWORD colCo
0410: 75 6e 74 49 6e 52 65 73 75 6c 74 2c 20 73 71 6c untInResult, sql
0420: 69 74 65 33 2a 2c 20 43 56 61 6c 75 65 2a 20 70 ite3*, CValue* p
0430: 43 6c 65 61 72 29 0d 0a 09 7b 0d 0a 09 09 69 66 Clear)...{....if
0440: 28 70 43 6c 65 61 72 2d 3e 49 73 45 6d 70 74 79 (pClear->IsEmpty
0450: 28 29 29 0d 0a 09 09 7b 0d 0a 09 09 09 6d 5f 70 ())....{.....m_p
0460: 54 61 62 6c 65 2d 3e 43 6c 65 61 72 28 54 52 55 Table->Clear(TRU
0470: 45 29 3b 0d 0a 09 09 09 72 65 74 75 72 6e 20 63 E);.....return c
0480: 6f 6c 43 6f 75 6e 74 49 6e 52 65 73 75 6c 74 3b olCountInResult;
0490: 0d 0a 09 09 7d 0d 0a 09 09 65 6c 73 65 20 69 66 ....}....else if
04a0: 28 31 20 3d 3d 20 28 6c 6f 6e 67 29 70 43 6c 65 (1 == (long)pCle
04b0: 61 72 2d 3e 47 65 74 4e 75 6d 65 72 69 63 28 29 ar->GetNumeric()
04c0: 29 0d 0a 09 09 09 6d 5f 70 54 61 62 6c 65 2d 3e ).....m_pTable->
04d0: 43 6c 65 61 72 28 46 41 4c 53 45 29 3b 0d 0a 09 Clear(FALSE);...
04e0: 09 44 57 4f 52 44 20 63 6f 6c 49 6e 54 61 62 6c .DWORD colInTabl
04f0: 65 73 20 3d 20 6d 5f 70 54 61 62 6c 65 2d 3e 47 es = m_pTable->G
0500: 65 74 43 6f 6c 75 6d 6e 43 6f 75 6e 74 28 29 3b etColumnCount();
0510: 0d 0a 09 09 72 65 74 75 72 6e 20 63 6f 6c 49 6e ....return colIn
0520: 54 61 62 6c 65 73 20 3c 20 63 6f 6c 43 6f 75 6e Tables < colCoun
0530: 74 49 6e 52 65 73 75 6c 74 20 3f 20 63 6f 6c 49 tInResult ? colI
0540: 6e 54 61 62 6c 65 73 20 3a 20 63 6f 6c 43 6f 75 nTables : colCou
0550: 6e 74 49 6e 52 65 73 75 6c 74 3b 0d 0a 09 7d 0d ntInResult;...}.
0560: 0a 09 2f 2f 20 c4 ee e1 e0 e2 eb e5 ed e8 e5 20 ..// ..........
0570: ea ee eb ee ed ea e8 20 e2 20 f0 e5 e7 f3 eb fc ....... . ......
0580: f2 e0 f2 20 e7 e0 ef f0 ee f1 e0 0d 0a 09 76 69 ... ..........vi
0590: 72 74 75 61 6c 20 76 6f 69 64 20 73 65 74 43 6f rtual void setCo
05a0: 6c 75 6d 6e 28 44 57 4f 52 44 20 63 6f 6c 49 64 lumn(DWORD colId
05b0: 78 2c 20 63 6f 6e 73 74 20 43 53 74 72 69 6e 67 x, const CString
05c0: 26 20 63 6f 6c 4e 61 6d 65 2c 20 63 6f 6e 73 74 & colName, const
05d0: 20 43 54 79 70 65 26 20 74 79 70 65 29 0d 0a 09 CType& type)...
05e0: 7b 0d 0a 09 09 69 66 28 6d 5f 70 54 61 62 6c 65 {....if(m_pTable
05f0: 2d 3e 47 65 74 43 6f 6c 75 6d 6e 43 6f 75 6e 74 ->GetColumnCount
0600: 28 29 20 3c 3d 20 63 6f 6c 49 64 78 29 0d 0a 09 () <= colIdx)...
0610: 09 09 6d 5f 70 54 61 62 6c 65 2d 3e 41 64 64 43 ..m_pTable->AddC
0620: 6f 6c 75 6d 6e 28 63 6f 6c 4e 61 6d 65 2c 20 74 olumn(colName, t
0630: 79 70 65 2c 20 63 6f 6c 4e 61 6d 65 2c 20 30 2c ype, colName, 0,
0640: 20 43 53 74 72 69 6e 67 28 29 2c 20 30 29 3b 0d CString(), 0);.
0650: 0a 09 7d 0d 0a 09 2f 2f 20 c4 ee e1 e0 e2 eb e5 ..}...// .......
0660: ed e8 e5 20 f1 f2 f0 ee ea e8 20 e2 20 f0 e5 e7 ... ...... . ...
0670: f3 eb fc f2 e0 f2 20 e7 e0 ef f0 ee f1 e0 2e 0d ...... .........
0680: 0a 09 2f 2f 20 cf e0 f0 e0 ec e5 f2 f0 20 2d 20 ..// ........ -
0690: ec e0 f1 f1 e8 e2 20 f3 ea e0 e7 e0 f2 e5 eb e5 ...... .........
06a0: e9 20 ed e0 20 43 56 61 6c 75 65 2c 20 ea ee eb . .. CValue, ...
06b0: e8 f7 e5 f1 f2 e2 ee ec 20 f0 e0 e2 ed fb e9 20 ........ ......
06c0: ea ee eb e8 f7 e5 f1 f2 e2 f3 0d 0a 09 2f 2f 20 .............//
06d0: e4 ee e1 e0 e2 eb e5 ed ed fb f5 20 ea ee eb ee ........... ....
06e0: ed ee ea 0d 0a 09 76 69 72 74 75 61 6c 20 76 6f ......virtual vo
06f0: 69 64 20 61 64 64 56 61 6c 75 65 73 28 43 56 61 id addValues(CVa
0700: 6c 75 65 2a 2a 20 70 70 56 61 6c 75 65 73 29 0d lue** ppValues).
0710: 0a 09 7b 0d 0a 09 09 6d 5f 70 54 61 62 6c 65 2d ..{....m_pTable-
0720: 3e 41 64 64 52 6f 77 28 70 70 56 61 6c 75 65 73 >AddRow(ppValues
0730: 2c 20 2d 31 29 3b 0d 0a 09 7d 0d 0a 09 2f 2f 20 , -1);...}...//
0740: cf f0 e8 f1 e2 ee e5 ed e8 e5 20 e2 ee e7 e2 f0 .......... .....
0750: e0 f9 e0 e5 ec ee e3 ee 20 e7 ed e0 f7 e5 ed e8 ........ .......
0760: ff 0d 0a 09 76 69 72 74 75 61 6c 20 76 6f 69 64 ....virtual void
0770: 20 61 73 73 69 67 6e 52 65 74 56 61 6c 75 65 28 assignRetValue(
0780: 43 56 61 6c 75 65 26 20 72 65 74 56 61 6c 29 0d CValue& retVal).
0790: 0a 09 7b 0d 0a 09 09 72 65 74 56 61 6c 2e 41 73 ..{....retVal.As
07a0: 73 69 67 6e 43 6f 6e 74 65 78 74 28 6d 5f 70 43 signContext(m_pC
07b0: 6f 6e 74 29 3b 0d 0a 09 7d 0d 0a 09 76 6f 69 64 ont);...}...void
07c0: 20 73 65 74 43 6f 6e 74 65 78 74 28 43 42 4c 43 setContext(CBLC
07d0: 6f 6e 74 65 78 74 2a 20 70 43 6f 6e 74 29 0d 0a ontext* pCont)..
07e0: 09 7b 0d 0a 09 09 6d 5f 70 43 6f 6e 74 20 3d 20 .{....m_pCont =
07f0: 70 43 6f 6e 74 3b 0d 0a 09 09 6d 5f 70 43 6f 6e pCont;....m_pCon
0800: 74 2d 3e 49 6e 63 72 52 65 66 28 29 3b 0d 0a 09 t->IncrRef();...
0810: 09 6d 5f 70 54 61 62 6c 65 20 3d 20 28 28 43 56 .m_pTable = ((CV
0820: 61 6c 75 65 54 61 62 6c 65 43 6f 6e 74 65 78 74 alueTableContext
0830: 44 61 74 61 2a 29 70 43 6f 6e 74 2d 3e 47 65 74 Data*)pCont->Get
0840: 49 6e 74 65 72 6e 61 6c 44 61 74 61 28 29 29 2d InternalData())-
0850: 3e 47 65 74 56 61 6c 75 65 54 61 62 6c 65 28 29 >GetValueTable()
0860: 3b 0d 0a 09 7d 0d 0a 70 72 6f 74 65 63 74 65 64 ;...}..protected
0870: 3a 0d 0a 09 43 42 4c 43 6f 6e 74 65 78 74 2a 20 :...CBLContext*
0880: 6d 5f 70 43 6f 6e 74 3b 0d 0a 09 43 56 61 6c 75 m_pCont;...CValu
0890: 65 54 61 62 6c 65 2a 20 6d 5f 70 54 61 62 6c 65 eTable* m_pTable
08a0: 3b 0d 0a 7d 3b 0d 0a 0d 0a 63 6c 61 73 73 20 49 ;..};....class I
08b0: 56 4c 52 65 73 75 6c 74 4c 6f 61 64 65 72 20 3a VLResultLoader :
08c0: 20 70 75 62 6c 69 63 20 49 53 51 4c 69 74 65 52 public ISQLiteR
08d0: 65 73 75 6c 74 4c 6f 61 64 65 72 0d 0a 7b 0d 0a esultLoader..{..
08e0: 70 75 62 6c 69 63 3a 0d 0a 09 49 56 4c 52 65 73 public:...IVLRes
08f0: 75 6c 74 4c 6f 61 64 65 72 28 29 20 3a 20 6d 5f ultLoader() : m_
0900: 70 43 6f 6e 74 28 4e 55 4c 4c 29 20 7b 7d 0d 0a pCont(NULL) {}..
0910: 09 7e 49 56 4c 52 65 73 75 6c 74 4c 6f 61 64 65 .~IVLResultLoade
0920: 72 28 29 09 7b 20 69 66 28 6d 5f 70 43 6f 6e 74 r().{ if(m_pCont
0930: 29 20 6d 5f 70 43 6f 6e 74 2d 3e 44 65 63 72 52 ) m_pCont->DecrR
0940: 65 66 28 29 3b 20 7d 0d 0a 09 76 69 72 74 75 61 ef(); }...virtua
0950: 6c 20 44 57 4f 52 44 20 69 6e 69 74 28 44 57 4f l DWORD init(DWO
0960: 52 44 20 63 6f 6c 43 6f 75 6e 74 49 6e 52 65 73 RD colCountInRes
0970: 75 6c 74 2c 20 73 71 6c 69 74 65 33 2a 2c 20 43 ult, sqlite3*, C
0980: 56 61 6c 75 65 2a 20 70 50 61 72 61 6d 29 0d 0a Value* pParam)..
0990: 09 7b 0d 0a 09 09 69 6e 74 20 70 61 72 61 6d 20 .{....int param
09a0: 3d 20 30 3b 0d 0a 09 09 69 66 28 21 70 50 61 72 = 0;....if(!pPar
09b0: 61 6d 2d 3e 49 73 45 6d 70 74 79 28 29 20 26 26 am->IsEmpty() &&
09c0: 20 70 50 61 72 61 6d 2d 3e 74 79 70 65 20 3d 3d pParam->type ==
09d0: 20 31 29 0d 0a 09 09 09 70 61 72 61 6d 20 3d 20 1).....param =
09e0: 28 6c 6f 6e 67 29 70 50 61 72 61 6d 2d 3e 6d 5f (long)pParam->m_
09f0: 4e 75 6d 62 65 72 3b 0d 0a 09 09 69 66 28 30 20 Number;....if(0
0a00: 3d 3d 20 28 70 61 72 61 6d 20 26 20 31 29 29 09 == (param & 1)).
0a10: 2f 2f 20 ce f7 e8 f1 f2 e8 f2 fc 20 f1 ef e8 f1 // ........ ....
0a20: ee ea 0d 0a 09 09 7b 0d 0a 09 09 09 43 56 61 6c ......{.....CVal
0a30: 75 65 49 74 65 6d 2a 2a 20 70 70 49 74 65 6d 73 ueItem** ppItems
0a40: 20 3d 20 28 43 56 61 6c 75 65 49 74 65 6d 2a 2a = (CValueItem**
0a50: 29 6d 5f 70 4c 69 73 74 2d 3e 47 65 74 44 61 74 )m_pList->GetDat
0a60: 61 28 29 3b 0d 0a 09 09 09 66 6f 72 28 44 57 4f a();.....for(DWO
0a70: 52 44 20 63 20 3d 20 6d 5f 70 4c 69 73 74 2d 3e RD c = m_pList->
0a80: 47 65 74 53 69 7a 65 28 29 3b 20 63 2d 2d 3b 29 GetSize(); c--;)
0a90: 0d 0a 09 09 09 09 64 65 6c 65 74 65 20 2a 70 70 ......delete *pp
0aa0: 49 74 65 6d 73 2b 2b 3b 0d 0a 09 09 09 6d 5f 70 Items++;.....m_p
0ab0: 4c 69 73 74 2d 3e 52 65 6d 6f 76 65 41 6c 6c 28 List->RemoveAll(
0ac0: 29 3b 0d 0a 09 09 7d 0d 0a 09 09 69 66 28 70 61 );....}....if(pa
0ad0: 72 61 6d 20 26 20 32 29 0d 0a 09 09 7b 0d 0a 09 ram & 2)....{...
0ae0: 09 09 6d 5f 70 75 74 4d 6f 64 65 20 3d 20 70 75 ..m_putMode = pu
0af0: 74 41 6c 6c 49 6e 56 61 6c 75 65 3b 0d 0a 09 09 tAllInValue;....
0b00: 09 6d 5f 63 6f 6c 43 6f 75 6e 74 20 3d 20 63 6f .m_colCount = co
0b10: 6c 43 6f 75 6e 74 49 6e 52 65 73 75 6c 74 20 3c lCountInResult <
0b20: 20 33 20 3f 20 63 6f 6c 43 6f 75 6e 74 49 6e 52 3 ? colCountInR
0b30: 65 73 75 6c 74 20 3a 20 33 3b 0d 0a 09 09 7d 0d esult : 3;....}.
0b40: 0a 09 09 65 6c 73 65 0d 0a 09 09 7b 0d 0a 09 09 ...else....{....
0b50: 09 6d 5f 70 75 74 4d 6f 64 65 20 3d 20 70 75 74 .m_putMode = put
0b60: 41 6c 6c 49 6e 56 61 6c 75 65 3b 0d 0a 09 09 09 AllInValue;.....
0b70: 6d 5f 63 6f 6c 43 6f 75 6e 74 20 3d 20 63 6f 6c m_colCount = col
0b80: 43 6f 75 6e 74 49 6e 52 65 73 75 6c 74 3b 0d 0a CountInResult;..
0b90: 09 09 7d 0d 0a 09 09 72 65 74 75 72 6e 20 6d 5f ..}....return m_
0ba0: 63 6f 6c 43 6f 75 6e 74 3b 0d 0a 09 7d 0d 0a 09 colCount;...}...
0bb0: 2f 2f 20 c4 ee e1 e0 e2 eb e5 ed e8 e5 20 ea ee // .......... ..
0bc0: eb ee ed ea e8 20 e2 20 f0 e5 e7 f3 eb fc f2 e0 ..... . ........
0bd0: f2 20 e7 e0 ef f0 ee f1 e0 0d 0a 09 76 69 72 74 . ..........virt
0be0: 75 61 6c 20 76 6f 69 64 20 73 65 74 43 6f 6c 75 ual void setColu
0bf0: 6d 6e 28 44 57 4f 52 44 2c 20 63 6f 6e 73 74 20 mn(DWORD, const
0c00: 43 53 74 72 69 6e 67 26 2c 20 63 6f 6e 73 74 20 CString&, const
0c10: 43 54 79 70 65 26 29 0d 0a 09 7b 0d 0a 09 7d 0d CType&)...{...}.
0c20: 0a 09 2f 2f 20 c4 ee e1 e0 e2 eb e5 ed e8 e5 20 ..// ..........
0c30: f1 f2 f0 ee ea e8 20 e2 20 f0 e5 e7 f3 eb fc f2 ...... . .......
0c40: e0 f2 20 e7 e0 ef f0 ee f1 e0 2e 0d 0a 09 2f 2f .. ...........//
0c50: 20 cf e0 f0 e0 ec e5 f2 f0 20 2d 20 ec e0 f1 f1 ........ - ....
0c60: e8 e2 20 f3 ea e0 e7 e0 f2 e5 eb e5 e9 20 ed e0 .. .......... ..
0c70: 20 43 56 61 6c 75 65 2c 20 ea ee eb e8 f7 e5 f1 CValue, .......
0c80: f2 e2 ee ec 20 f0 e0 e2 ed fb e9 20 ea ee eb e8 .... ...... ....
0c90: f7 e5 f1 f2 e2 f3 0d 0a 09 2f 2f 20 e4 ee e1 e0 .........// ....
0ca0: e2 eb e5 ed ed fb f5 20 ea ee eb ee ed ee ea 0d ....... ........
0cb0: 0a 09 76 69 72 74 75 61 6c 20 76 6f 69 64 20 61 ..virtual void a
0cc0: 64 64 56 61 6c 75 65 73 28 43 56 61 6c 75 65 2a ddValues(CValue*
0cd0: 2a 20 70 70 56 61 6c 75 65 73 29 0d 0a 09 7b 0d * ppValues)...{.
0ce0: 0a 09 09 69 66 28 70 75 74 41 6c 6c 49 6e 4c 69 ...if(putAllInLi
0cf0: 73 74 20 3d 3d 20 6d 5f 70 75 74 4d 6f 64 65 29 st == m_putMode)
0d00: 0d 0a 09 09 7b 0d 0a 09 09 09 44 57 4f 52 44 20 ....{.....DWORD
0d10: 73 20 3d 20 6d 5f 70 4c 69 73 74 2d 3e 47 65 74 s = m_pList->Get
0d20: 53 69 7a 65 28 29 2c 20 63 6f 75 6e 74 20 3d 20 Size(), count =
0d30: 6d 5f 63 6f 6c 43 6f 75 6e 74 3b 0d 0a 09 09 09 m_colCount;.....
0d40: 6d 5f 70 4c 69 73 74 2d 3e 53 65 74 53 69 7a 65 m_pList->SetSize
0d50: 28 73 20 2b 20 63 6f 75 6e 74 29 3b 0d 0a 09 09 (s + count);....
0d60: 09 43 56 61 6c 75 65 49 74 65 6d 2a 2a 20 70 70 .CValueItem** pp
0d70: 57 72 69 74 65 56 61 6c 75 65 73 20 3d 20 28 43 WriteValues = (C
0d80: 56 61 6c 75 65 49 74 65 6d 2a 2a 29 28 6d 5f 70 ValueItem**)(m_p
0d90: 4c 69 73 74 2d 3e 47 65 74 44 61 74 61 28 29 29 List->GetData())
0da0: 20 2b 20 73 3b 0d 0a 09 09 09 77 68 69 6c 65 28 + s;.....while(
0db0: 63 6f 75 6e 74 2d 2d 29 0d 0a 09 09 09 09 2a 70 count--)......*p
0dc0: 70 57 72 69 74 65 56 61 6c 75 65 73 2b 2b 20 3d pWriteValues++ =
0dd0: 20 6e 65 77 20 43 56 61 6c 75 65 49 74 65 6d 28 new CValueItem(
0de0: 2a 2a 70 70 56 61 6c 75 65 73 2b 2b 2c 20 43 53 **ppValues++, CS
0df0: 74 72 69 6e 67 28 29 29 3b 0d 0a 09 09 7d 0d 0a tring());....}..
0e00: 09 09 65 6c 73 65 0d 0a 09 09 7b 0d 0a 09 09 09 ..else....{.....
0e10: 43 56 61 6c 75 65 49 74 65 6d 20 2a 70 49 74 65 CValueItem *pIte
0e20: 6d 20 3d 20 6e 65 77 20 43 56 61 6c 75 65 49 74 m = new CValueIt
0e30: 65 6d 28 2a 70 70 56 61 6c 75 65 73 5b 30 5d 2c em(*ppValues[0],
0e40: 20 43 53 74 72 69 6e 67 28 29 29 3b 0d 0a 09 09 CString());....
0e50: 09 69 66 28 6d 5f 63 6f 6c 43 6f 75 6e 74 20 3e .if(m_colCount >
0e60: 20 31 29 0d 0a 09 09 09 7b 0d 0a 09 09 09 09 70 1).....{......p
0e70: 49 74 65 6d 2d 3e 6d 5f 74 65 78 74 20 3d 20 70 Item->m_text = p
0e80: 70 56 61 6c 75 65 73 5b 31 5d 2d 3e 47 65 74 53 pValues[1]->GetS
0e90: 74 72 69 6e 67 28 29 3b 0d 0a 09 09 09 09 69 66 tring();......if
0ea0: 28 6d 5f 63 6f 6c 43 6f 75 6e 74 20 3e 20 32 29 (m_colCount > 2)
0eb0: 0d 0a 09 09 09 09 09 70 49 74 65 6d 2d 3e 6d 5f .......pItem->m_
0ec0: 62 43 68 65 63 6b 20 3d 20 30 20 21 3d 20 28 6c bCheck = 0 != (l
0ed0: 6f 6e 67 29 70 70 56 61 6c 75 65 73 5b 32 5d 2d ong)ppValues[2]-
0ee0: 3e 47 65 74 4e 75 6d 65 72 69 63 28 29 3b 0d 0a >GetNumeric();..
0ef0: 09 09 09 7d 0d 0a 09 09 09 6d 5f 70 4c 69 73 74 ...}.....m_pList
0f00: 2d 3e 41 64 64 28 70 49 74 65 6d 29 3b 0d 0a 09 ->Add(pItem);...
0f10: 09 7d 0d 0a 09 7d 0d 0a 09 2f 2f 20 cf f0 e8 f1 .}...}...// ....
0f20: e2 ee e5 ed e8 e5 20 e2 ee e7 e2 f0 e0 f9 e0 e5 ...... .........
0f30: ec ee e3 ee 20 e7 ed e0 f7 e5 ed e8 ff 0d 0a 09 .... ...........
0f40: 76 69 72 74 75 61 6c 20 76 6f 69 64 20 61 73 73 virtual void ass
0f50: 69 67 6e 52 65 74 56 61 6c 75 65 28 43 56 61 6c ignRetValue(CVal
0f60: 75 65 26 20 72 65 74 56 61 6c 29 0d 0a 09 7b 0d ue& retVal)...{.
0f70: 0a 09 09 72 65 74 56 61 6c 2e 41 73 73 69 67 6e ...retVal.Assign
0f80: 43 6f 6e 74 65 78 74 28 6d 5f 70 43 6f 6e 74 29 Context(m_pCont)
0f90: 3b 0d 0a 09 7d 0d 0a 09 0d 0a 09 76 6f 69 64 20 ;...}......void
0fa0: 73 65 74 43 6f 6e 74 65 78 74 28 43 42 4c 43 6f setContext(CBLCo
0fb0: 6e 74 65 78 74 2a 20 70 43 6f 6e 74 29 0d 0a 09 ntext* pCont)...
0fc0: 7b 0d 0a 09 09 6d 5f 70 43 6f 6e 74 20 3d 20 70 {....m_pCont = p
0fd0: 43 6f 6e 74 3b 0d 0a 09 09 6d 5f 70 43 6f 6e 74 Cont;....m_pCont
0fe0: 2d 3e 49 6e 63 72 52 65 66 28 29 3b 0d 0a 09 09 ->IncrRef();....
0ff0: 6d 5f 70 4c 69 73 74 20 3d 20 2a 28 43 50 74 72 m_pList = *(CPtr
1000: 41 72 72 61 79 2a 2a 29 28 28 28 63 68 61 72 2a Array**)(((char*
1010: 29 6d 5f 70 43 6f 6e 74 29 20 2b 20 30 78 33 30 )m_pCont) + 0x30
1020: 29 3b 0d 0a 09 7d 0d 0a 70 72 6f 74 65 63 74 65 );...}..protecte
1030: 64 3a 0d 0a 09 43 42 4c 43 6f 6e 74 65 78 74 2a d:...CBLContext*
1040: 20 6d 5f 70 43 6f 6e 74 3b 0d 0a 09 43 50 74 72 m_pCont;...CPtr
1050: 41 72 72 61 79 2a 20 6d 5f 70 4c 69 73 74 3b 0d Array* m_pList;.
1060: 0a 09 44 57 4f 52 44 20 6d 5f 63 6f 6c 43 6f 75 ..DWORD m_colCou
1070: 6e 74 3b 0d 0a 09 65 6e 75 6d 20 7b 70 75 74 41 nt;...enum {putA
1080: 6c 6c 49 6e 4c 69 73 74 2c 20 70 75 74 41 6c 6c llInList, putAll
1090: 49 6e 56 61 6c 75 65 20 7d 20 6d 5f 70 75 74 4d InValue } m_putM
10a0: 6f 64 65 3b 0d 0a 7d 3b 0d 0a 0d 0a 63 6c 61 73 ode;..};....clas
10b0: 73 20 49 53 63 61 6c 61 72 52 65 73 75 6c 74 4c s IScalarResultL
10c0: 6f 61 64 65 72 20 3a 20 70 75 62 6c 69 63 20 49 oader : public I
10d0: 53 51 4c 69 74 65 52 65 73 75 6c 74 4c 6f 61 64 SQLiteResultLoad
10e0: 65 72 0d 0a 7b 0d 0a 70 75 62 6c 69 63 3a 0d 0a er..{..public:..
10f0: 09 76 69 72 74 75 61 6c 20 44 57 4f 52 44 20 69 .virtual DWORD i
1100: 6e 69 74 28 44 57 4f 52 44 2c 20 73 71 6c 69 74 nit(DWORD, sqlit
1110: 65 33 2a 2c 20 43 56 61 6c 75 65 2a 29 0d 0a 09 e3*, CValue*)...
1120: 7b 0d 0a 09 09 72 65 74 75 72 6e 20 6d 5f 63 6f {....return m_co
1130: 6c 75 6d 6e 20 2b 20 31 3b 0d 0a 09 7d 0d 0a 09 lumn + 1;...}...
1140: 2f 2f 20 c4 ee e1 e0 e2 eb e5 ed e8 e5 20 ea ee // .......... ..
1150: eb ee ed ea e8 20 e2 20 f0 e5 e7 f3 eb fc f2 e0 ..... . ........
1160: f2 20 e7 e0 ef f0 ee f1 e0 0d 0a 09 76 69 72 74 . ..........virt
1170: 75 61 6c 20 76 6f 69 64 20 73 65 74 43 6f 6c 75 ual void setColu
1180: 6d 6e 28 44 57 4f 52 44 2c 20 63 6f 6e 73 74 20 mn(DWORD, const
1190: 43 53 74 72 69 6e 67 26 2c 20 63 6f 6e 73 74 20 CString&, const
11a0: 43 54 79 70 65 26 29 0d 0a 09 7b 0d 0a 09 7d 0d CType&)...{...}.
11b0: 0a 09 2f 2f 20 c4 ee e1 e0 e2 eb e5 ed e8 e5 20 ..// ..........
11c0: f1 f2 f0 ee ea e8 20 e2 20 f0 e5 e7 f3 eb fc f2 ...... . .......
11d0: e0 f2 20 e7 e0 ef f0 ee f1 e0 2e 0d 0a 09 2f 2f .. ...........//
11e0: 20 cf e0 f0 e0 ec e5 f2 f0 20 2d 20 ec e0 f1 f1 ........ - ....
11f0: e8 e2 20 f3 ea e0 e7 e0 f2 e5 eb e5 e9 20 ed e0 .. .......... ..
1200: 20 43 56 61 6c 75 65 2c 20 ea ee eb e8 f7 e5 f1 CValue, .......
1210: f2 e2 ee ec 20 f0 e0 e2 ed fb e9 20 ea ee eb e8 .... ...... ....
1220: f7 e5 f1 f2 e2 f3 0d 0a 09 2f 2f 20 e4 ee e1 e0 .........// ....
1230: e2 eb e5 ed ed fb f5 20 ea ee eb ee ed ee ea 0d ....... ........
1240: 0a 09 76 69 72 74 75 61 6c 20 76 6f 69 64 20 61 ..virtual void a
1250: 64 64 56 61 6c 75 65 73 28 43 56 61 6c 75 65 2a ddValues(CValue*
1260: 2a 20 70 70 56 61 6c 75 65 73 29 0d 0a 09 7b 0d * ppValues)...{.
1270: 0a 09 09 6d 5f 76 61 6c 75 65 20 3d 20 2a 70 70 ...m_value = *pp
1280: 56 61 6c 75 65 73 5b 6d 5f 63 6f 6c 75 6d 6e 5d Values[m_column]
1290: 3b 0d 0a 09 7d 0d 0a 09 2f 2f 20 cf f0 e8 f1 e2 ;...}...// .....
12a0: ee e5 ed e8 e5 20 e2 ee e7 e2 f0 e0 f9 e0 e5 ec ..... ..........
12b0: ee e3 ee 20 e7 ed e0 f7 e5 ed e8 ff 0d 0a 09 76 ... ...........v
12c0: 69 72 74 75 61 6c 20 76 6f 69 64 20 61 73 73 69 irtual void assi
12d0: 67 6e 52 65 74 56 61 6c 75 65 28 43 56 61 6c 75 gnRetValue(CValu
12e0: 65 26 20 72 65 74 56 61 6c 29 0d 0a 09 7b 0d 0a e& retVal)...{..
12f0: 09 09 72 65 74 56 61 6c 20 3d 20 6d 5f 76 61 6c ..retVal = m_val
1300: 75 65 3b 0d 0a 09 7d 0d 0a 09 76 6f 69 64 20 73 ue;...}...void s
1310: 65 74 43 6f 6c 28 44 57 4f 52 44 20 63 6f 6c 29 etCol(DWORD col)
1320: 20 7b 6d 5f 63 6f 6c 75 6d 6e 20 3d 20 63 6f 6c {m_column = col
1330: 3b 7d 0d 0a 70 72 6f 74 65 63 74 65 64 3a 0d 0a ;}..protected:..
1340: 09 44 57 4f 52 44 20 6d 5f 63 6f 6c 75 6d 6e 3b .DWORD m_column;
1350: 0d 0a 09 43 56 61 6c 75 65 20 6d 5f 76 61 6c 75 ...CValue m_valu
1360: 65 3b 0d 0a 7d 3b 0d 0a 0d 0a e;..};....