You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(15) |
Feb
(26) |
Mar
(97) |
Apr
(224) |
May
(226) |
Jun
|
Jul
(3) |
Aug
(22) |
Sep
(48) |
Oct
|
Nov
|
Dec
(38) |
2004 |
Jan
(28) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(37) |
Jul
|
Aug
(73) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <bl...@us...> - 2003-05-11 17:53:13
|
Update of /cvsroot/cpptool/rfta/src/rftavc7addin/exploration In directory sc8-pr-cvs1:/tmp/cvs-serv22820/exploration Added Files: Exploration.vb MacroTest.cpp Log Message: * squeleton for a VC7 plug-in. The toolbar and a menu are added to VC7 interface. Though icones are not displayed. A dialog box is displayed when the command is activated. --- NEW FILE: Exploration.vb --- Imports EnvDTE Imports System.Diagnostics Public Module Module1 ' Test: how to get the current selection ' Retrieving the TextSelection, its property AnchorPoint and ActivePoint are VirtualPoint. ' The offset in number of character from the beginning of the document is in the ' AbsoluteCharOffset property of a VirtualPoint object. It is 1 based (begin of doc = offset 1) Sub TestEditPoint() Dim doc As Document = DTE.ActiveDocument Dim sel As TextSelection = doc.Selection Dim startPoint As VirtualPoint = sel.AnchorPoint Dim endPoint As VirtualPoint = sel.ActivePoint MsgBox("Start: " & startPoint.AbsoluteCharOffset & ", End: " & endPoint.AbsoluteCharOffset) End Sub Sub TestReplaceText() Dim doc As TextDocument = DTE.ActiveDocument.Object Dim point As EditPoint = doc.CreateEditPoint() point.MoveToAbsoluteOffset(5) point.Delete(4) point.MoveToAbsoluteOffset(12 + 4 - 5) point.Delete(4) 'point.MoveToAbsoluteOffset(5) 'point.Insert("5678") 'point.MoveToAbsoluteOffset(12 + 4) 'point.Insert("4567") End Sub ' The UndoContext given by DTE can be used to group command so that a ' single undo undo them all. ' The name passed to the Open method is the name displayed in the undo ' Combobox. ' The UndoContext should only be Open/Close if not yet Open (meaning ' we are already within a command group) Sub TestUndoCommandGroup() Dim undo As UndoContext = DTE.UndoContext Dim wasOpen As Boolean = undo.IsOpen If wasOpen = False Then undo.Open("Test undo command group", False) End If TestReplaceText() If wasOpen = False Then undo.Close() End If End Sub Sub TestUndoSubCommandGroup() Dim undo As UndoContext = DTE.UndoContext undo.Open("Test undo command group", False) TestReplaceText() TestUndoCommandGroup() undo.Close() End Sub End Module --- NEW FILE: MacroTest.cpp --- 0123456789 abcdefghij 9876543210 jihgfedcba ABCDEFGHIJ JIHGFEDCBA |
From: <bl...@us...> - 2003-05-11 17:53:13
|
Update of /cvsroot/cpptool/rfta/src/rftavc7addin In directory sc8-pr-cvs1:/tmp/cvs-serv22820 Added Files: AddIn.cpp AddIn.def AddIn.idl AddIn.rc AddIn.rgs Connect.cpp Connect.h HowToDebugVc7AddIn.txt ReCreateCommands.reg Resource.h rftavc7addin.vcproj stdafx.cpp stdafx.h Log Message: * squeleton for a VC7 plug-in. The toolbar and a menu are added to VC7 interface. Though icones are not displayed. A dialog box is displayed when the command is activated. --- NEW FILE: AddIn.cpp --- // AddIn.cpp : Implementation of DLL Exports. #include "stdafx.h" #include "resource.h" #include "AddIn.h" CAddInModule _AtlModule; // DLL Entry Point extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { _AtlModule.SetResourceInstance(hInstance); return _AtlModule.DllMain(dwReason, lpReserved); } // Used to determine whether the DLL can be unloaded by OLE STDAPI DllCanUnloadNow(void) { return _AtlModule.DllCanUnloadNow(); } // Returns a class factory to create an object of the requested type STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { return _AtlModule.DllGetClassObject(rclsid, riid, ppv); } // DllRegisterServer - Adds entries to the system registry STDAPI DllRegisterServer(void) { // registers object, typelib and all interfaces in typelib HRESULT hr = _AtlModule.DllRegisterServer(); return hr; } // DllUnregisterServer - Removes entries from the system registry STDAPI DllUnregisterServer(void) { HRESULT hr = _AtlModule.DllUnregisterServer(); return hr; } --- NEW FILE: AddIn.def --- ; AddIn.def : Declares the module parameters. EXPORTS DllCanUnloadNow PRIVATE DllGetClassObject PRIVATE DllRegisterServer PRIVATE DllUnregisterServer PRIVATE --- NEW FILE: AddIn.idl --- // AddIn.idl : IDL source for AddIn // // This file will be processed by the MIDL tool to // produce the type library (AddIn.tlb) and marshalling code. import "oaidl.idl"; import "ocidl.idl"; [ uuid(9D079750-4251-4722-8E52-E8296A611AE8), version(1.0), helpstring("rftavc7addin 1.0 Type Library") ] library rftavc7addinLib { importlib("stdole2.tlb"); [ uuid(D723FA07-0D64-42F6-AC68-127BC7DF3898), helpstring("Connect Class") ] coclass Connect { [default] interface IUnknown; }; }; --- NEW FILE: AddIn.rc --- // Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "winres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""winres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "1 TYPELIB ""AddIn.tlb""\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1,0,0,1 PRODUCTVERSION 1,0,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x4L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "TODO: <Company name>" VALUE "FileDescription", "TODO: <File description>" VALUE "FileVersion", "1.0.0.1" VALUE "LegalCopyright", "TODO: (c) <Company name>. All rights reserved." VALUE "InternalName", "AddIn.dll" VALUE "OriginalFilename", "AddIn.dll" VALUE "ProductName", "TODO: <Product name>" VALUE "ProductVersion", "1.0.0.1" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END ///////////////////////////////////////////////////////////////////////////// // // REGISTRY // IDR_ADDIN REGISTRY "AddIn.rgs" ///////////////////////////////////////////////////////////////////////////// // // String Table // STRINGTABLE BEGIN IDS_PROJNAME "AddIn" END #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // French (France) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) #ifdef _WIN32 LANGUAGE LANG_FRENCH, SUBLANG_FRENCH #pragma code_page(1252) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Bitmap // IDB_RENAMELOCALEVARIABLE BITMAP "res\\renamelocale.bmp" IDB_INLINELOCALEVARIABLE BITMAP "res\\inlinelocale.bmp" IDB_SPLITLOCALEVARIABLE BITMAP "res\\splitlocale.bmp" IDB_REDUCELOCALEVARIABLESCOPE BITMAP "res\\reducescope.bmp" #endif // French (France) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // 1 TYPELIB "AddIn.tlb" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED --- NEW FILE: AddIn.rgs --- HKCR { RFTA.1 = s 'Connect Class' { CLSID = s '{D723FA07-0D64-42F6-AC68-127BC7DF3898}' } RFTA = s 'Connect Class' { CLSID = s '{D723FA07-0D64-42F6-AC68-127BC7DF3898}' CurVer = s 'RFTA.1' } NoRemove CLSID { ForceRemove '{D723FA07-0D64-42F6-AC68-127BC7DF3898}' = s 'Connect Class' { ProgID = s 'RFTA.1' VersionIndependentProgID = s 'RFTA' ForceRemove 'Programmable' InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' } 'TypeLib' = s '{9D079750-4251-4722-8E52-E8296A611AE8}' } } } --- NEW FILE: Connect.cpp --- // Connect.cpp : Implementation of CConnect #include "stdafx.h" #include "AddIn.h" #include "Connect.h" extern CAddInModule _AtlModule; // When run, the Add-in wizard prepared the registry for the Add-in. // At a later time, if the Add-in becomes unavailable for reasons such as: // 1) You moved this project to a computer other than which is was originally created on. // 2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in. // 3) Registry corruption. // you will need to re-register the Add-in by building the MyAddin21Setup project // by right clicking the project in the Solution Explorer, then choosing install. /* CComBSTR("rftavc7addin"), CComBSTR("rftavc7addin"), CComBSTR("Executes the command for rftavc7addin"), VARIANT_TRUE, 59, NULL, EnvDTE::vsCommandStatusSupported+EnvDTE::vsCommandStatusEnabled, &pCreatedCommand)) && (pCreatedCommand)) class NamedCommand { public: CComPtr<EnvDTE::Command> add( const CComPtr<EnvDTE::AddIn> &addIn ) { CComPtr<EnvDTE::Command> command; HRESULT hr = } CComBSTR name_; CComBSTR buttonText_; CComBSTR toolTip_; VARIANT_BOOL msOfficeButton_; long bitmapId_; bool disableFlags_; }; */ #include <stdexcept> class IDTCallError : public std::runtime_error { public: IDTCallError( HRESULT hr ) : std::runtime_error( "IDT call failed" ) , hresult_( hr ) { } HRESULT hresult_; }; inline void checkIDTCall( HRESULT hresult ) { if ( !SUCCEEDED( hresult ) ) throw IDTCallError( hresult ); } void removeCommand( EnvDTE::Commands &commands, const wchar_t *commandName ) { CComBSTR fullCommandName = "RFTA."; fullCommandName += commandName; CComPtr<EnvDTE::Command> pExistingCommand; HRESULT hr = commands.Item( CComVariant( fullCommandName ), 0, &pExistingCommand ); if ( SUCCEEDED(hr) && pExistingCommand ) pExistingCommand->Delete(); } // CConnect STDMETHODIMP CConnect::OnConnection(IDispatch *pApplication, AddInDesignerObjects::ext_ConnectMode ConnectMode, IDispatch *pAddInInst, SAFEARRAY ** /*custom*/ ) { // AFX_MANAGE_STATE(AfxGetStaticModuleState()); // _asm int 3; // comment this out to force an assertion when loading the add-in. HRESULT hr = S_OK; pApplication->QueryInterface(__uuidof(EnvDTE::_DTE), (LPVOID*)&m_pDTE); pAddInInst->QueryInterface(__uuidof(EnvDTE::AddIn), (LPVOID*)&m_pAddInInstance); if(ConnectMode != 5) //5 == AddInDesignerObjects::ext_cm_UISetup) return S_OK; try { CComPtr<EnvDTE::Commands> pCommands; CComPtr<EnvDTE::Command> pCreatedCommand; checkIDTCall( m_pDTE->get_Commands( &pCommands ) ); // Removes existing command (so we can add some as the add-in is updated). // => notes will need to store command name somewhere. removeCommand( *pCommands, L"RenameLocaleVariable" ); removeCommand( *pCommands, L"InlineLocaleVariable" ); removeCommand( *pCommands, L"SplitLocaleVariable" ); removeCommand( *pCommands, L"ReduceLocaleVariableScope" ); CComPtr<EnvDTE::Command> cmdRename = addCommand( *pCommands, L"RenameLocaleVariable", L"Rename locale variable", L"Rename the selected locale variable", IDB_RENAMELOCALEVARIABLE ); CComPtr<EnvDTE::Command> cmdInline = addCommand( *pCommands, L"InlineLocaleVariable", L"Inline locale variable", L"Inline the selected locale variable", IDB_INLINELOCALEVARIABLE ); CComPtr<EnvDTE::Command> cmdSplit = addCommand( *pCommands, L"SplitLocaleVariable", L"Split locale variable", L"Split the selected locale variable declaration", IDB_SPLITLOCALEVARIABLE ); CComPtr<EnvDTE::Command> cmdReduce = addCommand( *pCommands, L"ReduceLocaleVariableScope", L"Reduce locale variable scope", L"Reduce the scope of the selected local variable", IDB_REDUCELOCALEVARIABLESCOPE ); CComPtr<Office::CommandBar> pToolBar = ensureToolBarExist( *pCommands, L"C++ Refactoring Assistant", EnvDTE::vsCommandBarTypeToolbar ); CComPtr<Office::CommandBar> pMenuBar = ensureToolBarExist( *pCommands, L"Refactoring", EnvDTE::vsCommandBarTypeMenu ); int index = 1; associateCommand( cmdRename, pToolBar, pMenuBar, index++ ); associateCommand( cmdInline, pToolBar, pMenuBar, index++ ); associateCommand( cmdSplit, pToolBar, pMenuBar, index++ ); associateCommand( cmdReduce, pToolBar, pMenuBar, index++ ); /* // The stuff below register the command in a menu named "Tool". We might want to do that too. CComPtr<Office::_CommandBars> pCommandBars; CComPtr<Office::CommandBarControl> pCommandBarControl; CComPtr<Office::CommandBar> pMenuBarCommandBar; // When run, the Add-in wizard prepared the registry for the Add-in. // At a later time, the Add-in or its commands may become unavailable for reasons such as: // 1) You moved this project to a computer other than which is was originally created on. // 2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in. // 3) You add new commands or modify commands already defined. // You will need to re-register the Add-in by building the rftavc7addinSetup project, // right-clicking the project in the Solution Explorer, and then choosing install. // Alternatively, you could execute the ReCreateCommands.reg file the Add-in Wizard generated in // the project directory, or run 'devenv /setup' from a command prompt. IfFailGoCheck(m_pDTE->get_Commands(&pCommands), pCommands); if(SUCCEEDED(pCommands->AddNamedCommand(m_pAddInInstance, CComBSTR("RFTARenameLocaleVariable"), CComBSTR("RFTARenameLocaleVariable"), CComBSTR("Rename the selected locale variable"), VARIANT_TRUE, 59, NULL, EnvDTE::vsCommandStatusSupported+EnvDTE::vsCommandStatusEnabled, &pCreatedCommand)) && (pCreatedCommand)) { //Add a button to the tools menu bar. IfFailGoCheck(m_pDTE->get_CommandBars(&pCommandBars), pCommandBars); IfFailGoCheck(pCommandBars->get_Item(CComVariant(L"Tools"), &pMenuBarCommandBar), pMenuBarCommandBar); IfFailGoCheck(pCreatedCommand->AddControl(pMenuBarCommandBar, 1, &pCommandBarControl), pCommandBarControl); } */ return S_OK; } catch ( const IDTCallError &e ) { /* CString message; message.Format( "C++ Refactoring Assistant initialization failed with code: %x", e.hresult_ ); MessageBox( 0, message, "Initialization failed", MB_OK ); */ return e.hresult_; } } CComPtr<EnvDTE::Command> CConnect::addCommand( EnvDTE::Commands &commands, const CComBSTR &commandName, const CComBSTR &commandButtonText, const CComBSTR &commandToolTip, int commandBitmapID ) { CComPtr<EnvDTE::Command> pCreatedCommand; checkIDTCall( commands.AddNamedCommand( m_pAddInInstance, commandName, commandButtonText, commandToolTip, VARIANT_FALSE, commandBitmapID, NULL, EnvDTE::vsCommandStatusSupported + EnvDTE::vsCommandStatusEnabled, &pCreatedCommand ) ); return pCreatedCommand; } CComPtr<Office::CommandBar> CConnect::ensureToolBarExist( EnvDTE::Commands &commands, const CComBSTR &toolBarName, EnvDTE::vsCommandBarType commandBarType ) { CComQIPtr<Office::CommandBar> pToolbar; CComPtr<Office::_CommandBars> pCommandBars; checkIDTCall( m_pDTE->get_CommandBars( &pCommandBars ) ); HRESULT hr = pCommandBars->get_Item( CComVariant( toolBarName ), &pToolbar ); if ( SUCCEEDED(hr) ) // the toolbar already exist, make it visible pToolbar->put_Visible(VARIANT_TRUE); else // the toolbar has not been created yet { CComPtr<Office::CommandBar> pMenubar; if ( commandBarType == EnvDTE::vsCommandBarTypeMenu ) // get top level menu bar checkIDTCall( pCommandBars->get_Item( CComVariant( "MenuBar" ), &pMenubar ) ); CComPtr<IDispatch> pDisp; checkIDTCall( commands.AddCommandBar( (LPWSTR)toolBarName, commandBarType, pMenubar, 4, &pDisp ) ); pToolbar = pDisp; // returned object is not a Office::CommandBar if ( pToolbar == NULL ) throw IDTCallError( E_FAIL ); pToolbar->put_Visible(VARIANT_TRUE); } return pToolbar; } void CConnect::associateCommand( const CComPtr<EnvDTE::Command> &pCommand, const CComPtr<Office::CommandBar> &pToolBar, const CComPtr<Office::CommandBar> &pMenuBar, int index ) { { CComPtr<Office::CommandBarControl> pCommandBarControl; HRESULT hr = pCommand->AddControl( pToolBar, index, &pCommandBarControl ); if ( SUCCEEDED(hr) ) { // make it image only CComQIPtr<Office::_CommandBarButton> pButton( pCommandBarControl ); if ( pButton ) pButton->put_Style( Office::msoButtonIcon ); } } { CComPtr<Office::CommandBarControl> pCommandBarControl; pCommand->AddControl( pMenuBar, index, &pCommandBarControl ); } } STDMETHODIMP CConnect::OnDisconnection(AddInDesignerObjects::ext_DisconnectMode /*RemoveMode*/, SAFEARRAY ** /*custom*/ ) { m_pDTE = NULL; return S_OK; } STDMETHODIMP CConnect::OnAddInsUpdate (SAFEARRAY ** /*custom*/ ) { return S_OK; } STDMETHODIMP CConnect::OnStartupComplete (SAFEARRAY ** /*custom*/ ) { return S_OK; } STDMETHODIMP CConnect::OnBeginShutdown (SAFEARRAY ** /*custom*/ ) { return S_OK; } STDMETHODIMP CConnect::QueryStatus( BSTR bstrCmdName, EnvDTE::vsCommandStatusTextWanted NeededText, EnvDTE::vsCommandStatus *pStatusOption, VARIANT *pvarCommandText ) { if(NeededText == EnvDTE::vsCommandStatusTextWantedNone) { CComBSTR commandName = bstrCmdName; // ::MessageBoxW( 0, commandName, commandName, MB_OK ); // CComBSTR commandName = bstrCmdName; bool enable = false; enable = ( commandName == L"RFTA.RenameLocaleVariable" ) || ( commandName == L"RFTA.InlineLocaleVariable" ) || ( commandName == L"RFTA.SplitLocaleVariable" ) || ( commandName == L"RFTA.ReduceLocaleVariableScope" ); if ( enable ) *pStatusOption = (EnvDTE::vsCommandStatus)(EnvDTE::vsCommandStatusEnabled+EnvDTE::vsCommandStatusSupported); // if(!_wcsicmp(bstrCmdName, L"rftavc7addin.Connect.RFTARenameLocaleVariable")) // { // *pStatusOption = (EnvDTE::vsCommandStatus)(EnvDTE::vsCommandStatusEnabled+EnvDTE::vsCommandStatusSupported); // } } return S_OK; } // Implements IDTCommandTarget STDMETHODIMP CConnect::Exec(BSTR bstrCmdName, EnvDTE::vsCommandExecOption ExecuteOption, VARIANT * /*pvarVariantIn*/, VARIANT * /*pvarVariantOut*/, VARIANT_BOOL *pvbHandled) { *pvbHandled = VARIANT_FALSE; if(ExecuteOption == EnvDTE::vsCommandExecOptionDoDefault) { CComBSTR commandName = bstrCmdName; ::MessageBoxW( 0, commandName, commandName, MB_OK ); *pvbHandled = VARIANT_TRUE; //if(!_wcsicmp(bstrCmdName, L"RFTA.RenameLocaleVariable")) //{ // *pvbHandled = VARIANT_TRUE; // return S_OK; //} } return S_OK; } --- NEW FILE: Connect.h --- // Connect.h : Declaration of the CConnect #pragma once #include "resource.h" // main symbols #pragma warning( disable : 4278 ) //The following #import imports DTE based on it's LIBID #import "libid:80cc9f66-e7d8-4ddd-85b6-d9e6cd0e93e2" version("7.0") lcid("0") raw_interfaces_only named_guids #pragma warning( default : 4278 ) // CConnect class ATL_NO_VTABLE CConnect : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CConnect, &CLSID_Connect>, public IDispatchImpl<EnvDTE::IDTCommandTarget, &EnvDTE::IID_IDTCommandTarget, &EnvDTE::LIBID_EnvDTE, 7, 0>, public IDispatchImpl<AddInDesignerObjects::_IDTExtensibility2, &AddInDesignerObjects::IID__IDTExtensibility2, &AddInDesignerObjects::LIBID_AddInDesignerObjects, 1, 0> { public: CConnect() { } DECLARE_REGISTRY_RESOURCEID(IDR_ADDIN) DECLARE_NOT_AGGREGATABLE(CConnect) BEGIN_COM_MAP(CConnect) COM_INTERFACE_ENTRY(AddInDesignerObjects::IDTExtensibility2) COM_INTERFACE_ENTRY(EnvDTE::IDTCommandTarget) COM_INTERFACE_ENTRY2(IDispatch, AddInDesignerObjects::IDTExtensibility2) END_COM_MAP() DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } public: //IDTExtensibility2 implementation: STDMETHOD(OnConnection)(IDispatch * Application, AddInDesignerObjects::ext_ConnectMode ConnectMode, IDispatch *AddInInst, SAFEARRAY **custom); STDMETHOD(OnDisconnection)(AddInDesignerObjects::ext_DisconnectMode RemoveMode, SAFEARRAY **custom ); STDMETHOD(OnAddInsUpdate)(SAFEARRAY **custom ); STDMETHOD(OnStartupComplete)(SAFEARRAY **custom ); STDMETHOD(OnBeginShutdown)(SAFEARRAY **custom ); //IDTCommandTarget implementation: STDMETHOD(QueryStatus)(BSTR CmdName, EnvDTE::vsCommandStatusTextWanted NeededText, EnvDTE::vsCommandStatus *StatusOption, VARIANT *CommandText); STDMETHOD(Exec)(BSTR CmdName, EnvDTE::vsCommandExecOption ExecuteOption, VARIANT *VariantIn, VARIANT *VariantOut, VARIANT_BOOL *Handled); CComPtr<EnvDTE::_DTE> m_pDTE; CComPtr<EnvDTE::AddIn> m_pAddInInstance; private: CComPtr<EnvDTE::Command> addCommand( EnvDTE::Commands &commands, const CComBSTR &commandName, const CComBSTR &commandButtonText, const CComBSTR &commandToolTip, int commandBitmapID ); CComPtr<Office::CommandBar> ensureToolBarExist( EnvDTE::Commands &commands, const CComBSTR &toolBarName, EnvDTE::vsCommandBarType commandBarType ); void associateCommand( const CComPtr<EnvDTE::Command> &pCommand, const CComPtr<Office::CommandBar> &pToolBar, const CComPtr<Office::CommandBar> &pMenuBar, int index ); }; OBJECT_ENTRY_AUTO(__uuidof(Connect), CConnect) --- NEW FILE: HowToDebugVc7AddIn.txt --- * To debug VC7 initialization (inital call to OnConnection()): - comment out the statement '_asm int 3;' at the begining of OnConnection() - compile - You must keep an instance of VC7 running. - Install the debug add-in - Run the ReCreateCommands.reg registry script, this will tell VC7 to reinitialize the add-in on the next startup. - Launch a *NEW* instance of VC7. A message box will appears telling you an exception occured. - Choose 'Cancel' to debug. A new dialog box appear asking you to select the debug to use. DO NOT select 'New instance', choose the already running instance of VC7. - The already running instance of VC7 will ask you wether you want to break or continue. Choose break to debug. * To debug after initialization (command execution): - add the statement '_asm int 3;' were you want to start debugging. This will force a break to occurs. - Follow the step above, but you don't have to bother having an already running VC7 as you can easily launch a new one. --- NEW FILE: ReCreateCommands.reg --- REGEDIT4 [HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSA\7.0\PreloadAddinState] "RFTA"=dword:1 [HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\7.0\PreloadAddinState] "RFTA"=dword:1 --- NEW FILE: Resource.h --- //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by AddIn.rc // #define IDS_PROJNAME 100 #define IDR_ADDIN 101 #define IDR_CONNECT 102 #define IDB_RENAMELOCALEVARIABLE 201 #define IDB_INLINELOCALEVARIABLE 202 #define IDB_SPLITLOCALEVARIABLE 203 #define IDB_INLINELOCALEVARIABLE1 204 #define IDB_REDUCELOCALEVARIABLESCOPE 204 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 202 #define _APS_NEXT_COMMAND_VALUE 32768 #define _APS_NEXT_CONTROL_VALUE 201 #define _APS_NEXT_SYMED_VALUE 103 #endif #endif --- NEW FILE: rftavc7addin.vcproj --- <?xml version="1.0" encoding = "Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.00" Name="rftavc7addin" ProjectGUID="{10EDA388-9FAF-4920-8E31-83879630241C}" Keyword="AtlProj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="2" UseOfMFC="2" UseOfATL="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" RegisterOutput="TRUE" IgnoreImportLibrary="TRUE" OutputFile="$(OutDir)/$(ProjectName).dll" LinkIncremental="2" ModuleDefinitionFile=".\AddIn.def" GenerateDebugInformation="TRUE" SubSystem="2" ImportLibrary="$(OutDir)/$(ProjectName).lib" TargetMachine="1"/> <Tool Name="VCMIDLTool" PreprocessorDefinitions="_DEBUG" MkTypLibCompatible="FALSE" TargetEnvironment="1" GenerateStublessProxies="TRUE" TypeLibraryName="$(IntDir)/AddIn.tlb" HeaderFileName="AddIn.h" DLLDataFileName="" InterfaceIdentifierFileName="AddIn_i.c" ProxyFileName="AddIn_p.c"/> <Tool Name="VCPostBuildEventTool" Description="Performing registration" CommandLine="regsvr32 /s /c "$(TargetPath)""/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" AdditionalIncludeDirectories="$(IntDir)"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="2" UseOfMFC="2" UseOfATL="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL" StringPooling="TRUE" MinimalRebuild="TRUE" RuntimeLibrary="2" EnableFunctionLevelLinking="TRUE" ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" RegisterOutput="TRUE" IgnoreImportLibrary="TRUE" OutputFile="$(OutDir)/$(ProjectName).dll" LinkIncremental="2" ModuleDefinitionFile=".\AddIn.def" GenerateDebugInformation="TRUE" SubSystem="2" ImportLibrary="$(OutDir)/$(ProjectName).lib" TargetMachine="1"/> <Tool Name="VCMIDLTool" PreprocessorDefinitions="NDEBUG" MkTypLibCompatible="FALSE" TargetEnvironment="1" GenerateStublessProxies="TRUE" TypeLibraryName="$(IntDir)/AddIn.tlb" HeaderFileName="AddIn.h" DLLDataFileName="" InterfaceIdentifierFileName="AddIn_i.c" ProxyFileName="AddIn_p.c"/> <Tool Name="VCPostBuildEventTool" Description="Performing registration" CommandLine="regsvr32 /s /c "$(TargetPath)""/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" AdditionalIncludeDirectories="$(IntDir)"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> </Configurations> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> <File RelativePath="AddIn.cpp"> </File> <File RelativePath="AddIn.def"> </File> <File RelativePath="AddIn.idl"> </File> <File RelativePath="Connect.cpp"> </File> <File RelativePath="stdafx.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc"> <File RelativePath="Connect.h"> </File> <File RelativePath="Resource.h"> </File> <File RelativePath="stdafx.h"> </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> <File RelativePath="AddIn.rc"> </File> <File RelativePath="AddIn.rgs"> </File> <File RelativePath="res\inlinelocale.bmp"> </File> <File RelativePath="res\reducescope.bmp"> </File> <File RelativePath="res\renamelocale.bmp"> </File> <File RelativePath="res\splitlocale.bmp"> </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: stdafx.cpp --- // stdafx.cpp : source file that includes just the standard includes // AddIn.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" --- NEW FILE: stdafx.h --- // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, // but are changed infrequently #pragma once #ifndef STRICT #define STRICT #endif // Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corresponding values for different platforms. #ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later. #define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. #endif #ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. #define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 2000 or later. #endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. #endif #ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later. #define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later. #endif #define _ATL_APARTMENT_THREADED #define _ATL_NO_AUTOMATIC_NAMESPACE #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit // turns off ATL's hiding of some common and often safely ignored warning messages #define _ATL_ALL_WARNINGS #include "resource.h" #include <atlbase.h> #include <atlcom.h> #pragma warning( disable : 4278 ) #pragma warning( disable : 4146 ) //The following #import imports the IDTExtensibility2 interface based on it's LIBID #import "libid:AC0714F2-3D04-11D1-AE7D-00A0C90F26F4" version("1.0") lcid("0") raw_interfaces_only named_guids //The following #import imports MSO based on it's LIBID #import "libid:2DF8D04C-5BFA-101B-BDE5-00AA0044DE52" version("2.2") lcid("0") raw_interfaces_only named_guids #pragma warning( default : 4146 ) #pragma warning( default : 4278 ) #define IfFailGo(x) { hr=(x); if (FAILED(hr)) goto Error; } #define IfFailGoCheck(x, p) { hr=(x); if (FAILED(hr)) goto Error; if(!p) {hr = E_FAIL; goto Error; } } class DECLSPEC_UUID("9D079750-4251-4722-8E52-E8296A611AE8") rftavc7addinLib; using namespace ATL; class CAddInModule : public CAtlDllModuleT< CAddInModule > { public: CAddInModule() { m_hInstance = NULL; } DECLARE_LIBID(__uuidof(rftavc7addinLib)) inline HINSTANCE GetResourceInstance() { return m_hInstance; } inline void SetResourceInstance(HINSTANCE hInstance) { m_hInstance = hInstance; } private: HINSTANCE m_hInstance; }; extern CAddInModule _AtlModule; |
From: <bl...@us...> - 2003-05-11 17:37:25
|
Update of /cvsroot/cpptool/rfta/src/rftavc7addin/exploration In directory sc8-pr-cvs1:/tmp/cvs-serv17291/exploration Log Message: Directory /cvsroot/cpptool/rfta/src/rftavc7addin/exploration added to the repository |
From: <bl...@us...> - 2003-05-11 17:35:55
|
Update of /cvsroot/cpptool/rfta/src/rftavc7addin/res In directory sc8-pr-cvs1:/tmp/cvs-serv16824/res Log Message: Directory /cvsroot/cpptool/rfta/src/rftavc7addin/res added to the repository |
From: <bl...@us...> - 2003-05-10 17:52:22
|
Update of /cvsroot/cpptool/rfta/src/rftavc7addin/rftavc7addinSetup In directory sc8-pr-cvs1:/tmp/cvs-serv14098/rftavc7addinSetup Log Message: Directory /cvsroot/cpptool/rfta/src/rftavc7addin/rftavc7addinSetup added to the repository |
From: <bl...@us...> - 2003-05-10 17:51:19
|
Update of /cvsroot/cpptool/rfta/src/rftavc7addin In directory sc8-pr-cvs1:/tmp/cvs-serv13824/rftavc7addin Log Message: Directory /cvsroot/cpptool/rfta/src/rftavc7addin added to the repository |
From: <bl...@us...> - 2003-05-10 17:48:58
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/test In directory sc8-pr-cvs1:/tmp/cvs-serv13082/libs/filesystem/test Removed Files: recursive_dir_itr_test.cpp Log Message: * updated to the current boost cvs (2003/05/10) --- recursive_dir_itr_test.cpp DELETED --- |
From: <bl...@us...> - 2003-05-10 17:48:58
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/example In directory sc8-pr-cvs1:/tmp/cvs-serv13082/libs/filesystem/example Removed Files: Jamfile compiler_status.cpp probe_valid_names.cpp process_jam_log.cpp readme.txt regr_report.bat tiny_xml.cpp tiny_xml.hpp tiny_xml_test.cpp tiny_xml_test.txt Log Message: * updated to the current boost cvs (2003/05/10) --- Jamfile DELETED --- --- compiler_status.cpp DELETED --- --- probe_valid_names.cpp DELETED --- --- process_jam_log.cpp DELETED --- --- readme.txt DELETED --- --- regr_report.bat DELETED --- --- tiny_xml.cpp DELETED --- --- tiny_xml.hpp DELETED --- --- tiny_xml_test.cpp DELETED --- --- tiny_xml_test.txt DELETED --- |
From: <bl...@us...> - 2003-05-10 17:48:58
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem In directory sc8-pr-cvs1:/tmp/cvs-serv13082/boost/filesystem Removed Files: recursive_directory_iterator.hpp Log Message: * updated to the current boost cvs (2003/05/10) --- recursive_directory_iterator.hpp DELETED --- |
From: <bl...@us...> - 2003-05-10 15:17:35
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc In directory sc8-pr-cvs1:/tmp/cvs-serv22050/libs/filesystem/doc Modified Files: convenience.htm do-list.htm exception.htm index.htm Log Message: * updated to the current boost cvs (2003/05/10) Index: convenience.htm =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc/convenience.htm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** convenience.htm 5 Apr 2003 11:23:23 -0000 1.1 --- convenience.htm 10 May 2003 15:17:32 -0000 1.2 *************** *** 25,29 **** <dl class="index"> <dt><a href="#create_directories">create_directories</a> ! </ol> <h2 id="create_directoies">create_directories</h2> --- 25,32 ---- <dl class="index"> <dt><a href="#create_directories">create_directories</a> ! <dt><a href="#extension">extension</a> ! <dt><a href="#basename">basename</a> ! <dt><a href="#change_extension">change_extension</a> ! </dl> <h2 id="create_directoies">create_directories</h2> *************** *** 42,49 **** </blockquote> <hr> ! <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->23 December, 2002<!--webbot bot="Timestamp" endspan i-checksum="38510" --></p> <p> </p> --- 45,117 ---- </blockquote> + <h2 id="extension">extension</h2> + + <blockquote> + + <p><code>std::string extension( const path & ph );</code></p> + + <p><b>Returns:</b> if <code>ph.leaf()</code> contains a dot ('.'), + returns the substring of <code>ph.leaf()</code> starting from the last dot and + ending at the string's end. Otherwise, returns empty string. + <p><b>Rationale:</b> <ul> + <li>The dot is included in the return value so that it's + possible to tell if extension is empty or absent. + <li>It was noted that this defintion of extension is probably not sufficient + when using <a href="http://tinyurl.com/9tih">Alternate Data Streams</a> — + a filesystem feature specific to NTFS. However, semantic in this case was not + clear, and the current one is quite usefull still. + </ul> + <p><b>Acknowlegements:</b> Carl Daniel and Pavel Vozenilek noticed and + discussed the ADS issue. + + <p>Contributed by Vladimir Prus.</p> + + </blockquote> + + <h2 id="basename">basename</h2> + + <blockquote> + + <p><code>std::string basename( const path & ph );</code></p> + + <p><b>Returns:</b> if <code>ph.leaf()</code> contains a dot ('.'), + returns the substring of <code>ph.leaf()</code> starting from beginning and + ending at the last dot (the dot is not included). Otherwise, returns + <code>ph.leaf()</code> + + </p> + + <p>Contributed by Vladimir Prus.</p> + + </blockquote> + + <h2 id="change_extension">change_extension</h2> + + <blockquote> + + <p><code>path basename( const path & ph, const std::string & new_extension );</code></p> + + <p><b>Postcondition:</b> <code>basename(return_value) == basename(ph) + && extension(return_value) == new_extension</code> + <p><b>Note:</b> It follows from the semantic of <code>extension</code> that + <code>new_extension</code> should include dot to achieve reasonable results. + </p> + <p><b>Rationale:</b> Previously, this functions had + <code>!ph.leaf().empty()</code> as precondition. It's not clear if it was + right or wrong. Changing extension of an empty path looks pointless. On the + other hand, the value of precondition was questionable: one would better place such + checks at the points where paths are entered by the user. Current decision + is to drop the precondition.</p> + + <p>Contributed by Vladimir Prus.</p> + + </blockquote> + + + <hr> ! <p>© Copyright Vladimir Prus, 2003</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->5 May, 2003<!--webbot bot="Timestamp" endspan i-checksum="38510" --></p> <p> </p> Index: do-list.htm =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc/do-list.htm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** do-list.htm 1 Apr 2003 08:25:45 -0000 1.2 --- do-list.htm 10 May 2003 15:17:32 -0000 1.3 *************** *** 10,18 **** and complete(). Also, path_test cases at line 410 need review, correction.<br> </li> - <li>Replace filesystem_error impl with shared_ptr. (Dave Abrahams).<br> - </li> - <li>Consider changing who() - interface (and ctors to const char *).<br> - </li> <li>Add a path::swap member function guaranteed not to throw. (Geurt Vos).<br> </li> --- 10,13 ---- *************** *** 44,46 **** <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->17 March, 2003<!--webbot bot="Timestamp" endspan i-checksum="28843" --></p> \ No newline at end of file --- 39,41 ---- <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->23 March, 2003<!--webbot bot="Timestamp" endspan i-checksum="28836" --></p> \ No newline at end of file Index: exception.htm =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc/exception.htm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** exception.htm 1 Apr 2003 08:25:45 -0000 1.2 --- exception.htm 10 May 2003 15:17:32 -0000 1.3 *************** *** 26,30 **** <p>The design evolved based on user requests to ease portability and ! internationalization.</p> <h2><a name="Synopsis">Synopsis</a></h2> --- 26,31 ---- <p>The design evolved based on user requests to ease portability and ! internationalization. See the Boost <a href="../../../more/error_handling.html"> ! Error and Exception Handling</a> guidelines.</p> <h2><a name="Synopsis">Synopsis</a></h2> *************** *** 54,58 **** }; ! class filesystem_error : public std::runtime_error { public: --- 55,59 ---- }; ! class filesystem_error : public std::exception { public: *************** *** 73,76 **** --- 74,79 ---- ~filesystem_error() throw(); + virtual const char * what() const throw(); + <i>sys_err</i> <a href="#native_error">native_error</a>() const; error_code <a href="#error">error</a>() const; *************** *** 115,118 **** --- 118,129 ---- <p><b>Effects:</b> Constructs a <i>filesystem_error</i> object.</p> </blockquote> + <h3><a name="what">what</a></h3> + <blockquote> + <p><code>virtual const char * what() const throw();</code></p> + <p><b>Returns:</b> A string identifying the error, including who(), path1(), + path2(), and related messages. If an error occurs in the preparation of the + string, particularly in low-memory situations, an implementation is permitted to + return a simpler static string.</p> + </blockquote> <h3><a name="native_error">native_error</a></h3> <blockquote> *************** *** 134,138 **** <pre>const std::string & who() const;</pre> ! <p><b>Returns:</b> The <code>who</code> argument to the constructor.</p> </blockquote> --- 145,151 ---- <pre>const std::string & who() const;</pre> ! <p><b>Returns:</b> The <code>who</code> argument to the constructor. An ! implementation is permitted to return an empty string if an exception, for ! example, std::bad_alloc, occurs during processing.</p> </blockquote> *************** *** 142,146 **** <p><b>Returns:</b> The <code>path1</code> argument to the constructor, if any, ! otherwise <code>path()</code>.</p> </blockquote> --- 155,161 ---- <p><b>Returns:</b> The <code>path1</code> argument to the constructor, if any, ! otherwise <code>path()</code>. An implementation is permitted to return an empty ! path if an exception, for example, std::bad_alloc, occurs during ! processing.</p> </blockquote> *************** *** 150,154 **** <p><b>Returns:</b> The <code>path2</code> argument to the constructor, if any, ! otherwise <code>path()</code>.</p> </blockquote> --- 165,171 ---- <p><b>Returns:</b> The <code>path2</code> argument to the constructor, if any, ! otherwise <code>path()</code>. An implementation is permitted to return an empty ! path if an exception, for example, std::bad_alloc, occurs during ! processing.</p> </blockquote> *************** *** 160,164 **** <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->02 January, 2003<!--webbot bot="Timestamp" endspan i-checksum="38568" --></p> </body> --- 177,181 ---- <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->23 March, 2003<!--webbot bot="Timestamp" endspan i-checksum="28836" --></p> </body> Index: index.htm =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc/index.htm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.htm 1 Apr 2003 08:25:46 -0000 1.2 --- index.htm 10 May 2003 15:17:32 -0000 1.3 *************** *** 428,437 **** <p>A lengthy discussion on the C++ committee's library reflector illuminated the "illusion ! of portability" problem, particularly in postings by JP Plauger and Pete Becker.</p> <hr> <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->16 March, 2003<!--webbot bot="Timestamp" endspan i-checksum="28841" --></p> </body> --- 428,437 ---- <p>A lengthy discussion on the C++ committee's library reflector illuminated the "illusion ! of portability" problem, particularly in postings by PJ Plauger and Pete Becker.</p> <hr> <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->08 April, 2003<!--webbot bot="Timestamp" endspan i-checksum="29884" --></p> </body> |
From: <bl...@us...> - 2003-05-10 15:17:35
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/test In directory sc8-pr-cvs1:/tmp/cvs-serv22050/libs/filesystem/test Modified Files: convenience_test.cpp Log Message: * updated to the current boost cvs (2003/05/10) Index: convenience_test.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/test/convenience_test.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** convenience_test.cpp 5 Apr 2003 11:23:24 -0000 1.1 --- convenience_test.cpp 10 May 2003 15:17:32 -0000 1.2 *************** *** 36,39 **** --- 36,67 ---- BOOST_TEST( fs::is_directory( "xx/ww" ) ); BOOST_TEST( fs::is_directory( "xx/ww/zz" ) ); + + // extension() tests ----------------------------------------------------------// + + BOOST_TEST( fs::extension("a/b") == "" ); + BOOST_TEST( fs::extension("a/b.txt") == ".txt" ); + BOOST_TEST( fs::extension("a/b.") == "." ); + BOOST_TEST( fs::extension("a.b.c") == ".c" ); + BOOST_TEST( fs::extension("a.b.c.") == "." ); + BOOST_TEST( fs::extension("") == "" ); + BOOST_TEST( fs::extension("a/") == "" ); + + // basename() tests ----------------------------------------------------------// + + BOOST_TEST( fs::basename("b") == "b" ); + BOOST_TEST( fs::basename("a/b.txt") == "b" ); + BOOST_TEST( fs::basename("a/b.") == "b" ); + BOOST_TEST( fs::basename("a.b.c") == "a.b" ); + BOOST_TEST( fs::basename("a.b.c.") == "a.b.c" ); + BOOST_TEST( fs::basename("") == "" ); + + // change_extension tests ---------------------------------------------------// + + BOOST_TEST( fs::change_extension("a.txt", ".tex").string() == "a.tex" ); + BOOST_TEST( fs::change_extension("a.", ".tex").string() == "a.tex" ); + BOOST_TEST( fs::change_extension("a", ".txt").string() == "a.txt" ); + BOOST_TEST( fs::change_extension("a.b.txt", ".tex").string() == "a.b.tex" ); + // see the rationale in html docs for explanation why this works + BOOST_TEST( fs::change_extension("", ".png").string() == ".png" ); return 0; |
From: <bl...@us...> - 2003-05-10 15:17:35
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem In directory sc8-pr-cvs1:/tmp/cvs-serv22050/boost/filesystem Modified Files: convenience.hpp exception.hpp fstream.hpp Log Message: * updated to the current boost cvs (2003/05/10) Index: convenience.hpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem/convenience.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** convenience.hpp 5 Apr 2003 11:23:22 -0000 1.1 --- convenience.hpp 10 May 2003 15:17:32 -0000 1.2 *************** *** 32,35 **** --- 32,41 ---- void create_directories(const path& ph); + std::string extension(const path& ph); + + std::string basename(const path& ph); + + path change_extension(const path& ph, const std::string& new_extension); + } // namespace filesystem } // namespace boost Index: exception.hpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem/exception.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** exception.hpp 1 Apr 2003 08:25:42 -0000 1.2 --- exception.hpp 10 May 2003 15:17:32 -0000 1.3 *************** *** 24,28 **** #include <string> ! #include <stdexcept> //----------------------------------------------------------------------------// --- 24,29 ---- #include <string> ! #include <exception> ! #include <boost/shared_ptr.hpp> //----------------------------------------------------------------------------// *************** *** 59,63 **** ! class filesystem_error : public std::runtime_error { public: --- 60,64 ---- ! class filesystem_error : public std::exception { public: *************** *** 85,88 **** --- 86,91 ---- ~filesystem_error() throw(); + virtual const char * what() const throw(); + int native_error() const { return m_sys_err; } // Note: a value of 0 implies a library (rather than system) error *************** *** 93,101 **** private: ! int m_sys_err; ! error_code m_err; ! std::string m_who; ! path m_path1; ! path m_path2; }; --- 96,103 ---- private: ! class m_imp; ! shared_ptr<m_imp> m_imp_ptr; ! int m_sys_err; ! error_code m_err; }; Index: fstream.hpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem/fstream.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fstream.hpp 1 Apr 2003 08:25:44 -0000 1.2 --- fstream.hpp 10 May 2003 15:17:32 -0000 1.3 *************** *** 14,17 **** --- 14,18 ---- #include <boost/filesystem/path.hpp> + #include <boost/detail/workaround.hpp> #include <iosfwd> *************** *** 27,32 **** public: virtual ~basic_filebuf() {} ! ! #if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this std::basic_filebuf<charT,traits> * open( const path & file_ph, std::ios_base::openmode mode ) --- 28,32 ---- public: virtual ~basic_filebuf() {} ! #if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this std::basic_filebuf<charT,traits> * open( const path & file_ph, std::ios_base::openmode mode ) *************** *** 48,57 **** public: basic_ifstream() {} explicit basic_ifstream( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in ) : std::basic_ifstream<charT,traits>( file_ph.native_file_string().c_str(), mode ) {} ! virtual ~basic_ifstream() {} ! #if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in ) --- 48,57 ---- public: basic_ifstream() {} + #if !BOOST_WORKAROUND( BOOST_MSVC, == 1310 ) explicit basic_ifstream( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in ) : std::basic_ifstream<charT,traits>( file_ph.native_file_string().c_str(), mode ) {} ! # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in ) *************** *** 60,64 **** --- 60,85 ---- file_ph.native_file_string().c_str(), mode ); } + # endif + #else // workaround for VC++ 7.1 bug id VSWhidbey 38416 + explicit basic_ifstream( const path & file_ph ) + : std::basic_ifstream<charT,traits>( + file_ph.native_file_string().c_str(), std::ios_base::in ) {} + basic_ifstream( const path & file_ph, + std::ios_base::openmode mode ) + : std::basic_ifstream<charT,traits>( + file_ph.native_file_string().c_str(), mode ) {} + void open( const path & file_ph ) + { + std::basic_ifstream<charT,traits>::open( + file_ph.native_file_string().c_str(), std::ios_base::in ); + } + void open( const path & file_ph, + std::ios_base::openmode mode ) + { + std::basic_ifstream<charT,traits>::open( + file_ph.native_file_string().c_str(), mode ); + } #endif + virtual ~basic_ifstream() {} }; *************** *** 73,82 **** public: basic_ofstream() {} explicit basic_ofstream( const path & file_ph, std::ios_base::openmode mode = std::ios_base::out ) : std::basic_ofstream<charT,traits>( file_ph.native_file_string().c_str(), mode ) {} ! virtual ~basic_ofstream() {} ! #if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::out ) --- 94,103 ---- public: basic_ofstream() {} + #if !BOOST_WORKAROUND( BOOST_MSVC, == 1310 ) explicit basic_ofstream( const path & file_ph, std::ios_base::openmode mode = std::ios_base::out ) : std::basic_ofstream<charT,traits>( file_ph.native_file_string().c_str(), mode ) {} ! # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::out ) *************** *** 85,89 **** --- 106,131 ---- file_ph.native_file_string().c_str(), mode ); } + # endif + #else // workaround for VC++ 7.1 bug id VSWhidbey 38416 + explicit basic_ofstream( const path & file_ph ) + : std::basic_ofstream<charT,traits>( + file_ph.native_file_string().c_str(), std::ios_base::out ) {} + basic_ofstream( const path & file_ph, + std::ios_base::openmode mode ) + : std::basic_ofstream<charT,traits>( + file_ph.native_file_string().c_str(), mode ) {} + void open( const path & file_ph ) + { + std::basic_ofstream<charT,traits>::open( + file_ph.native_file_string().c_str(), std::ios_base::out ); + } + void open( const path & file_ph, + std::ios_base::openmode mode ) + { + std::basic_ofstream<charT,traits>::open( + file_ph.native_file_string().c_str(), mode ); + } #endif + virtual ~basic_ofstream() {} }; *************** *** 98,107 **** public: basic_fstream() {} explicit basic_fstream( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out ) : std::basic_fstream<charT,traits>( file_ph.native_file_string().c_str(), mode ) {} ! virtual ~basic_fstream() {} ! #if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out ) --- 140,149 ---- public: basic_fstream() {} + #if !BOOST_WORKAROUND( BOOST_MSVC, == 1310 ) explicit basic_fstream( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out ) : std::basic_fstream<charT,traits>( file_ph.native_file_string().c_str(), mode ) {} ! # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out ) *************** *** 110,114 **** --- 152,179 ---- file_ph.native_file_string().c_str(), mode ); } + # endif + #else // workaround for VC++ 7.1 bug id VSWhidbey 38416 + explicit basic_fstream( const path & file_ph ) + : std::basic_fstream<charT,traits>( + file_ph.native_file_string().c_str(), + std::ios_base::in|std::ios_base::out ) {} + basic_fstream( const path & file_ph, + std::ios_base::openmode mode ) + : std::basic_fstream<charT,traits>( + file_ph.native_file_string().c_str(), mode ) {} + void open( const path & file_ph ) + { + std::basic_fstream<charT,traits>::open( + file_ph.native_file_string().c_str(), + std::ios_base::in|std::ios_base::out ); + } + void open( const path & file_ph, + std::ios_base::openmode mode ) + { + std::basic_fstream<charT,traits>::open( + file_ph.native_file_string().c_str(), mode ); + } #endif + virtual ~basic_fstream() {} }; |
From: <bl...@us...> - 2003-05-10 15:17:35
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/src In directory sc8-pr-cvs1:/tmp/cvs-serv22050/libs/filesystem/src Modified Files: convenience.cpp exception.cpp Log Message: * updated to the current boost cvs (2003/05/10) Index: convenience.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/src/convenience.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** convenience.cpp 5 Apr 2003 11:23:23 -0000 1.1 --- convenience.cpp 10 May 2003 15:17:32 -0000 1.2 *************** *** 29,32 **** --- 29,57 ---- } + std::string extension(const path& ph) + { + std::string leaf = ph.leaf(); + + std::string::size_type n = leaf.rfind('.'); + if (n != std::string::npos) + return leaf.substr(n); + else + return std::string(); + } + + std::string basename(const path& ph) + { + std::string leaf = ph.leaf(); + + std::string::size_type n = leaf.rfind('.'); + return leaf.substr(0, n); + } + + path change_extension(const path& ph, const std::string& new_extension) + { + return ph.branch_path() / (basename(ph) + new_extension); + } + + } // namespace filesystem } // namespace boost Index: exception.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/src/exception.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** exception.cpp 1 Apr 2003 08:25:50 -0000 1.2 --- exception.cpp 10 May 2003 15:17:32 -0000 1.3 *************** *** 180,183 **** --- 180,186 ---- } + const fs::path empty_path; + const std::string empty_string; + const char * no_context_msg = "filesystem_error"; } // unnamed namespace *************** *** 186,189 **** --- 189,204 ---- namespace filesystem { + // filesystem_error m_imp class --------------------------------------------// + // see www.boost.org/more/error_handling.html for implemenation rationale + + class filesystem_error::m_imp + { + public: + std::string m_who; + path m_path1; + path m_path2; + std::string m_what; + }; + // filesystem_error implementation -----------------------------------------// *************** *** 192,199 **** const std::string & who, const std::string & message ) ! : std::runtime_error( ! other_error_prep( who, message ).c_str() ), ! m_sys_err(0), m_err(other_error), m_who(who) ! {} filesystem_error::filesystem_error( --- 207,220 ---- const std::string & who, const std::string & message ) ! : m_sys_err(0), m_err(other_error) ! { ! try ! { ! m_imp_ptr.reset( new m_imp ); ! m_imp_ptr->m_who = who; ! m_imp_ptr->m_what = other_error_prep( who, message ); ! } ! catch (...) { m_imp_ptr.reset(); } ! } filesystem_error::filesystem_error( *************** *** 201,208 **** const path & path1, const std::string & message ) ! : std::runtime_error( ! other_error_prep( who, path1, message ).c_str() ), ! m_sys_err(0), m_err(other_error), m_who(who), m_path1(path1) ! {} filesystem_error::filesystem_error( --- 222,236 ---- const path & path1, const std::string & message ) ! : m_sys_err(0), m_err(other_error) ! { ! try ! { ! m_imp_ptr.reset( new m_imp ); ! m_imp_ptr->m_who = who; ! m_imp_ptr->m_what = other_error_prep( who, path1, message ); ! m_imp_ptr->m_path1 = path1; ! } ! catch (...) { m_imp_ptr.reset(); } ! } filesystem_error::filesystem_error( *************** *** 210,218 **** const path & path1, int sys_err_code ) ! : std::runtime_error( ! system_error_prep( who, path1, sys_err_code ).c_str() ), ! m_sys_err(sys_err_code), m_err(lookup_error(sys_err_code)), ! m_who(who), m_path1(path1) ! {} filesystem_error::filesystem_error( --- 238,252 ---- const path & path1, int sys_err_code ) ! : m_sys_err(sys_err_code), m_err(lookup_error(sys_err_code)) ! { ! try ! { ! m_imp_ptr.reset( new m_imp ); ! m_imp_ptr->m_who = who; ! m_imp_ptr->m_what = system_error_prep( who, path1, sys_err_code ); ! m_imp_ptr->m_path1 = path1; ! } ! catch (...) { m_imp_ptr.reset(); } ! } filesystem_error::filesystem_error( *************** *** 221,232 **** const path & path2, int sys_err_code ) ! : std::runtime_error( ! system_error_prep( who, path1, path2, sys_err_code ).c_str() ), ! m_sys_err(sys_err_code), m_err(lookup_error(sys_err_code)), ! m_who(who), m_path1(path1), m_path2(path2) ! {} filesystem_error::~filesystem_error() throw() { } --- 255,294 ---- const path & path2, int sys_err_code ) ! : m_sys_err(sys_err_code), m_err(lookup_error(sys_err_code)) ! { ! try ! { ! m_imp_ptr.reset( new m_imp ); ! m_imp_ptr->m_who = who; ! m_imp_ptr->m_what = system_error_prep( who, path1, path2, sys_err_code ); ! m_imp_ptr->m_path1 = path1; ! m_imp_ptr->m_path2 = path2; ! } ! catch (...) { m_imp_ptr.reset(); } ! } filesystem_error::~filesystem_error() throw() { + } + + const std::string & filesystem_error::who() const + { + return m_imp_ptr.get() == 0 ? empty_string : m_imp_ptr->m_who; + } + + const path & filesystem_error::path1() const + { + return m_imp_ptr.get() == 0 ? empty_path : m_imp_ptr->m_path1; + } + + const path & filesystem_error::path2() const + { + return m_imp_ptr.get() == 0 ? empty_path : m_imp_ptr->m_path2; + } + + const char * filesystem_error::what() const throw() + { + return m_imp_ptr.get() == 0 ? empty_string.c_str() + : m_imp_ptr->m_what.c_str(); } |
From: <net...@us...> - 2003-05-10 13:11:54
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv17669/src/rftaparser Modified Files: rftaparser.dsp Log Message: -- extensions and test for parsing declarations in compound statement context (preparation to replace 'variabledeclmutator') Index: rftaparser.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/rftaparser.dsp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** rftaparser.dsp 10 May 2003 10:56:07 -0000 1.53 --- rftaparser.dsp 10 May 2003 13:11:52 -0000 1.54 *************** *** 56,61 **** # 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 /nologo /dll /debug /machine:I386 /out:"..\..\build\rftaparser\Release/rftaparser_mdr.ext" # Begin Special Build Tool ! TargetDir=\prg\vc\Rfta\build\rftaparser\Release ! TargetPath=\prg\vc\Rfta\build\rftaparser\Release\rftaparser_mdr.ext TargetName=rftaparser_mdr SOURCE="$(InputPath)" --- 56,61 ---- # 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 /nologo /dll /debug /machine:I386 /out:"..\..\build\rftaparser\Release/rftaparser_mdr.ext" # Begin Special Build Tool ! TargetDir=\Projects\Cpptool\rfta\build\rftaparser\Release ! TargetPath=\Projects\Cpptool\rfta\build\rftaparser\Release\rftaparser_mdr.ext TargetName=rftaparser_mdr SOURCE="$(InputPath)" *************** *** 90,95 **** # 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 cppunitd_dll.lib /nologo /dll /debug /machine:I386 /out:"..\..\build\rftaparser\Debug/rftaparser_mdd.ext" /pdbtype:sept /libpath:"../../deplib/cppunit/lib" # Begin Special Build Tool ! TargetDir=\prg\vc\Rfta\build\rftaparser\Debug ! TargetPath=\prg\vc\Rfta\build\rftaparser\Debug\rftaparser_mdd.ext TargetName=rftaparser_mdd SOURCE="$(InputPath)" --- 90,95 ---- # 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 cppunitd_dll.lib /nologo /dll /debug /machine:I386 /out:"..\..\build\rftaparser\Debug/rftaparser_mdd.ext" /pdbtype:sept /libpath:"../../deplib/cppunit/lib" # Begin Special Build Tool ! TargetDir=\Projects\Cpptool\rfta\build\rftaparser\Debug ! TargetPath=\Projects\Cpptool\rfta\build\rftaparser\Debug\rftaparser_mdd.ext TargetName=rftaparser_mdd SOURCE="$(InputPath)" *************** *** 758,761 **** --- 758,769 ---- !ENDIF + # End Source File + # Begin Source File + + SOURCE=.\DeclarationDetailsParserTest.cpp + # End Source File + # Begin Source File + + SOURCE=.\DeclarationDetailsParserTest.h # End Source File # Begin Source File |
From: <net...@us...> - 2003-05-10 13:11:10
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv17499/src/rftaparser Modified Files: UnparsedDeclarationMutatorTest.cpp Log Message: -- corrected test (fct body not allowed for this parser type) Index: UnparsedDeclarationMutatorTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/UnparsedDeclarationMutatorTest.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** UnparsedDeclarationMutatorTest.cpp 4 May 2003 06:56:47 -0000 1.12 --- UnparsedDeclarationMutatorTest.cpp 10 May 2003 13:11:06 -0000 1.13 *************** *** 23,27 **** const std::string DECLARATOR = "DECLARATOR"; const std::string SPECIFIERLIST = "SPECIFIERLIST"; - const std::string FUNCTIONBODY = "FUNCTIONBODY"; namespace Testing --- 23,26 ---- *************** *** 98,102 **** // check number of specifiers parsed: ! CppUnit::assertEquals( specifierList->getChildCount(), specifierCount, sourceLine, boost::io::str(boost::format("Bad number of specifiers:\n Actual %1%\n Expected %2%.") % specifierList->getChildCount() --- 97,101 ---- // check number of specifiers parsed: ! CppUnit::assertEquals( specifierCount, specifierList->getChildCount() ,sourceLine, boost::io::str(boost::format("Bad number of specifiers:\n Actual %1%\n Expected %2%.") % specifierList->getChildCount() *************** *** 115,119 **** } // check declarators ! CppUnit::assertEquals( node->getChildCount() , declaratorCount , sourceLine, "Wrong number of declarators." ); --- 114,118 ---- } // check declarators ! CppUnit::assertEquals( declaratorCount, node->getChildCount(), sourceLine, "Wrong number of declarators." ); *************** *** 823,828 **** Testing::KeyedString source; source.addKeyed(SPECIFIER , "inline" ) << " "; ! source.addKeyed(DECLARATOR, "KeyedString::operator std::string() const" ) << " "; ! source.addKeyed(FUNCTIONBODY,"{ return sequence_; }"); SourceASTNodePtr sourceAST = RFTA_ASSERT_DECLARATION_MUTATOR_PASS( source ); --- 822,826 ---- Testing::KeyedString source; source.addKeyed(SPECIFIER , "inline" ) << " "; ! source.addKeyed(DECLARATOR, "KeyedString::operator std::string() const" ) << ";"; SourceASTNodePtr sourceAST = RFTA_ASSERT_DECLARATION_MUTATOR_PASS( source ); |
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv17247/src/rftaparser Modified Files: DeclarationDetailsParser.h DeclarationDetailsParser.cpp Added Files: DeclarationDetailsParserTest.h DeclarationDetailsParserTest.cpp Log Message: -- extensions and test for parsing declarations in compound statement context (preparation to replace 'variabledeclmutator') --- NEW FILE: DeclarationDetailsParserTest.h --- // ////////////////////////////////////////////////////////////////////////// // Header file DeclarationDetailsParserTest.h for class DeclarationDetailsParserTest // (c)Copyright 2003, Andre Baresel. // Created: 2003/05/09 // ////////////////////////////////////////////////////////////////////////// #ifndef RFTA_DeclarationDetailsParserTest_H #define RFTA_DeclarationDetailsParserTest_H #include "ParserTesting.h" namespace Refactoring { /// Unit tests for CompoundStatementParserTest class DeclarationDetailsParserTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( DeclarationDetailsParserTest ); CPPUNIT_TEST( testTemplateFuntionFollowedByDecl ); CPPUNIT_TEST_SUITE_END(); public: /*! Constructs a DeclarationDetailsParserTest object. */ DeclarationDetailsParserTest(); /// Destructor. virtual ~DeclarationDetailsParserTest(); void setUp(); void tearDown(); void testTemplateFuntionFollowedByDecl(); private: /// Prevents the use of the copy constructor. DeclarationDetailsParserTest( const DeclarationDetailsParserTest &other ); /// Prevents the use of the copy operator. void operator =( const DeclarationDetailsParserTest &other ); private: }; // Inlines methods for DeclarationDetailsParserTest: // ------------------------------------------------ } // namespace Refactoring #endif // RFTA_DeclarationDetailsParserTest_H --- NEW FILE: DeclarationDetailsParserTest.cpp --- // ////////////////////////////////////////////////////////////////////////// // Implementation file DeclarationDetailsParserTest.cpp for class DeclarationDetailsParserTest // (c)Copyright 2003, Andre Baresel. // Created: 2003/04/10 // ////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "DeclarationDetailsParserTest.h" #include <rfta/parser/ASTNodes.h> #include "DeclarationDetailsParser.h" #include "KeyedString.h" namespace Refactoring { RFTAPARSER_TEST_SUITE_REGISTRATION( DeclarationDetailsParserTest ); template<typename ParserType> void checkParserFail( const std::string &source, const CppUnit::SourceLine &sourceLine, Refactoring::Testing::Identity<ParserType> ) { SourceASTNodePtr sourceNode = SourceASTNode::create( source, source ); ParseContext context( sourceNode ); ASTNodePtr compound = ASTNode::create( ASTNodeTypes::compoundStatement, sourceNode, 0, source.length(), sourceNode ); ASTNodePtr decl = ASTNode::create( ASTNodeTypes::declarationOrExpression, compound, 0, source.length(), sourceNode ); context.addNode( decl ); ParserType parser( context, decl, sourceNode ); CppUnit::Message message( "parsing did not fail", std::string( "using parser: " ) + typeid(ParserType).name(), "Source:\n" + source ); CppUnit::Asserter::failIf( parser.tryParse(), message, sourceLine ); } #define ASSERT_PARSER_FAIL( ParserType, source )\ Refactoring::checkParserFail<ParserType>( source, \ CPPUNIT_SOURCELINE(), \ Refactoring::Testing::Identity<ParserType>() ) DeclarationDetailsParserTest::DeclarationDetailsParserTest() : CppUnit::TestFixture() { } DeclarationDetailsParserTest::~DeclarationDetailsParserTest() { } void DeclarationDetailsParserTest::setUp() { } void DeclarationDetailsParserTest::tearDown() { } void DeclarationDetailsParserTest::testTemplateFuntionFollowedByDecl() { ASSERT_PARSER_FAIL( DeclarationDetailsParser, "call_fct(10);" ); ASSERT_PARSER_FAIL( DeclarationDetailsParser, "sizeof SomeType;" ); ASSERT_PARSER_FAIL( DeclarationDetailsParser, "new SomeObject;" ); ASSERT_PARSER_FAIL( DeclarationDetailsParser, "x = x + 3;" ); ASSERT_PARSER_FAIL( DeclarationDetailsParser, "name.id = name.length() > 10 ? 1 : 2;" ); } } // namespace Refactoring Index: DeclarationDetailsParser.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationDetailsParser.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DeclarationDetailsParser.h 4 May 2003 06:56:47 -0000 1.4 --- DeclarationDetailsParser.h 10 May 2003 13:10:10 -0000 1.5 *************** *** 38,42 **** // // ENTRY-Point: ! void parseDeclarationSpecifierList(ASTNodePtr &specifierList); // parsing of composed specifiers (e.g. "class x { ... }" --- 38,42 ---- // // ENTRY-Point: ! bool parseDeclarationSpecifierList(ASTNodePtr &specifierList); // parsing of composed specifiers (e.g. "class x { ... }" *************** *** 77,81 **** // // ENTRY-Point: ! void parseDeclarators(); // parser has to stay at the character after the operator keyword... --- 77,81 ---- // // ENTRY-Point: ! bool parseDeclarators(); // parser has to stay at the character after the operator keyword... *************** *** 93,97 **** bool skipOverAssignmentInitializer(); ! void createAndAddInitializerNode( const ASTNodePtr &variableDeclNode ); void addValueNode( const ASTNodePtr& variableDeclNode, --- 93,97 ---- bool skipOverAssignmentInitializer(); ! bool createAndAddInitializerNode( const ASTNodePtr &variableDeclNode ); void addValueNode( const ASTNodePtr& variableDeclNode, *************** *** 110,113 **** --- 110,114 ---- KeywordSet declarationSpecifiers; KeywordSet elaboratedSpecifiers; + KeywordSet statementKeywords; }; Index: DeclarationDetailsParser.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationDetailsParser.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DeclarationDetailsParser.cpp 4 May 2003 06:56:47 -0000 1.8 --- DeclarationDetailsParser.cpp 10 May 2003 13:10:10 -0000 1.9 *************** *** 63,66 **** --- 63,83 ---- elaboratedSpecifiers.insert("union"); elaboratedSpecifiers.insert("typename"); + + // statement key words: + statementKeywords.insert( "break" ); + statementKeywords.insert( "case" ); + statementKeywords.insert( "continue" ); + statementKeywords.insert( "default" ); + statementKeywords.insert( "do" ); + statementKeywords.insert( "if" ); + statementKeywords.insert( "return" ); + statementKeywords.insert( "while" ); + statementKeywords.insert( "for" ); + statementKeywords.insert( "switch" ); + statementKeywords.insert( "try" ); + + statementKeywords.insert( "sizeof" ); + statementKeywords.insert( "new" ); + statementKeywords.insert( "delete" ); } *************** *** 71,77 **** bool DeclarationDetailsParser::tryParse() ! { ASTNodePtr declarationNode = node_; node_->mutateType( ASTNodeTypes::declaration ); --- 88,102 ---- + /** + * tries to parse declaration. This does not work + * for template definition and function-implementation (these are detected in 'DeclarationParser')! + */ bool DeclarationDetailsParser::tryParse() ! { ! // @todo: reverse mutation changes in the case of a parsing failure in ! // 'parseDeclarationSpecifierList' ! // 'parseDeclarators' ! ASTNodePtr declarationNode = node_; node_->mutateType( ASTNodeTypes::declaration ); *************** *** 101,109 **** { // read all declarators and add childs to property: ! parseDeclarators(); } ! // return with no parsing error: ! return true; } --- 126,145 ---- { // read all declarators and add childs to property: ! if (!parseDeclarators()) ! return false; // @todo: restore node type to 'unparsed' / 'unknown' ! } ! ! // this check does detect wrong declarations in compound statement context ! ASTNodePtr helpnode = boost::make_shared(node_->getParentNode()); ! if ( !(!helpnode) && helpnode->getType() == ASTNodeTypes::compoundStatement ) ! { ! // check if any specifier did appear ! if (specifierList->getChildCount() == 0) ! return false; // this is not a declaration } + ! // returns true only in case of reaching the final ';' ! return *(current_-1)==';'; } *************** *** 112,116 **** * the decision about the end of the specifier list is done in "tryParseUserDefinedType" */ ! void DeclarationDetailsParser::parseDeclarationSpecifierList(ASTNodePtr &specifierList) { --- 148,152 ---- * the decision about the end of the specifier list is done in "tryParseUserDefinedType" */ ! bool DeclarationDetailsParser::parseDeclarationSpecifierList(ASTNodePtr &specifierList) { *************** *** 122,125 **** --- 158,166 ---- while ( save_pointer = getCurrent(),lastIndex=getCurrentIndex(), tryReadNextIdentifier(identifier) ) { + if (statementKeywords.find(identifier) != statementKeywords.end()) + { // statement keywords cannot be specifiers... + current_ = save_pointer; + break; + } if (declarationSpecifiers.find(identifier) != declarationSpecifiers.end()) { *************** *** 168,171 **** --- 209,213 ---- } } + return true; } *************** *** 534,538 **** } ! void DeclarationDetailsParser::parseDeclarators() { --- 576,580 ---- } ! bool DeclarationDetailsParser::parseDeclarators() { *************** *** 594,598 **** { if (!tryNextIs(':')) ! throwFailure("Did not expect a single colon at this stage."); nestedName = "::"; --- 636,643 ---- { if (!tryNextIs(':')) ! { ! // Did not expect a single colon at this stage.... ! return false; ! } nestedName = "::"; *************** *** 606,610 **** std::string identifier; if (!tryReadNextIdentifier(identifier)) ! throwFailure( boost::format("unexpected character: '%1%'.") % *current_ ); if (identifier=="const") --- 651,658 ---- std::string identifier; if (!tryReadNextIdentifier(identifier)) ! { ! // unexpected character: '*current_' ! return false; ! } if (identifier=="const") *************** *** 628,632 **** { parseOperator(declaratorStartIndex); ! return; } --- 676,681 ---- { parseOperator(declaratorStartIndex); ! declaratorEndReached = true; ! break; } *************** *** 635,649 **** { if (!skipOverAssignmentInitializer()) ! throwFailure("Constant expression is not well formed."); // @todo: store bit field expression ! } ! continue; } while (hasNext() && !declaratorEndReached); if (!declaratorEndReached) { ! boost::format frmt( "failed to find expected declarator separator " ! "for declaration %1%: ',;=({'. "); ! throwFailure( frmt % declaratorNumber ); } --- 684,698 ---- { if (!skipOverAssignmentInitializer()) ! // failure: Constant expression is not well formed ! return false; ! // @todo: store bit field expression ! } } while (hasNext() && !declaratorEndReached); if (!declaratorEndReached) { ! // failed to find expected declarator separator for declaration 'declaratorNumber' ! return false; } *************** *** 676,690 **** // now go through initializers: ! createAndAddInitializerNode(declaratorNode); declaratorNumber++; } } ! void DeclarationDetailsParser::createAndAddInitializerNode( const ASTNodePtr &declaratorNode ) { if ( !hasNext() ) ! return; Tracker tracker( "DeclarationDetailsParser::createAndAddInitializerNode", *this ); --- 725,743 ---- // now go through initializers: ! if (!createAndAddInitializerNode(declaratorNode)) ! // error in parsing initializer ! return false; ! declaratorNumber++; } + return true; } ! bool DeclarationDetailsParser::createAndAddInitializerNode( const ASTNodePtr &declaratorNode ) { if ( !hasNext() ) ! return true; // simply no intializer Tracker tracker( "DeclarationDetailsParser::createAndAddInitializerNode", *this ); *************** *** 713,720 **** break; case ';': case ',': case '{': ! return; default: -- current_; ! throwFailure( boost::format("unexpected character: '%1%'.") % *current_ ); } --- 766,774 ---- break; case ';': case ',': case '{': ! return true; // end of initializer default: -- current_; ! // unexpected character: '*current_' ! return false; } *************** *** 729,739 **** skipSpaces(); - if ( !hasNext() ) - return; ! if ( *current_ == ';' || *current_ == ',' ) ! ++current_; else ! throwFailure( boost::format("unexpected character: '%1%'.") % *current_ ); } --- 783,794 ---- skipSpaces(); ! if ( !hasNext() || (*current_ != ';' && *current_ != ',') ) ! return false; // expected the final character of the initializer (';' or ',') else ! { ! ++current_; ! return true; ! } } *************** *** 965,976 **** findNextBalanced('(',')'); readUntilNextOf("{;=,"); - backtrackSkippingSpaces(); - - ASTNodePtr declaratorNode = createASTNode( ASTNodeTypes::unparsedDeclarator, - node_, - declaratorStartIndex, - getCurrentIndex() - declaratorStartIndex ); - node_->addChild(declaratorNode); - skipSpaces(); } --- 1020,1023 ---- |
From: <bl...@us...> - 2003-05-10 11:46:25
|
Update of /cvsroot/cpptool/rfta/src/rftavc6addin In directory sc8-pr-cvs1:/tmp/cvs-serv21742/src/rftavc6addin Modified Files: TextDocumentHelper.cpp TextDocumentHelper.h VCLineBasedTextDocument.cpp Log Message: *modified 'getSelectionRange' implementation making it more undo friendly. Index: TextDocumentHelper.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc6addin/TextDocumentHelper.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TextDocumentHelper.cpp 9 Jan 2003 19:44:51 -0000 1.3 --- TextDocumentHelper.cpp 10 May 2003 11:46:22 -0000 1.4 *************** *** 52,53 **** --- 52,71 ---- return tabSize; } + + + bool + TextDocumentHelper::redo() const + { + VARIANT_BOOL success; + _document->Redo( &success ); + return success != 0; + } + + + bool + TextDocumentHelper::undo() const + { + VARIANT_BOOL success; + _document->Undo( &success ); + return success != 0; + } Index: TextDocumentHelper.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc6addin/TextDocumentHelper.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TextDocumentHelper.h 9 Jan 2003 19:44:51 -0000 1.3 --- TextDocumentHelper.h 10 May 2003 11:46:22 -0000 1.4 *************** *** 30,33 **** --- 30,37 ---- int getTabSize() const; + bool undo() const; + + bool redo() const; + private: CComPtr<ITextDocument> _document; Index: VCLineBasedTextDocument.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc6addin/VCLineBasedTextDocument.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VCLineBasedTextDocument.cpp 9 Jan 2003 19:44:51 -0000 1.4 --- VCLineBasedTextDocument.cpp 10 May 2003 11:46:22 -0000 1.5 *************** *** 68,72 **** helper_.selection().currentColumn() -1 ); ! helper_.selection().setText( text.c_str() ); selectionEnd = Location( selectionStart, text ); --- 68,76 ---- helper_.selection().currentColumn() -1 ); ! if ( !text.empty() ) ! { ! if ( !helper_.undo() ) ! helper_.selection().setText( text.c_str() ); ! } selectionEnd = Location( selectionStart, text ); |
From: <bl...@us...> - 2003-05-10 10:57:02
|
Update of /cvsroot/cpptool/rfta/bug In directory sc8-pr-cvs1:/tmp/cvs-serv8016/bug Removed Files: ParserCrash.cpp Log Message: * bug fixed --- ParserCrash.cpp DELETED --- |
From: <bl...@us...> - 2003-05-10 10:56:11
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv7804/src/rftaparser Modified Files: rftaparser.dsp Log Message: * fixed release configuration Index: rftaparser.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/rftaparser.dsp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** rftaparser.dsp 4 May 2003 18:19:28 -0000 1.52 --- rftaparser.dsp 10 May 2003 10:56:07 -0000 1.53 *************** *** 54,58 **** 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 /nologo /dll /debug /machine:I386 /out:"..\..\build\rftaparser\Release/rftaparser_mdr.ext" /libpath:"../../deplib/cppunit/lib" # Begin Special Build Tool TargetDir=\prg\vc\Rfta\build\rftaparser\Release --- 54,58 ---- 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 /nologo /dll /debug /machine:I386 /out:"..\..\build\rftaparser\Release/rftaparser_mdr.ext" # Begin Special Build Tool TargetDir=\prg\vc\Rfta\build\rftaparser\Release *************** *** 680,687 **** --- 680,705 ---- SOURCE=.\MiniParserTest.cpp + + !IF "$(CFG)" == "rftaparser - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rftaparser - Win32 Debug" + + !ENDIF + # End Source File # Begin Source File SOURCE=.\MiniParserTest.h + + !IF "$(CFG)" == "rftaparser - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rftaparser - Win32 Debug" + + !ENDIF + # End Source File # End Group *************** *** 1298,1309 **** --- 1316,1380 ---- SOURCE=.\KeyedString.h + + !IF "$(CFG)" == "rftaparser - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rftaparser - Win32 Debug" + + !ENDIF + # End Source File # Begin Source File SOURCE=..\rftatest\SourceBuilder.cpp + + !IF "$(CFG)" == "rftaparser - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rftaparser - Win32 Debug" + + !ENDIF + # End Source File # Begin Source File SOURCE=..\..\include\rfta\test\SourceBuilder.h + + !IF "$(CFG)" == "rftaparser - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rftaparser - Win32 Debug" + + !ENDIF + + # End Source File + # Begin Source File + + SOURCE=.\SourceBuilderTestBase.cpp + + !IF "$(CFG)" == "rftaparser - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rftaparser - Win32 Debug" + + !ENDIF + + # End Source File + # Begin Source File + + SOURCE=.\SourceBuilderTestBase.h + + !IF "$(CFG)" == "rftaparser - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rftaparser - Win32 Debug" + + !ENDIF + # End Source File # Begin Source File *************** *** 1579,1590 **** SOURCE=..\..\include\rfta\parser\ParserTools.h - # End Source File - # Begin Source File - - SOURCE=.\SourceBuilderTestBase.cpp - # End Source File - # Begin Source File - - SOURCE=.\SourceBuilderTestBase.h # End Source File # End Target --- 1650,1653 ---- |
From: <bl...@us...> - 2003-05-10 10:55:41
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv7631/src/rftaparser Modified Files: SourceRange.cpp Log Message: * indentation fix Index: SourceRange.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/SourceRange.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SourceRange.cpp 1 May 2003 20:48:05 -0000 1.3 --- SourceRange.cpp 10 May 2003 10:55:38 -0000 1.4 *************** *** 22,26 **** SourceRange::SourceRange( int startIndex, ! int length ) : startIndex_( startIndex ) , length_( length ) --- 22,26 ---- SourceRange::SourceRange( int startIndex, ! int length ) : startIndex_( startIndex ) , length_( length ) |
From: <bl...@us...> - 2003-05-10 10:55:18
|
Update of /cvsroot/cpptool/rfta/include/rfta/refactoring In directory sc8-pr-cvs1:/tmp/cvs-serv7548/include/rfta/refactoring Modified Files: RenameTempRefactoring.h Log Message: * fixed crash that occurred when trying to resolve an identifier after it has gone out of scope: { { int index; } index; } => crashed * added test to check that refactoring fail if identifier out of scope Index: RenameTempRefactoring.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/RenameTempRefactoring.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** RenameTempRefactoring.h 22 Dec 2002 16:03:50 -0000 1.11 --- RenameTempRefactoring.h 10 May 2003 10:55:15 -0000 1.12 *************** *** 23,26 **** --- 23,27 ---- public: /*! Constructs a RenameTempRefactoring object. + * \exception RefactoringError on failure (selection is not a local variable...) */ RenameTempRefactoring( TextDocument &document, *************** *** 30,37 **** --- 31,47 ---- virtual ~RenameTempRefactoring(); + /*! Apply the refactoring, renaming the local variable with the specified name. + * \exception RefactoringError on failure (selection is not a local variable...) + */ void apply( const std::string &newTemporaryName ); + /*! Returns the original local variable name. + * \exception RefactoringError on failure (selection is not a local variable...) + */ const std::string getOldVariableName() const; + /*! Apply the number of occurrences of the local variable. + * \exception RefactoringError on failure (selection is not a local variable...) + */ int getVariableOccurrenceCount() const; |
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv7548/src/rfta Modified Files: IdentifierResolverContext.cpp IdentifierResolverContextTest.cpp IdentifierResolverContextTest.h RenameTempRefactoringTest.cpp RenameTempRefactoringTest.h Log Message: * fixed crash that occurred when trying to resolve an identifier after it has gone out of scope: { { int index; } index; } => crashed * added test to check that refactoring fail if identifier out of scope Index: IdentifierResolverContext.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/IdentifierResolverContext.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** IdentifierResolverContext.cpp 27 Apr 2003 22:02:02 -0000 1.7 --- IdentifierResolverContext.cpp 10 May 2003 10:55:14 -0000 1.8 *************** *** 7,10 **** --- 7,11 ---- #include "IdentifierResolverContext.h" #include <rfta/parser/ASTNodes.h> + #include <stdexcept> *************** *** 32,35 **** --- 33,40 ---- IdentifierResolverContext::exitLocalVariableScope() { + if ( scopeLocalVariables_.empty() ) + throw std::logic_error( "IdentifierResolverContext::exitLocalVariableScope(): " + "no matching enterNewLocalVariableScope()." ); + LocalVariables &variables = scopeLocalVariables_.back(); LocalVariables::iterator it = variables.begin(); *************** *** 38,42 **** { const ASTNodePtr &node = *it++; ! visibleLocalVariables_[ getLocalVariableName(node) ].pop_front(); } --- 43,58 ---- { const ASTNodePtr &node = *it++; ! VisibleLocalVariables::iterator itName = ! visibleLocalVariables_.find( getLocalVariableName(node) ); ! if ( itName == visibleLocalVariables_.end() ) ! { ! throw std::logic_error( "IdentifierResolverContext::exitLocalVariableScope(): " ! "inconsitent state, variable declared but not in visible variable list." ); ! } ! ! if ( itName->second.size() == 1 ) ! visibleLocalVariables_.erase( itName ); ! else ! itName->second.pop_front(); } *************** *** 69,72 **** --- 85,95 ---- if ( it == visibleLocalVariables_.end() ) return; + + if ( it->second.empty() ) + { + throw std::logic_error( "IdentifierResolverContext::resolveUnqualifiedIdentifier( " + + identifierNode->getBlankedText() + "): variable found in " + "list of visible variable, but no declaration found!" ); + } const ASTNodePtr &localVariableDeclNode = it->second.front(); Index: IdentifierResolverContextTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/IdentifierResolverContextTest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IdentifierResolverContextTest.cpp 27 Apr 2003 22:02:02 -0000 1.4 --- IdentifierResolverContextTest.cpp 10 May 2003 10:55:14 -0000 1.5 *************** *** 165,167 **** --- 165,197 ---- + void + IdentifierResolverContextTest::testLocalVariableResolutionFailIfOutOfScope() + { + builder_->add( "{" ); + builder_->add( " {" ); + builder_->addKeyingMid( " int ", "x", ";", "x.0" ); + builder_->add( " }" ); + builder_->addKeyingMid( " ", "x", ";", "x.1" ); + builder_->add( "}" ); + + initializeResolver(); + ASTNodePtr x0 = getVariableNode( "x.0" ); + ASTNodePtr x1 = getIdentifierNode( "x.1" ); + context_->enterNewLocalVariableScope(); + + context_->enterNewLocalVariableScope(); + context_->declareLocalVariable( x0 ); + context_->exitLocalVariableScope(); + + context_->resolveUnqualifiedIdentifier( x1 ); + context_->exitLocalVariableScope(); + + CPPUNIT_ASSERT( context_->isLocalVariableIdentifier( getIdentifierNode( "x.0" ) ) ); + CPPUNIT_ASSERT( x0 == + context_->getLocalVariableIdentifierDeclaration( getIdentifierNode( "x.0" ) ) ); + + CPPUNIT_ASSERT( !context_->isLocalVariableIdentifier( x1 ) ); + } + + } // namespace Refactoring Index: IdentifierResolverContextTest.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/IdentifierResolverContextTest.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IdentifierResolverContextTest.h 16 Dec 2002 20:09:46 -0000 1.3 --- IdentifierResolverContextTest.h 10 May 2003 10:55:14 -0000 1.4 *************** *** 22,25 **** --- 22,26 ---- CPPUNIT_TEST( testLocalVariableResolutionWithSubScope ); CPPUNIT_TEST( testDeclareNewLocalVariableInSubScope ); + CPPUNIT_TEST( testLocalVariableResolutionFailIfOutOfScope ); CPPUNIT_TEST_SUITE_END(); *************** *** 38,41 **** --- 39,43 ---- void testLocalVariableResolutionWithSubScope(); void testDeclareNewLocalVariableInSubScope(); + void testLocalVariableResolutionFailIfOutOfScope(); private: Index: RenameTempRefactoringTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/RenameTempRefactoringTest.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RenameTempRefactoringTest.cpp 5 Apr 2003 12:14:45 -0000 1.15 --- RenameTempRefactoringTest.cpp 10 May 2003 10:55:14 -0000 1.16 *************** *** 8,11 **** --- 8,12 ---- #include <rfta/refactoring/RenameTempRefactoring.h> #include <rfta/refactoring/PlainTextDocument.h> + #include <rfta/refactoring/RefactoringError.h> *************** *** 242,245 **** --- 243,270 ---- RFTA_ASSERT_EQUAL( expectedSource, actualSource ); } + + + void + RenameTempRefactoringTest::testFailIfDeclarationNotInScope() + { + builder_->add( + "{" + " { int index; }" + ); + builder_->addKeyingMid( " ", "index", ";", "selection" ); + builder_->add( + "}" ); + + try + { + applyRefactoring( "index2", "index" ); + CPPUNIT_FAIL( "applyRefactoring() should have thrown a RefactoringError exception." ); + } + catch ( RefactoringError &e ) + { + RFTA_ASSERT_EQUAL( RefactoringError::identifierIsNotLocalVariable, e.getCause() ); + } + } + Index: RenameTempRefactoringTest.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/RenameTempRefactoringTest.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RenameTempRefactoringTest.h 5 Apr 2003 12:14:45 -0000 1.9 --- RenameTempRefactoringTest.h 10 May 2003 10:55:14 -0000 1.10 *************** *** 26,29 **** --- 26,30 ---- CPPUNIT_TEST( testRenameInVariableInitializer ); CPPUNIT_TEST( testSelectInSubScope ); + CPPUNIT_TEST( testFailIfDeclarationNotInScope ); CPPUNIT_TEST_SUITE_END(); *************** *** 47,50 **** --- 48,53 ---- void testSelectInSubScope(); + + void testFailIfDeclarationNotInScope(); private: |
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv20545/src/rfta Modified Files: LineBasedTextDocument.cpp LineBasedTextDocumentTest.cpp LineBasedTextDocumentTest.h MockLineBasedTextDocument.cpp Log Message: * added support for tab within line based document Index: LineBasedTextDocument.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/LineBasedTextDocument.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LineBasedTextDocument.cpp 25 Dec 2002 22:39:46 -0000 1.5 --- LineBasedTextDocument.cpp 10 May 2003 07:49:37 -0000 1.6 *************** *** 179,185 **** } ! index += location.columnNumber_; ! if ( index > content_.length() ) ! index = content_.length(); return index; --- 179,190 ---- } ! int column = 0; ! while ( column < location.columnNumber_ && index < content_.length() ) ! { ! if ( content_[index++] == '\t' ) ! column = ((column + tabSize_) / tabSize_) * tabSize_; ! else ! ++column; ! } return index; *************** *** 213,218 **** --- 218,229 ---- int columnNumber = index; int lastEOLIndex = content_.find_last_of( '\n', index-1 ); + const char *lineStart = start; if ( lastEOLIndex != std::string::npos ) + { columnNumber -= lastEOLIndex + 1; + lineStart += lastEOLIndex + 1; + } + + columnNumber += std::count( lineStart, lineStart + columnNumber, '\t' ) * (tabSize_-1); return Location( lineNumber, columnNumber ); Index: LineBasedTextDocumentTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/LineBasedTextDocumentTest.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LineBasedTextDocumentTest.cpp 25 Dec 2002 22:39:46 -0000 1.5 --- LineBasedTextDocumentTest.cpp 10 May 2003 07:49:37 -0000 1.6 *************** *** 15,19 **** LineBasedTextDocumentTest::LineBasedTextDocumentTest() ! : CppUnit::TestFixture() { } --- 15,19 ---- LineBasedTextDocumentTest::LineBasedTextDocumentTest() ! : tabSize_( 8 ) { } *************** *** 28,32 **** LineBasedTextDocumentTest::setUp() { ! document_.reset( new MockLineBasedTextDocument( 3 ) ); } --- 28,32 ---- LineBasedTextDocumentTest::setUp() { ! document_.reset( new MockLineBasedTextDocument( tabSize_ ) ); } *************** *** 48,52 **** expectedSelectionEnd ); document_->setSelectionRange( SourceRange( selectionStartIndex, ! selectionLength ) ); document_->verify(); } --- 48,52 ---- expectedSelectionEnd ); document_->setSelectionRange( SourceRange( selectionStartIndex, ! selectionLength ) ); document_->verify(); } *************** *** 88,91 **** --- 88,140 ---- line2Index-1, line3Index-(line2Index-1)+4 ); // checkSetSelection( Location( 0,0 ), Location(4,0), 0,line4Index ); + } + + + void + LineBasedTextDocumentTest::testSetSelectionAfterTab() + { + std::string source( "\t\tSome Text\n" ); + int line1Index = source.length(); + source += "li\tne 2\n"; + int line2Index = source.length(); + source += "\tline3"; + document_->setContent( source ); + + checkSetSelection( Location( 0,0 ), Location(0,tabSize_), 0,1 ); + checkSetSelection( Location( 0,0 ), Location(0,tabSize_*2), 0,2 ); + checkSetSelection( Location( 0,0 ), Location(0,tabSize_*2+4), 0,2+4 ); + checkSetSelection( Location( 0,tabSize_ ), Location(0,tabSize_*2+5), 1,1+5 ); + + checkSetSelection( Location( 1,0 ), Location(1,6+tabSize_), line1Index,1+6 ); + checkSetSelection( Location( 1,2+tabSize_ ), Location(2,tabSize_+4), + line1Index+3, line2Index - (line1Index+3) + 1 + 4 ); + } + + + void + LineBasedTextDocumentTest::testGetSelectionAfterTab() + { + std::string source( "\t\tSome Text\n" ); + int line1Index = source.length(); + source += "li\tne 2\n"; + int line2Index = source.length(); + source += "\tline3"; + document_->setContent( source ); + + checkGetSelection( SourceRange(0,3), Location(0,0), Location(0,tabSize_*2+1) ); + checkGetSelection( SourceRange(0,3), Location(0,0), Location(0,tabSize_*2+1) ); + checkGetSelection( SourceRange(1,1+4), Location(0,tabSize_), Location(0,tabSize_*2+4) ); + checkGetSelection( SourceRange(1,line1Index-1+5), Location(0,tabSize_), Location(1,tabSize_+2) ); + } + + + void + LineBasedTextDocumentTest::checkGetSelection( const SourceRange &expectedSelectionRange, + const Location &selectionStart, + const Location &selectionEnd ) + { + document_->setExpectedSelectionRange( selectionStart, selectionEnd ); + SourceRange actualRange = document_->getSelectionRange(); + RFTA_ASSERT_EQUAL( expectedSelectionRange, actualRange ); } Index: LineBasedTextDocumentTest.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/LineBasedTextDocumentTest.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LineBasedTextDocumentTest.h 6 Nov 2002 20:49:15 -0000 1.1 --- LineBasedTextDocumentTest.h 10 May 2003 07:49:37 -0000 1.2 *************** *** 21,24 **** --- 21,26 ---- CPPUNIT_TEST( testSetSelectionOnFirstLine ); CPPUNIT_TEST( testSetSelectionOnManyLines ); + CPPUNIT_TEST( testSetSelectionAfterTab ); + CPPUNIT_TEST( testGetSelectionAfterTab ); CPPUNIT_TEST_SUITE_END(); *************** *** 37,40 **** --- 39,46 ---- void testSetSelectionOnManyLines(); + void testSetSelectionAfterTab(); + + void testGetSelectionAfterTab(); + private: typedef MockLineBasedTextDocument::Location Location; *************** *** 45,49 **** --- 51,60 ---- int selectionLength ); + void checkGetSelection( const SourceRange &expectedSelectionRange, + const Location &selectionStart, + const Location &selectionEnd ); + boost::shared_ptr<MockLineBasedTextDocument> document_; + const int tabSize_; }; Index: MockLineBasedTextDocument.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/MockLineBasedTextDocument.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MockLineBasedTextDocument.cpp 25 Dec 2002 22:39:46 -0000 1.2 --- MockLineBasedTextDocument.cpp 10 May 2003 07:49:37 -0000 1.3 *************** *** 33,37 **** void MockLineBasedTextDocument::setExpectedSelectionRange( const Location &selectionStart, ! const Location &selectionEnd ) { selectionStart_ = selectionStart; --- 33,37 ---- void MockLineBasedTextDocument::setExpectedSelectionRange( const Location &selectionStart, ! const Location &selectionEnd ) { selectionStart_ = selectionStart; *************** *** 54,58 **** { selectionStart_ = selectionStart; ! selectionEnd_ = selectionEnd_; addActual( "doSetSelectionRange(): start=" + selectionStart.toString() + --- 54,58 ---- { selectionStart_ = selectionStart; ! selectionEnd_ = selectionEnd; addActual( "doSetSelectionRange(): start=" + selectionStart.toString() + |
From: <bl...@us...> - 2003-05-06 07:53:33
|
Update of /cvsroot/cpptool/rfta/bug In directory sc8-pr-cvs1:/tmp/cvs-serv27128 Modified Files: List.txt Log Message: * add bug found for pure virtual function declaration Index: List.txt =================================================================== RCS file: /cvsroot/cpptool/rfta/bug/List.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** List.txt 5 May 2003 08:03:31 -0000 1.8 --- List.txt 6 May 2003 07:53:30 -0000 1.9 *************** *** 82,87 **** unsigned long visibleColour; => range extends to the end of the compound statement ! --- --- 82,91 ---- unsigned long visibleColour; => range extends to the end of the compound statement ! --- ! pure virtual method declaration is not parsed correctly (audacity\exportmp3.h.html) ! virtual wxString GetLibraryName() = 0; + => '=0' get parse as an assignment initializer expression. + --- |
From: <bl...@us...> - 2003-05-05 08:15:49
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv20028/src/rftaparser Modified Files: MiniParserTest.cpp MiniParserTest.h Log Message: * added callback to function member test using Boost.Bind. Index: MiniParserTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/MiniParserTest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MiniParserTest.cpp 4 May 2003 22:13:51 -0000 1.2 --- MiniParserTest.cpp 5 May 2003 07:37:09 -0000 1.3 *************** *** 6,9 **** --- 6,11 ---- #include "stdafx.h" #include "MiniParserTest.h" + #include <functional> + #include <boost/bind.hpp> *************** *** 72,75 **** --- 74,78 ---- MiniParserTest::setUp() { + callbackText_ = Xtl::CStringView(); } *************** *** 216,226 **** } void MiniParserTest::testParseCallback() { ! const Xtl::MiniParser &parser = Xtl::spaces>> Xtl::StringMiniParser( "ab" )[&callback1] >> Xtl::spaces; const std::string text( " ab " ); RFTA_ASSERT_MINIPARSER_PASS( text, parser ); RFTA_ASSERT_EQUAL( "ab", callback1Text.str() ); } --- 219,248 ---- } + + void + MiniParserTest::callback( const Xtl::CStringView &text ) + { + callbackText_ = text; + } + + void MiniParserTest::testParseCallback() { ! const Xtl::MiniParser &parser = Xtl::spaces >> Xtl::StringMiniParser( "ab" )[&callback1] >> Xtl::spaces; const std::string text( " ab " ); RFTA_ASSERT_MINIPARSER_PASS( text, parser ); RFTA_ASSERT_EQUAL( "ab", callback1Text.str() ); + + Xtl::MiniParser::MatchedCallback fcb; + fcb = boost::bind( &MiniParserTest::callback, this, _1 ); + + + const Xtl::MiniParser &parser2 = + Xtl::spaces + >> Xtl::StringMiniParser( "ab" )[boost::bind( &MiniParserTest::callback, this, _1 )] + >> Xtl::spaces; + RFTA_ASSERT_MINIPARSER_PASS( text, parser2 ); + RFTA_ASSERT_EQUAL( "ab", callbackText_.str() ); } Index: MiniParserTest.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/MiniParserTest.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MiniParserTest.h 4 May 2003 22:13:51 -0000 1.2 --- MiniParserTest.h 5 May 2003 07:37:09 -0000 1.3 *************** *** 60,63 **** --- 60,66 ---- private: + void callback( const Xtl::CStringView &text ); + + Xtl::CStringView callbackText_; }; |