File: raptor-section-iostream.html

package info (click to toggle)
raptor 1.4.13-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 11,576 kB
  • ctags: 4,494
  • sloc: ansic: 31,845; sh: 9,278; xml: 8,589; yacc: 2,912; lex: 1,018; makefile: 817; perl: 61; cpp: 59
file content (945 lines) | stat: -rw-r--r-- 36,393 bytes parent folder | download
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>I/O Stream</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.71.0">
<link rel="start" href="index.html" title="Raptor RDF Syntax Parsing and Serializing Library Manual">
<link rel="up" href="reference-manual.html" title="Part&#160;II.&#160;Raptor Reference Manual">
<link rel="prev" href="raptor-section-feature.html" title="Features">
<link rel="next" href="raptor-section-locator.html" title="Locator">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="introduction.html" title="Raptor Overview">
<link rel="part" href="tutorial.html" title="Part&#160;I.&#160;Raptor Tutorial">
<link rel="chapter" href="tutorial-initialising-finishing.html" title="Initialising and Finishing using the Library">
<link rel="chapter" href="tutorial-querying-functionality.html" title="Listing built-in functionality">
<link rel="chapter" href="tutorial-parsing.html" title="Parsing syntaxes to RDF Triples">
<link rel="chapter" href="tutorial-serializing.html" title="Serializing RDF triples to a syntax">
<link rel="part" href="reference-manual.html" title="Part&#160;II.&#160;Raptor Reference Manual">
<link rel="chapter" href="raptor-parsers.html" title="Parsers in Raptor (syntax to triples)">
<link rel="chapter" href="raptor-serializers.html" title="Serializers in Raptor (triples to syntax)">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="raptor-section-feature.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference-manual.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Raptor RDF Syntax Parsing and Serializing Library Manual</th>
<td><a accesskey="n" href="raptor-section-locator.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2576652" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2591730" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="raptor-section-iostream"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2576652"></a><span class="refentrytitle">I/O Stream</span>
</h2>
<p>I/O Stream &#8212; Providing streaming I/O writing to files, strings or user code.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">



typedef     <a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>;
int         (<a href="raptor-section-iostream.html#raptor-iostream-init-func">*raptor_iostream_init_func</a>)    (void *context);
void        (<a href="raptor-section-iostream.html#raptor-iostream-finish-func">*raptor_iostream_finish_func</a>)  (void *context);
int         (<a href="raptor-section-iostream.html#raptor-iostream-write-byte-func">*raptor_iostream_write_byte_func</a>)
                                            (void *context,
                                             const int byte);
int         (<a href="raptor-section-iostream.html#raptor-iostream-write-bytes-func">*raptor_iostream_write_bytes_func</a>)
                                            (void *context,
                                             const void *ptr,
                                             size_t size,
                                             size_t nmemb);
void        (<a href="raptor-section-iostream.html#raptor-iostream-write-end-func">*raptor_iostream_write_end_func</a>)
                                            (void *context);
            <a href="raptor-section-iostream.html#raptor-iostream-handler">raptor_iostream_handler</a>;
<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>* <a href="raptor-section-iostream.html#raptor-new-iostream-from-handler">raptor_new_iostream_from_handler</a>
                                            (void *context,
                                             const <a href="raptor-section-iostream.html#raptor-iostream-handler">raptor_iostream_handler</a> *handler);
<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>* <a href="raptor-section-iostream.html#raptor-new-iostream-to-sink">raptor_new_iostream_to_sink</a>
                                            (void);
<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>* <a href="raptor-section-iostream.html#raptor-new-iostream-to-filename">raptor_new_iostream_to_filename</a>
                                            (const char *filename);
<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>* <a href="raptor-section-iostream.html#raptor-new-iostream-to-file-handle">raptor_new_iostream_to_file_handle</a>
                                            (FILE *handle);
<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>* <a href="raptor-section-iostream.html#raptor-new-iostream-to-string">raptor_new_iostream_to_string</a>
                                            (void **string_p,
                                             size_t *length_p,
                                             void* (*malloc_handler) (size_t size));
