diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-09-25 10:53:37 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-09-27 15:50:43 +0200 |
commit | 4d74a89cfcdce4d9207f51c786a2a1fc278c5a11 (patch) | |
tree | 57dad8d63de8a0bf1b5f5e6e13d57982da431601 /doc/ja | |
parent | be6a29a596b5da3be4c00943cd5bdceabd5159c5 (diff) | |
download | weechat-4d74a89cfcdce4d9207f51c786a2a1fc278c5a11.zip |
api: add function string_parse_size
Diffstat (limited to 'doc/ja')
-rw-r--r-- | doc/ja/weechat_plugin_api.ja.adoc | 46 | ||||
-rw-r--r-- | doc/ja/weechat_scripting.ja.adoc | 1 |
2 files changed, 47 insertions, 0 deletions
diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index 7511c36de..0a1b8516b 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -1981,6 +1981,52 @@ def string_format_size(size: int) -> str: ... str = weechat.string_format_size(15200) # == "15.2 KB" ---- +// TRANSLATION MISSING +==== string_parse_size + +_WeeChat ≥ 3.7._ + +Parse a string with a size and optional unit and return the size in bytes. + +プロトタイプ: + +[source,c] +---- +unsigned long long weechat_string_parse_size (const char *size); +---- + +引数: + +* _size_: the size as string: float number followed optional spaces and optional + unit (lower or upper case), which is one of: +** _b_: bytes +** _k_: kilobytes (1k = 1000 bytes) +** _m_: megabytes (1m = 1000k = 1,000,000 bytes) +** _g_: gigabytes (1g = 1000m = 1,000,000,000 bytes) +** _t_: terabytes (1t = 1000g = 1,000,000,000,000 bytes) + +戻り値: + +* size in bytes, 0 if error + +C 言語での使用例: + +[source,c] +---- +unsigned long long size = weechat_parse_size ("1.34m"); /* size == 1340000 */ +---- + +Script (Python): + +[source,python] +---- +# プロトタイプ +def string_parse_size(size: str) -> int: ... + +# 例 +size = weechat.string_parse_size("1.34m") # 1340000 +---- + ==== string_color_code_size _WeeChat ≥ 3.0._ diff --git a/doc/ja/weechat_scripting.ja.adoc b/doc/ja/weechat_scripting.ja.adoc index acc3cb3be..4fd333797 100644 --- a/doc/ja/weechat_scripting.ja.adoc +++ b/doc/ja/weechat_scripting.ja.adoc @@ -596,6 +596,7 @@ link:weechat_plugin_api.ja.html[WeeChat プラグイン API リファレンス string_has_highlight_regex + string_mask_to_regex + string_format_size + + string_parse_size + string_color_code_size + string_remove_color + string_is_command_char + |