From: <bl...@us...> - 2003-04-01 08:43:44
|
Update of /cvsroot/cpptool/rfta/src/pyrfta In directory sc8-pr-cvs1:/tmp/cvs-serv26554/src/pyrfta Modified Files: pyrfta.cpp Log Message: * added SourceRange Index: pyrfta.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/pyrfta/pyrfta.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pyrfta.cpp 1 Apr 2003 08:32:27 -0000 1.1 --- pyrfta.cpp 1 Apr 2003 08:43:36 -0000 1.2 *************** *** 42,73 **** class_<SourceRange>( "SourceRange" ) ; - /* - SourceRange(); - - SourceRange( int startIndex, - int length ); - - int getStartIndex() const; - - int getEndIndex() const; - - void moveStartIndexBy( int delta ); - - int getLength() const; - void setLength( int length ); - - bool isEmpty() const; - - bool contains( const SourceRange &other ) const; - - bool overlap( const SourceRange &other ) const; - - bool operator ==( const SourceRange &other ) const; - - bool operator <( const SourceRange &other ) const; - - std::string toString() const; - */ } --- 42,57 ---- class_<SourceRange>( "SourceRange" ) + .def( init<int,int>() ) + .def( "moveStartIndexBy", &SourceRange::moveStartIndexBy ) + .add_property( "startIndex", &SourceRange::getStartIndex ) + .add_property( "endIndex", &SourceRange::getEndIndex ) + .add_property( "length", &SourceRange::getLength, &SourceRange::setLength ) + .def( "isEmpty", &SourceRange::isEmpty ) + .def( "contains", &SourceRange::contains ) + .def( "overlap", &SourceRange::overlap ) + .def( "toString", &SourceRange::toString ) // should use str(self) + .def( self == self ) + .def( self < self ) ; } |