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 
26 
27 /* Version History
28 
29  * 2013-08-15 v 0.0.9: Petr Vanek <petr@yarpen.cz>
30  + initial version
31 
32 */
33 
34 
64 namespace Qorize {
66 
67 
71 
73 
88  string qorize(bool val, string name = "var", bool newstyle=False);
89 
90 
92 
107  string qorize(string val, string name = "var", bool newstyle=False);
108 
109 
111 
126  string qorize(int val, string name = "var", bool newstyle=False);
127 
128 
130 
145  string qorize(float val, string name = "var", bool newstyle=False);
146 
147 
149 
164  string qorize(number val, string name = "var", bool newstyle=False);
165 
166 
168 
190  string qorize(date val, string name = "var", bool newstyle=False);
191 
192 
194 
212  string qorize(binary val, string name = "var", bool newstyle=False);
213 
214 
216 
236  string qorize(list val, string name = "var", bool newstyle=False);
237 
238 
240 
286  string qorize(hash val, string name = "var", bool newstyle=False);
287 
288 
290 
324  string qorizeNamed(hash val, string name = "var", bool newstyle=False);
325 
326 
328 
343  string qorize(any val, string name = "var", bool newstyle=False);
344 
346 
347 
348 // a helper class holding all logic
349 class QorizeHelper {
350 
351 public:
352 
353  private :
354  any container;
355  int type;
356  string code;
357  int level = 1;
358  list inlineLevel = ();
359  bool newstyle;
360 
361 public:
362 
363  static string checkVariableName(string name, any val, bool newstyle);
364 
365  static string escape(bool val);
366 
367  static string escape(string val);
368 
369  static string escape(int val);
370 
371  static string escape(float val);
372 
373  static string escape(number val);
374 
375  static string escape(date val);
376 
377  static string escape(binary val);
378 
379  static string escape(any val);
380 
381  constructor(any container, bool newstyle);
382 
383 
384  string list();
385 
386 
387  string hash();
388 
389 
390  string hashNamed(string name);
391 
392 
393  private processNamed(hash node, string name);
394 
395 
396  private process(list val);
397 
398 
399  private process(hash val);
400 
401 
402  private process(binary val);
403 
404 
405  private process(string val);
406 
407 
408  private process(bool val);
409 
410 
411  private process(date val);
412 
413 
414  private process(int val);
415 
416 
417  private process(float val);
418 
419 
420  private process(any val);
421 
422 
423 }; // class QorizeHelper
424 
425 }; // namespace Qorize
426 
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)