~ubuntu-branches/ubuntu/precise/libxml++2.6/precise

« back to all changes in this revision

Viewing changes to libxml++/io/istreamparserinputbuffer.cc

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-03-13 15:46:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050313154633-iubyqdtu6y3p8915
Tags: 2.10.0-0ubuntu2
added doxygen to the build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* istreamparserinputbuffer
 
2
 * this file is part of libxml++
 
3
 *
 
4
 * copyright (C) 2003 by libxml++ developer's team
 
5
 *
 
6
 * this file is covered by the GNU Lesser General Public License,
 
7
 * which should be included with libxml++ as the file COPYING.
 
8
 */
 
9
 
 
10
#include <libxml++/io/istreamparserinputbuffer.h>
 
11
 
 
12
namespace xmlpp
 
13
{
 
14
  IStreamParserInputBuffer::IStreamParserInputBuffer(
 
15
      std::istream & input)
 
16
    : ParserInputBuffer(), input_(input)
 
17
  {
 
18
  }
 
19
 
 
20
  IStreamParserInputBuffer::~IStreamParserInputBuffer()
 
21
  {
 
22
  }
 
23
 
 
24
  int IStreamParserInputBuffer::do_read(
 
25
      char * buffer,
 
26
      int len)
 
27
  {
 
28
    int l=0;
 
29
    if(input_)
 
30
    {
 
31
      // This is the correct statement - but gcc 2.95.3 lacks this method
 
32
      //l = input_.readsome(buffer, len);
 
33
      input_.read(buffer, len);
 
34
      l = input_.gcount();
 
35
    }
 
36
 
 
37
    return l;
 
38
  }
 
39
 
 
40
  bool IStreamParserInputBuffer::do_close()
 
41
  {
 
42
    return input_;
 
43
  }
 
44
};