Qore Qorize Module Reference  0.0.10
Qorize.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
2 // @file Qorize.qm Qorize module definition
3 
4 /* Qorize.qm Copyright 2013 - 2015 Qore Technologies s r.o.
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // minimum qore version
26 
27 // assume local var scope, do not use "$" for vars, members, and method calls
28 
29 
30 /* Version History
31  * 2015-11-11 v 0.0.10: David Nichols <david@qore.org>
32  + converted to new-style
33 
34  * 2013-08-15 v 0.0.9: Petr Vanek <petr@yarpen.cz>
35  + initial version
36 */
37 
38 
68 namespace Qorize {
70 
71 
75 
77 
92  string qorize(bool val, string name = "var", bool newstyle=False);
93 
94 
96 
111  string qorize(string val, string name = "var", bool newstyle=False);
112 
113 
115 
130  string qorize(int val, string name = "var", bool newstyle=False);
131 
132 
134 
149  string qorize(float val, string name = "var", bool newstyle=False);
150 
151 
153 
168  string qorize(number val, string name = "var", bool newstyle=False);
169 
170 
172 
194  string qorize(date val, string name = "var", bool newstyle=False);
195 
196 
198 
216  string qorize(binary val, string name = "var", bool newstyle=False);
217 
218 
220 
240  string qorize(list val, string name = "var", bool newstyle=False);
241 
242 
244 
290  string qorize(hash val, string name = "var", bool newstyle=False);
291 
292 
294 
328  string qorizeNamed(hash val, string name = "var", bool newstyle=False);
329 
330 
332 
347  string qorize(any val, string name = "var", bool newstyle=False);
348 
350 
351 
352 // a helper class holding all logic
353 class QorizeHelper {
354 
355 public:
356 
357  private :
358  any container;
359  int type;
360  string code;
361  int level = 1;
362  list inlineLevel = ();
363  bool newstyle;
364 
365 public:
366 
367  static string checkVariableName(string name, any val, bool newstyle);
368 
369  static string escape(bool val);
370 
371  static string escape(string val);
372 
373  static string escape(int val);
374 
375  static string escape(float val);
376 
377  static string escape(number val);
378 
379  static string escape(date val);
380 
381  static string escape(binary val);
382 
383  static string escape(any val);
384 
385  constructor(any n_container, bool n_newstyle);
386 
387 
388  string list();
389 
390 
391  string hash();
392 
393 
394  string hashNamed(string name);
395 
396 
397  private processNamed(hash node, string name);
398 
399 
400  private process(list val);
401 
402 
403  private process(hash val);
404 
405 
406  private process(binary val);
407 
408 
409  private process(string val);
410 
411 
412  private process(bool val);
413 
414 
415  private process(date val);
416 
417 
418  private process(int val);
419 
420 
421  private process(float val);
422 
423 
424  private process(any val);
425 
426 
427 }; // class QorizeHelper
428 
429 }; // namespace Qorize
date date(date dt)
number number(softnumber n)
binary binary()
const False
list list(...)
string qorizeNamed(hash val, string name="var", bool newstyle=False)
create code from the hash value - with one value per one line
string qorize(bool val, string name="var", bool newstyle=False)
create code from the boolean value
string type(any arg)
public Qorize namespace contains all relevant stuff for this module
Definition: Qorize.qm.dox.h:69
hash hash(object obj)