1424
|
1 /* |
|
2 |
1884
|
3 Copyright (C) 1996 John W. Eaton |
1424
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
2610
|
23 // Originally written by John C. Campbell <jcc@bevo.che.wisc.edu> |
1424
|
24 |
2610
|
25 // Completely rewritten by John W. Eaton <jwe@bevo.che.wisc.edu>, |
|
26 // April 1996. |
1424
|
27 |
|
28 #ifdef HAVE_CONFIG_H |
|
29 #include <config.h> |
|
30 #endif |
|
31 |
|
32 #include <cstdio> |
|
33 |
|
34 #include "file-info.h" |
|
35 |
|
36 file_info::file_info (void) |
|
37 { |
|
38 file_number = -1; |
|
39 file_fptr = 0; |
|
40 } |
|
41 |
1755
|
42 file_info::file_info (int n, const string& nm, FILE *t, const string& md) |
1424
|
43 { |
|
44 file_number = n; |
|
45 file_name = nm; |
|
46 file_fptr = t; |
|
47 file_mode = md; |
|
48 } |
|
49 |
|
50 file_info::file_info (const file_info& f) |
|
51 { |
|
52 file_number = f.file_number; |
|
53 file_name = f.file_name; |
|
54 file_fptr = f.file_fptr; |
|
55 file_mode = f.file_mode; |
|
56 } |
|
57 |
|
58 file_info& |
|
59 file_info::operator = (const file_info& f) |
|
60 { |
|
61 if (this != & f) |
|
62 { |
|
63 file_number = f.file_number; |
|
64 file_name = f.file_name; |
|
65 file_fptr = f.file_fptr; |
|
66 file_mode = f.file_mode; |
|
67 } |
|
68 return *this; |
|
69 } |
|
70 |
|
71 file_info::~file_info (void) |
|
72 { |
|
73 } |
|
74 |
|
75 int |
|
76 file_info::number (void) const |
|
77 { |
|
78 return file_number; |
|
79 } |
|
80 |
|
81 string |
|
82 file_info::name (void) const |
|
83 { |
|
84 return file_name; |
|
85 } |
|
86 |
|
87 FILE * |
|
88 file_info::fptr (void) const |
|
89 { |
|
90 return file_fptr; |
|
91 } |
|
92 |
|
93 string |
|
94 file_info::mode (void) const |
|
95 { |
|
96 return file_mode; |
|
97 } |
|
98 |
|
99 /* |
|
100 ;;; Local Variables: *** |
|
101 ;;; mode: C++ *** |
|
102 ;;; End: *** |
|
103 */ |