Qore Qorize Module Reference  0.0.9
 All Classes Namespaces Functions Variables Groups Pages
Qorize.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
2 // @file Mime.qm Mime module definition
3 
4 /* Mime.qm Copyright 2013 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 
28 /* Version History
29 
30  * 2013-08-15 v 0.0.9: Petr Vanek <petr@yarpen.cz>
31  + initial version
32 
33 */
34 
35 
65 namespace Qorize {
67 
68 
72 
74 
89  string qorize(bool val, string name = "var", bool newstyle=False);
90 
91 
93 
108  string qorize(string val, string name = "var", bool newstyle=False);
109 
110 
112 
127  string qorize(int val, string name = "var", bool newstyle=False);
128 
129 
131 
146  string qorize(float val, string name = "var", bool newstyle=False);
147 
148 
150 
165  string qorize(number val, string name = "var", bool newstyle=False);
166 
167 
169 
191  string qorize(date val, string name = "var", bool newstyle=False);
192 
193 
195 
213  string qorize(binary val, string name = "var", bool newstyle=False);
214 
215 
217 
237  string qorize(list val, string name = "var", bool newstyle=False);
238 
239 
241 
287  string qorize(hash val, string name = "var", bool newstyle=False);
288 
289 
291 
325  string qorizeNamed(hash val, string name = "var", bool newstyle=False);
326 
327 
329 
344  string qorize(any val, string name = "var", bool newstyle=False);
345 
347 
348 
349 // a helper class holding all logic
350 class QorizeHelper {
351 
352 public:
353 
354  private :
355  any container;
356  int type;
357  string code;
358  int level = 1;
359  list inlineLevel = ();
360  bool newstyle;
361 
362 public:
363 
364  static string checkVariableName(string name, any val, bool newstyle);
365 
366  static string escape(bool val);
367 
368  static string escape(string val);
369 
370  static string escape(int val);
371 
372  static string escape(float val);
373 
374  static string escape(number val);
375 
376  static string escape(date val);
377 
378  static string escape(binary val);
379 
380  static string escape(any val);
381 
382  constructor(any container, bool newstyle);
383 
384 
385  string list();
386 
387 
388  string hash();
389 
390 
391  string hashNamed(string name);
392 
393 
394  private processNamed(hash node, string name);
395 
396 
397  private process(list val);
398 
399 
400  private process(hash val);
401 
402 
403  private process(binary val);
404 
405 
406  private process(string val);
407 
408 
409  private process(bool val);
410 
411 
412  private process(date val);
413 
414 
415  private process(int val);
416 
417 
418  private process(float val);
419 
420 
421  private process(any val);
422 
423 
424 }; // class QorizeHelper
425 
426 }; // namespace Qorize
427 
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)
hash hash(object obj)