void        <a href="raptor-section-iostream.html#raptor-free-iostream">raptor_free_iostream</a>            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr);
int         <a href="raptor-section-iostream.html#raptor-iostream-write-bytes">raptor_iostream_write_bytes</a>     (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             const void *ptr,
                                             size_t size,
                                             size_t nmemb);
int         <a href="raptor-section-iostream.html#raptor-iostream-write-byte">raptor_iostream_write_byte</a>      (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             const int byte);
void        <a href="raptor-section-iostream.html#raptor-iostream-write-end">raptor_iostream_write_end</a>       (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr);
int         <a href="raptor-section-iostream.html#raptor-iostream-write-string">raptor_iostream_write_string</a>    (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             const void *string);
int         <a href="raptor-section-iostream.html#raptor-iostream-write-counted-string">raptor_iostream_write_counted_string</a>
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             const void *string,
                                             size_t len);
size_t      <a href="raptor-section-iostream.html#raptor-iostream-get-bytes-written-count">raptor_iostream_get_bytes_written_count</a>
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr);
int         <a href="raptor-section-iostream.html#raptor-iostream-write-decimal">raptor_iostream_write_decimal</a>   (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             int integer);
int         <a href="raptor-section-iostream.html#raptor-iostream-format-hexadecimal">raptor_iostream_format_hexadecimal</a>
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             unsigned int integer,
                                             int width);
int         <a href="raptor-section-iostream.html#raptor-iostream-write-stringbuffer">raptor_iostream_write_stringbuffer</a>
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             <a href="raptor-section-stringbuffer.html#raptor-stringbuffer">raptor_stringbuffer</a> *sb);
int         <a href="raptor-section-iostream.html#raptor-iostream-write-string-ntriples">raptor_iostream_write_string_ntriples</a>
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             unsigned char *string,
                                             size_t len,
                                             const char delim);
void        <a href="raptor-section-iostream.html#raptor-iostream-write-statement-ntriples">raptor_iostream_write_statement_ntriples</a>
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             const <a href="raptor-section-triples.html#raptor-statement">raptor_statement</a> *statement);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2591730"></a><h2>Description</h2>
<p>
An class providing an I/O writer abstraction that allows generating
output that can be stored or passed on to system files, strings
allocated in memory (usually via <a href="raptor-section-stringbuffer.html#raptor-stringbuffer"><span class="type">raptor_stringbuffer</span></a>), system
file handles (<code class="literal">FILE*</code>) or to a user function.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2603925"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2603936"></a><h3>
<a name="raptor-iostream"></a>raptor_iostream</h3>
<a class="indexterm" name="id2603948"></a><pre class="programlisting">raptor_iostream* raptor_iostream;
</pre>
<p>
Raptor I/O Stream class</p>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2603968"></a><h3>
<a name="raptor-iostream-init-func"></a>raptor_iostream_init_func ()</h3>
<a class="indexterm" name="id2603980"></a><pre class="programlisting">int         (*raptor_iostream_init_func)    (void *context);</pre>
<p>
Handler function for <a href="raptor-section-iostream.html#raptor-iostream"><span class="type">raptor_iostream</span></a> initialising.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> stream context data
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2604047"></a><h3>
<a name="raptor-iostream-finish-func"></a>raptor_iostream_finish_func ()</h3>
<a class="indexterm" name="id2604059"></a><pre class="programlisting">void        (*raptor_iostream_finish_func)  (void *context);</pre>
<p>
Handler function for <a href="raptor-section-iostream.html#raptor-iostream"><span class="type">raptor_iostream</span></a> terminating.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> stream context data
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2604115"></a><h3>
<a name="raptor-iostream-write-byte-func"></a>raptor_iostream_write_byte_func ()</h3>
<a class="indexterm" name="id2604128"></a><pre class="programlisting">int         (*raptor_iostream_write_byte_func)
                                            (void *context,
                                             const int byte);</pre>
<p>
Handler function for implementing <a href="raptor-section-iostream.html#raptor-iostream-write-byte"><code class="function">raptor_iostream_write_byte()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> stream context data
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>byte</code></em>&#160;:</span></td>
<td> byte to write
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2571262"></a><h3>
<a name="raptor-iostream-write-bytes-func"></a>raptor_iostream_write_bytes_func ()</h3>
<a class="indexterm" name="id2571275"></a><pre class="programlisting">int         (*raptor_iostream_write_bytes_func)
                                            (void *context,
                                             const void *ptr,
                                             size_t size,
                                             size_t nmemb);</pre>
