Skip to content

Commit 93e3ae1

Browse files
committed
Start to editor.rereplace rewrite
* Boost Regex integrated, using the N++/Scintilla regex code from François-R Boyer * Test Project * Basic converters from the GroupDetail to the ReplaceEntry - the plan is to have the converter call the python function, if one is specified in arguments to rereplace, otherwise to create the text to replace it with. If there are no $ or \ in the replacement string, then the replacement string can, I think, be presumed to be constant, and therefore only allocated once. Needs more tests to check the UTF-8 to UTF-32 conversions are working correctly, and handling UTF-8 encoded char*'s properly. Also need to extract various things as templates to cope with ANSI encoded documents
1 parent 61576ff commit 93e3ae1

29 files changed

Lines changed: 1713 additions & 10 deletions
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<ProjectGuid>{141C090A-DF76-456E-8B54-1E2C9E5AE75A}</ProjectGuid>
15+
<Keyword>Win32Proj</Keyword>
16+
<RootNamespace>PythonScriptTests</RootNamespace>
17+
</PropertyGroup>
18+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
20+
<ConfigurationType>Application</ConfigurationType>
21+
<UseDebugLibraries>true</UseDebugLibraries>
22+
<CharacterSet>Unicode</CharacterSet>
23+
</PropertyGroup>
24+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
25+
<ConfigurationType>Application</ConfigurationType>
26+
<UseDebugLibraries>false</UseDebugLibraries>
27+
<WholeProgramOptimization>true</WholeProgramOptimization>
28+
<CharacterSet>Unicode</CharacterSet>
29+
</PropertyGroup>
30+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
31+
<ImportGroup Label="ExtensionSettings">
32+
</ImportGroup>
33+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
34+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
35+
<Import Project="..\PythonScript\project\PythonSettings.props" />
36+
</ImportGroup>
37+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
38+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
39+
<Import Project="..\PythonScript\project\PythonSettings.props" />
40+
</ImportGroup>
41+
<PropertyGroup Label="UserMacros" />
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
43+
<LinkIncremental>true</LinkIncremental>
44+
<IncludePath>$(BoostBase);$(PythonBase)\Include;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;</IncludePath>
45+
<LibraryPath>$(BoostPythonLibPath);$(PythonLibPath);$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib</LibraryPath>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
48+
<LinkIncremental>false</LinkIncremental>
49+
</PropertyGroup>
50+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
51+
<ClCompile>
52+
<PrecompiledHeader>Use</PrecompiledHeader>
53+
<WarningLevel>Level3</WarningLevel>
54+
<Optimization>Disabled</Optimization>
55+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
56+
<AdditionalIncludeDirectories>gtest\include;..\PythonScript\src;$(BoostBase);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
57+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
58+
</ClCompile>
59+
<Link>
60+
<SubSystem>Console</SubSystem>
61+
<GenerateDebugInformation>true</GenerateDebugInformation>
62+
<AdditionalDependencies>bin\$(Configuration)\gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
63+
<AdditionalLibraryDirectories>
64+
</AdditionalLibraryDirectories>
65+
</Link>
66+
<PostBuildEvent>
67+
<Command>$(TargetDir)$(TargetFileName)</Command>
68+
</PostBuildEvent>
69+
</ItemDefinitionGroup>
70+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
71+
<ClCompile>
72+
<WarningLevel>Level3</WarningLevel>
73+
<PrecompiledHeader>Use</PrecompiledHeader>
74+
<Optimization>MaxSpeed</Optimization>
75+
<FunctionLevelLinking>true</FunctionLevelLinking>
76+
<IntrinsicFunctions>true</IntrinsicFunctions>
77+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
79+
</ClCompile>
80+
<Link>
81+
<SubSystem>Console</SubSystem>
82+
<GenerateDebugInformation>true</GenerateDebugInformation>
83+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
84+
<OptimizeReferences>true</OptimizeReferences>
85+
</Link>
86+
</ItemDefinitionGroup>
87+
<ItemGroup>
88+
<None Include="ReadMe.txt" />
89+
</ItemGroup>
90+
<ItemGroup>
91+
<ClInclude Include="stdafx.h" />
92+
<ClInclude Include="targetver.h" />
93+
</ItemGroup>
94+
<ItemGroup>
95+
<ClCompile Include="..\PythonScript\src\Replacer.cpp" />
96+
<ClCompile Include="..\PythonScript\src\UTF8Iterator.cpp" />
97+
<ClCompile Include="..\PythonScript\src\UtfConversion.cpp" />
98+
<ClCompile Include="TestRunner.cpp" />
99+
<ClCompile Include="stdafx.cpp">
100+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
101+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
102+
</ClCompile>
103+
<ClCompile Include="tests\TestReplacer.cpp" />
104+
</ItemGroup>
105+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
106+
<ImportGroup Label="ExtensionTargets">
107+
</ImportGroup>
108+
</Project>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
<Filter Include="Source Files\tests">
17+
<UniqueIdentifier>{407f0668-c53b-40e1-8349-70bcd8d3b67d}</UniqueIdentifier>
18+
</Filter>
19+
<Filter Include="Source Files\linkedCode">
20+
<UniqueIdentifier>{c1369108-864d-43af-b11e-181eb263b5b6}</UniqueIdentifier>
21+
</Filter>
22+
</ItemGroup>
23+
<ItemGroup>
24+
<None Include="ReadMe.txt" />
25+
</ItemGroup>
26+
<ItemGroup>
27+
<ClInclude Include="stdafx.h">
28+
<Filter>Header Files</Filter>
29+
</ClInclude>
30+
<ClInclude Include="targetver.h">
31+
<Filter>Header Files</Filter>
32+
</ClInclude>
33+
</ItemGroup>
34+
<ItemGroup>
35+
<ClCompile Include="stdafx.cpp">
36+
<Filter>Source Files</Filter>
37+
</ClCompile>
38+
<ClCompile Include="TestRunner.cpp">
39+
<Filter>Source Files</Filter>
40+
</ClCompile>
41+
<ClCompile Include="tests\TestReplacer.cpp">
42+
<Filter>Source Files\tests</Filter>
43+
</ClCompile>
44+
<ClCompile Include="..\PythonScript\src\Replacer.cpp">
45+
<Filter>Source Files\linkedCode</Filter>
46+
</ClCompile>
47+
<ClCompile Include="..\PythonScript\src\UTF8Iterator.cpp">
48+
<Filter>Source Files\linkedCode</Filter>
49+
</ClCompile>
50+
<ClCompile Include="..\PythonScript\src\UtfConversion.cpp">
51+
<Filter>Source Files\linkedCode</Filter>
52+
</ClCompile>
53+
</ItemGroup>
54+
</Project>

