MCPcopy Create free account
hub / github.com/demoth/jake2 / writeArchiveVariables

Method writeArchiveVariables

qcommon/src/main/java/jake2/qcommon/exec/Cvar.java:383–408  ·  view source on GitHub ↗

Appends lines containing \"set variable value\" for all variables with the archive flag set true.

(String path)

Source from the content-addressed store, hash-verified

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.

Callers 1

WriteConfigurationMethod · 0.80

Calls 4

fopenMethod · 0.95
fcloseMethod · 0.95
PrintfMethod · 0.95
writeBytesMethod · 0.80

Tested by

no test coverage detected