summaryrefslogtreecommitdiff
path: root/doc/ja/weechat_plugin_api.ja.adoc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-08-22 08:55:16 +0200
committerSébastien Helleu <flashcode@flashtux.org>2020-08-22 08:55:16 +0200
commit268aa631c6b464c0d97dce5dbe76f145a6cc5f68 (patch)
tree00ef2b36db0fc64e2723442f1750934aec030901 /doc/ja/weechat_plugin_api.ja.adoc
parent7dd5abd6252d108858f31a717a127f86d5c206c1 (diff)
downloadweechat-268aa631c6b464c0d97dce5dbe76f145a6cc5f68.zip
api: add function string_color_code_size (issue #1547)
Diffstat (limited to 'doc/ja/weechat_plugin_api.ja.adoc')
-rw-r--r--doc/ja/weechat_plugin_api.ja.adoc51
1 files changed, 51 insertions, 0 deletions
diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc
index c9b1ee1f0..fdd40dea5 100644
--- a/doc/ja/weechat_plugin_api.ja.adoc
+++ b/doc/ja/weechat_plugin_api.ja.adoc
@@ -1900,6 +1900,57 @@ str = weechat.string_format_size(size)
str = weechat.string_format_size(15200) # == "15.2 KB"
----
+==== string_color_code_size
+
+_WeeChat ≥ 3.0._
+
+// TRANSLATION MISSING
+Return the size (in bytes) of the WeeChat color code at the beginning of
+the string.
+
+プロトタイプ:
+
+[source,C]
+----
+int weechat_string_color_code_size (const char *string);
+----
+
+引数:
+
+* _string_: 文字列
+
+戻り値:
+
+// TRANSLATION MISSING
+* size (in bytes) of the WeeChat color code at the beginning of the string;
+ if the string is NULL, empty or does not start with a color code, 0 is returned;
+ if the string begins with multiple color codes, only the size of the first one
+ is returned
+
+C 言語での使用例:
+
+[source,C]
+----
+int size;
+
+size = weechat_string_color_code_size ("test"); /* size == 0 */
+size = weechat_string_color_code_size (weechat_color ("bold")); /* size == 2 */
+size = weechat_string_color_code_size (weechat_color ("yellow,red")); /* size == 7 */
+----
+
+スクリプト (Python) での使用例:
+
+[source,python]
+----
+# プロトタイプ
+size = weechat.string_color_code_size(string)
+
+# 例
+size = weechat.string_color_code_size("test") # size == 0
+size = weechat.string_color_code_size(weechat.color("bold")) # size == 2
+size = weechat.string_color_code_size(weechat.color("yellow,red")) # size == 7
+----
+
==== string_remove_color
文字列から WeeChat 色コードを削除。