1 |
/* |
2 |
* RdfNode.cs - Implementation of the "DotGNU.Rdf.RdfNode" class. |
3 |
* |
4 |
* Copyright (C) 2003 Adam Ballai, Cannibutter Software. |
5 |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU Lesser General Public License as published by |
8 |
* the Free Software Foundation; either version 2 of the License, or |
9 |
* (at your option) any later version. |
10 |
* |
11 |
* This program is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU Lesser General Public License |
17 |
* along with this program; if not, write to the Free Software |
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
* |
20 |
* Thanks to Redland http://www.redland.opensource.ac.uk for the design interface. |
21 |
* |
22 |
*/ |
23 |
|
24 |
namespace DotGNU.Rdf |
25 |
{ |
26 |
using System; |
27 |
using System.Net; |
28 |
|
29 |
public class RdfParser |
30 |
{ |
31 |
// *factory |
32 |
public delegate void Factory(RdfParserFactory parser_factory); |
33 |
|
34 |
// librdf_parser_register_factory |
35 |
public abstract void ParserRegisterFactory(RdfWorld world, String name, String mime_type, String uri_string, Factory parser_factory); |
36 |
|
37 |
|
38 |
// Constructor. |
39 |
// librdf_new_parser |
40 |
extern public RdfParser(RdfWorld world, |
41 |
String name, |
42 |
String mime_type, |
43 |
RdfUri type_uri); |
44 |
|
45 |
// Constructor. |
46 |
// librdf_new_parser_from_factory |
47 |
extern public RdfParser(RdfWorld world, RdfParserFactory parser_factory); |
48 |
|
49 |
|
50 |
|
51 |
// librdf_get_parser_factory |
52 |
/* |
53 |
librdf_parser_factory* librdf_get_parser_factory(librdf_world *world, |
54 |
const char *name, |
55 |
const char *mime_type, |
56 |
librdf_uri *type_uri); |
57 |
*/ |
58 |
|
59 |
|
60 |
public |
61 |
abstract |
62 |
RdfParserFactory |
63 |
GetParserFactory( |
64 |
RdfWorld world, |
65 |
String name, |
66 |
String mime_type, |
67 |
RdfUri type_uri); |
68 |
|
69 |
|
70 |
|
71 |
// librdf_free_parser |
72 |
public abstract void ParserFree(RdfParser parser); |
73 |
|
74 |
// librdf_parser_parse_as_stream |
75 |
public abstract RdfStream ParserParseAsStream(RdfParser parser, RdfUri uri, RdfUri base_uri); |
76 |
|
77 |
// librdf_parser_parse_into_model |
78 |
// non-zero on failure |
79 |
public abstract int ParserParseIntoModel(RdfParser parser, RdfUri uri, RdfUri base_uri, RdfModel model); |
80 |
|
81 |
// librdf_init_parser |
82 |
public abstract void ParserInit(RdfWorld world); |
83 |
|
84 |
// librdf_finish_parser |
85 |
public abstract void ParserFinish(RdfWorld world); |
86 |
|
87 |
// *error_fn |
88 |
public delegate void ErrorFn(IntPtr user_data, |
89 |
String msg, |
90 |
Object[] paramlist |
91 |
); |
92 |
|
93 |
// librdf_parser_set_error |
94 |
public abstract void ParserSetError(RdfParser parser, ErrorFn errorfn); |
95 |
|
96 |
// *warning_fn |
97 |
public delegate void WarningFn(IntPtr user_data, |
98 |
String msg, |
99 |
Object[] paramlist); |
100 |
|
101 |
// librdf_parser_set_warning |
102 |
public abstract void ParserSetWarning(RdfParser parser, IntPtr user_data, WarningFn warningfn); |
103 |
|
104 |
// librdf_parser_get_feature |
105 |
public abstract String Feature(RdfParser parser, RdfUri feature); |
106 |
|
107 |
// librdf_parser_set_feature |
108 |
// return non-zero on failure ... negative if no such feature |
109 |
public abstract int Feature(RdfParser parser, RdfUri feature, String value); |
110 |
|
111 |
} |
112 |
|
113 |
} |
114 |
|