File: SbString.i

package info (click to toggle)
pivy 0.6.10-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,216 kB
  • sloc: python: 36,331; cpp: 787; ansic: 733; makefile: 30; sh: 27; objc: 5
file content (17 lines) | stat: -rw-r--r-- 635 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
%ignore SbString::vsprintf(const char * formatstr, va_list args);

/* add operator overloading methods instead of the global functions */
%extend SbString {      
  int __eq__(const SbString &u) { return *self == u; }
  int __nq__(const SbString &u) { return *self != u; }
  int __eq__(char * u) { return *self == u; }
  int __nq__(char * u) { return *self != u; }
  /* add a method for wrapping c++ operator[] access */
  char __getitem__(int i) { return (*self)[i]; }
  /* iterator for string */
%pythoncode %{
  def __iter__(self):
    return getString().__iter__()
%} 
  const char * __repr__(void) { return self->getString(); }
}