1 /******************************************************************************
2 *
3 * Copyright (C) 2009, The Gentee Group. All rights reserved.
4 * This file is part of the Gentee open source project - http://www.gentee.com.
5 *
6 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE GENTEE LICENSE ("AGREEMENT").
7 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS
8 * ACCEPTANCE OF THE AGREEMENT.
9 *
10 * Author: Alexey Krivonogov ( gentee )
11 *
12 ******************************************************************************/
13
14 method uint ged.append()
15 {
16 return ged_append( this, 0 )
17 }
18
19 method uint ged.append( collection cdata )
20 {
21 buf data
22 uint i
23 arrustr aus
24
25 fornum i, *cdata
26 {
27 uint field
28
29 field as this.field( i )
30
31 switch field.ftype
32 {
33 case $FT_BYTE, $FT_SHORT, $FT_INT, $FT_FLOAT
34 {
35 if cdata.gettype( i ) == str : data += int( cdata[i] )
36 else : data += cdata[i]
37 }
38 case $FT_UBYTE, $FT_USHORT, $FT_UINT
39 {
40 if cdata.gettype( i ) == str : data += uint( cdata[i] )
41 else : data += cdata[i]
42 }
43 case $FT_ULONG, $FT_DOUBLE
44 {
45 if cdata.gettype( i ) == uint : data += ulong( cdata[i] )
46 else : data += cdata.ptr( i )->ulong
47 }
48 case $FT_LONG
49 {
50 if cdata.gettype( i ) == uint : data += long( cdata[i] )
51 else : data += cdata.ptr( i )->long
52 }
53 case $FT_STR
54 {
55 if cdata.gettype( i ) == str : data += cdata[i]->str.ptr()
56 }
57 case $FT_USTR
58 {
59 if cdata.gettype( i ) == ustr : data += cdata[i]->str.ptr()
60 elif cdata.gettype( i ) == str
61 {
62 aus += ustr( cdata[i]->str )
63 data += aus[ *aus - 1 ].ptr()
64 }
65 }
66 }
67 }
68 return ged_append( this, data.ptr())
69 }
70
71 method uint ged.isdel()
72 {
73 return ged_isdel( this )
74 }