| 294 | } |
| 295 | |
| 296 | void EntryList_Save(struct StringsBuffer* list, const char* file) { |
| 297 | cc_string path, entry; char pathBuffer[FILENAME_SIZE]; |
| 298 | struct Stream stream; |
| 299 | cc_filepath raw_path; |
| 300 | cc_result res; |
| 301 | int i; |
| 302 | |
| 303 | String_InitArray(path, pathBuffer); |
| 304 | String_AppendConst(&path, file); |
| 305 | |
| 306 | Platform_EncodePath(&raw_path, &path); |
| 307 | res = Stream_CreatePath(&stream, &raw_path); |
| 308 | if (res) { Logger_IOWarn2(res, "creating", &raw_path); return; } |
| 309 | |
| 310 | for (i = 0; i < list->count; i++) { |
| 311 | StringsBuffer_UNSAFE_GetRaw(list, i, &entry); |
| 312 | res = Stream_WriteLine(&stream, &entry); |
| 313 | if (res) { Logger_IOWarn2(res, "writing to", &raw_path); break; } |
| 314 | } |
| 315 | |
| 316 | res = stream.Close(&stream); |
| 317 | if (res) { Logger_IOWarn2(res, "closing", &raw_path); } |
| 318 | } |
| 319 | |
| 320 | cc_bool EntryList_Remove(struct StringsBuffer* list, const cc_string* key, char separator) { |
| 321 | cc_bool found = false; |
no test coverage detected