~ubuntu-branches/ubuntu/trusty/openscenegraph/trusty

« back to all changes in this revision

Viewing changes to OpenSceneGraph/src/osgPlugins/OpenFlight/RecordInputStream.h

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-07-29 04:34:38 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080729043438-no1h9h0dpsrlzp1y
* Non-maintainer upload.
* No longer try to detect (using /proc/cpuinfo when available) how many
  CPUs are available, fixing the FTBFS (due to -j0) on various platforms
  (Closes: #477353). The right way to do it is to support parallel=n in
  DEB_BUILD_OPTIONS (see Debian Policy §4.9.1), and adequate support has
  been implemented.
* Add patch to fix FTBFS due to the build system now refusing to handle
  whitespaces (Policy CMP0004 say the logs), thanks to Andreas Putzo who
  provided it (Closes: #482239):
   - debian/patches/fix-cmp0004-build-failure.dpatch
* Remove myself from Uploaders, as requested a while ago, done by Luk in
  his 2.2.0-2.1 NMU, which was never acknowledged.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
 
2
 *
 
3
 * This library is open source and may be redistributed and/or modified under  
 
4
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
 
5
 * (at your option) any later version.  The full license is in LICENSE file
 
6
 * included with this distribution, and on the openscenegraph.org website.
 
7
 * 
 
8
 * This library is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 
11
 * OpenSceneGraph Public License for more details.
 
12
*/
 
13
 
1
14
//
2
15
// OpenFlight� loader for OpenSceneGraph
3
16
//
4
 
//  Copyright (C) 2005-2006  Brede Johansen
 
17
//  Copyright (C) 2005-2007  Brede Johansen
5
18
//
6
19
 
7
20
#ifndef FLT_RECORDINPUTSTREAM_H
14
27
 
15
28
class Document;
16
29
 
 
30
typedef int opcode_type;
 
31
typedef std::streamsize size_type;
 
32
 
17
33
class RecordInputStream : public DataInputStream
18
34
{
19
35
    public:
20
36
 
21
37
        explicit RecordInputStream(std::streambuf* sb);
22
38
 
23
 
        bool readRecord(Document& data);
24
 
 
25
 
        inline std::istream::pos_type getStartOfRecord() const { return _start; }
26
 
        inline std::istream::pos_type getEndOfRecord() const { return _end; }
27
 
        inline std::streamsize getRecordSize() const { return _end-_start; }
28
 
        inline std::streamsize getRecordBodySize() const { return getRecordSize()-(std::streamsize)4; }
29
 
 
30
 
        inline void moveToStartOfRecord() { seekg(_start /*,std::ios_base::beg*/); }
31
 
        inline void setEndOfRecord(std::istream::pos_type pos) { _end=pos; }
 
39
        bool readRecord(Document&);
 
40
        bool readRecordBody(opcode_type, size_type, Document&);
 
41
 
 
42
        inline std::streamsize getRecordSize() const { return _recordSize; }
 
43
        inline std::streamsize getRecordBodySize() const { return _recordSize-(std::streamsize)4; }
32
44
 
33
45
    protected:
34
46
 
35
 
        virtual std::istream& vread(char_type *str, std::streamsize count);
36
 
        virtual std::istream& vforward(std::istream::off_type off);
37
 
 
38
 
        int _recordSize;
39
 
        int _recordOffset;
40
 
        std::istream::pos_type _start;      // start of record
41
 
        std::istream::pos_type _end;        // end of record
 
47
        std::streamsize _recordSize;
42
48
};
43
49
 
44
50
} // end namespace