<p>
Handler function for implementing <a href="raptor-section-iostream.html#raptor-iostream-write-bytes"><code class="function">raptor_iostream_write_bytes()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> stream context data
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>ptr</code></em>&#160;:</span></td>
<td> pointer to bytes to write
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>size</code></em>&#160;:</span></td>
<td> size of item
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>nmemb</code></em>&#160;:</span></td>
<td> number of items
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2571409"></a><h3>
<a name="raptor-iostream-write-end-func"></a>raptor_iostream_write_end_func ()</h3>
<a class="indexterm" name="id2571422"></a><pre class="programlisting">void        (*raptor_iostream_write_end_func)
                                            (void *context);</pre>
<p>
Handler function for implementing <a href="raptor-section-iostream.html#raptor-iostream-write-end"><code class="function">raptor_iostream_write_end()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> stream context data
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2571482"></a><h3>
<a name="raptor-iostream-handler"></a>raptor_iostream_handler</h3>
<a class="indexterm" name="id2571493"></a><pre class="programlisting">typedef struct {
  raptor_iostream_init_func         init;
  raptor_iostream_finish_func       finish;
  raptor_iostream_write_byte_func   write_byte;
  raptor_iostream_write_bytes_func  write_bytes;
  raptor_iostream_write_end_func    write_end;
} raptor_iostream_handler;
</pre>
<p>
I/O stream implementation handler structure.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a href="raptor-section-iostream.html#raptor-iostream-init-func">raptor_iostream_init_func</a>&#160;<em class="structfield"><code>init</code></em>;</span></td>
<td>  initialisation handler - optional, called at most once
</td>
</tr>
<tr>
<td>
<span class="term"><a href="raptor-section-iostream.html#raptor-iostream-finish-func">raptor_iostream_finish_func</a>&#160;<em class="structfield"><code>finish</code></em>;</span></td>
<td> finishing handler -  optional, called at most once
</td>
</tr>
<tr>
<td>
<span class="term"><a href="raptor-section-iostream.html#raptor-iostream-write-byte-func">raptor_iostream_write_byte_func</a>&#160;<em class="structfield"><code>write_byte</code></em>;</span></td>
<td> write byte handler - required
</td>
</tr>
<tr>
<td>
<span class="term"><a href="raptor-section-iostream.html#raptor-iostream-write-bytes-func">raptor_iostream_write_bytes_func</a>&#160;<em class="structfield"><code>write_bytes</code></em>;</span></td>
<td> write bytes handler - required
</td>
</tr>
<tr>
<td>
<span class="term"><a href="raptor-section-iostream.html#raptor-iostream-write-end-func">raptor_iostream_write_end_func</a>&#160;<em class="structfield"><code>write_end</code></em>;</span></td>
<td> write end handler - optional, called at most once
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2615079"></a><h3>
<a name="raptor-new-iostream-from-handler"></a>raptor_new_iostream_from_handler ()</h3>
<a class="indexterm" name="id2615092"></a><pre class="programlisting"><a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>* raptor_new_iostream_from_handler
                                            (void *context,
                                             const <a href="raptor-section-iostream.html#raptor-iostream-handler">raptor_iostream_handler</a> *handler);</pre>
<p>
Create a new iostream over a user-defined handler.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> pointer to context information to pass in to calls
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>handler</code></em>&#160;:</span></td>
<td> pointer to handler methods
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new <a href="raptor-section-iostream.html#raptor-iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2615174"></a><h3>
<a name="raptor-new-iostream-to-sink"></a>raptor_new_iostream_to_sink ()</h3>
<a class="indexterm" name="id2615185"></a><pre class="programlisting"><a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>* raptor_new_iostream_to_sink
                                            (void);</pre>
