Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Quick Reference(快速參考)

Algorithms(算法)
Finders and Formatters(Finders 和 Formatter)
Iterators(迭代器)
Classification(分類)

算法

Table 17.1. 大小寫轉換

算法名稱 說明 函數
to_upper 將一個 string 轉換為大寫 to_upper_copy()
to_upper()
to_lower 將一個 string 轉換為小寫 to_lower_copy()
to_lower()

Table 17.2. 修剪

算法名稱 說明 函數
trim_left 從一個 string 中移除開頭的空格 trim_left_copy_if()
trim_left_if()
trim_left_copy()
trim_left()
trim_right 從一個 string 中移除末尾的空格 trim_right_copy_if()
trim_right_if()
trim_right_copy()
trim_right()
trim 從一個 string 中移除開頭和末尾的空格 trim_copy_if()
trim_if()
trim_copy()
trim()

Table 17.3. 判斷式

算法名稱 說明 函數
starts_with 檢查一個 string 是否是另一個的前綴 starts_with()
istarts_with()
ends_with 檢查一個 string 是否是另一個的後綴 ends_with()
iends_with()
contains 檢查一個 string 是否被包含於另一個 contains()
icontains()
equals 檢查兩個 strings 是否相等 equals()
iequals()
lexicographical_compare 根據字典順序,檢查一個 string 是否小於另一個 lexicographical_compare()
ilexicographical_compare()
all 檢查一個 string 中的所有元素是否滿足指定的判斷式 all()

Table 17.4. 查找算法

算法名稱 說明 函數
find_first 查找一個 string 在輸入中的第一次出現 find_first()
ifind_first()
find_last 查找一個 string 在輸入中的最後一次出現 find_last()
ifind_last()
find_nth 查找一個 string 在輸入中的第 n 次(從 0 開始索引)出現 find_nth()
ifind_nth()
find_head 取回一個 string 的開頭 find_head()
find_tail 取回一個 string 的末尾 find_tail()
find_token 查找 string 中的第一個匹配標誌 find_token()
find_regex 使用正則表達式搜索 string find_regex()
find 通用查找算法 find()

Table 17.5. 刪除/替換

算法名稱 說明 函數
replace/erase_first 替換/刪除一個 string 在輸入中的第一次出現 replace_first()
replace_first_copy()
ireplace_first()
ireplace_first_copy()
erase_first()
erase_first_copy()
ierase_first()
ierase_first_copy()
replace/erase_last 替換/刪除一個 string 在輸入中的最後一次出現 replace_last()
replace_last_copy()
ireplace_last()
ireplace_last_copy()
erase_last()
erase_last_copy()
ierase_last()
ierase_last_copy()
replace/erase_nth 替換/刪除一個 string 在輸入中的第 n 次(從 0 開始索引)出現 replace_nth()
replace_nth_copy()
ireplace_nth()
ireplace_nth_copy()
erase_nth()
erase_nth_copy()
ierase_nth()
ierase_nth_copy()
replace/erase_all 替換/刪除一個 string 在輸入中的所有出現 replace_all()
replace_all_copy()
ireplace_all()
ireplace_all_copy()
erase_all()
erase_all_copy()
ierase_all()
ierase_all_copy()
replace/erase_head 替換/刪除輸入的開頭 replace_head()
replace_head_copy()
erase_head()
erase_head_copy()
replace/erase_tail 替換/刪除輸入的末尾 replace_tail()
replace_tail_copy()
erase_tail()
erase_tail_copy()
replace/erase_regex 替換/刪除與給定正則表達式匹配的一個 substring replace_regex()
replace_regex_copy()
erase_regex()
erase_regex_copy()
replace/erase_regex_all 替換/刪除與給定正則表達式匹配的全部 substring replace_all_regex()
replace_all_regex_copy()
erase_all_regex()
erase_all_regex_copy()
find_format 通用替換算法 find_format()
find_format_copy()
find_format_all()
find_format_all_copy()()

Table 17.6. 分割

算法名稱 說明 函數
find_all 查找/選取輸入中的所有匹配的 substring find_all()
ifind_all()
find_all_regex()
split 將輸入分給為若幹部分 split()
split_regex()
iter_find 在輸入中迭代使用 Finder,以找到所有匹配的 substrings iter_find()
iter_split 使用 Finder 在輸入中查找匹配的 substrings,並將它們作為分隔符將輸入分割為若幹部分 iter_split()

Table 17.7. 結合

算法名稱 說明 函數
join 將一個容器中的所有元素結合到一個單獨的 string 中 join
join_if 將一個容器中的所有滿足條件的元素結合到一個單獨的 string 中 join_if()

Finders and Formatters

Table 17.8. Finders

Finder 說明 生成器
first_finder 在輸入中搜索 string 的第一個匹配項 first_finder()
last_finder 在輸入中搜索 string 的最後一個匹配項 last_finder()
nth_finder 在輸入中搜索 string 的第 n 個(從 0 開始索引)匹配項 nth_finder()
head_finder 取回輸入的開頭 head_finder()
tail_finder 取回輸入的末尾 tail_finder()
token_finder 在輸入中搜索匹配的標誌 token_finder()
range_finder 不搜索,總是返回給定的 range range_finder()
regex_finder 搜索與給定 regex 匹配的一個 substring regex_finder()

Table 17.9. Formatters

Formatter 說明 生成器
const_formatter 常量 Formatter。總是返回特定的 string const_formatter()
identity_formatter 恆等 Formatter。返回沒有改變的輸入 identity_formatter()
empty_formatter 空 Formatter。總是返回一個空 string empty_formatter()
regex_formatter Regex Formatter。使用格式化 string 中的規範格式化 regex 匹配項 regex_formatter()

迭代器

Table 17.10. 查找迭代器

迭代器名稱 說明 迭代器類
find_iterator 在輸入中 迭代遍歷匹配的 substrings find_iterator
split_iterator 在輸入中迭代遍歷匹配的 substrings 之間的間隔 split_iterator

分類

Table 17.11. 判斷式

判斷式名稱 說明 生成器
is_classified 基於分類的通用 ctype 掩碼 is_classified()
is_space 識別空格 is_space()
is_alnum 識別字母和數字字符 is_alnum()
is_alpha 識別字母 is_alpha()
is_cntrl 識別控制字符 is_cntrl()
is_digit 識別十進制數字 is_digit()
is_graph 識別圖形字符 is_graph()
is_lower 識別小寫字符 is_lower()
is_print 識別可打印字符 is_print()
is_punct 識別標點符號字符 is_punct()
is_upper 識別大寫字符 is_upper()
is_xdigit 識別十六進制數字 is_xdigit()

Last revised: February 27, 2008 at 15:00:24 -0500


PrevUpHomeNext