Appends lines containing \"set variable value\" for all variables with the archive flag set true.
(String path)
| 381 | */ |
| 382 | |
| 383 | public void writeArchiveVariables(String path) { |
| 384 | RandomAccessFile f; |
| 385 | String buffer; |
| 386 | |
| 387 | f = Lib.fopen(path, "rw"); |
| 388 | if (f == null) |
| 389 | return; |
| 390 | |
| 391 | try { |
| 392 | f.seek(f.length()); |
| 393 | } catch (IOException e1) { |
| 394 | Lib.fclose(f); |
| 395 | return; |
| 396 | } |
| 397 | for (cvar_t var : cvarMap.values()) { |
| 398 | if ((var.flags & CVAR_ARCHIVE) != 0) { |
| 399 | buffer = "set " + var.name + " \"" + var.string + "\"\n"; |
| 400 | try { |
| 401 | f.writeBytes(buffer); |
| 402 | } catch (IOException e) { |
| 403 | Com.Printf("Could not write cvar " + var + " to " + path); |
| 404 | } |
| 405 | } |
| 406 | } |
| 407 | Lib.fclose(f); |
| 408 | } |
| 409 | |
| 410 | /** |
| 411 | * Variable typing auto completition. |
no test coverage detected