NEURON
file.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1991 Stanford University
3  * Copyright (c) 1991 Silicon Graphics, Inc.
4  *
5  * Permission to use, copy, modify, distribute, and sell this software and
6  * its documentation for any purpose is hereby granted without fee, provided
7  * that (i) the above copyright notices and this permission notice appear in
8  * all copies of the software and related documentation, and (ii) the names of
9  * Stanford and Silicon Graphics may not be used in any advertising or
10  * publicity relating to the software without the specific, prior written
11  * permission of Stanford and Silicon Graphics.
12  *
13  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * IN NO EVENT SHALL STANFORD OR SILICON GRAPHICS BE LIABLE FOR
18  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
19  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
21  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22  * OF THIS SOFTWARE.
23  */
24 
25 #ifndef os_file_h
26 #define os_file_h
27 
28 #include <OS/enter-scope.h>
29 
30 #undef _GLIBCXX_ATOMIC_BUILTINS
31 #undef _GLIBCXX_USE_INT128
32 
33 class FileInfo;
34 class String;
35 
36 class File {
37 protected:
38  File(FileInfo*);
39 public:
40  virtual ~File();
41 
42  virtual const String* name() const;
43  virtual long length() const;
44  virtual void close();
45 
46  virtual void limit(unsigned int buffersize);
47 protected:
48  FileInfo* rep() const;
49 private:
51 private:
52  /* not allowed */
53  void operator =(const File&);
54 };
55 
56 class InputFile : public File {
57 protected:
59 public:
60  virtual ~InputFile();
61 
62  static InputFile* open(const String& name);
63 
64  virtual int read(const char*& start);
65 };
66 
67 class StdInput : public InputFile {
68 public:
69  StdInput();
70  virtual ~StdInput();
71 
72  virtual long length() const;
73  virtual int read(const char*& start);
74 };
75 
76 #endif
Definition: file.h:36
virtual void limit(unsigned int buffersize)
Definition: file.cpp:200
FileInfo * rep() const
Definition: file.cpp:206
Definition: file.h:56
#define StdInput
Definition: _defines.h:15
void start()
Definition: hel2mos.cpp:205
virtual ~File()
Definition: file.cpp:154
virtual long length() const
Definition: file.cpp:170
File(FileInfo *)
Definition: file.cpp:149
int read(int, void *, unsigned int)
FileInfo * rep_
Definition: file.h:50
virtual const String * name() const
Definition: file.cpp:162
Definition: file.h:67
void operator=(const File &)
Definition: string.h:34
#define InputFile
Definition: _defines.h:8
virtual void close()
Definition: file.cpp:178