# Copyright 2005-2007 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ pragma.syntax("0.9") # XXX support File as lazy-value #def File := /** Return a read-only facet on a standard file-protocol object. */ def makeReadOnlyFile implements ExitViaHere { # implements DeepFrozen (fails because DeepFrozen uses this!) to run(rwFile, beShallow) { def readOnlyFile { # implements File # XXX all appropriate methods to deepReadOnly() { return readOnlyFile } # :File to shallowReadOnly() { return readOnlyFile } # :File to exists() :boolean { return rwFile.exists() } to getText() :String { return rwFile.getText() } to getTwine() :Twine { return rwFile.getTwine() } to getName() :String { return rwFile.getName() } to getPath() :String { return rwFile.getPath() } to getPlatformPath() :String { return rwFile.getPlatformPath() } } return readOnlyFile } }