source: NonGTP/Xerces/xerces/doc/html/apiDocs/classMemBufInputSource.html @ 358

Revision 358, 29.0 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1<HTML><HEAD><SCRIPT language="JavaScript" src="../resources/script.js" type="text/javascript"></SCRIPT><TITLE>MemBufInputSource class Reference</TITLE><link href="XercesApi.css" rel="stylesheet" type="text/css"></HEAD><BODY alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" height="60" rowspan="3" valign="top" width="135"><IMG border="0" height="60" hspace="0" src="../resources/logo.gif" vspace="0" width="135"></TD><TD align="left" colspan="4" height="5" valign="top" width="456"><IMG border="0" height="5" hspace="0" src="../resources/line.gif" vspace="0" width="456"></TD><TD align="left" height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60" hspace="0" src="../resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top" width="456"><IMG alt="" border="0" height="35" hspace="0" src="../graphics/api-header.jpg" vspace="0" width="456"></TD></TR><TR><TD align="left" height="20" valign="top" width="168"><IMG border="0" height="20" hspace="0" src="../resources/bottom.gif" vspace="0" width="168"></TD><TD align="left" height="20" valign="top" width="96"><A href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');" onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/" border="0" height="20" hspace="0" name="xml" onLoad="rolloverLoad('xml','../resources/button-xml-hi.gif','../resources/button-xml-lo.gif');" src="../resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.apache.org/" onMouseOut="rolloverOff('asf');" onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/" border="0" height="20" hspace="0" name="asf" onLoad="rolloverLoad('asf','../resources/button-asf-hi.gif','../resources/button-asf-lo.gif');" src="../resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/" onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');" target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0" name="w3c" onLoad="rolloverLoad('w3c','../resources/button-w3c-hi.gif','../resources/button-w3c-lo.gif');" src="../resources/button-w3c-lo.gif" vspace="0" width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG border="0" height="14" hspace="0" src="../resources/join.gif" vspace="0" width="120"><BR>
2  <A href="../../index.html" onMouseOut="rolloverOff('side-ext-2');" onMouseOver="rolloverOn('side-ext-2');"><IMG alt="Home" border="0" height="12" hspace="0" name="side-ext-2" onLoad="rolloverLoad('side-ext-2','../graphics/ext-2-label-2.jpg','../graphics/ext-2-label-3.jpg');" src="../graphics/ext-2-label-3.jpg" vspace="0" width="120"></A><BR>
3
4  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
5
6  <A href="../index.html" onMouseOut="rolloverOff('side-index');" onMouseOver="rolloverOn('side-index');"><IMG alt="Readme" border="0" height="12" hspace="0" name="side-index" onLoad="rolloverLoad('side-index','../graphics/index-label-2.jpg','../graphics/index-label-3.jpg');" src="../graphics/index-label-3.jpg" vspace="0" width="120"></A><BR>
7  <A href="../releases.html" onMouseOut="rolloverOff('side-releases');" onMouseOver="rolloverOn('side-releases');"><IMG alt="Release Info" border="0" height="12" hspace="0" name="side-releases" onLoad="rolloverLoad('side-releases','../graphics/releases-label-2.jpg','../graphics/releases-label-3.jpg');" src="../graphics/releases-label-3.jpg" vspace="0" width="120"></A><BR>
8  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
9  <A href="../install.html" onMouseOut="rolloverOff('side-install');" onMouseOver="rolloverOn('side-install');"><IMG alt="Installation" border="0" height="12" hspace="0" name="side-install" onLoad="rolloverLoad('side-install','../graphics/install-label-2.jpg','../graphics/install-label-3.jpg');" src="../graphics/install-label-3.jpg" vspace="0" width="120"></A><BR>
10  <A href="http://xml.apache.org/dist/xerces-c/" onMouseOut="rolloverOff('side-ext-18');" onMouseOver="rolloverOn('side-ext-18');"><IMG alt="Download" border="0" height="12" hspace="0" name="side-ext-18" onLoad="rolloverLoad('side-ext-18','../graphics/ext-18-label-2.jpg','../graphics/ext-18-label-3.jpg');" src="../graphics/ext-18-label-3.jpg" vspace="0" width="120"></A><BR>
11  <A href="../build.html" onMouseOut="rolloverOff('side-build');" onMouseOver="rolloverOn('side-build');"><IMG alt="Build" border="0" height="12" hspace="0" name="side-build" onLoad="rolloverLoad('side-build','../graphics/build-label-2.jpg','../graphics/build-label-3.jpg');" src="../graphics/build-label-3.jpg" vspace="0" width="120"></A><BR>
12
13  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
14  <A href="../faqs.html" onMouseOut="rolloverOff('side-faqs');" onMouseOver="rolloverOn('side-faqs');"><IMG alt="FAQs" border="0" height="12" hspace="0" name="side-faqs" onLoad="rolloverLoad('side-faqs','../graphics/faqs-label-2.jpg','../graphics/faqs-label-3.jpg');" src="../graphics/faqs-label-3.jpg" vspace="0" width="120"></A><BR> 
15  <A href="../samples.html" onMouseOut="rolloverOff('side-samples');" onMouseOver="rolloverOn('side-samples');"><IMG alt="Samples" border="0" height="12" hspace="0" name="side-samples" onLoad="rolloverLoad('side-samples','../graphics/samples-label-2.jpg','../graphics/samples-label-3.jpg');" src="../graphics/samples-label-3.jpg" vspace="0" width="120"></A><BR>
16  <A href="../api.html" onMouseOut="rolloverOff('side-api');" onMouseOver="rolloverOn('side-api');"><IMG alt="API Docs" border="0" height="12" hspace="0" name="side-api" onLoad="rolloverLoad('side-api','../graphics/api-label-2.jpg','../graphics/api-label-3.jpg');" src="../graphics/api-label-3.jpg" vspace="0" width="120"></A><BR> 
17
18  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR> 
19  <A href="../ApacheDOMC++Binding.html" onMouseOut="rolloverOff('side-ext-68');" onMouseOver="rolloverOn('side-ext-68');"><IMG alt="DOM C++ Binding" border="0" height="12" hspace="0" name="side-ext-68" onLoad="rolloverLoad('side-ext-68','../graphics/ext-68-label-2.jpg','../graphics/ext-68-label-3.jpg');" src="../graphics/ext-68-label-3.jpg" vspace="0" width="120"></A><BR>
20
21  <A href="../program.html" onMouseOut="rolloverOff('side-program');" onMouseOver="rolloverOn('side-program');"><IMG alt="Programming" border="0" height="12" hspace="0" name="side-program" onLoad="rolloverLoad('side-program','../graphics/program-label-2.jpg','../graphics/program-label-3.jpg');" src="../graphics/program-label-3.jpg" vspace="0" width="120"></A><BR>
22  <A href="../migrate.html" onMouseOut="rolloverOff('side-migrate');" onMouseOver="rolloverOn('side-migrate');"><IMG alt="Migration Guide" border="0" height="12" hspace="0" name="side-migrate" onLoad="rolloverLoad('side-migrate','../graphics/migrate-label-2.jpg','../graphics/migrate-label-3.jpg');" src="../graphics/migrate-label-3.jpg" vspace="0" width="120"></A><BR>
23
24  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
25
26  <A href="../feedback.html" onMouseOut="rolloverOff('side-feedback');" onMouseOver="rolloverOn('side-feedback');"><IMG alt="Feedback" border="0" height="12" hspace="0" name="side-feedback" onLoad="rolloverLoad('side-feedback','../graphics/feedback-label-2.jpg','../graphics/feedback-label-3.jpg');" src="../graphics/feedback-label-3.jpg" vspace="0" width="120"></A><BR>
27  <A href="../bug-report.html" onMouseOut="rolloverOff('side-bug-report');" onMouseOver="rolloverOn('side-bug-report');"><IMG alt="Bug-Reporting" border="0" height="12" hspace="0" name="side-bug-report" onLoad="rolloverLoad('side-bug-report','../graphics/bug-report-label-2.jpg','../graphics/bug-report-label-3.jpg');" src="../graphics/bug-report-label-3.jpg" vspace="0" width="120"></A><BR> 
28  <A href="../pdf.html" onMouseOut="rolloverOff('side-pdf');" onMouseOver="rolloverOn('side-pdf');"><IMG alt="PDF Document" border="0" height="12" hspace="0" name="side-pdf" onLoad="rolloverLoad('side-pdf','../graphics/pdf-label-2.jpg','../graphics/pdf-label-3.jpg');" src="../graphics/pdf-label-3.jpg" vspace="0" width="120"></A><BR>
29
30  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
31
32  <A href="http://xml.apache.org/websrc/cvsweb.cgi/xml-xerces/c/" onMouseOut="rolloverOff('side-ext-100');" onMouseOver="rolloverOn('side-ext-100');"><IMG alt="CVS Repository" border="0" height="12" hspace="0" name="side-ext-100" onLoad="rolloverLoad('side-ext-100','../graphics/ext-100-label-2.jpg','../graphics/ext-100-label-3.jpg');" src="../graphics/ext-100-label-3.jpg" vspace="0" width="120"></A><BR>
33
34  <A href="http://marc.theaimsgroup.com/?l=xerces-c-dev" onMouseOut="rolloverOff('side-ext-102');" onMouseOver="rolloverOn('side-ext-102');"><IMG alt="Mail Archive" border="0" height="12" hspace="0" name="side-ext-102" onLoad="rolloverLoad('side-ext-102','../graphics/ext-102-label-2.jpg','../graphics/ext-102-label-3.jpg');" src="../graphics/ext-102-label-3.jpg" vspace="0" width="120"></A><BR>
35
36
37<IMG border="0" height="14" hspace="0" src="../resources/close.gif" vspace="0" width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD>
38    <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#FFFFFF" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="../resources/void.gif" vspace="0" width="2"><B>API Docs for SAX and DOM</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
39
40            <P>
41<!-- Generated by Doxygen 1.2.14 -->
42<center>
43<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
44<hr><h1>MemBufInputSource Class Reference</h1>This class is a derivative of the standard <a class="el" href="classInputSource.html">InputSource</a> class.
45<a href="#_details">More...</a>
46<p>
47Inheritance diagram for MemBufInputSource:<p><center><img src="classMemBufInputSource__inherit__graph.gif" border="0" usemap="#MemBufInputSource__inherit__map" alt="Inheritance graph"></center>
48<map name="MemBufInputSource__inherit__map">
49<area href="classInputSource.html" shape="rect" coords="32,105,115,86" alt="">
50<area href="classXMemory.html" shape="rect" coords="39,36,108,17" alt="">
51</map>
52<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for MemBufInputSource:<p><center><img src="classMemBufInputSource__coll__graph.gif" border="0" usemap="#MemBufInputSource__coll__map" alt="Collaboration graph"></center>
53<map name="MemBufInputSource__coll__map">
54<area href="classInputSource.html" shape="rect" coords="56,126,139,108" alt="">
55<area href="classXMemory.html" shape="rect" coords="7,36,76,17" alt="">
56<area href="classMemoryManager.html" shape="rect" coords="100,36,209,17" alt="">
57</map>
58<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classMemBufInputSource-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
59<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
60<tr><td colspan="2"><div class="groupHeader">Constructors</div></td></tr>
61<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classMemBufInputSource.html#z216_0">MemBufInputSource</a> (const <a class="el" href="XercesDefs_8hpp.html#a16">XMLByte</a> *const srcDocBytes, const unsigned int byteCount, const XMLCh *const bufId, const bool adoptBuffer=false, <a class="el" href="classMemoryManager.html">MemoryManager</a> *const manager=<a class="el" href="classXMLPlatformUtils.html#z488_4">XMLPlatformUtils::fgMemoryManager</a>)</td></tr>
62<tr><td>&nbsp;</td><td><font size=-1><em>A memory buffer input source is constructed from a buffer of byte data, and the count of bytes in that buffer.</em> <a href="#z216_0">More...</a><em></em></font><br><br></td></tr>
63<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classMemBufInputSource.html#z216_1">MemBufInputSource</a> (const <a class="el" href="XercesDefs_8hpp.html#a16">XMLByte</a> *const srcDocBytes, const unsigned int byteCount, const char *const bufId, const bool adoptBuffer=false, <a class="el" href="classMemoryManager.html">MemoryManager</a> *const manager=<a class="el" href="classXMLPlatformUtils.html#z488_4">XMLPlatformUtils::fgMemoryManager</a>)</td></tr>
64<tr><td>&nbsp;</td><td><font size=-1><em>This constructor is identical to the previous one, except that it takes the fake system id in local code page form and transcodes it internally.</em> <a href="#z216_1">More...</a><em></em></font><br><br></td></tr>
65<tr><td colspan="2"><div class="groupHeader">Destructor</div></td></tr>
66<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classMemBufInputSource.html#z217_0">~MemBufInputSource</a> ()</td></tr>
67<tr><td>&nbsp;</td><td><font size=-1><em>If the buffer was adopted, the copy made during construction is deleted at this point.</em> <a href="#z217_0">More...</a><em></em></font><br><br></td></tr>
68<tr><td colspan="2"><div class="groupHeader">Virtual methods</div></td></tr>
69<tr><td nowrap align=right valign=top><a class="el" href="classBinInputStream.html">BinInputStream</a> *&nbsp;</td><td valign=bottom><a class="el" href="classMemBufInputSource.html#z218_0">makeStream</a> () const</td></tr>
70<tr><td>&nbsp;</td><td><font size=-1><em>This method will return a binary input stream derivative that will parse from the memory buffer.</em> <a href="#z218_0">More...</a><em></em></font><br><br></td></tr>
71<tr><td colspan="2"><div class="groupHeader">Setter methods</div></td></tr>
72<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classMemBufInputSource.html#z219_0">setCopyBufToStream</a> (const bool newState)</td></tr>
73<tr><td>&nbsp;</td><td><font size=-1><em>By default, for safety's sake, each newly created stream from this input source will make its own copy of the buffer to stream from.</em> <a href="#z219_0">More...</a><em></em></font><br><br></td></tr>
74<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classMemBufInputSource.html#z219_1">resetMemBufInputSource</a> (const <a class="el" href="XercesDefs_8hpp.html#a16">XMLByte</a> *const srcDocBytes, const unsigned int byteCount)</td></tr>
75<tr><td>&nbsp;</td><td><font size=-1><em>This methods allows the MemBufInputSource to be used for more than one input source, instead of destructing/constructing another MemBufInputSource.</em> <a href="#z219_1">More...</a><em></em></font><br><br></td></tr>
76</table>
77<hr><a name="_details"></a><h2>Detailed Description</h2>
78This class is a derivative of the standard <a class="el" href="classInputSource.html">InputSource</a> class.
79<p>
80It provides for the parser access to data stored in a memory buffer. The type of buffer and its host specific attributes are of little concern here. The only real requirement is that the memory be readable by the current process.
81<p>
82Note that the memory buffer size is expressed in <b>bytes</b>, not in characters. If you pass it text data, you must account for the bytes per character when indicating the buffer size.
83<p>
84As with all <a class="el" href="classInputSource.html">InputSource</a> derivatives. The primary objective of an input source is to create an input stream via which the parser can spool in data from the referenced source. In this case, there are two options available.
85<p>
86The passed buffer can be adopted or merely referenced. If it is adopted, then it must be dynamically allocated and will be destroyed when the input source is destroyed (no reference counting!.) If not adopted, the caller must insure that it remains valid until the input source object is destroyed.
87<p>
88The other option indicates whether each stream created for this input source should get its own copy of the data, or whether it should just stream the data directly from this object's copy of the data. The same rules apply here, in that the buffer must either be copied by the stream or it must remain valid until the stream is destroyed.
89<p>
90<hr><h2>Constructor &amp; Destructor Documentation</h2>
91<a name="z216_0" doxytag="MemBufInputSource::MemBufInputSource"></a><p>
92<table width="100%" cellpadding="2" cellspacing="0" border="0">
93  <tr>
94    <td class="md">
95      <table cellpadding="0" cellspacing="0" border="0">
96        <tr>
97          <td class="md" nowrap valign="top"> MemBufInputSource::MemBufInputSource </td>
98          <td class="md" valign="top">(&nbsp;</td>
99          <td class="md" nowrap valign="top">const <a class="el" href="XercesDefs_8hpp.html#a16">XMLByte</a> *const&nbsp;</td>
100          <td class="mdname" nowrap>&nbsp; <em>srcDocBytes</em>, </td>
101        </tr>
102        <tr>
103          <td></td>
104          <td></td>
105          <td class="md" nowrap>const unsigned int&nbsp;</td>
106          <td class="mdname" nowrap>&nbsp; <em>byteCount</em>, </td>
107        </tr>
108        <tr>
109          <td></td>
110          <td></td>
111          <td class="md" nowrap>const XMLCh *const&nbsp;</td>
112          <td class="mdname" nowrap>&nbsp; <em>bufId</em>, </td>
113        </tr>
114        <tr>
115          <td></td>
116          <td></td>
117          <td class="md" nowrap>const bool&nbsp;</td>
118          <td class="mdname" nowrap>&nbsp; <em>adoptBuffer</em> = false, </td>
119        </tr>
120        <tr>
121          <td></td>
122          <td></td>
123          <td class="md" nowrap><a class="el" href="classMemoryManager.html">MemoryManager</a> *const&nbsp;</td>
124          <td class="mdname" nowrap>&nbsp; <em>manager</em> = <a class="el" href="classXMLPlatformUtils.html#z488_4">XMLPlatformUtils::fgMemoryManager</a></td>
125        </tr>
126        <tr>
127          <td></td>
128          <td class="md">)&nbsp;</td>
129          <td class="md" colspan="2"></td>
130        </tr>
131
132      </table>
133    </td>
134  </tr>
135</table>
136<table cellspacing=5 cellpadding=0 border=0>
137  <tr>
138    <td>
139      &nbsp;
140    </td>
141    <td>
142
143<p>
144A memory buffer input source is constructed from a buffer of byte data, and the count of bytes in that buffer.
145<p>
146The parser will parse from this memory buffer until it has eaten the indicated number of bytes.
147<p>
148Note that the system id provided serves two purposes. Firstly it is going to be displayed in error messages as the source of the error. And secondly, any entities which are refered to from this entity via relative paths/URLs will be relative to this fake system id.<dl compact><dt><b>
149Parameters: </b><dd>
150<table border=0 cellspacing=2 cellpadding=0>
151<tr><td valign=top><em>srcDocBytes</em>&nbsp;</td><td>
152The actual data buffer to be parsed from. </td></tr>
153<tr><td valign=top><em>byteCount</em>&nbsp;</td><td>
154The count of bytes (not characters, bytes!) in the buffer. </td></tr>
155<tr><td valign=top><em>bufId</em>&nbsp;</td><td>
156A fake system id for the buffer. </td></tr>
157<tr><td valign=top><em>adoptBuffer</em>&nbsp;</td><td>
158Indicates whether this object should adopt the buffer (i.e. make a copy of it) or just use it in place. </td></tr>
159<tr><td valign=top><em>manager</em>&nbsp;</td><td>
160Pointer to the memory manager to be used to allocate objects. </td></tr>
161</table>
162</dl>    </td>
163  </tr>
164</table>
165<a name="z216_1" doxytag="MemBufInputSource::MemBufInputSource"></a><p>
166<table width="100%" cellpadding="2" cellspacing="0" border="0">
167  <tr>
168    <td class="md">
169      <table cellpadding="0" cellspacing="0" border="0">
170        <tr>
171          <td class="md" nowrap valign="top"> MemBufInputSource::MemBufInputSource </td>
172          <td class="md" valign="top">(&nbsp;</td>
173          <td class="md" nowrap valign="top">const <a class="el" href="XercesDefs_8hpp.html#a16">XMLByte</a> *const&nbsp;</td>
174          <td class="mdname" nowrap>&nbsp; <em>srcDocBytes</em>, </td>
175        </tr>
176        <tr>
177          <td></td>
178          <td></td>
179          <td class="md" nowrap>const unsigned int&nbsp;</td>
180          <td class="mdname" nowrap>&nbsp; <em>byteCount</em>, </td>
181        </tr>
182        <tr>
183          <td></td>
184          <td></td>
185          <td class="md" nowrap>const char *const&nbsp;</td>
186          <td class="mdname" nowrap>&nbsp; <em>bufId</em>, </td>
187        </tr>
188        <tr>
189          <td></td>
190          <td></td>
191          <td class="md" nowrap>const bool&nbsp;</td>
192          <td class="mdname" nowrap>&nbsp; <em>adoptBuffer</em> = false, </td>
193        </tr>
194        <tr>
195          <td></td>
196          <td></td>
197          <td class="md" nowrap><a class="el" href="classMemoryManager.html">MemoryManager</a> *const&nbsp;</td>
198          <td class="mdname" nowrap>&nbsp; <em>manager</em> = <a class="el" href="classXMLPlatformUtils.html#z488_4">XMLPlatformUtils::fgMemoryManager</a></td>
199        </tr>
200        <tr>
201          <td></td>
202          <td class="md">)&nbsp;</td>
203          <td class="md" colspan="2"></td>
204        </tr>
205
206      </table>
207    </td>
208  </tr>
209</table>
210<table cellspacing=5 cellpadding=0 border=0>
211  <tr>
212    <td>
213      &nbsp;
214    </td>
215    <td>
216
217<p>
218This constructor is identical to the previous one, except that it takes the fake system id in local code page form and transcodes it internally.
219<p>
220    </td>
221  </tr>
222</table>
223<a name="z217_0" doxytag="MemBufInputSource::~MemBufInputSource"></a><p>
224<table width="100%" cellpadding="2" cellspacing="0" border="0">
225  <tr>
226    <td class="md">
227      <table cellpadding="0" cellspacing="0" border="0">
228        <tr>
229          <td class="md" nowrap valign="top"> MemBufInputSource::~MemBufInputSource </td>
230          <td class="md" valign="top">(&nbsp;</td>
231          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
232          <td class="md" valign="top">)&nbsp;</td>
233          <td class="md" nowrap></td>
234        </tr>
235
236      </table>
237    </td>
238  </tr>
239</table>
240<table cellspacing=5 cellpadding=0 border=0>
241  <tr>
242    <td>
243      &nbsp;
244    </td>
245    <td>
246
247<p>
248If the buffer was adopted, the copy made during construction is deleted at this point.
249<p>
250    </td>
251  </tr>
252</table>
253<hr><h2>Member Function Documentation</h2>
254<a name="z218_0" doxytag="MemBufInputSource::makeStream"></a><p>
255<table width="100%" cellpadding="2" cellspacing="0" border="0">
256  <tr>
257    <td class="md">
258      <table cellpadding="0" cellspacing="0" border="0">
259        <tr>
260          <td class="md" nowrap valign="top"> <a class="el" href="classBinInputStream.html">BinInputStream</a>* MemBufInputSource::makeStream </td>
261          <td class="md" valign="top">(&nbsp;</td>
262          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
263          <td class="md" valign="top">)&nbsp;</td>
264          <td class="md" nowrap> const<code> [virtual]</code></td>
265        </tr>
266
267      </table>
268    </td>
269  </tr>
270</table>
271<table cellspacing=5 cellpadding=0 border=0>
272  <tr>
273    <td>
274      &nbsp;
275    </td>
276    <td>
277
278<p>
279This method will return a binary input stream derivative that will parse from the memory buffer.
280<p>
281If <a class="el" href="classMemBufInputSource.html#z219_0">setCopyBufToStream</a>() has been set, then the stream will make its own copy. Otherwise, it will use the buffer as is (in which case it must remain valid until the stream is no longer in use, i.e. the parse completes.)
282<p>
283<dl compact><dt><b>
284Returns: </b><dd>
285A dynamically allocated binary input stream derivative that can parse from the memory buffer. </dl>
286<p>
287Implements <a class="el" href="classInputSource.html#z434_0">InputSource</a>.    </td>
288  </tr>
289</table>
290<a name="z219_1" doxytag="MemBufInputSource::resetMemBufInputSource"></a><p>
291<table width="100%" cellpadding="2" cellspacing="0" border="0">
292  <tr>
293    <td class="md">
294      <table cellpadding="0" cellspacing="0" border="0">
295        <tr>
296          <td class="md" nowrap valign="top"> void MemBufInputSource::resetMemBufInputSource </td>
297          <td class="md" valign="top">(&nbsp;</td>
298          <td class="md" nowrap valign="top">const <a class="el" href="XercesDefs_8hpp.html#a16">XMLByte</a> *const&nbsp;</td>
299          <td class="mdname" nowrap>&nbsp; <em>srcDocBytes</em>, </td>
300        </tr>
301        <tr>
302          <td></td>
303          <td></td>
304          <td class="md" nowrap>const unsigned int&nbsp;</td>
305          <td class="mdname" nowrap>&nbsp; <em>byteCount</em></td>
306        </tr>
307        <tr>
308          <td></td>
309          <td class="md">)&nbsp;</td>
310          <td class="md" colspan="2"></td>
311        </tr>
312
313      </table>
314    </td>
315  </tr>
316</table>
317<table cellspacing=5 cellpadding=0 border=0>
318  <tr>
319    <td>
320      &nbsp;
321    </td>
322    <td>
323
324<p>
325This methods allows the MemBufInputSource to be used for more than one input source, instead of destructing/constructing another MemBufInputSource.
326<p>
327<dl compact><dt><b>
328Parameters: </b><dd>
329<table border=0 cellspacing=2 cellpadding=0>
330<tr><td valign=top><em>srcDocBytes</em>&nbsp;</td><td>
331The actual data buffer to be parsed from. </td></tr>
332<tr><td valign=top><em>byteCount</em>&nbsp;</td><td>
333The count of bytes (not characters, bytes!) in the buffer. </td></tr>
334</table>
335</dl>    </td>
336  </tr>
337</table>
338<a name="z219_0" doxytag="MemBufInputSource::setCopyBufToStream"></a><p>
339<table width="100%" cellpadding="2" cellspacing="0" border="0">
340  <tr>
341    <td class="md">
342      <table cellpadding="0" cellspacing="0" border="0">
343        <tr>
344          <td class="md" nowrap valign="top"> void MemBufInputSource::setCopyBufToStream </td>
345          <td class="md" valign="top">(&nbsp;</td>
346          <td class="md" nowrap valign="top">const bool&nbsp;</td>
347          <td class="mdname1" valign="top" nowrap>&nbsp; <em>newState</em>          </td>
348          <td class="md" valign="top">)&nbsp;</td>
349          <td class="md" nowrap></td>
350        </tr>
351
352      </table>
353    </td>
354  </tr>
355</table>
356<table cellspacing=5 cellpadding=0 border=0>
357  <tr>
358    <td>
359      &nbsp;
360    </td>
361    <td>
362
363<p>
364By default, for safety's sake, each newly created stream from this input source will make its own copy of the buffer to stream from.
365<p>
366This avoids having to deal with aliasing of the buffer for simple work. But, for higher performance applications or for large buffers, this is obviously not optimal.
367<p>
368In such cases, you can call this method to turn off that default action. Once turned off, the streams will just get a pointer to the buffer and parse directly from that. In this case, you must insure that the buffer remains valid for as long as any parse events are still using it.<dl compact><dt><b>
369Parameters: </b><dd>
370<table border=0 cellspacing=2 cellpadding=0>
371<tr><td valign=top><em>newState</em>&nbsp;</td><td>
372The new boolean flag state to set. </td></tr>
373</table>
374</dl>    </td>
375  </tr>
376</table>
377<hr>The documentation for this class was generated from the following file:<ul>
378<li><a class="el" href="MemBufInputSource_8hpp-source.html">MemBufInputSource.hpp</a></ul>
379    </FONT></TD></TR></TABLE><BR>
380</TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1" src="images/dot.gif" width="1" alt=""></TD></TR><TR><TD align="center"><FONT color="#0086b2" size="-1"><I>
381              Copyright &copy; 1994-2004 The Apache Software Foundation.
382              All Rights Reserved.
383            </I></FONT></TD></TR></TABLE></BODY></HTML>
Note: See TracBrowser for help on using the repository browser.