Class: OpenCV::Std::Vector::Std_String

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Includes:
Enumerable
Defined in:
lib/ropencv/ropencv_types.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.vectorObject .vectorObject

Overloads:

Raises:

  • (ArgumentError)


80871
80872
80873
80874
80875
80876
80877
80878
80879
80880
80881
80882
80883
80884
80885
80886
80887
80888
80889
80890
80891
80892
80893
80894
80895
80896
80897
80898
80899
80900
80901
80902
80903
80904
80905
# File 'lib/ropencv/ropencv_types.rb', line 80871

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Vector::Std_StringStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # overloaded method wrapper for std::vector<std::string>::vector<std::string>()
    @@std_vector_std_string_vector_std_string_defaults0 ||= []
    if(args.size >= 0 && args.size <= 0)
        targs = args.clone
        targs.size.upto(-1) do |i|
            targs[i] = @@std_vector_std_string_vector_std_string_defaults0[i]
        end
        begin
                return Rbind::std_vector_std_string_vector_std_string(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    # overloaded method wrapper for std::vector<std::string>::vector<std::string>(std::vector<std::string> other)
    @@std_vector_std_string_vector_std_string__2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        targs = args.clone
        targs.size.upto(0) do |i|
            targs[i] = @@std_vector_std_string_vector_std_string__2_defaults1[i]
        end
        begin
                return Rbind::std_vector_std_string_vector_std_string__2(*targs)
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "no constructor for #{self}(#{args.inspect})"
end

.nullObject

returns a null pointer to the object



80863
80864
80865
# File 'lib/ropencv/ropencv_types.rb', line 80863

def self.null
    new(Vector::Std_StringStruct.new)
end

Instance Method Details

#<<(val) ⇒ Object



81132
81133
81134
81135
# File 'lib/ropencv/ropencv_types.rb', line 81132

def <<(val)
    push_back(val)
    self
end

#[](idx) ⇒ Std::String

Note:

method wrapper for std::string std::vectorstd::string::operator

Parameters:

  • size (Size_T)

Returns:



81028
81029
81030
81031
81032
81033
81034
81035
81036
81037
# File 'lib/ropencv/ropencv_types.rb', line 81028

def [](size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_std_string_operator_array( self, size)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#at(size) ⇒ Std::String

Note:

method wrapper for std::string std::vectorstd::string::at(size_t size)

Parameters:

  • size (Size_T)

Returns:



81042
81043
81044
81045
81046
81047
81048
81049
81050
81051
# File 'lib/ropencv/ropencv_types.rb', line 81042

def at(size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_std_string_at( self, size)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#backStd::String

Note:

method wrapper for std::string std::vectorstd::string::back()

Returns:



81067
81068
81069
81070
81071
81072
81073
81074
81075
# File 'lib/ropencv/ropencv_types.rb', line 81067

def back()
    __validate_pointer__
    result = Rbind::std_vector_std_string_back( self)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#capacitySize_T

Note:

method wrapper for size_t std::vectorstd::string::capacity()

Returns:

  • (Size_T)


81005
81006
81007
81008
# File 'lib/ropencv/ropencv_types.rb', line 81005

def capacity()
    __validate_pointer__
    Rbind::std_vector_std_string_capacity( self)
end

#clearVoid

Note:

method wrapper for void std::vectorstd::string::clear()

Returns:

  • (Void)


80998
80999
81000
81001
# File 'lib/ropencv/ropencv_types.rb', line 80998

def clear()
    __validate_pointer__
    Rbind::std_vector_std_string_clear( self)
end

#dataVoid

Note:

method wrapper for void* std::vectorstd::string::data()

Returns:

  • (Void)


81079
81080
81081
81082
# File 'lib/ropencv/ropencv_types.rb', line 81079

def data()
    __validate_pointer__
    Rbind::std_vector_std_string_data( self)
end

#delete_if(&block) ⇒ Object



81136
81137
81138
81139
81140
81141
81142
81143
# File 'lib/ropencv/ropencv_types.rb', line 81136

def delete_if(&block)
    v = self.class.new
    each do |i|
         v << i if !yield(i)
    end
    v.swap(self)
    self
end

#each(&block) ⇒ Object



81122
81123
81124
81125
81126
81127
81128
81129
81130
81131
# File 'lib/ropencv/ropencv_types.rb', line 81122

def each(&block)
    if block
         s = size
         0.upto(s-1) do |i|
             yield self[i]
         end
    else
        Enumerator.new(self)
    end
end

#emptyBool

Note:

method wrapper for bool std::vectorstd::string::empty()

Returns:

  • (Bool)


81012
81013
81014
81015
# File 'lib/ropencv/ropencv_types.rb', line 81012

def empty()
    __validate_pointer__
    Rbind::std_vector_std_string_empty( self)
end

#frontStd::String

Note:

method wrapper for std::string std::vectorstd::string::front()

Returns:



81055
81056
81057
81058
81059
81060
81061
81062
81063
# File 'lib/ropencv/ropencv_types.rb', line 81055

def front()
    __validate_pointer__
    result = Rbind::std_vector_std_string_front( self)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#get_elementStd::String

Note:

method wrapper for std::string std::vectorstd::string::operator

Parameters:

  • size (Size_T)

Returns:



81111
81112
81113
81114
81115
81116
81117
81118
81119
81120
# File 'lib/ropencv/ropencv_types.rb', line 81111

def [](size)
validate_index(size)
    __validate_pointer__
    result = Rbind::std_vector_std_string_operator_array( self, size)
    if result.respond_to?(:__owner__?) && !result.__owner__?
    # store owner insight the pointer to not get garbage collected
        result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) 
    end
    result
end

#pop_backVoid

Note:

method wrapper for void std::vectorstd::string::pop_back()

Returns:

  • (Void)


81094
81095
81096
81097
# File 'lib/ropencv/ropencv_types.rb', line 81094

def pop_back()
    __validate_pointer__
    Rbind::std_vector_std_string_pop_back( self)
end

#push_back(other) ⇒ Void

Note:

method wrapper for void std::vectorstd::string::push_back(std::string other)

Parameters:

Returns:

  • (Void)


81087
81088
81089
81090
# File 'lib/ropencv/ropencv_types.rb', line 81087

def push_back(other)
    __validate_pointer__
    Rbind::std_vector_std_string_push_back( self, other)
end

#reserve(size) ⇒ Void

Note:

method wrapper for void std::vectorstd::string::reserve(size_t size)

Parameters:

  • size (Size_T)

Returns:

  • (Void)


81020
81021
81022
81023
# File 'lib/ropencv/ropencv_types.rb', line 81020

def reserve(size)
    __validate_pointer__
    Rbind::std_vector_std_string_reserve( self, size)
end

#resize(size, val = Std::String.new()) ⇒ Void

Note:

method wrapper for void std::vectorstd::string::resize(size_t size, std::string val = std::string())

methods

Parameters:

  • size (Size_T)
  • val (Std::String) (defaults to: Std::String.new())

Returns:

  • (Void)


80984
80985
80986
80987
# File 'lib/ropencv/ropencv_types.rb', line 80984

def resize(size, val = Std::String.new())
    __validate_pointer__
    Rbind::std_vector_std_string_resize( self, size, val)
end

#sizeSize_T

Note:

method wrapper for size_t std::vectorstd::string::size()

Returns:

  • (Size_T)


80991
80992
80993
80994
# File 'lib/ropencv/ropencv_types.rb', line 80991

def size()
    __validate_pointer__
    Rbind::std_vector_std_string_size( self)
end

#swap(other) ⇒ Void

Note:

method wrapper for void std::vectorstd::string::swap(std::vectorstd::string other)

Parameters:

Returns:

  • (Void)


81102
81103
81104
81105
# File 'lib/ropencv/ropencv_types.rb', line 81102

def swap(other)
    __validate_pointer__
    Rbind::std_vector_std_string_swap( self, other)
end

#to_sObject

converts Vector::Std_String into a string by crawling through all its attributes



80971
80972
80973
# File 'lib/ropencv/ropencv_types.rb', line 80971

def to_s
    "#<std::vector<std::string> >"
end

#validate_index(idx) ⇒ Object



81117
81118
81119
81120
81121
# File 'lib/ropencv/ropencv_types.rb', line 81117

def validate_index(idx)
    if idx < 0 || idx >= size
        raise RangeError,"#{idx} is out of range [0..#{size-1}]"
    end
end