]> err.no Git - sope/blob - sope-appserver/NGObjWeb/WOResponse+private.h
added support for 'disabled' binding as in WO
[sope] / sope-appserver / NGObjWeb / WOResponse+private.h
1 /*
2   Copyright (C) 2000-2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
6   SOPE is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with SOPE; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21
22 #ifndef __NGObjWeb_WOResponse_private_H__
23 #define __NGObjWeb_WOResponse_private_H__
24
25 #include <NGObjWeb/WOResponse.h>
26
27 // fast inline functions (non-WO)
28
29 #define WOResponse_AddChar(__R__,__C__) \
30   if (__R__) {__R__->addChar(__R__, @selector(appendContentCharacter:), __C__);}
31
32 #define WOResponse_AddString(__R__,__C__) \
33   if (__R__) {__R__->addStr(__R__, @selector(appendContentString:), __C__);}
34 #define WOResponse_AddCString(__R__,__C__) \
35   if (__R__) {__R__->addCStr(__R__, @selector(appendContentCString:), __C__);}
36
37 #define WOResponse_AddHtmlString(__R__,__C__) \
38   if (__R__) {__R__->addHStr(__R__, @selector(appendContentHTMLString:), __C__);}
39
40 // TODO: performance ! - use static buffer and appendContentCString !
41
42 #define WOResponse_AddUInt(__R__,__C__) \
43   if (__R__) {\
44     switch(__C__) {\
45       case 0: __R__->addCStr(__R__, @selector(appendContentCString:),"0");break;\
46       case 1: __R__->addCStr(__R__, @selector(appendContentCString:),"1");break;\
47       case 2: __R__->addCStr(__R__, @selector(appendContentCString:),"2");break;\
48       case 3: __R__->addCStr(__R__, @selector(appendContentCString:),"3");break;\
49       case 4: __R__->addCStr(__R__, @selector(appendContentCString:),"4");break;\
50       default: {\
51         char buf[12]; sprintf(buf,"%d", __C__); \
52         __R__->addCStr(__R__, @selector(appendContentCString:), buf);}\
53     }\
54   }
55
56 #define WOResponse_AddInt(__R__,__C__) \
57   if (__R__) {\
58     switch(__C__) {\
59       case 0: __R__->addCStr(__R__, @selector(appendContentCString:),"0");break;\
60       case 1: __R__->addCStr(__R__, @selector(appendContentCString:),"1");break;\
61       case 2: __R__->addCStr(__R__, @selector(appendContentCString:),"2");break;\
62       case 3: __R__->addCStr(__R__, @selector(appendContentCString:),"3");break;\
63       case 4: __R__->addCStr(__R__, @selector(appendContentCString:),"4");break;\
64       default: {\
65         char buf[12]; sprintf(buf,"%i", __C__); \
66         __R__->addCStr(__R__, @selector(appendContentCString:), buf);}\
67     }\
68   }
69
70 #endif /* __NGObjWeb_WOResponse_private_H__ */