Definition in file BinaryInputDevice.cpp.
#include <config.h>
#include <string>
#include "BinaryInputDevice.h"
Go to the source code of this file.
Defines | |
| #define | BUF_MAX 1000 |
Functions | |
| BinaryInputDevice & | operator>> (BinaryInputDevice &os, long &l) throw () |
| BinaryInputDevice & | operator>> (BinaryInputDevice &os, std::string &s) throw () |
| BinaryInputDevice & | operator>> (BinaryInputDevice &os, bool &b) throw () |
| BinaryInputDevice & | operator>> (BinaryInputDevice &os, SUMOReal &f) throw () |
| BinaryInputDevice & | operator>> (BinaryInputDevice &os, unsigned int &i) throw () |
| BinaryInputDevice & | operator>> (BinaryInputDevice &os, int &i) throw () |
| #define BUF_MAX 1000 |
| BinaryInputDevice& operator>> | ( | BinaryInputDevice & | os, | |
| long & | l | |||
| ) | throw () |
| [in,out] | os | The BinaryInputDevice to read the long from |
| [in] | i | The int to store the read value into |
Definition at line 103 of file BinaryInputDevice.cpp.
References BinaryInputDevice::myStream.
00103 { 00104 os.myStream.read((char*) &l, sizeof(long)); 00105 return os; 00106 }
| BinaryInputDevice& operator>> | ( | BinaryInputDevice & | os, | |
| std::string & | s | |||
| ) | throw () |
Reads the length of the string as an unsigned int, first. Reads then the specified number of chars into "myBuffer". Please note that the buffer has a fixed size - longer strings will cause an error.
| [in,out] | os | The BinaryInputDevice to read the string from |
| [in] | i | The string to store the read value into |
Definition at line 89 of file BinaryInputDevice.cpp.
00089 { 00090 unsigned int size; 00091 os >> size; 00092 if (size<BUF_MAX) { 00093 os.myStream.read((char*) &os.myBuffer, sizeof(char)*size); 00094 os.myBuffer[size] = 0; 00095 s = std::string(os.myBuffer); 00096 return os; 00097 } 00098 return os; 00099 }
| BinaryInputDevice& operator>> | ( | BinaryInputDevice & | os, | |
| bool & | b | |||
| ) | throw () |
| [in,out] | os | The BinaryInputDevice to read the bool from |
| [in] | i | The bool to store the read value into |
Definition at line 81 of file BinaryInputDevice.cpp.
References BinaryInputDevice::myStream.
00081 { 00082 b = 0; 00083 os.myStream.read((char*) &b, sizeof(char)); 00084 return os; 00085 }
| BinaryInputDevice& operator>> | ( | BinaryInputDevice & | os, | |
| SUMOReal & | f | |||
| ) | throw () |
| [in,out] | os | The BinaryInputDevice to read the SUMOReal from |
| [in] | i | The SUMOReal to store the read value into |
Definition at line 74 of file BinaryInputDevice.cpp.
References BinaryInputDevice::myStream, and SUMOReal.
| BinaryInputDevice& operator>> | ( | BinaryInputDevice & | os, | |
| unsigned int & | i | |||
| ) | throw () |
| [in,out] | os | The BinaryInputDevice to read the unsigned int from |
| [in] | i | The unsigned int to store the read value into |
Definition at line 67 of file BinaryInputDevice.cpp.
References BinaryInputDevice::myStream.
00067 { 00068 os.myStream.read((char*) &i, sizeof(unsigned int)); 00069 return os; 00070 }
| BinaryInputDevice& operator>> | ( | BinaryInputDevice & | os, | |
| int & | i | |||
| ) | throw () |
| [in,out] | os | The BinaryInputDevice to read the int from |
| [in] | i | The int to store the read value into |
Definition at line 60 of file BinaryInputDevice.cpp.
References BinaryInputDevice::myStream.
00060 { 00061 os.myStream.read((char*) &i, sizeof(int)); 00062 return os; 00063 }
1.5.6