| 176 | // in place of: |
| 177 | // string s = EncodeUint32(static_cast<uint32>(i)); |
| 178 | template <typename T> inline string EncodePOD(const T& value) { |
| 179 | ENFORCE_POD(T); |
| 180 | string s; |
| 181 | STLStringResizeUninitialized(&s, sizeof(T)); |
| 182 | memcpy(string_as_array(&s), &value, sizeof(T)); |
| 183 | return s; |
| 184 | } |
| 185 | |
| 186 | // Retrieves the bytes of a plain old data type value from a StringPiece. |
| 187 | // Verifies the given data type is a POD and copies the bytes of the |
no test coverage detected