diff --git a/PageCompiler/File2Page/File2Page.progen b/PageCompiler/File2Page/File2Page.progen
new file mode 100644
index 000000000..635279419
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page.progen
@@ -0,0 +1,16 @@
+vc.project.guid = 8BD05B6C-A179-40F1-BD17-6EA813055883
+vc.project.name = File2Page
+vc.project.target = f2cpsp
+vc.project.type = executable
+vc.project.pocobase = ..\\..
+vc.project.outdir = ${vc.project.pocobase}
+vc.project.platforms = Win32, x64
+vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
+vc.project.prototype = ${vc.project.name}_vs90.vcproj
+vc.project.compiler.include = ..\\..\\Foundation\\include;..\\..\\XML\\include;..\\..\\Util\\include;..\\..\\Net\\include
+vc.project.compiler.defines =
+vc.project.compiler.defines.shared =
+vc.project.compiler.defines.debug_shared = ${vc.project.compiler.defines.shared}
+vc.project.compiler.defines.release_shared = ${vc.project.compiler.defines.shared}
+vc.project.linker.dependencies = ws2_32.lib iphlpapi.lib
+vc.solution.create = true
diff --git a/PageCompiler/File2Page/File2Page_vs100.sln b/PageCompiler/File2Page/File2Page_vs100.sln
new file mode 100644
index 000000000..fab14ae25
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_vs100.sln
@@ -0,0 +1,37 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "File2Page", "File2Page_vs100.vcxproj", "{8BD05B6C-A179-40F1-BD17-6EA813055883}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ debug_shared|Win32 = debug_shared|Win32
+ release_shared|Win32 = release_shared|Win32
+ debug_static_mt|Win32 = debug_static_mt|Win32
+ release_static_mt|Win32 = release_static_mt|Win32
+ debug_static_md|Win32 = debug_static_md|Win32
+ release_static_md|Win32 = release_static_md|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|Win32.Build.0 = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|Win32.ActiveCfg = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|Win32.Build.0 = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|Win32.Deploy.0 = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|Win32.Build.0 = release_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/PageCompiler/File2Page/File2Page_vs100.vcxproj b/PageCompiler/File2Page/File2Page_vs100.vcxproj
new file mode 100644
index 000000000..483284cad
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_vs100.vcxproj
@@ -0,0 +1,299 @@
+
+
+
+
+ debug_shared
+ Win32
+
+
+ debug_static_md
+ Win32
+
+
+ debug_static_mt
+ Win32
+
+
+ release_shared
+ Win32
+
+
+ release_static_md
+ Win32
+
+
+ release_static_mt
+ Win32
+
+
+
+ File2Page
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}
+ File2Page
+ Win32Proj
+
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.30319.1
+ bin\
+ obj\$(Configuration)\
+ true
+ bin\
+ obj\$(Configuration)\
+ false
+ bin\static_mt\
+ obj\$(Configuration)\
+ true
+ bin\static_mt\
+ obj\$(Configuration)\
+ false
+ bin\static_md\
+ obj\$(Configuration)\
+ true
+ bin\static_md\
+ obj\$(Configuration)\
+ false
+ f2cpspd
+ f2cpspd
+ f2cpspd
+ f2cpsp
+ f2cpsp
+ f2cpsp
+
+
+
+ Disabled
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ true
+ true
+ true
+ true
+
+ Level3
+ EditAndContinue
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin\f2cpspd.exe
+ ..\..\lib;%(AdditionalLibraryDirectories)
+ true
+ true
+ bin\f2cpspd.pdb
+ Console
+ MachineX86
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin\f2cpsp.exe
+ ..\..\lib;%(AdditionalLibraryDirectories)
+ false
+ Console
+ true
+ true
+ MachineX86
+
+
+
+
+ Disabled
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebug
+ true
+ true
+ true
+ true
+
+ Level3
+ EditAndContinue
+ Default
+ %(DisableSpecificWarnings)
+
+
+ iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin\static_mt\f2cpspd.exe
+ ..\..\lib;%(AdditionalLibraryDirectories)
+ true
+ true
+ bin\static_mt\f2cpspd.pdb
+ Console
+ MachineX86
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ MultiThreaded
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin\static_mt\f2cpsp.exe
+ ..\..\lib;%(AdditionalLibraryDirectories)
+ false
+ Console
+ true
+ true
+ MachineX86
+
+
+
+
+ Disabled
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ true
+ true
+ true
+ true
+
+ Level3
+ EditAndContinue
+ Default
+ %(DisableSpecificWarnings)
+
+
+ iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin\static_md\f2cpspd.exe
+ ..\..\lib;%(AdditionalLibraryDirectories)
+ true
+ true
+ bin\static_md\f2cpspd.pdb
+ Console
+ MachineX86
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin\static_md\f2cpsp.exe
+ ..\..\lib;%(AdditionalLibraryDirectories)
+ false
+ Console
+ true
+ true
+ MachineX86
+
+
+
+
+
+
+
+
diff --git a/PageCompiler/File2Page/File2Page_vs100.vcxproj.filters b/PageCompiler/File2Page/File2Page_vs100.vcxproj.filters
new file mode 100644
index 000000000..659e6b857
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_vs100.vcxproj.filters
@@ -0,0 +1,16 @@
+
+
+
+
+ {4948e04d-f90f-466a-9fdb-65538a075bd7}
+
+
+ {3c3462cc-40d8-4b01-8f17-e96e771192c6}
+
+
+
+
+ Source Files
+
+
+
\ No newline at end of file
diff --git a/PageCompiler/File2Page/File2Page_vs100.vcxproj.user b/PageCompiler/File2Page/File2Page_vs100.vcxproj.user
new file mode 100644
index 000000000..ace9a86ac
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_vs100.vcxproj.user
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/PageCompiler/File2Page/File2Page_vs71.sln b/PageCompiler/File2Page/File2Page_vs71.sln
new file mode 100644
index 000000000..5fbab6eb1
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_vs71.sln
@@ -0,0 +1,33 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "File2Page", "File2Page_vs71.vcproj", "{8BD05B6C-A179-40F1-BD17-6EA813055883}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ debug_shared = debug_shared
+ release_shared = release_shared
+ debug_static_mt = debug_static_mt
+ release_static_mt = release_static_mt
+ debug_static_md = debug_static_md
+ release_static_md = release_static_md
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared.ActiveCfg = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared.Build.0 = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared.ActiveCfg = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared.Build.0 = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt.ActiveCfg = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt.Build.0 = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt.ActiveCfg = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt.Build.0 = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md.ActiveCfg = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md.Build.0 = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md.ActiveCfg = release_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md.Build.0 = release_static_md|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/PageCompiler/File2Page/File2Page_vs71.vcproj b/PageCompiler/File2Page/File2Page_vs71.vcproj
new file mode 100644
index 000000000..5d6e75c6e
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_vs71.vcproj
@@ -0,0 +1,395 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PageCompiler/File2Page/File2Page_vs80.sln b/PageCompiler/File2Page/File2Page_vs80.sln
new file mode 100644
index 000000000..fc3eb6ff6
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_vs80.sln
@@ -0,0 +1,37 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "File2Page", "File2Page_vs80.vcproj", "{8BD05B6C-A179-40F1-BD17-6EA813055883}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ debug_shared|Win32 = debug_shared|Win32
+ release_shared|Win32 = release_shared|Win32
+ debug_static_mt|Win32 = debug_static_mt|Win32
+ release_static_mt|Win32 = release_static_mt|Win32
+ debug_static_md|Win32 = debug_static_md|Win32
+ release_static_md|Win32 = release_static_md|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|Win32.Build.0 = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|Win32.ActiveCfg = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|Win32.Build.0 = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|Win32.Deploy.0 = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|Win32.Build.0 = release_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/PageCompiler/File2Page/File2Page_vs80.vcproj b/PageCompiler/File2Page/File2Page_vs80.vcproj
new file mode 100644
index 000000000..9fabba504
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_vs80.vcproj
@@ -0,0 +1,435 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PageCompiler/File2Page/File2Page_vs90.sln b/PageCompiler/File2Page/File2Page_vs90.sln
new file mode 100644
index 000000000..009d09271
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_vs90.sln
@@ -0,0 +1,37 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "File2Page", "File2Page_vs90.vcproj", "{8BD05B6C-A179-40F1-BD17-6EA813055883}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ debug_shared|Win32 = debug_shared|Win32
+ release_shared|Win32 = release_shared|Win32
+ debug_static_mt|Win32 = debug_static_mt|Win32
+ release_static_mt|Win32 = release_static_mt|Win32
+ debug_static_md|Win32 = debug_static_md|Win32
+ release_static_md|Win32 = release_static_md|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|Win32.Build.0 = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|Win32.ActiveCfg = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|Win32.Build.0 = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|Win32.Deploy.0 = release_shared|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|Win32.Build.0 = release_static_md|Win32
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/PageCompiler/File2Page/File2Page_vs90.vcproj b/PageCompiler/File2Page/File2Page_vs90.vcproj
new file mode 100644
index 000000000..c8a2e18ed
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_vs90.vcproj
@@ -0,0 +1,435 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PageCompiler/File2Page/File2Page_x64_vs100.sln b/PageCompiler/File2Page/File2Page_x64_vs100.sln
new file mode 100644
index 000000000..90727bcf5
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_x64_vs100.sln
@@ -0,0 +1,37 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "File2Page", "File2Page_x64_vs100.vcxproj", "{8BD05B6C-A179-40F1-BD17-6EA813055883}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ debug_shared|x64 = debug_shared|x64
+ release_shared|x64 = release_shared|x64
+ debug_static_mt|x64 = debug_static_mt|x64
+ release_static_mt|x64 = release_static_mt|x64
+ debug_static_md|x64 = debug_static_md|x64
+ release_static_md|x64 = release_static_md|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|x64.ActiveCfg = debug_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|x64.Build.0 = debug_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|x64.Deploy.0 = debug_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|x64.ActiveCfg = release_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|x64.Build.0 = release_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|x64.Deploy.0 = release_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|x64.Build.0 = release_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|x64.Deploy.0 = release_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|x64.Build.0 = debug_static_md|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|x64.Deploy.0 = debug_static_md|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|x64.ActiveCfg = release_static_md|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|x64.Build.0 = release_static_md|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|x64.Deploy.0 = release_static_md|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/PageCompiler/File2Page/File2Page_x64_vs100.vcxproj b/PageCompiler/File2Page/File2Page_x64_vs100.vcxproj
new file mode 100644
index 000000000..cbb83644f
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_x64_vs100.vcxproj
@@ -0,0 +1,299 @@
+
+
+
+
+ debug_shared
+ x64
+
+
+ debug_static_md
+ x64
+
+
+ debug_static_mt
+ x64
+
+
+ release_shared
+ x64
+
+
+ release_static_md
+ x64
+
+
+ release_static_mt
+ x64
+
+
+
+ File2Page
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}
+ File2Page
+ Win32Proj
+
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.30319.1
+ bin64\
+ obj64\$(Configuration)\
+ true
+ bin64\
+ obj64\$(Configuration)\
+ false
+ bin64\static_mt\
+ obj64\$(Configuration)\
+ true
+ bin64\static_mt\
+ obj64\$(Configuration)\
+ false
+ bin64\static_md\
+ obj64\$(Configuration)\
+ true
+ bin64\static_md\
+ obj64\$(Configuration)\
+ false
+ f2cpspd
+ f2cpspd
+ f2cpspd
+ f2cpsp
+ f2cpsp
+ f2cpsp
+
+
+
+ Disabled
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ true
+ true
+ true
+ true
+
+ Level3
+ ProgramDatabase
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin64\f2cpspd.exe
+ ..\..\lib64;%(AdditionalLibraryDirectories)
+ true
+ true
+ bin64\f2cpspd.pdb
+ Console
+ MachineX64
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin64\f2cpsp.exe
+ ..\..\lib64;%(AdditionalLibraryDirectories)
+ false
+ Console
+ true
+ true
+ MachineX64
+
+
+
+
+ Disabled
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebug
+ true
+ true
+ true
+ true
+
+ Level3
+ ProgramDatabase
+ Default
+ %(DisableSpecificWarnings)
+
+
+ iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin64\static_mt\f2cpspd.exe
+ ..\..\lib64;%(AdditionalLibraryDirectories)
+ true
+ true
+ bin64\static_mt\f2cpspd.pdb
+ Console
+ MachineX64
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ MultiThreaded
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin64\static_mt\f2cpsp.exe
+ ..\..\lib64;%(AdditionalLibraryDirectories)
+ false
+ Console
+ true
+ true
+ MachineX64
+
+
+
+
+ Disabled
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ true
+ true
+ true
+ true
+
+ Level3
+ ProgramDatabase
+ Default
+ %(DisableSpecificWarnings)
+
+
+ iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin64\static_md\f2cpspd.exe
+ ..\..\lib64;%(AdditionalLibraryDirectories)
+ true
+ true
+ bin64\static_md\f2cpspd.pdb
+ Console
+ MachineX64
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)
+ bin64\static_md\f2cpsp.exe
+ ..\..\lib64;%(AdditionalLibraryDirectories)
+ false
+ Console
+ true
+ true
+ MachineX64
+
+
+
+
+
+
+
+
diff --git a/PageCompiler/File2Page/File2Page_x64_vs100.vcxproj.filters b/PageCompiler/File2Page/File2Page_x64_vs100.vcxproj.filters
new file mode 100644
index 000000000..e8df60479
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_x64_vs100.vcxproj.filters
@@ -0,0 +1,16 @@
+
+
+
+
+ {563c9d6f-8586-498a-86f5-fcd08a8cecdb}
+
+
+ {a4f7188a-2f9c-4129-8c27-9ebdb8759e37}
+
+
+
+
+ Source Files
+
+
+
\ No newline at end of file
diff --git a/PageCompiler/File2Page/File2Page_x64_vs100.vcxproj.user b/PageCompiler/File2Page/File2Page_x64_vs100.vcxproj.user
new file mode 100644
index 000000000..ace9a86ac
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_x64_vs100.vcxproj.user
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/PageCompiler/File2Page/File2Page_x64_vs90.sln b/PageCompiler/File2Page/File2Page_x64_vs90.sln
new file mode 100644
index 000000000..e86d9ab52
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_x64_vs90.sln
@@ -0,0 +1,37 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "File2Page", "File2Page_x64_vs90.vcproj", "{8BD05B6C-A179-40F1-BD17-6EA813055883}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ debug_shared|x64 = debug_shared|x64
+ release_shared|x64 = release_shared|x64
+ debug_static_mt|x64 = debug_static_mt|x64
+ release_static_mt|x64 = release_static_mt|x64
+ debug_static_md|x64 = debug_static_md|x64
+ release_static_md|x64 = release_static_md|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|x64.ActiveCfg = debug_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|x64.Build.0 = debug_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_shared|x64.Deploy.0 = debug_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|x64.ActiveCfg = release_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|x64.Build.0 = release_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_shared|x64.Deploy.0 = release_shared|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|x64.Build.0 = release_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_mt|x64.Deploy.0 = release_static_mt|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|x64.Build.0 = debug_static_md|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.debug_static_md|x64.Deploy.0 = debug_static_md|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|x64.ActiveCfg = release_static_md|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|x64.Build.0 = release_static_md|x64
+ {8BD05B6C-A179-40F1-BD17-6EA813055883}.release_static_md|x64.Deploy.0 = release_static_md|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/PageCompiler/File2Page/File2Page_x64_vs90.vcproj b/PageCompiler/File2Page/File2Page_x64_vs90.vcproj
new file mode 100644
index 000000000..a113e0558
--- /dev/null
+++ b/PageCompiler/File2Page/File2Page_x64_vs90.vcproj
@@ -0,0 +1,435 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PageCompiler/File2Page/Makefile b/PageCompiler/File2Page/Makefile
new file mode 100644
index 000000000..a4bcb5839
--- /dev/null
+++ b/PageCompiler/File2Page/Makefile
@@ -0,0 +1,17 @@
+#
+# Makefile
+#
+# $Id: //poco/1.4/PageCompiler/File2Page/Makefile#1 $
+#
+# Makefile for Poco C++ Server Page Compiler File2Page Utility
+#
+
+include $(POCO_BASE)/build/rules/global
+
+objects = File2Page
+
+target = f2cpsp
+target_version = 1
+target_libs = PocoUtil PocoXML PocoFoundation
+
+include $(POCO_BASE)/build/rules/exec
diff --git a/PageCompiler/File2Page/dependencies b/PageCompiler/File2Page/dependencies
new file mode 100644
index 000000000..afd736493
--- /dev/null
+++ b/PageCompiler/File2Page/dependencies
@@ -0,0 +1,4 @@
+Net
+Util
+XML
+Foundation
diff --git a/PageCompiler/File2Page/src/File2Page.cpp b/PageCompiler/File2Page/src/File2Page.cpp
new file mode 100644
index 000000000..b5ffc4e8b
--- /dev/null
+++ b/PageCompiler/File2Page/src/File2Page.cpp
@@ -0,0 +1,298 @@
+//
+// File2Page.cpp
+//
+// $Id: //poco/1.4/PageCompiler/File2Page/src/File2Page.cpp#3 $
+//
+// An application that creates a Page Compiler source file from an
+// ordinary file.
+//
+// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// Permission is hereby granted, free of charge, to any person or organization
+// obtaining a copy of the software and accompanying documentation covered by
+// this license (the "Software") to use, reproduce, display, distribute,
+// execute, and transmit the Software, and to prepare derivative works of the
+// Software, and to permit third-parties to whom the Software is furnished to
+// do so, all subject to the following:
+//
+// The copyright notices in the Software and this entire statement, including
+// the above license grant, this restriction and the following disclaimer,
+// must be included in all copies of the Software, in whole or in part, and
+// all derivative works of the Software, unless such copies or derivative
+// works are solely in the form of machine-executable object code generated by
+// a source language processor.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+//
+
+
+#include "Poco/Util/Application.h"
+#include "Poco/Util/Option.h"
+#include "Poco/Util/OptionSet.h"
+#include "Poco/Util/HelpFormatter.h"
+#include "Poco/Util/AbstractConfiguration.h"
+#include "Poco/AutoPtr.h"
+#include "Poco/File.h"
+#include "Poco/Path.h"
+#include "Poco/FileStream.h"
+#include "Poco/NumberFormatter.h"
+#include "Poco/DateTime.h"
+#include
+
+
+using Poco::Util::Application;
+using Poco::Util::Option;
+using Poco::Util::OptionSet;
+using Poco::Util::HelpFormatter;
+using Poco::Util::AbstractConfiguration;
+using Poco::Util::OptionCallback;
+using Poco::NumberFormatter;
+
+
+class File2PageApp: public Application
+{
+public:
+ File2PageApp(): _helpRequested(false)
+ {
+ }
+
+protected:
+ void initialize(Application& self)
+ {
+ loadConfiguration(); // load default configuration files, if present
+ Application::initialize(self);
+ // add your own initialization code here
+ }
+
+ void uninitialize()
+ {
+ // add your own uninitialization code here
+ Application::uninitialize();
+ }
+
+ void reinitialize(Application& self)
+ {
+ Application::reinitialize(self);
+ // add your own reinitialization code here
+ }
+
+ void defineOptions(OptionSet& options)
+ {
+ Application::defineOptions(options);
+
+ options.addOption(
+ Option("help", "h", "display help information on command line arguments")
+ .required(false)
+ .repeatable(false)
+ .callback(OptionCallback(this, &File2PageApp::handleHelp)));
+
+ options.addOption(
+ Option("contentType", "t", "specify a content type")
+ .required(false)
+ .repeatable(false)
+ .argument("MIME-Type")
+ .callback(OptionCallback(this, &File2PageApp::handleContentType)));
+
+ options.addOption(
+ Option("contentLanguage", "l", "specify a content language")
+ .required(false)
+ .repeatable(false)
+ .argument("language")
+ .callback(OptionCallback(this, &File2PageApp::handleContentLang)));
+
+ options.addOption(
+ Option("class", "c", "specify the handler class name")
+ .required(false)
+ .repeatable(false)
+ .argument("class-name")
+ .callback(OptionCallback(this, &File2PageApp::handleClassName)));
+
+ options.addOption(
+ Option("namespace", "n", "specify the handler class namespace name")
+ .required(false)
+ .repeatable(false)
+ .argument("namespace-name")
+ .callback(OptionCallback(this, &File2PageApp::handleNamespace)));
+
+ options.addOption(
+ Option("output", "o", "specify the output file name")
+ .required(false)
+ .repeatable(false)
+ .argument("path")
+ .callback(OptionCallback(this, &File2PageApp::handleOutput)));
+}
+
+ void handleHelp(const std::string& name, const std::string& value)
+ {
+ _helpRequested = true;
+ displayHelp();
+ stopOptionsProcessing();
+ }
+
+ void handleContentType(const std::string& name, const std::string& value)
+ {
+ _contentType = value;
+ }
+
+ void handleContentLang(const std::string& name, const std::string& value)
+ {
+ _contentLang = value;
+ }
+
+ void handleClassName(const std::string& name, const std::string& value)
+ {
+ _clazz = value;
+ }
+
+ void handleNamespace(const std::string& name, const std::string& value)
+ {
+ _namespace = value;
+ }
+
+ void handleOutput(const std::string& name, const std::string& value)
+ {
+ _output = value;
+ }
+
+ void displayHelp()
+ {
+ HelpFormatter helpFormatter(options());
+ helpFormatter.setCommand(commandName());
+ helpFormatter.setUsage("OPTIONS");
+ helpFormatter.setHeader("Create a PageCompiler source file from a binary file.");
+ helpFormatter.format(std::cout);
+ }
+
+ void convert(const std::string& path)
+ {
+ Poco::Path p(path);
+ Poco::Path op(path);
+ if (_output.empty())
+ {
+ op.setExtension("cpsp");
+ }
+ else
+ {
+ op = _output;
+ }
+ if (_contentType.empty())
+ {
+ _contentType = extToContentType(p.getExtension());
+ }
+ if (_clazz.empty())
+ {
+ _clazz = p.getBaseName();
+ }
+ Poco::FileInputStream istr(path);
+ Poco::FileOutputStream ostr(op.toString());
+ ostr << "<%@ page\n"
+ << " contentType=\"" << _contentType << "\"\n";
+ if (!_contentLang.empty())
+ {
+ ostr << " contentLanguage=\"" << _contentLang << "\"\n";
+ }
+ ostr << " form=\"false\"\n"
+ << " namespace=\"" << _namespace << "\"\n"
+ << " class=\"" << _clazz << "\"\n"
+ << " precondition=\"checkModified(request)\"%><%@"
+ << " impl include=\"Poco/DateTime.h\"\n"
+ << " include=\"Poco/DateTimeParser.h\"\n"
+ << " include=\"Poco/DateTimeFormatter.h\"\n"
+ << " include=\"Poco/DateTimeFormat.h\"%><%!\n\n";
+ ostr << "// " << path << "\n";
+ ostr << "static const unsigned char data[] = {\n\t";
+ int ch = istr.get();
+ int pos = 0;
+ while (ch != -1)
+ {
+ ostr << "0x" << NumberFormatter::formatHex(ch, 2) << ", ";
+ if (pos++ == 16)
+ {
+ ostr << "\n\t";
+ pos = 0;
+ }
+ ch = istr.get();
+ }
+ Poco::File f(path);
+ Poco::DateTime lm = f.getLastModified();
+ ostr << "\n};\n\n\n";
+ ostr << "static bool checkModified(Poco::Net::HTTPServerRequest& request)\n"
+ << "{\n"
+ << "\tPoco::DateTime modified(" << lm.year() << ", " << lm.month() << ", " << lm.day() << ", " << lm.hour() << ", " << lm.minute() << ", " << lm.second() << ");\n"
+ << "\trequest.response().setChunkedTransferEncoding(false);\n"
+ << "\trequest.response().set(\"Last-Modified\", Poco::DateTimeFormatter::format(modified, Poco::DateTimeFormat::HTTP_FORMAT));\n"
+ << "\tif (request.has(\"If-Modified-Since\"))\n"
+ << "\t{\n"
+ << "\t\tPoco::DateTime modifiedSince;\n"
+ << "\t\tint tzd;\n"
+ << "\t\tPoco::DateTimeParser::parse(request.get(\"If-Modified-Since\"), modifiedSince, tzd);\n"
+ << "\t\tif (modified <= modifiedSince)\n"
+ << "\t\t{\n"
+ << "\t\t\trequest.response().setContentLength(0);\n"
+ << "\t\t\trequest.response().setStatusAndReason(Poco::Net::HTTPResponse::HTTP_NOT_MODIFIED);\n"
+ << "\t\t\trequest.response().send();\n"
+ << "\t\t\treturn false;\n"
+ << "\t\t}\n"
+ << "\t}\n"
+ << "\trequest.response().setContentLength(static_cast(sizeof(data)));\n"
+ << "\treturn true;\n"
+ << "}\n"
+ << "%><%\n"
+ << "\tresponseStream.write(reinterpret_cast(data), sizeof(data));\n"
+ << "%>";
+ }
+
+ std::string extToContentType(const std::string& ext)
+ {
+ if (ext == "jpg" || ext == "jpeg")
+ return "image/jpeg";
+ else if (ext == "png")
+ return "image/png";
+ else if (ext == "gif")
+ return "image/gif";
+ else if (ext == "ico")
+ return "image/x-icon";
+ else if (ext == "htm")
+ return "text/html";
+ else if (ext == "html")
+ return "text/html";
+ else if (ext == "css")
+ return "text/css";
+ else if (ext == "js")
+ return "application/javascript";
+ else if (ext == "xml")
+ return "text/xml";
+ else
+ return "application/binary";
+ }
+
+ int main(const std::vector& args)
+ {
+ if (!_helpRequested)
+ {
+ for (std::vector::const_iterator it = args.begin(); it != args.end(); ++it)
+ {
+ convert(*it);
+ }
+ }
+ return Application::EXIT_OK;
+ }
+
+private:
+ bool _helpRequested;
+ std::string _contentType;
+ std::string _contentLang;
+ std::string _clazz;
+ std::string _namespace;
+ std::string _output;
+};
+
+
+POCO_APP_MAIN(File2PageApp)