Changeset 6341 in orxonox.OLD for trunk/src/lib/network/converter.h
- Timestamp:
- Dec 30, 2005, 1:57:12 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/network/converter.h
r6139 r6341 3 3 * Is able to convert int to byte-array and vice versa 4 4 */ 5 5 6 6 #ifndef _CONVERTER 7 7 #define _CONVERTER … … 15 15 /* The size of an int in byte */ 16 16 #define INTSIZE 4 17 /* The size of a float in byte */ 18 #define FLOATSIZE 4 17 19 18 20 /*! … … 23 25 public: 24 26 static byte* intToByteArray(int x); 25 static int byteArrayToInt(byte* a); 26 27 //byte* floatToByteArray(float x); 28 //float byteArrayToFloat(byte[] a); 29 27 static int byteArrayToInt(const byte* a); 28 29 static int intToByteArray(int x, byte* a, int length); 30 static int byteArrayToInt(const byte* a, int* x); 31 32 static int floatToByteArray(float x, byte* a, int length); 33 static int byteArrayToFloat(const byte* a, float* x); 34 35 static int stringToByteArray(const char* s, byte* a, int length, int maxLength); 36 static int byteArrayToString(const byte* a, char* s, int maxLength); 37 static int byteArrayToStringM(const byte* a, char*& s ); 38 30 39 //Test 31 40 static char* floatToBinString(float x); 32 41 42 static byte* floatToByteArray(float x); 43 static float byteArrayToFloat(byte* a); 44 45 static byte* _floatToByteArray(float x); 46 static float _byteArrayToFloat(byte* a); 33 47 private: 34 48 Converter();
Note: See TracChangeset
for help on using the changeset viewer.