種類
- インスタンスメソッド (111)
- 特異メソッド (27)
ライブラリ
- ビルトイン (138)
クラス
-
Encoding
:: Converter (48) - Enumerator (12)
- IO (12)
- String (66)
キーワード
- byterindex (3)
- length (12)
- new (27)
- next (12)
-
primitive
_ convert (48) - size (12)
-
write
_ nonblock (12)
検索結果
先頭5件
- String
# bytesize -> Integer - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol - String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol
-
String
# bytesize -> Integer (21207.0) -
文字列のバイト長を整数で返します。
...文字列のバイト長を整数で返します。
//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}
@see String#size... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (9208.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...:Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (9208.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...:Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (9201.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...ンデックス offset から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表現......で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索はその開始......emlist[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("i... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol (9108.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...:Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (9108.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...:Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
IO
# write _ nonblock(string , exception: true) -> Integer | :wait _ writable (6306.0) -
IO をノンブロッキングモードに設定し、string を write(2) システムコールで書き出します。
...、string を write(2) システムコールで書き出します。
write(2) が成功した場合、書き込んだ長さを返します。
EAGAIN, EINTR などは例外 Errno::EXXX として呼出元に報告されます。
書き込んだバイト数(つまり返り値)は String#bytesize の......た例外 がErrno::EAGAIN、 Errno::EWOULDBLOCK である場合は、
その例外オブジェクトに IO::WaitWritable が Object#extend
されます。よって IO::WaitWritable を write_nonblock のリトライが必要
かの判定に用いることができます。
@param string 自身に......@param exception false を指定すると、書き込み時に Errno::EAGAIN、Errno::EWOULDBLOCK が発生
する代わりに :wait_writable を返します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX writ... -
String
. new(string = "" , encoding: string . encoding , capacity: string . bytesize) -> String (3507.0) -
string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。
...string と同じ内容の新しい文字列を作成して返します。
引数を省略した場合は空文字列を生成して返します。
@param string 文字列
@param encoding 作成する文字列のエンコーディングを文字列か
Encoding オブジェクト......せん)。省略した場合は引数 string のエンコーディングと同
じになります(ただし、string が指定されていなかった場合は
Encoding::ASCII_8BITになります)。
@param capacity 内部バッファのサイズを指定......reallocがなんども呼ばれる)ときの
パフォーマンスが改善されるかもしれません。
省略した場合、引数stringのバイト数が127未満であれば127、
それ以上であればstring.bytesizeになります。
@retur... -
String
. new(string = "" , encoding: string . encoding , capacity: 127) -> String (3307.0) -
string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。
...string と同じ内容の新しい文字列を作成して返します。
引数を省略した場合は空文字列を生成して返します。
@param string 文字列
@param encoding 作成する文字列のエンコーディングを文字列か
Encoding オブジェクト......せん)。省略した場合は引数 string のエンコーディングと同
じになります(ただし、string が指定されていなかった場合は
Encoding::ASCII_8BITになります)。
@param capacity 内部バッファのサイズを指定......reallocがなんども呼ばれる)ときの
パフォーマンスが改善されるかもしれません。
省略した場合、引数stringのバイト数が127未満であれば127、
それ以上であればstring.bytesizeになります。
@retur... -
String
. new(string = "" , encoding: string . encoding , capacity: 63) -> String (3307.0) -
string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。
...string と同じ内容の新しい文字列を作成して返します。
引数を省略した場合は空文字列を生成して返します。
@param string 文字列
@param encoding 作成する文字列のエンコーディングを文字列か
Encoding オブジェクト......せん)。省略した場合は引数 string のエンコーディングと同
じになります(ただし、string が指定されていなかった場合は
Encoding::ASCII_8BITになります)。
@param capacity 内部バッファのサイズを指定......reallocがなんども呼ばれる)ときの
パフォーマンスが改善されるかもしれません。
省略した場合、引数stringのバイト数が127未満であれば127、
それ以上であればstring.bytesizeになります。
@retur... -
String
. new(string = "") -> String (3207.0) -
string と同じ内容の新しい文字列を作成して返します。 引数を省略した場合は空文字列を生成して返します。
...string と同じ内容の新しい文字列を作成して返します。
引数を省略した場合は空文字列を生成して返します。
@param string 文字列
@param encoding 作成する文字列のエンコーディングを文字列か
Encoding オブジェクト......せん)。省略した場合は引数 string のエンコーディングと同
じになります(ただし、string が指定されていなかった場合は
Encoding::ASCII_8BITになります)。
@param capacity 内部バッファのサイズを指定......reallocがなんども呼ばれる)ときの
パフォーマンスが改善されるかもしれません。
省略した場合、引数stringのバイト数が127未満であれば127、
それ以上であればstring.bytesizeになります。
@retur...