Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6341 in orxonox.OLD for trunk/src/lib/network/converter.h


Ignore:
Timestamp:
Dec 30, 2005, 1:57:12 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the network branche back to the trunk, so we do not get away from each other to fast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/network/converter.h

    r6139 r6341  
    33 *  Is able to convert int to byte-array and vice versa
    44 */
    5  
     5
    66#ifndef _CONVERTER
    77#define _CONVERTER
     
    1515/* The size of an int in byte */
    1616#define INTSIZE 4
     17/* The size of a float in byte */
     18#define FLOATSIZE 4
    1719
    1820/*!
     
    2325  public:
    2426    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
    3039    //Test
    3140    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);
    3347  private:
    3448    Converter();
Note: See TracChangeset for help on using the changeset viewer.