77件ヒット
[1-77件を表示]
(0.084秒)
ライブラリ
- ビルトイン (33)
- fiddle (11)
-
fiddle
/ import (11) - ipaddr (11)
-
rubygems
/ dependency (11)
クラス
-
Fiddle
:: Pointer (11) -
File
:: Stat (11) -
Gem
:: Dependency (11) - IPAddr (11)
- Integer (11)
- Module (11)
モジュール
-
Fiddle
:: Importer (11)
検索結果
先頭5件
-
Fiddle
:: Pointer # <=>(other) -> Integer (21201.0) -
ポインタの指すアドレスの大小を比較します。
...ポインタの指すアドレスの大小を比較します。
other より小さい場合は -1, 等しい場合は 0、other より大きい場合は
1を返します。
@param other 比較対象の Pointer オブジェクト... -
Integer
# <=>(other) -> -1 | 0 | 1 | nil (21125.0) -
self と other を比較して、self が大きい時に1、等しい時に 0、小さい時 に-1、比較できない時に nil を返します。
...、self が大きい時に1、等しい時に 0、小さい時
に-1、比較できない時に nil を返します。
@param other 比較対象の数値
@return -1 か 0 か 1 か nil のいずれか
//emlist[][ruby]{
1 <=> 2 # => -1
1 <=> 1 # => 0
2 <=> 1 # => 1
2 <=> '' # => nil
//}... -
Module
# <=>(other) -> Integer | nil (18237.0) -
self と other の継承関係を比較します。
...のクラスやモジュール
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar <=> Foo # => -1
p Baz <=> Bar # => -1
p Baz <=> Foo # => -1
p Baz <=> Qux # => nil
p Qux <=> Baz # => nil
p Baz <=> Object.new # => nil
//}... -
File
:: Stat # <=>(o) -> Integer | nil (18219.0) -
ファイルの最終更新時刻を比較します。self が other よりも 新しければ正の数を、等しければ 0 を古ければ負の数を返します。 比較できない場合は nil を返します。
...fp1 = Tempfile.open("first")
fp1.print "古い方\n"
sleep(1)
fp2 = Tempfile.open("second")
fp2.print "新しい方\n"
p File::Stat.new(fp1.path) <=> File::Stat.new(fp2.path) #=> -1
p File::Stat.new(fp2.path) <=> File::Stat.new(fp1.path) #=> 1
p File::Stat.new(fp1.path) <=> fp2.path #=> nil
//}... -
Gem
:: Dependency # <=>(other) -> Integer (18201.0) -
self と other を Gem::Dependency#name の ASCII コードで比較して self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。
self と other を Gem::Dependency#name の ASCII コードで比較して
self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。 -
IPAddr
# <=>(other) -> Integer | nil (18201.0) -
self と other を比較します。
...の IPAddr オブジェクト。
@return self と other のアドレスファミリが一致しない場合は nil を返します。
アドレスファミリが一致する場合は、両方の数値表現を Integer#<=>
で比較した結果を返します。
@see Integer#<=>... -
Fiddle
:: Importer # bind(signature , *opts) { . . . } -> Fiddle :: Function (43.0) -
Ruby のブロックを C の関数で wrap し、その関数をモジュールに インポートします。
...tion オブジェクトとして
取り出すことができます。
signature で関数の名前とシネグチャを指定します。例えば
"int compare(void*, void*)" のように指定します。
opts には :stdcall もしくは :cdecl を渡すことができ、
呼出規約を明示......"int qsort(void*, size_t, size_t, void*)"
bind("int compare(void*, void*)"){|px, py|
x = px.to_s(Fiddle::SIZEOF_INT).unpack("i!")
y = py.to_s(Fiddle::SIZEOF_INT).unpack("i!")
x <=> y
}
end
data = [32, 180001, -13, -1, 0, 49].pack("i!*")
M.qsort(Fiddle::Pointe......r[data], 6, Fiddle::SIZEOF_INT, M["compare"])
p data.unpack("i!*") # => [-13, -1, 0, 32, 49, 180001]...