| 343 | } |
| 344 | |
| 345 | bool GetUInt32(uint32_t* value) { |
| 346 | if (type_ != kUInt32) { |
| 347 | return false; |
| 348 | } |
| 349 | if (fsize_ == 0) { |
| 350 | return true; |
| 351 | } |
| 352 | if (offset_ + 4 > bsize_) { |
| 353 | return false; |
| 354 | } |
| 355 | memcpy(static_cast<void*>(value), buffer_, 4); |
| 356 | memrev32ifbe(static_cast<void*>(value)); |
| 357 | buffer_ += 4; |
| 358 | offset_ += 4; |
| 359 | return true; |
| 360 | } |
| 361 | |
| 362 | bool GetInt32(int32_t* value) { |
| 363 | if (type_ != kInt32) { |