From d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0 Mon Sep 17 00:00:00 2001 From: cathook Date: Sun, 1 Jun 2014 13:56:57 +0800 Subject: big chnage --- doc/html/classmeow_1_1Usage.html | 797 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 797 insertions(+) create mode 100644 doc/html/classmeow_1_1Usage.html (limited to 'doc/html/classmeow_1_1Usage.html') diff --git a/doc/html/classmeow_1_1Usage.html b/doc/html/classmeow_1_1Usage.html new file mode 100644 index 0000000..68e689a --- /dev/null +++ b/doc/html/classmeow_1_1Usage.html @@ -0,0 +1,797 @@ + + + + + + + +Templates -- Meow: meow::Usage Class Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
Templates -- Meow +  1.1.2 +
+
不能,也不應該先編譯成obj-file的templates
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
meow::Usage Class Reference
+
+
+ +

管理參數設置, 自訂usage document, 分析argc, argv + More...

+ +

#include "Usage.h"

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Usage ()
 constructor More...
 
 Usage (String const &name)
 constructor More...
 
 Usage (Usage const &usage)
 constructor More...
 
bool import (Usage const &usage)
 將另一個usage的設置匯入 More...
 
bool update (Usage const &usage)
 將另一個usage的選項設置加進來 More...
 
bool optionAdd (unsigned char opt, String const &des)
 新增一個沒有額外選項的選項 More...
 
bool optionAdd (unsigned char opt, String const &des, String const &val_type, String const &val_default, bool must)
 新增一個有額外選項的選項 More...
 
bool optionValueAcceptAdd (unsigned char opt, String const &val, String const &des)
 針對-(opt)新增一個可接受的額外選項 More...
 
bool hasOptionSetup (unsigned char opt) const
 回傳是否有設定此選項 More...
 
size_t optionValuesSize (unsigned char opt) const
 回傳參數 -(opt) 被設置幾次 More...
 
String optionValue (unsigned char opt, size_t index) const
 回傳參數 -(opt) 的第 index 個額外選項 More...
 
size_t procArgsSize () const
 取得有幾個process arguments More...
 
String procArg (size_t index) const
 取得第i個process argument More...
 
Strings const & procArgs () const
 取得process arguments array More...
 
void usageBeginAdd (String const &des)
 新增一段usage document於每個選項逐條說明之前 More...
 
void usageEndAdd (String const &des)
 新增一段usage document於每個選項逐條說明之後 More...
 
String usage () const
 回傳usage string More...
 
bool arguments (int argc, char **argv, String *errmsg)
 給定argc, argv, 將各參數設置 More...
 
+

Detailed Description

+

管理參數設置, 自訂usage document, 分析argc, argv

+

Usage 是用來分析argc, argv和輸出usage document的class.
+ argc, argv的部份, 有以下規則

+
    +
  • -c 其中 c 可以代換成一個字符, 這種選像可能是 有設置沒設置
  • +
  • -c value 附加一個 value , 這種選項可以是 選擇性必要的 , 另外可以給定value的預設值以及哪些value是可接受
  • +
  • value 其他, 一律視為 process arguments
  • +
+
Author
cathook
+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
meow::Usage::Usage ()
+
+inline
+
+ +

constructor

+

所有說明文字中 <name> 都會被代換成空字串

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
meow::Usage::Usage (String const & name)
+
+inline
+
+ +

constructor

+

所有說明文字中 "<name>" 都會被代換成空字串 name

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
meow::Usage::Usage (Usage const & usage)
+
+inline
+
+ +

constructor

+

將另一個usage原封不動的複製過來

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool meow::Usage::arguments (int argc,
char ** argv,
String * errmsg 
)
+
+inline
+
+ +

給定argc, argv, 將各參數設置

+
Parameters
+ + + +
[in]argc,argv
[out]errmsg將錯誤訊息寫到這裡 (若給定NULL pointer, 則會把錯誤訊息忽略)
+
+
+
Returns
true/false 成功與否 (否的話代表有錯誤的設定值在其中)
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool meow::Usage::hasOptionSetup (unsigned char opt) const
+
+inline
+
+ +

回傳是否有設定此選項

+
Parameters
+ + +
[in]opt指定字符
+
+
+
Returns
true/false是否有設定此選項
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool meow::Usage::import (Usage const & usage)
+
+inline
+
+ +

將另一個usage的設置匯入

+
Parameters
+ + +
[in]usage另一個usage
+
+
+
Returns
true/false 表示 是否成功
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool meow::Usage::optionAdd (unsigned char opt,
String const & des 
)
+
+inline
+
+ +

新增一個沒有額外選項的選項

+
Parameters
+ + + +
[in]opt指定字符
[in]des即description, 用來解釋這個選項的意義用的
+
+
+
Returns
true/false是否成功
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool meow::Usage::optionAdd (unsigned char opt,
String const & des,
String const & val_type,
String const & val_default,
bool must 
)
+
+inline
+
+ +

新增一個有額外選項的選項

+
Parameters
+ + + + + + +
[in]opt指定字符
[in]des即description, 用來解釋這個選項的意義用的
[in]val_type表示額外選項的型態, 寫在USAGE裡面給人看用的
[in]val_default預設值, 若為空字串則當作沒有預設值
[in]must表示是否一定要設定
+
+
+
Returns
true/false是否成功
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
String meow::Usage::optionValue (unsigned char opt,
size_t index 
) const
+
+inline
+
+ +

回傳參數 -(opt) 的第 index 個額外選項

+
Parameters
+ + + +
[in]opt指定字符
[in]index第幾個
+
+
+
Returns
回傳參數 -(opt) 的第 index 個額外選項
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool meow::Usage::optionValueAcceptAdd (unsigned char opt,
String const & val,
String const & des 
)
+
+inline
+
+ +

針對-(opt)新增一個可接受的額外選項

+
Parameters
+ + + + +
[in]opt指定字符
[in]val額外選項
[in]des關於此額外選項的說明
+
+
+
Returns
true/false是否成功
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
size_t meow::Usage::optionValuesSize (unsigned char opt) const
+
+inline
+
+ +

回傳參數 -(opt) 被設置幾次

+
Parameters
+ + +
[in]opt指定字符
+
+
+
Returns
回傳次數
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
String meow::Usage::procArg (size_t index) const
+
+inline
+
+ +

取得第i個process argument

+
Parameters
+ + +
[in]index第幾個
+
+
+
Returns
回傳第 indexprocess argument
+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
Strings const& meow::Usage::procArgs () const
+
+inline
+
+ +

取得process arguments array

+
Returns
一個 std::vector , 包含所有 Process arguments
+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t meow::Usage::procArgsSize () const
+
+inline
+
+ +

取得有幾個process arguments

+
Returns
有幾個process arguments
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool meow::Usage::update (Usage const & usage)
+
+inline
+
+ +

將另一個usage的選項設置加進來

+
Parameters
+ + +
[in]usage另一個usage
+
+
+
Returns
true/false是否成功
+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
String meow::Usage::usage () const
+
+inline
+
+ +

回傳usage string

+
Returns
usage string
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void meow::Usage::usageBeginAdd (String const & des)
+
+inline
+
+ +

新增一段usage document於每個選項逐條說明之前

+
Parameters
+ + +
[in]des要新增的usage document
+
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void meow::Usage::usageEndAdd (String const & des)
+
+inline
+
+ +

新增一段usage document於每個選項逐條說明之後

+
Parameters
+ + +
[in]des要新增的usage document
+
+
+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + -- cgit v1.2.3