Sync usage with man page.
[netbsd-mini2440.git] / gnu / lib / libg++ / g++-include / PlotFile.h
blob1a6939641eb80560a27f3f13d66bb122c8ba0706
1 // This may look like C code, but it is really -*- C++ -*-
2 /*
3 Copyright (C) 1988 Free Software Foundation
4 written by Doug Lea (dl@rocky.oswego.edu)
6 This file is part of GNU CC.
8 GNU CC is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY. No author or distributor
10 accepts responsibility to anyone for the consequences of using it
11 or for whether it serves any particular purpose or works at all,
12 unless he says so in writing. Refer to the GNU CC General Public
13 License for full details.
15 Everyone is granted permission to copy, modify and redistribute
16 GNU CC, but only under the conditions described in the
17 GNU CC General Public License. A copy of this license is
18 supposed to have been given to you along with GNU CC so you
19 can know your rights and responsibilities. It should be in a
20 file named COPYING. Among other things, the copyright notice
21 and this notice must be preserved on all copies.
24 /*
25 a very simple implementation of a class to output unix "plot"
26 format plotter files. See corresponding unix man pages for
27 more details.
30 #ifndef _PlotFile_h
31 #ifdef __GNUG__
32 #pragma once
33 #pragma interface
34 #endif
35 #define _PlotFile_h
37 #include <File.h>
39 /*
40 Some plot libraries have the `box' command to draw boxes. Some don't.
41 `box' is included here via moves & lines to allow both possiblilties.
45 class PlotFile : private File
47 protected:
48 PlotFile& cmd(char c);
49 PlotFile& operator << (const int x);
50 PlotFile& operator << (const char *s);
52 public:
54 PlotFile();
55 PlotFile(const char* filename, io_mode m, access_mode a);
56 PlotFile(const char* filename, const char* m);
57 PlotFile(int filedesc, const io_mode m = io_writeonly);
58 PlotFile(FILE* fileptr);
60 ~PlotFile();
62 operator void*();
64 PlotFile& close() { File::close(); return *this; }
65 PlotFile& remove() { File::remove(); return *this; }
67 int filedesc() { return File::filedesc(); }
68 const char* name() { return File::name(); }
69 void setname(const char* newname) { File::setname(newname); }
70 int iocount() { return File::iocount(); }
72 int rdstate() { return File::rdstate(); }
73 int eof() { return File::eof(); }
74 int fail() { return File::fail(); }
75 int bad() { return File::bad(); }
76 int good() { return File::good(); }
78 // other status queries
80 int readable() { return File::readable(); }
81 int writable() { return File::writable(); }
82 int is_open() { return File::is_open(); }
84 void error() { File::error(); }
85 void clear(state_value f = _good) { File::clear(f); }
86 void set(state_value f) { File::set(f); }
87 void unset(state_value f) { File::unset(f); }
88 PlotFile& failif(int cond) { File::failif(cond); return *this; }
89 void check_state() { File::check_state(); }
91 PlotFile& raw() { File::raw(); return *this; }
93 PlotFile& open(const char* filename, io_mode m, access_mode a);
94 PlotFile& open(const char* filename, const char* m);
95 PlotFile& open(int filedesc, io_mode m);
96 PlotFile& open(FILE* fileptr);
97 PlotFile& setbuf(const int buffer_kind); // vals: _IONBF, _IOFBF, _IOLBF
98 PlotFile& setbuf(const int size, char* buf);
100 PlotFile& arc(const int xi, const int yi,
101 const int x0, const int y0,
102 const int x1, const int y1);
103 PlotFile& box(const int x0, const int y0,
104 const int x1, const int y1);
105 PlotFile& circle(const int x, const int y, const int r);
106 PlotFile& cont(const int xi, const int yi);
107 PlotFile& dot(const int xi, const int yi, const int dx,
108 int n, const int* pat);
109 PlotFile& erase();
110 PlotFile& label(const char* s);
111 PlotFile& line(const int x0, const int y0,
112 const int x1, const int y1);
113 PlotFile& linemod(const char* s);
114 PlotFile& move(const int xi, const int yi);
115 PlotFile& point(const int xi, const int yi);
116 PlotFile& space(const int x0, const int y0,
117 const int x1, const int y1);
121 #endif