Class: OpenCV::Cv::String
- Inherits:
-
Object
- Object
- OpenCV::Cv::String
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ropencv/ropencv_ruby.rb,
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
- #[](idx) ⇒ Char
- #c_str ⇒ C_string
- #clear ⇒ Void
- #compare(str) ⇒ Fixnum
- #empty ⇒ Bool
- #length ⇒ Size_T
-
#size ⇒ Size_T
methods.
- #swap(str) ⇒ Void
-
#to_s ⇒ Object
converts String into a string by crawling through all its attributes.
Class Method Details
.string ⇒ Object .string(str, length) ⇒ Object .string(other) ⇒ Object
8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 |
# File 'lib/ropencv/ropencv_types.rb', line 8060 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(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 cv::String::String() @@cv_string_string_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@cv_string_string_defaults0[i] end begin return Rbind::cv_string_string(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for cv::String::String(c_string str, size_t length) @@cv_string_string2_defaults1 ||= [nil, nil] if(args.size >= 2 && args.size <= 2) targs = args.clone targs.size.upto(1) do |i| targs[i] = @@cv_string_string2_defaults1[i] end begin return Rbind::cv_string_string2(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for cv::String::String(const cv::String other) @@cv_string_string3_defaults2 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@cv_string_string3_defaults2[i] end begin return Rbind::cv_string_string3(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.null ⇒ Object
returns a null pointer to the object
8048 8049 8050 |
# File 'lib/ropencv/ropencv_types.rb', line 8048 def self.null new(StringStruct.new) end |
Instance Method Details
#[](idx) ⇒ Char
8200 8201 8202 8203 |
# File 'lib/ropencv/ropencv_types.rb', line 8200 def [](idx) __validate_pointer__ Rbind::cv_string_operator_array( self, idx) end |
#c_str ⇒ C_string
Note:
method wrapper for const c_string cv::String::c_str()
8207 8208 8209 8210 |
# File 'lib/ropencv/ropencv_types.rb', line 8207 def c_str() __validate_pointer__ Rbind::cv_stringc_str( self) end |
#clear ⇒ Void
Note:
method wrapper for void cv::String::clear()
8221 8222 8223 8224 |
# File 'lib/ropencv/ropencv_types.rb', line 8221 def clear() __validate_pointer__ Rbind::cv_string_clear( self) end |
#compare(str) ⇒ Fixnum
Note:
method wrapper for int cv::String::compare(const cv::String str)
8229 8230 8231 8232 |
# File 'lib/ropencv/ropencv_types.rb', line 8229 def compare(str) __validate_pointer__ Rbind::cv_string_compare( self, str) end |
#empty ⇒ Bool
Note:
method wrapper for bool cv::String::empty()
8214 8215 8216 8217 |
# File 'lib/ropencv/ropencv_types.rb', line 8214 def empty() __validate_pointer__ Rbind::cv_string_empty( self) end |
#length ⇒ Size_T
Note:
method wrapper for size_t cv::String::length()
8192 8193 8194 8195 |
# File 'lib/ropencv/ropencv_types.rb', line 8192 def length() __validate_pointer__ Rbind::cv_string_length( self) end |
#size ⇒ Size_T
Note:
method wrapper for size_t cv::String::size()
methods
8185 8186 8187 8188 |
# File 'lib/ropencv/ropencv_types.rb', line 8185 def size() __validate_pointer__ Rbind::cv_string_size( self) end |
#swap(str) ⇒ Void
Note:
method wrapper for void cv::String::swap(cv::String& str)
8237 8238 8239 8240 |
# File 'lib/ropencv/ropencv_types.rb', line 8237 def swap(str) __validate_pointer__ Rbind::cv_string_swap( self, str) end |
#to_s ⇒ Object
converts String into a string by crawling through all its attributes
8174 8175 8176 |
# File 'lib/ropencv/ropencv_types.rb', line 8174 def to_s c_str end |