ptypes

ptypes Mercurial Source Tree


Root/doc/variant.utils.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<html><!-- #BeginTemplate "/Templates/tmpl.dwt" --><!-- DW6 -->
<head>
<!-- #BeginEditable "doctitle" -->
<title>PTypes: variant: utilities</title>
<!-- #EndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="styles.css">
</head>
<body bgcolor="#FFFFFF" leftmargin="40" marginwidth="40">
<p><a href="../index.html"><img src="title-21.png" width="253" height="39" alt="C++ Portable Types Library (PTypes) Version 2.1" border="0"></a>
<hr size="1" noshade>
<!-- #BeginEditable "body" -->
<p class="hpath"><a href="index.html">Top</a>: <a href="basic.html">Basic types</a>:
<a href="variant.html">variant</a>: Utilities</p>
<blockquote>
<pre class="lang">#include <ptypes.h>
  
enum { VAR_NULL, VAR_INT, VAR_BOOL, VAR_FLOAT,
       VAR_STRING, VAR_ARRAY, VAR_OBJECT };
  
void clear(variant&);
int  vartype(const variant&);
 
bool isnull(const variant&);
bool isint(const variant&);
bool isbool(const variant&);
bool isfloat(const variant&);
bool isstring(const variant&);
bool isarray(const variant&);
bool isobject(const variant&);
 
const variant nullvar;
</pre>
</blockquote>
<p><span class="def">void clear(variant&)</span> clears the variant and sets
its state to unassigned (null).</p>
<p><span class="def">int vartype(const variant&)</span> returns the type of
a variant, which can be compared with one of the <span class="lang">VAR_XXX</span>
constants.</p>
<p><span class="def">bool isXXX(const variant&)</span> this group of inlined
functions is provided to check whether the variant is of particular type.</p>
<p class="seealso">See also: <a href="variant.typecasts.html">Assignments and
typecasts</a>, <a href="variant.arrays.html">Arrays</a>, <a href="variant.objrefs.html">Object
references</a></p>
<!-- #EndEditable -->
<hr size="1">
<a href="../index.html" class="ns">PTypes home</a>
</body>
<!-- #EndTemplate --></html>
Source at commit 209d6fa3805c created 11 years 11 months ago.
By Nathan Adams, Updating tparray to use variants as array because tpodlist was causing variant data corruption

Archive Download this file

Branches

Tags

Page rendered in 1.00882s using 11 queries.