@@ -17,6 +17,14 @@ mod ffi {
17
17
type SplitBehaviorFlags = crate :: SplitBehaviorFlags ;
18
18
}
19
19
20
+ #[ cfg( cxxqt_qt_version_major = "6" ) ]
21
+ unsafe extern "C++" {
22
+ include ! ( "cxx-qt-lib/qtypes.h" ) ;
23
+
24
+ #[ cxx_name = "qsizetype" ]
25
+ type QSizeType = crate :: QSizeType ;
26
+ }
27
+
20
28
unsafe extern "C++" {
21
29
include ! ( "cxx-qt-lib/qbytearray.h" ) ;
22
30
type QByteArray = crate :: QByteArray ;
@@ -43,6 +51,23 @@ mod ffi {
43
51
#[ rust_name = "ends_with" ]
44
52
fn endsWith ( self : & QString , s : & QString , cs : CaseSensitivity ) -> bool ;
45
53
54
+ /// Returns the index position of the first occurrence of the string str in this string,
55
+ /// searching forward from index position from. Returns -1 if str is not found.
56
+ #[ cfg( cxxqt_qt_version_major = "5" ) ]
57
+ #[ rust_name = "index_of" ]
58
+ fn indexOf ( self : & QString , str : & QString , from : i32 , cs : CaseSensitivity ) -> i32 ;
59
+
60
+ /// Returns the index position of the first occurrence of the string str in this string,
61
+ /// searching forward from index position from. Returns -1 if str is not found.
62
+ #[ cfg( cxxqt_qt_version_major = "6" ) ]
63
+ #[ rust_name = "index_of" ]
64
+ fn indexOf (
65
+ self : & QString ,
66
+ str : & QString ,
67
+ from : QSizeType ,
68
+ cs : CaseSensitivity ,
69
+ ) -> QSizeType ;
70
+
46
71
/// Returns true if the string has no characters; otherwise returns false.
47
72
#[ rust_name = "is_empty" ]
48
73
fn isEmpty ( self : & QString ) -> bool ;
@@ -136,14 +161,6 @@ mod ffi {
136
161
#[ rust_name = "qstring_arg" ]
137
162
fn qstringArg ( string : & QString , a : & QString ) -> QString ;
138
163
#[ doc( hidden) ]
139
- #[ rust_name = "qstring_index_of" ]
140
- fn qstringIndexOf (
141
- string : & QString ,
142
- str : & QString ,
143
- from : isize ,
144
- cs : CaseSensitivity ,
145
- ) -> isize ;
146
- #[ doc( hidden) ]
147
164
#[ rust_name = "qstring_insert" ]
148
165
fn qstringInsert < ' a > ( string : & ' a mut QString , pos : isize , str : & QString )
149
166
-> & ' a mut QString ;
@@ -337,12 +354,6 @@ impl QString {
337
354
self . compare_i32 ( other, cs) . cmp ( & 0 )
338
355
}
339
356
340
- /// Returns the index position of the first occurrence of the string str in this string,
341
- /// searching forward from index position from. Returns -1 if str is not found.
342
- pub fn index_of ( & self , str : & QString , from : isize , cs : ffi:: CaseSensitivity ) -> isize {
343
- ffi:: qstring_index_of ( self , str, from, cs)
344
- }
345
-
346
357
/// Inserts the string str at the given index position and returns a mutable reference to this string.
347
358
pub fn insert < ' a > ( & ' a mut self , pos : isize , str : & Self ) -> & ' a mut Self {
348
359
ffi:: qstring_insert ( self , pos, str)
0 commit comments