3065 some functions in the tcp module can be static
[unleashed.git] / usr / src / cmd / man / src / util / nsgmls.src / include / Options.h
blobc5bd5cb97487393111b380d4bd11fe6e89edb246
1 // Copyright (c) 1996 James Clark
2 // See the file COPYING for copying permission.
3 #pragma ident "%Z%%M% %I% %E% SMI"
5 #ifndef Options_INCLUDED
6 #define Options_INCLUDED 1
8 #include "Boolean.h"
10 #ifdef SP_NAMESPACE
11 namespace SP_NAMESPACE {
12 #endif
14 // This is a mildly C++ified version of getopt().
15 // It never prints any message.
17 template<class T>
18 class Options {
19 public:
20 Options(int argc, T *const *, const T *);
21 // Returns false if there are no more options.
22 bool get(T &);
23 T *arg() const { return arg_; } // optarg
24 T opt() const { return opt_; } // optopt
25 int ind() const { return ind_; } // optind
26 private:
27 const T *search(T) const;
28 const T *opts_;
29 T *const *argv_;
30 int argc_;
31 int ind_;
32 T opt_;
33 T *arg_;
34 int sp_;
37 #ifdef SP_NAMESPACE
39 #endif
41 #endif /* not Options_INCLUDED */
43 #ifdef SP_DEFINE_TEMPLATES
44 #include "Options.cxx"
45 #endif