PythonScript.Tests/ReadMe.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
========================================================================
2+
CONSOLE APPLICATION : PythonScript.Tests Project Overview
3+
========================================================================
4+
5+
AppWizard has created this PythonScript.Tests application for you.
6+
7+
This file contains a summary of what you will find in each of the files that
8+
make up your PythonScript.Tests application.
9+
10+
11+
PythonScript.Tests.vcxproj
12+
This is the main project file for VC++ projects generated using an Application Wizard.
13+
It contains information about the version of Visual C++ that generated the file, and
14+
information about the platforms, configurations, and project features selected with the
15+
Application Wizard.
16+
17+
PythonScript.Tests.vcxproj.filters
18+
This is the filters file for VC++ projects generated using an Application Wizard.
19+
It contains information about the association between the files in your project
20+
and the filters. This association is used in the IDE to show grouping of files with
21+
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
22+
"Source Files" filter).
23+
24+
PythonScript.Tests.cpp
25+
This is the main application source file.
26+
27+
/////////////////////////////////////////////////////////////////////////////
28+
Other standard files:
29+
30+
StdAfx.h, StdAfx.cpp
31+
These files are used to build a precompiled header (PCH) file
32+
named PythonScript.Tests.pch and a precompiled types file named StdAfx.obj.
33+
34+
/////////////////////////////////////////////////////////////////////////////
35+
Other notes:
36+
37+
AppWizard uses "TODO:" comments to indicate parts of the source code you
38+
should add to or customize.
39+
40+
/////////////////////////////////////////////////////////////////////////////

PythonScript.Tests/TestRunner.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// PythonScript.Tests.cpp : Defines the entry point for the console application.
2+
//
3+
4+
#include "stdafx.h"
5+
#include <gtest/gtest.h>
6+
7+
int main(int argc, char* argv[])
8+
{
9+
::testing::InitGoogleTest(&argc, argv);
10+
return RUN_ALL_TESTS();
11+
}
12+

