ZMObject
└─ZMFilePatcher
public class ZMFilePatcher
extends ZMObject
| Fields inherited from org.zenmagick.core.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
ZMFilePatcher(string filename, array patch, string target) Create new patcher. |
|
| Method Summary | |
|---|---|
| protected array | applyPatch(array lines) Apply the patch to the given lines. |
| protected array | getLines() Get the file content as single lines. |
| boolean | isOpen() Checks if this patch can still be applied. |
| boolean | patch() Do patch. |
| protected boolean | putLines(array lines) Write the given lines. |
| protected array | revertPatch(array lines) Revert the patch to the given lines. |
| boolean | undo() Undo. |
| Methods inherited from org.zenmagick.core.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public ZMFilePatcher(string filename, array patch, string target)
Create new patcher.
null to update filename.protected array applyPatch(array lines)
Apply the patch to the given lines.
null if unchanged.protected array getLines()
Get the file content as single lines.
public boolean isOpen()
Checks if this patch can still be applied.
true if this patch can still be applied.public boolean patch()
Do patch.
true if patching was successful (or skipped), false if not.protected boolean putLines(array lines)
Write the given lines.
true if successful, false if not.protected array revertPatch(array lines)
Revert the patch to the given lines.
null if unchanged.public boolean undo()
Undo.
true if the undo was successful (or skipped), false if not.
Handle patches for a single file.