SLV2  0.6.6
value.h
1 /* SLV2
2  * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
3  *
4  * This library is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the Free
6  * Software Foundation; either version 2 of the License, or (at your option)
7  * any later version.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12  * for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __SLV2_VALUE_H__
20 #define __SLV2_VALUE_H__
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include <stdbool.h>
27 #include "slv2/types.h"
28 
38 SLV2Value
39 slv2_value_new_uri(SLV2World world, const char* uri);
40 
41 
46 SLV2Value
47 slv2_value_new_string(SLV2World world, const char* str);
48 
49 
54 SLV2Value
55 slv2_value_new_int(SLV2World world, int val);
56 
57 
62 SLV2Value
63 slv2_value_new_float(SLV2World world, float val);
64 
65 
68 void
69 slv2_value_free(SLV2Value val);
70 
71 
74 SLV2Value
75 slv2_value_duplicate(SLV2Value val);
76 
77 
80 bool
81 slv2_value_equals(SLV2Value value, SLV2Value other);
82 
83 
94 char*
95 slv2_value_get_turtle_token(SLV2Value value);
96 
97 
102 bool
103 slv2_value_is_uri(SLV2Value value);
104 
105 
113 const char*
114 slv2_value_as_uri(SLV2Value value);
115 
116 
117 #if 0
125 bool
126 slv2_value_is_qname(SLV2Value value);
127 
128 
136 const char*
137 slv2_value_as_qname(SLV2Value value);
138 #endif
139 
140 
147 bool
148 slv2_value_is_literal(SLV2Value value);
149 
150 
157 bool
158 slv2_value_is_string(SLV2Value value);
159 
160 
165 const char*
166 slv2_value_as_string(SLV2Value value);
167 
168 
173 bool
174 slv2_value_is_float(SLV2Value value);
175 
176 
184 float
185 slv2_value_as_float(SLV2Value value);
186 
187 
192 bool
193 slv2_value_is_int(SLV2Value value);
194 
195 
202 int
203 slv2_value_as_int(SLV2Value value);
204 
205 
208 #ifdef __cplusplus
209 } /* extern "C" */
210 #endif
211 
212 #endif /* __SLV2_VALUE_H__ */
SLV2Value slv2_value_new_uri(SLV2World world, const char *uri)
Create a new URI value.
SLV2Value slv2_value_new_string(SLV2World world, const char *str)
Create a new string value (with no language).
float slv2_value_as_float(SLV2Value value)
Return value as a float.
bool slv2_value_is_int(SLV2Value value)
Return whether this value is an integer literal.
char * slv2_value_get_turtle_token(SLV2Value value)
Return this value as a Turtle/SPARQL token.
SLV2Value slv2_value_duplicate(SLV2Value val)
Duplicate an SLV2Value.
void slv2_value_free(SLV2Value val)
Free an SLV2Value.
SLV2Value slv2_value_new_float(SLV2World world, float val)
Create a new floating point value.
const char * slv2_value_as_uri(SLV2Value value)
Return this value as a URI string, e.g.
int slv2_value_as_int(SLV2Value value)
Return value as an integer.
bool slv2_value_equals(SLV2Value value, SLV2Value other)
Return whether two values are equivalent.
bool slv2_value_is_string(SLV2Value value)
Return whether this value is a string literal.
bool slv2_value_is_literal(SLV2Value value)
Return whether this value is a literal (i.e.
bool slv2_value_is_uri(SLV2Value value)
Return whether the value is a URI (resource).
const char * slv2_value_as_string(SLV2Value value)
Return value as a string.
bool slv2_value_is_float(SLV2Value value)
Return whether this value is a decimal literal.
SLV2Value slv2_value_new_int(SLV2World world, int val)
Create a new integer value.

Generated for SLV2 by doxygen 1.9.1