bytestreamout_nil.hpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: bytestreamout_file.hpp
5 
6  CONTENTS:
7 
8  PROGRAMMERS:
9 
10  martin.isenburg@gmail.com
11 
12  COPYRIGHT:
13 
14  (c) 2010-2011, Martin Isenburg, LASSO - tools to catch reality
15 
16  This is free software; you can redistribute and/or modify it under the
17  terms of the GNU Lesser General Licence as published by the Free Software
18  Foundation. See the COPYING file for more information.
19 
20  This software is distributed WITHOUT ANY WARRANTY and without even the
21  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 
23  CHANGE HISTORY:
24 
25  1 October 2011 -- added 64 bit file support in MSVC 6.0 at McCafe at Hbf Linz
26  10 January 2011 -- licensing change for LGPL release and liblas integration
27  12 December 2010 -- created from ByteStreamOutFile after Howard got pushy (-;
28 
29 ===============================================================================
30 */
31 #ifndef BYTE_STREAM_OUT_NIL_H
32 #define BYTE_STREAM_OUT_NIL_H
33 
34 #include "bytestreamout.hpp"
35 
36 #include <stdio.h>
37 
39 {
40 public:
42 /* write a single byte */
43  BOOL putByte(U8 byte);
44 /* write an array of bytes */
45  BOOL putBytes(const U8* bytes, U32 num_bytes);
46 /* write 16 bit low-endian field */
47  BOOL put16bitsLE(const U8* bytes);
48 /* write 32 bit low-endian field */
49  BOOL put32bitsLE(const U8* bytes);
50 /* write 64 bit low-endian field */
51  BOOL put64bitsLE(const U8* bytes);
52 /* write 16 bit big-endian field */
53  BOOL put16bitsBE(const U8* bytes);
54 /* write 32 bit big-endian field */
55  BOOL put32bitsBE(const U8* bytes);
56 /* write 64 bit big-endian field */
57  BOOL put64bitsBE(const U8* bytes);
58 /* is the stream seekable (e.g. standard out is not) */
59  BOOL isSeekable() const;
60 /* get current position of stream */
61  I64 tell() const;
62 /* seek to this position in the stream */
63  BOOL seek(const I64 position);
64 /* seek to the end of the file */
65  BOOL seekEnd();
66 /* destructor */
68 private:
69  I64 num_bytes;
70 };
71 
73 {
74  num_bytes = 0;
75 }
76 
78 {
79  num_bytes++;
80  return TRUE;
81 }
82 
83 inline BOOL ByteStreamOutNil::putBytes(const U8* bytes, U32 num_bytes)
84 {
85  this->num_bytes += num_bytes;
86  return TRUE;
87 }
88 
90 {
91  return putBytes(bytes, 2);
92 }
93 
95 {
96  return putBytes(bytes, 4);
97 }
98 
100 {
101  return putBytes(bytes, 8);
102 }
103 
105 {
106  return putBytes(bytes, 2);
107 }
108 
110 {
111  return putBytes(bytes, 4);
112 }
113 
115 {
116  return putBytes(bytes, 8);
117 }
118 
120 {
121  return TRUE;
122 }
123 
125 {
126  return num_bytes;
127 }
128 
130 {
131  return TRUE;
132 }
133 
135 {
136  return TRUE;
137 }
138 
139 #endif
ByteStreamOutNil::put32bitsLE
BOOL put32bitsLE(const U8 *bytes)
Definition: bytestreamout_nil.hpp:94
ByteStreamOutNil::putBytes
BOOL putBytes(const U8 *bytes, U32 num_bytes)
Definition: bytestreamout_nil.hpp:83
ByteStreamOutNil::put64bitsLE
BOOL put64bitsLE(const U8 *bytes)
Definition: bytestreamout_nil.hpp:99
I64
long long I64
Definition: mydefs.hpp:48
TRUE
#define TRUE
Definition: mydefs.hpp:137
ByteStreamOutNil::put32bitsBE
BOOL put32bitsBE(const U8 *bytes)
Definition: bytestreamout_nil.hpp:109
ByteStreamOut
Definition: bytestreamout.hpp:36
ByteStreamOutNil::num_bytes
I64 num_bytes
Definition: bytestreamout_nil.hpp:67
ByteStreamOutNil::isSeekable
BOOL isSeekable() const
Definition: bytestreamout_nil.hpp:119
ByteStreamOutNil::put64bitsBE
BOOL put64bitsBE(const U8 *bytes)
Definition: bytestreamout_nil.hpp:114
bytestreamout.hpp
U8
unsigned char U8
Definition: mydefs.hpp:41
ByteStreamOutNil::seek
BOOL seek(const I64 position)
Definition: bytestreamout_nil.hpp:129
BOOL
int BOOL
Definition: mydefs.hpp:57
ByteStreamOutNil::tell
I64 tell() const
Definition: bytestreamout_nil.hpp:124
ByteStreamOutNil::putByte
BOOL putByte(U8 byte)
Definition: bytestreamout_nil.hpp:77
ByteStreamOutNil::seekEnd
BOOL seekEnd()
Definition: bytestreamout_nil.hpp:134
U32
unsigned int U32
Definition: mydefs.hpp:39
ByteStreamOutNil::ByteStreamOutNil
ByteStreamOutNil()
Definition: bytestreamout_nil.hpp:72
ByteStreamOutNil::~ByteStreamOutNil
~ByteStreamOutNil()
Definition: bytestreamout_nil.hpp:67
ByteStreamOutNil::put16bitsBE
BOOL put16bitsBE(const U8 *bytes)
Definition: bytestreamout_nil.hpp:104
ByteStreamOutNil
Definition: bytestreamout_nil.hpp:38
ByteStreamOutNil::put16bitsLE
BOOL put16bitsLE(const U8 *bytes)
Definition: bytestreamout_nil.hpp:89


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:22