commline.h

来自「自编的一个String类」· C头文件 代码 · 共 31 行

H
31
字号
//file commline.h#include "str.h"// class for decoding command line parameters// if first string begins with - or / assume it is options// assume all options form a single stringclass CommandLine{   int the_argc;   char** the_argv;   bool options;                // true if first arg begins with - or /   int n_args;                  // number of argumentspublic:   CommandLine(int an_argc, char** an_argv);   int argc() { return the_argc; }   char** argv() { return the_argv; }   String GetArg(int i);        // get i-th arg (1 = first arg after options)   String GetOptions();   int NumberOfArgs() { return n_args; }  // no. of args excl .exe and options   bool Options() { return options; }                                // true if there are options   bool HasOption(const String& s);                                // true if options has any char in s};// body file: commline.cpp

⌨️ 快捷键说明

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