<p>
Create a new iostream to a sink.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new <a href="raptor-section-iostream.html#raptor-iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2502475"></a><h3>
<a name="raptor-new-iostream-to-filename"></a>raptor_new_iostream_to_filename ()</h3>
<a class="indexterm" name="id2564034"></a><pre class="programlisting"><a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>* raptor_new_iostream_to_filename
                                            (const char *filename);</pre>
<p>
Constructor - create a new iostream writing to a filename.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
<td> Output filename to open and write to
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new <a href="raptor-section-iostream.html#raptor-iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2615283"></a><h3>
<a name="raptor-new-iostream-to-file-handle"></a>raptor_new_iostream_to_file_handle ()</h3>
<a class="indexterm" name="id2615296"></a><pre class="programlisting"><a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>* raptor_new_iostream_to_file_handle
                                            (FILE *handle);</pre>
<p>
Constructor - create a new iostream writing to a FILE*.
</p>
<p>
The <em class="parameter"><code>handle</code></em> must already be open for writing.
NOTE: This does not fclose the <em class="parameter"><code>handle</code></em> when it is finished.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>handle</code></em>&#160;:</span></td>
<td> FILE* handle to write to
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new <a href="raptor-section-iostream.html#raptor-iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2615372"></a><h3>
<a name="raptor-new-iostream-to-string"></a>raptor_new_iostream_to_string ()</h3>
<a class="indexterm" name="id2615384"></a><pre class="programlisting"><a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a>* raptor_new_iostream_to_string
                                            (void **string_p,
                                             size_t *length_p,
                                             void* (*malloc_handler) (size_t size));</pre>
<p>
Constructor - create a new iostream writing to a string.
</p>
<p>
If <em class="parameter"><code>malloc_handler</code></em> is null, raptor will allocate it using it's
own memory allocator.  *<em class="parameter"><code>string_p</code></em> is set to NULL on failure (and
*<em class="parameter"><code>length_p</code></em> to 0 if <em class="parameter"><code>length_p</code></em> is not NULL).</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>string_p</code></em>&#160;:</span></td>
<td> pointer to location to hold string
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>length_p</code></em>&#160;:</span></td>
<td> pointer to location to hold length of string (or NULL)
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>malloc_handler</code></em>&#160;:</span></td>
<td> pointer to malloc to use to make string (or NULL)
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new <a href="raptor-section-iostream.html#raptor-iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2615514"></a><h3>
<a name="raptor-free-iostream"></a>raptor_free_iostream ()</h3>
<a class="indexterm" name="id2615524"></a><pre class="programlisting">void        raptor_free_iostream            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr);</pre>
<p>
Destructor - destroy an iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> iostream object
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2615569"></a><h3>
<a name="raptor-iostream-write-bytes"></a>raptor_iostream_write_bytes ()</h3>
<a class="indexterm" name="id2615580"></a><pre class="programlisting">int         raptor_iostream_write_bytes     (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             const void *ptr,
                                             size_t size,
                                             size_t nmemb);</pre>
<p>
Write bytes to the iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>ptr</code></em>&#160;:</span></td>
<td> start of objects to write
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>size</code></em>&#160;:</span></td>
<td> size of object
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>nmemb</code></em>&#160;:</span></td>
<td> number of objects
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> number of objects written or less than nmemb or 0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2615692"></a><h3>
<a name="raptor-iostream-write-byte"></a>raptor_iostream_write_byte ()</h3>
<a class="indexterm" name="id2615703"></a><pre class="programlisting">int         raptor_iostream_write_byte      (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             const int byte);</pre>
<p>
Write a byte to the iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>byte</code></em>&#160;:</span></td>
<td> byte to write
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2615776"></a><h3>
<a name="raptor-iostream-write-end"></a>raptor_iostream_write_end ()</h3>
<a class="indexterm" name="id2615787"></a><pre class="programlisting">void        raptor_iostream_write_end       (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr);</pre>
<p>
End writing to the iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iostream
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2615831"></a><h3>
<a name="raptor-iostream-write-string"></a>raptor_iostream_write_string ()</h3>
<a class="indexterm" name="id2615844"></a><pre class="programlisting">int         raptor_iostream_write_string    (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             const void *string);</pre>
<p>
Write a NULL-terminated string to the iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>string</code></em>&#160;:</span></td>
<td> string
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2615918"></a><h3>
<a name="raptor-iostream-write-counted-string"></a>raptor_iostream_write_counted_string ()</h3>
<a class="indexterm" name="id2615931"></a><pre class="programlisting">int         raptor_iostream_write_counted_string
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             const void *string,
                                             size_t len);</pre>
