Reads a map of name of access entity to UUID for access entities of some type from a file.
| 103 | |
| 104 | /// Reads a map of name of access entity to UUID for access entities of some type from a file. |
| 105 | std::vector<std::pair<UUID, String>> readListFile(const String & file_path) |
| 106 | { |
| 107 | ReadBufferFromFile in(file_path); |
| 108 | |
| 109 | size_t num = 0; |
| 110 | readVarUInt(num, in); |
| 111 | std::vector<std::pair<UUID, String>> id_name_pairs; |
| 112 | id_name_pairs.reserve(num); |
| 113 | |
| 114 | for (size_t i = 0; i != num; ++i) |
| 115 | { |
| 116 | String name; |
| 117 | readStringBinary(name, in); |
| 118 | UUID id; |
| 119 | readUUIDText(id, in); |
| 120 | id_name_pairs.emplace_back(id, std::move(name)); |
| 121 | } |
| 122 | |
| 123 | return id_name_pairs; |
| 124 | } |
| 125 | |
| 126 | |
| 127 | /// Writes a map of name of access entity to UUID for access entities of some type to a file. |
no test coverage detected