⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getlongopt.3

📁 大型并行量子化学软件;支持密度泛函(DFT)。可以进行各种量子化学计算。支持CHARMM并行计算。非常具有应用价值。
💻 3
字号:
.\" @(#)GetLongOpt.3 2.0 12/01/1993.TH GETLONGOPT 3 "12 January 1993" "" "C++ LIBRARY CLASSES".UC 4.SH NAMEGetLongOpt - C++ class for parsing command line and strings for options.SH SYNOPSIS.nf.ft B.ss 18#include <GetLongOpt.h>GetLongOpt::GetLongOpt(const char optmark = '-');int GetLongOpt::parse(int argc, char * const *argv);int GetLongOpt::parse(char * const str, char * const p);int GetLongOpt::enroll(const char * const opt, const OptType t,   const char * const desc, const char * const val);const char * GetLongOpt::retrieve(const char * const opt) const;void GetLongOpt::usage(ostream &outfile = cout) const;void GetLongOpt::usage(const char *str);.ft.fi.ss.SH DESCRIPTIONGetLongOpt is a C++ class for getting options from the command lineand from strings. GetLongOpt supports long options. These optionsmay be flags or require optional or mandatory values.If an option requires a value, then the value should be separatedfrom the option either by whitespace or by a "=". Long optionscan be abbreviated. GetLongOpt can also be used to parse options given through environments.The constructor for GetLongOpt takes an optional argument: the optionmarker. If unspecified, this defaults to '-', the standard (?)Unix option marker. For example, a DOS addict may want to specify '/' for the option marker!.I GetLongOpt::enrolladds option specifications to its internaldatabase. The first argument is the option sting. The secondis an enum saying if the option is a flag (GetLongOpt::NoValue),if it requires a mandatory value (GetLongOpt::MandatoryValue) orif it takes an optional value (GetLongOpt::OptionalValue).The third argument is a string giving a brief description ofthe option. This description will be used by .I GetLongOpt::usage.GetLongOpt, for usage-printing, uses $val to represent valuesneeded by the options. <$val> is a mandatory value and [$val]is an optional value. The final argument to .I GetLongOpt::enrollis the default string to be returned if the option is notspecified. For flags (options with NoValue), use "" (emptystring, or in fact any arbitrary string) for specifying TRUEand 0 (null pointer) to specify FALSE..I GetLongOpt::usageis overloaded. If passed a string .I s,it sets theinternal usage string to .I s.Otherwise it simply prints thecommand usage. The options and theirdescriptions (as specified during enroll) are printed in theorder they are enrolled..I GetLongOpt::parseis also overloaded. It can either parse a string ofoptions (typically given from the environment), or it can parsethe command line args (argc, argv). In either case a returnvalue < 1 represents a parse error. Appropriate error messagesare printed when errors are seen. GetLongOpt::parse, in its firstform, takes two strings: the first one is the string to beparsed and the second one is a string to be prefixed to theparse errors. In its second form, .I GetLongOpt::parsetakes in argc and argv and returns thethe optind (see getopt(3)) if parsing is successful.Successful parsing, in either form of.I GetLongOpt::parse,updates the values of the options within the internal database.The values of the options that are enrolled in the databasecan be retrieved using .I GetLongOpt::retrieve.This returns a stringand this string should be converted to whatever type you want.See atoi(3), atof(3), atol(3) etc. I suppose you would do a .I GetLongOpt::parsebeforeretrieving. Otherwise all you would get are the default valuesyou gave while enrolling!Ambiguities while retrieving (may happen when options areabbreviated) are resolved by taking the matching option thatwas enrolled last.If you try to retrieve something you did not enroll, you willget a warning message. This means that you probably had madea typo somewhere while enrolling or retrieving..SH BUGSThey should be there well-hidden. If you spot one report it..SH "SEE ALSO"getopt(3),getopts(1),atoi(3), atof(3), atol(3)..SH AUTHOR.nfS ManoharanAdvanced Computer Research Institute1 Boulevard Marius Vivier-Merle69443 Lyon Cedex 03 Francemano@acri.fr.fi.\" end of man page

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -