class PLRuby::BitString - RDoc Documentation

# class PLRuby::BitString

The class PLRuby::BitString implement the PostgreSQL type bit and bit varying

### Public Class Methods

from_string(string, length = strlen(string)) click to toggle source

Convert a String to a BitString

    # File plruby.rb, line 1026
    def from_string(string, length = strlen(string))
    end

new(init, nbits = -1) click to toggle source

create a new BitString object with nbits bits

init can be a Fixnum or a String

For a String the first character can be 'x', 'X' for and hexadecimal representation, or 'b', 'B' for a binary representation. The default is a binary representation

    # File plruby.rb, line 1117
    def initialize(init, nbits = -1)
    end

### Public Instance Methods

&(other) click to toggle source

AND operator

    # File plruby.rb, line 1043
    def &(other)
    end

+(other) click to toggle source

Concatenate self and other

    # File plruby.rb, line 1039
    def +(other)
    end

<<(lshft) click to toggle source

LEFT SHIFT operator

    # File plruby.rb, line 1059
    def <<(lshft)
    end

<=>(other) click to toggle source

comparison function for 2 BitString objects

All bits are considered and additional zero bits may make one string smaller/larger than the other, even if their zero-padded values would be the same.

    # File plruby.rb, line 1035
    def <=>(other)
    end

>>(rshft) click to toggle source

RIGHT SHIFT operator

    # File plruby.rb, line 1063
    def >>(rshft)
    end

[](*args) click to toggle source

Element reference with the same syntax that for a String object

Return a BitString or a Fixnum 0, 1

    bitstring[fixnum]
    bitstring[fixnum, fixnum]
    bitstring[range]
    bitstring[regexp]
    bitstring[regexp, fixnum]
    bitstring[string]
    bitstring[other_bitstring]

    # File plruby.rb, line 1077
    def [](*args)
    end

[]=(*args) click to toggle source

Element assignment with the same syntax that for a String object

    bitstring[fixnum] = fixnum
    bitstring[fixnum] = string_or_bitstring
    bitstring[fixnum, fixnum] = string_or_bitstring
    bitstring[range] = string_or_bitstring
    bitstring[regexp] = string_or_bitstring
    bitstring[regexp, fixnum] = string_or_bitstring
    bitstring[other_str] = string_or_bitstring

    # File plruby.rb, line 1089
    def []=(*args)
    end

^(other) click to toggle source

XOR operator

    # File plruby.rb, line 1051
    def ^(other)
    end

concat(other) click to toggle source

append other to self

    # File plruby.rb, line 1093
    def concat(other)
    end

each() click to toggle source

iterate other each bit

    # File plruby.rb, line 1097
    def each
    end

include?(other) click to toggle source

return true if other is included in self

    # File plruby.rb, line 1101
    def include?(other)
    end

index(other) click to toggle source

return the position of other in self

return nil if other is not included in self

    # File plruby.rb, line 1107
    def index(other)
    end

length() click to toggle source

return the length of self in bits

    # File plruby.rb, line 1121
    def length
    end

octet_length() click to toggle source

return the length of self in octets

    # File plruby.rb, line 1125
    def octet_length
    end

push(other) click to toggle source

append other to self

    # File plruby.rb, line 1129
    def push(other)
    end

to_i() click to toggle source

convert self to a Fixnum

    # File plruby.rb, line 1133
    def to_i
    end

to_s() click to toggle source

convert self to a String

    # File plruby.rb, line 1137
    def to_s
    end

|(other) click to toggle source

OR operator

    # File plruby.rb, line 1047
    def |(other)
    end

~() click to toggle source

NOT operator

    # File plruby.rb, line 1055
    def ~()
    end