Class: OpenCV::Std::Vector::Std_String
- Inherits:
-
Object
- Object
- OpenCV::Std::Vector::Std_String
- Extended by:
- FFI::DataConverter
- Includes:
- Enumerable
- Defined in:
- lib/ropencv/ropencv_types.rb
Class Method Summary collapse
- .new(*args) ⇒ Object
-
.null ⇒ Object
returns a null pointer to the object.
Instance Method Summary collapse
- #<<(val) ⇒ Object
- #[](idx) ⇒ Std::String
- #at(size) ⇒ Std::String
- #back ⇒ Std::String
- #capacity ⇒ Size_T
- #clear ⇒ Void
- #data ⇒ Void
- #delete_if(&block) ⇒ Object
- #each(&block) ⇒ Object
- #empty ⇒ Bool
- #front ⇒ Std::String
- #get_element ⇒ Std::String
- #pop_back ⇒ Void
- #push_back(other) ⇒ Void
- #reserve(size) ⇒ Void
-
#resize(size, val = Std::String.new()) ⇒ Void
methods.
- #size ⇒ Size_T
- #swap(other) ⇒ Void
-
#to_s ⇒ Object
converts Vector::Std_String into a string by crawling through all its attributes.
- #validate_index(idx) ⇒ Object
Class Method Details
.vector ⇒ Object .vector ⇒ Object
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 |
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
method wrapper for std::string std::vectorstd::string::operator
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
method wrapper for std::string std::vectorstd::string::at(size_t size)
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 |
#back ⇒ Std::String
method wrapper for std::string std::vectorstd::string::back()
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 |
#capacity ⇒ Size_T
method wrapper for size_t std::vectorstd::string::capacity()
81005 81006 81007 81008 |
# File 'lib/ropencv/ropencv_types.rb', line 81005 def capacity() __validate_pointer__ Rbind::std_vector_std_string_capacity( self) end |
#clear ⇒ Void
method wrapper for void std::vectorstd::string::clear()
80998 80999 81000 81001 |
# File 'lib/ropencv/ropencv_types.rb', line 80998 def clear() __validate_pointer__ Rbind::std_vector_std_string_clear( self) end |
#data ⇒ Void
method wrapper for void* std::vectorstd::string::data()
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 |
#empty ⇒ Bool
method wrapper for bool std::vectorstd::string::empty()
81012 81013 81014 81015 |
# File 'lib/ropencv/ropencv_types.rb', line 81012 def empty() __validate_pointer__ Rbind::std_vector_std_string_empty( self) end |
#front ⇒ Std::String
method wrapper for std::string std::vectorstd::string::front()
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_element ⇒ Std::String
method wrapper for std::string std::vectorstd::string::operator
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_back ⇒ Void
method wrapper for void std::vectorstd::string::pop_back()
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
method wrapper for void std::vectorstd::string::push_back(std::string other)
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
method wrapper for void std::vectorstd::string::reserve(size_t size)
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
method wrapper for void std::vectorstd::string::resize(size_t size, std::string val = std::string())
methods
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 |
#size ⇒ Size_T
method wrapper for size_t std::vectorstd::string::size()
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
method wrapper for void std::vectorstd::string::swap(std::vectorstd::string other)
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_s ⇒ Object
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 |