VR-Link API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
byteStream.h
Go to the documentation of this file.
1 /*********************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************************/
5 
6 #pragma once
7 
13 
15 
16 #include <vector>
17 #include <string>
18 
22 {
23 public:
25  DtStreamReader(unsigned char* buffer, int length);
26 
28  virtual ~DtStreamReader();
29 
32 
33  bool readBool();
34  char readInt8();
35  unsigned char readUInt8();
36  short readInt16();
37  unsigned short readUInt16();
38  int readInt32();
39  unsigned readUInt32();
40  long long readInt64();
41  unsigned long long readUInt64();
42  float readSingle();
43  double readDouble();
44  std::string readString();
46 
47 protected:
49  int decodeStringSize();
50  unsigned char* myBuffer;
51  unsigned char* myReadHead;
52 };
53 
57 {
58 public:
60  DtStreamWriter(int length=0);
61 
63  virtual ~DtStreamWriter();
64 
66  //{@
67  unsigned char* buffer();
68  int length();
70 
73 
74  void writeBool(bool b);
75  void writeInt8(char num);
76  void writeUInt8(unsigned char num);
77  void writeInt16(short num);
78  void writeUInt16(unsigned short num);
79  void writeInt32(int num);
80  void writeUInt32(unsigned int num);
81  void writeInt64(long long num);
82  void writeUInt64(unsigned long long num);
83  void writeSingle(float num);
84  void writeDouble(double num);
85  void writeString(std::string& str);
87 
88 protected:
90  void encodeStringSize(int size);
91  unsigned char* myBuffer;
92  unsigned char* myWriteHead;
93  int myLength;
94 };

Document ID: Generated on Fri May 15 06:36:13 EDT 2015 from SVN revision 153263
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)