1 | svoid setOneLineFileInfoField(File f, S field, O value) { |
2 | File infoFile = associatedInfosFile(f); |
3 | LS lines = lines(loadTextFile(infoFile)); |
4 | S newLine = value == null ? null : field + ": " + str(value); |
5 | S line = firstStartingWithIC(lines, field + ": "); |
6 | if (eq(line, newLine)) ret; |
7 | saveTextFile(infoFile, lines(replaceAddOrRemove(lines, line, newLine))); |
8 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1018723 |
Snippet name: | setOneLineFileInfoField - removes line if value == null |
Eternal ID of this version: | #1018723/7 |
Text MD5: | b107a2956209ab805cea94b5bcbdc695 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-27 12:59:27 |
Source code size: | 374 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 354 / 412 |
Version history: | 6 change(s) |
Referenced in: | [show references] |