| 121 | } |
| 122 | |
| 123 | bool BuildOffsetsTable(string const & filePath) |
| 124 | { |
| 125 | try |
| 126 | { |
| 127 | string const destPath = filePath + TMP_OFFSETS_EXT; |
| 128 | SCOPE_GUARD(fileDeleter, bind(FileWriter::DeleteFileX, destPath)); |
| 129 | |
| 130 | { |
| 131 | FilesContainerR cont(filePath); |
| 132 | feature::FeaturesOffsetsTable::Build(cont, destPath); |
| 133 | } |
| 134 | |
| 135 | FilesContainerW(filePath, FileWriter::OP_WRITE_EXISTING).Write(destPath, FEATURE_OFFSETS_FILE_TAG); |
| 136 | return true; |
| 137 | } |
| 138 | catch (RootException const & ex) |
| 139 | { |
| 140 | LOG(LERROR, ("Generating offsets table failed for", filePath, "reason", ex.Msg())); |
| 141 | return false; |
| 142 | } |
| 143 | } |
| 144 | } // namespace feature |