PythonScript.Tests/gtest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit be1b3b66822cc3929f3da700973cef88bf45849a
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
========================================================================
2+
STATIC LIBRARY : gtest.vcxproj Project Overview
3+
========================================================================
4+
5+
AppWizard has created this gtest.vcxproj library project for you.
6+
7+
No source files were created as part of your project.
8+
9+
10+
gtest.vcxproj.vcxproj
11+
This is the main project file for VC++ projects generated using an Application Wizard.
12+
It contains information about the version of Visual C++ that generated the file, and
13+
information about the platforms, configurations, and project features selected with the
14+
Application Wizard.
15+
16+
gtest.vcxproj.vcxproj.filters
17+
This is the filters file for VC++ projects generated using an Application Wizard.
18+
It contains information about the association between the files in your project
19+
and the filters. This association is used in the IDE to show grouping of files with
20+
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
21+
"Source Files" filter).
22+
23+
/////////////////////////////////////////////////////////////////////////////
24+
Other notes:
25+
26+
AppWizard uses "TODO:" comments to indicate parts of the source code you
27+
should add to or customize.
28+
29+
/////////////////////////////////////////////////////////////////////////////
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<ProjectGuid>{2DDE822D-E7AC-4650-B875-D33FADC0EED9}</ProjectGuid>
15+
<Keyword>Win32Proj</Keyword>
16+
<RootNamespace>gtestvcxproj</RootNamespace>
17+
</PropertyGroup>
18+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
20+
<ConfigurationType>StaticLibrary</ConfigurationType>
21+
<UseDebugLibraries>true</UseDebugLibraries>
22+
<CharacterSet>Unicode</CharacterSet>
23+
</PropertyGroup>
24+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
25+
<ConfigurationType>StaticLibrary</ConfigurationType>
26+
<UseDebugLibraries>false</UseDebugLibraries>
27+
<WholeProgramOptimization>true</WholeProgramOptimization>
28+
<CharacterSet>Unicode</CharacterSet>
29+
</PropertyGroup>
30+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
31+
<ImportGroup Label="ExtensionSettings">
32+
</ImportGroup>
33+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
34+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
35+
</ImportGroup>
36+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
37+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
38+
</ImportGroup>
39+
<PropertyGroup Label="UserMacros" />
40+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
41+
<OutDir>$(ProjectDir)..\bin\$(Configuration)\</OutDir>
42+
</PropertyGroup>
43+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
44+
<OutDir>$(ProjectDir)..\bin\$(Configuration)\</OutDir>
45+
</PropertyGroup>
46+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
47+
<ClCompile>
48+
<PrecompiledHeader>
49+
</PrecompiledHeader>
50+
<WarningLevel>Level3</WarningLevel>
51+
<Optimization>Disabled</Optimization>
52+
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
53+
<AdditionalIncludeDirectories>..\gtest;..\gtest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
54+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
55+
</ClCompile>
56+
<Link>
57+
<SubSystem>Windows</SubSystem>
58+
<GenerateDebugInformation>true</GenerateDebugInformation>
59+
</Link>
60+
</ItemDefinitionGroup>
61+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
62+
<ClCompile>
63+
<WarningLevel>Level3</WarningLevel>
64+
<PrecompiledHeader>
65+
</PrecompiledHeader>
66+
<Optimization>MaxSpeed</Optimization>
67+
<FunctionLevelLinking>true</FunctionLevelLinking>
68+
<IntrinsicFunctions>true</IntrinsicFunctions>
69+
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
70+
</ClCompile>
71+
<Link>
72+
<SubSystem>Windows</SubSystem>
73+
<GenerateDebugInformation>true</GenerateDebugInformation>
74+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
75+
<OptimizeReferences>true</OptimizeReferences>
76+
</Link>
77+
</ItemDefinitionGroup>
78+
<ItemGroup>
79+
<None Include="ReadMe.txt" />
80+
</ItemGroup>
81+
<ItemGroup>
82+
<ClCompile Include="..\gtest\src\gtest-all.cc" />
83+
</ItemGroup>
84+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
85+
<ImportGroup Label="ExtensionTargets">
86+
</ImportGroup>
87+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<None Include="ReadMe.txt" />
19+
</ItemGroup>
20+
<ItemGroup>
21+
<ClCompile Include="..\gtest\src\gtest-all.cc">
22+
<Filter>Source Files</Filter>
23+
</ClCompile>
24+
</ItemGroup>
25+
</Project>

PythonScript.Tests/stdafx.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// stdafx.cpp : source file that includes just the standard includes
2+
// PythonScript.Tests.pch will be the pre-compiled header
3+
// stdafx.obj will contain the pre-compiled type information
4+
5+
#include "stdafx.h"
6+
7+
// TODO: reference any additional headers you need in STDAFX.H
8+
// and not in this file

0 commit comments

Comments
 (0)