My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "Sql.h"

NAMESPACE_UPP

void td_scalar(SqlSet& set, const String& prefix, const char *x) {
set.Cat(SqlId(prefix + x));
}

void td_array(SqlSet& set, const String& prefix, const char *x, int cnt) {
String name = prefix + x;
for(int i = 0; i < cnt; i++)
set.Cat(SqlId(name + Format("%d", i)));
}

void td_var(SqlSet& set, const String& prefix, const char *x, SqlSet (*f)(const String&)) {
set.Cat((*f)(prefix + x + '$'));
}

void td_shrink(String *array, int cnt) {
String *lim = array + cnt;
while(array < lim) {
array->Shrink();
array++;
}
}

struct NfEqual : FieldOperator {
ValueArray va;

virtual void Field(const char *name, Ref f) {
va.Add(f);
}
};

bool EqualFields(Fields a, Fields b)
{
NfEqual fa, fb;
a(fa);
b(fb);
return fa.table == fb.table && fa.va == fb.va;
}

struct NfAsString : FieldOperator {
String text;

virtual void Field(const char *name, Ref f) {
text << "\n\t" << name << '=' << (Value)f;
}
};


String AsString(Fields a)
{
NfAsString x;
a(x);
return x.text;
}

END_UPP_NAMESPACE

Change log

r4276 by cxl on Dec 8, 2011   Diff
Core: Id is now String based, Sql: SqlCol
erradicated
Go to: 
Project members, sign in to write a code review

Older revisions

r3005 by cxl on Jan 15, 2011   Diff
Sql: Table structures S_ now have
ToString to have DUMP/LOG support
r1726 by cxl on Nov 29, 2009   Diff
Sql: S_ structures are now == !=
comparable
r281 by mdelfede on Jun 7, 2008   Diff
changed svn layout
All revisions of this file

File info

Size: 1045 bytes, 59 lines

File properties

svn:eol-style
native
Powered by Google Project Hosting