summaryrefslogtreecommitdiffstats
path: root/common/rdr
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-03-17 14:35:51 +0100
committerPierre Ossman <ossman@cendio.se>2014-07-07 14:42:08 +0200
commit7b5c069d2e7eaa1748507a03697c14900258e507 (patch)
tree245936793e9607ce98dd89e98c1fdd0ac6b2d3ce /common/rdr
parent65ad3224e920deecb91a3c28e15341c8584a372c (diff)
downloadtigervnc-7b5c069d2e7eaa1748507a03697c14900258e507.tar.gz
tigervnc-7b5c069d2e7eaa1748507a03697c14900258e507.zip
Push encoding specific formats into the encoders and decoders
Keep the generic stream classes clean and general.
Diffstat (limited to 'common/rdr')
-rw-r--r--common/rdr/InStream.h23
-rw-r--r--common/rdr/OutStream.h25
2 files changed, 0 insertions, 48 deletions
diff --git a/common/rdr/InStream.h b/common/rdr/InStream.h
index 6d22ac6a..760fb3dc 100644
--- a/common/rdr/InStream.h
+++ b/common/rdr/InStream.h
@@ -71,23 +71,6 @@ namespace rdr {
inline S16 readS16() { return (S16)readU16(); }
inline S32 readS32() { return (S32)readU32(); }
- // readCompactLength() reads 1..3 bytes representing length of the data
- // following. This method is used by the Tight decoder.
-
- inline unsigned int readCompactLength() {
- U8 b = readU8();
- int result = (int)b & 0x7F;
- if (b & 0x80) {
- b = readU8();
- result |= ((int)b & 0x7F) << 7;
- if (b & 0x80) {
- b = readU8();
- result |= ((int)b & 0xFF) << 14;
- }
- }
- return result;
- }
-
// readString() reads a string - a U32 length followed by the data.
// Returns a null-terminated string - the caller should delete[] it
// afterwards.
@@ -128,12 +111,6 @@ namespace rdr {
inline U32 readOpaque32() { check(4); U32 r; ((U8*)&r)[0] = *ptr++;
((U8*)&r)[1] = *ptr++; ((U8*)&r)[2] = *ptr++;
((U8*)&r)[3] = *ptr++; return r; }
- inline U32 readOpaque24A() { check(3); U32 r=0; ((U8*)&r)[0] = *ptr++;
- ((U8*)&r)[1] = *ptr++; ((U8*)&r)[2] = *ptr++;
- return r; }
- inline U32 readOpaque24B() { check(3); U32 r=0; ((U8*)&r)[1] = *ptr++;
- ((U8*)&r)[2] = *ptr++; ((U8*)&r)[3] = *ptr++;
- return r; }
// pos() returns the position in the stream.
diff --git a/common/rdr/OutStream.h b/common/rdr/OutStream.h
index aed2eea1..4afd4bfb 100644
--- a/common/rdr/OutStream.h
+++ b/common/rdr/OutStream.h
@@ -65,25 +65,6 @@ namespace rdr {
inline void writeS16(S16 s) { writeU16((U16)s); }
inline void writeS32(S32 s) { writeU32((U32)s); }
- // writeCompactLength() writes 1..3 bytes representing length of the data
- // following. This method is used by the Tight encoder.
-
- inline void writeCompactLength(unsigned int len) {
- U8 b = len & 0x7F;
- if (len <= 0x7F) {
- writeU8(b);
- } else {
- writeU8(b | 0x80);
- b = len >> 7 & 0x7F;
- if (len <= 0x3FFF) {
- writeU8(b);
- } else {
- writeU8(b | 0x80);
- writeU8(len >> 14 & 0xFF);
- }
- }
- }
-
// writeString() writes a string - a U32 length followed by the data. The
// given string should be null-terminated (but the terminating null is not
// written to the stream).
@@ -128,12 +109,6 @@ namespace rdr {
*ptr++ = ((U8*)&u)[1];
*ptr++ = ((U8*)&u)[2];
*ptr++ = ((U8*)&u)[3]; }
- inline void writeOpaque24A(U32 u) { check(3); *ptr++ = ((U8*)&u)[0];
- *ptr++ = ((U8*)&u)[1];
- *ptr++ = ((U8*)&u)[2]; }
- inline void writeOpaque24B(U32 u) { check(3); *ptr++ = ((U8*)&u)[1];
- *ptr++ = ((U8*)&u)[2];
- *ptr++ = ((U8*)&u)[3]; }
// length() returns the length of the stream.