Last change
on this file since 6247 was
6139,
checked in by patrick, 19 years ago
|
trunk: merged branche network with trunk using command: svn merge -r5999:HEAD, conflicts resolved in favor of the trunk bla
|
File size:
777 bytes
|
Line | |
---|
1 | /*! |
---|
2 | * @file converter.h |
---|
3 | * Is able to convert int to byte-array and vice versa |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _CONVERTER |
---|
7 | #define _CONVERTER |
---|
8 | |
---|
9 | /* include this file, it contains some default definitions */ |
---|
10 | #include "netdefs.h" |
---|
11 | |
---|
12 | /* include base_object.h since all classes are derived from this one */ |
---|
13 | #include "base_object.h" |
---|
14 | |
---|
15 | /* The size of an int in byte */ |
---|
16 | #define INTSIZE 4 |
---|
17 | |
---|
18 | /*! |
---|
19 | * a class that can convert int to byte-array and vice versa |
---|
20 | */ |
---|
21 | class Converter: public BaseObject |
---|
22 | { |
---|
23 | public: |
---|
24 | static byte* intToByteArray(int x); |
---|
25 | static int byteArrayToInt(byte* a); |
---|
26 | |
---|
27 | //byte* floatToByteArray(float x); |
---|
28 | //float byteArrayToFloat(byte[] a); |
---|
29 | |
---|
30 | //Test |
---|
31 | static char* floatToBinString(float x); |
---|
32 | |
---|
33 | private: |
---|
34 | Converter(); |
---|
35 | ~Converter(); |
---|
36 | }; |
---|
37 | |
---|
38 | #endif /*_CONVERTER*/ |
---|
Note: See
TracBrowser
for help on using the repository browser.