string.pxd 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. # deprecated cimport for backwards compatibility:
  2. from libc.string cimport const_char
  3. cdef extern from "<string>" namespace "std::string" nogil:
  4. const size_t npos
  5. cdef extern from "<string>" namespace "std" nogil:
  6. cdef cppclass string:
  7. cppclass iterator:
  8. iterator()
  9. char& operator*()
  10. iterator(iterator&)
  11. iterator operator++()
  12. iterator operator--()
  13. bint operator==(iterator)
  14. bint operator!=(iterator)
  15. cppclass reverse_iterator:
  16. char& operator*()
  17. iterator operator++()
  18. iterator operator--()
  19. iterator operator+(size_t)
  20. iterator operator-(size_t)
  21. bint operator==(reverse_iterator)
  22. bint operator!=(reverse_iterator)
  23. bint operator<(reverse_iterator)
  24. bint operator>(reverse_iterator)
  25. bint operator<=(reverse_iterator)
  26. bint operator>=(reverse_iterator)
  27. cppclass const_iterator(iterator):
  28. pass
  29. cppclass const_reverse_iterator(reverse_iterator):
  30. pass
  31. string() except +
  32. string(const string& s) except +
  33. string(const string& s, size_t pos) except +
  34. string(const string& s, size_t pos, size_t len) except +
  35. string(const char* s) except +
  36. string(const char* s, size_t n) except +
  37. string(size_t n, char c) except +
  38. string(iterator first, iterator last) except +
  39. iterator begin()
  40. const_iterator const_begin "begin"()
  41. iterator end()
  42. const_iterator const_end "end"()
  43. reverse_iterator rbegin()
  44. const_reverse_iterator const_rbegin "rbegin"()
  45. reverse_iterator rend()
  46. const_reverse_iterator const_rend "rend"()
  47. const char* c_str()
  48. const char* data()
  49. size_t size()
  50. size_t max_size()
  51. size_t length()
  52. void resize(size_t) except +
  53. void resize(size_t, char) except +
  54. void shrink_to_fit() except +
  55. size_t capacity()
  56. void reserve(size_t) except +
  57. void clear()
  58. bint empty()
  59. iterator erase(iterator first, iterator last)
  60. iterator erase(iterator p)
  61. iterator erase(const_iterator first, const_iterator last)
  62. iterator erase(const_iterator p)
  63. string& erase(size_t pos, size_t len) except +
  64. string& erase(size_t pos) except +
  65. string& erase() except +
  66. char& at(size_t pos) except +
  67. char& operator[](size_t pos)
  68. char& front()
  69. char& back()
  70. int compare(const string& s)
  71. int compare(size_t pos, size_t len, const string& s) except +
  72. int compare(size_t pos, size_t len, const string& s, size_t subpos, size_t sublen) except +
  73. int compare(const char* s) except +
  74. int compare(size_t pos, size_t len, const char* s) except +
  75. int compare(size_t pos, size_t len, const char* s , size_t n) except +
  76. string& append(const string& s) except +
  77. string& append(const string& s, size_t subpos, size_t sublen) except +
  78. string& append(const char* s) except +
  79. string& append(const char* s, size_t n) except +
  80. string& append(size_t n, char c) except +
  81. void push_back(char c) except +
  82. void pop_back()
  83. string& assign(const string& s) except +
  84. string& assign(const string& s, size_t subpos, size_t sublen) except +
  85. string& assign(const char* s, size_t n) except +
  86. string& assign(const char* s) except +
  87. string& assign(size_t n, char c) except +
  88. string& insert(size_t pos, const string& s, size_t subpos, size_t sublen) except +
  89. string& insert(size_t pos, const string& s) except +
  90. string& insert(size_t pos, const char* s, size_t n) except +
  91. string& insert(size_t pos, const char* s) except +
  92. string& insert(size_t pos, size_t n, char c) except +
  93. void insert(iterator p, size_t n, char c) except +
  94. iterator insert(iterator p, char c) except +
  95. size_t copy(char* s, size_t len, size_t pos) except +
  96. size_t copy(char* s, size_t len) except +
  97. size_t find(const string& s, size_t pos)
  98. size_t find(const string& s)
  99. size_t find(const char* s, size_t pos, size_t n)
  100. size_t find(const char* s, size_t pos)
  101. size_t find(const char* s)
  102. size_t find(char c, size_t pos)
  103. size_t find(char c)
  104. size_t rfind(const string&, size_t pos)
  105. size_t rfind(const string&)
  106. size_t rfind(const char* s, size_t pos, size_t n)
  107. size_t rfind(const char* s, size_t pos)
  108. size_t rfind(const char* s)
  109. size_t rfind(char c, size_t pos)
  110. size_t rfind(char c)
  111. size_t find_first_of(const string&, size_t pos)
  112. size_t find_first_of(const string&)
  113. size_t find_first_of(const char* s, size_t pos, size_t n)
  114. size_t find_first_of(const char* s, size_t pos)
  115. size_t find_first_of(const char* s)
  116. size_t find_first_of(char c, size_t pos)
  117. size_t find_first_of(char c)
  118. size_t find_first_not_of(const string& s, size_t pos)
  119. size_t find_first_not_of(const string& s)
  120. size_t find_first_not_of(const char* s, size_t pos, size_t n)
  121. size_t find_first_not_of(const char* s, size_t pos)
  122. size_t find_first_not_of(const char*)
  123. size_t find_first_not_of(char c, size_t pos)
  124. size_t find_first_not_of(char c)
  125. size_t find_last_of(const string& s, size_t pos)
  126. size_t find_last_of(const string& s)
  127. size_t find_last_of(const char* s, size_t pos, size_t n)
  128. size_t find_last_of(const char* s, size_t pos)
  129. size_t find_last_of(const char* s)
  130. size_t find_last_of(char c, size_t pos)
  131. size_t find_last_of(char c)
  132. size_t find_last_not_of(const string& s, size_t pos)
  133. size_t find_last_not_of(const string& s)
  134. size_t find_last_not_of(const char* s, size_t pos, size_t n)
  135. size_t find_last_not_of(const char* s, size_t pos)
  136. size_t find_last_not_of(const char* s)
  137. size_t find_last_not_of(char c, size_t pos)
  138. size_t find_last_not_of(char c)
  139. string substr(size_t pos, size_t len) except +
  140. string substr(size_t pos) except +
  141. string substr()
  142. #string& operator= (const string&)
  143. #string& operator= (const char*)
  144. #string& operator= (char)
  145. string operator+ (const string&) except +
  146. string operator+ (const char*) except +
  147. bint operator==(const string&)
  148. bint operator==(const char*)
  149. bint operator!= (const string&)
  150. bint operator!= (const char*)
  151. bint operator< (const string&)
  152. bint operator< (const char*)
  153. bint operator> (const string&)
  154. bint operator> (const char*)
  155. bint operator<= (const string&)
  156. bint operator<= (const char*)
  157. bint operator>= (const string&)
  158. bint operator>= (const char*)
  159. string to_string(int val) except +
  160. string to_string(long val) except +
  161. string to_string(long long val) except +
  162. string to_string(unsigned val) except +
  163. string to_string(size_t val) except +
  164. string to_string(ssize_t val) except +
  165. string to_string(unsigned long val) except +
  166. string to_string(unsigned long long val) except +
  167. string to_string(float val) except +
  168. string to_string(double val) except +
  169. string to_string(long double val) except +
  170. int stoi(const string& s, size_t* idx, int base) except +
  171. int stoi(const string& s, size_t* idx) except +
  172. int stoi(const string& s) except +
  173. long stol(const string& s, size_t* idx, int base) except +
  174. long stol(const string& s, size_t* idx) except +
  175. long stol(const string& s) except +
  176. long long stoll(const string& s, size_t* idx, int base) except +
  177. long long stoll(const string& s, size_t* idx) except +
  178. long long stoll(const string& s) except +
  179. unsigned long stoul(const string& s, size_t* idx, int base) except +
  180. unsigned long stoul(const string& s, size_t* idx) except +
  181. unsigned long stoul(const string& s) except +
  182. unsigned long long stoull(const string& s, size_t* idx, int base) except +
  183. unsigned long long stoull(const string& s, size_t* idx) except +
  184. unsigned long long stoull(const string& s) except +
  185. float stof(const string& s, size_t* idx) except +
  186. float stof(const string& s) except +
  187. double stod(const string& s, size_t* idx) except +
  188. double stod(const string& s) except +
  189. long double stold(const string& s, size_t* idx) except +
  190. long double stold(const string& s) except +