@@ -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 ;
@@ -124,14 +149,6 @@ mod ffi {
124
149
#[ rust_name = "qstring_arg" ]
125
150
fn qstringArg ( string : & QString , a : & QString ) -> QString ;
126
151
#[ doc( hidden) ]
127
- #[ rust_name = "qstring_index_of" ]
128
- fn qstringIndexOf (
129
- string : & QString ,
130
- str : & QString ,
131
- from : isize ,
132
- cs : CaseSensitivity ,
133
- ) -> isize ;
134
- #[ doc( hidden) ]
135
152
#[ rust_name = "qstring_insert" ]
136
153
fn qstringInsert < ' a > ( string : & ' a mut QString , pos : isize , str : & QString )
137
154
-> & ' a mut QString ;
@@ -302,12 +319,6 @@ impl QString {
302
319
self . compare_i32 ( other, cs) . cmp ( & 0 )
303
320
}
304
321
305
- /// Returns the index position of the first occurrence of the string str in this string,
306
- /// searching forward from index position from. Returns -1 if str is not found.
307
- pub fn index_of ( & self , str : & QString , from : isize , cs : ffi:: CaseSensitivity ) -> isize {
308
- ffi:: qstring_index_of ( self , str, from, cs)
309
- }
310
-
311
322
/// Inserts the string str at the given index position and returns a mutable reference to this string.
312
323
pub fn insert < ' a > ( & ' a mut self , pos : isize , str : & Self ) -> & ' a mut Self {
313
324
ffi:: qstring_insert ( self , pos, str)
0 commit comments