Writes to the given file. Returns false in case of error.
| 81 | |
| 82 | // Writes to the given file. Returns false in case of error. |
| 83 | bool WordFeature::Serialize(FILE* fp) const { |
| 84 | if (fwrite(&x_, sizeof(x_), 1, fp) != 1) return false; |
| 85 | if (fwrite(&y_, sizeof(y_), 1, fp) != 1) return false; |
| 86 | if (fwrite(&dir_, sizeof(dir_), 1, fp) != 1) return false; |
| 87 | return true; |
| 88 | } |
| 89 | // Reads from the given file. Returns false in case of error. |
| 90 | // If swap is true, assumes a big/little-endian swap is needed. |
| 91 | bool WordFeature::DeSerialize(bool swap, FILE* fp) { |
no test coverage detected