<p>
Write a counted string to the iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>string</code></em>&#160;:</span></td>
<td> string
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>len</code></em>&#160;:</span></td>
<td> string length
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2616024"></a><h3>
<a name="raptor-iostream-get-bytes-written-count"></a>raptor_iostream_get_bytes_written_count ()</h3>
<a class="indexterm" name="id2616037"></a><pre class="programlisting">size_t      raptor_iostream_get_bytes_written_count
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr);</pre>
<p>
Get the number of bytes written to the iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> number of bytes written or 0 if non written so far
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2616094"></a><h3>
<a name="raptor-iostream-write-decimal"></a>raptor_iostream_write_decimal ()</h3>
<a class="indexterm" name="id2616106"></a><pre class="programlisting">int         raptor_iostream_write_decimal   (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             int integer);</pre>
<p>
Write an integer in decimal to the iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>integer</code></em>&#160;:</span></td>
<td> integer to format as decimal
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2616181"></a><h3>
<a name="raptor-iostream-format-hexadecimal"></a>raptor_iostream_format_hexadecimal ()</h3>
<a class="indexterm" name="id2616194"></a><pre class="programlisting">int         raptor_iostream_format_hexadecimal
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             unsigned int integer,
                                             int width);</pre>
<p>
Write an integer in hexadecimal to the iostream.
</p>
<p>
Always 0-fills the entire field and writes in uppercase A-F</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>integer</code></em>&#160;:</span></td>
<td> unsigned integer to format as hexadecimal
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>width</code></em>&#160;:</span></td>
<td> field width
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2616292"></a><h3>
<a name="raptor-iostream-write-stringbuffer"></a>raptor_iostream_write_stringbuffer ()</h3>
<a class="indexterm" name="id2616306"></a><pre class="programlisting">int         raptor_iostream_write_stringbuffer
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             <a href="raptor-section-stringbuffer.html#raptor-stringbuffer">raptor_stringbuffer</a> *sb);</pre>
<p>
Write a stringbuffer to an iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>sb</code></em>&#160;:</span></td>
<td> <a href="raptor-section-stringbuffer.html#raptor-stringbuffer"><span class="type">raptor_stringbuffer</span></a> to write
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2616386"></a><h3>
<a name="raptor-iostream-write-string-ntriples"></a>raptor_iostream_write_string_ntriples ()</h3>
<a class="indexterm" name="id2616399"></a><pre class="programlisting">int         raptor_iostream_write_string_ntriples
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             unsigned char *string,
                                             size_t len,
                                             const char delim);</pre>
<p>
Write an UTF-8 string using N-Triples escapes to an iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> <a href="raptor-section-iostream.html#raptor-iostream"><span class="type">raptor_iostream</span></a> to write to
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>string</code></em>&#160;:</span></td>
<td> UTF-8 string to write
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>len</code></em>&#160;:</span></td>
<td> length of UTF-8 string
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>delim</code></em>&#160;:</span></td>
<td> Terminating delimiter character for string (such as " or &gt;)
or \0 for no escaping.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure such as bad UTF-8 encoding.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2616521"></a><h3>
<a name="raptor-iostream-write-statement-ntriples"></a>raptor_iostream_write_statement_ntriples ()</h3>
<a class="indexterm" name="id2616533"></a><pre class="programlisting">void        raptor_iostream_write_statement_ntriples
                                            (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             const <a href="raptor-section-triples.html#raptor-statement">raptor_statement</a> *statement);</pre>
<p>
Write a <a href="raptor-section-triples.html#raptor-statement"><span class="type">raptor_statement</span></a> formatted in N-Triples format to a <a href="raptor-section-iostream.html#raptor-iostream"><span class="type">raptor_iostream</span></a></p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iosteram
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>statement</code></em>&#160;:</span></td>
<td> statement to write
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>