亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? getopts.cpp

?? 利用C
?? CPP
字號(hào):
/* getopts.c -  * * Whom: Steve Mertz <steve@dragon-ware.com> * Date: 20010610 * Why: A exercise in converting my C based getopts() into an OO solution. **//* * Copyright (c) 2001-2004 Steve Mertz <steve@dragon-ware.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without  * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this  * list of conditions and the following disclaimer. *  * Redistributions in binary form must reproduce the above copyright notice,  * this list of conditions and the following disclaimer in the documentation  * and/or other materials provided with the distribution. *  * Neither the name of Dragon Ware Computer Services nor the names of its  * contributors may be used to endorse or promote products derived from  * this software without specific prior written permission.  *  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  **/#include <iostream>#include <string>#include <map>#include "getopts.h"/* Options::Options() * * Whom: Steve Mertz <steve@dragon-ware.com> * Date: 20010610 * Why:  Initialize lastNumberUsed to '-1' for use in our map. * * Returns: Nothing*/Options::Options(){	lastNumberUsed = -1;}/* void Options::addOption(string shortName, string longName, string description, bool takeArg) *  * Whom: Steve Mertz <steve@dragon-ware.com> * Date: 20010609 * Why:  Adds an option to the option map * * Returns: Nothing*/void Options::addOption(std::string shortName, std::string longName, std::string description, bool takeArg){	struct option toBeAdded;	toBeAdded.shortName = shortName;	toBeAdded.longName = longName;	toBeAdded.description = description;	toBeAdded.takesArg = takeArg;  toBeAdded.isUsed = false;		/* Increment lastNumberUsed because the number of this new struct will become the new lastNumberUsed		 This works for the first item too since we initialize lastNumberUsed with -1 to start with.  */  lastNumberUsed++;	optionList[lastNumberUsed] = toBeAdded;}/* bool Options::parse(int argc, char **argv) * * Whom: Steve Mertz <steve@dragon-ware.com> * Date: 20010609 * Why:  Parses the command line arguments and puts the arguments of the options  *       into their struct.  Also sets the isUsed flag if we have parsed that option. * * Returns: true  - we have parsed something. *          false - we have not parsed anything.*/bool Options::parse(int argc, char **argv){	bool realOption, parsedData = false;                       // Set to true if we actually parse something useful.		/* First we must scan for the '-h' and '--help' options */	  for (int count = 1; count < argc; count++)		{			if (!strcmp(argv[count], "-h") || !strcmp(argv[count], "--help"))				showHelp(argv[0]);                       // We found out that the user wants help.  Go show and exit.		}	  	/* 		What we are doing here, is cycling through all the arguments that were passed in the program (argv)		and then we cycle through the list of options that we know about trying to match them up.  If we have		an unknown option or we have a option which requires an argument but there are none, then we 		showHelp() and exit.  Otherwise we add the argument to the list and set isUsed to true for later use 		in cycle().	*/	for (int argCount = 1; argCount < argc; argCount++)		{			realOption = false;			for (int listCount = 0; listCount <= lastNumberUsed; listCount++)				{					struct option tester = optionList[listCount];					if ((!tester.shortName.empty() && !strcmp(tester.shortName.c_str(), argv[argCount]+1)) ||						(!tester.longName.empty() && !strcmp(tester.longName.c_str(), argv[argCount]+2)))						{							realOption = true;							parsedData = true;							tester.isUsed = true;							if (tester.takesArg)								{									argCount++;									if ((argCount >= argc) || (*argv[argCount] == '-'))										showHelp(argv[0]);									tester.optionArgs = argv[argCount];								}							optionList[listCount] = tester;							break;                               // We have a match, no need to continue with the inner loop.						}				}							/* We just parsed an option we don't know what it is, so we will just showHelp() instead and exit. */			if (!realOption)				showHelp(argv[0]);		}			return parsedData;                             // Have we did we have any data to parse?}/* bool Options::beingUsed(int number) * * Whom: Steve Mertz <steve@dragon-ware.com> * Date: 20010610 * Why:  Returns whether or not 'number' of our map is being used. * * Returns: false - This item is not being used currently. *          true  - This item is being used currently.*/bool Options::beingUsed(int number){	return optionList[number].isUsed;}/* int Options::cycle() *  * Whom: Steve Mertz <steve@dragon-ware.com> * Date: 20010609 * Why:  Cycles through the list of options and returns the number of one that *       has it's isUsed flag set.  We go through the list backwards using lastNumberUsed *       as our start point. * * Returns: The number of an option that has it's isUsed flag set.*/int Options::cycle(){	while (lastNumberUsed >= 0)		{			if (beingUsed(lastNumberUsed))				{					lastNumberUsed--;					return lastNumberUsed+1;				}			lastNumberUsed--;		}  return lastNumberUsed;}/* string Options::getArgs(int number) * * Whom: Steve Mertz <steve@dragon-ware.com> * Date: 20010610 * Why:  Returns the arguments that this option was passed on the *       commandline. * * Returns: optionArgs*/std::string Options::getArgs(int number){	return optionList[number].optionArgs;}/* void Options::showHelp(char *progName) * * Whom: Steve Mertz <steve@dragon-ware.com> * Date: 20010610 * Why:  Displays the info for the options which are entered from addOption() * * Notes: This method really needs to be cleaned up probably to replace the *        tabs with something more meaningful later on. * * Returns: Nothing*/void Options::showHelp(char *progName){  std::string usageLine;	std::cout << "Usage: " << progName << " [options [args]]\n" << std::endl;  std::cout << "  --help,\t-h\t\t\tDisplays this information" << std::endl;  for (int counter = 0; counter <= lastNumberUsed; counter++)		{			if (!optionList[counter].shortName.empty() && !optionList[counter].longName.empty())				{					if (optionList[counter].takesArg)						usageLine = "--" + optionList[counter].longName + ",\t-" + 							optionList[counter].shortName + " <args>\t\t";					else						usageLine = "--" + optionList[counter].longName + ",\t-" + 							optionList[counter].shortName + "\t\t\t";				}			else if (!optionList[counter].longName.empty())				{					if (optionList[counter].takesArg)						usageLine = "--" + optionList[counter].longName + " <args>\t\t\t";					else						usageLine = "--" + optionList[counter].longName + "\t\t\t";				}			else if (!optionList[counter].shortName.empty())				{					if (optionList[counter].takesArg)						usageLine = "\t\t-" + optionList[counter].shortName + " <args>\t\t";					else						usageLine = "\t\t-" + optionList[counter].shortName + "\t\t\t";				}			std::cout << "  " << usageLine << optionList[counter].description << std::endl;		}  exit(0);}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品日日鲁夜夜添| 国产精品天干天干在观线| 成人丝袜视频网| 国产成人欧美日韩在线电影| 国内一区二区视频| 国产一区二区视频在线播放| 久草在线在线精品观看| 蜜臀久久99精品久久久久久9| 亚洲图片一区二区| 图片区小说区区亚洲影院| 亚洲无线码一区二区三区| 偷窥少妇高潮呻吟av久久免费| 一区二区欧美在线观看| 亚洲成人777| 日韩精品成人一区二区三区| 奇米亚洲午夜久久精品| 麻豆精品一区二区三区| 国产精品99久久久久久有的能看| 国产成人精品免费网站| 99vv1com这只有精品| 色香蕉成人二区免费| 欧美久久久一区| 久久一日本道色综合| 中文字幕一区二区在线观看| 一二三区精品福利视频| 欧美aaa在线| 国产精品一卡二卡在线观看| 99久久精品国产一区| 欧美三区免费完整视频在线观看| 这里只有精品电影| 欧美激情一区三区| 亚洲国产欧美在线| 国产美女娇喘av呻吟久久| 一本到三区不卡视频| 日韩片之四级片| 国产精品欧美久久久久一区二区| 亚洲综合色婷婷| 美国十次了思思久久精品导航| 国v精品久久久网| 欧美电影在线免费观看| 国产欧美日韩在线| 午夜精品久久久久久久| 成人激情午夜影院| 91麻豆精品国产无毒不卡在线观看| 国产日韩v精品一区二区| 一区二区三区中文在线观看| 久久精品国产免费| 色吧成人激情小说| 国产日韩亚洲欧美综合| 日韩激情av在线| 一本久久a久久免费精品不卡| 久久亚洲捆绑美女| 午夜精品一区二区三区免费视频| 国产suv一区二区三区88区| 884aa四虎影成人精品一区| 亚洲欧洲av另类| 国产美女娇喘av呻吟久久| 欧美一卡二卡三卡| 亚洲精品久久久蜜桃| 国产成人综合亚洲91猫咪| 日韩一区二区在线播放| 一区二区三区四区高清精品免费观看| 国产在线精品免费| 日韩丝袜美女视频| 日韩**一区毛片| 欧美在线高清视频| 亚洲三级电影网站| 成人精品免费看| 国产农村妇女毛片精品久久麻豆| 另类小说图片综合网| 欧美日韩不卡在线| 一区二区三区四区精品在线视频| 成人综合婷婷国产精品久久| 久久久久久久久久电影| 国产一区999| 国产午夜久久久久| 国产一区二区电影| 日本一区二区三区免费乱视频| 国产中文字幕一区| 欧美成人vps| 国产精品一区在线观看你懂的| 欧美videos大乳护士334| 婷婷久久综合九色综合伊人色| 一本一道久久a久久精品| 国产亚洲精品久| 高清国产一区二区| 国产精品国产自产拍高清av | 一区二区三区中文字幕电影| 91小视频在线| 一区2区3区在线看| 在线看不卡av| 日韩福利视频网| 精品91自产拍在线观看一区| 韩国v欧美v亚洲v日本v| 国产日产欧美一区二区三区| 波多野结衣的一区二区三区| 中文字幕一区av| 欧美色窝79yyyycom| 蜜臀久久99精品久久久久久9| 日韩欧美一二区| 国产精品亚洲一区二区三区在线 | 成人av网址在线| 亚洲美女屁股眼交3| 欧美一区二区三区婷婷月色 | 国产精品家庭影院| 欧美日韩国产三级| 韩国av一区二区三区| 亚洲丝袜精品丝袜在线| 欧美放荡的少妇| 成人激情午夜影院| 视频一区二区欧美| 国产欧美精品一区二区色综合朱莉| 色综合久久久久久久久久久| 免费成人在线观看| 亚洲欧美激情一区二区| 日韩欧美中文字幕制服| 成人h动漫精品一区二区| 天堂av在线一区| 日本一区二区三区四区| 欧美一区二区在线免费播放 | 一区二区在线观看免费视频播放 | 国产精品亚洲第一 | 日韩一区二区麻豆国产| 国产馆精品极品| 亚洲成人1区2区| 国产精品人妖ts系列视频| 91麻豆精品国产无毒不卡在线观看| 成人精品国产免费网站| 日本系列欧美系列| 亚洲精品美腿丝袜| 国产精品日韩精品欧美在线| 日韩精品一区二区三区四区视频| 色婷婷国产精品| 国产91丝袜在线18| 韩国女主播成人在线| 日本欧美在线观看| 亚洲自拍偷拍欧美| 日韩理论片中文av| 国产亚洲综合在线| 日韩欧美成人一区二区| 欧美日韩精品欧美日韩精品一 | 日韩精品一区二区三区视频播放| 91黄视频在线| hitomi一区二区三区精品| 看片的网站亚洲| 午夜视频在线观看一区二区三区| 亚洲人xxxx| 中文字幕中文在线不卡住| 国产精品区一区二区三区| 国产欧美日韩视频在线观看| 欧美电影免费观看高清完整版 | 国产一区二区不卡在线| 久久99精品网久久| 麻豆高清免费国产一区| 日韩**一区毛片| 蜜桃在线一区二区三区| 美国十次综合导航| 激情综合网天天干| 国产九色精品成人porny| 国产精品一区二区三区99| 国产在线不卡一区| 国产剧情一区二区| 成人激情黄色小说| 一本大道av一区二区在线播放| 大白屁股一区二区视频| 成人精品小蝌蚪| 日本黄色一区二区| 欧美人与禽zozo性伦| 在线成人高清不卡| 欧美成人免费网站| 欧美高清一级片在线观看| 中文字幕亚洲不卡| 亚洲永久精品国产| 水蜜桃久久夜色精品一区的特点| 日本vs亚洲vs韩国一区三区| 青青草国产精品97视觉盛宴 | 91丨porny丨户外露出| 色狠狠综合天天综合综合| 88在线观看91蜜桃国自产| 欧美成人三级在线| 中文字幕在线一区免费| 亚洲午夜三级在线| 九一久久久久久| av一区二区三区在线| 欧美日韩在线精品一区二区三区激情 | 欧美日韩国产一二三| 26uuu亚洲综合色| 中文字幕日韩欧美一区二区三区| 亚洲一区二区在线视频| 久久成人免费电影| 99久久久久久| 日韩精品中文字幕一区二区三区 | aa级大片欧美| 欧美一级日韩一级| 中文字幕一区二区三区视频| 日韩av网站免费在线| 95精品视频在线| 欧美不卡一区二区| 亚洲综合偷拍欧美一区色| 国产精品影视在线|