資源簡介
OgrePingpoGame
代碼片段和文件信息
/*
*?AnyOption?1.3??
*
*?kishan?at?hackorama?dot?com??www.hackorama.com?JULY?2001?
*
*?+?Acts?as?a?common?facade?class?for?reading?
*???commandline?options?as?well?as?options?from
*???an?optionfile?with?delimited?type?value?pairs?
*
*?+?Handles?the?POSIX?style?single?character?options?(?-w?)
*???as?well?as?the?newer?GNU?long?options?(?--width?)
*?
*?+?The?option?file?assumes?the?traditional?format?of
*???first?character?based?comment?lines?and?type?value
*???pairs?with?a?delimiter??and?flags?which?are?not?pairs
*?
*?? #?this?is?a?coment
*?? #?next?line?is?an?option?value?pair
*?? width?:?100
*????? #?next?line?is?a?flag?
*??????noimages???
*?
*?+?Supports?printing?out?Help?and?Usage??
*?
*?+?Why?not?just?use?getopt()???
*
*???getopt()?Its?a?POSIX?standard?not?part?of?ANSI-C.?
*???So?it?may?not?be?available?on?platforms?like?Windows.
*
*?+?Why?it?is?so?long??
*
*???The?actual?code?which?does?command?line?parsing?
*???and?option?file?parsing?are?done?in??few?methods.?
*???Most?of?the?extra?code?are?for?providing?a?flexible
*???common?public?interface?to?both?a?resourcefile?and
*???and?command?line?supporting?POSIX?style?and??
*???GNU?long?option?as?well?as?mixing?of?both.?
*?
*?+?Please?see?“anyoption.h“?for?public?method?descriptions?
*???
*/
/*?Updated?Auguest?2004?
*?Fix?from??Michael?D?Peters?(mpeters?at?sandia.gov)?
*?to?remove?static?local?variables?allowing?multiple?instantiations?
*?of?the?reader?(for?using?multiple?configuration?files).??There?is
*?an?error?in?the?destructor?when?using?multiple?instances?so?you
*?cannot?delete?your?objects?(it?will?crash)?but?not?calling?the?
*?destructor?only?introduces?a?small?memory?leak?so?I
*?have?not?bothered?tracking?it?down.
*
*?Also?updated?to?use?modern?C++?style?headers?rather?than
*?depricated?iostream.h?(it?was?causing?my?compiler?problems)
*/
/*?
*?Updated?September?2006??
*?Fix?from?Boyan?Asenov?for?a?bug?in?mixing?up?option?indexes?
*?leading?to?exception?when?mixing?different?options?types
*/
#include?“anyoption.h“
AnyOption::AnyOption?()
{
????init();
}
AnyOption::AnyOption?(?int?maxopt?)
{
????init(maxopt?maxopt);
}
AnyOption::AnyOption?(?int?maxopt?int?maxcharopt?)
{
????init(maxopt?maxcharopt);
}
AnyOption::~AnyOption?()
????{
????????if?(?mem_allocated?)
????????????cleanup();
????}
void?AnyOption::init?()
{
????init(DEFAULT_MAXOPTS?DEFAULT_MAXOPTS);
}
void?AnyOption::init?(?int?maxopt?int?maxcharopt?)
????{
????????max_options?=?maxopt;
????????max_char_options?=?maxcharopt;
????????max_usage_lines?=?DEFAULT_MAXUSAGE;
????????usage_lines?=?0;
????????argc?=?0;
????????argv?=?NULL;
????????posix_style?=?true;
????????verbose?=?false;
????????filename?=?NULL;
????????appname?=?NULL;
????????option_counter?=?0;
????????optchar_counter?=?0;
????????new_argv?=?NULL;
????????new_argc?=?0;
????????max_legal_args?=?0;
????????command_set?=?false;
????????file_set?=?f
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-12-09?15:18??PingpoGame\
?????目錄???????????0??2012-12-09?15:18??PingpoGame\.git\
?????文件?????????336??2012-12-09?15:18??PingpoGame\.git\config
?????文件??????????73??2012-12-09?15:12??PingpoGame\.git\desc
?????文件??????????87??2012-12-09?15:18??PingpoGame\.git\FETCH_HEAD
?????文件??????????23??2012-12-09?15:12??PingpoGame\.git\HEAD
?????目錄???????????0??2012-12-09?15:12??PingpoGame\.git\hooks\
?????文件?????????452??2012-12-09?15:12??PingpoGame\.git\hooks\applypatch-msg.sample
?????文件?????????896??2012-12-09?15:12??PingpoGame\.git\hooks\commit-msg.sample
?????文件?????????160??2012-12-09?15:12??PingpoGame\.git\hooks\post-commit.sample
?????文件?????????552??2012-12-09?15:12??PingpoGame\.git\hooks\post-receive.sample
?????文件?????????189??2012-12-09?15:12??PingpoGame\.git\hooks\post-update.sample
?????文件?????????398??2012-12-09?15:12??PingpoGame\.git\hooks\pre-applypatch.sample
?????文件????????1704??2012-12-09?15:12??PingpoGame\.git\hooks\pre-commit.sample
?????文件????????4951??2012-12-09?15:12??PingpoGame\.git\hooks\pre-reba
?????文件????????1239??2012-12-09?15:12??PingpoGame\.git\hooks\prepare-commit-msg.sample
?????文件????????3611??2012-12-09?15:12??PingpoGame\.git\hooks\update.sample
?????文件???????33680??2012-12-09?15:18??PingpoGame\.git\index
?????目錄???????????0??2012-12-09?15:12??PingpoGame\.git\info\
?????文件?????????240??2012-12-09?15:12??PingpoGame\.git\info\exclude
?????目錄???????????0??2012-12-09?15:18??PingpoGame\.git\logs\
?????文件?????????124??2012-12-09?15:18??PingpoGame\.git\logs\HEAD
?????目錄???????????0??2012-12-09?15:18??PingpoGame\.git\logs\refs\
?????目錄???????????0??2012-12-09?15:18??PingpoGame\.git\logs\refs\heads\
?????文件?????????124??2012-12-09?15:18??PingpoGame\.git\logs\refs\heads\master
?????目錄???????????0??2012-12-09?15:18??PingpoGame\.git\logs\refs\remotes\
?????目錄???????????0??2012-12-09?15:18??PingpoGame\.git\logs\refs\remotes\origin\
?????文件?????????175??2012-12-09?15:18??PingpoGame\.git\logs\refs\remotes\origin\master
?????目錄???????????0??2012-12-09?15:12??PingpoGame\.git\ob
?????目錄???????????0??2012-12-09?15:12??PingpoGame\.git\ob
?????目錄???????????0??2012-12-09?15:18??PingpoGame\.git\ob
............此處省略384個文件信息
- 上一篇:軟件加密原理與應(yīng)用
- 下一篇:jdk7源代碼內(nèi)含jsse源代碼
評論
共有 條評論