01: /*
02: * TesttranslatefilenameCmd.java --
03: *
04: * This file contains the Jacl implementation of the built-in Tcl test
05: * commands: testtranslatefilename.
06: *
07: * Copyright (c) 1997 Sun Microsystems, Inc.
08: *
09: * See the file "license.terms" for information on usage and
10: * redistribution of this file, and for a DISCLAIMER OF ALL
11: * WARRANTIES.
12: *
13: * RCS: @(#) $Id: TesttranslatefilenameCmd.java,v 1.1 1999/05/10 04:08:52 dejong Exp $
14: *
15: */
16:
17: package tcl.lang;
18:
19: /*
20: * This class implements the built-in test command: testtranslatefilename.
21: * It is used to test the FileUtil.translateFileName method.
22: */
23:
24: class TesttranslatefilenameCmd implements Command {
25:
26: /*
27: *----------------------------------------------------------------------
28: *
29: * CmdProc --
30: *
31: * This procedure is invoked to process the "testtranslatefilename"
32: * Tcl command. This command is only used in the test suite.
33: *
34: * Results:
35: * None.
36: *
37: * Side effects:
38: * None.
39: *
40: *----------------------------------------------------------------------
41: */
42:
43: public void cmdProc(Interp interp, // Current interp to eval the file cmd.
44: TclObject argv[]) throws TclException {
45: if (argv.length != 2) {
46: throw new TclNumArgsException(interp, 1, argv, "path");
47: }
48:
49: String result = FileUtil.translateFileName(interp, argv[1]
50: .toString());
51: interp.setResult(result);
52: return;
53: }
54:
55: } // end class TesttranslatefilenameCmd
|