|
From: <bl...@us...> - 2003-04-01 08:32:36
|
Update of /cvsroot/cpptool/rfta/src/pyrfta
In directory sc8-pr-cvs1:/tmp/cvs-serv19848/src/pyrfta
Added Files:
pyrfta.cpp pyrfta.dsp
Log Message:
* added pyrfta: python binding project
--- NEW FILE: pyrfta.cpp ---
#include <boost/python.hpp>
#include <rfta/refactoring/CodeModelStatements.h>
#include <rfta/refactoring/CodeModelExpressions.h>
#include <rfta/refactoring/PlainTextDocument.h>
// Notes: compiler memory allocation limits was reached after declaring two classes.
// => fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit
// Flags /Zm added to command line to increase the memory allocation limits.
using namespace boost::python;
using namespace Refactoring::CodeModel;
using Refactoring::SourceRange;
BOOST_PYTHON_MODULE(pyrfta)
{
class_<Element>( "Element" )
.def( "isFromSource", &Element::isFromSource )
.def( "getSourceText", &Element::getSourceText )
.def( "getSourceRange", &Element::getSourceRange )
// .def( "setSource", &Element::setSource )
.def( "accept", &Element::accept )
;
class_<Change>( "Change" )
.def( init<Change::ChangeType, Refactoring::SourceRange>() )
.def( "wasReplaced", &Change::wasReplaced )
.def( "wasRemoved", &Change::wasRemoved )
.def( "wasAdded", &Change::wasAdded )
.def( "isUnmodified", &Change::isUnmodified )
.def_readwrite( "type", &Change::type_ )
.def_readwrite( "oldRange", &Change::oldRange_ )
;
enum_<Change::ChangeType>( "ChangeType" )
.value( "added", Change::added )
.value( "replaced", Change::replaced )
.value( "removed", Change::removed )
.value( "unmodified", Change::unmodified )
;
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;
*/
}
--- NEW FILE: pyrfta.dsp ---
# Microsoft Developer Studio Project File - Name="pyrfta" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=pyrfta - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "pyrfta.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "pyrfta.mak" CFG="pyrfta - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "pyrfta - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "pyrfta - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "pyrfta - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "BOOST_PYTHON_STATIC_LINK" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BOOST_PYTHON_DYNAMIC_LIB" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40c /d "NDEBUG"
# ADD RSC /l 0x40c /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib python22.lib boost_python.lib /nologo /dll /machine:I386 /libpath:"../../lib" /libpath:"../../deplib/libs"
!ELSEIF "$(CFG)" == "pyrfta - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "BOOST_PYTHON_DYNAMIC_LIB" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /Zm200 /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG"
# ADD RSC /l 0x40c /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib python22.lib boost_python_debug.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"../../lib" /libpath:"../../deplib/libs"
!ENDIF
# Begin Target
# Name "pyrfta - Win32 Release"
# Name "pyrfta - Win32 Debug"
# Begin Source File
SOURCE=.\pyrfta.cpp
# End Source File
# End Target
# End Project
|