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 
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
int BOOL
Definition: mydefs.hpp:57
BOOL seek(const I64 position)
BOOL put32bitsBE(const U8 *bytes)
unsigned int U32
Definition: mydefs.hpp:39
BOOL putBytes(const U8 *bytes, U32 num_bytes)
long long I64
Definition: mydefs.hpp:48
unsigned char U8
Definition: mydefs.hpp:41
BOOL put32bitsLE(const U8 *bytes)
BOOL put16bitsBE(const U8 *bytes)
BOOL put16bitsLE(const U8 *bytes)
#define TRUE
Definition: mydefs.hpp:137
BOOL put64bitsBE(const U8 *bytes)
BOOL put64bitsLE(const U8 *bytes)
BOOL putByte(U8 byte)


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 Mon Feb 28 2022 22:46:06