wasCSharpSQLite – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /*
2 * EofCmd.java --
3 *
4 * Copyright (c) 1997 Sun Microsystems, Inc.
5 *
6 * See the file "license.terms" for information on usage and
7 * redistribution of this file, and for a DISCLAIMER OF ALL
8 * WARRANTIES.
9 *
10 * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart
11 *
12 * RCS @(#) $Id: EofCmd.java,v 1.1.1.1 1998/10/14 21:09:18 cvsadmin Exp $
13 *
14 */
15 using System;
16 namespace tcl.lang
17 {
18  
19 /// <summary> This class implements the built-in "eof" command in Tcl.</summary>
20  
21 class EofCmd : Command
22 {
23 /// <summary> This procedure is invoked to process the "eof" Tcl command.
24 /// See the user documentation for details on what it does.
25 ///
26 /// </summary>
27 /// <param name="interp">the current interpreter.
28 /// </param>
29 /// <param name="argv">command arguments.
30 /// </param>
31  
32 public TCL.CompletionCode cmdProc( Interp interp, TclObject[] argv )
33 {
34  
35 Channel chan; /* The channel being operated on this method */
36  
37 if ( argv.Length != 2 )
38 {
39 throw new TclNumArgsException( interp, 1, argv, "channelId" );
40 }
41  
42  
43 chan = TclIO.getChannel( interp, argv[1].ToString() );
44 if ( chan == null )
45 {
46  
47 throw new TclException( interp, "can not find channel named \"" + argv[1].ToString() + "\"" );
48 }
49  
50 if ( chan.eof() )
51 {
52 interp.setResult( TclInteger.newInstance( 1 ) );
53 }
54 else
55 {
56 interp.setResult( TclInteger.newInstance( 0 ) );
57 }
58 return TCL.CompletionCode.RETURN;
59 }
60 }
61 }