Fawkes API  Fawkes Development Version
fawkeslogging_tolua.cpp
1 /*
2 ** Lua binding: fawkeslogging
3 ** Generated automatically by tolua++-1.0.92
4 */
5 /* This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version. A runtime exception applies to
9  * this software (see LICENSE.GPL_WRE file mentioned below for details).
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Library General Public License for more details.
15  *
16  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
17  */
18 
19 #ifndef __cplusplus
20 #include "stdlib.h"
21 #endif
22 #include "string.h"
23 
24 #include "tolua++.h"
25 
26 /* Exported function */
27 TOLUA_API int tolua_fawkeslogging_open (lua_State* tolua_S);
28 
29 #include <logging/component.h>
30 
31 /* function to register type */
32 static void tolua_reg_types (lua_State* tolua_S)
33 {
34  tolua_usertype(tolua_S,"fawkes::ComponentLogger");
35 }
36 
37 /* method: log_debug of class fawkes::ComponentLogger */
38 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_debug00
39 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_debug00(lua_State* tolua_S)
40 {
41 #ifndef TOLUA_RELEASE
42  tolua_Error tolua_err;
43  if (
44  !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) ||
45  !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
46  !tolua_isnoobj(tolua_S,3,&tolua_err)
47  )
48  goto tolua_lerror;
49  else
50 #endif
51  {
52  fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0);
53  std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0));
54 #ifndef TOLUA_RELEASE
55  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_debug'",NULL);
56 #endif
57  {
58  self->log_debug(message);
59  }
60  }
61  return 0;
62 #ifndef TOLUA_RELEASE
63  tolua_lerror:
64  tolua_error(tolua_S,"#ferror in function 'log_debug'.",&tolua_err);
65  return 0;
66 #endif
67 }
68 #endif //#ifndef TOLUA_DISABLE
69 
70 /* method: log_info of class fawkes::ComponentLogger */
71 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_info00
72 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_info00(lua_State* tolua_S)
73 {
74 #ifndef TOLUA_RELEASE
75  tolua_Error tolua_err;
76  if (
77  !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) ||
78  !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
79  !tolua_isnoobj(tolua_S,3,&tolua_err)
80  )
81  goto tolua_lerror;
82  else
83 #endif
84  {
85  fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0);
86  std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0));
87 #ifndef TOLUA_RELEASE
88  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_info'",NULL);
89 #endif
90  {
91  self->log_info(message);
92  }
93  }
94  return 0;
95 #ifndef TOLUA_RELEASE
96  tolua_lerror:
97  tolua_error(tolua_S,"#ferror in function 'log_info'.",&tolua_err);
98  return 0;
99 #endif
100 }
101 #endif //#ifndef TOLUA_DISABLE
102 
103 /* method: log_warn of class fawkes::ComponentLogger */
104 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_warn00
105 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_warn00(lua_State* tolua_S)
106 {
107 #ifndef TOLUA_RELEASE
108  tolua_Error tolua_err;
109  if (
110  !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) ||
111  !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
112  !tolua_isnoobj(tolua_S,3,&tolua_err)
113  )
114  goto tolua_lerror;
115  else
116 #endif
117  {
118  fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0);
119  std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0));
120 #ifndef TOLUA_RELEASE
121  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_warn'",NULL);
122 #endif
123  {
124  self->log_warn(message);
125  }
126  }
127  return 0;
128 #ifndef TOLUA_RELEASE
129  tolua_lerror:
130  tolua_error(tolua_S,"#ferror in function 'log_warn'.",&tolua_err);
131  return 0;
132 #endif
133 }
134 #endif //#ifndef TOLUA_DISABLE
135 
136 /* method: log_error of class fawkes::ComponentLogger */
137 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_error00
138 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_error00(lua_State* tolua_S)
139 {
140 #ifndef TOLUA_RELEASE
141  tolua_Error tolua_err;
142  if (
143  !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) ||
144  !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
145  !tolua_isnoobj(tolua_S,3,&tolua_err)
146  )
147  goto tolua_lerror;
148  else
149 #endif
150  {
151  fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0);
152  std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0));
153 #ifndef TOLUA_RELEASE
154  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_error'",NULL);
155 #endif
156  {
157  self->log_error(message);
158  }
159  }
160  return 0;
161 #ifndef TOLUA_RELEASE
162  tolua_lerror:
163  tolua_error(tolua_S,"#ferror in function 'log_error'.",&tolua_err);
164  return 0;
165 #endif
166 }
167 #endif //#ifndef TOLUA_DISABLE
168 
169 /* Open function */
170 TOLUA_API int tolua_fawkeslogging_open (lua_State* tolua_S)
171 {
172  tolua_open(tolua_S);
173  tolua_reg_types(tolua_S);
174  tolua_module(tolua_S,NULL,0);
175  tolua_beginmodule(tolua_S,NULL);
176  tolua_module(tolua_S,"fawkes",0);
177  tolua_beginmodule(tolua_S,"fawkes");
178  tolua_cclass(tolua_S,"ComponentLogger","fawkes::ComponentLogger","",NULL);
179  tolua_beginmodule(tolua_S,"ComponentLogger");
180  tolua_function(tolua_S,"log_debug",tolua_fawkeslogging_fawkes_ComponentLogger_log_debug00);
181  tolua_function(tolua_S,"log_info",tolua_fawkeslogging_fawkes_ComponentLogger_log_info00);
182  tolua_function(tolua_S,"log_warn",tolua_fawkeslogging_fawkes_ComponentLogger_log_warn00);
183  tolua_function(tolua_S,"log_error",tolua_fawkeslogging_fawkes_ComponentLogger_log_error00);
184  tolua_endmodule(tolua_S);
185  tolua_endmodule(tolua_S);
186  tolua_endmodule(tolua_S);
187  return 1;
188 }
189 
190 
191 extern "C" {
192 #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
193  TOLUA_API int luaopen_fawkeslogging (lua_State* tolua_S) {
194  return tolua_fawkeslogging_open(tolua_S);
195 };
196 #endif
197 }
198 
199 
Component logger.
Definition: component.h:35