~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to libri2rib/binary.h

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
Import upstream version 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
 
2
// Aqsis
 
3
// Copyright � 1997 - 2001, Paul C. Gregory
 
4
//
 
5
// Contact: pgregory@aqsis.com
 
6
//
 
7
// This library is free software; you can redistribute it and/or
 
8
// modify it under the terms of the GNU Lesser General Public
 
9
// License as published by the Free Software Foundation; either
 
10
// version 2.1 of the License, or (at your option) any later version.
 
11
//
 
12
// This library is distributed in the hope that it will be useful,
 
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
// General Public License for more details.
 
16
//
 
17
// You should have received a copy of the GNU General Public
 
18
// License along with this library; if not, write to the Free Software
 
19
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
20
 
 
21
/** \file
 
22
 *  \brief Binary encoding output class
 
23
 *  \author Lionel J. Lacour (intuition01@online.fr)
 
24
 */
 
25
 
 
26
#ifndef RI2RIB_BINARY_H
 
27
#define RI2RIB_BINARY_H 1
 
28
 
 
29
#include <list>
 
30
#include "output.h"
 
31
 
 
32
START_NAMESPACE( libri2rib )
 
33
 
 
34
class CqBinary : public CqOutput
 
35
{
 
36
private:
 
37
    void intToChar( RtInt n, TqChar &b1, TqChar &b2, TqChar &b3, TqChar &b4 );
 
38
    void floatToChar( RtFloat f, TqChar &b1, TqChar &b2, TqChar &b3, TqChar &b4 );
 
39
    void addString( std::string &, TqBool &, TqUint & );
 
40
    void encodeString( const char * );
 
41
 
 
42
    TqBool m_aRequest[ LAST_Function ];
 
43
    std::list<std::string> m_aStrings;
 
44
 
 
45
protected:
 
46
    void printHeader();
 
47
    void printRequest( const char *, EqFunctions );
 
48
    void printInteger( const RtInt );
 
49
    void printFloat( const RtFloat );
 
50
    void printString( std::string & );
 
51
    void printSpace()
 
52
    {}
 
53
    void printEOL()
 
54
    {}
 
55
 
 
56
    void printArray ( RtInt n, RtInt *p );
 
57
    void printArray ( RtInt n, RtFloat *p );
 
58
    void printArray ( RtInt n, RtToken *p );
 
59
    void printToken ( RtToken t );
 
60
    void printCharP ( const char *c );
 
61
    void print ( const char *c );
 
62
 
 
63
public:
 
64
    CqBinary( const char *, int fdesc,
 
65
              SqOptions::EqCompression,
 
66
              SqOptions::EqIndentation, TqInt isize );
 
67
    ~CqBinary()
 
68
    {}
 
69
}
 
70
;
 
71
 
 
72
END_NAMESPACE( libri2rib )
 
73
#endif