equal
deleted
inserted
replaced
31 |
31 |
32 #if DEBUG |
32 #if DEBUG |
33 #include <iostream> |
33 #include <iostream> |
34 #endif |
34 #endif |
35 |
35 |
|
36 #include <string.h> |
36 #include <iomanip> |
37 #include <iomanip> |
37 #include <sstream> |
38 #include <sstream> |
38 using namespace std; |
39 using namespace std; |
39 |
40 |
40 #include "DataTypeHandler.h" |
41 #include "DataTypeHandler.h" |
104 ) |
105 ) |
105 { |
106 { |
106 stringstream str; |
107 stringstream str; |
107 size_t dataSize = type->byteSize; |
108 size_t dataSize = type->byteSize; |
108 |
109 |
|
110 memset(target, 0, targetSize); |
|
111 |
109 #if DEBUG |
112 #if DEBUG |
110 cerr << __func__ << "(targetSize=" << targetSize << ")" << endl; |
113 cerr << __func__ << "(targetSize=" << targetSize << ")" << endl; |
111 #endif |
114 #endif |
112 |
115 |
113 str << source; |
116 str << source; |
190 stringstream err; |
193 stringstream err; |
191 err << "String too large (" |
194 err << "String too large (" |
192 << dataSize << " > " << targetSize << ")"; |
195 << dataSize << " > " << targetSize << ")"; |
193 throw SizeException(err.str()); |
196 throw SizeException(err.str()); |
194 } |
197 } |
195 str >> (char *) target; |
198 str.read((char *) target, dataSize); |
196 break; |
199 break; |
197 case 0x0011: // double |
200 case 0x0011: // double |
198 { |
201 { |
199 double val; |
202 double val; |
200 str >> val; |
203 str >> val; |