Page MenuHomePhabricator

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/BlueBerry/Bundles/org.blueberry.test/CMakeLists.txt b/BlueBerry/Bundles/org.blueberry.test/CMakeLists.txt
index 2c87a4b468..69fe29508f 100644
--- a/BlueBerry/Bundles/org.blueberry.test/CMakeLists.txt
+++ b/BlueBerry/Bundles/org.blueberry.test/CMakeLists.txt
@@ -1,9 +1,11 @@
project(org_blueberry_test)
+include_directories(${CppUnit_INCLUDE_DIRS})
+
MACRO_CREATE_CTK_PLUGIN(
EXPORT_DIRECTIVE BERRY_TEST_EXPORT
EXPORTED_INCLUDE_SUFFIXES src src/harness
NO_INSTALL
)
-target_link_libraries(${PROJECT_NAME} optimized CppUnit debug CppUnitd)
+target_link_libraries(${PROJECT_NAME} ${CppUnit_LIBRARIES})
diff --git a/BlueBerry/Bundles/org.blueberry.test/src/berryBlueBerryTestDriver.cpp b/BlueBerry/Bundles/org.blueberry.test/src/berryBlueBerryTestDriver.cpp
index e5fb79f0c4..c15a053b6d 100644
--- a/BlueBerry/Bundles/org.blueberry.test/src/berryBlueBerryTestDriver.cpp
+++ b/BlueBerry/Bundles/org.blueberry.test/src/berryBlueBerryTestDriver.cpp
@@ -1,82 +1,94 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berryBlueBerryTestDriver.h"
#include "internal/berryTestRegistry.h"
-#include <CppUnit/TestRunner.h>
+#include "cppunit/TestRunner.h"
+#include "cppunit/TestResult.h"
+#include "cppunit/TestResultCollector.h"
namespace berry
{
BlueBerryTestDriver::BlueBerryTestDriver(const std::vector<
ITestDescriptor::Pointer>& descriptors,
bool uitests,
const std::string& testName,
bool wait) :
descriptors(descriptors), uitests(uitests), testName(testName), wait(wait)
{
}
int BlueBerryTestDriver::Run()
{
CppUnit::TestRunner runner;
unsigned int testCounter = 0;
for (std::vector<ITestDescriptor::Pointer>::iterator i = descriptors.begin(); i
!= descriptors.end(); ++i)
{
ITestDescriptor::Pointer descr(*i);
if (descr->IsUITest() == uitests)
{
CppUnit::Test* test = descr->CreateTest();
- runner.addTest(descr->GetId(), test);
+ runner.addTest(test);
++testCounter;
}
}
if (testCounter == 0)
{
std::cout << "No " << (uitests ? "UI " : "") << "tests registered."
<< std::endl;
return 0;
}
+ /*
std::vector<std::string> args;
args.push_back("BlueBerryTestDriver");
if (testName.empty())
args.push_back("-all");
else
args.push_back(testName);
if (wait)
args.push_back("-wait");
return runner.run(args) ? 0 : 1;
+ */
+
+ CppUnit::TestResult controller;
+
+ CppUnit::TestResultCollector result;
+ controller.addListener(&result);
+
+ runner.run(controller);
+ return result.wasSuccessful() ? 0 : 1;
}
int BlueBerryTestDriver::Run(const std::string& pluginId, bool uitests)
{
TestRegistry testRegistry;
const std::vector<ITestDescriptor::Pointer>& tests = testRegistry.GetTestsForId(
pluginId);
BlueBerryTestDriver driver(tests, uitests);
return driver.Run();
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.test/src/berryITestDescriptor.h b/BlueBerry/Bundles/org.blueberry.test/src/berryITestDescriptor.h
index a493a59aea..ed2d5348a1 100644
--- a/BlueBerry/Bundles/org.blueberry.test/src/berryITestDescriptor.h
+++ b/BlueBerry/Bundles/org.blueberry.test/src/berryITestDescriptor.h
@@ -1,42 +1,42 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYITESTDESCRIPTOR_H_
#define BERRYITESTDESCRIPTOR_H_
#include <berryObject.h>
#include <berryMacros.h>
-#include <CppUnit/Test.h>
+#include <cppunit/Test.h>
namespace berry {
struct ITestDescriptor : public Object
{
berryInterfaceMacro(ITestDescriptor, berry);
virtual CppUnit::Test* CreateTest() = 0;
virtual std::string GetId() const = 0;
virtual std::string GetContributor() const = 0;
virtual std::string GetDescription() const = 0;
virtual bool IsUITest() const = 0;
};
}
#endif /* BERRYITESTDESCRIPTOR_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.test/src/harness/berryTestCase.h b/BlueBerry/Bundles/org.blueberry.test/src/harness/berryTestCase.h
index 148437f8a6..4a3dfb6afe 100644
--- a/BlueBerry/Bundles/org.blueberry.test/src/harness/berryTestCase.h
+++ b/BlueBerry/Bundles/org.blueberry.test/src/harness/berryTestCase.h
@@ -1,84 +1,84 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYTESTCASE_H_
#define BERRYTESTCASE_H_
-#include <CppUnit/TestCase.h>
+#include <cppunit/TestCase.h>
#include <org_blueberry_test_Export.h>
namespace berry {
class BERRY_TEST_EXPORT TestCase : public CppUnit::TestCase
{
public:
TestCase(const std::string& testName);
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
* The default implementation does nothing.
* Subclasses may extend.
*/
virtual void DoSetUp();
/**
* Tears down the fixture, for example, close a network connection.
* This method is called after a test is executed.
* The default implementation closes all test windows, processing events both before
* and after doing so.
* Subclasses may extend.
*/
virtual void DoTearDown();
/**
* Clients should overwrite DoSetUp() instead of this method.
*/
void setUp();
/**
* Clients should overwrite DoSetUp() instead of this method.
*/
void tearDown();
protected:
/**
* Call this method in your unit test to enable detailed
* output about leaking berry::Object instances.
*/
void LeakDetailsOn();
/**
* Call this method to ignore leaking objects and to continue
* with the unit tests.
*/
void IgnoreLeakingObjects();
private:
bool m_LeakDetails;
bool m_IgnoreLeakage;
};
}
#endif /* BERRYTESTCASE_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.uitest/CMakeLists.txt b/BlueBerry/Bundles/org.blueberry.uitest/CMakeLists.txt
index 8bd9696385..fec762bb24 100644
--- a/BlueBerry/Bundles/org.blueberry.uitest/CMakeLists.txt
+++ b/BlueBerry/Bundles/org.blueberry.uitest/CMakeLists.txt
@@ -1,9 +1,11 @@
project(org_blueberry_uitest)
+include_directories(${CppUnit_INCLUDE_DIRS})
+
MACRO_CREATE_CTK_PLUGIN(
EXPORT_DIRECTIVE BERRY_UITEST_EXPORT
EXPORTED_INCLUDE_SUFFIXES src src/harness src/util
NO_INSTALL
)
-target_link_libraries(${PROJECT_NAME} optimized CppUnit debug CppUnitd)
+target_link_libraries(${PROJECT_NAME} ${CppUnit_LIBRARIES})
diff --git a/BlueBerry/Bundles/org.blueberry.uitest/src/harness/berryUITestCase.cpp b/BlueBerry/Bundles/org.blueberry.uitest/src/harness/berryUITestCase.cpp
index f95f213138..4c1ea4558c 100644
--- a/BlueBerry/Bundles/org.blueberry.uitest/src/harness/berryUITestCase.cpp
+++ b/BlueBerry/Bundles/org.blueberry.uitest/src/harness/berryUITestCase.cpp
@@ -1,268 +1,268 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berryUITestCase.h"
#include <berryPlatformUI.h>
#include <berryUIException.h>
#include "util/berryEmptyPerspective.h"
#ifdef BLUEBERRY_DEBUG_SMARTPOINTER
#include <berryDebugUtil.h>
#endif
namespace berry
{
IAdaptable* UITestCase::GetPageInput()
{
return 0;
}
UITestCase::UITestCase(const std::string& testName) :
TestCase(testName)
{
// ErrorDialog.NO_UI = true;
fWorkbench = PlatformUI::GetWorkbench();
}
void UITestCase::failexc(const std::string& message, const std::exception& e,
long lineNumber, const std::string& fileName)
{
//TODO IStatus
// If the exception is a CoreException with a multistatus
// then print out the multistatus so we can see all the info.
// if (e instanceof CoreException) {
// IStatus status = ((CoreException) e).getStatus();
// write(status, 0);
// } else
// e.printStackTrace();
- fail(message + ": " + e.what(), lineNumber, fileName);
+ CPPUNIT_FAIL(message + ": " + e.what());
}
IWorkbenchWindow::Pointer UITestCase::OpenTestWindow()
{
return OpenTestWindow(EmptyPerspective::PERSP_ID);
}
IWorkbenchWindow::Pointer UITestCase::OpenTestWindow(
const std::string& perspectiveId)
{
try
{
IWorkbenchWindow::Pointer window = fWorkbench->OpenWorkbenchWindow(
perspectiveId, GetPageInput());
WaitOnShell(window->GetShell());
return window;
} catch (WorkbenchException& e)
{
- failmsg(e.displayText());
+ CPPUNIT_FAIL(e.displayText());
return IWorkbenchWindow::Pointer(0);
}
}
void UITestCase::CloseAllTestWindows()
{
std::list<IWorkbenchWindow::Pointer>::iterator i = testWindows.begin();
while (!testWindows.empty())
{
testWindows.back()->Close();
testWindows.pop_back();
}
}
IWorkbenchPage::Pointer UITestCase::OpenTestPage(IWorkbenchWindow::Pointer /*win*/)
{
// IWorkbenchPage[] pages = openTestPage(win, 1);
// if (pages != null)
// return pages[0];
// else
return IWorkbenchPage::Pointer(0);
}
std::vector<IWorkbenchPage::Pointer> UITestCase::OpenTestPage(
IWorkbenchWindow::Pointer /*win*/, int /*pageTotal*/)
{
// try {
// IWorkbenchPage[] pages = new IWorkbenchPage[pageTotal];
// IAdaptable input = getPageInput();
//
// for (int i = 0; i < pageTotal; i++) {
// pages[i] = win.openPage(EmptyPerspective.PERSP_ID, input);
// }
// return pages;
// } catch (WorkbenchException e) {
// fail();
// return null;
// }
return std::vector<IWorkbenchPage::Pointer>();
}
void UITestCase::CloseAllPages(IWorkbenchWindow::Pointer /*window*/)
{
// IWorkbenchPage[] pages = window.getPages();
// for (int i = 0; i < pages.length; i++)
// pages[i].close();
}
void UITestCase::Trace(const std::string& msg)
{
std::cerr << msg << std::endl;
}
void UITestCase::setUp()
{
- Trace("----- " + this->name());
- Trace(this->name() + ": setUp...");
+ Trace("----- " + this->getName());
+ Trace(this->getName() + ": setUp...");
AddWindowListener();
berry::TestCase::setUp();
}
void UITestCase::DoSetUp()
{
// do nothing.
}
void UITestCase::tearDown()
{
- Trace(this->name() + ": tearDown...\n");
+ Trace(this->getName() + ": tearDown...\n");
RemoveWindowListener();
berry::TestCase::tearDown();
}
void UITestCase::DoTearDown()
{
ProcessEvents();
CloseAllTestWindows();
ProcessEvents();
}
void UITestCase::ProcessEvents()
{
// Display display = PlatformUI.getWorkbench().getDisplay();
// if (display != null)
// while (display.readAndDispatch())
// ;
}
void UITestCase::ManageWindows(bool manage)
{
windowListener->SetEnabled(manage);
}
IWorkbench* UITestCase::GetWorkbench()
{
return fWorkbench;
}
UITestCase::TestWindowListener::TestWindowListener(std::list<
IWorkbenchWindow::Pointer>& testWindows) :
enabled(true), testWindows(testWindows)
{
}
void UITestCase::TestWindowListener::SetEnabled(bool enabled)
{
this->enabled = enabled;
}
void UITestCase::TestWindowListener::WindowActivated(
IWorkbenchWindow::Pointer /*window*/)
{
// do nothing
}
void UITestCase::TestWindowListener::WindowDeactivated(
IWorkbenchWindow::Pointer /*window*/)
{
// do nothing
}
void UITestCase::TestWindowListener::WindowClosed(
IWorkbenchWindow::Pointer window)
{
if (enabled)
testWindows.remove(window);
}
void UITestCase::TestWindowListener::WindowOpened(
IWorkbenchWindow::Pointer window)
{
if (enabled)
testWindows.push_back(window);
}
void UITestCase::Indent(std::ostream& output, unsigned int indent)
{
for (unsigned int i = 0; i < indent; i++)
output << " ";
}
// void UITestCase::Write(IStatus status, unsigned int indent) {
// PrintStream output = System.out;
// indent(output, indent);
// output.println("Severity: " + status.getSeverity());
//
// indent(output, indent);
// output.println("Plugin ID: " + status.getPlugin());
//
// indent(output, indent);
// output.println("Code: " + status.getCode());
//
// indent(output, indent);
// output.println("Message: " + status.getMessage());
//
// if (status.getException() != null) {
// indent(output, indent);
// output.print("Exception: ");
// status.getException().printStackTrace(output);
// }
//
// if (status.isMultiStatus()) {
// IStatus[] children = status.getChildren();
// for (int i = 0; i < children.length; i++)
// write(children[i], indent + 1);
// }
// }
void UITestCase::AddWindowListener()
{
windowListener = new TestWindowListener(testWindows);
fWorkbench->AddWindowListener(windowListener);
}
void UITestCase::RemoveWindowListener()
{
if (windowListener)
{
fWorkbench->RemoveWindowListener(windowListener);
}
}
void UITestCase::WaitOnShell(Shell::Pointer /*shell*/)
{
ProcessEvents();
// long endTime = System.currentTimeMillis() + 5000;
//
// while (shell.getDisplay().getActiveShell() != shell
// && System.currentTimeMillis() < endTime) {
// processEvents();
// }
}
}
diff --git a/BlueBerry/Bundles/org.blueberry.uitest/src/harness/berryUITestCase.h b/BlueBerry/Bundles/org.blueberry.uitest/src/harness/berryUITestCase.h
index 3744489c85..23f17b23b0 100644
--- a/BlueBerry/Bundles/org.blueberry.uitest/src/harness/berryUITestCase.h
+++ b/BlueBerry/Bundles/org.blueberry.uitest/src/harness/berryUITestCase.h
@@ -1,213 +1,212 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYUITESTCASE_H_
#define BERRYUITESTCASE_H_
#include <berryTestCase.h>
#include <berryIWindowListener.h>
#include <berryIWorkbench.h>
#include <berryIWorkbenchPage.h>
#include <org_blueberry_uitest_Export.h>
#include <list>
namespace berry
{
/**
* <code>UITestCase</code> is a useful super class for most
* UI tests cases. It contains methods to create new windows
* and pages. It will also automatically close the test
* windows when the tearDown method is called.
*/
class BERRY_UITEST_EXPORT UITestCase: public TestCase
{
public:
/**
* Returns the workbench page input to use for newly created windows.
*
* @return the page input to use for newly created windows
* @since 3.1
*/
static IAdaptable* GetPageInput();
UITestCase(const std::string& testName);
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
* The default implementation does nothing.
* Subclasses may extend.
*/
virtual void DoSetUp();
/**
* Tears down the fixture, for example, close a network connection.
* This method is called after a test is executed.
* The default implementation closes all test windows, processing events both before
* and after doing so.
* Subclasses may extend.
*/
virtual void DoTearDown();
/**
* Fails the test due to the given throwable.
*/
void failexc(const std::string& message, const std::exception& e,
- long lineNumber = CppUnit::CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName =
- CppUnit::CppUnitException::CPPUNIT_UNKNOWNFILENAME);
+ long lineNumber = -1,
+ const std::string& fileName = "unknown");
/**
* Open a test window with the empty perspective.
*/
IWorkbenchWindow::Pointer OpenTestWindow();
/**
* Open a test window with the provided perspective.
*/
IWorkbenchWindow::Pointer OpenTestWindow(const std::string& perspectiveId);
/**
* Close all test windows.
*/
void CloseAllTestWindows();
/**
* Open a test page with the empty perspective in a window.
*/
IWorkbenchPage::Pointer OpenTestPage(IWorkbenchWindow::Pointer win);
/**
* Open "n" test pages with the empty perspective in a window.
*/
std::vector<IWorkbenchPage::Pointer> OpenTestPage(
IWorkbenchWindow::Pointer win, int pageTotal);
/**
* Close all pages within a window.
*/
void CloseAllPages(IWorkbenchWindow::Pointer window);
protected:
/**
* Outputs a trace message to the trace output device, if enabled.
* By default, trace messages are sent to <code>System.out</code>.
*
* @param msg the trace message
*/
void Trace(const std::string& msg);
/**
* Simple implementation of setUp. Subclasses are prevented
* from overriding this method to maintain logging consistency.
* DoSetUp() should be overriden instead.
*/
void setUp();
/**
* Simple implementation of tearDown. Subclasses are prevented
* from overriding this method to maintain logging consistency.
* DoTearDown() should be overriden instead.
*/
void tearDown();
static void ProcessEvents();
/**
* Set whether the window listener will manage opening and closing of created windows.
*/
void ManageWindows(bool manage);
/**
* Returns the workbench.
*
* @return the workbench
* @since 3.1
*/
IWorkbench* GetWorkbench();
class TestWindowListener: public IWindowListener
{
private:
bool enabled;
std::list<IWorkbenchWindow::Pointer>& testWindows;
public:
berryObjectMacro(TestWindowListener);
TestWindowListener(std::list<IWorkbenchWindow::Pointer>& testWindows);
void SetEnabled(bool enabled);
void WindowActivated(IWorkbenchWindow::Pointer window);
void WindowDeactivated(IWorkbenchWindow::Pointer window);
void WindowClosed(IWorkbenchWindow::Pointer window);
void WindowOpened(IWorkbenchWindow::Pointer window);
};
IWorkbench* fWorkbench;
private:
std::list<IWorkbenchWindow::Pointer> testWindows;
TestWindowListener::Pointer windowListener;
static void Indent(std::ostream& output, unsigned int indent);
//static void Write(IStatus status, unsigned int indent);
/**
* Adds a window listener to the workbench to keep track of
* opened test windows.
*/
void AddWindowListener();
/**
* Removes the listener added by <code>addWindowListener</code>.
*/
void RemoveWindowListener();
/**
* Try and process events until the new shell is the active shell. This may
* never happen, so time out after a suitable period.
*
* @param shell
* the shell to wait on
* @since 3.2
*/
void WaitOnShell(Shell::Pointer shell);
};
#define failuimsg(msg, exc) \
(this->failexc(msg, exc, __LINE__, __FILE__))
}
#endif /* BERRYUITESTCASE_H_ */
diff --git a/BlueBerry/Bundles/org.blueberry.uitest/src/util/berryUITestCaller.h b/BlueBerry/Bundles/org.blueberry.uitest/src/util/berryUITestCaller.h
index 6a911c1765..ddfbac127d 100644
--- a/BlueBerry/Bundles/org.blueberry.uitest/src/util/berryUITestCaller.h
+++ b/BlueBerry/Bundles/org.blueberry.uitest/src/util/berryUITestCaller.h
@@ -1,71 +1,71 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYUITESTCALLER_H_
#define BERRYUITESTCALLER_H_
-#include <CppUnit/TestCase.h>
-#include <CppUnit/Guards.h>
+#include <cppunit/TestCase.h>
+#include <cppunit/Guards.h>
#include <memory>
namespace berry {
template <class Fixture>
class UITestCaller: public CppUnit::TestCase
{
REFERENCEOBJECT (UITestCaller)
typedef void (Fixture::*TestMethod)();
public:
UITestCaller(const std::string& name, TestMethod test):
CppUnit::TestCase(name),
_test(test),
_fixture(new Fixture(name))
{
}
protected:
void runTest()
{
(_fixture.get()->*_test)();
}
void setUp()
{
_fixture.get()->DoSetUp();
}
void tearDown()
{
_fixture.get()->DoTearDown();
}
private:
TestMethod _test;
std::auto_ptr<Fixture> _fixture;
};
} // namespace berry
#define CppUnit_addUITest(suite, cls, mth) \
suite->addTest(new berry::UITestCaller<cls>(#mth, &cls::mth))
#endif /* BERRYUITESTCALLER_H_ */
diff --git a/BlueBerry/CMake/FindPoco.cmake b/BlueBerry/CMake/FindPoco.cmake
index 8b7574570f..1f7bb36c97 100644
--- a/BlueBerry/CMake/FindPoco.cmake
+++ b/BlueBerry/CMake/FindPoco.cmake
@@ -1,155 +1,168 @@
# - Find the Poco includes and libraries.
# The following variables are set if Poco is found. If Poco is not
# found, Poco_FOUND is set to false.
# Poco_FOUND - True when the Poco include directory is found.
# Poco_INCLUDE_DIRS - the path to where the poco include files are.
# Poco_LIBRARY_DIRS - The path to where the poco library files are.
# Poco_BINARY_DIRS - The path to where the poco dlls are.
# ----------------------------------------------------------------------------
# If you have installed Poco in a non-standard location.
# Then you have three options.
# In the following comments, it is assumed that <Your Path>
# points to the root directory of the include directory of Poco. e.g
# If you have put poco in C:\development\Poco then <Your Path> is
# "C:/development/Poco" and in this directory there will be two
# directories called "include" and "lib".
# 1) After CMake runs, set Poco_INCLUDE_DIR to <Your Path>/poco<-version>
# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/poco<-version>. This will allow find_path()
# to locate Poco_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g.
# set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
# 3) Set an environment variable called ${POCO_ROOT} that points to the root of where you have
# installed Poco, e.g. <Your Path>. It is assumed that there is at least a subdirectory called
# Foundation/include/Poco in this path.
#
# Note:
# 1) If you are just using the poco headers, then you do not need to use
# Poco_LIBRARY_DIR in your CMakeLists.txt file.
# 2) If Poco has not been installed, then when setting Poco_LIBRARY_DIR
# the script will look for /lib first and, if this fails, then for /stage/lib.
#
# Usage:
# In your CMakeLists.txt file do something like this:
# ...
# # Poco
# find_package(Poco)
# ...
# include_directories(${Poco_INCLUDE_DIRS})
# link_directories(${Poco_LIBRARY_DIR})
#
# In Windows, we make the assumption that, if the Poco files are installed, the default directory
# will be C:\poco or C:\Program Files\Poco or C:\Programme\Poco.
set(POCO_INCLUDE_PATH_DESCRIPTION "top-level directory containing the poco include directories. E.g /usr/local/include/ or c:\\poco\\include\\poco-1.3.2")
set(POCO_INCLUDE_DIR_MESSAGE "Set the Poco_INCLUDE_DIR cmake cache entry to the ${POCO_INCLUDE_PATH_DESCRIPTION}")
-set(POCO_LIBRARY_PATH_DESCRIPTION "top-level directory containing the poco libraries.")
-set(POCO_LIBRARY_DIR_MESSAGE "Set the Poco_LIBRARY_DIR cmake cache entry to the ${POCO_LIBRARY_PATH_DESCRIPTION}")
+set(POCO_LIBRARY_PATH_DESCRIPTION "directory containing the poco libraries:")
set(POCO_DIR_SEARCH $ENV{POCO_ROOT})
if(POCO_DIR_SEARCH)
file(TO_CMAKE_PATH ${POCO_DIR_SEARCH} POCO_DIR_SEARCH)
endif(POCO_DIR_SEARCH)
-
+list(APPEND POCO_DIR_SEARCH ${Poco_DIR})
if(WIN32)
set(POCO_DIR_SEARCH
${POCO_DIR_SEARCH}
C:/poco
D:/poco
"C:/Program Files/poco"
"C:/Programme/poco"
"D:/Program Files/poco"
"D:/Programme/poco"
)
endif(WIN32)
# Add in some path suffixes. These will have to be updated whenever a new Poco version comes out.
set(SUFFIX_FOR_INCLUDE_PATH
- poco-1.3.2
+ include
)
set(SUFFIX_FOR_LIBRARY_PATH
- poco-1.3.2/lib
- poco-1.3.2/lib/Linux/i686
- poco-1.3.2/lib/Linux/x86_64
lib
- lib/Linux/i686
- lib/Linux/x86_64
+ bin
)
#
# Look for an installation.
#
-find_path(Poco_INCLUDE_DIR NAMES Foundation/include/Poco/AbstractCache.h PATH_SUFFIXES ${SUFFIX_FOR_INCLUDE_PATH} PATHS
+find_path(Poco_INCLUDE_DIR NAMES Poco/Poco.h PATH_SUFFIXES ${SUFFIX_FOR_INCLUDE_PATH} PATHS
# Look in other places.
${POCO_DIR_SEARCH}
# Help the user find it if we cannot.
DOC "The ${POCO_INCLUDE_PATH_DESCRIPTION}"
)
if(NOT Poco_INCLUDE_DIR)
# Look for standard unix include paths
find_path(Poco_INCLUDE_DIR Poco/Poco.h DOC "The ${POCO_INCLUDE_PATH_DESCRIPTION}")
endif(NOT Poco_INCLUDE_DIR)
# Assume we didn't find it.
set(Poco_FOUND 0)
+set(Poco_LIBRARIES )
+set(Poco_LIBRARY_DIRS )
+
# Now try to get the include and library path.
-if(Poco_INCLUDE_DIR)
- if(EXISTS "${Poco_INCLUDE_DIR}/Foundation")
- set(Poco_INCLUDE_DIRS
- ${Poco_INCLUDE_DIR}/CppUnit/include
- ${Poco_INCLUDE_DIR}/Foundation/include
- ${Poco_INCLUDE_DIR}/Net/include
- ${Poco_INCLUDE_DIR}/Util/include
- ${Poco_INCLUDE_DIR}/XML/include
- ${Poco_INCLUDE_DIR}/Zip/include
+# Find all libraries, store debug and release separately
+foreach(lib
+ Crypto
+ Data
+ DataMySQL
+ DataSQLite
+ Foundation
+ JSON
+ MongoDB
+ Net
+ NetSSL
+ PDF
+ Util
+ XML
+ Zip
)
- set(Poco_FOUND 1)
- elseif(EXISTS "${Poco_INCLUDE_DIR}/Poco/Poco.h")
- set(Poco_INCLUDE_DIRS
- ${Poco_INCLUDE_DIR}
- )
- set(Poco_FOUND 1)
- endif(EXISTS "${Poco_INCLUDE_DIR}/Foundation")
-
- if(NOT Poco_LIBRARY_DIR)
- find_library(Poco_FOUNDATION_LIB NAMES PocoFoundation PocoFoundationd PATH_SUFFIXES ${SUFFIX_FOR_LIBRARY_PATH} PATHS
- # Look in other places.
- ${Poco_INCLUDE_DIR}
- ${POCO_DIR_SEARCH}
+ # Find Release libraries
+ find_library(Poco_${lib}_LIBRARY_RELEASE
+ NAMES Poco${lib}
+ PATH_SUFFIXES ${SUFFIX_FOR_LIBRARY_PATH}
+ PATHS ${POCO_DIR_SEARCH}
+ DOC "The ${POCO_LIBRARY_PATH_DESCRIPTION} Poco${lib}"
+ )
- # Help the user find it if we cannot.
- DOC "The ${POCO_LIBRARY_PATH_DESCRIPTION}"
+ # Find Debug libraries
+ find_library(Poco_${lib}_LIBRARY_DEBUG
+ NAMES Poco${lib}d
+ PATH_SUFFIXES ${SUFFIX_FOR_LIBRARY_PATH}
+ PATHS ${POCO_DIR_SEARCH}
+ DOC "The ${POCO_LIBRARY_PATH_DESCRIPTION} Poco${lib}d"
)
- set(Poco_LIBRARY_DIR "" CACHE PATH POCO_LIBARARY_PATH_DESCRIPTION)
- get_filename_component(Poco_LIBRARY_DIR ${Poco_FOUNDATION_LIB} PATH)
- if(Poco_LIBRARY_DIR)
- # Look for the poco binary path.
- set(Poco_BINARY_DIR ${Poco_INCLUDE_DIR})
- if(Poco_BINARY_DIR AND EXISTS "${Poco_BINARY_DIR}/bin")
- set(Poco_BINARY_DIRS ${Poco_BINARY_DIR}/bin)
- endif(Poco_BINARY_DIR AND EXISTS "${Poco_BINARY_DIR}/bin")
- endif(Poco_LIBRARY_DIR)
-
- endif(NOT Poco_LIBRARY_DIR)
-
-endif(Poco_INCLUDE_DIR)
-
-if(NOT Poco_FOUND)
- if(Poco_FIND_QUIETLY)
- message(STATUS "Poco was not found. ${POCO_INCLUDE_DIR_MESSAGE}")
- else(Poco_FIND_QUIETLY)
- if(Poco_FIND_REQUIRED)
- message(FATAL_ERROR "Poco was not found. ${POCO_INCLUDE_DIR_MESSAGE}")
- endif(Poco_FIND_REQUIRED)
- endif(Poco_FIND_QUIETLY)
-endif(NOT Poco_FOUND)
+
+ mark_as_advanced(Poco_${lib}_LIBRARY_RELEASE)
+ mark_as_advanced(Poco_${lib}_LIBRARY_DEBUG)
+
+ # Add libraries to variable according to build type
+ set(Poco_${lib}_LIBRARY)
+ if(Poco_${lib}_LIBRARY_RELEASE)
+ list(APPEND Poco_LIBRARIES optimized ${Poco_${lib}_LIBRARY_RELEASE})
+ list(APPEND Poco_${lib}_LIBRARY optimized ${Poco_${lib}_LIBRARY_RELEASE})
+ get_filename_component(lib_dir ${Poco_${lib}_LIBRARY_RELEASE} PATH)
+ list(APPEND Poco_LIBRARY_DIRS ${lib_dir})
+ endif()
+
+ if(Poco_${lib}_LIBRARY_DEBUG)
+ list(APPEND Poco_LIBRARIES debug ${Poco_${lib}_LIBRARY_DEBUG})
+ list(APPEND Poco_${lib}_LIBRARY debug ${Poco_${lib}_LIBRARY_DEBUG})
+ get_filename_component(lib_dir ${Poco_${lib}_LIBRARY_RELEASE} PATH)
+ list(APPEND Poco_LIBRARY_DIRS ${lib_dir})
+ endif()
+
+endforeach()
+
+if(Poco_LIBRARY_DIRS)
+ list(REMOVE_DUPLICATES Poco_LIBRARY_DIRS)
+endif()
+
+set(Poco_INCLUDE_DIRS ${Poco_INCLUDE_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Poco DEFAULT_MSG
+ Poco_INCLUDE_DIRS
+ Poco_Foundation_LIBRARY
+ Poco_LIBRARIES
+ )
diff --git a/BlueBerry/CMake/FunctionCreateBlueBerryApplication.cmake b/BlueBerry/CMake/FunctionCreateBlueBerryApplication.cmake
index 10d0296a1c..b0c0ac3303 100644
--- a/BlueBerry/CMake/FunctionCreateBlueBerryApplication.cmake
+++ b/BlueBerry/CMake/FunctionCreateBlueBerryApplication.cmake
@@ -1,215 +1,216 @@
#!
#! Create a BlueBerry application.
#!
#! \brief This function will create a BlueBerry application together with all
#! necessary provisioning and configuration data and install support.
#!
#! \param NAME (required) The name of the executable.
#! \param DESCRIPTION (optional) A human-readable description of your application.
#! The usage depends on the CPack generator (on Windows, this is a descriptive
#! text for the created shortcuts).
#! \param SOURCES (optional) A list of source files to compile into your executable. Defaults
#! to <name>.cpp.
#! \param PLUGINS (optional) A list of required plug-ins. Defaults to all known plug-ins.
#! \param EXCLUDE_PLUGINS (optional) A list of plug-ins which should not be used. Mainly
#! useful if PLUGINS was not used.
#! \param LINK_LIBRARIES A list of libraries to be linked with the executable.
#! \param LIBRARY_DIRS A list of directories to pass through to MITK_INSTALL_TARGETS
#! \param SHOW_CONSOLE (option) Show the console output window (on Windows).
#! \param NO_PROVISIONING (option) Do not create provisioning files.
#! \param NO_INSTALL (option) Do not install this executable
#!
#! Assuming that there exists a file called <code>MyApp.cpp</code>, an example call looks like:
#! \code
#! FunctionCreateBlueBerryApplication(
#! NAME MyApp
#! DESCRIPTION "MyApp - New ways to explore medical data"
#! EXCLUDE_PLUGINS org.mitk.gui.qt.extapplication
#! SHOW_CONSOLE
#! )
#! \endcode
#!
function(FunctionCreateBlueBerryApplication)
macro_parse_arguments(_APP "NAME;DESCRIPTION;SOURCES;PLUGINS;EXCLUDE_PLUGINS;LINK_LIBRARIES;LIBRARY_DIRS" "SHOW_CONSOLE;NO_PROVISIONING;NO_INSTALL" ${ARGN})
if(NOT _APP_NAME)
message(FATAL_ERROR "NAME argument cannot be empty.")
endif()
if(NOT _APP_SOURCES)
set(_APP_SOURCES ${_APP_NAME}.cpp)
endif()
if(NOT _APP_PLUGINS)
ctkFunctionGetAllPluginTargets(_APP_PLUGINS)
else()
set(_plugins ${_APP_PLUGINS})
set(_APP_PLUGINS)
foreach(_plugin ${_plugins})
string(REPLACE "." "_" _plugin_target ${_plugin})
list(APPEND _APP_PLUGINS ${_plugin_target})
endforeach()
# get all plug-in dependencies
ctkFunctionGetPluginDependencies(_plugin_deps PLUGINS ${_APP_PLUGINS} ALL)
# add the dependencies to the list of application plug-ins
list(APPEND _APP_PLUGINS ${_plugin_deps})
endif()
#------------------------------------------------------------------------
# Prerequesites
#------------------------------------------------------------------------
find_package(MITK REQUIRED)
+find_package(Poco REQUIRED)
# -----------------------------------------------------------------------
# Set up include and link dirs for the executable
# -----------------------------------------------------------------------
include(${QT_USE_FILE})
include_directories(
${org_blueberry_osgi_INCLUDE_DIRS}
${Poco_INCLUDE_DIRS}
${mbilog_INCLUDE_DIRS}
)
link_directories(${MITK_LINK_DIRECTORIES})
# -----------------------------------------------------------------------
# Add executable icon (Windows)
# -----------------------------------------------------------------------
set(WINDOWS_ICON_RESOURCE_FILE "")
if(WIN32)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons/${_APP_NAME}.rc")
set(WINDOWS_ICON_RESOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/icons/${_APP_NAME}.rc")
endif()
endif()
# -----------------------------------------------------------------------
# Create the executable and link libraries
# -----------------------------------------------------------------------
set(_app_compile_flags )
if(WIN32)
set(_app_compile_flags "${_app_compile_flags} -DPOCO_NO_UNWINDOWS -DWIN32_LEAN_AND_MEAN")
endif()
if(_APP_SHOW_CONSOLE)
add_executable(${_APP_NAME} MACOSX_BUNDLE ${_APP_SOURCES} ${WINDOWS_ICON_RESOURCE_FILE})
else()
add_executable(${_APP_NAME} MACOSX_BUNDLE WIN32 ${_APP_SOURCES} ${WINDOWS_ICON_RESOURCE_FILE})
endif()
set_target_properties(${_APP_NAME} PROPERTIES
COMPILE_FLAGS "${_app_compile_flags}")
target_link_libraries(${_APP_NAME} org_blueberry_osgi ${_APP_LINK_LIBRARIES})
if(WIN32)
target_link_libraries(${_APP_NAME} ${QT_QTCORE_LIBRARY} ${QT_QTMAIN_LIBRARY})
endif()
# -----------------------------------------------------------------------
# Add executable icon (Mac)
# -----------------------------------------------------------------------
if(APPLE)
set(icon_name "icon.icns")
set(icon_full_path "${CMAKE_CURRENT_SOURCE_DIR}/icons/${icon_name}")
if(EXISTS "${icon_full_path}")
set_target_properties(${_APP_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE "${icon_name}")
file(COPY ${icon_full_path} DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_APP_NAME}.app/Contents/Resources/")
INSTALL (FILES ${icon_full_path} DESTINATION "${_APP_NAME}.app/Contents/Resources/")
endif()
endif()
# -----------------------------------------------------------------------
# Set build time dependencies
# -----------------------------------------------------------------------
# This ensures that all enabled plug-ins are up-to-date when the
# executable is build.
if(_APP_PLUGINS)
ctkMacroGetAllProjectTargetLibraries("${_APP_PLUGINS}" _project_plugins)
if(_APP_EXCLUDE_PLUGINS)
set(_exclude_targets)
foreach(_exclude_plugin ${_APP_EXCLUDE_PLUGINS})
string(REPLACE "." "_" _exclude_target ${_exclude_plugin})
list(APPEND _exclude_targets ${_exclude_target})
endforeach()
list(REMOVE_ITEM _project_plugins ${_exclude_targets})
endif()
if(_project_plugins)
add_dependencies(${_APP_NAME} ${_project_plugins})
endif()
endif()
# -----------------------------------------------------------------------
# Additional files needed for the executable
# -----------------------------------------------------------------------
if(NOT _APP_NO_PROVISIONING)
# Create a provisioning file, listing all plug-ins
set(_prov_file "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_APP_NAME}.provisioning")
FunctionCreateProvisioningFile(FILE ${_prov_file}
PLUGINS ${_APP_PLUGINS}
EXCLUDE_PLUGINS ${_APP_EXCLUDE_PLUGINS}
)
endif()
# Create a .ini file for initial parameters
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_APP_NAME}.ini")
configure_file(${_APP_NAME}.ini
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_APP_NAME}.ini)
endif()
# Create batch files for Windows platforms
if(WIN32)
set(template_name "start${_APP_NAME}.bat.in")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${template_name}")
foreach(BUILD_TYPE debug release)
mitkFunctionCreateWindowsBatchScript(${template_name}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/start${_APP_NAME}_${BUILD_TYPE}.bat
${BUILD_TYPE})
endforeach()
endif()
endif(WIN32)
# -----------------------------------------------------------------------
# Install support
# -----------------------------------------------------------------------
if(NOT _APP_NO_INSTALL)
# This installs all third-party CTK plug-ins
FunctionInstallThirdPartyCTKPlugins(${_APP_PLUGINS} EXCLUDE ${_APP_EXCLUDE_PLUGINS})
if(COMMAND BlueBerryApplicationInstallHook)
set(_real_app_plugins ${_APP_PLUGINS})
if(_APP_EXCLUDE_PLUGINS)
list(REMOVE_ITEM _real_app_plugins ${_APP_EXCLUDE_PLUGINS})
endif()
BlueBerryApplicationInstallHook(APP_NAME ${_APP_NAME} PLUGINS ${_real_app_plugins})
endif()
# Install the executable
MITK_INSTALL_TARGETS(EXECUTABLES ${_APP_NAME} LIBRARY_DIRS ${_APP_LIBRARY_DIRS} GLOB_PLUGINS )
if(NOT _APP_NO_PROVISIONING)
# Install the provisioning file
mitkFunctionInstallProvisioningFiles(${_prov_file})
endif()
# On Linux, create a shell script to start a relocatable application
if(UNIX AND NOT APPLE)
install(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME ${_APP_NAME}.sh)
endif()
# Tell cpack the executables that you want in the start menu as links
set(MITK_CPACK_PACKAGE_EXECUTABLES ${MITK_CPACK_PACKAGE_EXECUTABLES} "${_APP_NAME};${_APP_DESCRIPTION}" CACHE INTERNAL "Collecting windows shortcuts to executables")
endif()
endfunction()
diff --git a/BlueBerry/CMake/MacroCreateCTKPlugin.cmake b/BlueBerry/CMake/MacroCreateCTKPlugin.cmake
index f389342ece..592301335d 100644
--- a/BlueBerry/CMake/MacroCreateCTKPlugin.cmake
+++ b/BlueBerry/CMake/MacroCreateCTKPlugin.cmake
@@ -1,192 +1,190 @@
#! \brief Creates a CTK plugin.
#!
#! This macro should be called from the plugins CMakeLists.txt file.
#! The target name is available after the macro call as ${PLUGIN_TARGET}
#! to add additional libraries in your CMakeLists.txt. Include paths and link
#! libraries are set depending on the value of the Required-Plugins header
#! in your manifest_headers.cmake file.
#!
#! This macro internally calls ctkMacroBuildPlugin() and adds support
#! for Qt Help files and installers.
#!
#! \param EXPORT_DIRECTIVE (required) The export directive to use in the generated
#! <plugin_target>_Exports.h file.
#! \param EXPORTED_INCLUDE_SUFFIXES (optional) a list of sub-directories which should
#! be added to the current source directory. The resulting directories
#! will be available in the set of include directories of depending plug-ins.
#! \param DOXYGEN_TAGFILES (optional) Which external tag files should be available for the plugin documentation
#! \param MOC_OPTIONS (optional) Additional options to pass to the Qt MOC compiler
#! \param TEST_PLUGIN (option) Mark this plug-in as a testing plug-in.
#! \param NO_INSTALL (option) Don't install this plug-in.
macro(MACRO_CREATE_CTK_PLUGIN)
MACRO_PARSE_ARGUMENTS(_PLUGIN "EXPORT_DIRECTIVE;EXPORTED_INCLUDE_SUFFIXES;DOXYGEN_TAGFILES;MOC_OPTIONS" "TEST_PLUGIN;NO_INSTALL;NO_QHP_TRANSFORM" ${ARGN})
message(STATUS "Creating CTK plugin ${PROJECT_NAME}")
set(PLUGIN_TARGET ${PROJECT_NAME})
include(files.cmake)
set(_PLUGIN_CPP_FILES ${CPP_FILES})
set(_PLUGIN_MOC_H_FILES ${MOC_H_FILES})
set(_PLUGIN_UI_FILES ${UI_FILES})
set(_PLUGIN_CACHED_RESOURCE_FILES ${CACHED_RESOURCE_FILES})
set(_PLUGIN_TRANSLATION_FILES ${TRANSLATION_FILES})
set(_PLUGIN_QRC_FILES ${QRC_FILES})
set(_PLUGIN_H_FILES ${H_FILES})
set(_PLUGIN_TXX_FILES ${TXX_FILES})
set(_PLUGIN_DOX_FILES ${DOX_FILES})
set(_PLUGIN_CMAKE_FILES ${CMAKE_FILES} files.cmake)
set(_PLUGIN_FILE_DEPENDENCIES ${FILE_DEPENDENCIES})
if(CTK_PLUGINS_OUTPUT_DIR)
set(_output_dir "${CTK_PLUGINS_OUTPUT_DIR}")
else()
set(_output_dir "")
endif()
if(_PLUGIN_TEST_PLUGIN)
+ find_package(CppUnit REQUIRED)
set(is_test_plugin "TEST_PLUGIN")
else()
set(is_test_plugin)
endif()
# Compute the plugin dependencies
ctkFunctionGetTargetLibraries(_PLUGIN_target_libraries)
#------------------------------------------------------------#
#------------------ Qt Help support -------------------------#
set(PLUGIN_GENERATED_QCH_FILES )
if(BLUEBERRY_USE_QT_HELP AND
EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/documentation/UserManual")
set(PLUGIN_DOXYGEN_INPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/documentation/UserManual")
set(PLUGIN_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/documentation/UserManual")
# Create a list of Doxygen tag files from the plug-in dependencies
set(PLUGIN_DOXYGEN_TAGFILES)
foreach(_dep_target ${_PLUGIN_target_libraries})
string(REPLACE _ . _dep ${_dep_target})
get_target_property(_is_imported ${_dep_target} IMPORTED)
if(_is_imported)
get_target_property(_import_loc_debug ${_dep_target} IMPORTED_LOCATION_DEBUG)
get_target_property(_import_loc_release ${_dep_target} IMPORTED_LOCATION_RELEASE)
# There is not necessarily a debug and release build
if(_import_loc_release)
set(_import_loc ${_import_loc_release})
else()
set(_import_loc ${_import_loc_debug})
endif()
get_filename_component(_target_filename "${_import_loc}" NAME)
# on windows there might be a Debug or Release subdirectory
string(REGEX REPLACE "/bin/plugins/(Debug/|Release/)?${_target_filename}" "/Plugins/${_dep}/documentation/UserManual" plugin_tag_dir "${_import_loc}" )
else()
set(plugin_tag_dir "${CMAKE_BINARY_DIR}/Plugins/${_dep}/documentation/UserManual")
endif()
set(_tag_file "${plugin_tag_dir}/${_dep_target}.tag")
if(EXISTS ${_tag_file})
set(PLUGIN_DOXYGEN_TAGFILES "${PLUGIN_DOXYGEN_TAGFILES} ${_tag_file}=qthelp://${_dep}/bundle/")
endif()
endforeach()
if(_PLUGIN_DOXYGEN_TAGFILES)
set(PLUGIN_DOXYGEN_TAGFILES "${PLUGIN_DOXYGEN_TAGFILES} ${_PLUGIN_DOXYGEN_TAGFILES}")
endif()
#message("PLUGIN_DOXYGEN_TAGFILES: ${PLUGIN_DOXYGEN_TAGFILES}")
if(_PLUGIN_NO_QHP_TRANSFORM)
set(_use_qhp_xsl 0)
else()
set(_use_qhp_xsl 1)
endif()
_FUNCTION_CREATE_CTK_QT_COMPRESSED_HELP(PLUGIN_GENERATED_QCH_FILES ${_use_qhp_xsl})
list(APPEND _PLUGIN_CACHED_RESOURCE_FILES ${PLUGIN_GENERATED_QCH_FILES})
endif()
#------------------------------------------------------------#
#------------------ Create Plug-in --------------------------#
ctkMacroBuildPlugin(
NAME ${PLUGIN_TARGET}
EXPORT_DIRECTIVE ${_PLUGIN_EXPORT_DIRECTIVE}
SRCS ${_PLUGIN_CPP_FILES}
MOC_SRCS ${_PLUGIN_MOC_H_FILES}
MOC_OPTIONS ${_PLUGIN_MOC_OPTIONS}
UI_FORMS ${_PLUGIN_UI_FILES}
EXPORTED_INCLUDE_SUFFIXES ${_PLUGIN_EXPORTED_INCLUDE_SUFFIXES}
RESOURCES ${_PLUGIN_QRC_FILES}
- TARGET_LIBRARIES ${_PLUGIN_target_libraries}
+ TARGET_LIBRARIES ${_PLUGIN_target_libraries} ${CppUnit_LIBRARIES}
CACHED_RESOURCEFILES ${_PLUGIN_CACHED_RESOURCE_FILES}
TRANSLATIONS ${_PLUGIN_TRANSLATION_FILES}
OUTPUT_DIR ${_output_dir}
${is_test_plugin}
)
if(mbilog_FOUND)
target_link_libraries(${PLUGIN_TARGET} mbilog)
endif()
include_directories(${Poco_INCLUDE_DIRS})
+ include_directories(${CppUnit_INCLUDE_DIRS})
include_directories(${BlueBerry_BINARY_DIR})
- target_link_libraries(${PLUGIN_TARGET}
- optimized PocoFoundation debug PocoFoundationd
- optimized PocoUtil debug PocoUtild
- optimized PocoXML debug PocoXMLd
- )
+ target_link_libraries(${PLUGIN_TARGET} ${Poco_LIBRARIES})
# Set compiler flags
get_target_property(_plugin_compile_flags ${PLUGIN_TARGET} COMPILE_FLAGS)
if(NOT _plugin_compile_flags)
set(_plugin_compile_flags "")
endif()
if(WIN32)
set(_plugin_compile_flags "${_plugin_compile_flags} -DPOCO_NO_UNWINDOWS -DWIN32_LEAN_AND_MEAN")
endif()
set_target_properties(${PLUGIN_TARGET} PROPERTIES COMPILE_FLAGS "${_plugin_compile_flags}")
set(_PLUGIN_META_FILES "${CMAKE_CURRENT_SOURCE_DIR}/manifest_headers.cmake")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin.xml")
list(APPEND _PLUGIN_META_FILES "${CMAKE_CURRENT_SOURCE_DIR}/plugin.xml")
endif()
MACRO_ORGANIZE_SOURCES(
SOURCE ${_PLUGIN_CPP_FILES}
HEADER ${_PLUGIN_H_FILES}
TXX ${_PLUGIN_TXX_FILES}
DOC ${_PLUGIN_DOX_FILES}
UI ${_PLUGIN_UI_FILES}
QRC ${_PLUGIN_QRC_FILES} ${_PLUGIN_CACHED_RESOURCE_FILES}
META ${_PLUGIN_META_FILES}
MOC ${MY_MOC_CPP}
GEN_UI ${MY_UI_CPP}
GEN_QRC ${MY_QRC_SRCS}
)
#------------------------------------------------------------#
#------------------ Installer support -----------------------#
if(NOT _PLUGIN_NO_INSTALL)
set(install_directories "")
if(NOT MACOSX_BUNDLE_NAMES)
set(install_directories bin/plugins)
else(NOT MACOSX_BUNDLE_NAMES)
foreach(bundle_name ${MACOSX_BUNDLE_NAMES})
list(APPEND install_directories ${bundle_name}.app/Contents/MacOS/plugins)
endforeach(bundle_name)
endif(NOT MACOSX_BUNDLE_NAMES)
foreach(install_subdir ${install_directories})
MACRO_INSTALL_CTK_PLUGIN(TARGETS ${PLUGIN_TARGET}
DESTINATION ${install_subdir})
endforeach()
endif()
endmacro()
diff --git a/BlueBerry/CMakeLists.txt b/BlueBerry/CMakeLists.txt
index a28dbb6ed6..d14a477fd6 100644
--- a/BlueBerry/CMakeLists.txt
+++ b/BlueBerry/CMakeLists.txt
@@ -1,280 +1,278 @@
project(BlueBerry)
cmake_minimum_required(VERSION 2.8.5)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMake/")
include(MacroParseArguments)
include(MacroConvertSchema)
include(MacroOrganizeSources)
include(MacroCreateCTKPlugin)
include(MacroCreateQtHelp)
include(MacroInstallCTKPlugin)
include(FunctionCreateProvisioningFile)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4275 /wd4251 /wd4503")
endif()
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
endif()
find_package(mbilog REQUIRED)
include_directories(${mbilog_INCLUDE_DIRS})
find_package(Qt4 4.6.2 REQUIRED)
if(QT_QMAKE_CHANGED)
set(QT_HELPGENERATOR_EXECUTABLE NOTFOUND)
set(QT_COLLECTIONGENERATOR_EXECUTABLE NOTFOUND)
set(QT_ASSISTANT_EXECUTABLE NOTFOUND)
set(QT_XMLPATTERNS_EXECUTABLE NOTFOUND)
endif()
find_program(QT_HELPGENERATOR_EXECUTABLE
NAMES qhelpgenerator qhelpgenerator-qt4 qhelpgenerator4
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
find_program(QT_COLLECTIONGENERATOR_EXECUTABLE
NAMES qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator4
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
find_program(QT_ASSISTANT_EXECUTABLE
NAMES assistant-qt4 assistant4 assistant
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
find_program(QT_XMLPATTERNS_EXECUTABLE
NAMES xmlpatterns
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
option(BLUEBERRY_USE_QT_HELP "Enable support for integrating bundle documentation into Qt Help" ON)
mark_as_advanced(BLUEBERRY_USE_QT_HELP
QT_HELPGENERATOR_EXECUTABLE
QT_COLLECTIONGENERATOR_EXECUTABLE
QT_ASSISTANT_EXECUTABLE
QT_XMLPATTERNS_EXECUTABLE)
set(_doxygen_too_old 1)
if(BLUEBERRY_USE_QT_HELP)
find_package(Doxygen)
if(DOXYGEN_FOUND)
execute_process(COMMAND ${DOXYGEN_EXECUTABLE} --version
OUTPUT_VARIABLE _doxygen_version)
if(${_doxygen_version} VERSION_GREATER 1.6.0 OR
${_doxygen_version} VERSION_EQUAL 1.6.0)
set(_doxygen_too_old 0)
endif()
endif()
if(_doxygen_too_old)
message("Doxygen was not found or is too old. Version 1.6.0 or later is needed if BLUEBERRY_USE_QT_HELP is ON")
set(BLUEBERRY_USE_QT_HELP OFF CACHE BOOL "Enable support for integrating bundle documentation into Qt Help" FORCE)
endif()
if(NOT QT_HELPGENERATOR_EXECUTABLE)
message("You have enabled Qt Help support, but QT_HELPGENERATOR_EXECUTABLE is empty")
set(BLUEBERRY_USE_QT_HELP OFF CACHE BOOL "Enable support for integrating bundle documentation into Qt Help" FORCE)
endif()
if(NOT QT_XMLPATTERNS_EXECUTABLE)
message("You have enabled Qt Help support, but QT_XMLPATTERNS_EXECUTABLE is empty")
set(BLUEBERRY_USE_QT_HELP OFF CACHE BOOL "Enable support for integrating bundle documentation into Qt Help" FORCE)
endif()
endif(BLUEBERRY_USE_QT_HELP)
include(${QT_USE_FILE})
# ========= CTK specific CMake stuff ============
cmake_policy(SET CMP0012 NEW)
find_package(CTK REQUIRED)
# Extract all library names starting with org_blueberry_
macro(GetMyTargetLibraries all_target_libraries varname)
set(re_ctkplugin "^org_blueberry_[a-zA-Z0-9_]+$")
set(_tmp_list)
list(APPEND _tmp_list ${all_target_libraries})
ctkMacroListFilter(_tmp_list re_ctkplugin OUTPUT_VARIABLE ${varname})
endmacro()
# ================================================
option(BLUEBERRY_BUILD_ALL_PLUGINS "Build all BlueBerry plugins (overriding selection)" OFF)
mark_as_advanced(BLUEBERRY_BUILD_ALL_PLUGINS)
if(BLUEBERRY_BUILD_ALL_PLUGINS)
set(BLUEBERRY_BUILD_ALL_PLUGINS_OPTION "FORCE_BUILD_ALL")
endif()
option(BLUEBERRY_STATIC "Build all plugins as static libraries" OFF)
mark_as_advanced(BLUEBERRY_STATIC)
option(BLUEBERRY_DEBUG_SMARTPOINTER "Enable code for debugging smart pointers" OFF)
mark_as_advanced(BLUEBERRY_DEBUG_SMARTPOINTER)
find_package(Poco REQUIRED)
find_package(Ant)
find_package(Eclipse)
set(BLUEBERRY_SOURCE_DIR ${BlueBerry_SOURCE_DIR})
set(BLUEBERRY_BINARY_DIR ${BlueBerry_BINARY_DIR})
set(BLUEBERRY_PLUGINS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Bundles)
set(BLUEBERRY_PLUGINS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Bundles)
set(OSGI_APP solstice)
set(OSGI_UI_APP solstice_ui)
if(Eclipse_DIR)
set(BLUEBERRY_DOC_TOOLS_DIR "${Eclipse_DIR}" CACHE PATH "Directory containing additional tools needed for generating the documentation")
else()
set(BLUEBERRY_DOC_TOOLS_DIR "" CACHE PATH "Directory containing additional tools needed for generating the documentation")
endif()
set(BLUEBERRY_DEBUG_POSTFIX d)
# Testing options
if(DEFINED BLUEBERRY_BUILD_TESTING)
option(BLUEBERRY_BUILD_TESTING "Build the BlueBerry tests." ${BLUEBERRY_BUILD_TESTING})
else()
option(BLUEBERRY_BUILD_TESTING "Build the BlueBerry tests." ${BUILD_TESTING})
endif()
if(WIN32)
set(_gui_testing_default "ON")
else()
set(_gui_testing_default "OFF")
endif()
option(BLUEBERRY_ENABLE_GUI_TESTING "Enable the BlueBerry GUI tests" ${_gui_testing_default})
mark_as_advanced(BLUEBERRY_ENABLE_GUI_TESTING)
if(BLUEBERRY_BUILD_TESTING)
enable_testing()
endif()
# Add CTK plugins
set(_ctk_plugins
Bundles/org.blueberry.osgi:ON
Bundles/org.blueberry.compat:OFF
Bundles/org.blueberry.core.runtime:OFF
Bundles/org.blueberry.core.expressions:OFF
Bundles/org.blueberry.solstice.common:OFF
Bundles/org.blueberry.core.commands:OFF
Bundles/org.blueberry.core.jobs:OFF
Bundles/org.blueberry.ui:OFF
Bundles/org.blueberry.ui.qt:OFF
Bundles/org.blueberry.ui.qt.help:OFF
Bundles/org.blueberry.ui.qt.log:ON
Bundles/org.blueberry.ui.qt.objectinspector:OFF
)
set(_ctk_test_plugins )
set(_ctk_plugins_include_dirs
${Poco_INCLUDE_DIRS}
)
set(_ctk_plugins_link_dirs
${Poco_LIBRARY_DIR}
)
include_directories(${_ctk_plugins_include_dirs})
link_directories(${_ctk_plugins_link_dirs})
if(BLUEBERRY_BUILD_TESTING)
+ find_package(CppUnit REQUIRED)
include(berryTestingHelpers)
set(BLUEBERRY_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_APP}")
get_target_property(_is_macosx_bundle ${OSGI_APP} MACOSX_BUNDLE)
if(APPLE AND _is_macosx_bundle)
set(BLUEBERRY_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_APP}.app/Contents/MacOS/${OSGI_APP}")
endif()
set(_ctk_testinfrastructure_plugins
Bundles/org.blueberry.test:ON
Bundles/org.blueberry.uitest:ON
)
set(_ctk_test_plugins
# Testing/org.blueberry.core.runtime.tests:ON
# Testing/org.blueberry.osgi.tests:ON
)
if(BLUEBERRY_ENABLE_GUI_TESTING)
# list(APPEND _ctk_test_plugins Testing/org.blueberry.ui.tests:ON)
set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_UI_APP}")
get_target_property(_is_macosx_bundle ${OSGI_UI_APP} MACOSX_BUNDLE)
if(APPLE AND _is_macosx_bundle)
set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_UI_APP}.app/Contents/MacOS/${OSGI_UI_APP}")
endif()
endif()
endif()
set(BLUEBERRY_TESTING_PROVISIONING_FILE "${BlueBerry_BINARY_DIR}/BlueBerryTesting.provisioning")
add_custom_target(BlueBerry)
ctkMacroSetupPlugins(${_ctk_plugins} ${_ctk_testinfrastructure_plugins} ${_ctk_test_plugins}
BUILD_OPTION_PREFIX BLUEBERRY_BUILD_
BUILD_ALL ${BLUEBERRY_BUILD_ALL_PLUGINS}
COMPACT_OPTIONS)
set(BLUEBERRY_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/BlueBerry.provisioning")
FunctionCreateProvisioningFile(
FILE ${BLUEBERRY_PROVISIONING_FILE}
PLUGINS ${_ctk_plugins}
)
FunctionCreateProvisioningFile(
FILE ${BLUEBERRY_TESTING_PROVISIONING_FILE}
INCLUDE ${BLUEBERRY_PROVISIONING_FILE}
PLUGINS ${_ctk_testinfrastructure_plugins} ${_ctk_test_plugins}
)
if(${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES)
add_dependencies(BlueBerry ${${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES})
endif()
set_property(TARGET ${${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES} PROPERTY LABELS BlueBerry)
set(BB_PLUGIN_USE_FILE "${BlueBerry_BINARY_DIR}/BlueBerryPluginUseFile.cmake")
if(${PROJECT_NAME}_PLUGIN_LIBRARIES)
ctkFunctionGeneratePluginUseFile(${BB_PLUGIN_USE_FILE})
else()
file(REMOVE ${BB_PLUGIN_USE_FILE})
set(BB_PLUGIN_USE_FILE )
endif()
# CTK Plugin Exports
set(BB_PLUGIN_EXPORTS_FILE "${CMAKE_CURRENT_BINARY_DIR}/BlueBerryPluginExports.cmake")
GetMyTargetLibraries("${${PROJECT_NAME}_PLUGIN_LIBRARIES}" my_plugin_targets)
-set(additional_export_targets mbilog PocoFoundation PocoUtil PocoXML)
-if(BLUEBERRY_BUILD_TESTING)
- list(APPEND additional_export_targets CppUnit)
-endif()
+set(additional_export_targets mbilog)
export(TARGETS ${my_plugin_targets} ${additional_export_targets}
FILE ${BB_PLUGIN_EXPORTS_FILE})
add_subdirectory(Documentation)
set(BLUEBERRY_QTPLUGIN_PATH )
if(CTK_QTDESIGNERPLUGINS_DIR AND EXISTS ${CTK_QTDESIGNERPLUGINS_DIR})
set(BLUEBERRY_QTPLUGIN_PATH "${CTK_QTDESIGNERPLUGINS_DIR}")
endif()
configure_file(BlueBerryConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/BlueBerryConfig.cmake @ONLY)
diff --git a/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryCoreRuntimeTestSuite.cpp b/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryCoreRuntimeTestSuite.cpp
index d6b4a47ce9..336dee5c98 100644
--- a/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryCoreRuntimeTestSuite.cpp
+++ b/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryCoreRuntimeTestSuite.cpp
@@ -1,41 +1,41 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#include <CppUnit/TestCase.h>
-#include <CppUnit/TestSuite.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestCase.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
#include "berryCoreRuntimeTestSuite.h"
#include "berryPreferencesTest.h"
#include "berryPreferencesServiceTest.h"
namespace berry {
CoreRuntimeTestSuite::CoreRuntimeTestSuite(const CoreRuntimeTestSuite& other)
{
}
CoreRuntimeTestSuite::CoreRuntimeTestSuite()
: CppUnit::TestSuite("CoreRuntimeTestSuite")
{
addTest(PreferencesTest::Suite());
addTest(PreferencesServiceTest::Suite());
}
}
diff --git a/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryCoreRuntimeTestSuite.h b/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryCoreRuntimeTestSuite.h
index 9e073ddcd9..c0353c8c40 100644
--- a/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryCoreRuntimeTestSuite.h
+++ b/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryCoreRuntimeTestSuite.h
@@ -1,42 +1,42 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYCORERUNTIMETESTSUITE_H_
#define BERRYCORERUNTIMETESTSUITE_H_
-#include <CppUnit/TestSuite.h>
+#include <cppunit/TestSuite.h>
#include <QObject>
Q_DECLARE_INTERFACE(CppUnit::Test, "CppUnit.Test")
namespace berry {
class CoreRuntimeTestSuite : public QObject, public CppUnit::TestSuite
{
Q_OBJECT
Q_INTERFACES(CppUnit::Test)
public:
CoreRuntimeTestSuite();
CoreRuntimeTestSuite(const CoreRuntimeTestSuite& other);
};
}
#endif /* BERRYCORERUNTIMETESTSUITE_H_ */
diff --git a/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryPreferencesServiceTest.cpp b/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryPreferencesServiceTest.cpp
index 354c0ac297..eed8689bd0 100644
--- a/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryPreferencesServiceTest.cpp
+++ b/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryPreferencesServiceTest.cpp
@@ -1,140 +1,140 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berryPreferencesServiceTest.h"
#include <berryIBerryPreferencesService.h>
#include <berryIPreferences.h>
#include <berryPlatform.h>
#include "berryLog.h"
-#include <CppUnit/TestSuite.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
#include "Poco/File.h"
#include "Poco/Path.h"
#include "Poco/AutoPtr.h"
#include <cstdlib>
#include <iostream>
#include <sstream>
using namespace std;
namespace berry
{
PreferencesServiceTest::PreferencesServiceTest(const std::string& testName)
: berry::TestCase(testName)
{}
CppUnit::Test* PreferencesServiceTest::Suite()
{
CppUnit::TestSuite* suite = new CppUnit::TestSuite("PreferencesServiceTest");
CppUnit_addTest(suite, PreferencesServiceTest, TestAll);
return suite;
}
void PreferencesServiceTest::TestAll()
{
try
{
IPreferencesService::Pointer prefService = Platform::GetServiceRegistry().GetServiceById<IPreferencesService>(IPreferencesService::ID);
assert(prefService.IsNotNull());
/// Test for: IPreferences::GetSystemPreferences()
IPreferences::Pointer sysPrefs = prefService->GetSystemPreferences();
assert(sysPrefs.IsNotNull());
/// Test for: IPreferences::GetUserPreferences(std::string name)
IPreferences::Pointer testUserPrefs = prefService->GetUserPreferences("testUser");
assert(testUserPrefs.IsNotNull());
/// Test for: IPreferences::GetUsers()
std::vector<std::string> userList = prefService->GetUsers();
// userList should now contain "testUser"
bool userListContainsTestUser = false;
for (std::vector<std::string>::iterator it = userList.begin()
; it != userList.end(); it++)
{
if(*it == "testUser")
{
userListContainsTestUser = true;
break;
}
}
assert(userListContainsTestUser);
IBerryPreferencesService::Pointer berryPrefService = prefService.Cast<IBerryPreferencesService>();
// optional test for IBerryPreferencesService
if(berryPrefService.IsNotNull())
{
/// Test for: IBerryPreferencesService::ExportPreferences(Poco::File f, std::string name="")
// write general prefs
std::string sysPrefsExportFilePath = Poco::Path::temp() + Poco::Path::separator() + "systemBerryPreferences";
Poco::File sysPrefsExportFile(sysPrefsExportFilePath);
sysPrefs->PutInt("testNumber", 1);
berryPrefService->ExportPreferences(sysPrefsExportFile);
// assert somethings was written
assert(sysPrefsExportFile.getSize() > 0);
// write testUser prefs
std::string testUserPrefsExportFilePath = Poco::Path::temp() + Poco::Path::separator() + "testUserBerryPreferences";
Poco::File testUserPrefsExportFile(testUserPrefsExportFilePath);
testUserPrefs->PutInt("testNumber", 2);
berryPrefService->ExportPreferences(testUserPrefsExportFile, "testUser");
assert(testUserPrefsExportFile.getSize() > 0);
/// Test for: IBerryPreferencesService::ImportPreferences(Poco::File f, std::string name="")
// import general prefs
// change testNumber value
sysPrefs->PutInt("testNumber", 3);
berryPrefService->ImportPreferences(sysPrefsExportFile);
// "testNumber" preference should now again be overwritten with its old value 1
assert(sysPrefs->GetInt("testNumber", 3) == 1);
// import testUser prefs
// change testNumber value
testUserPrefs->PutInt("testNumber", 4);
berryPrefService->ImportPreferences(testUserPrefsExportFile, "testUser");
// "testNumber" preference should now again be overwritten with its old value 2
assert(testUserPrefs->GetInt("testNumber", 4) == 2);
// delete files again
sysPrefsExportFile.remove();
testUserPrefsExportFile.remove();
}
}
catch (Poco::CreateFileException& e)
{
std::string msg = "Failed to create preferences file: ";
msg.append(e.what());
this->fail( msg );
}
catch (std::exception& e)
{
this->fail( e.what() );
}
catch (...)
{
this->fail( "unknown exception occured" );
}
}
}
diff --git a/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryPreferencesTest.cpp b/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryPreferencesTest.cpp
index f22d17798e..36001e5af8 100644
--- a/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryPreferencesTest.cpp
+++ b/BlueBerry/Testing/org.blueberry.core.runtime.tests/src/berryPreferencesTest.cpp
@@ -1,177 +1,177 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berryPreferencesTest.h"
#include <berryIBerryPreferences.h>
#include <berryIBerryPreferencesService.h>
#include <berryPlatform.h>
-#include <CppUnit/TestSuite.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
#include "berryLog.h"
#include "Poco/File.h"
#include "Poco/Path.h"
#include <cstdlib>
#include <iostream>
#include <limits>
using namespace std;
namespace berry
{
PreferencesTest::PreferencesTest(const std::string& testName)
: berry::TestCase(testName)
{}
CppUnit::Test* PreferencesTest::Suite()
{
CppUnit::TestSuite* suite = new CppUnit::TestSuite("PreferencesTest");
CppUnit_addTest(suite, PreferencesTest, TestAll);
return suite;
}
// simple class for testing berry changed events
class TestPreferencesChangedListener
{
public:
TestPreferencesChangedListener(IBerryPreferences* _berryPrefNode) : numCalled(0), berryPrefNode(_berryPrefNode)
{
berryPrefNode->OnChanged.AddListener(
berry::MessageDelegate1<TestPreferencesChangedListener, const IBerryPreferences*> (
this, &TestPreferencesChangedListener::PreferencesChanged )
);
};
~TestPreferencesChangedListener()
{
berryPrefNode->OnChanged.RemoveListener(
berry::MessageDelegate1<TestPreferencesChangedListener, const IBerryPreferences*> (
this, &TestPreferencesChangedListener::PreferencesChanged )
);
};
void PreferencesChanged(const IBerryPreferences*)
{
++numCalled;
}
int numCalled;
IBerryPreferences* berryPrefNode;
};
void PreferencesTest::TestAll()
{
IPreferencesService::Pointer prefService = Platform::GetServiceRegistry().GetServiceById<IPreferencesService>(IPreferencesService::ID);
assert(prefService.IsNotNull());
/// Test for: IPreferences::GetSystemPreferences()
IPreferences::Pointer root = prefService->GetSystemPreferences();
assert(root.IsNotNull());
{
BERRY_INFO << "testing Preferences::Node(), Preferences::NodeExists(), Preferences::Parent(), "
"Preferences::ChildrenNames(), Preferences::RemoveNode()";
berry::IPreferences::Pointer editorsNode(0);
editorsNode = root->Node("/editors");
assert(editorsNode.IsNotNull());
assert(editorsNode->NodeExists("/editors"));
assert(editorsNode->Parent() == root);
berry::IPreferences::Pointer editorsGeneralNode = root->Node("/editors/general");
assert(editorsNode->NodeExists("/editors/general"));
berry::IPreferences::Pointer editorsSyntaxNode = root->Node("/editors/syntax");
assert(editorsGeneralNode->NodeExists("/editors/syntax"));
berry::IPreferences::Pointer editorsFontNode = root->Node("/editors/font");
assert(editorsSyntaxNode->NodeExists("/editors/font"));
vector<string> childrenNames;
childrenNames.push_back("general");
childrenNames.push_back("syntax");
childrenNames.push_back("font");
assert(editorsNode->ChildrenNames() == childrenNames);
editorsFontNode->RemoveNode();
try {
editorsFontNode->Parent();
failmsg("this should throw a Poco::IllegalStateException");
}
catch (Poco::IllegalStateException)
{
// expected
}
}
// testing methods
// Preferences::put*()
// Preferences::get*()
{
BERRY_INFO << "testing Preferences::put*(), Preferences::get*(), OnChanged";
assert(root->NodeExists("/editors/general"));
berry::IPreferences::Pointer editorsGeneralNode = root->Node("/editors/general");
IBerryPreferences::Pointer berryEditorsGeneralNode = editorsGeneralNode.Cast< IBerryPreferences >();
assert(berryEditorsGeneralNode.IsNotNull());
TestPreferencesChangedListener listener(berryEditorsGeneralNode.GetPointer());
std::string strKey = "Bad words";std::string strValue = "badword1 badword2";
editorsGeneralNode->Put(strKey, strValue);
assert(listener.numCalled == 1);
assert(editorsGeneralNode->Get(strKey, "") == strValue);
assert(editorsGeneralNode->Get("wrong key", "default value") == "default value");
strKey = "Show Line Numbers";bool bValue = true;
editorsGeneralNode->PutBool(strKey, bValue);
assert(listener.numCalled == 2);
assert(editorsGeneralNode->GetBool(strKey, !bValue) == bValue);
strKey = "backgroundcolor"; strValue = "#00FF00";
editorsGeneralNode->PutByteArray(strKey, strValue);
assert(listener.numCalled == 3);
assert(editorsGeneralNode->GetByteArray(strKey, "") == strValue);
strKey = "update time"; double dValue = 1.23;
editorsGeneralNode->PutDouble(strKey, dValue);
assert(editorsGeneralNode->GetDouble(strKey, 0.0) == dValue);
strKey = "update time float"; float fValue = 1.23f;
editorsGeneralNode->PutFloat(strKey, fValue);
assert(editorsGeneralNode->GetFloat(strKey, 0.0f) == fValue);
strKey = "Break on column"; int iValue = 80;
editorsGeneralNode->PutInt(strKey, iValue);
assert(editorsGeneralNode->GetInt(strKey, 0) == iValue);
strKey = "Maximum number of words"; long lValue = 11000000;
editorsGeneralNode->PutLong(strKey, lValue);
assert(editorsGeneralNode->GetLong(strKey, 0) == lValue);
}
}
}
diff --git a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryMessageTest.cpp b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryMessageTest.cpp
index 83674a8a3b..978881e10c 100755
--- a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryMessageTest.cpp
+++ b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryMessageTest.cpp
@@ -1,331 +1,331 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berryMessageTest.h"
#include <berryMessage.h>
//#include <cstdlib>
-#include <CppUnit/TestSuite.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
namespace berry
{
struct MessageReceiver
{
bool received;
MessageReceiver() : received(false) {}
void PureSignal() { received = true; }
bool PureSignalWithReturn() { received = true; return received; }
void Message1(int i) { received = (i != 0); }
bool Message1WithReturn(int i) { received = (i != 0); return received; }
void Message2(int i, float d) { received = (i != 0 && d != 0); }
bool Message2WithReturn(int i, float d) { received = (i != 0 && d!= 0); return received; }
void Message3(int i, float d, double e) { received = (i != 0 && d != 0 && e != 0); }
bool Message3WithReturn(int i, float d, double e) { received = (i != 0 && d != 0 && e != 0); return received; }
void Message4(int i, float d, double e, bool b) { received = (i != 0 && d != 0 && e != 0 && b); }
bool Message4WithReturn(int i, float d, double e, bool b) { received = (i != 0 && d != 0 && e != 0 && b); return received; }
};
MessageTest::MessageTest(const std::string& testName)
: TestCase(testName)
{
}
CppUnit::Test* MessageTest::Suite()
{
CppUnit::TestSuite* suite = new CppUnit::TestSuite("MessageTest");
CppUnit_addTest(suite, MessageTest, TestMessage);
CppUnit_addTest(suite, MessageTest, TestMessageWithReturn);
CppUnit_addTest(suite, MessageTest, TestMessage1);
CppUnit_addTest(suite, MessageTest, TestMessage1WithReturn);
CppUnit_addTest(suite, MessageTest, TestMessage2);
CppUnit_addTest(suite, MessageTest, TestMessage2WithReturn);
CppUnit_addTest(suite, MessageTest, TestMessage3);
CppUnit_addTest(suite, MessageTest, TestMessage3WithReturn);
CppUnit_addTest(suite, MessageTest, TestMessage4);
CppUnit_addTest(suite, MessageTest, TestMessage4WithReturn);
return suite;
}
void MessageTest::TestMessage()
{
berry::Message<> msg;
MessageReceiver receiver;
MessageReceiver receiver2;
typedef berry::MessageDelegate<MessageReceiver> Delegate;
msg += Delegate(&receiver, &MessageReceiver::PureSignal);
assertEqual(1, (long)msg.GetListeners().size());
msg += Delegate(&receiver2, &MessageReceiver::PureSignal);
// duplicate entry
msg += Delegate(&receiver, &MessageReceiver::PureSignal);
assertEqual(2, (long)msg.GetListeners().size());
msg.Send();
assert(receiver.received && receiver2.received);
receiver.received = false;
receiver2.received = false;
msg -= Delegate(&receiver, &MessageReceiver::PureSignal);
assertEqual(1, (long)msg.GetListeners().size());
msg.Send();
assert(receiver.received == false && receiver2.received);
}
void MessageTest::TestMessageWithReturn()
{
berry::Message<bool> msg;
MessageReceiver receiver;
typedef berry::MessageDelegate<MessageReceiver, bool> Delegate;
msg += Delegate(&receiver, &MessageReceiver::PureSignalWithReturn);
msg();
assert(receiver.received);
receiver.received = false;
typedef berry::Message<bool>::ListenerList Listeners;
const Listeners& listeners = msg.GetListeners();
bool valueReturned = false;
for (Listeners::const_iterator iter = listeners.begin();
iter != listeners.end(); ++iter)
{
valueReturned = (*iter)->Execute();
if (valueReturned) break;
}
assert(valueReturned);
}
void MessageTest::TestMessage1()
{
berry::Message1<int> msg;
MessageReceiver receiver;
MessageReceiver receiver2;
typedef berry::MessageDelegate1<MessageReceiver, int> Delegate;
msg += Delegate(&receiver, &MessageReceiver::Message1);
assertEqual(1, (long)msg.GetListeners().size());
msg += Delegate(&receiver2, &MessageReceiver::Message1);
// duplicate entry
msg += Delegate(&receiver, &MessageReceiver::Message1);
assertEqual(2, (long)msg.GetListeners().size());
msg.Send(1);
assert(receiver.received && receiver2.received);
receiver.received = false;
receiver2.received = false;
msg -= Delegate(&receiver, &MessageReceiver::Message1);
assertEqual(1, (long)msg.GetListeners().size());
msg.Send(1);
assert(receiver.received == false && receiver2.received);
}
void MessageTest::TestMessage1WithReturn()
{
berry::Message1<int, bool> msg;
MessageReceiver receiver;
typedef berry::MessageDelegate1<MessageReceiver, int, bool> Delegate;
msg += Delegate(&receiver, &MessageReceiver::Message1WithReturn);
msg(1);
assert(receiver.received);
receiver.received = false;
typedef berry::Message1<int,bool>::ListenerList Listeners;
const Listeners& listeners = msg.GetListeners();
bool valueReturned = false;
for (Listeners::const_iterator iter = listeners.begin();
iter != listeners.end(); ++iter)
{
valueReturned = (*iter)->Execute(1);
if (valueReturned) break;
}
assert(valueReturned);
}
void MessageTest::TestMessage2()
{
berry::Message2<int, float> msg;
MessageReceiver receiver;
MessageReceiver receiver2;
typedef berry::MessageDelegate2<MessageReceiver, int, float> Delegate;
msg += Delegate(&receiver, &MessageReceiver::Message2);
assertEqual(1, (long)msg.GetListeners().size());
msg += Delegate(&receiver2, &MessageReceiver::Message2);
// duplicate entry
msg += Delegate(&receiver, &MessageReceiver::Message2);
assertEqual(2, (long)msg.GetListeners().size());
msg.Send(1, 1.0);
assert(receiver.received && receiver2.received);
receiver.received = false;
receiver2.received = false;
msg -= Delegate(&receiver, &MessageReceiver::Message2);
assertEqual(1, (long)msg.GetListeners().size());
msg.Send(1, 1.0);
assert(receiver.received == false && receiver2.received);
}
void MessageTest::TestMessage2WithReturn()
{
berry::Message2<int, float, bool> msg;
MessageReceiver receiver;
typedef berry::MessageDelegate2<MessageReceiver, int, float, bool> Delegate;
msg += Delegate(&receiver, &MessageReceiver::Message2WithReturn);
msg(1, 2);
assert(receiver.received);
receiver.received = false;
typedef berry::Message2<int,float,bool>::ListenerList Listeners;
const Listeners& listeners = msg.GetListeners();
bool valueReturned = false;
for (Listeners::const_iterator iter = listeners.begin();
iter != listeners.end(); ++iter)
{
valueReturned = (*iter)->Execute(1, 0.4f);
if (valueReturned) break;
}
assert(valueReturned);
}
void MessageTest::TestMessage3()
{
berry::Message3<int, float, double> msg;
MessageReceiver receiver;
MessageReceiver receiver2;
typedef berry::MessageDelegate3<MessageReceiver, int, float, double> Delegate;
msg += Delegate(&receiver, &MessageReceiver::Message3);
assertEqual(1, (long)msg.GetListeners().size());
msg += Delegate(&receiver2, &MessageReceiver::Message3);
// duplicate entry
msg += Delegate(&receiver, &MessageReceiver::Message3);
assertEqual(2, (long)msg.GetListeners().size());
msg.Send(1, 1.0, 2.0);
assert(receiver.received && receiver2.received);
receiver.received = false;
receiver2.received = false;
msg -= Delegate(&receiver, &MessageReceiver::Message3);
assertEqual(1, (long)msg.GetListeners().size());
msg.Send(1, -1.0, 5.0);
assert(receiver.received == false && receiver2.received);
}
void MessageTest::TestMessage3WithReturn()
{
berry::Message3<int, float, double, bool> msg;
MessageReceiver receiver;
typedef berry::MessageDelegate3<MessageReceiver, int, float, double, bool> Delegate;
msg += Delegate(&receiver, &MessageReceiver::Message3WithReturn);
msg(1, -2, 0.2);
assert(receiver.received);
receiver.received = false;
typedef berry::Message3<int,float,double,bool>::ListenerList Listeners;
const Listeners& listeners = msg.GetListeners();
bool valueReturned = false;
for (Listeners::const_iterator iter = listeners.begin();
iter != listeners.end(); ++iter)
{
valueReturned = (*iter)->Execute(1, 23.5, -12.2);
if (valueReturned) break;
}
assert(valueReturned);
}
void MessageTest::TestMessage4()
{
berry::Message4<int, float, double, bool> msg;
MessageReceiver receiver;
MessageReceiver receiver2;
typedef berry::MessageDelegate4<MessageReceiver, int, float, double, bool> Delegate;
msg += Delegate(&receiver, &MessageReceiver::Message4);
assertEqual(1, (long)msg.GetListeners().size());
msg += Delegate(&receiver2, &MessageReceiver::Message4);
// duplicate entry
msg += Delegate(&receiver, &MessageReceiver::Message4);
assertEqual(2, (long)msg.GetListeners().size());
msg.Send(1, 5.4f, -1.0f, true);
assert(receiver.received && receiver2.received);
receiver.received = false;
receiver2.received = false;
msg -= Delegate(&receiver, &MessageReceiver::Message4);
assertEqual(1, (long)msg.GetListeners().size());
msg.Send(1, 0.2f, 12.0f, true);
assert(receiver.received == false && receiver2.received);
}
void MessageTest::TestMessage4WithReturn()
{
berry::Message4<int, float, double, bool, bool> msg;
MessageReceiver receiver;
typedef berry::MessageDelegate4<MessageReceiver, int, float, double, bool, bool> Delegate;
msg += Delegate(&receiver, &MessageReceiver::Message4WithReturn);
msg(1, 4.1f, -1, true);
assert(receiver.received);
receiver.received = false;
typedef berry::Message4<int,float,double,bool,bool>::ListenerList Listeners;
const Listeners& listeners = msg.GetListeners();
bool valueReturned = false;
for (Listeners::const_iterator iter = listeners.begin();
iter != listeners.end(); ++iter)
{
valueReturned = (*iter)->Execute(1, -34.21f, 2, true);
if (valueReturned) break;
}
assert(valueReturned);
}
}
diff --git a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryOSGiCoreTestSuite.cpp b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryOSGiCoreTestSuite.cpp
index 920a516fdf..20efe61146 100644
--- a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryOSGiCoreTestSuite.cpp
+++ b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryOSGiCoreTestSuite.cpp
@@ -1,45 +1,45 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#include <CppUnit/TestCase.h>
-#include <CppUnit/TestSuite.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestCase.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
#include "berryOSGiCoreTestSuite.h"
#include "berryObjectTest.h"
#include "berrySmartPointerTest.h"
#include "berryWeakPointerTest.h"
#include "berryMessageTest.h"
namespace berry {
OSGiCoreTestSuite::OSGiCoreTestSuite()
: CppUnit::TestSuite("OSGiCoreTestSuite")
{
addTest(ObjectTest::Suite());
addTest(SmartPointerTest::Suite());
addTest(WeakPointerTest::Suite());
addTest(MessageTest::Suite());
}
OSGiCoreTestSuite::OSGiCoreTestSuite(const OSGiCoreTestSuite& other)
{
Q_UNUSED(other)
}
}
diff --git a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryOSGiCoreTestSuite.h b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryOSGiCoreTestSuite.h
index 0541c57160..439f39a87c 100644
--- a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryOSGiCoreTestSuite.h
+++ b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryOSGiCoreTestSuite.h
@@ -1,42 +1,42 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYOSGICORETESTSUITE_H_
#define BERRYOSGICORETESTSUITE_H_
-#include <CppUnit/TestSuite.h>
+#include <cppunit/TestSuite.h>
#include <QObject>
Q_DECLARE_INTERFACE(CppUnit::Test, "CppUnit.Test")
namespace berry {
class OSGiCoreTestSuite : public QObject, public CppUnit::TestSuite
{
Q_OBJECT
Q_INTERFACES(CppUnit::Test)
public:
OSGiCoreTestSuite();
OSGiCoreTestSuite(const OSGiCoreTestSuite& other);
};
}
#endif /* BERRYOSGICORETESTSUITE_H_ */
diff --git a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryObjectTest.cpp b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryObjectTest.cpp
index ab9f9f785f..1a7b7705ee 100755
--- a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryObjectTest.cpp
+++ b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryObjectTest.cpp
@@ -1,113 +1,113 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berryObjectTest.h"
-#include <CppUnit/TestSuite.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
#include <berryObject.h>
//#include <cstdlib>
namespace berry
{
class TestObject: public Object
{
public:
TestObject() :
Object()
{
}
};
/**
* used for listening to destroy events
*/
struct ObjectListener
{
bool m_ObjectDeleted;
ObjectListener() :
m_ObjectDeleted(false)
{
}
void DestroyListener()
{
m_ObjectDeleted = true;
}
};
CppUnit::Test* ObjectTest::Suite()
{
CppUnit::TestSuite* suite = new CppUnit::TestSuite("ObjectTest");
CppUnit_addTest(suite, ObjectTest, TestReferenceCount);
CppUnit_addTest(suite, ObjectTest, TestAddDestroyListener);
CppUnit_addTest(suite, ObjectTest, TestRemoveDestroyListener);
return suite;
}
ObjectTest::ObjectTest(const std::string& testName) :
TestCase(testName)
{
}
void ObjectTest::TestReferenceCount()
{
TestObject* obj = new TestObject();
assertEqual(obj->GetReferenceCount(), 0);
obj->Register();
assertEqual(obj->GetReferenceCount(), 1);
obj->SetReferenceCount(3);
assertEqual(obj->GetReferenceCount(), 3);
obj->SetReferenceCount(0);
}
void ObjectTest::TestAddDestroyListener()
{
TestObject* obj = new TestObject();
ObjectListener objectListener;
obj->AddDestroyListener(berry::MessageDelegate<ObjectListener>(
&objectListener, &ObjectListener::DestroyListener));
delete obj;
assertEqual(true, objectListener.m_ObjectDeleted);
}
void ObjectTest::TestRemoveDestroyListener()
{
TestObject* obj = new TestObject();
ObjectListener objectListener;
obj->AddDestroyListener(berry::MessageDelegate<ObjectListener>(
&objectListener, &ObjectListener::DestroyListener));
obj->RemoveDestroyListener(berry::MessageDelegate<ObjectListener>(
&objectListener, &ObjectListener::DestroyListener));
delete obj;
assertEqual(false, objectListener.m_ObjectDeleted);
}
}
diff --git a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berrySmartPointerTest.cpp b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berrySmartPointerTest.cpp
index 44a2bcde2b..0acdb33ba2 100755
--- a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berrySmartPointerTest.cpp
+++ b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berrySmartPointerTest.cpp
@@ -1,213 +1,213 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berrySmartPointerTest.h"
-#include <CppUnit/TestSuite.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
#include <berryObject.h>
#include <berrySmartPointer.h>
#include <berryWeakPointer.h>
#include <typeinfo>
//#include <cstdlib>
namespace berry
{
class TestObject : public berry::Object
{
public:
TestObject() : Object(), m_Val(0) {}
TestObject(int value) : m_Val(value) {}
bool operator==(const Object* o) const
{
if (const TestObject* to = dynamic_cast<const TestObject*>(o))
return m_Val == to->m_Val;
return false;
}
private:
int m_Val;
};
SmartPointerTest::SmartPointerTest(const std::string& testName)
: TestCase(testName)
{}
CppUnit::Test* SmartPointerTest::Suite()
{
CppUnit::TestSuite* suite = new CppUnit::TestSuite("SmartPointerTest");
CppUnit_addTest(suite, SmartPointerTest, TestConstructors);
CppUnit_addTest(suite, SmartPointerTest, TestCasting);
CppUnit_addTest(suite, SmartPointerTest, TestReferenceCounting);
CppUnit_addTest(suite, SmartPointerTest, TestOperators);
return suite;
}
void SmartPointerTest::TestConstructors()
{
{
// standard constructor
berry::SmartPointer<TestObject> testobj;
assertNullPtr(testobj.GetPointer());
}
{
// standard pointer constructor
berry::SmartPointer<TestObject> testobj(new TestObject());
assertNotNullPtr(testobj.GetPointer());
assertEqual(1, testobj->GetReferenceCount());
// copy constructor
berry::SmartPointer<TestObject> testobj2 = testobj;
assertEqual(testobj.GetPointer(), testobj2.GetPointer());
assertEqual(2, testobj2->GetReferenceCount());
}
{
// WeakPointer constructor
berry::WeakPointer<TestObject> ptr_weak;
try {
berry::SmartPointer<TestObject> testobj(ptr_weak);
failmsg("this should throw a BadWeakPointerException");
}
catch (BadWeakPointerException )
{
// expected
}
}
{
// const_cast template constructor
berry::SmartPointer<TestObject> testobj(new TestObject());
berry::SmartPointer<berry::Object> obj(testobj);
assertNotNullPtr(obj.GetPointer());
assertEqual(2, obj->GetReferenceCount());
assert(typeid(*(obj.GetPointer())) == typeid(TestObject));
}
}
void SmartPointerTest::TestCasting()
// cast tests
{
berry::SmartPointer<berry::Object> obj(new TestObject());
assertNotNullPtr(obj.GetPointer());
assertEqual(1, obj->GetReferenceCount());
berry::SmartPointer<TestObject> testobj = obj.Cast<TestObject>();
assertNotNullPtr(testobj.GetPointer());
assertEqual(2, testobj->GetReferenceCount());
assertEqual(testobj.GetPointer(), obj.GetPointer());
}
void SmartPointerTest::TestReferenceCounting()
// reference count tests
{
berry::SmartPointer<berry::Object> obj(new TestObject());
{
berry::SmartPointer<berry::Object> tmpobj = obj;
}
assertEqual(1, obj->GetReferenceCount());
}
void SmartPointerTest::TestOperators()
{
// operator tests
{
berry::SmartPointer<berry::Object> obj(new TestObject(1));
berry::SmartPointer<TestObject> testobj(new TestObject(2));
berry::SmartPointer<berry::Object> nullobj;
// boolean conversions
assert(obj.IsNotNull());
assert(false == obj.IsNull());
assert(obj);
assert(false == !obj);
// != operators
assert(obj != 0);
try
{
obj != 1;
failmsg("should throw a std::invalid_argument exception");
}
catch (std::invalid_argument)
{ //expectted }
}
// operator!=(R)
assert(obj != testobj.GetPointer());
// operator!=(const berry::SmartPointer<R>&)
assert(obj != testobj);
// == operators
// operator==(int)
assert((obj == 0) == false);
try {
obj == 1;
failmsg("should throw a std::invalid_argument exception");
}
catch (std::invalid_argument)
{ // expected }
}
// operator==(R)
assert((obj == testobj.GetPointer()) == false);
// operator==(R)
assert(obj == obj.GetPointer());
// operator==(R)
assert((obj == nullobj.GetPointer()) == false);
// operator==(const berry::SmartPointer<R>&)
assert((obj == testobj) == false);
// operator==(const berry::SmartPointer<R>&)
assert(obj == obj);
// operator==(const berry::SmartPointer<R>&)
assert((obj == nullobj) == false);
}
{
// = operators
berry::SmartPointer<berry::Object> obj(new TestObject(1));
berry::SmartPointer<TestObject> testobj(new TestObject(2));
obj = testobj;
// operator=(const berry::SmartPointer<R>&)
assert(obj == testobj);
assertEqual(2, obj->GetReferenceCount());
// operator=(Object*)
obj = testobj.GetPointer();
assert(obj == testobj);
assertEqual(2, obj->GetReferenceCount());
}
}
}
diff --git a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryWeakPointerTest.cpp b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryWeakPointerTest.cpp
index 5fd72f031b..61003ee903 100644
--- a/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryWeakPointerTest.cpp
+++ b/BlueBerry/Testing/org.blueberry.osgi.tests/src/berryWeakPointerTest.cpp
@@ -1,102 +1,102 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include <berryMessage.h>
#include <berryObject.h>
#include <berrySmartPointer.h>
#include <berryWeakPointer.h>
//#include <cstdlib>
#include "berryWeakPointerTest.h"
-#include <CppUnit/TestSuite.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
namespace berry
{
struct TestObject: public Object
{
/** creating a test object in order to test the weakpointer functions */
TestObject()
{ }
};
WeakPointerTest::WeakPointerTest(const std::string& testName) :
TestCase(testName)
{
}
CppUnit::Test* WeakPointerTest::Suite()
{
CppUnit::TestSuite* suite = new CppUnit::TestSuite("WeakPointerTest");
CppUnit_addTest(suite, WeakPointerTest, TestReferenceCounting);
CppUnit_addTest(suite, WeakPointerTest, TestConstructorAndLock);
CppUnit_addTest(suite, WeakPointerTest, TestOperators);
return suite;
}
void WeakPointerTest::TestReferenceCounting()
{
SmartPointer<TestObject> ptr_smart(new TestObject());
WeakPointer<TestObject> ptr_weak(ptr_smart);
assertEqual(1, ptr_smart->GetReferenceCount());
/* Testing the Object reference counter after returning a smartpointer
* to an object, Reference counter should be increased to 2 */
SmartPointer<TestObject> ptr_smart2(ptr_weak);
assertEqual(2, ptr_smart->GetReferenceCount());
}
void WeakPointerTest::TestConstructorAndLock()
{
SmartPointer<TestObject>* ptr_smart = new SmartPointer<TestObject> (
new TestObject);
WeakPointer<TestObject> ptr_weak(*ptr_smart);
WeakPointer<TestObject> ptr_weak2(ptr_weak);
{
SmartPointer<TestObject> ptr_smart1(ptr_weak);
SmartPointer<TestObject> ptr_smart2(ptr_weak2);
assertEqual(ptr_smart1.GetPointer(), ptr_smart2.GetPointer());
}
assertEqual(1, (*ptr_smart)->GetReferenceCount());
delete ptr_smart;
assert(ptr_weak2.Lock() == 0);
}
void WeakPointerTest::TestOperators()
{
SmartPointer<TestObject> ptr_smart(new TestObject);
SmartPointer<TestObject> ptr_smart2(new TestObject);
{
WeakPointer<TestObject> ptr_weak(ptr_smart);
WeakPointer<TestObject> ptr_weak2(ptr_smart2);
ptr_weak = ptr_weak2;
SmartPointer<TestObject> ptr_smart3(ptr_weak2);
SmartPointer<TestObject> ptr_smart4(ptr_weak);
assertEqual(ptr_smart3.GetPointer(), ptr_smart4.GetPointer());
}
}
}
diff --git a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIPageLayoutTest.cpp b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIPageLayoutTest.cpp
index f6d6f01b1e..4fdf65b58d 100644
--- a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIPageLayoutTest.cpp
+++ b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIPageLayoutTest.cpp
@@ -1,52 +1,52 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berryIPageLayoutTest.h"
-#include <CppUnit/TestSuite.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
#include <berryEmptyPerspective.h>
namespace berry
{
IPageLayoutTest::IPageLayoutTest(const std::string& testName) :
UITestCase(testName)
{
}
CppUnit::Test* IPageLayoutTest::Suite()
{
CppUnit::TestSuite* suite = new CppUnit::TestSuite("IPageLayoutTest");
CppUnit_addTest(suite, IPageLayoutTest, TestGetDescriptor);
return suite;
}
void IPageLayoutTest::TestGetDescriptor()
{
this->IgnoreLeakingObjects();
//this->LeakDetailsOn();
EmptyPerspective::SetLastPerspective("");
OpenTestWindow(EmptyPerspective::PERSP_ID);
assertEqual(EmptyPerspective::PERSP_ID, EmptyPerspective::GetLastPerspective());
}
}
diff --git a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIPageLayoutTest.h b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIPageLayoutTest.h
index 69fd9e5b99..70e49c5b50 100644
--- a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIPageLayoutTest.h
+++ b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIPageLayoutTest.h
@@ -1,48 +1,48 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYIPAGELAYOUTTEST_H_
#define BERRYIPAGELAYOUTTEST_H_
#include <berryUITestCase.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestCaller.h>
namespace berry {
/**
* Test cases for the <code>IPageLayout</code> API.
*
* @since 3.2
*/
class IPageLayoutTest : public UITestCase {
public:
friend class CppUnit::TestCaller<IPageLayoutTest>;
IPageLayoutTest(const std::string& testName);
static CppUnit::Test* Suite();
void TestGetDescriptor();
};
}
#endif /* BERRYIPAGELAYOUTTEST_H_ */
diff --git a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIViewPartTest.cpp b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIViewPartTest.cpp
index 71dafc618b..ff2904216d 100644
--- a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIViewPartTest.cpp
+++ b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIViewPartTest.cpp
@@ -1,94 +1,94 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berryIViewPartTest.h"
#include "berrySaveableMockViewPart.h"
#include <berryDebugBreakpointManager.h>
-#include <CppUnit/TestSuite.h>
+#include <cppunit/TestSuite.h>
namespace berry
{
IViewPartTest::IViewPartTest(const std::string& testName) :
IWorkbenchPartTest(testName)
{
}
CppUnit::Test* IViewPartTest::Suite()
{
CppUnit::TestSuite* suite = new CppUnit::TestSuite("IViewPartTest");
CppUnit_addTest(suite, IViewPartTest, TestOpenAndCloseSaveNotNeeded);
CppUnit_addTest(suite, IViewPartTest, TestOpenAndClose);
CppUnit_addTest(suite, IViewPartTest, TestOpenAndWindowClose);
return suite;
}
void IViewPartTest::TestOpenAndCloseSaveNotNeeded()
{
this->IgnoreLeakingObjects();
//this->LeakDetailsOn();
CallHistory::Pointer history;
{
// Open a part.
SaveableMockViewPart::Pointer part = fPage->ShowView(
SaveableMockViewPart::ID).Cast<SaveableMockViewPart> ();
part->SetDirty(true);
part->SetSaveNeeded(false);
ClosePart(fPage, part);
history = part->GetCallHistory();
}
// TODO: This verifies the 3.0 disposal order. However, there may be a bug here.
// That is, it may be necessary to change this and dispose the contribution items
// after the view's dispose method in order to ensure that the site is never returning
// a disposed contribution item. See bug 94457 for details.
std::vector<std::string> callOrder;
callOrder.push_back("SetInitializationData");
callOrder.push_back("Init");
callOrder.push_back("CreatePartControl");
callOrder.push_back("SetFocus");
callOrder.push_back("IsSaveOnCloseNeeded");
callOrder.push_back("WidgetDisposed");
//callOrder.push_back("ToolbarContributionItemWidgetDisposed");
//callOrder.push_back("ToolbarContributionItemDisposed");
callOrder.push_back("PartDestructor");
assert(history->VerifyOrder(callOrder));
// TODO enable assert when saveable support is complete
//assert(history->Contains("DoSave"));
}
MockWorkbenchPart::Pointer IViewPartTest::OpenPart(IWorkbenchPage::Pointer page)
{
return page->ShowView(MockViewPart::ID).Cast<MockWorkbenchPart> ();
}
void IViewPartTest::ClosePart(IWorkbenchPage::Pointer page,
MockWorkbenchPart::Pointer part)
{
page->HideView(part.Cast<IViewPart> ());
}
}
diff --git a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIViewPartTest.h b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIViewPartTest.h
index dc5ecd6093..8d0f1fccbe 100644
--- a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIViewPartTest.h
+++ b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryIViewPartTest.h
@@ -1,72 +1,72 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYIVIEWPARTTEST_H_
#define BERRYIVIEWPARTTEST_H_
#include "berryIWorkbenchPartTest.h"
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestCaller.h>
namespace berry
{
/**
* This is a test for IViewPart. Since IViewPart is an
* interface this test verifies the IViewPart lifecycle rather
* than the implementation.
*/
class IViewPartTest: public IWorkbenchPartTest
{
public:
friend class CppUnit::TestCaller<IViewPartTest>;
/**
* Constructor for IViewPartTest
*/
IViewPartTest(const std::string& testName);
static CppUnit::Test* Suite();
/**
* Tests that the view is closed without saving if isSaveOnCloseNeeded()
* returns false. This also tests some disposal behaviors specific to
* views: namely, that the contribution items are disposed in the correct
* order with respect to the disposal of the view.
*
* @see ISaveablePart#isSaveOnCloseNeeded()
*/
void TestOpenAndCloseSaveNotNeeded();
protected:
/**
* @see IWorkbenchPartTest#openPart(IWorkbenchPage)
*/
MockWorkbenchPart::Pointer OpenPart(IWorkbenchPage::Pointer page);
/**
* @see IWorkbenchPartTest#closePart(IWorkbenchPage, MockWorkbenchPart)
*/
void ClosePart(IWorkbenchPage::Pointer page, MockWorkbenchPart::Pointer part);
};
}
#endif /* BERRYIVIEWPARTTEST_H_ */
diff --git a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryUiApiTestSuite.h b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryUiApiTestSuite.h
index 69dec99a5e..2ae3e57b15 100644
--- a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryUiApiTestSuite.h
+++ b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryUiApiTestSuite.h
@@ -1,35 +1,35 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYUIAPITESTSUITE_H_
#define BERRYUIAPITESTSUITE_H_
-#include <CppUnit/TestSuite.h>
+#include <cppunit/TestSuite.h>
namespace berry {
class UiApiTestSuite : public CppUnit::TestSuite
{
public:
UiApiTestSuite();
};
}
#endif /* BERRYUIAPITESTSUITE_H_ */
diff --git a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryXMLMementoTest.cpp b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryXMLMementoTest.cpp
index 5b4e1d728e..4bf1030ff9 100644
--- a/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryXMLMementoTest.cpp
+++ b/BlueBerry/Testing/org.blueberry.ui.tests/src/api/berryXMLMementoTest.cpp
@@ -1,753 +1,753 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#define NOMINMAX
#include "berryXMLMementoTest.h"
-#include <CppUnit/TestSuite.h>
-#include <CppUnit/TestCaller.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestCaller.h>
#include <sstream>
#include <fstream>
#include <limits>
namespace berry
{
struct PutMementoChecker: public XMLMementoTest::MementoChecker
{
PutMementoChecker(XMLMementoTest* t) :
mementoTest(t)
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
mementoToSerialize->PutTextData("unchanged text data");
mementoToSerialize->PutString("neverlost", "retained value");
IMemento::Pointer aMemento = XMLMemento::CreateWriteRoot("foo");
mementoTest->FillMemento(aMemento);
// note that this does not copy the text data:
mementoToSerialize->PutMemento(aMemento);
// do not check for text data:
mementoTest->CheckMemento(mementoToSerialize, false);
assertEqual("unchanged text data", mementoToSerialize->GetTextData());
std::string str;
mementoToSerialize->GetString("neverlost", str);
assertEqual("retained value", str);
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
// do not check for text data:
mementoTest->CheckMemento(deserializedMemento, false);
assertEqual("unchanged text data", deserializedMemento
->GetTextData());
std::string str;
deserializedMemento->GetString("neverlost", str);
assertEqual("retained value", str);
}
private:
XMLMementoTest* mementoTest;
};
struct PutAndGetStringChecker: public XMLMementoTest::MementoChecker
{
PutAndGetStringChecker(const std::string& key, const std::string& value) :
key(key), value(value)
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
std::string helper;
assertEqual(false, mementoToSerialize->GetString(key, helper));
mementoToSerialize->PutString(key, value);
mementoToSerialize->GetString(key, helper);
assertEqual(value, helper);
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
std::string helper;
deserializedMemento->GetString(key, helper);
assertEqual(value, helper);
}
private:
const std::string& key;
const std::string& value;
};
struct CopyChildChecker: public XMLMementoTest::MementoChecker
{
CopyChildChecker(XMLMementoTest* t) :
mementoTest(t)
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
IMemento::Pointer child = mementoToSerialize->CreateChild("c", "i");
mementoTest->FillMemento(child);
IMemento::Pointer copiedChild = mementoToSerialize->CopyChild(child);
assertEqual("i", copiedChild->GetID());
mementoTest->CheckMemento(copiedChild, true);
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
IMemento::Pointer child = deserializedMemento->GetChild("c");
mementoTest->CheckMemento(child, true);
std::vector<IMemento::Pointer> children(deserializedMemento->GetChildren(
"c"));
assertEqual(2, (long)children.size());
assertEqual("i", children[0]->GetID());
mementoTest->CheckMemento(children[0], true);
assertEqual("i", children[1]->GetID());
mementoTest->CheckMemento(children[1], true);
}
private:
XMLMementoTest* mementoTest;
};
struct CreateAndGetChildChecker: public XMLMementoTest::MementoChecker
{
CreateAndGetChildChecker() :
type1("type1"), type2("type2"), id("id")
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
// check that nothing is there yet
assertNullPtr(mementoToSerialize->GetChild(type1).GetPointer());
assertNullPtr(mementoToSerialize->GetChild(type2).GetPointer());
// creation without ID
IMemento::Pointer child1 = mementoToSerialize->CreateChild(type1);
assertNotNullPtr(child1.GetPointer());
assertNotNullPtr(mementoToSerialize->GetChild(type1).GetPointer());
// creation with ID
IMemento::Pointer child2 = mementoToSerialize->CreateChild(type2, id);
assertNotNullPtr(child2.GetPointer());
assertNotNullPtr(mementoToSerialize->GetChild(type2).GetPointer());
assertEqual(id, child2->GetID());
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
IMemento::Pointer child1 = deserializedMemento->GetChild(type1);
assertNotNullPtr(child1.GetPointer());
IMemento::Pointer child2 = deserializedMemento->GetChild(type2);
assertNotNullPtr(child2.GetPointer());
assertEqual(id, child2->GetID());
}
private:
const std::string type1;
const std::string type2;
const std::string id;
};
struct GetChildrenChecker: public XMLMementoTest::MementoChecker
{
GetChildrenChecker() :
type("type"), id1("id"), id2("id2")
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
// check that nothing is there yet
assertNullPtr(mementoToSerialize->GetChild(type).GetPointer());
IMemento::Pointer child1 = mementoToSerialize->CreateChild(type, id1);
assertNotNullPtr(child1.GetPointer());
assertNotNullPtr(mementoToSerialize->GetChild(type).GetPointer());
assertEqual(id1, child1->GetID());
// second child with the same type
IMemento::Pointer child2 = mementoToSerialize->CreateChild(type, id2);
assertNotNullPtr(child2.GetPointer());
assertEqual(2, (long)mementoToSerialize->GetChildren(type).size());
assertEqual(id2, child2->GetID());
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
std::vector<IMemento::Pointer> children(deserializedMemento->GetChildren(
type));
assertEqual(2, (long)children.size());
// this checks that the order is maintained.
// the spec does not promise this, but clients
// may rely on the current implementation behaviour.
assertEqual(id1, children[0]->GetID());
assertEqual(id2, children[1]->GetID());
}
private:
const std::string type;
const std::string id1;
const std::string id2;
};
struct GetIDChecker: public XMLMementoTest::MementoChecker
{
GetIDChecker(const std::string& type, const std::string& id) :
type(type), id(id)
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
assertNullPtr(mementoToSerialize->GetChild(type).GetPointer());
IMemento::Pointer child = mementoToSerialize->CreateChild(type, id);
assertEqual(id, child->GetID());
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
IMemento::Pointer child = deserializedMemento->GetChild(type);
assertNotNullPtr(child.GetPointer());
assertEqual(id, child->GetID());
}
private:
const std::string type;
const std::string id;
};
struct PutAndGetFloatChecker: public XMLMementoTest::MementoChecker
{
PutAndGetFloatChecker(const std::string& key, double value) :
key(key), value(value)
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
double v;
assertEqual(false, mementoToSerialize->GetFloat(key, v));
mementoToSerialize->PutFloat(key, value);
mementoToSerialize->GetFloat(key, v);
assertEqual(value, v);
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
double v;
deserializedMemento->GetFloat(key, v);
assertEqual(value, v);
}
private:
const std::string key;
const double value;
};
struct PutAndGetIntChecker: public XMLMementoTest::MementoChecker
{
PutAndGetIntChecker(const std::string& key, const int value) :
key(key), value(value)
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
int v;
assertEqual(false, mementoToSerialize->GetInteger(key, v));
mementoToSerialize->PutInteger(key, value);
mementoToSerialize->GetInteger(key, v);
assertEqual(value, v);
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
int v;
deserializedMemento->GetInteger(key, v);
assertEqual(value, v);
}
private:
const std::string key;
const int value;
};
struct PutAndGetTextDataChecker: public XMLMementoTest::MementoChecker
{
PutAndGetTextDataChecker(const std::string& data) :
data(data)
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
assertEqual("", mementoToSerialize->GetTextData());
mementoToSerialize->PutTextData(data);
assertEqual(data, mementoToSerialize->GetTextData());
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
assertEqual(data, deserializedMemento->GetTextData());
}
private:
const std::string data;
};
struct LegalKeysChecker: public XMLMementoTest::MementoChecker
{
LegalKeysChecker(const std::string& key) :
key(key)
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
std::string v;
assertEqual(false, mementoToSerialize->GetString(key, v));
try
{
mementoToSerialize->PutString(key, "some string");
} catch (Poco::RuntimeException& ex)
{
std::cout << "offending key: '" + key + "'" << std::endl;
ex.rethrow();
}
mementoToSerialize->GetString(key, v);
assertEqual("some string", v);
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
std::string v;
deserializedMemento->GetString(key, v);
assertEqual("some string", v);
}
private:
const std::string key;
};
struct PutTextDataWithChildrenChecker: public XMLMementoTest::MementoChecker
{
PutTextDataWithChildrenChecker(const std::string& textData) :
textData(textData)
{
}
void PrepareAndCheckBeforeSerialization(
XMLMemento::Pointer mementoToSerialize)
{
mementoToSerialize->CreateChild("type", "id");
mementoToSerialize->PutTextData(textData);
mementoToSerialize->CreateChild("type", "id");
mementoToSerialize->CreateChild("type", "id");
assertEqual(textData, mementoToSerialize->GetTextData());
}
void CheckAfterDeserialization(XMLMemento::Pointer deserializedMemento)
{
assertEqual(textData, deserializedMemento->GetTextData());
}
private:
const std::string textData;
};
const std::string XMLMementoTest::TEST_STRINGS[10] =
{ "value", " value with spaces ", "value.with.many.dots",
"value_with_underscores", "value<with<lessthan", "value>with>greaterthan",
"value&with&ampersand", "value\"with\"quote", "value#with#hash", "", };
const unsigned int XMLMementoTest::TEST_STRINGS_LENGTH = 10;
/*
* the following cases are for bug 93720
*/
// "\nvalue\nwith\nnewlines\n", "\tvalue\twith\ttab\t",
// "\rvalue\rwith\rreturn\r", };
CppUnit::Test* XMLMementoTest::Suite()
{
CppUnit::TestSuite* suite = new CppUnit::TestSuite("XMLMementoTest");
CppUnit_addTest(suite, XMLMementoTest, TestPutMemento);
CppUnit_addTest(suite, XMLMementoTest, TestPutAndGetString);
CppUnit_addTest(suite, XMLMementoTest, TestCreateReadRootReaderExceptionCases);
CppUnit_addTest(suite, XMLMementoTest, TestCreateReadRootReader);
CppUnit_addTest(suite, XMLMementoTest, TestCreateWriteRoot);
CppUnit_addTest(suite, XMLMementoTest, TestSpacesInRootAreIllegal);
CppUnit_addTest(suite, XMLMementoTest, TestSpacesInKeysAreIllegal);
CppUnit_addTest(suite, XMLMementoTest, TestCopyChild);
CppUnit_addTest(suite, XMLMementoTest, TestCreateAndGetChild);
CppUnit_addTest(suite, XMLMementoTest, TestGetChildren);
CppUnit_addTest(suite, XMLMementoTest, TestGetID);
CppUnit_addTest(suite, XMLMementoTest, TestPutAndGetFloat);
CppUnit_addTest(suite, XMLMementoTest, TestPutAndGetInteger);
CppUnit_addTest(suite, XMLMementoTest, TestPutAndGetTextData);
CppUnit_addTest(suite, XMLMementoTest, TestLegalKeys);
CppUnit_addTest(suite, XMLMementoTest, TestIllegalKeys);
CppUnit_addTest(suite, XMLMementoTest, TestPutTextDataWithChildren);
CppUnit_addTest(suite, XMLMementoTest, TestMementoWithTextContent);
return suite;
}
XMLMementoTest::XMLMementoTest(const std::string& testName) :
TestCase(testName)
{
}
void XMLMementoTest::FillMemento(IMemento::Pointer memento)
{
memento->PutFloat("floatKey", 0.4f);
memento->PutInteger("integerKey", 324765);
memento->PutString("stringKey", "a string");
memento->PutTextData("some text data");
memento->CreateChild("child1");
memento->CreateChild("child2", "child2id1");
memento->CreateChild("child2", "child2id2");
}
void XMLMementoTest::TestPutAndGet(MementoChecker& mementoChecker)
throw (Poco::IOException, WorkbenchException)
{
XMLMemento::Pointer mementoToSerialize = XMLMemento::CreateWriteRoot(
"XMLMementoTest");
mementoChecker.PrepareAndCheckBeforeSerialization(mementoToSerialize);
std::stringstream writer;
mementoToSerialize->Save(writer);
writer.flush();
XMLMemento::Pointer deserializedMemento = XMLMemento::CreateReadRoot(writer);
mementoChecker.CheckAfterDeserialization(deserializedMemento);
}
void XMLMementoTest::CheckMemento(IMemento::Pointer memento,
bool checkForTextData)
{
double floatVal;
memento->GetFloat("floatKey", floatVal);
assertEqualDelta(0.4, floatVal, 0.0001);
int intVal;
memento->GetInteger("integerKey", intVal);
assertEqual(324765, intVal);
std::string strVal;
memento->GetString("stringKey", strVal);
assertEqual("a string", strVal);
if (checkForTextData)
{
assertEqual("some text data", memento->GetTextData());
}
IMemento::Pointer child1 = memento->GetChild("child1");
assertNotNullPtr(child1.GetPointer());
IMemento::Pointer child2 = memento->GetChild("child2");
assertNotNullPtr(child2.GetPointer());
assertEqual("child2id1", child2->GetID());
std::vector<IMemento::Pointer> children(memento->GetChildren("child2"));
assertEqual(2, (long)children.size());
assertEqual("child2id1", children[0]->GetID());
assertEqual("child2id2", children[1]->GetID());
}
void XMLMementoTest::TestPutMemento() throw (WorkbenchException,
Poco::IOException)
{
PutMementoChecker checker(this);
TestPutAndGet(checker);
}
void XMLMementoTest::TestPutAndGetString() throw (Poco::IOException,
WorkbenchException)
{
const std::string key = "key";
for (unsigned int i = 0; i < TEST_STRINGS_LENGTH; ++i)
{
const std::string value;
PutAndGetStringChecker checker(key, TEST_STRINGS[i]);
TestPutAndGet(checker);
}
}
void XMLMementoTest::TestCreateReadRootReaderExceptionCases()
{
try
{
std::stringstream ss("Invalid format");
XMLMemento::CreateReadRoot(ss);
failmsg("should throw WorkbenchException because of invalid format");
} catch (WorkbenchException e)
{
// expected
}
try
{
std::stringstream ss("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
XMLMemento::CreateReadRoot(ss);
failmsg("should throw WorkbenchException because there is no element");
} catch (WorkbenchException e)
{
// expected
}
try
{
std::ifstream file("__123thisshouldnotexist_238waer");
XMLMemento::CreateReadRoot(file);
failmsg("should throw WorkbenchException because of IOException");
} catch (WorkbenchException e)
{
// expected
}
}
void XMLMementoTest::TestCreateReadRootReader() throw (WorkbenchException)
{
std::stringstream
ss(
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><simple>some text data</simple>");
XMLMemento::Pointer memento = XMLMemento::CreateReadRoot(ss);
assertEqual("some text data", memento->GetTextData());
}
void XMLMementoTest::TestCreateWriteRoot()
{
std::string rootTypes[] =
{ "type", "type.with.dots", "type_with_underscores" };
for (unsigned int i = 0; i < 3; i++)
{
XMLMemento::Pointer memento = XMLMemento::CreateWriteRoot(rootTypes[i]);
assertNotNullPtr(memento.GetPointer());
}
}
void XMLMementoTest::TestSpacesInRootAreIllegal()
{
try
{
XMLMemento::CreateWriteRoot("with space");
failmsg("should fail");
} catch (std::exception& /*e*/)
{
// expected
}
}
void XMLMementoTest::TestSpacesInKeysAreIllegal()
{
XMLMemento::Pointer memento = XMLMemento::CreateWriteRoot("foo");
try
{
memento->CreateChild("with space", "bar");
failmsg("should fail");
} catch (std::exception& /*e*/)
{
// expected
}
try
{
memento->PutString("with space", "bar");
failmsg("should fail");
} catch (std::exception& /*e*/)
{
// expected
}
}
void XMLMementoTest::TestCopyChild() throw (WorkbenchException,
Poco::IOException)
{
CopyChildChecker checker(this);
TestPutAndGet(checker);
}
void XMLMementoTest::TestCreateAndGetChild() throw (WorkbenchException,
Poco::IOException)
{
CreateAndGetChildChecker checker;
TestPutAndGet(checker);
}
void XMLMementoTest::TestGetChildren() throw (WorkbenchException,
Poco::IOException)
{
GetChildrenChecker checker;
TestPutAndGet(checker);
}
void XMLMementoTest::TestGetID() throw (WorkbenchException, Poco::IOException)
{
const std::string type = "type";
const std::string ids[] =
{ "id", "", "id.with.many.dots", "id_with_underscores", "id<with<lessthan",
"id>with>greaterthan", "id&with&ampersand", "id\"with\"quote",
"id#with#hash" };
for (unsigned int i = 0; i < 9; i++)
{
GetIDChecker checker(type, ids[i]);
TestPutAndGet(checker);
}
}
void XMLMementoTest::TestPutAndGetFloat() throw (WorkbenchException,
Poco::IOException)
{
const std::string key = "key";
const double values[] =
{ -3.1415, 1, 0, 4554.45235, std::numeric_limits<double>::max(),
std::numeric_limits<double>::min(),
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::infinity() };
for (unsigned int i = 0; i < 8; i++)
{
PutAndGetFloatChecker checker(key, values[i]);
TestPutAndGet(checker);
}
}
void XMLMementoTest::TestPutAndGetInteger() throw (WorkbenchException,
Poco::IOException)
{
const std::string key = "key";
const int values[] =
{ 36254, 0, 1, -36254, std::numeric_limits<int>::max(), std::numeric_limits<
int>::min() };
for (unsigned int i = 0; i < 6; i++)
{
PutAndGetIntChecker checker(key, values[i]);
TestPutAndGet(checker);
}
}
void XMLMementoTest::TestPutAndGetTextData() throw (WorkbenchException,
Poco::IOException)
{
for (unsigned int i = 0; i < TEST_STRINGS_LENGTH; i++)
{
PutAndGetTextDataChecker checker(TEST_STRINGS[i]);
TestPutAndGet(checker);
}
}
void XMLMementoTest::TestLegalKeys() throw (WorkbenchException,
Poco::IOException)
{
const std::string legalKeys[] =
{ "value", "value.with.many.dots", "value_with_underscores" };
for (unsigned int i = 0; i < 3; i++)
{
LegalKeysChecker checker(legalKeys[i]);
TestPutAndGet(checker);
}
}
void XMLMementoTest::TestIllegalKeys() throw ()
{
const std::string illegalKeys[] =
{ "", " ", " key", "key ", "key key", "\t", "\tkey", "key\t", "key\tkey",
"\n", "\nkey", "key\n", "key\nkey", "key<with<lessthan",
"key>with>greaterthan", "key&with&ampersand", "key#with#hash",
"key\"with\"quote", "\"" };
for (unsigned int i = 0; i < 19; i++)
{
XMLMemento::Pointer memento = XMLMemento::CreateWriteRoot("foo");
try
{
memento->PutString(illegalKeys[i], "some string");
failmsg("putString with illegal key should fail");
} catch (std::exception& /*ex*/)
{
// expected
}
}
}
void XMLMementoTest::TestPutTextDataWithChildren() throw (WorkbenchException,
Poco::IOException)
{
const std::string textData =
"\n\tThis is\ntext data\n\t\twith newlines and \ttabs\t\n\t ";
PutTextDataWithChildrenChecker checker(textData);
TestPutAndGet(checker);
}
void XMLMementoTest::TestMementoWithTextContent()
{
IMemento::Pointer memento = XMLMemento::CreateWriteRoot("root");
IMemento::Pointer mementoWithChild = XMLMemento::CreateWriteRoot("root");
IMemento::Pointer child = mementoWithChild->CreateChild("child");
child->PutTextData("text");
memento->PutMemento(mementoWithChild);
IMemento::Pointer copiedChild = memento->GetChild("child");
assertEqual("text", copiedChild->GetTextData());
}
}
diff --git a/BlueBerry/Testing/org.blueberry.ui.tests/src/berryUiTestSuite.h b/BlueBerry/Testing/org.blueberry.ui.tests/src/berryUiTestSuite.h
index 17e410329b..c5935f2c99 100644
--- a/BlueBerry/Testing/org.blueberry.ui.tests/src/berryUiTestSuite.h
+++ b/BlueBerry/Testing/org.blueberry.ui.tests/src/berryUiTestSuite.h
@@ -1,42 +1,42 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYUITESTSUITE_H_
#define BERRYUITESTSUITE_H_
-#include <CppUnit/TestSuite.h>
+#include <cppunit/TestSuite.h>
#include <QObject>
Q_DECLARE_INTERFACE(CppUnit::Test, "CppUnit.Test")
namespace berry {
class UiTestSuite : public QObject, public CppUnit::TestSuite
{
Q_OBJECT
Q_INTERFACES(CppUnit::Test)
public:
UiTestSuite();
UiTestSuite(const UiTestSuite& other);
};
}
#endif /* BERRYUITESTSUITE_H_ */
diff --git a/CMake/MITKDashboardSetup.cmake b/CMake/MITKDashboardSetup.cmake
index 83df176cf5..e31fc1ca6f 100644
--- a/CMake/MITKDashboardSetup.cmake
+++ b/CMake/MITKDashboardSetup.cmake
@@ -1,156 +1,163 @@
# This file is intended to be included at the end of a custom MITKDashboardScript.TEMPLATE.cmake file
list(APPEND CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
#
# Automatically determined properties
#
set(MY_OPERATING_SYSTEM "${CMAKE_HOST_SYSTEM}") # Windows 7, Linux-2.6.32, Darwin...
site_name(CTEST_SITE)
if(QT_BINARY_DIR)
set(QT_QMAKE_EXECUTABLE "${QT_BINARY_DIR}/qmake")
else()
set(QT_QMAKE_EXECUTABLE "qmake")
endif()
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} --version
OUTPUT_VARIABLE MY_QT_VERSION
RESULT_VARIABLE qmake_error)
if(qmake_error)
message(FATAL_ERROR "Error when executing ${QT_QMAKE_EXECUTABLE} --version\n${qmake_error}")
endif()
string(REGEX REPLACE ".*Qt version ([0-9.]+) .*" "\\1" MY_QT_VERSION ${MY_QT_VERSION})
#
# Project specific properties
#
if(NOT CTEST_BUILD_NAME)
set(CTEST_BUILD_NAME "${MY_OPERATING_SYSTEM}-${MY_COMPILER}-Qt-${MY_QT_VERSION}-${CTEST_BUILD_CONFIGURATION}")
endif()
set(PROJECT_BUILD_DIR "MITK-build")
set(CTEST_PATH "$ENV{PATH}")
if(WIN32)
set(ANN_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/ANN-build/${CTEST_BUILD_CONFIGURATION}")
+ set(CPPUNIT_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/CppUnit-build/${CTEST_BUILD_CONFIGURATION}")
set(GLEW_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/GLEW-build/${CTEST_BUILD_CONFIGURATION}")
set(TINYXML_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/tinyxml-build/${CTEST_BUILD_CONFIGURATION}")
set(QWT_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/Qwt-build/${CTEST_BUILD_CONFIGURATION}")
set(QXT_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/Qxt-build/${CTEST_BUILD_CONFIGURATION}")
set(VTK_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/VTK-build/bin/${CTEST_BUILD_CONFIGURATION}")
set(ACVD_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/ACVD-build/bin/${CTEST_BUILD_CONFIGURATION}")
set(ITK_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/ITK-build/bin/${CTEST_BUILD_CONFIGURATION}")
set(BOOST_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/Boost-install/lib")
set(GDCM_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/GDCM-build/bin/${CTEST_BUILD_CONFIGURATION}")
set(OPENCV_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/OpenCV-build/bin/${CTEST_BUILD_CONFIGURATION}")
+ set(POCO_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/Poco_install/lib/${CTEST_BUILD_CONFIGURATION}")
set(SOFA_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/SOFA-build/bin/${CTEST_BUILD_CONFIGURATION}")
set(BLUEBERRY_OSGI_DIR "${CTEST_BINARY_DIRECTORY}/MITK-build/bin/BlueBerry/org.blueberry.osgi/bin/${CTEST_BUILD_CONFIGURATION}")
- set(CTEST_PATH "${CTEST_PATH};${QT_BINARY_DIR};${VTK_BINARY_DIR};${ANN_BINARY_DIR};${GLEW_BINARY_DIR};${TINYXML_BINARY_DIR};${QWT_BINARY_DIR};${QXT_BINARY_DIR};${ACVD_BINARY_DIR};${ITK_BINARY_DIR};${BOOST_BINARY_DIR};${GDCM_BINARY_DIR};${OPENCV_BINARY_DIR};${SOFA_BINARY_DIR};${BLUEBERRY_OSGI_DIR}")
+ set(CTEST_PATH "${CTEST_PATH};${CPPUNIT_BINARY_DIR};${QT_BINARY_DIR};${VTK_BINARY_DIR};${ANN_BINARY_DIR};${GLEW_BINARY_DIR};${TINYXML_BINARY_DIR};${QWT_BINARY_DIR};${QXT_BINARY_DIR};${ACVD_BINARY_DIR};${ITK_BINARY_DIR};${BOOST_BINARY_DIR};${GDCM_BINARY_DIR};${OPENCV_BINARY_DIR};${POCO_BINARY_DIR};${SOFA_BINARY_DIR};${BLUEBERRY_OSGI_DIR}")
endif()
set(ENV{PATH} "${CTEST_PATH}")
set(SUPERBUILD_TARGETS "")
# If the dashscript doesn't define a GIT_REPOSITORY variable, let's define it here.
if(NOT DEFINED GIT_REPOSITORY OR GIT_REPOSITORY STREQUAL "")
set(GIT_REPOSITORY "http://git.mitk.org/MITK.git")
endif()
#
# Display build info
#
message("Site name: ${CTEST_SITE}")
message("Build name: ${CTEST_BUILD_NAME}")
message("Script Mode: ${SCRIPT_MODE}")
message("Coverage: ${WITH_COVERAGE}, MemCheck: ${WITH_MEMCHECK}")
#
# Set initial cache options
#
if(CMAKE_GENERATOR MATCHES "[Mm]ake")
set(CTEST_USE_LAUNCHERS 1)
else()
set(CTEST_USE_LAUNCHERS 0)
endif()
# Remove this if block after all dartclients work
if(DEFINED ADDITIONNAL_CMAKECACHE_OPTION)
message(WARNING "Rename ADDITIONNAL to ADDITIONAL in your dartlclient script: ${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
set(ADDITIONAL_CMAKECACHE_OPTION ${ADDITIONNAL_CMAKECACHE_OPTION})
endif()
if(NOT DEFINED MITK_USE_ACVD)
set(MITK_USE_ACVD 1)
endif()
if(NOT DEFINED MITK_USE_Boost)
set(MITK_USE_Boost 1)
endif()
if(NOT DEFINED MITK_USE_OpenCV)
set(MITK_USE_OpenCV 1)
endif()
+if(NOT DEFINED MITK_USE_Poco)
+ set(MITK_USE_Poco 1)
+endif()
+
if(NOT DEFINED MITK_USE_SOFA)
set(MITK_USE_SOFA 1)
endif()
if(NOT DEFINED MITK_BUILD_ALL_APPS)
set(MITK_BUILD_ALL_APPS TRUE)
endif()
if(NOT DEFINED BLUEBERRY_BUILD_ALL_PLUGINS)
set(BLUEBERRY_BUILD_ALL_PLUGINS TRUE)
endif()
if(NOT DEFINED MITK_BUILD_ALL_PLUGINS)
set(MITK_BUILD_ALL_PLUGINS TRUE)
endif()
if(NOT DEFINED MITK_BUILD_EXAMPLES)
set(MITK_BUILD_EXAMPLES TRUE)
endif()
if(NOT BUILD_DiffusionCoreMiniApps)
set(BUILD_DiffusionCoreMiniApps TRUE)
endif()
if(NOT BUILD_FiberTrackingMiniApps)
set(BUILD_FiberTrackingMiniApps TRUE)
endif()
set(INITIAL_CMAKECACHE_OPTIONS "
BLUEBERRY_BUILD_ALL_PLUGINS:BOOL=${MITK_BUILD_ALL_PLUGINS}
MITK_BUILD_ALL_PLUGINS:BOOL=${MITK_BUILD_ALL_PLUGINS}
MITK_BUILD_ALL_APPS:BOOL=${MITK_BUILD_ALL_APPS}
MITK_BUILD_EXAMPLES:BOOL=${MITK_BUILD_EXAMPLES}
SUPERBUILD_EXCLUDE_MITKBUILD_TARGET:BOOL=TRUE
MITK_USE_ACVD:BOOL=${MITK_USE_ACVD}
MITK_USE_Boost:BOOL=${MITK_USE_Boost}
MITK_USE_OpenCV:BOOL=${MITK_USE_OpenCV}
+MITK_USE_Poco:BOOL=${MITK_USE_Poco}
MITK_USE_SOFA:BOOL=${MITK_USE_SOFA}
${ADDITIONAL_CMAKECACHE_OPTION}
")
# Write a cache file for populating the MITK initial cache (not the superbuild cache).
# This can be used to provide variables which are not passed through the
# superbuild process to the MITK configure step)
if(MITK_INITIAL_CACHE)
set(mitk_cache_file "${CTEST_SCRIPT_DIRECTORY}/mitk_initial_cache.txt")
file(WRITE "${mitk_cache_file}" "${MITK_INITIAL_CACHE}")
set(INITIAL_CMAKECACHE_OPTIONS "${INITIAL_CMAKECACHE_OPTIONS}
MITK_INITIAL_CACHE_FILE:INTERNAL=${mitk_cache_file}
")
endif()
#
# Download and include dashboard driver script
#
set(url "http://mitk.org/git/?p=MITK.git;a=blob_plain;f=CMake/MITKDashboardDriverScript.cmake;hb=${hb}")
set(dest ${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}.driver)
downloadFile("${url}" "${dest}")
include(${dest})
diff --git a/CMake/PackageDepends/MITK_CppUnit_Config.cmake b/CMake/PackageDepends/MITK_CppUnit_Config.cmake
new file mode 100644
index 0000000000..fbebe113ff
--- /dev/null
+++ b/CMake/PackageDepends/MITK_CppUnit_Config.cmake
@@ -0,0 +1,9 @@
+# first look for the superbuild CppUnit version, pointed to by CppUnit_DIR
+find_package(CppUnit QUIET NO_MODULE)
+if(NOT CppUnit_FOUND)
+ # now try invoking a FindCppUnit.cmake script
+ find_package(CppUnit REQUIRED)
+endif()
+
+list(APPEND ALL_LIBRARIES ${CppUnit_LIBRARIES})
+list(APPEND ALL_INCLUDE_DIRECTORIES ${CppUnit_INCLUDE_DIRS})
diff --git a/CMake/PackageDepends/MITK_Poco_Config.cmake b/CMake/PackageDepends/MITK_Poco_Config.cmake
index c9ee5eda11..11e126f116 100644
--- a/CMake/PackageDepends/MITK_Poco_Config.cmake
+++ b/CMake/PackageDepends/MITK_Poco_Config.cmake
@@ -1,12 +1,7 @@
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${MITK_SOURCE_DIR}/BlueBerry/CMake)
find_package(Poco)
list(APPEND ALL_INCLUDE_DIRECTORIES ${Poco_INCLUDE_DIRS})
-list(APPEND ALL_LIBRARIES optimized PocoFoundation
- debug PocoFoundationd
- optimized PocoUtil
- debug PocoUtild
- optimized PocoXML
- debug PocoXMLd)
+list(APPEND ALL_LIBRARIES ${Poco_LIBRARIES})
link_directories(${Poco_LIBRARY_DIRS})
diff --git a/CMake/mitkFunctionGetLibrarySearchPaths.cmake b/CMake/mitkFunctionGetLibrarySearchPaths.cmake
index 224faeddf9..a321489ba7 100644
--- a/CMake/mitkFunctionGetLibrarySearchPaths.cmake
+++ b/CMake/mitkFunctionGetLibrarySearchPaths.cmake
@@ -1,98 +1,104 @@
function(mitkFunctionGetLibrarySearchPaths search_path intermediate_dir)
set(_dir_candidates ${MITK_VTK_LIBRARY_DIRS} ${MITK_ITK_LIBRARY_DIRS} ${QT_LIBRARY_DIR}
${QT_LIBRARY_DIR}/../bin ${MITK_BINARY_DIR}/bin ${MITK_BINARY_DIR}/bin/plugins)
get_property(_additional_paths GLOBAL PROPERTY MITK_ADDITIONAL_LIBRARY_SEARCH_PATHS)
if(_additional_paths)
list(APPEND _dir_candidates ${_additional_paths})
endif()
if(WIN32)
list(APPEND _dir_candidates "${ITK_DIR}/bin")
else()
list(APPEND _dir_candidates "${ITK_DIR}/lib")
endif()
# The code below is sub-optimal. It makes assumptions about
# the structure of the build directories, pointed to by
# the *_DIR variables. Instead, we should rely on package
# specific "LIBRARY_DIRS" variables, if they exist.
if(MITK_USE_Python AND CTK_PYTHONQT_INSTALL_DIR)
list(APPEND _dir_candidates ${CTK_PYTHONQT_INSTALL_DIR}/bin)
endif()
if(MITK_USE_Boost AND MITK_USE_Boost_LIBRARIES AND NOT MITK_USE_SYSTEM_Boost)
list(APPEND _dir_candidates ${Boost_LIBRARY_DIRS})
endif()
if(ACVD_DIR)
list(APPEND _dir_candidates ${ACVD_DIR}/bin)
endif()
if(ANN_DIR)
list(APPEND _dir_candidates ${ANN_DIR})
endif()
+ if(CppUnit_DIR)
+ list(APPEND _dir_candidates ${CppUnit_DIR})
+ endif()
if(GDCM_DIR)
list(APPEND _dir_candidates ${GDCM_DIR}/bin)
endif()
if(GLEW_DIR)
list(APPEND _dir_candidates ${GLEW_DIR})
endif()
if(tinyxml_DIR)
list(APPEND _dir_candidates ${tinyxml_DIR})
endif()
if(OpenCV_DIR)
list(APPEND _dir_candidates ${OpenCV_DIR}/bin)
endif()
+ if(Poco_DIR)
+ list(APPEND _dir_candidates ${Poco_DIR}/lib)
+ endif()
if(Qwt_DIR)
list(APPEND _dir_candidates ${Qwt_DIR})
endif()
if(Qxt_DIR)
list(APPEND _dir_candidates ${Qxt_DIR})
endif()
if(SOFA_DIR)
list(APPEND _dir_candidates ${SOFA_DIR}/bin)
endif()
if(MITK_USE_TOF_PMDO3 OR MITK_USE_TOF_PMDCAMCUBE OR MITK_USE_TOF_PMDCAMBOARD)
list(APPEND _dir_candidates ${MITK_PMD_SDK_DIR}/plugins)
endif()
if(MITK_USE_BLUEBERRY)
list(APPEND _dir_candidates ${CTK_RUNTIME_LIBRARY_DIRS})
if(DEFINED CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY)
if(IS_ABSOLUTE "${CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY}")
list(APPEND _dir_candidates "${CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY}")
else()
list(APPEND _dir_candidates "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY}")
endif()
endif()
endif()
if(MITK_LIBRARY_DIRS)
list(APPEND _dir_candidates ${MITK_LIBRARY_DIRS})
endif()
list(REMOVE_DUPLICATES _dir_candidates)
set(_search_dirs )
foreach(_dir ${_dir_candidates})
if(EXISTS "${_dir}/${intermediate_dir}")
list(APPEND _search_dirs "${_dir}/${intermediate_dir}")
else()
list(APPEND _search_dirs ${_dir})
endif()
endforeach()
# Special handling for "internal" search dirs. The intermediate directory
# might not have been created yet, so we can't check for its existence.
# Hence we just add it for Windows without checking.
set(_internal_search_dirs ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins)
if(WIN32)
foreach(_dir ${_internal_search_dirs})
set(_search_dirs ${_dir}/${intermediate_dir} ${_search_dirs})
endforeach()
else()
set(_search_dirs ${_internal_search_dirs} ${_search_dirs})
endif()
list(REMOVE_DUPLICATES _search_dirs)
set(${search_path} ${_search_dirs} PARENT_SCOPE)
endfunction()
diff --git a/CMakeExternals/CppUnit.cmake b/CMakeExternals/CppUnit.cmake
new file mode 100644
index 0000000000..5b58ce8e05
--- /dev/null
+++ b/CMakeExternals/CppUnit.cmake
@@ -0,0 +1,38 @@
+#-----------------------------------------------------------------------------
+# CppUnit
+#-----------------------------------------------------------------------------
+
+# Sanity checks
+if(DEFINED CppUnit_DIR AND NOT EXISTS ${CppUnit_DIR})
+ message(FATAL_ERROR "CppUnit_DIR variable is defined but corresponds to non-existing directory")
+endif()
+
+set(proj CppUnit)
+set(proj_DEPENDENCIES )
+set(${proj}_DEPENDS ${proj})
+
+if(NOT DEFINED CppUnit_DIR)
+
+ set(patch_cmd ${CMAKE_COMMAND} -Dproj=${proj} -Dproj_target:STRING=cppunit -P ${MITK_SOURCE_DIR}/CMakeExternals/PatchCppUnit-1.12.1.cmake)
+
+ ExternalProject_Add(${proj}
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src
+ BINARY_DIR ${proj}-build
+ PREFIX ${proj}-cmake
+ URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/cppunit-1.12.1.tar.gz
+ URL_MD5 bd30e9cf5523cdfc019b94f5e1d7fd19
+ PATCH_COMMAND ${patch_cmd}
+ INSTALL_COMMAND ""
+ CMAKE_GENERATOR ${gen}
+ CMAKE_ARGS
+ ${ep_common_args}
+ DEPENDS ${proj_DEPENDENCIES}
+ )
+
+ set(${proj}_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build)
+
+else()
+
+ mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
+
+endif()
diff --git a/CMakeExternals/CppUnitCMakeLists.txt b/CMakeExternals/CppUnitCMakeLists.txt
new file mode 100644
index 0000000000..59ed2e0e44
--- /dev/null
+++ b/CMakeExternals/CppUnitCMakeLists.txt
@@ -0,0 +1,205 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(CppUnit)
+
+set(${PROJECT_NAME}_MAJOR_VERSION 1)
+set(${PROJECT_NAME}_MINOR_VERSION 12)
+set(${PROJECT_NAME}_PATCH_VERSION 1)
+set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION})
+
+# UNICODE support
+# See Visual C Unicode Programming Summary
+# http://msdn.microsoft.com/en-us/library/dybsewaf%28VS.100%29.aspx
+#add_definitions(-DUNICODE -D_UNICODE)
+
+
+add_definitions(-DCPPUNIT_BUILD_DLL)
+
+include_directories(include)
+
+
+# Generates include/cppunit/config-auto.h
+# This is originally done by autoconf
+
+include(CheckIncludeFile)
+include(CheckIncludeFileCXX)
+include(CheckCXXSourceCompiles)
+include(CheckCSourceCompiles)
+include(CheckLibraryExists)
+include(CheckFunctionExists)
+
+#Not used == not seen in any *.h *.cpp files
+#Not used FUNC_STRING_COMPARE_STRING_FIRST
+
+check_include_file_cxx(sstream CPPUNIT_HAVE_SSTREAM)
+check_include_file_cxx(strstream CPPUNIT_HAVE_STRSTREAM)
+set (CMAKE_REQUIRED_DEFINITIONS -DHAVE_STRSTREAM=CPPUNIT_HAVE_STRSTREAM)
+check_cxx_source_compiles(
+"#ifdef HAVE_STRSTREAM
+#include <strstream>
+#else
+#include <strstream.h>
+#endif
+int main() {
+ std::ostrstream message;
+ message << \"Hello\";
+ return 0;
+}" CPPUNIT_HAVE_CLASS_STRSTREAM)
+
+check_include_file_cxx(cmath CPPUNIT_HAVE_CMATH)
+#Not used, dld library is obsolete anyway HAVE_DLD
+#Not used HAVE_DLERROR
+check_include_file(dlfcn.h CPPUNIT_HAVE_DLFCN_H)
+
+check_c_source_compiles(
+"#include <math.h>
+int main() {
+ return finite(3);
+}" CPPUNIT_HAVE_FINITE)
+
+check_c_source_compiles(
+"#include <math.h>
+int main() {
+ return _finite(3);
+}" CPPUNIT_HAVE__FINITE)
+
+check_include_file_cxx(cxxabi.h CPPUNIT_HAVE_GCC_ABI_DEMANGLE)
+#Not used HAVE_INTTYPES_H
+
+check_c_source_compiles(
+"#include <math.h>
+int main() {
+ return isfinite(3);
+}" CPPUNIT_HAVE_ISFINITE)
+
+check_library_exists(dl dlopen "" CPPUNIT_HAVE_LIBDL)
+#Not used HAVE_MEMORY_H
+
+check_cxx_source_compiles(
+"namespace Outer {
+ namespace Inner {
+ int i = 0;
+ }
+}
+using namespace Outer::Inner;
+int main() {
+ return i;
+}" CPPUNIT_HAVE_NAMESPACES)
+
+check_cxx_source_compiles(
+"#include <typeinfo>
+class Base {
+public:
+ Base() {}
+ virtual int f() { return 0; }
+};
+class Derived : public Base {
+public:
+ Derived() {}
+ virtual int f() { return 1; }
+};
+int main() {
+ Derived d;
+ Base * ptr = &d;
+ return typeid(*ptr) == typeid(Derived);
+}" CPPUNIT_HAVE_RTTI)
+
+check_library_exists(dl shl_load "" CPPUNIT_HAVE_SHL_LOAD)
+
+#Not used HAVE_STDINT_H
+#Not used HAVE_STDLIB_H
+#Not used HAVE_STRINGS_H
+#Not used HAVE_STRING_H
+#Not used HAVE_SYS_STAT_H
+#Not used HAVE_SYS_TYPES_H
+#Not used HAVE_UNISTD_H
+#Not used PACKAGE
+#Not used PACKAGE_BUGREPORT
+#Not used PACKAGE_NAME
+#Not used PACKAGE_STRING
+#Not used PACKAGE_TARNAME
+#Not used PACKAGE_VERSION
+#Not used STDC_HEADERS
+check_include_file_cxx(typeinfo CPPUNIT_USE_TYPEINFO_NAME)
+#CPPUNIT_VERSION ok
+
+configure_file(config/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/include/cppunit/config-auto.h)
+##
+
+
+set(cppunit_SRCS
+ src/cppunit/AdditionalMessage.cpp
+ src/cppunit/Asserter.cpp
+ src/cppunit/BeOsDynamicLibraryManager.cpp
+ src/cppunit/BriefTestProgressListener.cpp
+ src/cppunit/CompilerOutputter.cpp
+ src/cppunit/DefaultProtector.h
+ src/cppunit/DefaultProtector.cpp
+ src/cppunit/DynamicLibraryManager.cpp
+ src/cppunit/DynamicLibraryManagerException.cpp
+ src/cppunit/Exception.cpp
+ src/cppunit/Message.cpp
+ src/cppunit/PlugInManager.cpp
+ src/cppunit/PlugInParameters.cpp
+ src/cppunit/Protector.cpp
+ src/cppunit/ProtectorChain.h
+ src/cppunit/ProtectorContext.h
+ src/cppunit/ProtectorChain.cpp
+ src/cppunit/RepeatedTest.cpp
+ src/cppunit/ShlDynamicLibraryManager.cpp
+ src/cppunit/SourceLine.cpp
+ src/cppunit/StringTools.cpp
+ src/cppunit/SynchronizedObject.cpp
+ src/cppunit/Test.cpp
+ src/cppunit/TestAssert.cpp
+ src/cppunit/TestCase.cpp
+ src/cppunit/TestCaseDecorator.cpp
+ src/cppunit/TestComposite.cpp
+ src/cppunit/TestDecorator.cpp
+ src/cppunit/TestFactoryRegistry.cpp
+ src/cppunit/TestFailure.cpp
+ src/cppunit/TestLeaf.cpp
+ src/cppunit/TestNamer.cpp
+ src/cppunit/TestPath.cpp
+ src/cppunit/TestPlugInDefaultImpl.cpp
+ src/cppunit/TestResult.cpp
+ src/cppunit/TestResultCollector.cpp
+ src/cppunit/TestRunner.cpp
+ src/cppunit/TestSetUp.cpp
+ src/cppunit/TestSuccessListener.cpp
+ src/cppunit/TestSuite.cpp
+ src/cppunit/TestSuiteBuilderContext.cpp
+ src/cppunit/TextOutputter.cpp
+ src/cppunit/TextTestProgressListener.cpp
+ src/cppunit/TextTestResult.cpp
+ src/cppunit/TextTestRunner.cpp
+ src/cppunit/TypeInfoHelper.cpp
+ src/cppunit/UnixDynamicLibraryManager.cpp
+ src/cppunit/Win32DynamicLibraryManager.cpp
+ src/cppunit/XmlDocument.cpp
+ src/cppunit/XmlElement.cpp
+ src/cppunit/XmlOutputter.cpp
+ src/cppunit/XmlOutputterHook.cpp
+)
+
+add_library(cppunit SHARED ${cppunit_SRCS})
+
+set_target_properties(cppunit PROPERTIES
+ VERSION ${${PROJECT_NAME}_VERSION}
+ SOVERSION ${${PROJECT_NAME}_VERSION}
+)
+
+# Config files
+set(${PROJECT_NAME}_LIBRARIES cppunit)
+set(${PROJECT_NAME}_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+configure_file(${PROJECT_NAME}Config.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake @ONLY)
+export(TARGETS ${${PROJECT_NAME}_LIBRARIES} FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Exports.cmake)
+
+# Version information
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}ConfigVersion.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+ @ONLY
+ )
diff --git a/CMakeExternals/CppUnitconfig.h.cmake b/CMakeExternals/CppUnitconfig.h.cmake
new file mode 100644
index 0000000000..4d7ba00387
--- /dev/null
+++ b/CMakeExternals/CppUnitconfig.h.cmake
@@ -0,0 +1,103 @@
+/* Inspired by config/config.h.in, config.h.cmake is used by CMake. */
+
+/* define if library uses std::string::compare(string,pos,n) */
+//Not used #undef FUNC_STRING_COMPARE_STRING_FIRST
+
+/* define to 1 if the library defines strstream */
+#cmakedefine01 CPPUNIT_HAVE_CLASS_STRSTREAM
+
+/* Define to 1 if you have the <cmath> header file. */
+#cmakedefine01 CPPUNIT_HAVE_CMATH
+
+/* Define if you have the GNU dld library. */
+//Not used, dld library is obsolete anyway #undef HAVE_DLD
+
+/* Define to 1 if you have the `dlerror' function. */
+//Not used #undef HAVE_DLERROR
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine01 CPPUNIT_HAVE_DLFCN_H
+
+/* Define to 1 if you have the `finite' function. */
+#cmakedefine01 CPPUNIT_HAVE_FINITE
+
+/* Define to 1 if you have the `_finite' function. */
+#cmakedefine01 CPPUNIT_HAVE__FINITE
+
+/* define to 1 if the compiler supports GCC C ABI name demangling */
+#cmakedefine01 CPPUNIT_HAVE_GCC_ABI_DEMANGLE
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+//Not used #undef HAVE_INTTYPES_H
+
+/* define if compiler has isfinite */
+#cmakedefine CPPUNIT_HAVE_ISFINITE
+
+/* Define if you have the libdl library or equivalent. */
+#cmakedefine CPPUNIT_HAVE_LIBDL
+
+/* Define to 1 if you have the <memory.h> header file. */
+//Not used #undef HAVE_MEMORY_H
+
+/* define to 1 if the compiler implements namespaces */
+#cmakedefine01 CPPUNIT_HAVE_NAMESPACES
+
+/* define to 1 if the compiler supports Run-Time Type Identification */
+#cmakedefine01 CPPUNIT_HAVE_RTTI
+
+/* Define if you have the shl_load function. */
+#cmakedefine CPPUNIT_HAVE_SHL_LOAD
+
+/* define to 1 if the compiler has stringstream */
+#cmakedefine01 CPPUNIT_HAVE_SSTREAM
+
+/* Define to 1 if you have the <stdint.h> header file. */
+//Not used #undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+//Not used #undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+//Not used #undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+//Not used #undef HAVE_STRING_H
+
+/* Define to 1 if you have the <strstream> header file. */
+#cmakedefine01 CPPUNIT_HAVE_STRSTREAM
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+//Not used #undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+//Not used #undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+//Not used #undef HAVE_UNISTD_H
+
+/* Name of package */
+//Not used #undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+//Not used #undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+//Not used #undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+//Not used #undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+//Not used #undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+//Not used #undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+//Not used #undef STDC_HEADERS
+
+/* Define to 1 to use type_info::name() for class names */
+#cmakedefine01 CPPUNIT_USE_TYPEINFO_NAME
+
+/* Version number of package */
+#define CPPUNIT_VERSION @CppUnit_VERSION@
diff --git a/CMakeExternals/PatchCppUnit-1.12.1.cmake b/CMakeExternals/PatchCppUnit-1.12.1.cmake
new file mode 100644
index 0000000000..24207b6cf6
--- /dev/null
+++ b/CMakeExternals/PatchCppUnit-1.12.1.cmake
@@ -0,0 +1,18 @@
+# Called by CppUnit.cmake (ExternalProject_Add) as a patch for CppUnit.
+# Copies the file CppUnitconfig.h.cmake to config/config.h.cmake
+# and adds a missing include statement
+
+configure_file(${CMAKE_CURRENT_LIST_DIR}/${proj}config.h.cmake config/config.h.cmake COPYONLY)
+
+# read whole file
+file(STRINGS src/cppunit/TypeInfoHelper.cpp sourceCode NEWLINE_CONSUME)
+
+# Add the stdlib.h include
+string(REGEX REPLACE "#include <cxxabi.h>" "#include <cxxabi.h>\n#include <stdlib.h>" sourceCode ${sourceCode})
+
+# set variable CONTENTS, which is substituted in TEMPLATE_FILE
+set(CONTENTS ${sourceCode})
+configure_file(${CMAKE_CURRENT_LIST_DIR}/EmptyFileForPatching.dummy src/cppunit/TypeInfoHelper.cpp @ONLY)
+
+# Add the default CMake build system
+include(${CMAKE_CURRENT_LIST_DIR}/GenerateDefaultCMakeBuildSystem.cmake)
diff --git a/CMakeExternals/PatchPoco-1.5.2-rc3.cmake b/CMakeExternals/PatchPoco-1.5.2-rc3.cmake
new file mode 100644
index 0000000000..8a6679545c
--- /dev/null
+++ b/CMakeExternals/PatchPoco-1.5.2-rc3.cmake
@@ -0,0 +1,36 @@
+# Called by Poco.cmake (ExternalProject_Add) as a patch for Poco.
+# Adds #define TIXML_USE_STL to enable STL string support
+
+# read whole file
+file(STRINGS Foundation/CMakeLists.txt sourceCode NEWLINE_CONSUME)
+
+# Remove files
+foreach(_file gzclose.c gzlib.c gzread.c gzwrite.c uncompr.c)
+ string(REGEX REPLACE "src/${_file}" "" sourceCode ${sourceCode})
+endforeach()
+
+# set variable CONTENTS, which is substituted in TEMPLATE_FILE
+set(CONTENTS ${sourceCode})
+configure_file(${CMAKE_CURRENT_LIST_DIR}/EmptyFileForPatching.dummy Foundation/CMakeLists.txt @ONLY)
+
+
+# read whole file
+file(STRINGS MongoDB/CMakeLists.txt sourceCode NEWLINE_CONSUME)
+
+# Fix define
+string(REGEX REPLACE "-DMONGODB_EXPORTS" "-DMongoDB_EXPORTS" sourceCode ${sourceCode})
+
+# set variable CONTENTS, which is substituted in TEMPLATE_FILE
+set(CONTENTS ${sourceCode})
+configure_file(${CMAKE_CURRENT_LIST_DIR}/EmptyFileForPatching.dummy MongoDB/CMakeLists.txt @ONLY)
+
+
+# read whole file
+file(STRINGS Net/CMakeLists.txt sourceCode NEWLINE_CONSUME)
+
+# Add missing source file entry
+string(REGEX REPLACE "src/NameValueCollection.cpp" "src/NameValueCollection.cpp\n src/Net.cpp" sourceCode ${sourceCode})
+
+# set variable CONTENTS, which is substituted in TEMPLATE_FILE
+set(CONTENTS ${sourceCode})
+configure_file(${CMAKE_CURRENT_LIST_DIR}/EmptyFileForPatching.dummy Net/CMakeLists.txt @ONLY)
diff --git a/CMakeExternals/Poco.cmake b/CMakeExternals/Poco.cmake
new file mode 100644
index 0000000000..557402f93e
--- /dev/null
+++ b/CMakeExternals/Poco.cmake
@@ -0,0 +1,43 @@
+#-----------------------------------------------------------------------------
+# Poco
+#-----------------------------------------------------------------------------
+
+if(MITK_USE_Poco)
+
+ # Sanity checks
+ if(DEFINED Poco_DIR AND NOT EXISTS ${Poco_DIR})
+ message(FATAL_ERROR "Poco_DIR variable is defined but corresponds to non-existing directory")
+ endif()
+
+ set(proj Poco)
+ set(proj_DEPENDENCIES )
+ set(${proj}_DEPENDS ${proj})
+
+ if(NOT DEFINED ${proj}_DIR)
+
+ set(patch_cmd ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/PatchPoco-1.5.2-rc3.cmake)
+
+ ExternalProject_Add(${proj}
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src
+ BINARY_DIR ${proj}-build
+ PREFIX ${proj}-cmake
+ URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/poco-1.5.2-rc3.tar.gz
+ URL_MD5 3651530070a6fce1db0e9ba17ff6c01e
+ INSTALL_DIR ${proj}-install
+ PATCH_COMMAND ${patch_cmd}
+ CMAKE_GENERATOR ${gen}
+ CMAKE_ARGS
+ ${ep_common_args}
+ -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ DEPENDS ${proj_DEPENDENCIES}
+ )
+
+ set(${proj}_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-install)
+
+ else()
+
+ mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
+
+ endif()
+
+endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 51abe1054d..6efe7bd631 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,963 +1,964 @@
if(APPLE)
# With XCode 4.3, the SDK location changed. Older CMake
# versions are not able to find it.
cmake_minimum_required(VERSION 2.8.8)
else()
cmake_minimum_required(VERSION 2.8.5)
endif()
#-----------------------------------------------------------------------------
# Set a default build type if none was specified
#-----------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
#-----------------------------------------------------------------------------
# Superbuild Option - Enabled by default
#-----------------------------------------------------------------------------
option(MITK_USE_SUPERBUILD "Build MITK and the projects it depends on via SuperBuild.cmake." ON)
if(MITK_USE_SUPERBUILD)
project(MITK-superbuild)
set(MITK_SOURCE_DIR ${PROJECT_SOURCE_DIR})
set(MITK_BINARY_DIR ${PROJECT_BINARY_DIR})
else()
project(MITK)
endif()
#-----------------------------------------------------------------------------
# Warn if source or build path is too long
#-----------------------------------------------------------------------------
if(WIN32)
set(_src_dir_length_max 50)
set(_bin_dir_length_max 50)
if(MITK_USE_SUPERBUILD)
set(_src_dir_length_max 43) # _src_dir_length_max - strlen(ITK-src)
set(_bin_dir_length_max 40) # _bin_dir_length_max - strlen(MITK-build)
endif()
string(LENGTH "${MITK_SOURCE_DIR}" _src_n)
string(LENGTH "${MITK_BINARY_DIR}" _bin_n)
# The warnings should be converted to errors
if(_src_n GREATER _src_dir_length_max)
message(WARNING "MITK source code directory path length is too long (${_src_n} > ${_src_dir_length_max})."
"Please move the MITK source code directory to a directory with a shorter path." )
endif()
if(_bin_n GREATER _bin_dir_length_max)
message(WARNING "MITK build directory path length is too long (${_bin_n} > ${_bin_dir_length_max})."
"Please move the MITK build directory to a directory with a shorter path." )
endif()
endif()
#-----------------------------------------------------------------------------
# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details
#-----------------------------------------------------------------------------
set(project_policies
CMP0001 # NEW: CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.
CMP0002 # NEW: Logical target names must be globally unique.
CMP0003 # NEW: Libraries linked via full path no longer produce linker search paths.
CMP0004 # NEW: Libraries linked may NOT have leading or trailing whitespace.
CMP0005 # NEW: Preprocessor definition values are now escaped automatically.
CMP0006 # NEW: Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.
CMP0007 # NEW: List command no longer ignores empty elements.
CMP0008 # NEW: Libraries linked by full-path must have a valid library file name.
CMP0009 # NEW: FILE GLOB_RECURSE calls should not follow symlinks by default.
CMP0010 # NEW: Bad variable reference syntax is an error.
CMP0011 # NEW: Included scripts do automatic cmake_policy PUSH and POP.
CMP0012 # NEW: if() recognizes numbers and boolean constants.
CMP0013 # NEW: Duplicate binary directories are not allowed.
CMP0014 # NEW: Input directories must have CMakeLists.txt
)
foreach(policy ${project_policies})
if(POLICY ${policy})
cmake_policy(SET ${policy} NEW)
endif()
endforeach()
#-----------------------------------------------------------------------------
# Update CMake module path
#------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH
${MITK_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH}
)
#-----------------------------------------------------------------------------
# CMake function(s) and macro(s)
#-----------------------------------------------------------------------------
include(mitkMacroEmptyExternalProject)
include(mitkFunctionGenerateProjectXml)
include(mitkFunctionSuppressWarnings)
SUPPRESS_VC_DEPRECATED_WARNINGS()
#-----------------------------------------------------------------------------
# Output directories.
#-----------------------------------------------------------------------------
foreach(type LIBRARY RUNTIME ARCHIVE)
# Make sure the directory exists
if(DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY
AND NOT EXISTS ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY})
message("Creating directory MITK_CMAKE_${type}_OUTPUT_DIRECTORY: ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}")
file(MAKE_DIRECTORY "${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}")
endif()
if(MITK_USE_SUPERBUILD)
set(output_dir ${MITK_BINARY_DIR}/bin)
if(NOT DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY)
set(MITK_CMAKE_${type}_OUTPUT_DIRECTORY ${MITK_BINARY_DIR}/MITK-build/bin)
endif()
else()
if(NOT DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY)
set(output_dir ${MITK_BINARY_DIR}/bin)
else()
set(output_dir ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY})
endif()
endif()
set(CMAKE_${type}_OUTPUT_DIRECTORY ${output_dir} CACHE INTERNAL "Single output directory for building all libraries.")
mark_as_advanced(CMAKE_${type}_OUTPUT_DIRECTORY)
endforeach()
#-----------------------------------------------------------------------------
# Additional MITK Options (also shown during superbuild)
#-----------------------------------------------------------------------------
option(BUILD_SHARED_LIBS "Build MITK with shared libraries" ON)
option(WITH_COVERAGE "Enable/Disable coverage" OFF)
option(BUILD_TESTING "Test the project" ON)
option(MITK_BUILD_ALL_APPS "Build all MITK applications" OFF)
set(MITK_BUILD_TUTORIAL OFF CACHE INTERNAL "Deprecated! Use MITK_BUILD_EXAMPLES instead!")
option(MITK_BUILD_EXAMPLES "Build the MITK Examples" ${MITK_BUILD_TUTORIAL})
option(MITK_USE_ACVD "Use Approximated Centroidal Voronoi Diagrams" OFF)
option(MITK_USE_GLEW "Use the GLEW library" ON)
option(MITK_USE_Boost "Use the Boost C++ library" OFF)
option(MITK_USE_BLUEBERRY "Build the BlueBerry platform" ON)
option(MITK_USE_CTK "Use CTK in MITK" ${MITK_USE_BLUEBERRY})
option(MITK_USE_QT "Use Nokia's Qt library" ${MITK_USE_CTK})
option(MITK_USE_DCMTK "EXPERIMENTAL, superbuild only: Use DCMTK in MITK" ${MITK_USE_CTK})
option(MITK_USE_OpenCV "Use Intel's OpenCV library" OFF)
option(MITK_USE_OpenCL "Use OpenCL GPU-Computing library" OFF)
+option(MITK_USE_Poco "Use the Poco library" ON)
option(MITK_USE_SOFA "Use Simulation Open Framework Architecture" OFF)
option(MITK_USE_Python "Use Python wrapping in MITK" OFF)
set(MITK_USE_CableSwig ${MITK_USE_Python})
if(MITK_USE_Python)
FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE(PythonInterp REQUIRED)
endif()
mark_as_advanced(MITK_BUILD_ALL_APPS
MITK_USE_GLEW
MITK_USE_CTK
MITK_USE_DCMTK
)
if(MITK_USE_Boost)
option(MITK_USE_SYSTEM_Boost "Use the system Boost" OFF)
set(MITK_USE_Boost_LIBRARIES "" CACHE STRING "A semi-colon separated list of required Boost libraries")
endif()
if(MITK_USE_BLUEBERRY)
option(MITK_BUILD_ALL_PLUGINS "Build all MITK plugins" OFF)
mark_as_advanced(MITK_BUILD_ALL_PLUGINS)
if(NOT MITK_USE_CTK)
message("Forcing MITK_USE_CTK to ON because of MITK_USE_BLUEBERRY")
set(MITK_USE_CTK ON CACHE BOOL "Use CTK in MITK" FORCE)
endif()
endif()
if(MITK_USE_CTK)
if(NOT MITK_USE_QT)
message("Forcing MITK_USE_QT to ON because of MITK_USE_CTK")
set(MITK_USE_QT ON CACHE BOOL "Use Nokia's Qt library in MITK" FORCE)
endif()
if(NOT MITK_USE_DCMTK)
message("Setting MITK_USE_DCMTK to ON because DCMTK needs to be build for CTK")
set(MITK_USE_DCMTK ON CACHE BOOL "Use DCMTK in MITK" FORCE)
endif()
endif()
if(MITK_USE_QT)
# find the package at the very beginning, so that QT4_FOUND is available
find_package(Qt4 4.6.2 REQUIRED)
endif()
if(MITK_USE_SOFA)
# SOFA requires at least CMake 2.8.8
set(SOFA_CMAKE_VERSION 2.8.8)
if(${CMAKE_VERSION} VERSION_LESS ${SOFA_CMAKE_VERSION})
set(MITK_USE_SOFA OFF CACHE BOOL "" FORCE)
message(WARNING "Switched off MITK_USE_SOFA\n Minimum required CMake version: ${SOFA_CMAKE_VERSION}\n Installed CMake version: ${CMAKE_VERSION}")
endif()
# SOFA doesn't support Clang
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(MITK_USE_SOFA OFF CACHE BOOL "" FORCE)
message(WARNING "Switched off MITK_USE_SOFA\n Clang is not supported, use GCC instead.")
endif()
# SOFA requires boost library
if(MITK_USE_SOFA AND NOT MITK_USE_Boost)
message("Forcing MITK_USE_Boost to ON because of MITK_USE_SOFA")
set(MITK_USE_Boost ON CACHE BOOL "" FORCE)
endif()
# SOFA requires boost system library
list(FIND MITK_USE_Boost_LIBRARIES system _result)
if(_result LESS 0)
message("Adding 'system' to MITK_USE_Boost_LIBRARIES.")
list(APPEND MITK_USE_Boost_LIBRARIES system)
endif()
# SOFA requires boost thread library
list(FIND MITK_USE_Boost_LIBRARIES thread _result)
if(_result LESS 0)
message("Adding 'thread' to MITK_USE_Boost_LIBRARIES.")
list(APPEND MITK_USE_Boost_LIBRARIES thread)
endif()
set(MITK_USE_Boost_LIBRARIES ${MITK_USE_Boost_LIBRARIES} CACHE STRING "" FORCE)
endif()
# Customize the default pixel types for multiplex macros
set(MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES
"int, unsigned int, short, unsigned short, char, unsigned char"
CACHE STRING "List of integral pixel types used in AccessByItk and InstantiateAccessFunction macros")
set(MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
"double, float"
CACHE STRING "List of floating pixel types used in AccessByItk and InstantiateAccessFunction macros")
set(MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES
"itk::RGBPixel<unsigned char>, itk::RGBAPixel<unsigned char>"
CACHE STRING "List of composite pixel types used in AccessByItk and InstantiateAccessFunction macros")
set(MITK_ACCESSBYITK_DIMENSIONS
"2,3"
CACHE STRING "List of dimensions used in AccessByItk and InstantiateAccessFunction macros")
mark_as_advanced(MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES
MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES
MITK_ACCESSBYITK_DIMENSIONS
)
# consistency checks
if(NOT MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES)
set(MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES
"int, unsigned int, short, unsigned short, char, unsigned char"
CACHE STRING "List of integral pixel types used in AccessByItk and InstantiateAccessFunction macros" FORCE)
endif()
if(NOT MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES)
set(MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
"double, float"
CACHE STRING "List of floating pixel types used in AccessByItk and InstantiateAccessFunction macros" FORCE)
endif()
if(NOT MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES)
set(MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES
"itk::RGBPixel<unsigned char>, itk::RGBAPixel<unsigned char>"
CACHE STRING "List of composite pixel types used in AccessByItk and InstantiateAccessFunction macros" FORCE)
endif()
if(NOT MITK_ACCESSBYITK_DIMENSIONS)
set(MITK_ACCESSBYITK_DIMENSIONS
"2,3"
CACHE STRING "List of dimensions used in AccessByItk and InstantiateAccessFunction macros")
endif()
#-----------------------------------------------------------------------------
# Project.xml
#-----------------------------------------------------------------------------
# A list of topologically ordered targets
set(CTEST_PROJECT_SUBPROJECTS)
if(MITK_USE_BLUEBERRY)
list(APPEND CTEST_PROJECT_SUBPROJECTS BlueBerry)
endif()
list(APPEND CTEST_PROJECT_SUBPROJECTS
MITK-Core
MITK-CoreUI
MITK-IGT
MITK-ToF
MITK-DTI
MITK-Registration
MITK-Modules # all modules not contained in a specific subproject
MITK-Plugins # all plugins not contained in a specific subproject
MITK-Examples
Unlabeled # special "subproject" catching all unlabeled targets and tests
)
# Configure CTestConfigSubProject.cmake that could be used by CTest scripts
configure_file(${MITK_SOURCE_DIR}/CTestConfigSubProject.cmake.in
${MITK_BINARY_DIR}/CTestConfigSubProject.cmake)
if(CTEST_PROJECT_ADDITIONAL_TARGETS)
# those targets will be executed at the end of the ctest driver script
# and they also get their own subproject label
set(subproject_list "${CTEST_PROJECT_SUBPROJECTS};${CTEST_PROJECT_ADDITIONAL_TARGETS}")
else()
set(subproject_list "${CTEST_PROJECT_SUBPROJECTS}")
endif()
# Generate Project.xml file expected by the CTest driver script
mitkFunctionGenerateProjectXml(${MITK_BINARY_DIR} MITK "${subproject_list}" ${MITK_USE_SUPERBUILD})
#-----------------------------------------------------------------------------
# Superbuild script
#-----------------------------------------------------------------------------
if(MITK_USE_SUPERBUILD)
include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild.cmake")
return()
endif()
#*****************************************************************************
#**************************** END OF SUPERBUILD ****************************
#*****************************************************************************
#-----------------------------------------------------------------------------
# CMake function(s) and macro(s)
#-----------------------------------------------------------------------------
include(CheckCXXSourceCompiles)
include(mitkFunctionCheckCompilerFlags)
include(mitkFunctionGetGccVersion)
include(MacroParseArguments)
include(mitkFunctionSuppressWarnings) # includes several functions
include(mitkFunctionOrganizeSources)
include(mitkFunctionGetVersion)
include(mitkFunctionGetVersionDescription)
include(mitkFunctionCreateWindowsBatchScript)
include(mitkFunctionInstallProvisioningFiles)
include(mitkFunctionInstallAutoLoadModules)
include(mitkFunctionGetLibrarySearchPaths)
include(mitkFunctionCompileSnippets)
include(mitkMacroCreateModuleConf)
include(mitkMacroCreateModule)
include(mitkMacroCheckModule)
include(mitkMacroCreateModuleTests)
include(mitkFunctionAddCustomModuleTest)
include(mitkMacroUseModule)
include(mitkMacroMultiplexPicType)
include(mitkMacroInstall)
include(mitkMacroInstallHelperApp)
include(mitkMacroInstallTargets)
include(mitkMacroGenerateToolsLibrary)
include(mitkMacroGetLinuxDistribution)
include(mitkMacroGetPMDPlatformString)
#-----------------------------------------------------------------------------
# Prerequesites
#-----------------------------------------------------------------------------
find_package(ITK REQUIRED)
find_package(VTK REQUIRED)
find_package(GDCM PATHS ${ITK_GDCM_DIR} REQUIRED)
#-----------------------------------------------------------------------------
# Set MITK specific options and variables (NOT available during superbuild)
#-----------------------------------------------------------------------------
# ASK THE USER TO SHOW THE CONSOLE WINDOW FOR CoreApp and mitkWorkbench
option(MITK_SHOW_CONSOLE_WINDOW "Use this to enable or disable the console window when starting MITK GUI Applications" ON)
mark_as_advanced(MITK_SHOW_CONSOLE_WINDOW)
# TODO: check if necessary
option(USE_ITKZLIB "Use the ITK zlib for pic compression." ON)
mark_as_advanced(USE_ITKZLIB)
if(NOT MITK_FAST_TESTING)
if(DEFINED MITK_CTEST_SCRIPT_MODE
AND (MITK_CTEST_SCRIPT_MODE STREQUAL "continuous" OR MITK_CTEST_SCRIPT_MODE STREQUAL "experimental") )
set(MITK_FAST_TESTING 1)
endif()
endif()
#-----------------------------------------------------------------------------
# Get MITK version info
#-----------------------------------------------------------------------------
mitkFunctionGetVersion(${MITK_SOURCE_DIR} MITK)
mitkFunctionGetVersionDescription(${MITK_SOURCE_DIR} MITK)
#-----------------------------------------------------------------------------
# Installation preparation
#
# These should be set before any MITK install macros are used
#-----------------------------------------------------------------------------
# on Mac OSX all BlueBerry plugins get copied into every
# application bundle (.app directory) specified here
if(MITK_USE_BLUEBERRY AND APPLE)
include("${CMAKE_CURRENT_SOURCE_DIR}/Applications/AppList.cmake")
foreach(mitk_app ${MITK_APPS})
# extract option_name
string(REPLACE "^^" "\\;" target_info ${mitk_app})
set(target_info_list ${target_info})
list(GET target_info_list 1 option_name)
list(GET target_info_list 0 app_name)
# check if the application is enabled
if(${option_name} OR MITK_BUILD_ALL_APPS)
set(MACOSX_BUNDLE_NAMES ${MACOSX_BUNDLE_NAMES} ${app_name})
endif()
endforeach()
endif()
#-----------------------------------------------------------------------------
# Set symbol visibility Flags
#-----------------------------------------------------------------------------
# MinGW does not export all symbols automatically, so no need to set flags
if(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW)
set(VISIBILITY_CXX_FLAGS ) #"-fvisibility=hidden -fvisibility-inlines-hidden")
endif()
#-----------------------------------------------------------------------------
# Set coverage Flags
#-----------------------------------------------------------------------------
if(WITH_COVERAGE)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(coverage_flags "-g -fprofile-arcs -ftest-coverage -O0 -DNDEBUG")
set(COVERAGE_CXX_FLAGS ${coverage_flags})
set(COVERAGE_C_FLAGS ${coverage_flags})
endif()
endif()
#-----------------------------------------------------------------------------
# MITK C/CXX Flags
#-----------------------------------------------------------------------------
set(MITK_C_FLAGS "${COVERAGE_C_FLAGS}")
set(MITK_C_FLAGS_DEBUG )
set(MITK_C_FLAGS_RELEASE )
set(MITK_CXX_FLAGS "${VISIBILITY_CXX_FLAGS} ${COVERAGE_CXX_FLAGS}")
set(MITK_CXX_FLAGS_DEBUG )
set(MITK_CXX_FLAGS_RELEASE )
set(MITK_EXE_LINKER_FLAGS )
set(MITK_SHARED_LINKER_FLAGS )
include(mitkSetupC++0xVariables)
if(WIN32)
set(MITK_CXX_FLAGS "${MITK_CXX_FLAGS} -D_WIN32_WINNT=0x0501 -DPOCO_NO_UNWINDOWS -DWIN32_LEAN_AND_MEAN")
set(MITK_CXX_FLAGS "${MITK_CXX_FLAGS} /wd4231") # warning C4231: nonstandard extension used : 'extern' before template explicit instantiation
endif()
if(NOT MSVC_VERSION)
foreach(_flag
-Wall
-Wextra
-Wpointer-arith
-Winvalid-pch
-Wcast-align
-Wwrite-strings
-Wno-error=gnu
-Woverloaded-virtual
-Wstrict-null-sentinel
#-Wold-style-cast
#-Wsign-promo
# the following two lines should be removed after ITK-3097 has
# been resolved, see also MITK bug 15279
-Wno-unused-local-typedefs
-Wno-array-bounds
-fdiagnostics-show-option
)
mitkFunctionCheckCAndCXXCompilerFlags(${_flag} MITK_C_FLAGS MITK_CXX_FLAGS)
endforeach()
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
mitkFunctionCheckCompilerFlags("-Wl,--no-undefined" MITK_SHARED_LINKER_FLAGS)
mitkFunctionCheckCompilerFlags("-Wl,--as-needed" MITK_SHARED_LINKER_FLAGS)
if(MITK_USE_C++0x)
mitkFunctionCheckCompilerFlags("-std=c++0x" MITK_CXX_FLAGS)
endif()
mitkFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION)
# With older version of gcc supporting the flag -fstack-protector-all, an extra dependency to libssp.so
# is introduced. If gcc is smaller than 4.4.0 and the build type is Release let's not include the flag.
# Doing so should allow to build package made for distribution using older linux distro.
if(${GCC_VERSION} VERSION_GREATER "4.4.0" OR (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${GCC_VERSION} VERSION_LESS "4.4.0"))
mitkFunctionCheckCAndCXXCompilerFlags("-fstack-protector-all" MITK_C_FLAGS MITK_CXX_FLAGS)
endif()
if(MINGW)
# suppress warnings about auto imported symbols
set(MITK_SHARED_LINKER_FLAGS "-Wl,--enable-auto-import ${MITK_SHARED_LINKER_FLAGS}")
endif()
set(MITK_CXX_FLAGS_RELEASE "-D_FORTIFY_SOURCE=2 ${MITK_CXX_FLAGS_RELEASE}")
endif()
set(MITK_MODULE_LINKER_FLAGS ${MITK_SHARED_LINKER_FLAGS})
set(MITK_EXE_LINKER_FLAGS ${MITK_SHARED_LINKER_FLAGS})
#-----------------------------------------------------------------------------
# MITK Packages
#-----------------------------------------------------------------------------
set(MITK_MODULES_PACKAGE_DEPENDS_DIR ${MITK_SOURCE_DIR}/CMake/PackageDepends)
set(MODULES_PACKAGE_DEPENDS_DIRS ${MITK_MODULES_PACKAGE_DEPENDS_DIR})
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
if(BUILD_TESTING)
enable_testing()
include(CTest)
mark_as_advanced(TCL_TCLSH DART_ROOT)
option(MITK_ENABLE_GUI_TESTING OFF "Enable the MITK GUI tests")
# Setup file for setting custom ctest vars
configure_file(
CMake/CTestCustom.cmake.in
${MITK_BINARY_DIR}/CTestCustom.cmake
@ONLY
)
# Configuration for the CMake-generated test driver
set(CMAKE_TESTDRIVER_EXTRA_INCLUDES "#include <stdexcept>")
set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "
try
{")
set(CMAKE_TESTDRIVER_AFTER_TESTMAIN " }
catch( std::exception & excp )
{
fprintf(stderr,\"%s\\n\",excp.what());
return EXIT_FAILURE;
}
catch( ... )
{
printf(\"Exception caught in the test driver\\n\");
return EXIT_FAILURE;
}
")
set(MITK_TEST_OUTPUT_DIR "${MITK_BINARY_DIR}/test_output")
if(NOT EXISTS ${MITK_TEST_OUTPUT_DIR})
file(MAKE_DIRECTORY ${MITK_TEST_OUTPUT_DIR})
endif()
# Test the external project template
if(MITK_USE_BLUEBERRY)
include(mitkTestProjectTemplate)
endif()
# Test the package target
include(mitkPackageTest)
endif()
configure_file(mitkTestingConfig.h.in ${MITK_BINARY_DIR}/mitkTestingConfig.h)
#-----------------------------------------------------------------------------
# MITK_SUPERBUILD_BINARY_DIR
#-----------------------------------------------------------------------------
# If MITK_SUPERBUILD_BINARY_DIR isn't defined, it means MITK is *NOT* build using Superbuild.
# In that specific case, MITK_SUPERBUILD_BINARY_DIR should default to MITK_BINARY_DIR
if(NOT DEFINED MITK_SUPERBUILD_BINARY_DIR)
set(MITK_SUPERBUILD_BINARY_DIR ${MITK_BINARY_DIR})
endif()
#-----------------------------------------------------------------------------
# Compile Utilities and set-up MITK variables
#-----------------------------------------------------------------------------
include(mitkSetupVariables)
#-----------------------------------------------------------------------------
# Cleanup
#-----------------------------------------------------------------------------
file(GLOB _MODULES_CONF_FILES ${PROJECT_BINARY_DIR}/${MODULES_CONF_DIRNAME}/*.cmake)
if(_MODULES_CONF_FILES)
file(REMOVE ${_MODULES_CONF_FILES})
endif()
add_subdirectory(Utilities)
if(MITK_USE_BLUEBERRY)
# We need to hack a little bit because MITK applications may need
# to enable certain BlueBerry plug-ins. However, these plug-ins
# are validated separately from the MITK plug-ins and know nothing
# about potential MITK plug-in dependencies of the applications. Hence
# we cannot pass the MITK application list to the BlueBerry
# ctkMacroSetupPlugins call but need to extract the BlueBerry dependencies
# from the applications and set them explicitly.
include("${CMAKE_CURRENT_SOURCE_DIR}/Applications/AppList.cmake")
foreach(mitk_app ${MITK_APPS})
# extract target_dir and option_name
string(REPLACE "^^" "\\;" target_info ${mitk_app})
set(target_info_list ${target_info})
list(GET target_info_list 0 target_dir)
list(GET target_info_list 1 option_name)
# check if the application is enabled and if target_libraries.cmake exists
if((${option_name} OR MITK_BUILD_ALL_APPS) AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Applications/${target_dir}/target_libraries.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/Applications/${target_dir}/target_libraries.cmake")
foreach(_target_dep ${target_libraries})
if(_target_dep MATCHES org_blueberry_)
string(REPLACE _ . _app_bb_dep ${_target_dep})
# explicitly set the build option for the BlueBerry plug-in
set(BLUEBERRY_BUILD_${_app_bb_dep} ON CACHE BOOL "Build the ${_app_bb_dep} plug-in")
endif()
endforeach()
endif()
endforeach()
set(mbilog_DIR "${mbilog_BINARY_DIR}")
if(MITK_BUILD_ALL_PLUGINS)
set(BLUEBERRY_BUILD_ALL_PLUGINS ON)
endif()
set(BLUEBERRY_XPDOC_OUTPUT_DIR ${MITK_DOXYGEN_OUTPUT_DIR}/html/extension-points/html/)
add_subdirectory(BlueBerry)
set(BlueBerry_DIR ${CMAKE_CURRENT_BINARY_DIR}/BlueBerry
CACHE PATH "The directory containing a CMake configuration file for BlueBerry" FORCE)
include(mitkMacroCreateCTKPlugin)
endif()
#-----------------------------------------------------------------------------
# Set C/CXX and linker flags for MITK code
#-----------------------------------------------------------------------------
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MITK_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MITK_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MITK_CXX_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MITK_C_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${MITK_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${MITK_C_FLAGS_RELEASE}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MITK_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MITK_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${MITK_MODULE_LINKER_FLAGS}")
#-----------------------------------------------------------------------------
# Add custom targets representing CDash subprojects
#-----------------------------------------------------------------------------
foreach(subproject ${CTEST_PROJECT_SUBPROJECTS})
if(NOT TARGET ${subproject} AND NOT subproject MATCHES "Unlabeled")
add_custom_target(${subproject})
endif()
endforeach()
#-----------------------------------------------------------------------------
# Add subdirectories
#-----------------------------------------------------------------------------
link_directories(${MITK_LINK_DIRECTORIES})
add_subdirectory(Core)
add_subdirectory(Modules)
if(MITK_USE_BLUEBERRY)
find_package(BlueBerry REQUIRED)
set(MITK_DEFAULT_SUBPROJECTS MITK-Plugins)
# Plug-in testing (needs some work to be enabled again)
if(BUILD_TESTING)
include(berryTestingHelpers)
set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp")
get_target_property(_is_macosx_bundle CoreApp MACOSX_BUNDLE)
if(APPLE AND _is_macosx_bundle)
set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.app/Contents/MacOS/CoreApp")
endif()
set(BLUEBERRY_TEST_APP_ID "org.mitk.qt.coreapplication")
endif()
include("${CMAKE_CURRENT_SOURCE_DIR}/Plugins/PluginList.cmake")
set(mitk_plugins_fullpath )
foreach(mitk_plugin ${MITK_EXT_PLUGINS})
list(APPEND mitk_plugins_fullpath Plugins/${mitk_plugin})
endforeach()
if(EXISTS ${MITK_PRIVATE_MODULES}/PluginList.cmake)
include(${MITK_PRIVATE_MODULES}/PluginList.cmake)
foreach(mitk_plugin ${MITK_PRIVATE_PLUGINS})
list(APPEND mitk_plugins_fullpath ${MITK_PRIVATE_MODULES}/${mitk_plugin})
endforeach()
endif()
# Specify which plug-ins belong to this project
macro(GetMyTargetLibraries all_target_libraries varname)
set(re_ctkplugin_mitk "^org_mitk_[a-zA-Z0-9_]+$")
set(re_ctkplugin_bb "^org_blueberry_[a-zA-Z0-9_]+$")
set(_tmp_list)
list(APPEND _tmp_list ${all_target_libraries})
ctkMacroListFilter(_tmp_list re_ctkplugin_mitk re_ctkplugin_bb OUTPUT_VARIABLE ${varname})
endmacro()
# Get infos about application directories and build options
include("${CMAKE_CURRENT_SOURCE_DIR}/Applications/AppList.cmake")
set(mitk_apps_fullpath )
foreach(mitk_app ${MITK_APPS})
list(APPEND mitk_apps_fullpath "${CMAKE_CURRENT_SOURCE_DIR}/Applications/${mitk_app}")
endforeach()
ctkMacroSetupPlugins(${mitk_plugins_fullpath}
BUILD_OPTION_PREFIX MITK_BUILD_
APPS ${mitk_apps_fullpath}
BUILD_ALL ${MITK_BUILD_ALL_PLUGINS}
COMPACT_OPTIONS)
set(MITK_PLUGIN_USE_FILE "${MITK_BINARY_DIR}/MitkPluginUseFile.cmake")
if(${PROJECT_NAME}_PLUGIN_LIBRARIES)
ctkFunctionGeneratePluginUseFile(${MITK_PLUGIN_USE_FILE})
else()
file(REMOVE ${MITK_PLUGIN_USE_FILE})
set(MITK_PLUGIN_USE_FILE )
endif()
# 11.3.13, change, muellerm: activate python bundle if python and blueberry is active
if( MITK_USE_Python )
set(MITK_BUILD_org.mitk.gui.qt.python ON)
endif()
endif()
#-----------------------------------------------------------------------------
# Python Wrapping
#-----------------------------------------------------------------------------
option(MITK_USE_Python "Build Python integration for MITK (requires CableSwig)." OFF)
#-----------------------------------------------------------------------------
# Documentation
#-----------------------------------------------------------------------------
add_subdirectory(Documentation)
#-----------------------------------------------------------------------------
# Installation
#-----------------------------------------------------------------------------
# set MITK cpack variables
# These are the default variables, which can be overwritten ( see below )
include(mitkSetupCPack)
set(use_default_config ON)
# MITK_APPS is set in Applications/AppList.cmake (included somewhere above
# if MITK_USE_BLUEBERRY is set to ON).
if(MITK_APPS)
set(activated_apps_no 0)
list(LENGTH MITK_APPS app_count)
# Check how many apps have been enabled
# If more than one app has been activated, the we use the
# default CPack configuration. Otherwise that apps configuration
# will be used, if present.
foreach(mitk_app ${MITK_APPS})
# extract option_name
string(REPLACE "^^" "\\;" target_info ${mitk_app})
set(target_info_list ${target_info})
list(GET target_info_list 1 option_name)
# check if the application is enabled
if(${option_name} OR MITK_BUILD_ALL_APPS)
MATH(EXPR activated_apps_no "${activated_apps_no} + 1")
endif()
endforeach()
if(app_count EQUAL 1 AND (activated_apps_no EQUAL 1 OR MITK_BUILD_ALL_APPS))
# Corner case if there is only one app in total
set(use_project_cpack ON)
elseif(activated_apps_no EQUAL 1 AND NOT MITK_BUILD_ALL_APPS)
# Only one app is enabled (no "build all" flag set)
set(use_project_cpack ON)
else()
# Less or more then one app is enabled
set(use_project_cpack OFF)
endif()
foreach(mitk_app ${MITK_APPS})
# extract target_dir and option_name
string(REPLACE "^^" "\\;" target_info ${mitk_app})
set(target_info_list ${target_info})
list(GET target_info_list 0 target_dir)
list(GET target_info_list 1 option_name)
# check if the application is enabled
if(${option_name} OR MITK_BUILD_ALL_APPS)
# check whether application specific configuration files will be used
if(use_project_cpack)
# use files if they exist
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Applications/${target_dir}/CPackOptions.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/Applications/${target_dir}/CPackOptions.cmake")
endif()
if(EXISTS "${PROJECT_SOURCE_DIR}/Applications/${target_dir}/CPackConfig.cmake.in")
set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/Applications/${target_dir}/CPackConfig.cmake")
configure_file(${PROJECT_SOURCE_DIR}/Applications/${target_dir}/CPackConfig.cmake.in
${CPACK_PROJECT_CONFIG_FILE} @ONLY)
set(use_default_config OFF)
endif()
endif()
# add link to the list
list(APPEND CPACK_CREATE_DESKTOP_LINKS "${target_dir}")
endif()
endforeach()
endif()
# if no application specific configuration file was used, use default
if(use_default_config)
configure_file(${MITK_SOURCE_DIR}/MITKCPackOptions.cmake.in
${MITK_BINARY_DIR}/MITKCPackOptions.cmake @ONLY)
set(CPACK_PROJECT_CONFIG_FILE "${MITK_BINARY_DIR}/MITKCPackOptions.cmake")
endif()
# include CPack model once all variables are set
include(CPack)
# Additional installation rules
include(mitkInstallRules)
#-----------------------------------------------------------------------------
# Last configuration steps
#-----------------------------------------------------------------------------
# This is for installation support of external projects depending on
# MITK plugins and modules. The export file should not be used for linking to MITK
# libraries without using LINK_DIRECTORIES, since the exports are incomplete
# yet (depending libraries are not exported).
set(MITK_EXPORTS_FILE "${MITK_BINARY_DIR}/MitkExports.cmake")
file(REMOVE ${MITK_EXPORTS_FILE})
set(targets_to_export)
get_property(module_targets GLOBAL PROPERTY MITK_MODULE_TARGETS)
if(module_targets)
list(APPEND targets_to_export ${module_targets})
endif()
if(MITK_USE_BLUEBERRY)
if(MITK_PLUGIN_LIBRARIES)
list(APPEND targets_to_export ${MITK_PLUGIN_LIBRARIES})
endif()
endif()
export(TARGETS ${targets_to_export} APPEND
FILE ${MITK_EXPORTS_FILE})
set(MITK_EXPORTED_TARGET_PROPERTIES )
foreach(target_to_export ${targets_to_export})
get_target_property(autoload_targets ${target_to_export} MITK_AUTOLOAD_TARGETS)
if(autoload_targets)
set(MITK_EXPORTED_TARGET_PROPERTIES "${MITK_EXPORTED_TARGET_PROPERTIES}
set_target_properties(${target_to_export} PROPERTIES MITK_AUTOLOAD_TARGETS \"${autoload_targets}\")")
endif()
get_target_property(autoload_dir ${target_to_export} MITK_AUTOLOAD_DIRECTORY)
if(autoload_dir)
set(MITK_EXPORTED_TARGET_PROPERTIES "${MITK_EXPORTED_TARGET_PROPERTIES}
set_target_properties(${target_to_export} PROPERTIES MITK_AUTOLOAD_DIRECTORY \"${autoload_dir}\")")
endif()
endforeach()
get_property(MITK_ADDITIONAL_LIBRARY_SEARCH_PATHS_CONFIG GLOBAL PROPERTY MITK_ADDITIONAL_LIBRARY_SEARCH_PATHS)
configure_file(${MITK_SOURCE_DIR}/CMake/ToolExtensionITKFactory.cpp.in
${MITK_BINARY_DIR}/ToolExtensionITKFactory.cpp.in COPYONLY)
configure_file(${MITK_SOURCE_DIR}/CMake/ToolExtensionITKFactoryLoader.cpp.in
${MITK_BINARY_DIR}/ToolExtensionITKFactoryLoader.cpp.in COPYONLY)
configure_file(${MITK_SOURCE_DIR}/CMake/ToolGUIExtensionITKFactory.cpp.in
${MITK_BINARY_DIR}/ToolGUIExtensionITKFactory.cpp.in COPYONLY)
set(VISIBILITY_AVAILABLE 0)
set(visibility_test_flag "")
mitkFunctionCheckCompilerFlags("-fvisibility=hidden" visibility_test_flag)
if(visibility_test_flag)
# The compiler understands -fvisiblity=hidden (probably gcc >= 4 or Clang)
set(VISIBILITY_AVAILABLE 1)
endif()
configure_file(mitkExportMacros.h.in ${MITK_BINARY_DIR}/mitkExportMacros.h)
configure_file(mitkVersion.h.in ${MITK_BINARY_DIR}/mitkVersion.h)
configure_file(mitkConfig.h.in ${MITK_BINARY_DIR}/mitkConfig.h)
set(IPFUNC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ipFunc)
set(UTILITIES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities)
file(GLOB _MODULES_CONF_FILES RELATIVE ${PROJECT_BINARY_DIR}/${MODULES_CONF_DIRNAME} ${PROJECT_BINARY_DIR}/${MODULES_CONF_DIRNAME}/*.cmake)
set(MITK_MODULE_NAMES)
foreach(_module ${_MODULES_CONF_FILES})
string(REPLACE Config.cmake "" _module_name ${_module})
list(APPEND MITK_MODULE_NAMES ${_module_name})
endforeach()
configure_file(mitkConfig.h.in ${MITK_BINARY_DIR}/mitkConfig.h)
configure_file(MITKConfig.cmake.in ${MITK_BINARY_DIR}/MITKConfig.cmake @ONLY)
# If we are under Windows, create two batch files which correctly
# set up the environment for the application and for Visual Studio
if(WIN32)
include(mitkFunctionCreateWindowsBatchScript)
set(VS_SOLUTION_FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.sln")
foreach(VS_BUILD_TYPE debug release)
mitkFunctionCreateWindowsBatchScript("${MITK_SOURCE_DIR}/CMake/StartVS.bat.in"
${PROJECT_BINARY_DIR}/StartVS_${VS_BUILD_TYPE}.bat
${VS_BUILD_TYPE})
endforeach()
endif(WIN32)
#-----------------------------------------------------------------------------
# MITK Applications
#-----------------------------------------------------------------------------
# This must come after MITKConfig.h was generated, since applications
# might do a find_package(MITK REQUIRED).
add_subdirectory(Applications)
#-----------------------------------------------------------------------------
# MITK Examples
#-----------------------------------------------------------------------------
if(MITK_BUILD_EXAMPLES)
# This must come after MITKConfig.h was generated, since applications
# might do a find_package(MITK REQUIRED).
add_subdirectory(Examples)
endif()
diff --git a/MITKConfig.cmake.in b/MITKConfig.cmake.in
index 2035d43cc1..46cbd1b149 100644
--- a/MITKConfig.cmake.in
+++ b/MITKConfig.cmake.in
@@ -1,203 +1,199 @@
# Update the CMake module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "@MITK_SOURCE_DIR@/CMake")
set(CppMicroServices_DIR "@MITK_BINARY_DIR@/Core/CppMicroServices")
# Include MITK macros
include(MacroParseArguments)
include(mitkFunctionCheckMitkCompatibility)
include(mitkFunctionOrganizeSources)
include(mitkFunctionCreateWindowsBatchScript)
include(mitkFunctionInstallProvisioningFiles)
include(mitkFunctionInstallAutoLoadModules)
include(mitkFunctionGetLibrarySearchPaths)
include(mitkMacroCreateModuleConf)
include(mitkMacroCreateModule)
include(mitkMacroCheckModule)
include(mitkMacroCreateModuleTests)
include(mitkFunctionAddCustomModuleTest)
include(mitkMacroUseModule)
include(mitkMacroMultiplexPicType)
include(mitkMacroInstall)
include(mitkMacroInstallHelperApp)
include(mitkMacroInstallTargets)
include(mitkMacroGenerateToolsLibrary)
include(mitkMacroCreateCTKPlugin)
include(mitkMacroGetPMDPlatformString)
# The MITK version number
set(MITK_VERSION_MAJOR "@MITK_VERSION_MAJOR@")
set(MITK_VERSION_MINOR "@MITK_VERSION_MINOR@")
set(MITK_VERSION_PATCH "@MITK_VERSION_PATCH@")
set(MITK_VERSION_STRING "@MITK_VERSION_STRING@")
# MITK compiler flags
set(MITK_C_FLAGS "@MITK_C_FLAGS@")
set(MTTK_C_FLAGS_DEBUG "@MITK_C_FLAGS_DEBUG@")
set(MITK_C_FLAGS_RELEASE "@MITK_C_FLAGS_RELEASE@")
set(MITK_CXX_FLAGS "@MITK_CXX_FLAGS@")
set(MTTK_CXX_FLAGS_DEBUG "@MITK_CXX_FLAGS_DEBUG@")
set(MITK_CXX_FLAGS_RELEASE "@MITK_CXX_FLAGS_RELEASE@")
set(MITK_EXE_LINKER_FLAGS "@MITK_EXE_LINKER_FLAGS@")
set(MITK_SHARED_LINKER_FLAGS "@MITK_SHARED_LINKER_FLAGS@")
set(MITK_MODULE_LINKER_FLAGS "@MITK_MODULE_LINKER_FLAGS@")
# Internal version numbers, used for approximate compatibility checks
# of a MITK development version (non-release).
set(MITK_VERSION_PLUGIN_SYSTEM 2) # dropped legacy BlueBerry plug-in CMake support
# MITK specific variables
set(MITK_SOURCE_DIR "@MITK_SOURCE_DIR@")
set(MITK_BINARY_DIR "@MITK_BINARY_DIR@")
set(UTILITIES_DIR "@UTILITIES_DIR@")
set(REGISTER_QFUNCTIONALITY_CPP_IN "@REGISTER_QFUNCTIONALITY_CPP_IN@")
set(MITK_MODULES_PACKAGE_DEPENDS_DIR "@MITK_MODULES_PACKAGE_DEPENDS_DIR@")
set(MODULES_PACKAGE_DEPENDS_DIRS "@MODULES_PACKAGE_DEPENDS_DIRS@")
set(MITK_DOXYGEN_TAGFILE_NAME "@MITK_DOXYGEN_TAGFILE_NAME@")
if(MODULES_CONF_DIRS)
list(APPEND MODULES_CONF_DIRS "@MODULES_CONF_DIRS@")
list(REMOVE_DUPLICATES MODULES_CONF_DIRS)
else()
set(MODULES_CONF_DIRS "@MODULES_CONF_DIRS@")
endif()
set(MODULES_CONF_DIRNAME "@MODULES_CONF_DIRNAME@")
foreach(_module @MITK_MODULE_NAMES@)
set(${_module}_CONFIG_FILE "@MITK_BINARY_DIR@/@MODULES_CONF_DIRNAME@/${_module}Config.cmake")
endforeach()
# Include directory variables
set(MITK_INCLUDE_DIRS "@MITK_INCLUDE_DIRS@")
set(QMITK_INCLUDE_DIRS "@QMITK_INCLUDE_DIRS@")
set(IPSEGMENTATION_INCLUDE_DIR "@IPSEGMENTATION_INCLUDE_DIR@")
set(IPFUNC_INCLUDE_DIR "@IPFUNC_INCLUDE_DIR@")
set(MITK_IGT_INCLUDE_DIRS "@MITK_IGT_INCLUDE_DIRS@")
# Library variables
set(MITK_LIBRARIES "@MITK_LIBRARIES@")
set(QMITK_LIBRARIES "@QMITK_LIBRARIES@")
# Link directory variables
set(MITK_LINK_DIRECTORIES "@MITK_LINK_DIRECTORIES@")
set(QMITK_LINK_DIRECTORIES "@QMITK_LINK_DIRECTORIES@")
set(MITK_LIBRARY_DIRS "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@/plugins" @MITK_ADDITIONAL_LIBRARY_SEARCH_PATHS_CONFIG@)
set(MITK_VTK_LIBRARY_DIRS "@MITK_VTK_LIBRARY_DIRS@")
set(MITK_ITK_LIBRARY_DIRS "@MITK_ITK_LIBRARY_DIRS@")
# External projects
set(ANN_DIR "@ANN_DIR@")
+set(CppUnit_DIR "@CppUnit_DIR@")
set(GLEW_DIR "@GLEW_DIR@")
set(tinyxml_DIR "@tinyxml_DIR@")
set(ITK_DIR "@ITK_DIR@")
set(VTK_DIR "@VTK_DIR@")
set(DCMTK_DIR "@DCMTK_DIR@")
set(GDCM_DIR "@GDCM_DIR@")
set(BOOST_ROOT "@BOOST_ROOT@")
set(OpenCV_DIR "@OpenCV_DIR@")
+set(Poco_DIR "@Poco_DIR@")
set(SOFA_DIR "@SOFA_DIR@")
set(Qwt_DIR "@Qwt_DIR@")
set(Qxt_DIR "@Qxt_DIR@")
set(MITK_QMAKE_EXECUTABLE "@QT_QMAKE_EXECUTABLE@")
set(MITK_DATA_DIR "@MITK_DATA_DIR@")
# External SDK directories
set(MITK_PMD_SDK_DIR @MITK_PMD_SDK_DIR@)
# MITK use variables
set(MITK_USE_QT @MITK_USE_QT@)
set(MITK_USE_BLUEBERRY @MITK_USE_BLUEBERRY@)
set(MITK_USE_SYSTEM_Boost @MITK_USE_SYSTEM_Boost@)
set(MITK_USE_Boost @MITK_USE_Boost@)
set(MITK_USE_Boost_LIBRARIES @MITK_USE_Boost_LIBRARIES@)
set(MITK_USE_CTK @MITK_USE_CTK@)
set(MITK_USE_DCMTK @MITK_USE_DCMTK@)
set(MITK_USE_OpenCV @MITK_USE_OpenCV@)
set(MITK_USE_SOFA @MITK_USE_SOFA@)
set(MITK_USE_Python @MITK_USE_Python@)
# MITK ToF use variables
set(MITK_TOF_PMDCAMCUBE_AVAILABLE @MITK_USE_TOF_PMDCAMCUBE@)
if(MITK_TOF_PMDCAMCUBE_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
option(MITK_USE_TOF_PMDCAMCUBE "Enable support for PMD Cam Cube" @MITK_USE_TOF_PMDCAMCUBE@)
mark_as_advanced(MITK_USE_TOF_PMDCAMCUBE)
endif()
set(MITK_TOF_PMDCAMBOARD_AVAILABLE @MITK_USE_TOF_PMDCAMBOARD@)
if(MITK_TOF_PMDCAMBOARD_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
option(MITK_USE_TOF_PMDCAMBOARD "Enable support for PMD Cam Board" @MITK_USE_TOF_PMDCAMBOARD@)
mark_as_advanced(MITK_USE_TOF_PMDCAMBOARD)
endif()
set(MITK_TOF_PMDO3_AVAILABLE @MITK_USE_TOF_PMDO3@)
if(MITK_TOF_PMDO3_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
option(MITK_USE_TOF_PMDO3 "Enable support for PMD =3" @MITK_USE_TOF_PMDO3@)
mark_as_advanced(MITK_USE_TOF_PMDO3)
endif()
set(MITK_TOF_KINECT_AVAILABLE @MITK_USE_TOF_KINECT@)
if(MITK_TOF_KINECT_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
option(MITK_USE_TOF_KINECT "Enable support for Kinect" @MITK_USE_TOF_KINECT@)
mark_as_advanced(MITK_USE_TOF_KINECT)
endif()
set(MITK_TOF_MESASR4000_AVAILABLE @MITK_USE_TOF_MESASR4000@)
if(MITK_TOF_MESASR4000_AVAILABLE AND NOT ${PROJECT_NAME} STREQUAL "MITK")
option(MITK_USE_TOF_MESASR4000 "Enable support for MESA SR4000" @MITK_USE_TOF_MESASR4000@)
mark_as_advanced(MITK_USE_TOF_MESASR4000)
endif()
-# There is no PocoConfig.cmake, so we set Poco specific CMake variables
-# here. This way the call to find_package(Poco) in BlueBerryConfig.cmake
-# finds the Poco distribution supplied by MITK
-set(Poco_INCLUDE_DIR "@MITK_SOURCE_DIR@/Utilities/Poco")
-set(Poco_LIBRARY_DIR "@MITK_BINARY_DIR@/bin")
-
if(MITK_USE_IGT)
#include(${MITK_DIR}/mitkIGTConfig.cmake)
endif()
# Install rules for ToF libraries loaded at runtime
include(@MITK_BINARY_DIR@/mitkToFHardwareInstallRules.cmake)
if(NOT MITK_EXPORTS_FILE_INCLUDED)
if(EXISTS "@MITK_EXPORTS_FILE@")
set(MITK_EXPORTS_FILE_INCLUDED 1)
include("@MITK_EXPORTS_FILE@")
endif(EXISTS "@MITK_EXPORTS_FILE@")
endif()
# BlueBerry support
if(MITK_USE_BLUEBERRY)
set(BlueBerry_DIR "@MITK_BINARY_DIR@/BlueBerry")
# Don't include the BlueBerry exports file, since the targets are
# also exported in the MITK exports file
set(BB_PLUGIN_EXPORTS_FILE_INCLUDED 1)
find_package(BlueBerry)
if(NOT BlueBerry_FOUND)
message(SEND_ERROR "MITK does not seem to be configured with BlueBerry support. Set MITK_USE_BLUEBERRY to ON in your MITK build configuration.")
endif(NOT BlueBerry_FOUND)
set(MITK_PLUGIN_USE_FILE @MITK_PLUGIN_USE_FILE@)
if(MITK_PLUGIN_USE_FILE)
if(EXISTS ${MITK_PLUGIN_USE_FILE})
include(${MITK_PLUGIN_USE_FILE})
endif()
endif()
set(MITK_PLUGIN_PROVISIONING_FILE "@MITK_EXTAPP_PROVISIONING_FILE@")
set(MITK_PROVISIONING_FILES
"${BLUEBERRY_PLUGIN_PROVISIONING_FILE}"
"${MITK_PLUGIN_PROVISIONING_FILE}")
endif(MITK_USE_BLUEBERRY)
# Set properties on exported targets
@MITK_EXPORTED_TARGET_PROPERTIES@
diff --git a/Modules/SceneSerialization/CMakeLists.txt b/Modules/SceneSerialization/CMakeLists.txt
index a75b2c22b2..3cb3bc4ced 100644
--- a/Modules/SceneSerialization/CMakeLists.txt
+++ b/Modules/SceneSerialization/CMakeLists.txt
@@ -1,8 +1,7 @@
MITK_CREATE_MODULE( SceneSerialization
INCLUDE_DIRS BaseDataSerializer BasePropertySerializer BasePropertyDeserializer
DEPENDS Mitk MitkExt SceneSerializationBase
PACKAGE_DEPENDS Poco
- ADDITIONAL_LIBS optimized PocoFoundation debug PocoFoundationd optimized PocoZip debug PocoZipd
)
add_subdirectory(Testing)
diff --git a/SuperBuild.cmake b/SuperBuild.cmake
index debe44a42b..43fb725481 100644
--- a/SuperBuild.cmake
+++ b/SuperBuild.cmake
@@ -1,392 +1,404 @@
#-----------------------------------------------------------------------------
# Convenient macro allowing to download a file
#-----------------------------------------------------------------------------
macro(downloadFile url dest)
file(DOWNLOAD ${url} ${dest} STATUS status)
list(GET status 0 error_code)
list(GET status 1 error_msg)
if(error_code)
message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}")
endif()
endmacro()
#-----------------------------------------------------------------------------
# MITK Prerequisites
#-----------------------------------------------------------------------------
if(UNIX AND NOT APPLE)
include(mitkFunctionCheckPackageHeader)
# Check for libxt-dev
mitkFunctionCheckPackageHeader(StringDefs.h libxt-dev /usr/include/X11/)
# Check for libtiff4-dev
mitkFunctionCheckPackageHeader(tiff.h libtiff4-dev)
# Check for libwrap0-dev
mitkFunctionCheckPackageHeader(tcpd.h libwrap0-dev)
endif()
#-----------------------------------------------------------------------------
# ExternalProjects
#-----------------------------------------------------------------------------
set(external_projects
tinyxml
ANN
+ CppUnit
GLEW
VTK
ACVD
GDCM
CableSwig
OpenCV
+ Poco
ITK
Boost
DCMTK
CTK
SOFA
MITKData
Qwt
Qxt
)
# These are "hard" dependencies and always set to ON
set(MITK_USE_tinyxml 1)
set(MITK_USE_ANN 1)
set(MITK_USE_GLEW 1)
set(MITK_USE_GDCM 1)
set(MITK_USE_ITK 1)
set(MITK_USE_VTK 1)
# Semi-hard dependencies, enabled by user-controlled variables
set(MITK_USE_CableSwig ${MITK_USE_Python})
if(MITK_USE_QT)
set(MITK_USE_Qwt 1)
set(MITK_USE_Qxt 1)
endif()
+if(MITK_USE_BLUEBERRY)
+ set(MITK_USE_CppUnit 1)
+endif()
+
# A list of "nice" external projects, playing well together with CMake
set(nice_external_projects ${external_projects})
list(REMOVE_ITEM nice_external_projects Boost)
foreach(proj ${nice_external_projects})
if(MITK_USE_${proj})
set(EXTERNAL_${proj}_DIR "${${proj}_DIR}" CACHE PATH "Path to ${proj} build directory")
mark_as_advanced(EXTERNAL_${proj}_DIR)
if(EXTERNAL_${proj}_DIR)
set(${proj}_DIR ${EXTERNAL_${proj}_DIR})
endif()
endif()
endforeach()
if(MITK_USE_Boost)
set(EXTERNAL_BOOST_ROOT "${BOOST_ROOT}" CACHE PATH "Path to Boost directory")
mark_as_advanced(EXTERNAL_BOOST_ROOT)
if(EXTERNAL_BOOST_ROOT)
set(BOOST_ROOT ${EXTERNAL_BOOST_ROOT})
endif()
endif()
if(BUILD_TESTING)
set(EXTERNAL_MITK_DATA_DIR "${MITK_DATA_DIR}" CACHE PATH "Path to the MITK data directory")
mark_as_advanced(EXTERNAL_MITK_DATA_DIR)
if(EXTERNAL_MITK_DATA_DIR)
set(MITK_DATA_DIR ${EXTERNAL_MITK_DATA_DIR})
endif()
endif()
# Look for git early on, if needed
if((BUILD_TESTING AND NOT EXTERNAL_MITK_DATA_DIR) OR
(MITK_USE_CTK AND NOT EXTERNAL_CTK_DIR))
find_package(Git REQUIRED)
endif()
#-----------------------------------------------------------------------------
# External project settings
#-----------------------------------------------------------------------------
include(ExternalProject)
set(ep_base "${CMAKE_BINARY_DIR}/CMakeExternals")
set_property(DIRECTORY PROPERTY EP_BASE ${ep_base})
set(ep_install_dir ${ep_base}/Install)
#set(ep_build_dir ${ep_base}/Build)
set(ep_source_dir ${ep_base}/Source)
#set(ep_parallelism_level)
set(ep_build_shared_libs ON)
set(ep_build_testing OFF)
if(NOT MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL)
set(MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL http://mitk.org/download/thirdparty)
endif()
# Compute -G arg for configuring external projects with the same CMake generator:
if(CMAKE_EXTRA_GENERATOR)
set(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
else()
set(gen "${CMAKE_GENERATOR}")
endif()
# Use this value where semi-colons are needed in ep_add args:
set(sep "^^")
##
if(MSVC_VERSION)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj /MP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /MP")
endif()
set(ep_common_args
-DBUILD_TESTING:BOOL=${ep_build_testing}
-DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
#debug flags
-DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
#release flags
-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
#relwithdebinfo
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
#link flags
-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
-DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
-DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS}
)
# Include external projects
foreach(p ${external_projects})
include(CMakeExternals/${p}.cmake)
endforeach()
#-----------------------------------------------------------------------------
# Set superbuild boolean args
#-----------------------------------------------------------------------------
set(mitk_cmake_boolean_args
BUILD_SHARED_LIBS
WITH_COVERAGE
BUILD_TESTING
MITK_USE_QT
MITK_BUILD_ALL_PLUGINS
MITK_BUILD_ALL_APPS
MITK_BUILD_TUTORIAL # Deprecated. Use MITK_BUILD_EXAMPLES instead
MITK_BUILD_EXAMPLES
MITK_USE_ACVD
+ MITK_USE_CppUnit
MITK_USE_GLEW
MITK_USE_Boost
MITK_USE_SYSTEM_Boost
MITK_USE_BLUEBERRY
MITK_USE_CTK
MITK_USE_DCMTK
MITK_USE_OpenCV
+ MITK_USE_Poco
MITK_USE_SOFA
MITK_USE_Python
MITK_USE_OpenCL
)
#-----------------------------------------------------------------------------
# Create the final variable containing superbuild boolean args
#-----------------------------------------------------------------------------
set(mitk_superbuild_boolean_args)
foreach(mitk_cmake_arg ${mitk_cmake_boolean_args})
list(APPEND mitk_superbuild_boolean_args -D${mitk_cmake_arg}:BOOL=${${mitk_cmake_arg}})
endforeach()
if(MITK_BUILD_ALL_PLUGINS)
list(APPEND mitk_superbuild_boolean_args -DBLUEBERRY_BUILD_ALL_PLUGINS:BOOL=ON)
endif()
#-----------------------------------------------------------------------------
# MITK Utilities
#-----------------------------------------------------------------------------
set(proj MITK-Utilities)
ExternalProject_Add(${proj}
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS
# Mandatory dependencies
${tinyxml_DEPENDS}
${ANN_DEPENDS}
${VTK_DEPENDS}
${ITK_DEPENDS}
# Optionnal dependencies
${ACVD_DEPENDS}
+ ${CppUnit_DEPENDS}
${GLEW_DEPENDS}
${Boost_DEPENDS}
${CTK_DEPENDS}
${DCMTK_DEPENDS}
${OpenCV_DEPENDS}
+ ${Poco_DEPENDS}
${SOFA_DEPENDS}
${MITK-Data_DEPENDS}
${Qwt_DEPENDS}
${Qxt_DEPENDS}
)
#-----------------------------------------------------------------------------
# Additional MITK CXX/C Flags
#-----------------------------------------------------------------------------
set(MITK_ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags for MITK")
set(MITK_ADDITIONAL_C_FLAGS_RELEASE "" CACHE STRING "Additional Release C Flags for MITK")
set(MITK_ADDITIONAL_C_FLAGS_DEBUG "" CACHE STRING "Additional Debug C Flags for MITK")
mark_as_advanced(MITK_ADDITIONAL_C_FLAGS MITK_ADDITIONAL_C_FLAGS_DEBUG MITK_ADDITIONAL_C_FLAGS_RELEASE)
set(MITK_ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags for MITK")
set(MITK_ADDITIONAL_CXX_FLAGS_RELEASE "" CACHE STRING "Additional Release CXX Flags for MITK")
set(MITK_ADDITIONAL_CXX_FLAGS_DEBUG "" CACHE STRING "Additional Debug CXX Flags for MITK")
mark_as_advanced(MITK_ADDITIONAL_CXX_FLAGS MITK_ADDITIONAL_CXX_FLAGS_DEBUG MITK_ADDITIONAL_CXX_FLAGS_RELEASE)
set(MITK_ADDITIONAL_EXE_LINKER_FLAGS "" CACHE STRING "Additional exe linker flags for MITK")
set(MITK_ADDITIONAL_SHARED_LINKER_FLAGS "" CACHE STRING "Additional shared linker flags for MITK")
set(MITK_ADDITIONAL_MODULE_LINKER_FLAGS "" CACHE STRING "Additional module linker flags for MITK")
mark_as_advanced(MITK_ADDITIONAL_EXE_LINKER_FLAGS MITK_ADDITIONAL_SHARED_LINKER_FLAGS MITK_ADDITIONAL_MODULE_LINKER_FLAGS)
#-----------------------------------------------------------------------------
# MITK Configure
#-----------------------------------------------------------------------------
if(MITK_INITIAL_CACHE_FILE)
set(mitk_initial_cache_arg -C "${MITK_INITIAL_CACHE_FILE}")
endif()
set(mitk_optional_cache_args )
foreach(type RUNTIME ARCHIVE LIBRARY)
if(DEFINED CTK_PLUGIN_${type}_OUTPUT_DIRECTORY)
list(APPEND mitk_optional_cache_args -DCTK_PLUGIN_${type}_OUTPUT_DIRECTORY:PATH=${CTK_PLUGIN_${type}_OUTPUT_DIRECTORY})
endif()
endforeach()
# Optional python variables
if(MITK_USE_Python)
list(APPEND mitk_optional_cache_args
-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}
-DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
-DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}
-DPYTHON_INCLUDE_DIR2:PATH=${PYTHON_INCLUDE_DIR2} )
endif()
set(proj MITK-Configure)
ExternalProject_Add(${proj}
LIST_SEPARATOR ^^
DOWNLOAD_COMMAND ""
CMAKE_GENERATOR ${gen}
CMAKE_CACHE_ARGS
# --------------- Build options ----------------
-DBUILD_TESTING:BOOL=${ep_build_testing}
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/MITK-build/install
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
# --------------- Compile options ----------------
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} ${MITK_ADDITIONAL_C_FLAGS}"
"-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} ${MITK_ADDITIONAL_CXX_FLAGS}"
# debug flags
"-DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG} ${MITK_ADDITIONAL_CXX_FLAGS_DEBUG}"
"-DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG} ${MITK_ADDITIONAL_C_FLAGS_DEBUG}"
# release flags
"-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE} ${MITK_ADDITIONAL_CXX_FLAGS_RELEASE}"
"-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE} ${MITK_ADDITIONAL_C_FLAGS_RELEASE}"
# relwithdebinfo
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
# link flags
"-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS} ${MITK_ADDITIONAL_EXE_LINKER_FLAGS}"
"-DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS} ${MITK_ADDITIONAL_SHARED_LINKER_FLAGS}"
"-DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS} ${MITK_ADDITIONAL_MODULE_LINKER_FLAGS}"
# Output directories
-DMITK_CMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${MITK_CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DMITK_CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${MITK_CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DMITK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${MITK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
# ------------- Boolean build options --------------
${mitk_superbuild_boolean_args}
${mitk_optional_cache_args}
-DMITK_USE_SUPERBUILD:BOOL=OFF
-DCTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}
# ----------------- Miscellaneous ---------------
-DMITK_CTEST_SCRIPT_MODE:STRING=${MITK_CTEST_SCRIPT_MODE}
-DMITK_SUPERBUILD_BINARY_DIR:PATH=${MITK_BINARY_DIR}
-DMITK_MODULES_TO_BUILD:INTERNAL=${MITK_MODULES_TO_BUILD}
-DMITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES:STRING=${MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES}
-DMITK_ACCESSBYITK_FLOATING_PIXEL_TYPES:STRING=${MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES}
-DMITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES:STRING=${MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES}
-DMITK_ACCESSBYITK_DIMENSIONS:STRING=${MITK_ACCESSBYITK_DIMENSIONS}
# --------------- External project dirs ---------------
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-DMITK_KWSTYLE_EXECUTABLE:FILEPATH=${MITK_KWSTYLE_EXECUTABLE}
-DCTK_DIR:PATH=${CTK_DIR}
-DDCMTK_DIR:PATH=${DCMTK_DIR}
-Dtinyxml_DIR:PATH=${tinyxml_DIR}
-DGLEW_DIR:PATH=${GLEW_DIR}
-DANN_DIR:PATH=${ANN_DIR}
+ -DCppUnit_DIR:PATH=${CppUnit_DIR}
-DVTK_DIR:PATH=${VTK_DIR} # FindVTK expects VTK_DIR
-DITK_DIR:PATH=${ITK_DIR} # FindITK expects ITK_DIR
-DACVD_DIR:PATH=${ACVD_DIR}
-DOpenCV_DIR:PATH=${OpenCV_DIR}
+ -DPoco_DIR:PATH=${Poco_DIR}
-DSOFA_DIR:PATH=${SOFA_DIR}
-DGDCM_DIR:PATH=${GDCM_DIR}
-DBOOST_ROOT:PATH=${BOOST_ROOT}
-DMITK_USE_Boost_LIBRARIES:STRING=${MITK_USE_Boost_LIBRARIES}
-DMITK_DATA_DIR:PATH=${MITK_DATA_DIR}
-DQwt_DIR:PATH=${Qwt_DIR}
-DQxt_DIR:PATH=${Qxt_DIR}
CMAKE_ARGS
${mitk_initial_cache_arg}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
BINARY_DIR ${CMAKE_BINARY_DIR}/MITK-build
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS
MITK-Utilities
)
#-----------------------------------------------------------------------------
# MITK
#-----------------------------------------------------------------------------
if(CMAKE_GENERATOR MATCHES ".*Makefiles.*")
set(mitk_build_cmd "$(MAKE)")
else()
set(mitk_build_cmd ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/MITK-build --config ${CMAKE_CFG_INTDIR})
endif()
if(NOT DEFINED SUPERBUILD_EXCLUDE_MITKBUILD_TARGET OR NOT SUPERBUILD_EXCLUDE_MITKBUILD_TARGET)
set(MITKBUILD_TARGET_ALL_OPTION "ALL")
else()
set(MITKBUILD_TARGET_ALL_OPTION "")
endif()
add_custom_target(MITK-build ${MITKBUILD_TARGET_ALL_OPTION}
COMMAND ${mitk_build_cmd}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/MITK-build
DEPENDS MITK-Configure
)
#-----------------------------------------------------------------------------
# Custom target allowing to drive the build of the MITK project itself
#-----------------------------------------------------------------------------
add_custom_target(MITK
COMMAND ${mitk_build_cmd}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/MITK-build
)
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index 216f20885e..75c0cd5785 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -1,39 +1,24 @@
SUPPRESS_ALL_WARNINGS()
# most stuff of these uses itk_zlib.h (via mitkIpPic.h)
find_package(ITK)
include(${ITK_USE_FILE})
# some legacy util files include in the old style with prefixed directory,
# like #include <ipPic/mitkIpPic.h>
include_directories(.)
subdirs(
ipPic
ipFunc
ipSegmentation
- Poco
mbilog
qtsingleapplication
KWStyle
)
# mbilog is independent of mitk, and cant use mitk macros
# configuring happens through mbilog/mbilogConfig.cmake.in
set(mbilog_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/mbilog" "${CMAKE_CURRENT_BINARY_DIR}/mbilog")
set(mbilog_CONFIG_FILE "${PROJECT_BINARY_DIR}/${MODULES_CONF_DIRNAME}/mbilogConfig.cmake" CACHE INTERNAL "Path to module config" FORCE)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mbilog/mbilogConfig.cmake.in" "${mbilog_CONFIG_FILE}")
-
-set(Poco_INCLUDE_DIR
- ${CMAKE_CURRENT_SOURCE_DIR}/Poco
- CACHE PATH
- "top-level directory containing the poco include directories. E.g /usr/local/include/ or c:\\poco\\include\\poco-1.3.2"
-)
-
-set(Poco_LIBRARY_DIR
- ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- CACHE PATH
- "top-level directory containing the poco libraries."
-)
-
-
diff --git a/Utilities/Poco/CMakeLists.txt b/Utilities/Poco/CMakeLists.txt
deleted file mode 100755
index 8017f2bf45..0000000000
--- a/Utilities/Poco/CMakeLists.txt
+++ /dev/null
@@ -1,125 +0,0 @@
-project(poco)
-
-cmake_minimum_required(VERSION 2.6)
-
-set(CPACK_PACKAGE_VERSION_MAJOR "1")
-set(CPACK_PACKAGE_VERSION_MINOR "3")
-set(CPACK_PACKAGE_VERSION_PATCH "5")
-set(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-set(RELEASE_NAME "Poco 1.3.5")
-set(PROJECT_VERSION ${COMPLETE_VERSION})
-
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "" CACHE PATH "The single directory for all runtime files")
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "" CACHE PATH "The single directory for all library files")
-
-
-#set(COMMON_CXX "-Wall -Wno-sign-compare")
-set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX} ${CMAKE_CXX_FLAGS_DEBUG}")
-set(CMAKE_CXX_FLAGS_MINSIZEREL "${COMMON_CXX} ${CMAKE_CXX_FLAGS_MINSIZEREL}")
-
-#see Bug #5281
-if(NOT MSVC)
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
-endif(NOT MSVC)
-
-# Set the library postfix
-set(CMAKE_DEBUG_POSTFIX "d")
-
-# Uncomment from next two lines to force statitc or dynamic library, default is autodetection
-if(POCO_STATIC)
- set( LIB_MODE STATIC )
-else(POCO_STATIC)
- set( LIB_MODE SHARED )
-endif(POCO_STATIC)
-
-# whether unit tests should be build
-set(POCO_ENABLE_TESTS FALSE CACHE BOOL "Build the Poco unit tests")
- mark_as_advanced(POCO_ENABLE_TESTS)
-set(ENABLE_TESTS ${POCO_ENABLE_TESTS})
-
-if(ENABLE_TESTS)
- enable_testing()
-endif(ENABLE_TESTS)
-
-# Set local include path
-#include_directories( CppUnit/include Foundation/include XML/include Net/include NetSSL_OpenSSL/include Util/include Data/include WebWidgets/include Zip/include)
-include_directories( CppUnit/include CppUnit/WinTestRunner/include Foundation/include XML/include Util/include Zip/include)
-
-include(CheckTypeSize)
-include(FindCygwin)
-#include(FindOpenSSL)
-include(CMakeDetermineCompilerId)
-
-#include(contrib/cmake/FindMySQL.cmake)
-#include(contrib/cmake/FindAPR.cmake)
-#include(contrib/cmake/FindApache2.cmake)
-
-# OS Detection
-if(CMAKE_SYSTEM MATCHES "Windows")
- add_definitions( -DPOCO_OS_FAMILY_WINDOWS )# -DPOCO_WIN32_UTF8)
- add_definitions( -DPOCO_NO_AUTOMATIC_LIBS )
- set(SYSLIBS iphlpapi gdi32)
-endif(CMAKE_SYSTEM MATCHES "Windows")
-
-if(CMAKE_SYSTEM MATCHES "Linux")
- add_definitions( -DPOCO_OS_FAMILY_UNIX )
- # Standard 'must be' defines
- add_definitions( -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64)
- set(SYSLIBS pthread dl rt)
-endif(CMAKE_SYSTEM MATCHES "Linux")
-
-if(CMAKE_SYSTEM MATCHES "SunOS")
- add_definitions( -DPOCO_OS_FAMILY_UNIX )
- # Standard 'must be' defines
- add_definitions( -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 )
- set(SYSLIBS pthread socket xnet nsl resolv rt dl)
-endif(CMAKE_SYSTEM MATCHES "SunOS")
-
-if(CMAKE_COMPILER_IS_MINGW)
- add_definitions(-DWC_NO_BEST_FIT_CHARS=0x400)
- add_definitions(-mno-cygwin -D_WIN32 -DMINGW32 -DWINVER=0x500 -DODBCVER=0x0300 -DPOCO_THREAD_STACK_SIZE -DFoundation_Config_INCLUDED )
- #link_directories(/usr/local/lib /usr/lib)
- #include_directories(/usr/local/include /usr/include)
-endif(CMAKE_COMPILER_IS_MINGW)
-
-if(CMAKE_COMPILER_IS_CYGWIN)
-# add_definitions(-DWC_NO_BEST_FIT_CHARS=0x400)
-endif(CMAKE_COMPILER_IS_CYGWIN)
-
-# SunPro C++
-if(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
- add_definitions( -D_BSD_SOURCE -library=stlport4)
-endif(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
-
-add_subdirectory(Foundation)
-add_subdirectory(XML)
-add_subdirectory(Util)
-add_subdirectory(CppUnit)
-#add_subdirectory(Net)
-
-#if(OPENSSL_FOUND)
-# add_subdirectory(NetSSL_OpenSSL)
-# add_subdirectory(Crypto)
-#endif(OPENSSL_FOUND)
-
-#add_subdirectory(Data)
-#add_subdirectory(WebWidgets)
-add_subdirectory(Zip)
-
-if(ENABLE_TESTS)
- add_subdirectory(Foundation/testsuite)
- add_subdirectory(XML/testsuite)
- add_subdirectory(Util/testsuite)
- add_subdirectory(Zip/testsuite)
-endif(ENABLE_TESTS)
-
-
-# Enable packaging
-
-# By default, do not warn when built on machines using only VS Express
-if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
- set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
-endif()
-
-include(InstallRequiredSystemLibraries)
-
diff --git a/Utilities/Poco/CppUnit/CMakeLists.txt b/Utilities/Poco/CppUnit/CMakeLists.txt
deleted file mode 100755
index a250156834..0000000000
--- a/Utilities/Poco/CppUnit/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-set(LIBNAME "CppUnit")
-#set(LIBNAMED "${LIBNAME}d")
-
-aux_source_directory(src SRCS)
-
-add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
-set_target_properties( ${LIBNAME} PROPERTIES
- # COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
- VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
- SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-
-#add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
-#set_target_properties( ${LIBNAMED}
-# PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
-# VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
-# SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-#target_link_libraries( ${LIBNAMED} )
-
-# Needs MFC headers, so exclude it to be able to compile on VS Express Edition
-#if(WIN32 AND NOT MINGW)
-# add_subdirectory(WinTestRunner)
-#endif()
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/CMakeLists.txt b/Utilities/Poco/CppUnit/WinTestRunner/CMakeLists.txt
deleted file mode 100644
index 75770e075c..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/CMakeLists.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-set(LIBNAME "WinTestRunner")
-#set(LIBNAMED "${LIBNAME}d")
-
-set(SRCS) # clear old sources
-aux_source_directory(src SRCS)
-
-add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
-set_target_properties( ${LIBNAME} PROPERTIES
- #COMPILE_FLAGS ${DEBUG_CXX_FLAGS}
- VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
- SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
-)
-add_definitions(-D_AFXDLL)
-target_link_libraries( ${LIBNAME} CppUnit WINMM)
-
-#add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
-#set_target_properties( ${LIBNAMED} PROPERTIES
-# #COMPILE_FLAGS "${RELEASE_CXX_FLAGS}"
-# DEFINE_SYMBOL _AFXDLL
-# VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
-# SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-target_link_libraries( ${LIBNAMED} CppUnitd)
-
-
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h b/Utilities/Poco/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h
deleted file mode 100644
index 65d21f1507..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// WinTestRunner.h
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h#3 $
-//
-// Application shell for CppUnit's TestRunner dialog.
-//
-
-
-#ifndef WinTestRunner_H_INCLUDED
-#define WinTestRunner_H_INCLUDED
-
-
-#if !defined(POCO_STATIC)
-#if defined(WinTestRunner_EXPORTS)
-#define WinTestRunner_API __declspec(dllexport)
-#else
-#define WinTestRunner_API __declspec(dllimport)
-#endif
-#else
-#define WinTestRunner_API
-#endif
-
-
-#include "CppUnit/CppUnit.h"
-#include <vector>
-#include <afxwin.h>
-
-
-namespace CppUnit {
-
-
-class Test;
-
-
-class WinTestRunner_API WinTestRunner
-{
-public:
- WinTestRunner();
- ~WinTestRunner();
-
- void run();
- void addTest(Test* pTest);
-
-private:
- std::vector<Test*> _tests;
-};
-
-
-class WinTestRunner_API WinTestRunnerApp: public CWinApp
- /// A simple application class that hosts the TestRunner dialog.
- /// Create a subclass and override the TestMain() method.
- ///
- /// WinTestRunnerApp supports a batch mode, which runs the
- /// test using the standard text-based TestRunner from CppUnit.
- /// To enable batch mode, start the application with the "/b"
- /// or "/B" argument. Optionally, a filename may be specified
- /// where the test output will be written to: "/b:<path>" or
- /// "/B:<path>".
- ///
- /// When run in batch mode, the exit code of the application
- /// will denote test success (0) or failure (1).
-{
-public:
- virtual BOOL InitInstance();
-
- virtual void TestMain() = 0;
-
- DECLARE_MESSAGE_MAP()
-};
-
-
-} // namespace CppUnit
-
-
-#endif // WinTestRunner_H_INCLUDED
-
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/res/Resource.h b/Utilities/Poco/CppUnit/WinTestRunner/res/Resource.h
deleted file mode 100644
index cd0bf35287..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/res/Resource.h
+++ /dev/null
@@ -1,27 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by TestRunner.rc
-//
-#define IDD_DIALOG_TESTRUNNER 129
-#define IDC_LIST 1000
-#define ID_RUN 1001
-#define ID_STOP 1002
-#define IDC_PROGRESS 1003
-#define IDC_INDICATOR 1004
-#define IDC_COMBO_TEST 1005
-#define IDC_STATIC_RUNS 1007
-#define IDC_STATIC_ERRORS 1008
-#define IDC_STATIC_FAILURES 1009
-#define IDC_EDIT_TIME 1010
-#define IDC_CHK_AUTORUN 1013
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 131
-#define _APS_NEXT_COMMAND_VALUE 32771
-#define _APS_NEXT_CONTROL_VALUE 1014
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/res/WinTestRunner.rc b/Utilities/Poco/CppUnit/WinTestRunner/res/WinTestRunner.rc
deleted file mode 100644
index c4056f2697..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/res/WinTestRunner.rc
+++ /dev/null
@@ -1,175 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.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 ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
- "#define _AFX_NO_OLE_RESOURCES\r\n"
- "#define _AFX_NO_TRACKER_RESOURCES\r\n"
- "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
- "\r\n"
- "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
- "#ifdef _WIN32\r\n"
- "LANGUAGE 9, 1\r\n"
- "#pragma code_page(1252)\r\n"
- "#endif\r\n"
- "#include ""..\\res\\WinTestRunner.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
- "#include ""afxres.rc"" // Standard components\r\n"
- "#endif\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 "FileDescription", "CppUnit WinTestRunner DLL"
- VALUE "FileVersion", "1, 0, 0, 1"
- VALUE "InternalName", "WinTestRunner"
- VALUE "LegalCopyright", "Copyright (c) 2005"
- VALUE "OriginalFilename", "TestRunner.dll"
- VALUE "ProductName", "CppUnit WinTestRunner Dynamic Link Library"
- VALUE "ProductVersion", "1, 0, 0, 1"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_DIALOG_TESTRUNNER DIALOGEX 0, 0, 512, 300
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "CppUnit WinTestRunner"
-FONT 8, "MS Sans Serif", 0, 0, 0x0
-BEGIN
- COMBOBOX IDC_COMBO_TEST,7,20,424,273,CBS_DROPDOWNLIST |
- WS_VSCROLL | WS_TABSTOP
- DEFPUSHBUTTON "Run",ID_RUN,455,7,50,14
- DEFPUSHBUTTON "Stop",ID_STOP,455,24,50,14
- CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | WS_BORDER |
- WS_TABSTOP,7,110,498,160
- PUSHBUTTON "Close",IDOK,455,279,50,14
- LTEXT "Test Name:",IDC_STATIC,7,9,179,9
- LTEXT "Progress:",IDC_STATIC,7,55,49,9
- LTEXT "Errors and Failures:",IDC_STATIC,7,99,67,9
- LTEXT "Runs:",IDC_STATIC,457,54,26,10
- LTEXT "Failures:",IDC_STATIC,457,80,26,10
- LTEXT "Errors:",IDC_STATIC,457,67,26,10
- RTEXT "0",IDC_STATIC_RUNS,487,54,16,10
- RTEXT "0",IDC_STATIC_ERRORS,487,67,16,10
- RTEXT "0",IDC_STATIC_FAILURES,487,80,16,10
- EDITTEXT IDC_EDIT_TIME,7,281,440,12,ES_AUTOHSCROLL | ES_READONLY |
- NOT WS_BORDER
- LTEXT "",IDC_PROGRESS,7,67,424,20,SS_SUNKEN | NOT WS_VISIBLE
- CONTROL "Auto Run",IDC_CHK_AUTORUN,"Button",BS_AUTOCHECKBOX |
- BS_LEFTTEXT | WS_TABSTOP,383,38,46,10
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_DIALOG_TESTRUNNER, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 505
- TOPMARGIN, 7
- BOTTOMMARGIN, 293
- END
-END
-#endif // APSTUDIO_INVOKED
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-#define _AFX_NO_SPLITTER_RESOURCES
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE 9, 1
-#pragma code_page(1252)
-#endif
-#include "afxres.rc" // Standard components
-#endif
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/ActiveTest.cpp b/Utilities/Poco/CppUnit/WinTestRunner/src/ActiveTest.cpp
deleted file mode 100644
index 930d0413c2..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/ActiveTest.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// ActiveTest.cpp
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/src/ActiveTest.cpp#1 $
-//
-
-
-#include <afxwin.h>
-#include "ActiveTest.h"
-
-
-namespace CppUnit {
-
-
-// Spawn a thread to a test
-void ActiveTest::run(TestResult* result)
-{
- CWinThread* thread;
-
- setTestResult(result);
- _runCompleted.ResetEvent();
-
- thread = AfxBeginThread(threadFunction, this, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
- DuplicateHandle(GetCurrentProcess(), thread->m_hThread, GetCurrentProcess(), &_threadHandle, 0, FALSE, DUPLICATE_SAME_ACCESS);
-
- thread->ResumeThread();
-}
-
-
-// Simple execution thread. Assuming that an ActiveTest instance
-// only creates one of these at a time.
-UINT ActiveTest::threadFunction(LPVOID thisInstance)
-{
- ActiveTest* test = (ActiveTest*) thisInstance;
-
- test->run();
- test->_runCompleted.SetEvent();
-
- return 0;
-}
-
-
-} // namespace CppUnit
-
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/ActiveTest.h b/Utilities/Poco/CppUnit/WinTestRunner/src/ActiveTest.h
deleted file mode 100644
index 6c80c967df..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/ActiveTest.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// ActiveTest.h
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/src/ActiveTest.h#1 $
-//
-
-
-#ifndef ActiveTest_INCLUDED
-#define ActiveTest_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/TestDecorator.h"
-#include <afxmt.h>
-
-
-namespace CppUnit {
-
-
-/* A Microsoft-specific active test
- *
- * An active test manages its own
- * thread of execution. This one
- * is very simple and only sufficient
- * for the limited use we put it through
- * in the TestRunner. It spawns a thread
- * on run (TestResult *) and signals
- * completion of the test.
- *
- * We assume that only one thread
- * will be active at once for each
- * instance.
- *
- */
-class ActiveTest: public TestDecorator
-{
-public:
- ActiveTest(Test* test);
- ~ActiveTest();
-
- void run(TestResult* result);
-
-protected:
- HANDLE _threadHandle;
- CEvent _runCompleted;
- TestResult* _currentTestResult;
-
- void run ();
- void setTestResult(TestResult* result);
- static UINT threadFunction(LPVOID thisInstance);
-};
-
-
-// Construct the active test
-inline ActiveTest::ActiveTest(Test *test): TestDecorator(test)
-{
- _currentTestResult = NULL;
- _threadHandle = INVALID_HANDLE_VALUE;
-}
-
-
-// Pend until the test has completed
-inline ActiveTest::~ActiveTest()
-{
- CSingleLock(&_runCompleted, TRUE);
- CloseHandle(_threadHandle);
-}
-
-
-// Set the test result that we are to run
-inline void ActiveTest::setTestResult(TestResult* result)
-{
- _currentTestResult = result;
-}
-
-
-// Run our test result
-inline void ActiveTest::run()
-{
- TestDecorator::run(_currentTestResult);
-}
-
-
-} // namespace CppUnit
-
-
-#endif // ActiveTest_INCLUDED
-
-
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/DLLMain.cpp b/Utilities/Poco/CppUnit/WinTestRunner/src/DLLMain.cpp
deleted file mode 100644
index fcf329fd0f..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/DLLMain.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// DLLMain.cpp
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/src/DLLMain.cpp#1 $
-//
-
-
-#include <afxwin.h>
-#include <afxdllx.h>
-
-
-static AFX_EXTENSION_MODULE TestRunnerDLL = { NULL, NULL };
-
-
-extern "C" int APIENTRY
-DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
-{
- // Remove this if you use lpReserved
- UNREFERENCED_PARAMETER(lpReserved);
-
- if (dwReason == DLL_PROCESS_ATTACH)
- {
- TRACE0("WinTestRunner.DLL Initializing\n");
-
- // Extension DLL one-time initialization
- if (!AfxInitExtensionModule(TestRunnerDLL, hInstance))
- return 0;
-
- // Insert this DLL into the resource chain
- // NOTE: If this Extension DLL is being implicitly linked to by
- // an MFC Regular DLL (such as an ActiveX Control)
- // instead of an MFC application, then you will want to
- // remove this line from DllMain and put it in a separate
- // function exported from this Extension DLL. The Regular DLL
- // that uses this Extension DLL should then explicitly call that
- // function to initialize this Extension DLL. Otherwise,
- // the CDynLinkLibrary object will not be attached to the
- // Regular DLL's resource chain, and serious problems will
- // result.
-
- new CDynLinkLibrary(TestRunnerDLL);
- }
- else if (dwReason == DLL_PROCESS_DETACH)
- {
- TRACE0("WinTestRunner.DLL Terminating\n");
- // Terminate the library before destructors are called
- AfxTermExtensionModule(TestRunnerDLL);
- }
- return 1; // ok
-}
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/GUITestResult.cpp b/Utilities/Poco/CppUnit/WinTestRunner/src/GUITestResult.cpp
deleted file mode 100644
index f1cc5d86a5..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/GUITestResult.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// GUITestResult.cpp
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/src/GUITestResult.cpp#2 $
-//
-
-
-#include "TestRunnerDlg.h"
-#include "GUITestResult.h"
-
-
-namespace CppUnit {
-
-
-void GUITestResult::addError(Test *test, CppUnitException *e)
-{
- ExclusiveZone zone(_syncObject);
-
- TestResult::addError(test, e);
- _runner->addError(this, test, e);
-}
-
-
-void GUITestResult::addFailure(Test *test, CppUnitException *e)
-{
- ExclusiveZone zone(_syncObject);
-
- TestResult::addFailure(test, e);
- _runner->addFailure(this, test, e);
-}
-
-
-void GUITestResult::startTest(Test *test)
-{
- ExclusiveZone zone(_syncObject);
-
- TestResult::startTest(test);
- _runner->startTest(test);
-}
-
-
-void GUITestResult::endTest(Test *test)
-{
- ExclusiveZone zone(_syncObject);
-
- TestResult::endTest(test);
- _runner->endTest(this, test);
-}
-
-
-} // namespace CppUnit
-
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/GUITestResult.h b/Utilities/Poco/CppUnit/WinTestRunner/src/GUITestResult.h
deleted file mode 100644
index 1a81e88752..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/GUITestResult.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// GUITestResult.h
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/src/GUITestResult.h#2 $
-//
-
-
-#ifndef GuiTestResult_INCLUDED
-#define GuiTestResult_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/TestResult.h"
-#include <afxmt.h>
-
-
-namespace CppUnit {
-
-
-class TestRunnerDlg;
-
-
-class GUITestResult: public TestResult
-{
-public:
- GUITestResult(TestRunnerDlg* runner);
- ~GUITestResult();
-
- void addError(Test* test, CppUnitException* e);
- void addFailure(Test* test, CppUnitException* e);
-
- void startTest(Test* test);
- void endTest(Test* test);
- void stop();
-
-protected:
- class LightweightSynchronizationObject: public TestResult::SynchronizationObject
- {
- public:
- void lock()
- {
- _syncObject.Lock();
- }
-
- void unlock()
- {
- _syncObject.Unlock();
- }
-
- private:
- CCriticalSection _syncObject;
- };
-
-private:
- TestRunnerDlg *_runner;
-};
-
-
-
-// Construct with lightweight synchronization
-inline GUITestResult::GUITestResult(TestRunnerDlg* runner): _runner(runner)
-{
- setSynchronizationObject(new LightweightSynchronizationObject());
-}
-
-
-// Destructor
-inline GUITestResult::~GUITestResult()
-{
-}
-
-
-// Override without protection to prevent deadlock
-inline void GUITestResult::stop()
-{
- _stop = true;
-}
-
-
-} // namespace CppUnit
-
-
-#endif // GuiTestResult_INCLUDED
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/ProgressBar.cpp b/Utilities/Poco/CppUnit/WinTestRunner/src/ProgressBar.cpp
deleted file mode 100644
index 08ab9c1eef..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/ProgressBar.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-//
-// ProgressBar.cpp
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/src/ProgressBar.cpp#1 $
-//
-
-
-#include "ProgressBar.h"
-
-
-namespace CppUnit {
-
-
-// Paint the progress bar in response to a paint message
-void ProgressBar::paint(CDC& dc)
-{
- paintBackground (dc);
- paintStatus (dc);
-}
-
-
-// Paint the background of the progress bar region
-void ProgressBar::paintBackground (CDC& dc)
-{
- CBrush brshBackground;
- CPen penGray (PS_SOLID, 1, RGB (128, 128, 128));
- CPen penWhite (PS_SOLID, 1, RGB (255, 255, 255));
-
- VERIFY (brshBackground.CreateSolidBrush (::GetSysColor (COLOR_BTNFACE)));
-
- dc.FillRect (_bounds, &brshBackground);
-
- CPen *pOldPen;
-
- pOldPen = dc.SelectObject (&penGray);
- {
- dc.MoveTo (_bounds.left, _bounds.top);
- dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top);
-
- dc.MoveTo (_bounds.left, _bounds.top);
- dc.LineTo (_bounds.left, _bounds.top + _bounds.Height () -1);
-
- }
- dc.SelectObject (&penWhite);
- {
- dc.MoveTo (_bounds.left + _bounds.Width () -1, _bounds.top);
- dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top + _bounds.Height () -1);
-
- dc.MoveTo (_bounds.left, _bounds.top + _bounds.Height () -1);
- dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top + _bounds.Height () -1);
-
- }
- dc.SelectObject (pOldPen);
-
-}
-
-
-// Paint the actual status of the progress bar
-void ProgressBar::paintStatus (CDC& dc)
-{
- if (_progress <= 0)
- return;
-
- CBrush brshStatus;
- CRect rect (_bounds.left, _bounds.top,
- _bounds.left + _progressX, _bounds.bottom);
-
- COLORREF statusColor = getStatusColor ();
-
- VERIFY (brshStatus.CreateSolidBrush (statusColor));
-
- rect.DeflateRect (1, 1);
- dc.FillRect (rect, &brshStatus);
-
-}
-
-
-// Paint the current step
-void ProgressBar::paintStep (int startX, int endX)
-{
- // kludge: painting the whole region on each step
- _baseWindow->RedrawWindow (_bounds);
- _baseWindow->UpdateWindow ();
-
-}
-
-
-// Setup the progress bar for execution over a total number of steps
-void ProgressBar::start (int total)
-{
- _total = total;
- reset ();
-}
-
-
-// Take one step, indicating whether it was a successful step
-void ProgressBar::step (bool successful)
-{
- _progress++;
-
- int x = _progressX;
-
- _progressX = scale (_progress);
-
- if (!_error && !successful)
- {
- _error = true;
- x = 1;
- }
-
- paintStep (x, _progressX);
-
-}
-
-
-// Map from steps to display units
-int ProgressBar::scale (int value)
-{
- if (_total > 0)
- return max (1, value * (_bounds.Width () - 1) / _total);
-
- return value;
-
-}
-
-
-// Reset the progress bar
-void ProgressBar::reset ()
-{
- _progressX = 1;
- _progress = 0;
- _error = false;
-
- _baseWindow->RedrawWindow (_bounds);
- _baseWindow->UpdateWindow ();
-
-}
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/ProgressBar.h b/Utilities/Poco/CppUnit/WinTestRunner/src/ProgressBar.h
deleted file mode 100644
index 88b2a0d268..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/ProgressBar.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// ProgressBar.h
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/src/ProgressBar.h#1 $
-//
-
-
-#ifndef ProgressBar_INCLUDED
-#define ProgressBar_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include <afxwin.h>
-
-
-namespace CppUnit {
-
-
-/* A Simple ProgressBar for test execution display
- */
-class ProgressBar
-{
-public:
- ProgressBar(CWnd* baseWindow, CRect& bounds);
-
- void step(bool successful);
- void paint(CDC& dc);
- int scale(int value);
- void reset();
- void start(int total);
-
-protected:
- void paintBackground(CDC& dc);
- void paintStatus(CDC& dc);
- COLORREF getStatusColor();
- void paintStep(int startX, int endX);
-
- CWnd* _baseWindow;
- CRect _bounds;
-
- bool _error;
- int _total;
- int _progress;
- int _progressX;
-};
-
-
-// Construct a ProgressBar
-inline ProgressBar::ProgressBar(CWnd* baseWindow, CRect& bounds):
- _baseWindow(baseWindow),
- _bounds(bounds),
- _error(false),
- _total(0),
- _progress(0),
- _progressX(0)
-{
- WINDOWINFO wi;
- wi.cbSize = sizeof(WINDOWINFO);
- baseWindow->GetWindowInfo(&wi);
- _bounds.OffsetRect(-wi.rcClient.left, -wi.rcClient.top);
-}
-
-
-// Get the current color
-inline COLORREF ProgressBar::getStatusColor()
-{
- return _error ? RGB(255, 0, 0) : RGB(0, 255, 0);
-}
-
-
-} // namespace CppUnit
-
-
-#endif // ProgressBar_INCLUDED
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/SynchronizedTestResult.h b/Utilities/Poco/CppUnit/WinTestRunner/src/SynchronizedTestResult.h
deleted file mode 100644
index 55dc01c55b..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/SynchronizedTestResult.h
+++ /dev/null
@@ -1,106 +0,0 @@
-#ifndef SYNCHRONIZEDTESTRESULTDECORATOR_H
-#define SYNCHRONIZEDTESTRESULTDECORATOR_H
-
-#include <afxmt.h>
-#include "TestResultDecorator.h"
-
-class SynchronizedTestResult : public TestResultDecorator
-{
-public:
- SynchronizedTestResult (TestResult *result);
- ~SynchronizedTestResult ();
-
-
- bool shouldStop ();
- void addError (Test *test, CppUnitException *e);
- void addFailure (Test *test, CppUnitException *e);
- void startTest (Test *test);
- void endTest (Test *test);
- int runTests ();
- int testErrors ();
- int testFailures ();
- bool wasSuccessful ();
- void stop ();
-
- vector<TestFailure *>& errors ();
- vector<TestFailure *>& failures ();
-
-private:
- CCriticalSection m_criticalSection;
-
-};
-
-
-// Constructor
-inline SynchronizedTestResult::SynchronizedTestResult (TestResult *result)
-: TestResultDecorator (result) {}
-
-// Destructor
-inline SynchronizedTestResult::~SynchronizedTestResult ()
-{}
-
-// Returns whether the test should stop
-inline bool SynchronizedTestResult::shouldStop ()
-{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->shouldStop (); }
-
-
-// Adds an error to the list of errors. The passed in exception
-// caused the error
-inline void SynchronizedTestResult::addError (Test *test, CppUnitException *e)
-{ CSingleLock sync (&m_criticalSection, TRUE); m_result->addError (test, e); }
-
-
-// Adds a failure to the list of failures. The passed in exception
-// caused the failure.
-inline void SynchronizedTestResult::addFailure (Test *test, CppUnitException *e)
-{ CSingleLock sync (&m_criticalSection, TRUE); m_result->addFailure (test, e); }
-
-
-// Informs the result that a test will be started.
-inline void SynchronizedTestResult::startTest (Test *test)
-{ CSingleLock sync (&m_criticalSection, TRUE); m_result->startTest (test); }
-
-
-// Informs the result that a test was completed.
-inline void SynchronizedTestResult::endTest (Test *test)
-{ CSingleLock sync (&m_criticalSection, TRUE); m_result->endTest (test); }
-
-
-// Gets the number of run tests.
-inline int SynchronizedTestResult::runTests ()
-{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->runTests (); }
-
-
-// Gets the number of detected errors.
-inline int SynchronizedTestResult::testErrors ()
-{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->testErrors (); }
-
-
-// Gets the number of detected failures.
-inline int SynchronizedTestResult::testFailures ()
-{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->testFailures (); }
-
-
-// Returns whether the entire test was successful or not.
-inline bool SynchronizedTestResult::wasSuccessful ()
-{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->wasSuccessful (); }
-
-
-// Marks that the test run should stop.
-inline void SynchronizedTestResult::stop ()
-{ CSingleLock sync (&m_criticalSection, TRUE); m_result->stop (); }
-
-
-// Returns a vector of the errors.
-inline vector<TestFailure *>& SynchronizedTestResult::errors ()
-{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->errors (); }
-
-
-// Returns a vector of the failures.
-inline vector<TestFailure *>& SynchronizedTestResult::failures ()
-{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->failures (); }
-
-
-#endif
-
-
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/TestResultDecorator.h b/Utilities/Poco/CppUnit/WinTestRunner/src/TestResultDecorator.h
deleted file mode 100644
index 33ed48db00..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/TestResultDecorator.h
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef CPP_UNIT_TESTRESULTDECORATOR_H
-#define CPP_UNIT_TESTRESULTDECORATOR_H
-
-#include "TestResult.h"
-
-class TestResultDecorator
-{
-public:
- TestResultDecorator (TestResult *result);
- virtual ~TestResultDecorator ();
-
-
- virtual bool shouldStop ();
- virtual void addError (Test *test, CppUnitException *e);
- virtual void addFailure (Test *test, CppUnitException *e);
- virtual void startTest (Test *test);
- virtual void endTest (Test *test);
- virtual int runTests ();
- virtual int testErrors ();
- virtual int testFailures ();
- virtual bool wasSuccessful ();
- virtual void stop ();
-
- vector<TestFailure *>& errors ();
- vector<TestFailure *>& failures ();
-
-protected:
- TestResult *m_result;
-};
-
-
-inline TestResultDecorator::TestResultDecorator (TestResult *result)
-: m_result (result) {}
-
-inline TestResultDecorator::~TestResultDecorator ()
-{}
-
-// Returns whether the test should stop
-inline bool TestResultDecorator::shouldStop ()
-{ return m_result->shouldStop (); }
-
-
-// Adds an error to the list of errors. The passed in exception
-// caused the error
-inline void TestResultDecorator::addError (Test *test, CppUnitException *e)
-{ m_result->addError (test, e); }
-
-
-// Adds a failure to the list of failures. The passed in exception
-// caused the failure.
-inline void TestResultDecorator::addFailure (Test *test, CppUnitException *e)
-{ m_result->addFailure (test, e); }
-
-
-// Informs the result that a test will be started.
-inline void TestResultDecorator::startTest (Test *test)
-{ m_result->startTest (test); }
-
-
-// Informs the result that a test was completed.
-inline void TestResultDecorator::endTest (Test *test)
-{ m_result->endTest (test); }
-
-
-// Gets the number of run tests.
-inline int TestResultDecorator::runTests ()
-{ return m_result->runTests (); }
-
-
-// Gets the number of detected errors.
-inline int TestResultDecorator::testErrors ()
-{ return m_result->testErrors (); }
-
-
-// Gets the number of detected failures.
-inline int TestResultDecorator::testFailures ()
-{ return m_result->testFailures (); }
-
-
-// Returns whether the entire test was successful or not.
-inline bool TestResultDecorator::wasSuccessful ()
-{ return m_result->wasSuccessful (); }
-
-
-// Marks that the test run should stop.
-inline void TestResultDecorator::stop ()
-{ m_result->stop (); }
-
-
-// Returns a vector of the errors.
-inline vector<TestFailure *>& TestResultDecorator::errors ()
-{ return m_result->errors (); }
-
-
-// Returns a vector of the failures.
-inline vector<TestFailure *>& TestResultDecorator::failures ()
-{ return m_result->failures (); }
-
-
-#endif
-
-
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp b/Utilities/Poco/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp
deleted file mode 100644
index 16fd69628d..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp
+++ /dev/null
@@ -1,439 +0,0 @@
-//
-// TestRunnerDlg.cpp
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp#2 $
-//
-
-
-#include <afxwin.h>
-#include <afxext.h>
-#include <afxcmn.h>
-#include <mmsystem.h>
-#include "TestRunnerDlg.h"
-#include "ActiveTest.h"
-#include "GUITestResult.h"
-#include "ProgressBar.h"
-#include "CppUnit/TestSuite.h"
-#include "TestRunnerDlg.h"
-
-
-namespace CppUnit {
-
-
-TestRunnerDlg::TestRunnerDlg(CWnd* pParent): CDialog(TestRunnerDlg::IDD, pParent)
-{
- //{{AFX_DATA_INIT(TestRunnerDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-
- _testsProgress = 0;
- _selectedTest = 0;
- _currentTest = 0;
-}
-
-
-void TestRunnerDlg::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(TestRunnerDlg)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(TestRunnerDlg, CDialog)
- //{{AFX_MSG_MAP(TestRunnerDlg)
- ON_BN_CLICKED(ID_RUN, OnRun)
- ON_BN_CLICKED(ID_STOP, OnStop)
- ON_CBN_SELCHANGE(IDC_COMBO_TEST, OnSelchangeComboTest)
- ON_BN_CLICKED(IDC_CHK_AUTORUN, OnBnClickedAutorun)
- ON_WM_PAINT()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-BOOL TestRunnerDlg::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
- CComboBox *comboBox = (CComboBox *)GetDlgItem (IDC_COMBO_TEST);
-
- ASSERT (listCtrl);
- ASSERT (comboBox);
-
- CString title;
- GetWindowText(title);
-#if defined(_DEBUG)
- title.Append(" [debug]");
-#else
- title.Append(" [release]");
-#endif
- SetWindowText(title);
-
- listCtrl->InsertColumn (0,"Type", LVCFMT_LEFT, 16 + listCtrl->GetStringWidth ("Type"), 1);
- listCtrl->InsertColumn (1,"Name", LVCFMT_LEFT, 16 * listCtrl->GetStringWidth ("X"), 2);
- listCtrl->InsertColumn (2,"Failed Condition", LVCFMT_LEFT, 24 * listCtrl->GetStringWidth ("M"), 3);
- listCtrl->InsertColumn (3,"Line", LVCFMT_LEFT, 16 + listCtrl->GetStringWidth ("0000"), 4);
- listCtrl->InsertColumn (4,"File Name", LVCFMT_LEFT, 36 * listCtrl->GetStringWidth ("M"), 5);
-
- int numberOfCases = 0;
-
- CWinApp* pApp = AfxGetApp();
- CString lastTestCS = pApp->GetProfileString("Tests", "lastTest");
- std::string lastTest((LPCSTR) lastTestCS);
- int sel = -1;
- for (std::vector<TestInfo>::iterator it = _tests.begin (); it != _tests.end (); ++it)
- {
- std::string cbName(it->level*4, ' ');
- cbName.append(it->pTest->toString());
- comboBox->AddString (cbName.c_str ());
- if (sel < 0)
- {
- if (lastTest.empty() || lastTest == it->pTest->toString())
- {
- _selectedTest = it->pTest;
- sel = numberOfCases;
- }
- }
- numberOfCases++;
- }
-
- if (numberOfCases > 0)
- {
- if (sel < 0)
- {
- _selectedTest = _tests[0].pTest;
- sel = 0;
- }
- comboBox->SetCurSel (sel);
- }
- else
- {
- beRunDisabled ();
- }
- CWnd *pProgress = GetDlgItem(IDC_PROGRESS);
- CRect rect;
- pProgress->GetWindowRect(&rect);
- _testsProgress = new ProgressBar (this, rect);
-
- CButton* autoRunBtn = (CButton*) GetDlgItem(IDC_CHK_AUTORUN);
- autoRunBtn->SetCheck(pApp->GetProfileInt("Tests", "autoRun", BST_UNCHECKED));
-
- reset ();
-
- if (autoRunBtn->GetCheck() == BST_CHECKED)
- {
- OnRun();
- }
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-
-TestRunnerDlg::~TestRunnerDlg ()
-{
- freeState ();
- delete _testsProgress;
-}
-
-
-void TestRunnerDlg::OnRun()
-{
- if (_selectedTest == 0)
- return;
-
- freeState ();
- reset ();
-
- beRunning ();
-
- int numberOfTests = _selectedTest->countTestCases ();
-
- _testsProgress->start (numberOfTests);
-
- _result = new GUITestResult ((TestRunnerDlg *)this);
- _activeTest = new ActiveTest (_selectedTest);
-
- _testStartTime = timeGetTime ();
-
- _activeTest->run (_result);
-
- _testEndTime = timeGetTime ();
-
-}
-
-
-void TestRunnerDlg::addListEntry(const std::string& type, TestResult *result, Test *test, CppUnitException *e)
-{
- char stage [80];
- LV_ITEM lvi;
- CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
- int currentEntry = result->testErrors () + result->testFailures () -1;
-
- sprintf (stage, "%s", type.c_str ());
-
- lvi.mask = LVIF_TEXT;
- lvi.iItem = currentEntry;
- lvi.iSubItem = 0;
- lvi.pszText = stage;
- lvi.iImage = 0;
- lvi.stateMask = 0;
- lvi.state = 0;
-
- listCtrl->InsertItem (&lvi);
-
- // Set class string
- listCtrl->SetItemText (currentEntry, 1, test->toString ().c_str ());
-
- // Set the asserted text
- listCtrl->SetItemText(currentEntry, 2, e->what ());
-
- // Set the line number
- if (e->lineNumber () == CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
- sprintf (stage, "<unknown>");
- else
- sprintf (stage, "%ld", e->lineNumber ());
-
- listCtrl->SetItemText(currentEntry, 3, stage);
-
- // Set the file name
- listCtrl->SetItemText(currentEntry, 4, e->fileName ().c_str ());
-
- listCtrl->RedrawItems (currentEntry, currentEntry);
- listCtrl->UpdateWindow ();
-
-}
-
-
-void TestRunnerDlg::addError (TestResult *result, Test *test, CppUnitException *e)
-{
- addListEntry ("Error", result, test, e);
- _errors++;
-
- _currentTest = 0;
- updateCountsDisplay ();
-
-}
-
-
-void TestRunnerDlg::addFailure (TestResult *result, Test *test, CppUnitException *e)
-{
- addListEntry ("Failure", result, test, e);
- _failures++;
-
- _currentTest = 0;
- updateCountsDisplay ();
-
-}
-
-
-void TestRunnerDlg::startTest(Test* test)
-{
- _currentTest = test;
- updateCountsDisplay();
-}
-
-
-void TestRunnerDlg::endTest (TestResult *result, Test *test)
-{
- if (_selectedTest == 0)
- return;
- _currentTest = 0;
-
- _testsRun++;
- updateCountsDisplay ();
- _testsProgress->step (_failures == 0 && _errors == 0);
-
- _testEndTime = timeGetTime ();
-
- updateCountsDisplay ();
-
- if (_testsRun >= _selectedTest->countTestCases ())
- beIdle ();
-}
-
-
-void TestRunnerDlg::beRunning ()
-{
- CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
- CButton *closeButton = (CButton *)GetDlgItem (IDOK);
-
- runButton->EnableWindow (FALSE);
- closeButton->EnableWindow (FALSE);
-
-}
-
-
-void TestRunnerDlg::beIdle ()
-{
- CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
- CButton *closeButton = (CButton *)GetDlgItem (IDOK);
-
- runButton->EnableWindow (TRUE);
- closeButton->EnableWindow (TRUE);
-
-}
-
-
-void TestRunnerDlg::beRunDisabled ()
-{
- CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
- CButton *closeButton = (CButton *)GetDlgItem (IDOK);
- CButton *stopButton = (CButton *)GetDlgItem (ID_STOP);
-
- runButton->EnableWindow (FALSE);
- stopButton->EnableWindow (FALSE);
- closeButton->EnableWindow (TRUE);
-
-}
-
-
-void TestRunnerDlg::freeState ()
-{
- delete _activeTest;
- delete _result;
-
-}
-
-
-void TestRunnerDlg::reset ()
-{
- _testsRun = 0;
- _errors = 0;
- _failures = 0;
- _testEndTime = _testStartTime;
-
- updateCountsDisplay ();
-
- _activeTest = 0;
- _result = 0;
-
- CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
-
- listCtrl->DeleteAllItems ();
- _testsProgress->reset ();
-
-}
-
-
-void TestRunnerDlg::updateCountsDisplay ()
-{
- CStatic *statTestsRun = (CStatic *)GetDlgItem (IDC_STATIC_RUNS);
- CStatic *statErrors = (CStatic *)GetDlgItem (IDC_STATIC_ERRORS);
- CStatic *statFailures = (CStatic *)GetDlgItem (IDC_STATIC_FAILURES);
- CEdit *editTime = (CEdit *)GetDlgItem (IDC_EDIT_TIME);
-
- CString argumentString;
-
- argumentString.Format ("%d", _testsRun);
- statTestsRun ->SetWindowText (argumentString);
-
- argumentString.Format ("%d", _errors);
- statErrors ->SetWindowText (argumentString);
-
- argumentString.Format ("%d", _failures);
- statFailures ->SetWindowText (argumentString);
-
- if (_currentTest)
- argumentString.Format ("Execution Time: %3.3lf seconds, Current Test: %s", (_testEndTime - _testStartTime) / 1000.0, _currentTest->toString().c_str());
- else
- argumentString.Format ("Execution Time: %3.3lf seconds", (_testEndTime - _testStartTime) / 1000.0);
-
- editTime ->SetWindowText (argumentString);
-
-
-}
-
-
-void TestRunnerDlg::OnStop()
-{
- if (_result)
- _result->stop ();
-
- beIdle ();
-
-}
-
-
-void TestRunnerDlg::OnOK()
-{
- if (_result)
- _result->stop ();
-
- CDialog::OnOK ();
-}
-
-
-void TestRunnerDlg::OnSelchangeComboTest()
-{
- CComboBox *testsSelection = (CComboBox *)GetDlgItem (IDC_COMBO_TEST);
-
- int currentSelection = testsSelection->GetCurSel ();
-
- if (currentSelection >= 0 && currentSelection < _tests.size ())
- {
- _selectedTest = (_tests.begin () + currentSelection)->pTest;
- beIdle ();
- CWinApp* pApp = AfxGetApp();
- pApp->WriteProfileString("Tests", "lastTest", _selectedTest->toString().c_str());
- }
- else
- {
- _selectedTest = 0;
- beRunDisabled ();
-
- }
-
- freeState ();
- reset ();
-
-}
-
-
-void TestRunnerDlg::OnBnClickedAutorun()
-{
- CButton *autoRunBtn = (CButton *)GetDlgItem (IDC_CHK_AUTORUN);
- CWinApp* pApp = AfxGetApp();
- pApp->WriteProfileInt("Tests", "autoRun", autoRunBtn->GetCheck());
-}
-
-
-void TestRunnerDlg::OnPaint()
-{
- CPaintDC dc (this);
-
- _testsProgress->paint (dc);
-}
-
-
-void TestRunnerDlg::setTests(const std::vector<Test*>& tests)
-{
- _tests.clear();
- for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
- {
- addTest(*it, 0);
- }
-}
-
-
-void TestRunnerDlg::addTest(Test* pTest, int level)
-{
- TestInfo ti;
- ti.pTest = pTest;
- ti.level = level;
- _tests.push_back(ti);
- TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
- if (pSuite)
- {
- const std::vector<Test*>& tests = pSuite->tests();
- for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
- {
- addTest(*it, level + 1);
- }
- }
-}
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/TestRunnerDlg.h b/Utilities/Poco/CppUnit/WinTestRunner/src/TestRunnerDlg.h
deleted file mode 100644
index 4aab977046..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/TestRunnerDlg.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// TestRunnerDlg.h
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/src/TestRunnerDlg.h#2 $
-//
-
-
-#ifndef TestRunnerDlg_INCLUDED
-#define TestRunnerDlg_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/CppUnitException.h"
-#include "ActiveTest.h"
-#include <vector>
-#include "../res/Resource.h"
-#include <afxwin.h>
-#include "afxwin.h"
-
-
-namespace CppUnit {
-
-
-class ProgressBar;
-
-
-class TestRunnerDlg: public CDialog
-{
-public:
- TestRunnerDlg(CWnd* pParent = NULL);
- ~TestRunnerDlg();
-
- void setTests(const std::vector<Test*>& tests);
-
- void addError(TestResult* result, Test* test, CppUnitException* e);
- void addFailure(TestResult* result, Test* test, CppUnitException* e);
- void startTest(Test* test);
- void endTest(TestResult* result, Test* test);
-
- //{{AFX_DATA(TestRunnerDlg)
- enum { IDD = IDD_DIALOG_TESTRUNNER };
- // NOTE: the ClassWizard will add data members here
- //}}AFX_DATA
-
- //{{AFX_VIRTUAL(TestRunnerDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-protected:
- //{{AFX_MSG(TestRunnerDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnRun();
- afx_msg void OnStop();
- virtual void OnOK();
- afx_msg void OnSelchangeComboTest();
- afx_msg void OnBnClickedAutorun();
- afx_msg void OnPaint();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- void addListEntry(const std::string& type, TestResult* result, Test* test, CppUnitException* e);
- void beIdle();
- void beRunning();
- void beRunDisabled();
- void reset();
- void freeState();
- void updateCountsDisplay();
- void addTest(Test* pTest, int level);
-
- struct TestInfo
- {
- Test* pTest;
- int level;
- };
- std::vector<TestInfo> _tests;
- ProgressBar* _testsProgress;
- Test* _selectedTest;
- ActiveTest* _activeTest;
- TestResult* _result;
- int _testsRun;
- int _errors;
- int _failures;
- DWORD _testStartTime;
- DWORD _testEndTime;
- Test* _currentTest;
-};
-
-
-} // namespace CppUnit
-
-
-#endif // TestRunnerDlg_INCLUDED
-
diff --git a/Utilities/Poco/CppUnit/WinTestRunner/src/WinTestRunner.cpp b/Utilities/Poco/CppUnit/WinTestRunner/src/WinTestRunner.cpp
deleted file mode 100644
index 2cce333810..0000000000
--- a/Utilities/Poco/CppUnit/WinTestRunner/src/WinTestRunner.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// WinTestRunner.cpp
-//
-// $Id: //poco/1.3/CppUnit/WinTestRunner/src/WinTestRunner.cpp#2 $
-//
-
-
-#include "WinTestRunner/WinTestRunner.h"
-#include "TestRunnerDlg.h"
-#include "CppUnit/TestRunner.h"
-#include <fstream>
-
-
-namespace CppUnit {
-
-
-WinTestRunner::WinTestRunner()
-{
-}
-
-
-WinTestRunner::~WinTestRunner()
-{
- for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
- delete *it;
-}
-
-
-void WinTestRunner::run()
-{
- // Note: The following code is some evil hack to
- // add batch capability to the MFC based WinTestRunner.
-
- std::string cmdLine(AfxGetApp()->m_lpCmdLine);
- if (cmdLine.size() >= 2 && cmdLine[0] == '/' && (cmdLine[1] == 'b' || cmdLine[1] == 'B'))
- {
- // We're running in batch mode.
- std::string outPath;
- if (cmdLine.size() > 4 && cmdLine[2] == ':')
- outPath = cmdLine.substr(3);
- else
- outPath = "CON";
- std::ofstream ostr(outPath.c_str());
- if (ostr.good())
- {
- TestRunner runner(ostr);
- for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
- runner.addTest((*it)->toString(), *it);
- _tests.clear();
- std::vector<std::string> args;
- args.push_back("WinTestRunner");
- args.push_back("-all");
- bool success = runner.run(args);
- ExitProcess(success ? 0 : 1);
- }
- else ExitProcess(2);
- }
- else
- {
- // We're running in interactive mode.
- TestRunnerDlg dlg;
- dlg.setTests(_tests);
- dlg.DoModal();
- }
-}
-
-
-void WinTestRunner::addTest(Test* pTest)
-{
- _tests.push_back(pTest);
-}
-
-
-BEGIN_MESSAGE_MAP(WinTestRunnerApp, CWinApp)
-END_MESSAGE_MAP()
-
-
-BOOL WinTestRunnerApp::InitInstance()
-{
- AllocConsole();
- SetConsoleTitle("CppUnit WinTestRunner Console");
- freopen("CONOUT$", "w", stdout);
- freopen("CONOUT$", "w", stderr);
- freopen("CONIN$", "r", stdin);
- TestMain();
- FreeConsole();
- return FALSE;
-}
-
-
-void WinTestRunnerApp::TestMain()
-{
-}
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/CppUnit.h b/Utilities/Poco/CppUnit/include/CppUnit/CppUnit.h
deleted file mode 100755
index 27a219c17c..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/CppUnit.h
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// CppUnit.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_CppUnit_INCLUDED
-#define CppUnit_CppUnit_INCLUDED
-
-
-//
-// Ensure that POCO_DLL is default unless POCO_STATIC is defined
-//
-#if defined(_WIN32) && defined(_DLL)
- #if !defined(POCO_DLL) && !defined(POCO_STATIC)
- #define POCO_DLL
- #endif
-#endif
-
-
-//
-// The following block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the CppUnit_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// CppUnit_API functions as being imported from a DLL, wheras this DLL sees symbols
-// defined with this macro as being exported.
-//
-#if defined(_WIN32) && defined(POCO_DLL)
- #if defined(CppUnit_EXPORTS)
- #define CppUnit_API __declspec(dllexport)
- #else
- #define CppUnit_API __declspec(dllimport)
- #endif
-#endif
-
-
-#if !defined(CppUnit_API)
- #define CppUnit_API
-#endif
-
-
-// Turn off some annoying warnings
-#ifdef _MSC_VER
- #pragma warning(disable:4786) // identifier truncation warning
- #pragma warning(disable:4503) // decorated name length exceeded - mainly a problem with STLPort
- #pragma warning(disable:4018) // signed/unsigned comparison
- #pragma warning(disable:4284) // return type for operator -> is not UDT
- #pragma warning(disable:4251) // ... needs to have dll-interface warning
- #pragma warning(disable:4273)
- #pragma warning(disable:4275) // ... non dll-interface class used as base for dll-interface class
-#endif
-
-
-#endif // CppUnit_CppUnit_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/CppUnitException.h b/Utilities/Poco/CppUnit/include/CppUnit/CppUnitException.h
deleted file mode 100755
index 30cdaf2b13..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/CppUnitException.h
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// CppUnitException.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_CppUnitException_INCLUDED
-#define CppUnit_CppUnitException_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include <exception>
-#include <string>
-
-
-namespace CppUnit {
-
-
-class CppUnit_API CppUnitException: public std::exception
- /// CppUnitException is an exception that serves
- /// descriptive strings through its what() method
-{
-public:
- CppUnitException(const std::string& message = "",
- long lineNumber = CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CPPUNIT_UNKNOWNFILENAME);
- CppUnitException(const std::string& message,
- long lineNumber,
- long data1lineNumber,
- const std::string& fileName);
- CppUnitException(const std::string& message,
- long lineNumber,
- long data1lineNumber,
- long data2lineNumber,
- const std::string& fileName);
- CppUnitException(const CppUnitException& other);
- virtual ~CppUnitException() throw();
-
- CppUnitException& operator = (const CppUnitException& other);
-
- const char* what() const throw ();
-
- long lineNumber() const;
- long data1LineNumber() const;
- long data2LineNumber() const;
- const std::string& fileName() const;
-
- static const std::string CPPUNIT_UNKNOWNFILENAME;
- static const int CPPUNIT_UNKNOWNLINENUMBER;
-
-private:
- std::string _message;
- long _lineNumber;
- long _data1lineNumber;
- long _data2lineNumber;
- std::string _fileName;
-};
-
-
-inline CppUnitException::CppUnitException(const CppUnitException& other): exception (other)
-{
- _message = other._message;
- _lineNumber = other._lineNumber;
- _data1lineNumber = other._data1lineNumber;
- _data2lineNumber = other._data2lineNumber;
- _fileName = other._fileName;
-}
-
-
-inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(fileName)
-{
-}
-
-
-inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, long data1lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(fileName)
-{
-}
-
-
-inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, long data1lineNumber, long data2lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(data2lineNumber), _fileName(fileName)
-{
-}
-
-
-inline CppUnitException::~CppUnitException () throw()
-{
-}
-
-
-inline CppUnitException& CppUnitException::operator = (const CppUnitException& other)
-{
- exception::operator= (other);
-
- if (&other != this)
- {
- _message = other._message;
- _lineNumber = other._lineNumber;
- _data1lineNumber = other._data1lineNumber;
- _data2lineNumber = other._data2lineNumber;
- _fileName = other._fileName;
- }
- return *this;
-}
-
-
-inline const char* CppUnitException::what() const throw ()
-{
- return _message.c_str();
-}
-
-
-inline long CppUnitException::lineNumber() const
-{
- return _lineNumber;
-}
-
-
-inline long CppUnitException::data1LineNumber() const
-{
- return _data1lineNumber;
-}
-
-
-inline long CppUnitException::data2LineNumber() const
-{
- return _data2lineNumber;
-}
-
-
-// The file in which the error occurred
-inline const std::string& CppUnitException::fileName() const
-{
- return _fileName;
-}
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_CppUnitException_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/Guards.h b/Utilities/Poco/CppUnit/include/CppUnit/Guards.h
deleted file mode 100755
index a7fd120373..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/Guards.h
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// Guards.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_Guards_INCLUDED
-#define CppUnit_Guards_INCLUDED
-
-
-// Prevent copy construction and assignment for a class
-#define REFERENCEOBJECT(className) \
-private: \
- className(const className& other); \
- className& operator = (const className& other);
-
-
-#endif // CppUnit_Guards_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/Orthodox.h b/Utilities/Poco/CppUnit/include/CppUnit/Orthodox.h
deleted file mode 100755
index 4ce4b42af6..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/Orthodox.h
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// Orthodox.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_Orthodox_INCLUDED
-#define CppUnit_Orthodox_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/TestCase.h"
-
-
-namespace CppUnit {
-
-
-/*
- * Orthodox performs a simple set of tests on an arbitary
- * class to make sure that it supports at least the
- * following operations:
- *
- * default construction - constructor
- * equality/inequality - operator== && operator!=
- * assignment - operator=
- * negation - operator!
- * safe passage - copy construction
- *
- * If operations for each of these are not declared
- * the template will not instantiate. If it does
- * instantiate, tests are performed to make sure
- * that the operations have correct semantics.
- *
- * Adding an orthodox test to a suite is very
- * easy:
- *
- * public: Test *suite () {
- * TestSuite *suiteOfTests = new TestSuite;
- * suiteOfTests->addTest (new ComplexNumberTest ("testAdd");
- * suiteOfTests->addTest (new TestCaller<Orthodox<Complex> > ());
- * return suiteOfTests;
- * }
- *
- * Templated test cases be very useful when you are want to
- * make sure that a group of classes have the same form.
- *
- * see TestSuite
- */
-template <class ClassUnderTest>
-class Orthodox: public TestCase
-{
-public:
- Orthodox(): TestCase("Orthodox")
- {
- }
-
-protected:
- ClassUnderTest call(ClassUnderTest object);
- void runTest ();
-};
-
-
-// Run an orthodoxy test
-template <class ClassUnderTest>
-void Orthodox<ClassUnderTest>::runTest()
-{
- // make sure we have a default constructor
- ClassUnderTest a, b, c;
-
- // make sure we have an equality operator
- assert (a == b);
-
- // check the inverse
- b.operator= (a.operator! ());
- assert (a != b);
-
- // double inversion
- b = !!a;
- assert (a == b);
-
- // invert again
- b = !a;
-
- // check calls
- c = a;
- assert (c == call (a));
-
- c = b;
- assert (c == call (b));
-}
-
-
-// Exercise a call
-template <class ClassUnderTest>
-ClassUnderTest Orthodox<ClassUnderTest>::call(ClassUnderTest object)
-{
- return object;
-}
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_Orthodox_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/RepeatedTest.h b/Utilities/Poco/CppUnit/include/CppUnit/RepeatedTest.h
deleted file mode 100755
index 7083996d3a..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/RepeatedTest.h
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// RepeatedTest.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_RepeatedTest_INCLUDED
-#define CppUnit_RepeatedTest_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/Guards.h"
-#include "CppUnit/TestDecorator.h"
-
-
-namespace CppUnit {
-
-
-class Test;
-class TestResult;
-
-
-/*
- * A decorator that runs a test repeatedly.
- * Does not assume ownership of the test it decorates
- *
- */
-class CppUnit_API RepeatedTest: public TestDecorator
-{
- REFERENCEOBJECT (RepeatedTest)
-
-public:
- RepeatedTest(Test* test, int timesRepeat): TestDecorator (test), _timesRepeat (timesRepeat)
- {
- }
-
- int countTestCases();
- std::string toString();
- void run(TestResult *result);
-
-private:
- const int _timesRepeat;
-};
-
-
-// Counts the number of test cases that will be run by this test.
-inline RepeatedTest::countTestCases ()
-{
- return TestDecorator::countTestCases() * _timesRepeat;
-}
-
-
-// Returns the name of the test instance.
-inline std::string RepeatedTest::toString()
-{
- return TestDecorator::toString() + " (repeated)";
-}
-
-
-// Runs a repeated test
-inline void RepeatedTest::run(TestResult *result)
-{
- for (int n = 0; n < _timesRepeat; n++)
- {
- if (result->shouldStop())
- break;
-
- TestDecorator::run(result);
- }
-}
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_RepeatedTest_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/Test.h b/Utilities/Poco/CppUnit/include/CppUnit/Test.h
deleted file mode 100755
index bf2c263bd4..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/Test.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// Test.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_Test_INCLUDED
-#define CppUnit_Test_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include <string>
-
-
-namespace CppUnit {
-
-
-class TestResult;
-
-
-/*
- * A Test can be run and collect its results.
- * See TestResult.
- *
- */
-class CppUnit_API Test
-{
-public:
- virtual ~Test() = 0;
- virtual void run(TestResult* result) = 0;
- virtual int countTestCases() = 0;
- virtual std::string toString() = 0;
-};
-
-
-inline Test::~Test()
-{
-}
-
-
-// Runs a test and collects its result in a TestResult instance.
-inline void Test::run(TestResult * /*result*/)
-{
-}
-
-
-// Counts the number of test cases that will be run by this test.
-inline int Test::countTestCases()
-{
- return 0;
-}
-
-
-// Returns the name of the test instance.
-inline std::string Test::toString()
-{
- return "";
-}
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_Test_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/TestCaller.h b/Utilities/Poco/CppUnit/include/CppUnit/TestCaller.h
deleted file mode 100755
index 1de91796ac..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/TestCaller.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// TestCaller.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_TestCaller_INCLUDED
-#define CppUnit_TestCaller_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "Guards.h"
-#include "TestCase.h"
-#include <memory>
-
-
-namespace CppUnit {
-
-
-/*
- * A test caller provides access to a test case method
- * on a test case class. Test callers are useful when
- * you want to run an individual test or add it to a
- * suite.
- *
- * Here is an example:
- *
- * class MathTest : public TestCase {
- * ...
- * public:
- * void setUp ();
- * void tearDown ();
- *
- * void testAdd ();
- * void testSubtract ();
- * };
- *
- * Test *MathTest::suite () {
- * TestSuite *suite = new TestSuite;
- *
- * suite->addTest (new TestCaller<MathTest> ("testAdd", testAdd));
- * return suite;
- * }
- *
- * You can use a TestCaller to bind any test method on a TestCase
- * class, as long as it returns accepts void and returns void.
- *
- * See TestCase
- */
-template <class Fixture>
-class TestCaller: public TestCase
-{
- REFERENCEOBJECT (TestCaller)
-
- typedef void (Fixture::*TestMethod)();
-
-public:
- TestCaller(const std::string& name, TestMethod test):
- TestCase(name),
- _test(test),
- _fixture(new Fixture(name))
- {
- }
-
-protected:
- void runTest()
- {
- (_fixture.get()->*_test)();
- }
-
- void setUp()
- {
- _fixture.get()->setUp();
- }
-
- void tearDown()
- {
- _fixture.get()->tearDown();
- }
-
-private:
- TestMethod _test;
- std::auto_ptr<Fixture> _fixture;
-};
-
-
-} // namespace CppUnit
-
-
-#define CppUnit_addTest(suite, cls, mth) \
- suite->addTest(new CppUnit::TestCaller<cls>(#mth, &cls::mth))
-
-
-#endif // CppUnit_TestCaller_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/TestCase.h b/Utilities/Poco/CppUnit/include/CppUnit/TestCase.h
deleted file mode 100755
index ebfa659b96..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/TestCase.h
+++ /dev/null
@@ -1,249 +0,0 @@
-//
-// TestCase.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_TestCase_INCLUDED
-#define CppUnit_TestCase_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/Guards.h"
-#include "CppUnit/Test.h"
-#include "CppUnit/CppUnitException.h"
-#include <string>
-#include <typeinfo>
-
-
-namespace CppUnit {
-
-
-class TestResult;
-
-
-/*
- * A test case defines the fixture to run multiple tests. To define a test case
- * 1) implement a subclass of TestCase
- * 2) define instance variables that store the state of the fixture
- * 3) initialize the fixture state by overriding setUp
- * 4) clean-up after a test by overriding tearDown.
- *
- * Each test runs in its own fixture so there
- * can be no side effects among test runs.
- * Here is an example:
- *
- * class MathTest : public TestCase {
- * protected: int m_value1;
- * protected: int m_value2;
- *
- * public: MathTest (std::string name)
- * : TestCase (name) {
- * }
- *
- * protected: void setUp () {
- * m_value1 = 2;
- * m_value2 = 3;
- * }
- * }
- *
- *
- * For each test implement a method which interacts
- * with the fixture. Verify the expected results with assertions specified
- * by calling assert on the expression you want to test:
- *
- * protected: void testAdd () {
- * int result = value1 + value2;
- * assert (result == 5);
- * }
- *
- * Once the methods are defined you can run them. To do this, use
- * a TestCaller.
- *
- * Test *test = new TestCaller<MathTest>("testAdd", MathTest::testAdd);
- * test->run ();
- *
- *
- * The tests to be run can be collected into a TestSuite. CppUnit provides
- * different test runners which can run a test suite and collect the results.
- * The test runners expect a static method suite as the entry
- * point to get a test to run.
- *
- * public: static MathTest::suite () {
- * TestSuite *suiteOfTests = new TestSuite;
- * suiteOfTests->addTest(new TestCaller<MathTest>("testAdd", testAdd));
- * suiteOfTests->addTest(new TestCaller<MathTest>("testDivideByZero", testDivideByZero));
- * return suiteOfTests;
- * }
- *
- * Note that the caller of suite assumes lifetime control
- * for the returned suite.
- *
- * see TestResult, TestSuite and TestCaller
- *
- */
-class CppUnit_API TestCase: public Test
-{
- REFERENCEOBJECT (TestCase)
-
-public:
- TestCase(const std::string& Name);
- ~TestCase();
-
- virtual void run(TestResult* result);
- virtual TestResult* run();
- virtual int countTestCases();
- const std::string& name() const;
- std::string toString();
-
- virtual void setUp();
- virtual void tearDown();
-
-protected:
- virtual void runTest();
- TestResult* defaultResult();
-
- void assertImplementation(bool condition,
- const std::string& conditionExpression = "",
- long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
-
- void loop1assertImplementation(bool condition,
- const std::string& conditionExpression = "",
- long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- long dataLineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
-
- void loop2assertImplementation(bool condition,
- const std::string& conditionExpression = "",
- long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- long data1LineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- long data2LineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
-
- void assertEquals(long expected,
- long actual,
- long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
-
- void assertEquals(double expected,
- double actual,
- double delta,
- long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
-
- void assertEquals(const std::string& expected,
- const std::string& actual,
- long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
-
- void assertEquals(const void* expected,
- const void* actual,
- long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
-
- std::string notEqualsMessage(long expected, long actual);
- std::string notEqualsMessage(double expected, double actual);
- std::string notEqualsMessage(const void* expected, const void* actual);
- std::string notEqualsMessage(const std::string& expected, const std::string& actual);
-
- void assertNotNull(const void* pointer,
- const std::string& pointerExpression = "",
- long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
-
- void assertNull(const void* pointer,
- const std::string& pointerExpression = "",
- long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
-
- void fail(const std::string&message = "",
- long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
- const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
-
-private:
- const std::string _name;
-};
-
-
-// Constructs a test case
-inline TestCase::TestCase(const std::string& name): _name (name)
-{
-}
-
-
-// Destructs a test case
-inline TestCase::~TestCase()
-{
-}
-
-
-// Returns a count of all the tests executed
-inline int TestCase::countTestCases()
-{
- return 1;
-}
-
-
-// Returns the name of the test case
-inline const std::string& TestCase::name() const
-{
- return _name;
-}
-
-
-// A hook for fixture set up
-inline void TestCase::setUp()
-{
-}
-
-
-// A hook for fixture tear down
-inline void TestCase::tearDown()
-{
-}
-
-
-// Returns the name of the test case instance
-inline std::string TestCase::toString()
-{
- const std::type_info& thisClass = typeid(*this);
- return std::string(thisClass.name()) + "." + name();
-}
-
-
-// A set of macros which allow us to get the line number
-// and file name at the point of an error.
-// Just goes to show that preprocessors do have some
-// redeeming qualities.
-#undef assert
-#define assert(condition) \
- (this->assertImplementation((condition), (#condition), __LINE__, __FILE__))
-
-#define loop_1_assert(data1line, condition) \
- (this->loop1assertImplementation((condition), (#condition), __LINE__, data1line, __FILE__))
-
-#define loop_2_assert(data1line, data2line, condition) \
- (this->loop2assertImplementation((condition), (#condition), __LINE__, data1line, data2line, __FILE__))
-
-#define assertEqualDelta(expected, actual, delta) \
- (this->assertEquals((expected), (actual), (delta), __LINE__, __FILE__))
-
-#define assertEqual(expected, actual) \
- (this->assertEquals((expected), (actual), __LINE__, __FILE__))
-
-#define assertNullPtr(ptr) \
- (this->assertNull((ptr), #ptr, __LINE__, __FILE__))
-
-#define assertNotNullPtr(ptr) \
- (this->assertNotNull((ptr), #ptr, __LINE__, __FILE__))
-
-#define failmsg(msg) \
- (this->fail(msg, __LINE__, __FILE__))
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_TestCase_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/TestDecorator.h b/Utilities/Poco/CppUnit/include/CppUnit/TestDecorator.h
deleted file mode 100755
index 017401a4e9..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/TestDecorator.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// TestDecorator.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_TestDecorator_INCLUDED
-#define CppUnit_TestDecorator_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/Guards.h"
-#include "CppUnit/Test.h"
-
-
-namespace CppUnit {
-
-
-class TestResult;
-
-
-/*
- * A Decorator for Tests
- *
- * Does not assume ownership of the test it decorates
- *
- */
-class CppUnit_API TestDecorator: public Test
-{
- REFERENCEOBJECT(TestDecorator)
-
-public:
- TestDecorator(Test* test);
-
- virtual ~TestDecorator();
-
- int countTestCases();
-
- void run(TestResult* result);
-
- std::string toString();
-
-protected:
- Test* _test;
-};
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_TestDecorator_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/TestFailure.h b/Utilities/Poco/CppUnit/include/CppUnit/TestFailure.h
deleted file mode 100755
index 072a004021..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/TestFailure.h
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// TestFailure.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_TestFailure_INCLUDED
-#define CppUnit_TestFailure_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/CppUnitException.h"
-#include "CppUnit/Guards.h"
-
-
-namespace CppUnit {
-
-
-class Test;
-
-
-/*
- * A TestFailure collects a failed test together with
- * the caught exception.
- *
- * TestFailure assumes lifetime control for any exception
- * passed to it. The lifetime of tests is handled by
- * their TestSuite (if they have been added to one) or
- * whomever creates them.
- *
- * see TestResult
- * see TestSuite
- *
- */
-class CppUnit_API TestFailure
-{
- REFERENCEOBJECT (TestFailure)
-
-public:
- TestFailure(Test* failedTest, CppUnitException* thrownException);
- ~TestFailure();
-
- Test* failedTest();
- CppUnitException* thrownException();
- std::string toString();
-
-protected:
- Test* _failedTest;
- CppUnitException *_thrownException;
-};
-
-
-// Constructs a TestFailure with the given test and exception.
-inline TestFailure::TestFailure(Test* failedTest, CppUnitException* thrownException): _failedTest(failedTest), _thrownException(thrownException)
-{
-}
-
-
-// Deletes the owned exception.
-inline TestFailure::~TestFailure()
-{
- delete _thrownException;
-}
-
-
-// Gets the failed test.
-inline Test* TestFailure::failedTest()
-{
- return _failedTest;
-}
-
-
-// Gets the thrown exception.
-inline CppUnitException* TestFailure::thrownException()
-{
- return _thrownException;
-}
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_TestFailure_INCLUDED
-
-
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/TestResult.h b/Utilities/Poco/CppUnit/include/CppUnit/TestResult.h
deleted file mode 100755
index 7131f4824c..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/TestResult.h
+++ /dev/null
@@ -1,231 +0,0 @@
-//
-// TestResult.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_TestResult_INCLUDED
-#define CppUnit_TestResult_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/Guards.h"
-#include "CppUnit/TestFailure.h"
-#include <vector>
-
-
-namespace CppUnit {
-
-
-class CppUnitException;
-class Test;
-
-
-/*
- * A TestResult collects the results of executing a test case. It is an
- * instance of the Collecting Parameter pattern.
- *
- * The test framework distinguishes between failures and errors.
- * A failure is anticipated and checked for with assertions. Errors are
- * unanticipated problems signified by exceptions that are not generated
- * by the framework.
- *
- * TestResult supplies a template method 'setSynchronizationObject ()'
- * so that subclasses can provide mutual exclusion in the face of multiple
- * threads. This can be useful when tests execute in one thread and
- * they fill a subclass of TestResult which effects change in another
- * thread. To have mutual exclusion, override setSynchronizationObject ()
- * and make sure that you create an instance of ExclusiveZone at the
- * beginning of each method.
- *
- * see Test
- */
-class CppUnit_API TestResult
-{
- REFERENCEOBJECT (TestResult)
-
-public:
- TestResult();
- virtual ~TestResult();
-
- virtual void addError(Test* test, CppUnitException* e);
- virtual void addFailure(Test* test, CppUnitException* e);
- virtual void startTest(Test* test);
- virtual void endTest(Test* test);
- virtual int runTests();
- virtual int testErrors();
- virtual int testFailures();
- virtual bool wasSuccessful();
- virtual bool shouldStop();
- virtual void stop();
-
- virtual std::vector<TestFailure*>& errors();
- virtual std::vector<TestFailure*>& failures();
-
- class SynchronizationObject
- {
- public:
- SynchronizationObject()
- {
- }
-
- virtual ~SynchronizationObject()
- {
- }
-
- virtual void lock()
- {
- }
-
- virtual void unlock()
- {
- }
- };
-
- class ExclusiveZone
- {
- SynchronizationObject* m_syncObject;
-
- public:
- ExclusiveZone(SynchronizationObject* syncObject): m_syncObject(syncObject)
- {
- m_syncObject->lock();
- }
-
- ~ExclusiveZone()
- {
- m_syncObject->unlock();
- }
- };
-
-protected:
- virtual void setSynchronizationObject(SynchronizationObject* syncObject);
-
- std::vector<TestFailure*> _errors;
- std::vector<TestFailure*> _failures;
- int _runTests;
- bool _stop;
- SynchronizationObject* _syncObject;
-
-};
-
-
-// Construct a TestResult
-inline TestResult::TestResult(): _syncObject(new SynchronizationObject())
-{
- _runTests = 0;
- _stop = false;
-}
-
-
-// Adds an error to the list of errors. The passed in exception
-// caused the error
-inline void TestResult::addError(Test* test, CppUnitException* e)
-{
- ExclusiveZone zone(_syncObject);
- _errors.push_back(new TestFailure(test, e));
-}
-
-
-// Adds a failure to the list of failures. The passed in exception
-// caused the failure.
-inline void TestResult::addFailure(Test* test, CppUnitException* e)
-{
- ExclusiveZone zone(_syncObject);
- _failures.push_back(new TestFailure(test, e));
-}
-
-
-// Informs the result that a test will be started.
-inline void TestResult::startTest(Test* test)
-{
- ExclusiveZone zone(_syncObject);
- _runTests++;
-}
-
-
-// Informs the result that a test was completed.
-inline void TestResult::endTest(Test* test)
-{
- ExclusiveZone zone(_syncObject);
-}
-
-
-// Gets the number of run tests.
-inline int TestResult::runTests()
-{
- ExclusiveZone zone(_syncObject);
- return _runTests;
-}
-
-
-// Gets the number of detected errors.
-inline int TestResult::testErrors()
-{
- ExclusiveZone zone(_syncObject);
- return (int) _errors.size();
-}
-
-
-// Gets the number of detected failures.
-inline int TestResult::testFailures()
-{
- ExclusiveZone zone(_syncObject);
- return (int) _failures.size();
-}
-
-
-// Returns whether the entire test was successful or not.
-inline bool TestResult::wasSuccessful()
-{
- ExclusiveZone zone(_syncObject);
- return _failures.size() == 0 && _errors.size () == 0;
-}
-
-
-// Returns a std::vector of the errors.
-inline std::vector<TestFailure*>& TestResult::errors()
-{
- ExclusiveZone zone(_syncObject);
- return _errors;
-}
-
-
-// Returns a std::vector of the failures.
-inline std::vector<TestFailure*>& TestResult::failures()
-{
- ExclusiveZone zone(_syncObject);
- return _failures;
-}
-
-
-// Returns whether testing should be stopped
-inline bool TestResult::shouldStop()
-{
- ExclusiveZone zone(_syncObject);
- return _stop;
-}
-
-
-// Stop testing
-inline void TestResult::stop()
-{
- ExclusiveZone zone(_syncObject);
- _stop = true;
-}
-
-
-// Accept a new synchronization object for protection of this instance
-// TestResult assumes ownership of the object
-inline void TestResult::setSynchronizationObject(SynchronizationObject* syncObject)
-{
- delete _syncObject;
- _syncObject = syncObject;
-}
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_TestResult_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/TestRunner.h b/Utilities/Poco/CppUnit/include/CppUnit/TestRunner.h
deleted file mode 100755
index 690b098f69..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/TestRunner.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// TestRunner.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_TestRunner_INCLUDED
-#define CppUnit_TestRunner_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include <vector>
-#include <string>
-#include <ostream>
-
-
-namespace CppUnit {
-
-
-class Test;
-
-
-/*
- * A command line based tool to run tests.
- * TestRunner expects as its only argument the name of a TestCase class.
- * TestRunner prints out a trace as the tests are executed followed by a
- * summary at the end.
- *
- * You can add to the tests that the TestRunner knows about by
- * making additional calls to "addTest (...)" in main.
- *
- * Here is the synopsis:
- *
- * TestRunner [-all] [-print] [-wait] ExampleTestCase
- *
- */
-class CppUnit_API TestRunner
-{
- typedef std::pair<std::string, Test*> Mapping;
- typedef std::vector<Mapping> Mappings;
-
-public:
- TestRunner();
- TestRunner(std::ostream& ostr);
- ~TestRunner();
-
- bool run(const std::vector<std::string>& args);
- void addTest(const std::string& name, Test* test);
-
-protected:
- bool run(Test* test);
- void printBanner();
- void print(const std::string& name, Test* pTest, int indent);
- Test* find(const std::string& name, Test* pTest, const std::string& testName);
-
-private:
- std::ostream& _ostr;
- Mappings _mappings;
-};
-
-
-} // namespace CppUnit
-
-
-#define CppUnitMain(testCase) \
- int main(int ac, char **av) \
- { \
- std::vector<std::string> args; \
- for (int i = 0; i < ac; ++i) \
- args.push_back(std::string(av[i])); \
- CppUnit::TestRunner runner; \
- runner.addTest(#testCase, testCase::suite()); \
- return runner.run(args) ? 0 : 1; \
- }
-
-
-#endif // CppUnit_TestRunner_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/TestSetup.h b/Utilities/Poco/CppUnit/include/CppUnit/TestSetup.h
deleted file mode 100755
index 5c51b6904c..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/TestSetup.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// TestSetup.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_TestSetup_INCLUDED
-#define CppUnit_TestSetup_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/Guards.h"
-#include "CppUnit/TestDecorator.h"
-
-
-namespace CppUnit {
-
-
-class Test;
-class TestResult;
-
-
-class CppUnit_API TestSetup: public TestDecorator
-{
- REFERENCEOBJECT (TestSetup)
-
-public:
- TestSetup(Test* test): TestDecorator(test)
- {
- }
-
- void run(TestResult* result);
-
-protected:
- void setUp()
- {
- }
-
- void tearDown()
- {
- }
-};
-
-
-inline void TestSetup::run(TestResult* result)
-{
- setUp();
- TestDecorator::run(result);
- tearDown();
-}
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_TestSetup_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/TestSuite.h b/Utilities/Poco/CppUnit/include/CppUnit/TestSuite.h
deleted file mode 100755
index 35b062ecb6..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/TestSuite.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// TestSuite.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_TestSuite_INCLUDED
-#define CppUnit_TestSuite_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/Guards.h"
-#include "CppUnit/Test.h"
-#include <vector>
-#include <string>
-
-
-namespace CppUnit {
-
-
-class TestResult;
-
-
-/*
- * A TestSuite is a Composite of Tests.
- * It runs a collection of test cases. Here is an example.
- *
- * TestSuite *suite= new TestSuite();
- * suite->addTest(new TestCaller<MathTest> ("testAdd", testAdd));
- * suite->addTest(new TestCaller<MathTest> ("testDivideByZero", testDivideByZero));
- *
- * Note that TestSuites assume lifetime
- * control for any tests added to them.
- *
- * see Test and TestCaller
- */
-class CppUnit_API TestSuite: public Test
-{
- REFERENCEOBJECT (TestSuite)
-
-public:
- TestSuite(const std::string& name = "");
- ~TestSuite();
-
- void run(TestResult* result);
- int countTestCases();
- void addTest(Test* test);
- std::string toString();
-
- virtual void deleteContents();
-
- const std::vector<Test*> tests() const;
-
-private:
- std::vector<Test*> _tests;
- const std::string _name;
-};
-
-
-// Default constructor
-inline TestSuite::TestSuite(const std::string& name): _name(name)
-{
-}
-
-
-// Destructor
-inline TestSuite::~TestSuite()
-{
- deleteContents();
-}
-
-
-// Adds a test to the suite.
-inline void TestSuite::addTest(Test* test)
-{
- _tests.push_back(test);
-}
-
-
-// Returns a std::string representation of the test suite.
-inline std::string TestSuite::toString()
-{
- return "suite " + _name;
-}
-
-
-// Returns all tests
-inline const std::vector<Test*> TestSuite::tests() const
-{
- return _tests;
-}
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_TestSuite_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/TextTestResult.h b/Utilities/Poco/CppUnit/include/CppUnit/TextTestResult.h
deleted file mode 100755
index 14392aa29e..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/TextTestResult.h
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// TextTestResult.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_TextTestResult_INCLUDED
-#define CppUnit_TextTestResult_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include "CppUnit/TestResult.h"
-#include <ostream>
-
-
-namespace CppUnit {
-
-
-class CppUnit_API TextTestResult: public TestResult
-{
-public:
- TextTestResult();
- TextTestResult(std::ostream& ostr);
-
- virtual void addError(Test* test, CppUnitException* e);
- virtual void addFailure(Test* test, CppUnitException* e);
- virtual void startTest(Test* test);
- virtual void print(std::ostream& stream);
- virtual void printErrors(std::ostream& stream);
- virtual void printFailures(std::ostream& stream);
- virtual void printHeader(std::ostream& stream);
-
-protected:
- std::string shortName(const std::string& testName);
-
-private:
- std::ostream& _ostr;
-};
-
-
-/* insertion operator for easy output */
-inline std::ostream& operator<< (std::ostream& stream, TextTestResult& result)
-{
- result.print(stream);
- return stream;
-}
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_TextTestResult_INCLUDED
diff --git a/Utilities/Poco/CppUnit/include/CppUnit/estring.h b/Utilities/Poco/CppUnit/include/CppUnit/estring.h
deleted file mode 100755
index 30f76ccf31..0000000000
--- a/Utilities/Poco/CppUnit/include/CppUnit/estring.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// estring.h
-//
-// $Id$
-//
-
-
-#ifndef CppUnit_estring_INCLUDED
-#define CppUnit_estring_INCLUDED
-
-
-#include "CppUnit/CppUnit.h"
-#include <string>
-#include <stdio.h>
-
-
-namespace CppUnit {
-
-
-// Create a std::string from a const char pointer
-inline std::string estring(const char *cstring)
-{
- return std::string(cstring);
-}
-
-
-// Create a std::string from a std::string (for uniformities' sake)
-inline std::string estring(std::string& expandedString)
-{
- return expandedString;
-}
-
-
-// Create a std::string from an int
-inline std::string estring(int number)
-{
- char buffer[50];
- sprintf(buffer, "%d", number);
- return std::string (buffer);
-}
-
-
-// Create a string from a long
-inline std::string estring(long number)
-{
- char buffer[50];
- sprintf(buffer, "%ld", number);
- return std::string (buffer);
-}
-
-
-// Create a std::string from a double
-inline std::string estring(double number)
-{
- char buffer[50];
- sprintf(buffer, "%lf", number);
- return std::string(buffer);
-}
-
-
-// Create a std::string from a double
-inline std::string estring(const void* ptr)
-{
- char buffer[50];
- sprintf(buffer, "%p", ptr);
- return std::string(buffer);
-}
-
-
-} // namespace CppUnit
-
-
-#endif // CppUnit_estring_INCLUDED
diff --git a/Utilities/Poco/CppUnit/src/CppUnitException.cpp b/Utilities/Poco/CppUnit/src/CppUnitException.cpp
deleted file mode 100755
index 607c7a37ac..0000000000
--- a/Utilities/Poco/CppUnit/src/CppUnitException.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// CppUnitException.cpp
-//
-// $Id$
-//
-
-
-#include "CppUnit/CppUnitException.h"
-
-
-namespace CppUnit {
-
-
-const std::string CppUnitException::CPPUNIT_UNKNOWNFILENAME = "<unknown>";
-const int CppUnitException::CPPUNIT_UNKNOWNLINENUMBER = -1;
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/CppUnit/src/TestCase.cpp b/Utilities/Poco/CppUnit/src/TestCase.cpp
deleted file mode 100755
index 4b0a3181b9..0000000000
--- a/Utilities/Poco/CppUnit/src/TestCase.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-//
-// TestCase.cpp
-//
-// $Id$
-//
-
-
-#include <stdexcept>
-#include <math.h>
-#include "CppUnit/TestCase.h"
-#include "CppUnit/TestResult.h"
-#include "CppUnit/estring.h"
-#include <typeinfo>
-
-
-using namespace std;
-
-
-namespace CppUnit {
-
-
-// Create a default TestResult
-TestResult* TestCase::defaultResult()
-{
- return new TestResult;
-}
-
-
-// Check for a failed general assertion
-void TestCase::assertImplementation(bool condition, const std::string& conditionExpression, long lineNumber, const std::string& fileName)
-{
- if (!condition)
- throw CppUnitException(conditionExpression, lineNumber, fileName);
-}
-
-
-void TestCase::loop1assertImplementation(bool condition, const std::string& conditionExpression, long lineNumber, long data1lineNumber, const std::string& fileName)
-{
- if (!condition)
- throw CppUnitException(conditionExpression, lineNumber, data1lineNumber, fileName);
-}
-
-
-void TestCase::loop2assertImplementation(bool condition, const std::string& conditionExpression, long lineNumber, long data1lineNumber, long data2lineNumber, const std::string& fileName)
-{
- if (!condition)
- throw CppUnitException(conditionExpression, lineNumber, data1lineNumber, data2lineNumber, fileName);
-}
-
-
-// Check for a failed equality assertion
-void TestCase::assertEquals(long expected, long actual, long lineNumber, const std::string& fileName)
-{
- if (expected != actual)
- assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
-}
-
-
-// Check for a failed equality assertion
-void TestCase::assertEquals(double expected, double actual, double delta, long lineNumber, const std::string& fileName)
-{
- if (fabs(expected - actual) > delta)
- assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
-}
-
-
-// Check for a failed equality assertion
-void TestCase::assertEquals(const void* expected, const void* actual, long lineNumber, const std::string& fileName)
-{
- if (expected != actual)
- assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
-}
-
-
-// Check for a failed equality assertion
-void TestCase::assertEquals(const std::string& expected, const std::string& actual, long lineNumber, const std::string& fileName)
-{
- if (expected != actual)
- assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
-}
-
-
-void TestCase::assertNotNull(const void* pointer, const std::string& pointerExpression, long lineNumber, const std::string& fileName)
-{
- if (pointer == NULL)
- throw CppUnitException(pointerExpression + " must not be NULL", lineNumber, fileName);
-}
-
-
-void TestCase::assertNull(const void* pointer, const std::string& pointerExpression, long lineNumber, const std::string& fileName)
-{
- if (pointer != NULL)
- throw CppUnitException(pointerExpression + " must be NULL", lineNumber, fileName);
-}
-
-
-void TestCase::fail (const std::string& message, long lineNumber, const std::string& fileName)
-{
- throw CppUnitException(std::string("fail: ") + message, lineNumber, fileName);
-}
-
-
-// Run the test and catch any exceptions that are triggered by it
-void TestCase::run(TestResult *result)
-{
- result->startTest(this);
-
- setUp();
- try
- {
- runTest();
- }
- catch (CppUnitException& e)
- {
- CppUnitException* copy = new CppUnitException(e);
- result->addFailure(this, copy);
- }
- catch (std::exception& e)
- {
- std::string msg(typeid(e).name());
- msg.append(": ");
- msg.append(e.what());
- result->addError(this, new CppUnitException(msg));
-
- }
-#if !defined(_WIN32)
- catch (...)
- {
- CppUnitException *e = new CppUnitException ("unknown exception");
- result->addError (this, e);
- }
-#endif
- tearDown ();
- result->endTest(this);
-}
-
-
-// A default run method
-TestResult* TestCase::run()
-{
- TestResult* result = defaultResult();
-
- run(result);
- return result;
-}
-
-
-// All the work for runTest is deferred to subclasses
-void TestCase::runTest()
-{
-}
-
-
-// Build a message about a failed equality check
-std::string TestCase::notEqualsMessage(long expected, long actual)
-{
- return "expected: " + estring(expected) + " but was: " + estring(actual);
-}
-
-
-// Build a message about a failed equality check
-std::string TestCase::notEqualsMessage(double expected, double actual)
-{
- return "expected: " + estring(expected) + " but was: " + estring(actual);
-}
-
-
-// Build a message about a failed equality check
-std::string TestCase::notEqualsMessage(const void* expected, const void* actual)
-{
- return "expected: " + estring(expected) + " but was: " + estring(actual);
-}
-
-
-// Build a message about a failed equality check
-std::string TestCase::notEqualsMessage(const std::string& expected, const std::string& actual)
-{
- return "expected: \"" + expected + "\" but was: \"" + actual + "\"";
-}
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/CppUnit/src/TestDecorator.cpp b/Utilities/Poco/CppUnit/src/TestDecorator.cpp
deleted file mode 100755
index e01dd7e02f..0000000000
--- a/Utilities/Poco/CppUnit/src/TestDecorator.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// TestDecorator.cpp
-//
-// $Id$
-//
-
-
-#include "CppUnit/TestDecorator.h"
-
-
-namespace CppUnit {
-
-
-TestDecorator::TestDecorator(Test* test)
-{
- _test = test;
-}
-
-
-TestDecorator::~TestDecorator()
-{
-}
-
-
-int TestDecorator::countTestCases()
-{
- return _test->countTestCases();
-}
-
-
-void TestDecorator::run(TestResult* result)
-{
- _test->run(result);
-}
-
-
-std::string TestDecorator::toString()
-{
- return _test->toString();
-}
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/CppUnit/src/TestFailure.cpp b/Utilities/Poco/CppUnit/src/TestFailure.cpp
deleted file mode 100755
index 91f29ffdad..0000000000
--- a/Utilities/Poco/CppUnit/src/TestFailure.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// TestFailure.cpp
-//
-// $Id$
-//
-
-
-#include "CppUnit/TestFailure.h"
-#include "CppUnit/Test.h"
-
-
-namespace CppUnit {
-
-
-// Returns a short description of the failure.
-std::string TestFailure::toString()
-{
- return _failedTest->toString () + ": " + _thrownException->what();
-}
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/CppUnit/src/TestResult.cpp b/Utilities/Poco/CppUnit/src/TestResult.cpp
deleted file mode 100755
index 7bb93f5f78..0000000000
--- a/Utilities/Poco/CppUnit/src/TestResult.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// TestResult.cpp
-//
-// $Id$
-//
-
-
-#include "CppUnit/TestResult.h"
-
-
-namespace CppUnit {
-
-
-// Destroys a test result
-TestResult::~TestResult()
-{
- std::vector<TestFailure*>::iterator it;
-
- for (it = _errors.begin(); it != _errors.end(); ++it)
- delete *it;
-
- for (it = _failures.begin(); it != _failures.end(); ++it)
- delete *it;
-
- delete _syncObject;
-}
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/CppUnit/src/TestRunner.cpp b/Utilities/Poco/CppUnit/src/TestRunner.cpp
deleted file mode 100755
index 99b433459c..0000000000
--- a/Utilities/Poco/CppUnit/src/TestRunner.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-//
-// TestRunner.cpp
-//
-// $Id$
-//
-
-
-#include "CppUnit/TestRunner.h"
-#include "CppUnit/Test.h"
-#include "CppUnit/TestSuite.h"
-#include "CppUnit/TextTestResult.h"
-#include <iostream>
-
-
-namespace CppUnit {
-
-
-TestRunner::TestRunner():
- _ostr(std::cout)
-{
-}
-
-
-TestRunner::TestRunner(std::ostream& ostr):
- _ostr(ostr)
-{
-}
-
-
-TestRunner::~TestRunner()
-{
- for (Mappings::iterator it = _mappings.begin(); it != _mappings.end(); ++it)
- delete it->second;
-}
-
-
-void TestRunner::printBanner()
-{
- _ostr
- << "Usage: driver [-all] [-print] [-wait] [name] ..." << std::endl
- << " where name is the name of a test case class" << std::endl;
-}
-
-
-bool TestRunner::run(const std::vector<std::string>& args)
-{
- std::string testCase;
- int numberOfTests = 0;
- bool success = true;
- bool all = false;
- bool wait = false;
- bool printed = false;
-
- for (int i = 1; i < args.size(); i++)
- {
- const std::string& arg = args[i];
- if (arg == "-wait")
- {
- wait = true;
- continue;
- }
- else if (arg == "-all")
- {
- all = true;
- continue;
- }
- else if (arg == "-print")
- {
- for (Mappings::iterator it = _mappings.begin(); it != _mappings.end(); ++it)
- {
- print(it->first, it->second, 0);
- }
- printed = true;
- continue;
- }
-
- if (!all)
- {
- testCase = arg;
-
- if (testCase == "")
- {
- printBanner();
- return false;
- }
-
- Test* testToRun = 0;
- for (Mappings::iterator it = _mappings.begin(); !testToRun && it != _mappings.end(); ++it)
- {
- testToRun = find(testCase, it->second, it->first);
- }
- if (testToRun)
- {
- if (!run(testToRun)) success = false;
- }
- numberOfTests++;
-
- if (!testToRun)
- {
- _ostr << "Test " << testCase << " not found." << std::endl;
- return false;
- }
- }
- }
-
- if (all)
- {
- for (Mappings::iterator it = _mappings.begin(); it != _mappings.end(); ++it)
- {
- if (!run(it->second)) success = false;
- numberOfTests++;
- }
- }
-
- if (numberOfTests == 0 && !printed)
- {
- printBanner();
- return false;
- }
-
- if (wait)
- {
- _ostr << "<RETURN> to continue" << std::endl;
- std::cin.get();
- }
-
- return success;
-}
-
-
-bool TestRunner::run(Test* test)
-{
- TextTestResult result(_ostr);
-
- test->run(&result);
- _ostr << result << std::endl;
-
- return result.wasSuccessful();
-}
-
-
-void TestRunner::addTest(const std::string& name, Test* test)
-{
- _mappings.push_back(Mapping(name, test));
-}
-
-
-void TestRunner::print(const std::string& name, Test* pTest, int indent)
-{
- for (int i = 0; i < indent; ++i)
- _ostr << " ";
- _ostr << name << std::endl;
- TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
- if (pSuite)
- {
- const std::vector<Test*>& tests = pSuite->tests();
- for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
- {
- print((*it)->toString(), *it, indent + 1);
- }
- }
-}
-
-
-Test* TestRunner::find(const std::string& name, Test* pTest, const std::string& testName)
-{
- if (testName.find(name) != std::string::npos)
- {
- return pTest;
- }
- else
- {
- TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
- if (pSuite)
- {
- const std::vector<Test*>& tests = pSuite->tests();
- for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
- {
- Test* result = find(name, *it, (*it)->toString());
- if (result) return result;
- }
- }
- return 0;
- }
-}
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/CppUnit/src/TestSuite.cpp b/Utilities/Poco/CppUnit/src/TestSuite.cpp
deleted file mode 100755
index c1f3b32525..0000000000
--- a/Utilities/Poco/CppUnit/src/TestSuite.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// TestSuite.cpp
-//
-// $Id$
-//
-
-
-#include "CppUnit/TestSuite.h"
-#include "CppUnit/TestResult.h"
-
-
-namespace CppUnit {
-
-
-// Deletes all tests in the suite.
-void TestSuite::deleteContents()
-{
- for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
- delete *it;
-}
-
-
-// Runs the tests and collects their result in a TestResult.
-void TestSuite::run(TestResult *result)
-{
- for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
- {
- if (result->shouldStop ())
- break;
-
- Test *test = *it;
- test->run(result);
- }
-}
-
-
-// Counts the number of test cases that will be run by this test.
-int TestSuite::countTestCases()
-{
- int count = 0;
-
- for (std::vector<Test*>::iterator it = _tests.begin (); it != _tests.end (); ++it)
- count += (*it)->countTestCases();
-
- return count;
-}
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/CppUnit/src/TextTestResult.cpp b/Utilities/Poco/CppUnit/src/TextTestResult.cpp
deleted file mode 100755
index d43f825fcb..0000000000
--- a/Utilities/Poco/CppUnit/src/TextTestResult.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// TextTestResult.cpp
-//
-// $Id$
-//
-
-
-#include "CppUnit/TextTestResult.h"
-#include "CppUnit/CppUnitException.h"
-#include "CppUnit/Test.h"
-#include "CppUnit/estring.h"
-#include <iostream>
-#include <iomanip>
-
-
-namespace CppUnit {
-
-
-TextTestResult::TextTestResult():
- _ostr(std::cout)
-{
-}
-
-
-TextTestResult::TextTestResult(std::ostream& ostr):
- _ostr(ostr)
-{
-}
-
-
-void TextTestResult::addError(Test* test, CppUnitException* e)
-{
- TestResult::addError(test, e);
- _ostr << "ERROR" << std::flush;
-}
-
-
-void TextTestResult::addFailure(Test* test, CppUnitException* e)
-{
- TestResult::addFailure(test, e);
- _ostr << "FAILURE" << std::flush;
-}
-
-
-void TextTestResult::startTest(Test* test)
-{
- TestResult::startTest(test);
- _ostr << "\n" << shortName(test->toString()) << ": ";
-}
-
-
-void TextTestResult::printErrors(std::ostream& stream)
-{
- if (testErrors() != 0)
- {
- stream << "\n";
-
- if (testErrors() == 1)
- stream << "There was " << testErrors() << " error: " << std::endl;
- else
- stream << "There were " << testErrors() << " errors: " << std::endl;
-
- int i = 1;
- for (std::vector<TestFailure*>::iterator it = errors().begin(); it != errors().end(); ++it)
- {
- TestFailure* failure = *it;
- CppUnitException* e = failure->thrownException();
-
- stream << std::setw(2) << i
- << ": "
- << failure->failedTest()->toString() << "\n"
- << " \"" << (e ? e->what() : "") << "\"\n"
- << " in \""
- << (e ? e->fileName() : std::string())
- << "\", line ";
- if (e == 0)
- {
- stream << "0";
- }
- else
- {
- stream << e->lineNumber();
- if (e->data2LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
- {
- stream << " data lines " << e->data1LineNumber()
- << ", " << e->data2LineNumber();
- }
- else if (e->data1LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
- {
- stream << " data line " << e->data1LineNumber();
- }
- }
- stream << "\n";
- i++;
- }
- }
-}
-
-
-void TextTestResult::printFailures(std::ostream& stream)
-{
- if (testFailures() != 0)
- {
- stream << "\n";
- if (testFailures() == 1)
- stream << "There was " << testFailures() << " failure: " << std::endl;
- else
- stream << "There were " << testFailures() << " failures: " << std::endl;
-
- int i = 1;
-
- for (std::vector<TestFailure*>::iterator it = failures().begin(); it != failures().end(); ++it)
- {
- TestFailure* failure = *it;
- CppUnitException* e = failure->thrownException();
-
- stream << std::setw(2) << i
- << ": "
- << failure->failedTest()->toString() << "\n"
- << " \"" << (e ? e->what() : "") << "\"\n"
- << " in \""
- << (e ? e->fileName() : std::string())
- << "\", line ";
- if (e == 0)
- {
- stream << "0";
- }
- else
- {
- stream << e->lineNumber();
- if (e->data2LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
- {
- stream << " data lines "
- << e->data1LineNumber()
- << ", " << e->data2LineNumber();
- }
- else if (e->data1LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
- {
- stream << " data line " << e->data1LineNumber();
- }
- }
- stream << "\n";
- i++;
- }
- }
-}
-
-
-void TextTestResult::print(std::ostream& stream)
-{
- printHeader(stream);
- printErrors(stream);
- printFailures(stream);
-}
-
-
-void TextTestResult::printHeader(std::ostream& stream)
-{
- stream << "\n\n";
- if (wasSuccessful())
- stream << "OK ("
- << runTests() << " tests)"
- << std::endl;
- else
- stream << "!!!FAILURES!!!" << std::endl
- << "Runs: "
- << runTests ()
- << " Failures: "
- << testFailures ()
- << " Errors: "
- << testErrors ()
- << std::endl;
-}
-
-
-std::string TextTestResult::shortName(const std::string& testName)
-{
- std::string::size_type pos = testName.rfind('.');
- if (pos != std::string::npos)
- return std::string(testName, pos + 1);
- else
- return testName;
-}
-
-
-} // namespace CppUnit
diff --git a/Utilities/Poco/Foundation/CMakeLists.txt b/Utilities/Poco/Foundation/CMakeLists.txt
deleted file mode 100755
index 0e0947c680..0000000000
--- a/Utilities/Poco/Foundation/CMakeLists.txt
+++ /dev/null
@@ -1,215 +0,0 @@
-set(LIBNAME "PocoFoundation")
-#set(LIBNAMED "${LIBNAME}d")
-
-set( BASE_SRCS
-
- src/AtomicCounter.cpp
-
- src/ASCIIEncoding.cpp
- src/AbstractObserver.cpp
- src/ActiveDispatcher.cpp
- src/ArchiveStrategy.cpp
- src/AsyncChannel.cpp
-
- src/Base64Decoder.cpp
- src/Base64Encoder.cpp
- src/BinaryReader.cpp
- src/BinaryWriter.cpp
- src/Bugcheck.cpp
- src/ByteOrder.cpp
- src/Channel.cpp
- src/Checksum.cpp
- src/Condition.cpp
- src/Configurable.cpp
- src/ConsoleChannel.cpp
- src/CountingStream.cpp
- src/DateTime.cpp
- src/DateTimeFormat.cpp
- src/DateTimeFormatter.cpp
- src/DateTimeParser.cpp
- src/Debugger.cpp
- src/DeflatingStream.cpp
- src/DigestEngine.cpp
- src/DigestStream.cpp
- src/DirectoryIterator.cpp
- src/DynamicAny.cpp
- src/DynamicAnyHolder.cpp
- src/Environment.cpp
- src/ErrorHandler.cpp
- src/Event.cpp
- src/EventArgs.cpp
- src/Exception.cpp
- src/FPEnvironment.cpp
- src/File.cpp
- src/FileChannel.cpp
- src/FileStream.cpp
- src/FileStreamFactory.cpp
- src/Format.cpp
- src/Formatter.cpp
- src/FormattingChannel.cpp
- src/Glob.cpp
- src/Hash.cpp
- src/HashStatistic.cpp
- src/HexBinaryDecoder.cpp
- src/HexBinaryEncoder.cpp
- src/InflatingStream.cpp
- src/Latin1Encoding.cpp
- src/Latin9Encoding.cpp
- src/LineEndingConverter.cpp
- src/LocalDateTime.cpp
- src/LogFile.cpp
- src/LogStream.cpp
- src/Logger.cpp
- src/LoggingFactory.cpp
- src/LoggingRegistry.cpp
- src/MD2Engine.cpp
- src/MD4Engine.cpp
- src/MD5Engine.cpp
- src/Manifest.cpp
- src/MemoryPool.cpp
- src/Message.cpp
- src/Mutex.cpp
- src/NamedEvent.cpp
- src/NamedMutex.cpp
- src/NestedDiagnosticContext.cpp
- src/Notification.cpp
- src/NotificationCenter.cpp
- src/NotificationQueue.cpp
- src/TimedNotificationQueue.cpp
- src/PriorityNotificationQueue.cpp
- src/NullChannel.cpp
- src/NullStream.cpp
- src/NumberFormatter.cpp
- src/NumberParser.cpp
-# src/OpcomChannel.cpp
- src/Path.cpp
- src/PatternFormatter.cpp
- src/Pipe.cpp
- src/PipeImpl.cpp
- src/PipeStream.cpp
- src/Process.cpp
- src/PurgeStrategy.cpp
- src/RWLock.cpp
- src/Random.cpp
- src/RandomStream.cpp
- src/RefCountedObject.cpp
- src/RegularExpression.cpp
- src/RotateStrategy.cpp
- src/Runnable.cpp
- src/SHA1Engine.cpp
- src/Semaphore.cpp
- src/SharedLibrary.cpp
- src/SharedMemory.cpp
- src/SignalHandler.cpp
- src/SimpleFileChannel.cpp
- src/SplitterChannel.cpp
- src/Stopwatch.cpp
- src/StreamChannel.cpp
- src/StreamConverter.cpp
- src/StreamCopier.cpp
- src/StreamTokenizer.cpp
- src/String.cpp
- src/StringTokenizer.cpp
- src/SynchronizedObject.cpp
- src/Task.cpp
- src/TaskManager.cpp
- src/TaskNotification.cpp
- src/TeeStream.cpp
- src/TemporaryFile.cpp
- src/TextConverter.cpp
- src/TextEncoding.cpp
- src/TextIterator.cpp
- src/Thread.cpp
- src/ThreadTarget.cpp
- src/ThreadLocal.cpp
- src/ThreadPool.cpp
- src/Timer.cpp
- src/Timespan.cpp
- src/Timestamp.cpp
- src/Timezone.cpp
- src/Token.cpp
- src/URI.cpp
- src/URIStreamFactory.cpp
- src/URIStreamOpener.cpp
- src/UTF16Encoding.cpp
- src/UTF8Encoding.cpp
- src/UTF8String.cpp
- src/UUID.cpp
- src/UUIDGenerator.cpp
- src/Unicode.cpp
- src/UnicodeConverter.cpp
-# src/Var.cpp
-# src/VarHolder.cpp
- src/Void.cpp
- src/Windows1252Encoding.cpp
- src/adler32.c
- src/compress.c
- src/crc32.c
- src/deflate.c
- src/gzio.c
- src/infback.c
- src/inffast.c
- src/inflate.c
- src/inftrees.c
- src/pcre_chartables.c
- src/pcre_compile.c
- src/pcre_exec.c
- src/pcre_fullinfo.c
- src/pcre_globals.c
- src/pcre_maketables.c
- src/pcre_newline.c
- src/pcre_ord2utf8.c
- src/pcre_study.c
- src/pcre_tables.c
- src/pcre_try_flipped.c
- src/pcre_ucd.c
- src/pcre_valid_utf8.c
- src/pcre_xclass.c
- src/pocomsg.mc
- src/trees.c
- src/zutil.c
-)
-
-set(WIN_SRCS
- src/EventLogChannel.cpp
- src/WindowsConsoleChannel.cpp
-)
-
-set(LIN_SRCS
- src/SyslogChannel.cpp
-)
-
-if(CMAKE_SYSTEM MATCHES "Windows")
- set(SRCS ${BASE_SRCS} ${WIN_SRCS})
- #add_definitions( -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC)
-else(CMAKE_SYSTEM MATCHES "Windows")
- set(SRCS ${BASE_SRCS} ${LIN_SRCS})
- add_definitions( -DPCRE_STATIC)
-endif(CMAKE_SYSTEM MATCHES "Windows")
-
-if(CMAKE_COMPILER_IS_MINGW)
- add_definitions( -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC)
-endif()
-
-add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
-set_target_properties( ${LIBNAME} PROPERTIES
- DEFINE_SYMBOL Foundation_EXPORTS
- #COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
- VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
- SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-if(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
- set_target_properties( ${LIBNAME} PROPERTIES LINK_FLAGS "-library=stlport4")
-endif(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
-target_link_libraries( ${LIBNAME} ${SYSLIBS})
-
-#add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
-#set_target_properties( ${LIBNAMED}
-# PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
-# DEFINE_SYMBOL Foundation_EXPORTS
-# VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
-# SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-#if(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
-# set_target_properties( ${LIBNAMED} PROPERTIES LINK_FLAGS "-library=stlport4")
-#endif(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
-#target_link_libraries( ${LIBNAMED} ${SYSLIBS})
-
diff --git a/Utilities/Poco/Foundation/include/Poco/ASCIIEncoding.h b/Utilities/Poco/Foundation/include/Poco/ASCIIEncoding.h
deleted file mode 100755
index e5977e3e2b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ASCIIEncoding.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// ASCIIEncoding.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: ASCIIEncoding
-//
-// Definition of the ASCIIEncoding class.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_ASCIIEncoding_INCLUDED
-#define Foundation_ASCIIEncoding_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/TextEncoding.h"
-
-
-namespace Poco {
-
-
-class Foundation_API ASCIIEncoding: public TextEncoding
- /// 7-bit ASCII text encoding.
-{
-public:
- ASCIIEncoding();
- ~ASCIIEncoding();
- const char* canonicalName() const;
- bool isA(const std::string& encodingName) const;
- const CharacterMap& characterMap() const;
- int convert(const unsigned char* bytes) const;
- int convert(int ch, unsigned char* bytes, int length) const;
-
-private:
- static const char* _names[];
- static const CharacterMap _charMap;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ASCIIEncoding_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/AbstractCache.h b/Utilities/Poco/Foundation/include/Poco/AbstractCache.h
deleted file mode 100755
index 56968865b2..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AbstractCache.h
+++ /dev/null
@@ -1,315 +0,0 @@
-//
-// AbstractCache.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: AbstractCache
-//
-// Definition of the AbstractCache class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_AbstractCache_INCLUDED
-#define Foundation_AbstractCache_INCLUDED
-
-
-#include "Poco/KeyValueArgs.h"
-#include "Poco/ValidArgs.h"
-#include "Poco/Mutex.h"
-#include "Poco/Exception.h"
-#include "Poco/FIFOEvent.h"
-#include "Poco/EventArgs.h"
-#include "Poco/Delegate.h"
-#include "Poco/SharedPtr.h"
-#include <map>
-#include <set>
-#include <cstddef>
-
-
-namespace Poco {
-
-
-template <class TKey, class TValue, class TStrategy>
-class AbstractCache
- /// An AbstractCache is the interface of all caches.
-{
-public:
- FIFOEvent<const KeyValueArgs<TKey, TValue > > Add;
- FIFOEvent<const TKey> Remove;
- FIFOEvent<const TKey> Get;
- FIFOEvent<const EventArgs> Clear;
-
- typedef std::map<TKey, SharedPtr<TValue > > DataHolder;
- typedef typename DataHolder::iterator Iterator;
- typedef typename DataHolder::const_iterator ConstIterator;
- typedef std::set<TKey> KeySet;
-
- AbstractCache()
- {
- initialize();
- }
-
- AbstractCache(const TStrategy& strat): _strategy(strat)
- {
- initialize();
- }
-
- virtual ~AbstractCache()
- {
- uninitialize();
- }
-
- void add(const TKey& key, const TValue& val)
- /// Adds the key value pair to the cache.
- /// If for the key already an entry exists, it will be overwritten.
- {
- FastMutex::ScopedLock lock(_mutex);
- doAdd(key, val);
- }
-
- void add(const TKey& key, SharedPtr<TValue > val)
- /// Adds the key value pair to the cache. Note that adding a NULL SharedPtr will fail!
- /// If for the key already an entry exists, it will be overwritten.
- {
- FastMutex::ScopedLock lock(_mutex);
- doAdd(key, val);
- }
-
- void remove(const TKey& key)
- /// Removes an entry from the cache. If the entry is not found,
- /// the remove is ignored.
- {
- FastMutex::ScopedLock lock(_mutex);
- Iterator it = _data.find(key);
- doRemove(it);
- }
-
- bool has(const TKey& key) const
- /// Returns true if the cache contains a value for the key.
- {
- FastMutex::ScopedLock lock(_mutex);
- return doHas(key);
- }
-
- SharedPtr<TValue> get(const TKey& key)
- /// Returns a SharedPtr of the value. The SharedPointer will remain valid
- /// even when cache replacement removes the element.
- /// If for the key no value exists, an empty SharedPtr is returned.
- {
- FastMutex::ScopedLock lock(_mutex);
- return doGet (key);
- }
-
- void clear()
- /// Removes all elements from the cache.
- {
- FastMutex::ScopedLock lock(_mutex);
- doClear();
- }
-
- std::size_t size()
- /// Returns the number of cached elements
- {
- FastMutex::ScopedLock lock(_mutex);
- doReplace();
- return _data.size();
- }
-
- void forceReplace()
- /// Forces cache replacement. Note that Poco's cache strategy use for efficiency reason no background thread
- /// which periodically triggers cache replacement. Cache Replacement is only started when the cache is modified
- /// from outside, i.e. add is called, or when a user tries to access an cache element via get.
- /// In some cases, i.e. expire based caching where for a long time no access to the cache happens,
- /// it might be desirable to be able to trigger cache replacement manually.
- {
- FastMutex::ScopedLock lock(_mutex);
- doReplace();
- }
-
- std::set<TKey> getAllKeys()
- /// Returns a copy of all keys stored in the cache
- {
- FastMutex::ScopedLock lock(_mutex);
- doReplace();
- ConstIterator it = _data.begin();
- ConstIterator itEnd = _data.end();
- std::set<TKey> result;
- for (; it != itEnd; ++it)
- result.insert(it->first);
-
- return result;
- }
-
-protected:
- mutable FIFOEvent<ValidArgs<TKey> > IsValid;
- mutable FIFOEvent<KeySet> Replace;
-
- void initialize()
- /// Sets up event registration.
- {
- Add += Delegate<TStrategy, const KeyValueArgs<TKey, TValue> >(&_strategy, &TStrategy::onAdd);
- Remove += Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onRemove);
- Get += Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onGet);
- Clear += Delegate<TStrategy, const EventArgs>(&_strategy, &TStrategy::onClear);
- IsValid += Delegate<TStrategy, ValidArgs<TKey> >(&_strategy, &TStrategy::onIsValid);
- Replace += Delegate<TStrategy, KeySet>(&_strategy, &TStrategy::onReplace);
- }
-
- void uninitialize()
- /// Reverts event registration.
- {
- Add -= Delegate<TStrategy, const KeyValueArgs<TKey, TValue> >(&_strategy, &TStrategy::onAdd );
- Remove -= Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onRemove);
- Get -= Delegate<TStrategy, const TKey>(&_strategy, &TStrategy::onGet);
- Clear -= Delegate<TStrategy, const EventArgs>(&_strategy, &TStrategy::onClear);
- IsValid -= Delegate<TStrategy, ValidArgs<TKey> >(&_strategy, &TStrategy::onIsValid);
- Replace -= Delegate<TStrategy, KeySet>(&_strategy, &TStrategy::onReplace);
- }
-
- void doAdd(const TKey& key, const TValue& val)
- /// Adds the key value pair to the cache.
- /// If for the key already an entry exists, it will be overwritten.
- {
- Iterator it = _data.find(key);
- doRemove(it);
-
- KeyValueArgs<TKey, TValue> args(key, val);
- Add.notify(this, args);
- _data.insert(std::make_pair(key, SharedPtr<TValue>(new TValue(val))));
-
- doReplace();
- }
-
- void doAdd(const TKey& key, SharedPtr<TValue>& val)
- /// Adds the key value pair to the cache.
- /// If for the key already an entry exists, it will be overwritten.
- {
- Iterator it = _data.find(key);
- doRemove(it);
-
- KeyValueArgs<TKey, TValue> args(key, *val);
- Add.notify(this, args);
- _data.insert(std::make_pair(key, val));
-
- doReplace();
- }
-
- void doRemove(Iterator it)
- /// Removes an entry from the cache. If the entry is not found
- /// the remove is ignored.
- {
- if (it != _data.end())
- {
- Remove.notify(this, it->first);
- _data.erase(it);
- }
- }
-
- bool doHas(const TKey& key) const
- /// Returns true if the cache contains a value for the key
- {
- // ask the strategy if the key is valid
- ConstIterator it = _data.find(key);
- bool result = false;
-
- if (it != _data.end())
- {
- ValidArgs<TKey> args(key);
- IsValid.notify(this, args);
- result = args.isValid();
- }
-
- return result;
- }
-
- SharedPtr<TValue> doGet(const TKey& key)
- /// Returns a SharedPtr of the cache entry, returns 0 if for
- /// the key no value was found
- {
- Iterator it = _data.find(key);
- SharedPtr<TValue> result;
-
- if (it != _data.end())
- {
- // inform all strategies that a read-access to an element happens
- Get.notify(this, key);
- // ask all strategies if the key is valid
- ValidArgs<TKey> args(key);
- IsValid.notify(this, args);
-
- if (!args.isValid())
- {
- doRemove(it);
- }
- else
- {
- result = it->second;
- }
- }
-
- return result;
- }
-
- void doClear()
- {
- static EventArgs _emptyArgs;
- Clear.notify(this, _emptyArgs);
- _data.clear();
- }
-
- void doReplace()
- {
- std::set<TKey> delMe;
- Replace.notify(this, delMe);
- // delMe contains the to be removed elements
- typename std::set<TKey>::const_iterator it = delMe.begin();
- typename std::set<TKey>::const_iterator endIt = delMe.end();
-
- for (; it != endIt; ++it)
- {
- Iterator itH = _data.find(*it);
- doRemove(itH);
- }
- }
-
- TStrategy _strategy;
- mutable DataHolder _data;
- mutable FastMutex _mutex;
-
-private:
- AbstractCache(const AbstractCache& aCache);
- AbstractCache& operator = (const AbstractCache& aCache);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/AbstractDelegate.h b/Utilities/Poco/Foundation/include/Poco/AbstractDelegate.h
deleted file mode 100755
index 1c6af8f0b6..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AbstractDelegate.h
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// AbstractDelegate.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: AbstractDelegate
-//
-// Implementation of the AbstractDelegate template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_AbstractDelegate_INCLUDED
-#define Foundation_AbstractDelegate_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-template <class TArgs>
-class AbstractDelegate
- /// Interface for Delegate and Expire
- /// Very similar to AbstractPriorityDelegate but having two separate files (no inheritance)
- /// allows one to have compile-time checks when registering an observer
- /// instead of run-time checks.
-{
-public:
- AbstractDelegate(void* pTarget): _pTarget(pTarget)
- {
- poco_assert_dbg (_pTarget != 0);
- }
-
- AbstractDelegate(const AbstractDelegate& del): _pTarget(del._pTarget)
- {
- poco_assert_dbg (_pTarget != 0);
- }
-
- virtual ~AbstractDelegate()
- {
- }
-
- virtual bool notify(const void* sender, TArgs& arguments) = 0;
- /// Returns false, if the Delegate is no longer valid, thus indicating an expire
-
- virtual AbstractDelegate* clone() const = 0;
- /// Returns a deep-copy of the AbstractDelegate
-
- bool operator < (const AbstractDelegate<TArgs>& other) const
- /// For comparing AbstractDelegates in a collection.
- {
- return _pTarget < other._pTarget;
- }
-
- void* target() const
- {
- return _pTarget;
- }
-
-protected:
- void* _pTarget;
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/AbstractEvent.h b/Utilities/Poco/Foundation/include/Poco/AbstractEvent.h
deleted file mode 100755
index 05ceeb4ee2..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AbstractEvent.h
+++ /dev/null
@@ -1,333 +0,0 @@
-//
-// AbstractEvent.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: AbstractEvent
-//
-// Definition of the AbstractEvent class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_AbstractFoundation_INCLUDED
-#define Foundation_AbstractFoundation_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/SingletonHolder.h"
-#include "Poco/SharedPtr.h"
-#include "Poco/ActiveResult.h"
-#include "Poco/ActiveMethod.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-template <class TArgs, class TStrategy, class TDelegate>
-class AbstractEvent
- /// An AbstractEvent is the super-class of all events.
- /// It works similar to the way C# handles notifications (aka events in C#).
- /// Events can be used to send information to a set of observers
- /// which are registered at the event. The type of the data is specified with
- /// the template parameter TArgs. The TStrategy parameter must be a subclass
- /// of NotificationStrategy. The parameter TDelegate can either be a subclass of AbstractDelegate
- /// or of PriorityAbstractDelegate.
- ///
- /// Note that AbstractEvent should never be used directly. One ought to use
- /// one of its subclasses which set the TStrategy and TDelegate template parameters
- /// to fixed values. For most use-cases the BasicEvent template will be sufficient:
- /// #include "Poco/BasicEvent.h"
- /// #include "Poco/Delegate.h"
- ///
- /// If one requires delegates to be called in the order they registered, use FIFOEvent:
- /// #include "Poco/FIFOEvent.h"
- /// #include "Poco/Delegate.h"
- ///
- /// Both FIFOEvent and BasicEvent work with a standard delegate. They allow one object to register
- /// exactly one delegate at an event. In contrast, a PriorityDelegate comes with an attached priority value
- /// and allows one object to register for one priority value one delegate. Note that PriorityDelegates
- /// only work with PriorityEvents:
- /// #include "Poco/PriorityEvent.h"
- /// #include "Poco/PriorityDelegate.h"
- ///
- /// Use events by adding them as public members to the object which is throwing notifications:
- ///
- /// class MyData
- /// {
- /// public:
- /// Poco::BasicEvent<int> AgeChanged;
- ///
- /// MyData();
- /// ...
- /// };
- ///
- /// Throwing the event can be done either by the events notify() or notifyAsync() method:
- ///
- ///
- /// Alternatively, instead of notify(), operator () can be used.
- ///
- /// void MyData::setAge(int i)
- /// {
- /// this->_age = i;
- /// AgeChanged(this, this->_age);
- /// }
- ///
- /// Note that notify and notifyAsync do not catch exceptions, i.e. in case a delegate
- /// throws an exception, the notify is immediately aborted and the exception is thrown
- /// back to the caller.
- ///
- /// Delegates can register methods at the event. In the case of a BasicEvent or FIFOEvent
- /// the Delegate template is used, in case of an PriorityEvent a PriorityDelegate is used.
- /// Mixing of observers, e.g. using a PriorityDelegate with a BasicEvent is not possible and
- /// checked for during compile time.
- /// Events require the observers to follow one of the following method signature:
- ///
- /// void onEvent(const void* pSender, TArgs& args);
- /// void onEvent(TArgs& args);
- /// static void onEvent(const void* pSender, TArgs& args);
- /// static void onEvent(void* pSender, TArgs& args);
- /// static void onEvent(TArgs& args);
- ///
- /// For performance reasons arguments are always sent by reference. This also allows observers
- /// to modify the sent argument. To prevent that, use <const TArg> as template
- /// parameter. A non-conformant method signature leads to compile errors.
- ///
- /// Assuming that the observer meets the method signature requirement, it can register
- /// this method with the += operator:
- ///
- /// class MyController
- /// {
- /// protected:
- /// MyData _data;
- ///
- /// void onDataChanged(void* pSender, int& data);
- /// ...
- /// };
- ///
- /// MyController::MyController()
- /// {
- /// _data.AgeChanged += delegate(this, &MyController::onDataChanged);
- /// }
- ///
- /// In some cases it might be desirable to work with automatically expiring registrations. Simply add
- /// to delegate as 3rd parameter a expireValue (in milliseconds):
- ///
- /// _data.DataChanged += delegate(this, &MyController::onDataChanged, 1000);
- ///
- /// This will add a delegate to the event which will automatically be removed in 1000 millisecs.
- ///
- /// Unregistering happens via the -= operator. Forgetting to unregister a method will lead to
- /// segmentation faults later, when one tries to send a notify to a no longer existing object.
- ///
- /// MyController::~MyController()
- /// {
- /// _data.DataChanged -= delegate(this, &MyController::onDataChanged);
- /// }
- ///
- /// Working with PriorityDelegates as similar to working with BasicEvent/FIFOEvent.Instead of ''delegate''
- /// simply use ''priorityDelegate''.
- ///
- /// For further examples refer to the event testsuites.
-{
-public:
- AbstractEvent():
- _executeAsync(this, &AbstractEvent::executeAsyncImpl),
- _enabled(true)
- {
- }
-
- AbstractEvent(const TStrategy& strat):
- _executeAsync(this, &AbstractEvent::executeAsyncImpl),
- _strategy(strat),
- _enabled(true)
- {
- }
-
- virtual ~AbstractEvent()
- {
- }
-
- void operator += (const TDelegate& aDelegate)
- /// Adds a delegate to the event. If the observer is equal to an
- /// already existing one (determined by the < operator),
- /// it will simply replace the existing observer.
- /// This behavior is determined by the TStrategy. Current implementations
- /// (DefaultStrategy, FIFOStrategy) follow that guideline but future ones
- /// can deviate.
- {
- FastMutex::ScopedLock lock(_mutex);
- _strategy.add(aDelegate);
- }
-
- void operator -= (const TDelegate& aDelegate)
- /// Removes a delegate from the event. If the delegate is equal to an
- /// already existing one is determined by the < operator.
- /// If the observer is not found, the unregister will be ignored
- {
- FastMutex::ScopedLock lock(_mutex);
- _strategy.remove(aDelegate);
- }
-
- void operator () (const void* pSender, TArgs& args)
- {
- notify(pSender, args);
- }
-
- void notify(const void* pSender, TArgs& args)
- /// Sends a notification to all registered delegates. The order is
- /// determined by the TStrategy. This method is blocking. While executing,
- /// other objects can change the list of delegates. These changes don't
- /// influence the current active notifications but are activated with
- /// the next notify. If one of the delegates throws an exception, the notify
- /// method is immediately aborted and the exception is reported to the caller.
- {
- SharedPtr<TStrategy> ptrStrat;
- bool enabled = false;
-
- {
- FastMutex::ScopedLock lock(_mutex);
- enabled = _enabled;
- if (_enabled)
- {
- // thread-safeness:
- // copy should be faster and safer than blocking until
- // execution ends
- ptrStrat = new TStrategy(_strategy);
- }
- }
-
- if (enabled)
- {
- ptrStrat->notify(pSender, args);
- }
- }
-
- ActiveResult<TArgs> notifyAsync(const void* pSender, const TArgs& args)
- /// Sends a notification to all registered delegates. The order is
- /// determined by the TStrategy. This method is not blocking and will
- /// immediately return. The delegates are invoked in a seperate thread.
- /// Call activeResult.wait() to wait until the notification has ended.
- /// While executing, other objects can change the delegate list. These changes don't
- /// influence the current active notifications but are activated with
- /// the next notify. If one of the delegates throws an exception, the execution
- /// is aborted and the exception is reported to the caller.
- {
- NotifyAsyncParams params(pSender, args);
-
- {
- FastMutex::ScopedLock lock(_mutex);
-
- // thread-safeness:
- // copy should be faster and safer than blocking until
- // execution ends
- // make a copy of the strategy here to guarantee that
- // between notifyAsync and the execution of the method no changes can occur
-
- params.ptrStrat = SharedPtr<TStrategy>(new TStrategy(_strategy));
- params.enabled = _enabled;
- }
-
- ActiveResult<TArgs> result = _executeAsync(params);
- return result;
- }
-
- void enable()
- /// Enables the event
- {
- FastMutex::ScopedLock lock(_mutex);
- _enabled = true;
- }
-
- void disable()
- /// Disables the event. notify and notifyAsnyc will be ignored,
- /// but adding/removing delegates is still allowed.
- {
- FastMutex::ScopedLock lock(_mutex);
- _enabled = false;
- }
-
- bool isEnabled() const
- {
- FastMutex::ScopedLock lock(_mutex);
- return _enabled;
- }
-
- void clear()
- /// Removes all delegates.
- {
- FastMutex::ScopedLock lock(_mutex);
- _strategy.clear();
- }
-
-protected:
- struct NotifyAsyncParams
- {
- SharedPtr<TStrategy> ptrStrat;
- const void* pSender;
- TArgs args;
- bool enabled;
-
- NotifyAsyncParams(const void* pSend, const TArgs& a):ptrStrat(), pSender(pSend), args(a), enabled(true)
- /// default constructor reduces the need for TArgs to have an empty constructor, only copy constructor is needed.
- {
- }
- };
-
- ActiveMethod<TArgs, NotifyAsyncParams, AbstractEvent> _executeAsync;
-
- TArgs executeAsyncImpl(const NotifyAsyncParams& par)
- {
- if (!par.enabled)
- {
- return par.args;
- }
-
- NotifyAsyncParams params = par;
- TArgs retArgs(params.args);
- params.ptrStrat->notify(params.pSender, retArgs);
- return retArgs;
- }
-
- TStrategy _strategy; /// The strategy used to notify observers.
- bool _enabled; /// Stores if an event is enabled. Notfies on disabled events have no effect
- /// but it is possible to change the observers.
- mutable FastMutex _mutex;
-
-private:
- AbstractEvent(const AbstractEvent& other);
- AbstractEvent& operator = (const AbstractEvent& other);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/AbstractObserver.h b/Utilities/Poco/Foundation/include/Poco/AbstractObserver.h
deleted file mode 100755
index 3e71f34e59..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AbstractObserver.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// AbstractObserver.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: NotificationCenter
-//
-// Definition of the AbstractObserver class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_AbstractObserver_INCLUDED
-#define Foundation_AbstractObserver_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Notification.h"
-
-
-namespace Poco {
-
-
-class Foundation_API AbstractObserver
- /// The base class for all instantiations of
- /// the Observer and NObserver template classes.
-{
-public:
- AbstractObserver();
- AbstractObserver(const AbstractObserver& observer);
- virtual ~AbstractObserver();
-
- AbstractObserver& operator = (const AbstractObserver& observer);
-
- virtual void notify(Notification* pNf) const = 0;
- virtual bool equals(const AbstractObserver& observer) const = 0;
- virtual bool accepts(Notification* pNf) const = 0;
- virtual AbstractObserver* clone() const = 0;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_AbstractObserver_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/AbstractPriorityDelegate.h b/Utilities/Poco/Foundation/include/Poco/AbstractPriorityDelegate.h
deleted file mode 100755
index 4bcff57925..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AbstractPriorityDelegate.h
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// AbstractPriorityDelegate.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: AbstractPriorityDelegate
-//
-// Implementation of the AbstractPriorityDelegate template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_AbstractPriorityDelegate_INCLUDED
-#define Foundation_AbstractPriorityDelegate_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-template <class TArgs>
-class AbstractPriorityDelegate
- /// Interface for PriorityDelegate and PriorityExpire.
- /// Very similar to AbstractDelegate but having two separate files (no inheritance)
- /// allows to have compile-time checks when registering an observer
- /// instead of run-time checks.
-{
-public:
- AbstractPriorityDelegate(void* pTarget, int prio):
- _pTarget(pTarget),
- _priority(prio)
- {
- }
-
- AbstractPriorityDelegate(const AbstractPriorityDelegate& del):
- _pTarget(del._pTarget),
- _priority(del._priority)
- {
- }
-
- virtual ~AbstractPriorityDelegate()
- {
- }
-
- virtual bool notify(const void* sender, TArgs & arguments) = 0;
- /// Returns false, if the Delegate is no longer valid, thus indicating an expire
-
- virtual AbstractPriorityDelegate* clone() const = 0;
- // Returns a deep-copy of the object.
-
- bool operator < (const AbstractPriorityDelegate<TArgs>& other) const
- /// Operator used for comparing AbstractPriorityDelegates in a collection.
- {
- if (_priority == other._priority)
- {
- return _pTarget < other._pTarget;
- }
-
- return (_priority < other._priority);
- }
-
- void* target() const
- {
- return _pTarget;
- }
-
- int priority() const
- {
- return _priority;
- }
-
-protected:
- void* _pTarget;
- int _priority;
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/AbstractStrategy.h b/Utilities/Poco/Foundation/include/Poco/AbstractStrategy.h
deleted file mode 100755
index 8da1aca27e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AbstractStrategy.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// AbstractStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: AbstractCache
-//
-// Definition of the AbstractStrategy class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_AbstractStrategy_INCLUDED
-#define Foundation_AbstractStrategy_INCLUDED
-
-
-#include "Poco/KeyValueArgs.h"
-#include "Poco/ValidArgs.h"
-#include "Poco/EventArgs.h"
-
-
-namespace Poco {
-
-
-template <class TKey, class TValue>
-class AbstractStrategy
- /// An AbstractStrategy is the interface for all strategies.
-{
-public:
- AbstractStrategy()
- {
- }
-
- virtual ~AbstractStrategy()
- {
- }
-
- virtual void onAdd(const void* pSender, const KeyValueArgs <TKey, TValue>& key) = 0;
- /// Adds the key to the strategy.
- /// If for the key already an entry exists, an excpetion will be thrown.
-
- virtual void onRemove(const void* pSender, const TKey& key) = 0;
- /// Removes an entry from the strategy. If the entry is not found
- /// the remove is ignored.
-
- virtual void onGet(const void* pSender, const TKey& key) = 0;
- /// Informs the strategy that a read-access happens to an element.
-
- virtual void onClear(const void* pSender, const EventArgs& args) = 0;
- /// Removes all elements from the cache.
-
- virtual void onIsValid(const void* pSender, ValidArgs<TKey>& key) = 0;
- /// Used to query if a key is still valid (i.e. cached).
-
- virtual void onReplace(const void* pSender, std::set<TKey>& elemsToRemove) = 0;
- /// Used by the Strategy to indicate which elements should be removed from
- /// the cache. Note that onReplace does not change the current list of keys.
- /// The cache object is reponsible to remove the elements.
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/AccessExpirationDecorator.h b/Utilities/Poco/Foundation/include/Poco/AccessExpirationDecorator.h
deleted file mode 100755
index d4eca9c69c..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AccessExpirationDecorator.h
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// AccessExpirationDecorator.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: AccessExpirationDecorator
-//
-// Implementation of the AccessExpirationDecorator template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_AccessExpirationDecorator_INCLUDED
-#define Foundation_AccessExpirationDecorator_INCLUDED
-
-
-#include "Poco/Timestamp.h"
-#include "Poco/Timespan.h"
-
-
-namespace Poco {
-
-
-template <typename TArgs>
-class AccessExpirationDecorator
- /// AccessExpirationDecorator adds an expiration method to values so that they can be used
- /// with the UniqueAccessExpireCache
-{
-public:
- AccessExpirationDecorator():
- _value(),
- _span()
- {
- }
-
- AccessExpirationDecorator(const TArgs& p, const Poco::Timespan::TimeDiff& diffInMs):
- /// Creates an element that will expire in diff milliseconds
- _value(p),
- _span(diffInMs*1000)
- {
- }
-
- AccessExpirationDecorator(const TArgs& p, const Poco::Timespan& timeSpan):
- /// Creates an element that will expire after the given timeSpan
- _value(p),
- _span(timeSpan)
- {
- }
-
-
- ~AccessExpirationDecorator()
- {
- }
-
- const Poco::Timespan& getTimeout() const
- {
- return _span;
- }
-
- const TArgs& value() const
- {
- return _value;
- }
-
- TArgs& value()
- {
- return _value;
- }
-
-private:
- TArgs _value;
- Timespan _span;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_AccessExpirationDecorator_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/AccessExpireCache.h b/Utilities/Poco/Foundation/include/Poco/AccessExpireCache.h
deleted file mode 100755
index e75e9cd306..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AccessExpireCache.h
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// AccessExpireCache.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: AccessExpireCache
-//
-// Definition of the AccessExpireCache class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_AccessExpireCache_INCLUDED
-#define Foundation_AccessExpireCache_INCLUDED
-
-
-#include "Poco/AbstractCache.h"
-#include "Poco/AccessExpireStrategy.h"
-
-
-namespace Poco {
-
-
-template <class TKey, class TValue>
-class AccessExpireCache: public AbstractCache<TKey, TValue, AccessExpireStrategy<TKey, TValue> >
- /// An AccessExpireCache caches entries for a fixed time period (per default 10 minutes).
- /// Entries expire when they are not accessed with get() during this time period. Each access resets
- /// the start time for expiration.
- /// Be careful when using an AccessExpireCache. A cache is often used
- /// like cache.has(x) followed by cache.get x). Note that it could happen
- /// that the "has" call works, then the current execution thread gets descheduled, time passes,
- /// the entry gets invalid, thus leading to an empty SharedPtr being returned
- /// when "get" is invoked.
-{
-public:
- AccessExpireCache(Timestamp::TimeDiff expire = 600000):
- AbstractCache<TKey, TValue, AccessExpireStrategy<TKey, TValue> >(AccessExpireStrategy<TKey, TValue>(expire))
- {
- }
-
- ~AccessExpireCache()
- {
- }
-
-private:
- AccessExpireCache(const AccessExpireCache& aCache);
- AccessExpireCache& operator = (const AccessExpireCache& aCache);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_AccessExpireCache_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/AccessExpireLRUCache.h b/Utilities/Poco/Foundation/include/Poco/AccessExpireLRUCache.h
deleted file mode 100755
index c5120ce9a2..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AccessExpireLRUCache.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// AccessExpireLRUCache.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: AccessExpireLRUCache
-//
-// Definition of the AccessExpireLRUCache class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_AccessExpireLRUCache_INCLUDED
-#define Foundation_AccessExpireLRUCache_INCLUDED
-
-
-#include "Poco/AbstractCache.h"
-#include "Poco/StrategyCollection.h"
-#include "Poco/AccessExpireStrategy.h"
-#include "Poco/LRUStrategy.h"
-
-
-namespace Poco {
-
-
-template <
- class TKey,
- class TValue
->
-class AccessExpireLRUCache: public AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue> >
- /// An AccessExpireLRUCache combines LRU caching and time based expire caching.
- /// It cache entries for a fixed time period (per default 10 minutes)
- /// but also limits the size of the cache (per default: 1024).
-{
-public:
- AccessExpireLRUCache(long cacheSize = 1024, Timestamp::TimeDiff expire = 600000):
- AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue> >(StrategyCollection<TKey, TValue>())
- {
- this->_strategy.pushBack(new LRUStrategy<TKey, TValue>(cacheSize));
- this->_strategy.pushBack(new AccessExpireStrategy<TKey, TValue>(expire));
- }
-
- ~AccessExpireLRUCache()
- {
- }
-
-private:
- AccessExpireLRUCache(const AccessExpireLRUCache& aCache);
- AccessExpireLRUCache& operator = (const AccessExpireLRUCache& aCache);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_AccessExpireLRUCache_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/AccessExpireStrategy.h b/Utilities/Poco/Foundation/include/Poco/AccessExpireStrategy.h
deleted file mode 100755
index a32700a417..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AccessExpireStrategy.h
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// AccessExpireStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: AccessExpireStrategy
-//
-// Definition of the AccessExpireStrategy class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_AccessExpireStrategy_INCLUDED
-#define Foundation_AccessExpireStrategy_INCLUDED
-
-
-#include "Poco/KeyValueArgs.h"
-#include "Poco/ValidArgs.h"
-#include "Poco/ExpireStrategy.h"
-#include "Poco/Bugcheck.h"
-#include "Poco/Timestamp.h"
-#include "Poco/EventArgs.h"
-#include <set>
-#include <map>
-
-
-namespace Poco {
-
-
-template <
- class TKey,
- class TValue
->
-class AccessExpireStrategy: public ExpireStrategy<TKey, TValue>
- /// An AccessExpireStrategy implements time and access based expiration of cache entries
-{
-public:
- AccessExpireStrategy(Timestamp::TimeDiff expireTimeInMilliSec): ExpireStrategy<TKey, TValue>(expireTimeInMilliSec)
- /// Create an expire strategy. Note that the smallest allowed caching time is 25ms.
- /// Anything lower than that is not useful with current operating systems.
- {
- }
-
- ~AccessExpireStrategy()
- {
- }
-
- void onGet(const void*, const TKey& key)
- {
- // get triggers an update to the expiration time
- typename ExpireStrategy<TKey, TValue>::Iterator it = this->_keys.find(key);
- if (it != this->_keys.end())
- {
- this->_keyIndex.erase(it->second);
- Timestamp now;
- typename ExpireStrategy<TKey, TValue>::IndexIterator itIdx =
- this->_keyIndex.insert(typename ExpireStrategy<TKey, TValue>::TimeIndex::value_type(now, key));
- it->second = itIdx;
- }
- }
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_AccessExpireStrategy_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ActiveDispatcher.h b/Utilities/Poco/Foundation/include/Poco/ActiveDispatcher.h
deleted file mode 100755
index 1f8f79f401..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ActiveDispatcher.h
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// ActiveDispatcher.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ActiveObjects
-//
-// Definition of the ActiveDispatcher class.
-//
-// Copyright (c) 2006-2007, 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.
-//
-
-
-#ifndef Foundation_ActiveDispatcher_INCLUDED
-#define Foundation_ActiveDispatcher_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Runnable.h"
-#include "Poco/Thread.h"
-#include "Poco/ActiveStarter.h"
-#include "Poco/ActiveRunnable.h"
-#include "Poco/NotificationQueue.h"
-
-
-namespace Poco {
-
-
-class Foundation_API ActiveDispatcher: protected Runnable
- /// This class is used to implement an active object
- /// with strictly serialized method execution.
- ///
- /// An active object, with is an ordinary object
- /// containing ActiveMethod members, executes all
- /// active methods in their own thread.
- /// This behavior does not fit the "classic"
- /// definition of an active object, which serializes
- /// the execution of active methods (in other words,
- /// only one active method can be running at any given
- /// time).
- ///
- /// Using this class as a base class, the serializing
- /// behavior for active objects can be implemented.
- ///
- /// The following example shows how this is done:
- ///
- /// class ActiveObject: public ActiveDispatcher
- /// {
- /// public:
- /// ActiveObject():
- /// exampleActiveMethod(this, &ActiveObject::exampleActiveMethodImpl)
- /// {
- /// }
- ///
- /// ActiveMethod<std::string, std::string, ActiveObject, ActiveStarter<ActiveDispatcher> > exampleActiveMethod;
- ///
- /// protected:
- /// std::string exampleActiveMethodImpl(const std::string& arg)
- /// {
- /// ...
- /// }
- /// };
- ///
- /// The only things different from the example in
- /// ActiveMethod is that the ActiveObject in this case
- /// inherits from ActiveDispatcher, and that the ActiveMethod
- /// template for exampleActiveMethod has an additional parameter,
- /// specifying the specialized ActiveStarter for ActiveDispatcher.
-{
-public:
- ActiveDispatcher();
- /// Creates the ActiveDispatcher.
-
- ActiveDispatcher(Thread::Priority prio);
- /// Creates the ActiveDispatcher and sets
- /// the priority of its thread.
-
- virtual ~ActiveDispatcher();
- /// Destroys the ActiveDispatcher.
-
- void start(ActiveRunnableBase::Ptr pRunnable);
- /// Adds the Runnable to the dispatch queue.
-
- void cancel();
- /// Cancels all queued methods.
-
-protected:
- void run();
- void stop();
-
-private:
- Thread _thread;
- NotificationQueue _queue;
-};
-
-
-template <>
-class ActiveStarter<ActiveDispatcher>
- /// A specialization of ActiveStarter
- /// for ActiveDispatcher.
-{
-public:
- static void start(ActiveDispatcher* pOwner, ActiveRunnableBase::Ptr pRunnable)
- {
- pOwner->start(pRunnable);
- }
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ActiveDispatcher_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ActiveMethod.h b/Utilities/Poco/Foundation/include/Poco/ActiveMethod.h
deleted file mode 100755
index d57f44ad8d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ActiveMethod.h
+++ /dev/null
@@ -1,240 +0,0 @@
-//
-// ActiveMethod.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ActiveObjects
-//
-// Definition of the ActiveMethod class.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_ActiveMethod_INCLUDED
-#define Foundation_ActiveMethod_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/ActiveResult.h"
-#include "Poco/ActiveRunnable.h"
-#include "Poco/ActiveStarter.h"
-#include "Poco/AutoPtr.h"
-
-
-namespace Poco {
-
-
-template <class ResultType, class ArgType, class OwnerType, class StarterType = ActiveStarter<OwnerType> >
-class ActiveMethod
- /// An active method is a method that, when called, executes
- /// in its own thread. ActiveMethod's take exactly one
- /// argument and can return a value. To pass more than one
- /// argument to the method, use a struct.
- /// The following example shows how to add an ActiveMethod
- /// to a class:
- ///
- /// class ActiveObject
- /// {
- /// public:
- /// ActiveObject():
- /// exampleActiveMethod(this, &ActiveObject::exampleActiveMethodImpl)
- /// {
- /// }
- ///
- /// ActiveMethod<std::string, std::string, ActiveObject> exampleActiveMethod;
- ///
- /// protected:
- /// std::string exampleActiveMethodImpl(const std::string& arg)
- /// {
- /// ...
- /// }
- /// };
- ///
- /// And following is an example that shows how to invoke an ActiveMethod.
- ///
- /// ActiveObject myActiveObject;
- /// ActiveResult<std::string> result = myActiveObject.exampleActiveMethod("foo");
- /// ...
- /// result.wait();
- /// std::cout << result.data() << std::endl;
- ///
- /// The way an ActiveMethod is started can be changed by passing a StarterType
- /// template argument with a corresponding class. The default ActiveStarter
- /// starts the method in its own thread, obtained from a thread pool.
- ///
- /// For an alternative implementation of StarterType, see ActiveDispatcher.
- ///
- /// For methods that do not require an argument or a return value, the Void
- /// class can be used.
-{
-public:
- typedef ResultType (OwnerType::*Callback)(const ArgType&);
- typedef ActiveResult<ResultType> ActiveResultType;
- typedef ActiveRunnable<ResultType, ArgType, OwnerType> ActiveRunnableType;
-
- ActiveMethod(OwnerType* pOwner, Callback method):
- _pOwner(pOwner),
- _method(method)
- /// Creates an ActiveMethod object.
- {
- poco_check_ptr (pOwner);
- }
-
- ActiveResultType operator () (const ArgType& arg)
- /// Invokes the ActiveMethod.
- {
- ActiveResultType result(new ActiveResultHolder<ResultType>());
- ActiveRunnableBase::Ptr pRunnable(new ActiveRunnableType(_pOwner, _method, arg, result));
- StarterType::start(_pOwner, pRunnable);
- return result;
- }
-
- ActiveMethod(const ActiveMethod& other):
- _pOwner(other._pOwner),
- _method(other._method)
- {
- }
-
- ActiveMethod& operator = (const ActiveMethod& other)
- {
- ActiveMethod tmp(other);
- swap(tmp);
- return *this;
- }
-
- void swap(ActiveMethod& other)
- {
- std::swap(_pOwner, other._pOwner);
- std::swap(_method, other._method);
- }
-
-private:
- ActiveMethod();
-
- OwnerType* _pOwner;
- Callback _method;
-};
-
-
-
-template <class ResultType, class OwnerType, class StarterType>
-class ActiveMethod <ResultType, void, OwnerType, StarterType>
- /// An active method is a method that, when called, executes
- /// in its own thread. ActiveMethod's take exactly one
- /// argument and can return a value. To pass more than one
- /// argument to the method, use a struct.
- /// The following example shows how to add an ActiveMethod
- /// to a class:
- ///
- /// class ActiveObject
- /// {
- /// public:
- /// ActiveObject():
- /// exampleActiveMethod(this, &ActiveObject::exampleActiveMethodImpl)
- /// {
- /// }
- ///
- /// ActiveMethod<std::string, std::string, ActiveObject> exampleActiveMethod;
- ///
- /// protected:
- /// std::string exampleActiveMethodImpl(const std::string& arg)
- /// {
- /// ...
- /// }
- /// };
- ///
- /// And following is an example that shows how to invoke an ActiveMethod.
- ///
- /// ActiveObject myActiveObject;
- /// ActiveResult<std::string> result = myActiveObject.exampleActiveMethod("foo");
- /// ...
- /// result.wait();
- /// std::cout << result.data() << std::endl;
- ///
- /// The way an ActiveMethod is started can be changed by passing a StarterType
- /// template argument with a corresponding class. The default ActiveStarter
- /// starts the method in its own thread, obtained from a thread pool.
- ///
- /// For an alternative implementation of StarterType, see ActiveDispatcher.
- ///
- /// For methods that do not require an argument or a return value, simply use void.
-{
-public:
- typedef ResultType (OwnerType::*Callback)(void);
- typedef ActiveResult<ResultType> ActiveResultType;
- typedef ActiveRunnable<ResultType, void, OwnerType> ActiveRunnableType;
-
- ActiveMethod(OwnerType* pOwner, Callback method):
- _pOwner(pOwner),
- _method(method)
- /// Creates an ActiveMethod object.
- {
- poco_check_ptr (pOwner);
- }
-
- ActiveResultType operator () (void)
- /// Invokes the ActiveMethod.
- {
- ActiveResultType result(new ActiveResultHolder<ResultType>());
- ActiveRunnableBase::Ptr pRunnable(new ActiveRunnableType(_pOwner, _method, result));
- StarterType::start(_pOwner, pRunnable);
- return result;
- }
-
- ActiveMethod(const ActiveMethod& other):
- _pOwner(other._pOwner),
- _method(other._method)
- {
- }
-
- ActiveMethod& operator = (const ActiveMethod& other)
- {
- ActiveMethod tmp(other);
- swap(tmp);
- return *this;
- }
-
- void swap(ActiveMethod& other)
- {
- std::swap(_pOwner, other._pOwner);
- std::swap(_method, other._method);
- }
-
-private:
- ActiveMethod();
-
- OwnerType* _pOwner;
- Callback _method;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ActiveMethod_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ActiveResult.h b/Utilities/Poco/Foundation/include/Poco/ActiveResult.h
deleted file mode 100755
index 6946292984..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ActiveResult.h
+++ /dev/null
@@ -1,517 +0,0 @@
-//
-// ActiveResult.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ActiveObjects
-//
-// Definition of the ActiveResult class.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_ActiveResult_INCLUDED
-#define Foundation_ActiveResult_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-#include "Poco/Event.h"
-#include "Poco/RefCountedObject.h"
-#include "Poco/Exception.h"
-#include <algorithm>
-
-
-namespace Poco {
-
-
-template <class ResultType>
-class ActiveResultHolder: public RefCountedObject
- /// This class holds the result of an asynchronous method
- /// invocation. It is used to pass the result from the
- /// execution thread back to the invocation thread.
- /// The class uses reference counting for memory management.
- /// Do not use this class directly, use ActiveResult instead.
-{
-public:
- ActiveResultHolder():
- _pData(0),
- _pExc(0),
- _event(false)
- /// Creates an ActiveResultHolder.
- {
- }
-
- ResultType& data()
- /// Returns a reference to the actual result.
- {
- poco_check_ptr(_pData);
- return *_pData;
- }
-
- void data(ResultType* pData)
- {
- delete _pData;
- _pData = pData;
- }
-
- void wait()
- /// Pauses the caller until the result becomes available.
- {
- _event.wait();
- }
-
- bool tryWait(long milliseconds)
- /// Waits up to the specified interval for the result to
- /// become available. Returns true if the result became
- /// available, false otherwise.
- {
- return _event.tryWait(milliseconds);
- }
-
- void wait(long milliseconds)
- /// Waits up to the specified interval for the result to
- /// become available. Throws a TimeoutException if the
- /// result did not became available.
- {
- _event.wait(milliseconds);
- }
-
- void notify()
- /// Notifies the invoking thread that the result became available.
- {
- _event.set();
- }
-
- bool failed() const
- /// Returns true if the active method failed (and threw an exception).
- /// Information about the exception can be obtained by calling error().
- {
- return _pExc != 0;
- }
-
- std::string error() const
- /// If the active method threw an exception, a textual representation
- /// of the exception is returned. An empty string is returned if the
- /// active method completed successfully.
- {
- if (_pExc)
- return _pExc->message();
- else
- return std::string();
- }
-
- Exception* exception() const
- /// If the active method threw an exception, a clone of the exception
- /// object is returned, otherwise null.
- {
- return _pExc;
- }
-
- void error(const Exception& exc)
- /// Sets the exception.
- {
- delete _pExc;
- _pExc = exc.clone();
- }
-
- void error(const std::string& msg)
- /// Sets the exception.
- {
- delete _pExc;
- _pExc = new UnhandledException(msg);
- }
-
-protected:
- ~ActiveResultHolder()
- {
- delete _pData;
- delete _pExc;
- }
-
-private:
- ResultType* _pData;
- Exception* _pExc;
- Event _event;
-};
-
-
-
-template <>
-class ActiveResultHolder<void>: public RefCountedObject
-{
-public:
- ActiveResultHolder():
- _pExc(0),
- _event(false)
- /// Creates an ActiveResultHolder.
- {
- }
-
- void wait()
- /// Pauses the caller until the result becomes available.
- {
- _event.wait();
- }
-
- bool tryWait(long milliseconds)
- /// Waits up to the specified interval for the result to
- /// become available. Returns true if the result became
- /// available, false otherwise.
- {
- return _event.tryWait(milliseconds);
- }
-
- void wait(long milliseconds)
- /// Waits up to the specified interval for the result to
- /// become available. Throws a TimeoutException if the
- /// result did not became available.
- {
- _event.wait(milliseconds);
- }
-
- void notify()
- /// Notifies the invoking thread that the result became available.
- {
- _event.set();
- }
-
- bool failed() const
- /// Returns true if the active method failed (and threw an exception).
- /// Information about the exception can be obtained by calling error().
- {
- return _pExc != 0;
- }
-
- std::string error() const
- /// If the active method threw an exception, a textual representation
- /// of the exception is returned. An empty string is returned if the
- /// active method completed successfully.
- {
- if (_pExc)
- return _pExc->message();
- else
- return std::string();
- }
-
- Exception* exception() const
- /// If the active method threw an exception, a clone of the exception
- /// object is returned, otherwise null.
- {
- return _pExc;
- }
-
- void error(const Exception& exc)
- /// Sets the exception.
- {
- delete _pExc;
- _pExc = exc.clone();
- }
-
- void error(const std::string& msg)
- /// Sets the exception.
- {
- delete _pExc;
- _pExc = new UnhandledException(msg);
- }
-
-protected:
- ~ActiveResultHolder()
- {
- delete _pExc;
- }
-
-private:
- Exception* _pExc;
- Event _event;
-};
-
-
-template <class RT>
-class ActiveResult
- /// This class holds the result of an asynchronous method
- /// invocation (see class ActiveMethod). It is used to pass the
- /// result from the execution thread back to the invocation thread.
-{
-public:
- typedef RT ResultType;
- typedef ActiveResultHolder<ResultType> ActiveResultHolderType;
-
- ActiveResult(ActiveResultHolderType* pHolder):
- _pHolder(pHolder)
- /// Creates the active result. For internal use only.
- {
- poco_check_ptr (pHolder);
- }
-
- ActiveResult(const ActiveResult& result)
- /// Copy constructor.
- {
- _pHolder = result._pHolder;
- _pHolder->duplicate();
- }
-
- ~ActiveResult()
- /// Destroys the result.
- {
- _pHolder->release();
- }
-
- ActiveResult& operator = (const ActiveResult& result)
- /// Assignment operator.
- {
- ActiveResult tmp(result);
- swap(tmp);
- return *this;
- }
-
- void swap(ActiveResult& result)
- {
- using std::swap;
- swap(_pHolder, result._pHolder);
- }
-
- ResultType& data() const
- /// Returns a reference to the result data.
- {
- return _pHolder->data();
- }
-
- void data(ResultType* pValue)
- {
- _pHolder->data(pValue);
- }
-
- void wait()
- /// Pauses the caller until the result becomes available.
- {
- _pHolder->wait();
- }
-
- bool tryWait(long milliseconds)
- /// Waits up to the specified interval for the result to
- /// become available. Returns true if the result became
- /// available, false otherwise.
- {
- return _pHolder->tryWait(milliseconds);
- }
-
- void wait(long milliseconds)
- /// Waits up to the specified interval for the result to
- /// become available. Throws a TimeoutException if the
- /// result did not became available.
- {
- _pHolder->wait(milliseconds);
- }
-
- bool available() const
- /// Returns true if a result is available.
- {
- return _pHolder->tryWait(0);
- }
-
- bool failed() const
- /// Returns true if the active method failed (and threw an exception).
- /// Information about the exception can be obtained by calling error().
- {
- return _pHolder->failed();
- }
-
- std::string error() const
- /// If the active method threw an exception, a textual representation
- /// of the exception is returned. An empty string is returned if the
- /// active method completed successfully.
- {
- return _pHolder->error();
- }
-
- Exception* exception() const
- /// If the active method threw an exception, a clone of the exception
- /// object is returned, otherwise null.
- {
- return _pHolder->exception();
- }
-
- void notify()
- /// Notifies the invoking thread that the result became available.
- /// For internal use only.
- {
- _pHolder->notify();
- }
-
- ResultType& data()
- /// Returns a non-const reference to the result data. For internal
- /// use only.
- {
- return _pHolder->data();
- }
-
- void error(const std::string& msg)
- /// Sets the failed flag and the exception message.
- {
- _pHolder->error(msg);
- }
-
- void error(const Exception& exc)
- /// Sets the failed flag and the exception message.
- {
- _pHolder->error(exc);
- }
-
-private:
- ActiveResult();
-
- ActiveResultHolderType* _pHolder;
-};
-
-
-
-template <>
-class ActiveResult<void>
- /// This class holds the result of an asynchronous method
- /// invocation (see class ActiveMethod). It is used to pass the
- /// result from the execution thread back to the invocation thread.
-{
-public:
- typedef ActiveResultHolder<void> ActiveResultHolderType;
-
- ActiveResult(ActiveResultHolderType* pHolder):
- _pHolder(pHolder)
- /// Creates the active result. For internal use only.
- {
- poco_check_ptr (pHolder);
- }
-
- ActiveResult(const ActiveResult& result)
- /// Copy constructor.
- {
- _pHolder = result._pHolder;
- _pHolder->duplicate();
- }
-
- ~ActiveResult()
- /// Destroys the result.
- {
- _pHolder->release();
- }
-
- ActiveResult& operator = (const ActiveResult& result)
- /// Assignment operator.
- {
- ActiveResult tmp(result);
- swap(tmp);
- return *this;
- }
-
- void swap(ActiveResult& result)
- {
- using std::swap;
- swap(_pHolder, result._pHolder);
- }
-
- void wait()
- /// Pauses the caller until the result becomes available.
- {
- _pHolder->wait();
- }
-
- bool tryWait(long milliseconds)
- /// Waits up to the specified interval for the result to
- /// become available. Returns true if the result became
- /// available, false otherwise.
- {
- return _pHolder->tryWait(milliseconds);
- }
-
- void wait(long milliseconds)
- /// Waits up to the specified interval for the result to
- /// become available. Throws a TimeoutException if the
- /// result did not became available.
- {
- _pHolder->wait(milliseconds);
- }
-
- bool available() const
- /// Returns true if a result is available.
- {
- return _pHolder->tryWait(0);
- }
-
- bool failed() const
- /// Returns true if the active method failed (and threw an exception).
- /// Information about the exception can be obtained by calling error().
- {
- return _pHolder->failed();
- }
-
- std::string error() const
- /// If the active method threw an exception, a textual representation
- /// of the exception is returned. An empty string is returned if the
- /// active method completed successfully.
- {
- return _pHolder->error();
- }
-
- Exception* exception() const
- /// If the active method threw an exception, a clone of the exception
- /// object is returned, otherwise null.
- {
- return _pHolder->exception();
- }
-
- void notify()
- /// Notifies the invoking thread that the result became available.
- /// For internal use only.
- {
- _pHolder->notify();
- }
-
- void error(const std::string& msg)
- /// Sets the failed flag and the exception message.
- {
- _pHolder->error(msg);
- }
-
- void error(const Exception& exc)
- /// Sets the failed flag and the exception message.
- {
- _pHolder->error(exc);
- }
-
-private:
- ActiveResult();
-
- ActiveResultHolderType* _pHolder;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ActiveResult_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ActiveRunnable.h b/Utilities/Poco/Foundation/include/Poco/ActiveRunnable.h
deleted file mode 100755
index 5157247d1a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ActiveRunnable.h
+++ /dev/null
@@ -1,253 +0,0 @@
-//
-// ActiveRunnable.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ActiveObjects
-//
-// Definition of the ActiveRunnable class.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_ActiveRunnable_INCLUDED
-#define Foundation_ActiveRunnable_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/ActiveResult.h"
-#include "Poco/Runnable.h"
-#include "Poco/RefCountedObject.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-class ActiveRunnableBase: public Runnable, public RefCountedObject
- /// The base class for all ActiveRunnable instantiations.
-{
-public:
- typedef AutoPtr<ActiveRunnableBase> Ptr;
-};
-
-
-template <class ResultType, class ArgType, class OwnerType>
-class ActiveRunnable: public ActiveRunnableBase
- /// This class is used by ActiveMethod.
- /// See the ActiveMethod class for more information.
-{
-public:
- typedef ResultType (OwnerType::*Callback)(const ArgType&);
- typedef ActiveResult<ResultType> ActiveResultType;
-
- ActiveRunnable(OwnerType* pOwner, Callback method, const ArgType& arg, const ActiveResultType& result):
- _pOwner(pOwner),
- _method(method),
- _arg(arg),
- _result(result)
- {
- poco_check_ptr (pOwner);
- }
-
- void run()
- {
- ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
- try
- {
- _result.data(new ResultType((_pOwner->*_method)(_arg)));
- }
- catch (Exception& e)
- {
- _result.error(e);
- }
- catch (std::exception& e)
- {
- _result.error(e.what());
- }
- catch (...)
- {
- _result.error("unknown exception");
- }
- _result.notify();
- }
-
-private:
- OwnerType* _pOwner;
- Callback _method;
- ArgType _arg;
- ActiveResultType _result;
-};
-
-
-template <class ArgType, class OwnerType>
-class ActiveRunnable<void, ArgType, OwnerType>: public ActiveRunnableBase
- /// This class is used by ActiveMethod.
- /// See the ActiveMethod class for more information.
-{
-public:
- typedef void (OwnerType::*Callback)(const ArgType&);
- typedef ActiveResult<void> ActiveResultType;
-
- ActiveRunnable(OwnerType* pOwner, Callback method, const ArgType& arg, const ActiveResultType& result):
- _pOwner(pOwner),
- _method(method),
- _arg(arg),
- _result(result)
- {
- poco_check_ptr (pOwner);
- }
-
- void run()
- {
- ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
- try
- {
- (_pOwner->*_method)(_arg);
- }
- catch (Exception& e)
- {
- _result.error(e);
- }
- catch (std::exception& e)
- {
- _result.error(e.what());
- }
- catch (...)
- {
- _result.error("unknown exception");
- }
- _result.notify();
- }
-
-private:
- OwnerType* _pOwner;
- Callback _method;
- ArgType _arg;
- ActiveResultType _result;
-};
-
-
-template <class ResultType, class OwnerType>
-class ActiveRunnable<ResultType, void, OwnerType>: public ActiveRunnableBase
- /// This class is used by ActiveMethod.
- /// See the ActiveMethod class for more information.
-{
-public:
- typedef ResultType (OwnerType::*Callback)();
- typedef ActiveResult<ResultType> ActiveResultType;
-
- ActiveRunnable(OwnerType* pOwner, Callback method, const ActiveResultType& result):
- _pOwner(pOwner),
- _method(method),
- _result(result)
- {
- poco_check_ptr (pOwner);
- }
-
- void run()
- {
- ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
- try
- {
- _result.data(new ResultType((_pOwner->*_method)()));
- }
- catch (Exception& e)
- {
- _result.error(e);
- }
- catch (std::exception& e)
- {
- _result.error(e.what());
- }
- catch (...)
- {
- _result.error("unknown exception");
- }
- _result.notify();
- }
-
-private:
- OwnerType* _pOwner;
- Callback _method;
- ActiveResultType _result;
-};
-
-
-template <class OwnerType>
-class ActiveRunnable<void, void, OwnerType>: public ActiveRunnableBase
- /// This class is used by ActiveMethod.
- /// See the ActiveMethod class for more information.
-{
-public:
- typedef void (OwnerType::*Callback)();
- typedef ActiveResult<void> ActiveResultType;
-
- ActiveRunnable(OwnerType* pOwner, Callback method, const ActiveResultType& result):
- _pOwner(pOwner),
- _method(method),
- _result(result)
- {
- poco_check_ptr (pOwner);
- }
-
- void run()
- {
- ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done
- try
- {
- (_pOwner->*_method)();
- }
- catch (Exception& e)
- {
- _result.error(e);
- }
- catch (std::exception& e)
- {
- _result.error(e.what());
- }
- catch (...)
- {
- _result.error("unknown exception");
- }
- _result.notify();
- }
-
-private:
- OwnerType* _pOwner;
- Callback _method;
- ActiveResultType _result;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ActiveRunnable_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ActiveStarter.h b/Utilities/Poco/Foundation/include/Poco/ActiveStarter.h
deleted file mode 100755
index 1923a82ad9..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ActiveStarter.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// ActiveStarter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ActiveObjects
-//
-// Definition of the ActiveStarter class.
-//
-// Copyright (c) 2006-2007, 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.
-//
-
-
-#ifndef Foundation_ActiveStarter_INCLUDED
-#define Foundation_ActiveStarter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/ThreadPool.h"
-#include "Poco/ActiveRunnable.h"
-
-
-namespace Poco {
-
-
-template <class OwnerType>
-class ActiveStarter
- /// The default implementation of the StarterType
- /// policy for ActiveMethod. It starts the method
- /// in its own thread, obtained from the default
- /// thread pool.
-{
-public:
- static void start(OwnerType* pOwner, ActiveRunnableBase::Ptr pRunnable)
- {
- ThreadPool::defaultPool().start(*pRunnable);
- pRunnable->duplicate(); // The runnable will release itself.
- }
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ActiveStarter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Activity.h b/Utilities/Poco/Foundation/include/Poco/Activity.h
deleted file mode 100755
index c104c2ada0..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Activity.h
+++ /dev/null
@@ -1,218 +0,0 @@
-//
-// Activity.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ActiveObjects
-//
-// Definition of the Activity template class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Activity_INCLUDED
-#define Foundation_Activity_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/RunnableAdapter.h"
-#include "Poco/ThreadPool.h"
-#include "Poco/Event.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-template <class C>
-class Activity: public Runnable
- /// This template class helps to implement active objects.
- /// An active object uses threads to decouple method
- /// execution from method invocation, or to perform tasks
- /// autonomously, without intervention of a caller.
- ///
- /// An activity is a (typically longer running) method
- /// that executes within its own task. Activities can
- /// be started automatically (upon object construction)
- /// or manually at a later time. Activities can also
- /// be stopped at any time. However, to make stopping
- /// an activity work, the method implementing the
- /// activity has to check periodically whether it
- /// has been requested to stop, and if so, return.
- /// Activities are stopped before the object they belong to is
- /// destroyed. Methods implementing activities cannot have arguments
- /// or return values.
- ///
- /// Activity objects are used as follows:
- ///
- /// class ActiveObject
- /// {
- /// public:
- /// ActiveObject():
- /// _activity(this, &ActiveObject::runActivity)
- /// {
- /// ...
- /// }
- ///
- /// ...
- ///
- /// protected:
- /// void runActivity()
- /// {
- /// while (!_activity.isStopped())
- /// {
- /// ...
- /// }
- /// }
- ///
- /// private:
- /// Activity<ActiveObject> _activity;
- /// };
-{
-public:
- typedef RunnableAdapter<C> RunnableAdapterType;
- typedef typename RunnableAdapterType::Callback Callback;
-
- Activity(C* pOwner, Callback method):
- _pOwner(pOwner),
- _runnable(*pOwner, method),
- _stopped(true),
- _running(false),
- _done(false)
- /// Creates the activity. Call start() to
- /// start it.
- {
- poco_check_ptr (pOwner);
- }
-
- ~Activity()
- /// Stops and destroys the activity.
- {
- stop();
- wait();
- }
-
- void start()
- /// Starts the activity by acquiring a
- /// thread for it from the default thread pool.
- {
- FastMutex::ScopedLock lock(_mutex);
-
- if (!_running)
- {
- _done.reset();
- _stopped = false;
- _running = true;
- try
- {
- ThreadPool::defaultPool().start(*this);
- }
- catch (...)
- {
- _running = false;
- throw;
- }
- }
- }
-
- void stop()
- /// Requests to stop the activity.
- {
- FastMutex::ScopedLock lock(_mutex);
-
- _stopped = true;
- }
-
- void wait()
- /// Waits for the activity to complete.
- {
- if (_running)
- {
- _done.wait();
- }
- }
-
- void wait(long milliseconds)
- /// Waits the given interval for the activity to complete.
- /// An TimeoutException is thrown if the activity does not
- /// complete within the given interval.
- {
- if (_running)
- {
- _done.wait(milliseconds);
- }
- }
-
- bool isStopped() const
- /// Returns true if the activity has been requested to stop.
- {
- return _stopped;
- }
-
- bool isRunning() const
- /// Returns true if the activity is running.
- {
- return _running;
- }
-
-protected:
- void run()
- {
- try
- {
- _runnable.run();
- }
- catch (...)
- {
- _running = false;
- _done.set();
- throw;
- }
- _running = false;
- _done.set();
- }
-
-private:
- Activity();
- Activity(const Activity&);
- Activity& operator = (const Activity&);
-
- C* _pOwner;
- RunnableAdapterType _runnable;
- volatile bool _stopped;
- volatile bool _running;
- Event _done;
- FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Activity_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Any.h b/Utilities/Poco/Foundation/include/Poco/Any.h
deleted file mode 100755
index 8e6878ed25..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Any.h
+++ /dev/null
@@ -1,286 +0,0 @@
-//
-// Any.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Any
-//
-// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
-// Extracted from Boost 1.33.1 lib and adapted for poco: Peter Schojer/AppliedInformatics 2006-02-02
-//
-// 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.
-//
-
-
-#ifndef Foundation_Any_INCLUDED
-#define Foundation_Any_INCLUDED
-
-
-#include "Poco/Exception.h"
-#include <algorithm>
-#include <typeinfo>
-
-
-namespace Poco {
-
-
-class Any
- /// An Any class represents a general type and is capable of storing any type, supporting type-safe extraction
- /// of the internally stored data.
- ///
- /// Code taken from the Boost 1.33.1 library. Original copyright by Kevlin Henney. Modified for Poco
- /// by Applied Informatics.
-{
-public:
- Any():
- _content(0)
- /// Creates an empty any type.
- {
- }
-
- template <typename ValueType>
- Any(const ValueType& value):
- _content(new Holder<ValueType>(value))
- /// Creates an any which stores the init parameter inside.
- ///
- /// Example:
- /// Any a(13);
- /// Any a(string("12345"));
- {
- }
-
- Any(const Any& other):
- _content(other._content ? other._content->clone() : 0)
- /// Copy constructor, works with empty Anys and initialized Any values.
- {
- }
-
- ~Any()
- {
- delete _content;
- }
-
- Any& swap(Any& rhs)
- /// Swaps the content of the two Anys.
- {
- std::swap(_content, rhs._content);
- return *this;
- }
-
- template <typename ValueType>
- Any& operator = (const ValueType& rhs)
- /// Assignment operator for all types != Any.
- ///
- /// Example:
- /// Any a = 13;
- /// Any a = string("12345");
- {
- Any(rhs).swap(*this);
- return *this;
- }
-
- Any& operator = (const Any& rhs)
- /// Assignment operator for Any.
- {
- Any(rhs).swap(*this);
- return *this;
- }
-
- bool empty() const
- /// returns true if the Any is empty
- {
- return !_content;
- }
-
- const std::type_info& type() const
- /// Returns the type information of the stored content.
- /// If the Any is empty typeid(void) is returned.
- /// It is suggested to always query an Any for its type info before trying to extract
- /// data via an AnyCast/RefAnyCast.
- {
- return _content ? _content->type() : typeid(void);
- }
-
-private:
- class Placeholder
- {
- public:
- virtual ~Placeholder()
- {
- }
-
- virtual const std::type_info& type() const = 0;
- virtual Placeholder* clone() const = 0;
- };
-
- template <typename ValueType>
- class Holder: public Placeholder
- {
- public:
- Holder(const ValueType& value):
- _held(value)
- {
- }
-
- virtual const std::type_info& type() const
- {
- return typeid(ValueType);
- }
-
- virtual Placeholder* clone() const
- {
- return new Holder(_held);
- }
-
- ValueType _held;
- };
-
-private:
- template <typename ValueType>
- friend ValueType* AnyCast(Any*);
-
- template <typename ValueType>
- friend ValueType* UnsafeAnyCast(Any*);
-
- Placeholder* _content;
-};
-
-
-template <typename ValueType>
-ValueType* AnyCast(Any* operand)
- /// AnyCast operator used to extract the ValueType from an Any*. Will return a pointer
- /// to the stored value.
- ///
- /// Example Usage:
- /// MyType* pTmp = AnyCast<MyType*>(pAny).
- /// Will return NULL if the cast fails, i.e. types don't match.
-{
- return operand && operand->type() == typeid(ValueType)
- ? &static_cast<Any::Holder<ValueType>*>(operand->_content)->_held
- : 0;
-}
-
-
-template <typename ValueType>
-const ValueType* AnyCast(const Any* operand)
- /// AnyCast operator used to extract a const ValueType pointer from an const Any*. Will return a const pointer
- /// to the stored value.
- ///
- /// Example Usage:
- /// const MyType* pTmp = AnyCast<MyType*>(pAny).
- /// Will return NULL if the cast fails, i.e. types don't match.
-{
- return AnyCast<ValueType>(const_cast<Any*>(operand));
-}
-
-
-template <typename ValueType>
-ValueType AnyCast(const Any& operand)
- /// AnyCast operator used to extract a copy of the ValueType from an const Any&.
- ///
- /// Example Usage:
- /// MyType tmp = AnyCast<MyType>(anAny).
- /// Will throw a BadCastException if the cast fails.
- /// Dont use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& = ...
- /// Some compilers will accept this code although a copy is returned. Use the RefAnyCast in
- /// these cases.
-{
- ValueType* result = AnyCast<ValueType>(const_cast<Any*>(&operand));
- if (!result) throw BadCastException("Failed to convert between const Any types");
- return *result;
-}
-
-
-template <typename ValueType>
-ValueType AnyCast(Any& operand)
- /// AnyCast operator used to extract a copy of the ValueType from an Any&.
- ///
- /// Example Usage:
- /// MyType tmp = AnyCast<MyType>(anAny).
- /// Will throw a BadCastException if the cast fails.
- /// Dont use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& tmp = ...
- /// Some compilers will accept this code although a copy is returned. Use the RefAnyCast in
- /// these cases.
-{
- ValueType* result = AnyCast<ValueType>(&operand);
- if (!result) throw BadCastException("Failed to convert between Any types");
- return *result;
-}
-
-
-template <typename ValueType>
-const ValueType& RefAnyCast(const Any & operand)
- /// AnyCast operator used to return a const reference to the internal data.
- ///
- /// Example Usage:
- /// const MyType& tmp = RefAnyCast<MyType>(anAny);
-{
- ValueType* result = AnyCast<ValueType>(const_cast<Any*>(&operand));
- if (!result) throw BadCastException("RefAnyCast: Failed to convert between const Any types");
- return *result;
-}
-
-
-template <typename ValueType>
-ValueType& RefAnyCast(Any& operand)
- /// AnyCast operator used to return a reference to the internal data.
- ///
- /// Example Usage:
- /// MyType& tmp = RefAnyCast<MyType>(anAny);
-{
- ValueType* result = AnyCast<ValueType>(&operand);
- if (!result) throw BadCastException("RefAnyCast: Failed to convert between Any types");
- return *result;
-}
-
-
-template <typename ValueType>
-ValueType* UnsafeAnyCast(Any* operand)
- /// The "unsafe" versions of AnyCast are not part of the
- /// public interface and may be removed at any time. They are
- /// required where we know what type is stored in the any and can't
- /// use typeid() comparison, e.g., when our types may travel across
- /// different shared libraries.
-{
- return &static_cast<Any::Holder<ValueType>*>(operand->_content)->_held;
-}
-
-
-template <typename ValueType>
-const ValueType* UnsafeAnyCast(const Any* operand)
- /// The "unsafe" versions of AnyCast are not part of the
- /// public interface and may be removed at any time. They are
- /// required where we know what type is stored in the any and can't
- /// use typeid() comparison, e.g., when our types may travel across
- /// different shared libraries.
-{
- return AnyCast<ValueType>(const_cast<Any*>(operand));
-}
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/ArchiveStrategy.h b/Utilities/Poco/Foundation/include/Poco/ArchiveStrategy.h
deleted file mode 100755
index ddfd70b57f..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ArchiveStrategy.h
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// ArchiveStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: FileChannel
-//
-// Definition of the ArchiveStrategy class and subclasses.
-//
-// Copyright (c) 2004-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.
-//
-
-
-#ifndef Foundation_ArchiveStrategy_INCLUDED
-#define Foundation_ArchiveStrategy_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/LogFile.h"
-#include "Poco/File.h"
-#include "Poco/DateTimeFormatter.h"
-#include "Poco/NumberFormatter.h"
-
-
-namespace Poco {
-
-
-class ArchiveCompressor;
-
-
-class Foundation_API ArchiveStrategy
- /// The ArchiveStrategy is used by FileChannel
- /// to rename a rotated log file for archiving.
- ///
- /// Archived files can be automatically compressed,
- /// using the gzip file format.
-{
-public:
- ArchiveStrategy();
- virtual ~ArchiveStrategy();
-
- virtual LogFile* archive(LogFile* pFile) = 0;
- /// Renames the given log file for archiving
- /// and creates and returns a new log file.
- /// The given LogFile object is deleted.
-
- void compress(bool flag = true);
- /// Enables or disables compression of archived files.
-
-protected:
- void moveFile(const std::string& oldName, const std::string& newName);
- bool exists(const std::string& name);
-
-private:
- ArchiveStrategy(const ArchiveStrategy&);
- ArchiveStrategy& operator = (const ArchiveStrategy&);
-
- bool _compress;
- ArchiveCompressor* _pCompressor;
-};
-
-
-class Foundation_API ArchiveByNumberStrategy: public ArchiveStrategy
- /// A monotonic increasing number is appended to the
- /// log file name. The most recent archived file
- /// always has the number zero.
-{
-public:
- ArchiveByNumberStrategy();
- ~ArchiveByNumberStrategy();
- LogFile* archive(LogFile* pFile);
-};
-
-
-template <class DT>
-class ArchiveByTimestampStrategy: public ArchiveStrategy
- /// A timestamp (YYYYMMDDhhmmssiii) is appended to archived
- /// log files.
-{
-public:
- ArchiveByTimestampStrategy()
- {
- }
-
- ~ArchiveByTimestampStrategy()
- {
- }
-
- LogFile* archive(LogFile* pFile)
- /// Archives the file by appending the current timestamp to the
- /// file name. If the new file name exists, additionally a monotonic
- /// increasing number is appended to the log file name.
- {
- std::string path = pFile->path();
- delete pFile;
- std::string archPath = path;
- archPath.append(".");
- DateTimeFormatter::append(archPath, DT().timestamp(), "%Y%m%d%H%M%S%i");
-
- if (exists(archPath)) archiveByNumber(archPath);
- else moveFile(path, archPath);
-
- return new LogFile(path);
- }
-
-private:
- void archiveByNumber(const std::string& basePath)
- /// A monotonic increasing number is appended to the
- /// log file name. The most recent archived file
- /// always has the number zero.
- {
- int n = -1;
- std::string path;
- do
- {
- path = basePath;
- path.append(".");
- NumberFormatter::append(path, ++n);
- }
- while (exists(path));
-
- while (n >= 0)
- {
- std::string oldPath = basePath;
- if (n > 0)
- {
- oldPath.append(".");
- NumberFormatter::append(oldPath, n - 1);
- }
- std::string newPath = basePath;
- newPath.append(".");
- NumberFormatter::append(newPath, n);
- moveFile(oldPath, newPath);
- --n;
- }
- }
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ArchiveStrategy_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/AsyncChannel.h b/Utilities/Poco/Foundation/include/Poco/AsyncChannel.h
deleted file mode 100755
index 0f9ce9fc3b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AsyncChannel.h
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// AsyncChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: AsyncChannel
-//
-// Definition of the AsyncChannel class.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_AsyncChannel_INCLUDED
-#define Foundation_AsyncChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-#include "Poco/Thread.h"
-#include "Poco/Mutex.h"
-#include "Poco/Runnable.h"
-#include "Poco/NotificationQueue.h"
-
-
-namespace Poco {
-
-
-class Foundation_API AsyncChannel: public Channel, public Runnable
- /// A channel uses a separate thread for logging.
- ///
- /// Using this channel can help to improve the performance of
- /// applications that produce huge amounts of log messages or
- /// that write log messages to multiple channels simultaneously.
- ///
- /// All log messages are put into a queue and this queue is
- /// then processed by a separate thread.
-{
-public:
- AsyncChannel(Channel* pChannel = 0, Thread::Priority prio = Thread::PRIO_NORMAL);
- /// Creates the AsyncChannel and connects it to
- /// the given channel.
-
- void setChannel(Channel* pChannel);
- /// Connects the AsyncChannel to the given target channel.
- /// All messages will be forwarded to this channel.
-
- Channel* getChannel() const;
- /// Returns the target channel.
-
- void open();
- /// Opens the channel and creates the
- /// background ;ogging thread.
-
- void close();
- /// Closes the channel and stops the background
- /// logging thread.
-
- void log(const Message& msg);
- /// Queues the message for processing by the
- /// background thread.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Sets or changes a configuration property.
- ///
- /// The "channel" property allows setting the target
- /// channel via the LoggingRegistry.
- /// The "channel" property is set-only.
- ///
- /// The "priority" property allows setting the thread
- /// priority. The following values are supported:
- /// * lowest
- /// * low
- /// * normal (default)
- /// * high
- /// * highest
- ///
- /// The "priority" property is set-only.
-
-protected:
- ~AsyncChannel();
- void run();
- void setPriority(const std::string& value);
-
-private:
- Channel* _pChannel;
- Thread _thread;
- FastMutex _mutex;
- NotificationQueue _queue;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_AsyncChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/AtomicCounter.h b/Utilities/Poco/Foundation/include/Poco/AtomicCounter.h
deleted file mode 100644
index 292cbaedf8..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AtomicCounter.h
+++ /dev/null
@@ -1,327 +0,0 @@
-//
-// AtomicCounter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: AtomicCounter
-//
-// Definition of the AtomicCounter class.
-//
-// Copyright (c) 2009, 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.
-//
-
-
-#ifndef Foundation_AtomicCounter_INCLUDED
-#define Foundation_AtomicCounter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#if POCO_OS == POCO_OS_WINDOWS_NT
-#include "Poco/UnWindows.h"
-#elif POCO_OS == POCO_OS_MAC_OS_X
-#include <libkern/OSAtomic.h>
-#else
-#include "Poco/Mutex.h"
-#endif // POCO_OS
-
-
-namespace Poco {
-
-
-class Foundation_API AtomicCounter
- /// This class implements a simple counter, which
- /// provides atomic operations that are safe to
- /// use in a multithreaded environment.
- ///
- /// Typical usage of AtomicCounter is for implementing
- /// reference counting and similar things.
- ///
- /// On some platforms, the implementation of AtomicCounter
- /// is based on atomic primitives specific to the platform
- /// (such as InterlockedIncrement, etc. on Windows), and
- /// thus very efficient. On platforms that do not support
- /// atomic primitives, operations are guarded by a FastMutex.
- ///
- /// The following platforms currently have atomic
- /// primitives:
- /// - Windows
- /// - Mac OS X
-{
-public:
- typedef int ValueType; /// The underlying integer type.
-
- AtomicCounter();
- /// Creates a new AtomicCounter and initializes it to zero.
-
- explicit AtomicCounter(ValueType initialValue);
- /// Creates a new AtomicCounter and initializes it with
- /// the given value.
-
- AtomicCounter(const AtomicCounter& counter);
- /// Creates the counter by copying another one.
-
- ~AtomicCounter();
- /// Destroys the AtomicCounter.
-
- AtomicCounter& operator = (const AtomicCounter& counter);
- /// Assigns the value of another AtomicCounter.
-
- AtomicCounter& operator = (ValueType value);
- /// Assigns a value to the counter.
-
- operator ValueType () const;
- /// Returns the value of the counter.
-
- ValueType value() const;
- /// Returns the value of the counter.
-
- ValueType operator ++ (); // prefix
- /// Increments the counter and returns the result.
-
- ValueType operator ++ (int); // postfix
- /// Increments the counter and returns the previous value.
-
- ValueType operator -- (); // prefix
- /// Decrements the counter and returns the result.
-
- ValueType operator -- (int); // postfix
- /// Decrements the counter and returns the previous value.
-
- bool operator ! () const;
- /// Returns true if the counter is zero, false otherwise.
-
-private:
-#if POCO_OS == POCO_OS_WINDOWS_NT
- typedef volatile LONG ImplType;
-#elif POCO_OS == POCO_OS_MAC_OS_X
- typedef int32_t ImplType;
-#else // generic implementation based on FastMutex
- struct ImplType
- {
- mutable FastMutex mutex;
- volatile int value;
- };
-#endif // POCO_OS
-
- ImplType _counter;
-};
-
-
-//
-// inlines
-//
-
-
-#if POCO_OS == POCO_OS_WINDOWS_NT
-//
-// Windows
-//
-inline AtomicCounter::operator AtomicCounter::ValueType () const
-{
- return _counter;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::value() const
-{
- return _counter;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
-{
- return InterlockedIncrement(&_counter);
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
-{
- ValueType result(_counter);
- InterlockedIncrement(&_counter);
- return result;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
-{
- return InterlockedDecrement(&_counter);
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
-{
- ValueType result(_counter);
- InterlockedDecrement(&_counter);
- return result;
-}
-
-
-inline bool AtomicCounter::operator ! () const
-{
- return _counter == 0;
-}
-
-
-#elif POCO_OS == POCO_OS_MAC_OS_X
-//
-// Mac OS X
-//
-inline AtomicCounter::operator AtomicCounter::ValueType () const
-{
- return _counter;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::value() const
-{
- return _counter;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
-{
- return OSAtomicIncrement32(&_counter);
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
-{
- ValueType result(_counter);
- OSAtomicIncrement32(&_counter);
- return result;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
-{
- return OSAtomicDecrement32(&_counter);
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
-{
- ValueType result(_counter);
- OSAtomicDecrement32(&_counter);
- return result;
-}
-
-
-inline bool AtomicCounter::operator ! () const
-{
- return _counter == 0;
-}
-
-
-#else
-//
-// Generic implementation based on FastMutex
-//
-inline AtomicCounter::operator AtomicCounter::ValueType () const
-{
- ValueType result;
- {
- FastMutex::ScopedLock lock(_counter.mutex);
- result = _counter.value;
- }
- return result;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::value() const
-{
- ValueType result;
- {
- FastMutex::ScopedLock lock(_counter.mutex);
- result = _counter.value;
- }
- return result;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator ++ () // prefix
-{
- ValueType result;
- {
- FastMutex::ScopedLock lock(_counter.mutex);
- result = ++_counter.value;
- }
- return result;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator ++ (int) // postfix
-{
- ValueType result;
- {
- FastMutex::ScopedLock lock(_counter.mutex);
- result = _counter.value++;
- }
- return result;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator -- () // prefix
-{
- ValueType result;
- {
- FastMutex::ScopedLock lock(_counter.mutex);
- result = --_counter.value;
- }
- return result;
-}
-
-
-inline AtomicCounter::ValueType AtomicCounter::operator -- (int) // postfix
-{
- ValueType result;
- {
- FastMutex::ScopedLock lock(_counter.mutex);
- result = _counter.value--;
- }
- return result;
-}
-
-
-inline bool AtomicCounter::operator ! () const
-{
- bool result;
- {
- FastMutex::ScopedLock lock(_counter.mutex);
- result = _counter.value == 0;
- }
- return result;
-}
-
-
-#endif // POCO_OS
-
-
-} // namespace Poco
-
-
-#endif // Foundation_AtomicCounter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/AutoPtr.h b/Utilities/Poco/Foundation/include/Poco/AutoPtr.h
deleted file mode 100755
index 6f6d38bf13..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AutoPtr.h
+++ /dev/null
@@ -1,378 +0,0 @@
-//
-// AutoPtr.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: AutoPtr
-//
-// Definition of the AutoPtr template class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_AutoPtr_INCLUDED
-#define Foundation_AutoPtr_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include <algorithm>
-
-
-namespace Poco {
-
-
-template <class C>
-class AutoPtr
- /// AutoPtr is a "smart" pointer for classes implementing
- /// reference counting based garbage collection.
- /// To be usable with the AutoPtr template, a class must
- /// implement the following behaviour:
- /// A class must maintain a reference count.
- /// The constructors of the object initialize the reference
- /// count to one.
- /// The class must implement a public duplicate() method:
- /// void duplicate();
- /// that increments the reference count by one.
- /// The class must implement a public release() method:
- /// void release()
- /// that decrements the reference count by one, and,
- /// if the reference count reaches zero, deletes the
- /// object.
- ///
- /// AutoPtr works in the following way:
- /// If an AutoPtr is assigned an ordinary pointer to
- /// an object (via the constructor or the assignment operator),
- /// it takes ownership of the object and the object's reference
- /// count remains unchanged.
- /// If the AutoPtr is assigned another AutoPtr, the
- /// object's reference count is incremented by one by
- /// calling duplicate() on its object.
- /// The destructor of AutoPtr calls release() on its
- /// object.
- /// AutoPtr supports dereferencing with both the ->
- /// and the * operator. An attempt to dereference a null
- /// AutoPtr results in a NullPointerException being thrown.
- /// AutoPtr also implements all relational operators.
- /// Note that AutoPtr allows casting of its encapsulated data types.
-{
-public:
- AutoPtr(): _ptr(0)
- {
- }
-
- AutoPtr(C* ptr): _ptr(ptr)
- {
- }
-
- AutoPtr(C* ptr, bool shared): _ptr(ptr)
- {
- if (shared && _ptr) _ptr->duplicate();
- }
-
- AutoPtr(const AutoPtr& ptr): _ptr(ptr._ptr)
- {
- if (_ptr) _ptr->duplicate();
- }
-
- template <class Other>
- AutoPtr(const AutoPtr<Other>& ptr): _ptr(const_cast<Other*>(ptr.get()))
- {
- if (_ptr) _ptr->duplicate();
- }
-
- ~AutoPtr()
- {
- if (_ptr) _ptr->release();
- }
-
- AutoPtr& assign(C* ptr)
- {
- if (_ptr != ptr)
- {
- if (_ptr) _ptr->release();
- _ptr = ptr;
- }
- return *this;
- }
-
- AutoPtr& assign(C* ptr, bool shared)
- {
- if (_ptr != ptr)
- {
- if (_ptr) _ptr->release();
- _ptr = ptr;
- if (shared && _ptr) _ptr->duplicate();
- }
- return *this;
- }
-
- AutoPtr& assign(const AutoPtr& ptr)
- {
- if (&ptr != this)
- {
- if (_ptr) _ptr->release();
- _ptr = ptr._ptr;
- if (_ptr) _ptr->duplicate();
- }
- return *this;
- }
-
- template <class Other>
- AutoPtr& assign(const AutoPtr<Other>& ptr)
- {
- if (ptr.get() != _ptr)
- {
- if (_ptr) _ptr->release();
- _ptr = const_cast<Other*>(ptr.get());
- if (_ptr) _ptr->duplicate();
- }
- return *this;
- }
-
- AutoPtr& operator = (C* ptr)
- {
- return assign(ptr);
- }
-
- AutoPtr& operator = (const AutoPtr& ptr)
- {
- return assign(ptr);
- }
-
- template <class Other>
- AutoPtr& operator = (const AutoPtr<Other>& ptr)
- {
- return assign<Other>(ptr);
- }
-
- void swap(AutoPtr& ptr)
- {
- std::swap(_ptr, ptr._ptr);
- }
-
- template <class Other>
- AutoPtr<Other> cast() const
- /// Casts the AutoPtr via a dynamic cast to the given type.
- /// Returns an AutoPtr containing NULL if the cast fails.
- /// Example: (assume class Sub: public Super)
- /// AutoPtr<Super> super(new Sub());
- /// AutoPtr<Sub> sub = super.cast<Sub>();
- /// poco_assert (sub.get());
- {
- Other* pOther = dynamic_cast<Other*>(_ptr);
- return AutoPtr<Other>(pOther, true);
- }
-
- template <class Other>
- AutoPtr<Other> unsafeCast() const
- /// Casts the AutoPtr via a static cast to the given type.
- /// Example: (assume class Sub: public Super)
- /// AutoPtr<Super> super(new Sub());
- /// AutoPtr<Sub> sub = super.unsafeCast<Sub>();
- /// poco_assert (sub.get());
- {
- Other* pOther = static_cast<Other*>(_ptr);
- return AutoPtr<Other>(pOther, true);
- }
-
- C* operator -> ()
- {
- if (_ptr)
- return _ptr;
- else
- throw NullPointerException();
- }
-
- const C* operator -> () const
- {
- if (_ptr)
- return _ptr;
- else
- throw NullPointerException();
- }
-
- C& operator * ()
- {
- if (_ptr)
- return *_ptr;
- else
- throw NullPointerException();
- }
-
- const C& operator * () const
- {
- if (_ptr)
- return *_ptr;
- else
- throw NullPointerException();
- }
-
- C* get()
- {
- return _ptr;
- }
-
- const C* get() const
- {
- return _ptr;
- }
-
- operator C* ()
- {
- return _ptr;
- }
-
- operator const C* () const
- {
- return _ptr;
- }
-
- bool operator ! () const
- {
- return _ptr == 0;
- }
-
- bool isNull() const
- {
- return _ptr == 0;
- }
-
- C* duplicate()
- {
- if (_ptr) _ptr->duplicate();
- return _ptr;
- }
-
- bool operator == (const AutoPtr& ptr) const
- {
- return _ptr == ptr._ptr;
- }
-
- bool operator == (const C* ptr) const
- {
- return _ptr == ptr;
- }
-
- bool operator == (C* ptr) const
- {
- return _ptr == ptr;
- }
-
- bool operator != (const AutoPtr& ptr) const
- {
- return _ptr != ptr._ptr;
- }
-
- bool operator != (const C* ptr) const
- {
- return _ptr != ptr;
- }
-
- bool operator != (C* ptr) const
- {
- return _ptr != ptr;
- }
-
- bool operator < (const AutoPtr& ptr) const
- {
- return _ptr < ptr._ptr;
- }
-
- bool operator < (const C* ptr) const
- {
- return _ptr < ptr;
- }
-
- bool operator < (C* ptr) const
- {
- return _ptr < ptr;
- }
-
- bool operator <= (const AutoPtr& ptr) const
- {
- return _ptr <= ptr._ptr;
- }
-
- bool operator <= (const C* ptr) const
- {
- return _ptr <= ptr;
- }
-
- bool operator <= (C* ptr) const
- {
- return _ptr <= ptr;
- }
-
- bool operator > (const AutoPtr& ptr) const
- {
- return _ptr > ptr._ptr;
- }
-
- bool operator > (const C* ptr) const
- {
- return _ptr > ptr;
- }
-
- bool operator > (C* ptr) const
- {
- return _ptr > ptr;
- }
-
- bool operator >= (const AutoPtr& ptr) const
- {
- return _ptr >= ptr._ptr;
- }
-
- bool operator >= (const C* ptr) const
- {
- return _ptr >= ptr;
- }
-
- bool operator >= (C* ptr) const
- {
- return _ptr >= ptr;
- }
-
-private:
- C* _ptr;
-};
-
-
-template <class C>
-inline void swap(AutoPtr<C>& p1, AutoPtr<C>& p2)
-{
- p1.swap(p2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_AutoPtr_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/AutoReleasePool.h b/Utilities/Poco/Foundation/include/Poco/AutoReleasePool.h
deleted file mode 100755
index 0bd6a03508..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/AutoReleasePool.h
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// AutoReleasePool.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: AutoReleasePool
-//
-// Definition of the AutoReleasePool class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_AutoReleasePool_INCLUDED
-#define Foundation_AutoReleasePool_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <list>
-
-
-namespace Poco {
-
-
-template <class C>
-class AutoReleasePool
- /// An AutoReleasePool implements simple garbage collection for
- /// reference-counted objects.
- /// It temporarily takes ownwership of reference-counted objects that
- /// nobody else wants to take ownership of and releases them
- /// at a later, appropriate point in time.
- ///
- /// Note: The correct way to add an object hold by an AutoPtr<> to
- /// an AutoReleasePool is by invoking the AutoPtr's duplicate()
- /// method. Example:
- /// AutoReleasePool<C> arp;
- /// AutoPtr<C> ptr = new C;
- /// ...
- /// arp.add(ptr.duplicate());
-{
-public:
- AutoReleasePool()
- /// Creates the AutoReleasePool.
- {
- }
-
- ~AutoReleasePool()
- /// Destroys the AutoReleasePool and releases
- /// all objects it currently holds.
- {
- release();
- }
-
- void add(C* pObject)
- /// Adds the given object to the AutoReleasePool.
- /// The object's reference count is not modified
- {
- if (pObject)
- _list.push_back(pObject);
- }
-
- void release()
- /// Releases all objects the AutoReleasePool currently holds
- /// by calling each object's release() method.
- {
- while (!_list.empty())
- {
- _list.front()->release();
- _list.pop_front();
- }
- }
-
-private:
- typedef std::list<C*> ObjectList;
-
- ObjectList _list;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_AutoReleasePool_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Base64Decoder.h b/Utilities/Poco/Foundation/include/Poco/Base64Decoder.h
deleted file mode 100755
index 3c084196f8..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Base64Decoder.h
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// Base64Decoder.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: Base64
-//
-// Definition of class Base64Decoder.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Base64Decoder_INCLUDED
-#define Foundation_Base64Decoder_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnbufferedStreamBuf.h"
-#include <istream>
-
-
-namespace Poco {
-
-
-class Foundation_API Base64DecoderBuf: public UnbufferedStreamBuf
- /// This streambuf base64-decodes all data read
- /// from the istream connected to it.
-{
-public:
- Base64DecoderBuf(std::istream& istr);
- ~Base64DecoderBuf();
-
-private:
- int readFromDevice();
- int readOne();
-
- unsigned char _group[3];
- int _groupLength;
- int _groupIndex;
- std::istream& _istr;
-
- static unsigned char IN_ENCODING[256];
- static bool IN_ENCODING_INIT;
-
-private:
- Base64DecoderBuf(const Base64DecoderBuf&);
- Base64DecoderBuf& operator = (const Base64DecoderBuf&);
-};
-
-
-class Foundation_API Base64DecoderIOS: public virtual std::ios
- /// The base class for Base64Decoder.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- Base64DecoderIOS(std::istream& istr);
- ~Base64DecoderIOS();
- Base64DecoderBuf* rdbuf();
-
-protected:
- Base64DecoderBuf _buf;
-
-private:
- Base64DecoderIOS(const Base64DecoderIOS&);
- Base64DecoderIOS& operator = (const Base64DecoderIOS&);
-};
-
-
-class Foundation_API Base64Decoder: public Base64DecoderIOS, public std::istream
- /// This istream base64-decodes all data
- /// read from the istream connected to it.
-{
-public:
- Base64Decoder(std::istream& istr);
- ~Base64Decoder();
-
-private:
- Base64Decoder(const Base64Decoder&);
- Base64Decoder& operator = (const Base64Decoder&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Base64Decoder_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Base64Encoder.h b/Utilities/Poco/Foundation/include/Poco/Base64Encoder.h
deleted file mode 100755
index 6b8a2ff0ca..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Base64Encoder.h
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// Base64Encoder.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: Base64
-//
-// Definition of class Base64Encoder.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Base64Encoder_INCLUDED
-#define Foundation_Base64Encoder_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnbufferedStreamBuf.h"
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API Base64EncoderBuf: public UnbufferedStreamBuf
- /// This streambuf base64-encodes all data written
- /// to it and forwards it to a connected
- /// ostream.
-{
-public:
- Base64EncoderBuf(std::ostream& ostr);
- ~Base64EncoderBuf();
-
- int close();
- /// Closes the stream buffer.
-
- void setLineLength(int lineLength);
- /// Specify the line length.
- ///
- /// After the given number of characters have been written,
- /// a newline character will be written.
- ///
- /// Specify 0 for an unlimited line length.
-
- int getLineLength() const;
- /// Returns the currently set line length.
-
-private:
- int writeToDevice(char c);
-
- unsigned char _group[3];
- int _groupLength;
- int _pos;
- int _lineLength;
- std::ostream& _ostr;
-
- static const unsigned char OUT_ENCODING[64];
-
- friend class Base64DecoderBuf;
-
- Base64EncoderBuf(const Base64EncoderBuf&);
- Base64EncoderBuf& operator = (const Base64EncoderBuf&);
-};
-
-
-class Foundation_API Base64EncoderIOS: public virtual std::ios
- /// The base class for Base64Encoder.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- Base64EncoderIOS(std::ostream& ostr);
- ~Base64EncoderIOS();
- int close();
- Base64EncoderBuf* rdbuf();
-
-protected:
- Base64EncoderBuf _buf;
-
-private:
- Base64EncoderIOS(const Base64EncoderIOS&);
- Base64EncoderIOS& operator = (const Base64EncoderIOS&);
-};
-
-
-class Foundation_API Base64Encoder: public Base64EncoderIOS, public std::ostream
- /// This ostream base64-encodes all data
- /// written to it and forwards it to
- /// a connected ostream.
- /// Always call close() when done
- /// writing data, to ensure proper
- /// completion of the encoding operation.
-{
-public:
- Base64Encoder(std::ostream& ostr);
- ~Base64Encoder();
-
-private:
- Base64Encoder(const Base64Encoder&);
- Base64Encoder& operator = (const Base64Encoder&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Base64Encoder_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/BasicEvent.h b/Utilities/Poco/Foundation/include/Poco/BasicEvent.h
deleted file mode 100755
index 40effcf6dd..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/BasicEvent.h
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// BasicEvent.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: BasicEvent
-//
-// Implementation of the BasicEvent template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_BasicEvent_INCLUDED
-#define Foundation_BasicEvent_INCLUDED
-
-
-#include "Poco/AbstractEvent.h"
-#include "Poco/DefaultStrategy.h"
-#include "Poco/AbstractDelegate.h"
-#include "Poco/CompareFunctions.h"
-
-
-namespace Poco {
-
-
-template <class TArgs>
-class BasicEvent: public AbstractEvent <
- TArgs, DefaultStrategy<TArgs, AbstractDelegate<TArgs>, p_less<AbstractDelegate<TArgs> > >,
- AbstractDelegate<TArgs>
->
- /// A BasicEvent uses internally a DefaultStrategy which
- /// invokes delegates in an arbitrary manner.
- /// Note that one object can only register one method to a BasicEvent.
- /// Subsequent registrations will overwrite the existing delegate.
- /// For example:
- /// BasicEvent<int> event;
- /// MyClass myObject;
- /// event += delegate(&myObject, &MyClass::myMethod1);
- /// event += delegate(&myObject, &MyClass::myMethod2);
- ///
- /// The second registration will overwrite the first one. The reason is simply that
- /// function pointers can only be compared by equality but not by lower than.
-{
-public:
- BasicEvent()
- {
- }
-
- ~BasicEvent()
- {
- }
-
-private:
- BasicEvent(const BasicEvent& e);
- BasicEvent& operator = (const BasicEvent& e);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/BinaryReader.h b/Utilities/Poco/Foundation/include/Poco/BinaryReader.h
deleted file mode 100755
index 9a9b1f5252..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/BinaryReader.h
+++ /dev/null
@@ -1,187 +0,0 @@
-//
-// BinaryReader.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: BinaryReaderWriter
-//
-// Definition of the BinaryReader class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_BinaryReader_INCLUDED
-#define Foundation_BinaryReader_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <istream>
-
-
-namespace Poco {
-
-
-class Foundation_API BinaryReader
- /// This class reads basic types in binary form into an input stream.
- /// It provides an extractor-based interface similar to istream.
- /// The reader also supports automatic conversion from big-endian
- /// (network byte order) to little-endian and vice-versa.
- /// Use a BinaryWriter to create a stream suitable for a BinaryReader.
-{
-public:
- enum StreamByteOrder
- {
- NATIVE_BYTE_ORDER = 1, /// the host's native byte-order
- BIG_ENDIAN_BYTE_ORDER = 2, /// big-endian (network) byte-order
- NETWORK_BYTE_ORDER = 2, /// big-endian (network) byte-order
- LITTLE_ENDIAN_BYTE_ORDER = 3, /// little-endian byte-order
- UNSPECIFIED_BYTE_ORDER = 4 /// unknown, byte-order will be determined by reading the byte-order mark
- };
-
- BinaryReader(std::istream& istr, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER);
- /// Creates the BinaryReader.
-
- ~BinaryReader();
- /// Destroys the BinaryReader.
-
- BinaryReader& operator >> (bool& value);
- BinaryReader& operator >> (char& value);
- BinaryReader& operator >> (unsigned char& value);
- BinaryReader& operator >> (signed char& value);
- BinaryReader& operator >> (short& value);
- BinaryReader& operator >> (unsigned short& value);
- BinaryReader& operator >> (int& value);
- BinaryReader& operator >> (unsigned int& value);
- BinaryReader& operator >> (long& value);
- BinaryReader& operator >> (unsigned long& value);
- BinaryReader& operator >> (float& value);
- BinaryReader& operator >> (double& value);
-
-#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
- BinaryReader& operator >> (Int64& value);
- BinaryReader& operator >> (UInt64& value);
-#endif
-
- BinaryReader& operator >> (std::string& value);
-
- void read7BitEncoded(UInt32& value);
- /// Reads a 32-bit unsigned integer in compressed format.
- /// See BinaryWriter::write7BitEncoded() for a description
- /// of the compression algorithm.
-
-#if defined(POCO_HAVE_INT64)
- void read7BitEncoded(UInt64& value);
- /// Reads a 64-bit unsigned integer in compressed format.
- /// See BinaryWriter::write7BitEncoded() for a description
- /// of the compression algorithm.
-#endif
-
- void readRaw(int length, std::string& value);
- /// Reads length bytes of raw data into value.
-
- void readBOM();
- /// Reads a byte-order mark from the stream and configures
- /// the reader for the encountered byte order.
- /// A byte-order mark is a 16-bit integer with a value of 0xFEFF,
- /// written in host byte order.
-
- bool good();
- /// Returns _istr.good();
-
- bool fail();
- /// Returns _istr.fail();
-
- bool bad();
- /// Returns _istr.bad();
-
- bool eof();
- /// Returns _istr.eof();
-
- std::istream& stream() const;
- /// Returns the underlying stream.
-
- StreamByteOrder byteOrder() const;
- /// Returns the byte-order used by the reader, which is
- /// either BIG_ENDIAN_BYTE_ORDER or LITTLE_ENDIAN_BYTE_ORDER.
-
-private:
- std::istream& _istr;
- bool _flipBytes;
-};
-
-
-//
-// inlines
-//
-
-
-inline bool BinaryReader::good()
-{
- return _istr.good();
-}
-
-
-inline bool BinaryReader::fail()
-{
- return _istr.fail();
-}
-
-
-inline bool BinaryReader::bad()
-{
- return _istr.bad();
-}
-
-
-inline bool BinaryReader::eof()
-{
- return _istr.eof();
-}
-
-
-inline std::istream& BinaryReader::stream() const
-{
- return _istr;
-}
-
-
-inline BinaryReader::StreamByteOrder BinaryReader::byteOrder() const
-{
-#if defined(POCO_ARCH_BIG_ENDIAN)
- return _flipBytes ? LITTLE_ENDIAN_BYTE_ORDER : BIG_ENDIAN_BYTE_ORDER;
-#else
- return _flipBytes ? BIG_ENDIAN_BYTE_ORDER : LITTLE_ENDIAN_BYTE_ORDER;
-#endif
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_BinaryReader_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/BinaryWriter.h b/Utilities/Poco/Foundation/include/Poco/BinaryWriter.h
deleted file mode 100755
index 65976601c7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/BinaryWriter.h
+++ /dev/null
@@ -1,199 +0,0 @@
-//
-// BinaryWriter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: BinaryReaderWriter
-//
-// Definition of the BinaryWriter class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_BinaryWriter_INCLUDED
-#define Foundation_BinaryWriter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API BinaryWriter
- /// This class writes basic types in binary form into an output stream.
- /// It provides an inserter-based interface similar to ostream.
- /// The writer also supports automatic conversion from big-endian
- /// (network byte order) to little-endian and vice-versa.
- /// Use a BinaryReader to read from a stream created by a BinaryWriter.
- /// Be careful when exchanging data between systems with different
- /// data type sizes (e.g., 32-bit and 64-bit architectures), as the sizes
- /// of some of the basic types may be different. For example, writing a
- /// long integer on a 64-bit system and reading it on a 32-bit system
- /// may yield an incorrent result. Use fixed-size types (Int32, Int64, etc.)
- /// in such a case.
-{
-public:
- enum StreamByteOrder
- {
- NATIVE_BYTE_ORDER = 1, /// the host's native byte-order
- BIG_ENDIAN_BYTE_ORDER = 2, /// big-endian (network) byte-order
- NETWORK_BYTE_ORDER = 2, /// big-endian (network) byte-order
- LITTLE_ENDIAN_BYTE_ORDER = 3 /// little-endian byte-order
- };
-
- BinaryWriter(std::ostream& ostr, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER);
- /// Creates the BinaryWriter.
-
- ~BinaryWriter();
- /// Destroys the BinaryWriter.
-
- BinaryWriter& operator << (bool value);
- BinaryWriter& operator << (char value);
- BinaryWriter& operator << (unsigned char value);
- BinaryWriter& operator << (signed char value);
- BinaryWriter& operator << (short value);
- BinaryWriter& operator << (unsigned short value);
- BinaryWriter& operator << (int value);
- BinaryWriter& operator << (unsigned int value);
- BinaryWriter& operator << (long value);
- BinaryWriter& operator << (unsigned long value);
- BinaryWriter& operator << (float value);
- BinaryWriter& operator << (double value);
-
-#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
- BinaryWriter& operator << (Int64 value);
- BinaryWriter& operator << (UInt64 value);
-#endif
-
- BinaryWriter& operator << (const std::string& value);
- BinaryWriter& operator << (const char* value);
-
- void write7BitEncoded(UInt32 value);
- /// Writes a 32-bit unsigned integer in a compressed format.
- /// The value is written out seven bits at a time, starting
- /// with the seven least-significant bits.
- /// The high bit of a byte indicates whether there are more bytes to be
- /// written after this one.
- /// If value will fit in seven bits, it takes only one byte of space.
- /// If value will not fit in seven bits, the high bit is set on the first byte and
- /// written out. value is then shifted by seven bits and the next byte is written.
- /// This process is repeated until the entire integer has been written.
-
-#if defined(POCO_HAVE_INT64)
- void write7BitEncoded(UInt64 value);
- /// Writes a 64-bit unsigned integer in a compressed format.
- /// The value written out seven bits at a time, starting
- /// with the seven least-significant bits.
- /// The high bit of a byte indicates whether there are more bytes to be
- /// written after this one.
- /// If value will fit in seven bits, it takes only one byte of space.
- /// If value will not fit in seven bits, the high bit is set on the first byte and
- /// written out. value is then shifted by seven bits and the next byte is written.
- /// This process is repeated until the entire integer has been written.
-#endif
-
- void writeRaw(const std::string& rawData);
- /// Writes the string as-is to the stream.
-
- void writeBOM();
- /// Writes a byte-order mark to the stream. A byte order mark is
- /// a 16-bit integer with a value of 0xFEFF, written in host byte-order.
- /// A BinaryReader uses the byte-order mark to determine the byte-order
- /// of the stream.
-
- void flush();
- /// Flushes the underlying stream.
-
- bool good();
- /// Returns _ostr.good();
-
- bool fail();
- /// Returns _ostr.fail();
-
- bool bad();
- /// Returns _ostr.bad();
-
- std::ostream& stream() const;
- /// Returns the underlying stream.
-
- StreamByteOrder byteOrder() const;
- /// Returns the byte ordering used by the writer, which is
- /// either BIG_ENDIAN_BYTE_ORDER or LITTLE_ENDIAN_BYTE_ORDER.
-
-private:
- std::ostream& _ostr;
- bool _flipBytes;
-};
-
-
-//
-// inlines
-//
-
-
-inline std::ostream& BinaryWriter::stream() const
-{
- return _ostr;
-}
-
-
-inline bool BinaryWriter::good()
-{
- return _ostr.good();
-}
-
-
-inline bool BinaryWriter::fail()
-{
- return _ostr.fail();
-}
-
-
-inline bool BinaryWriter::bad()
-{
- return _ostr.bad();
-}
-
-
-inline BinaryWriter::StreamByteOrder BinaryWriter::byteOrder() const
-{
-#if defined(POCO_ARCH_BIG_ENDIAN)
- return _flipBytes ? LITTLE_ENDIAN_BYTE_ORDER : BIG_ENDIAN_BYTE_ORDER;
-#else
- return _flipBytes ? BIG_ENDIAN_BYTE_ORDER : LITTLE_ENDIAN_BYTE_ORDER;
-#endif
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_BinaryWriter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Buffer.h b/Utilities/Poco/Foundation/include/Poco/Buffer.h
deleted file mode 100755
index 2482c6f6c1..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Buffer.h
+++ /dev/null
@@ -1,130 +0,0 @@
-//
-// Buffer.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Buffer
-//
-// Definition of the Buffer class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_Buffer_INCLUDED
-#define Foundation_Buffer_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <cstddef>
-
-
-namespace Poco {
-
-
-template <class T>
-class Buffer
- /// A very simple buffer class that allocates a buffer of
- /// a given type and size in the constructor and
- /// deallocates the buffer in the destructor.
- ///
- /// This class is useful everywhere where a temporary buffer
- /// is needed.
-{
-public:
- Buffer(std::size_t size):
- _size(size),
- _ptr(new T[size])
- /// Creates and allocates the Buffer.
- {
- }
-
- ~Buffer()
- /// Destroys the Buffer.
- {
- delete [] _ptr;
- }
-
- std::size_t size() const
- /// Returns the size of the buffer.
- {
- return _size;
- }
-
- T* begin()
- /// Returns a pointer to the beginning of the buffer.
- {
- return _ptr;
- }
-
- const T* begin() const
- /// Returns a pointer to the beginning of the buffer.
- {
- return _ptr;
- }
-
- T* end()
- /// Returns a pointer to end of the buffer.
- {
- return _ptr + _size;
- }
-
- const T* end() const
- /// Returns a pointer to the end of the buffer.
- {
- return _ptr + _size;
- }
-
- T& operator [] (std::size_t index)
- {
- poco_assert (index < _size);
-
- return _ptr[index];
- }
-
- const T& operator [] (std::size_t index) const
- {
- poco_assert (index < _size);
-
- return _ptr[index];
- }
-
-private:
- Buffer();
- Buffer(const Buffer&);
- Buffer& operator = (const Buffer&);
-
- std::size_t _size;
- T* _ptr;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Buffer_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/BufferAllocator.h b/Utilities/Poco/Foundation/include/Poco/BufferAllocator.h
deleted file mode 100755
index 95b3958bc6..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/BufferAllocator.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// BufferAllocator.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: BufferAllocator
-//
-// Definition of the BufferAllocator class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef Foundation_BufferAllocator_INCLUDED
-#define Foundation_BufferAllocator_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <ios>
-#include <cstddef>
-
-
-namespace Poco {
-
-
-template <typename ch>
-class BufferAllocator
- /// The BufferAllocator used if no specific
- /// BufferAllocator has been specified.
-{
-public:
- typedef ch char_type;
-
- static char_type* allocate(std::streamsize size)
- {
- return new char_type[static_cast<std::size_t>(size)];
- }
-
- static void deallocate(char_type* ptr, std::streamsize size)
- {
- delete [] ptr;
- }
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_BufferAllocator_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h b/Utilities/Poco/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h
deleted file mode 100755
index 5af9aaddb5..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h
+++ /dev/null
@@ -1,196 +0,0 @@
-//
-// BufferedBidirectionalStreamBuf.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: StreamBuf
-//
-// Definition of template BasicBufferedBidirectionalStreamBuf and class BufferedBidirectionalStreamBuf.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef Foundation_BufferedBidirectionalStreamBuf_INCLUDED
-#define Foundation_BufferedBidirectionalStreamBuf_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/BufferAllocator.h"
-#include "Poco/StreamUtil.h"
-#include <streambuf>
-#include <iosfwd>
-#include <ios>
-
-
-namespace Poco {
-
-
-template <typename ch, typename tr, typename ba = BufferAllocator<ch> >
-class BasicBufferedBidirectionalStreamBuf: public std::basic_streambuf<ch, tr>
- /// This is an implementation of a buffered bidirectional
- /// streambuf that greatly simplifies the implementation of
- /// custom streambufs of various kinds.
- /// Derived classes only have to override the methods
- /// readFromDevice() or writeToDevice().
- ///
- /// In contrast to BasicBufferedStreambuf, this class supports
- /// simultaneous read and write access, so in addition to
- /// istream and ostream this streambuf can also be used
- /// for implementing an iostream.
-{
-protected:
- typedef std::basic_streambuf<ch, tr> Base;
- typedef std::basic_ios<ch, tr> IOS;
- typedef ch char_type;
- typedef tr char_traits;
- typedef ba Allocator;
- typedef typename Base::int_type int_type;
- typedef typename Base::pos_type pos_type;
- typedef typename Base::off_type off_type;
- typedef typename IOS::openmode openmode;
-
-public:
- BasicBufferedBidirectionalStreamBuf(std::streamsize bufferSize, openmode mode):
- _bufsize(bufferSize),
- _pReadBuffer(Allocator::allocate(_bufsize)),
- _pWriteBuffer(Allocator::allocate(_bufsize)),
- _mode(mode)
- {
- resetBuffers();
- }
-
- ~BasicBufferedBidirectionalStreamBuf()
- {
- Allocator::deallocate(_pReadBuffer, _bufsize);
- Allocator::deallocate(_pWriteBuffer, _bufsize);
- }
-
- virtual int_type overflow(int_type c)
- {
- if (!(_mode & IOS::out)) return char_traits::eof();
-
- if (c != char_traits::eof())
- {
- *this->pptr() = char_traits::to_char_type(c);
- this->pbump(1);
- }
- if (flushBuffer() == std::streamsize(-1)) return char_traits::eof();
-
- return c;
- }
-
- virtual int_type underflow()
- {
- if (!(_mode & IOS::in)) return char_traits::eof();
-
- if (this->gptr() && (this->gptr() < this->egptr()))
- return char_traits::to_int_type(*this->gptr());
-
- int putback = int(this->gptr() - this->eback());
- if (putback > 4) putback = 4;
-
- char_traits::copy(_pReadBuffer + (4 - putback), this->gptr() - putback, putback);
-
- int n = readFromDevice(_pReadBuffer + 4, _bufsize - 4);
- if (n <= 0) return char_traits::eof();
-
- this->setg(_pReadBuffer + (4 - putback), _pReadBuffer + 4, _pReadBuffer + 4 + n);
-
- // return next character
- return char_traits::to_int_type(*this->gptr());
- }
-
- virtual int sync()
- {
- if (this->pptr() && this->pptr() > this->pbase())
- {
- if (flushBuffer() == -1) return -1;
- }
- return 0;
- }
-
-protected:
- void setMode(openmode mode)
- {
- _mode = mode;
- }
-
- openmode getMode() const
- {
- return _mode;
- }
-
- void resetBuffers()
- {
- this->setg(_pReadBuffer + 4, _pReadBuffer + 4, _pReadBuffer + 4);
- this->setp(_pWriteBuffer, _pWriteBuffer + (_bufsize - 1));
- }
-
-private:
- virtual int readFromDevice(char_type* buffer, std::streamsize length)
- {
- return 0;
- }
-
- virtual int writeToDevice(const char_type* buffer, std::streamsize length)
- {
- return 0;
- }
-
- int flushBuffer()
- {
- int n = int(this->pptr() - this->pbase());
- if (writeToDevice(this->pbase(), n) == n)
- {
- this->pbump(-n);
- return n;
- }
- return -1;
- }
-
- std::streamsize _bufsize;
- char_type* _pReadBuffer;
- char_type* _pWriteBuffer;
- openmode _mode;
-
- BasicBufferedBidirectionalStreamBuf(const BasicBufferedBidirectionalStreamBuf&);
- BasicBufferedBidirectionalStreamBuf& operator = (const BasicBufferedBidirectionalStreamBuf&);
-};
-
-
-//
-// We provide an instantiation for char
-//
-typedef BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char> > BufferedBidirectionalStreamBuf;
-
-
-} // namespace Poco
-
-
-#endif // Foundation_BufferedBidirectionalStreamBuf_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/BufferedStreamBuf.h b/Utilities/Poco/Foundation/include/Poco/BufferedStreamBuf.h
deleted file mode 100755
index 8edc57c9de..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/BufferedStreamBuf.h
+++ /dev/null
@@ -1,188 +0,0 @@
-//
-// BufferedStreamBuf.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: StreamBuf
-//
-// Definition of template BasicBufferedStreamBuf and class BufferedStreamBuf.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_BufferedStreamBuf_INCLUDED
-#define Foundation_BufferedStreamBuf_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/BufferAllocator.h"
-#include "Poco/StreamUtil.h"
-#include <streambuf>
-#include <iosfwd>
-#include <ios>
-
-
-namespace Poco {
-
-
-template <typename ch, typename tr, typename ba = BufferAllocator<ch> >
-class BasicBufferedStreamBuf: public std::basic_streambuf<ch, tr>
- /// This is an implementation of a buffered streambuf
- /// that greatly simplifies the implementation of
- /// custom streambufs of various kinds.
- /// Derived classes only have to override the methods
- /// readFromDevice() or writeToDevice().
- ///
- /// This streambuf only supports unidirectional streams.
- /// In other words, the BasicBufferedStreamBuf can be
- /// used for the implementation of an istream or an
- /// ostream, but not for an iostream.
-{
-protected:
- typedef std::basic_streambuf<ch, tr> Base;
- typedef std::basic_ios<ch, tr> IOS;
- typedef ch char_type;
- typedef tr char_traits;
- typedef ba Allocator;
- typedef typename Base::int_type int_type;
- typedef typename Base::pos_type pos_type;
- typedef typename Base::off_type off_type;
- typedef typename IOS::openmode openmode;
-
-public:
- BasicBufferedStreamBuf(std::streamsize bufferSize, openmode mode):
- _bufsize(bufferSize),
- _pBuffer(Allocator::allocate(_bufsize)),
- _mode(mode)
- {
- this->setg(_pBuffer + 4, _pBuffer + 4, _pBuffer + 4);
- this->setp(_pBuffer, _pBuffer + (_bufsize - 1));
- }
-
- ~BasicBufferedStreamBuf()
- {
- Allocator::deallocate(_pBuffer, _bufsize);
- }
-
- virtual int_type overflow(int_type c)
- {
- if (!(_mode & IOS::out)) return char_traits::eof();
-
- if (c != char_traits::eof())
- {
- *this->pptr() = char_traits::to_char_type(c);
- this->pbump(1);
- }
- if (flushBuffer() == std::streamsize(-1)) return char_traits::eof();
-
- return c;
- }
-
- virtual int_type underflow()
- {
- if (!(_mode & IOS::in)) return char_traits::eof();
-
- if (this->gptr() && (this->gptr() < this->egptr()))
- return char_traits::to_int_type(*this->gptr());
-
- int putback = int(this->gptr() - this->eback());
- if (putback > 4) putback = 4;
-
- char_traits::copy(_pBuffer + (4 - putback), this->gptr() - putback, putback);
-
- int n = readFromDevice(_pBuffer + 4, _bufsize - 4);
- if (n <= 0) return char_traits::eof();
-
- this->setg(_pBuffer + (4 - putback), _pBuffer + 4, _pBuffer + 4 + n);
-
- // return next character
- return char_traits::to_int_type(*this->gptr());
- }
-
- virtual int sync()
- {
- if (this->pptr() && this->pptr() > this->pbase())
- {
- if (flushBuffer() == -1) return -1;
- }
- return 0;
- }
-
-protected:
- void setMode(openmode mode)
- {
- _mode = mode;
- }
-
- openmode getMode() const
- {
- return _mode;
- }
-
-private:
- virtual int readFromDevice(char_type* buffer, std::streamsize length)
- {
- return 0;
- }
-
- virtual int writeToDevice(const char_type* buffer, std::streamsize length)
- {
- return 0;
- }
-
- int flushBuffer()
- {
- int n = int(this->pptr() - this->pbase());
- if (writeToDevice(this->pbase(), n) == n)
- {
- this->pbump(-n);
- return n;
- }
- return -1;
- }
-
- std::streamsize _bufsize;
- char_type* _pBuffer;
- openmode _mode;
-
- BasicBufferedStreamBuf(const BasicBufferedStreamBuf&);
- BasicBufferedStreamBuf& operator = (const BasicBufferedStreamBuf&);
-};
-
-
-//
-// We provide an instantiation for char
-//
-typedef BasicBufferedStreamBuf<char, std::char_traits<char> > BufferedStreamBuf;
-
-
-} // namespace Poco
-
-
-#endif // Foundation_BufferedStreamBuf_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Bugcheck.h b/Utilities/Poco/Foundation/include/Poco/Bugcheck.h
deleted file mode 100755
index 867bd21071..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Bugcheck.h
+++ /dev/null
@@ -1,184 +0,0 @@
-//
-// Bugcheck.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Bugcheck
-//
-// Definition of the Bugcheck class and the self-testing macros.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Bugcheck_INCLUDED
-#define Foundation_Bugcheck_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <string>
-#if defined(_DEBUG)
-# include <iostream>
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API Bugcheck
- /// This class provides some static methods that are
- /// used by the
- /// poco_assert_dbg(), poco_assert(), poco_check_ptr()
- /// and poco_bugcheck() macros.
- /// You should not invoke these methods
- /// directly. Use the macros instead, as they
- /// automatically provide useful context information.
-{
-public:
- static void assertion(const char* cond, const char* file, int line);
- /// An assertion failed. Break into the debugger, if
- /// possible, then throw an AssertionViolationException.
-
- static void nullPointer(const char* ptr, const char* file, int line);
- /// An null pointer was encountered. Break into the debugger, if
- /// possible, then throw an NullPointerException.
-
- static void bugcheck(const char* file, int line);
- /// An internal error was encountered. Break into the debugger, if
- /// possible, then throw an BugcheckException.
-
- static void bugcheck(const char* msg, const char* file, int line);
- /// An internal error was encountered. Break into the debugger, if
- /// possible, then throw an BugcheckException.
-
- static void debugger(const char* file, int line);
- /// An internal error was encountered. Break into the debugger, if
- /// possible.
-
- static void debugger(const char* msg, const char* file, int line);
- /// An internal error was encountered. Break into the debugger, if
- /// possible.
-
-protected:
- static std::string what(const char* msg, const char* file, int line);
-};
-
-
-} // namespace Poco
-
-
-//
-// useful macros (these automatically supply line number and file name)
-//
-#if defined(_DEBUG)
- #define poco_assert_dbg(cond) \
- if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
-#else
- #define poco_assert_dbg(cond)
-#endif
-
-
-#define poco_assert(cond) \
- if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
-
-
-#define poco_check_ptr(ptr) \
- if (!(ptr)) Poco::Bugcheck::nullPointer(#ptr, __FILE__, __LINE__); else (void) 0
-
-
-#define poco_bugcheck() \
- Poco::Bugcheck::bugcheck(__FILE__, __LINE__)
-
-
-#define poco_bugcheck_msg(msg) \
- Poco::Bugcheck::bugcheck(msg, __FILE__, __LINE__)
-
-
-#define poco_debugger() \
- Poco::Bugcheck::debugger(__FILE__, __LINE__)
-
-
-#define poco_debugger_msg(msg) \
- Poco::Bugcheck::debugger(msg, __FILE__, __LINE__)
-
-
-#if defined(_DEBUG)
-# define poco_stdout_dbg(outstr) \
- std::cout << __FILE__ << '(' << std::dec << __LINE__ << "):" << outstr << std::endl;
-#else
-# define poco_stdout_dbg(outstr)
-#endif
-
-
-#if defined(_DEBUG)
-# define poco_stderr_dbg(outstr) \
- std::cerr << __FILE__ << '(' << std::dec << __LINE__ << "):" << outstr << std::endl;
-#else
-# define poco_stderr_dbg(outstr)
-#endif
-
-
-//
-// poco_static_assert
-//
-// The following was ported from <boost/static_assert.hpp>
-//
-
-
-template <bool x>
-struct POCO_STATIC_ASSERTION_FAILURE;
-
-
-template <>
-struct POCO_STATIC_ASSERTION_FAILURE<true>
-{
- enum
- {
- value = 1
- };
-};
-
-
-template <int x>
-struct poco_static_assert_test
-{
-};
-
-
-#if defined(__GNUC__) && (__GNUC__ == 3) && ((__GNUC_MINOR__ == 3) || (__GNUC_MINOR__ == 4))
-#define poco_static_assert(B) \
- typedef char POCO_JOIN(poco_static_assert_typedef_, __LINE__) \
- [POCO_STATIC_ASSERTION_FAILURE<(bool) (B)>::value]
-#else
-#define poco_static_assert(B) \
- typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (B)>)> \
- POCO_JOIN(poco_static_assert_typedef_, __LINE__)
-#endif
-
-
-#endif // Foundation_Bugcheck_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ByteOrder.h b/Utilities/Poco/Foundation/include/Poco/ByteOrder.h
deleted file mode 100755
index 2f098bec13..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ByteOrder.h
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// ByteOrder.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: ByteOrder
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_ByteOrder_INCLUDED
-#define Foundation_ByteOrder_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Types.h"
-
-
-namespace Poco {
-
-
-class Foundation_API ByteOrder
- /// This class contains a number of static methods
- /// to convert between big-endian and little-endian
- /// integers of various sizes.
-{
-public:
- static Int16 flipBytes(Int16 value);
- static UInt16 flipBytes(UInt16 value);
- static Int32 flipBytes(Int32 value);
- static UInt32 flipBytes(UInt32 value);
-#if defined(POCO_HAVE_INT64)
- static Int64 flipBytes(Int64 value);
- static UInt64 flipBytes(UInt64 value);
-#endif
-
- static Int16 toBigEndian(Int16 value);
- static UInt16 toBigEndian (UInt16 value);
- static Int32 toBigEndian(Int32 value);
- static UInt32 toBigEndian (UInt32 value);
-#if defined(POCO_HAVE_INT64)
- static Int64 toBigEndian(Int64 value);
- static UInt64 toBigEndian (UInt64 value);
-#endif
-
- static Int16 fromBigEndian(Int16 value);
- static UInt16 fromBigEndian (UInt16 value);
- static Int32 fromBigEndian(Int32 value);
- static UInt32 fromBigEndian (UInt32 value);
-#if defined(POCO_HAVE_INT64)
- static Int64 fromBigEndian(Int64 value);
- static UInt64 fromBigEndian (UInt64 value);
-#endif
-
- static Int16 toLittleEndian(Int16 value);
- static UInt16 toLittleEndian (UInt16 value);
- static Int32 toLittleEndian(Int32 value);
- static UInt32 toLittleEndian (UInt32 value);
-#if defined(POCO_HAVE_INT64)
- static Int64 toLittleEndian(Int64 value);
- static UInt64 toLittleEndian (UInt64 value);
-#endif
-
- static Int16 fromLittleEndian(Int16 value);
- static UInt16 fromLittleEndian (UInt16 value);
- static Int32 fromLittleEndian(Int32 value);
- static UInt32 fromLittleEndian (UInt32 value);
-#if defined(POCO_HAVE_INT64)
- static Int64 fromLittleEndian(Int64 value);
- static UInt64 fromLittleEndian (UInt64 value);
-#endif
-
- static Int16 toNetwork(Int16 value);
- static UInt16 toNetwork (UInt16 value);
- static Int32 toNetwork(Int32 value);
- static UInt32 toNetwork (UInt32 value);
-#if defined(POCO_HAVE_INT64)
- static Int64 toNetwork(Int64 value);
- static UInt64 toNetwork (UInt64 value);
-#endif
-
- static Int16 fromNetwork(Int16 value);
- static UInt16 fromNetwork (UInt16 value);
- static Int32 fromNetwork(Int32 value);
- static UInt32 fromNetwork (UInt32 value);
-#if defined(POCO_HAVE_INT64)
- static Int64 fromNetwork(Int64 value);
- static UInt64 fromNetwork (UInt64 value);
-#endif
-};
-
-
-//
-// inlines
-//
-inline UInt16 ByteOrder::flipBytes(UInt16 value)
-{
- return ((value >> 8) & 0x00FF) | ((value << 8) & 0xFF00);
-}
-
-
-inline Int16 ByteOrder::flipBytes(Int16 value)
-{
- return Int16(flipBytes(UInt16(value)));
-}
-
-
-inline UInt32 ByteOrder::flipBytes(UInt32 value)
-{
- return ((value >> 24) & 0x000000FF) | ((value >> 8) & 0x0000FF00)
- | ((value << 8) & 0x00FF0000) | ((value << 24) & 0xFF000000);
-}
-
-
-inline Int32 ByteOrder::flipBytes(Int32 value)
-{
- return Int32(flipBytes(UInt32(value)));
-}
-
-
-#if defined(POCO_HAVE_INT64)
-inline UInt64 ByteOrder::flipBytes(UInt64 value)
-{
- UInt32 hi = UInt32(value >> 32);
- UInt32 lo = UInt32(value & 0xFFFFFFFF);
- return UInt64(flipBytes(hi)) | (UInt64(flipBytes(lo)) << 32);
-}
-
-
-inline Int64 ByteOrder::flipBytes(Int64 value)
-{
- return Int64(flipBytes(UInt64(value)));
-}
-#endif // POCO_HAVE_INT64
-
-
-//
-// some macro trickery to automate the method implementation
-//
-#define POCO_IMPLEMENT_BYTEORDER_NOOP_(op, type) \
- inline type ByteOrder::op(type value) \
- { \
- return value; \
- }
-#define POCO_IMPLEMENT_BYTEORDER_FLIP_(op, type) \
- inline type ByteOrder::op(type value) \
- { \
- return flipBytes(value); \
- }
-
-
-#if defined(POCO_HAVE_INT64)
- #define POCO_IMPLEMENT_BYTEORDER_NOOP(op) \
- POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int16) \
- POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt16) \
- POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int32) \
- POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt32) \
- POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int64) \
- POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt64)
- #define POCO_IMPLEMENT_BYTEORDER_FLIP(op) \
- POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int16) \
- POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt16) \
- POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int32) \
- POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt32) \
- POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int64) \
- POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt64)
-#else
- #define POCO_IMPLEMENT_BYTEORDER_NOOP(op) \
- POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int16) \
- POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt16) \
- POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int32) \
- POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt32)
- #define POCO_IMPLEMENT_BYTEORDER_FLIP(op) \
- POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int16) \
- POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt16) \
- POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int32) \
- POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt32)
-#endif
-
-
-#if defined(POCO_ARCH_BIG_ENDIAN)
- #define POCO_IMPLEMENT_BYTEORDER_BIG POCO_IMPLEMENT_BYTEORDER_NOOP
- #define POCO_IMPLEMENT_BYTEORDER_LIT POCO_IMPLEMENT_BYTEORDER_FLIP
-#else
- #define POCO_IMPLEMENT_BYTEORDER_BIG POCO_IMPLEMENT_BYTEORDER_FLIP
- #define POCO_IMPLEMENT_BYTEORDER_LIT POCO_IMPLEMENT_BYTEORDER_NOOP
-#endif
-
-
-POCO_IMPLEMENT_BYTEORDER_BIG(toBigEndian)
-POCO_IMPLEMENT_BYTEORDER_BIG(fromBigEndian)
-POCO_IMPLEMENT_BYTEORDER_BIG(toNetwork)
-POCO_IMPLEMENT_BYTEORDER_BIG(fromNetwork)
-POCO_IMPLEMENT_BYTEORDER_LIT(toLittleEndian)
-POCO_IMPLEMENT_BYTEORDER_LIT(fromLittleEndian)
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ByteOrder_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Channel.h b/Utilities/Poco/Foundation/include/Poco/Channel.h
deleted file mode 100755
index b54bc744a7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Channel.h
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// Channel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Channel
-//
-// Definition of the Channel class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Channel_INCLUDED
-#define Foundation_Channel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Configurable.h"
-#include "Poco/Mutex.h"
-#include "Poco/RefCountedObject.h"
-
-
-namespace Poco {
-
-
-class Message;
-
-
-class Foundation_API Channel: public Configurable, public RefCountedObject
- /// The base class for all Channel classes.
- ///
- /// Supports reference counting based garbage
- /// collection and provides trivial implementations
- /// of getProperty() and setProperty().
-{
-public:
- Channel();
- /// Creates the channel and initializes
- /// the reference count to one.
-
- virtual void open();
- /// Does whatever is necessary to open the channel.
- /// The default implementation does nothing.
-
- virtual void close();
- /// Does whatever is necessary to close the channel.
- /// The default implementation does nothing.
-
- virtual void log(const Message& msg) = 0;
- /// Logs the given message to the channel. Must be
- /// overridden by subclasses.
- ///
- /// If the channel has not been opened yet, the log()
- /// method will open it.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Throws a PropertyNotSupportedException.
-
- std::string getProperty(const std::string& name) const;
- /// Throws a PropertyNotSupportedException.
-
-protected:
- virtual ~Channel();
-
-private:
- Channel(const Channel&);
- Channel& operator = (const Channel&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Channel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Checksum.h b/Utilities/Poco/Foundation/include/Poco/Checksum.h
deleted file mode 100755
index ca70e13384..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Checksum.h
+++ /dev/null
@@ -1,130 +0,0 @@
-//
-// Checksum.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Checksum
-//
-// Definition of the Checksum class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_Checksum_INCLUDED
-#define Foundation_Checksum_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Checksum
- /// This class calculates CRC-32 or Adler-32 checksums
- /// for arbitrary data.
- ///
- /// A cyclic redundancy check (CRC) is a type of hash function, which is used to produce a
- /// small, fixed-size checksum of a larger block of data, such as a packet of network
- /// traffic or a computer file. CRC-32 is one of the most commonly used CRC algorithms.
- ///
- /// Adler-32 is a checksum algorithm which was invented by Mark Adler.
- /// It is almost as reliable as a 32-bit cyclic redundancy check for protecting against
- /// accidental modification of data, such as distortions occurring during a transmission,
- /// but is significantly faster to calculate in software.
-
-{
-public:
- enum Type
- {
- TYPE_ADLER32 = 0,
- TYPE_CRC32
- };
-
- Checksum();
- /// Creates a CRC-32 checksum initialized to 0.
-
- Checksum(Type t);
- /// Creates the Checksum, using the given type.
-
- ~Checksum();
- /// Destroys the Checksum.
-
- void update(const char* data, unsigned length);
- /// Updates the checksum with the given data.
-
- void update(const std::string& data);
- /// Updates the checksum with the given data.
-
- void update(char data);
- /// Updates the checksum with the given data.
-
- Poco::UInt32 checksum() const;
- /// Returns the calculated checksum.
-
- Type type() const;
- /// Which type of checksum are we calulcating
-
-private:
- Type _type;
- Poco::UInt32 _value;
-};
-
-
-//
-// inlines
-//
-inline void Checksum::update(const std::string& data)
-{
- update(data.c_str(), static_cast<unsigned int>(data.size()));
-}
-
-
-inline void Checksum::update(char c)
-{
- update(&c, 1);
-}
-
-
-inline Poco::UInt32 Checksum::checksum() const
-{
- return _value;
-}
-
-
-inline Checksum::Type Checksum::type() const
-{
- return _type;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Checksum_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ClassLibrary.h b/Utilities/Poco/Foundation/include/Poco/ClassLibrary.h
deleted file mode 100755
index b012fb6578..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ClassLibrary.h
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// ClassLibrary.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: ClassLoader
-//
-// Definitions for class libraries.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_ClassLibrary_INCLUDED
-#define Foundation_ClassLibrary_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Manifest.h"
-#include <typeinfo>
-
-
-#if defined(_WIN32)
- #define POCO_LIBRARY_API __declspec(dllexport)
-#else
- #define POCO_LIBRARY_API
-#endif
-
-
-//
-// the entry points for every class library
-//
-extern "C"
-{
- bool POCO_LIBRARY_API pocoBuildManifest(Poco::ManifestBase* pManifest);
- void POCO_LIBRARY_API pocoInitializeLibrary();
- void POCO_LIBRARY_API pocoUninitializeLibrary();
-}
-
-
-//
-// additional support for named manifests
-//
-#define POCO_DECLARE_NAMED_MANIFEST(name) \
-extern "C" \
-{ \
- bool POCO_LIBRARY_API POCO_JOIN(pocoBuildManifest, name)(Poco::ManifestBase* pManifest); \
-}
-
-
-//
-// Macros to automatically implement pocoBuildManifest
-//
-// usage:
-//
-// POCO_BEGIN_MANIFEST(MyBaseClass)
-// POCO_EXPORT_CLASS(MyFirstClass)
-// POCO_EXPORT_CLASS(MySecondClass)
-// ...
-// POCO_END_MANIFEST
-//
-#define POCO_BEGIN_MANIFEST_IMPL(fnName, base) \
- bool fnName(Poco::ManifestBase* pManifest_) \
- { \
- typedef base _Base; \
- typedef Poco::Manifest<_Base> _Manifest; \
- std::string requiredType(typeid(_Manifest).name()); \
- std::string actualType(pManifest_->className()); \
- if (requiredType == actualType) \
- { \
- Poco::Manifest<_Base>* pManifest = static_cast<_Manifest*>(pManifest_);
-
-
-#define POCO_BEGIN_MANIFEST(base) \
- POCO_BEGIN_MANIFEST_IMPL(pocoBuildManifest, base)
-
-
-#define POCO_BEGIN_NAMED_MANIFEST(name, base) \
- POCO_DECLARE_NAMED_MANIFEST(name) \
- POCO_BEGIN_MANIFEST_IMPL(POCO_JOIN(pocoBuildManifest, name), base)
-
-
-#define POCO_END_MANIFEST \
- return true; \
- } \
- else return false; \
- }
-
-
-#define POCO_EXPORT_CLASS(cls) \
- pManifest->insert(new Poco::MetaObject<cls, _Base>(#cls));
-
-
-#define POCO_EXPORT_SINGLETON(cls) \
- pManifest->insert(new Poco::MetaSingleton<cls, _Base>(#cls));
-
-
-#endif // Foundation_ClassLibrary_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ClassLoader.h b/Utilities/Poco/Foundation/include/Poco/ClassLoader.h
deleted file mode 100755
index 8315f169bd..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ClassLoader.h
+++ /dev/null
@@ -1,385 +0,0 @@
-//
-// ClassLoader.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: ClassLoader
-//
-// Definition of the ClassLoader class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_ClassLoader_INCLUDED
-#define Foundation_ClassLoader_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/MetaObject.h"
-#include "Poco/Manifest.h"
-#include "Poco/SharedLibrary.h"
-#include "Poco/Mutex.h"
-#include "Poco/Exception.h"
-#include <map>
-
-
-namespace Poco {
-
-
-template <class Base>
-class ClassLoader
- /// The ClassLoader loads C++ classes from shared libraries
- /// at runtime. It must be instantiated with a root class
- /// of the loadable classes.
- /// For a class to be loadable from a library, the library
- /// must provide a Manifest of all the classes it contains.
- /// The Manifest for a shared library can be easily built
- /// with the help of the macros in the header file
- /// "Foundation/ClassLibrary.h".
- ///
- /// Starting with POCO release 1.3, a class library can
- /// export multiple manifests. In addition to the default
- /// (unnamed) manifest, multiple named manifests can
- /// be exported, each having a different base class.
- ///
- /// There is one important restriction: one instance of
- /// ClassLoader can only load one manifest from a class
- /// library.
-{
-public:
- typedef AbstractMetaObject<Base> Meta;
- typedef Manifest<Base> Manif;
- typedef void (*InitializeLibraryFunc)();
- typedef void (*UninitializeLibraryFunc)();
- typedef bool (*BuildManifestFunc)(ManifestBase*);
-
- struct LibraryInfo
- {
- SharedLibrary* pLibrary;
- const Manif* pManifest;
- int refCount;
- };
- typedef std::map<std::string, LibraryInfo> LibraryMap;
-
- class Iterator
- /// The ClassLoader's very own iterator class.
- {
- public:
- typedef std::pair<std::string, const Manif*> Pair;
-
- Iterator(const typename LibraryMap::const_iterator& it)
- {
- _it = it;
- }
- Iterator(const Iterator& it)
- {
- _it = it._it;
- }
- ~Iterator()
- {
- }
- Iterator& operator = (const Iterator& it)
- {
- _it = it._it;
- return *this;
- }
- inline bool operator == (const Iterator& it) const
- {
- return _it == it._it;
- }
- inline bool operator != (const Iterator& it) const
- {
- return _it != it._it;
- }
- Iterator& operator ++ () // prefix
- {
- ++_it;
- return *this;
- }
- Iterator operator ++ (int) // postfix
- {
- Iterator result(_it);
- ++_it;
- return result;
- }
- inline const Pair* operator * () const
- {
- _pair.first = _it->first;
- _pair.second = _it->second.pManifest;
- return &_pair;
- }
- inline const Pair* operator -> () const
- {
- _pair.first = _it->first;
- _pair.second = _it->second.pManifest;
- return &_pair;
- }
-
- private:
- typename LibraryMap::const_iterator _it;
- mutable Pair _pair;
- };
-
- ClassLoader()
- /// Creates the ClassLoader.
- {
- }
-
- virtual ~ClassLoader()
- /// Destroys the ClassLoader.
- {
- for (typename LibraryMap::const_iterator it = _map.begin(); it != _map.end(); ++it)
- {
- delete it->second.pLibrary;
- delete it->second.pManifest;
- }
- }
-
- void loadLibrary(const std::string& path, const std::string& manifest)
- /// Loads a library from the given path, using the given manifest.
- /// Does nothing if the library is already loaded.
- /// Throws a LibraryLoadException if the library
- /// cannot be loaded or does not have a Manifest.
- /// If the library exports a function named "pocoInitializeLibrary",
- /// this function is executed.
- /// If called multiple times for the same library,
- /// the number of calls to unloadLibrary() must be the same
- /// for the library to become unloaded.
- {
- FastMutex::ScopedLock lock(_mutex);
-
- typename LibraryMap::iterator it = _map.find(path);
- if (it == _map.end())
- {
- LibraryInfo li;
- li.pLibrary = new SharedLibrary(path);
- li.pManifest = new Manif();
- li.refCount = 1;
- try
- {
- std::string pocoBuildManifestSymbol("pocoBuildManifest");
- pocoBuildManifestSymbol.append(manifest);
- if (li.pLibrary->hasSymbol("pocoInitializeLibrary"))
- {
- InitializeLibraryFunc initializeLibrary = (InitializeLibraryFunc) li.pLibrary->getSymbol("pocoInitializeLibrary");
- initializeLibrary();
- }
- if (li.pLibrary->hasSymbol(pocoBuildManifestSymbol))
- {
- BuildManifestFunc buildManifest = (BuildManifestFunc) li.pLibrary->getSymbol(pocoBuildManifestSymbol);
- if (buildManifest(const_cast<Manif*>(li.pManifest)))
- _map[path] = li;
- else
- throw LibraryLoadException(std::string("Manifest class mismatch in ") + path, manifest);
- }
- else throw LibraryLoadException(std::string("No manifest in ") + path, manifest);
- }
- catch (...)
- {
- delete li.pLibrary;
- delete li.pManifest;
- throw;
- }
- }
- else
- {
- ++it->second.refCount;
- }
- }
-
- void loadLibrary(const std::string& path)
- /// Loads a library from the given path. Does nothing
- /// if the library is already loaded.
- /// Throws a LibraryLoadException if the library
- /// cannot be loaded or does not have a Manifest.
- /// If the library exports a function named "pocoInitializeLibrary",
- /// this function is executed.
- /// If called multiple times for the same library,
- /// the number of calls to unloadLibrary() must be the same
- /// for the library to become unloaded.
- ///
- /// Equivalent to loadLibrary(path, "").
- {
- loadLibrary(path, "");
- }
-
- void unloadLibrary(const std::string& path)
- /// Unloads the given library.
- /// Be extremely cautious when unloading shared libraries.
- /// If objects from the library are still referenced somewhere,
- /// a total crash is very likely.
- /// If the library exports a function named "pocoUninitializeLibrary",
- /// this function is executed before it is unloaded.
- /// If loadLibrary() has been called multiple times for the same
- /// library, the number of calls to unloadLibrary() must be the same
- /// for the library to become unloaded.
- {
- FastMutex::ScopedLock lock(_mutex);
-
- typename LibraryMap::iterator it = _map.find(path);
- if (it != _map.end())
- {
- if (--it->second.refCount == 0)
- {
- if (it->second.pLibrary->hasSymbol("pocoUninitializeLibrary"))
- {
- UninitializeLibraryFunc uninitializeLibrary = (UninitializeLibraryFunc) it->second.pLibrary->getSymbol("pocoUninitializeLibrary");
- uninitializeLibrary();
- }
- delete it->second.pManifest;
- it->second.pLibrary->unload();
- delete it->second.pLibrary;
- _map.erase(it);
- }
- }
- else throw NotFoundException(path);
- }
-
- const Meta* findClass(const std::string& className) const
- /// Returns a pointer to the MetaObject for the given
- /// class, or a null pointer if the class is not known.
- {
- FastMutex::ScopedLock lock(_mutex);
-
- for (typename LibraryMap::const_iterator it = _map.begin(); it != _map.end(); ++it)
- {
- const Manif* pManif = it->second.pManifest;
- typename Manif::Iterator itm = pManif->find(className);
- if (itm != pManif->end())
- return *itm;
- }
- return 0;
- }
-
- const Meta& classFor(const std::string& className) const
- /// Returns a reference to the MetaObject for the given
- /// class. Throws a NotFoundException if the class
- /// is not known.
- {
- const Meta* pMeta = findClass(className);
- if (pMeta)
- return *pMeta;
- else
- throw NotFoundException(className);
- }
-
- Base* create(const std::string& className) const
- /// Creates an instance of the given class.
- /// Throws a NotFoundException if the class
- /// is not known.
- {
- return classFor(className).create();
- }
-
- Base& instance(const std::string& className) const
- /// Returns a reference to the sole instance of
- /// the given class. The class must be a singleton,
- /// otherwise an InvalidAccessException will be thrown.
- /// Throws a NotFoundException if the class
- /// is not known.
- {
- return classFor(className).instance();
- }
-
- bool canCreate(const std::string& className) const
- /// Returns true if create() can create new instances
- /// of the class.
- {
- return classFor(className).canCreate();
- }
-
- void destroy(const std::string& className, Base* pObject) const
- /// Destroys the object pObject points to.
- /// Does nothing if object is not found.
- {
- classFor(className).destroy(pObject);
- }
-
- bool isAutoDelete(const std::string& className, Base* pObject) const
- /// Returns true if the object is automatically
- /// deleted by its meta object.
- {
- return classFor(className).isAutoDelete(pObject);
- }
-
- const Manif* findManifest(const std::string& path) const
- /// Returns a pointer to the Manifest for the given
- /// library, or a null pointer if the library has not been loaded.
- {
- FastMutex::ScopedLock lock(_mutex);
-
- typename LibraryMap::const_iterator it = _map.find(path);
- if (it != _map.end())
- return it->second.pManifest;
- else
- return 0;
- }
-
- const Manif& manifestFor(const std::string& path) const
- /// Returns a reference to the Manifest for the given library
- /// Throws a NotFoundException if the library has not been loaded.
- {
- const Manif* pManif = findManifest(path);
- if (pManif)
- return *pManif;
- else
- throw NotFoundException(path);
- }
-
- bool isLibraryLoaded(const std::string& path) const
- /// Returns true if the library with the given name
- /// has already been loaded.
- {
- return findManifest(path) != 0;
- }
-
- Iterator begin() const
- {
- FastMutex::ScopedLock lock(_mutex);
-
- return Iterator(_map.begin());
- }
-
- Iterator end() const
- {
- FastMutex::ScopedLock lock(_mutex);
-
- return Iterator(_map.end());
- }
-
-private:
- LibraryMap _map;
- mutable FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ClassLoader_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/CompareFunctions.h b/Utilities/Poco/Foundation/include/Poco/CompareFunctions.h
deleted file mode 100755
index 1350118eb9..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/CompareFunctions.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// CompareFunctions.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: CompareFunctions
-//
-// Compare operators for the NotificationStrategies.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_CompareFunctions_INCLUDED
-#define Foundation_CompareFunctions_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <functional>
-
-
-namespace Poco {
-
-
-template <class T>
-struct p_less: std::binary_function<T, T, bool>
-{
- bool operator () (const T* const & x, const T* const & y) const
- {
- return *x < *y;
- }
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/Condition.h b/Utilities/Poco/Foundation/include/Poco/Condition.h
deleted file mode 100755
index a97a24983b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Condition.h
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// Condition.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Condition
-//
-// Definition of the Condition class template.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_Condition_INCLUDED
-#define Foundation_Condition_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-#include "Poco/ScopedUnlock.h"
-#include "Poco/Event.h"
-#include "Poco/Exception.h"
-#include <deque>
-
-
-namespace Poco {
-
-
-class Foundation_API Condition
- /// A Condition is a synchronization object used to block a thread
- /// until a particular condition is met.
- /// A Condition object is always used in conjunction with
- /// a Mutex (or FastMutex) object.
- ///
- /// Condition objects are similar to POSIX condition variables, which the
- /// difference that Condition is not subject to spurious wakeups.
- ///
- /// Threads waiting on a Condition are resumed in FIFO order.
-{
-public:
- Condition();
- /// Creates the Condition.
-
- ~Condition();
- /// Destroys the Condition.
-
- template <class Mtx>
- void wait(Mtx& mutex)
- /// Unlocks the mutex (which must be locked upon calling
- /// wait()) and waits until the Condition is signalled.
- ///
- /// The given mutex will be locked again upon
- /// leaving the function, even in case of an exception.
- {
- ScopedUnlock<Mtx> unlock(mutex, false);
- Event event;
- {
- FastMutex::ScopedLock lock(_mutex);
- mutex.unlock();
- enqueue(event);
- }
- event.wait();
- }
-
- template <class Mtx>
- void wait(Mtx& mutex, long milliseconds)
- /// Unlocks the mutex (which must be locked upon calling
- /// wait()) and waits for the given time until the Condition is signalled.
- ///
- /// The given mutex will be locked again upon successfully leaving the
- /// function, even in case of an exception.
- ///
- /// Throws a TimeoutException if the Condition is not signalled
- /// within the given time interval.
- {
- if (!tryWait(mutex, milliseconds))
- throw TimeoutException();
- }
-
- template <class Mtx>
- bool tryWait(Mtx& mutex, long milliseconds)
- /// Unlocks the mutex (which must be locked upon calling
- /// tryWait()) and waits for the given time until the Condition is signalled.
- ///
- /// The given mutex will be locked again upon leaving the
- /// function, even in case of an exception.
- ///
- /// Returns true if the Condition has been signalled
- /// within the given time interval, otherwise false.
- {
- ScopedUnlock<Mtx> unlock(mutex, false);
- Event event;
- {
- FastMutex::ScopedLock lock(_mutex);
- mutex.unlock();
- enqueue(event);
- }
- if (!event.tryWait(milliseconds))
- {
- FastMutex::ScopedLock lock(_mutex);
- dequeue(event);
- return false;
- }
- return true;
- }
-
- void signal();
- /// Signals the Condition and allows one waiting thread
- /// to continue execution.
-
- void broadcast();
- /// Signals the Condition and allows all waiting
- /// threads to continue their execution.
-
-protected:
- void enqueue(Event& event);
- void dequeue();
- void dequeue(Event& event);
-
-private:
- Condition(const Condition&);
- Condition& operator = (const Condition&);
-
- typedef std::deque<Event*> WaitQueue;
-
- FastMutex _mutex;
- WaitQueue _waitQueue;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Condition_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Config.h b/Utilities/Poco/Foundation/include/Poco/Config.h
deleted file mode 100755
index e283bc7ae9..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Config.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// Config.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Foundation
-//
-// Feature configuration for the POCO libraries.
-//
-// Copyright (c) 2006-2009, 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.
-//
-
-
-#ifndef Foundation_Config_INCLUDED
-#define Foundation_Config_INCLUDED
-
-
-// Define to enable Windows Unicode (UTF-8) support
-#define POCO_WIN32_UTF8
-
-
-// Define to disable implicit linking
-// #define POCO_NO_AUTOMATIC_LIBS
-
-
-// Define to disable FPEnvironment support
-// #define POCO_NO_FPENVIRONMENT
-
-
-// Define if std::wstring is not available
-// #define POCO_NO_WSTRING
-
-
-// Define to disable shared memory
-// #define POCO_NO_SHAREDMEMORY
-
-
-// Define to desired default thread stack size
-// Zero means OS default
-#define POCO_THREAD_STACK_SIZE 0
-
-
-// Following are options to remove certain features
-// to reduce library/executable size for smaller
-// embedded platforms. By enabling these options,
-// the size of a statically executable can be
-// reduced by a few 100 Kbytes.
-
-
-// No automatic registration of FileChannel in
-// LoggingFactory - avoids FileChannel and friends
-// being linked to executable.
-// #define POCO_NO_FILECHANNEL
-
-
-// No automatic registration of SplitterChannel in
-// LoggingFactory - avoids SplitterChannel being
-// linked to executable.
-// #define POCO_NO_SPLITTERCHANNEL
-
-
-// No automatic registration of SyslogChannel in
-// LoggingFactory - avoids SyslogChannel being
-// linked to executable on Unix/Linux systems.
-// #define POCO_NO_SYSLOGCHANNEL
-
-
-// No support for INI file configurations in
-// Poco::Util::Application.
-// #define POCO_UTIL_NO_INIFILECONFIGURATION
-
-
-// No support for XML configuration in
-// Poco::Util::Application. Avoids linking of XML
-// library and saves a few 100 Kbytes.
-// #define POCO_UTIL_NO_XMLCONFIGURATION
-
-
-#endif // Foundation_Config_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Configurable.h b/Utilities/Poco/Foundation/include/Poco/Configurable.h
deleted file mode 100755
index c87f395901..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Configurable.h
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// Configurable.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Configurable
-//
-// Definition of the Configurable class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Configurable_INCLUDED
-#define Foundation_Configurable_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Configurable
- /// A simple interface that defines
- /// getProperty() and setProperty() methods.
- ///
- /// This interface is implemented by Formatter and
- /// Channel and is used to configure arbitrary
- /// channels and formatters.
- ///
- /// A property is basically a name-value pair. For
- /// simplicity, both names and values are strings.
- /// Every property controls a certain aspect of a
- /// Formatter or Channel. For example, the PatternFormatter's
- /// formatting pattern is set via a property.
- ///
- /// NOTE: The following property names are use internally
- /// by the logging framework and must not be used by
- /// channels or formatters:
- /// - class
- /// - pattern (Channel)
- /// - formatter (Channel)
-{
-public:
- Configurable();
- /// Creates the Configurable.
-
- virtual ~Configurable();
- /// Destroys the Configurable.
-
- virtual void setProperty(const std::string& name, const std::string& value) = 0;
- /// Sets the property with the given name to the given value.
- /// If a property with the given name is not supported, a
- /// PropertyNotSupportedException is thrown.
-
- virtual std::string getProperty(const std::string& name) const = 0;
- /// Returns the value of the property with the given name.
- /// If a property with the given name is not supported, a
- /// PropertyNotSupportedException is thrown.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Configurable_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ConsoleChannel.h b/Utilities/Poco/Foundation/include/Poco/ConsoleChannel.h
deleted file mode 100755
index 678daa3647..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ConsoleChannel.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// ConsoleChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: ConsoleChannel
-//
-// Definition of the ConsoleChannel class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_ConsoleChannel_INCLUDED
-#define Foundation_ConsoleChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-#include "Poco/Mutex.h"
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API ConsoleChannel: public Channel
- /// A channel that writes to an ostream.
- ///
- /// Only the message's text is written, followed
- /// by a newline.
- ///
- /// Chain this channel to a FormattingChannel with an
- /// appropriate Formatter to control what is contained
- /// in the text.
- ///
- /// Similar to StreamChannel, except that a static
- /// mutex is used to protect against multiple
- /// console channels concurrently writing to the
- /// same stream.
-{
-public:
- ConsoleChannel();
- /// Creates the channel and attached std::clog.
-
- ConsoleChannel(std::ostream& str);
- /// Creates the channel.
-
- void log(const Message& msg);
- /// Logs the given message to the channel's stream.
-
-protected:
- ~ConsoleChannel();
-
-private:
- std::ostream& _str;
- static FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ConsoleChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/CountingStream.h b/Utilities/Poco/Foundation/include/Poco/CountingStream.h
deleted file mode 100755
index 3d9b3f373e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/CountingStream.h
+++ /dev/null
@@ -1,241 +0,0 @@
-//
-// CountingStream.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: CountingStream
-//
-// Definition of the CountingStreamBuf, CountingInputStream and CountingOutputStream classes.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_CountingStream_INCLUDED
-#define Foundation_CountingStream_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnbufferedStreamBuf.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API CountingStreamBuf: public UnbufferedStreamBuf
- /// This stream buffer counts all characters and lines
- /// going through it.
-{
-public:
- CountingStreamBuf();
- /// Creates an unconnected CountingStreamBuf.
-
- CountingStreamBuf(std::istream& istr);
- /// Creates the CountingStreamBuf and connects it
- /// to the given input stream.
-
- CountingStreamBuf(std::ostream& ostr);
- /// Creates the CountingStreamBuf and connects it
- /// to the given output stream.
-
- ~CountingStreamBuf();
- /// Destroys the CountingStream.
-
- int chars() const;
- /// Returns the total number of characters.
-
- int lines() const;
- /// Returns the total number of lines.
-
- int pos() const;
- /// Returns the number of characters on the current line.
-
- void reset();
- /// Resets all counters.
-
- void setCurrentLineNumber(int line);
- /// Sets the current line number.
- ///
- /// This is mainly useful when parsing C/C++
- /// preprocessed source code containing #line directives.
-
- int getCurrentLineNumber() const;
- /// Returns the current line number (same as lines()).
-
-protected:
- int readFromDevice();
- int writeToDevice(char c);
-
-private:
- std::istream* _pIstr;
- std::ostream* _pOstr;
- int _chars;
- int _lines;
- int _pos;
-};
-
-
-class Foundation_API CountingIOS: public virtual std::ios
- /// The base class for CountingInputStream and CountingOutputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- CountingIOS();
- /// Creates the basic stream and leaves it unconnected.
-
- CountingIOS(std::istream& istr);
- /// Creates the basic stream and connects it
- /// to the given input stream.
-
- CountingIOS(std::ostream& ostr);
- /// Creates the basic stream and connects it
- /// to the given output stream.
-
- ~CountingIOS();
- /// Destroys the stream.
-
- int chars() const;
- /// Returns the total number of characters.
-
- int lines() const;
- /// Returns the total number of lines.
-
- int pos() const;
- /// Returns the number of characters on the current line.
-
- void reset();
- /// Resets all counters.
-
- void setCurrentLineNumber(int line);
- /// Sets the current line number.
- ///
- /// This is mainly useful when parsing C/C++
- /// preprocessed source code containing #line directives.
-
- int getCurrentLineNumber() const;
- /// Returns the current line number (same as lines()).
-
- CountingStreamBuf* rdbuf();
- /// Returns a pointer to the underlying streambuf.
-
-protected:
- CountingStreamBuf _buf;
-};
-
-
-class Foundation_API CountingInputStream: public CountingIOS, public std::istream
- /// This stream counts all characters and lines
- /// going through it. This is useful for lexers and parsers
- /// that need to determine the current position in the stream.
-{
-public:
- CountingInputStream(std::istream& istr);
- /// Creates the CountingInputStream and connects it
- /// to the given input stream.
-
- ~CountingInputStream();
- /// Destroys the stream.
-};
-
-
-class Foundation_API CountingOutputStream: public CountingIOS, public std::ostream
- /// This stream counts all characters and lines
- /// going through it.
-{
-public:
- CountingOutputStream();
- /// Creates an unconnected CountingOutputStream.
-
- CountingOutputStream(std::ostream& ostr);
- /// Creates the CountingOutputStream and connects it
- /// to the given input stream.
-
- ~CountingOutputStream();
- /// Destroys the CountingOutputStream.
-};
-
-
-//
-// inlines
-//
-inline int CountingStreamBuf::chars() const
-{
- return _chars;
-}
-
-
-inline int CountingStreamBuf::lines() const
-{
- return _lines;
-}
-
-
-inline int CountingStreamBuf::pos() const
-{
- return _pos;
-}
-
-
-inline int CountingStreamBuf::getCurrentLineNumber() const
-{
- return _lines;
-}
-
-
-inline int CountingIOS::chars() const
-{
- return _buf.chars();
-}
-
-
-inline int CountingIOS::lines() const
-{
- return _buf.lines();
-}
-
-
-inline int CountingIOS::pos() const
-{
- return _buf.pos();
-}
-
-
-inline int CountingIOS::getCurrentLineNumber() const
-{
- return _buf.getCurrentLineNumber();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_CountingStream_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DateTime.h b/Utilities/Poco/Foundation/include/Poco/DateTime.h
deleted file mode 100755
index 3e0003cea3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DateTime.h
+++ /dev/null
@@ -1,433 +0,0 @@
-//
-// DateTime.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: DateTime
-//
-// Definition of the DateTime class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DateTime_INCLUDED
-#define Foundation_DateTime_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Timespan.h"
-
-
-namespace Poco {
-
-
-class Foundation_API DateTime
- /// This class represents an instant in time, expressed
- /// in years, months, days, hours, minutes, seconds
- /// and milliseconds based on the Gregorian calendar.
- /// The class is mainly useful for conversions between
- /// UTC, Julian day and Gregorian calendar dates.
- ///
- /// Conversion calculations are based on algorithms
- /// collected and described by Peter Baum at
- /// http://vsg.cape.com/~pbaum/date/date0.htm
- ///
- /// Internally, this class stores a date/time in two
- /// forms (UTC and broken down) for performance reasons. Only use
- /// this class for conversions between date/time representations.
- /// Use the Timestamp class for everything else.
- ///
- /// Notes:
- /// * Zero is a valid year (in accordance with ISO 8601 and astronomical year numbering)
- /// * Year zero (0) is a leap year
- /// * Negative years (years preceding 1 BC) are not supported
- ///
- /// For more information, please see:
- /// * http://en.wikipedia.org/wiki/Gregorian_Calendar
- /// * http://en.wikipedia.org/wiki/Julian_day
- /// * http://en.wikipedia.org/wiki/UTC
- /// * http://en.wikipedia.org/wiki/ISO_8601
-{
-public:
- enum Months
- /// Symbolic names for month numbers (1 to 12).
- {
- JANUARY = 1,
- FEBRUARY,
- MARCH,
- APRIL,
- MAY,
- JUNE,
- JULY,
- AUGUST,
- SEPTEMBER,
- OCTOBER,
- NOVEMBER,
- DECEMBER
- };
-
- enum DaysOfWeek
- /// Symbolic names for week day numbers (0 to 6).
- {
- SUNDAY = 0,
- MONDAY,
- TUESDAY,
- WEDNESDAY,
- THURSDAY,
- FRIDAY,
- SATURDAY
- };
-
- DateTime();
- /// Creates a DateTime for the current date and time.
-
- DateTime(const Timestamp& timestamp);
- /// Creates a DateTime for the date and time given in
- /// a Timestamp.
-
- DateTime(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0);
- /// Creates a DateTime for the given Gregorian date and time.
- /// * year is from 0 to 9999.
- /// * month is from 1 to 12.
- /// * day is from 1 to 31.
- /// * hour is from 0 to 23.
- /// * minute is from 0 to 59.
- /// * second is from 0 to 59.
- /// * millisecond is from 0 to 999.
- /// * microsecond is from 0 to 999.
-
- DateTime(double julianDay);
- /// Creates a DateTime for the given Julian day.
-
- DateTime(Timestamp::UtcTimeVal utcTime, Timestamp::TimeDiff diff);
- /// Creates a DateTime from an UtcTimeVal and a TimeDiff.
- ///
- /// Mainly used internally by DateTime and friends.
-
- DateTime(const DateTime& dateTime);
- /// Copy constructor. Creates the DateTime from another one.
-
- ~DateTime();
- /// Destroys the DateTime.
-
- DateTime& operator = (const DateTime& dateTime);
- /// Assigns another DateTime.
-
- DateTime& operator = (const Timestamp& timestamp);
- /// Assigns a Timestamp.
-
- DateTime& operator = (double julianDay);
- /// Assigns a Julian day.
-
- DateTime& assign(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microseconds = 0);
- /// Assigns a Gregorian date and time.
- /// * year is from 0 to 9999.
- /// * month is from 1 to 12.
- /// * day is from 1 to 31.
- /// * hour is from 0 to 23.
- /// * minute is from 0 to 59.
- /// * second is from 0 to 59.
- /// * millisecond is from 0 to 999.
- /// * microsecond is from 0 to 999.
-
- void swap(DateTime& dateTime);
- /// Swaps the DateTime with another one.
-
- int year() const;
- /// Returns the year.
-
- int month() const;
- /// Returns the month (1 to 12).
-
- int week(int firstDayOfWeek = MONDAY) const;
- /// Returns the week number within the year.
- /// FirstDayOfWeek should be either SUNDAY (0) or MONDAY (1).
- /// The returned week number will be from 0 to 53. Week number 1 is the week
- /// containing January 4. This is in accordance to ISO 8601.
- ///
- /// The following example assumes that firstDayOfWeek is MONDAY. For 2005, which started
- /// on a Saturday, week 1 will be the week starting on Monday, January 3.
- /// January 1 and 2 will fall within week 0 (or the last week of the previous year).
- ///
- /// For 2007, which starts on a Monday, week 1 will be the week startung on Monday, January 1.
- /// There will be no week 0 in 2007.
-
- int day() const;
- /// Returns the day witin the month (1 to 31).
-
- int dayOfWeek() const;
- /// Returns the weekday (0 to 6, where
- /// 0 = Sunday, 1 = Monday, ..., 6 = Saturday).
-
- int dayOfYear() const;
- /// Returns the number of the day in the year.
- /// January 1 is 1, February 1 is 32, etc.
-
- int hour() const;
- /// Returns the hour (0 to 23).
-
- int hourAMPM() const;
- /// Returns the hour (0 to 12).
-
- bool isAM() const;
- /// Returns true if hour < 12;
-
- bool isPM() const;
- /// Returns true if hour >= 12.
-
- int minute() const;
- /// Returns the minute (0 to 59).
-
- int second() const;
- /// Returns the second (0 to 59).
-
- int millisecond() const;
- /// Returns the millisecond (0 to 999)
-
- int microsecond() const;
- /// Returns the microsecond (0 to 999)
-
- double julianDay() const;
- /// Returns the julian day for the date and time.
-
- Timestamp timestamp() const;
- /// Returns the date and time expressed as a Timestamp.
-
- Timestamp::UtcTimeVal utcTime() const;
- /// Returns the date and time expressed in UTC-based
- /// time. UTC base time is midnight, October 15, 1582.
- /// Resolution is 100 nanoseconds.
-
- bool operator == (const DateTime& dateTime) const;
- bool operator != (const DateTime& dateTime) const;
- bool operator < (const DateTime& dateTime) const;
- bool operator <= (const DateTime& dateTime) const;
- bool operator > (const DateTime& dateTime) const;
- bool operator >= (const DateTime& dateTime) const;
-
- DateTime operator + (const Timespan& span) const;
- DateTime operator - (const Timespan& span) const;
- Timespan operator - (const DateTime& dateTime) const;
- DateTime& operator += (const Timespan& span);
- DateTime& operator -= (const Timespan& span);
-
- void makeUTC(int tzd);
- /// Converts a local time into UTC, by applying the given time zone differential.
-
- void makeLocal(int tzd);
- /// Converts a UTC time into a local time, by applying the given time zone differential.
-
- static bool isLeapYear(int year);
- /// Returns true if the given year is a leap year;
- /// false otherwise.
-
- static int daysOfMonth(int year, int month);
- /// Returns the number of days in the given month
- /// and year. Month is from 1 to 12.
-
- static bool isValid(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0);
- /// Checks if the given date and time is valid
- /// (all arguments are within a proper range).
- ///
- /// Returns true if all arguments are valid, false otherwise.
-
-protected:
- static double toJulianDay(Timestamp::UtcTimeVal utcTime);
- /// Computes the Julian day for an UTC time.
-
- static double toJulianDay(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0);
- /// Computes the Julian day for a gregorian calendar date and time.
- /// See <http://vsg.cape.com/~pbaum/date/jdimp.htm>, section 2.3.1 for the algorithm.
-
- static Timestamp::UtcTimeVal toUtcTime(double julianDay);
- /// Computes the UTC time for a Julian day.
-
- void computeGregorian(double julianDay);
- /// Computes the Gregorian date for the given Julian day.
- /// See <http://vsg.cape.com/~pbaum/date/injdimp.htm>, section 3.3.1 for the algorithm.
-
- void computeDaytime();
- /// Extracts the daytime (hours, minutes, seconds, etc.) from the stored utcTime.
-
-private:
- void checkLimit(short& lower, short& higher, short limit);
- void normalize();
- ///utility functions used to correct the overflow in computeGregorian
-
- Timestamp::UtcTimeVal _utcTime;
- short _year;
- short _month;
- short _day;
- short _hour;
- short _minute;
- short _second;
- short _millisecond;
- short _microsecond;
-};
-
-
-//
-// inlines
-//
-inline Timestamp DateTime::timestamp() const
-{
- return Timestamp::fromUtcTime(_utcTime);
-}
-
-
-inline Timestamp::UtcTimeVal DateTime::utcTime() const
-{
- return _utcTime;
-}
-
-
-inline int DateTime::year() const
-{
- return _year;
-}
-
-
-inline int DateTime::month() const
-{
- return _month;
-}
-
-
-inline int DateTime::day() const
-{
- return _day;
-}
-
-
-inline int DateTime::hour() const
-{
- return _hour;
-}
-
-
-inline int DateTime::hourAMPM() const
-{
- if (_hour < 1)
- return 12;
- else if (_hour > 12)
- return _hour - 12;
- else
- return _hour;
-}
-
-
-inline bool DateTime::isAM() const
-{
- return _hour < 12;
-}
-
-
-inline bool DateTime::isPM() const
-{
- return _hour >= 12;
-}
-
-
-inline int DateTime::minute() const
-{
- return _minute;
-}
-
-
-inline int DateTime::second() const
-{
- return _second;
-}
-
-
-inline int DateTime::millisecond() const
-{
- return _millisecond;
-}
-
-
-inline int DateTime::microsecond() const
-{
- return _microsecond;
-}
-
-
-inline bool DateTime::operator == (const DateTime& dateTime) const
-{
- return _utcTime == dateTime._utcTime;
-}
-
-
-inline bool DateTime::operator != (const DateTime& dateTime) const
-{
- return _utcTime != dateTime._utcTime;
-}
-
-
-inline bool DateTime::operator < (const DateTime& dateTime) const
-{
- return _utcTime < dateTime._utcTime;
-}
-
-
-inline bool DateTime::operator <= (const DateTime& dateTime) const
-{
- return _utcTime <= dateTime._utcTime;
-}
-
-
-inline bool DateTime::operator > (const DateTime& dateTime) const
-{
- return _utcTime > dateTime._utcTime;
-}
-
-
-inline bool DateTime::operator >= (const DateTime& dateTime) const
-{
- return _utcTime >= dateTime._utcTime;
-}
-
-
-inline bool DateTime::isLeapYear(int year)
-{
- return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
-}
-
-
-inline void swap(DateTime& d1, DateTime& d2)
-{
- d1.swap(d2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DateTime_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DateTimeFormat.h b/Utilities/Poco/Foundation/include/Poco/DateTimeFormat.h
deleted file mode 100755
index 12df23baee..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DateTimeFormat.h
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// DateTimeFormat.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: DateTimeFormat
-//
-// Definition of the DateTimeFormat class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DateTimeFormat_INCLUDED
-#define Foundation_DateTimeFormat_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API DateTimeFormat
- /// Definition of date/time formats and various
- /// constants used by DateTimeFormatter and DateTimeParser.
-{
-public:
- // predefined date formats
- static const std::string ISO8601_FORMAT;
- /// The date/time format defined in the ISO 8601 standard.
- ///
- /// Examples:
- /// 2005-01-01T12:00:00+01:00
- /// 2005-01-01T11:00:00Z
-
- static const std::string RFC822_FORMAT;
- /// The date/time format defined in RFC 822 (obsoleted by RFC 1123).
- ///
- /// Examples:
- /// Sat, 1 Jan 05 12:00:00 +0100
- /// Sat, 1 Jan 05 11:00:00 GMT
-
- static const std::string RFC1123_FORMAT;
- /// The date/time format defined in RFC 1123 (obsoletes RFC 822).
- ///
- /// Examples:
- /// Sat, 1 Jan 2005 12:00:00 +0100
- /// Sat, 1 Jan 2005 11:00:00 GMT
-
- static const std::string HTTP_FORMAT;
- /// The date/time format defined in the HTTP specification (RFC 2616),
- /// which is basically a variant of RFC 1036 with a zero-padded day field.
- ///
- /// Examples:
- /// Sat, 01 Jan 2005 12:00:00 +0100
- /// Sat, 01 Jan 2005 11:00:00 GMT
-
- static const std::string RFC850_FORMAT;
- /// The date/time format defined in RFC 850 (obsoleted by RFC 1036).
- ///
- /// Examples:
- /// Saturday, 1-Jan-05 12:00:00 +0100
- /// Saturday, 1-Jan-05 11:00:00 GMT
-
- static const std::string RFC1036_FORMAT;
- /// The date/time format defined in RFC 1036 (obsoletes RFC 850).
- ///
- /// Examples:
- /// Saturday, 1 Jan 05 12:00:00 +0100
- /// Saturday, 1 Jan 05 11:00:00 GMT
-
- static const std::string ASCTIME_FORMAT;
- /// The date/time format produced by the ANSI C asctime() function.
- ///
- /// Example:
- /// Sat Jan 1 12:00:00 2005
-
- static const std::string SORTABLE_FORMAT;
- /// A simple, sortable date/time format.
- ///
- /// Example:
- /// 2005-01-01 12:00:00
-
-
- // names used by formatter and parser
- static const std::string WEEKDAY_NAMES[7];
- /// English names of week days (Sunday, Monday, Tuesday, ...).
-
- static const std::string MONTH_NAMES[12];
- /// English names of months (January, February, ...).
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DateTimeFormat_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DateTimeFormatter.h b/Utilities/Poco/Foundation/include/Poco/DateTimeFormatter.h
deleted file mode 100755
index cb5c6a13e7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DateTimeFormatter.h
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// DateTimeFormatter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: DateTimeFormatter
-//
-// Definition of the DateTimeFormatter class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DateTimeFormatter_INCLUDED
-#define Foundation_DateTimeFormatter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DateTime.h"
-#include "Poco/LocalDateTime.h"
-
-
-namespace Poco {
-
-
-class Timestamp;
-class Timespan;
-
-
-class Foundation_API DateTimeFormatter
- /// This class converts dates and times into strings, supporting a
- /// variety of standard and custom formats.
- ///
- /// There are two kind of static member functions:
- /// * format* functions return a std::string containing
- /// the formatted value.
- /// * append* functions append the formatted value to
- /// an existing string.
-{
-public:
- enum
- {
- UTC = 0xFFFF /// Special value for timeZoneDifferential denoting UTC.
- };
-
- static std::string format(const Timestamp& timestamp, const std::string& fmt, int timeZoneDifferential = UTC);
- /// Formats the given timestamp according to the given format.
- /// The format string is used as a template to format the date and
- /// is copied character by character except for the following special characters,
- /// which are replaced by the corresponding value.
- ///
- /// * %w - abbreviated weekday (Mon, Tue, ...)
- /// * %W - full weekday (Monday, Tuesday, ...)
- /// * %b - abbreviated month (Jan, Feb, ...)
- /// * %B - full month (January, February, ...)
- /// * %d - zero-padded day of month (01 .. 31)
- /// * %e - day of month (1 .. 31)
- /// * %f - space-padded day of month ( 1 .. 31)
- /// * %m - zero-padded month (01 .. 12)
- /// * %n - month (1 .. 12)
- /// * %o - space-padded month ( 1 .. 12)
- /// * %y - year without century (70)
- /// * %Y - year with century (1970)
- /// * %H - hour (00 .. 23)
- /// * %h - hour (00 .. 12)
- /// * %a - am/pm
- /// * %A - AM/PM
- /// * %M - minute (00 .. 59)
- /// * %S - second (00 .. 59)
- /// * %i - millisecond (000 .. 999)
- /// * %c - centisecond (0 .. 9)
- /// * %F - fractional seconds/microseconds (000000 - 999999)
- /// * %z - time zone differential in ISO 8601 format (Z or +NN.NN).
- /// * %Z - time zone differential in RFC format (GMT or +NNNN)
- /// * %% - percent sign
- ///
- /// Class DateTimeFormat defines format strings for various standard date/time formats.
-
- static std::string format(const DateTime& dateTime, const std::string& fmt, int timeZoneDifferential = UTC);
- /// Formats the given date and time according to the given format.
- /// See format(const Timestamp&, const std::string&, int) for more information.
-
- static std::string format(const LocalDateTime& dateTime, const std::string& fmt);
- /// Formats the given local date and time according to the given format.
- /// See format(const Timestamp&, const std::string&, int) for more information.
-
- static std::string format(const Timespan& timespan, const std::string& fmt = "%dd %H:%M:%S.%i");
- /// Formats the given timespan according to the given format.
- /// The format string is used as a template to format the date and
- /// is copied character by character except for the following special characters,
- /// which are replaced by the corresponding value.
- ///
- /// * %d - days
- /// * %H - hours (00 .. 23)
- /// * %h - total hours (0 .. n)
- /// * %M - minutes (00 .. 59)
- /// * %m - total minutes (0 .. n)
- /// * %S - seconds (00 .. 59)
- /// * %s - total seconds (0 .. n)
- /// * %i - milliseconds (000 .. 999)
- /// * %c - centisecond (0 .. 9)
- /// * %F - fractional seconds/microseconds (000000 - 999999)
- /// * %% - percent sign
-
- static void append(std::string& str, const Timestamp& timestamp, const std::string& fmt, int timeZoneDifferential = UTC);
- /// Formats the given timestamp according to the given format and appends it to str.
- ///
- /// See format() for documentation of the formatting string.
-
- static void append(std::string& str, const DateTime& dateTime, const std::string& fmt, int timeZoneDifferential = UTC);
- /// Formats the given date and time according to the given format and appends it to str.
- ///
- /// See format() for documentation of the formatting string.
-
- static void append(std::string& str, const LocalDateTime& dateTime, const std::string& fmt);
- /// Formats the given local date and time according to the given format and appends it to str.
- ///
- /// See format() for documentation of the formatting string.
-
- static void append(std::string& str, const Timespan& timespan, const std::string& fmt = "%dd %H:%M:%S.%i");
- /// Formats the given timespan according to the given format and appends it to str.
- ///
- /// See format() for documentation of the formatting string.
-
- static std::string tzdISO(int timeZoneDifferential);
- /// Formats the given timezone differential in ISO format.
- /// If timeZoneDifferential is UTC, "Z" is returned,
- /// otherwise, +HH.MM (or -HH.MM) is returned.
-
- static std::string tzdRFC(int timeZoneDifferential);
- /// Formats the given timezone differential in RFC format.
- /// If timeZoneDifferential is UTC, "GMT" is returned,
- /// otherwise ++HHMM (or -HHMM) is returned.
-
- static void tzdISO(std::string& str, int timeZoneDifferential);
- /// Formats the given timezone differential in ISO format
- /// and appends it to the given string.
- /// If timeZoneDifferential is UTC, "Z" is returned,
- /// otherwise, +HH.MM (or -HH.MM) is returned.
-
- static void tzdRFC(std::string& str, int timeZoneDifferential);
- /// Formats the given timezone differential in RFC format
- /// and appends it to the given string.
- /// If timeZoneDifferential is UTC, "GMT" is returned,
- /// otherwise ++HHMM (or -HHMM) is returned.
-};
-
-
-//
-// inlines
-//
-inline std::string DateTimeFormatter::format(const Timestamp& timestamp, const std::string& fmt, int timeZoneDifferential)
-{
- DateTime dateTime(timestamp);
- return format(dateTime, fmt, timeZoneDifferential);
-}
-
-
-inline std::string DateTimeFormatter::format(const DateTime& dateTime, const std::string& fmt, int timeZoneDifferential)
-{
- std::string result;
- result.reserve(64);
- append(result, dateTime, fmt, timeZoneDifferential);
- return result;
-}
-
-
-inline std::string DateTimeFormatter::format(const LocalDateTime& dateTime, const std::string& fmt)
-{
- return format(dateTime._dateTime, fmt, dateTime._tzd);
-}
-
-
-inline std::string DateTimeFormatter::format(const Timespan& timespan, const std::string& fmt)
-{
- std::string result;
- result.reserve(32);
- append(result, timespan, fmt);
- return result;
-}
-
-
-inline void DateTimeFormatter::append(std::string& str, const Timestamp& timestamp, const std::string& fmt, int timeZoneDifferential)
-{
- DateTime dateTime(timestamp);
- append(str, dateTime, fmt, timeZoneDifferential);
-}
-
-
-inline std::string DateTimeFormatter::tzdISO(int timeZoneDifferential)
-{
- std::string result;
- result.reserve(8);
- tzdISO(result, timeZoneDifferential);
- return result;
-}
-
-
-inline std::string DateTimeFormatter::tzdRFC(int timeZoneDifferential)
-{
- std::string result;
- result.reserve(8);
- tzdRFC(result, timeZoneDifferential);
- return result;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DateTimeFormatter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DateTimeParser.h b/Utilities/Poco/Foundation/include/Poco/DateTimeParser.h
deleted file mode 100755
index 41518257e0..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DateTimeParser.h
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// DateTimeParser.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: DateTimeParser
-//
-// Definition of the DateTimeParser class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DateTimeParser_INCLUDED
-#define Foundation_DateTimeParser_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DateTime.h"
-
-
-namespace Poco {
-
-
-class Foundation_API DateTimeParser
- /// This class provides a method for parsing dates and times
- /// from strings. All parsing methods do their best to
- /// parse a meaningful result, even from malformed input
- /// strings.
- ///
- /// The returned DateTime will always contain a time in the same
- /// timezone as the time in the string. Call DateTime::makeUTC()
- /// with the timeZoneDifferential returned by parse() to convert
- /// the DateTime to UTC.
- ///
- /// Note: When parsing a time in 12-hour (AM/PM) format, the hour
- /// (%h) must be parsed before the AM/PM designator (%a, %A),
- /// otherwise the AM/PM designator will be ignored.
-{
-public:
- static void parse(const std::string& fmt, const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
- /// Parses a date and time in the given format from the given string.
- /// Throws a SyntaxException if the string cannot be successfully parsed.
- /// Please see DateTimeFormatter::format() for a description of the format string.
- /// Class DateTimeFormat defines format strings for various standard date/time formats.
-
- static DateTime parse(const std::string& fmt, const std::string& str, int& timeZoneDifferential);
- /// Parses a date and time in the given format from the given string.
- /// Throws a SyntaxException if the string cannot be successfully parsed.
- /// Please see DateTimeFormatter::format() for a description of the format string.
- /// Class DateTimeFormat defines format strings for various standard date/time formats.
-
- static bool tryParse(const std::string& fmt, const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
- /// Parses a date and time in the given format from the given string.
- /// Returns true if the string has been successfully parsed, false otherwise.
- /// Please see DateTimeFormatter::format() for a description of the format string.
- /// Class DateTimeFormat defines format strings for various standard date/time formats.
-
- static void parse(const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
- /// Parses a date and time from the given dateTime string. Before parsing, the method
- /// examines the dateTime string for a known date/time format.
- /// Throws a SyntaxException if the string cannot be successfully parsed.
- /// Please see DateTimeFormatter::format() for a description of the format string.
- /// Class DateTimeFormat defines format strings for various standard date/time formats.
-
- static DateTime parse(const std::string& str, int& timeZoneDifferential);
- /// Parses a date and time from the given dateTime string. Before parsing, the method
- /// examines the dateTime string for a known date/time format.
- /// Please see DateTimeFormatter::format() for a description of the format string.
- /// Class DateTimeFormat defines format strings for various standard date/time formats.
-
- static bool tryParse(const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
- /// Parses a date and time from the given dateTime string. Before parsing, the method
- /// examines the dateTime string for a known date/time format.
- /// Please see DateTimeFormatter::format() for a description of the format string.
- /// Class DateTimeFormat defines format strings for various standard date/time formats.
-
- static int parseMonth(std::string::const_iterator& it, const std::string::const_iterator& end);
- /// Tries to interpret the given range as a month name. The range must be at least
- /// three characters long.
- /// Returns the month number (1 .. 12) if the month name is valid. Otherwise throws
- /// a SyntaxException.
-
- static int parseDayOfWeek(std::string::const_iterator& it, const std::string::const_iterator& end);
- /// Tries to interpret the given range as a weekday name. The range must be at least
- /// three characters long.
- /// Returns the weekday number (0 .. 6, where 0 = Synday, 1 = Monday, etc.) if the
- /// weekday name is valid. Otherwise throws a SyntaxException.
-
-protected:
- static int parseTZD(std::string::const_iterator& it, const std::string::const_iterator& end);
- static int parseAMPM(std::string::const_iterator& it, const std::string::const_iterator& end, int hour);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DateTimeParser_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Debugger.h b/Utilities/Poco/Foundation/include/Poco/Debugger.h
deleted file mode 100755
index 64474eb231..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Debugger.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// Debugger.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Debugger
-//
-// Definition of the Debugger class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Debugger_INCLUDED
-#define Foundation_Debugger_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Debugger
- /// The Debugger class provides an interface to the debugger.
- /// The presence of a debugger can be checked for,
- /// messages can be written to the debugger's log window
- /// and a break into the debugger can be enforced.
- /// The methods only work if the program is compiled
- /// in debug mode (the macro _DEBUG is defined).
-{
-public:
- static bool isAvailable();
- /// Returns true if a debugger is available, false otherwise.
- /// On Windows, this function uses the IsDebuggerPresent()
- /// function.
- /// On Unix, this function returns true if the environment
- /// variable POCO_ENABLE_DEBUGGER is set.
- /// On OpenVMS, this function always returns true in debug,
- /// mode, false otherwise.
-
- static void message(const std::string& msg);
- /// Writes a message to the debugger log, if available, otherwise to
- /// standard error output.
-
- static void message(const std::string& msg, const char* file, int line);
- /// Writes a message to the debugger log, if available, otherwise to
- /// standard error output.
-
- static void enter();
- /// Breaks into the debugger, if it is available.
- /// On Windows, this is done using the DebugBreak() function.
- /// On Unix, the SIGINT signal is raised.
- /// On OpenVMS, the SS$_DEBUG signal is raised.
-
- static void enter(const std::string& msg);
- /// Writes a debug message to the debugger log and breaks into it.
-
- static void enter(const std::string& msg, const char* file, int line);
- /// Writes a debug message to the debugger log and breaks into it.
-
- static void enter(const char* file, int line);
- /// Writes a debug message to the debugger log and breaks into it.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Debugger_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DefaultStrategy.h b/Utilities/Poco/Foundation/include/Poco/DefaultStrategy.h
deleted file mode 100755
index 535c9e3a5f..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DefaultStrategy.h
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// DefaultStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: DefaultStrategy
-//
-// Implementation of the DefaultStrategy template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_DefaultStrategy_INCLUDED
-#define Foundation_DefaultStrategy_INCLUDED
-
-
-#include "Poco/NotificationStrategy.h"
-#include <memory>
-#include <set>
-#include <vector>
-
-
-namespace Poco {
-
-
-template <class TArgs, class TDelegate, class TCompare>
-class DefaultStrategy: public NotificationStrategy<TArgs, TDelegate>
- /// Default notification strategy. Allows one observer
- /// to register exactly once. The observer must provide an
- /// < (less-than) operator.
-{
-public:
- typedef std::set<TDelegate*, TCompare> Delegates;
- typedef typename Delegates::iterator Iterator;
- typedef typename Delegates::const_iterator ConstIterator;
-
-public:
- DefaultStrategy()
- {
- }
-
- DefaultStrategy(const DefaultStrategy& s)
- {
- operator = (s);
- }
-
- ~DefaultStrategy()
- {
- clear();
- }
-
- void notify(const void* sender, TArgs& arguments)
- {
- std::vector<Iterator> delMe;
-
- for (Iterator it = _observers.begin(); it != _observers.end(); it++)
- {
- if (!(*it)->notify(sender, arguments))
- {
- // schedule for deletion
- delMe.push_back(it);
- }
- }
-
- while (!delMe.empty())
- {
- typename std::vector<Iterator>::iterator vit = delMe.end();
- --vit;
- delete **vit;
- _observers.erase(*vit);
- delMe.pop_back();
- }
- }
-
- void add(const TDelegate& delegate)
- {
- Iterator it = _observers.find(const_cast<TDelegate*>(&delegate));
- if (it != _observers.end())
- {
- delete *it;
- _observers.erase(it);
- }
- std::auto_ptr<TDelegate> pDelegate(delegate.clone());
- bool tmp = _observers.insert(pDelegate.get()).second;
- poco_assert (tmp);
- pDelegate.release();
- }
-
- void remove(const TDelegate& delegate)
- {
- Iterator it = _observers.find(const_cast<TDelegate*>(&delegate));
- if (it != _observers.end())
- {
- delete *it;
- _observers.erase(it);
- }
- }
-
- DefaultStrategy& operator = (const DefaultStrategy& s)
- {
- if (this != &s)
- {
- for (ConstIterator it = s._observers.begin(); it != s._observers.end(); ++it)
- {
- add(**it);
- }
- }
- return *this;
- }
-
- void clear()
- {
- for (Iterator it = _observers.begin(); it != _observers.end(); ++it)
- {
- delete *it;
- }
- _observers.clear();
- }
-
- bool empty() const
- {
- return _observers.empty();
- }
-
-protected:
- Delegates _observers;
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/DeflatingStream.h b/Utilities/Poco/Foundation/include/Poco/DeflatingStream.h
deleted file mode 100755
index 829b74fe7c..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DeflatingStream.h
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// DeflatingStream.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: ZLibStream
-//
-// Definition of the DeflatingStream class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DeflatingStream_INCLUDED
-#define Foundation_DeflatingStream_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/BufferedStreamBuf.h"
-#include <istream>
-#include <ostream>
-#include "Poco/zlib.h"
-
-
-namespace Poco {
-
-
-class Foundation_API DeflatingStreamBuf: public BufferedStreamBuf
- /// This is the streambuf class used by DeflatingInputStream and DeflatingOutputStream.
- /// The actual work is delegated to zlib 1.2.1 (see http://www.gzip.org).
- /// Both zlib (deflate) streams and gzip streams are supported.
- /// Output streams should always call close() to ensure
- /// proper completion of compression.
- /// A compression level (0 to 9) can be specified in the constructor.
-{
-public:
- enum StreamType
- {
- STREAM_ZLIB,
- STREAM_GZIP
- };
-
- DeflatingStreamBuf(std::istream& istr, StreamType type, int level);
- DeflatingStreamBuf(std::ostream& ostr, StreamType type, int level);
- ~DeflatingStreamBuf();
- int close();
-
-protected:
- int readFromDevice(char* buffer, std::streamsize length);
- int writeToDevice(const char* buffer, std::streamsize length);
-
-private:
- enum
- {
- STREAM_BUFFER_SIZE = 1024,
- DEFLATE_BUFFER_SIZE = 32768
- };
-
- std::istream* _pIstr;
- std::ostream* _pOstr;
- char* _buffer;
- z_stream _zstr;
- bool _eof;
-};
-
-
-class Foundation_API DeflatingIOS: public virtual std::ios
- /// The base class for DeflatingOutputStream and DeflatingInputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- DeflatingIOS(std::ostream& ostr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
- DeflatingIOS(std::istream& istr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
- ~DeflatingIOS();
- DeflatingStreamBuf* rdbuf();
-
-protected:
- DeflatingStreamBuf _buf;
-};
-
-
-class Foundation_API DeflatingOutputStream: public DeflatingIOS, public std::ostream
- /// This stream compresses all data passing through it
- /// using zlib's deflate algorithm.
- /// After all data has been written to the stream, close()
- /// must be called to ensure completion of compression.
- /// Example:
- /// std::ofstream ostr("data.gz", std::ios::binary);
- /// DeflatingOutputStream deflater(ostr, DeflatingStreamBuf::STREAM_GZIP);
- /// deflater << "Hello, world!" << std::endl;
- /// deflater.close();
- /// ostr.close();
-{
-public:
- DeflatingOutputStream(std::ostream& ostr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
- ~DeflatingOutputStream();
- int close();
-};
-
-
-class Foundation_API DeflatingInputStream: public DeflatingIOS, public std::istream
- /// This stream compresses all data passing through it
- /// using zlib's deflate algorithm.
-{
-public:
- DeflatingInputStream(std::istream& istr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
- ~DeflatingInputStream();
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DeflatingStream_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Delegate.h b/Utilities/Poco/Foundation/include/Poco/Delegate.h
deleted file mode 100755
index c170084b89..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Delegate.h
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// Delegate.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: Delegate
-//
-// Implementation of the Delegate template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_Delegate_INCLUDED
-#define Foundation_Delegate_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/AbstractDelegate.h"
-#include "Poco/FunctionDelegate.h"
-#include "Poco/Expire.h"
-
-
-namespace Poco {
-
-
-template <class TObj, class TArgs, bool withSender=true>
-class Delegate: public AbstractDelegate<TArgs>
-{
-public:
- typedef void (TObj::*NotifyMethod)(const void*, TArgs&);
-
- Delegate(TObj* obj, NotifyMethod method):
- AbstractDelegate<TArgs>(obj),
- _receiverObject(obj),
- _receiverMethod(method)
- {
- }
-
- Delegate(const Delegate& delegate):
- AbstractDelegate<TArgs>(delegate),
- _receiverObject(delegate._receiverObject),
- _receiverMethod(delegate._receiverMethod)
- {
- }
-
- ~Delegate()
- {
- }
-
- Delegate& operator = (const Delegate& delegate)
- {
- if (&delegate != this)
- {
- this->_pTarget = delegate._pTarget;
- this->_receiverObject = delegate._receiverObject;
- this->_receiverMethod = delegate._receiverMethod;
- }
- return *this;
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- (_receiverObject->*_receiverMethod)(sender, arguments);
- return true; // a "standard" delegate never expires
- }
-
- AbstractDelegate<TArgs>* clone() const
- {
- return new Delegate(*this);
- }
-
-protected:
- TObj* _receiverObject;
- NotifyMethod _receiverMethod;
-
-private:
- Delegate();
-};
-
-
-template <class TObj, class TArgs>
-class Delegate<TObj, TArgs, false>: public AbstractDelegate<TArgs>
-{
-public:
- typedef void (TObj::*NotifyMethod)(TArgs&);
-
- Delegate(TObj* obj, NotifyMethod method):
- AbstractDelegate<TArgs>(obj),
- _receiverObject(obj),
- _receiverMethod(method)
- {
- }
-
- Delegate(const Delegate& delegate):
- AbstractDelegate<TArgs>(delegate),
- _receiverObject(delegate._receiverObject),
- _receiverMethod(delegate._receiverMethod)
- {
- }
-
- ~Delegate()
- {
- }
-
- Delegate& operator = (const Delegate& delegate)
- {
- if (&delegate != this)
- {
- this->_pTarget = delegate._pTarget;
- this->_receiverObject = delegate._receiverObject;
- this->_receiverMethod = delegate._receiverMethod;
- }
- return *this;
- }
-
- bool notify(const void*, TArgs& arguments)
- {
- (_receiverObject->*_receiverMethod)(arguments);
- return true; // a "standard" delegate never expires
- }
-
- AbstractDelegate<TArgs>* clone() const
- {
- return new Delegate(*this);
- }
-
-protected:
- TObj* _receiverObject;
- NotifyMethod _receiverMethod;
-
-private:
- Delegate();
-};
-
-
-template <class TObj, class TArgs>
-static Delegate<TObj, TArgs, true> delegate(TObj* pObj, void (TObj::*NotifyMethod)(const void*, TArgs&))
-{
- return Delegate<TObj, TArgs, true>(pObj, NotifyMethod);
-}
-
-
-template <class TObj, class TArgs>
-static Delegate<TObj, TArgs, false> delegate(TObj* pObj, void (TObj::*NotifyMethod)(TArgs&))
-{
- return Delegate<TObj, TArgs, false>(pObj, NotifyMethod);
-}
-
-
-
-template <class TObj, class TArgs>
-static Expire<TArgs> delegate(TObj* pObj, void (TObj::*NotifyMethod)(const void*, TArgs&), Timestamp::TimeDiff expireMillisecs)
-{
- return Expire<TArgs>(Delegate<TObj, TArgs, true>(pObj, NotifyMethod), expireMillisecs);
-}
-
-
-template <class TObj, class TArgs>
-static Expire<TArgs> delegate(TObj* pObj, void (TObj::*NotifyMethod)(TArgs&), Timestamp::TimeDiff expireMillisecs)
-{
- return Expire<TArgs>(Delegate<TObj, TArgs, false>(pObj, NotifyMethod), expireMillisecs);
-}
-
-
-template <class TArgs>
-static Expire<TArgs> delegate(void (*NotifyMethod)(const void*, TArgs&), Timestamp::TimeDiff expireMillisecs)
-{
- return Expire<TArgs>(FunctionDelegate<TArgs, true, true>(NotifyMethod), expireMillisecs);
-}
-
-
-template <class TArgs>
-static Expire<TArgs> delegate(void (*NotifyMethod)(void*, TArgs&), Timestamp::TimeDiff expireMillisecs)
-{
- return Expire<TArgs>(FunctionDelegate<TArgs, true, false>(NotifyMethod), expireMillisecs);
-}
-
-
-template <class TArgs>
-static Expire<TArgs> delegate(void (*NotifyMethod)(TArgs&), Timestamp::TimeDiff expireMillisecs)
-{
- return Expire<TArgs>(FunctionDelegate<TArgs, false>( NotifyMethod), expireMillisecs);
-}
-
-
-template <class TArgs>
-static FunctionDelegate<TArgs, true, true> delegate(void (*NotifyMethod)(const void*, TArgs&))
-{
- return FunctionDelegate<TArgs, true, true>(NotifyMethod);
-}
-
-
-template <class TArgs>
-static FunctionDelegate<TArgs, true, false> delegate(void (*NotifyMethod)(void*, TArgs&))
-{
- return FunctionDelegate<TArgs, true, false>(NotifyMethod);
-}
-
-
-template <class TArgs>
-static FunctionDelegate<TArgs, false> delegate(void (*NotifyMethod)(TArgs&))
-{
- return FunctionDelegate<TArgs, false>(NotifyMethod);
-}
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/DigestEngine.h b/Utilities/Poco/Foundation/include/Poco/DigestEngine.h
deleted file mode 100755
index 171dcd384b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DigestEngine.h
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// DigestEngine.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: DigestEngine
-//
-// Definition of class DigestEngine.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DigestEngine_INCLUDED
-#define Foundation_DigestEngine_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-class Foundation_API DigestEngine
- /// This class is an abstract base class
- /// for all classes implementing a message
- /// digest algorithm, like MD5Engine
- /// and SHA1Engine.
- /// Call update() repeatedly with data to
- /// compute the digest from. When done,
- /// call digest() to obtain the message
- /// digest.
-{
-public:
- typedef std::vector<unsigned char> Digest;
-
- DigestEngine();
- virtual ~DigestEngine();
-
- void update(const void* data, unsigned length);
- void update(char data);
- void update(const std::string& data);
- /// Updates the digest with the given data.
-
- virtual unsigned digestLength() const = 0;
- /// Returns the length of the digest in bytes.
-
- virtual void reset() = 0;
- /// Resets the engine so that a new
- /// digest can be computed.
-
- virtual const Digest& digest() = 0;
- /// Finishes the computation of the digest and
- /// returns the message digest. Resets the engine
- /// and can thus only be called once for every digest.
- /// The returned reference is valid until the next
- /// time digest() is called, or the engine object is destroyed.
-
- static std::string digestToHex(const Digest& bytes);
- /// Converts a message digest into a string of hexadecimal numbers.
-
-protected:
- virtual void updateImpl(const void* data, unsigned length) = 0;
- /// Updates the digest with the given data. Must be implemented
- /// by subclasses.
-
-private:
- DigestEngine(const DigestEngine&);
- DigestEngine& operator = (const DigestEngine&);
-};
-
-
-//
-// inlines
-//
-
-
-inline void DigestEngine::update(const void* data, unsigned length)
-{
- updateImpl(data, length);
-}
-
-
-inline void DigestEngine::update(char data)
-{
- updateImpl(&data, 1);
-}
-
-
-inline void DigestEngine::update(const std::string& data)
-{
- updateImpl(data.data(), (unsigned) data.size());
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DigestEngine_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DigestStream.h b/Utilities/Poco/Foundation/include/Poco/DigestStream.h
deleted file mode 100755
index 5997eb58a3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DigestStream.h
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// DigestStream.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: DigestStream
-//
-// Definition of classes DigestInputStream and DigestOutputStream.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DigestStream_INCLUDED
-#define Foundation_DigestStream_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/BufferedStreamBuf.h"
-#include "Poco/DigestEngine.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API DigestBuf: public BufferedStreamBuf
- /// This streambuf computes a digest of all data going
- /// through it.
-{
-public:
- DigestBuf(DigestEngine& eng);
- DigestBuf(DigestEngine& eng, std::istream& istr);
- DigestBuf(DigestEngine& eng, std::ostream& ostr);
- ~DigestBuf();
- int readFromDevice(char* buffer, std::streamsize length);
- int writeToDevice(const char* buffer, std::streamsize length);
- void close();
-
-private:
- DigestEngine& _eng;
- std::istream* _pIstr;
- std::ostream* _pOstr;
- static const int BUFFER_SIZE;
-};
-
-
-class Foundation_API DigestIOS: public virtual std::ios
- /// The base class for DigestInputStream and DigestOutputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- DigestIOS(DigestEngine& eng);
- DigestIOS(DigestEngine& eng, std::istream& istr);
- DigestIOS(DigestEngine& eng, std::ostream& ostr);
- ~DigestIOS();
- DigestBuf* rdbuf();
-
-protected:
- DigestBuf _buf;
-};
-
-
-class Foundation_API DigestInputStream: public DigestIOS, public std::istream
- /// This istream computes a digest of
- /// all the data passing through it,
- /// using a DigestEngine.
-{
-public:
- DigestInputStream(DigestEngine& eng, std::istream& istr);
- ~DigestInputStream();
-};
-
-
-class Foundation_API DigestOutputStream: public DigestIOS, public std::ostream
- /// This ostream computes a digest of
- /// all the data passing through it,
- /// using a DigestEngine.
- /// To ensure that all data has been incorporated
- /// into the digest, call close() or flush() before
- /// you obtain the digest from the digest engine.
-{
-public:
- DigestOutputStream(DigestEngine& eng);
- DigestOutputStream(DigestEngine& eng, std::ostream& ostr);
- ~DigestOutputStream();
- void close();
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DigestStream_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DirectoryIterator.h b/Utilities/Poco/Foundation/include/Poco/DirectoryIterator.h
deleted file mode 100755
index a39148e2ad..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DirectoryIterator.h
+++ /dev/null
@@ -1,173 +0,0 @@
-//
-// DirectoryIterator.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: DirectoryIterator
-//
-// Definition of the DirectoryIterator class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DirectoryIterator_INCLUDED
-#define Foundation_DirectoryIterator_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/File.h"
-#include "Poco/Path.h"
-
-
-namespace Poco {
-
-
-class DirectoryIteratorImpl;
-
-
-class Foundation_API DirectoryIterator
- /// The DirectoryIterator class is used to enumerate
- /// all files in a directory.
- ///
- /// DirectoryIterator has some limitations:
- /// * only forward iteration (++) is supported
- /// * an iterator copied from another one will always
- /// point to the same file as the original iterator,
- /// even is the original iterator has been advanced
- /// (all copies of an iterator share their state with
- /// the original iterator)
- /// * because of this you should only use the prefix
- /// increment operator
-{
-public:
- DirectoryIterator();
- /// Creates the end iterator.
-
- DirectoryIterator(const std::string& path);
- /// Creates a directory iterator for the given path.
-
- DirectoryIterator(const DirectoryIterator& iterator);
- /// Creates a directory iterator for the given path.
-
- DirectoryIterator(const File& file);
- /// Creates a directory iterator for the given file.
-
- DirectoryIterator(const Path& path);
- /// Creates a directory iterator for the given path.
-
- ~DirectoryIterator();
- /// Destroys the DirectoryIterator.
-
- const std::string& name() const;
- /// Returns the current filename.
-
- const Path& path() const;
- /// Returns the current path.
-
- DirectoryIterator& operator = (const DirectoryIterator& it);
- DirectoryIterator& operator = (const File& file);
- DirectoryIterator& operator = (const Path& path);
- DirectoryIterator& operator = (const std::string& path);
-
- DirectoryIterator& operator ++ (); // prefix
-
- //@ deprecated
- DirectoryIterator operator ++ (int); // postfix
- /// Please use the prefix increment operator instead.
-
- const File& operator * () const;
- File& operator * ();
- const File* operator -> () const;
- File* operator -> ();
-
- bool operator == (const DirectoryIterator& iterator) const;
- bool operator != (const DirectoryIterator& iterator) const;
-
-private:
- Path _path;
- File _file;
- DirectoryIteratorImpl* _pImpl;
-};
-
-
-//
-// inlines
-//
-inline const std::string& DirectoryIterator::name() const
-{
- return _path.getFileName();
-}
-
-
-inline const Path& DirectoryIterator::path() const
-{
- return _path;
-}
-
-
-inline const File& DirectoryIterator::operator * () const
-{
- return _file;
-}
-
-
-inline File& DirectoryIterator::operator * ()
-{
- return _file;
-}
-
-
-inline const File* DirectoryIterator::operator -> () const
-{
- return &_file;
-}
-
-
-inline File* DirectoryIterator::operator -> ()
-{
- return &_file;
-}
-
-
-inline bool DirectoryIterator::operator == (const DirectoryIterator& iterator) const
-{
- return name() == iterator.name();
-}
-
-
-inline bool DirectoryIterator::operator != (const DirectoryIterator& iterator) const
-{
- return name() != iterator.name();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DirectoryIterator_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_UNIX.h b/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_UNIX.h
deleted file mode 100755
index e271d3efd2..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_UNIX.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// DirectoryIterator_UNIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: DirectoryIterator
-//
-// Definition of the DirectoryIteratorImpl class for UNIX.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DirectoryIterator_UNIX_INCLUDED
-#define Foundation_DirectoryIterator_UNIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <dirent.h>
-
-
-namespace Poco {
-
-
-class Foundation_API DirectoryIteratorImpl
-{
-public:
- DirectoryIteratorImpl(const std::string& path);
- ~DirectoryIteratorImpl();
-
- void duplicate();
- void release();
-
- const std::string& get() const;
- const std::string& next();
-
-private:
- DIR* _pDir;
- std::string _current;
- int _rc;
-};
-
-
-//
-// inlines
-//
-const std::string& DirectoryIteratorImpl::get() const
-{
- return _current;
-}
-
-
-inline void DirectoryIteratorImpl::duplicate()
-{
- ++_rc;
-}
-
-
-inline void DirectoryIteratorImpl::release()
-{
- if (--_rc == 0)
- delete this;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DirectoryIterator_UNIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_VMS.h b/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_VMS.h
deleted file mode 100755
index e16db2621a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_VMS.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// DirectoryIterator_VMS.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: DirectoryIterator
-//
-// Definition of the DirectoryIteratorImpl class for OpenVMS.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DirectoryIterator_VMS_INCLUDED
-#define Foundation_DirectoryIterator_VMS_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <rms.h>
-
-
-namespace Poco {
-
-
-class Foundation_API DirectoryIteratorImpl
-{
-public:
- DirectoryIteratorImpl(const std::string& path);
- ~DirectoryIteratorImpl();
-
- void duplicate();
- void release();
-
- const std::string& get() const;
- const std::string& next();
-
-private:
- struct FAB _fab;
- struct NAM _nam;
- std::string _search;
- char _spec[255];
- std::string _current;
- int _rc;
-};
-
-
-//
-// inlines
-//
-const std::string& DirectoryIteratorImpl::get() const
-{
- return _current;
-}
-
-
-inline void DirectoryIteratorImpl::duplicate()
-{
- ++_rc;
-}
-
-
-inline void DirectoryIteratorImpl::release()
-{
- if (--_rc == 0)
- delete this;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DirectoryIterator_VMS_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_WIN32.h b/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_WIN32.h
deleted file mode 100755
index b50d4839ad..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_WIN32.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// DirectoryIterator_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: DirectoryIterator
-//
-// Definition of the DirectoryIteratorImpl class for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DirectoryIterator_WIN32_INCLUDED
-#define Foundation_DirectoryIterator_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API DirectoryIteratorImpl
-{
-public:
- DirectoryIteratorImpl(const std::string& path);
- ~DirectoryIteratorImpl();
-
- void duplicate();
- void release();
-
- const std::string& get() const;
- const std::string& next();
-
-private:
- HANDLE _fh;
- WIN32_FIND_DATA _fd;
- std::string _current;
- int _rc;
-};
-
-
-//
-// inlines
-//
-const std::string& DirectoryIteratorImpl::get() const
-{
- return _current;
-}
-
-
-inline void DirectoryIteratorImpl::duplicate()
-{
- ++_rc;
-}
-
-
-inline void DirectoryIteratorImpl::release()
-{
- if (--_rc == 0)
- delete this;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DirectoryIterator_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_WIN32U.h b/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_WIN32U.h
deleted file mode 100755
index ce6513ccaa..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DirectoryIterator_WIN32U.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// DirectoryIterator_WIN32U.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: DirectoryIterator
-//
-// Definition of the DirectoryIteratorImpl class for WIN32.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_DirectoryIterator_WIN32U_INCLUDED
-#define Foundation_DirectoryIterator_WIN32U_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API DirectoryIteratorImpl
-{
-public:
- DirectoryIteratorImpl(const std::string& path);
- ~DirectoryIteratorImpl();
-
- void duplicate();
- void release();
-
- const std::string& get() const;
- const std::string& next();
-
-private:
- HANDLE _fh;
- WIN32_FIND_DATAW _fd;
- std::string _current;
- int _rc;
-};
-
-
-//
-// inlines
-//
-const std::string& DirectoryIteratorImpl::get() const
-{
- return _current;
-}
-
-
-inline void DirectoryIteratorImpl::duplicate()
-{
- ++_rc;
-}
-
-
-inline void DirectoryIteratorImpl::release()
-{
- if (--_rc == 0)
- delete this;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DirectoryIterator_WIN32U_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DynamicAny.h b/Utilities/Poco/Foundation/include/Poco/DynamicAny.h
deleted file mode 100755
index 89833aa57a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DynamicAny.h
+++ /dev/null
@@ -1,1889 +0,0 @@
-//
-// DynamicAny.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: DynamicAny
-//
-// Definition of the DynamicAny class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_DynamicAny_INCLUDED
-#define Foundation_DynamicAny_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DynamicAnyHolder.h"
-#include "Poco/Format.h"
-#include <typeinfo>
-
-
-namespace Poco {
-
-
-class Foundation_API DynamicAny
- /// DynamicAny allows to store data of different types and to convert between these types transparently.
- /// DynamicAny puts forth the best effort to provide intuitive and reasonable conversion semantics and prevent
- /// unexpected data loss, particularly when performing narrowing or signedness conversions of numeric data types.
- ///
- /// An attempt to convert or extract from a non-initialized (empty) DynamicAny variable shall result
- /// in an exception being thrown.
- ///
- /// Loss of signedness is not allowed for numeric values. This means that if an attempt is made to convert
- /// the internal value which is a negative signed integer to an unsigned integer type storage, a RangeException is thrown.
- /// Overflow is not allowed, so if the internal value is a larger number than the target numeric type size can accomodate,
- /// a RangeException is thrown.
- ///
- /// Precision loss, such as in conversion from floating-point types to integers or from double to float on platforms
- /// where they differ in size (provided internal actual value fits in float min/max range), is allowed.
- ///
- /// String truncation is allowed -- it is possible to convert between string and character when string length is
- /// greater than 1. An empty string gets converted to the char '\0', a non-empty string is truncated to the first character.
- ///
- /// Boolean conversion is performed as follows:
- ///
- /// A string value "false" (not case sensitive), "0" or "" (empty string) can be converted to a boolean value false,
- /// any other string not being false by the above criteria evaluates to true (e.g: "hi" -> true).
- /// Integer 0 values are false, everything else is true.
- /// Floating point values equal to the minimal FP representation on a given platform are false, everything else is true.
- ///
- /// Arithmetic operations with POD types as well as between DynamicAny's are supported, subject to following
- /// limitations:
- ///
- /// - for std::string and const char* values, only '+' and '+=' operations are supported
- ///
- /// - for integral and floating point numeric values, following operations are supported:
- /// '+', '+=', '-', '-=', '*', '*=' , '/' and '/='
- ///
- /// - for integral values, following operations are supported:
- /// prefix and postfix increment (++) and decement (--)
- ///
- /// - for all other types, InvalidArgumentException is thrown upon attempt of an arithmetic operation
- ///
- /// A DynamicAny can be created from and converted to a value of any type for which a specialization of
- /// DynamicAnyHolderImpl is available. For supported types, see DynamicAnyHolder documentation.
-{
-public:
- DynamicAny();
- /// Creates an empty DynamicAny.
-
- template <typename T>
- DynamicAny(const T& val):
- _pHolder(new DynamicAnyHolderImpl<T>(val))
- /// Creates the DynamicAny from the given value.
- {
- }
-
- DynamicAny(const char* pVal);
- // Convenience constructor for const char* which gets mapped to a std::string internally, i.e. pVal is deep-copied.
-
- DynamicAny(const DynamicAny& other);
- /// Copy constructor.
-
- ~DynamicAny();
- /// Destroys the DynamicAny.
-
- void swap(DynamicAny& other);
- /// Swaps the content of the this DynamicAny with the other DynamicAny.
-
- template <typename T>
- void convert(T& val) const
- /// Invoke this method to perform a safe conversion.
- ///
- /// Example usage:
- /// DynamicAny any("42");
- /// int i;
- /// any.convert(i);
- ///
- /// Throws a RangeException if the value does not fit
- /// into the result variable.
- /// Throws a NotImplementedException if conversion is
- /// not available for the given type.
- /// Throws InvalidAccessException if DynamicAny is empty.
- {
- if (!_pHolder)
- throw InvalidAccessException("Can not convert empty value.");
-
- _pHolder->convert(val);
- }
-
- template <typename T>
- T convert() const
- /// Invoke this method to perform a safe conversion.
- ///
- /// Example usage:
- /// DynamicAny any("42");
- /// int i = any.convert<int>();
- ///
- /// Throws a RangeException if the value does not fit
- /// into the result variable.
- /// Throws a NotImplementedException if conversion is
- /// not available for the given type.
- /// Throws InvalidAccessException if DynamicAny is empty.
- {
- if (!_pHolder)
- throw InvalidAccessException("Can not convert empty value.");
-
- T result;
- _pHolder->convert(result);
- return result;
- }
-
- template <typename T>
- operator T () const
- /// Safe conversion operator for implicit type
- /// conversions. If the requested type T is same as the
- /// type being held, the operation performed is direct
- /// extraction, otherwise it is the conversion of the value
- /// from type currently held to the one requested.
- ///
- /// Throws a RangeException if the value does not fit
- /// into the result variable.
- /// Throws a NotImplementedException if conversion is
- /// not available for the given type.
- /// Throws InvalidAccessException if DynamicAny is empty.
- {
- if (!_pHolder)
- throw InvalidAccessException("Can not convert empty value.");
-
- if (typeid(T) == _pHolder->type())
- return extract<T>();
- else
- {
- T result;
- _pHolder->convert(result);
- return result;
- }
- }
-
- template <typename T>
- const T& extract() const
- /// Returns a const reference to the actual value.
- ///
- /// Must be instantiated with the exact type of
- /// the stored value, otherwise a BadCastException
- /// is thrown.
- /// Throws InvalidAccessException if DynamicAny is empty.
- {
- if (_pHolder && _pHolder->type() == typeid(T))
- {
- DynamicAnyHolderImpl<T>* pHolderImpl = static_cast<DynamicAnyHolderImpl<T>*>(_pHolder);
- return pHolderImpl->value();
- }
- else if (!_pHolder)
- throw InvalidAccessException("Can not extract empty value.");
- else
- throw BadCastException(format("Can not convert %s to %s.",
- _pHolder->type().name(),
- typeid(T).name()));
- }
-
- template <typename T>
- DynamicAny& operator = (const T& other)
- /// Assignment operator for assigning POD to DynamicAny
- {
- DynamicAny tmp(other);
- swap(tmp);
- return *this;
- }
-
- bool operator ! () const;
- /// Logical NOT operator.
-
- DynamicAny& operator = (const DynamicAny& other);
- /// Assignment operator specialization for DynamicAny
-
- template <typename T>
- const DynamicAny operator + (const T& other) const
- /// Addition operator for adding POD to DynamicAny
- {
- return convert<T>() + other;
- }
-
- const DynamicAny operator + (const DynamicAny& other) const;
- /// Addition operator specialization for DynamicAny
-
- const DynamicAny operator + (const char* other) const;
- /// Addition operator specialization for adding const char* to DynamicAny
-
- DynamicAny& operator ++ ();
- /// Pre-increment operator
-
- const DynamicAny operator ++ (int);
- /// Post-increment operator
-
- DynamicAny& operator -- ();
- /// Pre-decrement operator
-
- const DynamicAny operator -- (int);
- /// Post-decrement operator
-
- template <typename T>
- DynamicAny& operator += (const T& other)
- /// Addition assignment operator for addition/assignment of POD to DynamicAny.
- {
- return *this = convert<T>() + other;
- }
-
- DynamicAny& operator += (const DynamicAny& other);
- /// Addition assignment operator overload for DynamicAny
-
- DynamicAny& operator += (const char* other);
- /// Addition assignment operator overload for const char*
-
- template <typename T>
- const DynamicAny operator - (const T& other) const
- /// Subtraction operator for subtracting POD from DynamicAny
- {
- return convert<T>() - other;
- }
-
- const DynamicAny operator - (const DynamicAny& other) const;
- /// Subtraction operator overload for DynamicAny
-
- template <typename T>
- DynamicAny& operator -= (const T& other)
- /// Subtraction assignment operator
- {
- return *this = convert<T>() - other;
- }
-
- DynamicAny& operator -= (const DynamicAny& other);
- /// Subtraction assignment operator overload for DynamicAny
-
- template <typename T>
- const DynamicAny operator * (const T& other) const
- /// Multiplication operator for multiplying DynamicAny with POD
- {
- return convert<T>() * other;
- }
-
- const DynamicAny operator * (const DynamicAny& other) const;
- /// Multiplication operator overload for DynamicAny
-
- template <typename T>
- DynamicAny& operator *= (const T& other)
- /// Multiplication assignment operator
- {
- return *this = convert<T>() * other;
- }
-
- DynamicAny& operator *= (const DynamicAny& other);
- /// Multiplication assignment operator overload for DynamicAny
-
- template <typename T>
- const DynamicAny operator / (const T& other) const
- /// Division operator for dividing DynamicAny with POD
- {
- return convert<T>() / other;
- }
-
- const DynamicAny operator / (const DynamicAny& other) const;
- /// Division operator overload for DynamicAny
-
- template <typename T>
- DynamicAny& operator /= (const T& other)
- /// Division assignment operator
- {
- return *this = convert<T>() / other;
- }
-
- DynamicAny& operator /= (const DynamicAny& other);
- /// Division assignment operator specialization for DynamicAny
-
- template <typename T>
- bool operator == (const T& other) const
- /// Equality operator
- {
- if (isEmpty()) return false;
- return convert<T>() == other;
- }
-
- bool operator == (const char* other) const;
- /// Equality operator overload for const char*
-
- bool operator == (const DynamicAny& other) const;
- /// Equality operator overload for DynamicAny
-
- template <typename T>
- bool operator != (const T& other) const
- /// Inequality operator
- {
- if (isEmpty()) return true;
- return convert<T>() != other;
- }
-
- bool operator != (const DynamicAny& other) const;
- /// Inequality operator overload for DynamicAny
-
- bool operator != (const char* other) const;
- /// Inequality operator overload for const char*
-
- template <typename T>
- bool operator < (const T& other) const
- /// Less than operator
- {
- if (isEmpty()) return false;
- return convert<T>() < other;
- }
-
- bool operator < (const DynamicAny& other) const;
- /// Less than operator overload for DynamicAny
-
- template <typename T>
- bool operator <= (const T& other) const
- /// Less than or equal operator
- {
- if (isEmpty()) return false;
- return convert<T>() <= other;
- }
-
- bool operator <= (const DynamicAny& other) const;
- /// Less than or equal operator overload for DynamicAny
-
- template <typename T>
- bool operator > (const T& other) const
- /// Greater than operator
- {
- if (isEmpty()) return false;
- return convert<T>() > other;
- }
-
- bool operator > (const DynamicAny& other) const;
- /// Greater than operator overload for DynamicAny
-
- template <typename T>
- bool operator >= (const T& other) const
- /// Greater than or equal operator
- {
- if (isEmpty()) return false;
- return convert<T>() >= other;
- }
-
- bool operator >= (const DynamicAny& other) const;
- /// Greater than or equal operator overload for DynamicAny
-
- template <typename T>
- bool operator || (const T& other) const
- /// Logical OR operator
- {
- if (isEmpty()) return false;
- return convert<bool>() || other;
- }
-
- bool operator || (const DynamicAny& other) const;
- /// Logical OR operator operator overload for DynamicAny
-
- template <typename T>
- bool operator && (const T& other) const
- /// Logical AND operator
- {
- if (isEmpty()) return false;
- return convert<bool>() && other;
- }
-
- bool operator && (const DynamicAny& other) const;
- /// Logical AND operator operator overload for DynamicAny
-
- bool isArray() const;
- /// Returns true if DynamicAny represents a vector
-
- template <typename T>
- DynamicAny& operator [] (T n)
- /// Index operator, only use on DynamicAnys where isArray
- /// returns true! In all other cases InvalidAccessException is thrown.
- {
- return holderImpl<std::vector<DynamicAny>,
- InvalidAccessException>("Not an array.")->operator[](n);
- }
-
- template <typename T>
- const DynamicAny& operator [] (T n) const
- /// const Index operator, only use on DynamicAnys where isArray
- /// returns true! In all other cases InvalidAccessException is thrown.
- {
- return const_cast<const DynamicAny&>(holderImpl<std::vector<DynamicAny>,
- InvalidAccessException>("Not an array.")->operator[](n));
- }
-
- const std::type_info& type() const;
- /// Returns the type information of the stored content.
-
- void empty();
- /// Empties DynamicAny.
-
- bool isEmpty() const;
- /// Returns true if empty.
-
- bool isInteger() const;
- /// Returns true if stored value is integer.
-
- bool isSigned() const;
- /// Returns true if stored value is signed.
-
- bool isNumeric() const;
- /// Returns true if stored value is numeric.
- /// Returns false for numeric strings (e.g. "123" is string, not number)
-
- bool isString() const;
- /// Returns true if stored value is std::string.
-
-private:
- template <typename T>
- T add(const DynamicAny& other) const
- {
- return convert<T>() + other.convert<T>();
- }
-
- template <typename T>
- T subtract(const DynamicAny& other) const
- {
- return convert<T>() - other.convert<T>();
- }
-
- template <typename T>
- T multiply(const DynamicAny& other) const
- {
- return convert<T>() * other.convert<T>();
- }
-
- template <typename T>
- T divide(const DynamicAny& other) const
- {
- return convert<T>() / other.convert<T>();
- }
-
- template <typename T, typename E>
- DynamicAnyHolderImpl<T>* holderImpl(const std::string errorMessage = "") const
- {
- if (_pHolder && _pHolder->type() == typeid(T))
- return static_cast<DynamicAnyHolderImpl<T>*>(_pHolder);
- else if (!_pHolder)
- throw InvalidAccessException("Can not access empty value.");
- else
- throw E(errorMessage);
- }
-
- DynamicAnyHolder* _pHolder;
-};
-
-
-///
-/// inlines
-///
-
-
-///
-/// DynamicAny members
-///
-inline void DynamicAny::swap(DynamicAny& ptr)
-{
- std::swap(_pHolder, ptr._pHolder);
-}
-
-
-inline const std::type_info& DynamicAny::type() const
-{
- return _pHolder ? _pHolder->type() : typeid(void);
-}
-
-
-inline const DynamicAny DynamicAny::operator + (const char* other) const
-{
- return convert<std::string>() + other;
-}
-
-
-inline DynamicAny& DynamicAny::operator += (const char*other)
-{
- return *this = convert<std::string>() + other;
-}
-
-
-inline bool DynamicAny::operator ! () const
-{
- return !convert<bool>();
-}
-
-
-inline bool DynamicAny::isEmpty() const
-{
- return 0 == _pHolder;
-}
-
-
-inline bool DynamicAny::isArray() const
-{
- return _pHolder ? _pHolder->isArray() : false;
-}
-
-
-inline bool DynamicAny::isInteger() const
-{
- return _pHolder ? _pHolder->isInteger() : false;
-}
-
-
-inline bool DynamicAny::isSigned() const
-{
- return _pHolder ? _pHolder->isSigned() : false;
-}
-
-
-inline bool DynamicAny::isNumeric() const
-{
- return _pHolder ? _pHolder->isNumeric() : false;
-}
-
-
-inline bool DynamicAny::isString() const
-{
- return _pHolder ? _pHolder->isString() : false;
-}
-
-
-///
-/// DynamicAny non-member functions
-///
-inline const DynamicAny operator + (const char* other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to const char*
-{
- std::string tmp = other;
- return tmp + da.convert<std::string>();
-}
-
-
-inline char operator + (const char& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to char
-{
- return other + da.convert<char>();
-}
-
-
-inline char operator - (const char& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from char
-{
- return other - da.convert<char>();
-}
-
-
-inline char operator * (const char& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with char
-{
- return other * da.convert<char>();
-}
-
-
-inline char operator / (const char& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with char
-{
- return other / da.convert<char>();
-}
-
-
-inline char operator += (char& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to char
-{
- return other += da.convert<char>();
-}
-
-
-inline char operator -= (char& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from char
-{
- return other -= da.convert<char>();
-}
-
-
-inline char operator *= (char& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with char
-{
- return other *= da.convert<char>();
-}
-
-
-inline char operator /= (char& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with char
-{
- return other /= da.convert<char>();
-}
-
-
-inline bool operator == (const char& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with char
-{
- if (da.isEmpty()) return false;
- return other == da.convert<char>();
-}
-
-
-inline bool operator != (const char& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with char
-{
- if (da.isEmpty()) return true;
- return other != da.convert<char>();
-}
-
-
-inline bool operator < (const char& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with char
-{
- if (da.isEmpty()) return false;
- return other < da.convert<char>();
-}
-
-
-inline bool operator <= (const char& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with char
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<char>();
-}
-
-
-inline bool operator > (const char& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with char
-{
- if (da.isEmpty())return false;
- return other > da.convert<char>();
-}
-
-
-inline bool operator >= (const char& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with char
-{
- if (da.isEmpty())return false;
- return other >= da.convert<char>();
-}
-
-
-inline Poco::Int8 operator + (const Poco::Int8& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to Poco::Int8
-{
- return other + da.convert<Poco::Int8>();
-}
-
-
-inline Poco::Int8 operator - (const Poco::Int8& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from Poco::Int8
-{
- return other - da.convert<Poco::Int8>();
-}
-
-
-inline Poco::Int8 operator * (const Poco::Int8& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with Poco::Int8
-{
- return other * da.convert<Poco::Int8>();
-}
-
-
-inline Poco::Int8 operator / (const Poco::Int8& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with Poco::Int8
-{
- return other / da.convert<Poco::Int8>();
-}
-
-
-inline Poco::Int8 operator += (Poco::Int8& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to Poco::Int8
-{
- return other += da.convert<Poco::Int8>();
-}
-
-
-inline Poco::Int8 operator -= (Poco::Int8& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from Poco::Int8
-{
- return other -= da.convert<Poco::Int8>();
-}
-
-
-inline Poco::Int8 operator *= (Poco::Int8& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with Poco::Int8
-{
- return other *= da.convert<Poco::Int8>();
-}
-
-
-inline Poco::Int8 operator /= (Poco::Int8& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with Poco::Int8
-{
- return other /= da.convert<Poco::Int8>();
-}
-
-
-inline bool operator == (const Poco::Int8& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with Poco::Int8
-{
- if (da.isEmpty()) return false;
- return other == da.convert<Poco::Int8>();
-}
-
-
-inline bool operator != (const Poco::Int8& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with Poco::Int8
-{
- if (da.isEmpty()) return true;
- return other != da.convert<Poco::Int8>();
-}
-
-
-inline bool operator < (const Poco::Int8& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with Poco::Int8
-{
- if (da.isEmpty()) return false;
- return other < da.convert<Poco::Int8>();
-}
-
-
-inline bool operator <= (const Poco::Int8& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with Poco::Int8
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<Poco::Int8>();
-}
-
-
-inline bool operator > (const Poco::Int8& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with Poco::Int8
-{
- if (da.isEmpty()) return false;
- return other > da.convert<Poco::Int8>();
-}
-
-
-inline bool operator >= (const Poco::Int8& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with Poco::Int8
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<Poco::Int8>();
-}
-
-
-inline Poco::UInt8 operator + (const Poco::UInt8& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to Poco::UInt8
-{
- return other + da.convert<Poco::UInt8>();
-}
-
-
-inline Poco::UInt8 operator - (const Poco::UInt8& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from Poco::UInt8
-{
- return other - da.convert<Poco::UInt8>();
-}
-
-
-inline Poco::UInt8 operator * (const Poco::UInt8& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with Poco::UInt8
-{
- return other * da.convert<Poco::UInt8>();
-}
-
-
-inline Poco::UInt8 operator / (const Poco::UInt8& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with Poco::UInt8
-{
- return other / da.convert<Poco::UInt8>();
-}
-
-
-inline Poco::UInt8 operator += (Poco::UInt8& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to Poco::UInt8
-{
- return other += da.convert<Poco::UInt8>();
-}
-
-
-inline Poco::UInt8 operator -= (Poco::UInt8& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from Poco::UInt8
-{
- return other -= da.convert<Poco::UInt8>();
-}
-
-
-inline Poco::UInt8 operator *= (Poco::UInt8& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with Poco::UInt8
-{
- return other *= da.convert<Poco::UInt8>();
-}
-
-
-inline Poco::UInt8 operator /= (Poco::UInt8& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with Poco::UInt8
-{
- return other /= da.convert<Poco::UInt8>();
-}
-
-
-inline bool operator == (const Poco::UInt8& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with Poco::UInt8
-{
- if (da.isEmpty()) return false;
- return other == da.convert<Poco::UInt8>();
-}
-
-
-inline bool operator != (const Poco::UInt8& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with Poco::UInt8
-{
- if (da.isEmpty()) return true;
- return other != da.convert<Poco::UInt8>();
-}
-
-
-inline bool operator < (const Poco::UInt8& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with Poco::UInt8
-{
- if (da.isEmpty()) return false;
- return other < da.convert<Poco::UInt8>();
-}
-
-
-inline bool operator <= (const Poco::UInt8& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with Poco::UInt8
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<Poco::UInt8>();
-}
-
-
-inline bool operator > (const Poco::UInt8& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with Poco::UInt8
-{
- if (da.isEmpty()) return false;
- return other > da.convert<Poco::UInt8>();
-}
-
-
-inline bool operator >= (const Poco::UInt8& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with Poco::UInt8
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<Poco::UInt8>();
-}
-
-
-inline Poco::Int16 operator + (const Poco::Int16& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to Poco::Int16
-{
- return other + da.convert<Poco::Int16>();
-}
-
-
-inline Poco::Int16 operator - (const Poco::Int16& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from Poco::Int16
-{
- return other - da.convert<Poco::Int16>();
-}
-
-
-inline Poco::Int16 operator * (const Poco::Int16& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with Poco::Int16
-{
- return other * da.convert<Poco::Int16>();
-}
-
-
-inline Poco::Int16 operator / (const Poco::Int16& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with Poco::Int16
-{
- return other / da.convert<Poco::Int16>();
-}
-
-
-inline Poco::Int16 operator += (Poco::Int16& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to Poco::Int16
-{
- return other += da.convert<Poco::Int16>();
-}
-
-
-inline Poco::Int16 operator -= (Poco::Int16& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from Poco::Int16
-{
- return other -= da.convert<Poco::Int16>();
-}
-
-
-inline Poco::Int16 operator *= (Poco::Int16& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with Poco::Int16
-{
- return other *= da.convert<Poco::Int16>();
-}
-
-
-inline Poco::Int16 operator /= (Poco::Int16& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with Poco::Int16
-{
- return other /= da.convert<Poco::Int16>();
-}
-
-
-inline bool operator == (const Poco::Int16& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with Poco::Int16
-{
- if (da.isEmpty()) return false;
- return other == da.convert<Poco::Int16>();
-}
-
-
-inline bool operator != (const Poco::Int16& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with Poco::Int16
-{
- if (da.isEmpty()) return true;
- return other != da.convert<Poco::Int16>();
-}
-
-
-inline bool operator < (const Poco::Int16& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with Poco::Int16
-{
- if (da.isEmpty()) return false;
- return other < da.convert<Poco::Int16>();
-}
-
-
-inline bool operator <= (const Poco::Int16& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with Poco::Int16
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<Poco::Int16>();
-}
-
-
-inline bool operator > (const Poco::Int16& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with Poco::Int16
-{
- if (da.isEmpty()) return false;
- return other > da.convert<Poco::Int16>();
-}
-
-
-inline bool operator >= (const Poco::Int16& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with Poco::Int16
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<Poco::Int16>();
-}
-
-
-inline Poco::UInt16 operator + (const Poco::UInt16& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to Poco::UInt16
-{
- return other + da.convert<Poco::UInt16>();
-}
-
-
-inline Poco::UInt16 operator - (const Poco::UInt16& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from Poco::UInt16
-{
- return other - da.convert<Poco::UInt16>();
-}
-
-
-inline Poco::UInt16 operator * (const Poco::UInt16& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with Poco::UInt16
-{
- return other * da.convert<Poco::UInt16>();
-}
-
-
-inline Poco::UInt16 operator / (const Poco::UInt16& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with Poco::UInt16
-{
- return other / da.convert<Poco::UInt16>();
-}
-
-
-inline Poco::UInt16 operator += (Poco::UInt16& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to Poco::UInt16
-{
- return other += da.convert<Poco::UInt16>();
-}
-
-
-inline Poco::UInt16 operator -= (Poco::UInt16& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from Poco::UInt16
-{
- return other -= da.convert<Poco::UInt16>();
-}
-
-
-inline Poco::UInt16 operator *= (Poco::UInt16& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with Poco::UInt16
-{
- return other *= da.convert<Poco::UInt16>();
-}
-
-
-inline Poco::UInt16 operator /= (Poco::UInt16& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with Poco::UInt16
-{
- return other /= da.convert<Poco::UInt16>();
-}
-
-
-inline bool operator == (const Poco::UInt16& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with Poco::UInt16
-{
- if (da.isEmpty()) return false;
- return other == da.convert<Poco::UInt16>();
-}
-
-
-inline bool operator != (const Poco::UInt16& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with Poco::UInt16
-{
- if (da.isEmpty()) return true;
- return other != da.convert<Poco::UInt16>();
-}
-
-
-inline bool operator < (const Poco::UInt16& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with Poco::UInt16
-{
- if (da.isEmpty()) return false;
- return other < da.convert<Poco::UInt16>();
-}
-
-
-inline bool operator <= (const Poco::UInt16& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with Poco::UInt16
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<Poco::UInt16>();
-}
-
-
-inline bool operator > (const Poco::UInt16& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with Poco::UInt16
-{
- if (da.isEmpty()) return false;
- return other > da.convert<Poco::UInt16>();
-}
-
-
-inline bool operator >= (const Poco::UInt16& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with Poco::UInt16
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<Poco::UInt16>();
-}
-
-
-inline Poco::Int32 operator + (const Poco::Int32& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to Poco::Int32
-{
- return other + da.convert<Poco::Int32>();
-}
-
-
-inline Poco::Int32 operator - (const Poco::Int32& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from Poco::Int32
-{
- return other - da.convert<Poco::Int32>();
-}
-
-
-inline Poco::Int32 operator * (const Poco::Int32& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with Poco::Int32
-{
- return other * da.convert<Poco::Int32>();
-}
-
-
-inline Poco::Int32 operator / (const Poco::Int32& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with Poco::Int32
-{
- return other / da.convert<Poco::Int32>();
-}
-
-
-inline Poco::Int32 operator += (Poco::Int32& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to Poco::Int32
-{
- return other += da.convert<Poco::Int32>();
-}
-
-
-inline Poco::Int32 operator -= (Poco::Int32& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from Poco::Int32
-{
- return other -= da.convert<Poco::Int32>();
-}
-
-
-inline Poco::Int32 operator *= (Poco::Int32& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with Poco::Int32
-{
- return other *= da.convert<Poco::Int32>();
-}
-
-
-inline Poco::Int32 operator /= (Poco::Int32& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with Poco::Int32
-{
- return other /= da.convert<Poco::Int32>();
-}
-
-
-inline bool operator == (const Poco::Int32& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with Poco::Int32
-{
- if (da.isEmpty()) return false;
- return other == da.convert<Poco::Int32>();
-}
-
-
-inline bool operator != (const Poco::Int32& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with Poco::Int32
-{
- if (da.isEmpty()) return true;
- return other != da.convert<Poco::Int32>();
-}
-
-
-inline bool operator < (const Poco::Int32& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with Poco::Int32
-{
- if (da.isEmpty()) return false;
- return other < da.convert<Poco::Int32>();
-}
-
-
-inline bool operator <= (const Poco::Int32& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with Poco::Int32
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<Poco::Int32>();
-}
-
-
-inline bool operator > (const Poco::Int32& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with Poco::Int32
-{
- if (da.isEmpty()) return false;
- return other > da.convert<Poco::Int32>();
-}
-
-
-inline bool operator >= (const Poco::Int32& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with Poco::Int32
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<Poco::Int32>();
-}
-
-
-inline Poco::UInt32 operator + (const Poco::UInt32& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to Poco::UInt32
-{
- return other + da.convert<Poco::UInt32>();
-}
-
-
-inline Poco::UInt32 operator - (const Poco::UInt32& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from Poco::UInt32
-{
- return other - da.convert<Poco::UInt32>();
-}
-
-
-inline Poco::UInt32 operator * (const Poco::UInt32& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with Poco::UInt32
-{
- return other * da.convert<Poco::UInt32>();
-}
-
-
-inline Poco::UInt32 operator / (const Poco::UInt32& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with Poco::UInt32
-{
- return other / da.convert<Poco::UInt32>();
-}
-
-
-inline Poco::UInt32 operator += (Poco::UInt32& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to Poco::UInt32
-{
- return other += da.convert<Poco::UInt32>();
-}
-
-
-inline Poco::UInt32 operator -= (Poco::UInt32& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from Poco::UInt32
-{
- return other -= da.convert<Poco::UInt32>();
-}
-
-
-inline Poco::UInt32 operator *= (Poco::UInt32& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with Poco::UInt32
-{
- return other *= da.convert<Poco::UInt32>();
-}
-
-
-inline Poco::UInt32 operator /= (Poco::UInt32& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with Poco::UInt32
-{
- return other /= da.convert<Poco::UInt32>();
-}
-
-
-inline bool operator == (const Poco::UInt32& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with Poco::UInt32
-{
- if (da.isEmpty()) return false;
- return other == da.convert<Poco::UInt32>();
-}
-
-
-inline bool operator != (const Poco::UInt32& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with Poco::UInt32
-{
- if (da.isEmpty()) return true;
- return other != da.convert<Poco::UInt32>();
-}
-
-
-inline bool operator < (const Poco::UInt32& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with Poco::UInt32
-{
- if (da.isEmpty()) return false;
- return other < da.convert<Poco::UInt32>();
-}
-
-
-inline bool operator <= (const Poco::UInt32& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with Poco::UInt32
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<Poco::UInt32>();
-}
-
-
-inline bool operator > (const Poco::UInt32& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with Poco::UInt32
-{
- if (da.isEmpty()) return false;
- return other > da.convert<Poco::UInt32>();
-}
-
-
-inline bool operator >= (const Poco::UInt32& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with Poco::UInt32
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<Poco::UInt32>();
-}
-
-
-inline Poco::Int64 operator + (const Poco::Int64& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to Poco::Int64
-{
- return other + da.convert<Poco::Int64>();
-}
-
-
-inline Poco::Int64 operator - (const Poco::Int64& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from Poco::Int64
-{
- return other - da.convert<Poco::Int64>();
-}
-
-
-inline Poco::Int64 operator * (const Poco::Int64& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with Poco::Int64
-{
- return other * da.convert<Poco::Int64>();
-}
-
-
-inline Poco::Int64 operator / (const Poco::Int64& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with Poco::Int64
-{
- return other / da.convert<Poco::Int64>();
-}
-
-
-inline Poco::Int64 operator += (Poco::Int64& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to Poco::Int64
-{
- return other += da.convert<Poco::Int64>();
-}
-
-
-inline Poco::Int64 operator -= (Poco::Int64& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from Poco::Int64
-{
- return other -= da.convert<Poco::Int64>();
-}
-
-
-inline Poco::Int64 operator *= (Poco::Int64& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with Poco::Int64
-{
- return other *= da.convert<Poco::Int64>();
-}
-
-
-inline Poco::Int64 operator /= (Poco::Int64& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with Poco::Int64
-{
- return other /= da.convert<Poco::Int64>();
-}
-
-
-inline bool operator == (const Poco::Int64& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with Poco::Int64
-{
- if (da.isEmpty()) return false;
- return other == da.convert<Poco::Int64>();
-}
-
-
-inline bool operator != (const Poco::Int64& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with Poco::Int64
-{
- if (da.isEmpty()) return true;
- return other != da.convert<Poco::Int64>();
-}
-
-
-inline bool operator < (const Poco::Int64& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with Poco::Int64
-{
- if (da.isEmpty()) return false;
- return other < da.convert<Poco::Int64>();
-}
-
-
-inline bool operator <= (const Poco::Int64& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with Poco::Int64
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<Poco::Int64>();
-}
-
-
-inline bool operator > (const Poco::Int64& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with Poco::Int64
-{
- if (da.isEmpty()) return false;
- return other > da.convert<Poco::Int64>();
-}
-
-
-inline bool operator >= (const Poco::Int64& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with Poco::Int64
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<Poco::Int64>();
-}
-
-
-inline Poco::UInt64 operator + (const Poco::UInt64& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to Poco::UInt64
-{
- return other + da.convert<Poco::UInt64>();
-}
-
-
-inline Poco::UInt64 operator - (const Poco::UInt64& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from Poco::UInt64
-{
- return other - da.convert<Poco::UInt64>();
-}
-
-
-inline Poco::UInt64 operator * (const Poco::UInt64& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with Poco::UInt64
-{
- return other * da.convert<Poco::UInt64>();
-}
-
-
-inline Poco::UInt64 operator / (const Poco::UInt64& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with Poco::UInt64
-{
- return other / da.convert<Poco::UInt64>();
-}
-
-
-inline Poco::UInt64 operator += (Poco::UInt64& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to Poco::UInt64
-{
- return other += da.convert<Poco::UInt64>();
-}
-
-
-inline Poco::UInt64 operator -= (Poco::UInt64& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from Poco::UInt64
-{
- return other -= da.convert<Poco::UInt64>();
-}
-
-
-inline Poco::UInt64 operator *= (Poco::UInt64& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with Poco::UInt64
-{
- return other *= da.convert<Poco::UInt64>();
-}
-
-
-inline Poco::UInt64 operator /= (Poco::UInt64& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with Poco::UInt64
-{
- return other /= da.convert<Poco::UInt64>();
-}
-
-
-inline bool operator == (const Poco::UInt64& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with Poco::UInt64
-{
- if (da.isEmpty()) return false;
- return other == da.convert<Poco::UInt64>();
-}
-
-
-inline bool operator != (const Poco::UInt64& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with Poco::UInt64
-{
- if (da.isEmpty()) return true;
- return other != da.convert<Poco::UInt64>();
-}
-
-
-inline bool operator < (const Poco::UInt64& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with Poco::UInt64
-{
- if (da.isEmpty()) return false;
- return other < da.convert<Poco::UInt64>();
-}
-
-
-inline bool operator <= (const Poco::UInt64& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with Poco::UInt64
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<Poco::UInt64>();
-}
-
-
-inline bool operator > (const Poco::UInt64& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with Poco::UInt64
-{
- if (da.isEmpty()) return false;
- return other > da.convert<Poco::UInt64>();
-}
-
-
-inline bool operator >= (const Poco::UInt64& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with Poco::UInt64
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<Poco::UInt64>();
-}
-
-
-inline float operator + (const float& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to float
-{
- return other + da.convert<float>();
-}
-
-
-inline float operator - (const float& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from float
-{
- return other - da.convert<float>();
-}
-
-
-inline float operator * (const float& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with float
-{
- return other * da.convert<float>();
-}
-
-
-inline float operator / (const float& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with float
-{
- return other / da.convert<float>();
-}
-
-
-inline float operator += (float& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to float
-{
- return other += da.convert<float>();
-}
-
-
-inline float operator -= (float& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from float
-{
- return other -= da.convert<float>();
-}
-
-
-inline float operator *= (float& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with float
-{
- return other *= da.convert<float>();
-}
-
-
-inline float operator /= (float& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with float
-{
- return other /= da.convert<float>();
-}
-
-
-inline bool operator == (const float& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with float
-{
- if (da.isEmpty()) return false;
- return other == da.convert<float>();
-}
-
-
-inline bool operator != (const float& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with float
-{
- if (da.isEmpty()) return true;
- return other != da.convert<float>();
-}
-
-
-inline bool operator < (const float& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with float
-{
- if (da.isEmpty()) return false;
- return other < da.convert<float>();
-}
-
-
-inline bool operator <= (const float& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with float
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<float>();
-}
-
-
-inline bool operator > (const float& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with float
-{
- if (da.isEmpty()) return false;
- return other > da.convert<float>();
-}
-
-
-inline bool operator >= (const float& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with float
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<float>();
-}
-
-
-inline double operator + (const double& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to double
-{
- return other + da.convert<double>();
-}
-
-
-inline double operator - (const double& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from double
-{
- return other - da.convert<double>();
-}
-
-
-inline double operator * (const double& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with double
-{
- return other * da.convert<double>();
-}
-
-
-inline double operator / (const double& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with double
-{
- return other / da.convert<double>();
-}
-
-
-inline double operator += (double& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to double
-{
- return other += da.convert<double>();
-}
-
-
-inline double operator -= (double& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from double
-{
- return other -= da.convert<double>();
-}
-
-
-inline double operator *= (double& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with double
-{
- return other *= da.convert<double>();
-}
-
-
-inline double operator /= (double& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with double
-{
- return other /= da.convert<double>();
-}
-
-
-inline bool operator == (const double& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with double
-{
- if (da.isEmpty()) return false;
- return other == da.convert<double>();
-}
-
-
-inline bool operator != (const double& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with double
-{
- if (da.isEmpty()) return true;
- return other != da.convert<double>();
-}
-
-
-inline bool operator < (const double& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with double
-{
- if (da.isEmpty()) return false;
- return other < da.convert<double>();
-}
-
-
-inline bool operator <= (const double& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with double
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<double>();
-}
-
-
-inline bool operator > (const double& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with double
-{
- if (da.isEmpty()) return false;
- return other > da.convert<double>();
-}
-
-
-inline bool operator >= (const double& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with double
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<double>();
-}
-
-
-inline bool operator == (const bool& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with bool
-{
- if (da.isEmpty()) return false;
- return other == da.convert<bool>();
-}
-
-
-inline bool operator != (const bool& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with bool
-{
- if (da.isEmpty()) return true;
- return other != da.convert<bool>();
-}
-
-
-inline bool operator == (const std::string& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with std::string
-{
- if (da.isEmpty()) return false;
- return other == da.convert<std::string>();
-}
-
-
-inline bool operator != (const std::string& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with std::string
-{
- if (da.isEmpty()) return true;
- return other != da.convert<std::string>();
-}
-
-
-inline bool operator == (const char* other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with const char*
-{
- if (da.isEmpty()) return false;
- return da.convert<std::string>() == other;
-}
-
-
-inline bool operator != (const char* other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with const char*
-{
- if (da.isEmpty()) return true;
- return da.convert<std::string>() != other;
-}
-
-
-#ifndef POCO_LONG_IS_64_BIT
-
-
-inline long operator + (const long& other, const DynamicAny& da)
- /// Addition operator for adding DynamicAny to long
-{
- return other + da.convert<long>();
-}
-
-
-inline long operator - (const long& other, const DynamicAny& da)
- /// Subtraction operator for subtracting DynamicAny from long
-{
- return other - da.convert<long>();
-}
-
-
-inline long operator * (const long& other, const DynamicAny& da)
- /// Multiplication operator for multiplying DynamicAny with long
-{
- return other * da.convert<long>();
-}
-
-
-inline long operator / (const long& other, const DynamicAny& da)
- /// Division operator for dividing DynamicAny with long
-{
- return other / da.convert<long>();
-}
-
-
-inline long operator += (long& other, const DynamicAny& da)
- /// Addition assignment operator for adding DynamicAny to long
-{
- return other += da.convert<long>();
-}
-
-
-inline long operator -= (long& other, const DynamicAny& da)
- /// Subtraction assignment operator for subtracting DynamicAny from long
-{
- return other -= da.convert<long>();
-}
-
-
-inline long operator *= (long& other, const DynamicAny& da)
- /// Multiplication assignment operator for multiplying DynamicAny with long
-{
- return other *= da.convert<long>();
-}
-
-
-inline long operator /= (long& other, const DynamicAny& da)
- /// Division assignment operator for dividing DynamicAny with long
-{
- return other /= da.convert<long>();
-}
-
-
-inline bool operator == (const long& other, const DynamicAny& da)
- /// Equality operator for comparing DynamicAny with long
-{
- if (da.isEmpty()) return false;
- return other == da.convert<long>();
-}
-
-
-inline bool operator != (const long& other, const DynamicAny& da)
- /// Inequality operator for comparing DynamicAny with long
-{
- if (da.isEmpty()) return true;
- return other != da.convert<long>();
-}
-
-
-inline bool operator < (const long& other, const DynamicAny& da)
- /// Less than operator for comparing DynamicAny with long
-{
- if (da.isEmpty()) return false;
- return other < da.convert<long>();
-}
-
-
-inline bool operator <= (const long& other, const DynamicAny& da)
- /// Less than or equal operator for comparing DynamicAny with long
-{
- if (da.isEmpty()) return false;
- return other <= da.convert<long>();
-}
-
-
-inline bool operator > (const long& other, const DynamicAny& da)
- /// Greater than operator for comparing DynamicAny with long
-{
- if (da.isEmpty()) return false;
- return other > da.convert<long>();
-}
-
-
-inline bool operator >= (const long& other, const DynamicAny& da)
- /// Greater than or equal operator for comparing DynamicAny with long
-{
- if (da.isEmpty()) return false;
- return other >= da.convert<long>();
-}
-
-
-#endif // POCO_LONG_IS_64_BIT
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DynamicAny_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DynamicAnyHolder.h b/Utilities/Poco/Foundation/include/Poco/DynamicAnyHolder.h
deleted file mode 100755
index ad38a59ad3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DynamicAnyHolder.h
+++ /dev/null
@@ -1,3091 +0,0 @@
-//
-// DynamicAnyHolder.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: DynamicAnyHolder
-//
-// Definition of the DynamicAnyHolder class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_DynamicAnyHolder_INCLUDED
-#define Foundation_DynamicAnyHolder_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/NumberParser.h"
-#include "Poco/DateTime.h"
-#include "Poco/Timestamp.h"
-#include "Poco/LocalDateTime.h"
-#include "Poco/DateTimeFormat.h"
-#include "Poco/DateTimeFormatter.h"
-#include "Poco/DateTimeParser.h"
-#include "Poco/String.h"
-#include "Poco/Exception.h"
-#include <vector>
-#include <typeinfo>
-#undef min
-#undef max
-#include <limits>
-
-
-namespace Poco {
-
-
-class DynamicAny;
-
-
-class Foundation_API DynamicAnyHolder
- /// Interface for a data holder used by the DynamicAny class.
- /// Provides methods to convert between data types.
- /// Only data types for which a convert method exists are supported, which are
- /// all C++ built-in types with addition of std::string, DateTime, LocalDateTime, Timestamp,
- /// and std::vector<DynamicAny>.
-{
-public:
- DynamicAnyHolder();
- /// Creates the DynamicAnyHolder.
-
- virtual ~DynamicAnyHolder();
- /// Destroys the DynamicAnyHolder.
-
- virtual DynamicAnyHolder* clone() const = 0;
- /// Deep-copies the DynamicAnyHolder.
-
- virtual const std::type_info& type() const = 0;
- /// Returns the type information of the stored content.
-
- virtual void convert(Int8& val) const = 0;
- virtual void convert(Int16& val) const = 0;
- virtual void convert(Int32& val) const = 0;
- virtual void convert(Int64& val) const = 0;
- virtual void convert(UInt8& val) const = 0;
- virtual void convert(UInt16& val) const = 0;
- virtual void convert(UInt32& val) const = 0;
- virtual void convert(UInt64& val) const = 0;
- virtual void convert(DateTime& val) const = 0;
- virtual void convert(LocalDateTime& val) const = 0;
- virtual void convert(Timestamp& val) const = 0;
- virtual bool isArray() const = 0;
- virtual bool isInteger() const = 0;
- virtual bool isSigned() const = 0;
- virtual bool isNumeric() const = 0;
- virtual bool isString() const = 0;
-
-#ifndef POCO_LONG_IS_64_BIT
- void convert(long& val) const;
- void convert(unsigned long& val) const;
-#endif
-
- virtual void convert(bool& val) const = 0;
- virtual void convert(float& val) const = 0;
- virtual void convert(double& val) const = 0;
- virtual void convert(char& val) const = 0;
- virtual void convert(std::string& val) const = 0;
-
-protected:
- template <typename F, typename T>
- void convertToSmaller(const F& from, T& to) const
- /// This function is meant to convert signed numeric values from
- /// larger to smaller type. It checks the upper and lower bound and
- /// if from value is within limits of type T (i.e. check calls do not throw),
- /// it is converted.
- {
- poco_static_assert (std::numeric_limits<F>::is_specialized);
- poco_static_assert (std::numeric_limits<T>::is_specialized);
- poco_static_assert (std::numeric_limits<F>::is_signed);
- poco_static_assert (std::numeric_limits<T>::is_signed);
-
- if (std::numeric_limits<F>::is_integer)
- checkUpperLimit(from, to);
- else
- checkUpperLimitFloat(from, to);
-
- checkLowerLimit(from, to);
- to = static_cast<T>(from);
- }
-
- template <typename F, typename T>
- void convertToSmallerUnsigned(const F& from, T& to) const
- /// This function is meant for converting unsigned integral data types,
- /// from larger to smaller type. Since lower limit is always 0 for unigned types,
- /// only the upper limit is checked, thus saving some cycles compared to the signed
- /// version of the function. If the value to be converted is smaller than
- /// the maximum value for the target type, the conversion is performed.
- {
- poco_static_assert (std::numeric_limits<F>::is_specialized);
- poco_static_assert (std::numeric_limits<T>::is_specialized);
- poco_static_assert (!std::numeric_limits<F>::is_signed);
- poco_static_assert (!std::numeric_limits<T>::is_signed);
-
- checkUpperLimit(from, to);
- to = static_cast<T>(from);
- }
-
- template <typename F, typename T>
- void convertSignedToUnsigned(const F& from, T& to) const
- /// This function is meant for converting signed integral data types to
- /// unsigned data types. Negative values can not be converted and if one is
- /// encountered, RangeException is thrown.
- /// If upper limit is within the target data type limits, the conversion is performed.
- {
- poco_static_assert (std::numeric_limits<F>::is_specialized);
- poco_static_assert (std::numeric_limits<T>::is_specialized);
- poco_static_assert (std::numeric_limits<F>::is_signed);
- poco_static_assert (!std::numeric_limits<T>::is_signed);
-
- if (from < 0)
- throw RangeException("Value too small.");
- checkUpperLimit(from, to);
- to = static_cast<T>(from);
- }
-
- template <typename F, typename T>
- void convertSignedFloatToUnsigned(const F& from, T& to) const
- /// This function is meant for converting floating point data types to
- /// unsigned integral data types. Negative values can not be converted and if one is
- /// encountered, RangeException is thrown.
- /// If uper limit is within the target data type limits, the conversion is performed.
- {
- poco_static_assert (std::numeric_limits<F>::is_specialized);
- poco_static_assert (std::numeric_limits<T>::is_specialized);
- poco_static_assert (!std::numeric_limits<F>::is_integer);
- poco_static_assert (std::numeric_limits<T>::is_integer);
- poco_static_assert (!std::numeric_limits<T>::is_signed);
-
- if (from < 0)
- throw RangeException("Value too small.");
- checkUpperLimitFloat(from, to);
- to = static_cast<T>(from);
- }
-
- template <typename F, typename T>
- void convertUnsignedToSigned(const F& from, T& to) const
- /// This function is meant for converting unsigned integral data types to
- /// unsigned data types. Negative values can not be converted and if one is
- /// encountered, RangeException is thrown.
- /// If upper limit is within the target data type limits, the converiosn is performed.
- {
- poco_static_assert (std::numeric_limits<F>::is_specialized);
- poco_static_assert (std::numeric_limits<T>::is_specialized);
- poco_static_assert (!std::numeric_limits<F>::is_signed);
- poco_static_assert (std::numeric_limits<T>::is_signed);
-
- checkUpperLimit(from, to);
- to = static_cast<T>(from);
- }
-
-private:
- template <typename F, typename T>
- void checkUpperLimit(const F& from, T&) const
- {
- if ((sizeof(T) < sizeof(F)) &&
- (from > static_cast<F>(std::numeric_limits<T>::max())))
- {
- throw RangeException("Value too large.");
- }
- else
- if (static_cast<T>(from) > std::numeric_limits<T>::max())
- {
- throw RangeException("Value too large.");
- }
- }
-
- template <typename F, typename T>
- void checkUpperLimitFloat(const F& from, T&) const
- {
- if (from > std::numeric_limits<T>::max())
- throw RangeException("Value too large.");
- }
-
- template <typename F, typename T>
- void checkLowerLimit(const F& from, T&) const
- {
- if (from < std::numeric_limits<T>::min())
- throw RangeException("Value too small.");
- }
-};
-
-
-//
-// inlines
-//
-#ifndef POCO_LONG_IS_64_BIT
-inline void DynamicAnyHolder::convert(long& val) const
-{
- Int32 tmp;
- convert(tmp);
- val = tmp;
-}
-
-
-inline void DynamicAnyHolder::convert(unsigned long& val) const
-{
- UInt32 tmp;
- convert(tmp);
- val = tmp;
-}
-#endif
-
-
-template <typename T>
-class DynamicAnyHolderImpl: public DynamicAnyHolder
- /// Template based implementation of a DynamicAnyHolder.
- /// Conversion work happens in the template specializations of this class.
- ///
- /// DynamicAny can be used for any type for which a specialization for
- /// DynamicAnyHolderImpl is available.
- ///
- /// DynamicAnyHolderImpl throws following exceptions:
- /// NotImplementedException (if the specialization for a type does not exist)
- /// RangeException (if an attempt is made to assign a numeric value outside of the target min/max limits
- /// SyntaxException (if an attempt is made to convert a string containing non-numeric characters to number)
- ///
- /// All specializations must additionally implement a public member function:
- /// const T& value() const
- /// returning a const reference to the actual stored value.
-{
-public:
- DynamicAnyHolderImpl()
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(T);
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<T>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<T>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<T>::is_specialized;
- }
-
- bool isString() const
- {
- return type() == typeid(std::string);
- }
-
- void convert(Int8&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(Int16&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(Int32&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(Int64&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(UInt8&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(UInt16&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(UInt32&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(UInt64&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(bool&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(float&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(double&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(char&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(std::string&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(DateTime&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(LocalDateTime&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- void convert(Timestamp&) const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- DynamicAnyHolder* clone() const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-
- bool isArray() const
- {
- throw NotImplementedException("No DynamicAnyHolder specialization for type", typeid(T).name());
- }
-};
-
-
-template <>
-class DynamicAnyHolderImpl<Int8>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(Int8 val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(Int8);
- }
-
- void convert(Int8& val) const
- {
- val = _val;
- }
-
- void convert(Int16& val) const
- {
- val = _val;
- }
-
- void convert(Int32& val) const
- {
- val = _val;
- }
-
- void convert(Int64& val) const
- {
- val = _val;
- }
-
- void convert(UInt8& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt32& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt64& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(bool& val) const
- {
- val = (_val != 0);
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- val = static_cast<char>(_val);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("Int8 -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("Int8 -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("Int8 -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const Int8& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<Int8>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<Int8>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<Int8>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- Int8 _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<Int16>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(Int16 val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(Int16);
- }
-
- void convert(Int8& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int16& val) const
- {
- val = _val;
- }
-
- void convert(Int32& val) const
- {
- val = _val;
- }
-
- void convert(Int64& val) const
- {
- val = _val;
- }
-
- void convert(UInt8& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt32& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt64& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(bool& val) const
- {
- val = (_val != 0);
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("Int16 -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("Int16 -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("Int16 -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const Int16& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<Int16>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<Int16>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<Int16>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- Int16 _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<Int32>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(Int32 val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(Int32);
- }
-
- void convert(Int8& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int16& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int32& val) const
- {
- val = _val;
- }
-
- void convert(Int64& val) const
- {
- val = _val;
- }
-
- void convert(UInt8& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt32& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt64& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(bool& val) const
- {
- val = (_val != 0);
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("Int32 -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("Int32 -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("Int32 -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const Int32& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<Int32>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<Int32>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<Int32>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- Int32 _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<Int64>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(Int64 val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(Int64);
- }
-
- void convert(Int8& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int16& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int32& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int64& val) const
- {
- val = _val;
- }
-
- void convert(UInt8& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt32& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt64& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(bool& val) const
- {
- val = (_val != 0);
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime& dt) const
- {
- dt = Timestamp(_val);
- }
-
- void convert(LocalDateTime& ldt) const
- {
- ldt = Timestamp(_val);
- }
-
- void convert(Timestamp& val) const
- {
- val = Timestamp(_val);
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const Int64& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<Int64>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<Int64>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<Int64>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- Int64 _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<UInt8>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(UInt8 val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(UInt8);
- }
-
- void convert(Int8& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int16& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int32& val) const
- {
- val = static_cast<Int32>(_val);
- }
-
- void convert(Int64& val) const
- {
- val = static_cast<Int64>(_val);
- }
-
- void convert(UInt8& val) const
- {
- val = _val;
- }
-
- void convert(UInt16& val) const
- {
- val = _val;
- }
-
- void convert(UInt32& val) const
- {
- val = _val;
- }
-
- void convert(UInt64& val) const
- {
- val = _val;
- }
-
- void convert(bool& val) const
- {
- val = (_val != 0);
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("UInt8 -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("Unt8 -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("UInt8 -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const UInt8& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<UInt8>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<UInt8>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<UInt8>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- UInt8 _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<UInt16>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(UInt16 val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(UInt16);
- }
-
- void convert(Int8& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int16& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int32& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int64& val) const
- {
- val = static_cast<Int64>(_val);
- }
-
- void convert(UInt8& val) const
- {
- convertToSmallerUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- val = _val;
- }
-
- void convert(UInt32& val) const
- {
- val = _val;
- }
-
- void convert(UInt64& val) const
- {
- val = _val;
- }
-
- void convert(bool& val) const
- {
- val = (_val != 0);
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("UInt16 -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("UInt16 -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("UInt16 -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const UInt16& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<UInt16>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<UInt16>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<UInt16>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- UInt16 _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<UInt32>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(UInt32 val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(UInt32);
- }
-
- void convert(Int8& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int16& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int32& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int64& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(UInt8& val) const
- {
- convertToSmallerUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- convertToSmallerUnsigned(_val, val);
- }
-
- void convert(UInt32& val) const
- {
- val = _val;
- }
-
- void convert(UInt64& val) const
- {
- val = _val;
- }
-
- void convert(bool& val) const
- {
- val = (_val != 0);
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("UInt32 -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("UInt32 -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("UInt32 -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const UInt32& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<UInt32>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<UInt32>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<UInt32>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- UInt32 _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<UInt64>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(UInt64 val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(UInt64);
- }
-
- void convert(Int8& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int16& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int32& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int64& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(UInt8& val) const
- {
- convertToSmallerUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- convertToSmallerUnsigned(_val, val);
- }
-
- void convert(UInt32& val) const
- {
- convertToSmallerUnsigned(_val, val);
- }
-
- void convert(UInt64& val) const
- {
- val = _val;
- }
-
- void convert(bool& val) const
- {
- val = (_val != 0);
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime& dt) const
- {
- Int64 val;
- convertUnsignedToSigned(_val, val);
- dt = Timestamp(val);
- }
-
- void convert(LocalDateTime& ldt) const
- {
- Int64 val;
- convertUnsignedToSigned(_val, val);
- ldt = Timestamp(val);
- }
-
- void convert(Timestamp& val) const
- {
- Int64 tmp;
- convertUnsignedToSigned(_val, tmp);
- val = Timestamp(tmp);
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const UInt64& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<UInt64>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<UInt64>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<UInt64>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- UInt64 _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<bool>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(bool val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(bool);
- }
-
- void convert(Int8& val) const
- {
- val = static_cast<Int8>(_val ? 1 : 0);
- }
-
- void convert(Int16& val) const
- {
- val = static_cast<Int16>(_val ? 1 : 0);
- }
-
- void convert(Int32& val) const
- {
- val = static_cast<Int32>(_val ? 1 : 0);
- }
-
- void convert(Int64& val) const
- {
- val = static_cast<Int64>(_val ? 1 : 0);
- }
-
- void convert(UInt8& val) const
- {
- val = static_cast<UInt8>(_val ? 1 : 0);
- }
-
- void convert(UInt16& val) const
- {
- val = static_cast<UInt16>(_val ? 1 : 0);
- }
-
- void convert(UInt32& val) const
- {
- val = static_cast<UInt32>(_val ? 1 : 0);
- }
-
- void convert(UInt64& val) const
- {
- val = static_cast<UInt64>(_val ? 1 : 0);
- }
-
- void convert(bool& val) const
- {
- val = _val;
- }
-
- void convert(float& val) const
- {
- val = (_val ? 1.0f : 0.0f);
- }
-
- void convert(double& val) const
- {
- val = (_val ? 1.0 : 0.0);
- }
-
- void convert(char& val) const
- {
- val = static_cast<char>(_val ? 1 : 0);
- }
-
- void convert(std::string& val) const
- {
- val = (_val ? "true" : "false");
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("bool -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("bool -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("bool -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const bool& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<bool>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<bool>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<bool>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- bool _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<float>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(float val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(float);
- }
-
- void convert(Int8& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int16& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int32& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int64& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(UInt8& val) const
- {
- convertSignedFloatToUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- convertSignedFloatToUnsigned(_val, val);
- }
-
- void convert(UInt32& val) const
- {
- convertSignedFloatToUnsigned(_val, val);
- }
-
- void convert(UInt64& val) const
- {
- convertSignedFloatToUnsigned(_val, val);
- }
-
- void convert(bool& val) const
- {
- val = !(_val <= std::numeric_limits<float>::min() &&
- _val >= -1 * std::numeric_limits<float>::min());
- }
-
- void convert(float& val) const
- {
- val = _val;
- }
-
- void convert(double& val) const
- {
- val = _val;
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("float -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("float -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("float -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const float& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<float>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<float>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<float>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- float _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<double>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(double val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(double);
- }
-
- void convert(Int8& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int16& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int32& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int64& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(UInt8& val) const
- {
- convertSignedFloatToUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- convertSignedFloatToUnsigned(_val, val);
- }
-
- void convert(UInt32& val) const
- {
- convertSignedFloatToUnsigned(_val, val);
- }
-
- void convert(UInt64& val) const
- {
- convertSignedFloatToUnsigned(_val, val);
- }
-
- void convert(bool& val) const
- {
- val = !(_val <= std::numeric_limits<double>::min() &&
- _val >= -1 * std::numeric_limits<double>::min());
- }
-
- void convert(float& val) const
- {
- double fMin = -1 * std::numeric_limits<float>::max();
- double fMax = std::numeric_limits<float>::max();
-
- if (_val < fMin) throw RangeException("Value too small.");
- if (_val > fMax) throw RangeException("Value too large.");
-
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = _val;
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("double -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("double -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("double -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const double& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<double>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<double>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<double>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- double _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<char>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(char val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(char);
- }
-
- void convert(Int8& val) const
- {
- val = static_cast<Int8>(_val);
- }
-
- void convert(Int16& val) const
- {
- val = static_cast<UInt8>(_val);
- }
-
- void convert(Int32& val) const
- {
- val = static_cast<UInt8>(_val);
- }
-
- void convert(Int64& val) const
- {
- val = static_cast<UInt8>(_val);
- }
-
- void convert(UInt8& val) const
- {
- val = static_cast<UInt8>(_val);
- }
-
- void convert(UInt16& val) const
- {
- val = static_cast<UInt8>(_val);
- }
-
- void convert(UInt32& val) const
- {
- val = static_cast<UInt8>(_val);
- }
-
- void convert(UInt64& val) const
- {
- val = static_cast<UInt8>(_val);
- }
-
- void convert(bool& val) const
- {
- val = (_val != '\0');
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- val = _val;
- }
-
- void convert(std::string& val) const
- {
- val = std::string(1, _val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("char -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("char -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("char -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const char& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<char>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<char>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<char>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- char _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<std::string>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(const char* pVal): _val(pVal)
- {
- }
-
- DynamicAnyHolderImpl(const std::string& val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(std::string);
- }
-
- void convert(Int8& val) const
- {
- int v = NumberParser::parse(_val);
- convertToSmaller(v, val);
- }
-
- void convert(Int16& val) const
- {
- int v = NumberParser::parse(_val);
- convertToSmaller(v, val);
- }
-
- void convert(Int32& val) const
- {
- val = NumberParser::parse(_val);
- }
-
- void convert(Int64& val) const
- {
- val = NumberParser::parse64(_val);
- }
-
- void convert(UInt8& val) const
- {
- unsigned int v = NumberParser::parseUnsigned(_val);
- convertToSmallerUnsigned(v, val);
- }
-
- void convert(UInt16& val) const
- {
- unsigned int v = NumberParser::parseUnsigned(_val);
- convertToSmallerUnsigned(v, val);
- }
-
- void convert(UInt32& val) const
- {
- val = NumberParser::parseUnsigned(_val);
- }
-
- void convert(UInt64& val) const
- {
- val = NumberParser::parseUnsigned64(_val);
- }
-
- void convert(bool& val) const
- {
- static const std::string VAL_FALSE("false");
- static const std::string VAL_INTFALSE("0");
-
- if (_val == VAL_INTFALSE || (icompare(_val, VAL_FALSE) == 0))
- val = false;
- else
- val = true;
- }
-
- void convert(float& val) const
- {
- double v = NumberParser::parseFloat(_val);
- convertToSmaller(v, val);
- }
-
- void convert(double& val) const
- {
- val = NumberParser::parseFloat(_val);
- }
-
- void convert(char& val) const
- {
- if (_val.empty())
- val = '\0';
- else
- val = _val[0];
- }
-
- void convert(std::string& val) const
- {
- val = _val;
- }
-
- void convert(DateTime& val) const
- {
- int tzd = 0;
- if (!DateTimeParser::tryParse(DateTimeFormat::ISO8601_FORMAT, _val, val, tzd))
- throw BadCastException("string -> DateTime");
- }
-
- void convert(LocalDateTime& ldt) const
- {
- int tzd = 0;
- DateTime tmp;
- if (!DateTimeParser::tryParse(DateTimeFormat::ISO8601_FORMAT, _val, tmp, tzd))
- throw BadCastException("string -> LocalDateTime");
-
- ldt = LocalDateTime(tzd, tmp, false);
- }
-
- void convert(Timestamp& ts) const
- {
- int tzd = 0;
- DateTime tmp;
- if (!DateTimeParser::tryParse(DateTimeFormat::ISO8601_FORMAT, _val, tmp, tzd))
- throw BadCastException("string -> Timestamp");
-
- ts = tmp.timestamp();
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const std::string& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return false;
- }
-
- bool isSigned() const
- {
- return false;
- }
-
- bool isNumeric() const
- {
- return false;
- }
-
- bool isString() const
- {
- return true;
- }
-
-private:
- std::string _val;
-};
-
-
-#ifndef POCO_LONG_IS_64_BIT
-
-
-template <>
-class DynamicAnyHolderImpl<long>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(long val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(long);
- }
-
- void convert(Int8& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int16& val) const
- {
- convertToSmaller(_val, val);
- }
-
- void convert(Int32& val) const
- {
- val = static_cast<Int32>(_val);
- }
-
- void convert(Int64& val) const
- {
- val = static_cast<Int64>(_val);
- }
-
- void convert(UInt8& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt32& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(UInt64& val) const
- {
- convertSignedToUnsigned(_val, val);
- }
-
- void convert(bool& val) const
- {
- val = (_val != 0);
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("long -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("long -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("long -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const long& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<long>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<long>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<long>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- long _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<unsigned long>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(unsigned long val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(unsigned long);
- }
-
- void convert(Int8& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int16& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int32& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(Int64& val) const
- {
- convertUnsignedToSigned(_val, val);
- }
-
- void convert(UInt8& val) const
- {
- convertToSmallerUnsigned(_val, val);
- }
-
- void convert(UInt16& val) const
- {
- convertToSmallerUnsigned(_val, val);
- }
-
- void convert(UInt32& val) const
- {
- convertToSmallerUnsigned(_val, val);
- }
-
- void convert(UInt64& val) const
- {
- val = static_cast<UInt64>(_val);
- }
-
- void convert(bool& val) const
- {
- val = (_val != 0);
- }
-
- void convert(float& val) const
- {
- val = static_cast<float>(_val);
- }
-
- void convert(double& val) const
- {
- val = static_cast<double>(_val);
- }
-
- void convert(char& val) const
- {
- UInt8 tmp;
- convert(tmp);
- val = static_cast<char>(tmp);
- }
-
- void convert(std::string& val) const
- {
- val = NumberFormatter::format(_val);
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("unsigned long -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("unsigned long -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("unsigned long -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const unsigned long& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return std::numeric_limits<unsigned long>::is_integer;
- }
-
- bool isSigned() const
- {
- return std::numeric_limits<unsigned long>::is_signed;
- }
-
- bool isNumeric() const
- {
- return std::numeric_limits<unsigned long>::is_specialized;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- unsigned long _val;
-};
-
-
-#endif // 64bit
-
-
-template <typename T>
-class DynamicAnyHolderImpl<std::vector<T> >: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(const std::vector<T>& val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(std::vector<T>);
- }
-
- void convert(Int8& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(Int16& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(Int32& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(Int64& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(UInt8& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(UInt16& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(UInt32& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(UInt64& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(bool& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(float& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(double& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(char& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(std::string& val) const
- {
- throw BadCastException("Cannot cast collection type to non-collection type");
- }
-
- void convert(DateTime&) const
- {
- throw BadCastException("vector -> DateTime");
- }
-
- void convert(LocalDateTime&) const
- {
- throw BadCastException("vector -> LocalDateTime");
- }
-
- void convert(Timestamp&) const
- {
- throw BadCastException("vector -> Timestamp");
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const std::vector<T>& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return true;
- }
-
- bool isInteger() const
- {
- return false;
- }
-
- bool isSigned() const
- {
- return false;
- }
-
- bool isNumeric() const
- {
- return false;
- }
-
- bool isString() const
- {
- return false;
- }
-
- T& operator[](typename std::vector<T>::size_type n)
- {
- return _val.operator[](n);
- }
-
- const T& operator[](typename std::vector<T>::size_type n) const
- {
- return _val.operator[](n);
- }
-
-private:
- std::vector<T> _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<DateTime>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(const DateTime& val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(DateTime);
- }
-
- void convert(Int8&) const
- {
- throw BadCastException();
- }
-
- void convert(Int16&) const
- {
- throw BadCastException();
- }
-
- void convert(Int32&) const
- {
- throw BadCastException();
- }
-
- void convert(Int64& val) const
- {
- val = _val.timestamp().epochMicroseconds();
- }
-
- void convert(UInt8&) const
- {
- throw BadCastException();
- }
-
- void convert(UInt16&) const
- {
- throw BadCastException();
- }
-
- void convert(UInt32&) const
- {
- throw BadCastException();
- }
-
- void convert(UInt64& val) const
- {
- val = _val.timestamp().epochMicroseconds();
- }
-
- void convert(bool&) const
- {
- throw BadCastException();
- }
-
- void convert(float&) const
- {
- throw BadCastException();
- }
-
- void convert(double&) const
- {
- throw BadCastException();
- }
-
- void convert(char&) const
- {
- throw BadCastException();
- }
-
- void convert(std::string& val) const
- {
- val = DateTimeFormatter::format(_val, Poco::DateTimeFormat::ISO8601_FORMAT);
- }
-
- void convert(DateTime& val) const
- {
- val = _val;
- }
-
- void convert(LocalDateTime& ldt) const
- {
- ldt = _val.timestamp();
- }
-
- void convert(Timestamp& ts) const
- {
- ts = _val.timestamp();
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const DateTime& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return false;
- }
-
- bool isSigned() const
- {
- return false;
- }
-
- bool isNumeric() const
- {
- return false;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- DateTime _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<LocalDateTime>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(const LocalDateTime& val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(LocalDateTime);
- }
-
- void convert(Int8&) const
- {
- throw BadCastException();
- }
-
- void convert(Int16&) const
- {
- throw BadCastException();
- }
-
- void convert(Int32&) const
- {
- throw BadCastException();
- }
-
- void convert(Int64& val) const
- {
- val = _val.timestamp().epochMicroseconds();
- }
-
- void convert(UInt8&) const
- {
- throw BadCastException();
- }
-
- void convert(UInt16&) const
- {
- throw BadCastException();
- }
-
- void convert(UInt32&) const
- {
- throw BadCastException();
- }
-
- void convert(UInt64& val) const
- {
- val = _val.timestamp().epochMicroseconds();
- }
-
- void convert(bool&) const
- {
- throw BadCastException();
- }
-
- void convert(float&) const
- {
- throw BadCastException();
- }
-
- void convert(double&) const
- {
- throw BadCastException();
- }
-
- void convert(char&) const
- {
- throw BadCastException();
- }
-
- void convert(std::string& val) const
- {
- val = DateTimeFormatter::format(_val, Poco::DateTimeFormat::ISO8601_FORMAT);
- }
-
- void convert(DateTime& val) const
- {
- val = _val.timestamp();
- }
-
- void convert(LocalDateTime& ldt) const
- {
- ldt = _val;
- }
-
- void convert(Timestamp& ts) const
- {
- ts = _val.timestamp();
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const LocalDateTime& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return false;
- }
-
- bool isSigned() const
- {
- return false;
- }
-
- bool isNumeric() const
- {
- return false;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- LocalDateTime _val;
-};
-
-
-template <>
-class DynamicAnyHolderImpl<Timestamp>: public DynamicAnyHolder
-{
-public:
- DynamicAnyHolderImpl(const Timestamp& val): _val(val)
- {
- }
-
- ~DynamicAnyHolderImpl()
- {
- }
-
- const std::type_info& type() const
- {
- return typeid(Timestamp);
- }
-
- void convert(Int8&) const
- {
- throw BadCastException();
- }
-
- void convert(Int16&) const
- {
- throw BadCastException();
- }
-
- void convert(Int32&) const
- {
- throw BadCastException();
- }
-
- void convert(Int64& val) const
- {
- val = _val.epochMicroseconds();
- }
-
- void convert(UInt8&) const
- {
- throw BadCastException();
- }
-
- void convert(UInt16&) const
- {
- throw BadCastException();
- }
-
- void convert(UInt32&) const
- {
- throw BadCastException();
- }
-
- void convert(UInt64& val) const
- {
- val = _val.epochMicroseconds();
- }
-
- void convert(bool&) const
- {
- throw BadCastException();
- }
-
- void convert(float&) const
- {
- throw BadCastException();
- }
-
- void convert(double&) const
- {
- throw BadCastException();
- }
-
- void convert(char&) const
- {
- throw BadCastException();
- }
-
- void convert(std::string& val) const
- {
- val = DateTimeFormatter::format(_val, Poco::DateTimeFormat::ISO8601_FORMAT);
- }
-
- void convert(DateTime& val) const
- {
- val = _val;
- }
-
- void convert(LocalDateTime& ldt) const
- {
- ldt = _val;
- }
-
- void convert(Timestamp& ts) const
- {
- ts = _val;
- }
-
- DynamicAnyHolder* clone() const
- {
- return new DynamicAnyHolderImpl(_val);
- }
-
- const Timestamp& value() const
- {
- return _val;
- }
-
- bool isArray() const
- {
- return false;
- }
-
- bool isInteger() const
- {
- return false;
- }
-
- bool isSigned() const
- {
- return false;
- }
-
- bool isNumeric() const
- {
- return false;
- }
-
- bool isString() const
- {
- return false;
- }
-
-private:
- Timestamp _val;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DynamicAnyHolder_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/DynamicFactory.h b/Utilities/Poco/Foundation/include/Poco/DynamicFactory.h
deleted file mode 100755
index 2440a97ee5..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/DynamicFactory.h
+++ /dev/null
@@ -1,158 +0,0 @@
-//
-// DynamicFactory.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: DynamicFactory
-//
-// Definition of the DynamicFactory class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_DynamicFactory_INCLUDED
-#define Foundation_DynamicFactory_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Instantiator.h"
-#include "Poco/Exception.h"
-#include "Poco/Mutex.h"
-#include <map>
-#include <memory>
-
-
-namespace Poco {
-
-
-template <class Base>
-class DynamicFactory
- /// A factory that creates objects by class name.
-{
-public:
- typedef AbstractInstantiator<Base> AbstractFactory;
-
- DynamicFactory()
- /// Creates the DynamicFactory.
- {
- }
-
- ~DynamicFactory()
- /// Destroys the DynamicFactory and deletes the instantiators for
- /// all registered classes.
- {
- for (typename FactoryMap::iterator it = _map.begin(); it != _map.end(); ++it)
- {
- delete it->second;
- }
- }
-
- Base* createInstance(const std::string& className) const
- /// Creates a new instance of the class with the given name.
- /// The class must have been registered with registerClass.
- /// If the class name is unknown, a NotFoundException is thrown.
- {
- FastMutex::ScopedLock lock(_mutex);
-
- typename FactoryMap::const_iterator it = _map.find(className);
- if (it != _map.end())
- return it->second->createInstance();
- else
- throw NotFoundException(className);
- }
-
- template <class C>
- void registerClass(const std::string& className)
- /// Registers the instantiator for the given class with the DynamicFactory.
- /// The DynamicFactory takes ownership of the instantiator and deletes
- /// it when it's no longer used.
- /// If the class has already been registered, an ExistsException is thrown
- /// and the instantiator is deleted.
- {
- registerClass(className, new Instantiator<C, Base>);
- }
-
- void registerClass(const std::string& className, AbstractFactory* pAbstractFactory)
- /// Registers the instantiator for the given class with the DynamicFactory.
- /// The DynamicFactory takes ownership of the instantiator and deletes
- /// it when it's no longer used.
- /// If the class has already been registered, an ExistsException is thrown
- /// and the instantiator is deleted.
- {
- poco_check_ptr (pAbstractFactory);
-
- FastMutex::ScopedLock lock(_mutex);
-
- std::auto_ptr<AbstractFactory> ptr(pAbstractFactory);
- typename FactoryMap::iterator it = _map.find(className);
- if (it == _map.end())
- _map[className] = ptr.release();
- else
- throw ExistsException(className);
- }
-
- void unregisterClass(const std::string& className)
- /// Unregisters the given class and deletes the instantiator
- /// for the class.
- /// Throws a NotFoundException if the class has not been registered.
- {
- FastMutex::ScopedLock lock(_mutex);
-
- typename FactoryMap::iterator it = _map.find(className);
- if (it != _map.end())
- {
- delete it->second;
- _map.erase(it);
- }
- else throw NotFoundException(className);
- }
-
- bool isClass(const std::string& className) const
- /// Returns true iff the given class has been registered.
- {
- FastMutex::ScopedLock lock(_mutex);
-
- return _map.find(className) != _map.end();
- }
-
-private:
- DynamicFactory(const DynamicFactory&);
- DynamicFactory& operator = (const DynamicFactory&);
-
- typedef std::map<std::string, AbstractFactory*> FactoryMap;
-
- FactoryMap _map;
- mutable FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_DynamicFactory_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Environment.h b/Utilities/Poco/Foundation/include/Poco/Environment.h
deleted file mode 100755
index b9a8709561..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Environment.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Environment.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Environment
-//
-// Definition of the Environment class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Environment_INCLUDED
-#define Foundation_Environment_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Environment
- /// This class provides access to environment variables
- /// and some general system information.
-{
-public:
- typedef UInt8 NodeId[6]; /// Ethernet address.
-
- static std::string get(const std::string& name);
- /// Returns the value of the environment variable
- /// with the given name. Throws a NotFoundException
- /// if the variable does not exist.
-
- static std::string get(const std::string& name, const std::string& defaultValue);
- /// Returns the value of the environment variable
- /// with the given name. If the environment variable
- /// is undefined, returns defaultValue instead.
-
- static bool has(const std::string& name);
- /// Returns true iff an environment variable
- /// with the given name is defined.
-
- static void set(const std::string& name, const std::string& value);
- /// Sets the environment variable with the given name
- /// to the given value.
-
- static std::string osName();
- /// Returns the operating system name.
-
- static std::string osVersion();
- /// Returns the operating system version.
-
- static std::string osArchitecture();
- /// Returns the operating system architecture.
-
- static std::string nodeName();
- /// Returns the node (or host) name.
-
- static void nodeId(NodeId& id);
- /// Returns the Ethernet address of the first Ethernet
- /// adapter found on the system.
- ///
- /// Throws a SystemException if no Ethernet adapter is available.
-
- static std::string nodeId();
- /// Returns the Ethernet address (format "xx:xx:xx:xx:xx:xx")
- /// of the first Ethernet adapter found on the system.
- ///
- /// Throws a SystemException if no Ethernet adapter is available.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Environment_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Environment_UNIX.h b/Utilities/Poco/Foundation/include/Poco/Environment_UNIX.h
deleted file mode 100755
index 136663bddf..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Environment_UNIX.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// Environment_UNIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Environment
-//
-// Definition of the EnvironmentImpl class for Unix.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Environment_UNIX_INCLUDED
-#define Foundation_Environment_UNIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-#include <map>
-
-
-namespace Poco {
-
-
-class Foundation_API EnvironmentImpl
-{
-public:
- typedef UInt8 NodeId[6]; /// Ethernet address.
-
- static std::string getImpl(const std::string& name);
- static bool hasImpl(const std::string& name);
- static void setImpl(const std::string& name, const std::string& value);
- static std::string osNameImpl();
- static std::string osVersionImpl();
- static std::string osArchitectureImpl();
- static std::string nodeNameImpl();
- static void nodeIdImpl(NodeId& id);
-
-private:
- typedef std::map<std::string, std::string> StringMap;
-
- static StringMap _map;
- static FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Environment_UNIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Environment_VMS.h b/Utilities/Poco/Foundation/include/Poco/Environment_VMS.h
deleted file mode 100755
index 450c6dbe89..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Environment_VMS.h
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// Environment_VMS.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Environment
-//
-// Definition of the EnvironmentImpl class for OpenVMS.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Environment_VMS_INCLUDED
-#define Foundation_Environment_VMS_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-class Foundation_API EnvironmentImpl
-{
-public:
- typedef UInt8 NodeId[6]; /// Ethernet address.
-
- static std::string getImpl(const std::string& name);
- static bool hasImpl(const std::string& name);
- static void setImpl(const std::string& name, const std::string& value);
- static std::string osNameImpl();
- static std::string osVersionImpl();
- static std::string osArchitectureImpl();
- static std::string nodeNameImpl();
- static void nodeIdImpl(NodeId& id);
-
- static std::string getsyi(unsigned short code);
- /// a wrapper for $GETSYIW
-
- static std::string trnlnm(const std::string& name);
-
-private:
- static FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Environment_VMS_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Environment_WIN32.h b/Utilities/Poco/Foundation/include/Poco/Environment_WIN32.h
deleted file mode 100755
index b2e3b513db..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Environment_WIN32.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// Environment_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Environment
-//
-// Definition of the EnvironmentImpl class for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Environment_WIN32_INCLUDED
-#define Foundation_Environment_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API EnvironmentImpl
-{
-public:
- typedef UInt8 NodeId[6]; /// Ethernet address.
-
- static std::string getImpl(const std::string& name);
- static bool hasImpl(const std::string& name);
- static void setImpl(const std::string& name, const std::string& value);
- static std::string osNameImpl();
- static std::string osVersionImpl();
- static std::string osArchitectureImpl();
- static std::string nodeNameImpl();
- static void nodeIdImpl(NodeId& id);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Environment_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Environment_WIN32U.h b/Utilities/Poco/Foundation/include/Poco/Environment_WIN32U.h
deleted file mode 100755
index 3eb5a4d43a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Environment_WIN32U.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// Environment_WIN32U.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Environment
-//
-// Definition of the EnvironmentImpl class for WIN32.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_Environment_WIN32U_INCLUDED
-#define Foundation_Environment_WIN32U_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API EnvironmentImpl
-{
-public:
- typedef UInt8 NodeId[6]; /// Ethernet address.
-
- static std::string getImpl(const std::string& name);
- static bool hasImpl(const std::string& name);
- static void setImpl(const std::string& name, const std::string& value);
- static std::string osNameImpl();
- static std::string osVersionImpl();
- static std::string osArchitectureImpl();
- static std::string nodeNameImpl();
- static void nodeIdImpl(NodeId& id);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Environment_WIN32U_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ErrorHandler.h b/Utilities/Poco/Foundation/include/Poco/ErrorHandler.h
deleted file mode 100755
index 124a6789d1..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ErrorHandler.h
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-// ErrorHandler.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ErrorHandler
-//
-// Definition of the ErrorHandler class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef Foundation_ErrorHandler_INCLUDED
-#define Foundation_ErrorHandler_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-class Foundation_API ErrorHandler
- /// This is the base class for thread error handlers.
- ///
- /// An unhandled exception that causes a thread to terminate is usually
- /// silently ignored, since the class library cannot do anything meaningful
- /// about it.
- ///
- /// The Thread class provides the possibility to register a
- /// global ErrorHandler that is invoked whenever a thread has
- /// been terminated by an unhandled exception.
- /// The ErrorHandler must be derived from this class and can
- /// provide implementations of all three exception() overloads.
- ///
- /// The ErrorHandler is always invoked within the context of
- /// the offending thread.
-{
-public:
- ErrorHandler();
- /// Creates the ErrorHandler.
-
- virtual ~ErrorHandler();
- /// Destroys the ErrorHandler.
-
- virtual void exception(const Exception& exc);
- /// Called when a Poco::Exception (or a subclass)
- /// caused the thread to terminate.
- ///
- /// This method should not throw any exception - it would
- /// be silently ignored.
- ///
- /// The default implementation just breaks into the debugger.
-
- virtual void exception(const std::exception& exc);
- /// Called when a std::exception (or a subclass)
- /// caused the thread to terminate.
- ///
- /// This method should not throw any exception - it would
- /// be silently ignored.
- ///
- /// The default implementation just breaks into the debugger.
-
- virtual void exception();
- /// Called when an exception that is neither a
- /// Poco::Exception nor a std::exception caused
- /// the thread to terminate.
- ///
- /// This method should not throw any exception - it would
- /// be silently ignored.
- ///
- /// The default implementation just breaks into the debugger.
-
- static void handle(const Exception& exc);
- /// Invokes the currently registered ErrorHandler.
-
- static void handle(const std::exception& exc);
- /// Invokes the currently registered ErrorHandler.
-
- static void handle();
- /// Invokes the currently registered ErrorHandler.
-
- static ErrorHandler* set(ErrorHandler* pHandler);
- /// Registers the given handler as the current error handler.
- ///
- /// Returns the previously registered handler.
-
- static ErrorHandler* get();
- /// Returns a pointer to the currently registered
- /// ErrorHandler.
-
-protected:
- static ErrorHandler* defaultHandler();
- /// Returns the default ErrorHandler.
-
-private:
- static ErrorHandler* _pHandler;
- static FastMutex _mutex;
-};
-
-
-//
-// inlines
-//
-inline ErrorHandler* ErrorHandler::get()
-{
- return _pHandler;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ErrorHandler_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Event.h b/Utilities/Poco/Foundation/include/Poco/Event.h
deleted file mode 100755
index 5a7d0483be..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Event.h
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// Event.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Event
-//
-// Definition of the Event class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Event_INCLUDED
-#define Foundation_Event_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/Event_WIN32.h"
-#else
-#include "Poco/Event_POSIX.h"
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API Event: private EventImpl
- /// An Event is a synchronization object that
- /// allows one thread to signal one or more
- /// other threads that a certain event
- /// has happened.
- /// Usually, one thread signals an event,
- /// while one or more other threads wait
- /// for an event to become signalled.
-{
-public:
- Event(bool autoReset = true);
- /// Creates the event. If autoReset is true,
- /// the event is automatically reset after
- /// a wait() successfully returns.
-
- ~Event();
- /// Destroys the event.
-
- void set();
- /// Signals the event. If autoReset is true,
- /// only one thread waiting for the event
- /// can resume execution.
- /// If autoReset is false, all waiting threads
- /// can resume execution.
-
- void wait();
- /// Waits for the event to become signalled.
-
- void wait(long milliseconds);
- /// Waits for the event to become signalled.
- /// Throws a TimeoutException if the event
- /// does not become signalled within the specified
- /// time interval.
-
- bool tryWait(long milliseconds);
- /// Waits for the event to become signalled.
- /// Returns true if the event
- /// became signalled within the specified
- /// time interval, false otherwise.
-
- void reset();
- /// Resets the event to unsignalled state.
-
-private:
- Event(const Event&);
- Event& operator = (const Event&);
-};
-
-
-//
-// inlines
-//
-inline void Event::set()
-{
- setImpl();
-}
-
-
-inline void Event::wait()
-{
- waitImpl();
-}
-
-
-inline void Event::wait(long milliseconds)
-{
- if (!waitImpl(milliseconds))
- throw TimeoutException();
-}
-
-
-inline bool Event::tryWait(long milliseconds)
-{
- return waitImpl(milliseconds);
-}
-
-
-inline void Event::reset()
-{
- resetImpl();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Event_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/EventArgs.h b/Utilities/Poco/Foundation/include/Poco/EventArgs.h
deleted file mode 100755
index 9c26dda52e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/EventArgs.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// EventArgs.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: EventArgs
-//
-// Definition of EventArgs.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_EventArgs_INCLUDED
-#define Foundation_EventArgs_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API EventArgs
- /// The purpose of the EventArgs class is to be used as parameter
- /// when one doesn't want to send any data.
- /// One can use EventArgs as a super-class for one's own event arguments
- /// but with the arguments being a template parameter this is not
- /// necessary.
-{
-public:
- EventArgs();
-
- virtual ~EventArgs();
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/EventLogChannel.h b/Utilities/Poco/Foundation/include/Poco/EventLogChannel.h
deleted file mode 100755
index 14497b5ff1..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/EventLogChannel.h
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// EventLogChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: EventLogChannel
-//
-// Definition of the EventLogChannel class specific to WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_EventLogChannel_INCLUDED
-#define Foundation_EventLogChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API EventLogChannel: public Channel
- /// This Windows-only channel works with the Windows NT Event Log
- /// service.
- ///
- /// To work properly, the EventLogChannel class requires that either
- /// the PocoFoundation.dll or the PocoMsg.dll Dynamic Link Library
- /// containing the message definition resources can be found in $PATH.
-{
-public:
- EventLogChannel();
- /// Creates the EventLogChannel.
- /// The name of the current application (or more correctly,
- /// the name of its executable) is taken as event source name.
-
- EventLogChannel(const std::string& name);
- /// Creates the EventLogChannel with the given event source name.
-
- EventLogChannel(const std::string& name, const std::string& host);
- /// Creates an EventLogChannel with the given event source
- /// name that routes messages to the given host.
-
- void open();
- /// Opens the EventLogChannel. If necessary, the
- /// required registry entries to register a
- /// message resource DLL are made.
-
- void close();
- /// Closes the EventLogChannel.
-
- void log(const Message& msg);
- /// Logs the given message to the Windows Event Log.
- ///
- /// The message type and priority are mapped to
- /// appropriate values for Event Log type and category.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Sets or changes a configuration property.
- ///
- /// The following properties are supported:
- ///
- /// * name: The name of the event source.
- /// * loghost: The name of the host where the Event Log service is running.
- /// The default is "localhost".
- /// * host: same as host.
- /// * logfile: The name of the log file. The default is "Application".
-
- std::string getProperty(const std::string& name) const;
- /// Returns the value of the given property.
-
- static const std::string PROP_NAME;
- static const std::string PROP_HOST;
- static const std::string PROP_LOGHOST;
- static const std::string PROP_LOGFILE;
-
-protected:
- ~EventLogChannel();
- static int getType(const Message& msg);
- static int getCategory(const Message& msg);
- void setUpRegistry() const;
-#if defined(POCO_WIN32_UTF8)
- static std::wstring findLibrary(const wchar_t* name);
-#else
- static std::string findLibrary(const char* name);
-#endif
-
-private:
- std::string _name;
- std::string _host;
- std::string _logFile;
- HANDLE _h;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_EventLogChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Event_POSIX.h b/Utilities/Poco/Foundation/include/Poco/Event_POSIX.h
deleted file mode 100755
index 07e3043e68..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Event_POSIX.h
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// Event_POSIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Event
-//
-// Definition of the EventImpl class for POSIX Threads.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Event_POSIX_INCLUDED
-#define Foundation_Event_POSIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include <pthread.h>
-#include <errno.h>
-
-
-namespace Poco {
-
-
-class Foundation_API EventImpl
-{
-protected:
- EventImpl(bool autoReset);
- ~EventImpl();
- void setImpl();
- void waitImpl();
- bool waitImpl(long milliseconds);
- void resetImpl();
-
-private:
- bool _auto;
- volatile bool _state;
- pthread_mutex_t _mutex;
- pthread_cond_t _cond;
-};
-
-
-//
-// inlines
-//
-inline void EventImpl::setImpl()
-{
- if (pthread_mutex_lock(&_mutex))
- throw SystemException("cannot signal event (lock)");
- _state = true;
- if (pthread_cond_broadcast(&_cond))
- {
- pthread_mutex_unlock(&_mutex);
- throw SystemException("cannot signal event");
- }
- pthread_mutex_unlock(&_mutex);
-}
-
-
-inline void EventImpl::resetImpl()
-{
- if (pthread_mutex_lock(&_mutex))
- throw SystemException("cannot reset event");
- _state = false;
- pthread_mutex_unlock(&_mutex);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Event_POSIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Event_WIN32.h b/Utilities/Poco/Foundation/include/Poco/Event_WIN32.h
deleted file mode 100755
index 8cbe6eecfa..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Event_WIN32.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// Event_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Event
-//
-// Definition of the EventImpl class for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Event_WIN32_INCLUDED
-#define Foundation_Event_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API EventImpl
-{
-protected:
- EventImpl(bool autoReset = false);
- ~EventImpl();
- void setImpl();
- void waitImpl();
- bool waitImpl(long milliseconds);
- void resetImpl();
-
-private:
- HANDLE _event;
-};
-
-
-//
-// inlines
-//
-inline void EventImpl::setImpl()
-{
- if (!SetEvent(_event))
- {
- throw SystemException("cannot signal event");
- }
-}
-
-
-inline void EventImpl::resetImpl()
-{
- if (!ResetEvent(_event))
- {
- throw SystemException("cannot reset event");
- }
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Event_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Exception.h b/Utilities/Poco/Foundation/include/Poco/Exception.h
deleted file mode 100755
index fbbdedb4e3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Exception.h
+++ /dev/null
@@ -1,264 +0,0 @@
-//
-// Exception.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Exception
-//
-// Definition of various Poco exception classes.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Exception_INCLUDED
-#define Foundation_Exception_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <stdexcept>
-
-
-namespace Poco {
-
-
-class Foundation_API Exception: public std::exception
- /// This is the base class for all exceptions defined
- /// in the Poco class library.
-{
-public:
- Exception(const std::string& msg, int code = 0);
- /// Creates an exception.
-
- Exception(const std::string& msg, const std::string& arg, int code = 0);
- /// Creates an exception.
-
- Exception(const std::string& msg, const Exception& nested, int code = 0);
- /// Creates an exception and stores a clone
- /// of the nested exception.
-
- Exception(const Exception& exc);
- /// Copy constructor.
-
- ~Exception() throw();
- /// Destroys the exception and deletes the nested exception.
-
- Exception& operator = (const Exception& exc);
- /// Assignment operator.
-
- virtual const char* name() const throw();
- /// Returns a static string describing the exception.
-
- virtual const char* className() const throw();
- /// Returns the name of the exception class.
-
- virtual const char* what() const throw();
- /// Returns a static string describing the exception.
- ///
- /// Same as name(), but for compatibility with std::exception.
-
- const Exception* nested() const;
- /// Returns a pointer to the nested exception, or
- /// null if no nested exception exists.
-
- const std::string& message() const;
- /// Returns the message text.
-
- int code() const;
- /// Returns the exception code if defined.
-
- std::string displayText() const;
- /// Returns a string consisting of the
- /// message name and the message text.
-
- virtual Exception* clone() const;
- /// Creates an exact copy of the exception.
- ///
- /// The copy can later be thrown again by
- /// invoking rethrow() on it.
-
- virtual void rethrow() const;
- /// (Re)Throws the exception.
- ///
- /// This is useful for temporarily storing a
- /// copy of an exception (see clone()), then
- /// throwing it again.
-
-protected:
- Exception(int code = 0);
- /// Standard constructor.
-
-private:
- std::string _msg;
- Exception* _pNested;
- int _code;
-};
-
-
-//
-// inlines
-//
-inline const Exception* Exception::nested() const
-{
- return _pNested;
-}
-
-
-inline const std::string& Exception::message() const
-{
- return _msg;
-}
-
-
-inline int Exception::code() const
-{
- return _code;
-}
-
-
-//
-// Macros for quickly declaring and implementing exception classes.
-// Unfortunately, we cannot use a template here because character
-// pointers (which we need for specifying the exception name)
-// are not allowed as template arguments.
-//
-#define POCO_DECLARE_EXCEPTION(API, CLS, BASE) \
- class API CLS: public BASE \
- { \
- public: \
- CLS(int code = 0); \
- CLS(const std::string& msg, int code = 0); \
- CLS(const std::string& msg, const std::string& arg, int code = 0); \
- CLS(const std::string& msg, const Poco::Exception& exc, int code = 0); \
- CLS(const CLS& exc); \
- ~CLS() throw(); \
- CLS& operator = (const CLS& exc); \
- const char* name() const throw(); \
- const char* className() const throw(); \
- Poco::Exception* clone() const; \
- void rethrow() const; \
- };
-
-
-#define POCO_IMPLEMENT_EXCEPTION(CLS, BASE, NAME) \
- CLS::CLS(int code): BASE(code) \
- { \
- } \
- CLS::CLS(const std::string& msg, int code): BASE(msg, code) \
- { \
- } \
- CLS::CLS(const std::string& msg, const std::string& arg, int code): BASE(msg, arg, code) \
- { \
- } \
- CLS::CLS(const std::string& msg, const Poco::Exception& exc, int code): BASE(msg, exc, code) \
- { \
- } \
- CLS::CLS(const CLS& exc): BASE(exc) \
- { \
- } \
- CLS::~CLS() throw() \
- { \
- } \
- CLS& CLS::operator = (const CLS& exc) \
- { \
- BASE::operator = (exc); \
- return *this; \
- } \
- const char* CLS::name() const throw() \
- { \
- return NAME; \
- } \
- const char* CLS::className() const throw() \
- { \
- return typeid(*this).name(); \
- } \
- Poco::Exception* CLS::clone() const \
- { \
- return new CLS(*this); \
- } \
- void CLS::rethrow() const \
- { \
- throw *this; \
- }
-
-
-//
-// Standard exception classes
-//
-POCO_DECLARE_EXCEPTION(Foundation_API, LogicException, Exception)
-POCO_DECLARE_EXCEPTION(Foundation_API, AssertionViolationException, LogicException)
-POCO_DECLARE_EXCEPTION(Foundation_API, NullPointerException, LogicException)
-POCO_DECLARE_EXCEPTION(Foundation_API, BugcheckException, LogicException)
-POCO_DECLARE_EXCEPTION(Foundation_API, InvalidArgumentException, LogicException)
-POCO_DECLARE_EXCEPTION(Foundation_API, NotImplementedException, LogicException)
-POCO_DECLARE_EXCEPTION(Foundation_API, RangeException, LogicException)
-POCO_DECLARE_EXCEPTION(Foundation_API, IllegalStateException, LogicException)
-POCO_DECLARE_EXCEPTION(Foundation_API, InvalidAccessException, LogicException)
-POCO_DECLARE_EXCEPTION(Foundation_API, SignalException, LogicException)
-POCO_DECLARE_EXCEPTION(Foundation_API, UnhandledException, LogicException)
-
-POCO_DECLARE_EXCEPTION(Foundation_API, RuntimeException, Exception)
-POCO_DECLARE_EXCEPTION(Foundation_API, NotFoundException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, ExistsException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, TimeoutException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, SystemException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, RegularExpressionException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, LibraryLoadException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, LibraryAlreadyLoadedException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, NoThreadAvailableException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, PropertyNotSupportedException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, PoolOverflowException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, NoPermissionException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, OutOfMemoryException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, DataException, RuntimeException)
-
-POCO_DECLARE_EXCEPTION(Foundation_API, DataFormatException, DataException)
-POCO_DECLARE_EXCEPTION(Foundation_API, SyntaxException, DataException)
-POCO_DECLARE_EXCEPTION(Foundation_API, CircularReferenceException, DataException)
-POCO_DECLARE_EXCEPTION(Foundation_API, PathSyntaxException, SyntaxException)
-POCO_DECLARE_EXCEPTION(Foundation_API, IOException, RuntimeException)
-POCO_DECLARE_EXCEPTION(Foundation_API, FileException, IOException)
-POCO_DECLARE_EXCEPTION(Foundation_API, FileExistsException, FileException)
-POCO_DECLARE_EXCEPTION(Foundation_API, FileNotFoundException, FileException)
-POCO_DECLARE_EXCEPTION(Foundation_API, PathNotFoundException, FileException)
-POCO_DECLARE_EXCEPTION(Foundation_API, FileReadOnlyException, FileException)
-POCO_DECLARE_EXCEPTION(Foundation_API, FileAccessDeniedException, FileException)
-POCO_DECLARE_EXCEPTION(Foundation_API, CreateFileException, FileException)
-POCO_DECLARE_EXCEPTION(Foundation_API, OpenFileException, FileException)
-POCO_DECLARE_EXCEPTION(Foundation_API, WriteFileException, FileException)
-POCO_DECLARE_EXCEPTION(Foundation_API, ReadFileException, FileException)
-POCO_DECLARE_EXCEPTION(Foundation_API, UnknownURISchemeException, RuntimeException)
-
-POCO_DECLARE_EXCEPTION(Foundation_API, ApplicationException, Exception)
-POCO_DECLARE_EXCEPTION(Foundation_API, BadCastException, RuntimeException)
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Exception_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ExpirationDecorator.h b/Utilities/Poco/Foundation/include/Poco/ExpirationDecorator.h
deleted file mode 100755
index ce69c5ad26..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ExpirationDecorator.h
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// ExpirationDecorator.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: ExpirationDecorator
-//
-// Implementation of the ExpirationDecorator template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_ExpirationDecorator_INCLUDED
-#define Foundation_ExpirationDecorator_INCLUDED
-
-
-#include "Poco/Timestamp.h"
-#include "Poco/Timespan.h"
-
-
-namespace Poco {
-
-
-template <typename TArgs>
-class ExpirationDecorator
- /// ExpirationDecorator adds an expiration method to values so that they can be used
- /// with the UniqueExpireCache
-{
-public:
- ExpirationDecorator():
- _value(),
- _expiresAt()
- {
- }
-
- ExpirationDecorator(const TArgs& p, const Poco::Timespan::TimeDiff& diffInMs):
- /// Creates an element that will expire in diff milliseconds
- _value(p),
- _expiresAt()
- {
- _expiresAt += (diffInMs*1000);
- }
-
- ExpirationDecorator(const TArgs& p, const Poco::Timespan& timeSpan):
- /// Creates an element that will expire after the given timeSpan
- _value(p),
- _expiresAt()
- {
- _expiresAt += timeSpan.totalMicroseconds();
- }
-
- ExpirationDecorator(const TArgs& p, const Poco::Timestamp& timeStamp):
- /// Creates an element that will expire at the given time point
- _value(p),
- _expiresAt(timeStamp)
- {
- }
-
-
- ~ExpirationDecorator()
- {
- }
-
- const Poco::Timestamp& getExpiration() const
- {
- return _expiresAt;
- }
-
- const TArgs& value() const
- {
- return _value;
- }
-
- TArgs& value()
- {
- return _value;
- }
-
-private:
- TArgs _value;
- Timestamp _expiresAt;
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/Expire.h b/Utilities/Poco/Foundation/include/Poco/Expire.h
deleted file mode 100755
index 23701c9791..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Expire.h
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// Expire.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: Expire
-//
-// Implementation of the Expire template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_Expire_INCLUDED
-#define Foundation_Expire_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/AbstractDelegate.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-
-
-template <class TArgs>
-class Expire: public AbstractDelegate<TArgs>
- /// Decorator for AbstractDelegate adding automatic
- /// expiring of registrations to AbstractDelegates.
-{
-public:
- Expire(const AbstractDelegate<TArgs>& p, Timestamp::TimeDiff expireMillisecs):
- AbstractDelegate<TArgs>(p),
- _pDelegate(p.clone()),
- _expire(expireMillisecs*1000)
- {
- }
-
- Expire(const Expire& expire):
- AbstractDelegate<TArgs>(expire),
- _pDelegate(expire._pDelegate->clone()),
- _expire(expire._expire),
- _creationTime(expire._creationTime)
- {
- }
-
- ~Expire()
- {
- destroy();
- }
-
- Expire& operator = (const Expire& expire)
- {
- if (&expire != this)
- {
- delete this->_pDelegate;
- this->_pDelegate = expire._pDelegate->clone();
- this->_expire = expire._expire;
- this->_creationTime = expire._creationTime;
- this->_pTarget = expire._pTarget;
- }
- return *this;
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- if (!expired())
- return this->_pDelegate->notify(sender, arguments);
- else
- return false;
- }
-
- AbstractDelegate<TArgs>* clone() const
- {
- return new Expire(*this);
- }
-
- void destroy()
- {
- delete this->_pDelegate;
- this->_pDelegate = 0;
- }
-
- const AbstractDelegate<TArgs>& getDelegate() const
- {
- return *this->_pDelegate;
- }
-
-protected:
- bool expired() const
- {
- return _creationTime.isElapsed(_expire);
- }
-
- AbstractDelegate<TArgs>* _pDelegate;
- Timestamp::TimeDiff _expire;
- Timestamp _creationTime;
-
-private:
- Expire();
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/ExpireCache.h b/Utilities/Poco/Foundation/include/Poco/ExpireCache.h
deleted file mode 100755
index f00aa9fd1a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ExpireCache.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// ExpireCache.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: ExpireCache
-//
-// Definition of the ExpireCache class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_ExpireCache_INCLUDED
-#define Foundation_ExpireCache_INCLUDED
-
-
-#include "Poco/AbstractCache.h"
-#include "Poco/ExpireStrategy.h"
-
-
-namespace Poco {
-
-
-template <class TKey, class TValue>
-class ExpireCache: public AbstractCache<TKey, TValue, ExpireStrategy<TKey, TValue> >
- /// An ExpireCache caches entries for a fixed time period (per default 10 minutes).
- /// Entries expire independently of the access pattern, i.e. after a constant time.
- /// If you require your objects to expire after they were not accessed for a given time
- /// period use a Poco::AccessExpireCache.
- ///
- /// Be careful when using an ExpireCache. A cache is often used
- /// like cache.has(x) followed by cache.get x). Note that it could happen
- /// that the "has" call works, then the current execution thread gets descheduled, time passes,
- /// the entry gets invalid, thus leading to an empty SharedPtr being returned
- /// when "get" is invoked.
-{
-public:
- ExpireCache(Timestamp::TimeDiff expire = 600000):
- AbstractCache<TKey, TValue, ExpireStrategy<TKey, TValue> >(ExpireStrategy<TKey, TValue>(expire))
- {
- }
-
- ~ExpireCache()
- {
- }
-
-private:
- ExpireCache(const ExpireCache& aCache);
- ExpireCache& operator = (const ExpireCache& aCache);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/ExpireLRUCache.h b/Utilities/Poco/Foundation/include/Poco/ExpireLRUCache.h
deleted file mode 100755
index 4ef3cd3820..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ExpireLRUCache.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// ExpireLRUCache.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: ExpireLRUCache
-//
-// Definition of the ExpireLRUCache class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_ExpireLRUCache_INCLUDED
-#define Foundation_ExpireLRUCache_INCLUDED
-
-
-#include "Poco/AbstractCache.h"
-#include "Poco/StrategyCollection.h"
-#include "Poco/ExpireStrategy.h"
-#include "Poco/LRUStrategy.h"
-
-
-namespace Poco {
-
-
-template <
- class TKey,
- class TValue
->
-class ExpireLRUCache: public AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue> >
- /// An ExpireLRUCache combines LRU caching and time based expire caching.
- /// It cache entries for a fixed time period (per default 10 minutes)
- /// but also limits the size of the cache (per default: 1024).
-{
-public:
- ExpireLRUCache(long cacheSize = 1024, Timestamp::TimeDiff expire = 600000):
- AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue> >(StrategyCollection<TKey, TValue>())
- {
- this->_strategy.pushBack(new LRUStrategy<TKey, TValue>(cacheSize));
- this->_strategy.pushBack(new ExpireStrategy<TKey, TValue>(expire));
- }
-
- ~ExpireLRUCache()
- {
- }
-
-private:
- ExpireLRUCache(const ExpireLRUCache& aCache);
- ExpireLRUCache& operator = (const ExpireLRUCache& aCache);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/ExpireStrategy.h b/Utilities/Poco/Foundation/include/Poco/ExpireStrategy.h
deleted file mode 100755
index 283f407589..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ExpireStrategy.h
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-// ExpireStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: ExpireStrategy
-//
-// Definition of the ExpireStrategy class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_ExpireStrategy_INCLUDED
-#define Foundation_ExpireStrategy_INCLUDED
-
-
-#include "Poco/KeyValueArgs.h"
-#include "Poco/ValidArgs.h"
-#include "Poco/AbstractStrategy.h"
-#include "Poco/Bugcheck.h"
-#include "Poco/Timestamp.h"
-#include "Poco/EventArgs.h"
-#include <set>
-#include <map>
-
-
-namespace Poco {
-
-
-template <
- class TKey,
- class TValue
->
-class ExpireStrategy: public AbstractStrategy<TKey, TValue>
- /// An ExpireStrategy implements time based expiration of cache entries
-{
-public:
- typedef std::multimap<Timestamp, TKey> TimeIndex;
- typedef typename TimeIndex::iterator IndexIterator;
- typedef typename TimeIndex::const_iterator ConstIndexIterator;
- typedef std::map<TKey, IndexIterator> Keys;
- typedef typename Keys::iterator Iterator;
-
-public:
- ExpireStrategy(Timestamp::TimeDiff expireTimeInMilliSec): _expireTime(expireTimeInMilliSec * 1000)
- /// Create an expire strategy. Note that the smallest allowed caching time is 25ms.
- /// Anything lower than that is not useful with current operating systems.
- {
- if (_expireTime < 25000) throw InvalidArgumentException("expireTime must be at least 25 ms");
- }
-
- ~ExpireStrategy()
- {
- }
-
- void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args)
- {
- Timestamp now;
- IndexIterator it = _keyIndex.insert(typename TimeIndex::value_type(now, args.key()));
- std::pair<Iterator, bool> stat = _keys.insert(typename Keys::value_type(args.key(), it));
- if (!stat.second)
- {
- _keyIndex.erase(stat.first->second);
- stat.first->second = it;
- }
- }
-
- void onRemove(const void*, const TKey& key)
- {
- Iterator it = _keys.find(key);
- if (it != _keys.end())
- {
- _keyIndex.erase(it->second);
- _keys.erase(it);
- }
- }
-
- void onGet(const void*, const TKey& key)
- {
- // get triggers no changes in an expire
- }
-
- void onClear(const void*, const EventArgs& args)
- {
- _keys.clear();
- _keyIndex.clear();
- }
-
- void onIsValid(const void*, ValidArgs<TKey>& args)
- {
- Iterator it = _keys.find(args.key());
- if (it != _keys.end())
- {
- if (it->second->first.isElapsed(_expireTime))
- {
- args.invalidate();
- }
- }
- else //not found: probably removed by onReplace
- args.invalidate();
- }
-
- void onReplace(const void*, std::set<TKey>& elemsToRemove)
- {
- // Note: replace only informs the cache which elements
- // it would like to remove!
- // it does not remove them on its own!
- IndexIterator it = _keyIndex.begin();
- while (it != _keyIndex.end() && it->first.isElapsed(_expireTime))
- {
- elemsToRemove.insert(it->second);
- ++it;
- }
- }
-
-protected:
- Timestamp::TimeDiff _expireTime;
- Keys _keys; /// For faster replacement of keys, the iterator points to the _keyIndex map
- TimeIndex _keyIndex; /// Maps time to key value
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/FIFOEvent.h b/Utilities/Poco/Foundation/include/Poco/FIFOEvent.h
deleted file mode 100755
index 8ec29cb2b7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FIFOEvent.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// FIFOEvent.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: FIFOEvent
-//
-// Implementation of the FIFOEvent template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_FIFOEvent_INCLUDED
-#define Foundation_FIFOEvent_INCLUDED
-
-
-#include "Poco/AbstractEvent.h"
-#include "Poco/FIFOStrategy.h"
-#include "Poco/AbstractDelegate.h"
-#include "Poco/CompareFunctions.h"
-
-
-namespace Poco {
-
-
-template <class TArgs>
-class FIFOEvent: public AbstractEvent <
- TArgs,
- FIFOStrategy<TArgs, AbstractDelegate<TArgs>, p_less<AbstractDelegate< TArgs> > >,
- AbstractDelegate<TArgs>
->
- /// A FIFOEvent uses internally a FIFOStrategy which guarantees
- /// that delegates are invoked in the order they were added to
- /// the event.
- ///
- /// Note that one object can only register one method to a FIFOEvent.
- /// Subsequent registrations will overwrite the existing delegate.
- /// For example:
- /// FIFOEvent<int> tmp;
- /// MyClass myObject;
- /// tmp += delegate(&myObject, &MyClass::myMethod1);
- /// tmp += delegate(&myObject, &MyClass::myMethod2);
- ///
- /// The second registration will overwrite the first one.
-{
-public:
- FIFOEvent()
- {
- }
-
- ~FIFOEvent()
- {
- }
-
-private:
- FIFOEvent(const FIFOEvent& e);
- FIFOEvent& operator = (const FIFOEvent& e);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/FIFOStrategy.h b/Utilities/Poco/Foundation/include/Poco/FIFOStrategy.h
deleted file mode 100755
index a7df0138e5..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FIFOStrategy.h
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// FIFOStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: FIFOStragegy
-//
-// Implementation of the FIFOStrategy template.
-//
-// Copyright (c) 2006, 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.
-//
-
-#ifndef Foundation_FIFOStrategy_INCLUDED
-#define Foundation_FIFOStrategy_INCLUDED
-
-
-#include "Poco/NotificationStrategy.h"
-#include <map>
-#include <list>
-#include <memory>
-
-
-namespace Poco {
-
-
-template <class TArgs, class TDelegate, class TCompare>
-class FIFOStrategy: public NotificationStrategy<TArgs, TDelegate>
-{
-public:
- typedef std::list<TDelegate*> Delegates;
- typedef typename Delegates::iterator Iterator;
- typedef typename Delegates::const_iterator ConstIterator;
- typedef std::map<TDelegate*, Iterator, TCompare> DelegateIndex;
- typedef typename DelegateIndex::iterator IndexIterator;
- typedef typename DelegateIndex::const_iterator ConstIndexIterator;
-
- FIFOStrategy()
- {
- }
-
- FIFOStrategy(const FIFOStrategy& s)
- {
- operator = (s);
- }
-
- ~FIFOStrategy()
- {
- clear();
- }
-
- void notify(const void* sender, TArgs& arguments)
- {
- std::vector<Iterator> delMe;
- Iterator it = _observers.begin();
- Iterator itEnd = _observers.end();
-
- for (; it != itEnd; ++it)
- {
- if (!(*it)->notify(sender, arguments))
- {
- // schedule for deletion
- delMe.push_back(it);
- }
- }
-
- while (!delMe.empty())
- {
- typename std::vector<Iterator>::iterator vit = delMe.end();
- --vit;
- delete **vit;
- _observers.erase(*vit);
- delMe.pop_back();
- }
- }
-
- void add(const TDelegate& delegate)
- {
- IndexIterator it = _observerIndex.find(const_cast<TDelegate*>(&delegate));
- if (it != _observerIndex.end())
- {
- delete *it->second;
- _observers.erase(it->second);
- _observerIndex.erase(it);
- }
- std::auto_ptr<TDelegate> pDelegate(delegate.clone());
- _observers.push_back(pDelegate.get());
- bool tmp = _observerIndex.insert(std::make_pair(pDelegate.get(), --_observers.end())).second;
- poco_assert (tmp);
- pDelegate.release();
- }
-
- void remove(const TDelegate& delegate)
- {
- IndexIterator it = _observerIndex.find(const_cast<TDelegate*>(&delegate));
-
- if (it != _observerIndex.end())
- {
- delete *it->second;
- _observers.erase(it->second);
- _observerIndex.erase(it);
- }
- }
-
- FIFOStrategy& operator = (const FIFOStrategy& s)
- {
- if (this != &s)
- {
- for (ConstIterator it = s._observers.begin(); it != s._observers.end(); ++it)
- {
- add(**it);
- }
- }
- return *this;
- }
-
- void clear()
- {
- for (Iterator it = _observers.begin(); it != _observers.end(); ++it)
- {
- delete *it;
- }
-
- _observers.clear();
- _observerIndex.clear();
- }
-
- bool empty() const
- {
- return _observers.empty();
- }
-
-protected:
- Delegates _observers; /// Stores the delegates in the order they were added.
- DelegateIndex _observerIndex; /// For faster lookup when add/remove is used.
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/FPEnvironment.h b/Utilities/Poco/Foundation/include/Poco/FPEnvironment.h
deleted file mode 100755
index f2c3277189..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FPEnvironment.h
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// FPEnvironment.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Definitions of class FPEnvironment.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_FPEnvironment_INCLUDED
-#define Foundation_FPEnvironment_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-#if defined(POCO_NO_FPENVIRONMENT)
-#include "Poco/FPEnvironment_DUMMY.h"
-#elif defined(__osf__) || defined(__VMS)
-#include "Poco/FPEnvironment_DEC.h"
-#elif defined(sun) || defined(__sun)
-#include "Poco/FPEnvironment_SUN.h"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "Poco/FPEnvironment_C99.h"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/FPEnvironment_WIN32.h"
-#else
-#include "Poco/FPEnvironment_DUMMY.h"
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API FPEnvironment: private FPEnvironmentImpl
- /// Instances of this class can be used to save
- /// and later restore the current floating
- /// point environment (consisting of rounding
- /// mode and floating-point flags).
- /// The class also provides various static
- /// methods to query certain properties
- /// of a floating-point number.
-{
-public:
- enum RoundingMode
- {
- FP_ROUND_DOWNWARD = FP_ROUND_DOWNWARD_IMPL,
- FP_ROUND_UPWARD = FP_ROUND_UPWARD_IMPL,
- FP_ROUND_TONEAREST = FP_ROUND_TONEAREST_IMPL,
- FP_ROUND_TOWARDZERO = FP_ROUND_TOWARDZERO_IMPL
- };
-
- enum Flag
- {
- FP_DIVIDE_BY_ZERO = FP_DIVIDE_BY_ZERO_IMPL,
- FP_INEXACT = FP_INEXACT_IMPL,
- FP_OVERFLOW = FP_OVERFLOW_IMPL,
- FP_UNDERFLOW = FP_UNDERFLOW_IMPL,
- FP_INVALID = FP_INVALID_IMPL
- };
-
- FPEnvironment();
- /// Standard constructor.
- /// Remembers the current environment.
-
- FPEnvironment(RoundingMode mode);
- /// Remembers the current environment and
- /// sets the given rounding mode.
-
- FPEnvironment(const FPEnvironment& env);
- /// Copy constructor.
-
- ~FPEnvironment();
- /// Restores the previous environment (unless
- /// keepCurrent() has been called previously)
-
- FPEnvironment& operator = (const FPEnvironment& env);
- /// Assignment operator
-
- void keepCurrent();
- /// Keep the current environment even after
- /// destroying the FPEnvironment object.
-
- static void clearFlags();
- /// Resets all flags.
-
- static bool isFlag(Flag flag);
- /// Returns true iff the given flag is set.
-
- static void setRoundingMode(RoundingMode mode);
- /// Sets the rounding mode.
-
- static RoundingMode getRoundingMode();
- /// Returns the current rounding mode.
-
- static bool isInfinite(float value);
- static bool isInfinite(double value);
- static bool isInfinite(long double value);
- /// Returns true iff the given number is infinite.
-
- static bool isNaN(float value);
- static bool isNaN(double value);
- static bool isNaN(long double value);
- /// Returns true iff the given number is NaN.
-
- static float copySign(float target, float source);
- static double copySign(double target, double source);
- static long double copySign(long double target, long double source);
- /// Copies the sign from source to target.
-};
-
-
-//
-// For convenience, we provide a shorter name for
-// the FPEnvironment class.
-//
-typedef FPEnvironment FPE;
-
-
-//
-// inline's
-//
-inline bool FPEnvironment::isFlag(Flag flag)
-{
- return isFlagImpl(FlagImpl(flag));
-}
-
-
-inline void FPEnvironment::setRoundingMode(RoundingMode mode)
-{
- setRoundingModeImpl(RoundingModeImpl(mode));
-}
-
-
-inline FPEnvironment::RoundingMode FPEnvironment::getRoundingMode()
-{
- return RoundingMode(getRoundingModeImpl());
-}
-
-
-inline bool FPEnvironment::isInfinite(float value)
-{
- return isInfiniteImpl(value);
-}
-
-
-inline bool FPEnvironment::isInfinite(double value)
-{
- return isInfiniteImpl(value);
-}
-
-
-inline bool FPEnvironment::isInfinite(long double value)
-{
- return isInfiniteImpl(value);
-}
-
-
-inline bool FPEnvironment::isNaN(float value)
-{
- return isNaNImpl(value);
-}
-
-
-inline bool FPEnvironment::isNaN(double value)
-{
- return isNaNImpl(value);
-}
-
-
-inline bool FPEnvironment::isNaN(long double value)
-{
- return isNaNImpl(value);
-}
-
-
-inline float FPEnvironment::copySign(float target, float source)
-{
- return copySignImpl(target, source);
-}
-
-
-inline double FPEnvironment::copySign(double target, double source)
-{
- return copySignImpl(target, source);
-}
-
-
-inline long double FPEnvironment::copySign(long double target, long double source)
-{
- return copySignImpl(target, source);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FPEnvironment_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FPEnvironment_C99.h b/Utilities/Poco/Foundation/include/Poco/FPEnvironment_C99.h
deleted file mode 100755
index 0a96696a47..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FPEnvironment_C99.h
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// FPEnvironment_C99.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Definitions of class FPEnvironmentImpl for C99.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_FPEnvironment_C99_INCLUDED
-#define Foundation_FPEnvironment_C99_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <fenv.h>
-#include <math.h>
-
-
-namespace Poco {
-
-
-class FPEnvironmentImpl
-{
-protected:
- enum RoundingModeImpl
- {
- FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD,
- FP_ROUND_UPWARD_IMPL = FE_UPWARD,
- FP_ROUND_TONEAREST_IMPL = FE_TONEAREST,
- FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO
- };
- enum FlagImpl
- {
- FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO,
- FP_INEXACT_IMPL = FE_INEXACT,
- FP_OVERFLOW_IMPL = FE_OVERFLOW,
- FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
- FP_INVALID_IMPL = FE_INVALID
- };
- FPEnvironmentImpl();
- FPEnvironmentImpl(const FPEnvironmentImpl& env);
- ~FPEnvironmentImpl();
- FPEnvironmentImpl& operator = (const FPEnvironmentImpl& env);
- void keepCurrentImpl();
- static void clearFlagsImpl();
- static bool isFlagImpl(FlagImpl flag);
- static void setRoundingModeImpl(RoundingModeImpl mode);
- static RoundingModeImpl getRoundingModeImpl();
- static bool isInfiniteImpl(float value);
- static bool isInfiniteImpl(double value);
- static bool isInfiniteImpl(long double value);
- static bool isNaNImpl(float value);
- static bool isNaNImpl(double value);
- static bool isNaNImpl(long double value);
- static float copySignImpl(float target, float source);
- static double copySignImpl(double target, double source);
- static long double copySignImpl(long double target, long double source);
-
-private:
- fenv_t _env;
-};
-
-
-//
-// inlines
-//
-inline bool FPEnvironmentImpl::isInfiniteImpl(float value)
-{
- return isinf(value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isInfiniteImpl(double value)
-{
- return isinf(value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isInfiniteImpl(long double value)
-{
- return isinf((double) value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isNaNImpl(float value)
-{
- return isnan(value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isNaNImpl(double value)
-{
- return isnan(value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isNaNImpl(long double value)
-{
- return isnan((double) value) != 0;
-}
-
-
-inline float FPEnvironmentImpl::copySignImpl(float target, float source)
-{
- return copysignf(target, source);
-}
-
-
-inline double FPEnvironmentImpl::copySignImpl(double target, double source)
-{
- return copysign(target, source);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FPEnvironment_C99_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FPEnvironment_DEC.h b/Utilities/Poco/Foundation/include/Poco/FPEnvironment_DEC.h
deleted file mode 100755
index 95facae89a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FPEnvironment_DEC.h
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-// FPEnvironment_DEC.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Definitions of class FPEnvironmentImpl for Tru64 and OpenVMS Alpha.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_FPEnvironment_DEC_INCLUDED
-#define Foundation_FPEnvironment_DEC_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#if defined(__VMS)
-#include <ieeedef.h>
-#else
-#include <machine/fpu.h>
-#endif
-
-
-namespace Poco {
-
-
-class FPEnvironmentImpl
-{
-protected:
- enum RoundingModeImpl
- {
- FP_ROUND_DOWNWARD_IMPL = 0,
- FP_ROUND_UPWARD_IMPL = 0,
- FP_ROUND_TONEAREST_IMPL = 0,
- FP_ROUND_TOWARDZERO_IMPL = 0
- };
- enum FlagImpl
- {
-#if defined(__VMS)
- FP_DIVIDE_BY_ZERO_IMPL = IEEE$M_STATUS_DZE,
- FP_INEXACT_IMPL = IEEE$M_STATUS_INE,
- FP_OVERFLOW_IMPL = IEEE$M_STATUS_OVF,
- FP_UNDERFLOW_IMPL = IEEE$M_STATUS_UNF,
- FP_INVALID_IMPL = IEEE$M_STATUS_INV
-#else
- FP_DIVIDE_BY_ZERO_IMPL = IEEE_STATUS_DZE,
- FP_INEXACT_IMPL = IEEE_STATUS_INE,
- FP_OVERFLOW_IMPL = IEEE_STATUS_OVF,
- FP_UNDERFLOW_IMPL = IEEE_STATUS_UNF,
- FP_INVALID_IMPL = IEEE_STATUS_INV
-#endif
- };
- FPEnvironmentImpl();
- FPEnvironmentImpl(const FPEnvironmentImpl& env);
- ~FPEnvironmentImpl();
- FPEnvironmentImpl& operator = (const FPEnvironmentImpl& env);
- void keepCurrentImpl();
- static void clearFlagsImpl();
- static bool isFlagImpl(FlagImpl flag);
- static void setRoundingModeImpl(RoundingModeImpl mode);
- static RoundingModeImpl getRoundingModeImpl();
- static bool isInfiniteImpl(float value);
- static bool isInfiniteImpl(double value);
- static bool isInfiniteImpl(long double value);
- static bool isNaNImpl(float value);
- static bool isNaNImpl(double value);
- static bool isNaNImpl(long double value);
- static float copySignImpl(float target, float source);
- static double copySignImpl(double target, double source);
- static long double copySignImpl(long double target, long double source);
-
-private:
-#if defined(__VMS)
- struct _ieee _env;
-#else
- unsigned long _env;
-#endif
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FPEnvironment_DEC_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FPEnvironment_DUMMY.h b/Utilities/Poco/Foundation/include/Poco/FPEnvironment_DUMMY.h
deleted file mode 100755
index f9c2d674a4..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FPEnvironment_DUMMY.h
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// FPEnvironment_DUMMY.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Definition of class FPEnvironmentImpl for platforms that do not
-// support IEEE 754 extensions.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_FPEnvironment_DUMMY_INCLUDED
-#define Foundation_FPEnvironment_DUMMY_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <math.h>
-
-
-namespace Poco {
-
-
-class Foundation_API FPEnvironmentImpl
-{
-protected:
- enum RoundingModeImpl
- {
- FP_ROUND_DOWNWARD_IMPL,
- FP_ROUND_UPWARD_IMPL,
- FP_ROUND_TONEAREST_IMPL,
- FP_ROUND_TOWARDZERO_IMPL
- };
- enum FlagImpl
- {
- FP_DIVIDE_BY_ZERO_IMPL,
- FP_INEXACT_IMPL,
- FP_OVERFLOW_IMPL,
- FP_UNDERFLOW_IMPL,
- FP_INVALID_IMPL
- };
- FPEnvironmentImpl();
- FPEnvironmentImpl(const FPEnvironmentImpl& env);
- ~FPEnvironmentImpl();
- FPEnvironmentImpl& operator = (const FPEnvironmentImpl& env);
- void keepCurrentImpl();
- static void clearFlagsImpl();
- static bool isFlagImpl(FlagImpl flag);
- static void setRoundingModeImpl(RoundingModeImpl mode);
- static RoundingModeImpl getRoundingModeImpl();
- static bool isInfiniteImpl(float value);
- static bool isInfiniteImpl(double value);
- static bool isInfiniteImpl(long double value);
- static bool isNaNImpl(float value);
- static bool isNaNImpl(double value);
- static bool isNaNImpl(long double value);
- static float copySignImpl(float target, float source);
- static double copySignImpl(double target, double source);
- static long double copySignImpl(long double target, long double source);
-
-private:
- static RoundingModeImpl _roundingMode;
-};
-
-
-//
-// inlines
-//
-inline bool FPEnvironmentImpl::isInfiniteImpl(float value)
-{
- return isinf(value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isInfiniteImpl(double value)
-{
- return isinf(value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isInfiniteImpl(long double value)
-{
- return isinf((double) value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isNaNImpl(float value)
-{
- return isnan(value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isNaNImpl(double value)
-{
- return isnan(value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isNaNImpl(long double value)
-{
- return isnan((double) value) != 0;
-}
-
-
-inline float FPEnvironmentImpl::copySignImpl(float target, float source)
-{
- return copysignf(target, source);
-}
-
-
-inline double FPEnvironmentImpl::copySignImpl(double target, double source)
-{
- return copysign(target, source);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FPEnvironment_DUMMY_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FPEnvironment_SUN.h b/Utilities/Poco/Foundation/include/Poco/FPEnvironment_SUN.h
deleted file mode 100755
index 87662ce70e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FPEnvironment_SUN.h
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// FPEnvironment_SUN.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Definitions of class FPEnvironmentImpl for Solaris.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef Foundation_FPEnvironment_SUN_INCLUDED
-#define Foundation_FPEnvironment_SUN_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <ieeefp.h>
-
-
-namespace Poco {
-
-
-class FPEnvironmentImpl
-{
-protected:
- enum RoundingModeImpl
- {
- FP_ROUND_DOWNWARD_IMPL = FP_RM,
- FP_ROUND_UPWARD_IMPL = FP_RP,
- FP_ROUND_TONEAREST_IMPL = FP_RN,
- FP_ROUND_TOWARDZERO_IMPL = FP_RZ
- };
- enum FlagImpl
- {
- FP_DIVIDE_BY_ZERO_IMPL = FP_X_DZ,
- FP_INEXACT_IMPL = FP_X_IMP,
- FP_OVERFLOW_IMPL = FP_X_OFL,
- FP_UNDERFLOW_IMPL = FP_X_UFL,
- FP_INVALID_IMPL = FP_X_INV
- };
- FPEnvironmentImpl();
- FPEnvironmentImpl(const FPEnvironmentImpl& env);
- ~FPEnvironmentImpl();
- FPEnvironmentImpl& operator = (const FPEnvironmentImpl& env);
- void keepCurrentImpl();
- static void clearFlagsImpl();
- static bool isFlagImpl(FlagImpl flag);
- static void setRoundingModeImpl(RoundingModeImpl mode);
- static RoundingModeImpl getRoundingModeImpl();
- static bool isInfiniteImpl(float value);
- static bool isInfiniteImpl(double value);
- static bool isInfiniteImpl(long double value);
- static bool isNaNImpl(float value);
- static bool isNaNImpl(double value);
- static bool isNaNImpl(long double value);
- static float copySignImpl(float target, float source);
- static double copySignImpl(double target, double source);
- static long double copySignImpl(long double target, long double source);
-
-private:
- fp_rnd _rnd;
- fp_except _exc;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FPEnvironment_SUN_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FPEnvironment_WIN32.h b/Utilities/Poco/Foundation/include/Poco/FPEnvironment_WIN32.h
deleted file mode 100755
index c0243a0858..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FPEnvironment_WIN32.h
+++ /dev/null
@@ -1,153 +0,0 @@
-//
-// FPEnvironment_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Definitions of class FPEnvironmentImpl for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_FPEnvironment_WIN32_INCLUDED
-#define Foundation_FPEnvironment_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <float.h>
-#include <math.h>
-
-
-namespace Poco {
-
-
-class Foundation_API FPEnvironmentImpl
-{
-protected:
- enum RoundingModeImpl
- {
- FP_ROUND_DOWNWARD_IMPL = RC_DOWN,
- FP_ROUND_UPWARD_IMPL = RC_UP,
- FP_ROUND_TONEAREST_IMPL = RC_NEAR,
- FP_ROUND_TOWARDZERO_IMPL = RC_CHOP
- };
- enum FlagImpl
- {
- FP_DIVIDE_BY_ZERO_IMPL = SW_ZERODIVIDE,
- FP_INEXACT_IMPL = SW_INEXACT,
- FP_OVERFLOW_IMPL = SW_OVERFLOW,
- FP_UNDERFLOW_IMPL = SW_UNDERFLOW,
- FP_INVALID_IMPL = SW_INVALID
- };
- FPEnvironmentImpl();
- FPEnvironmentImpl(const FPEnvironmentImpl& env);
- ~FPEnvironmentImpl();
- FPEnvironmentImpl& operator = (const FPEnvironmentImpl& env);
- void keepCurrentImpl();
- static void clearFlagsImpl();
- static bool isFlagImpl(FlagImpl flag);
- static void setRoundingModeImpl(RoundingModeImpl mode);
- static RoundingModeImpl getRoundingModeImpl();
- static bool isInfiniteImpl(float value);
- static bool isInfiniteImpl(double value);
- static bool isInfiniteImpl(long double value);
- static bool isNaNImpl(float value);
- static bool isNaNImpl(double value);
- static bool isNaNImpl(long double value);
- static float copySignImpl(float target, float source);
- static double copySignImpl(double target, double source);
- static long double copySignImpl(long double target, long double source);
-
-private:
- unsigned _env;
-};
-
-
-//
-// inlines
-//
-inline bool FPEnvironmentImpl::isInfiniteImpl(float value)
-{
- return _finite(value) == 0;
-}
-
-
-inline bool FPEnvironmentImpl::isInfiniteImpl(double value)
-{
- return _finite(value) == 0;
-}
-
-
-inline bool FPEnvironmentImpl::isInfiniteImpl(long double value)
-{
- return _finite(value) == 0;
-}
-
-
-inline bool FPEnvironmentImpl::isNaNImpl(float value)
-{
- return _isnan(value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isNaNImpl(double value)
-{
- return _isnan(value) != 0;
-}
-
-
-inline bool FPEnvironmentImpl::isNaNImpl(long double value)
-{
- return _isnan(value) != 0;
-}
-
-
-inline float FPEnvironmentImpl::copySignImpl(float target, float source)
-{
- return float(_copysign(target, source));
-}
-
-
-inline double FPEnvironmentImpl::copySignImpl(double target, double source)
-{
- return _copysign(target, source);
-}
-
-
-inline long double FPEnvironmentImpl::copySignImpl(long double target, long double source)
-{
- return (source > 0 && target > 0) || (source < 0 && target < 0) ? target : -target;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FPEnvironment_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/File.h b/Utilities/Poco/Foundation/include/Poco/File.h
deleted file mode 100755
index eaa41d9b7c..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/File.h
+++ /dev/null
@@ -1,296 +0,0 @@
-//
-// File.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: File
-//
-// Definition of the File class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_File_INCLUDED
-#define Foundation_File_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-#include <vector>
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "Poco/File_WIN32U.h"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/File_WIN32.h"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "Poco/File_UNIX.h"
-#else
-#include "Poco/File_VMS.h"
-#endif
-
-
-namespace Poco {
-
-
-class Path;
-
-
-class Foundation_API File: private FileImpl
- /// The File class provides methods for working with a file.
-{
-public:
- typedef FileSizeImpl FileSize;
-
- File();
- /// Creates the file.
-
- File(const std::string& path);
- /// Creates the file.
-
- File(const char* path);
- /// Creates the file.
-
- File(const Path& path);
- /// Creates the file.
-
- File(const File& file);
- /// Copy constructor.
-
- virtual ~File();
- /// Destroys the file.
-
- File& operator = (const File& file);
- /// Assignment operator.
-
- File& operator = (const std::string& path);
- /// Assignment operator.
-
- File& operator = (const char* path);
- /// Assignment operator.
-
- File& operator = (const Path& path);
- /// Assignment operator.
-
- void swap(File& file);
- /// Swaps the file with another one.
-
- const std::string& path() const;
- /// Returns the path.
-
- bool exists() const;
- /// Returns true iff the file exists.
-
- bool canRead() const;
- /// Returns true iff the file is readable.
-
- bool canWrite() const;
- /// Returns true iff the file is writeable.
-
- bool canExecute() const;
- /// Returns true iff the file is executable.
- ///
- /// On Windows and OpenVMS, the file must have
- /// the extension ".EXE" to be executable.
- /// On Unix platforms, the executable permission
- /// bit must be set.
-
- bool isFile() const;
- /// Returns true iff the file is a regular file.
-
- bool isLink() const;
- /// Returns true iff the file is a symbolic link.
-
- bool isDirectory() const;
- /// Returns true iff the file is a directory.
-
- bool isDevice() const;
- /// Returns true iff the file is a device.
-
- bool isHidden() const;
- /// Returns true if the file is hidden.
- ///
- /// On Windows platforms, the file's hidden
- /// attribute is set for this to be true.
- ///
- /// On Unix platforms, the file name must
- /// begin with a period for this to be true.
-
- Timestamp created() const;
- /// Returns the creation date of the file.
- ///
- /// Not all platforms or filesystems (e.g. Linux and most Unix
- /// platforms with the exception of FreeBSD and Mac OS X)
- /// maintain the creation date of a file.
- /// On such platforms, created() returns
- /// the time of the last inode modification.
-
- Timestamp getLastModified() const;
- /// Returns the modification date of the file.
-
- void setLastModified(const Timestamp& ts);
- /// Sets the modification date of the file.
-
- FileSize getSize() const;
- /// Returns the size of the file in bytes.
-
- void setSize(FileSize size);
- /// Sets the size of the file in bytes. Can be used
- /// to truncate a file.
-
- void setWriteable(bool flag = true);
- /// Makes the file writeable (if flag is true), or
- /// non-writeable (if flag is false) by setting the
- /// file's flags in the filesystem accordingly.
-
- void setReadOnly(bool flag = true);
- /// Makes the file non-writeable (if flag is true), or
- /// writeable (if flag is false) by setting the
- /// file's flags in the filesystem accordingly.
-
- void setExecutable(bool flag = true);
- /// Makes the file executable (if flag is true), or
- /// non-executable (if flag is false) by setting
- /// the file's permission bits accordingly.
- ///
- /// Does nothing on Windows and OpenVMS.
-
- void copyTo(const std::string& path) const;
- /// Copies the file (or directory) to the given path.
- /// The target path can be a directory.
- ///
- /// A directory is copied recursively.
-
- void moveTo(const std::string& path);
- /// Copies the file (or directory) to the given path and
- /// removes the original file. The target path can be a directory.
-
- void renameTo(const std::string& path);
- /// Renames the file to the new name.
-
- void remove(bool recursive = false);
- /// Deletes the file. If recursive is true and the
- /// file is a directory, recursively deletes all
- /// files in the directory.
-
- bool createFile();
- /// Creates a new, empty file in an atomic operation.
- /// Returns true if the file has been created and false
- /// if the file already exists. Throws an exception if
- /// an error occurs.
-
- bool createDirectory();
- /// Creates a directory. Returns true if the directory
- /// has been created and false if it already exists.
- /// Throws an exception if an error occurs.
-
- void createDirectories();
- /// Creates a directory (and all parent directories
- /// if necessary).
-
- void list(std::vector<std::string>& files) const;
- /// Fills the vector with the names of all
- /// files in the directory.
-
- void list(std::vector<File>& files) const;
- /// Fills the vector with the names of all
- /// files in the directory.
-
- bool operator == (const File& file) const;
- bool operator != (const File& file) const;
- bool operator < (const File& file) const;
- bool operator <= (const File& file) const;
- bool operator > (const File& file) const;
- bool operator >= (const File& file) const;
-
- static void handleLastError(const std::string& path);
- /// For internal use only. Throws an appropriate
- /// exception for the last file-related error.
-
-protected:
- void copyDirectory(const std::string& path) const;
- /// Copies a directory. Used internally by copyTo().
-};
-
-
-//
-// inlines
-//
-inline const std::string& File::path() const
-{
- return getPathImpl();
-}
-
-
-inline bool File::operator == (const File& file) const
-{
- return getPathImpl() == file.getPathImpl();
-}
-
-
-inline bool File::operator != (const File& file) const
-{
- return getPathImpl() != file.getPathImpl();
-}
-
-
-inline bool File::operator < (const File& file) const
-{
- return getPathImpl() < file.getPathImpl();
-}
-
-
-inline bool File::operator <= (const File& file) const
-{
- return getPathImpl() <= file.getPathImpl();
-}
-
-
-inline bool File::operator > (const File& file) const
-{
- return getPathImpl() > file.getPathImpl();
-}
-
-
-inline bool File::operator >= (const File& file) const
-{
- return getPathImpl() >= file.getPathImpl();
-}
-
-
-inline void swap(File& f1, File& f2)
-{
- f1.swap(f2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_File_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FileChannel.h b/Utilities/Poco/Foundation/include/Poco/FileChannel.h
deleted file mode 100755
index fa02d61656..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FileChannel.h
+++ /dev/null
@@ -1,258 +0,0 @@
-//
-// FileChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: FileChannel
-//
-// Definition of the FileChannel class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_FileChannel_INCLUDED
-#define Foundation_FileChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-class LogFile;
-class RotateStrategy;
-class ArchiveStrategy;
-class PurgeStrategy;
-
-
-class Foundation_API FileChannel: public Channel
- /// A Channel that writes to a file. This class supports
- /// flexible log file rotation and archiving, as well
- /// as automatic purging of archived log files.
- ///
- /// Only the message's text is written, followed
- /// by a newline.
- ///
- /// Chain this channel to a FormattingChannel with an
- /// appropriate Formatter to control what is in the text.
- ///
- /// The FileChannel support log file rotation based
- /// on log file size or time intervals.
- /// Archived log files can be compressed in gzip format.
- /// Older archived files can be automatically deleted
- /// (purged).
- ///
- /// The rotation strategy can be specified with the
- /// "rotation" property, which can take one of the
- /// follwing values:
- ///
- /// * never: no log rotation
- /// * [day,][hh]:mm: the file is rotated on specified day/time
- /// day - day is specified as long or short day name (Monday|Mon, Tuesday|Tue, ... );
- /// day can be omitted, in which case log is rotated every day
- /// hh - valid hour range is 00-23;
- /// hour can be omitted, in which case log is rotated every hour
- /// mm - valid minute range is 00-59;
- /// minute must be specified
- /// * daily: the file is rotated daily
- /// * weekly: the file is rotated every seven days
- /// * monthly: the file is rotated every 30 days
- /// * <n> minutes: the file is rotated every <n> minutes,
- /// where <n> is an integer greater than zero.
- /// * <n> hours: the file is rotated every <n> hours, where
- /// <n> is an integer greater than zero.
- /// * <n> days: the file is rotated every <n> days, where
- /// <n> is an integer greater than zero.
- /// * <n> weeks: the file is rotated every <n> weeks, where
- /// <n> is an integer greater than zero.
- /// * <n> months: the file is rotated every <n> months, where
- /// <n> is an integer greater than zero and
- /// a month has 30 days.
- /// * <n>: the file is rotated when its size exceeds
- /// <n> bytes.
- /// * <n> K: the file is rotated when its size exceeds
- /// <n> Kilobytes.
- /// * <n> M: the file is rotated when its size exceeds
- /// <n> Megabytes.
- ///
- /// NOTE: For periodic log file rotation (daily, weekly, monthly, etc.),
- /// the date and time of log file creation or last rotation is
- /// written into the first line of the log file. This is because
- /// there is no reliable way to find out the real creation date of
- /// a file on many platforms (e.g., most Unix platforms do not
- /// provide the creation date, and Windows has its own issues
- /// with its "File System Tunneling Capabilities").
- ///
- /// Using the "archive" property it is possible to specify
- /// how archived log files are named. The following values
- /// for the "archive" property are supported:
- ///
- /// * number: A number, starting with 0, is appended to
- /// the name of archived log files. The newest
- /// archived log file always has the number 0.
- /// For example, if the log file is named
- /// "access.log", and it fulfils the criteria
- /// for rotation, the file is renamed to
- /// "access.log.0". If a file named "access.log.0"
- /// already exists, it is renamed to "access.log.1",
- /// and so on.
- /// * timestamp: A timestamp is appended to the log file name.
- /// For example, if the log file is named
- /// "access.log", and it fulfils the criteria
- /// for rotation, the file is renamed to
- /// "access.log.20050802110300".
- ///
- /// Using the "times" property it is possible to specify
- /// time mode for the day/time based rotation. The following values
- /// for the "times" property are supported:
- ///
- /// * utc: Rotation strategy is based on UTC time (default).
- /// * local: Rotation strategy is based on local time.
- ///
- /// Archived log files can be compressed using the gzip compression
- /// method. Compressing can be controlled with the "compression"
- /// property. The following values for the "compress" property
- /// are supported:
- ///
- /// * true: Compress archived log files.
- /// * false: Do not compress archived log files.
- ///
- /// Archived log files can be automatically purged, either if
- /// they reach a certain age, or if the number of archived
- /// log files reaches a given maximum number. This is
- /// controlled by the purgeAge and purgeCount properties.
- ///
- /// The purgeAge property can have the following values:
- ///
- /// * <n> [seconds] the maximum age is <n> seconds.
- /// * <n> minutes: the maximum age is <n> minutes.
- /// * <n> hours: the maximum age is <n> hours.
- /// * <n> days: the maximum age is <n> days.
- /// * <n> weeks: the maximum age is <n> weeks.
- /// * <n> months: the maximum age is <n> months, where a month has 30 days.
- ///
- /// The purgeCount property has an integer value that
- /// specifies the maximum number of archived log files.
- /// If the number is exceeded, archived log files are
- /// deleted, starting with the oldest.
- ///
- /// For a more lightweight file channel class, see SimpleFileChannel.
-{
-public:
- FileChannel();
- /// Creates the FileChannel.
-
- FileChannel(const std::string& path);
- /// Creates the FileChannel for a file with the given path.
-
- void open();
- /// Opens the FileChannel and creates the log file if necessary.
-
- void close();
- /// Closes the FileChannel.
-
- void log(const Message& msg);
- /// Logs the given message to the file.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Sets the property with the given name.
- ///
- /// The following properties are supported:
- /// * path: The log file's path.
- /// * rotation: The log file's rotation mode. See the
- /// FileChannel class for details.
- /// * archive: The log file's archive mode. See the
- /// FileChannel class for details.
- /// * times: The log file's time mode. See the
- /// FileChannel class for details.
- /// * compress: Enable or disable compression of
- /// archived files. See the FileChannel class
- /// for details.
- /// * purgeAge: Maximum age of an archived log file before
- /// it is purged. See the FileChannel class for
- /// details.
- /// * purgeCount: Maximum number of archived log files before
- /// files are purged. See the FileChannel class
- /// for details.
-
- std::string getProperty(const std::string& name) const;
- /// Returns the value of the property with the given name.
- /// See setProperty() for a description of the supported
- /// properties.
-
- Timestamp creationDate() const;
- /// Returns the log file's creation date.
-
- UInt64 size() const;
- /// Returns the log file's current size in bytes.
-
- const std::string& path() const;
- /// Returns the log file's path.
-
- static const std::string PROP_PATH;
- static const std::string PROP_ROTATION;
- static const std::string PROP_ARCHIVE;
- static const std::string PROP_TIMES;
- static const std::string PROP_COMPRESS;
- static const std::string PROP_PURGEAGE;
- static const std::string PROP_PURGECOUNT;
-
-protected:
- ~FileChannel();
- void setRotation(const std::string& rotation);
- void setArchive(const std::string& archive);
- void setCompress(const std::string& compress);
- void setPurgeAge(const std::string& age);
- void setPurgeCount(const std::string& count);
- void purge();
-
-private:
- std::string _path;
- std::string _times;
- std::string _rotation;
- std::string _archive;
- bool _compress;
- std::string _purgeAge;
- std::string _purgeCount;
- LogFile* _pFile;
- RotateStrategy* _pRotateStrategy;
- ArchiveStrategy* _pArchiveStrategy;
- PurgeStrategy* _pPurgeStrategy;
- FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FileChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FileStream.h b/Utilities/Poco/Foundation/include/Poco/FileStream.h
deleted file mode 100755
index a1d1f1f9dc..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FileStream.h
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// FileStream.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: FileStream
-//
-// Definition of the FileStreamBuf, FileInputStream and FileOutputStream classes.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_FileStream_INCLUDED
-#define Foundation_FileStream_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "FileStream_WIN32.h"
-#else
-#include "FileStream_POSIX.h"
-#endif
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API FileIOS: public virtual std::ios
- /// The base class for FileInputStream and FileOutputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
- ///
- /// Files are always opened in binary mode, a text mode
- /// with CR-LF translation is not supported. Thus, the
- /// file is always opened as if the std::ios::binary flag
- /// was specified.
- /// Use an InputLineEndingConverter or OutputLineEndingConverter
- /// if you require CR-LF translation.
- ///
- /// On Windows platforms, if POCO_WIN32_UTF8 is #define'd,
- /// UTF-8 encoded Unicode paths are correctly handled.
-{
-public:
- FileIOS(std::ios::openmode defaultMode);
- /// Creates the basic stream.
-
- ~FileIOS();
- /// Destroys the stream.
-
- void open(const std::string& path, std::ios::openmode mode);
- /// Opens the file specified by path, using the given mode.
- ///
- /// Throws a FileException (or a similar exception) if the file
- /// does not exist or is not accessible for other reasons and
- /// a new file cannot be created.
-
- void close();
- /// Closes the file stream.
-
- FileStreamBuf* rdbuf();
- /// Returns a pointer to the underlying streambuf.
-
-protected:
- FileStreamBuf _buf;
- std::ios::openmode _defaultMode;
-};
-
-
-class Foundation_API FileInputStream: public FileIOS, public std::istream
- /// An input stream for reading from a file.
- ///
- /// Files are always opened in binary mode, a text mode
- /// with CR-LF translation is not supported. Thus, the
- /// file is always opened as if the std::ios::binary flag
- /// was specified.
- /// Use an InputLineEndingConverter if you require CR-LF translation.
- ///
- /// On Windows platforms, if POCO_WIN32_UTF8 is #define'd,
- /// UTF-8 encoded Unicode paths are correctly handled.
-{
-public:
- FileInputStream();
- /// Creates an unopened FileInputStream.
-
- FileInputStream(const std::string& path, std::ios::openmode mode = std::ios::in);
- /// Creates the FileInputStream for the file given by path, using
- /// the given mode.
- ///
- /// The std::ios::in flag is always set, regardless of the actual
- /// value specified for mode.
- ///
- /// Throws a FileNotFoundException (or a similar exception) if the file
- /// does not exist or is not accessible for other reasons.
-
- ~FileInputStream();
- /// Destroys the stream.
-};
-
-
-class Foundation_API FileOutputStream: public FileIOS, public std::ostream
- /// An output stream for writing to a file.
- ///
- /// Files are always opened in binary mode, a text mode
- /// with CR-LF translation is not supported. Thus, the
- /// file is always opened as if the std::ios::binary flag
- /// was specified.
- /// Use an OutputLineEndingConverter if you require CR-LF translation.
- ///
- /// On Windows platforms, if POCO_WIN32_UTF8 is #define'd,
- /// UTF-8 encoded Unicode paths are correctly handled.
-{
-public:
- FileOutputStream();
- /// Creats an unopened FileOutputStream.
-
- FileOutputStream(const std::string& path, std::ios::openmode mode = std::ios::out | std::ios::trunc);
- /// Creates the FileOutputStream for the file given by path, using
- /// the given mode.
- ///
- /// The std::ios::out is always set, regardless of the actual
- /// value specified for mode.
- ///
- /// Throws a FileException (or a similar exception) if the file
- /// does not exist or is not accessible for other reasons and
- /// a new file cannot be created.
-
- ~FileOutputStream();
- /// Destroys the FileOutputStream.
-};
-
-
-class Foundation_API FileStream: public FileIOS, public std::iostream
- /// A stream for reading from and writing to a file.
- ///
- /// Files are always opened in binary mode, a text mode
- /// with CR-LF translation is not supported. Thus, the
- /// file is always opened as if the std::ios::binary flag
- /// was specified.
- /// Use an InputLineEndingConverter or OutputLineEndingConverter
- /// if you require CR-LF translation.
- ///
- /// A seek (seekg() or seekp()) operation will always set the
- /// read position and the write position simultaneously to the
- /// same value.
- ///
- /// On Windows platforms, if POCO_WIN32_UTF8 is #define'd,
- /// UTF-8 encoded Unicode paths are correctly handled.
-{
-public:
- FileStream();
- /// Creats an unopened FileStream.
-
- FileStream(const std::string& path, std::ios::openmode mode = std::ios::out | std::ios::in);
- /// Creates the FileStream for the file given by path, using
- /// the given mode.
-
- ~FileStream();
- /// Destroys the FileOutputStream.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FileStream_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FileStreamFactory.h b/Utilities/Poco/Foundation/include/Poco/FileStreamFactory.h
deleted file mode 100755
index 730017d8f5..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FileStreamFactory.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// FileStreamFactory.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: URI
-// Module: FileStreamFactory
-//
-// Definition of the FileStreamFactory class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_FileStreamFactory_INCLUDED
-#define Foundation_FileStreamFactory_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/URIStreamFactory.h"
-
-
-namespace Poco {
-
-
-class Path;
-
-
-class Foundation_API FileStreamFactory: public URIStreamFactory
- /// An implementation of the URIStreamFactory interface
- /// that handles file URIs.
-{
-public:
- FileStreamFactory();
- /// Creates the FileStreamFactory.
-
- ~FileStreamFactory();
- /// Destroys the FileStreamFactory.
-
- std::istream* open(const URI& uri);
- /// Creates and opens a file stream in binary mode for the given URI.
- /// The URI must be either a file URI or a relative URI reference
- /// containing a path to a local file.
- ///
- /// Throws an FileNotFound exception if the file cannot
- /// be opened.
-
- std::istream* open(const Path& path);
- /// Creates and opens a file stream in binary mode for the given path.
- ///
- /// Throws an FileNotFound exception if the file cannot
- /// be opened.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FileStreamFactory_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FileStream_POSIX.h b/Utilities/Poco/Foundation/include/Poco/FileStream_POSIX.h
deleted file mode 100755
index 2939cae2a6..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FileStream_POSIX.h
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// FileStream_POSIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: FileStream
-//
-// Definition of the FileStreamBuf, FileInputStream and FileOutputStream classes.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_FileStream_POSIX_INCLUDED
-#define Foundation_FileStream_POSIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/BufferedBidirectionalStreamBuf.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API FileStreamBuf: public BufferedBidirectionalStreamBuf
- /// This stream buffer handles Fileio
-{
-public:
- FileStreamBuf();
- /// Creates a FileStreamBuf.
-
- ~FileStreamBuf();
- /// Destroys the FileStream.
-
- void open(const std::string& path, std::ios::openmode mode);
- /// Opens the given file in the given mode.
-
- void close();
- /// Closes the File stream buffer.
-
- std::streampos seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode = std::ios::in | std::ios::out);
- /// Change position by offset, according to way and mode.
-
- std::streampos seekpos(std::streampos pos, std::ios::openmode mode = std::ios::in | std::ios::out);
- /// Change to specified position, according to mode.
-
-protected:
- enum
- {
- BUFFER_SIZE = 4096
- };
-
- int readFromDevice(char* buffer, std::streamsize length);
- int writeToDevice(const char* buffer, std::streamsize length);
-
-private:
- std::string _path;
- int _fd;
- std::streamoff _pos;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FileStream_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FileStream_WIN32.h b/Utilities/Poco/Foundation/include/Poco/FileStream_WIN32.h
deleted file mode 100755
index f7e4ad79f7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FileStream_WIN32.h
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// FileStream_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: FileStream
-//
-// Definition of the FileStreamBuf, FileInputStream and FileOutputStream classes.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_FileStream_WIN32_INCLUDED
-#define Foundation_FileStream_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/BufferedBidirectionalStreamBuf.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API FileStreamBuf: public BufferedBidirectionalStreamBuf
- /// This stream buffer handles Fileio
-{
-public:
- FileStreamBuf();
- /// Creates a FileStreamBuf.
-
- ~FileStreamBuf();
- /// Destroys the FileStream.
-
- void open(const std::string& path, std::ios::openmode mode);
- /// Opens the given file in the given mode.
-
- void close();
- /// Closes the File stream buffer
-
- std::streampos seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode = std::ios::in | std::ios::out);
- /// change position by offset, according to way and mode
-
- std::streampos seekpos(std::streampos pos, std::ios::openmode mode = std::ios::in | std::ios::out);
- /// change to specified position, according to mode
-
-protected:
- enum
- {
- BUFFER_SIZE = 4096
- };
-
- int readFromDevice(char* buffer, std::streamsize length);
- int writeToDevice(const char* buffer, std::streamsize length);
-
-private:
- std::string _path;
- HANDLE _handle;
- UInt64 _pos;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FileStream_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/File_UNIX.h b/Utilities/Poco/Foundation/include/Poco/File_UNIX.h
deleted file mode 100755
index bed61cb866..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/File_UNIX.h
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// File_UNIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: File
-//
-// Definition of the FileImpl class for Unix.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_File_UNIX_INCLUDED
-#define Foundation_File_UNIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class FileImpl
-{
-protected:
- typedef UInt64 FileSizeImpl;
-
- FileImpl();
- FileImpl(const std::string& path);
- virtual ~FileImpl();
- void swapImpl(FileImpl& file);
- void setPathImpl(const std::string& path);
- const std::string& getPathImpl() const;
- bool existsImpl() const;
- bool canReadImpl() const;
- bool canWriteImpl() const;
- bool canExecuteImpl() const;
- bool isFileImpl() const;
- bool isDirectoryImpl() const;
- bool isLinkImpl() const;
- bool isDeviceImpl() const;
- bool isHiddenImpl() const;
- Timestamp createdImpl() const;
- Timestamp getLastModifiedImpl() const;
- void setLastModifiedImpl(const Timestamp& ts);
- FileSizeImpl getSizeImpl() const;
- void setSizeImpl(FileSizeImpl size);
- void setWriteableImpl(bool flag = true);
- void setExecutableImpl(bool flag = true);
- void copyToImpl(const std::string& path) const;
- void renameToImpl(const std::string& path);
- void removeImpl();
- bool createFileImpl();
- bool createDirectoryImpl();
- static void handleLastErrorImpl(const std::string& path);
-
-private:
- std::string _path;
-
- friend class DirectoryIteratorImpl;
-};
-
-
-//
-// inlines
-//
-inline const std::string& FileImpl::getPathImpl() const
-{
- return _path;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_File_UNIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/File_VMS.h b/Utilities/Poco/Foundation/include/Poco/File_VMS.h
deleted file mode 100755
index ad3e976df8..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/File_VMS.h
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// File_VMS.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: File
-//
-// Definition of the FileImpl class for OpenVMS.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_File_VMS_INCLUDED
-#define Foundation_File_VMS_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class FileImpl
-{
-protected:
- typedef UInt64 FileSizeImpl;
-
- FileImpl();
- FileImpl(const std::string& path);
- virtual ~FileImpl();
- void setPath(const std::string& path);
- void swapImpl(FileImpl& file);
- void setPathImpl(const std::string& path);
- const std::string& getPathImpl() const;
- bool existsImpl() const;
- bool canReadImpl() const;
- bool canWriteImpl() const;
- bool canExecuteImpl() const;
- bool isFileImpl() const;
- bool isDirectoryImpl() const;
- bool isLinkImpl() const;
- bool isDeviceImpl() const;
- bool isHiddenImpl() const;
- Timestamp createdImpl() const;
- Timestamp getLastModifiedImpl() const;
- void setLastModifiedImpl(const Timestamp& ts);
- FileSizeImpl getSizeImpl() const;
- void setSizeImpl(FileSizeImpl size);
- void setWriteableImpl(bool flag = true);
- void setExecutableImpl(bool flag = true);
- void copyToImpl(const std::string& path) const;
- void renameToImpl(const std::string& path);
- void removeImpl();
- bool createFileImpl();
- bool createDirectoryImpl();
- static void handleLastError(const std::string& path);
-
-private:
- std::string _path;
-};
-
-
-//
-// inlines
-//
-inline const std::string& FileImpl::getPathImpl() const
-{
- return _path;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_File_VMS_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/File_WIN32.h b/Utilities/Poco/Foundation/include/Poco/File_WIN32.h
deleted file mode 100755
index 5392194da5..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/File_WIN32.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// File_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: File
-//
-// Definition of the FileImpl class for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_File_WIN32_INCLUDED
-#define Foundation_File_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-
-
-class Foundation_API FileImpl
-{
-protected:
- typedef UInt64 FileSizeImpl;
-
- FileImpl();
- FileImpl(const std::string& path);
- virtual ~FileImpl();
- void swapImpl(FileImpl& file);
- void setPathImpl(const std::string& path);
- const std::string& getPathImpl() const;
- bool existsImpl() const;
- bool canReadImpl() const;
- bool canWriteImpl() const;
- bool canExecuteImpl() const;
- bool isFileImpl() const;
- bool isDirectoryImpl() const;
- bool isLinkImpl() const;
- bool isDeviceImpl() const;
- bool isHiddenImpl() const;
- Timestamp createdImpl() const;
- Timestamp getLastModifiedImpl() const;
- void setLastModifiedImpl(const Timestamp& ts);
- FileSizeImpl getSizeImpl() const;
- void setSizeImpl(FileSizeImpl size);
- void setWriteableImpl(bool flag = true);
- void setExecutableImpl(bool flag = true);
- void copyToImpl(const std::string& path) const;
- void renameToImpl(const std::string& path);
- void removeImpl();
- bool createFileImpl();
- bool createDirectoryImpl();
- static void handleLastErrorImpl(const std::string& path);
-
-private:
- std::string _path;
-
- friend class FileHandle;
- friend class DirectoryIteratorImpl;
-};
-
-
-//
-// inlines
-//
-inline const std::string& FileImpl::getPathImpl() const
-{
- return _path;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_File_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/File_WIN32U.h b/Utilities/Poco/Foundation/include/Poco/File_WIN32U.h
deleted file mode 100755
index c2295d14bc..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/File_WIN32U.h
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// File_WIN32U.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: File
-//
-// Definition of the Unicode FileImpl class for WIN32.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_File_WIN32U_INCLUDED
-#define Foundation_File_WIN32U_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-
-
-class Foundation_API FileImpl
-{
-protected:
- typedef UInt64 FileSizeImpl;
-
- FileImpl();
- FileImpl(const std::string& path);
- virtual ~FileImpl();
- void swapImpl(FileImpl& file);
- void setPathImpl(const std::string& path);
- const std::string& getPathImpl() const;
- bool existsImpl() const;
- bool canReadImpl() const;
- bool canWriteImpl() const;
- bool canExecuteImpl() const;
- bool isFileImpl() const;
- bool isDirectoryImpl() const;
- bool isLinkImpl() const;
- bool isDeviceImpl() const;
- bool isHiddenImpl() const;
- Timestamp createdImpl() const;
- Timestamp getLastModifiedImpl() const;
- void setLastModifiedImpl(const Timestamp& ts);
- FileSizeImpl getSizeImpl() const;
- void setSizeImpl(FileSizeImpl size);
- void setWriteableImpl(bool flag = true);
- void setExecutableImpl(bool flag = true);
- void copyToImpl(const std::string& path) const;
- void renameToImpl(const std::string& path);
- void removeImpl();
- bool createFileImpl();
- bool createDirectoryImpl();
- static void handleLastErrorImpl(const std::string& path);
-
-private:
- std::string _path;
- std::wstring _upath;
-
- friend class FileHandle;
- friend class DirectoryIteratorImpl;
-};
-
-
-//
-// inlines
-//
-inline const std::string& FileImpl::getPathImpl() const
-{
- return _path;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_File_WIN32U_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Format.h b/Utilities/Poco/Foundation/include/Poco/Format.h
deleted file mode 100755
index 829b6e1f20..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Format.h
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// Format.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Format
-//
-// Definition of the format freestanding function.
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Redistributions in any form must be accompanied by information on
-// how to obtain complete source code for this software and any
-// accompanying software that uses this software. The source code
-// must either be included in the distribution or be available for no
-// more than the cost of distribution plus a nominal fee, and must be
-// freely redistributable under reasonable conditions. For an
-// executable file, complete source code means the source code for all
-// modules it contains. It does not include source code for modules or
-// files that typically accompany the major components of the operating
-// system on which the executable file runs.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#ifndef Foundation_Format_INCLUDED
-#define Foundation_Format_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Any.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-std::string Foundation_API format(const std::string& fmt, const Any& value);
- /// This function implements sprintf-style formatting in a typesafe way.
- /// Various variants of the function are available, supporting a
- /// different number of arguments (up to six).
- ///
- /// The formatting is controlled by the format string in fmt.
- /// Format strings are quite similar to those of the std::printf() function, but
- /// there are some minor differences.
- ///
- /// The format string can consist of any sequence of characters; certain
- /// characters have a special meaning. Characters without a special meaning
- /// are copied verbatim to the result. A percent sign (%) marks the beginning
- /// of a format specification. Format specifications have the following syntax:
- ///
- /// %[<flags>][<width>][.<precision>][<modifier>]<type>
- ///
- /// Flags, width, precision and prefix are optional. The only required part of
- /// the format specification, apart from the percent sign, is the type.
- ///
- /// Following are valid type specifications and their meaning:
- ///
- /// * b boolean (true = 1, false = 0)
- /// * c character
- /// * d signed decimal integer
- /// * i signed decimal integer
- /// * o unsigned octal integer
- /// * u unsigned decimal integer
- /// * x unsigned hexadecimal integer (lower case)
- /// * X unsigned hexadecimal integer (upper case)
- /// * e signed floating-point value in the form [-]d.dddde[<sign>]dd[d]
- /// * E signed floating-point value in the form [-]d.ddddE[<sign>]dd[d]
- /// * f signed floating-point value in the form [-]dddd.dddd
- /// * s std::string
- /// * z std::size_t
- ///
- /// The following flags are supported:
- ///
- /// * - left align the result within the given field width
- /// * + prefix the output value with a sign (+ or –) if the output value is of a signed type
- /// * 0 if width is prefixed with 0, zeros are added until the minimum width is reached
- /// * # For o, x, X, the # flag prefixes any nonzero output value with 0, 0x, or 0X, respectively;
- /// for e, E, f, the # flag forces the output value to contain a decimal point in all cases.
- ///
- /// The following modifiers are supported:
- ///
- /// * (none) argument is char (c), int (d, i), unsigned (o, u, x, X) double (e, E, f, g, G) or string (s)
- /// * l argument is long (d, i), unsigned long (o, u, x, X) or long double (e, E, f, g, G)
- /// * L argument is long long (d, i), unsigned long long (o, u, x, X)
- /// * h argument is short (d, i), unsigned short (o, u, x, X) or float (e, E, f, g, G)
- /// * ? argument is any signed or unsigned int, short, long, or 64-bit integer (d, i, o, x, X)
- ///
- /// The width argument is a nonnegative decimal integer controlling the minimum number of characters printed.
- /// If the number of characters in the output value is less than the specified width, blanks or
- /// leading zeros are added, according to the specified flags (-, +, 0).
- ///
- /// Precision is a nonnegative decimal integer, preceded by a period (.), which specifies the number of characters
- /// to be printed, the number of decimal places, or the number of significant digits.
- ///
- /// Throws a BadCastException if an argument does not correspond to the type of its format specification.
- ///
- /// If there are more format specifiers than values, the format specifiers without a corresponding value
- /// are copied verbatim to output.
- ///
- /// If there are more values than format specifiers, the superfluous values are ignored.
- ///
- /// Usage Example:
- /// std::string s = format("The answer to life, the universe, and everything is %d", 42);
-
-std::string Foundation_API format(const std::string& fmt, const Any& value1, const Any& value2);
-std::string Foundation_API format(const std::string& fmt, const Any& value1, const Any& value2, const Any& value3);
-std::string Foundation_API format(const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4);
-std::string Foundation_API format(const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4, const Any& value5);
-std::string Foundation_API format(const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4, const Any& value5, const Any& value6);
-
-
-void Foundation_API format(std::string& result, const std::string& fmt, const Any& value);
- /// Appends the formatted string to result.
-
-void Foundation_API format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2);
-void Foundation_API format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2, const Any& value3);
-void Foundation_API format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4);
-void Foundation_API format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4, const Any& value5);
-void Foundation_API format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4, const Any& value5, const Any& value6);
-
-
-void Foundation_API format(std::string& result, const std::string& fmt, const std::vector<Any>& values);
- /// Supports a variable number of arguments and is used by
- /// all other variants of format().
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Format_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Formatter.h b/Utilities/Poco/Foundation/include/Poco/Formatter.h
deleted file mode 100755
index f2117516f3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Formatter.h
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// Formatter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Formatter
-//
-// Definition of the Formatter class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Formatter_INCLUDED
-#define Foundation_Formatter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Configurable.h"
-#include "Poco/RefCountedObject.h"
-
-
-namespace Poco {
-
-
-class Message;
-
-
-class Foundation_API Formatter: public Configurable, public RefCountedObject
- /// The base class for all Formatter classes.
- ///
- /// A formatter basically takes a Message object
- /// and formats it into a string. How the formatting
- /// is exactly done is up to the implementation of
- /// Formatter. For example, a very simple implementation
- /// might simply take the message's Text (see Message::getText()).
- /// A useful implementation should at least take the Message's
- /// Time, Priority and Text fields and put them into a string.
- ///
- /// The Formatter class supports the Configurable
- /// interface, so the behaviour of certain formatters
- /// is configurable.
- ///
- /// Trivial implementations of of getProperty() and
- /// setProperty() are provided.
- ///
- /// Subclasses must at least provide a format() method.
-{
-public:
- Formatter();
- /// Creates the formatter.
-
- virtual ~Formatter();
- /// Destroys the formatter.
-
- virtual void format(const Message& msg, std::string& text) = 0;
- /// Formats the message and places the result in text.
- /// Subclasses must override this method.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Throws a PropertyNotSupportedException.
-
- std::string getProperty(const std::string& name) const;
- /// Throws a PropertyNotSupportedException.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Formatter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FormattingChannel.h b/Utilities/Poco/Foundation/include/Poco/FormattingChannel.h
deleted file mode 100755
index 6d8194e428..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FormattingChannel.h
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// FormattingChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Formatter
-//
-// Definition of the FormattingChannel class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_FormattingChannel_INCLUDED
-#define Foundation_FormattingChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-
-
-namespace Poco {
-
-
-class Formatter;
-
-
-class Foundation_API FormattingChannel: public Channel
- /// The FormattingChannel is a filter channel that routes
- /// a Message through a Formatter before passing it on
- /// to the destination channel.
-{
-public:
- FormattingChannel();
- /// Creates a FormattingChannel.
-
- FormattingChannel(Formatter* pFormatter);
- /// Creates a FormattingChannel and attaches a Formatter.
-
- FormattingChannel(Formatter* pFormatter, Channel* pChannel);
- /// Creates a FormattingChannel and attaches a Formatter
- /// and a Channel.
-
- void setFormatter(Formatter* pFormatter);
- /// Sets the Formatter used to format the messages
- /// before they are passed on. If null, the message
- /// is passed on unmodified.
-
- Formatter* getFormatter() const;
- /// Returns the Formatter used to format messages,
- /// which may be null.
-
- void setChannel(Channel* pChannel);
- /// Sets the destination channel to which the formatted
- /// messages are passed on.
-
- Channel* getChannel() const;
- /// Returns the channel to which the formatted
- /// messages are passed on.
-
- void log(const Message& msg);
- /// Formats the given Message using the Formatter and
- /// passes the formatted message on to the destination
- /// Channel.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Sets or changes a configuration property.
- ///
- /// Only the "channel" and "formatter" properties are supported, which allow
- /// setting the target channel and formatter, respectively, via the LoggingRegistry.
- /// The "channel" and "formatter" properties are set-only.
- ///
- /// Unsupported properties are passed to the attached Channel.
-
- void open();
- /// Opens the attached channel.
-
- void close();
- /// Closes the attached channel.
-
-protected:
- ~FormattingChannel();
-
-private:
- Formatter* _pFormatter;
- Channel* _pChannel;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FormattingChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Foundation.h b/Utilities/Poco/Foundation/include/Poco/Foundation.h
deleted file mode 100755
index e25ed8af27..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Foundation.h
+++ /dev/null
@@ -1,140 +0,0 @@
-//
-// Foundation.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Foundation
-//
-// Basic definitions for the POCO Foundation library.
-// This file must be the first file included by every other Foundation
-// header file.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Foundation_INCLUDED
-#define Foundation_Foundation_INCLUDED
-
-
-//
-// Include library configuration
-//
-#include "Poco/Config.h"
-
-
-//
-// Ensure that POCO_DLL is default unless POCO_STATIC is defined
-//
-#if defined(_WIN32) && defined(_DLL)
- #if !defined(POCO_DLL) && !defined(POCO_STATIC)
- #define POCO_DLL
- #endif
-#endif
-
-
-//
-// The following block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the Foundation_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// Foundation_API functions as being imported from a DLL, wheras this DLL sees symbols
-// defined with this macro as being exported.
-//
-#if defined(_WIN32) && defined(POCO_DLL)
- #if defined(Foundation_EXPORTS)
- #define Foundation_API __declspec(dllexport)
- #else
- #define Foundation_API __declspec(dllimport)
- #endif
-#endif
-
-
-#if !defined(Foundation_API)
- #define Foundation_API
-#endif
-
-
-//
-// Automatically link Foundation library.
-//
-#if defined(_MSC_VER)
- #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Foundation_EXPORTS)
- #if defined(POCO_DLL)
- #if defined(_DEBUG)
- #pragma comment(lib, "PocoFoundationd.lib")
- #else
- #pragma comment(lib, "PocoFoundation.lib")
- #endif
- #else
- #if defined(_DEBUG)
- #pragma comment(lib, "PocoFoundationmtd.lib")
- #else
- #pragma comment(lib, "PocoFoundationmt.lib")
- #endif
- #endif
- #endif
-#endif
-
-
-//
-// Include platform-specific definitions
-//
-#include "Poco/Platform.h"
-#if defined(_WIN32)
- #include "Poco/Platform_WIN32.h"
-#elif defined(__VMS)
- #include "Poco/Platform_VMS.h"
-#elif defined(POCO_OS_FAMILY_UNIX)
- #include "Poco/Platform_POSIX.h"
-#endif
-
-
-//
-// POCO_JOIN
-//
-// The following piece of macro magic joins the two
-// arguments together, even when one of the arguments is
-// itself a macro (see 16.3.1 in C++ standard). The key
-// is that macro expansion of macro arguments does not
-// occur in POCO_DO_JOIN2 but does in POCO_DO_JOIN.
-//
-#define POCO_JOIN(X, Y) POCO_DO_JOIN(X, Y)
-#define POCO_DO_JOIN(X, Y) POCO_DO_JOIN2(X, Y)
-#define POCO_DO_JOIN2(X, Y) X##Y
-
-
-//
-// Pull in basic definitions
-//
-#include "Poco/Bugcheck.h"
-#include "Poco/Types.h"
-#include <string>
-
-
-#endif // Foundation_Foundation_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FunctionDelegate.h b/Utilities/Poco/Foundation/include/Poco/FunctionDelegate.h
deleted file mode 100755
index 9691104e44..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FunctionDelegate.h
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-// FunctionDelegate.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: FunctionDelegate
-//
-// Implementation of the FunctionDelegate template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_FunctionDelegate_INCLUDED
-#define Foundation_FunctionDelegate_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/AbstractDelegate.h"
-
-
-namespace Poco {
-
-
-template <class TArgs, bool hasSender = true, bool senderIsConst = true>
-class FunctionDelegate: public AbstractDelegate<TArgs>
- /// Wraps a C style function (or a C++ static fucntion) to be used as
- /// a delegate
-{
-public:
- typedef void (*NotifyMethod)(const void*, TArgs&);
-
- FunctionDelegate(NotifyMethod method):
- AbstractDelegate<TArgs>(*reinterpret_cast<void**>(&method)),
- _receiverMethod(method)
- {
- }
-
- FunctionDelegate(const FunctionDelegate& delegate):
- AbstractDelegate<TArgs>(delegate),
- _receiverMethod(delegate._receiverMethod)
- {
- }
-
- ~FunctionDelegate()
- {
- }
-
- FunctionDelegate& operator = (const FunctionDelegate& delegate)
- {
- if (&delegate != this)
- {
- this->_pTarget = delegate._pTarget;
- this->_receiverMethod = delegate._receiverMethod;
- }
- return *this;
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- (*_receiverMethod)(sender, arguments);
- return true; // a "standard" delegate never expires
- }
-
- AbstractDelegate<TArgs>* clone() const
- {
- return new FunctionDelegate(*this);
- }
-
-protected:
- NotifyMethod _receiverMethod;
-
-private:
- FunctionDelegate();
-};
-
-
-template <class TArgs>
-class FunctionDelegate<TArgs, true, false>: public AbstractDelegate<TArgs>
-{
-public:
- typedef void (*NotifyMethod)(void*, TArgs&);
-
- FunctionDelegate(NotifyMethod method):
- AbstractDelegate<TArgs>(*reinterpret_cast<void**>(&method)),
- _receiverMethod(method)
- {
- }
-
- FunctionDelegate(const FunctionDelegate& delegate):
- AbstractDelegate<TArgs>(delegate),
- _receiverMethod(delegate._receiverMethod)
- {
- }
-
- ~FunctionDelegate()
- {
- }
-
- FunctionDelegate& operator = (const FunctionDelegate& delegate)
- {
- if (&delegate != this)
- {
- this->_pTarget = delegate._pTarget;
- this->_receiverMethod = delegate._receiverMethod;
- }
- return *this;
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- (*_receiverMethod)(const_cast<void*>(sender), arguments);
- return true; // a "standard" delegate never expires
- }
-
- AbstractDelegate<TArgs>* clone() const
- {
- return new FunctionDelegate(*this);
- }
-
-protected:
- NotifyMethod _receiverMethod;
-
-private:
- FunctionDelegate();
-};
-
-
-template <class TArgs, bool senderIsConst>
-class FunctionDelegate<TArgs, false, senderIsConst>: public AbstractDelegate<TArgs>
-{
-public:
- typedef void (*NotifyMethod)(TArgs&);
-
- FunctionDelegate(NotifyMethod method):
- AbstractDelegate<TArgs>(*reinterpret_cast<void**>(&method)),
- _receiverMethod(method)
- {
- }
-
- FunctionDelegate(const FunctionDelegate& delegate):
- AbstractDelegate<TArgs>(delegate),
- _receiverMethod(delegate._receiverMethod)
- {
- }
-
- ~FunctionDelegate()
- {
- }
-
- FunctionDelegate& operator = (const FunctionDelegate& delegate)
- {
- if (&delegate != this)
- {
- this->_pTarget = delegate._pTarget;
- this->_receiverMethod = delegate._receiverMethod;
- }
- return *this;
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- (*_receiverMethod)(arguments);
- return true; // a "standard" delegate never expires
- }
-
- AbstractDelegate<TArgs>* clone() const
- {
- return new FunctionDelegate(*this);
- }
-
-protected:
- NotifyMethod _receiverMethod;
-
-private:
- FunctionDelegate();
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FunctionDelegate_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/FunctionPriorityDelegate.h b/Utilities/Poco/Foundation/include/Poco/FunctionPriorityDelegate.h
deleted file mode 100755
index 0ca1a1022e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/FunctionPriorityDelegate.h
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// FunctionPriorityDelegate.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: FunctionPriorityDelegate
-//
-// Implementation of the FunctionPriorityDelegate template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_FunctionPriorityDelegate_INCLUDED
-#define Foundation_FunctionPriorityDelegate_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/AbstractPriorityDelegate.h"
-
-
-namespace Poco {
-
-
-template <class TArgs, bool useSender = true, bool senderIsConst = true>
-class FunctionPriorityDelegate: public AbstractPriorityDelegate<TArgs>
- /// Wraps a C style function (or a C++ static fucntion) to be used as
- /// a priority delegate
-{
-public:
- typedef void (*NotifyMethod)(const void*, TArgs&);
-
- FunctionPriorityDelegate(NotifyMethod method, int prio):
- AbstractPriorityDelegate<TArgs>(*reinterpret_cast<void**>(&method), prio),
- _receiverMethod(method)
- {
- }
-
- FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate):
- AbstractPriorityDelegate<TArgs>(delegate._pTarget, delegate._priority),
- _receiverMethod(delegate._receiverMethod)
- {
- }
-
- FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate)
- {
- if (&delegate != this)
- {
- this->_pTarget = delegate._pTarget;
- this->_receiverMethod = delegate._receiverMethod;
- this->_priority = delegate._priority;
- }
- return *this;
- }
-
- ~FunctionPriorityDelegate()
- {
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- (*_receiverMethod)(sender, arguments);
- return true; // per default the delegate never expires
- }
-
- AbstractPriorityDelegate<TArgs>* clone() const
- {
- return new FunctionPriorityDelegate(*this);
- }
-
-protected:
- NotifyMethod _receiverMethod;
-
-private:
- FunctionPriorityDelegate();
-};
-
-
-template <class TArgs>
-class FunctionPriorityDelegate<TArgs, true, false>: public AbstractPriorityDelegate<TArgs>
-{
-public:
- typedef void (*NotifyMethod)(void*, TArgs&);
-
- FunctionPriorityDelegate(NotifyMethod method, int prio):
- AbstractPriorityDelegate<TArgs>(*reinterpret_cast<void**>(&method), prio),
- _receiverMethod(method)
- {
- }
-
- FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate):
- AbstractPriorityDelegate<TArgs>(delegate._pTarget, delegate._priority),
- _receiverMethod(delegate._receiverMethod)
- {
- }
-
- FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate)
- {
- if (&delegate != this)
- {
- this->_pTarget = delegate._pTarget;
- this->_receiverMethod = delegate._receiverMethod;
- this->_priority = delegate._priority;
- }
- return *this;
- }
-
- ~FunctionPriorityDelegate()
- {
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- (*_receiverMethod)(const_cast<void*>(sender), arguments);
- return true; // per default the delegate never expires
- }
-
- AbstractPriorityDelegate<TArgs>* clone() const
- {
- return new FunctionPriorityDelegate(*this);
- }
-
-protected:
- NotifyMethod _receiverMethod;
-
-private:
- FunctionPriorityDelegate();
-};
-
-
-
-template <class TArgs>
-class FunctionPriorityDelegate<TArgs, false>: public AbstractPriorityDelegate<TArgs>
-{
-public:
- typedef void (*NotifyMethod)(TArgs&);
-
- FunctionPriorityDelegate(NotifyMethod method, int prio):
- AbstractPriorityDelegate<TArgs>(*reinterpret_cast<void**>(&method), prio),
- _receiverMethod(method)
- {
- }
-
- FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate):
- AbstractPriorityDelegate<TArgs>(delegate._pTarget, delegate._priority),
- _receiverMethod(delegate._receiverMethod)
- {
- }
-
- FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate)
- {
- if (&delegate != this)
- {
- this->_pTarget = delegate._pTarget;
- this->_receiverMethod = delegate._receiverMethod;
- this->_priority = delegate._priority;
- }
- return *this;
- }
-
- ~FunctionPriorityDelegate()
- {
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- (*_receiverMethod)(arguments);
- return true; // per default the delegate never expires
- }
-
- AbstractPriorityDelegate<TArgs>* clone() const
- {
- return new FunctionPriorityDelegate(*this);
- }
-
-protected:
- NotifyMethod _receiverMethod;
-
-private:
- FunctionPriorityDelegate();
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_FunctionPriorityDelegate_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Glob.h b/Utilities/Poco/Foundation/include/Poco/Glob.h
deleted file mode 100755
index a070e8a889..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Glob.h
+++ /dev/null
@@ -1,162 +0,0 @@
-//
-// Glob.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Glob
-//
-// Definition of the Glob class.
-//
-// Copyright (c) 2004-2009, 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.
-//
-
-
-#ifndef Foundation_Glob_INCLUDED
-#define Foundation_Glob_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/TextIterator.h"
-#include <set>
-
-
-namespace Poco {
-
-
-class Path;
-
-
-class Foundation_API Glob
- /// This class implements glob-style pattern matching
- /// as known from Unix shells.
- ///
- /// In the pattern string, '*' matches any sequence of characters,
- /// '?' matches any single character, [SET] matches any single character
- /// in the specified set, [!SET] matches any character not in the
- /// specified set.
- ///
- /// A set is composed of characters or ranges; a range looks like
- /// character hyphen character (as in 0-9 or A-Z).
- /// [0-9a-zA-Z_] is the set of characters allowed in C identifiers.
- /// Any other character in the pattern must be matched exactly.
- ///
- /// To suppress the special syntactic significance of any of '[]*?!-\',
- /// and match the character exactly, precede it with a backslash.
- ///
- /// All strings are assumed to be UTF-8 encoded.
-{
-public:
- enum Options
- /// Flags that modify the matching behavior.
- {
- GLOB_DEFAULT = 0x00, /// default behavior
- GLOB_DOT_SPECIAL = 0x01, /// '*' and '?' do not match '.' at beginning of subject
- GLOB_FOLLOW_SYMLINKS = 0x02, /// follow symbolic links
- GLOB_CASELESS = 0x04, /// ignore case when comparing characters
- GLOB_DIRS_ONLY = 0x80 /// only glob for directories (for internal use only)
- };
-
- Glob(const std::string& pattern, int options = 0);
- /// Creates the Glob, using the given pattern. The pattern
- /// must not be an empty string.
- ///
- /// If the GLOB_DOT_SPECIAL option is specified, '*' and '?' do
- /// not match '.' at the beginning of a matched subject. This is useful for
- /// making dot-files invisible in good old Unix-style.
-
- ~Glob();
- /// Destroys the Glob.
-
- bool match(const std::string& subject);
- /// Matches the given subject against the glob pattern.
- /// Returns true if the subject matches the pattern, false
- /// otherwise.
-
- static void glob(const std::string& pathPattern, std::set<std::string>& files, int options = 0);
- /// Creates a set of files that match the given pathPattern.
- ///
- /// The path may be give in either Unix, Windows or VMS syntax and
- /// is automatically expanded by calling Path::expand().
- ///
- /// The pattern may contain wildcard expressions even in intermediate
- /// directory names (e.g. /usr/include/*/*.h).
- ///
- /// Note that, for obvious reasons, escaping characters in a pattern
- /// with a backslash does not work in Windows-style paths.
- ///
- /// Directories that for whatever reason cannot be traversed are
- /// ignored.
-
- static void glob(const char* pathPattern, std::set<std::string>& files, int options = 0);
- /// Creates a set of files that match the given pathPattern.
- ///
- /// The path may be give in either Unix, Windows or VMS syntax and
- /// is automatically expanded by calling Path::expand().
- ///
- /// The pattern may contain wildcard expressions even in intermediate
- /// directory names (e.g. /usr/include/*/*.h).
- ///
- /// Note that, for obvious reasons, escaping characters in a pattern
- /// with a backslash does not work in Windows-style paths.
- ///
- /// Directories that for whatever reason cannot be traversed are
- /// ignored.
-
- static void glob(const Path& pathPattern, std::set<std::string>& files, int options = 0);
- /// Creates a set of files that match the given pathPattern.
- ///
- /// The pattern may contain wildcard expressions even in intermediate
- /// directory names (e.g. /usr/include/*/*.h).
- ///
- /// Note that, for obvious reasons, escaping characters in a pattern
- /// with a backslash does not work in Windows-style paths.
- ///
- /// Directories that for whatever reason cannot be traversed are
- /// ignored.
-
-protected:
- bool match(TextIterator& itp, const TextIterator& endp, TextIterator& its, const TextIterator& ends);
- bool matchAfterAsterisk(TextIterator itp, const TextIterator& endp, TextIterator its, const TextIterator& ends);
- bool matchSet(TextIterator& itp, const TextIterator& endp, int c);
- static void collect(const Path& pathPattern, const Path& base, const Path& current, const std::string& pattern, std::set<std::string>& files, int options);
- static bool isDirectory(const Path& path, bool followSymlink);
-
-private:
- std::string _pattern;
- int _options;
-
- Glob();
- Glob(const Glob&);
- Glob& operator = (const Glob&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Glob_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/HMACEngine.h b/Utilities/Poco/Foundation/include/Poco/HMACEngine.h
deleted file mode 100755
index 94c9632f80..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/HMACEngine.h
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// HMACEngine.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: HMACEngine
-//
-// Definition of the HMACEngine class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_HMACEngine_INCLUDED
-#define Foundation_HMACEngine_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DigestEngine.h"
-#include <cstring>
-
-
-namespace Poco {
-
-
-template <class Engine>
-class HMACEngine: public DigestEngine
- /// This class implementes the HMAC message
- /// authentication code algorithm, as specified
- /// in RFC 2104. The underlying DigestEngine
- /// (MD5Engine, SHA1Engine, etc.) must be given as
- /// template argument.
- /// Since the HMACEngine is a DigestEngine, it can
- /// be used with the DigestStream class to create
- /// a HMAC for a stream.
-{
-public:
- enum
- {
- BLOCK_SIZE = Engine::BLOCK_SIZE,
- DIGEST_SIZE = Engine::DIGEST_SIZE
- };
-
- HMACEngine(const std::string& passphrase)
- {
- init(passphrase.data(), (unsigned) passphrase.length());
- }
-
- HMACEngine(const char* passphrase, unsigned length)
- {
- poco_check_ptr (passphrase);
-
- init(passphrase, length);
- }
-
- ~HMACEngine()
- {
- std::memset(_ipad, 0, BLOCK_SIZE);
- std::memset(_opad, 0, BLOCK_SIZE);
- delete [] _ipad;
- delete [] _opad;
- }
-
- unsigned digestLength() const
- {
- return DIGEST_SIZE;
- }
-
- void reset()
- {
- _engine.reset();
- _engine.update(_ipad, BLOCK_SIZE);
- }
-
- const DigestEngine::Digest& digest()
- {
- const DigestEngine::Digest& d = _engine.digest();
- char db[DIGEST_SIZE];
- char* pdb = db;
- for (DigestEngine::Digest::const_iterator it = d.begin(); it != d.end(); ++it)
- *pdb++ = *it;
- _engine.reset();
- _engine.update(_opad, BLOCK_SIZE);
- _engine.update(db, DIGEST_SIZE);
- const DigestEngine::Digest& result = _engine.digest();
- reset();
- return result;
- }
-
-protected:
- void init(const char* passphrase, unsigned length)
- {
- _ipad = new char[BLOCK_SIZE];
- _opad = new char[BLOCK_SIZE];
- std::memset(_ipad, 0, BLOCK_SIZE);
- std::memset(_opad, 0, BLOCK_SIZE);
- if (length > BLOCK_SIZE)
- {
- _engine.reset();
- _engine.update(passphrase, length);
- const DigestEngine::Digest& d = _engine.digest();
- char* ipad = _ipad;
- char* opad = _opad;
- int n = BLOCK_SIZE;
- for (DigestEngine::Digest::const_iterator it = d.begin(); it != d.end() && n-- > 0; ++it)
- {
- *ipad++ = *it;
- *opad++ = *it;
- }
- }
- else
- {
- std::memcpy(_ipad, passphrase, length);
- std::memcpy(_opad, passphrase, length);
- }
- for (int i = 0; i < BLOCK_SIZE; ++i)
- {
- _ipad[i] ^= 0x36;
- _opad[i] ^= 0x5c;
- }
- reset();
- }
-
- void updateImpl(const void* data, unsigned length)
- {
- _engine.update(data, length);
- }
-
-private:
- HMACEngine();
- HMACEngine(const HMACEngine&);
- HMACEngine& operator = (const HMACEngine&);
-
- Engine _engine;
- char* _ipad;
- char* _opad;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_HMACEngine_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Hash.h b/Utilities/Poco/Foundation/include/Poco/Hash.h
deleted file mode 100755
index 3f4b98881b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Hash.h
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// Hash.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Hashing
-// Module: Hash
-//
-// Definition of the Hash class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_Hash_INCLUDED
-#define Foundation_Hash_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <cstddef>
-
-
-namespace Poco {
-
-std::size_t Foundation_API hash(Int8 n);
-std::size_t Foundation_API hash(UInt8 n);
-std::size_t Foundation_API hash(Int16 n);
-std::size_t Foundation_API hash(UInt16 n);
-std::size_t Foundation_API hash(Int32 n);
-std::size_t Foundation_API hash(UInt32 n);
-std::size_t Foundation_API hash(Int64 n);
-std::size_t Foundation_API hash(UInt64 n);
-std::size_t Foundation_API hash(const std::string& str);
-
-
-template <class T>
-struct Hash
- /// A generic hash function.
-{
- std::size_t operator () (T value) const
- /// Returns the hash for the given value.
- {
- return hash(value);
- }
-};
-
-
-
-//
-// inlines
-//
-inline std::size_t hash(Int8 n)
-{
- return static_cast<std::size_t>(n)*2654435761U;
-}
-
-
-inline std::size_t hash(UInt8 n)
-{
- return static_cast<std::size_t>(n)*2654435761U;
-}
-
-
-inline std::size_t hash(Int16 n)
-{
- return static_cast<std::size_t>(n)*2654435761U;
-}
-
-
-inline std::size_t hash(UInt16 n)
-{
- return static_cast<std::size_t>(n)*2654435761U;
-}
-
-
-inline std::size_t hash(Int32 n)
-{
- return static_cast<std::size_t>(n)*2654435761U;
-}
-
-
-inline std::size_t hash(UInt32 n)
-{
- return static_cast<std::size_t>(n)*2654435761U;
-}
-
-
-inline std::size_t hash(Int64 n)
-{
- return static_cast<std::size_t>(n)*2654435761U;
-}
-
-
-inline std::size_t hash(UInt64 n)
-{
- return static_cast<std::size_t>(n)*2654435761U;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Hash_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/HashFunction.h b/Utilities/Poco/Foundation/include/Poco/HashFunction.h
deleted file mode 100755
index f9f6f1d2af..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/HashFunction.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// HashFunction.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Hashing
-// Module: HashFunction
-//
-// Definition of the HashFunction class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_HashFunction_INCLUDED
-#define Foundation_HashFunction_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Hash.h"
-
-
-namespace Poco {
-
-
-//@ deprecated
-template <class T>
-struct HashFunction
- /// A generic hash function.
-{
- UInt32 operator () (T key, UInt32 maxValue) const
- /// Returns the hash value for the given key.
- {
- return ((UInt32) hash(key)) % maxValue;
- }
-};
-
-
-//@ deprecated
-template <>
-struct HashFunction<std::string>
- /// A generic hash function.
-{
- UInt32 operator () (const std::string& key, UInt32 maxValue) const
- /// Returns the hash value for the given key.
- {
- return ((UInt32) hash(key)) % maxValue;
- }
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_HashFunctions_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/HashMap.h b/Utilities/Poco/Foundation/include/Poco/HashMap.h
deleted file mode 100755
index 29a49709a3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/HashMap.h
+++ /dev/null
@@ -1,244 +0,0 @@
-//
-// HashMap.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Hashing
-// Module: HashMap
-//
-// Definition of the HashMap class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_HashMap_INCLUDED
-#define Foundation_HashMap_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/LinearHashTable.h"
-#include "Poco/Exception.h"
-#include <utility>
-
-
-namespace Poco {
-
-
-template <class Key, class Value>
-struct HashMapEntry
- /// This class template is used internally by HashMap.
-{
- Key first;
- Value second;
-
- HashMapEntry():
- first(),
- second()
- {
- }
-
- HashMapEntry(const Key& key):
- first(key),
- second()
- {
- }
-
- HashMapEntry(const Key& key, const Value& value):
- first(key),
- second(value)
- {
- }
-
- bool operator == (const HashMapEntry& entry) const
- {
- return first == entry.first;
- }
-
- bool operator != (const HashMapEntry& entry) const
- {
- return first != entry.first;
- }
-};
-
-
-template <class HME, class KeyHashFunc>
-struct HashMapEntryHash
- /// This class template is used internally by HashMap.
-{
- std::size_t operator () (const HME& entry) const
- {
- return _func(entry.first);
- }
-
-private:
- KeyHashFunc _func;
-};
-
-
-template <class Key, class Mapped, class HashFunc = Hash<Key> >
-class HashMap
- /// This class implements a map using a LinearHashTable.
- ///
- /// A HashMap can be used just like a std::map.
-{
-public:
- typedef Key KeyType;
- typedef Mapped MappedType;
- typedef Mapped& Reference;
- typedef const Mapped& ConstReference;
- typedef Mapped* Pointer;
- typedef const Mapped* ConstPointer;
-
- typedef HashMapEntry<Key, Mapped> ValueType;
- typedef std::pair<KeyType, MappedType> PairType;
-
- typedef HashMapEntryHash<ValueType, HashFunc> HashType;
- typedef LinearHashTable<ValueType, HashType> HashTable;
-
- typedef typename HashTable::Iterator Iterator;
- typedef typename HashTable::ConstIterator ConstIterator;
-
- HashMap()
- /// Creates an empty HashMap.
- {
- }
-
- HashMap(std::size_t initialReserve):
- _table(initialReserve)
- /// Creates the HashMap with room for initialReserve entries.
- {
- }
-
- HashMap& operator = (const HashMap& map)
- /// Assigns another HashMap.
- {
- HashMap tmp(map);
- swap(tmp);
- return *this;
- }
-
- void swap(HashMap& map)
- /// Swaps the HashMap with another one.
- {
- _table.swap(map._table);
- }
-
- ConstIterator begin() const
- {
- return _table.begin();
- }
-
- ConstIterator end() const
- {
- return _table.end();
- }
-
- Iterator begin()
- {
- return _table.begin();
- }
-
- Iterator end()
- {
- return _table.end();
- }
-
- ConstIterator find(const KeyType& key) const
- {
- ValueType value(key);
- return _table.find(value);
- }
-
- Iterator find(const KeyType& key)
- {
- ValueType value(key);
- return _table.find(value);
- }
-
- std::pair<Iterator, bool> insert(const PairType& pair)
- {
- ValueType value(pair.first, pair.second);
- return _table.insert(value);
- }
-
- std::pair<Iterator, bool> insert(const ValueType& value)
- {
- return _table.insert(value);
- }
-
- void erase(Iterator it)
- {
- _table.erase(it);
- }
-
- void erase(const KeyType& key)
- {
- Iterator it = find(key);
- _table.erase(it);
- }
-
- void clear()
- {
- _table.clear();
- }
-
- std::size_t size() const
- {
- return _table.size();
- }
-
- bool empty() const
- {
- return _table.empty();
- }
-
- ConstReference operator [] (const KeyType& key) const
- {
- ConstIterator it = _table.find(key);
- if (it != _table.end())
- return it->second;
- else
- throw NotFoundException();
- }
-
- Reference operator [] (const KeyType& key)
- {
- ValueType value(key);
- std::pair<Iterator, bool> res = _table.insert(value);
- return res.first->second;
- }
-
-private:
- HashTable _table;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_HashMap_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/HashSet.h b/Utilities/Poco/Foundation/include/Poco/HashSet.h
deleted file mode 100755
index 15f280be78..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/HashSet.h
+++ /dev/null
@@ -1,199 +0,0 @@
-//
-// HashSet.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Hashing
-// Module: HashSet
-//
-// Definition of the HashSet class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_HashSet_INCLUDED
-#define Foundation_HashSet_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/LinearHashTable.h"
-
-
-namespace Poco {
-
-
-template <class Value, class HashFunc = Hash<Value> >
-class HashSet
- /// This class implements a set using a LinearHashTable.
- ///
- /// A HashSet can be used just like a std::set.
-{
-public:
- typedef Value ValueType;
- typedef Value& Reference;
- typedef const Value& ConstReference;
- typedef Value* Pointer;
- typedef const Value* ConstPointer;
- typedef HashFunc Hash;
-
- typedef LinearHashTable<ValueType, Hash> HashTable;
-
- typedef typename HashTable::Iterator Iterator;
- typedef typename HashTable::ConstIterator ConstIterator;
-
- HashSet()
- /// Creates an empty HashSet.
- {
- }
-
- HashSet(std::size_t initialReserve):
- _table(initialReserve)
- /// Creates the HashSet, using the given initialReserve.
- {
- }
-
- HashSet(const HashSet& set):
- _table(set._table)
- /// Creates the HashSet by copying another one.
- {
- }
-
- ~HashSet()
- /// Destroys the HashSet.
- {
- }
-
- HashSet& operator = (const HashSet& table)
- /// Assigns another HashSet.
- {
- HashSet tmp(table);
- swap(tmp);
- return *this;
- }
-
- void swap(HashSet& set)
- /// Swaps the HashSet with another one.
- {
- _table.swap(set._table);
- }
-
- ConstIterator begin() const
- /// Returns an iterator pointing to the first entry, if one exists.
- {
- return _table.begin();
- }
-
- ConstIterator end() const
- /// Returns an iterator pointing to the end of the table.
- {
- return _table.end();
- }
-
- Iterator begin()
- /// Returns an iterator pointing to the first entry, if one exists.
- {
- return _table.begin();
- }
-
- Iterator end()
- /// Returns an iterator pointing to the end of the table.
- {
- return _table.end();
- }
-
- ConstIterator find(const ValueType& value) const
- /// Finds an entry in the table.
- {
- return _table.find(value);
- }
-
- Iterator find(const ValueType& value)
- /// Finds an entry in the table.
- {
- return _table.find(value);
- }
-
- std::size_t count(const ValueType& value) const
- /// Returns the number of elements with the given
- /// value, with is either 1 or 0.
- {
- return _table.count(value);
- }
-
- std::pair<Iterator, bool> insert(const ValueType& value)
- /// Inserts an element into the set.
- ///
- /// If the element already exists in the set,
- /// a pair(iterator, false) with iterator pointing to the
- /// existing element is returned.
- /// Otherwise, the element is inserted an a
- /// pair(iterator, true) with iterator
- /// pointing to the new element is returned.
- {
- return _table.insert(value);
- }
-
- void erase(Iterator it)
- /// Erases the element pointed to by it.
- {
- _table.erase(it);
- }
-
- void erase(const ValueType& value)
- /// Erases the element with the given value, if it exists.
- {
- _table.erase(value);
- }
-
- void clear()
- /// Erases all elements.
- {
- _table.clear();
- }
-
- std::size_t size() const
- /// Returns the number of elements in the table.
- {
- return _table.size();
- }
-
- bool empty() const
- /// Returns true iff the table is empty.
- {
- return _table.empty();
- }
-
-private:
- HashTable _table;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_HashSet_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/HashStatistic.h b/Utilities/Poco/Foundation/include/Poco/HashStatistic.h
deleted file mode 100755
index adcf68984c..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/HashStatistic.h
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// HashStatistic.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Hashing
-// Module: HashStatistic
-//
-// Definition of the HashStatistic class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_HashStatistic_INCLUDED
-#define Foundation_HashStatistic_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-//@ deprecated
-class Foundation_API HashStatistic
- /// HashStatistic class bundles statistical information on the current state of a HashTable
-{
-public:
- HashStatistic(
- UInt32 tableSize,
- UInt32 numEntries,
- UInt32 numZeroEntries,
- UInt32 maxEntry,
- std::vector<UInt32> details = std::vector<UInt32>());
- /// Creates the HashStatistic.
-
- virtual ~HashStatistic();
- /// Destroys the HashStatistic.
-
- UInt32 maxPositionsOfTable() const;
- /// Returns the maximum number of different hash values possible for the table
-
- UInt32 numberOfEntries() const;
- /// Returns the total number of entries currently stored in the HashTable
-
- UInt32 numberOfZeroPositions() const;
- /// Returns the number of hash positions that contain no entry.
-
- double avgEntriesPerHash() const;
- /// Returns the average number of entries per position in the Hashtable, the higher this value the less efficient
- /// performs hashing. If a large value is returned and getNumberOfZeroPositions also returns a large value, this
- /// indicates an inefficient hashing function. If the number of zero entries is low, resizing the HashTable, should
- /// be enough to improve performance
-
- double avgEntriesPerHashExclZeroEntries() const;
- /// Same as getAvgEntriesPerHash but hash values that contain no entry are ignored,
- /// getAvgEntriesPerHashExclZeroEntries >= getAvgEntriesPerHash will always be true.
-
- UInt32 maxEntriesPerHash() const;
- /// Returns the maximum number of entries per hash value found in the current table.
-
- const std::vector<UInt32> detailedEntriesPerHash() const;
- /// Will either be an empty vector or will contain for each possible hash value, the number of entries currently stored
-
- std::string toString() const;
- /// Converts the whole data structure into a string.
-
-private:
- UInt32 _sizeOfTable;
- UInt32 _numberOfEntries;
- UInt32 _numZeroEntries;
- UInt32 _maxEntriesPerHash;
- std::vector<UInt32> _detailedEntriesPerHash;
-};
-
-
-inline UInt32 HashStatistic::maxPositionsOfTable() const
-{
- return _sizeOfTable;
-}
-
-
-inline UInt32 HashStatistic::numberOfEntries() const
-{
- return _numberOfEntries;
-}
-
-
-inline UInt32 HashStatistic::numberOfZeroPositions() const
-{
- return _numZeroEntries;
-}
-
-
-inline double HashStatistic::avgEntriesPerHash() const
-{
- return ((double) numberOfEntries()) / maxPositionsOfTable();
-}
-
-
-inline double HashStatistic::avgEntriesPerHashExclZeroEntries() const
-{
- return ((double) numberOfEntries()) / (maxPositionsOfTable() - numberOfZeroPositions());
-}
-
-
-inline UInt32 HashStatistic::maxEntriesPerHash() const
-{
- return _maxEntriesPerHash;
-}
-
-
-inline const std::vector<UInt32> HashStatistic::detailedEntriesPerHash() const
-{
- return _detailedEntriesPerHash;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_HashStatistic_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/HashTable.h b/Utilities/Poco/Foundation/include/Poco/HashTable.h
deleted file mode 100755
index 77cba4debf..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/HashTable.h
+++ /dev/null
@@ -1,392 +0,0 @@
-//
-// HashTable.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Hashing
-// Module: HashTable
-//
-// Definition of the HashTable class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_HashTable_INCLUDED
-#define Foundation_HashTable_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include "Poco/HashFunction.h"
-#include "Poco/HashStatistic.h"
-#include <vector>
-#include <map>
-#include <cstddef>
-#include <cstring>
-
-
-namespace Poco {
-
-
-//@ deprecated
-template <class Key, class Value, class KeyHashFunction = HashFunction<Key> >
-class HashTable
- /// A HashTable stores a key value pair that can be looked up via a hashed key.
- ///
- /// Collision handling is done via overflow maps(!). With small hash tables performance of this
- /// data struct will be closer to that a map than a hash table, i.e. slower. On the plus side,
- /// this class offers remove operations. Also HashTable full errors are not possible. If a fast
- /// HashTable implementation is needed and the remove operation is not required, use SimpleHashTable
- /// instead.
- ///
- /// This class is NOT thread safe.
-{
-public:
- typedef std::map<Key, Value> HashEntryMap;
- typedef HashEntryMap** HashTableVector;
-
- typedef typename HashEntryMap::const_iterator ConstIterator;
- typedef typename HashEntryMap::iterator Iterator;
-
- HashTable(UInt32 initialSize = 251):
- _entries(0),
- _size(0),
- _maxCapacity(initialSize)
- /// Creates the HashTable.
- {
- _entries = new HashEntryMap*[initialSize];
- memset(_entries, '\0', sizeof(HashEntryMap*)*initialSize);
- }
-
- HashTable(const HashTable& ht):
- _entries(new HashEntryMap*[ht._maxCapacity]),
- _size(ht._size),
- _maxCapacity(ht._maxCapacity)
- {
- for (UInt32 i = 0; i < _maxCapacity; ++i)
- {
- if (ht._entries[i])
- _entries[i] = new HashEntryMap(ht._entries[i]->begin(), ht._entries[i]->end());
- else
- _entries[i] = 0;
- }
- }
-
- ~HashTable()
- /// Destroys the HashTable.
- {
- clear();
- }
-
- HashTable& operator = (const HashTable& ht)
- {
- if (this != &ht)
- {
- clear();
- _maxCapacity = ht._maxCapacity;
- poco_assert_dbg (_entries == 0);
- _entries = new HashEntryMap*[_maxCapacity];
- _size = ht._size;
-
- for (UInt32 i = 0; i < _maxCapacity; ++i)
- {
- if (ht._entries[i])
- _entries[i] = new HashEntryMap(ht._entries[i]->begin(), ht._entries[i]->end());
- else
- _entries[i] = 0;
- }
- }
- return *this;
- }
-
- void clear()
- {
- if (!_entries)
- return;
- for (UInt32 i = 0; i < _maxCapacity; ++i)
- {
- if (_entries[i])
- delete _entries[i];
- }
- delete[] _entries;
- _entries = 0;
- _size = 0;
- _maxCapacity = 0;
- }
-
- UInt32 insert(const Key& key, const Value& value)
- /// Returns the hash value of the inserted item.
- /// Throws an exception if the entry was already inserted
- {
- UInt32 hsh = hash(key);
- insertRaw(key, hsh, value);
- return hsh;
- }
-
- Value& insertRaw(const Key& key, UInt32 hsh, const Value& value)
- /// Returns the hash value of the inserted item.
- /// Throws an exception if the entry was already inserted
- {
- if (!_entries[hsh])
- _entries[hsh] = new HashEntryMap();
- std::pair<typename HashEntryMap::iterator, bool> res(_entries[hsh]->insert(std::make_pair(key, value)));
- if (!res.second)
- throw InvalidArgumentException("HashTable::insert, key already exists.");
- _size++;
- return res.first->second;
- }
-
- UInt32 update(const Key& key, const Value& value)
- /// Returns the hash value of the inserted item.
- /// Replaces an existing entry if it finds one
- {
- UInt32 hsh = hash(key);
- updateRaw(key, hsh, value);
- return hsh;
- }
-
- void updateRaw(const Key& key, UInt32 hsh, const Value& value)
- /// Returns the hash value of the inserted item.
- /// Replaces an existing entry if it finds one
- {
- if (!_entries[hsh])
- _entries[hsh] = new HashEntryMap();
- std::pair<Iterator, bool> res = _entries[hsh]->insert(std::make_pair(key, value));
- if (res.second == false)
- res.first->second = value;
- else
- _size++;
- }
-
- void remove(const Key& key)
- {
- UInt32 hsh = hash(key);
- removeRaw(key, hsh);
- }
-
- void removeRaw(const Key& key, UInt32 hsh)
- /// Performance version, allows to specify the hash value
- {
- if (_entries[hsh])
- {
- _size -= _entries[hsh]->erase(key);
- }
- }
-
- UInt32 hash(const Key& key) const
- {
- return _hash(key, _maxCapacity);
- }
-
- const Value& get(const Key& key) const
- /// Throws an exception if the value does not exist
- {
- UInt32 hsh = hash(key);
- return getRaw(key, hsh);
- }
-
- const Value& getRaw(const Key& key, UInt32 hsh) const
- /// Throws an exception if the value does not exist
- {
- if (!_entries[hsh])
- throw InvalidArgumentException("key not found");
-
- ConstIterator it = _entries[hsh]->find(key);
- if (it == _entries[hsh]->end())
- throw InvalidArgumentException("key not found");
-
- return it->second;
- }
-
- Value& get(const Key& key)
- /// Throws an exception if the value does not exist
- {
- UInt32 hsh = hash(key);
- return const_cast<Value&>(getRaw(key, hsh));
- }
-
- const Value& operator [] (const Key& key) const
- {
- return get(key);
- }
-
- Value& operator [] (const Key& key)
- {
- UInt32 hsh = hash(key);
-
- if (!_entries[hsh])
- return insertRaw(key, hsh, Value());
-
- ConstIterator it = _entries[hsh]->find(key);
- if (it == _entries[hsh]->end())
- return insertRaw(key, hsh, Value());
-
- return it->second;
- }
-
- const Key& getKeyRaw(const Key& key, UInt32 hsh)
- /// Throws an exception if the key does not exist. returns a reference to the internally
- /// stored key. Useful when someone does an insert and wants for performance reason only to store
- /// a pointer to the key in another collection
- {
- if (!_entries[hsh])
- throw InvalidArgumentException("key not found");
- ConstIterator it = _entries[hsh]->find(key);
- if (it == _entries[hsh]->end())
- throw InvalidArgumentException("key not found");
- return it->first;
- }
-
- bool get(const Key& key, Value& v) const
- /// Sets v to the found value, returns false if no value was found
- {
- UInt32 hsh = hash(key);
- return getRaw(key, hsh, v);
- }
-
- bool getRaw(const Key& key, UInt32 hsh, Value& v) const
- /// Sets v to the found value, returns false if no value was found
- {
- if (!_entries[hsh])
- return false;
-
- ConstIterator it = _entries[hsh]->find(key);
- if (it == _entries[hsh]->end())
- return false;
-
- v = it->second;
- return true;
- }
-
- bool exists(const Key& key)
- {
- UInt32 hsh = hash(key);
- return existsRaw(key, hsh);
- }
-
- bool existsRaw(const Key& key, UInt32 hsh)
- {
- return _entries[hsh] && (_entries[hsh]->end() != _entries[hsh]->find(key));
- }
-
- std::size_t size() const
- /// Returns the number of elements already inserted into the HashTable
- {
- return _size;
- }
-
- UInt32 maxCapacity() const
- {
- return _maxCapacity;
- }
-
- void resize(UInt32 newSize)
- /// Resizes the hashtable, rehashes all existing entries. Expensive!
- {
- if (_maxCapacity != newSize)
- {
- HashTableVector cpy = _entries;
- _entries = 0;
- UInt32 oldSize = _maxCapacity;
- _maxCapacity = newSize;
- _entries = new HashEntryMap*[_maxCapacity];
- memset(_entries, '\0', sizeof(HashEntryMap*)*_maxCapacity);
-
- if (_size == 0)
- {
- // no data was yet inserted
- delete[] cpy;
- return;
- }
- _size = 0;
- for (UInt32 i = 0; i < oldSize; ++i)
- {
- if (cpy[i])
- {
- ConstIterator it = cpy[i]->begin();
- ConstIterator itEnd = cpy[i]->end();
- for (; it != itEnd; ++it)
- {
- insert(it->first, it->second);
- }
- delete cpy[i];
- }
- }
- delete[] cpy;
- }
- }
-
- HashStatistic currentState(bool details = false) const
- /// Returns the current internal state
- {
- UInt32 numberOfEntries = (UInt32)_size;
- UInt32 numZeroEntries = 0;
- UInt32 maxEntriesPerHash = 0;
- std::vector<UInt32> detailedEntriesPerHash;
- #ifdef DEBUG
- UInt32 totalSize = 0;
- #endif
- for (UInt32 i = 0; i < _maxCapacity; ++i)
- {
- if (_entries[i])
- {
- UInt32 size = (UInt32)_entries[i]->size();
- poco_assert_dbg(size != 0);
- if (size > maxEntriesPerHash)
- maxEntriesPerHash = size;
- if (details)
- detailedEntriesPerHash.push_back(size);
- #ifdef DEBUG
- totalSize += size;
- #endif
- }
- else
- {
- numZeroEntries++;
- if (details)
- detailedEntriesPerHash.push_back(0);
- }
- }
- #ifdef DEBUG
- poco_assert_dbg(totalSize == numberOfEntries);
- #endif
- return HashStatistic(_maxCapacity, numberOfEntries, numZeroEntries, maxEntriesPerHash, detailedEntriesPerHash);
- }
-
-private:
- HashTableVector _entries;
- std::size_t _size;
- UInt32 _maxCapacity;
- KeyHashFunction _hash;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_HashTable_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/HexBinaryDecoder.h b/Utilities/Poco/Foundation/include/Poco/HexBinaryDecoder.h
deleted file mode 100755
index fa86c286cb..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/HexBinaryDecoder.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// HexBinaryDecoder.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: HexBinary
-//
-// Definition of the HexBinaryDecoder class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_HexBinaryDecoder_INCLUDED
-#define Foundation_HexBinaryDecoder_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnbufferedStreamBuf.h"
-#include <istream>
-
-
-namespace Poco {
-
-
-class Foundation_API HexBinaryDecoderBuf: public UnbufferedStreamBuf
- /// This streambuf decodes all hexBinary-encoded data read
- /// from the istream connected to it.
- /// In hexBinary encoding, each binary octet is encoded as a character tuple,
- /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code.
- /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/),
- /// section 3.2.15.
-{
-public:
- HexBinaryDecoderBuf(std::istream& istr);
- ~HexBinaryDecoderBuf();
-
-private:
- int readFromDevice();
- int readOne();
-
- std::istream& _istr;
-};
-
-
-class Foundation_API HexBinaryDecoderIOS: public virtual std::ios
- /// The base class for HexBinaryDecoder.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- HexBinaryDecoderIOS(std::istream& istr);
- ~HexBinaryDecoderIOS();
- HexBinaryDecoderBuf* rdbuf();
-
-protected:
- HexBinaryDecoderBuf _buf;
-};
-
-
-class Foundation_API HexBinaryDecoder: public HexBinaryDecoderIOS, public std::istream
- /// This istream decodes all hexBinary-encoded data read
- /// from the istream connected to it.
- /// In hexBinary encoding, each binary octet is encoded as a character tuple,
- /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code.
- /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/),
- /// section 3.2.15.
-{
-public:
- HexBinaryDecoder(std::istream& istr);
- ~HexBinaryDecoder();
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_HexBinaryDecoder_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/HexBinaryEncoder.h b/Utilities/Poco/Foundation/include/Poco/HexBinaryEncoder.h
deleted file mode 100755
index f226c02763..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/HexBinaryEncoder.h
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// HexBinaryEncoder.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: HexBinary
-//
-// Definition of the HexBinaryEncoder class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_HexBinaryEncoder_INCLUDED
-#define Foundation_HexBinaryEncoder_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnbufferedStreamBuf.h"
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API HexBinaryEncoderBuf: public UnbufferedStreamBuf
- /// This streambuf encodes all data written
- /// to it in hexBinary encoding and forwards it to a connected
- /// ostream.
- /// In hexBinary encoding, each binary octet is encoded as a character tuple,
- /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code.
- /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/),
- /// section 3.2.15.
-{
-public:
- HexBinaryEncoderBuf(std::ostream& ostr);
- ~HexBinaryEncoderBuf();
-
- int close();
- /// Closes the stream buffer.
-
- void setLineLength(int lineLength);
- /// Specify the line length.
- ///
- /// After the given number of characters have been written,
- /// a newline character will be written.
- ///
- /// Specify 0 for an unlimited line length.
-
- int getLineLength() const;
- /// Returns the currently set line length.
-
- void setUppercase(bool flag = true);
- /// Specify whether hex digits a-f are written in upper or lower case.
-
-private:
- int writeToDevice(char c);
-
- int _pos;
- int _lineLength;
- int _uppercase;
- std::ostream& _ostr;
-};
-
-
-class Foundation_API HexBinaryEncoderIOS: public virtual std::ios
- /// The base class for HexBinaryEncoder.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- HexBinaryEncoderIOS(std::ostream& ostr);
- ~HexBinaryEncoderIOS();
- int close();
- HexBinaryEncoderBuf* rdbuf();
-
-protected:
- HexBinaryEncoderBuf _buf;
-};
-
-
-class Foundation_API HexBinaryEncoder: public HexBinaryEncoderIOS, public std::ostream
- /// This ostream encodes all data
- /// written to it in BinHex encoding and forwards it to
- /// a connected ostream.
- /// Always call close() when done
- /// writing data, to ensure proper
- /// completion of the encoding operation.
- /// In hexBinary encoding, each binary octet is encoded as a character tuple,
- /// consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code.
- /// See also: XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/),
- /// section 3.2.15.
-{
-public:
- HexBinaryEncoder(std::ostream& ostr);
- ~HexBinaryEncoder();
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_HexBinaryEncoder_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/InflatingStream.h b/Utilities/Poco/Foundation/include/Poco/InflatingStream.h
deleted file mode 100755
index db49ac4d42..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/InflatingStream.h
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// InflatingStream.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: ZLibStream
-//
-// Definition of the InflatingInputStream and InflatingOutputStream classes.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_InflatingStream_INCLUDED
-#define Foundation_InflatingStream_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/BufferedStreamBuf.h"
-#include <istream>
-#include <ostream>
-#include "Poco/zlib.h"
-
-
-namespace Poco {
-
-
-class Foundation_API InflatingStreamBuf: public BufferedStreamBuf
- /// This is the streambuf class used by InflatingInputStream and InflatingOutputStream.
- /// The actual work is delegated to zlib 1.2.1 (see http://www.gzip.org).
- /// Both zlib (deflate) streams and gzip streams are supported.
- /// Output streams should always call close() to ensure
- /// proper completion of decompression.
-{
-public:
- enum StreamType
- {
- STREAM_ZLIB,
- STREAM_GZIP,
- STREAM_ZIP // ZIP is handled as STREAM_ZLIB, except that we do not check the ADLER32 value (must be checked by an outside class!)
- };
-
- InflatingStreamBuf(std::istream& istr, StreamType type);
- InflatingStreamBuf(std::ostream& ostr, StreamType type);
- ~InflatingStreamBuf();
- int close();
-
-protected:
- int readFromDevice(char* buffer, std::streamsize length);
- int writeToDevice(const char* buffer, std::streamsize length);
-
-private:
- enum
- {
- STREAM_BUFFER_SIZE = 1024,
- INFLATE_BUFFER_SIZE = 32768
- };
-
- std::istream* _pIstr;
- std::ostream* _pOstr;
- char* _buffer;
- z_stream _zstr;
- bool _eof;
- bool _check;
-};
-
-
-class Foundation_API InflatingIOS: public virtual std::ios
- /// The base class for InflatingOutputStream and InflatingInputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- InflatingIOS(std::ostream& ostr, InflatingStreamBuf::StreamType type = InflatingStreamBuf::STREAM_ZLIB);
- InflatingIOS(std::istream& istr, InflatingStreamBuf::StreamType type = InflatingStreamBuf::STREAM_ZLIB);
- ~InflatingIOS();
- InflatingStreamBuf* rdbuf();
-
-protected:
- InflatingStreamBuf _buf;
-};
-
-
-class Foundation_API InflatingOutputStream: public InflatingIOS, public std::ostream
- /// This stream decompresses all data passing through it
- /// using zlib's inflate algorithm.
- /// After all data has been written to the stream, close()
- /// must be called to ensure completion of decompression.
-{
-public:
- InflatingOutputStream(std::ostream& ostr, InflatingStreamBuf::StreamType type = InflatingStreamBuf::STREAM_ZLIB);
- ~InflatingOutputStream();
- int close();
-};
-
-
-class Foundation_API InflatingInputStream: public InflatingIOS, public std::istream
- /// This stream decompresses all data passing through it
- /// using zlib's inflate algorithm.
- /// Example:
- /// std::ifstream istr("data.gz", std::ios::binary);
- /// InflatingInputStream inflater(istr, InflatingStreamBuf::STREAM_GZIP);
- /// std::string data;
- /// istr >> data;
-{
-public:
- InflatingInputStream(std::istream& istr, InflatingStreamBuf::StreamType type = InflatingStreamBuf::STREAM_ZLIB);
- ~InflatingInputStream();
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_InflatingStream_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Instantiator.h b/Utilities/Poco/Foundation/include/Poco/Instantiator.h
deleted file mode 100755
index d57e086729..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Instantiator.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// Instantiator.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Instantiator
-//
-// Definition of the Instantiator class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Instantiator_INCLUDED
-#define Foundation_Instantiator_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-template <class Base>
-class AbstractInstantiator
- /// The common base class for all Instantiator instantiations.
- /// Used by DynamicFactory.
-{
-public:
- AbstractInstantiator()
- /// Creates the AbstractInstantiator.
- {
- }
-
- virtual ~AbstractInstantiator()
- /// Destroys the AbstractInstantiator.
- {
- }
-
- virtual Base* createInstance() const = 0;
- /// Creates an instance of a concrete subclass of Base.
-
-private:
- AbstractInstantiator(const AbstractInstantiator&);
- AbstractInstantiator& operator = (const AbstractInstantiator&);
-};
-
-
-template <class C, class Base>
-class Instantiator: public AbstractInstantiator<Base>
- /// A template class for the easy instantiation of
- /// instantiators.
- ///
- /// For the Instantiator to work, the class of which
- /// instances are to be instantiated must have a no-argument
- /// constructor.
-{
-public:
- Instantiator()
- /// Creates the Instantiator.
- {
- }
-
- virtual ~Instantiator()
- /// Destroys the Instantiator.
- {
- }
-
- Base* createInstance() const
- {
- return new C;
- }
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Instantiator_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/KeyValueArgs.h b/Utilities/Poco/Foundation/include/Poco/KeyValueArgs.h
deleted file mode 100755
index 908ef4390b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/KeyValueArgs.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// KeyValueArgs.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: KeyValueArgs
-//
-// Definition of the KeyValueArgs class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_KeyValueArgs_INCLUDED
-#define Foundation_KeyValueArgs_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-template <class TKey, class TValue>
-class KeyValueArgs
- /// Simply event arguments class to transfer a key and a value via an event call.
- /// Note that key and value are *NOT* copied, only references to them are stored.
-{
-public:
- KeyValueArgs(const TKey& aKey, const TValue& aVal):
- _key(aKey),
- _value(aVal)
- {
- }
-
- KeyValueArgs(const KeyValueArgs& args):
- _key(args._key),
- _value(args._value)
- {
- }
-
- ~KeyValueArgs()
- {
- }
-
- const TKey& key() const
- /// Returns a reference to the key,
- {
- return _key;
- }
-
- const TValue& value() const
- /// Returns a Reference to the value.
- {
- return _value;
- }
-
-protected:
- const TKey& _key;
- const TValue& _value;
-
-private:
- KeyValueArgs& operator = (const KeyValueArgs& args);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/LRUCache.h b/Utilities/Poco/Foundation/include/Poco/LRUCache.h
deleted file mode 100755
index 65e568abde..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LRUCache.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// LRUCache.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: LRUCache
-//
-// Definition of the LRUCache class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_LRUCache_INCLUDED
-#define Foundation_LRUCache_INCLUDED
-
-
-#include "Poco/AbstractCache.h"
-#include "Poco/LRUStrategy.h"
-
-
-namespace Poco {
-
-
-template <class TKey, class TValue>
-class LRUCache: public AbstractCache<TKey, TValue, LRUStrategy<TKey, TValue> >
- /// An LRUCache implements Least Recently Used caching. The default size for a cache is 1024 entries
-{
-public:
- LRUCache(long size = 1024):
- AbstractCache<TKey, TValue, LRUStrategy<TKey, TValue> >(LRUStrategy<TKey, TValue>(size))
- {
- }
-
- ~LRUCache()
- {
- }
-
-private:
- LRUCache(const LRUCache& aCache);
- LRUCache& operator = (const LRUCache& aCache);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/LRUStrategy.h b/Utilities/Poco/Foundation/include/Poco/LRUStrategy.h
deleted file mode 100755
index 445af4d07d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LRUStrategy.h
+++ /dev/null
@@ -1,162 +0,0 @@
-//
-// LRUStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: LRUStrategy
-//
-// Definition of the LRUStrategy class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_LRUStrategy_INCLUDED
-#define Foundation_LRUStrategy_INCLUDED
-
-
-#include "Poco/KeyValueArgs.h"
-#include "Poco/ValidArgs.h"
-#include "Poco/AbstractStrategy.h"
-#include "Poco/EventArgs.h"
-#include "Poco/Exception.h"
-#include <list>
-#include <map>
-#include <cstddef>
-
-
-namespace Poco {
-
-
-template <class TKey, class TValue>
-class LRUStrategy: public AbstractStrategy<TKey, TValue>
- /// An LRUStrategy implements least recently used cache replacement.
-{
-public:
- typedef std::list<TKey> Keys;
- typedef typename Keys::iterator Iterator;
- typedef typename Keys::const_iterator ConstIterator;
- typedef std::map<TKey, Iterator> KeyIndex;
- typedef typename KeyIndex::iterator IndexIterator;
- typedef typename KeyIndex::const_iterator ConstIndexIterator;
-
-public:
- LRUStrategy(std::size_t size):
- _size(size)
- {
- if (_size < 1) throw InvalidArgumentException("size must be > 0");
- }
-
- ~LRUStrategy()
- {
- }
-
- void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args)
- {
- _keys.push_front(args.key());
- std::pair<IndexIterator, bool> stat = _keyIndex.insert(std::make_pair(args.key(), _keys.begin()));
- if (!stat.second)
- {
- stat.first->second = _keys.begin();
- }
- }
-
- void onRemove(const void*, const TKey& key)
- {
- IndexIterator it = _keyIndex.find(key);
-
- if (it != _keyIndex.end())
- {
- _keys.erase(it->second);
- _keyIndex.erase(it);
- }
- }
-
- void onGet(const void*, const TKey& key)
- {
- // LRU: in case of an hit, move to begin
- IndexIterator it = _keyIndex.find(key);
-
- if (it != _keyIndex.end())
- {
- _keys.splice(_keys.begin(), _keys, it->second); //_keys.erase(it->second)+_keys.push_front(key);
- it->second = _keys.begin();
- }
- }
-
- void onClear(const void*, const EventArgs& /*args*/)
- {
- _keys.clear();
- _keyIndex.clear();
- }
-
- void onIsValid(const void*, ValidArgs<TKey>& args)
- {
- if (_keyIndex.find(args.key()) == _keyIndex.end())
- {
- args.invalidate();
- }
- }
-
- void onReplace(const void*, std::set<TKey>& elemsToRemove)
- {
- // Note: replace only informs the cache which elements
- // it would like to remove!
- // it does not remove them on its own!
- std::size_t curSize = _keyIndex.size();
-
- if (curSize < _size)
- {
- return;
- }
-
- std::size_t diff = curSize - _size;
- Iterator it = --_keys.end(); //--keys can never be invoked on an empty list due to the minSize==1 requirement of LRU
- std::size_t i = 0;
-
- while (i++ < diff)
- {
- elemsToRemove.insert(*it);
- if (it != _keys.begin())
- {
- --it;
- }
- }
- }
-
-protected:
- std::size_t _size; /// Number of keys the cache can store.
- Keys _keys;
- KeyIndex _keyIndex; /// For faster access to _keys
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/Latin1Encoding.h b/Utilities/Poco/Foundation/include/Poco/Latin1Encoding.h
deleted file mode 100755
index 60d9f3b6ba..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Latin1Encoding.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// Latin1Encoding.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: Latin1Encoding
-//
-// Definition of the Latin1Encoding class.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_Latin1Encoding_INCLUDED
-#define Foundation_Latin1Encoding_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/TextEncoding.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Latin1Encoding: public TextEncoding
- /// ISO Latin-1 (8859-1) text encoding.
-{
-public:
- Latin1Encoding();
- ~Latin1Encoding();
- const char* canonicalName() const;
- bool isA(const std::string& encodingName) const;
- const CharacterMap& characterMap() const;
- int convert(const unsigned char* bytes) const;
- int convert(int ch, unsigned char* bytes, int length) const;
-
-private:
- static const char* _names[];
- static const CharacterMap _charMap;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Latin1Encoding_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Latin9Encoding.h b/Utilities/Poco/Foundation/include/Poco/Latin9Encoding.h
deleted file mode 100755
index 44ad9cf92a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Latin9Encoding.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// Latin9Encoding.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: Latin9Encoding
-//
-// Definition of the Latin9Encoding class.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_Latin9Encoding_INCLUDED
-#define Foundation_Latin9Encoding_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/TextEncoding.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Latin9Encoding: public TextEncoding
- /// ISO Latin-9 (8859-15) text encoding.
- ///
- /// Latin-9 is basically Latin-1 with the EURO sign plus
- /// some other minor changes.
-{
-public:
- Latin9Encoding();
- ~Latin9Encoding();
- const char* canonicalName() const;
- bool isA(const std::string& encodingName) const;
- const CharacterMap& characterMap() const;
- int convert(const unsigned char* bytes) const;
- int convert(int ch, unsigned char* bytes, int length) const;
-
-private:
- static const char* _names[];
- static const CharacterMap _charMap;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Latin9Encoding_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LineEndingConverter.h b/Utilities/Poco/Foundation/include/Poco/LineEndingConverter.h
deleted file mode 100755
index c63c5c2cef..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LineEndingConverter.h
+++ /dev/null
@@ -1,203 +0,0 @@
-//
-// LineEndingConverter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: LineEndingConverter
-//
-// Definition of the LineEndingConverter class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef Foundation_LineEndingConverter_INCLUDED
-#define Foundation_LineEndingConverter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnbufferedStreamBuf.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API LineEnding
- /// This class defines valid line ending sequences
- /// for InputLineEndingConverter and OutputLineEndingConverter.
-{
-public:
- static const std::string NEWLINE_DEFAULT;
- static const std::string NEWLINE_CR;
- static const std::string NEWLINE_CRLF;
- static const std::string NEWLINE_LF;
-};
-
-
-class Foundation_API LineEndingConverterStreamBuf: public UnbufferedStreamBuf
- /// This stream buffer performs line ending conversion
- /// on text streams. The converter can convert from and to
- /// the Unix (LF), Mac (CR) and DOS/Windows/Network (CF-LF) endings.
- ///
- /// Any newline sequence in the source will be replaced by the
- /// target newline sequence.
-{
-public:
- LineEndingConverterStreamBuf(std::istream& istr);
- /// Creates the LineEndingConverterStreamBuf and connects it
- /// to the given input stream.
-
- LineEndingConverterStreamBuf(std::ostream& ostr);
- /// Creates the LineEndingConverterStreamBuf and connects it
- /// to the given output stream.
-
- ~LineEndingConverterStreamBuf();
- /// Destroys the LineEndingConverterStream.
-
- void setNewLine(const std::string& newLineCharacters);
- /// Sets the target line ending for the converter.
- ///
- /// Possible values are:
- /// * NEWLINE_DEFAULT (whatever is appropriate for the current platform)
- /// * NEWLINE_CRLF (Windows),
- /// * NEWLINE_LF (Unix),
- /// * NEWLINE_CR (Macintosh)
- ///
- /// In theory, any character sequence can be used as newline sequence.
- /// In practice, however, only the above three make sense.
-
- const std::string& getNewLine() const;
- /// Returns the line ending currently in use.
-
-protected:
- int readFromDevice();
- int writeToDevice(char c);
-
-private:
- std::istream* _pIstr;
- std::ostream* _pOstr;
- std::string _newLine;
- std::string::const_iterator _it;
- char _lastChar;
-};
-
-
-class Foundation_API LineEndingConverterIOS: public virtual std::ios
- /// The base class for InputLineEndingConverter and OutputLineEndingConverter.
- ///
- /// This class provides common methods and is also needed to ensure
- /// the correct initialization order of the stream buffer and base classes.
-{
-public:
- LineEndingConverterIOS(std::istream& istr);
- /// Creates the LineEndingConverterIOS and connects it
- /// to the given input stream.
-
- LineEndingConverterIOS(std::ostream& ostr);
- /// Creates the LineEndingConverterIOS and connects it
- /// to the given output stream.
-
- ~LineEndingConverterIOS();
- /// Destroys the stream.
-
- void setNewLine(const std::string& newLineCharacters);
- /// Sets the target line ending for the converter.
- ///
- /// Possible values are:
- /// * NEWLINE_DEFAULT (whatever is appropriate for the current platform)
- /// * NEWLINE_CRLF (Windows),
- /// * NEWLINE_LF (Unix),
- /// * NEWLINE_CR (Macintosh)
- ///
- /// In theory, any character sequence can be used as newline sequence.
- /// In practice, however, only the above three make sense.
- ///
- /// If an empty string is given, all newline characters are removed from
- /// the stream.
-
- const std::string& getNewLine() const;
- /// Returns the line ending currently in use.
-
- LineEndingConverterStreamBuf* rdbuf();
- /// Returns a pointer to the underlying streambuf.
-
-protected:
- LineEndingConverterStreamBuf _buf;
-};
-
-
-class Foundation_API InputLineEndingConverter: public LineEndingConverterIOS, public std::istream
- /// InputLineEndingConverter performs line ending conversion
- /// on text input streams. The converter can convert from and to
- /// the Unix (LF), Mac (CR) and DOS/Windows/Network (CF-LF) endings.
- ///
- /// Any newline sequence in the source will be replaced by the
- /// target newline sequence.
-{
-public:
- InputLineEndingConverter(std::istream& istr);
- /// Creates the LineEndingConverterInputStream and connects it
- /// to the given input stream.
-
- InputLineEndingConverter(std::istream& istr, const std::string& newLineCharacters);
- /// Creates the LineEndingConverterInputStream and connects it
- /// to the given input stream.
-
- ~InputLineEndingConverter();
- /// Destroys the stream.
-};
-
-
-class Foundation_API OutputLineEndingConverter: public LineEndingConverterIOS, public std::ostream
- /// OutputLineEndingConverter performs line ending conversion
- /// on text output streams. The converter can convert from and to
- /// the Unix (LF), Mac (CR) and DOS/Windows/Network (CF-LF) endings.
- ///
- /// Any newline sequence in the source will be replaced by the
- /// target newline sequence.
-{
-public:
- OutputLineEndingConverter(std::ostream& ostr);
- /// Creates the LineEndingConverterOutputStream and connects it
- /// to the given input stream.
-
- OutputLineEndingConverter(std::ostream& ostr, const std::string& newLineCharacters);
- /// Creates the LineEndingConverterOutputStream and connects it
- /// to the given input stream.
-
- ~OutputLineEndingConverter();
- /// Destroys the LineEndingConverterOutputStream.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LineEndingConverter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LinearHashTable.h b/Utilities/Poco/Foundation/include/Poco/LinearHashTable.h
deleted file mode 100755
index 8833dc1ffe..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LinearHashTable.h
+++ /dev/null
@@ -1,492 +0,0 @@
-//
-// LinearHashTable.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Hashing
-// Module: LinearHashTable
-//
-// Definition of the LinearHashTable class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_LinearHashTable_INCLUDED
-#define Foundation_LinearHashTable_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Hash.h"
-#include <functional>
-#include <algorithm>
-#include <vector>
-#include <utility>
-#include <cstddef>
-
-
-namespace Poco {
-
-
-template <class Value, class HashFunc = Hash<Value> >
-class LinearHashTable
- /// This class implements a linear hash table.
- ///
- /// In a linear hash table, the available address space
- /// grows or shrinks dynamically. A linar hash table thus
- /// supports any number of insertions or deletions without
- /// lookup or insertion performance deterioration.
- ///
- /// Linear hashing was discovered by Witold Litwin in 1980
- /// and described in the paper LINEAR HASHING: A NEW TOOL FOR FILE AND TABLE ADDRESSING.
- ///
- /// For more information on linear hashing, see <http://en.wikipedia.org/wiki/Linear_hash>.
- ///
- /// The LinearHashTable is not thread safe.
- ///
- /// Value must support comparison for equality.
- ///
- /// Find, insert and delete operations are basically O(1) with regard
- /// to the total number of elements in the table, and O(N) with regard
- /// to the number of elements in the bucket where the element is stored.
- /// On average, every bucket stores one element; the exact number depends
- /// on the quality of the hash function. In most cases, the maximum number of
- /// elements in a bucket should not exceed 3.
-{
-public:
- typedef Value ValueType;
- typedef Value& Reference;
- typedef const Value& ConstReference;
- typedef Value* Pointer;
- typedef const Value* ConstPointer;
- typedef HashFunc Hash;
- typedef std::vector<Value> Bucket;
- typedef std::vector<Bucket> BucketVec;
- typedef typename Bucket::iterator BucketIterator;
- typedef typename BucketVec::iterator BucketVecIterator;
-
- class ConstIterator: public std::iterator<std::forward_iterator_tag, Value>
- {
- public:
- ConstIterator()
- {
- }
-
- ConstIterator(const BucketVecIterator& vecIt, const BucketVecIterator& endIt, const BucketIterator& buckIt):
- _vecIt(vecIt),
- _endIt(endIt),
- _buckIt(buckIt)
- {
- }
-
- ConstIterator(const ConstIterator& it):
- _vecIt(it._vecIt),
- _endIt(it._endIt),
- _buckIt(it._buckIt)
- {
- }
-
- ConstIterator& operator = (const ConstIterator& it)
- {
- ConstIterator tmp(it);
- swap(tmp);
- return *this;
- }
-
- void swap(ConstIterator& it)
- {
- using std::swap;
- swap(_vecIt, it._vecIt);
- swap(_endIt, it._endIt);
- swap(_buckIt, it._buckIt);
- }
-
- bool operator == (const ConstIterator& it) const
- {
- return _vecIt == it._vecIt && (_vecIt == _endIt || _buckIt == it._buckIt);
- }
-
- bool operator != (const ConstIterator& it) const
- {
- return _vecIt != it._vecIt || (_vecIt != _endIt && _buckIt != it._buckIt);
- }
-
- const typename Bucket::value_type& operator * () const
- {
- return *_buckIt;
- }
-
- const typename Bucket::value_type* operator -> () const
- {
- return &*_buckIt;
- }
-
- ConstIterator& operator ++ () // prefix
- {
- if (_vecIt != _endIt)
- {
- ++_buckIt;
- while (_vecIt != _endIt && _buckIt == _vecIt->end())
- {
- ++_vecIt;
- if (_vecIt != _endIt) _buckIt = _vecIt->begin();
- }
- }
- return *this;
- }
-
- ConstIterator operator ++ (int) // postfix
- {
- ConstIterator tmp(*this);
- ++*this;
- return tmp;
- }
-
- protected:
- BucketVecIterator _vecIt;
- BucketVecIterator _endIt;
- BucketIterator _buckIt;
-
- friend class LinearHashTable;
- };
-
- class Iterator: public ConstIterator
- {
- public:
- Iterator()
- {
- }
-
- Iterator(const BucketVecIterator& vecIt, const BucketVecIterator& endIt, const BucketIterator& buckIt):
- ConstIterator(vecIt, endIt, buckIt)
- {
- }
-
- Iterator(const Iterator& it):
- ConstIterator(it)
- {
- }
-
- Iterator& operator = (const Iterator& it)
- {
- Iterator tmp(it);
- swap(tmp);
- return *this;
- }
-
- void swap(Iterator& it)
- {
- ConstIterator::swap(it);
- }
-
- typename Bucket::value_type& operator * ()
- {
- return *this->_buckIt;
- }
-
- const typename Bucket::value_type& operator * () const
- {
- return *this->_buckIt;
- }
-
- typename Bucket::value_type* operator -> ()
- {
- return &*this->_buckIt;
- }
-
- const typename Bucket::value_type* operator -> () const
- {
- return &*this->_buckIt;
- }
-
- Iterator& operator ++ () // prefix
- {
- ConstIterator::operator ++ ();
- return *this;
- }
-
- Iterator operator ++ (int) // postfix
- {
- Iterator tmp(*this);
- ++*this;
- return tmp;
- }
-
- friend class LinearHashTable;
- };
-
- LinearHashTable(std::size_t initialReserve = 64):
- _split(0),
- _front(1),
- _size(0)
- /// Creates the LinearHashTable, using the given initialReserve.
- {
- _buckets.reserve(calcSize(initialReserve));
- _buckets.push_back(Bucket());
- }
-
- LinearHashTable(const LinearHashTable& table):
- _buckets(table._buckets),
- _split(table._split),
- _front(table._front),
- _size(table._size)
- /// Creates the LinearHashTable by copying another one.
- {
- }
-
- ~LinearHashTable()
- /// Destroys the LinearHashTable.
- {
- }
-
- LinearHashTable& operator = (const LinearHashTable& table)
- /// Assigns another LinearHashTable.
- {
- LinearHashTable tmp(table);
- swap(tmp);
- return *this;
- }
-
- void swap(LinearHashTable& table)
- /// Swaps the LinearHashTable with another one.
- {
- using std::swap;
- swap(_buckets, table._buckets);
- swap(_split, table._split);
- swap(_front, table._front);
- swap(_size, table._size);
- }
-
- ConstIterator begin() const
- /// Returns an iterator pointing to the first entry, if one exists.
- {
- BucketVecIterator it(_buckets.begin());
- BucketVecIterator end(_buckets.end());
- while (it != end && it->empty())
- {
- ++it;
- }
- if (it == end)
- return this->end();
- else
- return ConstIterator(it, end, it->begin());
- }
-
- ConstIterator end() const
- /// Returns an iterator pointing to the end of the table.
- {
- return ConstIterator(_buckets.end(), _buckets.end(), _buckets.front().end());
- }
-
- Iterator begin()
- /// Returns an iterator pointing to the first entry, if one exists.
- {
- BucketVecIterator it(_buckets.begin());
- BucketVecIterator end(_buckets.end());
- while (it != end && it->empty())
- {
- ++it;
- }
- if (it == end)
- return this->end();
- else
- return Iterator(it, end, it->begin());
- }
-
- Iterator end()
- /// Returns an iterator pointing to the end of the table.
- {
- return Iterator(_buckets.end(), _buckets.end(), _buckets.front().end());
- }
-
- ConstIterator find(const Value& value) const
- /// Finds an entry in the table.
- {
- std::size_t addr = bucketAddress(value);
- BucketVecIterator it(_buckets.begin() + addr);
- BucketIterator buckIt(std::find(it->begin(), it->end(), value));
- if (buckIt != it->end())
- return ConstIterator(it, _buckets.end(), buckIt);
- else
- return end();
- }
-
- Iterator find(const Value& value)
- /// Finds an entry in the table.
- {
- std::size_t addr = bucketAddress(value);
- BucketVecIterator it(_buckets.begin() + addr);
- BucketIterator buckIt(std::find(it->begin(), it->end(), value));
- if (buckIt != it->end())
- return Iterator(it, _buckets.end(), buckIt);
- else
- return end();
- }
-
- std::size_t count(const Value& value) const
- /// Returns the number of elements with the given
- /// value, with is either 1 or 0.
- {
- return find(value) != end() ? 1 : 0;
- }
-
- std::pair<Iterator, bool> insert(const Value& value)
- /// Inserts an element into the table.
- ///
- /// If the element already exists in the table,
- /// a pair(iterator, false) with iterator pointing to the
- /// existing element is returned.
- /// Otherwise, the element is inserted an a
- /// pair(iterator, true) with iterator
- /// pointing to the new element is returned.
- {
- split();
- std::size_t addr = bucketAddress(value);
- BucketVecIterator it(_buckets.begin() + addr);
- BucketIterator buckIt(std::find(it->begin(), it->end(), value));
- if (buckIt == it->end())
- {
- buckIt = it->insert(buckIt, value);
- ++_size;
- return std::make_pair(Iterator(it, _buckets.end(), buckIt), true);
- }
- else
- {
- return std::make_pair(Iterator(it, _buckets.end(), buckIt), false);
- }
- }
-
- void erase(Iterator it)
- /// Erases the element pointed to by it.
- {
- if (it != end())
- {
- it._vecIt->erase(it._buckIt);
- --_size;
- merge();
- }
- }
-
- void erase(const Value& value)
- /// Erases the element with the given value, if it exists.
- {
- Iterator it = find(value);
- erase(it);
- }
-
- void clear()
- /// Erases all elements.
- {
- LinearHashTable empty;
- swap(empty);
- }
-
- std::size_t size() const
- /// Returns the number of elements in the table.
- {
- return _size;
- }
-
- bool empty() const
- /// Returns true iff the table is empty.
- {
- return _size == 0;
- }
-
-protected:
- std::size_t bucketAddress(const Value& value) const
- {
- std::size_t n = _hash(value);
- if (n % _front >= _split)
- return n % _front;
- else
- return n % (2*_front);
- }
-
- void split()
- {
- if (_split == _front)
- {
- _split = 0;
- _front *= 2;
- _buckets.reserve(_front*2);
- }
- Bucket tmp;
- _buckets.push_back(tmp);
- _buckets[_split].swap(tmp);
- ++_split;
- for (BucketIterator it = tmp.begin(); it != tmp.end(); ++it)
- {
- using std::swap;
- std::size_t addr = bucketAddress(*it);
- _buckets[addr].push_back(Value());
- swap(*it, _buckets[addr].back());
- }
- }
-
- void merge()
- {
- if (_split == 0)
- {
- _front /= 2;
- _split = _front;
- }
- --_split;
- Bucket tmp;
- tmp.swap(_buckets.back());
- _buckets.pop_back();
- for (BucketIterator it = tmp.begin(); it != tmp.end(); ++it)
- {
- using std::swap;
- std::size_t addr = bucketAddress(*it);
- _buckets[addr].push_back(Value());
- swap(*it, _buckets[addr].back());
- }
- }
-
- static std::size_t calcSize(std::size_t initialSize)
- {
- std::size_t size = 32;
- while (size < initialSize) size *= 2;
- return size;
- }
-
-private:
- // Evil hack: _buckets must be mutable because both ConstIterator and Iterator hold
- // ordinary iterator's (not const_iterator's).
- mutable BucketVec _buckets;
- std::size_t _split;
- std::size_t _front;
- std::size_t _size;
- HashFunc _hash;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LinearHashTable_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LocalDateTime.h b/Utilities/Poco/Foundation/include/Poco/LocalDateTime.h
deleted file mode 100755
index 5f7edc223b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LocalDateTime.h
+++ /dev/null
@@ -1,405 +0,0 @@
-//
-// LocalDateTime.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: LocalDateTime
-//
-// Definition of the LocalDateTime class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_LocalDateTime_INCLUDED
-#define Foundation_LocalDateTime_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DateTime.h"
-
-
-namespace Poco {
-
-
-class Foundation_API LocalDateTime
- /// This class represents an instant in local time
- /// (as opposed to UTC), expressed in years, months, days,
- /// hours, minutes, seconds and milliseconds based on the
- /// Gregorian calendar.
- ///
- /// In addition to the date and time, the class also
- /// maintains a time zone differential, which denotes
- /// the difference in seconds from UTC to local time,
- /// i.e. UTC = local time - time zone differential.
- ///
- /// Although LocalDateTime supports relational and arithmetic
- /// operators, all date/time comparisons and date/time arithmetics
- /// should be done in UTC, using the DateTime or Timestamp
- /// class for better performance. The relational operators
- /// normalize the dates/times involved to UTC before carrying out
- /// the comparison.
- ///
- /// The time zone differential is based on the input date and
- /// time and current time zone. A number of constructors accept
- /// an explicit time zone differential parameter. These should
- /// not be used since daylight savings time processing is impossible
- /// since the time zone is unknown. Each of the constructors
- /// accepting a tzd parameter have been marked as deprecated and
- /// may be removed in a future revision.
-{
-public:
- LocalDateTime();
- /// Creates a LocalDateTime with the current date/time
- /// for the current time zone.
-
- LocalDateTime(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0);
- /// Creates a DateTime for the given Gregorian local date and time.
- /// * year is from 0 to 9999.
- /// * month is from 1 to 12.
- /// * day is from 1 to 31.
- /// * hour is from 0 to 23.
- /// * minute is from 0 to 59.
- /// * second is from 0 to 59.
- /// * millisecond is from 0 to 999.
- /// * microsecond is from 0 to 999.
-
- //@ deprecated
- LocalDateTime(int tzd, int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond);
- /// Creates a DateTime for the given Gregorian date and time in the
- /// time zone denoted by the time zone differential in tzd.
- /// * tzd is in seconds.
- /// * year is from 0 to 9999.
- /// * month is from 1 to 12.
- /// * day is from 1 to 31.
- /// * hour is from 0 to 23.
- /// * minute is from 0 to 59.
- /// * second is from 0 to 59.
- /// * millisecond is from 0 to 999.
- /// * microsecond is from 0 to 999.
-
- LocalDateTime(const DateTime& dateTime);
- /// Creates a LocalDateTime from the UTC time given in dateTime,
- /// using the time zone differential of the current time zone.
-
- //@ deprecated
- LocalDateTime(int tzd, const DateTime& dateTime);
- /// Creates a LocalDateTime from the UTC time given in dateTime,
- /// using the given time zone differential. Adjusts dateTime
- /// for the given time zone differential.
-
- //@ deprecated
- LocalDateTime(int tzd, const DateTime& dateTime, bool adjust);
- /// Creates a LocalDateTime from the UTC time given in dateTime,
- /// using the given time zone differential. If adjust is true,
- /// adjusts dateTime for the given time zone differential.
-
- LocalDateTime(double julianDay);
- /// Creates a LocalDateTime for the given Julian day in the local time zone.
-
- //@ deprecated
- LocalDateTime(int tzd, double julianDay);
- /// Creates a LocalDateTime for the given Julian day in the time zone
- /// denoted by the time zone differential in tzd.
-
- LocalDateTime(const LocalDateTime& dateTime);
- /// Copy constructor. Creates the LocalDateTime from another one.
-
- ~LocalDateTime();
- /// Destroys the LocalDateTime.
-
- LocalDateTime& operator = (const LocalDateTime& dateTime);
- /// Assigns another LocalDateTime.
-
- LocalDateTime& operator = (const Timestamp& timestamp);
- /// Assigns a timestamp
-
- LocalDateTime& operator = (double julianDay);
- /// Assigns a Julian day in the local time zone.
-
- LocalDateTime& assign(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microseconds = 0);
- /// Assigns a Gregorian local date and time.
- /// * year is from 0 to 9999.
- /// * month is from 1 to 12.
- /// * day is from 1 to 31.
- /// * hour is from 0 to 23.
- /// * minute is from 0 to 59.
- /// * second is from 0 to 59.
- /// * millisecond is from 0 to 999.
- /// * microsecond is from 0 to 999.
-
- //@ deprecated
- LocalDateTime& assign(int tzd, int year, int month, int day, int hour, int minute, int second, int millisecond, int microseconds);
- /// Assigns a Gregorian local date and time in the time zone denoted by
- /// the time zone differential in tzd.
- /// * tzd is in seconds.
- /// * year is from 0 to 9999.
- /// * month is from 1 to 12.
- /// * day is from 1 to 31.
- /// * hour is from 0 to 23.
- /// * minute is from 0 to 59.
- /// * second is from 0 to 59.
- /// * millisecond is from 0 to 999.
- /// * microsecond is from 0 to 999.
-
- //@ deprecated
- LocalDateTime& assign(int tzd, double julianDay);
- /// Assigns a Julian day in the time zone denoted by the
- /// time zone differential in tzd.
-
- void swap(LocalDateTime& dateTime);
- /// Swaps the LocalDateTime with another one.
-
- int year() const;
- /// Returns the year.
-
- int month() const;
- /// Returns the month (1 to 12).
-
- int week(int firstDayOfWeek = DateTime::MONDAY) const;
- /// Returns the week number within the year.
- /// FirstDayOfWeek should be either SUNDAY (0) or MONDAY (1).
- /// The returned week number will be from 0 to 53. Week number 1 is the week
- /// containing January 4. This is in accordance to ISO 8601.
- ///
- /// The following example assumes that firstDayOfWeek is MONDAY. For 2005, which started
- /// on a Saturday, week 1 will be the week starting on Monday, January 3.
- /// January 1 and 2 will fall within week 0 (or the last week of the previous year).
- ///
- /// For 2007, which starts on a Monday, week 1 will be the week startung on Monday, January 1.
- /// There will be no week 0 in 2007.
-
- int day() const;
- /// Returns the day witin the month (1 to 31).
-
- int dayOfWeek() const;
- /// Returns the weekday (0 to 6, where
- /// 0 = Sunday, 1 = Monday, ..., 6 = Saturday).
-
- int dayOfYear() const;
- /// Returns the number of the day in the year.
- /// January 1 is 1, February 1 is 32, etc.
-
- int hour() const;
- /// Returns the hour (0 to 23).
-
- int hourAMPM() const;
- /// Returns the hour (0 to 12).
-
- bool isAM() const;
- /// Returns true if hour < 12;
-
- bool isPM() const;
- /// Returns true if hour >= 12.
-
- int minute() const;
- /// Returns the minute (0 to 59).
-
- int second() const;
- /// Returns the second (0 to 59).
-
- int millisecond() const;
- /// Returns the millisecond (0 to 999)
-
- int microsecond() const;
- /// Returns the microsecond (0 to 999)
-
- double julianDay() const;
- /// Returns the julian day for the date.
-
- int tzd() const;
- /// Returns the time zone differential.
-
- DateTime utc() const;
- /// Returns the UTC equivalent for the local date and time.
-
- Timestamp timestamp() const;
- /// Returns the date and time expressed as a Timestamp.
-
- Timestamp::UtcTimeVal utcTime() const;
- /// Returns the UTC equivalent for the local date and time.
-
- bool operator == (const LocalDateTime& dateTime) const;
- bool operator != (const LocalDateTime& dateTime) const;
- bool operator < (const LocalDateTime& dateTime) const;
- bool operator <= (const LocalDateTime& dateTime) const;
- bool operator > (const LocalDateTime& dateTime) const;
- bool operator >= (const LocalDateTime& dateTime) const;
-
- LocalDateTime operator + (const Timespan& span) const;
- LocalDateTime operator - (const Timespan& span) const;
- Timespan operator - (const LocalDateTime& dateTime) const;
- LocalDateTime& operator += (const Timespan& span);
- LocalDateTime& operator -= (const Timespan& span);
-
-protected:
- LocalDateTime(Timestamp::UtcTimeVal utcTime, Timestamp::TimeDiff diff, int tzd);
-
- void determineTzd(bool adjust = false);
- /// Recalculate the tzd based on the _dateTime member based
- /// on the current timezone using the Standard C runtime functions.
- /// If adjust is true, then adjustForTzd() is called after the
- /// differential is calculated.
-
- void adjustForTzd();
- /// Adjust the _dateTime member based on the _tzd member.
-
-private:
- DateTime _dateTime;
- int _tzd;
-
- friend class DateTimeFormatter;
- friend class DateTimeParser;
-};
-
-
-//
-// inlines
-//
-inline int LocalDateTime::year() const
-{
- return _dateTime.year();
-}
-
-
-inline int LocalDateTime::month() const
-{
- return _dateTime.month();
-}
-
-
-inline int LocalDateTime::week(int firstDayOfWeek) const
-{
- return _dateTime.week(firstDayOfWeek);
-}
-
-
-inline int LocalDateTime::day() const
-{
- return _dateTime.day();
-}
-
-
-inline int LocalDateTime::dayOfWeek() const
-{
- return _dateTime.dayOfWeek();
-}
-
-
-inline int LocalDateTime::dayOfYear() const
-{
- return _dateTime.dayOfYear();
-}
-
-
-inline int LocalDateTime::hour() const
-{
- return _dateTime.hour();
-}
-
-
-inline int LocalDateTime::hourAMPM() const
-{
- return _dateTime.hourAMPM();
-}
-
-
-inline bool LocalDateTime::isAM() const
-{
- return _dateTime.isAM();
-}
-
-
-inline bool LocalDateTime::isPM() const
-{
- return _dateTime.isPM();
-}
-
-
-inline int LocalDateTime::minute() const
-{
- return _dateTime.minute();
-}
-
-
-inline int LocalDateTime::second() const
-{
- return _dateTime.second();
-}
-
-
-inline int LocalDateTime::millisecond() const
-{
- return _dateTime.millisecond();
-}
-
-
-inline int LocalDateTime::microsecond() const
-{
- return _dateTime.microsecond();
-}
-
-
-inline double LocalDateTime::julianDay() const
-{
- return _dateTime.julianDay();
-}
-
-
-inline int LocalDateTime::tzd() const
-{
- return _tzd;
-}
-
-inline Timestamp LocalDateTime::timestamp() const
-{
- return Timestamp::fromUtcTime(_dateTime.utcTime());
-}
-
-inline Timestamp::UtcTimeVal LocalDateTime::utcTime() const
-{
- return _dateTime.utcTime() - ((Timestamp::TimeDiff) _tzd)*10000000;
-}
-
-
-inline void LocalDateTime::adjustForTzd()
-{
- _dateTime += Timespan(((Timestamp::TimeDiff) _tzd)*Timespan::SECONDS);
-}
-
-
-inline void swap(LocalDateTime& d1, LocalDateTime& d2)
-{
- d1.swap(d2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LocalDateTime_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LogFile.h b/Utilities/Poco/Foundation/include/Poco/LogFile.h
deleted file mode 100755
index 3f33ac2a70..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LogFile.h
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// LogFile.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogFile
-//
-// Definition of the LogFile class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_LogFile_INCLUDED
-#define Foundation_LogFile_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "Poco/LogFile_WIN32U.h"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/LogFile_WIN32.h"
-#elif defined(POCO_OS_FAMILY_VMS)
-#include "Poco/LogFile_VMS.h"
-#else
-#include "Poco/LogFile_STD.h"
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API LogFile: public LogFileImpl
- /// This class is used by FileChannel to work
- /// with a log file.
-{
-public:
- LogFile(const std::string& path);
- /// Creates the LogFile.
-
- ~LogFile();
- /// Destroys the LogFile.
-
- void write(const std::string& text);
- /// Writes the given text to the log file.
-
- UInt64 size() const;
- /// Returns the current size in bytes of the log file.
-
- Timestamp creationDate() const;
- /// Returns the date and time the log file was created.
-
- const std::string& path() const;
- /// Returns the path given in the constructor.
-};
-
-
-//
-// inlines
-//
-inline void LogFile::write(const std::string& text)
-{
- writeImpl(text);
-}
-
-
-inline UInt64 LogFile::size() const
-{
- return sizeImpl();
-}
-
-
-inline Timestamp LogFile::creationDate() const
-{
- return creationDateImpl();
-}
-
-
-inline const std::string& LogFile::path() const
-{
- return pathImpl();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LogFile_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LogFile_STD.h b/Utilities/Poco/Foundation/include/Poco/LogFile_STD.h
deleted file mode 100755
index f987b32e65..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LogFile_STD.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// LogFile_STD.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogFile
-//
-// Definition of the LogFileImpl class using iostreams.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_LogFile_STD_INCLUDED
-#define Foundation_LogFile_STD_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-#include "Poco/FileStream.h"
-
-
-namespace Poco {
-
-
-class Foundation_API LogFileImpl
- /// The implementation of LogFile for non-Windows platforms.
- /// The native filesystem APIs are used for
- /// total control over locking behavior.
-{
-public:
- LogFileImpl(const std::string& path);
- ~LogFileImpl();
- void writeImpl(const std::string& text);
- UInt64 sizeImpl() const;
- Timestamp creationDateImpl() const;
- const std::string& pathImpl() const;
-
-private:
- std::string _path;
- mutable Poco::FileOutputStream _str;
- Timestamp _creationDate;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LogFile_STD_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LogFile_VMS.h b/Utilities/Poco/Foundation/include/Poco/LogFile_VMS.h
deleted file mode 100755
index 994b4f4624..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LogFile_VMS.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// LogFile_VMS.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogFile
-//
-// Definition of the LogFileImpl class using C I/O with OpenVMS extensions.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_LogFile_VMS_INCLUDED
-#define Foundation_LogFile_VMS_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-#include <stdio.h>
-
-
-namespace Poco {
-
-
-class Foundation_API LogFileImpl
- /// The implementation of LogFile for OpenVMS.
- /// The C Standard Library functions for file I/O
- /// are used with OpenVMS-specific extensions to
- /// control sharing and locking behavior.
-{
-public:
- LogFileImpl(const std::string& path);
- ~LogFileImpl();
- void writeImpl(const std::string& text);
- UInt64 sizeImpl() const;
- Timestamp creationDateImpl() const;
- const std::string& pathImpl() const;
-
-private:
- std::string _path;
- mutable FILE* _file;
- Timestamp _creationDate;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LogFile_VMS_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LogFile_WIN32.h b/Utilities/Poco/Foundation/include/Poco/LogFile_WIN32.h
deleted file mode 100755
index 9c750e3fc5..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LogFile_WIN32.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// LogFile_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogFile
-//
-// Definition of the LogFileImpl class using the Windows file APIs.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_LogFile_WIN32_INCLUDED
-#define Foundation_LogFile_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API LogFileImpl
- /// The implementation of LogFile for Windows.
- /// The native filesystem APIs are used for
- /// total control over locking behavior.
-{
-public:
- LogFileImpl(const std::string& path);
- ~LogFileImpl();
- void writeImpl(const std::string& text);
- UInt64 sizeImpl() const;
- Timestamp creationDateImpl() const;
- const std::string& pathImpl() const;
-
-private:
- void createFile();
-
- std::string _path;
- HANDLE _hFile;
- Timestamp _creationDate;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LogFile_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LogFile_WIN32U.h b/Utilities/Poco/Foundation/include/Poco/LogFile_WIN32U.h
deleted file mode 100755
index cc14063263..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LogFile_WIN32U.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// LogFile_WIN32U.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogFile
-//
-// Definition of the LogFileImpl class using the Windows file APIs.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_LogFile_WIN32U_INCLUDED
-#define Foundation_LogFile_WIN32U_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API LogFileImpl
- /// The implementation of LogFile for Windows.
- /// The native filesystem APIs are used for
- /// total control over locking behavior.
-{
-public:
- LogFileImpl(const std::string& path);
- ~LogFileImpl();
- void writeImpl(const std::string& text);
- UInt64 sizeImpl() const;
- Timestamp creationDateImpl() const;
- const std::string& pathImpl() const;
-
-private:
- void createFile();
-
- std::string _path;
- HANDLE _hFile;
- Timestamp _creationDate;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LogFile_WIN32U_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LogStream.h b/Utilities/Poco/Foundation/include/Poco/LogStream.h
deleted file mode 100755
index 8c7463cd94..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LogStream.h
+++ /dev/null
@@ -1,207 +0,0 @@
-//
-// LogStream.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogStream
-//
-// Definition of the LogStream class.
-//
-// Copyright (c) 2006-2007, 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.
-//
-
-
-#ifndef Foundation_LogStream_INCLUDED
-#define Foundation_LogStream_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Logger.h"
-#include "Poco/UnbufferedStreamBuf.h"
-#include <istream>
-
-
-namespace Poco {
-
-
-class Foundation_API LogStreamBuf: public UnbufferedStreamBuf
- /// This class implements a streambuf interface
- /// to a Logger.
- ///
- /// The streambuf appends all characters written to it
- /// to a string. As soon as a CR or LF (std::endl) is written,
- /// the string is sent to the Logger, with the set
- /// priority.
-{
-public:
- LogStreamBuf(Logger& logger, Message::Priority priority);
- /// Creates the LogStream.
-
- ~LogStreamBuf();
- /// Destroys the LogStream.
-
- void setPriority(Message::Priority priority);
- /// Sets the priority for log messages.
-
- Message::Priority getPriority() const;
- /// Returns the priority for log messages.
-
- Logger& logger() const;
- /// Returns a reference to the Logger.
-
-private:
- int writeToDevice(char c);
-
-private:
- Logger& _logger;
- Message::Priority _priority;
- std::string _message;
-};
-
-
-class Foundation_API LogIOS: public virtual std::ios
- /// The base class for LogStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- LogIOS(Logger& logger, Message::Priority priority);
- ~LogIOS();
- LogStreamBuf* rdbuf();
-
-protected:
- LogStreamBuf _buf;
-};
-
-
-class Foundation_API LogStream: public LogIOS, public std::ostream
- /// This class implements an ostream interface
- /// to a Logger.
- ///
- /// The stream's buffer appends all characters written to it
- /// to a string. As soon as a CR or LF (std::endl) is written,
- /// the string is sent to the Logger, with the current
- /// priority.
- ///
- /// Usage example:
- /// LogStream ls(someLogger);
- /// ls << "Some informational message" << std::endl;
- /// ls.error() << "Some error message" << std::endl;
-{
-public:
- LogStream(Logger& logger, Message::Priority priority = Message::PRIO_INFORMATION);
- /// Creates the LogStream, using the given logger and priority.
-
- LogStream(const std::string& loggerName, Message::Priority priority = Message::PRIO_INFORMATION);
- /// Creates the LogStream, using the logger identified
- /// by loggerName, and sets the priority.
-
- ~LogStream();
- /// Destroys the LogStream.
-
- LogStream& fatal();
- /// Sets the priority for log messages to Message::PRIO_FATAL.
-
- LogStream& fatal(const std::string& message);
- /// Sets the priority for log messages to Message::PRIO_FATAL
- /// and writes the given message.
-
- LogStream& critical();
- /// Sets the priority for log messages to Message::PRIO_CRITICAL.
-
- LogStream& critical(const std::string& message);
- /// Sets the priority for log messages to Message::PRIO_CRITICAL
- /// and writes the given message.
-
- LogStream& error();
- /// Sets the priority for log messages to Message::PRIO_ERROR.
-
- LogStream& error(const std::string& message);
- /// Sets the priority for log messages to Message::PRIO_ERROR
- /// and writes the given message.
-
- LogStream& warning();
- /// Sets the priority for log messages to Message::PRIO_WARNING.
-
- LogStream& warning(const std::string& message);
- /// Sets the priority for log messages to Message::PRIO_WARNING
- /// and writes the given message.
-
- LogStream& notice();
- /// Sets the priority for log messages to Message::PRIO_NOTICE.
-
- LogStream& notice(const std::string& message);
- /// Sets the priority for log messages to Message::PRIO_NOTICE
- /// and writes the given message.
-
- LogStream& information();
- /// Sets the priority for log messages to Message::PRIO_INFORMATION.
-
- LogStream& information(const std::string& message);
- /// Sets the priority for log messages to Message::PRIO_INFORMATION
- /// and writes the given message.
-
- LogStream& debug();
- /// Sets the priority for log messages to Message::PRIO_DEBUG.
-
- LogStream& debug(const std::string& message);
- /// Sets the priority for log messages to Message::PRIO_DEBUG
- /// and writes the given message.
-
- LogStream& trace();
- /// Sets the priority for log messages to Message::PRIO_TRACE.
-
- LogStream& trace(const std::string& message);
- /// Sets the priority for log messages to Message::PRIO_TRACE
- /// and writes the given message.
-
- LogStream& priority(Message::Priority priority);
- /// Sets the priority for log messages.
-};
-
-
-//
-// inlines
-//
-inline Message::Priority LogStreamBuf::getPriority() const
-{
- return _priority;
-}
-
-
-inline Logger& LogStreamBuf::logger() const
-{
- return _logger;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LogStream_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Logger.h b/Utilities/Poco/Foundation/include/Poco/Logger.h
deleted file mode 100755
index df70ec3327..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Logger.h
+++ /dev/null
@@ -1,484 +0,0 @@
-//
-// Logger.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Logger
-//
-// Definition of the Logger class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Logger_INCLUDED
-#define Foundation_Logger_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-#include "Poco/Message.h"
-#include <map>
-#include <vector>
-#include <cstddef>
-
-
-namespace Poco {
-
-
-class Exception;
-
-
-class Foundation_API Logger: public Channel
- /// Logger is a special Channel that acts as the main
- /// entry point into the logging framework.
- ///
- /// An application uses instances of the Logger class to generate its log messages
- /// and send them on their way to their final destination. Logger instances
- /// are organized in a hierarchical, tree-like manner and are maintained by
- /// the framework. Every Logger object has exactly one direct ancestor, with
- /// the exception of the root logger. A newly created logger inherits its properties -
- /// channel and level - from its direct ancestor. Every logger is connected
- /// to a channel, to which it passes on its messages. Furthermore, every logger
- /// has a log level, which is used for filtering messages based on their priority.
- /// Only messages with a priority equal to or higher than the specified level
- /// are passed on. For example, if the level of a logger is set to three (PRIO_ERROR),
- /// only messages with priority PRIO_ERROR, PRIO_CRITICAL and PRIO_FATAL will
- /// propagate. If the level is set to zero, the logger is effectively disabled.
- ///
- /// The name of a logger determines the logger's place within the logger hierarchy.
- /// The name of the root logger is always "", the empty string. For all other
- /// loggers, the name is made up of one or more components, separated by a period.
- /// For example, the loggers with the name HTTPServer.RequestHandler and HTTPServer.Listener
- /// are descendants of the logger HTTPServer, which itself is a descendant of
- /// the root logger. There is not limit as to how deep
- /// the logger hierarchy can become. Once a logger has been created and it has
- /// inherited the channel and level from its ancestor, it loses the connection
- /// to it. So changes to the level or channel of a logger do not affect its
- /// descendants. This greatly simplifies the implementation of the framework
- /// and is no real restriction, because almost always levels and channels are
- /// set up at application startup and never changed afterwards. Nevertheless,
- /// there are methods to simultaneously change the level and channel of all
- /// loggers in a certain hierarchy.
-{
-public:
- const std::string& name() const;
- /// Returns the name of the logger, which is set as the
- /// message source on all messages created by the logger.
-
- void setChannel(Channel* pChannel);
- /// Attaches the given Channel to the Logger.
-
- Channel* getChannel() const;
- /// Returns the Channel attached to the logger.
-
- void setLevel(int level);
- /// Sets the Logger's log level.
-
- int getLevel() const;
- /// Returns the Logger's log level.
-
- void setLevel(const std::string& level);
- /// Sets the Logger's log level using a symbolic value.
- ///
- /// Valid values are:
- /// - fatal
- /// - critical
- /// - error
- /// - warning
- /// - notice
- /// - information
- /// - debug
- /// - trace
-
- void setProperty(const std::string& name, const std::string& value);
- /// Sets or changes a configuration property.
- ///
- /// Only the "channel" and "level" properties are supported, which allow
- /// setting the target channel and log level, respectively, via the LoggingRegistry.
- /// The "channel" and "level" properties are set-only.
-
- void log(const Message& msg);
- /// Logs the given message if its priority is
- /// greater than or equal to the Logger's log level.
-
- void log(const Exception& exc);
- /// Logs the given exception with priority PRIO_ERROR.
-
- void fatal(const std::string& msg);
- /// If the Logger's log level is at least PRIO_FATAL,
- /// creates a Message with priority PRIO_FATAL
- /// and the given message text and sends it
- /// to the attached channel.
-
- void critical(const std::string& msg);
- /// If the Logger's log level is at least PRIO_CRITICAL,
- /// creates a Message with priority PRIO_CRITICAL
- /// and the given message text and sends it
- /// to the attached channel.
-
- void error(const std::string& msg);
- /// If the Logger's log level is at least PRIO_ERROR,
- /// creates a Message with priority PRIO_ERROR
- /// and the given message text and sends it
- /// to the attached channel.
-
- void warning(const std::string& msg);
- /// If the Logger's log level is at least PRIO_WARNING,
- /// creates a Message with priority PRIO_WARNING
- /// and the given message text and sends it
- /// to the attached channel.
-
- void notice(const std::string& msg);
- /// If the Logger's log level is at least PRIO_NOTICE,
- /// creates a Message with priority PRIO_NOTICE
- /// and the given message text and sends it
- /// to the attached channel.
-
- void information(const std::string& msg);
- /// If the Logger's log level is at least PRIO_INFORMATION,
- /// creates a Message with priority PRIO_INFORMATION
- /// and the given message text and sends it
- /// to the attached channel.
-
- void debug(const std::string& msg);
- /// If the Logger's log level is at least PRIO_DEBUG,
- /// creates a Message with priority PRIO_DEBUG
- /// and the given message text and sends it
- /// to the attached channel.
-
- void trace(const std::string& msg);
- /// If the Logger's log level is at least PRIO_TRACE,
- /// creates a Message with priority PRIO_TRACE
- /// and the given message text and sends it
- /// to the attached channel.
-
- void dump(const std::string& msg, const void* buffer, std::size_t length, Message::Priority prio = Message::PRIO_DEBUG);
- /// Logs the given message, followed by the data in buffer.
- ///
- /// The data in buffer is written in canonical hex+ASCII form:
- /// Offset (4 bytes) in hexadecimal, followed by sixteen
- /// space-separated, two column, hexadecimal bytes,
- /// followed by the same sixteen bytes as ASCII characters.
- /// For bytes outside the range 32 .. 127, a dot is printed.
-
- bool is(int level) const;
- /// Returns true if at least the given log level is set.
-
- bool fatal() const;
- /// Returns true if the log level is at least PRIO_FATAL.
-
- bool critical() const;
- /// Returns true if the log level is at least PRIO_CRITICAL.
-
- bool error() const;
- /// Returns true if the log level is at least PRIO_ERROR.
-
- bool warning() const;
- /// Returns true if the log level is at least PRIO_WARNING.
-
- bool notice() const;
- /// Returns true if the log level is at least PRIO_NOTICE.
-
- bool information() const;
- /// Returns true if the log level is at least PRIO_INFORMATION.
-
- bool debug() const;
- /// Returns true if the log level is at least PRIO_DEBUG.
-
- bool trace() const;
- /// Returns true if the log level is at least PRIO_TRACE.
-
- static std::string format(const std::string& fmt, const std::string& arg);
- /// Replaces all occurences of $0 in fmt with the string given in arg and
- /// returns the result. To include a dollar sign in the result string,
- /// specify two dollar signs ($$) in the format string.
-
- static std::string format(const std::string& fmt, const std::string& arg0, const std::string& arg1);
- /// Replaces all occurences of $<n> in fmt with the string given in arg<n> and
- /// returns the result. To include a dollar sign in the result string,
- /// specify two dollar signs ($$) in the format string.
-
- static std::string format(const std::string& fmt, const std::string& arg0, const std::string& arg1, const std::string& arg2);
- /// Replaces all occurences of $<n> in fmt with the string given in arg<n> and
- /// returns the result. To include a dollar sign in the result string,
- /// specify two dollar signs ($$) in the format string.
-
- static std::string format(const std::string& fmt, const std::string& arg0, const std::string& arg1, const std::string& arg2, const std::string& arg3);
- /// Replaces all occurences of $<n> in fmt with the string given in arg<n> and
- /// returns the result. To include a dollar sign in the result string,
- /// specify two dollar signs ($$) in the format string.
-
- static void setLevel(const std::string& name, int level);
- /// Sets the given log level on all loggers that are
- /// descendants of the Logger with the given name.
-
- static void setChannel(const std::string& name, Channel* pChannel);
- /// Attaches the given Channel to all loggers that are
- /// descendants of the Logger with the given name.
-
- static void setProperty(const std::string& loggerName, const std::string& propertyName, const std::string& value);
- /// Sets or changes a configuration property for all loggers
- /// that are descendants of the Logger with the given name.
-
- static Logger& get(const std::string& name);
- /// Returns a reference to the Logger with the given name.
- /// If the Logger does not yet exist, it is created, based
- /// on its parent logger.
-
- static Logger& unsafeGet(const std::string& name);
- /// Returns a reference to the Logger with the given name.
- /// If the Logger does not yet exist, it is created, based
- /// on its parent logger.
- ///
- /// WARNING: This method is not thread safe. You should
- /// probably use get() instead.
- /// The only time this method should be used is during
- /// program initialization, when only one thread is running.
-
- static Logger& create(const std::string& name, Channel* pChannel, int level = Message::PRIO_INFORMATION);
- /// Creates and returns a reference to a Logger with the
- /// given name. The Logger's Channel and log level as set as
- /// specified.
-
- static Logger& root();
- /// Returns a reference to the root logger, which is the ultimate
- /// ancestor of all Loggers.
-
- static Logger* has(const std::string& name);
- /// Returns a pointer to the Logger with the given name if it
- /// exists, or a null pointer otherwse.
-
- static void destroy(const std::string& name);
- /// Destroys the logger with the specified name. Does nothing
- /// if the logger is not found.
- ///
- /// After a logger has been destroyed, all references to it
- /// become invalid.
-
- static void shutdown();
- /// Shuts down the logging framework and releases all
- /// Loggers.
-
- static void names(std::vector<std::string>& names);
- /// Fills the given vector with the names
- /// of all currently defined loggers.
-
- static const std::string ROOT; /// The name of the root logger ("").
-
-protected:
- typedef std::map<std::string, Logger*> LoggerMap;
-
- Logger(const std::string& name, Channel* pChannel, int level);
- ~Logger();
-
- void log(const std::string& text, Message::Priority prio);
-
- static std::string format(const std::string& fmt, int argc, std::string argv[]);
- static void formatDump(std::string& message, const void* buffer, std::size_t length);
- static Logger& parent(const std::string& name);
- static void add(Logger* pLogger);
- static Logger* find(const std::string& name);
-
-private:
- Logger();
- Logger(const Logger&);
- Logger& operator = (const Logger&);
-
- std::string _name;
- Channel* _pChannel;
- int _level;
-
- static LoggerMap* _pLoggerMap;
- static Mutex _mapMtx;
-};
-
-
-//
-// convenience macros
-//
-#define poco_fatal(logger, msg) \
- if ((logger).fatal()) (logger).fatal(msg) else (void) 0
-
-#define poco_critical(logger, msg) \
- if ((logger).critical()) (logger).critical(msg) else (void) 0
-
-#define poco_error(logger, msg) \
- if ((logger).error()) (logger).error(msg) else (void) 0
-
-#define poco_warning(logger, msg) \
- if ((logger).warning()) (logger).warning(msg) else (void) 0
-
-#define poco_notice(logger, msg) \
- if ((logger).notice()) (logger).notice(msg) else (void) 0
-
-#define poco_information(logger, msg) \
- if ((logger).information()) (logger).information(msg) else (void) 0
-
-#if defined(_DEBUG)
- #define poco_debug(logger, msg) \
- if ((logger).debug()) (logger).debug(msg) else (void) 0
-
- #define poco_trace(logger, msg) \
- if ((logger).trace()) (logger).trace(msg) else (void) 0
-#else
- #define poco_debug(logger, msg)
- #define poco_trace(logger, msg)
-#endif
-
-
-//
-// inlines
-//
-inline const std::string& Logger::name() const
-{
- return _name;
-}
-
-
-inline int Logger::getLevel() const
-{
- return _level;
-}
-
-
-inline void Logger::log(const std::string& text, Message::Priority prio)
-{
- if (_level >= prio && _pChannel)
- {
- _pChannel->log(Message(_name, text, prio));
- }
-}
-
-
-inline void Logger::fatal(const std::string& msg)
-{
- log(msg, Message::PRIO_FATAL);
-}
-
-
-inline void Logger::critical(const std::string& msg)
-{
- log(msg, Message::PRIO_CRITICAL);
-}
-
-
-inline void Logger::error(const std::string& msg)
-{
- log(msg, Message::PRIO_ERROR);
-}
-
-
-inline void Logger::warning(const std::string& msg)
-{
- log(msg, Message::PRIO_WARNING);
-}
-
-
-inline void Logger::notice(const std::string& msg)
-{
- log(msg, Message::PRIO_NOTICE);
-}
-
-
-inline void Logger::information(const std::string& msg)
-{
- log(msg, Message::PRIO_INFORMATION);
-}
-
-
-inline void Logger::debug(const std::string& msg)
-{
- log(msg, Message::PRIO_DEBUG);
-}
-
-
-inline void Logger::trace(const std::string& msg)
-{
- log(msg, Message::PRIO_TRACE);
-}
-
-
-inline bool Logger::is(int level) const
-{
- return _level >= level;
-}
-
-
-inline bool Logger::fatal() const
-{
- return _level >= Message::PRIO_FATAL;
-}
-
-
-inline bool Logger::critical() const
-{
- return _level >= Message::PRIO_CRITICAL;
-}
-
-
-inline bool Logger::error() const
-{
- return _level >= Message::PRIO_ERROR;
-}
-
-
-inline bool Logger::warning() const
-{
- return _level >= Message::PRIO_WARNING;
-}
-
-
-inline bool Logger::notice() const
-{
- return _level >= Message::PRIO_NOTICE;
-}
-
-
-inline bool Logger::information() const
-{
- return _level >= Message::PRIO_INFORMATION;
-}
-
-
-inline bool Logger::debug() const
-{
- return _level >= Message::PRIO_DEBUG;
-}
-
-
-inline bool Logger::trace() const
-{
- return _level >= Message::PRIO_TRACE;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Logger_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LoggingFactory.h b/Utilities/Poco/Foundation/include/Poco/LoggingFactory.h
deleted file mode 100755
index d341fc6aea..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LoggingFactory.h
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// LoggingFactory.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LoggingFactory
-//
-// Definition of the LoggingFactory class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_LoggingFactory_INCLUDED
-#define Foundation_LoggingFactory_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DynamicFactory.h"
-#include "Poco/Channel.h"
-#include "Poco/Formatter.h"
-
-
-namespace Poco {
-
-
-class Foundation_API LoggingFactory
- /// An extensible factory for channels and formatters.
- ///
- /// The following channel classes are pre-registered:
- /// - AsyncChannel
- /// - ConsoleChannel
- /// - EventLogChannel (Windows platforms only)
- /// - FileChannel
- /// - FormattingChannel
- /// - NullChannel
- /// - OpcomChannel (OpenVMS only)
- /// - SplitterChannel
- /// - SyslogChannel (Unix platforms only)
- ///
- /// The following formatter classes are pre-registered:
- /// - PatternFormatter
-{
-public:
- typedef AbstractInstantiator<Channel> ChannelInstantiator;
- typedef AbstractInstantiator<Formatter> FormatterFactory;
-
- LoggingFactory();
- /// Creates the LoggingFactory.
- ///
- /// Automatically registers class factories for the
- /// built-in channel and formatter classes.
-
- ~LoggingFactory();
- /// Destroys the LoggingFactory.
-
- void registerChannelClass(const std::string& className, ChannelInstantiator* pFactory);
- /// Registers a channel class with the LoggingFactory.
-
- void registerFormatterClass(const std::string& className, FormatterFactory* pFactory);
- /// Registers a formatter class with the LoggingFactory.
-
- Channel* createChannel(const std::string& className) const;
- /// Creates a new Channel instance from specified class.
- ///
- /// Throws a NotFoundException if the specified channel class
- /// has not been registered.
-
- Formatter* createFormatter(const std::string& className) const;
- /// Creates a new Formatter instance from specified class.
- ///
- /// Throws a NotFoundException if the specified formatter class
- /// has not been registered.
-
- static LoggingFactory& defaultFactory();
- /// Returns a reference to the default
- /// LoggingFactory.
-
-private:
- void registerBuiltins();
-
- DynamicFactory<Channel> _channelFactory;
- DynamicFactory<Formatter> _formatterFactory;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LoggingFactory_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/LoggingRegistry.h b/Utilities/Poco/Foundation/include/Poco/LoggingRegistry.h
deleted file mode 100755
index e753323347..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/LoggingRegistry.h
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// LoggingRegistry.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LoggingRegistry
-//
-// Definition of the LoggingRegistry class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_LoggingRegistry_INCLUDED
-#define Foundation_LoggingRegistry_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Channel.h"
-#include "Poco/Formatter.h"
-#include "Poco/Mutex.h"
-#include <map>
-
-
-namespace Poco {
-
-
-class Foundation_API LoggingRegistry
- /// A registry for channels and formatters.
- ///
- /// The LoggingRegistry class is used for configuring
- /// the logging framework.
-{
-public:
- LoggingRegistry();
- /// Creates the LoggingRegistry.
-
- ~LoggingRegistry();
- /// Destroys the LoggingRegistry.
-
- Channel* channelForName(const std::string& name) const;
- /// Returns the Channel object which has been registered
- /// under the given name.
- ///
- /// Throws a NotFoundException if the name is unknown.
-
- Formatter* formatterForName(const std::string& name) const;
- /// Returns the Formatter object which has been registered
- /// under the given name.
- ///
- /// Throws a NotFoundException if the name is unknown.
-
- void registerChannel(const std::string& name, Channel* pChannel);
- /// Registers a channel under a given name.
- /// It is okay to re-register a different channel under an
- /// already existing name.
-
- void registerFormatter(const std::string& name, Formatter* pFormatter);
- /// Registers a formatter under a given name.
- /// It is okay to re-register a different formatter under an
- /// already existing name.
-
- void unregisterChannel(const std::string& name);
- /// Unregisters the given channel.
- ///
- /// Throws a NotFoundException if the name is unknown.
-
- void unregisterFormatter(const std::string& name);
- /// Unregisters the given formatter.
- ///
- /// Throws a NotFoundException if the name is unknown.
-
- void clear();
- /// Unregisters all registered channels and formatters.
-
- static LoggingRegistry& defaultRegistry();
- /// Returns a reference to the default
- /// LoggingRegistry.
-
-private:
- typedef AutoPtr<Channel> ChannelPtr;
- typedef AutoPtr<Formatter> FormatterPtr;
- typedef std::map<std::string, ChannelPtr> ChannelMap;
- typedef std::map<std::string, FormatterPtr> FormatterMap;
-
- ChannelMap _channelMap;
- FormatterMap _formatterMap;
- mutable FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_LoggingRegistry_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/MD2Engine.h b/Utilities/Poco/Foundation/include/Poco/MD2Engine.h
deleted file mode 100755
index 4541555d2a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/MD2Engine.h
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// MD2Engine.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: MD2Engine
-//
-// Definition of class MD2Engine.
-//
-// Copyright (c) 2004-2006, 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.
-//
-//
-// MD2 (RFC 1319) algorithm:
-// Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
-// rights reserved.
-//
-// License to copy and use this software is granted for
-// non-commercial Internet Privacy-Enhanced Mail provided that it is
-// identified as the "RSA Data Security, Inc. MD2 Message Digest
-// Algorithm" in all material mentioning or referencing this software
-// or this function.
-//
-// RSA Data Security, Inc. makes no representations concerning either
-// the merchantability of this software or the suitability of this
-// software for any particular purpose. It is provided "as is"
-// without express or implied warranty of any kind.
-//
-// These notices must be retained in any copies of any part of this
-// documentation and/or software.
-//
-
-
-#ifndef Foundation_MD2Engine_INCLUDED
-#define Foundation_MD2Engine_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DigestEngine.h"
-
-
-namespace Poco {
-
-
-class Foundation_API MD2Engine: public DigestEngine
- /// This class implementes the MD2 message digest algorithm,
- /// described in RFC 1319.
-{
-public:
- enum
- {
- BLOCK_SIZE = 16,
- DIGEST_SIZE = 16
- };
-
- MD2Engine();
- ~MD2Engine();
-
- unsigned digestLength() const;
- void reset();
- const DigestEngine::Digest& digest();
-
-protected:
- void updateImpl(const void* data, unsigned length);
-
-private:
- static void transform(unsigned char state[16], unsigned char checksum[16], const unsigned char block[16]);
-
- struct Context
- {
- unsigned char state[16]; // state
- unsigned char checksum[16]; // checksum
- unsigned int count; // number of bytes, modulo 16
- unsigned char buffer[16]; // input buffer
- };
-
- Context _context;
- DigestEngine::Digest _digest;
-
- MD2Engine(const MD2Engine&);
- MD2Engine& operator = (const MD2Engine&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_MD2Engine_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/MD4Engine.h b/Utilities/Poco/Foundation/include/Poco/MD4Engine.h
deleted file mode 100755
index c025214abc..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/MD4Engine.h
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// MD4Engine.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: MD4Engine
-//
-// Definition of class MD4Engine.
-//
-// Copyright (c) 2004-2006, 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.
-//
-//
-// MD4 (RFC 1320) algorithm:
-// Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
-// rights reserved.
-//
-// License to copy and use this software is granted provided that it
-// is identified as the "RSA Data Security, Inc. MD4 Message-Digest
-// Algorithm" in all material mentioning or referencing this software
-// or this function.
-//
-// License is also granted to make and use derivative works provided
-// that such works are identified as "derived from the RSA Data
-// Security, Inc. MD4 Message-Digest Algorithm" in all material
-// mentioning or referencing the derived work.
-//
-// RSA Data Security, Inc. makes no representations concerning either
-// the merchantability of this software or the suitability of this
-// software for any particular purpose. It is provided "as is"
-// without express or implied warranty of any kind.
-//
-// These notices must be retained in any copies of any part of this
-// documentation and/or software.
-//
-
-
-#ifndef Foundation_MD4Engine_INCLUDED
-#define Foundation_MD4Engine_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DigestEngine.h"
-
-
-namespace Poco {
-
-
-class Foundation_API MD4Engine: public DigestEngine
- /// This class implementes the MD4 message digest algorithm,
- /// described in RFC 1320.
-{
-public:
- enum
- {
- BLOCK_SIZE = 64,
- DIGEST_SIZE = 16
- };
-
- MD4Engine();
- ~MD4Engine();
-
- unsigned digestLength() const;
- void reset();
- const DigestEngine::Digest& digest();
-
-protected:
- void updateImpl(const void* data, unsigned length);
-
-private:
- static void transform(UInt32 state[4], const unsigned char block[64]);
- static void encode(unsigned char* output, const UInt32* input, unsigned int len);
- static void decode(UInt32* output, const unsigned char* input, unsigned int len);
-
- struct Context
- {
- UInt32 state[4]; // state (ABCD)
- UInt32 count[2]; // number of bits, modulo 2^64 (lsb first)
- unsigned char buffer[64]; // input buffer
- };
-
- Context _context;
- DigestEngine::Digest _digest;
-
- MD4Engine(const MD4Engine&);
- MD4Engine& operator = (const MD4Engine&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_MD5Engine_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/MD5Engine.h b/Utilities/Poco/Foundation/include/Poco/MD5Engine.h
deleted file mode 100755
index 1059226d0f..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/MD5Engine.h
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// MD5Engine.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: MD5Engine
-//
-// Definition of class MD5Engine.
-//
-// Copyright (c) 2004-2006, 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.
-//
-//
-// MD5 (RFC 1321) algorithm:
-// Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
-// rights reserved.
-//
-// License to copy and use this software is granted provided that it
-// is identified as the "RSA Data Security, Inc. MD5 Message-Digest
-// Algorithm" in all material mentioning or referencing this software
-// or this function.
-//
-// License is also granted to make and use derivative works provided
-// that such works are identified as "derived from the RSA Data
-// Security, Inc. MD5 Message-Digest Algorithm" in all material
-// mentioning or referencing the derived work.
-//
-// RSA Data Security, Inc. makes no representations concerning either
-// the merchantability of this software or the suitability of this
-// software for any particular purpose. It is provided "as is"
-// without express or implied warranty of any kind.
-//
-// These notices must be retained in any copies of any part of this
-// documentation and/or software.
-//
-
-
-#ifndef Foundation_MD5Engine_INCLUDED
-#define Foundation_MD5Engine_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DigestEngine.h"
-
-
-namespace Poco {
-
-
-class Foundation_API MD5Engine: public DigestEngine
- /// This class implementes the MD5 message digest algorithm,
- /// described in RFC 1321.
-{
-public:
- enum
- {
- BLOCK_SIZE = 64,
- DIGEST_SIZE = 16
- };
-
- MD5Engine();
- ~MD5Engine();
-
- unsigned digestLength() const;
- void reset();
- const DigestEngine::Digest& digest();
-
-protected:
- void updateImpl(const void* data, unsigned length);
-
-private:
- static void transform(UInt32 state[4], const unsigned char block[64]);
- static void encode(unsigned char* output, const UInt32* input, unsigned int len);
- static void decode(UInt32* output, const unsigned char* input, unsigned int len);
-
- struct Context
- {
- UInt32 state[4]; // state (ABCD)
- UInt32 count[2]; // number of bits, modulo 2^64 (lsb first)
- unsigned char buffer[64]; // input buffer
- };
-
- Context _context;
- DigestEngine::Digest _digest;
-
- MD5Engine(const MD5Engine&);
- MD5Engine& operator = (const MD5Engine&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_MD5Engine_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Manifest.h b/Utilities/Poco/Foundation/include/Poco/Manifest.h
deleted file mode 100755
index 2fe0928729..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Manifest.h
+++ /dev/null
@@ -1,202 +0,0 @@
-//
-// Manifest.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: ClassLoader
-//
-// Definition of the Manifest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Manifest_INCLUDED
-#define Foundation_Manifest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/MetaObject.h"
-#include <map>
-#include <typeinfo>
-
-
-namespace Poco {
-
-
-class Foundation_API ManifestBase
- /// ManifestBase is a common base class for
- /// all instantiations of Manifest.
-{
-public:
- ManifestBase();
- virtual ~ManifestBase();
-
- virtual const char* className() const = 0;
- /// Returns the type name of the manifest's class.
-};
-
-
-template <class B>
-class Manifest: public ManifestBase
- /// A Manifest maintains a list of all classes
- /// contained in a dynamically loadable class
- /// library.
- /// Internally, the information is held
- /// in a map. An iterator is provided to
- /// iterate over all the classes in a Manifest.
-{
-public:
- typedef AbstractMetaObject<B> Meta;
- typedef std::map<std::string, const Meta*> MetaMap;
-
- class Iterator
- /// The Manifest's very own iterator class.
- {
- public:
- Iterator(const typename MetaMap::const_iterator& it)
- {
- _it = it;
- }
- Iterator(const Iterator& it)
- {
- _it = it._it;
- }
- ~Iterator()
- {
- }
- Iterator& operator = (const Iterator& it)
- {
- _it = it._it;
- return *this;
- }
- inline bool operator == (const Iterator& it) const
- {
- return _it == it._it;
- }
- inline bool operator != (const Iterator& it) const
- {
- return _it != it._it;
- }
- Iterator& operator ++ () // prefix
- {
- ++_it;
- return *this;
- }
- Iterator operator ++ (int) // postfix
- {
- Iterator result(_it);
- ++_it;
- return result;
- }
- inline const Meta* operator * () const
- {
- return _it->second;
- }
- inline const Meta* operator -> () const
- {
- return _it->second;
- }
-
- private:
- typename MetaMap::const_iterator _it;
- };
-
- Manifest()
- /// Creates an empty Manifest.
- {
- }
-
- virtual ~Manifest()
- /// Destroys the Manifest.
- {
- clear();
- }
-
- Iterator find(const std::string& className) const
- /// Returns an iterator pointing to the MetaObject
- /// for the given class. If the MetaObject cannot
- /// be found, the iterator points to end().
- {
- return Iterator(_metaMap.find(className));
- }
-
- Iterator begin() const
- {
- return Iterator(_metaMap.begin());
- }
-
- Iterator end() const
- {
- return Iterator(_metaMap.end());
- }
-
- bool insert(const Meta* pMeta)
- /// Inserts a MetaObject. Returns true if insertion
- /// was successful, false if a class with the same
- /// name already exists.
- {
- return _metaMap.insert(typename MetaMap::value_type(pMeta->name(), pMeta)).second;
- }
-
- void clear()
- /// Removes all MetaObjects from the manifest.
- {
- for (typename MetaMap::iterator it = _metaMap.begin(); it != _metaMap.end(); ++it)
- {
- delete it->second;
- }
- _metaMap.clear();
- }
-
- int size() const
- /// Returns the number of MetaObjects in the Manifest.
- {
- return int(_metaMap.size());
- }
-
- bool empty() const
- /// Returns true iff the Manifest does not contain any MetaObjects.
- {
- return _metaMap.empty();
- }
-
- const char* className() const
- {
- return typeid(*this).name();
- }
-
-private:
- MetaMap _metaMap;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Manifest_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/MemoryPool.h b/Utilities/Poco/Foundation/include/Poco/MemoryPool.h
deleted file mode 100755
index 98cd0d712b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/MemoryPool.h
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// MemoryPool.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: MemoryPool
-//
-// Definition of the MemoryPool class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef Foundation_MemoryPool_INCLUDED
-#define Foundation_MemoryPool_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-#include <vector>
-#include <cstddef>
-
-
-namespace Poco {
-
-
-class Foundation_API MemoryPool
- /// A simple pool for fixed-size memory blocks.
- ///
- /// The main purpose of this class is to speed-up
- /// memory allocations, as well as to reduce memory
- /// fragmentation in situations where the same blocks
- /// are allocated all over again, such as in server
- /// applications.
- ///
- /// All allocated blocks are retained for future use.
- /// A limit on the number of blocks can be specified.
- /// Blocks can be preallocated.
-{
-public:
- MemoryPool(std::size_t blockSize, int preAlloc = 0, int maxAlloc = 0);
- /// Creates a MemoryPool for blocks with the given blockSize.
- /// The number of blocks given in preAlloc are preallocated.
-
- ~MemoryPool();
-
- void* get();
- /// Returns a memory block. If there are no more blocks
- /// in the pool, a new block will be allocated.
- ///
- /// If maxAlloc blocks are already allocated, an
- /// OutOfMemoryException is thrown.
-
- void release(void* ptr);
- /// Releases a memory block and returns it to the pool.
-
- std::size_t blockSize() const;
- /// Returns the block size.
-
- int allocated() const;
- /// Returns the number of allocated blocks.
-
- int available() const;
- /// Returns the number of available blocks in the pool.
-
-private:
- MemoryPool();
- MemoryPool(const MemoryPool&);
- MemoryPool& operator = (const MemoryPool&);
-
- enum
- {
- BLOCK_RESERVE = 128
- };
-
- typedef std::vector<char*> BlockVec;
-
- std::size_t _blockSize;
- int _maxAlloc;
- int _allocated;
- BlockVec _blocks;
- FastMutex _mutex;
-};
-
-
-//
-// inlines
-//
-inline std::size_t MemoryPool::blockSize() const
-{
- return _blockSize;
-}
-
-
-inline int MemoryPool::allocated() const
-{
- return _allocated;
-}
-
-
-inline int MemoryPool::available() const
-{
- return (int) _blocks.size();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_MemoryPool_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Message.h b/Utilities/Poco/Foundation/include/Poco/Message.h
deleted file mode 100755
index 4998d40ca7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Message.h
+++ /dev/null
@@ -1,223 +0,0 @@
-//
-// Message.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Message
-//
-// Definition of the Message class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Message_INCLUDED
-#define Foundation_Message_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-#include <map>
-
-
-namespace Poco {
-
-
-class Foundation_API Message
- /// This class represents a log message that is sent through a
- /// chain of log channels.
- ///
- /// A Message contains a priority denoting the severity of the
- /// message, a source describing its origin, a text describing
- /// its meaning, the time of its creation, and an identifier of
- /// the process and thread that created the message.
- ///
- /// A Message can also contain any number of named parameters
- /// that contain additional information about the event that
- /// caused the message.
-{
-public:
- enum Priority
- {
- PRIO_FATAL = 1, /// A fatal error. The application will most likely terminate. This is the highest priority.
- PRIO_CRITICAL, /// A critical error. The application might not be able to continue running successfully.
- PRIO_ERROR, /// An error. An operation did not complete successfully, but the application as a whole is not affected.
- PRIO_WARNING, /// A warning. An operation completed with an unexpected result.
- PRIO_NOTICE, /// A notice, which is an information with just a higher priority.
- PRIO_INFORMATION, /// An informational message, usually denoting the successful completion of an operation.
- PRIO_DEBUG, /// A debugging message.
- PRIO_TRACE /// A tracing message. This is the lowest priority.
- };
-
- Message();
- /// Creates an empty Message.
- /// The thread and process ids are set.
-
- Message(const std::string& source, const std::string& text, Priority prio);
- /// Creates a Message with the given source, text and priority.
- /// The thread and process ids are set.
-
- Message(const Message& msg);
- /// Creates a Message by copying another one.
-
- Message(const Message& msg, const std::string& text);
- /// Creates a Message by copying all but the text from another message.
-
- ~Message();
- /// Destroys the Message.
-
- Message& operator = (const Message& msg);
- /// Assignment operator.
-
- void swap(Message& msg);
- /// Swaps the message with another one.
-
- void setSource(const std::string& src);
- /// Sets the source of the message.
-
- const std::string& getSource() const;
- /// Returns the source of the message.
-
- void setText(const std::string& text);
- /// Sets the text of the message.
-
- const std::string& getText() const;
- /// Returns the text of the message.
-
- void setPriority(Priority prio);
- /// Sets the priority of the message.
-
- Priority getPriority() const;
- /// Returns the priority of the message.
-
- void setTime(const Timestamp& time);
- /// Sets the time of the message.
-
- const Timestamp& getTime() const;
- /// Returns the time of the message.
-
- void setThread(const std::string& thread);
- /// Sets the thread identifier for the message.
-
- const std::string& getThread() const;
- /// Returns the thread identifier for the message.
-
- void setTid(long pid);
- /// Sets the numeric thread identifier for the message.
-
- long getTid() const;
- /// Returns the numeric thread identifier for the message.
-
- void setPid(long pid);
- /// Sets the process identifier for the message.
-
- long getPid() const;
- /// Returns the process identifier for the message.
-
- const std::string& operator [] (const std::string& param) const;
- /// Returns a const reference to the value of the parameter
- /// with the given name. Throws a NotFoundException if the
- /// parameter does not exist.
-
- std::string& operator [] (const std::string& param);
- /// Returns a reference to the value of the parameter with the
- /// given name. This can be used to set the parameter's value.
- /// If the parameter does not exist, it is created with an
- /// empty string value.
-
-protected:
- void init();
- typedef std::map<std::string, std::string> StringMap;
-
-private:
- std::string _source;
- std::string _text;
- Priority _prio;
- Timestamp _time;
- int _tid;
- std::string _thread;
- long _pid;
- StringMap* _pMap;
-};
-
-
-//
-// inlines
-//
-inline const std::string& Message::getSource() const
-{
- return _source;
-}
-
-
-inline const std::string& Message::getText() const
-{
- return _text;
-}
-
-
-inline Message::Priority Message::getPriority() const
-{
- return _prio;
-}
-
-
-inline const Timestamp& Message::getTime() const
-{
- return _time;
-}
-
-
-inline const std::string& Message::getThread() const
-{
- return _thread;
-}
-
-
-inline long Message::getTid() const
-{
- return _tid;
-}
-
-
-inline long Message::getPid() const
-{
- return _pid;
-}
-
-
-inline void swap(Message& m1, Message& m2)
-{
- m1.swap(m2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Message_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/MetaObject.h b/Utilities/Poco/Foundation/include/Poco/MetaObject.h
deleted file mode 100755
index 4c85529b95..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/MetaObject.h
+++ /dev/null
@@ -1,223 +0,0 @@
-//
-// MetaObject.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: ClassLoader
-//
-// Definition of the MetaObject class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_MetaObject_INCLUDED
-#define Foundation_MetaObject_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include "Poco/SingletonHolder.h"
-#include <set>
-
-
-namespace Poco {
-
-
-template <class B>
-class AbstractMetaObject
- /// A MetaObject stores some information
- /// about a C++ class. The MetaObject class
- /// is used by the Manifest class.
- /// AbstractMetaObject is a common base class
- /// for all MetaObject in a rooted class hierarchy.
- /// A MetaObject can also be used as an object
- /// factory for its class.
-{
-public:
- AbstractMetaObject(const char* name): _name(name)
- {
- }
-
- virtual ~AbstractMetaObject()
- {
- for (typename ObjectSet::iterator it = _deleteSet.begin(); it != _deleteSet.end(); ++it)
- {
- delete *it;
- }
- }
-
- const char* name() const
- {
- return _name;
- }
-
- virtual B* create() const = 0;
- /// Create a new instance of a class.
- /// Cannot be used for singletons.
-
- virtual B& instance() const = 0;
- /// Returns a reference to the only instance
- /// of the class. Used for singletons only.
-
- virtual bool canCreate() const = 0;
- /// Returns true iff the create method can be used
- /// to create instances of the class.
- /// Returns false if the class is a singleton.
-
- virtual void destroy(B* pObject) const
- /// If pObject was owned by meta object, the
- /// ownership of the deleted object is removed
- /// and the object is deleted.
- {
- typename ObjectSet::iterator it = _deleteSet.find(pObject);
-
- if (it != _deleteSet.end())
- {
- _deleteSet.erase(pObject);
- delete pObject;
- }
- }
-
- B* autoDelete(B* pObject) const
- /// Give ownership of pObject to the meta object.
- /// The meta object will delete all objects it owns
- /// when it is destroyed.
- ///
- /// Returns pObject.
- {
- if (this->canCreate()) // guard against singleton
- {
- poco_check_ptr (pObject);
- _deleteSet.insert(pObject);
- }
- else throw InvalidAccessException("Cannot take ownership of", this->name());
-
- return pObject;
- }
-
- virtual bool isAutoDelete(B* pObject) const
- /// Returns true if the object is owned
- /// by meta object.
- ///
- /// Overloaded in MetaSingleton - returns true
- /// if the class is a singleton.
- {
- return _deleteSet.find(pObject) != _deleteSet.end();
- }
-
-private:
- AbstractMetaObject();
- AbstractMetaObject(const AbstractMetaObject&);
- AbstractMetaObject& operator = (const AbstractMetaObject&);
-
- typedef std::set<B*> ObjectSet;
-
- const char* _name;
- mutable ObjectSet _deleteSet;
-};
-
-
-template <class C, class B>
-class MetaObject: public AbstractMetaObject<B>
- /// A MetaObject stores some information
- /// about a C++ class. The MetaObject class
- /// is used by the Manifest class.
- /// A MetaObject can also be used as an object
- /// factory for its class.
-{
-public:
- MetaObject(const char* name): AbstractMetaObject<B>(name)
- {
- }
-
- ~MetaObject()
- {
- }
-
- B* create() const
- {
- return new C;
- }
-
- B& instance() const
- {
- throw InvalidAccessException("Not a singleton. Use create() to create instances of", this->name());
- }
-
- bool canCreate() const
- {
- return true;
- }
-};
-
-
-template <class C, class B>
-class MetaSingleton: public AbstractMetaObject<B>
- /// A SingletonMetaObject disables the create() method
- /// and instead offers an instance() method to access
- /// the single instance of its class.
-{
-public:
- MetaSingleton(const char* name): AbstractMetaObject<B>(name)
- {
- }
-
- ~MetaSingleton()
- {
- }
-
- B* create() const
- {
- throw InvalidAccessException("Cannot create instances of a singleton class. Use instance() to obtain a", this->name());
- }
-
- bool canCreate() const
- {
- return false;
- }
-
- B& instance() const
- {
- return *_object.get();
- }
-
- bool isAutoDelete(B* pObject) const
- {
- return true;
- }
-
-private:
- mutable SingletonHolder<C> _object;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_MetaObject_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/MetaProgramming.h b/Utilities/Poco/Foundation/include/Poco/MetaProgramming.h
deleted file mode 100755
index 2b802cd13d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/MetaProgramming.h
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// TypeChecks.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: MetaProgramming
-//
-// Common definitions useful for Meta Template Programming
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_TypeChecks_INCLUDED
-#define Foundation_TypeChecks_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-template <typename T>
-struct IsReference
- ///Use this struct to determine if a template type is a reference
-{
- enum
- {
- VALUE = 0
- };
-};
-
-
-template <typename T>
-struct IsReference<T&>
-{
- enum
- {
- VALUE = 1
- };
-};
-
-
-template <typename T>
-struct IsReference<const T&>
-{
- enum
- {
- VALUE = 1
- };
-};
-
-
-
-template <typename T>
-struct IsConst
- ///Use this struct to determine if a template type is a const type
-{
- enum
- {
- VALUE = 0
- };
-};
-
-
-template <typename T>
-struct IsConst<const T&>
-{
- enum
- {
- VALUE = 1
- };
-};
-
-
-template <typename T>
-struct IsConst<const T>
-{
- enum
- {
- VALUE = 1
- };
-};
-
-
-template <typename T>
-struct TypeWrapper
- /// Use the type wrapper if you want to dedecouple constness and references from template types
-{
- typedef T TYPE;
- typedef const T CONSTTYPE;
- typedef T& REFTYPE;
- typedef const T& CONSTREFTYPE;
-};
-
-
-template <typename T>
-struct TypeWrapper<const T>
-{
- typedef T TYPE;
- typedef const T CONSTTYPE;
- typedef T& REFTYPE;
- typedef const T& CONSTREFTYPE;
-};
-
-
-template <typename T>
-struct TypeWrapper<const T&>
-{
- typedef T TYPE;
- typedef const T CONSTTYPE;
- typedef T& REFTYPE;
- typedef const T& CONSTREFTYPE;
-};
-
-
-template <typename T>
-struct TypeWrapper<T&>
-{
- typedef T TYPE;
- typedef const T CONSTTYPE;
- typedef T& REFTYPE;
- typedef const T& CONSTREFTYPE;
-};
-
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/Mutex.h b/Utilities/Poco/Foundation/include/Poco/Mutex.h
deleted file mode 100755
index a4a476c96e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Mutex.h
+++ /dev/null
@@ -1,237 +0,0 @@
-//
-// Mutex.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Mutex
-//
-// Definition of the Mutex and FastMutex classes.
-//
-// Copyright (c) 2004-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.
-//
-
-
-#ifndef Foundation_Mutex_INCLUDED
-#define Foundation_Mutex_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include "Poco/ScopedLock.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/Mutex_WIN32.h"
-#else
-#include "Poco/Mutex_POSIX.h"
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API Mutex: private MutexImpl
- /// A Mutex (mutual exclusion) is a synchronization
- /// mechanism used to control access to a shared resource
- /// in a concurrent (multithreaded) scenario.
- /// Mutexes are recursive, that is, the same mutex can be
- /// locked multiple times by the same thread (but, of course,
- /// not by other threads).
- /// Using the ScopedLock class is the preferred way to automatically
- /// lock and unlock a mutex.
-{
-public:
- typedef Poco::ScopedLock<Mutex> ScopedLock;
-
- Mutex();
- /// creates the Mutex.
-
- ~Mutex();
- /// destroys the Mutex.
-
- void lock();
- /// Locks the mutex. Blocks if the mutex
- /// is held by another thread.
-
- void lock(long milliseconds);
- /// Locks the mutex. Blocks up to the given number of milliseconds
- /// if the mutex is held by another thread. Throws a TimeoutException
- /// if the mutex can not be locked within the given timeout.
- ///
- /// Performance Note: On most platforms (including Windows), this member function is
- /// implemented using a loop calling (the equivalent of) tryLock() and Thread::sleep().
- /// On POSIX platforms that support pthread_mutex_timedlock(), this is used.
-
- bool tryLock();
- /// Tries to lock the mutex. Returns false immediately
- /// if the mutex is already held by another thread.
- /// Returns true if the mutex was successfully locked.
-
- bool tryLock(long milliseconds);
- /// Locks the mutex. Blocks up to the given number of milliseconds
- /// if the mutex is held by another thread.
- /// Returns true if the mutex was successfully locked.
- ///
- /// Performance Note: On most platforms (including Windows), this member function is
- /// implemented using a loop calling (the equivalent of) tryLock() and Thread::sleep().
- /// On POSIX platforms that support pthread_mutex_timedlock(), this is used.
-
- void unlock();
- /// Unlocks the mutex so that it can be acquired by
- /// other threads.
-
-private:
- Mutex(const Mutex&);
- Mutex& operator = (const Mutex&);
-};
-
-
-class Foundation_API FastMutex: private FastMutexImpl
- /// A FastMutex (mutual exclusion) is similar to a Mutex.
- /// Unlike a Mutex, however, a FastMutex is not recursive,
- /// which means that a deadlock will occur if the same
- /// thread tries to lock a mutex it has already locked again.
- /// Locking a FastMutex is faster than locking a recursive Mutex.
- /// Using the ScopedLock class is the preferred way to automatically
- /// lock and unlock a mutex.
-{
-public:
- typedef Poco::ScopedLock<FastMutex> ScopedLock;
-
- FastMutex();
- /// creates the Mutex.
-
- ~FastMutex();
- /// destroys the Mutex.
-
- void lock();
- /// Locks the mutex. Blocks if the mutex
- /// is held by another thread.
-
- void lock(long milliseconds);
- /// Locks the mutex. Blocks up to the given number of milliseconds
- /// if the mutex is held by another thread. Throws a TimeoutException
- /// if the mutex can not be locked within the given timeout.
- ///
- /// Performance Note: On most platforms (including Windows), this member function is
- /// implemented using a loop calling (the equivalent of) tryLock() and Thread::sleep().
- /// On POSIX platforms that support pthread_mutex_timedlock(), this is used.
-
- bool tryLock();
- /// Tries to lock the mutex. Returns false immediately
- /// if the mutex is already held by another thread.
- /// Returns true if the mutex was successfully locked.
-
- bool tryLock(long milliseconds);
- /// Locks the mutex. Blocks up to the given number of milliseconds
- /// if the mutex is held by another thread.
- /// Returns true if the mutex was successfully locked.
- ///
- /// Performance Note: On most platforms (including Windows), this member function is
- /// implemented using a loop calling (the equivalent of) tryLock() and Thread::sleep().
- /// On POSIX platforms that support pthread_mutex_timedlock(), this is used.
-
- void unlock();
- /// Unlocks the mutex so that it can be acquired by
- /// other threads.
-
-private:
- FastMutex(const FastMutex&);
- FastMutex& operator = (const FastMutex&);
-};
-
-
-//
-// inlines
-//
-inline void Mutex::lock()
-{
- lockImpl();
-}
-
-
-inline void Mutex::lock(long milliseconds)
-{
- if (!tryLockImpl(milliseconds))
- throw TimeoutException();
-}
-
-
-inline bool Mutex::tryLock()
-{
- return tryLockImpl();
-}
-
-
-inline bool Mutex::tryLock(long milliseconds)
-{
- return tryLockImpl(milliseconds);
-}
-
-
-inline void Mutex::unlock()
-{
- unlockImpl();
-}
-
-
-inline void FastMutex::lock()
-{
- lockImpl();
-}
-
-
-inline void FastMutex::lock(long milliseconds)
-{
- if (!tryLockImpl(milliseconds))
- throw TimeoutException();
-}
-
-
-inline bool FastMutex::tryLock()
-{
- return tryLockImpl();
-}
-
-
-inline bool FastMutex::tryLock(long milliseconds)
-{
- return tryLockImpl(milliseconds);
-}
-
-
-inline void FastMutex::unlock()
-{
- unlockImpl();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Mutex_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Mutex_POSIX.h b/Utilities/Poco/Foundation/include/Poco/Mutex_POSIX.h
deleted file mode 100755
index 33bb7ee7de..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Mutex_POSIX.h
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// Mutex_POSIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Mutex
-//
-// Definition of the MutexImpl and FastMutexImpl classes for POSIX Threads.
-//
-// Copyright (c) 2004-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.
-//
-
-
-#ifndef Foundation_Mutex_POSIX_INCLUDED
-#define Foundation_Mutex_POSIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include <pthread.h>
-#include <errno.h>
-
-
-namespace Poco {
-
-
-class Foundation_API MutexImpl
-{
-protected:
- MutexImpl();
- MutexImpl(bool fast);
- ~MutexImpl();
- void lockImpl();
- bool tryLockImpl();
- bool tryLockImpl(long milliseconds);
- void unlockImpl();
-
-private:
- pthread_mutex_t _mutex;
-};
-
-
-class Foundation_API FastMutexImpl: public MutexImpl
-{
-protected:
- FastMutexImpl();
- ~FastMutexImpl();
-};
-
-
-//
-// inlines
-//
-inline void MutexImpl::lockImpl()
-{
- if (pthread_mutex_lock(&_mutex))
- throw SystemException("cannot lock mutex");
-}
-
-
-inline bool MutexImpl::tryLockImpl()
-{
- int rc = pthread_mutex_trylock(&_mutex);
- if (rc == 0)
- return true;
- else if (rc == EBUSY)
- return false;
- else
- throw SystemException("cannot lock mutex");
-
-}
-
-
-inline void MutexImpl::unlockImpl()
-{
- if (pthread_mutex_unlock(&_mutex))
- throw SystemException("cannot unlock mutex");
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Mutex_POSIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Mutex_WIN32.h b/Utilities/Poco/Foundation/include/Poco/Mutex_WIN32.h
deleted file mode 100755
index ef44d34b04..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Mutex_WIN32.h
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// Mutex_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Mutex
-//
-// Definition of the MutexImpl and FastMutexImpl classes for WIN32.
-//
-// Copyright (c) 2004-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.
-//
-
-
-#ifndef Foundation_Mutex_WIN32_INCLUDED
-#define Foundation_Mutex_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API MutexImpl
-{
-protected:
- MutexImpl();
- ~MutexImpl();
- void lockImpl();
- bool tryLockImpl();
- bool tryLockImpl(long milliseconds);
- void unlockImpl();
-
-private:
- CRITICAL_SECTION _cs;
-};
-
-
-typedef MutexImpl FastMutexImpl;
-
-
-//
-// inlines
-//
-inline void MutexImpl::lockImpl()
-{
- try
- {
- EnterCriticalSection(&_cs);
- }
- catch (...)
- {
- throw SystemException("cannot lock mutex");
- }
-}
-
-
-inline bool MutexImpl::tryLockImpl()
-{
- try
- {
- return TryEnterCriticalSection(&_cs) == 1;
- }
- catch (...)
- {
- }
- throw SystemException("cannot lock mutex");
-}
-
-
-inline void MutexImpl::unlockImpl()
-{
- LeaveCriticalSection(&_cs);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Mutex_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NObserver.h b/Utilities/Poco/Foundation/include/Poco/NObserver.h
deleted file mode 100755
index 1d05f057d7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NObserver.h
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// NObserver.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: NotificationCenter
-//
-// Definition of the NObserver class template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_NObserver_INCLUDED
-#define Foundation_NObserver_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/AbstractObserver.h"
-
-
-namespace Poco {
-
-
-template <class C, class N>
-class NObserver: public AbstractObserver
- /// This template class implements an adapter that sits between
- /// a NotificationCenter and an object receiving notifications
- /// from it. It is quite similar in concept to the
- /// RunnableAdapter, but provides some NotificationCenter
- /// specific additional methods.
- /// See the NotificationCenter class for information on how
- /// to use this template class.
- ///
- /// This class template is quite similar to the Observer class
- /// template. The only difference is that the NObserver
- /// expects the callback function to accept a const AutoPtr&
- /// instead of a plain pointer as argument, thus simplifying memory
- /// management.
-{
-public:
- typedef AutoPtr<N> NotificationPtr;
- typedef void (C::*Callback)(const NotificationPtr&);
-
- NObserver(C& object, Callback method):
- _pObject(&object),
- _method(method)
- {
- }
-
- NObserver(const NObserver& observer):
- AbstractObserver(observer),
- _pObject(observer._pObject),
- _method(observer._method)
- {
- }
-
- ~NObserver()
- {
- }
-
- NObserver& operator = (const NObserver& observer)
- {
- if (&observer != this)
- {
- _pObject = observer._pObject;
- _method = observer._method;
- }
- return *this;
- }
-
- void notify(Notification* pNf) const
- {
- N* pCastNf = dynamic_cast<N*>(pNf);
- if (pCastNf)
- {
- NotificationPtr ptr(pCastNf, true);
- (_pObject->*_method)(ptr);
- }
- }
-
- bool equals(const AbstractObserver& abstractObserver) const
- {
- const NObserver* pObs = dynamic_cast<const NObserver*>(&abstractObserver);
- return pObs && pObs->_pObject == _pObject && pObs->_method == _method;
- }
-
- bool accepts(Notification* pNf) const
- {
- return dynamic_cast<N*>(pNf) != 0;
- }
-
- AbstractObserver* clone() const
- {
- return new NObserver(*this);
- }
-
-private:
- NObserver();
-
- C* _pObject;
- Callback _method;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NObserver_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedEvent.h b/Utilities/Poco/Foundation/include/Poco/NamedEvent.h
deleted file mode 100755
index e86f63b6c4..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedEvent.h
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// NamedEvent.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedEvent
-//
-// Definition of the NamedEvent class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NamedEvent_INCLUDED
-#define Foundation_NamedEvent_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "Poco/NamedEvent_WIN32U.h"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/NamedEvent_WIN32.h"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "Poco/NamedEvent_UNIX.h"
-#else
-#include "Poco/NamedEvent_VMS.h"
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API NamedEvent: public NamedEventImpl
- /// An NamedEvent is a global synchronization object
- /// that allows one process or thread to signal an
- /// other process or thread that a certain event
- /// has happened.
- ///
- /// Unlike an Event, which itself is the unit of synchronization,
- /// a NamedEvent refers to a named operating system resource being the
- /// unit of synchronization.
- /// In other words, there can be multiple instances of NamedEvent referring
- /// to the same actual synchronization object.
- ///
- /// NamedEvents are always autoresetting.
- ///
- /// There should not be more than one instance of NamedEvent for
- /// a given name in a process. Otherwise, the instances may
- /// interfere with each other.
-{
-public:
- NamedEvent(const std::string& name);
- /// Creates the event.
-
- ~NamedEvent();
- /// Destroys the event.
-
- void set();
- /// Signals the event.
- /// The one thread or process waiting for the event
- /// can resume execution.
-
- void wait();
- /// Waits for the event to become signalled.
-
-private:
- NamedEvent();
- NamedEvent(const NamedEvent&);
- NamedEvent& operator = (const NamedEvent&);
-};
-
-
-//
-// inlines
-//
-inline void NamedEvent::set()
-{
- setImpl();
-}
-
-
-inline void NamedEvent::wait()
-{
- waitImpl();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NamedEvent_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedEvent_UNIX.h b/Utilities/Poco/Foundation/include/Poco/NamedEvent_UNIX.h
deleted file mode 100755
index 4edf6ee632..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedEvent_UNIX.h
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// NamedEvent_UNIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedEvent
-//
-// Definition of the NamedEventImpl class for Unix.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NamedEvent_UNIX_INCLUDED
-#define Foundation_NamedEvent_UNIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
-#include <semaphore.h>
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API NamedEventImpl
-{
-protected:
- NamedEventImpl(const std::string& name);
- ~NamedEventImpl();
- void setImpl();
- void waitImpl();
-
-private:
- std::string getFileName();
-
- std::string _name;
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- sem_t* _sem;
-#else
- int _lockfd; // lock file descriptor
- int _semfd; // file used to identify semaphore
- int _semid; // semaphore id
-#endif
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NamedEvent_UNIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedEvent_VMS.h b/Utilities/Poco/Foundation/include/Poco/NamedEvent_VMS.h
deleted file mode 100755
index 6b291c7889..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedEvent_VMS.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// NamedEvent_VMS.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedEvent
-//
-// Definition of the NamedEventImpl class for OpenVMS.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NamedEvent_VMS_INCLUDED
-#define Foundation_NamedEvent_VMS_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API NamedEventImpl
-{
-protected:
- NamedEventImpl(const std::string& name);
- ~NamedEventImpl();
- void setImpl();
- void waitImpl();
-
-private:
- std::string _name;
- unsigned short _mbxChan;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NamedEvent_VMS_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedEvent_WIN32.h b/Utilities/Poco/Foundation/include/Poco/NamedEvent_WIN32.h
deleted file mode 100755
index d69f32ed2e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedEvent_WIN32.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// NamedEvent_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedEvent
-//
-// Definition of the NamedEventImpl class for Windows.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NamedEvent_WIN32_INCLUDED
-#define Foundation_NamedEvent_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API NamedEventImpl
-{
-protected:
- NamedEventImpl(const std::string& name);
- ~NamedEventImpl();
- void setImpl();
- void waitImpl();
-
-private:
- std::string _name;
- HANDLE _event;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NamedEvent_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedEvent_WIN32U.h b/Utilities/Poco/Foundation/include/Poco/NamedEvent_WIN32U.h
deleted file mode 100755
index a11ac3c2a5..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedEvent_WIN32U.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// NamedEvent_WIN32U.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedEvent
-//
-// Definition of the NamedEventImpl class for Windows.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NamedEvent_WIN32U_INCLUDED
-#define Foundation_NamedEvent_WIN32U_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API NamedEventImpl
-{
-protected:
- NamedEventImpl(const std::string& name);
- ~NamedEventImpl();
- void setImpl();
- void waitImpl();
-
-private:
- std::string _name;
- std::wstring _uname;
- HANDLE _event;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NamedEvent_WIN32U_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedMutex.h b/Utilities/Poco/Foundation/include/Poco/NamedMutex.h
deleted file mode 100755
index b819633ac3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedMutex.h
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// NamedMutex.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedMutex
-//
-// Definition of the NamedMutex class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NamedMutex_INCLUDED
-#define Foundation_NamedMutex_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/ScopedLock.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "Poco/NamedMutex_WIN32U.h"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/NamedMutex_WIN32.h"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "Poco/NamedMutex_UNIX.h"
-#else
-#include "Poco/NamedMutex_VMS.h"
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API NamedMutex: private NamedMutexImpl
- /// A NamedMutex (mutual exclusion) is a global synchronization
- /// mechanism used to control access to a shared resource
- /// in a concurrent (multi process) scenario.
- /// Using the ScopedLock class is the preferred way to automatically
- /// lock and unlock a mutex.
- ///
- /// Unlike a Mutex or a FastMutex, which itself is the unit of synchronization,
- /// a NamedMutex refers to a named operating system resource being the
- /// unit of synchronization.
- /// In other words, there can be multiple instances of NamedMutex referring
- /// to the same actual synchronization object.
- ///
- ///
- /// There should not be more than one instance of NamedMutex for
- /// a given name in a process. Otherwise, the instances may
- /// interfere with each other.
-{
-public:
- typedef Poco::ScopedLock<NamedMutex> ScopedLock;
-
- NamedMutex(const std::string& name);
- /// creates the Mutex.
-
- ~NamedMutex();
- /// destroys the Mutex.
-
- void lock();
- /// Locks the mutex. Blocks if the mutex
- /// is held by another process or thread.
-
- bool tryLock();
- /// Tries to lock the mutex. Returns false immediately
- /// if the mutex is already held by another process or thread.
- /// Returns true if the mutex was successfully locked.
-
- void unlock();
- /// Unlocks the mutex so that it can be acquired by
- /// other threads.
-
-private:
- NamedMutex();
- NamedMutex(const NamedMutex&);
- NamedMutex& operator = (const NamedMutex&);
-};
-
-
-//
-// inlines
-//
-inline void NamedMutex::lock()
-{
- lockImpl();
-}
-
-
-inline bool NamedMutex::tryLock()
-{
- return tryLockImpl();
-}
-
-
-inline void NamedMutex::unlock()
-{
- unlockImpl();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NamedMutex_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedMutex_UNIX.h b/Utilities/Poco/Foundation/include/Poco/NamedMutex_UNIX.h
deleted file mode 100755
index fccd9880f3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedMutex_UNIX.h
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// NamedMutex_UNIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedMutex
-//
-// Definition of the NamedMutexImpl class for Unix.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NamedMutex_UNIX_INCLUDED
-#define Foundation_NamedMutex_UNIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
-#include <semaphore.h>
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API NamedMutexImpl
-{
-protected:
- NamedMutexImpl(const std::string& name);
- ~NamedMutexImpl();
- void lockImpl();
- bool tryLockImpl();
- void unlockImpl();
-
-private:
- std::string getFileName();
-
- std::string _name;
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- sem_t* _sem;
-#else
- int _lockfd; // lock file descriptor
- int _semfd; // file used to identify semaphore
- int _semid; // semaphore id
-#endif
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NamedMutex_UNIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedMutex_VMS.h b/Utilities/Poco/Foundation/include/Poco/NamedMutex_VMS.h
deleted file mode 100755
index 18084fdbf8..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedMutex_VMS.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// NamedMutex_VMS.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedMutex
-//
-// Definition of the NamedMutexImpl class for OpenVMS.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NamedMutex_VMS_INCLUDED
-#define Foundation_NamedMutex_VMS_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <descrip.h>
-#include <lckdef.h>
-
-
-namespace Poco {
-
-
-class Foundation_API NamedMutexImpl
-{
-protected:
- NamedMutexImpl(const std::string& name);
- ~NamedMutexImpl();
- void lockImpl();
- bool tryLockImpl();
- void unlockImpl();
-
-private:
- std::string _name;
- struct dsc$descriptor_s _nameDesc;
- int _lksb[4];
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NamedMutex_VMS_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedMutex_WIN32.h b/Utilities/Poco/Foundation/include/Poco/NamedMutex_WIN32.h
deleted file mode 100755
index a3a76ad7c7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedMutex_WIN32.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// NamedMutex_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedMutex
-//
-// Definition of the NamedMutexImpl class for Windows.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NamedMutex_WIN32_INCLUDED
-#define Foundation_NamedMutex_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API NamedMutexImpl
-{
-protected:
- NamedMutexImpl(const std::string& name);
- ~NamedMutexImpl();
- void lockImpl();
- bool tryLockImpl();
- void unlockImpl();
-
-private:
- std::string _name;
- HANDLE _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NamedMutex_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedMutex_WIN32U.h b/Utilities/Poco/Foundation/include/Poco/NamedMutex_WIN32U.h
deleted file mode 100755
index 72c1eebe61..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedMutex_WIN32U.h
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// NamedMutex_WIN32U.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedMutex
-//
-// Definition of the NamedMutexImpl class for Windows.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NamedMutex_WIN32U_INCLUDED
-#define Foundation_NamedMutex_WIN32U_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API NamedMutexImpl
-{
-protected:
- NamedMutexImpl(const std::string& name);
- ~NamedMutexImpl();
- void lockImpl();
- bool tryLockImpl();
- void unlockImpl();
-
-private:
- std::string _name;
- std::wstring _uname;
- HANDLE _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NamedMutex_WIN32U_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NamedTuple.h b/Utilities/Poco/Foundation/include/Poco/NamedTuple.h
deleted file mode 100755
index 55cace79ba..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NamedTuple.h
+++ /dev/null
@@ -1,4484 +0,0 @@
-//
-// NamedTuple.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: NamedTuple
-//
-// Definition of the NamedTuple class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_NamedTuple_INCLUDED
-#define Foundation_NamedTuple_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Tuple.h"
-#include "Poco/TypeList.h"
-#include "Poco/DynamicAny.h"
-#include "Poco/SharedPtr.h"
-#include "Poco/Format.h"
-
-
-namespace Poco {
-
-
-template<class T0,
- class T1 = NullTypeList,
- class T2 = NullTypeList,
- class T3 = NullTypeList,
- class T4 = NullTypeList,
- class T5 = NullTypeList,
- class T6 = NullTypeList,
- class T7 = NullTypeList,
- class T8 = NullTypeList,
- class T9 = NullTypeList,
- class T10 = NullTypeList,
- class T11 = NullTypeList,
- class T12 = NullTypeList,
- class T13 = NullTypeList,
- class T14 = NullTypeList,
- class T15 = NullTypeList,
- class T16 = NullTypeList,
- class T17 = NullTypeList,
- class T18 = NullTypeList,
- class T19 = NullTypeList>
-struct NamedTuple: public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::Type Type;
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17),
- typename TypeWrapper<T18>::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18),
- typename TypeWrapper<T19>::CONSTTYPE& t19 = POCO_TYPEWRAPPER_DEFAULTVALUE(T19)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17),
- typename TypeWrapper<T18>::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18),
- typename TypeWrapper<T19>::CONSTTYPE& t19 = POCO_TYPEWRAPPER_DEFAULTVALUE(T19)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- const std::string& n10 = "K",
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- const std::string& n11 = "L",
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- const std::string& n12 = "M",
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- const std::string& n13 = "N",
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- const std::string& n14 = "O",
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- const std::string& n15 = "P",
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- const std::string& n16 = "Q",
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- const std::string& n17 = "R",
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17),
- const std::string& n18 = "S",
- typename TypeWrapper<T18>::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18),
- const std::string& n19 = "T",
- typename TypeWrapper<T19>::CONSTTYPE& t19 = POCO_TYPEWRAPPER_DEFAULTVALUE(T19)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- case 10: return TupleType::template get<10>();
- case 11: return TupleType::template get<11>();
- case 12: return TupleType::template get<12>();
- case 13: return TupleType::template get<13>();
- case 14: return TupleType::template get<14>();
- case 15: return TupleType::template get<15>();
- case 16: return TupleType::template get<16>();
- case 17: return TupleType::template get<17>();
- case 18: return TupleType::template get<18>();
- case 19: return TupleType::template get<19>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J",
- const std::string& n10 = "K",
- const std::string& n11 = "L",
- const std::string& n12 = "M",
- const std::string& n13 = "N",
- const std::string& n14 = "O",
- const std::string& n15 = "P",
- const std::string& n16 = "Q",
- const std::string& n17 = "R",
- const std::string& n18 = "S",
- const std::string& n19 = "T")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- _pNames->push_back(n10);
- _pNames->push_back(n11);
- _pNames->push_back(n12);
- _pNames->push_back(n13);
- _pNames->push_back(n14);
- _pNames->push_back(n15);
- _pNames->push_back(n16);
- _pNames->push_back(n17);
- _pNames->push_back(n18);
- _pNames->push_back(n19);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13,
- class T14,
- class T15,
- class T16,
- class T17,
- class T18>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::Type Type;
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17),
- typename TypeWrapper<T18>::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17),
- typename TypeWrapper<T18>::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- const std::string& n10 = "K",
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- const std::string& n11 = "L",
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- const std::string& n12 = "M",
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- const std::string& n13 = "N",
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- const std::string& n14 = "O",
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- const std::string& n15 = "P",
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- const std::string& n16 = "Q",
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- const std::string& n17 = "R",
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17),
- const std::string& n18 = "S",
- typename TypeWrapper<T18>::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- case 10: return TupleType::template get<10>();
- case 11: return TupleType::template get<11>();
- case 12: return TupleType::template get<12>();
- case 13: return TupleType::template get<13>();
- case 14: return TupleType::template get<14>();
- case 15: return TupleType::template get<15>();
- case 16: return TupleType::template get<16>();
- case 17: return TupleType::template get<17>();
- case 18: return TupleType::template get<18>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J",
- const std::string& n10 = "K",
- const std::string& n11 = "L",
- const std::string& n12 = "M",
- const std::string& n13 = "N",
- const std::string& n14 = "O",
- const std::string& n15 = "P",
- const std::string& n16 = "Q",
- const std::string& n17 = "R",
- const std::string& n18 = "S")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- _pNames->push_back(n10);
- _pNames->push_back(n11);
- _pNames->push_back(n12);
- _pNames->push_back(n13);
- _pNames->push_back(n14);
- _pNames->push_back(n15);
- _pNames->push_back(n16);
- _pNames->push_back(n17);
- _pNames->push_back(n18);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13,
- class T14,
- class T15,
- class T16,
- class T17>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::Type Type;
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- const std::string& n10 = "K",
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- const std::string& n11 = "L",
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- const std::string& n12 = "M",
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- const std::string& n13 = "N",
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- const std::string& n14 = "O",
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- const std::string& n15 = "P",
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- const std::string& n16 = "Q",
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- const std::string& n17 = "R",
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- case 10: return TupleType::template get<10>();
- case 11: return TupleType::template get<11>();
- case 12: return TupleType::template get<12>();
- case 13: return TupleType::template get<13>();
- case 14: return TupleType::template get<14>();
- case 15: return TupleType::template get<15>();
- case 16: return TupleType::template get<16>();
- case 17: return TupleType::template get<17>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J",
- const std::string& n10 = "K",
- const std::string& n11 = "L",
- const std::string& n12 = "M",
- const std::string& n13 = "N",
- const std::string& n14 = "O",
- const std::string& n15 = "P",
- const std::string& n16 = "Q",
- const std::string& n17 = "R")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- _pNames->push_back(n10);
- _pNames->push_back(n11);
- _pNames->push_back(n12);
- _pNames->push_back(n13);
- _pNames->push_back(n14);
- _pNames->push_back(n15);
- _pNames->push_back(n16);
- _pNames->push_back(n17);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13,
- class T14,
- class T15,
- class T16>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::Type Type;
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- const std::string& n10 = "K",
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- const std::string& n11 = "L",
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- const std::string& n12 = "M",
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- const std::string& n13 = "N",
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- const std::string& n14 = "O",
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- const std::string& n15 = "P",
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- const std::string& n16 = "Q",
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- case 10: return TupleType::template get<10>();
- case 11: return TupleType::template get<11>();
- case 12: return TupleType::template get<12>();
- case 13: return TupleType::template get<13>();
- case 14: return TupleType::template get<14>();
- case 15: return TupleType::template get<15>();
- case 16: return TupleType::template get<16>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J",
- const std::string& n10 = "K",
- const std::string& n11 = "L",
- const std::string& n12 = "M",
- const std::string& n13 = "N",
- const std::string& n14 = "O",
- const std::string& n15 = "P",
- const std::string& n16 = "Q")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- _pNames->push_back(n10);
- _pNames->push_back(n11);
- _pNames->push_back(n12);
- _pNames->push_back(n13);
- _pNames->push_back(n14);
- _pNames->push_back(n15);
- _pNames->push_back(n16);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13,
- class T14,
- class T15>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- const std::string& n10 = "K",
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- const std::string& n11 = "L",
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- const std::string& n12 = "M",
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- const std::string& n13 = "N",
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- const std::string& n14 = "O",
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- const std::string& n15 = "P",
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- case 10: return TupleType::template get<10>();
- case 11: return TupleType::template get<11>();
- case 12: return TupleType::template get<12>();
- case 13: return TupleType::template get<13>();
- case 14: return TupleType::template get<14>();
- case 15: return TupleType::template get<15>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J",
- const std::string& n10 = "K",
- const std::string& n11 = "L",
- const std::string& n12 = "M",
- const std::string& n13 = "N",
- const std::string& n14 = "O",
- const std::string& n15 = "P")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- _pNames->push_back(n10);
- _pNames->push_back(n11);
- _pNames->push_back(n12);
- _pNames->push_back(n13);
- _pNames->push_back(n14);
- _pNames->push_back(n15);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13,
- class T14>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- const std::string& n10 = "K",
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- const std::string& n11 = "L",
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- const std::string& n12 = "M",
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- const std::string& n13 = "N",
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- const std::string& n14 = "O",
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- case 10: return TupleType::template get<10>();
- case 11: return TupleType::template get<11>();
- case 12: return TupleType::template get<12>();
- case 13: return TupleType::template get<13>();
- case 14: return TupleType::template get<14>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J",
- const std::string& n10 = "K",
- const std::string& n11 = "L",
- const std::string& n12 = "M",
- const std::string& n13 = "N",
- const std::string& n14 = "O")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- _pNames->push_back(n10);
- _pNames->push_back(n11);
- _pNames->push_back(n12);
- _pNames->push_back(n13);
- _pNames->push_back(n14);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- const std::string& n10 = "K",
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- const std::string& n11 = "L",
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- const std::string& n12 = "M",
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- const std::string& n13 = "N",
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- case 10: return TupleType::template get<10>();
- case 11: return TupleType::template get<11>();
- case 12: return TupleType::template get<12>();
- case 13: return TupleType::template get<13>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J",
- const std::string& n10 = "K",
- const std::string& n11 = "L",
- const std::string& n12 = "M",
- const std::string& n13 = "N")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- _pNames->push_back(n10);
- _pNames->push_back(n11);
- _pNames->push_back(n12);
- _pNames->push_back(n13);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- const std::string& n10 = "K",
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- const std::string& n11 = "L",
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- const std::string& n12 = "M",
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12), _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- case 10: return TupleType::template get<10>();
- case 11: return TupleType::template get<11>();
- case 12: return TupleType::template get<12>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J",
- const std::string& n10 = "K",
- const std::string& n11 = "L",
- const std::string& n12 = "M")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- _pNames->push_back(n10);
- _pNames->push_back(n11);
- _pNames->push_back(n12);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- const std::string& n10 = "K",
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- const std::string& n11 = "L",
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- case 10: return TupleType::template get<10>();
- case 11: return TupleType::template get<11>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J",
- const std::string& n10 = "K",
- const std::string& n11 = "L")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- _pNames->push_back(n10);
- _pNames->push_back(n11);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- const std::string& n10 = "K",
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10), _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- case 10: return TupleType::template get<10>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J",
- const std::string& n10 = "K")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- _pNames->push_back(n10);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- const std::string& n9 = "J",
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- case 9: return TupleType::template get<9>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I",
- const std::string& n9 = "J")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- _pNames->push_back(n9);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- const std::string& n8 = "I",
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7,t8),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7,n8);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- case 8: return TupleType::template get<8>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H",
- const std::string& n8 = "I")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- _pNames->push_back(n8);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,T7,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6,T7>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6,T7> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6,T7>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- const std::string& n7 = "H",
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7)):
- TupleType(t0,t1,t2,t3,t4,t5,t6,t7),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6,n7);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- case 7: return TupleType::template get<7>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G",
- const std::string& n7 = "H")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- _pNames->push_back(n7);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,T6,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5,T6>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5,T6> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5,T6>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6)):
- TupleType(t0,t1,t2,t3,t4,t5,t6), _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6)):
- TupleType(t0,t1,t2,t3,t4,t5,t6)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- const std::string& n6 = "G",
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6)):
- TupleType(t0,t1,t2,t3,t4,t5,t6), _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5,n6);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- case 6: return TupleType::template get<6>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F",
- const std::string& n6 = "G")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- _pNames->push_back(n6);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5>
-struct NamedTuple<T0,T1,T2,T3,T4,T5,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4,T5>
-{
- typedef Tuple<T0,T1,T2,T3,T4,T5> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4,T5>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5)):
- TupleType(t0,t1,t2,t3,t4,t5), _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5)):
- TupleType(t0,t1,t2,t3,t4,t5)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- const std::string& n5 = "F",
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5)):
- TupleType(t0,t1,t2,t3,t4,t5), _pNames(0)
- {
- init(n0,n1,n2,n3,n4,n5);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- case 5: return TupleType::template get<5>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E",
- const std::string& n5 = "F")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- _pNames->push_back(n5);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3,
- class T4>
-struct NamedTuple<T0,T1,T2,T3,T4,NullTypeList>:
- public Tuple<T0,T1,T2,T3,T4>
-{
- typedef Tuple<T0,T1,T2,T3,T4> TupleType;
- typedef typename Tuple<T0,T1,T2,T3,T4>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4)):
- TupleType(t0,t1,t2,t3,t4),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4)):
- TupleType(t0,t1,t2,t3,t4)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- const std::string& n4 = "E",
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4)):
- TupleType(t0,t1,t2,t3,t4),
- _pNames(0)
- {
- init(n0,n1,n2,n3,n4);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- case 4: return TupleType::template get<4>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D",
- const std::string& n4 = "E")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- _pNames->push_back(n4);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2,
- class T3>
-struct NamedTuple<T0,T1,T2,T3,NullTypeList>:
- public Tuple<T0,T1,T2,T3>
-{
- typedef Tuple<T0,T1,T2,T3> TupleType;
- typedef typename Tuple<T0,T1,T2,T3>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3)):
- TupleType(t0,t1,t2,t3),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3)):
- TupleType(t0,t1,t2,t3)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- const std::string& n3 = "D",
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3)):
- TupleType(t0,t1,t2,t3), _pNames(0)
- {
- init(n0,n1,n2,n3);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- case 3: return TupleType::template get<3>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C",
- const std::string& n3 = "D")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- _pNames->push_back(n3);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1,
- class T2>
-struct NamedTuple<T0,T1,T2,NullTypeList>:
- public Tuple<T0,T1,T2>
-{
- typedef Tuple<T0,T1,T2> TupleType;
- typedef typename Tuple<T0,T1,T2>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2)):
- TupleType(t0,t1,t2),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2)):
- TupleType(t0,t1,t2)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- const std::string& n2 = "C",
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2)):
- TupleType(t0,t1,t2),
- _pNames(0)
- {
- init(n0,n1,n2);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- case 2: return TupleType::template get<2>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B",
- const std::string& n2 = "C")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- _pNames->push_back(n2);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0,
- class T1>
-struct NamedTuple<T0,T1,NullTypeList>:
- public Tuple<T0,T1>
-{
- typedef Tuple<T0,T1> TupleType;
- typedef typename Tuple<T0,T1>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1)):
- TupleType(t0,t1),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1)):
- TupleType(t0,t1)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0,
- typename TypeWrapper<T0>::CONSTTYPE& t0,
- const std::string& n1 = "B",
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1)):
- TupleType(t0,t1),
- _pNames(0)
- {
- init(n0,n1);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- case 1: return TupleType::template get<1>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A",
- const std::string& n1 = "B")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- _pNames->push_back(n1);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-template<class T0>
-struct NamedTuple<T0,NullTypeList>:
- public Tuple<T0>
-{
- typedef Tuple<T0> TupleType;
- typedef typename Tuple<T0>::Type Type;
-
- typedef std::vector<std::string> NameVec;
- typedef SharedPtr<NameVec> NameVecPtr;
-
- NamedTuple(): _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(typename TypeWrapper<T0>::CONSTTYPE& t0):
- TupleType(t0),
- _pNames(0)
- {
- init();
- }
-
- NamedTuple(const NameVecPtr& rNames,
- typename TypeWrapper<T0>::CONSTTYPE& t0):
- TupleType(t0)
- {
- if (rNames->size() != TupleType::length)
- throw InvalidArgumentException("Wrong names vector length.");
-
- _pNames = rNames;
- }
-
- NamedTuple(const std::string& n0, typename TypeWrapper<T0>::CONSTTYPE& t0):
- TupleType(t0),
- _pNames(0)
- {
- init(n0);
- }
-
- const DynamicAny get(const std::string& name) const
- {
- NameVec::const_iterator it = _pNames->begin();
- NameVec::const_iterator itEnd = _pNames->end();
-
- for(std::size_t counter = 0; it != itEnd; ++it, ++counter)
- {
- if (name == *it)
- {
- switch (counter)
- {
- case 0: return TupleType::template get<0>();
- default: throw RangeException();
- }
- }
- }
-
- throw NotFoundException("Name not found: " + name);
- }
-
- const DynamicAny operator [] (const std::string& name) const
- {
- return get(name);
- }
-
- template<int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return TupleType::template get<N>();
- }
-
- template<int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- return TupleType::template set<N>(val);
- }
-
- const NameVecPtr& names()
- {
- return _pNames;
- }
-
- void setName(std::size_t index, const std::string& name)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- (*_pNames)[index] = name;
- }
-
- const std::string& getName(std::size_t index)
- {
- if (index >= _pNames->size())
- throw InvalidArgumentException(format("Invalid index: %z", index));
-
- return (*_pNames)[index];
- }
-
- bool operator == (const NamedTuple& other) const
- {
- return TupleType(*this) == TupleType(other) && _pNames == other._pNames;
- }
-
- bool operator != (const NamedTuple& other) const
- {
- return !(*this == other);
- }
-
- bool operator < (const NamedTuple& other) const
- {
- TupleType th(*this);
- TupleType oth(other);
-
- return (th < oth && _pNames == other._pNames) ||
- (th == oth && _pNames < other._pNames) ||
- (th < oth && _pNames < other._pNames);
- }
-
-private:
- void init(const std::string& n0 = "A")
- {
- if (!_pNames)
- {
- _pNames = new NameVec;
- _pNames->push_back(n0);
- }
- }
-
- NameVecPtr _pNames;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Tuple_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NestedDiagnosticContext.h b/Utilities/Poco/Foundation/include/Poco/NestedDiagnosticContext.h
deleted file mode 100755
index 5391a38c83..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NestedDiagnosticContext.h
+++ /dev/null
@@ -1,196 +0,0 @@
-//
-// NestedDiagnosticContext.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: NestedDiagnosticContext
-//
-// Definition of the NestedDiagnosticContext class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NestedDiagnosticContext_INCLUDED
-#define Foundation_NestedDiagnosticContext_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <vector>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class NDCScope;
-
-
-class Foundation_API NestedDiagnosticContext
- /// This class implements a Nested Diagnostic Context (NDC),
- /// as described in Neil Harrison's article "Patterns for Logging
- /// Diagnostic Messages" in "Pattern Languages of Program Design 3"
- /// (Addison-Wesley).
- ///
- /// A NDC maintains a stack of context information, consisting of
- /// an informational string (e.g., a method name), as well as an
- /// optional source code line number and file name.
- /// NDCs are especially useful for tagging log messages with
- /// context information which is very helpful in a multithreaded
- /// server scenario.
- /// Every thread has its own private NDC, which is automatically
- /// created when needed and destroyed when the thread terminates.
- ///
- /// The NDCScope (or NDC::Scope) class can be used to automatically
- /// push information at the beginning of a scope, and to pop it
- /// at the end.
- /// The poco_ndc(info) macro augments the information with a
- /// source code line number and file name.
-{
-public:
- typedef NDCScope Scope;
-
- NestedDiagnosticContext();
- /// Creates the NestedDiagnosticContext.
-
- NestedDiagnosticContext(const NestedDiagnosticContext& ctx);
- /// Copy constructor.
-
- ~NestedDiagnosticContext();
- /// Destroys the NestedDiagnosticContext.
-
- NestedDiagnosticContext& operator = (const NestedDiagnosticContext& ctx);
- /// Assignment operator.
-
- void push(const std::string& info);
- /// Pushes a context (without line number and filename) onto the stack.
-
- void push(const std::string& info, int line, const char* filename);
- /// Pushes a context (including line number and filename)
- /// onto the stack. Filename must be a static string, such as the
- /// one produced by the __FILE__ preprocessor macro.
-
- void pop();
- /// Pops the top-most context off the stack.
-
- int depth() const;
- /// Returns the depth (number of contexts) of the stack.
-
- std::string toString() const;
- /// Returns the stack as a string with entries
- /// delimited by colons. The string does not contain
- /// line numbers and filenames.
-
- void dump(std::ostream& ostr) const;
- /// Dumps the stack (including line number and filenames)
- /// to the given stream. The entries are delimited by
- /// a newline.
-
- void dump(std::ostream& ostr, const std::string& delimiter) const;
- /// Dumps the stack (including line number and filenames)
- /// to the given stream.
-
- void clear();
- /// Clears the NDC stack.
-
- static NestedDiagnosticContext& current();
- /// Returns the current thread's NDC.
-
-private:
- struct Context
- {
- std::string info;
- const char* file;
- int line;
- };
- typedef std::vector<Context> Stack;
-
- Stack _stack;
-};
-
-
-typedef NestedDiagnosticContext NDC;
-
-
-class Foundation_API NDCScope
- /// This class can be used to automatically push a context onto
- /// the NDC stack at the beginning of a scope, and to pop
- /// the context at the end of the scope.
-{
-public:
- NDCScope(const std::string& info);
- /// Pushes a context on the stack.
-
- NDCScope(const std::string& info, int line, const char* filename);
- /// Pushes a context on the stack.
-
- ~NDCScope();
- /// Pops the top-most context off the stack.
-};
-
-
-//
-// inlines
-//
-inline NDCScope::NDCScope(const std::string& info)
-{
- NestedDiagnosticContext::current().push(info);
-}
-
-
-inline NDCScope::NDCScope(const std::string& info, int line, const char* filename)
-{
- NestedDiagnosticContext::current().push(info, line, filename);
-}
-
-
-inline NDCScope::~NDCScope()
-{
- NestedDiagnosticContext::current().pop();
-}
-
-
-//
-// helper macros
-//
-#define poco_ndc(func) \
- Poco::NDCScope _theNdcScope(#func, __LINE__, __FILE__)
-
-
-#if defined(_DEBUG)
- #define poco_ndc_dbg(func) \
- Poco::NDCScope _theNdcScope(#func, __LINE__, __FILE__)
-#else
- #define poco_ndc_dbg(func)
-#endif
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NestedDiagnosticContext_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Notification.h b/Utilities/Poco/Foundation/include/Poco/Notification.h
deleted file mode 100755
index 1c268cff9c..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// Notification.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: Notification
-//
-// Definition of the Notification class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Notification_INCLUDED
-#define Foundation_Notification_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-#include "Poco/RefCountedObject.h"
-#include "Poco/AutoPtr.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Notification: public RefCountedObject
- /// The base class for all notification classes used
- /// with the NotificationCenter and the NotificationQueue
- /// classes.
- /// The Notification class can be used with the AutoPtr
- /// template class.
-{
-public:
- typedef AutoPtr<Notification> Ptr;
-
- Notification();
- /// Creates the notification.
-
- virtual std::string name() const;
- /// Returns the name of the notification.
- /// The default implementation returns the class name.
-
-protected:
- virtual ~Notification();
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Notification_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NotificationCenter.h b/Utilities/Poco/Foundation/include/Poco/NotificationCenter.h
deleted file mode 100755
index 925a3c8c95..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NotificationCenter.h
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-// NotificationCenter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: NotificationCenter
-//
-// Definition of the NotificationCenter class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NotificationCenter_INCLUDED
-#define Foundation_NotificationCenter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Notification.h"
-#include "Poco/Mutex.h"
-#include <list>
-
-
-namespace Poco {
-
-
-class AbstractObserver;
-
-
-class Foundation_API NotificationCenter
- /// A NotificationCenter is essentially a notification dispatcher.
- /// It notifies all observers of notifications meeting specific criteria.
- /// This information is encapsulated in Notification objects.
- /// Client objects register themselves with the notification center as observers of
- /// specific notifications posted by other objects. When an event occurs, an object
- /// posts an appropriate notification to the notification center. The notification
- /// center invokes the registered method on each matching observer, passing the notification
- /// as argument.
- ///
- /// The order in which observers receive notifications is undefined.
- /// It is possible for the posting object and the observing object to be the same.
- /// The NotificationCenter delivers notifications to observers synchronously.
- /// In other words the postNotification() method does not return until all observers have
- /// received and processed the notification.
- /// If an observer throws an exception while handling a notification, the NotificationCenter
- /// stops dispatching the notification and postNotification() rethrows the exception.
- ///
- /// In a multithreaded scenario, notifications are always delivered in the thread in which the
- /// notification was posted, which may not be the same thread in which an observer registered itself.
- ///
- /// The NotificationCenter class is basically a C++ implementation of the NSNotificationCenter class
- /// found in Apple's Cocoa (or OpenStep).
- ///
- /// While handling a notification, an observer can unregister itself from the notification center,
- /// or it can register or unregister other observers. Observers added during a dispatch cycle
- /// will not receive the current notification.
- ///
- /// The method receiving the notification must be implemented as
- /// void handleNotification(MyNotification* pNf);
- /// The handler method gets co-ownership of the Notification object
- /// and must release it when done. This is best done with an AutoPtr:
- /// void MyClass::handleNotification(MyNotification* pNf)
- /// {
- /// AutoPtr<MyNotification> nf(pNf);
- /// ...
- /// }
- ///
- /// Alternatively, the NObserver class template can be used to register a callback
- /// method. In this case, the callback method receives the Notification in an
- /// AutoPtr and thus does not have to deal with object ownership issues:
- /// void MyClass::handleNotification(const AutoPtr<MyNotification>& pNf)
- /// {
- /// ...
- /// }
-{
-public:
- NotificationCenter();
- /// Creates the NotificationCenter.
-
- ~NotificationCenter();
- /// Destroys the NotificationCenter.
-
- void addObserver(const AbstractObserver& observer);
- /// Registers an observer with the NotificationCenter.
- /// Usage:
- /// Observer<MyClass, MyNotification> obs(*this, &MyClass::handleNotification);
- /// notificationCenter.addObserver(obs);
- ///
- /// Alternatively, the NObserver template class can be used instead of Observer.
-
- void removeObserver(const AbstractObserver& observer);
- /// Unregisters an observer with the NotificationCenter.
-
- void postNotification(Notification::Ptr pNotification);
- /// Posts a notification to the NotificationCenter.
- /// The NotificationCenter then delivers the notification
- /// to all interested observers.
- /// If an observer throws an exception, dispatching terminates
- /// and the exception is rethrown to the caller.
- /// Ownership of the notification object is claimed and the
- /// notification is released before returning. Therefore,
- /// a call like
- /// notificationCenter.postNotification(new MyNotification);
- /// does not result in a memory leak.
-
- bool hasObservers() const;
- /// Returns true iff there is at least one registered observer.
- ///
- /// Can be used to improve performance if an expensive notification
- /// shall only be created and posted if there are any observers.
-
- static NotificationCenter& defaultCenter();
- /// Returns a reference to the default
- /// NotificationCenter.
-
-private:
- typedef std::list<AbstractObserver*> ObserverList;
-
- ObserverList _observers;
- mutable Mutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NotificationCenter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NotificationQueue.h b/Utilities/Poco/Foundation/include/Poco/NotificationQueue.h
deleted file mode 100755
index c6ba1f40b0..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NotificationQueue.h
+++ /dev/null
@@ -1,177 +0,0 @@
-//
-// NotificationQueue.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: NotificationQueue
-//
-// Definition of the NotificationQueue class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NotificationQueue_INCLUDED
-#define Foundation_NotificationQueue_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Notification.h"
-#include "Poco/Mutex.h"
-#include "Poco/Event.h"
-#include <deque>
-
-
-namespace Poco {
-
-
-class NotificationCenter;
-
-
-class Foundation_API NotificationQueue
- /// A NotificationQueue object provides a way to implement asynchronous
- /// notifications. This is especially useful for sending notifications
- /// from one thread to another, for example from a background thread to
- /// the main (user interface) thread.
- ///
- /// The NotificationQueue can also be used to distribute work from
- /// a controlling thread to one or more worker threads. Each worker thread
- /// repeatedly calls waitDequeueNotification() and processes the
- /// returned notification. Special care must be taken when shutting
- /// down a queue with worker threads waiting for notifications.
- /// The recommended sequence to shut down and destroy the queue is to
- /// 1. set a termination flag for every worker thread
- /// 2. call the wakeUpAll() method
- /// 3. join each worker thread
- /// 4. destroy the notification queue.
-{
-public:
- NotificationQueue();
- /// Creates the NotificationQueue.
-
- ~NotificationQueue();
- /// Destroys the NotificationQueue.
-
- void enqueueNotification(Notification::Ptr pNotification);
- /// Enqueues the given notification by adding it to
- /// the end of the queue (FIFO).
- /// The queue takes ownership of the notification, thus
- /// a call like
- /// notificationQueue.enqueueNotification(new MyNotification);
- /// does not result in a memory leak.
-
- void enqueueUrgentNotification(Notification::Ptr pNotification);
- /// Enqueues the given notification by adding it to
- /// the front of the queue (LIFO). The event therefore gets processed
- /// before all other events already in the queue.
- /// The queue takes ownership of the notification, thus
- /// a call like
- /// notificationQueue.enqueueUrgentNotification(new MyNotification);
- /// does not result in a memory leak.
-
- Notification* dequeueNotification();
- /// Dequeues the next pending notification.
- /// Returns 0 (null) if no notification is available.
- /// The caller gains ownership of the notification and
- /// is expected to release it when done with it.
- ///
- /// It is highly recommended that the result is immediately
- /// assigned to a Notification::Ptr, to avoid potential
- /// memory management issues.
-
- Notification* waitDequeueNotification();
- /// Dequeues the next pending notification.
- /// If no notification is available, waits for a notification
- /// to be enqueued.
- /// The caller gains ownership of the notification and
- /// is expected to release it when done with it.
- /// This method returns 0 (null) if wakeUpWaitingThreads()
- /// has been called by another thread.
- ///
- /// It is highly recommended that the result is immediately
- /// assigned to a Notification::Ptr, to avoid potential
- /// memory management issues.
-
- Notification* waitDequeueNotification(long milliseconds);
- /// Dequeues the next pending notification.
- /// If no notification is available, waits for a notification
- /// to be enqueued up to the specified time.
- /// Returns 0 (null) if no notification is available.
- /// The caller gains ownership of the notification and
- /// is expected to release it when done with it.
- ///
- /// It is highly recommended that the result is immediately
- /// assigned to a Notification::Ptr, to avoid potential
- /// memory management issues.
-
- void dispatch(NotificationCenter& notificationCenter);
- /// Dispatches all queued notifications to the given
- /// notification center.
-
- void wakeUpAll();
- /// Wakes up all threads that wait for a notification.
-
- bool empty() const;
- /// Returns true iff the queue is empty.
-
- int size() const;
- /// Returns the number of notifications in the queue.
-
- void clear();
- /// Removes all notifications from the queue.
-
- bool hasIdleThreads() const;
- /// Returns true if the queue has at least one thread waiting
- /// for a notification.
-
- static NotificationQueue& defaultQueue();
- /// Returns a reference to the default
- /// NotificationQueue.
-
-protected:
- Notification::Ptr dequeueOne();
-
-private:
- typedef std::deque<Notification::Ptr> NfQueue;
- struct WaitInfo
- {
- Notification::Ptr pNf;
- Event nfAvailable;
- };
- typedef std::deque<WaitInfo*> WaitQueue;
-
- NfQueue _nfQueue;
- WaitQueue _waitQueue;
- mutable FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NotificationQueue_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NotificationStrategy.h b/Utilities/Poco/Foundation/include/Poco/NotificationStrategy.h
deleted file mode 100755
index 0f14979ac7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NotificationStrategy.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// NotificationStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: NotificationStrategy
-//
-// Definition of the NotificationStrategy interface.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_NotificationStrategy_INCLUDED
-#define Foundation_NotificationStrategy_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-template <class TArgs, class TDelegate>
-class NotificationStrategy
- /// The interface that all notification strategies must implement.
-{
-public:
- NotificationStrategy()
- {
- }
-
- virtual ~NotificationStrategy()
- {
- }
-
- virtual void notify(const void* sender, TArgs& arguments) = 0;
- /// Sends a notification to all registered delegates,
-
- virtual void add(const TDelegate& pDelegate) = 0;
- /// Adds a delegate to the strategy, if the delegate is not yet present
-
- virtual void remove(const TDelegate& pDelegate) = 0;
- /// Removes a delegate from the strategy if found.
-
- virtual void clear() = 0;
- /// Removes all delegates from the strategy.
-
- virtual bool empty() const = 0;
- /// Returns false if the strategy contains at least one delegate.
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/NullChannel.h b/Utilities/Poco/Foundation/include/Poco/NullChannel.h
deleted file mode 100755
index bb3aee5e01..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NullChannel.h
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// NullChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: NullChannel
-//
-// Definition of the NullChannel class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NullChannel_INCLUDED
-#define Foundation_NullChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-
-
-namespace Poco {
-
-
-class Foundation_API NullChannel: public Channel
- /// The NullChannel is the /dev/null of Channels.
- ///
- /// A NullChannel discards all information sent to it.
- /// Furthermore, its setProperty() method ignores
- /// all properties, so it the NullChannel has the
- /// nice feature that it can stand in for any
- /// other channel class in a logging configuration.
-{
-public:
- NullChannel();
- /// Creates the NullChannel.
-
- ~NullChannel();
- /// Destroys the NullChannel.
-
- void log(const Message& msg);
- /// Does nothing.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Ignores both name and value.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NullChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NullStream.h b/Utilities/Poco/Foundation/include/Poco/NullStream.h
deleted file mode 100755
index 6e7df5ae8d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NullStream.h
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// NullStream.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: NullStream
-//
-// Definition of the NullStreamBuf, NullInputStream and NullOutputStream classes.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NullStream_INCLUDED
-#define Foundation_NullStream_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnbufferedStreamBuf.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API NullStreamBuf: public UnbufferedStreamBuf
- /// This stream buffer discards all characters written to it.
- /// Any read operation immediately yields EOF.
-{
-public:
- NullStreamBuf();
- /// Creates a NullStreamBuf.
-
- ~NullStreamBuf();
- /// Destroys the NullStreamBuf.
-
-protected:
- int readFromDevice();
- int writeToDevice(char c);
-};
-
-
-class Foundation_API NullIOS: public virtual std::ios
- /// The base class for NullInputStream and NullOutputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- NullIOS();
- ~NullIOS();
-
-protected:
- NullStreamBuf _buf;
-};
-
-
-class Foundation_API NullInputStream: public NullIOS, public std::istream
- /// Any read operation from this stream immediately
- /// yields EOF.
-{
-public:
- NullInputStream();
- /// Creates the NullInputStream.
-
- ~NullInputStream();
- /// Destroys the NullInputStream.
-};
-
-
-class Foundation_API NullOutputStream: public NullIOS, public std::ostream
- /// This stream discards all characters written to it.
-{
-public:
- NullOutputStream();
- /// Creates the NullOutputStream.
-
- ~NullOutputStream();
- /// Destroys the NullOutputStream.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NullStream_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NumberFormatter.h b/Utilities/Poco/Foundation/include/Poco/NumberFormatter.h
deleted file mode 100755
index dea1a06419..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NumberFormatter.h
+++ /dev/null
@@ -1,669 +0,0 @@
-//
-// NumberFormatter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: NumberFormatter
-//
-// Definition of the NumberFormatter class.
-//
-// Copyright (c) 2004-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.
-//
-
-
-#ifndef Foundation_NumberFormatter_INCLUDED
-#define Foundation_NumberFormatter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API NumberFormatter
- /// The NumberFormatter class provides static methods
- /// for formatting numeric values into strings.
- ///
- /// There are two kind of static member functions:
- /// * format* functions return a std::string containing
- /// the formatted value.
- /// * append* functions append the formatted value to
- /// an existing string.
- ///
- /// Internally, std::sprintf() is used to do the actual
- /// formatting.
-{
-public:
- static std::string format(int value);
- /// Formats an integer value in decimal notation.
-
- static std::string format(int value, int width);
- /// Formats an integer value in decimal notation,
- /// right justified in a field having at least
- /// the specified width.
-
- static std::string format0(int value, int width);
- /// Formats an integer value in decimal notation,
- /// right justified and zero-padded in a field
- /// having at least the specified width.
-
- static std::string formatHex(int value);
- /// Formats an int value in hexadecimal notation.
- /// The value is treated as unsigned.
-
- static std::string formatHex(int value, int width);
- /// Formats a int value in hexadecimal notation,
- /// right justified and zero-padded in
- /// a field having at least the specified width.
- /// The value is treated as unsigned.
-
- static std::string format(unsigned value);
- /// Formats an unsigned int value in decimal notation.
-
- static std::string format(unsigned value, int width);
- /// Formats an unsigned long int in decimal notation,
- /// right justified in a field having at least the
- /// specified width.
-
- static std::string format0(unsigned int value, int width);
- /// Formats an unsigned int value in decimal notation,
- /// right justified and zero-padded in a field having at
- /// least the specified width.
-
- static std::string formatHex(unsigned value);
- /// Formats an unsigned int value in hexadecimal notation.
-
- static std::string formatHex(unsigned value, int width);
- /// Formats a int value in hexadecimal notation,
- /// right justified and zero-padded in
- /// a field having at least the specified width.
-
- static std::string format(long value);
- /// Formats a long value in decimal notation.
-
- static std::string format(long value, int width);
- /// Formats a long value in decimal notation,
- /// right justified in a field having at least the
- /// specified width.
-
- static std::string format0(long value, int width);
- /// Formats a long value in decimal notation,
- /// right justified and zero-padded in a field
- /// having at least the specified width.
-
- static std::string formatHex(long value);
- /// Formats an unsigned long value in hexadecimal notation.
- /// The value is treated as unsigned.
-
- static std::string formatHex(long value, int width);
- /// Formats an unsigned long value in hexadecimal notation,
- /// right justified and zero-padded in a field having at least the
- /// specified width.
- /// The value is treated as unsigned.
-
- static std::string format(unsigned long value);
- /// Formats an unsigned long value in decimal notation.
-
- static std::string format(unsigned long value, int width);
- /// Formats an unsigned long value in decimal notation,
- /// right justified in a field having at least the specified
- /// width.
-
- static std::string format0(unsigned long value, int width);
- /// Formats an unsigned long value in decimal notation,
- /// right justified and zero-padded
- /// in a field having at least the specified width.
-
- static std::string formatHex(unsigned long value);
- /// Formats an unsigned long value in hexadecimal notation.
-
- static std::string formatHex(unsigned long value, int width);
- /// Formats an unsigned long value in hexadecimal notation,
- /// right justified and zero-padded in a field having at least the
- /// specified width.
-
-#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
-
- static std::string format(Int64 value);
- /// Formats a 64-bit integer value in decimal notation.
-
- static std::string format(Int64 value, int width);
- /// Formats a 64-bit integer value in decimal notation,
- /// right justified in a field having at least the specified width.
-
- static std::string format0(Int64 value, int width);
- /// Formats a 64-bit integer value in decimal notation,
- /// right justified and zero-padded in a field having at least
- /// the specified width.
-
- static std::string formatHex(Int64 value);
- /// Formats a 64-bit integer value in hexadecimal notation.
- /// The value is treated as unsigned.
-
- static std::string formatHex(Int64 value, int width);
- /// Formats a 64-bit integer value in hexadecimal notation,
- /// right justified and zero-padded in a field having at least
- /// the specified width.
- /// The value is treated as unsigned.
-
- static std::string format(UInt64 value);
- /// Formats an unsigned 64-bit integer value in decimal notation.
-
- static std::string format(UInt64 value, int width);
- /// Formats an unsigned 64-bit integer value in decimal notation,
- /// right justified in a field having at least the specified width.
-
- static std::string format0(UInt64 value, int width);
- /// Formats an unsigned 64-bit integer value in decimal notation,
- /// right justified and zero-padded in a field having at least the
- /// specified width.
-
- static std::string formatHex(UInt64 value);
- /// Formats a 64-bit integer value in hexadecimal notation.
-
- static std::string formatHex(UInt64 value, int width);
- /// Formats a 64-bit integer value in hexadecimal notation,
- /// right justified and zero-padded in a field having at least
- /// the specified width.
-
-#endif // defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
-
- static std::string format(float value);
- /// Formats a float value in decimal floating-point notation,
- /// according to std::printf's %g format with a precision of 8 fractional digits.
-
- static std::string format(double value);
- /// Formats a double value in decimal floating-point notation,
- /// according to std::printf's %g format with a precision of 16 fractional digits.
-
- static std::string format(double value, int precision);
- /// Formats a double value in decimal floating-point notation,
- /// according to std::printf's %f format with the given precision.
-
- static std::string format(double value, int width, int precision);
- /// Formats a double value in decimal floating-point notation,
- /// right justified in a field of the specified width,
- /// with the number of fractional digits given in precision.
-
- static std::string format(const void* ptr);
- /// Formats a pointer in an eight (32-bit architectures) or
- /// sixteen (64-bit architectures) characters wide
- /// field in hexadecimal notation.
-
- static void append(std::string& str, int value);
- /// Formats an integer value in decimal notation.
-
- static void append(std::string& str, int value, int width);
- /// Formats an integer value in decimal notation,
- /// right justified in a field having at least
- /// the specified width.
-
- static void append0(std::string& str, int value, int width);
- /// Formats an integer value in decimal notation,
- /// right justified and zero-padded in a field
- /// having at least the specified width.
-
- static void appendHex(std::string& str, int value);
- /// Formats an int value in hexadecimal notation.
- /// The value is treated as unsigned.
-
- static void appendHex(std::string& str, int value, int width);
- /// Formats a int value in hexadecimal notation,
- /// right justified and zero-padded in
- /// a field having at least the specified width.
- /// The value is treated as unsigned.
-
- static void append(std::string& str, unsigned value);
- /// Formats an unsigned int value in decimal notation.
-
- static void append(std::string& str, unsigned value, int width);
- /// Formats an unsigned long int in decimal notation,
- /// right justified in a field having at least the
- /// specified width.
-
- static void append0(std::string& str, unsigned int value, int width);
- /// Formats an unsigned int value in decimal notation,
- /// right justified and zero-padded in a field having at
- /// least the specified width.
-
- static void appendHex(std::string& str, unsigned value);
- /// Formats an unsigned int value in hexadecimal notation.
-
- static void appendHex(std::string& str, unsigned value, int width);
- /// Formats a int value in hexadecimal notation,
- /// right justified and zero-padded in
- /// a field having at least the specified width.
-
- static void append(std::string& str, long value);
- /// Formats a long value in decimal notation.
-
- static void append(std::string& str, long value, int width);
- /// Formats a long value in decimal notation,
- /// right justified in a field having at least the
- /// specified width.
-
- static void append0(std::string& str, long value, int width);
- /// Formats a long value in decimal notation,
- /// right justified and zero-padded in a field
- /// having at least the specified width.
-
- static void appendHex(std::string& str, long value);
- /// Formats an unsigned long value in hexadecimal notation.
- /// The value is treated as unsigned.
-
- static void appendHex(std::string& str, long value, int width);
- /// Formats an unsigned long value in hexadecimal notation,
- /// right justified and zero-padded in a field having at least the
- /// specified width.
- /// The value is treated as unsigned.
-
- static void append(std::string& str, unsigned long value);
- /// Formats an unsigned long value in decimal notation.
-
- static void append(std::string& str, unsigned long value, int width);
- /// Formats an unsigned long value in decimal notation,
- /// right justified in a field having at least the specified
- /// width.
-
- static void append0(std::string& str, unsigned long value, int width);
- /// Formats an unsigned long value in decimal notation,
- /// right justified and zero-padded
- /// in a field having at least the specified width.
-
- static void appendHex(std::string& str, unsigned long value);
- /// Formats an unsigned long value in hexadecimal notation.
-
- static void appendHex(std::string& str, unsigned long value, int width);
- /// Formats an unsigned long value in hexadecimal notation,
- /// right justified and zero-padded in a field having at least the
- /// specified width.
-
-#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
-
- static void append(std::string& str, Int64 value);
- /// Formats a 64-bit integer value in decimal notation.
-
- static void append(std::string& str, Int64 value, int width);
- /// Formats a 64-bit integer value in decimal notation,
- /// right justified in a field having at least the specified width.
-
- static void append0(std::string& str, Int64 value, int width);
- /// Formats a 64-bit integer value in decimal notation,
- /// right justified and zero-padded in a field having at least
- /// the specified width.
-
- static void appendHex(std::string& str, Int64 value);
- /// Formats a 64-bit integer value in hexadecimal notation.
- /// The value is treated as unsigned.
-
- static void appendHex(std::string& str, Int64 value, int width);
- /// Formats a 64-bit integer value in hexadecimal notation,
- /// right justified and zero-padded in a field having at least
- /// the specified width.
- /// The value is treated as unsigned.
-
- static void append(std::string& str, UInt64 value);
- /// Formats an unsigned 64-bit integer value in decimal notation.
-
- static void append(std::string& str, UInt64 value, int width);
- /// Formats an unsigned 64-bit integer value in decimal notation,
- /// right justified in a field having at least the specified width.
-
- static void append0(std::string& str, UInt64 value, int width);
- /// Formats an unsigned 64-bit integer value in decimal notation,
- /// right justified and zero-padded in a field having at least the
- /// specified width.
-
- static void appendHex(std::string& str, UInt64 value);
- /// Formats a 64-bit integer value in hexadecimal notation.
-
- static void appendHex(std::string& str, UInt64 value, int width);
- /// Formats a 64-bit integer value in hexadecimal notation,
- /// right justified and zero-padded in a field having at least
- /// the specified width.
-
-#endif // defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
-
- static void append(std::string& str, float value);
- /// Formats a float value in decimal floating-point notation,
- /// according to std::printf's %g format with a precision of 8 fractional digits.
-
- static void append(std::string& str, double value);
- /// Formats a double value in decimal floating-point notation,
- /// according to std::printf's %g format with a precision of 16 fractional digits.
-
- static void append(std::string& str, double value, int precision);
- /// Formats a double value in decimal floating-point notation,
- /// according to std::printf's %f format with the given precision.
-
- static void append(std::string& str, double value, int width, int precision);
- /// Formats a double value in decimal floating-point notation,
- /// right justified in a field of the specified width,
- /// with the number of fractional digits given in precision.
-
- static void append(std::string& str, const void* ptr);
- /// Formats a pointer in an eight (32-bit architectures) or
- /// sixteen (64-bit architectures) characters wide
- /// field in hexadecimal notation.
-};
-
-
-//
-// inlines
-//
-inline std::string NumberFormatter::format(int value)
-{
- std::string result;
- append(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(int value, int width)
-{
- std::string result;
- append(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::format0(int value, int width)
-{
- std::string result;
- append0(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(int value)
-{
- std::string result;
- appendHex(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(int value, int width)
-{
- std::string result;
- appendHex(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(unsigned value)
-{
- std::string result;
- append(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(unsigned value, int width)
-{
- std::string result;
- append(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::format0(unsigned int value, int width)
-{
- std::string result;
- append0(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(unsigned value)
-{
- std::string result;
- appendHex(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(unsigned value, int width)
-{
- std::string result;
- appendHex(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(long value)
-{
- std::string result;
- append(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(long value, int width)
-{
- std::string result;
- append(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::format0(long value, int width)
-{
- std::string result;
- append0(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(long value)
-{
- std::string result;
- appendHex(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(long value, int width)
-{
- std::string result;
- appendHex(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(unsigned long value)
-{
- std::string result;
- append(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(unsigned long value, int width)
-{
- std::string result;
- append(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::format0(unsigned long value, int width)
-{
- std::string result;
- append0(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(unsigned long value)
-{
- std::string result;
- appendHex(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(unsigned long value, int width)
-{
- std::string result;
- appendHex(result, value, width);
- return result;
-}
-
-
-#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
-
-
-inline std::string NumberFormatter::format(Int64 value)
-{
- std::string result;
- append(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(Int64 value, int width)
-{
- std::string result;
- append(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::format0(Int64 value, int width)
-{
- std::string result;
- append0(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(Int64 value)
-{
- std::string result;
- appendHex(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(Int64 value, int width)
-{
- std::string result;
- appendHex(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(UInt64 value)
-{
- std::string result;
- append(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(UInt64 value, int width)
-{
- std::string result;
- append(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::format0(UInt64 value, int width)
-{
- std::string result;
- append0(result, value, width);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(UInt64 value)
-{
- std::string result;
- appendHex(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::formatHex(UInt64 value, int width)
-{
- std::string result;
- appendHex(result, value, width);
- return result;
-}
-
-
-#endif // defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
-
-
-inline std::string NumberFormatter::format(float value)
-{
- std::string result;
- append(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(double value)
-{
- std::string result;
- append(result, value);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(double value, int precision)
-{
- std::string result;
- append(result, value, precision);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(double value, int width, int precision)
-{
- std::string result;
- append(result, value, width, precision);
- return result;
-}
-
-
-inline std::string NumberFormatter::format(const void* ptr)
-{
- std::string result;
- append(result, ptr);
- return result;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NumberFormatter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/NumberParser.h b/Utilities/Poco/Foundation/include/Poco/NumberParser.h
deleted file mode 100755
index 4a7f109b57..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/NumberParser.h
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// NumberParser.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: NumberParser
-//
-// Definition of the NumberParser class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_NumberParser_INCLUDED
-#define Foundation_NumberParser_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API NumberParser
- /// The NumberParser class provides static methods
- /// for parsing numbers out of strings.
-{
-public:
- static int parse(const std::string& s);
- /// Parses an integer value in decimal notation from the given string.
- /// Throws a SyntaxException if the string does not hold a number in decimal notation.
-
- static bool tryParse(const std::string& s, int& value);
- /// Parses an integer value in decimal notation from the given string.
- /// Returns true if a valid integer has been found, false otherwise.
-
- static unsigned parseUnsigned(const std::string& s);
- /// Parses an unsigned integer value in decimal notation from the given string.
- /// Throws a SyntaxException if the string does not hold a number in decimal notation.
-
- static bool tryParseUnsigned(const std::string& s, unsigned& value);
- /// Parses an unsigned integer value in decimal notation from the given string.
- /// Returns true if a valid integer has been found, false otherwise.
-
- static unsigned parseHex(const std::string& s);
- /// Parses an integer value in hexadecimal notation from the given string.
- /// Throws a SyntaxException if the string does not hold a number in
- /// hexadecimal notation.
-
- static bool tryParseHex(const std::string& s, unsigned& value);
- /// Parses an unsigned integer value in hexadecimal notation from the given string.
- /// Returns true if a valid integer has been found, false otherwise.
-
-#if defined(POCO_HAVE_INT64)
-
- static Int64 parse64(const std::string& s);
- /// Parses a 64-bit integer value in decimal notation from the given string.
- /// Throws a SyntaxException if the string does not hold a number in decimal notation.
-
- static bool tryParse64(const std::string& s, Int64& value);
- /// Parses a 64-bit integer value in decimal notation from the given string.
- /// Returns true if a valid integer has been found, false otherwise.
-
- static UInt64 parseUnsigned64(const std::string& s);
- /// Parses an unsigned 64-bit integer value in decimal notation from the given string.
- /// Throws a SyntaxException if the string does not hold a number in decimal notation.
-
- static bool tryParseUnsigned64(const std::string& s, UInt64& value);
- /// Parses an unsigned 64-bit integer value in decimal notation from the given string.
- /// Returns true if a valid integer has been found, false otherwise.
-
- static UInt64 parseHex64(const std::string& s);
- /// Parses a 64 bit-integer value in hexadecimal notation from the given string.
- /// Throws a SyntaxException if the string does not hold a number in hexadecimal notation.
-
- static bool tryParseHex64(const std::string& s, UInt64& value);
- /// Parses an unsigned 64-bit integer value in hexadecimal notation from the given string.
- /// Returns true if a valid integer has been found, false otherwise.
-
-#endif // defined(POCO_HAVE_INT64)
-
- static double parseFloat(const std::string& s);
- /// Parses a double value in decimal floating point notation
- /// from the given string.
- /// Throws a SyntaxException if the string does not hold a floating-point
- /// number in decimal notation.
-
- static bool tryParseFloat(const std::string& s, double& value);
- /// Parses a double value in decimal floating point notation
- /// from the given string.
- /// Returns true if a valid floating point number has been found,
- /// false otherwise.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_NumberParser_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Observer.h b/Utilities/Poco/Foundation/include/Poco/Observer.h
deleted file mode 100755
index 8522b8a9eb..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Observer.h
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// Observer.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: NotificationCenter
-//
-// Definition of the Observer class template.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Observer_INCLUDED
-#define Foundation_Observer_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/AbstractObserver.h"
-
-
-namespace Poco {
-
-
-template <class C, class N>
-class Observer: public AbstractObserver
- /// This template class implements an adapter that sits between
- /// a NotificationCenter and an object receiving notifications
- /// from it. It is quite similar in concept to the
- /// RunnableAdapter, but provides some NotificationCenter
- /// specific additional methods.
- /// See the NotificationCenter class for information on how
- /// to use this template class.
- ///
- /// Instead of the Observer class template, you might want to
- /// use the NObserver class template, which uses an AutoPtr to
- /// pass the Notification to the callback function, thus freeing
- /// you from memory management issues.
-{
-public:
- typedef void (C::*Callback)(N*);
-
- Observer(C& object, Callback method):
- _pObject(&object),
- _method(method)
- {
- }
-
- Observer(const Observer& observer):
- AbstractObserver(observer),
- _pObject(observer._pObject),
- _method(observer._method)
- {
- }
-
- ~Observer()
- {
- }
-
- Observer& operator = (const Observer& observer)
- {
- if (&observer != this)
- {
- _pObject = observer._pObject;
- _method = observer._method;
- }
- return *this;
- }
-
- void notify(Notification* pNf) const
- {
- N* pCastNf = dynamic_cast<N*>(pNf);
- if (pCastNf)
- {
- pCastNf->duplicate();
- (_pObject->*_method)(pCastNf);
- }
- }
-
- bool equals(const AbstractObserver& abstractObserver) const
- {
- const Observer* pObs = dynamic_cast<const Observer*>(&abstractObserver);
- return pObs && pObs->_pObject == _pObject && pObs->_method == _method;
- }
-
- bool accepts(Notification* pNf) const
- {
- return dynamic_cast<N*>(pNf) != 0;
- }
-
- AbstractObserver* clone() const
- {
- return new Observer(*this);
- }
-
-private:
- Observer();
-
- C* _pObject;
- Callback _method;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Observer_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/OpcomChannel.h b/Utilities/Poco/Foundation/include/Poco/OpcomChannel.h
deleted file mode 100755
index 10f8143f85..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/OpcomChannel.h
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// OpcomChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: OpcomChannel
-//
-// Definition of the OpcomChannel class specific to OpenVMS.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_OpcomChannel_INCLUDED
-#define Foundation_OpcomChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-
-
-namespace Poco {
-
-
-class Foundation_API OpcomChannel: public Channel
- /// A OpenVMS-only channel that uses the OpenVMS OPCOM service.
-{
-public:
- OpcomChannel();
- /// Creates an OpcomChannel that uses the OPC$M_NM_CENTRL
- /// target.
-
- OpcomChannel(int target);
- /// Creates an OpcomChannel that uses the given target.
- /// Specify one of the OPC$M_NM_* values.
- /// See also setProperty().
-
- void log(const Message& msg);
- /// Logs the given message using the OpenVMS OPCOM service.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Sets the property with the given name.
- ///
- /// The only supported property is "target", which must
- /// be set to one of the following values:
- ///
- /// * CARDS: Card device operator
- /// * CENTRL: Central operator
- /// * SECURITY: Security operator
- /// * CLUSTER: OpenVMS Cluster operator
- /// * DEVICE: Device status information
- /// * DISKS: Disks operator
- /// * NTWORK: Network operator
- /// * TAPES: Tapes operator
- /// * PRINT: Printer operator
- /// * OPER1 ..
- /// * OPER12: System-manager-defined operator functions
-
- std::string getProperty(const std::string& name) const;
- /// Returns the value of the property with the given name.
- /// See setProperty() for a description of the supported
- /// properties.
-
- static const std::string PROP_TARGET;
-
-protected:
- ~OpcomChannel();
-
-private:
- int _target;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_OpcomChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Path.h b/Utilities/Poco/Foundation/include/Poco/Path.h
deleted file mode 100755
index 9a7fa1014a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Path.h
+++ /dev/null
@@ -1,492 +0,0 @@
-//
-// Path.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Path
-//
-// Definition of the Path class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Path_INCLUDED
-#define Foundation_Path_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-class Foundation_API Path
- /// This class represents filesystem paths in a
- /// platform-independent manner.
- /// Unix, Windows and OpenVMS all use a different
- /// syntax for filesystem paths.
- /// This class can work with all three formats.
- /// A path is made up of an optional node name
- /// (only Windows and OpenVMS), an optional
- /// device name (also only Windows and OpenVMS),
- /// a list of directory names and an optional
- /// filename.
-{
-public:
- enum Style
- {
- PATH_UNIX, /// Unix-style path
- PATH_WINDOWS, /// Windows-style path
- PATH_VMS, /// VMS-style path
- PATH_NATIVE, /// The current platform's native style
- PATH_GUESS /// Guess the style by examining the path
- };
-
- typedef std::vector<std::string> StringVec;
-
- Path();
- /// Creates an empty relative path.
-
- Path(bool absolute);
- /// Creates an empty absolute or relative path.
-
- Path(const char* path);
- /// Creates a path from a string.
-
- Path(const char* path, Style style);
- /// Creates a path from a string.
-
- Path(const std::string& path);
- /// Creates a path from a string.
-
- Path(const std::string& path, Style style);
- /// Creates a path from a string.
-
- Path(const Path& path);
- /// Copy constructor
-
- Path(const Path& parent, const std::string& fileName);
- /// Creates a path from a parent path and a filename.
- /// The parent path is expected to reference a directory.
-
- Path(const Path& parent, const char* fileName);
- /// Creates a path from a parent path and a filename.
- /// The parent path is expected to reference a directory.
-
- Path(const Path& parent, const Path& relative);
- /// Creates a path from a parent path and a relative path.
- /// The parent path is expected to reference a directory.
- /// The relative path is appended to the parent path.
-
- ~Path();
- /// Destroys the Path.
-
- Path& operator = (const Path& path);
- /// Assignment operator.
-
- Path& operator = (const std::string& path);
- /// Assigns a string containing a path in native format.
-
- Path& operator = (const char* path);
- /// Assigns a string containing a path in native format.
-
- void swap(Path& path);
- /// Swaps the path with another one.
-
- Path& assign(const std::string& path);
- /// Assigns a string containing a path in native format.
-
- Path& assign(const std::string& path, Style style);
- /// Assigns a string containing a path.
-
- Path& assign(const Path& path);
- /// Assigns the given path.
-
- Path& assign(const char* path);
- /// Assigns a string containing a path.
-
- std::string toString() const;
- /// Returns a string containing the path in native format.
-
- std::string toString(Style style) const;
- /// Returns a string containing the path in the given format.
-
- Path& parse(const std::string& path);
- /// Same as assign().
-
- Path& parse(const std::string& path, Style style);
- /// Assigns a string containing a path.
-
- bool tryParse(const std::string& path);
- /// Tries to interpret the given string as a path
- /// in native format.
- /// If the path is syntactically valid, assigns the
- /// path and returns true. Otherwise leaves the
- /// object unchanged and returns false.
-
- bool tryParse(const std::string& path, Style style);
- /// Tries to interpret the given string as a path,
- /// according to the given style.
- /// If the path is syntactically valid, assigns the
- /// path and returns true. Otherwise leaves the
- /// object unchanged and returns false.
-
- Path& parseDirectory(const std::string& path);
- /// The resulting path always refers to a directory and
- /// the filename part is empty.
-
- Path& parseDirectory(const std::string& path, Style style);
- /// The resulting path always refers to a directory and
- /// the filename part is empty.
-
- Path& makeDirectory();
- /// If the path contains a filename, the filename is appended
- /// to the directory list and cleared. Thus the resulting path
- /// always refers to a directory.
-
- Path& makeFile();
- /// If the path contains no filename, the last directory
- /// becomes the filename.
-
- Path& makeParent();
- /// Makes the path refer to its parent.
-
- Path& makeAbsolute();
- /// Makes the path absolute if it is relative.
- /// The current working directory is taken as base directory.
-
- Path& makeAbsolute(const Path& base);
- /// Makes the path absolute if it is relative.
- /// The given path is taken as base.
-
- Path& append(const Path& path);
- /// Appends the given path.
-
- Path& resolve(const Path& path);
- /// Resolves the given path agains the current one.
- ///
- /// If the given path is absolute, it replaces the current one.
- /// Otherwise, the relative path is appended to the current path.
-
- bool isAbsolute() const;
- /// Returns true iff the path is absolute.
-
- bool isRelative() const;
- /// Returns true iff the path is relative.
-
- bool isDirectory() const;
- /// Returns true iff the path references a directory
- /// (the filename part is empty).
-
- bool isFile() const;
- /// Returns true iff the path references a file
- /// (the filename part is not empty).
-
- void setNode(const std::string& node);
- /// Sets the node name.
- /// Setting a non-empty node automatically makes
- /// the path an absolute one.
-
- const std::string& getNode() const;
- /// Returns the node name.
-
- void setDevice(const std::string& device);
- /// Sets the device name.
- /// Setting a non-empty device automatically makes
- /// the path an absolute one.
-
- const std::string& getDevice() const;
- /// Returns the device name.
-
- int depth() const;
- /// Returns the number of directories in the directory list.
-
- const std::string& directory(int n) const;
- /// Returns the n'th directory in the directory list.
- /// If n == depth(), returns the filename.
-
- const std::string& operator [] (int n) const;
- /// Returns the n'th directory in the directory list.
- /// If n == depth(), returns the filename.
-
- void pushDirectory(const std::string& dir);
- /// Adds a directory to the directory list.
-
- void popDirectory();
- /// Removes the last directory from the directory list.
-
- void setFileName(const std::string& name);
- /// Sets the filename.
-
- const std::string& getFileName() const;
- /// Returns the filename.
-
- void setBaseName(const std::string& name);
- /// Sets the basename part of the filename and
- /// does not change the extension.
-
- std::string getBaseName() const;
- /// Returns the basename (the filename sans
- /// extension) of the path.
-
- void setExtension(const std::string& extension);
- /// Sets the filename extension.
-
- std::string getExtension() const;
- /// Returns the filename extension.
-
- const std::string& version() const;
- /// Returns the file version. VMS only.
-
- void clear();
- /// Clears all components.
-
- Path parent() const;
- /// Returns a path referring to the path's
- /// directory.
-
- Path absolute() const;
- /// Returns an absolute variant of the path,
- /// taking the current working directory as base.
-
- Path absolute(const Path& base) const;
- /// Returns an absolute variant of the path,
- /// taking the given path as base.
-
- static Path forDirectory(const std::string& path);
- /// Creates a path referring to a directory.
-
- static Path forDirectory(const std::string& path, Style style);
- /// Creates a path referring to a directory.
-
- static char separator();
- /// Returns the platform's path name separator, which separates
- /// the components (names) in a path.
- ///
- /// On Unix systems, this is the slash '/'. On Windows systems,
- /// this is the backslash '\'. On OpenVMS systems, this is the
- /// period '.'.
-
- static char pathSeparator();
- /// Returns the platform's path separator, which separates
- /// single paths in a list of paths.
- ///
- /// On Unix systems, this is the colon ':'. On Windows systems,
- /// this is the semicolon ';'. On OpenVMS systems, this is the
- /// comma ','.
-
- static std::string current();
- /// Returns the current working directory.
-
- static std::string home();
- /// Returns the user's home directory.
-
- static std::string temp();
- /// Returns the temporary directory.
-
- static std::string null();
- /// Returns the name of the null device.
-
- static std::string expand(const std::string& path);
- /// Expands all environment variables contained in the path.
- ///
- /// On Unix, a tilde as first character in the path is
- /// replaced with the path to user's home directory.
-
- static void listRoots(std::vector<std::string>& roots);
- /// Fills the vector with all filesystem roots available on the
- /// system. On Unix, there is exactly one root, "/".
- /// On Windows, the roots are the drive letters.
- /// On OpenVMS, the roots are the mounted disks.
-
- static bool find(StringVec::const_iterator it, StringVec::const_iterator end, const std::string& name, Path& path);
- /// Searches the file with the given name in the locations (paths) specified
- /// by it and end. A relative path may be given in name.
- ///
- /// If the file is found in one of the locations, the complete
- /// path of the file is stored in the path given as argument and true is returned.
- /// Otherwise false is returned and the path argument remains unchanged.
-
- static bool find(const std::string& pathList, const std::string& name, Path& path);
- /// Searches the file with the given name in the locations (paths) specified
- /// in pathList. The paths in pathList must be delimited by the platform's
- /// path separator (see pathSeparator()). A relative path may be given in name.
- ///
- /// If the file is found in one of the locations, the complete
- /// path of the file is stored in the path given as argument and true is returned.
- /// Otherwise false is returned and the path argument remains unchanged.
-
- static std::string transcode(const std::string& path);
- /// On Windows, if POCO has been compiled with Windows UTF-8 support
- /// (POCO_WIN32_UTF8), this function converts a string (usually containing a path)
- /// encoded in UTF-8 into a string encoded in the current Windows code page.
- ///
- /// This function should be used for every string passed as a file name to
- /// a string stream or fopen().
- ///
- /// On all other platforms, or if POCO has not been compiled with Windows UTF-8
- /// support, this function returns the string unchanged.
-
-protected:
- void parseUnix(const std::string& path);
- void parseWindows(const std::string& path);
- void parseVMS(const std::string& path);
- void parseGuess(const std::string& path);
- std::string buildUnix() const;
- std::string buildWindows() const;
- std::string buildVMS() const;
-
-private:
- std::string _node;
- std::string _device;
- std::string _name;
- std::string _version;
- StringVec _dirs;
- bool _absolute;
-};
-
-
-//
-// inlines
-//
-inline bool Path::isAbsolute() const
-{
- return _absolute;
-}
-
-
-inline bool Path::isRelative() const
-{
- return !_absolute;
-}
-
-
-inline bool Path::isDirectory() const
-{
- return _name.empty();
-}
-
-
-inline bool Path::isFile() const
-{
- return !_name.empty();
-}
-
-
-inline Path& Path::parse(const std::string& path)
-{
- return assign(path);
-}
-
-
-inline Path& Path::parse(const std::string& path, Style style)
-{
- return assign(path, style);
-}
-
-
-inline const std::string& Path::getNode() const
-{
- return _node;
-}
-
-
-inline const std::string& Path::getDevice() const
-{
- return _device;
-}
-
-
-inline const std::string& Path::getFileName() const
-{
- return _name;
-}
-
-
-inline int Path::depth() const
-{
- return int(_dirs.size());
-}
-
-
-inline const std::string& Path::version() const
-{
- return _version;
-}
-
-
-inline Path Path::forDirectory(const std::string& path)
-{
- Path p;
- return p.parseDirectory(path);
-}
-
-
-inline Path Path::forDirectory(const std::string& path, Style style)
-{
- Path p;
- return p.parseDirectory(path, style);
-}
-
-
-inline char Path::separator()
-{
-#if defined(POCO_OS_FAMILY_VMS)
- return '.';
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- return '\\';
-#else
- return '/';
-#endif
-}
-
-
-inline char Path::pathSeparator()
-{
-#if defined(POCO_OS_FAMILY_VMS)
- return ',';
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- return ';';
-#else
- return ':';
-#endif
-}
-
-
-inline void swap(Path& p1, Path& p2)
-{
- p1.swap(p2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Path_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Path_UNIX.h b/Utilities/Poco/Foundation/include/Poco/Path_UNIX.h
deleted file mode 100755
index cc3cf6c794..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Path_UNIX.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// Path_UNIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Path
-//
-// Definition of the PathImpl class fo rUnix.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Path_UNIX_INCLUDED
-#define Foundation_Path_UNIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-class PathImpl
-{
-public:
- static std::string currentImpl();
- static std::string homeImpl();
- static std::string tempImpl();
- static std::string nullImpl();
- static std::string expandImpl(const std::string& path);
- static void listRootsImpl(std::vector<std::string>& roots);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Path_UNIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Path_VMS.h b/Utilities/Poco/Foundation/include/Poco/Path_VMS.h
deleted file mode 100755
index 2978139e9f..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Path_VMS.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// Path_VMS.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Path
-//
-// Definition of the PathImpl class for OpenVMS.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Path_VMS_INCLUDED
-#define Foundation_Path_VMS_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-class PathImpl
-{
-public:
- static std::string currentImpl();
- static std::string homeImpl();
- static std::string tempImpl();
- static std::string nullImpl();
- static std::string expandImpl(const std::string& path);
- static void listRootsImpl(std::vector<std::string>& roots);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Path_VMS_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Path_WIN32.h b/Utilities/Poco/Foundation/include/Poco/Path_WIN32.h
deleted file mode 100755
index acc8f2db55..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Path_WIN32.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// Path_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Path
-//
-// Definition of the PathImpl class for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Path_WIN32_INCLUDED
-#define Foundation_Path_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-class Foundation_API PathImpl
-{
-public:
- static std::string currentImpl();
- static std::string homeImpl();
- static std::string tempImpl();
- static std::string nullImpl();
- static std::string expandImpl(const std::string& path);
- static void listRootsImpl(std::vector<std::string>& roots);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Path_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Path_WIN32U.h b/Utilities/Poco/Foundation/include/Poco/Path_WIN32U.h
deleted file mode 100755
index 773f78a92f..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Path_WIN32U.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// Path_WIN32U.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Path
-//
-// Definition of the PathImpl class for WIN32.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_Path_WIN32U_INCLUDED
-#define Foundation_Path_WIN32U_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-class Foundation_API PathImpl
-{
-public:
- static std::string currentImpl();
- static std::string homeImpl();
- static std::string tempImpl();
- static std::string nullImpl();
- static std::string expandImpl(const std::string& path);
- static void listRootsImpl(std::vector<std::string>& roots);
-
- enum
- {
- MAX_PATH_LEN = 32767
- };
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Path_WIN32U_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/PatternFormatter.h b/Utilities/Poco/Foundation/include/Poco/PatternFormatter.h
deleted file mode 100755
index 9df4be4c83..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PatternFormatter.h
+++ /dev/null
@@ -1,150 +0,0 @@
-//
-// PatternFormatter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: PatternFormatter
-//
-// Definition of the PatternFormatter class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_PatternFormatter_INCLUDED
-#define Foundation_PatternFormatter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Formatter.h"
-#include "Poco/Message.h"
-
-
-namespace Poco {
-
-
-class Foundation_API PatternFormatter: public Formatter
- /// This Formatter allows for custom formatting of
- /// log messages based on format patterns.
- ///
- /// The format pattern is used as a template to format the message and
- /// is copied character by character except for the following special characters,
- /// which are replaced by the corresponding value.
- ///
- /// * %s - message source
- /// * %t - message text
- /// * %l - message priority level (1 .. 7)
- /// * %p - message priority (Fatal, Critical, Error, Warning, Notice, Information, Debug, Trace)
- /// * %q - abbreviated message priority (F, C, E, W,N, I, D, T)
- /// * %P - message process identifier
- /// * %T - message thread name
- /// * %I - message thread identifier (numeric)
- /// * %N - node or host name
- /// * %w - message date/time abbreviated weekday (Mon, Tue, ...)
- /// * %W - message date/time full weekday (Monday, Tuesday, ...)
- /// * %b - message date/time abbreviated month (Jan, Feb, ...)
- /// * %B - message date/time full month (January, February, ...)
- /// * %d - message date/time zero-padded day of month (01 .. 31)
- /// * %e - message date/time day of month (1 .. 31)
- /// * %f - message date/time space-padded day of month ( 1 .. 31)
- /// * %m - message date/time zero-padded month (01 .. 12)
- /// * %n - message date/time month (1 .. 12)
- /// * %o - message date/time space-padded month ( 1 .. 12)
- /// * %y - message date/time year without century (70)
- /// * %Y - message date/time year with century (1970)
- /// * %H - message date/time hour (00 .. 23)
- /// * %h - message date/time hour (00 .. 12)
- /// * %a - message date/time am/pm
- /// * %A - message date/time AM/PM
- /// * %M - message date/time minute (00 .. 59)
- /// * %S - message date/time second (00 .. 59)
- /// * %i - message date/time millisecond (000 .. 999)
- /// * %c - message date/time centisecond (0 .. 9)
- /// * %F - message date/time fractional seconds/microseconds (000000 - 999999)
- /// * %z - time zone differential in ISO 8601 format (Z or +NN.NN).
- /// * %Z - time zone differential in RFC format (GMT or +NNNN)
- /// * %[name] - the value of the message parameter with the given name
- /// * %% - percent sign
-
-{
-public:
- PatternFormatter();
- /// Creates a PatternFormatter.
- /// The format pattern must be specified with
- /// a call to setProperty.
-
- PatternFormatter(const std::string& format);
- /// Creates a PatternFormatter that uses the
- /// given format pattern.
-
- ~PatternFormatter();
- /// Destroys the PatternFormatter.
-
- void format(const Message& msg, std::string& text);
- /// Formats the message according to the specified
- /// format pattern and places the result in text.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Sets the property with the given name to the given value.
- ///
- /// The following properties are supported:
- ///
- /// * pattern: The format pattern. See the PatternFormatter class
- /// for details.
- /// * times: Specifies whether times are adjusted for local time
- /// or taken as they are in UTC. Supported values are "local" and "UTC".
- ///
- /// If any other property name is given, a PropertyNotSupported
- /// exception is thrown.
-
- std::string getProperty(const std::string& name) const;
- /// Returns the value of the property with the given name or
- /// throws a PropertyNotSupported exception if the given
- /// name is not recognized.
-
- static const std::string PROP_PATTERN;
- static const std::string PROP_TIMES;
-
-protected:
- static const std::string& getPriorityName(int);
- /// Returns a string for the given priority value.
-
- static void fmt(std::string& str, int value);
- static void fmt(std::string& str, int value, int width);
- static void fmt0(std::string& str, int value, int width);
-
-private:
- bool _localTime;
- std::string _pattern;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_PatternFormatter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Pipe.h b/Utilities/Poco/Foundation/include/Poco/Pipe.h
deleted file mode 100755
index 264a504927..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Pipe.h
+++ /dev/null
@@ -1,164 +0,0 @@
-//
-// Pipe.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Pipe
-//
-// Definition of the Pipe class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Pipe_INCLUDED
-#define Foundation_Pipe_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/PipeImpl.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Pipe
- /// This class implements an anonymous pipe.
- ///
- /// Pipes are a common method of inter-process communication -
- /// on Unix, pipes are the oldest form of IPC.
- ///
- /// A pipe is a half-duplex communication channel, which means
- /// that data only flows in one direction.
- /// Pipes have a read-end and a write-end. One process writes to
- /// the pipe and another process reads the data written by
- /// its peer.
- /// Read and write operations are always synchronous. A read will
- /// block until data is available and a write will block until
- /// the reader reads the data.
- ///
- /// The sendBytes() and readBytes() methods of Pipe are usually
- /// used through a PipeOutputStream or PipeInputStream and are
- /// not called directly.
- ///
- /// Pipe objects have value semantics; the actual work is delegated
- /// to a reference-counted PipeImpl object.
-{
-public:
- typedef PipeImpl::Handle Handle; /// The read/write handle or file descriptor.
-
- enum CloseMode /// used by close()
- {
- CLOSE_READ = 0x01, /// Close reading end of pipe.
- CLOSE_WRITE = 0x02, /// Close writing end of pipe.
- CLOSE_BOTH = 0x03 /// Close both ends of pipe.
- };
-
- Pipe();
- /// Creates the Pipe.
- ///
- /// Throws a CreateFileException if the pipe cannot be
- /// created.
-
- Pipe(const Pipe& pipe);
- /// Creates the Pipe using the PipeImpl from another one.
-
- ~Pipe();
- /// Closes and destroys the Pipe.
-
- Pipe& operator = (const Pipe& pipe);
- /// Releases the Pipe's PipeImpl and assigns another one.
-
- int writeBytes(const void* buffer, int length);
- /// Sends the contents of the given buffer through
- /// the pipe. Blocks until the receiver is ready
- /// to read the data.
- ///
- /// Returns the number of bytes sent.
- ///
- /// Throws a WriteFileException if the data cannot be written.
-
- int readBytes(void* buffer, int length);
- /// Receives data from the pipe and stores it
- /// in buffer. Up to length bytes are received.
- /// Blocks until data becomes available.
- ///
- /// Returns the number of bytes received, or 0
- /// if the pipe has been closed.
- ///
- /// Throws a ReadFileException if nothing can be read.
-
- Handle readHandle() const;
- /// Returns the read handle or file descriptor
- /// for the Pipe. For internal use only.
-
- Handle writeHandle() const;
- /// Returns the write handle or file descriptor
- /// for the Pipe. For internal use only.
-
- void close(CloseMode mode = CLOSE_BOTH);
- /// Depending on the argument, closes either the
- /// reading end, the writing end, or both ends
- /// of the Pipe.
-
-private:
- PipeImpl* _pImpl;
-};
-
-
-//
-// inlines
-//
-inline int Pipe::writeBytes(const void* buffer, int length)
-{
- return _pImpl->writeBytes(buffer, length);
-}
-
-
-inline int Pipe::readBytes(void* buffer, int length)
-{
- return _pImpl->readBytes(buffer, length);
-}
-
-
-inline Pipe::Handle Pipe::readHandle() const
-{
- return _pImpl->readHandle();
-}
-
-
-inline Pipe::Handle Pipe::writeHandle() const
-{
- return _pImpl->writeHandle();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Pipe_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/PipeImpl.h b/Utilities/Poco/Foundation/include/Poco/PipeImpl.h
deleted file mode 100755
index 8f860a9e68..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PipeImpl.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// PipeImpl.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: PipeImpl
-//
-// Definition of the PipeImpl class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_PipeImpl_INCLUDED
-#define Foundation_PipeImpl_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/PipeImpl_WIN32.h"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "Poco/PipeImpl_POSIX.h"
-#else
-#include "Poco/PipeImpl_DUMMY.h"
-#endif
-
-
-#endif // Foundation_PipeImpl_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/PipeImpl_DUMMY.h b/Utilities/Poco/Foundation/include/Poco/PipeImpl_DUMMY.h
deleted file mode 100755
index 66162733e9..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PipeImpl_DUMMY.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// PipeImpl_DUMMY.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: PipeImpl
-//
-// Definition of the PipeImpl_DUMMY class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_PipeImpl_DUMMY_INCLUDED
-#define Foundation_PipeImpl_DUMMY_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/RefCountedObject.h"
-
-
-namespace Poco {
-
-
-class Foundation_API PipeImpl: public RefCountedObject
- /// A dummy implementation of PipeImpl for platforms
- /// that do not support pipes.
-{
-public:
- typedef int Handle;
-
- PipeImpl();
- ~PipeImpl();
- int writeBytes(const void* buffer, int length);
- int readBytes(void* buffer, int length);
- Handle readHandle() const;
- Handle writeHandle() const;
- void closeRead();
- void closeWrite();
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_PipeImpl_DUMMY_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/PipeImpl_POSIX.h b/Utilities/Poco/Foundation/include/Poco/PipeImpl_POSIX.h
deleted file mode 100755
index 55727bb9ae..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PipeImpl_POSIX.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// PipeImpl_POSIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: PipeImpl
-//
-// Definition of the PipeImpl class for POSIX.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_PipeImpl_POSIX_INCLUDED
-#define Foundation_PipeImpl_POSIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/RefCountedObject.h"
-
-
-namespace Poco {
-
-
-class Foundation_API PipeImpl: public RefCountedObject
- /// A dummy implementation of PipeImpl for platforms
- /// that do not support pipes.
-{
-public:
- typedef int Handle;
-
- PipeImpl();
- ~PipeImpl();
- int writeBytes(const void* buffer, int length);
- int readBytes(void* buffer, int length);
- Handle readHandle() const;
- Handle writeHandle() const;
- void closeRead();
- void closeWrite();
-
-private:
- int _readfd;
- int _writefd;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_PipeImpl_POSIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/PipeImpl_WIN32.h b/Utilities/Poco/Foundation/include/Poco/PipeImpl_WIN32.h
deleted file mode 100755
index 24aa1244bc..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PipeImpl_WIN32.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// PipeImpl_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: PipeImpl
-//
-// Definition of the PipeImpl class for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_PipeImpl_WIN32_INCLUDED
-#define Foundation_PipeImpl_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/RefCountedObject.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API PipeImpl: public RefCountedObject
- /// A dummy implementation of PipeImpl for platforms
- /// that do not support pipes.
-{
-public:
- typedef HANDLE Handle;
-
- PipeImpl();
- ~PipeImpl();
- int writeBytes(const void* buffer, int length);
- int readBytes(void* buffer, int length);
- Handle readHandle() const;
- Handle writeHandle() const;
- void closeRead();
- void closeWrite();
-
-private:
- HANDLE _readHandle;
- HANDLE _writeHandle;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_PipeImpl_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/PipeStream.h b/Utilities/Poco/Foundation/include/Poco/PipeStream.h
deleted file mode 100755
index 7062d36b79..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PipeStream.h
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-// PipeStream.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: PipeStream
-//
-// Definition of the PipeStream class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_PipeStream_INCLUDED
-#define Foundation_PipeStream_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Pipe.h"
-#include "Poco/BufferedStreamBuf.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API PipeStreamBuf: public BufferedStreamBuf
- /// This is the streambuf class used for reading from and writing to a Pipe.
-{
-public:
- typedef BufferedStreamBuf::openmode openmode;
-
- PipeStreamBuf(const Pipe& pipe, openmode mode);
- /// Creates a PipeStreamBuf with the given Pipe.
-
- ~PipeStreamBuf();
- /// Destroys the PipeStreamBuf.
-
- void close();
- /// Closes the pipe.
-
-protected:
- int readFromDevice(char* buffer, std::streamsize length);
- int writeToDevice(const char* buffer, std::streamsize length);
-
-private:
- enum
- {
- STREAM_BUFFER_SIZE = 1024
- };
-
- Pipe _pipe;
-};
-
-
-class Foundation_API PipeIOS: public virtual std::ios
- /// The base class for PipeInputStream and
- /// PipeOutputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- PipeIOS(const Pipe& pipe, openmode mode);
- /// Creates the PipeIOS with the given Pipe.
-
- ~PipeIOS();
- /// Destroys the PipeIOS.
- ///
- /// Flushes the buffer, but does not close the pipe.
-
- PipeStreamBuf* rdbuf();
- /// Returns a pointer to the internal PipeStreamBuf.
-
- void close();
- /// Flushes the stream and closes the pipe.
-
-protected:
- PipeStreamBuf _buf;
-};
-
-
-class Foundation_API PipeOutputStream: public PipeIOS, public std::ostream
- /// An output stream for writing to a Pipe.
-{
-public:
- PipeOutputStream(const Pipe& pipe);
- /// Creates the PipeOutputStream with the given Pipe.
-
- ~PipeOutputStream();
- /// Destroys the PipeOutputStream.
- ///
- /// Flushes the buffer, but does not close the pipe.
-};
-
-
-class Foundation_API PipeInputStream: public PipeIOS, public std::istream
- /// An input stream for reading from a Pipe.
- ///
- /// Using formatted input from a PipeInputStream
- /// is not recommended, due to the read-ahead behavior of
- /// istream with formatted reads.
-{
-public:
- PipeInputStream(const Pipe& pipe);
- /// Creates the PipeInputStream with the given Pipe.
-
- ~PipeInputStream();
- /// Destroys the PipeInputStream.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_PipeStream_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Platform.h b/Utilities/Poco/Foundation/include/Poco/Platform.h
deleted file mode 100755
index 214f71c192..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Platform.h
+++ /dev/null
@@ -1,189 +0,0 @@
-//
-// Platform.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Platform
-//
-// Platform and architecture identification macros.
-//
-// NOTE: This file may be included from both C++ and C code, so it
-// must not contain any C++ specific things.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Platform_INCLUDED
-#define Foundation_Platform_INCLUDED
-
-
-//
-// Platform Identification
-//
-#define POCO_OS_FREE_BSD 0x0001
-#define POCO_OS_AIX 0x0002
-#define POCO_OS_HPUX 0x0003
-#define POCO_OS_TRU64 0x0004
-#define POCO_OS_LINUX 0x0005
-#define POCO_OS_MAC_OS_X 0x0006
-#define POCO_OS_NET_BSD 0x0007
-#define POCO_OS_OPEN_BSD 0x0008
-#define POCO_OS_IRIX 0x0009
-#define POCO_OS_SOLARIS 0x000a
-#define POCO_OS_QNX 0x000b
-#define POCO_OS_VXWORKS 0x000c
-#define POCO_OS_CYGWIN 0x000d
-#define POCO_OS_UNKNOWN_UNIX 0x00ff
-#define POCO_OS_WINDOWS_NT 0x1001
-#define POCO_OS_WINDOWS_CE 0x1011
-#define POCO_OS_VMS 0x2001
-
-
-#if defined(__FreeBSD__)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS_FAMILY_BSD 1
- #define POCO_OS POCO_OS_FREE_BSD
-#elif defined(_AIX) || defined(__TOS_AIX__)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS POCO_OS_AIX
-#elif defined(hpux) || defined(_hpux)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS POCO_OS_HPUX
-#elif defined(__digital__) || defined(__osf__)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS POCO_OS_TRU64
-#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__TOS_LINUX__)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS POCO_OS_LINUX
-#elif defined(__APPLE__) || defined(__TOS_MACOS__)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS_FAMILY_BSD 1
- #define POCO_OS POCO_OS_MAC_OS_X
-#elif defined(__NetBSD__)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS_FAMILY_BSD 1
- #define POCO_OS POCO_OS_NET_BSD
-#elif defined(__OpenBSD__)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS_FAMILY_BSD 1
- #define POCO_OS POCO_OS_OPEN_BSD
-#elif defined(sgi) || defined(__sgi)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS POCO_OS_IRIX
-#elif defined(sun) || defined(__sun)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS POCO_OS_SOLARIS
-#elif defined(__QNX__)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS POCO_OS_QNX
-#elif defined(unix) || defined(__unix) || defined(__unix__)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS POCO_OS_UNKNOWN_UNIX
-#elif defined(_WIN32_WCE)
- #define POCO_OS_FAMILY_WINDOWS 1
- #define POCO_OS POCO_OS_WINDOWS_CE
-#elif defined(_WIN32) || defined(_WIN64)
- #define POCO_OS_FAMILY_WINDOWS 1
- #define POCO_OS POCO_OS_WINDOWS_NT
-#elif defined(__CYGWIN__)
- #define POCO_OS_FAMILY_UNIX 1
- #define POCO_OS POCO_OS_CYGWIN
-#elif defined(__VMS)
- #define POCO_OS_FAMILY_VMS 1
- #define POCO_OS POCO_OS_VMS
-#endif
-
-
-//
-// Hardware Architecture and Byte Order
-//
-#define POCO_ARCH_ALPHA 0x01
-#define POCO_ARCH_IA32 0x02
-#define POCO_ARCH_IA64 0x03
-#define POCO_ARCH_MIPS 0x04
-#define POCO_ARCH_HPPA 0x05
-#define POCO_ARCH_PPC 0x06
-#define POCO_ARCH_POWER 0x07
-#define POCO_ARCH_SPARC 0x08
-#define POCO_ARCH_AMD64 0x09
-#define POCO_ARCH_ARM 0x0a
-#define POCO_ARCH_M68K 0x0b
-#define POCO_ARCH_S390 0x0c
-
-
-#if defined(__ALPHA) || defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA)
- #define POCO_ARCH POCO_ARCH_ALPHA
- #define POCO_ARCH_LITTLE_ENDIAN 1
-#elif defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_IX86)
- #define POCO_ARCH POCO_ARCH_IA32
- #define POCO_ARCH_LITTLE_ENDIAN 1
-#elif defined(_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
- #define POCO_ARCH POCO_ARCH_IA64
- #if defined(hpux) || defined(_hpux)
- #define POCO_ARCH_BIG_ENDIAN 1
- #else
- #define POCO_ARCH_LITTLE_ENDIAN 1
- #endif
-#elif defined(__x86_64__) || defined(_M_X64)
- #define POCO_ARCH POCO_ARCH_AMD64
- #define POCO_ARCH_LITTLE_ENDIAN 1
-#elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(_M_MRX000)
- #define POCO_ARCH POCO_ARCH_MIPS
- #define POCO_ARCH_BIG_ENDIAN 1
-#elif defined(__hppa) || defined(__hppa__)
- #define POCO_ARCH POCO_ARCH_HPPA
- #define POCO_ARCH_BIG_ENDIAN 1
-#elif defined(__PPC) || defined(__POWERPC__) || defined(__powerpc) || defined(__PPC__) || \
- defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC) || defined(_M_PPC)
- #define POCO_ARCH POCO_ARCH_PPC
- #define POCO_ARCH_BIG_ENDIAN 1
-#elif defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_ARCH_PWR3) || \
- defined(_ARCH_PWR4) || defined(__THW_RS6000)
- #define POCO_ARCH POCO_ARCH_POWER
- #define POCO_ARCH_BIG_ENDIAN 1
-#elif defined(__sparc__) || defined(__sparc) || defined(sparc)
- #define POCO_ARCH POCO_ARCH_SPARC
- #define POCO_ARCH_BIG_ENDIAN 1
-#elif defined(__arm__) || defined(__arm) || defined(ARM) || defined(_ARM_) || defined(__ARM__) || defined(_M_ARM)
- #define POCO_ARCH POCO_ARCH_ARM
- #if defined(__ARMEB__)
- #define POCO_ARCH_BIG_ENDIAN 1
- #else
- #define POCO_ARCH_LITTLE_ENDIAN 1
- #endif
-#elif defined(__m68k__)
- #define POCO_ARCH POCO_ARCH_M68K
- #define POCO_ARCH_BIG_ENDIAN 1
-#elif defined(__s390__)
- #define POCO_ARCH POCO_ARCH_S390
- #define POCO_ARCH_BIG_ENDIAN 1
-#endif
-
-
-#endif // Foundation_Platform_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Platform_POSIX.h b/Utilities/Poco/Foundation/include/Poco/Platform_POSIX.h
deleted file mode 100755
index 5e4f72d77d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Platform_POSIX.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// Platform_POSIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Platform
-//
-// Platform and architecture identification macros
-// and platform-specific definitions for various POSIX platforms
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Platform_POSIX_INCLUDED
-#define Foundation_Platform_POSIX_INCLUDED
-
-
-//
-// PA-RISC based HP-UX platforms have some issues...
-//
-#if defined(hpux) || defined(_hpux)
- #if defined(__hppa) || defined(__hppa__)
- #define POCO_NO_SYS_SELECT_H 1
- #if defined(__HP_aCC)
- #define POCO_NO_TEMPLATE_ICOMPARE 1
- #endif
- #endif
-#endif
-
-
-#endif // Foundation_Platform_POSIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Platform_VMS.h b/Utilities/Poco/Foundation/include/Poco/Platform_VMS.h
deleted file mode 100755
index 4ff503208c..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Platform_VMS.h
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// Platform_VMS.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Platform
-//
-// Platform and architecture identification macros
-// and platform-specific definitions for OpenVMS.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Platform_VMS_INCLUDED
-#define Foundation_Platform_VMS_INCLUDED
-
-
-// Define the POCO_DESCRIPTOR_STRING and POCO_DESCRIPTOR_LITERAL
-// macros which we use instead of $DESCRIPTOR and $DESCRIPTOR64.
-// Our macros work with both 32bit and 64bit pointer sizes.
-#if __INITIAL_POINTER_SIZE != 64
- #define POCO_DESCRIPTOR_STRING(name, string) \
- struct dsc$descriptor_s name = \
- { \
- string.size(), \
- DSC$K_DTYPE_T, \
- DSC$K_CLASS_S, \
- (char*) string.data() \
- }
- #define POCO_DESCRIPTOR_LITERAL(name, string) \
- struct dsc$descriptor_s name = \
- { \
- sizeof(string) - 1, \
- DSC$K_DTYPE_T, \
- DSC$K_CLASS_S, \
- (char*) string \
- }
-#else
- #define POCO_DESCRIPTOR_STRING(name, string) \
- struct dsc64$descriptor_s name =\
- { \
- 1, \
- DSC64$K_DTYPE_T, \
- DSC64$K_CLASS_S, \
- -1, \
- string.size(), \
- (char*) string.data() \
- }
- #define POCO_DESCRIPTOR_LITERAL(name, string) \
- struct dsc64$descriptor_s name =\
- { \
- 1, \
- DSC64$K_DTYPE_T, \
- DSC64$K_CLASS_S, \
- -1, \
- sizeof(string) - 1, \
- (char*) string \
- }
-#endif
-
-
-// No <sys/select.h> header file
-#define POCO_NO_SYS_SELECT_H
-
-
-#endif // Foundation_Platform_VMS_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Platform_WIN32.h b/Utilities/Poco/Foundation/include/Poco/Platform_WIN32.h
deleted file mode 100755
index b01073f8e3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Platform_WIN32.h
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// Platform_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Platform
-//
-// Platform and architecture identification macros
-// and platform-specific definitions for Windows.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_Platform_WIN32_INCLUDED
-#define Foundation_Platform_WIN32_INCLUDED
-
-
-// Verify that we're built with the multithreaded
-// versions of the runtime libraries
-#if defined(_MSC_VER) && !defined(_MT)
- #error Must compile with /MD, /MDd, /MT or /MTd
-#endif
-
-
-// Check debug/release settings consistency
-#if defined(NDEBUG) && defined(_DEBUG)
- #error Inconsistent build settings (check for /MD[d])
-#endif
-
-
-// Reduce bloat imported by "Poco/UnWindows.h"
-#if defined(_WIN32)
- #if !defined(_WIN32_WINNT)
- #define _WIN32_WINNT 0x0500
- #endif
- #if !defined(WIN32_LEAN_AND_MEAN) && !defined(POCO_BLOATED_WIN32)
- #define WIN32_LEAN_AND_MEAN
- #endif
-#endif
-
-
-// Unicode Support
-#if defined(UNICODE) && !defined(POCO_WIN32_UTF8)
- #define POCO_WIN32_UTF8
-#endif
-
-
-// Turn off some annoying warnings
-#if defined(_MSC_VER)
- #pragma warning(disable:4018) // signed/unsigned comparison
- #pragma warning(disable:4251) // ... needs to have dll-interface warning
- #pragma warning(disable:4355) // 'this' : used in base member initializer list
- #pragma warning(disable:4996) // VC++ 8.0 deprecation warnings
- #pragma warning(disable:4351) // new behavior: elements of array '...' will be default initialized
- #pragma warning(disable:4675) // resolved overload was found by argument-dependent lookup
-#endif
-
-
-#if defined(__INTEL_COMPILER)
- #pragma warning(disable:1738) // base class dllexport/dllimport specification differs from that of the derived class
- #pragma warning(disable:1478) // function ... was declared "deprecated"
- #pragma warning(disable:1744) // field of class type without a DLL interface used in a class with a DLL interface
-#endif
-
-
-#endif // Foundation_Platform_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Poco.h b/Utilities/Poco/Foundation/include/Poco/Poco.h
deleted file mode 100755
index ed55b9dd34..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Poco.h
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// Poco.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Foundation
-//
-// Basic definitions for the POCO libraries.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_Poco_INCLUDED
-#define Foundation_Poco_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-#endif // Foundation_Poco_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/PriorityDelegate.h b/Utilities/Poco/Foundation/include/Poco/PriorityDelegate.h
deleted file mode 100755
index 6499dd6c49..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PriorityDelegate.h
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// PriorityDelegate.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: PriorityDelegate
-//
-// Implementation of the PriorityDelegate template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_PriorityDelegate_INCLUDED
-#define Foundation_PriorityDelegate_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/AbstractPriorityDelegate.h"
-#include "Poco/PriorityExpire.h"
-#include "Poco/FunctionPriorityDelegate.h"
-
-
-namespace Poco {
-
-
-template <class TObj, class TArgs, bool useSender = true>
-class PriorityDelegate: public AbstractPriorityDelegate<TArgs>
-{
-public:
- typedef void (TObj::*NotifyMethod)(const void*, TArgs&);
-
- PriorityDelegate(TObj* obj, NotifyMethod method, int prio):
- AbstractPriorityDelegate<TArgs>(obj, prio),
- _receiverObject(obj),
- _receiverMethod(method)
- {
- }
-
- PriorityDelegate(const PriorityDelegate& delegate):
- AbstractPriorityDelegate<TArgs>(delegate._pTarget, delegate._priority),
- _receiverObject(delegate._receiverObject),
- _receiverMethod(delegate._receiverMethod)
- {
- }
-
- PriorityDelegate& operator = (const PriorityDelegate& delegate)
- {
- if (&delegate != this)
- {
- this->_pTarget = delegate._pTarget;
- this->_receiverObject = delegate._receiverObject;
- this->_receiverMethod = delegate._receiverMethod;
- this->_priority = delegate._priority;
- }
- return *this;
- }
-
- ~PriorityDelegate()
- {
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- (_receiverObject->*_receiverMethod)(sender, arguments);
- return true; // per default the delegate never expires
- }
-
- AbstractPriorityDelegate<TArgs>* clone() const
- {
- return new PriorityDelegate(*this);
- }
-
-protected:
- TObj* _receiverObject;
- NotifyMethod _receiverMethod;
-
-private:
- PriorityDelegate();
-};
-
-
-
-template <class TObj, class TArgs>
-class PriorityDelegate<TObj, TArgs, false>: public AbstractPriorityDelegate<TArgs>
-{
-public:
- typedef void (TObj::*NotifyMethod)(TArgs&);
-
- PriorityDelegate(TObj* obj, NotifyMethod method, int prio):
- AbstractPriorityDelegate<TArgs>(obj, prio),
- _receiverObject(obj),
- _receiverMethod(method)
- {
- }
-
- PriorityDelegate(const PriorityDelegate& delegate):
- AbstractPriorityDelegate<TArgs>(delegate._pTarget, delegate._priority),
- _receiverObject(delegate._receiverObject),
- _receiverMethod(delegate._receiverMethod)
- {
- }
-
- PriorityDelegate& operator = (const PriorityDelegate& delegate)
- {
- if (&delegate != this)
- {
- this->_pTarget = delegate._pTarget;
- this->_receiverObject = delegate._receiverObject;
- this->_receiverMethod = delegate._receiverMethod;
- this->_priority = delegate._priority;
- }
- return *this;
- }
-
- ~PriorityDelegate()
- {
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- (_receiverObject->*_receiverMethod)(arguments);
- return true; // per default the delegate never expires
- }
-
- AbstractPriorityDelegate<TArgs>* clone() const
- {
- return new PriorityDelegate(*this);
- }
-
-protected:
- TObj* _receiverObject;
- NotifyMethod _receiverMethod;
-
-private:
- PriorityDelegate();
-};
-
-
-template <class TObj, class TArgs>
-static PriorityDelegate<TObj, TArgs, true> priorityDelegate(TObj* pObj, void (TObj::*NotifyMethod)(const void*, TArgs&), int prio)
-{
- return PriorityDelegate<TObj, TArgs, true>(pObj, NotifyMethod, prio);
-}
-
-
-template <class TObj, class TArgs>
-static PriorityDelegate<TObj, TArgs, false> priorityDelegate(TObj* pObj, void (TObj::*NotifyMethod)(TArgs&), int prio)
-{
- return PriorityDelegate<TObj, TArgs, false>(pObj, NotifyMethod, prio);
-}
-
-
-template <class TObj, class TArgs>
-static PriorityExpire<TArgs> priorityDelegate(TObj* pObj, void (TObj::*NotifyMethod)(const void*, TArgs&), int prio, Timestamp::TimeDiff expireMilliSec)
-{
- return PriorityExpire<TArgs>(PriorityDelegate<TObj, TArgs, true>(pObj, NotifyMethod, prio), expireMilliSec);
-}
-
-
-template <class TObj, class TArgs>
-static PriorityExpire<TArgs> priorityDelegate(TObj* pObj, void (TObj::*NotifyMethod)(TArgs&), int prio, Timestamp::TimeDiff expireMilliSec)
-{
- return PriorityExpire<TArgs>(PriorityDelegate<TObj, TArgs, false>(pObj, NotifyMethod, prio), expireMilliSec);
-}
-
-
-template <class TArgs>
-static PriorityExpire<TArgs> priorityDelegate(void (*NotifyMethod)(const void*, TArgs&), int prio, Timestamp::TimeDiff expireMilliSec)
-{
- return PriorityExpire<TArgs>(FunctionPriorityDelegate<TArgs, true, true>(NotifyMethod, prio), expireMilliSec);
-}
-
-
-template <class TArgs>
-static PriorityExpire<TArgs> priorityDelegate(void (*NotifyMethod)(void*, TArgs&), int prio, Timestamp::TimeDiff expireMilliSec)
-{
- return PriorityExpire<TArgs>(FunctionPriorityDelegate<TArgs, true, false>(NotifyMethod, prio), expireMilliSec);
-}
-
-
-template <class TArgs>
-static PriorityExpire<TArgs> priorityDelegate(void (*NotifyMethod)(TArgs&), int prio, Timestamp::TimeDiff expireMilliSec)
-{
- return PriorityExpire<TArgs>(FunctionPriorityDelegate<TArgs, false>(NotifyMethod, prio), expireMilliSec);
-}
-
-
-template <class TArgs>
-static FunctionPriorityDelegate<TArgs, true, true> priorityDelegate(void (*NotifyMethod)(const void*, TArgs&), int prio)
-{
- return FunctionPriorityDelegate<TArgs, true, true>(NotifyMethod, prio);
-}
-
-
-template <class TArgs>
-static FunctionPriorityDelegate<TArgs, true, false> priorityDelegate(void (*NotifyMethod)(void*, TArgs&), int prio)
-{
- return FunctionPriorityDelegate<TArgs, true, false>(NotifyMethod, prio);
-}
-
-
-template <class TArgs>
-static FunctionPriorityDelegate<TArgs, false> priorityDelegate(void (*NotifyMethod)(TArgs&), int prio)
-{
- return FunctionPriorityDelegate<TArgs, false>(NotifyMethod, prio);
-}
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/PriorityEvent.h b/Utilities/Poco/Foundation/include/Poco/PriorityEvent.h
deleted file mode 100755
index cf96257747..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PriorityEvent.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// PriorityEvent.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: PriorityEvent
-//
-// Implementation of the PriorityEvent template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_PriorityEvent_INCLUDED
-#define Foundation_PriorityEvent_INCLUDED
-
-
-#include "Poco/AbstractEvent.h"
-#include "Poco/DefaultStrategy.h"
-#include "Poco/AbstractPriorityDelegate.h"
-#include "Poco/CompareFunctions.h"
-
-
-namespace Poco {
-
-
-template <class TArgs>
-class PriorityEvent: public AbstractEvent <
- TArgs,
- DefaultStrategy<TArgs, AbstractPriorityDelegate< TArgs>, p_less<AbstractPriorityDelegate<TArgs> > >,
- AbstractPriorityDelegate<TArgs>
->
- /// A PriorityEvent uses internally a DefaultStrategy which
- /// invokes delegates in a manner determined by the priority field
- /// in the PriorityDelegates (lower priorities first).
- /// PriorityEvents can only be used together with PriorityDelegates.
- /// PriorityDelegates are sorted according to the priority value, when
- /// two delegates have the same priority, they are invoked in
- /// an arbitrary manner.
- /// Note that one object can register several methods as long as they differ
- /// in their priority value:
- /// PriorityEvent<int> tmp;
- /// MyClass myObject;
- /// tmp += priorityDelegate(&myObject, &MyClass::myMethod1, 1);
- /// tmp += priorityDelegate(&myObject, &MyClass::myMethod2, 2);
-{
-public:
- PriorityEvent()
- {
- }
-
- ~PriorityEvent()
- {
- }
-
-private:
- PriorityEvent(const PriorityEvent& e);
- PriorityEvent& operator = (const PriorityEvent& e);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/PriorityExpire.h b/Utilities/Poco/Foundation/include/Poco/PriorityExpire.h
deleted file mode 100755
index 635466e24e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PriorityExpire.h
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// PriorityExpire.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: PriorityExpire
-//
-// Implementation of the PriorityExpire template.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_PriorityExpire_INCLUDED
-#define Foundation_PriorityExpire_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-#include "Poco/AbstractPriorityDelegate.h"
-
-
-namespace Poco {
-
-
-template <class TArgs>
-class PriorityExpire: public AbstractPriorityDelegate<TArgs>
- /// Decorator for AbstractPriorityDelegate adding automatic
- /// expiring of registrations to AbstractPriorityDelegate.
-{
-public:
- PriorityExpire(const AbstractPriorityDelegate<TArgs>& p, Timestamp::TimeDiff expireMilliSec):
- AbstractPriorityDelegate<TArgs>(p),
- _pDelegate(p.clone()),
- _expire(expireMilliSec*1000)
- {
- }
-
- PriorityExpire(const PriorityExpire& expire):
- AbstractPriorityDelegate<TArgs>(expire),
- _pDelegate(expire._pDelegate->clone()),
- _expire(expire._expire),
- _creationTime(expire._creationTime)
- {
- }
-
- ~PriorityExpire()
- {
- destroy();
- }
-
- PriorityExpire& operator = (const PriorityExpire& expire)
- {
- if (&expire != this)
- {
- delete this->_pDelegate;
- this->_pTarget = expire._pTarget;
- this->_pDelegate = expire._pDelegate->clone();
- this->_expire = expire._expire;
- this->_creationTime = expire._creationTime;
- }
- return *this;
- }
-
- bool notify(const void* sender, TArgs& arguments)
- {
- if (!expired())
- return this->_pDelegate->notify(sender, arguments);
- else
- return false;
- }
-
- AbstractPriorityDelegate<TArgs>* clone() const
- {
- return new PriorityExpire(*this);
- }
-
- void destroy()
- {
- delete this->_pDelegate;
- this->_pDelegate = 0;
- }
-
- const AbstractPriorityDelegate<TArgs>& getDelegate() const
- {
- return *this->_pDelegate;
- }
-
-protected:
- bool expired() const
- {
- return _creationTime.isElapsed(_expire);
- }
-
- AbstractPriorityDelegate<TArgs>* _pDelegate;
- Timestamp::TimeDiff _expire;
- Timestamp _creationTime;
-
-private:
- PriorityExpire();
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/PriorityNotificationQueue.h b/Utilities/Poco/Foundation/include/Poco/PriorityNotificationQueue.h
deleted file mode 100644
index 354d121c50..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PriorityNotificationQueue.h
+++ /dev/null
@@ -1,180 +0,0 @@
-//
-// PriorityNotificationQueue.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: PriorityNotificationQueue
-//
-// Definition of the PriorityNotificationQueue class.
-//
-// Copyright (c) 2009, 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.
-//
-
-
-#ifndef Foundation_PriorityNotificationQueue_INCLUDED
-#define Foundation_PriorityNotificationQueue_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Notification.h"
-#include "Poco/Mutex.h"
-#include "Poco/Event.h"
-#include <map>
-#include <deque>
-
-
-namespace Poco {
-
-
-class NotificationCenter;
-
-
-class Foundation_API PriorityNotificationQueue
- /// A PriorityNotificationQueue object provides a way to implement asynchronous
- /// notifications. This is especially useful for sending notifications
- /// from one thread to another, for example from a background thread to
- /// the main (user interface) thread.
- ///
- /// The PriorityNotificationQueue is quite similar to the NotificationQueue class.
- /// The only difference to NotificationQueue is that each Notification is tagged
- /// with a priority value. When inserting a Notification into the queue, the
- /// Notification is inserted according to the given priority value, with
- /// lower priority values being inserted before higher priority
- /// values. Therefore, the lower the numerical priority value, the higher
- /// the actual notification priority.
- ///
- /// Notifications are dequeued in order of their priority.
- ///
- /// The PriorityNotificationQueue can also be used to distribute work from
- /// a controlling thread to one or more worker threads. Each worker thread
- /// repeatedly calls waitDequeueNotification() and processes the
- /// returned notification. Special care must be taken when shutting
- /// down a queue with worker threads waiting for notifications.
- /// The recommended sequence to shut down and destroy the queue is to
- /// 1. set a termination flag for every worker thread
- /// 2. call the wakeUpAll() method
- /// 3. join each worker thread
- /// 4. destroy the notification queue.
-{
-public:
- PriorityNotificationQueue();
- /// Creates the PriorityNotificationQueue.
-
- ~PriorityNotificationQueue();
- /// Destroys the PriorityNotificationQueue.
-
- void enqueueNotification(Notification::Ptr pNotification, int priority);
- /// Enqueues the given notification by adding it to
- /// the queue according to the given priority.
- /// Lower priority values are inserted before higher priority values.
- /// The queue takes ownership of the notification, thus
- /// a call like
- /// notificationQueue.enqueueNotification(new MyNotification, 1);
- /// does not result in a memory leak.
-
- Notification* dequeueNotification();
- /// Dequeues the next pending notification.
- /// Returns 0 (null) if no notification is available.
- /// The caller gains ownership of the notification and
- /// is expected to release it when done with it.
- ///
- /// It is highly recommended that the result is immediately
- /// assigned to a Notification::Ptr, to avoid potential
- /// memory management issues.
-
- Notification* waitDequeueNotification();
- /// Dequeues the next pending notification.
- /// If no notification is available, waits for a notification
- /// to be enqueued.
- /// The caller gains ownership of the notification and
- /// is expected to release it when done with it.
- /// This method returns 0 (null) if wakeUpWaitingThreads()
- /// has been called by another thread.
- ///
- /// It is highly recommended that the result is immediately
- /// assigned to a Notification::Ptr, to avoid potential
- /// memory management issues.
-
- Notification* waitDequeueNotification(long milliseconds);
- /// Dequeues the next pending notification.
- /// If no notification is available, waits for a notification
- /// to be enqueued up to the specified time.
- /// Returns 0 (null) if no notification is available.
- /// The caller gains ownership of the notification and
- /// is expected to release it when done with it.
- ///
- /// It is highly recommended that the result is immediately
- /// assigned to a Notification::Ptr, to avoid potential
- /// memory management issues.
-
- void dispatch(NotificationCenter& notificationCenter);
- /// Dispatches all queued notifications to the given
- /// notification center.
-
- void wakeUpAll();
- /// Wakes up all threads that wait for a notification.
-
- bool empty() const;
- /// Returns true iff the queue is empty.
-
- int size() const;
- /// Returns the number of notifications in the queue.
-
- void clear();
- /// Removes all notifications from the queue.
-
- bool hasIdleThreads() const;
- /// Returns true if the queue has at least one thread waiting
- /// for a notification.
-
- static PriorityNotificationQueue& defaultQueue();
- /// Returns a reference to the default
- /// PriorityNotificationQueue.
-
-protected:
- Notification::Ptr dequeueOne();
-
-private:
- typedef std::multimap<int, Notification::Ptr> NfQueue;
- struct WaitInfo
- {
- Notification::Ptr pNf;
- Event nfAvailable;
- };
- typedef std::deque<WaitInfo*> WaitQueue;
-
- NfQueue _nfQueue;
- WaitQueue _waitQueue;
- mutable FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_PriorityNotificationQueue_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Process.h b/Utilities/Poco/Foundation/include/Poco/Process.h
deleted file mode 100755
index e145ae17df..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Process.h
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// Process.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Process
-//
-// Definition of the Process class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Process_INCLUDED
-#define Foundation_Process_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "Poco/Process_WIN32U.h"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/Process_WIN32.h"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "Poco/Process_UNIX.h"
-#else
-#include "Poco/Process_VMS.h"
-#endif
-
-
-namespace Poco {
-
-
-class Pipe;
-
-
-class Foundation_API ProcessHandle
- /// A handle for a process created with Process::launch().
- ///
- /// This handle can be used to determine the process ID of
- /// the newly created process and it can be used to wait for
- /// the completion of a process.
-{
-public:
- typedef ProcessImpl::PIDImpl PID;
-
- ProcessHandle(const ProcessHandle& handle);
- /// Creates a ProcessHandle by copying another one.
-
- ~ProcessHandle();
- /// Destroys the ProcessHandle.
-
- ProcessHandle& operator = (const ProcessHandle& handle);
- /// Assigns another handle.
-
- PID id() const;
- /// Returns the process ID.
-
- int wait() const;
- /// Waits for the process to terminate
- /// and returns the exit code of the process.
-
-protected:
- ProcessHandle(ProcessHandleImpl* pImpl);
-
-private:
- ProcessHandle();
-
- ProcessHandleImpl* _pImpl;
-
- friend class Process;
-};
-
-
-class Foundation_API Process: public ProcessImpl
- /// This class provides methods for working with processes.
-{
-public:
- typedef PIDImpl PID;
- typedef ArgsImpl Args;
-
- static PID id();
- /// Returns the process ID of the current process.
-
- static void times(long& userTime, long& kernelTime);
- /// Returns the number of seconds spent by the
- /// current process in user and kernel mode.
-
- static ProcessHandle launch(const std::string& command, const Args& args);
- /// Creates a new process for the given command and returns
- /// a ProcessHandle of the new process. The given arguments are
- /// passed to the command on the command line.
-
- static ProcessHandle launch(const std::string& command, const Args& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe);
- /// Creates a new process for the given command and returns
- /// a ProcessHandle of the new process. The given arguments are
- /// passed to the command on the command line.
- ///
- /// If inPipe, outPipe or errPipe is non-null, the corresponding
- /// standard input, standard output or standard error stream
- /// of the launched process is redirected to the Pipe.
- /// PipeInputStream or PipeOutputStream can be used to
- /// send receive data from, or send data to the process.
- ///
- /// Note: the same Pipe can be used for both outPipe and errPipe.
- ///
- /// After a Pipe has been passed as inPipe, only write operations
- /// are valid. After a Pipe has been passed as outPipe or errPipe,
- /// only read operations are valid.
- ///
- /// It is forbidden to pass the same pipe as inPipe and outPipe or errPipe.
- ///
- /// Usage example:
- /// Pipe outPipe;
- /// Process::Args args;
- /// ProcessHandle ph(launch("/bin/ps", args, &outPipe, 0, 0));
- /// PipeInputStream istr(outPipe);
- /// ... // read output of ps from istr
- /// int rc = ph.wait();
-
- static int wait(const ProcessHandle& handle);
- /// Waits for the process specified by handle to terminate
- /// and returns the exit code of the process.
-
- static void kill(PID pid);
- /// Kills the process with the given pid.
-
- static void requestTermination(PID pid);
- /// Requests termination of the process with the give PID.
- ///
- /// On Unix platforms, this will send a SIGINT to the
- /// process and thus work with arbitrary processes.
- ///
- /// On other platforms, a global event flag
- /// will be set. Setting the flag will cause
- /// Util::ServerApplication::waitForTerminationRequest() to
- /// return. Therefore this will only work with applications
- /// based on Util::ServerApplication.
-};
-
-
-//
-// inlines
-//
-inline Process::PID Process::id()
-{
- return ProcessImpl::idImpl();
-}
-
-
-inline void Process::times(long& userTime, long& kernelTime)
-{
- ProcessImpl::timesImpl(userTime, kernelTime);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Process_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Process_UNIX.h b/Utilities/Poco/Foundation/include/Poco/Process_UNIX.h
deleted file mode 100755
index b1d92b782d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Process_UNIX.h
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// Process_UNIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Process
-//
-// Definition of the ProcessImpl class for Unix.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Process_UNIX_INCLUDED
-#define Foundation_Process_UNIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/RefCountedObject.h"
-#include <unistd.h>
-#include <vector>
-
-
-namespace Poco {
-
-
-class Pipe;
-
-
-class Foundation_API ProcessHandleImpl: public RefCountedObject
-{
-public:
- ProcessHandleImpl(pid_t pid);
- ~ProcessHandleImpl();
-
- pid_t id() const;
- int wait() const;
-
-private:
- pid_t _pid;
-};
-
-
-class Foundation_API ProcessImpl
-{
-public:
- typedef pid_t PIDImpl;
- typedef std::vector<std::string> ArgsImpl;
-
- static PIDImpl idImpl();
- static void timesImpl(long& userTime, long& kernelTime);
- static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe);
- static void killImpl(PIDImpl pid);
- static void requestTerminationImpl(PIDImpl pid);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Process_UNIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Process_VMS.h b/Utilities/Poco/Foundation/include/Poco/Process_VMS.h
deleted file mode 100755
index 244150c672..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Process_VMS.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// Process_VMS.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Process
-//
-// Definition of the ProcessImpl class for OpenVMS.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Process_VMS_INCLUDED
-#define Foundation_Process_VMS_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/RefCountedObject.h"
-#include <vector>
-#include <unistd.h>
-
-
-namespace Poco {
-
-
-class Pipe;
-
-
-class ProcessHandleImpl: public RefCountedObject
-{
-public:
- ProcessHandleImpl(pid_t pid);
- ~ProcessHandleImpl();
-
- pid_t id() const;
- int wait() const;
-
-private:
- pid_t _pid;
-};
-
-
-class ProcessImpl
-{
-public:
- typedef pid_t PIDImpl;
- typedef std::vector<std::string> ArgsImpl;
-
- static PIDImpl idImpl();
- static void timesImpl(long& userTime, long& kernelTime);
- static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe);
- static int waitImpl(PIDImpl pid);
- static void killImpl(PIDImpl pid);
- static void requestTerminationImpl(PIDImpl pid);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Process_VMS_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Process_WIN32.h b/Utilities/Poco/Foundation/include/Poco/Process_WIN32.h
deleted file mode 100755
index c320b1db0f..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Process_WIN32.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// Process_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Process
-//
-// Definition of the ProcessImpl class for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Process_WIN32_INCLUDED
-#define Foundation_Process_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/RefCountedObject.h"
-#include <vector>
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Pipe;
-
-
-class Foundation_API ProcessHandleImpl: public RefCountedObject
-{
-public:
- ProcessHandleImpl(HANDLE _hProcess, UInt32 pid);
- ~ProcessHandleImpl();
-
- UInt32 id() const;
- int wait() const;
-
-private:
- HANDLE _hProcess;
- UInt32 _pid;
-
- ProcessHandleImpl(const ProcessHandleImpl&);
- ProcessHandleImpl& operator = (const ProcessHandleImpl&);
-};
-
-
-class Foundation_API ProcessImpl
-{
-public:
- typedef UInt32 PIDImpl;
- typedef std::vector<std::string> ArgsImpl;
-
- static PIDImpl idImpl();
- static void timesImpl(long& userTime, long& kernelTime);
- static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe);
- static void killImpl(PIDImpl pid);
- static void requestTerminationImpl(PIDImpl pid);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Process_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Process_WIN32U.h b/Utilities/Poco/Foundation/include/Poco/Process_WIN32U.h
deleted file mode 100755
index eb6480c6a3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Process_WIN32U.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// Process_WIN32U.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Process
-//
-// Definition of the ProcessImpl class for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Process_WIN32U_INCLUDED
-#define Foundation_Process_WIN32U_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/RefCountedObject.h"
-#include <vector>
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Pipe;
-
-
-class Foundation_API ProcessHandleImpl: public RefCountedObject
-{
-public:
- ProcessHandleImpl(HANDLE _hProcess, UInt32 pid);
- ~ProcessHandleImpl();
-
- UInt32 id() const;
- int wait() const;
-
-private:
- HANDLE _hProcess;
- UInt32 _pid;
-
- ProcessHandleImpl(const ProcessHandleImpl&);
- ProcessHandleImpl& operator = (const ProcessHandleImpl&);
-};
-
-
-class Foundation_API ProcessImpl
-{
-public:
- typedef UInt32 PIDImpl;
- typedef std::vector<std::string> ArgsImpl;
-
- static PIDImpl idImpl();
- static void timesImpl(long& userTime, long& kernelTime);
- static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe);
- static void killImpl(PIDImpl pid);
- static void requestTerminationImpl(PIDImpl pid);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Process_WIN32U_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/PurgeStrategy.h b/Utilities/Poco/Foundation/include/Poco/PurgeStrategy.h
deleted file mode 100755
index 7cad14d294..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/PurgeStrategy.h
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// PurgeStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: FileChannel
-//
-// Definition of the PurgeStrategy class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_PurgeStrategy_INCLUDED
-#define Foundation_PurgeStrategy_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/File.h"
-#include "Poco/Timespan.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-class Foundation_API PurgeStrategy
- /// The PurgeStrategy is used by FileChannel
- /// to purge archived log files.
-{
-public:
- PurgeStrategy();
- virtual ~PurgeStrategy();
-
- virtual void purge(const std::string& path) = 0;
- /// Purges archived log files. The path to the
- /// current "hot" log file is given.
- /// To find archived log files, look for files
- /// with a name consisting of the given path
- /// plus any suffix (e.g., .1, .20050929081500, .1.gz).
- /// A list of archived files can be obtained by calling
- /// the list() method.
-
-protected:
- void list(const std::string& path, std::vector<File>& files);
- /// Fills the given vector with a list of archived log
- /// files. The path of the current "hot" log file is
- /// given in path.
- ///
- /// All files with the same name as the one given in path,
- /// plus some suffix (e.g., .1, .20050929081500, .1.gz) are
- /// considered archived files.
-
-private:
- PurgeStrategy(const PurgeStrategy&);
- PurgeStrategy& operator = (const PurgeStrategy&);
-};
-
-
-class Foundation_API PurgeByAgeStrategy: public PurgeStrategy
- /// This purge strategy purges all files that have
- /// exceeded a given age (given in seconds).
-{
-public:
- PurgeByAgeStrategy(const Timespan& age);
- ~PurgeByAgeStrategy();
-
- void purge(const std::string& path);
-
-private:
- Timespan _age;
-};
-
-
-class Foundation_API PurgeByCountStrategy: public PurgeStrategy
- /// This purge strategy ensures that a maximum number
- /// of archived files is not exceeded. Files are deleted
- /// based on their age, with oldest files deleted first.
-{
-public:
- PurgeByCountStrategy(int count);
- ~PurgeByCountStrategy();
-
- void purge(const std::string& path);
-
-private:
- int _count;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_PurgeStrategy_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/RWLock.h b/Utilities/Poco/Foundation/include/Poco/RWLock.h
deleted file mode 100755
index d3c9c4645e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/RWLock.h
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// RWLock.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: RWLock
-//
-// Definition of the RWLock class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_RWLock_INCLUDED
-#define Foundation_RWLock_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/RWLock_WIN32.h"
-#else
-#include "Poco/RWLock_POSIX.h"
-#endif
-
-
-namespace Poco {
-
-
-class ScopedRWLock;
-
-
-class Foundation_API RWLock: private RWLockImpl
- /// A reader writer lock allows multiple concurrent
- /// readers or one exclusive writer.
-{
-public:
- typedef ScopedRWLock ScopedLock;
-
- RWLock();
- /// Creates the Reader/Writer lock.
-
- ~RWLock();
- /// Destroys the Reader/Writer lock.
-
- void readLock();
- /// Acquires a read lock. If another thread currently holds a write lock,
- /// waits until the write lock is released.
-
- bool tryReadLock();
- /// Tries to acquire a read lock. Immediately returns true if successful, or
- /// false if another thread currently holds a write lock.
-
- void writeLock();
- /// Acquires a write lock. If one or more other threads currently hold
- /// locks, waits until all locks are released. The results are undefined
- /// if the same thread already holds a read or write lock
-
- bool tryWriteLock();
- /// Tries to acquire a write lock. Immediately returns true if successful,
- /// or false if one or more other threads currently hold
- /// locks. The result is undefined if the same thread already
- /// holds a read or write lock.
-
- void unlock();
- /// Releases the read or write lock.
-
-private:
- RWLock(const RWLock&);
- RWLock& operator = (const RWLock&);
-};
-
-
-class Foundation_API ScopedRWLock
- /// A variant of ScopedLock for reader/writer locks.
-{
-public:
- ScopedRWLock(RWLock& rwl, bool write = false);
- ~ScopedRWLock();
-
-private:
- RWLock& _rwl;
-
- ScopedRWLock();
- ScopedRWLock(const ScopedRWLock&);
- ScopedRWLock& operator = (const ScopedRWLock&);
-};
-
-
-//
-// inlines
-//
-inline void RWLock::readLock()
-{
- readLockImpl();
-}
-
-
-inline bool RWLock::tryReadLock()
-{
- return tryReadLockImpl();
-}
-
-
-inline void RWLock::writeLock()
-{
- writeLockImpl();
-}
-
-
-inline bool RWLock::tryWriteLock()
-{
- return tryWriteLockImpl();
-}
-
-
-inline void RWLock::unlock()
-{
- unlockImpl();
-}
-
-
-inline ScopedRWLock::ScopedRWLock(RWLock& rwl, bool write): _rwl(rwl)
-{
- if (write)
- _rwl.writeLock();
- else
- _rwl.readLock();
-}
-
-
-inline ScopedRWLock::~ScopedRWLock()
-{
- _rwl.unlock();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_RWLock_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/RWLock_POSIX.h b/Utilities/Poco/Foundation/include/Poco/RWLock_POSIX.h
deleted file mode 100755
index 11b3216e39..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/RWLock_POSIX.h
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// RWLock_POSIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: RWLock
-//
-// Definition of the RWLockImpl class for POSIX Threads.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_RWLock_POSIX_INCLUDED
-#define Foundation_RWLock_POSIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include <pthread.h>
-#include <errno.h>
-
-
-namespace Poco {
-
-
-class Foundation_API RWLockImpl
-{
-protected:
- RWLockImpl();
- ~RWLockImpl();
- void readLockImpl();
- bool tryReadLockImpl();
- void writeLockImpl();
- bool tryWriteLockImpl();
- void unlockImpl();
-
-private:
- pthread_rwlock_t _rwl;
-};
-
-
-//
-// inlines
-//
-inline void RWLockImpl::readLockImpl()
-{
- if (pthread_rwlock_rdlock(&_rwl))
- throw SystemException("cannot lock reader/writer lock");
-}
-
-
-inline bool RWLockImpl::tryReadLockImpl()
-{
- int rc = pthread_rwlock_tryrdlock(&_rwl);
- if (rc == 0)
- return true;
- else if (rc == EBUSY)
- return false;
- else
- throw SystemException("cannot lock reader/writer lock");
-
-}
-
-
-inline void RWLockImpl::writeLockImpl()
-{
- if (pthread_rwlock_wrlock(&_rwl))
- throw SystemException("cannot lock reader/writer lock");
-}
-
-
-inline bool RWLockImpl::tryWriteLockImpl()
-{
- int rc = pthread_rwlock_trywrlock(&_rwl);
- if (rc == 0)
- return true;
- else if (rc == EBUSY)
- return false;
- else
- throw SystemException("cannot lock reader/writer lock");
-
-}
-
-
-inline void RWLockImpl::unlockImpl()
-{
- if (pthread_rwlock_unlock(&_rwl))
- throw SystemException("cannot unlock mutex");
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_RWLock_POSIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/RWLock_WIN32.h b/Utilities/Poco/Foundation/include/Poco/RWLock_WIN32.h
deleted file mode 100755
index 9f028f57cf..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/RWLock_WIN32.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// RWLock_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: RWLock
-//
-// Definition of the RWLockImpl class for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_RWLock_WIN32_INCLUDED
-#define Foundation_RWLock_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API RWLockImpl
-{
-protected:
- RWLockImpl();
- ~RWLockImpl();
- void readLockImpl();
- bool tryReadLockImpl();
- void writeLockImpl();
- bool tryWriteLockImpl();
- void unlockImpl();
-
-private:
- void addWriter();
- void removeWriter();
-
- HANDLE _mutex;
- HANDLE _readEvent;
- HANDLE _writeEvent;
- unsigned _readers;
- unsigned _writersWaiting;
- unsigned _writers;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_RWLock_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Random.h b/Utilities/Poco/Foundation/include/Poco/Random.h
deleted file mode 100755
index 95c465339d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Random.h
+++ /dev/null
@@ -1,187 +0,0 @@
-//
-// Random.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: Random
-//
-// Definition of class Random.
-//
-// Copyright (c) 2004-2006, 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.
-//
-//
-// Based on the FreeBSD random number generator.
-// src/lib/libc/stdlib/random.c,v 1.25
-//
-// Copyright (c) 1983, 1993
-// The Regents of the University of California. All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 4. Neither the name of the University nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE.
-//
-
-
-#ifndef Foundation_Random_INCLUDED
-#define Foundation_Random_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Random
- /// A better random number generator.
- /// Random implements a pseudo random number generator
- /// (PRNG). The PRNG is a nonlinear additive
- /// feedback random number generator using 256 bytes
- /// of state information and a period of up to 2^69.
-{
-public:
- enum Type
- {
- RND_STATE_0 = 8, /// linear congruential
- RND_STATE_32 = 32, /// x**7 + x**3 + 1
- RND_STATE_64 = 64, /// x**15 + x + 1
- RND_STATE_128 = 128, /// x**31 + x**3 + 1
- RND_STATE_256 = 256 /// x**63 + x + 1
- };
-
- Random(int stateSize = 256);
- /// Creates and initializes the PRNG.
- /// Specify either a state buffer size
- /// (8 to 256 bytes) or one of the Type values.
-
- ~Random();
- /// Destroys the PRNG.
-
- void seed(UInt32 seed);
- /// Seeds the pseudo random generator with the given seed.
-
- void seed();
- /// Seeds the pseudo random generator with a random seed
- /// obtained from a RandomInputStream.
-
- UInt32 next();
- /// Returns the next 31-bit pseudo random number.
-
- UInt32 next(UInt32 n);
- /// Returns the next 31-bit pseudo random number modulo n.
-
- char nextChar();
- /// Returns the next pseudo random character.
-
- bool nextBool();
- /// Returns the next boolean pseudo random value.
-
- float nextFloat();
- /// Returns the next float pseudo random number between 0.0 and 1.0.
-
- double nextDouble();
- /// Returns the next double pseudo random number between 0.0 and 1.0.
-
-protected:
- void initState(UInt32 seed, char* arg_state, Int32 n);
- static UInt32 goodRand(Int32 x);
-
-private:
- enum
- {
- MAX_TYPES = 5,
- NSHUFF = 50
- };
-
- UInt32* _fptr;
- UInt32* _rptr;
- UInt32* _state;
- int _randType;
- int _randDeg;
- int _randSep;
- UInt32* _endPtr;
- char* _pBuffer;
-};
-
-
-//
-// inlines
-//
-inline UInt32 Random::next(UInt32 n)
-{
- return next() % n;
-}
-
-
-inline char Random::nextChar()
-{
- return char((next() >> 3) & 0xFF);
-}
-
-
-inline bool Random::nextBool()
-{
- return (next() & 0x1000) != 0;
-}
-
-
-inline float Random::nextFloat()
-{
- return float(next()) / 0x7FFFFFFF;
-}
-
-
-inline double Random::nextDouble()
-{
- return double(next()) / 0x7FFFFFFF;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Random_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/RandomStream.h b/Utilities/Poco/Foundation/include/Poco/RandomStream.h
deleted file mode 100755
index d9c51ddeac..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/RandomStream.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// RandomStream.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: RandomStream
-//
-// Definition of class RandomInputStream.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_RandomStream_INCLUDED
-#define Foundation_RandomStream_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/BufferedStreamBuf.h"
-#include <istream>
-
-
-namespace Poco {
-
-
-class Foundation_API RandomBuf: public BufferedStreamBuf
- /// This streambuf generates random data.
- /// On Windows NT, the cryptographic API is used.
- /// On Unix, /dev/random is used, if available.
- /// Otherwise, a random number generator, some
- /// more-or-less random data and a SHA-1 digest
- /// is used to generate random data.
-{
-public:
- RandomBuf();
- ~RandomBuf();
- int readFromDevice(char* buffer, std::streamsize length);
-};
-
-
-class Foundation_API RandomIOS: public virtual std::ios
- /// The base class for RandomInputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- RandomIOS();
- ~RandomIOS();
- RandomBuf* rdbuf();
-
-protected:
- RandomBuf _buf;
-};
-
-
-class Foundation_API RandomInputStream: public RandomIOS, public std::istream
- /// This istream generates random data
- /// using the RandomBuf.
-{
-public:
- RandomInputStream();
- ~RandomInputStream();
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_RandomStream_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/RefCountedObject.h b/Utilities/Poco/Foundation/include/Poco/RefCountedObject.h
deleted file mode 100755
index 8d2f6a249d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/RefCountedObject.h
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// RefCountedObject.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: RefCountedObject
-//
-// Definition of the RefCountedObject class.
-//
-// Copyright (c) 2004-2009, 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.
-//
-
-
-#ifndef Foundation_RefCountedObject_INCLUDED
-#define Foundation_RefCountedObject_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/AtomicCounter.h"
-
-
-namespace Poco {
-
-
-class Foundation_API RefCountedObject
- /// A base class for objects that employ
- /// reference counting based garbage collection.
- ///
- /// Reference-counted objects inhibit construction
- /// by copying and assignment.
-{
-public:
- RefCountedObject();
- /// Creates the RefCountedObject.
- /// The initial reference count is one.
-
- void duplicate() const;
- /// Increments the object's reference count.
-
- void release() const;
- /// Decrements the object's reference count
- /// and deletes the object if the count
- /// reaches zero.
-
- int referenceCount() const;
- /// Returns the reference count.
-
-protected:
- virtual ~RefCountedObject();
- /// Destroys the RefCountedObject.
-
-private:
- RefCountedObject(const RefCountedObject&);
- RefCountedObject& operator = (const RefCountedObject&);
-
- mutable AtomicCounter _counter;
-};
-
-
-//
-// inlines
-//
-inline int RefCountedObject::referenceCount() const
-{
- return _counter.value();
-}
-
-
-inline void RefCountedObject::duplicate() const
-{
- ++_counter;
-}
-
-
-inline void RefCountedObject::release() const
-{
- if (--_counter == 0) delete this;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_RefCountedObject_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/RegularExpression.h b/Utilities/Poco/Foundation/include/Poco/RegularExpression.h
deleted file mode 100755
index 7bdcb6d773..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/RegularExpression.h
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// RegularExpression.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: RegExp
-// Module: RegularExpression
-//
-// Definitions of class RegularExpression.
-//
-// A wrapper class for Philip Hazel's PCRE - Perl Compatible Regular Expressions
-// library (http://www.pcre.org).
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_RegularExpression_INCLUDED
-#define Foundation_RegularExpression_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <vector>
-
-
-//
-// Copy these definitions from pcre.h
-// to avoid pulling in the entire header file
-//
-extern "C"
-{
- struct real_pcre;
- typedef struct real_pcre pcre;
- struct pcre_extra;
-}
-
-
-namespace Poco {
-
-
-class Foundation_API RegularExpression
- /// A class for working with regular expressions.
- /// Implemented using PCRE, the Perl Compatible
- /// Regular Expressions library by Philip Hazel
- /// (see http://www.pcre.org).
-{
-public:
- enum Options // These must match the corresponsing options in pcre.h!
- /// Some of the following options can only be passed to the constructor;
- /// some can be passed only to matching functions, and some can be used
- /// everywhere.
- ///
- /// * Options marked [ctor] can be passed to the constructor.
- /// * Options marked [match] can be passed to match, extract, split and subst.
- /// * Options marked [subst] can be passed to subst.
- ///
- /// See the PCRE documentation for more information.
- {
- RE_CASELESS = 0x00000001, /// case insensitive matching (/i) [ctor]
- RE_MULTILINE = 0x00000002, /// enable multi-line mode; affects ^ and $ (/m) [ctor]
- RE_DOTALL = 0x00000004, /// dot matches all characters, including newline (/s) [ctor]
- RE_EXTENDED = 0x00000004, /// totally ignore whitespace (/x) [ctor]
- RE_ANCHORED = 0x00000010, /// treat pattern as if it starts with a ^ [ctor, match]
- RE_DOLLAR_ENDONLY = 0x00000020, /// dollar matches end-of-string only, not last newline in string [ctor]
- RE_EXTRA = 0x00000040, /// enable optional PCRE functionality [ctor]
- RE_NOTBOL = 0x00000080, /// circumflex does not match beginning of string [match]
- RE_NOTEOL = 0x00000100, /// $ does not match end of string [match]
- RE_UNGREEDY = 0x00000200, /// make quantifiers ungreedy [ctor]
- RE_NOTEMPTY = 0x00000400, /// empty string never matches [match]
- RE_UTF8 = 0x00000800, /// assume pattern and subject is UTF-8 encoded [ctor]
- RE_NO_AUTO_CAPTURE = 0x00001000, /// disable numbered capturing parentheses [ctor, match]
- RE_NO_UTF8_CHECK = 0x00002000, /// do not check validity of UTF-8 code sequences [match]
- RE_FIRSTLINE = 0x00040000, /// an unanchored pattern is required to match
- /// before or at the first newline in the subject string,
- /// though the matched text may continue over the newline [ctor]
- RE_DUPNAMES = 0x00080000, /// names used to identify capturing subpatterns need not be unique [ctor]
- RE_NEWLINE_CR = 0x00100000, /// assume newline is CR ('\r'), the default [ctor]
- RE_NEWLINE_LF = 0x00200000, /// assume newline is LF ('\n') [ctor]
- RE_NEWLINE_CRLF = 0x00300000, /// assume newline is CRLF ("\r\n") [ctor]
- RE_NEWLINE_ANY = 0x00400000, /// assume newline is any valid Unicode newline character [ctor]
- RE_NEWLINE_ANYCRLF = 0x00500000, /// assume newline is any of CR, LF, CRLF [ctor]
- RE_GLOBAL = 0x10000000, /// replace all occurences (/g) [subst]
- RE_NO_VARS = 0x20000000 /// treat dollar in replacement string as ordinary character [subst]
- };
-
- struct Match
- {
- std::string::size_type offset; /// zero based offset (std::string::npos if subexpr does not match)
- std::string::size_type length; /// length of substring
- };
- typedef std::vector<Match> MatchVec;
-
- RegularExpression(const std::string& pattern, int options = 0, bool study = true);
- /// Creates a regular expression and parses the given pattern.
- /// If study is true, the pattern is analyzed and optimized. This
- /// is mainly useful if the pattern is used more than once.
- /// For a description of the options, please see the PCRE documentation.
- /// Throws a RegularExpressionException if the patter cannot be compiled.
-
- ~RegularExpression();
- /// Destroys the regular expression.
-
- int match(const std::string& subject, Match& mtch, int options = 0) const;
- /// Matches the given subject string against the pattern. Returns the position
- /// of the first captured substring in mtch.
- /// If no part of the subject matches the pattern, mtch.offset is std::string::npos and
- /// mtch.length is 0.
- /// Throws a RegularExpressionException in case of an error.
- /// Returns the number of matches.
-
- int match(const std::string& subject, std::string::size_type offset, Match& mtch, int options = 0) const;
- /// Matches the given subject string, starting at offset, against the pattern.
- /// Returns the position of the captured substring in mtch.
- /// If no part of the subject matches the pattern, mtch.offset is std::string::npos and
- /// mtch.length is 0.
- /// Throws a RegularExpressionException in case of an error.
- /// Returns the number of matches.
-
- int match(const std::string& subject, std::string::size_type offset, MatchVec& matches, int options = 0) const;
- /// Matches the given subject string against the pattern.
- /// The first entry in matches contains the position of the captured substring.
- /// The following entries identify matching subpatterns. See the PCRE documentation
- /// for a more detailed explanation.
- /// If no part of the subject matches the pattern, matches is empty.
- /// Throws a RegularExpressionException in case of an error.
- /// Returns the number of matches.
-
- bool match(const std::string& subject, std::string::size_type offset = 0) const;
- /// Returns true if and only if the subject matches the regular expression.
- ///
- /// Internally, this method sets the RE_ANCHORED and RE_NOTEMPTY options for
- /// matching, which means that the empty string will never match and
- /// the pattern is treated as if it starts with a ^.
-
- bool match(const std::string& subject, std::string::size_type offset, int options) const;
- /// Returns true if and only if the subject matches the regular expression.
-
- bool operator == (const std::string& subject) const;
- /// Returns true if and only if the subject matches the regular expression.
- ///
- /// Internally, this method sets the RE_ANCHORED and RE_NOTEMPTY options for
- /// matching, which means that the empty string will never match and
- /// the pattern is treated as if it starts with a ^.
-
- bool operator != (const std::string& subject) const;
- /// Returns true if and only if the subject does not match the regular expression.
- ///
- /// Internally, this method sets the RE_ANCHORED and RE_NOTEMPTY options for
- /// matching, which means that the empty string will never match and
- /// the pattern is treated as if it starts with a ^.
-
- int extract(const std::string& subject, std::string& str, int options = 0) const;
- /// Matches the given subject string against the pattern.
- /// Returns the captured string.
- /// Throws a RegularExpressionException in case of an error.
- /// Returns the number of matches.
-
- int extract(const std::string& subject, std::string::size_type offset, std::string& str, int options = 0) const;
- /// Matches the given subject string, starting at offset, against the pattern.
- /// Returns the captured string.
- /// Throws a RegularExpressionException in case of an error.
- /// Returns the number of matches.
-
- int split(const std::string& subject, std::vector<std::string>& strings, int options = 0) const;
- /// Matches the given subject string against the pattern.
- /// The first entry in captured is the captured substring.
- /// The following entries contain substrings matching subpatterns. See the PCRE documentation
- /// for a more detailed explanation.
- /// If no part of the subject matches the pattern, captured is empty.
- /// Throws a RegularExpressionException in case of an error.
- /// Returns the number of matches.
-
- int split(const std::string& subject, std::string::size_type offset, std::vector<std::string>& strings, int options = 0) const;
- /// Matches the given subject string against the pattern.
- /// The first entry in captured is the captured substring.
- /// The following entries contain substrings matching subpatterns. See the PCRE documentation
- /// for a more detailed explanation.
- /// If no part of the subject matches the pattern, captured is empty.
- /// Throws a RegularExpressionException in case of an error.
- /// Returns the number of matches.
-
- int subst(std::string& subject, const std::string& replacement, int options = 0) const;
- /// Substitute in subject all matches of the pattern with replacement.
- /// If RE_GLOBAL is specified as option, all matches are replaced. Otherwise,
- /// only the first match is replaced.
- /// Occurences of $<n> (for example, $1, $2, ...) in replacement are replaced
- /// with the corresponding captured string. $0 is the original subject string.
- /// Returns the number of replaced occurences.
-
- int subst(std::string& subject, std::string::size_type offset, const std::string& replacement, int options = 0) const;
- /// Substitute in subject all matches of the pattern with replacement,
- /// starting at offset.
- /// If RE_GLOBAL is specified as option, all matches are replaced. Otherwise,
- /// only the first match is replaced.
- /// Unless RE_NO_VARS is specified, occurences of $<n> (for example, $0, $1, $2, ... $9)
- /// in replacement are replaced with the corresponding captured string.
- /// $0 is the captured substring. $1 ... $n are the substrings maching the subpatterns.
- /// Returns the number of replaced occurences.
-
- static bool match(const std::string& subject, const std::string& pattern, int options = 0);
- /// Matches the given subject string against the regular expression given in pattern,
- /// using the given options.
-
-protected:
- std::string::size_type substOne(std::string& subject, std::string::size_type offset, const std::string& replacement, int options) const;
-
-private:
- pcre* _pcre;
- pcre_extra* _extra;
-
- static const int OVEC_SIZE;
-
- RegularExpression();
- RegularExpression(const RegularExpression&);
- RegularExpression& operator = (const RegularExpression&);
-};
-
-
-//
-// inlines
-//
-inline int RegularExpression::match(const std::string& subject, Match& mtch, int options) const
-{
- return match(subject, 0, mtch, options);
-}
-
-
-inline int RegularExpression::split(const std::string& subject, std::vector<std::string>& strings, int options) const
-{
- return split(subject, 0, strings, options);
-}
-
-
-inline int RegularExpression::subst(std::string& subject, const std::string& replacement, int options) const
-{
- return subst(subject, 0, replacement, options);
-}
-
-
-inline bool RegularExpression::operator == (const std::string& subject) const
-{
- return match(subject);
-}
-
-
-inline bool RegularExpression::operator != (const std::string& subject) const
-{
- return !match(subject);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_RegularExpression_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/RotateStrategy.h b/Utilities/Poco/Foundation/include/Poco/RotateStrategy.h
deleted file mode 100755
index 466904c4c7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/RotateStrategy.h
+++ /dev/null
@@ -1,187 +0,0 @@
-//
-// RotateStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: FileChannel
-//
-// Definition of the RotateStrategy class and subclasses.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_RotateStrategy_INCLUDED
-#define Foundation_RotateStrategy_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timespan.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Exception.h"
-#include "Poco/LogFile.h"
-#include "Poco/StringTokenizer.h"
-#include "Poco/DateTimeParser.h"
-#include "Poco/NumberParser.h"
-
-
-namespace Poco {
-
-
-class Foundation_API RotateStrategy
- /// The RotateStrategy is used by LogFile to determine when
- /// a file must be rotated.
-{
-public:
- RotateStrategy();
- virtual ~RotateStrategy();
-
- virtual bool mustRotate(LogFile* pFile) = 0;
- /// Returns true if the given log file must
- /// be rotated, false otherwise.
-
-private:
- RotateStrategy(const RotateStrategy&);
- RotateStrategy& operator = (const RotateStrategy&);
-};
-
-
-template <class DT>
-class RotateAtTimeStrategy: public RotateStrategy
- /// The file is rotated at specified [day,][hour]:minute
-{
-public:
- RotateAtTimeStrategy(const std::string& rtime):
- _day(-1),
- _hour(-1),
- _minute(0)
- {
- if (rtime.empty())
- throw InvalidArgumentException("Rotation time must be specified.");
-
- if ((rtime.find(',') != rtime.npos) && (rtime.find(':') == rtime.npos))
- throw InvalidArgumentException("Invalid rotation time specified.");
-
- StringTokenizer timestr(rtime, ",:", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- int index = 0;
-
- switch (timestr.count())
- {
- case 3: // day,hh:mm
- {
- std::string::const_iterator it = timestr[index].begin();
- _day = DateTimeParser::parseDayOfWeek(it, timestr[index].end());
- ++index;
- }
- case 2: // hh:mm
- _hour = NumberParser::parse(timestr[index]);
- ++index;
- case 1: // mm
- _minute = NumberParser::parse(timestr[index]);
- break;
- default:
- throw InvalidArgumentException("Invalid rotation time specified.");
- }
- getNextRollover();
- }
-
- ~RotateAtTimeStrategy()
- {
- }
-
- bool mustRotate(LogFile* pFile)
- {
- if (DT() >= _threshold)
- {
- getNextRollover();
- return true;
- }
- return false;
- }
-
-private:
- void getNextRollover()
- {
- Timespan tsp(0, 0, 1, 0, 1000); // 0,00:01:00.001
- do
- {
- _threshold += tsp;
- }
- while (!(_threshold.minute() == _minute &&
- (-1 == _hour || _threshold.hour() == _hour) &&
- (-1 == _day || _threshold.dayOfWeek() == _day)));
- // round to :00.0 seconds
- _threshold.assign(_threshold.year(), _threshold.month(), _threshold.day(), _threshold.hour(), _threshold.minute());
- }
-
- DT _threshold;
- int _day;
- int _hour;
- int _minute;
-};
-
-
-class Foundation_API RotateByIntervalStrategy: public RotateStrategy
- /// The file is rotated when the log file
- /// exceeds a given age.
- ///
- /// For this to work reliably across all platforms and file systems
- /// (there are severe issues on most platforms finding out the real
- /// creation date of a file), the creation date of the file is
- /// written into the log file as the first entry.
-{
-public:
- RotateByIntervalStrategy(const Timespan& span);
- ~RotateByIntervalStrategy();
- bool mustRotate(LogFile* pFile);
-
-private:
- Timespan _span;
- Timestamp _lastRotate;
- static const std::string ROTATE_TEXT;
-};
-
-
-class Foundation_API RotateBySizeStrategy: public RotateStrategy
- /// The file is rotated when the log file
- /// exceeds a given size.
-{
-public:
- RotateBySizeStrategy(UInt64 size);
- ~RotateBySizeStrategy();
- bool mustRotate(LogFile* pFile);
-
-private:
- UInt64 _size;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_RotateStrategy_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Runnable.h b/Utilities/Poco/Foundation/include/Poco/Runnable.h
deleted file mode 100755
index 8edc377561..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Runnable.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// Runnable.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Definition of the Runnable class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Runnable_INCLUDED
-#define Foundation_Runnable_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Runnable
- /// The Runnable interface with the run() method
- /// must be implemented by classes that provide
- /// an entry point for a thread.
-{
-public:
- Runnable();
- virtual ~Runnable();
-
- virtual void run() = 0;
- /// Do whatever the thread needs to do. Must
- /// be overridden by subclasses.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Runnable_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/RunnableAdapter.h b/Utilities/Poco/Foundation/include/Poco/RunnableAdapter.h
deleted file mode 100755
index 6b5962a7e5..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/RunnableAdapter.h
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// RunnableAdapter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Definition of the RunnableAdapter template class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_RunnableAdapter_INCLUDED
-#define Foundation_RunnableAdapter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Runnable.h"
-
-
-namespace Poco {
-
-
-template <class C>
-class RunnableAdapter: public Runnable
- /// This adapter simplifies using ordinary methods as
- /// targets for threads.
- /// Usage:
- /// RunnableAdapter<MyClass> ra(myObject, &MyObject::doSomething));
- /// Thread thr;
- /// thr.Start(ra);
- ///
- /// For using a freestanding or static member function as a thread
- /// target, please see the ThreadTarget class.
-{
-public:
- typedef void (C::*Callback)();
-
- RunnableAdapter(C& object, Callback method): _pObject(&object), _method(method)
- {
- }
-
- RunnableAdapter(const RunnableAdapter& ra): _pObject(ra._pObject), _method(ra._method)
- {
- }
-
- ~RunnableAdapter()
- {
- }
-
- RunnableAdapter& operator = (const RunnableAdapter& ra)
- {
- _pObject = ra._pObject;
- _method = ra._method;
- return *this;
- }
-
- void run()
- {
- (_pObject->*_method)();
- }
-
-private:
- RunnableAdapter();
-
- C* _pObject;
- Callback _method;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_RunnableAdapter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SHA1Engine.h b/Utilities/Poco/Foundation/include/Poco/SHA1Engine.h
deleted file mode 100755
index 3074a9106f..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SHA1Engine.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// SHA1Engine.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: SHA1Engine
-//
-// Definition of class SHA1Engine.
-//
-// Secure Hash Standard SHA-1 algorithm
-// (FIPS 180-1, see http://www.itl.nist.gov/fipspubs/fip180-1.htm)
-//
-// Based on the public domain implementation by Peter C. Gutmann
-// on 2 Sep 1992, modified by Carl Ellison to be SHA-1.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SHA1Engine_INCLUDED
-#define Foundation_SHA1Engine_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DigestEngine.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SHA1Engine: public DigestEngine
- /// This class implementes the SHA-1 message digest algorithm.
- /// (FIPS 180-1, see http://www.itl.nist.gov/fipspubs/fip180-1.htm)
-{
-public:
- enum
- {
- BLOCK_SIZE = 64,
- DIGEST_SIZE = 20
- };
-
- SHA1Engine();
- ~SHA1Engine();
-
- unsigned digestLength() const;
- void reset();
- const DigestEngine::Digest& digest();
-
-protected:
- void updateImpl(const void* data, unsigned length);
-
-private:
- void transform();
- static void byteReverse(UInt32* buffer, int byteCount);
-
- typedef UInt8 BYTE;
-
- struct Context
- {
- UInt32 digest[5]; // Message digest
- UInt32 countLo; // 64-bit bit count
- UInt32 countHi;
- UInt32 data[16]; // SHA data buffer
- UInt32 slop; // # of bytes saved in data[]
- };
-
- Context _context;
- DigestEngine::Digest _digest;
-
- SHA1Engine(const SHA1Engine&);
- SHA1Engine& operator = (const SHA1Engine&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SHA1Engine_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ScopedLock.h b/Utilities/Poco/Foundation/include/Poco/ScopedLock.h
deleted file mode 100755
index 8c0b387e42..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ScopedLock.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// ScopedLock.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Mutex
-//
-// Definition of the ScopedLock template class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_ScopedLock_INCLUDED
-#define Foundation_ScopedLock_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-template <class M>
-class ScopedLock
- /// A class that simplifies thread synchronization
- /// with a mutex.
- /// The constructor accepts a Mutex and locks it.
- /// The destructor unlocks the mutex.
-{
-public:
- inline ScopedLock(M& mutex): _mutex(mutex)
- {
- _mutex.lock();
- }
- inline ~ScopedLock()
- {
- _mutex.unlock();
- }
-
-private:
- M& _mutex;
-
- ScopedLock();
- ScopedLock(const ScopedLock&);
- ScopedLock& operator = (const ScopedLock&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ScopedLock_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ScopedUnlock.h b/Utilities/Poco/Foundation/include/Poco/ScopedUnlock.h
deleted file mode 100755
index ad29e9b4d1..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ScopedUnlock.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// ScopedUnlock.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Mutex
-//
-// Definition of the ScopedUnlock template class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_ScopedUnlock_INCLUDED
-#define Foundation_ScopedUnlock_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-template <class M>
-class ScopedUnlock
- /// A class that simplifies thread synchronization
- /// with a mutex.
- /// The constructor accepts a Mutex and unlocks it.
- /// The destructor locks the mutex.
-{
-public:
- inline ScopedUnlock(M& mutex, bool unlockNow = true): _mutex(mutex)
- {
- if (unlockNow)
- _mutex.unlock();
- }
- inline ~ScopedUnlock()
- {
- _mutex.lock();
- }
-
-private:
- M& _mutex;
-
- ScopedUnlock();
- ScopedUnlock(const ScopedUnlock&);
- ScopedUnlock& operator = (const ScopedUnlock&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ScopedUnlock_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Semaphore.h b/Utilities/Poco/Foundation/include/Poco/Semaphore.h
deleted file mode 100755
index c4d555ac15..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Semaphore.h
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// Semaphore.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Semaphore
-//
-// Definition of the Semaphore class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Semaphore_INCLUDED
-#define Foundation_Semaphore_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/Semaphore_WIN32.h"
-#else
-#include "Poco/Semaphore_POSIX.h"
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API Semaphore: private SemaphoreImpl
- /// A Semaphore is a synchronization object with the following
- /// characteristics:
- /// A semaphore has a value that is constrained to be a non-negative
- /// integer and two atomic operations. The allowable operations are V
- /// (here called set()) and P (here called wait()). A V (set()) operation
- /// increases the value of the semaphore by one.
- /// A P (wait()) operation decreases the value of the semaphore by one,
- /// provided that can be done without violating the constraint that the
- /// value be non-negative. A P (wait()) operation that is initiated when
- /// the value of the semaphore is 0 suspends the calling thread.
- /// The calling thread may continue when the value becomes positive again.
-{
-public:
- Semaphore(int n);
- Semaphore(int n, int max);
- /// Creates the semaphore. The current value
- /// of the semaphore is given in n. The
- /// maximum value of the semaphore is given
- /// in max.
- /// If only n is given, it must be greater than
- /// zero.
- /// If both n and max are given, max must be
- /// greater than zero, n must be greater than
- /// or equal to zero and less than or equal
- /// to max.
-
- ~Semaphore();
- /// Destroys the semaphore.
-
- void set();
- /// Increments the semaphore's value by one and
- /// thus signals the semaphore. Another thread
- /// waiting for the semaphore will be able
- /// to continue.
-
- void wait();
- /// Waits for the semaphore to become signalled.
- /// To become signalled, a semaphore's value must
- /// be greater than zero.
- /// Decrements the semaphore's value by one.
-
- void wait(long milliseconds);
- /// Waits for the semaphore to become signalled.
- /// To become signalled, a semaphore's value must
- /// be greater than zero.
- /// Throws a TimeoutException if the semaphore
- /// does not become signalled within the specified
- /// time interval.
- /// Decrements the semaphore's value by one
- /// if successful.
-
- bool tryWait(long milliseconds);
- /// Waits for the semaphore to become signalled.
- /// To become signalled, a semaphore's value must
- /// be greater than zero.
- /// Returns true if the semaphore
- /// became signalled within the specified
- /// time interval, false otherwise.
- /// Decrements the semaphore's value by one
- /// if successful.
-
-private:
- Semaphore();
- Semaphore(const Semaphore&);
- Semaphore& operator = (const Semaphore&);
-};
-
-
-//
-// inlines
-//
-inline void Semaphore::set()
-{
- setImpl();
-}
-
-
-inline void Semaphore::wait()
-{
- waitImpl();
-}
-
-
-inline void Semaphore::wait(long milliseconds)
-{
- if (!waitImpl(milliseconds))
- throw TimeoutException();
-}
-
-
-inline bool Semaphore::tryWait(long milliseconds)
-{
- return waitImpl(milliseconds);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Semaphore_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Semaphore_POSIX.h b/Utilities/Poco/Foundation/include/Poco/Semaphore_POSIX.h
deleted file mode 100755
index a672fbeb10..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Semaphore_POSIX.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// Semaphore_POSIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Semaphore
-//
-// Definition of the SemaphoreImpl class for POSIX Threads.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Semaphore_POSIX_INCLUDED
-#define Foundation_Semaphore_POSIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include <pthread.h>
-#include <errno.h>
-
-
-namespace Poco {
-
-
-class Foundation_API SemaphoreImpl
-{
-protected:
- SemaphoreImpl(int n, int max);
- ~SemaphoreImpl();
- void setImpl();
- void waitImpl();
- bool waitImpl(long milliseconds);
-
-private:
- volatile int _n;
- int _max;
- pthread_mutex_t _mutex;
- pthread_cond_t _cond;
-};
-
-
-//
-// inlines
-//
-inline void SemaphoreImpl::setImpl()
-{
- if (pthread_mutex_lock(&_mutex))
- throw SystemException("cannot signal semaphore (lock)");
- if (_n < _max)
- {
- ++_n;
- }
- else
- {
- pthread_mutex_unlock(&_mutex);
- throw SystemException("cannot signal semaphore: count would exceed maximum");
- }
- if (pthread_cond_signal(&_cond))
- {
- pthread_mutex_unlock(&_mutex);
- throw SystemException("cannot signal semaphore");
- }
- pthread_mutex_unlock(&_mutex);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Semaphore_POSIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Semaphore_WIN32.h b/Utilities/Poco/Foundation/include/Poco/Semaphore_WIN32.h
deleted file mode 100755
index b4ada1881d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Semaphore_WIN32.h
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// Semaphore_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Semaphore
-//
-// Definition of the SemaphoreImpl class for WIN32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Semaphore_WIN32_INCLUDED
-#define Foundation_Semaphore_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SemaphoreImpl
-{
-protected:
- SemaphoreImpl(int n, int max);
- ~SemaphoreImpl();
- void setImpl();
- void waitImpl();
- bool waitImpl(long milliseconds);
-
-private:
- HANDLE _sema;
-};
-
-
-//
-// inlines
-//
-inline void SemaphoreImpl::setImpl()
-{
- if (!ReleaseSemaphore(_sema, 1, NULL))
- {
- throw SystemException("cannot signal semaphore");
- }
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Semaphore_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedLibrary.h b/Utilities/Poco/Foundation/include/Poco/SharedLibrary.h
deleted file mode 100755
index ce15315e06..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedLibrary.h
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// SharedLibrary.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Definition of the SharedLibrary class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SharedLibrary_INCLUDED
-#define Foundation_SharedLibrary_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-#if defined(hpux) || defined(_hpux)
-#include "Poco/SharedLibrary_HPUX.h"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "Poco/SharedLibrary_UNIX.h"
-#elif defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "Poco/SharedLibrary_WIN32U.h"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/SharedLibrary_WIN32.h"
-#elif defined(POCO_OS_FAMILY_VMS)
-#include "Poco/SharedLibrary_VMS.h"
-#endif
-
-
-namespace Poco {
-
-
-class Foundation_API SharedLibrary: private SharedLibraryImpl
- /// The SharedLibrary class dynamically
- /// loads shared libraries at run-time.
-{
-public:
- SharedLibrary();
- /// Creates a SharedLibrary object.
-
- SharedLibrary(const std::string& path);
- /// Creates a SharedLibrary object and loads a library
- /// from the given path.
-
- virtual ~SharedLibrary();
- /// Destroys the SharedLibrary. The actual library
- /// remains loaded.
-
- void load(const std::string& path);
- /// Loads a shared library from the given path.
- /// Throws a LibraryAlreadyLoadedException if
- /// a library has already been loaded.
- /// Throws a LibraryLoadException if the library
- /// cannot be loaded.
-
- void unload();
- /// Unloads a shared library.
-
- bool isLoaded() const;
- /// Returns true iff a library has been loaded.
-
- bool hasSymbol(const std::string& name);
- /// Returns true iff the loaded library contains
- /// a symbol with the given name.
-
- void* getSymbol(const std::string& name);
- /// Returns the address of the symbol with
- /// the given name. For functions, this
- /// is the entry point of the function.
- /// Throws a NotFoundException if the symbol
- /// does not exist.
-
- const std::string& getPath() const;
- /// Returns the path of the library, as
- /// specified in a call to load() or the
- /// constructor.
-
- static std::string suffix();
- /// Returns the platform-specific filename suffix
- /// for shared libraries (including the period).
- /// In debug mode, the suffix also includes a
- /// "d" to specify the debug version of a library.
-
-private:
- SharedLibrary(const SharedLibrary&);
- SharedLibrary& operator = (const SharedLibrary&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SharedLibrary_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedLibrary_HPUX.h b/Utilities/Poco/Foundation/include/Poco/SharedLibrary_HPUX.h
deleted file mode 100755
index d350df40f8..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedLibrary_HPUX.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// SharedLibrary_HPUX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Definition of the SharedLibraryImpl class for HP-UX.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SharedLibrary_HPUX_INCLUDED
-#define Foundation_SharedLibrary_HPUX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-#include <dl.h>
-
-
-namespace Poco {
-
-
-class Foundation_API SharedLibraryImpl
-{
-protected:
- SharedLibraryImpl();
- ~SharedLibraryImpl();
- void loadImpl(const std::string& path);
- void unloadImpl();
- bool isLoadedImpl() const;
- void* findSymbolImpl(const std::string& name);
- const std::string& getPathImpl() const;
- static std::string suffixImpl();
-
-private:
- std::string _path;
- shl_t _handle;
- static FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SharedLibrary_HPUX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedLibrary_UNIX.h b/Utilities/Poco/Foundation/include/Poco/SharedLibrary_UNIX.h
deleted file mode 100755
index 90a63ad1fb..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedLibrary_UNIX.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// SharedLibrary_UNIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Definition of the SharedLibraryImpl class for UNIX (dlopen).
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SharedLibrary_UNIX_INCLUDED
-#define Foundation_SharedLibrary_UNIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SharedLibraryImpl
-{
-protected:
- SharedLibraryImpl();
- ~SharedLibraryImpl();
- void loadImpl(const std::string& path);
- void unloadImpl();
- bool isLoadedImpl() const;
- void* findSymbolImpl(const std::string& name);
- const std::string& getPathImpl() const;
- static std::string suffixImpl();
-
-private:
- std::string _path;
- void* _handle;
- static FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SharedLibrary_UNIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedLibrary_VMS.h b/Utilities/Poco/Foundation/include/Poco/SharedLibrary_VMS.h
deleted file mode 100755
index 6bf13842b6..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedLibrary_VMS.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// SharedLibrary_VMS.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Definition of the SharedLibraryImpl class for VMS (dlopen).
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SharedLibrary_VMS_INCLUDED
-#define Foundation_SharedLibrary_VMS_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SharedLibraryImpl
-{
-protected:
- SharedLibraryImpl();
- ~SharedLibraryImpl();
- void loadImpl(const std::string& path);
- void unloadImpl();
- bool isLoadedImpl() const;
- void* findSymbolImpl(const std::string& name);
- const std::string& getPathImpl() const;
- static std::string suffixImpl();
-
-private:
- std::string _path;
- static FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SharedLibrary_VMS_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedLibrary_WIN32.h b/Utilities/Poco/Foundation/include/Poco/SharedLibrary_WIN32.h
deleted file mode 100755
index 1aca078863..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedLibrary_WIN32.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// SharedLibrary_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Definition of the SharedLibraryImpl class for Win32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SharedLibrary_WIN32_INCLUDED
-#define Foundation_SharedLibrary_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SharedLibraryImpl
-{
-protected:
- SharedLibraryImpl();
- ~SharedLibraryImpl();
- void loadImpl(const std::string& path);
- void unloadImpl();
- bool isLoadedImpl() const;
- void* findSymbolImpl(const std::string& name);
- const std::string& getPathImpl() const;
- static std::string suffixImpl();
-
-private:
- std::string _path;
- void* _handle;
- static FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SharedLibrary_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedLibrary_WIN32U.h b/Utilities/Poco/Foundation/include/Poco/SharedLibrary_WIN32U.h
deleted file mode 100755
index 927c63864e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedLibrary_WIN32U.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// SharedLibrary_WIN32U.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Definition of the SharedLibraryImpl class for Win32.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SharedLibrary_WIN32U_INCLUDED
-#define Foundation_SharedLibrary_WIN32U_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SharedLibraryImpl
-{
-protected:
- SharedLibraryImpl();
- ~SharedLibraryImpl();
- void loadImpl(const std::string& path);
- void unloadImpl();
- bool isLoadedImpl() const;
- void* findSymbolImpl(const std::string& name);
- const std::string& getPathImpl() const;
- static std::string suffixImpl();
-
-private:
- std::string _path;
- void* _handle;
- static FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SharedLibrary_WIN32U_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedMemory.h b/Utilities/Poco/Foundation/include/Poco/SharedMemory.h
deleted file mode 100755
index 7885aaadd2..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedMemory.h
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// SharedMemory.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: SharedMemory
-//
-// Definition of the SharedMemory class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_SharedMemory_INCLUDED
-#define Foundation_SharedMemory_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <algorithm>
-#include <cstddef>
-
-
-namespace Poco {
-
-
-class SharedMemoryImpl;
-class File;
-
-
-class Foundation_API SharedMemory
- /// Create and manage a shared memory object.
- ///
- /// A SharedMemory object has value semantics, but
- /// is implemented using a handle/implementation idiom.
- /// Therefore, multiple SharedMemory objects can share
- /// a single, reference counted SharedMemoryImpl object.
-{
-public:
- enum AccessMode
- {
- AM_READ = 0,
- AM_WRITE
- };
-
- SharedMemory();
- /// Default constructor creates an unmapped SharedMemory object.
- /// No clients can connect to an unmapped SharedMemory object.
-
- SharedMemory(const std::string& name, std::size_t size, AccessMode mode, const void* addrHint = 0, bool server = true);
- /// Creates or connects to a shared memory object with the given name.
- ///
- /// For maximum portability, name should be a valid Unix filename and not
- /// contain any slashes or backslashes.
- ///
- /// An address hint can be passed to the system, specifying the desired
- /// start address of the shared memory area. Whether the hint
- /// is actually honored is, however, up to the system. Windows platform
- /// will generally ignore the hint.
- ///
- /// If server is set to false, the shared memory region will be unlinked
- /// by calling shm_unlink (on POSIX platforms) when the SharedMemory object is destroyed.
- /// The server parameter is ignored on Windows platforms.
-
- SharedMemory(const File& file, AccessMode mode, const void* addrHint = 0);
- /// Maps the entire contents of file into a shared memory segment.
- ///
- /// An address hint can be passed to the system, specifying the desired
- /// start address of the shared memory area. Whether the hint
- /// is actually honored is, however, up to the system. Windows platform
- /// will generally ignore the hint.
-
- SharedMemory(const SharedMemory& other);
- /// Creates a SharedMemory object by copying another one.
-
- ~SharedMemory();
- /// Destroys the SharedMemory.
-
- SharedMemory& operator = (const SharedMemory& other);
- /// Assigns another SharedMemory object.
-
- void swap(SharedMemory& other);
- /// Swaps the SharedMemory object with another one.
-
- char* begin() const;
- /// Returns the start address of the shared memory segment.
- /// Will be NULL for illegal segments.
-
- char* end() const;
- /// Returns the one-past-end end address of the shared memory segment.
- /// Will be NULL for illegal segments.
-
-private:
- SharedMemoryImpl* _pImpl;
-};
-
-
-//
-// inlines
-//
-inline void SharedMemory::swap(SharedMemory& other)
-{
- using std::swap;
- swap(_pImpl, other._pImpl);
-}
-
-
-} // namespace Poco::Poco
-
-
-#endif // Foundation_SharedMemory_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedMemory_DUMMY.h b/Utilities/Poco/Foundation/include/Poco/SharedMemory_DUMMY.h
deleted file mode 100755
index fd01fb54a9..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedMemory_DUMMY.h
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// SharedMemoryImpl.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: SharedMemoryImpl
-//
-// Definition of the SharedMemoryImpl class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_SharedMemoryImpl_INCLUDED
-#define Foundation_SharedMemoryImpl_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/SharedMemory.h"
-#include "Poco/RefCountedObject.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SharedMemoryImpl: public RefCountedObject
- /// A dummy implementation of shared memory, for systems
- /// that do not have shared memory support.
-{
-public:
- SharedMemoryImpl(const std::string& id, std::size_t size, SharedMemory::AccessMode mode, const void* addr, bool server);
- /// Creates or connects to a shared memory object with the given name.
- ///
- /// For maximum portability, name should be a valid Unix filename and not
- /// contain any slashes or backslashes.
- ///
- /// An address hint can be passed to the system, specifying the desired
- /// start address of the shared memory area. Whether the hint
- /// is actually honored is, however, up to the system. Windows platform
- /// will generally ignore the hint.
-
- SharedMemoryImpl(const Poco::File& aFile, SharedMemory::AccessMode mode, const void* addr);
- /// Maps the entire contents of file into a shared memory segment.
- ///
- /// An address hint can be passed to the system, specifying the desired
- /// start address of the shared memory area. Whether the hint
- /// is actually honored is, however, up to the system. Windows platform
- /// will generally ignore the hint.
-
- char* begin() const;
- /// Returns the start address of the shared memory segment.
-
- char* end() const;
- /// Returns the one-past-end end address of the shared memory segment.
-
-protected:
- ~SharedMemoryImpl();
- /// Destroys the SharedMemoryImpl.
-
-private:
- SharedMemoryImpl();
- SharedMemoryImpl(const SharedMemoryImpl&);
- SharedMemoryImpl& operator = (const SharedMemoryImpl&);
-};
-
-
-//
-// inlines
-//
-inline char* SharedMemoryImpl::begin() const
-{
- return 0;
-}
-
-
-inline char* SharedMemoryImpl::end() const
-{
- return 0;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SharedMemoryImpl_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedMemory_POSIX.h b/Utilities/Poco/Foundation/include/Poco/SharedMemory_POSIX.h
deleted file mode 100755
index bb4ff4b844..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedMemory_POSIX.h
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// SharedMemoryImpl.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: SharedMemoryImpl
-//
-// Definition of the SharedMemoryImpl class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_SharedMemoryImpl_INCLUDED
-#define Foundation_SharedMemoryImpl_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/SharedMemory.h"
-#include "Poco/RefCountedObject.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SharedMemoryImpl: public RefCountedObject
- /// Shared memory implementation for POSIX platforms.
-{
-public:
- SharedMemoryImpl(const std::string& name, std::size_t size, SharedMemory::AccessMode mode, const void* addrHint, bool server);
- /// Creates or connects to a shared memory object with the given name.
- ///
- /// For maximum portability, name should be a valid Unix filename and not
- /// contain any slashes or backslashes.
- ///
- /// An address hint can be passed to the system, specifying the desired
- /// start address of the shared memory area. Whether the hint
- /// is actually honored is, however, up to the system. Windows platform
- /// will generally ignore the hint.
- ///
- /// If server is set to false, the shared memory region will be unlinked
- /// by calling shm_unlink when the SharedMemory object is destroyed.
-
- SharedMemoryImpl(const Poco::File& file, SharedMemory::AccessMode mode, const void* addrHint);
- /// Maps the entire contents of file into a shared memory segment.
- ///
- /// An address hint can be passed to the system, specifying the desired
- /// start address of the shared memory area. Whether the hint
- /// is actually honored is, however, up to the system. Windows platform
- /// will generally ignore the hint.
-
- char* begin() const;
- /// Returns the start address of the shared memory segment.
-
- char* end() const;
- /// Returns the one-past-end end address of the shared memory segment.
-
-protected:
- void map(const void* addrHint);
- /// Maps the shared memory object.
-
- void unmap();
- /// Unmaps the shared memory object.
-
- void close();
- /// Releases the handle for the shared memory segment.
-
- ~SharedMemoryImpl();
- /// Destroys the SharedMemoryImpl.
-
-private:
- SharedMemoryImpl();
- SharedMemoryImpl(const SharedMemoryImpl&);
- SharedMemoryImpl& operator = (const SharedMemoryImpl&);
-
- std::size_t _size;
- int _fd;
- char* _address;
- SharedMemory::AccessMode _access;
- std::string _name;
- bool _fileMapped;
- bool _server;
-};
-
-
-//
-// inlines
-//
-inline char* SharedMemoryImpl::begin() const
-{
- return _address;
-}
-
-
-inline char* SharedMemoryImpl::end() const
-{
- return _address + _size;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SharedMemoryImpl_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedMemory_WIN32.h b/Utilities/Poco/Foundation/include/Poco/SharedMemory_WIN32.h
deleted file mode 100755
index 4d0c3bd90f..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedMemory_WIN32.h
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// SharedMemoryImpl.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: SharedMemoryImpl
-//
-// Definition of the SharedMemoryImpl class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_SharedMemoryImpl_INCLUDED
-#define Foundation_SharedMemoryImpl_INCLUDED
-
-
-#include "Poco/Poco.h"
-#include "Poco/SharedMemory.h"
-#include "Poco/RefCountedObject.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SharedMemoryImpl: public RefCountedObject
- /// Shared memory implementation for Windows platforms.
-{
-public:
- SharedMemoryImpl(const std::string& name, std::size_t size, SharedMemory::AccessMode mode, const void* addrHint, bool server);
- /// Creates or connects to a shared memory object with the given name.
- ///
- /// For maximum portability, name should be a valid Unix filename and not
- /// contain any slashes or backslashes.
- ///
- /// An address hint can be passed to the system, specifying the desired
- /// start address of the shared memory area. Whether the hint
- /// is actually honored is, however, up to the system. Windows platform
- /// will generally ignore the hint.
-
- SharedMemoryImpl(const Poco::File& file, SharedMemory::AccessMode mode, const void* addrHint);
- /// Maps the entire contents of file into a shared memory segment.
- ///
- /// An address hint can be passed to the system, specifying the desired
- /// start address of the shared memory area. Whether the hint
- /// is actually honored is, however, up to the system. Windows platform
- /// will generally ignore the hint.
-
- char* begin() const;
- /// Returns the beginn address of the SharedMemory segment. Will be null for illegal segments.
-
- char* end() const;
- /// Points past the last byte of the end address of the SharedMemory segment. Will be null for illegal segments.
-
-protected:
- void map();
- /// Maps the shared memory object.
-
- void unmap();
- /// Unmaps the shared memory object.
-
- void close();
- /// Releases the handle for the shared memory segment.
-
- ~SharedMemoryImpl();
- /// Destroys the SharedMemoryImpl.
-
-private:
- SharedMemoryImpl();
- SharedMemoryImpl(const SharedMemoryImpl&);
- SharedMemoryImpl& operator = (const SharedMemoryImpl&);
-
- std::string _name;
- HANDLE _memHandle;
- HANDLE _fileHandle;
- DWORD _size;
- DWORD _mode;
- char* _address;
-};
-
-
-//
-// inlines
-//
-inline char* SharedMemoryImpl::begin() const
-{
- return _address;
-}
-
-
-inline char* SharedMemoryImpl::end() const
-{
- return _address + _size;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SharedMemoryImpl_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SharedPtr.h b/Utilities/Poco/Foundation/include/Poco/SharedPtr.h
deleted file mode 100755
index c52f7ee2d7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SharedPtr.h
+++ /dev/null
@@ -1,423 +0,0 @@
-//
-// SharedPtr.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: SharedPtr
-//
-// Definition of the SharedPtr template class.
-//
-// Copyright (c) 2005-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.
-//
-
-
-#ifndef Foundation_SharedPtr_INCLUDED
-#define Foundation_SharedPtr_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include "Poco/AtomicCounter.h"
-#include <algorithm>
-
-
-namespace Poco {
-
-
-class ReferenceCounter
- /// Simple ReferenceCounter object, does not delete itself when count reaches 0.
-{
-public:
- ReferenceCounter(): _cnt(1)
- {
- }
-
- void duplicate()
- {
- ++_cnt;
- }
-
- int release()
- {
- return --_cnt;
- }
-
- int referenceCount() const
- {
- return _cnt.value();
- }
-
-private:
- AtomicCounter _cnt;
-};
-
-
-template <class C>
-class ReleasePolicy
- /// The default release policy for SharedPtr, which
- /// simply uses the delete operator to delete an object.
-{
-public:
- static void release(C* pObj)
- /// Delete the object.
- /// Note that pObj can be 0.
- {
- delete pObj;
- }
-};
-
-
-template <class C, class RC = ReferenceCounter, class RP = ReleasePolicy<C> >
-class SharedPtr
- /// SharedPtr is a "smart" pointer for classes implementing
- /// reference counting based garbage collection.
- /// SharedPtr is thus similar to AutoPtr. Unlike the
- /// AutoPtr template, which can only be used with
- /// classes that support reference counting, SharedPtr
- /// can be used with any class. For this to work, a
- /// SharedPtr manages a reference count for the object
- /// it manages.
- ///
- /// SharedPtr works in the following way:
- /// If an SharedPtr is assigned an ordinary pointer to
- /// an object (via the constructor or the assignment operator),
- /// it takes ownership of the object and the object's reference
- /// count is initialized to one.
- /// If the SharedPtr is assigned another SharedPtr, the
- /// object's reference count is incremented by one.
- /// The destructor of SharedPtr decrements the object's
- /// reference count by one and deletes the object if the
- /// reference count reaches zero.
- /// SharedPtr supports dereferencing with both the ->
- /// and the * operator. An attempt to dereference a null
- /// SharedPtr results in a NullPointerException being thrown.
- /// SharedPtr also implements all relational operators and
- /// a cast operator in case dynamic casting of the encapsulated data types
- /// is required.
-{
-public:
- SharedPtr(): _pCounter(new RC), _ptr(0)
- {
- }
-
- SharedPtr(C* ptr): _pCounter(new RC), _ptr(ptr)
- {
- }
-
- template <class Other, class OtherRP>
- SharedPtr(const SharedPtr<Other, RC, OtherRP>& ptr): _pCounter(ptr._pCounter), _ptr(const_cast<Other*>(ptr.get()))
- {
- _pCounter->duplicate();
- }
-
- SharedPtr(const SharedPtr& ptr): _pCounter(ptr._pCounter), _ptr(ptr._ptr)
- {
- _pCounter->duplicate();
- }
-
- ~SharedPtr()
- {
- release();
- }
-
- SharedPtr& assign(C* ptr)
- {
- if (get() != ptr)
- {
- RC* pTmp = new RC;
- release();
- _pCounter = pTmp;
- _ptr = ptr;
- }
- return *this;
- }
-
- SharedPtr& assign(const SharedPtr& ptr)
- {
- if (&ptr != this)
- {
- SharedPtr tmp(ptr);
- swap(tmp);
- }
- return *this;
- }
-
- template <class Other, class OtherRP>
- SharedPtr& assign(const SharedPtr<Other, RC, OtherRP>& ptr)
- {
- if (ptr.get() != _ptr)
- {
- SharedPtr tmp(ptr);
- swap(tmp);
- }
- return *this;
- }
-
- SharedPtr& operator = (C* ptr)
- {
- return assign(ptr);
- }
-
- SharedPtr& operator = (const SharedPtr& ptr)
- {
- return assign(ptr);
- }
-
- template <class Other, class OtherRP>
- SharedPtr& operator = (const SharedPtr<Other, RC, OtherRP>& ptr)
- {
- return assign<Other>(ptr);
- }
-
- void swap(SharedPtr& ptr)
- {
- std::swap(_ptr, ptr._ptr);
- std::swap(_pCounter, ptr._pCounter);
- }
-
- template <class Other>
- SharedPtr<Other, RC, RP> cast() const
- /// Casts the SharedPtr via a dynamic cast to the given type.
- /// Returns an SharedPtr containing NULL if the cast fails.
- /// Example: (assume class Sub: public Super)
- /// SharedPtr<Super> super(new Sub());
- /// SharedPtr<Sub> sub = super.cast<Sub>();
- /// poco_assert (sub.get());
- {
- Other* pOther = dynamic_cast<Other*>(_ptr);
- if (pOther)
- return SharedPtr<Other, RC, RP>(_pCounter, pOther);
- return SharedPtr<Other, RC, RP>();
- }
-
- template <class Other>
- SharedPtr<Other, RC, RP> unsafeCast() const
- /// Casts the SharedPtr via a static cast to the given type.
- /// Example: (assume class Sub: public Super)
- /// SharedPtr<Super> super(new Sub());
- /// SharedPtr<Sub> sub = super.unsafeCast<Sub>();
- /// poco_assert (sub.get());
- {
- Other* pOther = static_cast<Other*>(_ptr);
- return SharedPtr<Other, RC, RP>(_pCounter, pOther);
- }
-
- C* operator -> ()
- {
- return deref();
- }
-
- const C* operator -> () const
- {
- return deref();
- }
-
- C& operator * ()
- {
- return *deref();
- }
-
- const C& operator * () const
- {
- return *deref();
- }
-
- C* get()
- {
- return _ptr;
- }
-
- const C* get() const
- {
- return _ptr;
- }
-
- operator C* ()
- {
- return _ptr;
- }
-
- operator const C* () const
- {
- return _ptr;
- }
-
- bool operator ! () const
- {
- return _ptr == 0;
- }
-
- bool isNull() const
- {
- return _ptr == 0;
- }
-
- bool operator == (const SharedPtr& ptr) const
- {
- return get() == ptr.get();
- }
-
- bool operator == (const C* ptr) const
- {
- return get() == ptr;
- }
-
- bool operator == (C* ptr) const
- {
- return get() == ptr;
- }
-
- bool operator != (const SharedPtr& ptr) const
- {
- return get() != ptr.get();
- }
-
- bool operator != (const C* ptr) const
- {
- return get() != ptr;
- }
-
- bool operator != (C* ptr) const
- {
- return get() != ptr;
- }
-
- bool operator < (const SharedPtr& ptr) const
- {
- return get() < ptr.get();
- }
-
- bool operator < (const C* ptr) const
- {
- return get() < ptr;
- }
-
- bool operator < (C* ptr) const
- {
- return get() < ptr;
- }
-
- bool operator <= (const SharedPtr& ptr) const
- {
- return get() <= ptr.get();
- }
-
- bool operator <= (const C* ptr) const
- {
- return get() <= ptr;
- }
-
- bool operator <= (C* ptr) const
- {
- return get() <= ptr;
- }
-
- bool operator > (const SharedPtr& ptr) const
- {
- return get() > ptr.get();
- }
-
- bool operator > (const C* ptr) const
- {
- return get() > ptr;
- }
-
- bool operator > (C* ptr) const
- {
- return get() > ptr;
- }
-
- bool operator >= (const SharedPtr& ptr) const
- {
- return get() >= ptr.get();
- }
-
- bool operator >= (const C* ptr) const
- {
- return get() >= ptr;
- }
-
- bool operator >= (C* ptr) const
- {
- return get() >= ptr;
- }
-
- int referenceCount() const
- {
- return _pCounter->referenceCount();
- }
-
-private:
- C* deref() const
- {
- if (!_ptr)
- throw NullPointerException();
-
- return _ptr;
- }
-
- void release()
- {
- poco_assert_dbg (_pCounter);
- int i = _pCounter->release();
- if (i == 0)
- {
- RP::release(_ptr);
- _ptr = 0;
-
- delete _pCounter;
- _pCounter = 0;
- }
- }
-
- SharedPtr(RC* pCounter, C* ptr): _pCounter(pCounter), _ptr(ptr)
- /// for cast operation
- {
- poco_assert_dbg (_pCounter);
- _pCounter->duplicate();
- }
-
-private:
- RC* _pCounter;
- C* _ptr;
-
- template <class OtherC, class OtherRC, class OtherRP> friend class SharedPtr;
-};
-
-
-template <class C, class RC, class RP>
-inline void swap(SharedPtr<C, RC, RP>& p1, SharedPtr<C, RC, RP>& p2)
-{
- p1.swap(p2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SharedPtr_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SignalHandler.h b/Utilities/Poco/Foundation/include/Poco/SignalHandler.h
deleted file mode 100755
index b40294ceb0..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SignalHandler.h
+++ /dev/null
@@ -1,151 +0,0 @@
-//
-// SignalHandler.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: SignalHandler
-//
-// Definition of the SignalHandler class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SignalHandler_INCLUDED
-#define Foundation_SignalHandler_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-#if defined(POCO_OS_FAMILY_UNIX)
-
-
-#include <vector>
-#include <setjmp.h>
-
-
-namespace Poco {
-
-
-class Foundation_API SignalHandler
- /// This helper class simplifies the handling of POSIX signals.
- ///
- /// The class provides a signal handler (installed with
- /// installHandlers()) that translates certain POSIX
- /// signals (SIGILL, SIGBUS, SIGSEGV, SIGSYS) into
- /// C++ exceptions.
- ///
- /// Internally, a stack of sigjmp_buf structs is maintained for
- /// each thread. The constructor pushes a new sigjmp_buf onto
- /// the current thread's stack. The destructor pops the sigjmp_buf
- /// from the stack.
- ///
- /// The poco_throw_on_signal macro creates an instance of SignalHandler
- /// on the stack, which results in a new sigjmp_buf being created.
- /// The sigjmp_buf is then set-up with sigsetjmp().
- ///
- /// The handleSignal() method, which is invoked when a signal arrives,
- /// checks if a sigjmp_buf is available for the current thread.
- /// If so, siglongjmp() is used to jump out of the signal handler.
- ///
- /// Typical usage is as follows:
- ///
- /// try
- /// {
- /// poco_throw_on_signal;
- /// ...
- /// }
- /// catch (Poco::SignalException&)
- /// {
- /// ...
- /// }
- ///
- /// The best way to deal with a SignalException is to log as much context
- /// information as possible, to aid in debugging, and then to exit.
- ///
- /// The SignalHandler can be disabled globally by compiling POCO and client
- /// code with the POCO_NO_SIGNAL_HANDLER macro defined.
-{
-public:
- SignalHandler();
- /// Creates the SignalHandler.
-
- ~SignalHandler();
- /// Destroys the SignalHandler.
-
- sigjmp_buf& jumpBuffer();
- /// Returns the top-most sigjmp_buf for the current thread.
-
- static void throwSignalException(int sig);
- /// Throws a SignalException with a textual description
- /// of the given signal as argument.
-
- static void install();
- /// Installs signal handlers for SIGILL, SIGBUS, SIGSEGV
- /// and SIGSYS.
-
-protected:
- static void handleSignal(int sig);
- /// The actual signal handler.
-
- struct JumpBuffer
- /// sigjmp_buf cannot be used to instantiate a std::vector,
- /// so we provide a wrapper struct.
- {
- sigjmp_buf buf;
- };
- typedef std::vector<JumpBuffer> JumpBufferVec;
-
- static JumpBufferVec& jumpBufferVec();
- /// Returns the JumpBufferVec for the current thread.
-
-private:
- static JumpBufferVec _jumpBufferVec;
-
- friend class ThreadImpl;
-};
-
-
-#ifndef POCO_NO_SIGNAL_HANDLER
-#define poco_throw_on_signal \
- Poco::SignalHandler _poco_signalHandler; \
- int _poco_signal = sigsetjmp(_poco_signalHandler.jumpBuffer(), 1); \
- if (_poco_signal) _poco_signalHandler.throwSignalException(_poco_signal);
-#else
-#define poco_throw_on_signal
-#endif
-
-
-} // namespace Poco
-
-
-#endif // POCO_OS_FAMILY_UNIX
-
-
-#endif // Foundation_SignalHandler_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SimpleFileChannel.h b/Utilities/Poco/Foundation/include/Poco/SimpleFileChannel.h
deleted file mode 100755
index b2187cc7a2..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SimpleFileChannel.h
+++ /dev/null
@@ -1,156 +0,0 @@
-//
-// SimpleFileChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: SimpleFileChannel
-//
-// Definition of the SimpleFileChannel class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef Foundation_SimpleFileChannel_INCLUDED
-#define Foundation_SimpleFileChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-class LogFile;
-
-
-class Foundation_API SimpleFileChannel: public Channel
- /// A Channel that writes to a file. This class only
- /// supports simple log file rotation.
- ///
- /// For more features, see the FileChannel class.
- ///
- /// Only the message's text is written, followed
- /// by a newline.
- ///
- /// Chain this channel to a FormattingChannel with an
- /// appropriate Formatter to control what is in the text.
- ///
- /// Log file rotation based on log file size is supported.
- ///
- /// If rotation is enabled, the SimpleFileChannel will
- /// alternate between two log files. If the size of
- /// the primary log file exceeds a specified limit,
- /// the secondary log file will be used, and vice
- /// versa.
- ///
- /// Log rotation is configured with the "rotation"
- /// property, which supports the following values:
- /// * never: no log rotation
- /// * <n>: the file is rotated when its size exceeds
- /// <n> bytes.
- /// * <n> K: the file is rotated when its size exceeds
- /// <n> Kilobytes.
- /// * <n> M: the file is rotated when its size exceeds
- /// <n> Megabytes.
- ///
- /// The path of the (primary) log file can be specified with
- /// the "path" property. Optionally, the path of the secondary
- /// log file can be specified with the "secondaryPath" property.
- ///
- /// If no secondary path is specified, the secondary path will
- /// default to <primaryPath>.1.
-{
-public:
- SimpleFileChannel();
- /// Creates the FileChannel.
-
- SimpleFileChannel(const std::string& path);
- /// Creates the FileChannel for a file with the given path.
-
- void open();
- /// Opens the FileChannel and creates the log file if necessary.
-
- void close();
- /// Closes the FileChannel.
-
- void log(const Message& msg);
- /// Logs the given message to the file.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Sets the property with the given name.
- ///
- /// The following properties are supported:
- /// * path: The primary log file's path.
- /// * secondaryPath: The secondary log file's path.
- /// * rotation: The log file's rotation mode. See the
- /// SimpleFileChannel class for details.
-
- std::string getProperty(const std::string& name) const;
- /// Returns the value of the property with the given name.
- /// See setProperty() for a description of the supported
- /// properties.
-
- Timestamp creationDate() const;
- /// Returns the log file's creation date.
-
- UInt64 size() const;
- /// Returns the log file's current size in bytes.
-
- const std::string& path() const;
- /// Returns the log file's primary path.
-
- const std::string& secondaryPath() const;
- /// Returns the log file's secondary path.
-
- static const std::string PROP_PATH;
- static const std::string PROP_SECONDARYPATH;
- static const std::string PROP_ROTATION;
-
-protected:
- ~SimpleFileChannel();
- void setRotation(const std::string& rotation);
- void rotate();
-
-private:
- std::string _path;
- std::string _secondaryPath;
- std::string _rotation;
- UInt64 _limit;
- LogFile* _pFile;
- FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SimpleFileChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SimpleHashTable.h b/Utilities/Poco/Foundation/include/Poco/SimpleHashTable.h
deleted file mode 100755
index 03552e77f6..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SimpleHashTable.h
+++ /dev/null
@@ -1,419 +0,0 @@
-//
-// SimpleHashTable.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Hashing
-// Module: SimpleHashTable
-//
-// Definition of the SimpleHashTable class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_SimpleHashTable_INCLUDED
-#define Foundation_SimpleHashTable_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include "Poco/HashFunction.h"
-#include "Poco/HashStatistic.h"
-#include <vector>
-#include <map>
-#include <cstddef>
-#include <algorithm>
-
-
-namespace Poco {
-
-
-//@ deprecated
-template <class Key, class Value, class KeyHashFunction = HashFunction<Key> >
-class SimpleHashTable
- /// A SimpleHashTable stores a key value pair that can be looked up via a hashed key.
- ///
- /// In comparision to a HashTable, this class handles collisions by sequentially searching the next
- /// free location. This also means that the maximum size of this table is limited, i.e. if the hash table
- /// is full, it will throw an exception and that this class does not support remove operations.
- /// On the plus side it is faster than the HashTable.
- ///
- /// This class is NOT thread safe.
-{
-public:
- class HashEntry
- {
- public:
- Key key;
- Value value;
- HashEntry(const Key k, const Value v): key(k), value(v)
- {
- }
- };
-
- typedef std::vector<HashEntry*> HashTableVector;
-
- SimpleHashTable(UInt32 capacity = 251): _entries(capacity, 0), _size(0), _capacity(capacity)
- /// Creates the SimpleHashTable.
- {
- }
-
- SimpleHashTable(const SimpleHashTable& ht):
- _size(ht._size),
- _capacity(ht._capacity)
- {
- _entries.reserve(ht._capacity);
- for (typename HashTableVector::iterator it = ht._entries.begin(); it != ht._entries.end(); ++it)
- {
- if (*it)
- _entries.push_back(new HashEntry(*it));
- else
- _entries.push_back(0);
- }
- }
-
- ~SimpleHashTable()
- /// Destroys the SimpleHashTable.
- {
- clear();
- }
-
- SimpleHashTable& operator = (const SimpleHashTable& ht)
- {
- if (this != &ht)
- {
- SimpleHashTable tmp(ht);
- swap(tmp);
- }
- return *this;
- }
-
- void swap(SimpleHashTable& ht)
- {
- using std::swap;
- swap(_entries, ht._entries);
- swap(_size, ht._size);
- swap(_capacity, ht._capacity);
- }
-
- void clear()
- {
- for (typename HashTableVector::iterator it = _entries.begin(); it != _entries.end(); ++it)
- {
- delete *it;
- *it = 0;
- }
- _size = 0;
- }
-
- UInt32 insert(const Key& key, const Value& value)
- /// Returns the hash value of the inserted item.
- /// Throws an exception if the entry was already inserted
- {
- UInt32 hsh = hash(key);
- insertRaw(key, hsh, value);
- return hsh;
- }
-
- Value& insertRaw(const Key& key, UInt32 hsh, const Value& value)
- /// Returns the hash value of the inserted item.
- /// Throws an exception if the entry was already inserted
- {
- UInt32 pos = hsh;
- if (!_entries[pos])
- _entries[pos] = new HashEntry(key, value);
- else
- {
- UInt32 origHash = hsh;
- while (_entries[hsh % _capacity])
- {
- if (_entries[hsh % _capacity]->key == key)
- throw ExistsException();
- if (hsh - origHash > _capacity)
- throw PoolOverflowException("SimpleHashTable full");
- hsh++;
- }
- pos = hsh % _capacity;
- _entries[pos] = new HashEntry(key, value);
- }
- _size++;
- return _entries[pos]->value;
- }
-
- UInt32 update(const Key& key, const Value& value)
- /// Returns the hash value of the inserted item.
- /// Replaces an existing entry if it finds one
- {
- UInt32 hsh = hash(key);
- updateRaw(key, hsh, value);
- return hsh;
- }
-
- void updateRaw(const Key& key, UInt32 hsh, const Value& value)
- /// Returns the hash value of the inserted item.
- /// Replaces an existing entry if it finds one
- {
- if (!_entries[hsh])
- _entries[hsh] = new HashEntry(key, value);
- else
- {
- UInt32 origHash = hsh;
- while (_entries[hsh % _capacity])
- {
- if (_entries[hsh % _capacity]->key == key)
- {
- _entries[hsh % _capacity]->value = value;
- return;
- }
- if (hsh - origHash > _capacity)
- throw PoolOverflowException("SimpleHashTable full");
- hsh++;
- }
- _entries[hsh % _capacity] = new HashEntry(key, value);
- }
- _size++;
- }
-
- UInt32 hash(const Key& key) const
- {
- return _hash(key, _capacity);
- }
-
- const Value& get(const Key& key) const
- /// Throws an exception if the value does not exist
- {
- UInt32 hsh = hash(key);
- return getRaw(key, hsh);
- }
-
- const Value& getRaw(const Key& key, UInt32 hsh) const
- /// Throws an exception if the value does not exist
- {
- UInt32 origHash = hsh;
- while (true)
- {
- if (_entries[hsh % _capacity])
- {
- if (_entries[hsh % _capacity]->key == key)
- {
- return _entries[hsh % _capacity]->value;
- }
- }
- else
- throw InvalidArgumentException("value not found");
- if (hsh - origHash > _capacity)
- throw InvalidArgumentException("value not found");
- hsh++;
- }
- }
-
- Value& get(const Key& key)
- /// Throws an exception if the value does not exist
- {
- UInt32 hsh = hash(key);
- return const_cast<Value&>(getRaw(key, hsh));
- }
-
- const Value& operator [] (const Key& key) const
- {
- return get(key);
- }
-
- Value& operator [] (const Key& key)
- {
- UInt32 hsh = hash(key);
- UInt32 origHash = hsh;
- while (true)
- {
- if (_entries[hsh % _capacity])
- {
- if (_entries[hsh % _capacity]->key == key)
- {
- return _entries[hsh % _capacity]->value;
- }
- }
- else return insertRaw(key, hsh, Value());
- if (hsh - origHash > _capacity)
- return insertRaw(key, hsh, Value());
- hsh++;
- }
- }
-
- const Key& getKeyRaw(const Key& key, UInt32 hsh)
- /// Throws an exception if the key does not exist. returns a reference to the internally
- /// stored key. Useful when someone does an insert and wants for performance reason only to store
- /// a pointer to the key in another collection
- {
- UInt32 origHash = hsh;
- while (true)
- {
- if (_entries[hsh % _capacity])
- {
- if (_entries[hsh % _capacity]->key == key)
- {
- return _entries[hsh % _capacity]->key;
- }
- }
- else
- throw InvalidArgumentException("key not found");
-
- if (hsh - origHash > _capacity)
- throw InvalidArgumentException("key not found");
- hsh++;
- }
- }
-
- bool get(const Key& key, Value& v) const
- /// Sets v to the found value, returns false if no value was found
- {
- UInt32 hsh = hash(key);
- return getRaw(key, hsh, v);
- }
-
- bool getRaw(const Key& key, UInt32 hsh, Value& v) const
- /// Sets v to the found value, returns false if no value was found
- {
- UInt32 origHash = hsh;
- while (true)
- {
- if (_entries[hsh % _capacity])
- {
- if (_entries[hsh % _capacity]->key == key)
- {
- v = _entries[hsh % _capacity]->value;
- return true;
- }
- }
- else
- return false;
- if (hsh - origHash > _capacity)
- return false;
- hsh++;
- }
- }
-
- bool exists(const Key& key) const
- {
- UInt32 hsh = hash(key);
- return existsRaw(key, hsh);
- }
-
- bool existsRaw(const Key& key, UInt32 hsh) const
- {
- UInt32 origHash = hsh;
- while (true)
- {
- if (_entries[hsh % _capacity])
- {
- if (_entries[hsh % _capacity]->key == key)
- {
- return true;
- }
- }
- else
- return false;
- if (hsh - origHash > _capacity)
- return false;
- hsh++;
- }
- }
-
- std::size_t size() const
- /// Returns the number of elements already inserted into the SimpleHashTable
- {
- return _size;
- }
-
- UInt32 capacity() const
- {
- return _capacity;
- }
-
- void resize(UInt32 newSize)
- /// Resizes the hashtable, rehashes all existing entries. Expensive!
- {
- if (_capacity != newSize)
- {
- SimpleHashTable tmp(newSize);
- swap(tmp);
- for (typename HashTableVector::const_iterator it = tmp._entries.begin(); it != tmp._entries.end(); ++it)
- {
- if (*it)
- {
- insertRaw((*it)->key, hash((*it)->key), (*it)->value);
- }
- }
- }
- }
-
- HashStatistic currentState(bool details = false) const
- /// Returns the current internal state
- {
- UInt32 numberOfEntries = (UInt32)_size;
- UInt32 numZeroEntries = 0;
- UInt32 maxEntriesPerHash = 0;
- std::vector<UInt32> detailedEntriesPerHash;
- #ifdef _DEBUG
- UInt32 totalSize = 0;
- #endif
- for (int i=0; i < _capacity; ++i)
- {
- if (_entries[i])
- {
- maxEntriesPerHash = 1;
- UInt32 size = 1;
- if (details)
- detailedEntriesPerHash.push_back(size);
- #ifdef DEBUG
- totalSize += size;
- #endif
- }
- else
- {
- numZeroEntries++;
- if (details)
- detailedEntriesPerHash.push_back(0);
- }
- }
- poco_assert_dbg(totalSize == numberOfEntries);
-
- return HashStatistic(_capacity, numberOfEntries, numZeroEntries, maxEntriesPerHash, detailedEntriesPerHash);
- }
-
-private:
- HashTableVector _entries;
- std::size_t _size;
- UInt32 _capacity;
- KeyHashFunction _hash;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_HashTable_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SingletonHolder.h b/Utilities/Poco/Foundation/include/Poco/SingletonHolder.h
deleted file mode 100755
index 6e49abf2f3..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SingletonHolder.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// SingletonHolder.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: SingletonHolder
-//
-// Definition of the SingletonHolder template.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SingletonHolder_INCLUDED
-#define Foundation_SingletonHolder_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-template <class S>
-class SingletonHolder
- /// This is a helper template class for managing
- /// singleton objects allocated on the heap.
- /// The class ensures proper deletion (including
- /// calling of the destructor) of singleton objects
- /// when the application that created them terminates.
-{
-public:
- SingletonHolder()
- /// Creates the SingletonHolder.
- {
- _pS = 0;
- }
- ~SingletonHolder()
- /// Destroys the SingletonHolder and the singleton
- /// object that it holds.
- {
- delete _pS;
- }
- S* get()
- /// Returns a pointer to the singleton object
- /// hold by the SingletonHolder. The first call
- /// to get will create the singleton.
- {
- FastMutex::ScopedLock lock(_m);
- if (!_pS) _pS = new S;
- return _pS;
- }
-
-private:
- S* _pS;
- FastMutex _m;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SingletonHolder_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SplitterChannel.h b/Utilities/Poco/Foundation/include/Poco/SplitterChannel.h
deleted file mode 100755
index 4b64a727ab..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SplitterChannel.h
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// SplitterChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: SplitterChannel
-//
-// Definition of the SplitterChannel class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SplitterChannel_INCLUDED
-#define Foundation_SplitterChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-#include "Poco/Mutex.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-class Foundation_API SplitterChannel: public Channel
- /// This channel sends a message to multiple
- /// channels simultaneously.
-{
-public:
- SplitterChannel();
- /// Creates the SplitterChannel.
-
- void addChannel(Channel* pChannel);
- /// Attaches a channel, which may not be null.
-
- void removeChannel(Channel* pChannel);
- /// Removes a channel.
-
- void log(const Message& msg);
- /// Sends the given Message to all
- /// attaches channels.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Sets or changes a configuration property.
- ///
- /// Only the "channel" property is supported, which allows
- /// adding a comma-separated list of channels via the LoggingRegistry.
- /// The "channel" property is set-only.
- /// To simplify file-based configuration, all property
- /// names starting with "channel" are treated as "channel".
-
- void close();
- /// Removes all channels.
-
- int count() const;
- /// Returns the number of channels in the SplitterChannel.
-
-protected:
- ~SplitterChannel();
-
-private:
- typedef std::vector<Channel*> ChannelVec;
-
- ChannelVec _channels;
- mutable FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SplitterChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Stopwatch.h b/Utilities/Poco/Foundation/include/Poco/Stopwatch.h
deleted file mode 100755
index 8824270076..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Stopwatch.h
+++ /dev/null
@@ -1,130 +0,0 @@
-//
-// Stopwatch.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: Stopwatch
-//
-// Definition of the Stopwatch class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Stopwatch_INCLUDED
-#define Foundation_Stopwatch_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Stopwatch
- /// A simple facility to measure time intervals
- /// with microsecond resolution.
-{
-public:
- Stopwatch();
- ~Stopwatch();
-
- void start();
- /// Starts (or restarts) the stopwatch.
-
- void stop();
- /// Stops or pauses the stopwatch.
-
- void reset();
- /// Resets the stopwatch.
-
- void restart();
- /// Resets and starts the stopwatch.
-
- Timestamp::TimeDiff elapsed() const;
- /// Returns the elapsed time in microseconds
- /// since the stopwatch started.
-
- int elapsedSeconds() const;
- /// Returns the number of seconds elapsed
- /// since the stopwatch started.
-
- static Timestamp::TimeVal resolution();
- /// Returns the resolution of the stopwatch.
-
-private:
- Stopwatch(const Stopwatch&);
- Stopwatch& operator = (const Stopwatch&);
-
- Timestamp _start;
- Timestamp::TimeDiff _elapsed;
- bool _running;
-};
-
-
-//
-// inlines
-//
-inline void Stopwatch::start()
-{
- if (!_running)
- {
- _start.update();
- _running = true;
- }
-}
-
-
-inline void Stopwatch::stop()
-{
- if (_running)
- {
- Timestamp current;
- _elapsed += current - _start;
- _running = false;
- }
-}
-
-
-inline int Stopwatch::elapsedSeconds() const
-{
- return int(elapsed()/resolution());
-}
-
-
-inline Timestamp::TimeVal Stopwatch::resolution()
-{
- return Timestamp::resolution();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Stopwatch_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/StrategyCollection.h b/Utilities/Poco/Foundation/include/Poco/StrategyCollection.h
deleted file mode 100755
index ded17a7aea..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/StrategyCollection.h
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// StrategyCollection.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: StrategyCollection
-//
-// Definition of the StrategyCollection class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_StrategyCollection_INCLUDED
-#define Foundation_StrategyCollection_INCLUDED
-
-
-#include "Poco/KeyValueArgs.h"
-#include "Poco/ValidArgs.h"
-#include "Poco/AbstractStrategy.h"
-#include "Poco/SharedPtr.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-template <class TKey, class TValue>
-class StrategyCollection: public AbstractStrategy<TKey, TValue>
- /// An StrategyCollection is a decorator masking n collections as a single one
-{
-public:
- typedef std::vector<SharedPtr<AbstractStrategy<TKey, TValue> > > Strategies;
- typedef typename Strategies::iterator Iterator;
- typedef typename Strategies::const_iterator ConstIterator;
-
-public:
- StrategyCollection()
- {
- }
-
- ~StrategyCollection()
- {
- }
-
- void pushBack(AbstractStrategy<TKey, TValue>* pStrat)
- /// Adds an AbstractStrategy to the collection. Class takes ownership of pointer
- {
- _strategies.push_back(SharedPtr<AbstractStrategy<TKey, TValue> >(pStrat));
- }
-
- void popBack()
- /// Removes the last added AbstractStrategy from the collection.
- {
- _strategies.pop_back();
- }
-
- void onAdd(const void* pSender, const KeyValueArgs <TKey, TValue>& key)
- /// Adds the key to the strategy.
- /// If for the key already an entry exists, it will be overwritten.
- {
- Iterator it = _strategies.begin();
- Iterator endIt = _strategies.end();
- for (; it != endIt; ++it)
- {
- (*it)->onAdd(pSender, key);
- }
- }
-
- void onRemove(const void* pSender, const TKey& key)
- /// Removes an entry from the strategy. If the entry is not found
- /// the remove is ignored.
- {
- Iterator it = _strategies.begin();
- Iterator endIt = _strategies.end();
- for (; it != endIt; ++it)
- {
- (*it)->onRemove(pSender, key);
- }
- }
-
- void onGet(const void* pSender, const TKey& key)
- {
- Iterator it = _strategies.begin();
- Iterator endIt = _strategies.end();
- for (; it != endIt; ++it)
- {
- (*it)->onGet(pSender, key);
- }
- }
-
- void onClear(const void* pSender, const EventArgs& args)
- {
- Iterator it = _strategies.begin();
- Iterator endIt = _strategies.end();
- for (; it != endIt; ++it)
- {
- (*it)->onClear(pSender, args);
- }
- }
-
- void onIsValid(const void* pSender, ValidArgs<TKey>& key)
- {
- Iterator it = _strategies.begin();
- Iterator endIt = _strategies.end();
- for (; it != endIt && key.isValid(); ++it)
- {
- (*it)->onIsValid(pSender, key);
- }
- }
-
- void onReplace(const void* pSender, std::set<TKey>& elemsToRemove)
- {
- Iterator it = _strategies.begin();
- Iterator endIt = _strategies.end();
- for (; it != endIt; ++it)
- {
- (*it)->onReplace(pSender, elemsToRemove);
- }
- }
-
-protected:
- Strategies _strategies;
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/StreamChannel.h b/Utilities/Poco/Foundation/include/Poco/StreamChannel.h
deleted file mode 100755
index 9b0ff89b11..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/StreamChannel.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// StreamChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: StreamChannel
-//
-// Definition of the StreamChannel class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_StreamChannel_INCLUDED
-#define Foundation_StreamChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-#include "Poco/Mutex.h"
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API StreamChannel: public Channel
- /// A channel that writes to an ostream.
- ///
- /// Only the message's text is written, followed
- /// by a newline.
- ///
- /// Chain this channel to a FormattingChannel with an
- /// appropriate Formatter to control what is contained
- /// in the text.
-{
-public:
- StreamChannel(std::ostream& str);
- /// Creates the channel.
-
- void log(const Message& msg);
- /// Logs the given message to the channel's stream.
-
-protected:
- virtual ~StreamChannel();
-
-private:
- std::ostream& _str;
- FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_StreamChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/StreamConverter.h b/Utilities/Poco/Foundation/include/Poco/StreamConverter.h
deleted file mode 100755
index 52beaf6c43..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/StreamConverter.h
+++ /dev/null
@@ -1,150 +0,0 @@
-//
-// StreamConverter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: StreamConverter
-//
-// Definition of the StreamConverter class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_StreamConverter_INCLUDED
-#define Foundation_StreamConverter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/TextEncoding.h"
-#include "Poco/UnbufferedStreamBuf.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API StreamConverterBuf: public UnbufferedStreamBuf
- /// A StreamConverter converts streams from one encoding (inEncoding)
- /// into another (outEncoding).
- /// If a character cannot be represented in outEncoding, defaultChar
- /// is used instead.
- /// If a byte sequence is not valid in inEncoding, defaultChar is used
- /// instead and the encoding error count is incremented.
-{
-public:
- StreamConverterBuf(std::istream& istr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar = '?');
- /// Creates the StreamConverterBuf and connects it
- /// to the given input stream.
-
- StreamConverterBuf(std::ostream& ostr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar = '?');
- /// Creates the StreamConverterBuf and connects it
- /// to the given output stream.
-
- ~StreamConverterBuf();
- /// Destroys the StreamConverterBuf.
-
- int errors() const;
- /// Returns the number of encoding errors encountered.
-
-protected:
- int readFromDevice();
- int writeToDevice(char c);
-
-private:
- std::istream* _pIstr;
- std::ostream* _pOstr;
- const TextEncoding& _inEncoding;
- const TextEncoding& _outEncoding;
- int _defaultChar;
- unsigned char _buffer[TextEncoding::MAX_SEQUENCE_LENGTH];
- int _sequenceLength;
- int _pos;
- int _errors;
-};
-
-
-class Foundation_API StreamConverterIOS: public virtual std::ios
- /// The base class for InputStreamConverter and OutputStreamConverter.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- StreamConverterIOS(std::istream& istr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar = '?');
- StreamConverterIOS(std::ostream& ostr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar = '?');
- ~StreamConverterIOS();
- StreamConverterBuf* rdbuf();
- int errors() const;
-
-protected:
- StreamConverterBuf _buf;
-};
-
-
-class Foundation_API InputStreamConverter: public StreamConverterIOS, public std::istream
- /// This stream converts all characters read from the
- /// underlying istream from one character encoding into another.
- /// If a character cannot be represented in outEncoding, defaultChar
- /// is used instead.
- /// If a byte sequence read from the underlying stream is not valid in inEncoding,
- /// defaultChar is used instead and the encoding error count is incremented.
-{
-public:
- InputStreamConverter(std::istream& istr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar = '?');
- /// Creates the InputStreamConverter and connects it
- /// to the given input stream.
-
- ~InputStreamConverter();
- /// Destroys the stream.
-};
-
-
-class Foundation_API OutputStreamConverter: public StreamConverterIOS, public std::ostream
- /// This stream converts all characters written to the
- /// underlying ostream from one character encoding into another.
- /// If a character cannot be represented in outEncoding, defaultChar
- /// is used instead.
- /// If a byte sequence written to the stream is not valid in inEncoding,
- /// defaultChar is used instead and the encoding error count is incremented.
-{
-public:
- OutputStreamConverter(std::ostream& ostr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar = '?');
- /// Creates the OutputStreamConverter and connects it
- /// to the given input stream.
-
- ~OutputStreamConverter();
- /// Destroys the CountingOutputStream.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_StreamConverter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/StreamCopier.h b/Utilities/Poco/Foundation/include/Poco/StreamCopier.h
deleted file mode 100755
index 124c5fcf94..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/StreamCopier.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// StreamCopier.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: StreamCopier
-//
-// Definition of class StreamCopier.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_StreamCopier_INCLUDED
-#define Foundation_StreamCopier_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API StreamCopier
- /// This class provides static methods to copy the contents from one stream
- /// into another.
-{
-public:
- static std::streamsize copyStream(std::istream& istr, std::ostream& ostr, unsigned bufferSize = 8192);
- /// Writes all bytes readable from istr to ostr, using an internal buffer.
- ///
- /// Returns the number of bytes copied.
-
- static std::streamsize copyStreamUnbuffered(std::istream& istr, std::ostream& ostr);
- /// Writes all bytes readable from istr to ostr.
- ///
- /// Returns the number of bytes copied.
-
- static std::streamsize copyToString(std::istream& istr, std::string& str, unsigned bufferSize = 8192);
- /// Appends all bytes readable from istr to the given string, using an internal buffer.
- ///
- /// Returns the number of bytes copied.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_StreamCopier_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/StreamTokenizer.h b/Utilities/Poco/Foundation/include/Poco/StreamTokenizer.h
deleted file mode 100755
index bc1894f775..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/StreamTokenizer.h
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// StreamTokenizer.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: StreamTokenizer
-//
-// Definition of the StreamTokenizer class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_StreamTokenizer_INCLUDED
-#define Foundation_StreamTokenizer_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Token.h"
-#include <istream>
-#include <vector>
-
-
-namespace Poco {
-
-
-class Foundation_API StreamTokenizer
- /// A stream tokenizer splits an input stream
- /// into a sequence of tokens of different kinds.
- /// Various token kinds can be registered with
- /// the tokenizer.
-{
-public:
- StreamTokenizer();
- /// Creates a StreamTokenizer with no attached stream.
-
- StreamTokenizer(std::istream& istr);
- /// Creates a StreamTokenizer with no attached stream.
-
- virtual ~StreamTokenizer();
- /// Destroys the StreamTokenizer and deletes all
- /// registered tokens.
-
- void attachToStream(std::istream& istr);
- /// Attaches the tokenizer to an input stream.
-
- void addToken(Token* pToken);
- /// Adds a token class to the tokenizer. The
- /// tokenizer takes ownership of the token and
- /// deletes it when no longer needed. Comment
- /// and whitespace tokens will be marked as
- /// ignorable, which means that next() will not
- /// return them.
-
- void addToken(Token* pToken, bool ignore);
- /// Adds a token class to the tokenizer. The
- /// tokenizer takes ownership of the token and
- /// deletes it when no longer needed.
- /// If ignore is true, the token will be marked
- /// as ignorable, which means that next() will
- /// not return it.
-
- const Token* next();
- /// Extracts the next token from the input stream.
- /// Returns a pointer to an EOFToken if there are
- /// no more characters to read.
- /// Returns a pointer to an InvalidToken if an
- /// invalid character is encountered.
- /// If a token is marked as ignorable, it will not
- /// be returned, and the next token will be
- /// examined.
- /// Never returns a NULL pointer.
- /// You must not delete the token returned by next().
-
-private:
- struct TokenInfo
- {
- Token* pToken;
- bool ignore;
- };
-
- typedef std::vector<TokenInfo> TokenVec;
-
- TokenVec _tokens;
- std::istream* _pIstr;
- InvalidToken _invalidToken;
- EOFToken _eofToken;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_StreamTokenizer_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/StreamUtil.h b/Utilities/Poco/Foundation/include/Poco/StreamUtil.h
deleted file mode 100755
index be2a51356c..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/StreamUtil.h
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// StreamUtil.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: StreamUtil
-//
-// Stream implementation support.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef Foundation_StreamUtil_INCLUDED
-#define Foundation_StreamUtil_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-// poco_ios_init
-//
-// This is a workaround for a bug in the Dinkumware
-// implementation of iostreams.
-//
-// Calling basic_ios::init() multiple times for the
-// same basic_ios instance results in a memory leak
-// caused by the ios' locale being allocated more than
-// once, each time overwriting the old pointer.
-// This usually occurs in the following scenario:
-//
-// class MyStreamBuf: public std::streambuf
-// {
-// ...
-// };
-//
-// class MyIOS: public virtual std::ios
-// {
-// public:
-// MyIOS()
-// {
-// init(&_buf);
-// }
-// protected:
-// MyStreamBuf _buf;
-// };
-//
-// class MyIStream: public MyIOS, public std::istream
-// {
-// ...
-// };
-//
-// In this scenario, std::ios::init() is called twice
-// (the first time by the MyIOS constructor, the second
-// time by the std::istream constructor), resulting in
-// two locale objects being allocated, the pointer second
-// one overwriting the pointer to the first one and thus
-// causing a memory leak.
-//
-// The workaround is to call init() only once for each
-// stream object - by the istream, ostream or iostream
-// constructor, and not calling init() in ios-derived
-// base classes.
-//
-// Some stream implementations, however, require that
-// init() is called in the MyIOS constructor.
-// Therefore we replace each call to init() with
-// the poco_ios_init macro defined below.
-
-
-#if !defined(POCO_IOS_INIT_HACK)
- // Microsoft Visual Studio with Dinkumware STL (but not STLport)
-# if defined(_MSC_VER) && (!defined(_STLP_MSVC) || defined(_STLP_NO_OWN_IOSTREAMS))
-# define POCO_IOS_INIT_HACK 1
- // QNX with Dinkumware but not GNU C++ Library
-# elif defined(__QNX__) && !defined(__GLIBCPP__)
-# define POCO_IOS_INIT_HACK 1
-# endif
-#endif
-
-
-#if defined(POCO_IOS_INIT_HACK)
-# define poco_ios_init(buf)
-#else
-# define poco_ios_init(buf) init(buf)
-#endif
-
-
-#endif // Foundation_StreamUtil_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/String.h b/Utilities/Poco/Foundation/include/Poco/String.h
deleted file mode 100755
index c28bbf4dc8..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/String.h
+++ /dev/null
@@ -1,599 +0,0 @@
-//
-// String.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: String
-//
-// String utility functions.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_String_INCLUDED
-#define Foundation_String_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <cstring>
-#include <cctype>
-
-
-namespace Poco {
-
-
-template <class S>
-S trimLeft(const S& str)
- /// Returns a copy of str with all leading
- /// whitespace removed.
-{
- typename S::const_iterator it = str.begin();
- typename S::const_iterator end = str.end();
-
- while (it != end && std::isspace(*it)) ++it;
- return S(it, end);
-}
-
-
-template <class S>
-S& trimLeftInPlace(S& str)
- /// Removes all leading whitespace in str.
-{
- typename S::iterator it = str.begin();
- typename S::iterator end = str.end();
-
- while (it != end && std::isspace(*it)) ++it;
- str.erase(str.begin(), it);
- return str;
-}
-
-
-template <class S>
-S trimRight(const S& str)
- /// Returns a copy of str with all trailing
- /// whitespace removed.
-{
- int pos = int(str.size()) - 1;
-
- while (pos >= 0 && std::isspace(str[pos])) --pos;
- return S(str, 0, pos + 1);
-}
-
-
-template <class S>
-S& trimRightInPlace(S& str)
- /// Removes all trailing whitespace in str.
-{
- int pos = int(str.size()) - 1;
-
- while (pos >= 0 && std::isspace(str[pos])) --pos;
- str.resize(pos + 1);
-
- return str;
-}
-
-
-template <class S>
-S trim(const S& str)
- /// Returns a copy of str with all leading and
- /// trailing whitespace removed.
-{
- int first = 0;
- int last = int(str.size()) - 1;
-
- while (first <= last && std::isspace(str[first])) ++first;
- while (last >= first && std::isspace(str[last])) --last;
-
- return S(str, first, last - first + 1);
-}
-
-
-template <class S>
-S& trimInPlace(S& str)
- /// Removes all leading and trailing whitespace in str.
-{
- int first = 0;
- int last = int(str.size()) - 1;
-
- while (first <= last && std::isspace(str[first])) ++first;
- while (last >= first && std::isspace(str[last])) --last;
-
- str.resize(last + 1);
- str.erase(0, first);
-
- return str;
-}
-
-
-template <class S>
-S toUpper(const S& str)
- /// Returns a copy of str containing all upper-case characters.
-{
- typename S::const_iterator it = str.begin();
- typename S::const_iterator end = str.end();
-
- S result;
- result.reserve(str.size());
- while (it != end) result += std::toupper(*it++);
- return result;
-}
-
-
-template <class S>
-S& toUpperInPlace(S& str)
- /// Replaces all characters in str with their upper-case counterparts.
-{
- typename S::iterator it = str.begin();
- typename S::iterator end = str.end();
-
- while (it != end) { *it = std::toupper(*it); ++it; }
- return str;
-}
-
-
-template <class S>
-S toLower(const S& str)
- /// Returns a copy of str containing all lower-case characters.
-{
- typename S::const_iterator it = str.begin();
- typename S::const_iterator end = str.end();
-
- S result;
- result.reserve(str.size());
- while (it != end) result += std::tolower(*it++);
- return result;
-}
-
-
-template <class S>
-S& toLowerInPlace(S& str)
- /// Replaces all characters in str with their lower-case counterparts.
-{
- typename S::iterator it = str.begin();
- typename S::iterator end = str.end();
-
- while (it != end) { *it = std::tolower(*it); ++it; }
- return str;
-}
-
-
-#if !defined(POCO_NO_TEMPLATE_ICOMPARE)
-
-
-template <class S, class It>
-int icompare(
- const S& str,
- typename S::size_type pos,
- typename S::size_type n,
- It it2,
- It end2)
- /// Case-insensitive string comparison
-{
- typename S::size_type sz = str.size();
- if (pos > sz) pos = sz;
- if (pos + n > sz) n = sz - pos;
- It it1 = str.begin() + pos;
- It end1 = str.begin() + pos + n;
- while (it1 != end1 && it2 != end2)
- {
- typename S::value_type c1(std::tolower(*it1));
- typename S::value_type c2(std::tolower(*it2));
- if (c1 < c2)
- return -1;
- else if (c1 > c2)
- return 1;
- ++it1; ++it2;
- }
-
- if (it1 == end1)
- return it2 == end2 ? 0 : -1;
- else
- return 1;
-}
-
-
-template <class S>
-int icompare(const S& str1, const S& str2)
- // A special optimization for an often used case.
-{
- typename S::const_iterator it1(str1.begin());
- typename S::const_iterator end1(str1.end());
- typename S::const_iterator it2(str2.begin());
- typename S::const_iterator end2(str2.end());
- while (it1 != end1 && it2 != end2)
- {
- typename S::value_type c1(std::tolower(*it1));
- typename S::value_type c2(std::tolower(*it2));
- if (c1 < c2)
- return -1;
- else if (c1 > c2)
- return 1;
- ++it1; ++it2;
- }
-
- if (it1 == end1)
- return it2 == end2 ? 0 : -1;
- else
- return 1;
-}
-
-
-template <class S>
-int icompare(const S& str1, typename S::size_type n1, const S& str2, typename S::size_type n2)
-{
- if (n2 > str2.size()) n2 = str2.size();
- return icompare(str1, 0, n1, str2.begin(), str2.begin() + n2);
-}
-
-
-template <class S>
-int icompare(const S& str1, typename S::size_type n, const S& str2)
-{
- if (n > str2.size()) n = str2.size();
- return icompare(str1, 0, n, str2.begin(), str2.begin() + n);
-}
-
-
-template <class S>
-int icompare(const S& str1, typename S::size_type pos, typename S::size_type n, const S& str2)
-{
- return icompare(str1, pos, n, str2.begin(), str2.end());
-}
-
-
-template <class S>
-int icompare(
- const S& str1,
- typename S::size_type pos1,
- typename S::size_type n1,
- const S& str2,
- typename S::size_type pos2,
- typename S::size_type n2)
-{
- typename S::size_type sz2 = str2.size();
- if (pos2 > sz2) pos2 = sz2;
- if (pos2 + n2 > sz2) n2 = sz2 - pos2;
- return icompare(str1, pos1, n1, str2.begin() + pos2, str2.begin() + pos2 + n2);
-}
-
-
-template <class S>
-int icompare(
- const S& str1,
- typename S::size_type pos1,
- typename S::size_type n,
- const S& str2,
- typename S::size_type pos2)
-{
- typename S::size_type sz2 = str2.size();
- if (pos2 > sz2) pos2 = sz2;
- if (pos2 + n > sz2) n = sz2 - pos2;
- return icompare(str1, pos1, n, str2.begin() + pos2, str2.begin() + pos2 + n);
-}
-
-
-template <class S>
-int icompare(
- const S& str,
- typename S::size_type pos,
- typename S::size_type n,
- const typename S::value_type* ptr)
-{
- poco_check_ptr (ptr);
- typename S::size_type sz = str.size();
- if (pos > sz) pos = sz;
- if (pos + n > sz) n = sz - pos;
- typename S::const_iterator it = str.begin() + pos;
- typename S::const_iterator end = str.begin() + pos + n;
- while (it != end && *ptr)
- {
- typename S::value_type c1(std::tolower(*it));
- typename S::value_type c2(std::tolower(*ptr));
- if (c1 < c2)
- return -1;
- else if (c1 > c2)
- return 1;
- ++it; ++ptr;
- }
-
- if (it == end)
- return *ptr == 0 ? 0 : -1;
- else
- return 1;
-}
-
-
-template <class S>
-int icompare(
- const S& str,
- typename S::size_type pos,
- const typename S::value_type* ptr)
-{
- return icompare(str, pos, str.size() - pos, ptr);
-}
-
-
-template <class S>
-int icompare(
- const S& str,
- const typename S::value_type* ptr)
-{
- return icompare(str, 0, str.size(), ptr);
-}
-
-
-#else
-
-
-int Foundation_API icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, std::string::const_iterator it2, std::string::const_iterator end2);
-int Foundation_API icompare(const std::string& str1, const std::string& str2);
-int Foundation_API icompare(const std::string& str1, std::string::size_type n1, const std::string& str2, std::string::size_type n2);
-int Foundation_API icompare(const std::string& str1, std::string::size_type n, const std::string& str2);
-int Foundation_API icompare(const std::string& str1, std::string::size_type pos, std::string::size_type n, const std::string& str2);
-int Foundation_API icompare(const std::string& str1, std::string::size_type pos1, std::string::size_type n1, const std::string& str2, std::string::size_type pos2, std::string::size_type n2);
-int Foundation_API icompare(const std::string& str1, std::string::size_type pos1, std::string::size_type n, const std::string& str2, std::string::size_type pos2);
-int Foundation_API icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, const std::string::value_type* ptr);
-int Foundation_API icompare(const std::string& str, std::string::size_type pos, const std::string::value_type* ptr);
-int Foundation_API icompare(const std::string& str, const std::string::value_type* ptr);
-
-
-#endif
-
-
-template <class S>
-S translate(const S& str, const S& from, const S& to)
- /// Returns a copy of str with all characters in
- /// from replaced by the corresponding (by position)
- /// characters in to. If there is no corresponding
- /// character in to, the character is removed from
- /// the copy.
-{
- S result;
- result.reserve(str.size());
- typename S::const_iterator it = str.begin();
- typename S::const_iterator end = str.end();
- typename S::size_type toSize = to.size();
- while (it != end)
- {
- typename S::size_type pos = from.find(*it);
- if (pos == S::npos)
- {
- result += *it;
- }
- else
- {
- if (pos < toSize) result += to[pos];
- }
- ++it;
- }
- return result;
-}
-
-
-template <class S>
-S translate(const S& str, const typename S::value_type* from, const typename S::value_type* to)
-{
- poco_check_ptr (from);
- poco_check_ptr (to);
- return translate(str, S(from), S(to));
-}
-
-
-template <class S>
-S& translateInPlace(S& str, const S& from, const S& to)
- /// Replaces in str all occurences of characters in from
- /// with the corresponding (by position) characters in to.
- /// If there is no corresponding character, the character
- /// is removed.
-{
- str = translate(str, from, to);
- return str;
-}
-
-
-template <class S>
-S translateInPlace(S& str, const typename S::value_type* from, const typename S::value_type* to)
-{
- poco_check_ptr (from);
- poco_check_ptr (to);
- str = translate(str, S(from), S(to));
- return str;
-}
-
-
-#if !defined(POCO_NO_TEMPLATE_ICOMPARE)
-
-
-template <class S>
-S replace(const S& str, const S& from, const S& to, typename S::size_type start = 0)
- /// Replace all occurences of from (which must not be the empty string)
- /// in str with to, starting at position start.
-{
- S result(str);
- replaceInPlace(result, from, to, start);
- return result;
-}
-
-
-template <class S>
-S replace(const S& str, const typename S::value_type* from, const typename S::value_type* to, typename S::size_type start = 0)
-{
- S result(str);
- replaceInPlace(result, from, to, start);
- return result;
-}
-
-
-template <class S>
-S& replaceInPlace(S& str, const S& from, const S& to, typename S::size_type start = 0)
-{
- poco_assert (from.size() > 0);
-
- S result;
- typename S::size_type pos = 0;
- result.append(str, 0, start);
- do
- {
- pos = str.find(from, start);
- if (pos != S::npos)
- {
- result.append(str, start, pos - start);
- result.append(to);
- start = pos + from.length();
- }
- else result.append(str, start, str.size() - start);
- }
- while (pos != S::npos);
- str.swap(result);
- return str;
-}
-
-
-template <class S>
-S& replaceInPlace(S& str, const typename S::value_type* from, const typename S::value_type* to, typename S::size_type start = 0)
-{
- poco_assert (*from);
-
- S result;
- typename S::size_type pos = 0;
- typename S::size_type fromLen = std::strlen(from);
- result.append(str, 0, start);
- do
- {
- pos = str.find(from, start);
- if (pos != S::npos)
- {
- result.append(str, start, pos - start);
- result.append(to);
- start = pos + fromLen;
- }
- else result.append(str, start, str.size() - start);
- }
- while (pos != S::npos);
- str.swap(result);
- return str;
-}
-
-
-#else
-
-
-std::string Foundation_API replace(const std::string& str, const std::string& from, const std::string& to, std::string::size_type start = 0);
-std::string Foundation_API replace(const std::string& str, const std::string::value_type* from, const std::string::value_type* to, std::string::size_type start = 0);
-std::string& Foundation_API replaceInPlace(std::string& str, const std::string& from, const std::string& to, std::string::size_type start = 0);
-std::string& Foundation_API replaceInPlace(std::string& str, const std::string::value_type* from, const std::string::value_type* to, std::string::size_type start = 0);
-
-
-#endif
-
-
-template <class S>
-S cat(const S& s1, const S& s2)
- /// Concatenates two strings.
-{
- S result = s1;
- result.reserve(s1.size() + s2.size());
- result.append(s2);
- return result;
-}
-
-
-template <class S>
-S cat(const S& s1, const S& s2, const S& s3)
- /// Concatenates three strings.
-{
- S result = s1;
- result.reserve(s1.size() + s2.size() + s3.size());
- result.append(s2);
- result.append(s3);
- return result;
-}
-
-
-template <class S>
-S cat(const S& s1, const S& s2, const S& s3, const S& s4)
- /// Concatenates four strings.
-{
- S result = s1;
- result.reserve(s1.size() + s2.size() + s3.size() + s4.size());
- result.append(s2);
- result.append(s3);
- result.append(s4);
- return result;
-}
-
-
-template <class S>
-S cat(const S& s1, const S& s2, const S& s3, const S& s4, const S& s5)
- /// Concatenates five strings.
-{
- S result = s1;
- result.reserve(s1.size() + s2.size() + s3.size() + s4.size() + s5.size());
- result.append(s2);
- result.append(s3);
- result.append(s4);
- result.append(s5);
- return result;
-}
-
-
-template <class S>
-S cat(const S& s1, const S& s2, const S& s3, const S& s4, const S& s5, const S& s6)
- /// Concatenates six strings.
-{
- S result = s1;
- result.reserve(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size());
- result.append(s2);
- result.append(s3);
- result.append(s4);
- result.append(s5);
- result.append(s6);
- return result;
-}
-
-
-template <class S, class It>
-S cat(const S& delim, const It& begin, const It& end)
- /// Concatenates a sequence of strings, delimited
- /// by the string given in delim.
-{
- S result;
- for (It it = begin; it != end; ++it)
- {
- if (!result.empty()) result.append(delim);
- result += *it;
- }
- return result;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_String_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/StringTokenizer.h b/Utilities/Poco/Foundation/include/Poco/StringTokenizer.h
deleted file mode 100755
index 70c6c63eee..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/StringTokenizer.h
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// StringTokenizer.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: StringTokenizer
-//
-// Definition of the StringTokenizer class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_StringTokenizer_INCLUDED
-#define Foundation_StringTokenizer_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Exception.h"
-#include <vector>
-#include <cstddef>
-
-
-namespace Poco {
-
-
-class Foundation_API StringTokenizer
- /// A simple tokenizer that splits a string into
- /// tokens, which are separated by separator characters.
- /// An iterator is used to iterate over all tokens.
-{
-public:
- enum Options
- {
- TOK_IGNORE_EMPTY = 1, /// ignore empty tokens
- TOK_TRIM = 2 /// remove leading and trailing whitespace from tokens
- };
-
- typedef std::vector<std::string>::const_iterator Iterator;
-
- StringTokenizer(const std::string& str, const std::string& separators, int options = 0);
- /// Splits the given string into tokens. The tokens are expected to be
- /// separated by one of the separator characters given in separators.
- /// Additionally, options can be specified:
- /// * TOK_IGNORE_EMPTY: empty tokens are ignored
- /// * TOK_TRIM: trailing and leading whitespace is removed from tokens.
- /// An empty token at the end of str is always ignored. For example,
- /// a StringTokenizer with the following arguments:
- /// StringTokenizer(",ab,cd,", ",");
- /// will produce three tokens, "", "ab" and "cd".
-
- ~StringTokenizer();
- /// Destroys the tokenizer.
-
- Iterator begin() const;
- Iterator end() const;
-
- const std::string& operator [] (std::size_t index) const;
- /// Returns the index'th token.
- /// Throws a RangeException if the index is out of range.
-
- std::size_t count() const;
- /// Returns the number of tokens.
-
-private:
- StringTokenizer(const StringTokenizer&);
- StringTokenizer& operator = (const StringTokenizer&);
-
- std::vector<std::string> _tokens;
-};
-
-
-//
-// inlines
-//
-
-
-inline StringTokenizer::Iterator StringTokenizer::begin() const
-{
- return _tokens.begin();
-}
-
-
-inline StringTokenizer::Iterator StringTokenizer::end() const
-{
- return _tokens.end();
-}
-
-
-inline const std::string& StringTokenizer::operator [] (std::size_t index) const
-{
- if (index >= _tokens.size()) throw RangeException();
- return _tokens[index];
-}
-
-
-inline std::size_t StringTokenizer::count() const
-{
- return _tokens.size();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_StringTokenizer_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SynchronizedObject.h b/Utilities/Poco/Foundation/include/Poco/SynchronizedObject.h
deleted file mode 100755
index 4708f32620..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SynchronizedObject.h
+++ /dev/null
@@ -1,153 +0,0 @@
-//
-// SynchronizedObject.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: SynchronizedObject
-//
-// Definition of the SynchronizedObject class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SynchronizedObject_INCLUDED
-#define Foundation_SynchronizedObject_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-#include "Poco/Event.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SynchronizedObject
- /// This class aggregates a Mutex and an Event
- /// and can act as a base class for all objects
- /// requiring synchronization in a multithreaded
- /// scenario.
-{
-public:
- typedef Poco::ScopedLock<SynchronizedObject> ScopedLock;
-
- SynchronizedObject();
- /// Creates the object.
-
- virtual ~SynchronizedObject();
- /// Destroys the object.
-
- void lock() const;
- /// Locks the object. Blocks if the object
- /// is locked by another thread.
-
- bool tryLock() const;
- /// Tries to lock the object. Returns false immediately
- /// if the object is already locked by another thread
- /// Returns true if the object was successfully locked.
-
- void unlock() const;
- /// Unlocks the object so that it can be locked by
- /// other threads.
-
- void notify() const;
- /// Signals the object.
- /// Exactly only one thread waiting for the object
- /// can resume execution.
-
- void wait() const;
- /// Waits for the object to become signalled.
-
- void wait(long milliseconds) const;
- /// Waits for the object to become signalled.
- /// Throws a TimeoutException if the object
- /// does not become signalled within the specified
- /// time interval.
-
- bool tryWait(long milliseconds) const;
- /// Waits for the object to become signalled.
- /// Returns true if the object
- /// became signalled within the specified
- /// time interval, false otherwise.
-
-private:
- mutable Mutex _mutex;
- mutable Event _event;
-};
-
-
-//
-// inlines
-//
-inline void SynchronizedObject::lock() const
-{
- _mutex.lock();
-}
-
-
-inline bool SynchronizedObject::tryLock() const
-{
- return _mutex.tryLock();
-}
-
-
-inline void SynchronizedObject::unlock() const
-{
- _mutex.unlock();
-}
-
-
-inline void SynchronizedObject::notify() const
-{
- _event.set();
-}
-
-
-inline void SynchronizedObject::wait() const
-{
- _event.wait();
-}
-
-
-inline void SynchronizedObject::wait(long milliseconds) const
-{
- _event.wait(milliseconds);
-}
-
-
-inline bool SynchronizedObject::tryWait(long milliseconds) const
-{
- return _event.tryWait(milliseconds);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SynchronizedObject_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/SyslogChannel.h b/Utilities/Poco/Foundation/include/Poco/SyslogChannel.h
deleted file mode 100755
index ba19f28299..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/SyslogChannel.h
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// SyslogChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: SyslogChannel
-//
-// Definition of the SyslogChannel class specific to UNIX.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_SyslogChannel_INCLUDED
-#define Foundation_SyslogChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-
-
-namespace Poco {
-
-
-class Foundation_API SyslogChannel: public Channel
- /// This Unix-only channel works with the Unix syslog service.
-{
-public:
- enum Option
- {
- SYSLOG_PID = 0x01, /// log the pid with each message
- SYSLOG_CONS = 0x02, /// log on the console if errors in sending
- SYSLOG_NDELAY = 0x08, /// don't delay open
- SYSLOG_PERROR = 0x20 /// log to stderr as well (not supported on all platforms)
- };
-
- enum Facility
- {
- SYSLOG_KERN = ( 0<<3), /// kernel messages
- SYSLOG_USER = ( 1<<3), /// random user-level messages
- SYSLOG_MAIL = ( 2<<3), /// mail system
- SYSLOG_DAEMON = ( 3<<3), /// system daemons
- SYSLOG_AUTH = ( 4<<3), /// security/authorization messages
- SYSLOG_SYSLOG = ( 5<<3), /// messages generated internally by syslogd
- SYSLOG_LPR = ( 6<<3), /// line printer subsystem
- SYSLOG_NEWS = ( 7<<3), /// network news subsystem
- SYSLOG_UUCP = ( 8<<3), /// UUCP subsystem
- SYSLOG_CRON = ( 9<<3), /// clock daemon
- SYSLOG_AUTHPRIV = (10<<3), /// security/authorization messages (private)
- SYSLOG_FTP = (11<<3), /// ftp daemon
- SYSLOG_LOCAL0 = (16<<3), /// reserved for local use
- SYSLOG_LOCAL1 = (17<<3), /// reserved for local use
- SYSLOG_LOCAL2 = (18<<3), /// reserved for local use
- SYSLOG_LOCAL3 = (19<<3), /// reserved for local use
- SYSLOG_LOCAL4 = (20<<3), /// reserved for local use
- SYSLOG_LOCAL5 = (21<<3), /// reserved for local use
- SYSLOG_LOCAL6 = (22<<3), /// reserved for local use
- SYSLOG_LOCAL7 = (23<<3) /// reserved for local use
- };
-
- SyslogChannel();
- /// Creates a SyslogChannel.
-
- SyslogChannel(const std::string& name, int options = SYSLOG_CONS, int facility = SYSLOG_USER);
- /// Creates a SyslogChannel with the given name, options and facility.
-
- void open();
- /// Opens the SyslogChannel.
-
- void close();
- /// Closes the SyslogChannel.
-
- void log(const Message& msg);
- /// Sens the message's text to the syslog service.
-
- void setProperty(const std::string& name, const std::string& value);
- /// Sets the property with the given value.
- ///
- /// The following properties are supported:
- /// * name: The name used to identify the source of log messages.
- /// * facility: The facility added to each log message. See the Facility enumeration for a list of supported values.
- /// * options: The logging options. See the Option enumeration for a list of supported values.
-
- std::string getProperty(const std::string& name) const;
- /// Returns the value of the property with the given name.
-
- static const std::string PROP_NAME;
- static const std::string PROP_FACILITY;
- static const std::string PROP_OPTIONS;
-
-protected:
- ~SyslogChannel();
- static int getPrio(const Message& msg);
-
-private:
- std::string _name;
- int _options;
- int _facility;
- bool _open;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_SyslogChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Task.h b/Utilities/Poco/Foundation/include/Poco/Task.h
deleted file mode 100755
index 910e67a104..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Task.h
+++ /dev/null
@@ -1,207 +0,0 @@
-//
-// Task.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Tasks
-// Module: Tasks
-//
-// Definition of the Task class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Task_INCLUDED
-#define Foundation_Task_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Runnable.h"
-#include "Poco/RefCountedObject.h"
-#include "Poco/Mutex.h"
-#include "Poco/Event.h"
-
-
-namespace Poco {
-
-
-class TaskManager;
-class Notification;
-class NotificationCenter;
-
-
-class Foundation_API Task: public Runnable, public RefCountedObject
- /// A Task is a subclass of Runnable that has a name
- /// and supports progress reporting and cancellation.
- ///
- /// A TaskManager object can be used to take care of the
- /// lifecycle of a Task.
-{
-public:
- enum TaskState
- {
- TASK_IDLE,
- TASK_STARTING,
- TASK_RUNNING,
- TASK_CANCELLING,
- TASK_FINISHED
- };
-
- Task(const std::string& name);
- /// Creates the Task.
-
- const std::string& name() const;
- /// Returns the task's name.
-
- float progress() const;
- /// Returns the task's progress.
- /// The value will be between 0.0 (just started)
- /// and 1.0 (completed).
-
- void cancel();
- /// Requests the task to cancel itself. For cancellation
- /// to work, the task's runTask() method must periodically
- /// call isCancelled() and react accordingly.
-
- bool isCancelled() const;
- /// Returns true if cancellation of the task has been
- /// requested.
- ///
- /// A Task's runTask() method should periodically
- /// call this method and stop whatever it is doing in an
- /// orderly way when this method returns true.
-
- TaskState state() const;
- /// Returns the task's current state.
-
- void reset();
- /// Sets the task's progress to zero and clears the
- /// cancel flag.
-
- virtual void runTask() = 0;
- /// Do whatever the task needs to do. Must
- /// be overridden by subclasses.
-
- void run();
- /// Calls the task's runTask() method and notifies the owner
- /// of the task's start and completion.
-
-protected:
- bool sleep(long milliseconds);
- /// Suspends the current thread for the specified
- /// amount of time.
- ///
- /// If the task is cancelled while it is sleeping,
- /// sleep() will return immediately and the return
- /// value will be true. If the time interval
- /// passes without the task being cancelled, the
- /// return value is false.
- ///
- /// A Task should use this method in favor of Thread::sleep().
-
- void setProgress(float progress);
- /// Sets the task's progress.
- /// The value should be between 0.0 (just started)
- /// and 1.0 (completed).
-
- virtual void postNotification(Notification* pNf);
- /// Posts a notification to the task manager's
- /// notification center.
- ///
- /// A task can use this method to post custom
- /// notifications about its progress.
-
- void setOwner(TaskManager* pOwner);
- /// Sets the (optional) owner of the task.
-
- TaskManager* getOwner() const;
- /// Returns the owner of the task, which may be NULL.
-
- void setState(TaskState state);
- /// Sets the task's state.
-
- virtual ~Task();
- /// Destroys the Task.
-
-private:
- Task();
- Task(const Task&);
- Task& operator = (const Task&);
-
- std::string _name;
- TaskManager* _pOwner;
- float _progress;
- TaskState _state;
- Event _cancelEvent;
- mutable FastMutex _mutex;
-
- friend class TaskManager;
-};
-
-
-//
-// inlines
-//
-inline const std::string& Task::name() const
-{
- return _name;
-}
-
-
-inline float Task::progress() const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return _progress;
-}
-
-
-inline bool Task::isCancelled() const
-{
- return _state == TASK_CANCELLING;
-}
-
-
-inline Task::TaskState Task::state() const
-{
- return _state;
-}
-
-
-inline TaskManager* Task::getOwner() const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return _pOwner;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Task_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/TaskManager.h b/Utilities/Poco/Foundation/include/Poco/TaskManager.h
deleted file mode 100755
index 1cedcd109b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/TaskManager.h
+++ /dev/null
@@ -1,153 +0,0 @@
-//
-// TaskManager.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Tasks
-// Module: Tasks
-//
-// Definition of the TaskManager class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_TaskManager_INCLUDED
-#define Foundation_TaskManager_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-#include "Poco/Task.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/NotificationCenter.h"
-#include "Poco/Timestamp.h"
-#include <list>
-
-
-namespace Poco {
-
-
-class Notification;
-class ThreadPool;
-class Exception;
-
-
-class Foundation_API TaskManager
- /// The TaskManager manages a collection of tasks
- /// and monitors their lifetime.
- ///
- /// A TaskManager has a built-in NotificationCenter that
- /// is used to send out notifications on task progress
- /// and task states. See the TaskNotification class and its
- /// subclasses for the various events that result in a notification.
- /// To keep the number of notifications small, a TaskProgressNotification
- /// will only be sent out once in 100 milliseconds.
-{
-public:
- typedef AutoPtr<Task> TaskPtr;
- typedef std::list<TaskPtr> TaskList;
-
- TaskManager();
- /// Creates the TaskManager, using the
- /// default ThreadPool.
-
- TaskManager(ThreadPool& pool);
- /// Creates the TaskManager, using the
- /// given ThreadPool.
-
- ~TaskManager();
- /// Destroys the TaskManager.
-
- void start(Task* pTask);
- /// Starts the given task in a thread obtained
- /// from the thread pool.
- ///
- /// The TaskManager takes ownership of the Task object
- /// and deletes it when it it finished.
-
- void cancelAll();
- /// Requests cancellation of all tasks.
-
- void joinAll();
- /// Waits for the completion of all the threads
- /// in the TaskManager's thread pool.
-
- TaskList taskList() const;
- /// Returns a copy of the internal task list.
-
- int count() const;
- /// Returns the number of tasks in the internal task list.
-
- void addObserver(const AbstractObserver& observer);
- /// Registers an observer with the NotificationCenter.
- /// Usage:
- /// Observer<MyClass, MyNotification> obs(*this, &MyClass::handleNotification);
- /// notificationCenter.addObserver(obs);
-
- void removeObserver(const AbstractObserver& observer);
- /// Unregisters an observer with the NotificationCenter.
-
- static const int MIN_PROGRESS_NOTIFICATION_INTERVAL;
-
-protected:
- void postNotification(Notification* pNf);
- /// Posts a notification to the task manager's
- /// notification center.
-
- void taskStarted(Task* pTask);
- void taskProgress(Task* pTask, float progress);
- void taskCancelled(Task* pTask);
- void taskFinished(Task* pTask);
- void taskFailed(Task* pTask, const Exception& exc);
-
-private:
- ThreadPool& _threadPool;
- TaskList _taskList;
- Timestamp _lastProgressNotification;
- NotificationCenter _nc;
- mutable FastMutex _mutex;
-
- friend class Task;
-};
-
-
-//
-// inlines
-//
-inline int TaskManager::count() const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return (int) _taskList.size();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_TaskManager_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/TaskNotification.h b/Utilities/Poco/Foundation/include/Poco/TaskNotification.h
deleted file mode 100755
index 10c48516cc..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/TaskNotification.h
+++ /dev/null
@@ -1,192 +0,0 @@
-//
-// TaskNotification.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Tasks
-// Module: Tasks
-//
-// Definition of the TaskNotification class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_TaskNotification_INCLUDED
-#define Foundation_TaskNotification_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Notification.h"
-#include "Poco/Task.h"
-
-
-namespace Poco {
-
-
-class Foundation_API TaskNotification: public Notification
- /// Base class for TaskManager notifications.
-{
-public:
- TaskNotification(Task* pTask);
- /// Creates the TaskNotification.
-
- Task* task() const;
- /// Returns the subject of the notification.
-
-protected:
- virtual ~TaskNotification();
- /// Destroys the TaskNotification.
-
-private:
- Task* _pTask;
-};
-
-
-class Foundation_API TaskStartedNotification: public TaskNotification
- /// This notification is posted by the TaskManager for
- /// every task that has been started.
-{
-public:
- TaskStartedNotification(Task* pTask);
-
-protected:
- ~TaskStartedNotification();
-};
-
-
-class Foundation_API TaskCancelledNotification: public TaskNotification
- /// This notification is posted by the TaskManager for
- /// every task that has been cancelled.
-{
-public:
- TaskCancelledNotification(Task* pTask);
-
-protected:
- ~TaskCancelledNotification();
-};
-
-
-class Foundation_API TaskFinishedNotification: public TaskNotification
- /// This notification is posted by the TaskManager for
- /// every task that has finished.
-{
-public:
- TaskFinishedNotification(Task* pTask);
-
-protected:
- ~TaskFinishedNotification();
-};
-
-
-class Foundation_API TaskFailedNotification: public TaskNotification
- /// This notification is posted by the TaskManager for
- /// every task that has failed with an exception.
-{
-public:
- TaskFailedNotification(Task* pTask, const Exception& exc);
-
- const Exception& reason() const;
-
-protected:
- ~TaskFailedNotification();
-
-private:
- Exception* _pException;
-};
-
-
-class Foundation_API TaskProgressNotification: public TaskNotification
- /// This notification is posted by the TaskManager for
- /// every task that has failed with an exception.
-{
-public:
- TaskProgressNotification(Task* pTask, float progress);
-
- float progress() const;
-
-protected:
- ~TaskProgressNotification();
-
-private:
- float _progress;
-};
-
-
-template <class C>
-class TaskCustomNotification: public TaskNotification
- /// This is a template for "custom" notification.
- /// Unlike other notifications, this notification
- /// is instantiated and posted by the task itself.
- /// The purpose is to provide generic notifiation
- /// mechanism between the task and its observer(s).
-{
-public:
- TaskCustomNotification(Task* pTask, const C& custom):
- TaskNotification(pTask),
- _custom(custom)
- {
- }
-
- const C& custom() const
- {
- return _custom;
- }
-
-protected:
- ~TaskCustomNotification(){};
-
-private:
- C _custom;
-};
-
-
-//
-// inlines
-//
-inline Task* TaskNotification::task() const
-{
- return _pTask;
-}
-
-
-inline const Exception& TaskFailedNotification::reason() const
-{
- return *_pException;
-}
-
-
-inline float TaskProgressNotification::progress() const
-{
- return _progress;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_TaskNotification_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/TeeStream.h b/Utilities/Poco/Foundation/include/Poco/TeeStream.h
deleted file mode 100755
index ab94a255c6..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/TeeStream.h
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// TeeStream.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: TeeStream
-//
-// Definition of the TeeStream class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef Foundation_TeeStream_INCLUDED
-#define Foundation_TeeStream_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UnbufferedStreamBuf.h"
-#include <vector>
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-
-
-class Foundation_API TeeStreamBuf: public UnbufferedStreamBuf
- /// This stream buffer copies all data written to or
- /// read from it to one or multiple output streams.
-{
-public:
- TeeStreamBuf();
- /// Creates an unconnected CountingStreamBuf.
- /// Use addStream() to attach output streams.
-
- TeeStreamBuf(std::istream& istr);
- /// Creates the CountingStreamBuf and connects it
- /// to the given input stream.
-
- TeeStreamBuf(std::ostream& ostr);
- /// Creates the CountingStreamBuf and connects it
- /// to the given output stream.
-
- ~TeeStreamBuf();
- /// Destroys the CountingStream.
-
- void addStream(std::ostream& ostr);
- /// Adds the given output stream.
-
-protected:
- int readFromDevice();
- int writeToDevice(char c);
-
-private:
- typedef std::vector<std::ostream*> StreamVec;
-
- std::istream* _pIstr;
- StreamVec _streams;
-};
-
-
-class Foundation_API TeeIOS: public virtual std::ios
- /// The base class for TeeInputStream and TeeOutputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- TeeIOS();
- /// Creates the basic stream and leaves it unconnected.
-
- TeeIOS(std::istream& istr);
- /// Creates the basic stream and connects it
- /// to the given input stream.
-
- TeeIOS(std::ostream& ostr);
- /// Creates the basic stream and connects it
- /// to the given output stream.
-
- ~TeeIOS();
- /// Destroys the stream.
-
- void addStream(std::ostream& ostr);
- /// Adds the given output stream.
-
- TeeStreamBuf* rdbuf();
- /// Returns a pointer to the underlying streambuf.
-
-protected:
- TeeStreamBuf _buf;
-};
-
-
-class Foundation_API TeeInputStream: public TeeIOS, public std::istream
- /// This stream copies all characters read through it
- /// to one or multiple output streams.
-{
-public:
- TeeInputStream(std::istream& istr);
- /// Creates the TeeInputStream and connects it
- /// to the given input stream.
-
- ~TeeInputStream();
- /// Destroys the TeeInputStream.
-};
-
-
-class Foundation_API TeeOutputStream: public TeeIOS, public std::ostream
- /// This stream copies all characters written to it
- /// to one or multiple output streams.
-{
-public:
- TeeOutputStream();
- /// Creates an unconnected TeeOutputStream.
-
- TeeOutputStream(std::ostream& ostr);
- /// Creates the TeeOutputStream and connects it
- /// to the given input stream.
-
- ~TeeOutputStream();
- /// Destroys the TeeOutputStream.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_TeeStream_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/TemporaryFile.h b/Utilities/Poco/Foundation/include/Poco/TemporaryFile.h
deleted file mode 100755
index 9b505652bf..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/TemporaryFile.h
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// TemporaryFile.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: TemporaryFile
-//
-// Definition of the TemporaryFile class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_TemporaryFile_INCLUDED
-#define Foundation_TemporaryFile_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/File.h"
-
-
-namespace Poco {
-
-
-class Foundation_API TemporaryFile: public File
- /// The TemporaryFile class helps with the handling
- /// of temporary files.
- /// A unique name for the temporary file is
- /// automatically chosen and the file is placed
- /// in the directory reserved for temporary
- /// files (see Path::temp()).
- /// Obtain the path by calling the path() method
- /// (inherited from File).
- ///
- /// The TemporaryFile class does not actually
- /// create the file - this is up to the application.
- /// The class does, however, delete the temporary
- /// file - either in the destructor, or immediately
- /// before the application terminates.
-{
-public:
- TemporaryFile();
- /// Creates the TemporaryFile.
-
- ~TemporaryFile();
- /// Destroys the TemporaryFile and
- /// deletes the corresponding file on
- /// disk unless keep() or keepUntilExit()
- /// has been called.
-
- void keep();
- /// Disables automatic deletion of the file in
- /// the destructor.
-
- void keepUntilExit();
- /// Disables automatic deletion of the file in
- /// the destructor, but registers the file
- /// for deletion at process termination.
-
- static void registerForDeletion(const std::string& path);
- /// Registers the given file for deletion
- /// at process termination.
-
- static std::string tempName();
- /// Returns a unique path name for a temporary
- /// file in the system's scratch directory
- /// (see Path::temp()).
-
-private:
- bool _keep;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_TemporaryFile_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/TextConverter.h b/Utilities/Poco/Foundation/include/Poco/TextConverter.h
deleted file mode 100755
index 6d7bdc939d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/TextConverter.h
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// TextConverter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: TextConverter
-//
-// Definition of the TextConverter class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_TextConverter_INCLUDED
-#define Foundation_TextConverter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class TextEncoding;
-
-
-class Foundation_API TextConverter
- /// A TextConverter converts strings from one encoding
- /// into another.
-{
-public:
- typedef int (*Transform)(int);
- /// Transform function for convert.
-
- TextConverter(const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar = '?');
- /// Creates the TextConverter. The encoding objects must not be deleted while the
- /// TextConverter is in use.
-
- ~TextConverter();
- /// Destroys the TextConverter.
-
- int convert(const std::string& source, std::string& destination, Transform trans);
- /// Converts the source string from inEncoding to outEncoding
- /// and appends the result to destination. Every character is
- /// passed to the transform function.
- /// If a character cannot be represented in outEncoding, defaultChar
- /// is used instead.
- /// Returns the number of encoding errors (invalid byte sequences
- /// in source).
-
- int convert(const void* source, int length, std::string& destination, Transform trans);
- /// Converts the source buffer from inEncoding to outEncoding
- /// and appends the result to destination. Every character is
- /// passed to the transform function.
- /// If a character cannot be represented in outEncoding, defaultChar
- /// is used instead.
- /// Returns the number of encoding errors (invalid byte sequences
- /// in source).
-
- int convert(const std::string& source, std::string& destination);
- /// Converts the source string from inEncoding to outEncoding
- /// and appends the result to destination.
- /// If a character cannot be represented in outEncoding, defaultChar
- /// is used instead.
- /// Returns the number of encoding errors (invalid byte sequences
- /// in source).
-
- int convert(const void* source, int length, std::string& destination);
- /// Converts the source buffer from inEncoding to outEncoding
- /// and appends the result to destination.
- /// If a character cannot be represented in outEncoding, defaultChar
- /// is used instead.
- /// Returns the number of encoding errors (invalid byte sequences
- /// in source).
-
-private:
- TextConverter();
- TextConverter(const TextConverter&);
- TextConverter& operator = (const TextConverter&);
-
- const TextEncoding& _inEncoding;
- const TextEncoding& _outEncoding;
- int _defaultChar;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_TextConverter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/TextEncoding.h b/Utilities/Poco/Foundation/include/Poco/TextEncoding.h
deleted file mode 100755
index 5fa05b5057..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/TextEncoding.h
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// TextEncoding.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: TextEncoding
-//
-// Definition of the abstract TextEncoding class.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_TextEncoding_INCLUDED
-#define Foundation_TextEncoding_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/SharedPtr.h"
-
-
-namespace Poco {
-
-
-class TextEncodingManager;
-
-
-class Foundation_API TextEncoding
- /// An abstract base class for implementing text encodings
- /// like UTF-8 or ISO 8859-1.
- ///
- /// Subclasses must override the canonicalName(), isA(),
- /// characterMap() and convert() methods and need to be
- /// thread safe and stateless.
- ///
- /// TextEncoding also provides static member functions
- /// for managing mappings from encoding names to
- /// TextEncoding objects.
-{
-public:
- typedef SharedPtr<TextEncoding> Ptr;
-
- enum
- {
- MAX_SEQUENCE_LENGTH = 6 /// The maximum character byte sequence length supported.
- };
-
- typedef int CharacterMap[256];
- /// The map[b] member gives information about byte sequences
- /// whose first byte is b.
- /// If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c.
- /// If map[b] is -1, then the byte sequence is malformed.
- /// If map[b] is -n, where n >= 2, then b is the first byte of an n-byte
- /// sequence that encodes a single Unicode scalar value. Byte sequences up
- /// to 6 bytes in length are supported.
-
- virtual ~TextEncoding();
- /// Destroys the encoding.
-
- virtual const char* canonicalName() const = 0;
- /// Returns the canonical name of this encoding,
- /// e.g. "ISO-8859-1". Encoding name comparisons are case
- /// insensitive.
-
- virtual bool isA(const std::string& encodingName) const = 0;
- /// Returns true if the given name is one of the names of this encoding.
- /// For example, the "ISO-8859-1" encoding is also known as "Latin-1".
- ///
- /// Encoding name comparision are be case insensitive.
-
- virtual const CharacterMap& characterMap() const = 0;
- /// Returns the CharacterMap for the encoding.
- /// The CharacterMap should be kept in a static member. As
- /// characterMap() can be called frequently, it should be
- /// implemented in such a way that it just returns a static
- /// map. If the map is built at runtime, this should be
- /// done in the constructor.
-
- virtual int convert(const unsigned char* bytes) const;
- /// The convert function is used to convert multibyte sequences;
- /// bytes will point to a byte sequence of n bytes where
- /// getCharacterMap()[*bytes] == -n.
- ///
- /// The convert function must return the Unicode scalar value
- /// represented by this byte sequence or -1 if the byte sequence is malformed.
- /// The default implementation returns (int) bytes[0].
-
- virtual int convert(int ch, unsigned char* bytes, int length) const;
- /// Transform the Unicode character ch into the encoding's
- /// byte sequence. The method returns the number of bytes
- /// used. The method must not use more than length characters.
- /// Bytes and length can also be null - in this case only the number
- /// of bytes required to represent ch is returned.
- /// If the character cannot be converted, 0 is returned and
- /// the byte sequence remains unchanged.
- /// The default implementation simply returns 0.
-
- static TextEncoding& byName(const std::string& encodingName);
- /// Returns the TextEncoding object for the given encoding name.
- ///
- /// Throws a NotFoundException if the encoding with given name is not available.
-
- static TextEncoding::Ptr find(const std::string& encodingName);
- /// Returns a pointer to the TextEncoding object for the given encodingName,
- /// or NULL if no such TextEncoding object exists.
-
- static void add(TextEncoding::Ptr encoding);
- /// Adds the given TextEncoding to the table of text encodings,
- /// under the encoding's canonical name.
- ///
- /// If an encoding with the given name is already registered,
- /// it is replaced.
-
- static void add(TextEncoding::Ptr encoding, const std::string& name);
- /// Adds the given TextEncoding to the table of text encodings,
- /// under the given name.
- ///
- /// If an encoding with the given name is already registered,
- /// it is replaced.
-
- static void remove(const std::string& encodingName);
- /// Removes the encoding with the given name from the table
- /// of text encodings.
-
- static TextEncoding::Ptr global(TextEncoding::Ptr encoding);
- /// Sets global TextEncoding object.
- ///
- /// This function sets the global encoding to the argument and returns a
- /// reference of the previous global encoding.
-
- static TextEncoding& global();
- /// Return the current global TextEncoding object
-
- static const std::string GLOBAL;
- /// Name of the global TextEncoding, which is the empty string.
-
-protected:
- static TextEncodingManager& manager();
- /// Returns the TextEncodingManager.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_TextEncoding_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/TextIterator.h b/Utilities/Poco/Foundation/include/Poco/TextIterator.h
deleted file mode 100755
index f15bd737b9..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/TextIterator.h
+++ /dev/null
@@ -1,151 +0,0 @@
-//
-// TextIterator.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: TextIterator
-//
-// Definition of the TextIterator class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_TextIterator_INCLUDED
-#define Foundation_TextIterator_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class TextEncoding;
-
-
-class Foundation_API TextIterator
- /// An unidirectional iterator for iterating over characters in a string.
- /// The TextIterator uses a TextEncoding object to
- /// work with multi-byte character encodings like UTF-8.
- /// Characters are reported in Unicode.
- ///
- /// Example: Count the number of UTF-8 characters in a string.
- ///
- /// UTF8Encoding utf8Encoding;
- /// std::string utf8String("....");
- /// TextIterator it(utf8String, utf8Encoding);
- /// TextIterator end(utf8String);
- /// int n = 0;
- /// while (it != end) { ++n; ++it; }
- ///
- /// NOTE: When an UTF-16 encoding is used, surrogate pairs will be
- /// reported as two separate characters, due to restrictions of
- /// the TextEncoding class.
-{
-public:
- TextIterator();
- /// Creates an uninitialized TextIterator.
-
- TextIterator(const std::string& str, const TextEncoding& encoding);
- /// Creates a TextIterator for the given string.
- /// The encoding object must not be deleted as long as the iterator
- /// is in use.
-
- TextIterator(const std::string::const_iterator& begin, const std::string::const_iterator& end, const TextEncoding& encoding);
- /// Creates a TextIterator for the given range.
- /// The encoding object must not be deleted as long as the iterator
- /// is in use.
-
- TextIterator(const std::string& str);
- /// Creates an end TextIterator for the given string.
-
- TextIterator(const std::string::const_iterator& end);
- /// Creates an end TextIterator.
-
- ~TextIterator();
- /// Destroys the TextIterator.
-
- TextIterator(const TextIterator& it);
- /// Copy constructor.
-
- TextIterator& operator = (const TextIterator& it);
- /// Assignment operator.
-
- void swap(TextIterator& it);
- /// Swaps the iterator with another one.
-
- int operator * () const;
- /// Returns the Unicode value of the current character.
- /// If there is no valid character at the current position,
- /// -1 is returned.
-
- TextIterator& operator ++ ();
- /// Prefix increment operator.
-
- TextIterator operator ++ (int);
- /// Postfix increment operator.
-
- bool operator == (const TextIterator& it) const;
- /// Compares two iterators for equality.
-
- bool operator != (const TextIterator& it) const;
- /// Compares two iterators for inequality.
-
-private:
- const TextEncoding* _pEncoding;
- std::string::const_iterator _it;
- std::string::const_iterator _end;
-};
-
-
-//
-// inlines
-//
-inline bool TextIterator::operator == (const TextIterator& it) const
-{
- return _it == it._it;
-}
-
-
-inline bool TextIterator::operator != (const TextIterator& it) const
-{
- return _it != it._it;
-}
-
-
-inline void swap(TextIterator& it1, TextIterator& it2)
-{
- it1.swap(it2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_TextIterator_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Thread.h b/Utilities/Poco/Foundation/include/Poco/Thread.h
deleted file mode 100755
index aaaf92598d..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Thread.h
+++ /dev/null
@@ -1,290 +0,0 @@
-//
-// Thread.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Definition of the Thread class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Thread_INCLUDED
-#define Foundation_Thread_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/Thread_WIN32.h"
-#else
-#include "Poco/Thread_POSIX.h"
-#endif
-
-
-namespace Poco {
-
-
-class Runnable;
-class ThreadLocalStorage;
-
-
-class Foundation_API Thread: private ThreadImpl
- /// This class implements a platform-independent
- /// wrapper to an operating system thread.
- ///
- /// Every Thread object gets a unique (within
- /// its process) numeric thread ID.
- /// Furthermore, a thread can be assigned a name.
- /// The name of a thread can be changed at any time.
-{
-public:
- using ThreadImpl::Callable;
-
- enum Priority
- /// Thread priorities.
- {
- PRIO_LOWEST = PRIO_LOWEST_IMPL, /// The lowest thread priority.
- PRIO_LOW = PRIO_LOW_IMPL, /// A lower than normal thread priority.
- PRIO_NORMAL = PRIO_NORMAL_IMPL, /// The normal thread priority.
- PRIO_HIGH = PRIO_HIGH_IMPL, /// A higher than normal thread priority.
- PRIO_HIGHEST = PRIO_HIGHEST_IMPL /// The highest thread priority.
- };
-
- Thread();
- /// Creates a thread. Call start() to start it.
-
- Thread(const std::string& name);
- /// Creates a named thread. Call start() to start it.
-
- ~Thread();
- /// Destroys the thread.
-
- int id() const;
- /// Returns the unique thread ID of the thread.
-
- std::string name() const;
- /// Returns the name of the thread.
-
- std::string getName() const;
- /// Returns teh name of the thread.
-
- void setName(const std::string& name);
- /// Sets the name of the thread.
-
- void setPriority(Priority prio);
- /// Sets the thread's priority.
- ///
- /// Some platform only allow changing a thread's priority
- /// if the process has certain privileges.
-
- Priority getPriority() const;
- /// Returns the thread's priority.
-
- void setOSPriority(int prio);
- /// Sets the thread's priority, using an operating system specific
- /// priority value. Use getMinOSPriority() and getMaxOSPriority() to
- /// obtain mininum and maximum priority values.
-
- int getOSPriority() const;
- /// Returns the thread's priority, expressed as an operating system
- /// specific priority value.
-
- static int getMinOSPriority();
- /// Returns the mininum operating system-specific priority value,
- /// which can be passed to setOSPriority().
-
- static int getMaxOSPriority();
- /// Returns the maximum operating system-specific priority value,
- /// which can be passed to setOSPriority().
-
- void setStackSize(int size);
- /// Sets the thread's stack size in bytes.
- /// Setting the stack size to 0 will use the default stack size.
- /// Typically, the real stack size is rounded up to the nearest
- /// page size multiple.
-
- int getStackSize() const;
- /// Returns the thread's stack size in bytes.
- /// If the default stack size is used, 0 is returned.
-
- void start(Runnable& target);
- /// Starts the thread with the given target.
-
- void start(Callable target, void* pData = 0);
- /// Starts the thread with the given target and parameter.
-
- void join();
- /// Waits until the thread completes execution.
- /// If multiple threads try to join the same
- /// thread, the result is undefined.
-
- void join(long milliseconds);
- /// Waits for at most the given interval for the thread
- /// to complete. Throws a TimeoutException if the thread
- /// does not complete within the specified time interval.
-
- bool tryJoin(long milliseconds);
- /// Waits for at most the given interval for the thread
- /// to complete. Returns true if the thread has finished,
- /// false otherwise.
-
- bool isRunning() const;
- /// Returns true if the thread is running.
-
- static void sleep(long milliseconds);
- /// Suspends the current thread for the specified
- /// amount of time.
-
- static void yield();
- /// Yields cpu to other threads.
-
- static Thread* current();
- /// Returns the Thread object for the currently active thread.
- /// If the current thread is the main thread, 0 is returned.
-
-protected:
- ThreadLocalStorage& tls();
- /// Returns a reference to the thread's local storage.
-
- void clearTLS();
- /// Clears the thread's local storage.
-
- std::string makeName();
- /// Creates a unique name for a thread.
-
- static int uniqueId();
- /// Creates and returns a unique id for a thread.
-
-private:
- Thread(const Thread&);
- Thread& operator = (const Thread&);
-
- int _id;
- std::string _name;
- ThreadLocalStorage* _pTLS;
- mutable FastMutex _mutex;
-
- friend class ThreadLocalStorage;
- friend class PooledThread;
-};
-
-
-//
-// inlines
-//
-inline int Thread::id() const
-{
- return _id;
-}
-
-
-inline std::string Thread::name() const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return _name;
-}
-
-
-inline std::string Thread::getName() const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return _name;
-}
-
-
-inline bool Thread::isRunning() const
-{
- return isRunningImpl();
-}
-
-
-inline void Thread::sleep(long milliseconds)
-{
- sleepImpl(milliseconds);
-}
-
-
-inline void Thread::yield()
-{
- yieldImpl();
-}
-
-
-inline Thread* Thread::current()
-{
- return static_cast<Thread*>(currentImpl());
-}
-
-
-inline void Thread::setOSPriority(int prio)
-{
- setOSPriorityImpl(prio);
-}
-
-
-inline int Thread::getOSPriority() const
-{
- return getOSPriorityImpl();
-}
-
-
-inline int Thread::getMinOSPriority()
-{
- return ThreadImpl::getMinOSPriorityImpl();
-}
-
-
-inline int Thread::getMaxOSPriority()
-{
- return ThreadImpl::getMaxOSPriorityImpl();
-}
-
-
-inline void Thread::setStackSize(int size)
-{
- setStackSizeImpl(size);
-}
-
-
-inline int Thread::getStackSize() const
-{
- return getStackSizeImpl();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Thread_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ThreadLocal.h b/Utilities/Poco/Foundation/include/Poco/ThreadLocal.h
deleted file mode 100755
index 9097271711..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ThreadLocal.h
+++ /dev/null
@@ -1,179 +0,0 @@
-//
-// ThreadLocal.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Definition of the ThreadLocal template and related classes.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_ThreadLocal_INCLUDED
-#define Foundation_ThreadLocal_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <map>
-
-
-namespace Poco {
-
-
-class Foundation_API TLSAbstractSlot
- /// This is the base class for all objects
- /// that the ThreadLocalStorage class manages.
-{
-public:
- TLSAbstractSlot();
- virtual ~TLSAbstractSlot();
-};
-
-
-template <class C>
-class TLSSlot: public TLSAbstractSlot
- /// The Slot template wraps another class
- /// so that it can be stored in a ThreadLocalStorage
- /// object. This class is used internally, and you
- /// must not create instances of it yourself.
-{
-public:
- TLSSlot():
- _value()
- {
- }
-
- ~TLSSlot()
- {
- }
-
- C& value()
- {
- return _value;
- }
-
-private:
- TLSSlot(const TLSSlot&);
- TLSSlot& operator = (const TLSSlot&);
-
- C _value;
-};
-
-
-class Foundation_API ThreadLocalStorage
- /// This class manages the local storage for each thread.
- /// Never use this class directly, always use the
- /// ThreadLocal template for managing thread local storage.
-{
-public:
- ThreadLocalStorage();
- /// Creates the TLS.
-
- ~ThreadLocalStorage();
- /// Deletes the TLS.
-
- TLSAbstractSlot*& get(const void* key);
- /// Returns the slot for the given key.
-
- static ThreadLocalStorage& current();
- /// Returns the TLS object for the current thread
- /// (which may also be the main thread).
-
- static void clear();
- /// Clears the current thread's TLS object.
- /// Does nothing in the main thread.
-
-private:
- typedef std::map<const void*, TLSAbstractSlot*> TLSMap;
-
- TLSMap _map;
-
- friend class Thread;
-};
-
-
-template <class C>
-class ThreadLocal
- /// This template is used to declare type safe thread
- /// local variables. It can basically be used like
- /// a smart pointer class with the special feature
- /// that it references a different object
- /// in every thread. The underlying object will
- /// be created when it is referenced for the first
- /// time.
- /// See the NestedDiagnosticContext class for an
- /// example how to use this template.
- /// Every thread only has access to its own
- /// thread local data. There is no way for a thread
- /// to access another thread's local data.
-{
- typedef TLSSlot<C> Slot;
-
-public:
- ThreadLocal()
- {
- }
-
- ~ThreadLocal()
- {
- }
-
- C* operator -> ()
- {
- return &get();
- }
-
- C& operator * ()
- /// "Dereferences" the smart pointer and returns a reference
- /// to the underlying data object. The reference can be used
- /// to modify the object.
- {
- return get();
- }
-
- C& get()
- /// Returns a reference to the underlying data object.
- /// The reference can be used to modify the object.
- {
- TLSAbstractSlot*& p = ThreadLocalStorage::current().get(this);
- if (!p) p = new Slot;
- return static_cast<Slot*>(p)->value();
- }
-
-private:
- ThreadLocal(const ThreadLocal&);
- ThreadLocal& operator = (const ThreadLocal&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ThreadLocal_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ThreadPool.h b/Utilities/Poco/Foundation/include/Poco/ThreadPool.h
deleted file mode 100755
index 233e5e2015..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ThreadPool.h
+++ /dev/null
@@ -1,200 +0,0 @@
-//
-// ThreadPool.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ThreadPool
-//
-// Definition of the ThreadPool class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_ThreadPool_INCLUDED
-#define Foundation_ThreadPool_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Thread.h"
-#include "Poco/Mutex.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-class Runnable;
-class PooledThread;
-
-
-class Foundation_API ThreadPool
- /// A thread pool always keeps a number of threads running, ready
- /// to accept work.
- /// Creating and starting a threads can impose a significant runtime
- /// overhead to an application. A thread pool helps to improve
- /// the performance of an application by reducing the number
- /// of threads that have to be created (and destroyed again).
- /// Threads in a thread pool are re-used once they become
- /// available again.
- /// The thread pool always keeps a minimum number of threads
- /// running. If the demans for threads increases, additional
- /// threads are created. Once the demand for threads sinks
- /// again, no-longer used threads are stopped and removed
- /// from the pool.
-{
-public:
- ThreadPool(int minCapacity = 2,
- int maxCapacity = 16,
- int idleTime = 60,
- int stackSize = POCO_THREAD_STACK_SIZE);
- ThreadPool(const std::string& name,
- int minCapacity = 2,
- int maxCapacity = 16,
- int idleTime = 60,
- int stackSize = POCO_THREAD_STACK_SIZE);
- /// Creates a thread pool with minCapacity threads.
- /// If required, up to maxCapacity threads are created
- /// a NoThreadAvailableException exception is thrown.
- /// If a thread is running idle for more than idleTime seconds,
- /// and more than minCapacity threads are running, the thread
- /// is killed. Threads are created with given stack size.
-
- ~ThreadPool();
- /// Currently running threads will remain active
- /// until they complete.
-
- void addCapacity(int n);
- /// Increases (or decreases, if n is negative)
- /// the maximum number of threads.
-
- int capacity() const;
- /// Returns the maximum capacity of threads.
-
- void setStackSize(int stackSize);
- /// Sets the stack size for threads.
- /// New stack size applies only for newly created threads.
-
- int getStackSize() const;
- /// Returns the stack size used to create new threads.
-
- int used() const;
- /// Returns the number of currently used threads.
-
- int allocated() const;
- /// Returns the number of currently allocated threads.
-
- int available() const;
- /// Returns the number available threads.
-
- void start(Runnable& target);
- /// Obtains a thread and starts the target.
- /// Throws a NoThreadAvailableException if no more
- /// threads are available.
-
- void start(Runnable& target, const std::string& name);
- /// Obtains a thread and starts the target.
- /// Assigns the given name to the thread.
- /// Throws a NoThreadAvailableException if no more
- /// threads are available.
-
- void startWithPriority(Thread::Priority priority, Runnable& target);
- /// Obtains a thread, adjusts the thread's priority, and starts the target.
- /// Throws a NoThreadAvailableException if no more
- /// threads are available.
-
- void startWithPriority(Thread::Priority priority, Runnable& target, const std::string& name);
- /// Obtains a thread, adjusts the thread's priority, and starts the target.
- /// Assigns the given name to the thread.
- /// Throws a NoThreadAvailableException if no more
- /// threads are available.
-
- void stopAll();
- /// Stops all running threads.
- /// Will also delete all thread objects.
- /// If used, this method should be the last action before
- /// the thread pool is deleted.
-
- void joinAll();
- /// Waits for all threads to complete.
-
- void collect();
- /// Stops and removes no longer used threads from the
- /// thread pool. Can be called at various times in an
- /// application's life time to help the thread pool
- /// manage its threads. Calling this method is optional,
- /// as the thread pool is also implicitly managed in
- /// calls to start(), addCapacity() and joinAll().
-
- static ThreadPool& defaultPool();
- /// Returns a reference to the default
- /// thread pool.
-
-protected:
- PooledThread* getThread();
- PooledThread* createThread();
-
- void housekeep();
-
-private:
- ThreadPool(const ThreadPool& pool);
- ThreadPool& operator = (const ThreadPool& pool);
-
- typedef std::vector<PooledThread*> ThreadVec;
-
- std::string _name;
- int _minCapacity;
- int _maxCapacity;
- int _idleTime;
- int _serial;
- int _age;
- int _stackSize;
- ThreadVec _threads;
- mutable FastMutex _mutex;
-};
-
-
-//
-// inlines
-//
-inline void ThreadPool::setStackSize(int stackSize)
-{
- _stackSize = stackSize;
-}
-
-
-inline int ThreadPool::getStackSize() const
-{
- return _stackSize;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ThreadPool_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/ThreadTarget.h b/Utilities/Poco/Foundation/include/Poco/ThreadTarget.h
deleted file mode 100755
index e454ef23eb..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ThreadTarget.h
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// ThreadTarget.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ThreadTarget
-//
-// Definition of the ThreadTarget class.
-//
-// 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.
-//
-
-
-#ifndef Foundation_ThreadTarget_INCLUDED
-#define Foundation_ThreadTarget_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Runnable.h"
-
-
-namespace Poco {
-
-
-class Foundation_API ThreadTarget: public Runnable
- /// This adapter simplifies using static member functions as well as
- /// standalone functions as targets for threads.
- /// Note that it is possible to pass those entities directly to Thread::start().
- /// This adapter is provided as a convenience for higher abstraction level
- /// scenarios where Runnable abstract class is used.
- ///
- /// For using a non-static member function as a thread target, please
- /// see the RunnableAdapter class.
- ///
- /// Usage:
- /// class MyObject
- /// {
- /// static void doSomething() {}
- /// };
- /// ThreadTarget ra(&MyObject::doSomething));
- /// Thread thr;
- /// thr.start(ra);
- ///
- /// or:
- ///
- /// void doSomething() {}
- ///
- /// ThreadTarget ra(doSomething));
- /// Thread thr;
- /// thr.start(ra);
-{
-public:
- typedef void (*Callback)();
-
- ThreadTarget(Callback method);
-
- ThreadTarget(const ThreadTarget& te);
-
- ~ThreadTarget();
-
- ThreadTarget& operator = (const ThreadTarget& te);
-
- void run();
-
-private:
- ThreadTarget();
-
- Callback _method;
-};
-
-
-//
-// inlines
-//
-inline void ThreadTarget::run()
-{
- _method();
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_ThreadTarget_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Thread_POSIX.h b/Utilities/Poco/Foundation/include/Poco/Thread_POSIX.h
deleted file mode 100755
index 24f98439d7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Thread_POSIX.h
+++ /dev/null
@@ -1,207 +0,0 @@
-//
-// Thread_POSIX.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Definition of the ThreadImpl class for POSIX Threads.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_Thread_POSIX_INCLUDED
-#define Foundation_Thread_POSIX_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Runnable.h"
-#include "Poco/SignalHandler.h"
-#include "Poco/Event.h"
-#include "Poco/RefCountedObject.h"
-#include "Poco/AutoPtr.h"
-#include <pthread.h>
-// must be limits.h (not <climits>) for PTHREAD_STACK_MIN on Solaris
-#include <limits.h>
-#if !defined(POCO_NO_SYS_SELECT_H)
-#include <sys/select.h>
-#endif
-#include <errno.h>
-
-
-namespace Poco {
-
-
-class Foundation_API ThreadImpl
-{
-public:
- typedef void (*Callable)(void*);
-
- enum Priority
- {
- PRIO_LOWEST_IMPL,
- PRIO_LOW_IMPL,
- PRIO_NORMAL_IMPL,
- PRIO_HIGH_IMPL,
- PRIO_HIGHEST_IMPL
- };
-
- struct CallbackData: public RefCountedObject
- {
- CallbackData(): callback(0), pData(0)
- {
- }
-
- Callable callback;
- void* pData;
- };
-
- ThreadImpl();
- ~ThreadImpl();
-
- void setPriorityImpl(int prio);
- int getPriorityImpl() const;
- void setOSPriorityImpl(int prio);
- int getOSPriorityImpl() const;
- static int getMinOSPriorityImpl();
- static int getMaxOSPriorityImpl();
- void setStackSizeImpl(int size);
- int getStackSizeImpl() const;
- void startImpl(Runnable& target);
- void startImpl(Callable target, void* pData = 0);
-
- void joinImpl();
- bool joinImpl(long milliseconds);
- bool isRunningImpl() const;
- static void sleepImpl(long milliseconds);
- static void yieldImpl();
- static ThreadImpl* currentImpl();
-
-protected:
- static void* runnableEntry(void* pThread);
- static void* callableEntry(void* pThread);
- static int mapPrio(int prio);
- static int reverseMapPrio(int osPrio);
-
-private:
- class CurrentThreadHolder
- {
- public:
- CurrentThreadHolder()
- {
- if (pthread_key_create(&_key, NULL))
- throw SystemException("cannot allocate thread context key");
- }
- ~CurrentThreadHolder()
- {
- pthread_key_delete(_key);
- }
- ThreadImpl* get() const
- {
- return reinterpret_cast<ThreadImpl*>(pthread_getspecific(_key));
- }
- void set(ThreadImpl* pThread)
- {
- pthread_setspecific(_key, pThread);
- }
-
- private:
- pthread_key_t _key;
- };
-
- struct ThreadData: public RefCountedObject
- {
- ThreadData():
- pRunnableTarget(0),
- pCallbackTarget(0),
- thread(0),
- prio(PRIO_NORMAL_IMPL),
- done(false),
- stackSize(POCO_THREAD_STACK_SIZE)
- {
- }
-
- Runnable* pRunnableTarget;
- AutoPtr<CallbackData> pCallbackTarget;
- pthread_t thread;
- int prio;
- int osPrio;
- Event done;
- std::size_t stackSize;
- };
-
- AutoPtr<ThreadData> _pData;
-
- static CurrentThreadHolder _currentThreadHolder;
-
-#if defined(POCO_OS_FAMILY_UNIX)
- SignalHandler::JumpBufferVec _jumpBufferVec;
- friend class SignalHandler;
-#endif
-};
-
-
-//
-// inlines
-//
-inline int ThreadImpl::getPriorityImpl() const
-{
- return _pData->prio;
-}
-
-
-inline int ThreadImpl::getOSPriorityImpl() const
-{
- return _pData->osPrio;
-}
-
-
-inline bool ThreadImpl::isRunningImpl() const
-{
- return _pData->pRunnableTarget != 0 ||
- (_pData->pCallbackTarget.get() != 0 && _pData->pCallbackTarget->callback != 0);
-}
-
-
-inline void ThreadImpl::yieldImpl()
-{
- sched_yield();
-}
-
-
-inline int ThreadImpl::getStackSizeImpl() const
-{
- return _pData->stackSize;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Thread_POSIX_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Thread_WIN32.h b/Utilities/Poco/Foundation/include/Poco/Thread_WIN32.h
deleted file mode 100755
index 5fdcc550c1..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Thread_WIN32.h
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-// Thread_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Definition of the ThreadImpl class for WIN32.
-//
-// Copyright (c) 2004-2009, 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.
-//
-
-
-#ifndef Foundation_Thread_WIN32_INCLUDED
-#define Foundation_Thread_WIN32_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Runnable.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API ThreadImpl
-{
-public:
- typedef void (*Callable)(void*);
-
-#if defined(_DLL)
- typedef DWORD (WINAPI *Entry)(LPVOID);
-#else
- typedef unsigned (__stdcall *Entry)(void*);
-#endif
-
- struct CallbackData
- {
- CallbackData(): callback(0), pData(0)
- {
- }
-
- Callable callback;
- void* pData;
- };
-
- enum Priority
- {
- PRIO_LOWEST_IMPL = THREAD_PRIORITY_LOWEST,
- PRIO_LOW_IMPL = THREAD_PRIORITY_BELOW_NORMAL,
- PRIO_NORMAL_IMPL = THREAD_PRIORITY_NORMAL,
- PRIO_HIGH_IMPL = THREAD_PRIORITY_ABOVE_NORMAL,
- PRIO_HIGHEST_IMPL = THREAD_PRIORITY_HIGHEST
- };
-
- ThreadImpl();
- ~ThreadImpl();
-
- void setPriorityImpl(int prio);
- int getPriorityImpl() const;
- void setOSPriorityImpl(int prio);
- int getOSPriorityImpl() const;
- static int getMinOSPriorityImpl();
- static int getMaxOSPriorityImpl();
- void setStackSizeImpl(int size);
- int getStackSizeImpl() const;
- void startImpl(Runnable& target);
- void startImpl(Callable target, void* pData = 0);
-
- void joinImpl();
- bool joinImpl(long milliseconds);
- bool isRunningImpl() const;
- static void sleepImpl(long milliseconds);
- static void yieldImpl();
- static ThreadImpl* currentImpl();
-
-protected:
-#if defined(_DLL)
- static DWORD WINAPI runnableEntry(LPVOID pThread);
-#else
- static unsigned __stdcall runnableEntry(void* pThread);
-#endif
-
-#if defined(_DLL)
- static DWORD WINAPI callableEntry(LPVOID pThread);
-#else
- static unsigned __stdcall callableEntry(void* pThread);
-#endif
-
- void createImpl(Entry ent, void* pData);
- void threadCleanup();
-
-private:
- class CurrentThreadHolder
- {
- public:
- CurrentThreadHolder(): _slot(TlsAlloc())
- {
- if (_slot == TLS_OUT_OF_INDEXES)
- throw SystemException("cannot allocate thread context key");
- }
- ~CurrentThreadHolder()
- {
- TlsFree(_slot);
- }
- ThreadImpl* get() const
- {
- return reinterpret_cast<ThreadImpl*>(TlsGetValue(_slot));
- }
- void set(ThreadImpl* pThread)
- {
- TlsSetValue(_slot, pThread);
- }
-
- private:
- DWORD _slot;
- };
-
- Runnable* _pRunnableTarget;
- CallbackData _callbackTarget;
- HANDLE _thread;
- int _prio;
- int _stackSize;
-
- static CurrentThreadHolder _currentThreadHolder;
-};
-
-
-//
-// inlines
-//
-inline int ThreadImpl::getPriorityImpl() const
-{
- return _prio;
-}
-
-
-inline int ThreadImpl::getOSPriorityImpl() const
-{
- return _prio;
-}
-
-
-inline int ThreadImpl::getMinOSPriorityImpl()
-{
- return PRIO_LOWEST_IMPL;
-}
-
-
-inline int ThreadImpl::getMaxOSPriorityImpl()
-{
- return PRIO_HIGHEST_IMPL;
-}
-
-
-inline void ThreadImpl::sleepImpl(long milliseconds)
-{
- Sleep(DWORD(milliseconds));
-}
-
-
-inline void ThreadImpl::yieldImpl()
-{
- Sleep(0);
-}
-
-
-inline void ThreadImpl::setStackSizeImpl(int size)
-{
- _stackSize = size;
-}
-
-
-inline int ThreadImpl::getStackSizeImpl() const
-{
- return _stackSize;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Thread_WIN32_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/TimedNotificationQueue.h b/Utilities/Poco/Foundation/include/Poco/TimedNotificationQueue.h
deleted file mode 100644
index 29a16c7453..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/TimedNotificationQueue.h
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// TimedNotificationQueue.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: TimedNotificationQueue
-//
-// Definition of the TimedNotificationQueue class.
-//
-// Copyright (c) 2009, 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.
-//
-
-
-#ifndef Foundation_TimedNotificationQueue_INCLUDED
-#define Foundation_TimedNotificationQueue_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Notification.h"
-#include "Poco/Mutex.h"
-#include "Poco/Event.h"
-#include "Poco/Timestamp.h"
-#include <map>
-
-
-namespace Poco {
-
-
-class Foundation_API TimedNotificationQueue
- /// A TimedNotificationQueue object provides a way to implement timed, asynchronous
- /// notifications. This is especially useful for sending notifications
- /// from one thread to another, for example from a background thread to
- /// the main (user interface) thread.
- ///
- /// The TimedNotificationQueue is quite similar to the NotificationQueue class.
- /// The only difference to NotificationQueue is that each Notification is tagged
- /// with a Timestamp. When inserting a Notification into the queue, the
- /// Notification is inserted according to the given Timestamp, with
- /// lower Timestamp values being inserted before higher ones.
- ///
- /// Notifications are dequeued in order of their timestamps.
- ///
- /// TimedNotificationQueue has some restrictions regarding multithreaded use.
- /// While multiple threads may enqueue notifications, only one thread at a
- /// time may dequeue notifications from the queue.
- ///
- /// If two threads try to dequeue a notification simultaneously, the results
- /// are undefined.
-{
-public:
- TimedNotificationQueue();
- /// Creates the TimedNotificationQueue.
-
- ~TimedNotificationQueue();
- /// Destroys the TimedNotificationQueue.
-
- void enqueueNotification(Notification::Ptr pNotification, Timestamp timestamp);
- /// Enqueues the given notification by adding it to
- /// the queue according to the given timestamp.
- /// Lower timestamp values are inserted before higher ones.
- /// The queue takes ownership of the notification, thus
- /// a call like
- /// notificationQueue.enqueueNotification(new MyNotification, someTime);
- /// does not result in a memory leak.
-
- Notification* dequeueNotification();
- /// Dequeues the next pending notification with a timestamp
- /// less than or equal to the current time.
- /// Returns 0 (null) if no notification is available.
- /// The caller gains ownership of the notification and
- /// is expected to release it when done with it.
- ///
- /// It is highly recommended that the result is immediately
- /// assigned to a Notification::Ptr, to avoid potential
- /// memory management issues.
-
- Notification* waitDequeueNotification();
- /// Dequeues the next pending notification.
- /// If no notification is available, waits for a notification
- /// to be enqueued.
- /// The caller gains ownership of the notification and
- /// is expected to release it when done with it.
- /// This method returns 0 (null) if wakeUpWaitingThreads()
- /// has been called by another thread.
- ///
- /// It is highly recommended that the result is immediately
- /// assigned to a Notification::Ptr, to avoid potential
- /// memory management issues.
-
- Notification* waitDequeueNotification(long milliseconds);
- /// Dequeues the next pending notification.
- /// If no notification is available, waits for a notification
- /// to be enqueued up to the specified time.
- /// Returns 0 (null) if no notification is available.
- /// The caller gains ownership of the notification and
- /// is expected to release it when done with it.
- ///
- /// It is highly recommended that the result is immediately
- /// assigned to a Notification::Ptr, to avoid potential
- /// memory management issues.
-
- bool empty() const;
- /// Returns true iff the queue is empty.
-
- int size() const;
- /// Returns the number of notifications in the queue.
-
- void clear();
- /// Removes all notifications from the queue.
- ///
- /// Calling clear() while another thread executes one of
- /// the dequeue member functions will result in undefined
- /// behavior.
-
-protected:
- typedef std::multimap<Timestamp, Notification::Ptr> NfQueue;
- Notification::Ptr dequeueOne(NfQueue::iterator& it);
- bool wait(Timestamp::TimeDiff interval);
-
-private:
- NfQueue _nfQueue;
- Event _nfAvailable;
- mutable FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_TimedNotificationQueue_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Timer.h b/Utilities/Poco/Foundation/include/Poco/Timer.h
deleted file mode 100755
index 0575ab59a9..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Timer.h
+++ /dev/null
@@ -1,243 +0,0 @@
-//
-// Timer.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Timer
-//
-// Definition of the Timer and related classes.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Timer_INCLUDED
-#define Foundation_Timer_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Runnable.h"
-#include "Poco/Mutex.h"
-#include "Poco/Event.h"
-#include "Poco/Thread.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-
-
-class AbstractTimerCallback;
-class ThreadPool;
-
-
-class Foundation_API Timer: protected Runnable
- /// This class implements a thread-based timer.
- /// A timer starts a thread that first waits for a given start interval.
- /// Once that interval expires, the timer callback is called repeatedly
- /// in the given periodic interval. If the interval is 0, the timer is only
- /// called once.
- /// The timer callback method can stop the timer by setting the
- /// timer's periodic interval to 0.
- ///
- /// The timer callback runs in its own thread, so multithreading
- /// issues (proper synchronization) have to be considered when writing
- /// the callback method.
- ///
- /// The exact interval at which the callback is called depends on many
- /// factors like operating system, CPU performance and system load and
- /// may differ from the specified interval.
- ///
- /// The time needed to execute the timer callback is not included
- /// in the interval between invocations. For example, if the interval
- /// is 500 milliseconds, and the callback needs 400 milliseconds to
- /// execute, the callback function is nevertheless called every 500
- /// milliseconds. If the callback takes longer to execute than the
- /// interval, the callback function will be immediately called again
- /// once it returns.
- ///
- /// The timer thread is taken from a thread pool, so
- /// there is a limit to the number of available concurrent timers.
-{
-public:
- Timer(long startInterval = 0, long periodicInterval = 0);
- /// Creates a new timer object. StartInterval and periodicInterval
- /// are given in milliseconds. If a periodicInterval of zero is
- /// specified, the callback will only be called once, after the
- /// startInterval expires.
- /// To start the timer, call the Start() method.
-
- virtual ~Timer();
- /// Stops and destroys the timer.
-
- void start(const AbstractTimerCallback& method);
- /// Starts the timer.
- /// Create the TimerCallback as follows:
- /// TimerCallback<MyClass> callback(*this, &MyClass::onTimer);
- /// timer.start(callback);
- ///
- /// The timer thread is taken from the global default thread pool.
-
- void start(const AbstractTimerCallback& method, Thread::Priority priority);
- /// Starts the timer in a thread with the given priority.
- /// Create the TimerCallback as follows:
- /// TimerCallback<MyClass> callback(*this, &MyClass::onTimer);
- /// timer.start(callback);
- ///
- /// The timer thread is taken from the global default thread pool.
-
- void start(const AbstractTimerCallback& method, ThreadPool& threadPool);
- /// Starts the timer.
- /// Create the TimerCallback as follows:
- /// TimerCallback<MyClass> callback(*this, &MyClass::onTimer);
- /// timer.start(callback);
-
- void start(const AbstractTimerCallback& method, Thread::Priority priority, ThreadPool& threadPool);
- /// Starts the timer in a thread with the given priority.
- /// Create the TimerCallback as follows:
- /// TimerCallback<MyClass> callback(*this, &MyClass::onTimer);
- /// timer.start(callback);
-
- void stop();
- /// Stops the timer. If the callback method is currently running
- /// it will be allowed to finish first.
- /// WARNING: Never call this method from within the callback method,
- /// as a deadlock would result. To stop the timer from within the
- /// callback method, call restart(0).
-
- void restart();
- /// Restarts the periodic interval. If the callback method is already running,
- /// nothing will happen.
-
- void restart(long milliseconds);
- /// Sets a new periodic interval and restarts the timer.
- /// An interval of 0 will stop the timer.
-
- long getStartInterval() const;
- /// Returns the start interval.
-
- void setStartInterval(long milliseconds);
- /// Sets the start interval. Will only be
- /// effective before start() is called.
-
- long getPeriodicInterval() const;
- /// Returns the periodic interval.
-
- void setPeriodicInterval(long milliseconds);
- /// Sets the periodic interval. If the timer is already running
- /// the new interval will be effective when the current interval
- /// expires.
-
-protected:
- void run();
-
-private:
- volatile long _startInterval;
- volatile long _periodicInterval;
- Event _wakeUp;
- Event _done;
- AbstractTimerCallback* _pCallback;
- Poco::Timestamp _nextInvocation;
- mutable FastMutex _mutex;
-
- Timer(const Timer&);
- Timer& operator = (const Timer&);
-};
-
-
-class Foundation_API AbstractTimerCallback
- /// This is the base class for all instantiations of
- /// the TimerCallback template.
-{
-public:
- AbstractTimerCallback();
- AbstractTimerCallback(const AbstractTimerCallback& callback);
- virtual ~AbstractTimerCallback();
-
- AbstractTimerCallback& operator = (const AbstractTimerCallback& callback);
-
- virtual void invoke(Timer& timer) const = 0;
- virtual AbstractTimerCallback* clone() const = 0;
-};
-
-
-template <class C>
-class TimerCallback: public AbstractTimerCallback
- /// This template class implements an adapter that sits between
- /// a Timer and an object's method invoked by the timer.
- /// It is quite similar in concept to the RunnableAdapter, but provides
- /// some Timer specific additional methods.
- /// See the Timer class for information on how
- /// to use this template class.
-{
-public:
- typedef void (C::*Callback)(Timer&);
-
- TimerCallback(C& object, Callback method): _pObject(&object), _method(method)
- {
- }
-
- TimerCallback(const TimerCallback& callback): _pObject(callback._pObject), _method(callback._method)
- {
- }
-
- ~TimerCallback()
- {
- }
-
- TimerCallback& operator = (const TimerCallback& callback)
- {
- if (&callback != this)
- {
- _pObject = callback._pObject;
- _method = callback._method;
- }
- return *this;
- }
-
- void invoke(Timer& timer) const
- {
- (_pObject->*_method)(timer);
- }
-
- AbstractTimerCallback* clone() const
- {
- return new TimerCallback(*this);
- }
-
-private:
- TimerCallback();
-
- C* _pObject;
- Callback _method;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Timer_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Timespan.h b/Utilities/Poco/Foundation/include/Poco/Timespan.h
deleted file mode 100755
index de2b47c119..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Timespan.h
+++ /dev/null
@@ -1,320 +0,0 @@
-//
-// Timespan.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: Timespan
-//
-// Definition of the Timespan class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Timespan_INCLUDED
-#define Foundation_Timespan_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Timespan
- /// A class that represents time spans up to microsecond resolution.
-{
-public:
- typedef Timestamp::TimeDiff TimeDiff;
-
- Timespan();
- /// Creates a zero Timespan.
-
- Timespan(TimeDiff microseconds);
- /// Creates a Timespan.
-
- Timespan(long seconds, long microseconds);
- /// Creates a Timespan. Useful for creating
- /// a Timespan from a struct timeval.
-
- Timespan(int days, int hours, int minutes, int seconds, int microseconds);
- /// Creates a Timespan.
-
- Timespan(const Timespan& timespan);
- /// Creates a Timespan from another one.
-
- ~Timespan();
- /// Destroys the Timespan.
-
- Timespan& operator = (const Timespan& timespan);
- /// Assignment operator.
-
- Timespan& operator = (TimeDiff microseconds);
- /// Assignment operator.
-
- Timespan& assign(int days, int hours, int minutes, int seconds, int microseconds);
- /// Assigns a new span.
-
- Timespan& assign(long seconds, long microseconds);
- /// Assigns a new span. Useful for assigning
- /// from a struct timeval.
-
- void swap(Timespan& timespan);
- /// Swaps the Timespan with another one.
-
- bool operator == (const Timespan& ts) const;
- bool operator != (const Timespan& ts) const;
- bool operator > (const Timespan& ts) const;
- bool operator >= (const Timespan& ts) const;
- bool operator < (const Timespan& ts) const;
- bool operator <= (const Timespan& ts) const;
-
- bool operator == (TimeDiff microseconds) const;
- bool operator != (TimeDiff microseconds) const;
- bool operator > (TimeDiff microseconds) const;
- bool operator >= (TimeDiff microseconds) const;
- bool operator < (TimeDiff microseconds) const;
- bool operator <= (TimeDiff microseconds) const;
-
- Timespan operator + (const Timespan& d) const;
- Timespan operator - (const Timespan& d) const;
- Timespan& operator += (const Timespan& d);
- Timespan& operator -= (const Timespan& d);
-
- Timespan operator + (TimeDiff microseconds) const;
- Timespan operator - (TimeDiff microseconds) const;
- Timespan& operator += (TimeDiff microseconds);
- Timespan& operator -= (TimeDiff microseconds);
-
- int days() const;
- /// Returns the number of days.
-
- int hours() const;
- /// Returns the number of hours (0 to 23).
-
- int totalHours() const;
- /// Returns the total number of hours.
-
- int minutes() const;
- /// Returns the number of minutes (0 to 59).
-
- int totalMinutes() const;
- /// Returns the total number of minutes.
-
- int seconds() const;
- /// Returns the number of seconds (0 to 59).
-
- int totalSeconds() const;
- /// Returns the total number of seconds.
-
- int milliseconds() const;
- /// Returns the number of milliseconds (0 to 999).
-
- TimeDiff totalMilliseconds() const;
- /// Returns the total number of milliseconds.
-
- int microseconds() const;
- /// Returns the fractions of a millisecond
- /// in microseconds (0 to 999).
-
- int useconds() const;
- /// Returns the fractions of a second
- /// in microseconds (0 to 999999).
-
- TimeDiff totalMicroseconds() const;
- /// Returns the total number of microseconds.
-
- static const TimeDiff MILLISECONDS; /// The number of microseconds in a millisecond.
- static const TimeDiff SECONDS; /// The number of microseconds in a second.
- static const TimeDiff MINUTES; /// The number of microseconds in a minute.
- static const TimeDiff HOURS; /// The number of microseconds in a hour.
- static const TimeDiff DAYS; /// The number of microseconds in a day.
-
-private:
- TimeDiff _span;
-};
-
-
-//
-// inlines
-//
-inline int Timespan::days() const
-{
- return int(_span/DAYS);
-}
-
-
-inline int Timespan::hours() const
-{
- return int((_span/HOURS) % 24);
-}
-
-
-inline int Timespan::totalHours() const
-{
- return int(_span/HOURS);
-}
-
-
-inline int Timespan::minutes() const
-{
- return int((_span/MINUTES) % 60);
-}
-
-
-inline int Timespan::totalMinutes() const
-{
- return int(_span/MINUTES);
-}
-
-
-inline int Timespan::seconds() const
-{
- return int((_span/SECONDS) % 60);
-}
-
-
-inline int Timespan::totalSeconds() const
-{
- return int(_span/SECONDS);
-}
-
-
-inline int Timespan::milliseconds() const
-{
- return int((_span/MILLISECONDS) % 1000);
-}
-
-
-inline Timespan::TimeDiff Timespan::totalMilliseconds() const
-{
- return _span/MILLISECONDS;
-}
-
-
-inline int Timespan::microseconds() const
-{
- return int(_span % 1000);
-}
-
-
-inline int Timespan::useconds() const
-{
- return int(_span % 1000000);
-}
-
-
-inline Timespan::TimeDiff Timespan::totalMicroseconds() const
-{
- return _span;
-}
-
-
-inline bool Timespan::operator == (const Timespan& ts) const
-{
- return _span == ts._span;
-}
-
-
-inline bool Timespan::operator != (const Timespan& ts) const
-{
- return _span != ts._span;
-}
-
-
-inline bool Timespan::operator > (const Timespan& ts) const
-{
- return _span > ts._span;
-}
-
-
-inline bool Timespan::operator >= (const Timespan& ts) const
-{
- return _span >= ts._span;
-}
-
-
-inline bool Timespan::operator < (const Timespan& ts) const
-{
- return _span < ts._span;
-}
-
-
-inline bool Timespan::operator <= (const Timespan& ts) const
-{
- return _span <= ts._span;
-}
-
-
-inline bool Timespan::operator == (TimeDiff microseconds) const
-{
- return _span == microseconds;
-}
-
-
-inline bool Timespan::operator != (TimeDiff microseconds) const
-{
- return _span != microseconds;
-}
-
-
-inline bool Timespan::operator > (TimeDiff microseconds) const
-{
- return _span > microseconds;
-}
-
-
-inline bool Timespan::operator >= (TimeDiff microseconds) const
-{
- return _span >= microseconds;
-}
-
-
-inline bool Timespan::operator < (TimeDiff microseconds) const
-{
- return _span < microseconds;
-}
-
-
-inline bool Timespan::operator <= (TimeDiff microseconds) const
-{
- return _span <= microseconds;
-}
-
-
-inline void swap(Timespan& s1, Timespan& s2)
-{
- s1.swap(s2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Timespan_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Timestamp.h b/Utilities/Poco/Foundation/include/Poco/Timestamp.h
deleted file mode 100755
index 3165b845dd..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Timestamp.h
+++ /dev/null
@@ -1,260 +0,0 @@
-//
-// Timestamp.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: Timestamp
-//
-// Definition of the Timestamp class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Timestamp_INCLUDED
-#define Foundation_Timestamp_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <ctime>
-
-
-namespace Poco {
-
-
-class Foundation_API Timestamp
- /// A Timestamp stores a monotonic time value
- /// with (theoretical) microseconds resolution.
- /// Timestamps can be compared with each other
- /// and simple arithmetics are supported.
- /// Timestamps are UTC (Coordinated Universal Time)
- /// based and thus independent of the timezone
- /// in effect on the system.
-{
-public:
- typedef Int64 TimeVal; /// monotonic UTC time value in microsecond resolution
- typedef Int64 UtcTimeVal; /// monotonic UTC time value in 100 nanosecond resolution
- typedef Int64 TimeDiff; /// difference between two timestamps in microseconds
-
- Timestamp();
- /// Creates a timestamp with the current time.
-
- Timestamp(TimeVal tv);
- /// Creates a timestamp from the given time value.
-
- Timestamp(const Timestamp& other);
- /// Copy constructor.
-
- ~Timestamp();
- /// Destroys the timestamp
-
- Timestamp& operator = (const Timestamp& other);
- Timestamp& operator = (TimeVal tv);
-
- void swap(Timestamp& timestamp);
- /// Swaps the Timestamp with another one.
-
- void update();
- /// Updates the Timestamp with the current time.
-
- bool operator == (const Timestamp& ts) const;
- bool operator != (const Timestamp& ts) const;
- bool operator > (const Timestamp& ts) const;
- bool operator >= (const Timestamp& ts) const;
- bool operator < (const Timestamp& ts) const;
- bool operator <= (const Timestamp& ts) const;
-
- Timestamp operator + (TimeDiff d) const;
- Timestamp operator - (TimeDiff d) const;
- TimeDiff operator - (const Timestamp& ts) const;
- Timestamp& operator += (TimeDiff d);
- Timestamp& operator -= (TimeDiff d);
-
- std::time_t epochTime() const;
- /// Returns the timestamp expressed in time_t.
- /// time_t base time is midnight, January 1, 1970.
- /// Resolution is one second.
-
- UtcTimeVal utcTime() const;
- /// Returns the timestamp expressed in UTC-based
- /// time. UTC base time is midnight, October 15, 1582.
- /// Resolution is 100 nanoseconds.
-
- TimeVal epochMicroseconds() const;
- /// Returns the timestamp expressed in microseconds
- /// since the Unix epoch, midnight, January 1, 1970.
-
- TimeDiff elapsed() const;
- /// Returns the time elapsed since the time denoted by
- /// the timestamp. Equivalent to Timestamp() - *this.
-
- bool isElapsed(TimeDiff interval) const;
- /// Returns true iff the given interval has passed
- /// since the time denoted by the timestamp.
-
- static Timestamp fromEpochTime(std::time_t t);
- /// Creates a timestamp from a std::time_t.
-
- static Timestamp fromUtcTime(UtcTimeVal val);
- /// Creates a timestamp from a UTC time value.
-
- static TimeVal resolution();
- /// Returns the resolution in units per second.
- /// Since the timestamp has microsecond resolution,
- /// the returned value is always 1000000.
-
-#if defined(_WIN32)
- static Timestamp fromFileTimeNP(UInt32 fileTimeLow, UInt32 fileTimeHigh);
- void toFileTimeNP(UInt32& fileTimeLow, UInt32& fileTimeHigh) const;
-#endif
-
-private:
- TimeVal _ts;
-};
-
-
-//
-// inlines
-//
-inline bool Timestamp::operator == (const Timestamp& ts) const
-{
- return _ts == ts._ts;
-}
-
-
-inline bool Timestamp::operator != (const Timestamp& ts) const
-{
- return _ts != ts._ts;
-}
-
-
-inline bool Timestamp::operator > (const Timestamp& ts) const
-{
- return _ts > ts._ts;
-}
-
-
-inline bool Timestamp::operator >= (const Timestamp& ts) const
-{
- return _ts >= ts._ts;
-}
-
-
-inline bool Timestamp::operator < (const Timestamp& ts) const
-{
- return _ts < ts._ts;
-}
-
-
-inline bool Timestamp::operator <= (const Timestamp& ts) const
-{
- return _ts <= ts._ts;
-}
-
-
-inline Timestamp Timestamp::operator + (Timestamp::TimeDiff d) const
-{
- return Timestamp(_ts + d);
-}
-
-
-inline Timestamp Timestamp::operator - (Timestamp::TimeDiff d) const
-{
- return Timestamp(_ts - d);
-}
-
-
-inline Timestamp::TimeDiff Timestamp::operator - (const Timestamp& ts) const
-{
- return _ts - ts._ts;
-}
-
-
-inline Timestamp& Timestamp::operator += (Timestamp::TimeDiff d)
-{
- _ts += d;
- return *this;
-}
-
-
-inline Timestamp& Timestamp::operator -= (Timestamp::TimeDiff d)
-{
- _ts -= d;
- return *this;
-}
-
-
-inline std::time_t Timestamp::epochTime() const
-{
- return std::time_t(_ts/resolution());
-}
-
-
-inline Timestamp::UtcTimeVal Timestamp::utcTime() const
-{
- return _ts*10 + (TimeDiff(0x01b21dd2) << 32) + 0x13814000;
-}
-
-
-inline Timestamp::TimeVal Timestamp::epochMicroseconds() const
-{
- return _ts;
-}
-
-
-inline Timestamp::TimeDiff Timestamp::elapsed() const
-{
- Timestamp now;
- return now - *this;
-}
-
-
-inline bool Timestamp::isElapsed(Timestamp::TimeDiff interval) const
-{
- Timestamp now;
- Timestamp::TimeDiff diff = now - *this;
- return diff >= interval;
-}
-
-
-inline Timestamp::TimeVal Timestamp::resolution()
-{
- return 1000000;
-}
-
-
-inline void swap(Timestamp& s1, Timestamp& s2)
-{
- s1.swap(s2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Timestamp_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Timezone.h b/Utilities/Poco/Foundation/include/Poco/Timezone.h
deleted file mode 100755
index cc58b98813..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Timezone.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// Timezone.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: Timezone
-//
-// Definition of the Timezone class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Timezone_INCLUDED
-#define Foundation_Timezone_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Timezone
- /// This class provides information about the current timezone.
-{
-public:
- static int utcOffset();
- /// Returns the offset of local time to UTC, in seconds.
- /// local time = UTC + utcOffset().
-
- static int dst();
- /// Returns the daylight saving time offset in seconds if
- /// daylight saving time is in use.
- /// local time = UTC + utcOffset() + dst().
-
- static bool isDst(const Timestamp& timestamp);
- /// Returns true if daylight saving time is in effect
- /// for the given time. Depending on the operating system
- /// platform this might only work reliably for certain
- /// date ranges, as the C library's localtime() function
- /// is used.
-
- static int tzd();
- /// Returns the time zone differential for the current timezone.
- /// The timezone differential is computed as utcOffset() + dst()
- /// and is expressed in seconds.
-
- static std::string name();
- /// Returns the timezone name currently in effect.
-
- static std::string standardName();
- /// Returns the timezone name if not daylight saving time is in effect.
-
- static std::string dstName();
- /// Returns the timezone name if daylight saving time is in effect.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Timezone_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Token.h b/Utilities/Poco/Foundation/include/Poco/Token.h
deleted file mode 100755
index f0a6df84dc..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Token.h
+++ /dev/null
@@ -1,183 +0,0 @@
-//
-// Token.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: StreamTokenizer
-//
-// Definition of the Token class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Token_INCLUDED
-#define Foundation_Token_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <istream>
-
-
-namespace Poco {
-
-
-class Foundation_API Token
- /// The base class for all token classes that can be
- /// registered with the StreamTokenizer.
-{
-public:
- enum Class
- {
- IDENTIFIER_TOKEN,
- KEYWORD_TOKEN,
- SEPARATOR_TOKEN,
- OPERATOR_TOKEN,
- STRING_LITERAL_TOKEN,
- CHAR_LITERAL_TOKEN,
- INTEGER_LITERAL_TOKEN,
- LONG_INTEGER_LITERAL_TOKEN,
- FLOAT_LITERAL_TOKEN,
- DOUBLE_LITERAL_TOKEN,
- COMMENT_TOKEN,
- SPECIAL_COMMENT_TOKEN,
- PREPROCESSOR_TOKEN,
- WHITESPACE_TOKEN,
- EOF_TOKEN,
- INVALID_TOKEN,
- USER_TOKEN
- };
-
- Token();
- /// Creates the Token.
-
- virtual ~Token();
- /// Destroys the Token.
-
- virtual bool start(char c, std::istream& istr);
- /// Checks if the given character (and, optionally,
- /// the next character in the input stream) start
- /// a valid token. Returns true if so, false
- /// otherwise.
- ///
- /// The current read position in istr must not be
- /// changed. In other words, only the peek() method
- /// of istream may be used.
- ///
- /// If the character starts the token, it should
- /// be set as the token's value.
-
- virtual void finish(std::istream& istr);
- /// Builds the token by reading and appending
- /// the remaining characters from istr.
-
- virtual Class tokenClass() const;
- /// Returns the kind of the token.
-
- const std::string& tokenString() const;
- /// Returns the token's raw string.
-
- virtual std::string asString() const;
- /// Returns a string representation of the token.
-
- virtual int asInteger() const;
- /// Returns an integer representation of the token.
-
- virtual double asFloat() const;
- /// Returns a floating-point representation of the token.
-
- virtual char asChar() const;
- /// Returns a char representation of the token.
-
- bool is(Class tokenClass) const;
- /// Returns true iff the token has the given class.
-
-protected:
- std::string _value;
-
-private:
- Token(const Token&);
- Token& operator = (const Token&);
-};
-
-
-class Foundation_API InvalidToken: public Token
- /// This token class is used for signalling that
- /// an invalid character sequence has been encountered
- /// in the input stream.
-{
-public:
- InvalidToken();
- ~InvalidToken();
- Class tokenClass() const;
-};
-
-
-class Foundation_API EOFToken: public Token
- /// This token class is used to signal the
- /// end of the input stream.
-{
-public:
- EOFToken();
- ~EOFToken();
- Class tokenClass() const;
-};
-
-
-class Foundation_API WhitespaceToken: public Token
- /// This pseudo token class is used to eat
- /// up whitespace in between real tokens.
-{
-public:
- WhitespaceToken();
- ~WhitespaceToken();
- Class tokenClass() const;
- bool start(char c, std::istream& istr);
- void finish(std::istream& istr);
-};
-
-
-//
-// inlines
-//
-inline const std::string& Token::tokenString() const
-{
- return _value;
-}
-
-
-inline bool Token::is(Token::Class cls) const
-{
- return tokenClass() == cls;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Token_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Tuple.h b/Utilities/Poco/Foundation/include/Poco/Tuple.h
deleted file mode 100755
index 2d8faf775a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Tuple.h
+++ /dev/null
@@ -1,1769 +0,0 @@
-//
-// Tuple.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Tuple
-//
-// Definition of the Tuple class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Tuple_INCLUDED
-#define Foundation_Tuple_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/TypeList.h"
-
-
-namespace Poco {
-
-
-#if defined(_MSC_VER)
-#define POCO_TYPEWRAPPER_DEFAULTVALUE(T) TypeWrapper<T>::TYPE()
-#else
-#define POCO_TYPEWRAPPER_DEFAULTVALUE(T) typename TypeWrapper<T>::TYPE()
-#endif
-
-
-template <class T0,
- class T1 = NullTypeList,
- class T2 = NullTypeList,
- class T3 = NullTypeList,
- class T4 = NullTypeList,
- class T5 = NullTypeList,
- class T6 = NullTypeList,
- class T7 = NullTypeList,
- class T8 = NullTypeList,
- class T9 = NullTypeList,
- class T10 = NullTypeList,
- class T11 = NullTypeList,
- class T12 = NullTypeList,
- class T13 = NullTypeList,
- class T14 = NullTypeList,
- class T15 = NullTypeList,
- class T16 = NullTypeList,
- class T17 = NullTypeList,
- class T18 = NullTypeList,
- class T19 = NullTypeList>
-struct Tuple
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17),
- typename TypeWrapper<T18>::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18),
- typename TypeWrapper<T19>::CONSTTYPE& t19 = POCO_TYPEWRAPPER_DEFAULTVALUE(T19)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t6, typename TypeListType<T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t7, typename TypeListType<T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t8, typename TypeListType<T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t9, typename TypeListType<T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t10, typename TypeListType<T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t11, typename TypeListType<T12,T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t12, typename TypeListType<T13,T14,T15,T16,T17,T18,T19>::HeadType
- (t13, typename TypeListType<T14,T15,T16,T17,T18,T19>::HeadType
- (t14, typename TypeListType<T15,T16,T17,T18,T19>::HeadType
- (t15, typename TypeListType<T16,T17,T18,T19>::HeadType
- (t16, typename TypeListType<T17,T18,T19>::HeadType
- (t17, typename TypeListType<T18,T19>::HeadType
- (t18, typename TypeListType<T19>::HeadType
- (t19, NullTypeList()))))))))))))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13,
- class T14,
- class T15,
- class T16,
- class T17,
- class T18>
-struct Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17),
- typename TypeWrapper<T18>::CONSTTYPE& t18 = POCO_TYPEWRAPPER_DEFAULTVALUE(T18)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t6, typename TypeListType<T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t7, typename TypeListType<T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t8, typename TypeListType<T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t9, typename TypeListType<T10,T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t10, typename TypeListType<T11,T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t11, typename TypeListType<T12,T13,T14,T15,T16,T17,T18>::HeadType
- (t12, typename TypeListType<T13,T14,T15,T16,T17,T18>::HeadType
- (t13, typename TypeListType<T14,T15,T16,T17,T18>::HeadType
- (t14, typename TypeListType<T15,T16,T17,T18>::HeadType
- (t15, typename TypeListType<T16,T17,T18>::HeadType
- (t16, typename TypeListType<T17,T18>::HeadType
- (t17, typename TypeListType<T18>::HeadType
- (t18, NullTypeList())))))))))))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13,
- class T14,
- class T15,
- class T16,
- class T17>
-struct Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16),
- typename TypeWrapper<T17>::CONSTTYPE& t17 = POCO_TYPEWRAPPER_DEFAULTVALUE(T17)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t6, typename TypeListType<T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t7, typename TypeListType<T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t8, typename TypeListType<T9,T10,T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t9, typename TypeListType<T10,T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t10, typename TypeListType<T11,T12,T13,T14,T15,T16,T17>::HeadType
- (t11, typename TypeListType<T12,T13,T14,T15,T16,T17>::HeadType
- (t12, typename TypeListType<T13,T14,T15,T16,T17>::HeadType
- (t13, typename TypeListType<T14,T15,T16,T17>::HeadType
- (t14, typename TypeListType<T15,T16,T17>::HeadType
- (t15, typename TypeListType<T16,T17>::HeadType
- (t16, typename TypeListType<T17>::HeadType
- (t17, NullTypeList()))))))))))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13,
- class T14,
- class T15,
- class T16>
-struct Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15),
- typename TypeWrapper<T16>::CONSTTYPE& t16 = POCO_TYPEWRAPPER_DEFAULTVALUE(T16)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::HeadType
- (t6, typename TypeListType<T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::HeadType
- (t7, typename TypeListType<T8,T9,T10,T11,T12,T13,T14,T15,T16>::HeadType
- (t8, typename TypeListType<T9,T10,T11,T12,T13,T14,T15,T16>::HeadType
- (t9, typename TypeListType<T10,T11,T12,T13,T14,T15,T16>::HeadType
- (t10, typename TypeListType<T11,T12,T13,T14,T15,T16>::HeadType
- (t11, typename TypeListType<T12,T13,T14,T15,T16>::HeadType
- (t12, typename TypeListType<T13,T14,T15,T16>::HeadType
- (t13, typename TypeListType<T14,T15,T16>::HeadType
- (t14, typename TypeListType<T15,T16>::HeadType
- (t15, typename TypeListType<T16>::HeadType
- (t16, NullTypeList())))))))))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13,
- class T14,
- class T15>
-struct Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14),
- typename TypeWrapper<T15>::CONSTTYPE& t15 = POCO_TYPEWRAPPER_DEFAULTVALUE(T15)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>::HeadType
- (t6, typename TypeListType<T7,T8,T9,T10,T11,T12,T13,T14,T15>::HeadType
- (t7, typename TypeListType<T8,T9,T10,T11,T12,T13,T14,T15>::HeadType
- (t8, typename TypeListType<T9,T10,T11,T12,T13,T14,T15>::HeadType
- (t9, typename TypeListType<T10,T11,T12,T13,T14,T15>::HeadType
- (t10, typename TypeListType<T11,T12,T13,T14,T15>::HeadType
- (t11, typename TypeListType<T12,T13,T14,T15>::HeadType
- (t12, typename TypeListType<T13,T14,T15>::HeadType
- (t13, typename TypeListType<T14,T15>::HeadType
- (t14, typename TypeListType<T15>::HeadType
- (t15, NullTypeList()))))))))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13,
- class T14>
-struct Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13),
- typename TypeWrapper<T14>::CONSTTYPE& t14 = POCO_TYPEWRAPPER_DEFAULTVALUE(T14)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9,T10,T11,T12,T13,T14>::HeadType
- (t6, typename TypeListType<T7,T8,T9,T10,T11,T12,T13,T14>::HeadType
- (t7, typename TypeListType<T8,T9,T10,T11,T12,T13,T14>::HeadType
- (t8, typename TypeListType<T9,T10,T11,T12,T13,T14>::HeadType
- (t9, typename TypeListType<T10,T11,T12,T13,T14>::HeadType
- (t10, typename TypeListType<T11,T12,T13,T14>::HeadType
- (t11, typename TypeListType<T12,T13,T14>::HeadType
- (t12, typename TypeListType<T13,T14>::HeadType
- (t13, typename TypeListType<T14>::HeadType
- (t14, NullTypeList())))))))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12,
- class T13>
-struct Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12),
- typename TypeWrapper<T13>::CONSTTYPE& t13 = POCO_TYPEWRAPPER_DEFAULTVALUE(T13)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9,T10,T11,T12,T13>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9,T10,T11,T12,T13>::HeadType
- (t6, typename TypeListType<T7,T8,T9,T10,T11,T12,T13>::HeadType
- (t7, typename TypeListType<T8,T9,T10,T11,T12,T13>::HeadType
- (t8, typename TypeListType<T9,T10,T11,T12,T13>::HeadType
- (t9, typename TypeListType<T10,T11,T12,T13>::HeadType
- (t10, typename TypeListType<T11,T12,T13>::HeadType
- (t11, typename TypeListType<T12,T13>::HeadType
- (t12, typename TypeListType<T13>::HeadType
- (t13, NullTypeList()))))))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11,
- class T12>
-struct Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12, NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11),
- typename TypeWrapper<T12>::CONSTTYPE& t12 = POCO_TYPEWRAPPER_DEFAULTVALUE(T12)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9,T10,T11,T12>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9,T10,T11,T12>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9,T10,T11,T12>::HeadType
- (t6, typename TypeListType<T7,T8,T9,T10,T11,T12>::HeadType
- (t7, typename TypeListType<T8,T9,T10,T11,T12>::HeadType
- (t8, typename TypeListType<T9,T10,T11,T12>::HeadType
- (t9, typename TypeListType<T10,T11,T12>::HeadType
- (t10, typename TypeListType<T11,T12>::HeadType
- (t11, typename TypeListType<T12>::HeadType
- (t12, NullTypeList())))))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10,
- class T11>
-struct Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10),
- typename TypeWrapper<T11>::CONSTTYPE& t11 = POCO_TYPEWRAPPER_DEFAULTVALUE(T11)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9,T10,T11>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9,T10,T11>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9,T10,T11>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9,T10,T11>::HeadType
- (t6, typename TypeListType<T7,T8,T9,T10,T11>::HeadType
- (t7, typename TypeListType<T8,T9,T10,T11>::HeadType
- (t8, typename TypeListType<T9,T10,T11>::HeadType
- (t9, typename TypeListType<T10,T11>::HeadType
- (t10, typename TypeListType<T11>::HeadType
- (t11, NullTypeList()))))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9,
- class T10>
-struct Tuple<T0, T1,T2,T3,T4,T5,T6,T7,T8,T9,T10, NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9),
- typename TypeWrapper<T10>::CONSTTYPE& t10 = POCO_TYPEWRAPPER_DEFAULTVALUE(T10)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9,T10>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9,T10>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9,T10>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9,T10>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9,T10>::HeadType
- (t6, typename TypeListType<T7,T8,T9,T10>::HeadType
- (t7, typename TypeListType<T8,T9,T10>::HeadType
- (t8, typename TypeListType<T9,T10>::HeadType
- (t9, typename TypeListType<T10>::HeadType
- (t10, NullTypeList())))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8,
- class T9>
-struct Tuple<T0, T1,T2,T3,T4,T5,T6,T7,T8,T9, NullTypeList>
-{
- typedef typename TypeListType<T0, T1,T2,T3,T4,T5,T6,T7,T8,T9>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8),
- typename TypeWrapper<T9>::CONSTTYPE& t9 = POCO_TYPEWRAPPER_DEFAULTVALUE(T9)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8,T9>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8,T9>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8,T9>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8,T9>::HeadType
- (t5, typename TypeListType<T6,T7,T8,T9>::HeadType
- (t6, typename TypeListType<T7,T8,T9>::HeadType
- (t7, typename TypeListType<T8,T9>::HeadType
- (t8, typename TypeListType<T9>::HeadType
- (t9, NullTypeList()))))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7,
- class T8>
-struct Tuple<T0, T1,T2,T3,T4,T5,T6,T7,T8, NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7,T8>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7),
- typename TypeWrapper<T8>::CONSTTYPE& t8 = POCO_TYPEWRAPPER_DEFAULTVALUE(T8)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7,T8>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7,T8>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7,T8>::HeadType
- (t4, typename TypeListType<T5,T6,T7,T8>::HeadType
- (t5, typename TypeListType<T6,T7,T8>::HeadType
- (t6, typename TypeListType<T7,T8>::HeadType
- (t7, typename TypeListType<T8>::HeadType
- (t8, NullTypeList())))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6,
- class T7>
-struct Tuple<T0, T1,T2,T3,T4,T5,T6,T7, NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6,T7>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6),
- typename TypeWrapper<T7>::CONSTTYPE& t7 = POCO_TYPEWRAPPER_DEFAULTVALUE(T7)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6,T7>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6,T7>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6,T7>::HeadType
- (t3, typename TypeListType<T4,T5,T6,T7>::HeadType
- (t4, typename TypeListType<T5,T6,T7>::HeadType
- (t5, typename TypeListType<T6,T7>::HeadType
- (t6, typename TypeListType<T7>::HeadType
- (t7, NullTypeList()))))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5,
- class T6>
-struct Tuple<T0, T1,T2,T3,T4,T5,T6, NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5,T6>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5),
- typename TypeWrapper<T6>::CONSTTYPE& t6 = POCO_TYPEWRAPPER_DEFAULTVALUE(T6)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5,T6>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5,T6>::HeadType
- (t2, typename TypeListType<T3,T4,T5,T6>::HeadType
- (t3, typename TypeListType<T4,T5,T6>::HeadType
- (t4, typename TypeListType<T5,T6>::HeadType
- (t5, typename TypeListType<T6>::HeadType
- (t6, NullTypeList())))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4,
- class T5>
-struct Tuple<T0, T1,T2,T3,T4,T5, NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4,T5>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4),
- typename TypeWrapper<T5>::CONSTTYPE& t5 = POCO_TYPEWRAPPER_DEFAULTVALUE(T5)):
- _data(t0, typename TypeListType<T1,T2,T3,T4,T5>::HeadType
- (t1, typename TypeListType<T2,T3,T4,T5>::HeadType
- (t2, typename TypeListType<T3,T4,T5>::HeadType
- (t3, typename TypeListType<T4,T5>::HeadType
- (t4, typename TypeListType<T5>::HeadType
- (t5, NullTypeList()))))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3,
- class T4>
-struct Tuple<T0, T1,T2,T3,T4, NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3,T4>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3),
- typename TypeWrapper<T4>::CONSTTYPE& t4 = POCO_TYPEWRAPPER_DEFAULTVALUE(T4)):
- _data(t0, typename TypeListType<T1,T2,T3,T4>::HeadType
- (t1, typename TypeListType<T2,T3,T4>::HeadType
- (t2, typename TypeListType<T3,T4>::HeadType
- (t3, typename TypeListType<T4>::HeadType
- (t4, NullTypeList())))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2,
- class T3>
-struct Tuple<T0, T1,T2,T3, NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2,T3>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2),
- typename TypeWrapper<T3>::CONSTTYPE& t3 = POCO_TYPEWRAPPER_DEFAULTVALUE(T3)):
- _data(t0, typename TypeListType<T1,T2,T3>::HeadType
- (t1, typename TypeListType<T2,T3>::HeadType
- (t2, typename TypeListType<T3>::HeadType
- (t3, NullTypeList()))))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1,
- class T2>
-struct Tuple<T0, T1,T2, NullTypeList>
-{
- typedef typename TypeListType<T0,T1,T2>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1),
- typename TypeWrapper<T2>::CONSTTYPE& t2 = POCO_TYPEWRAPPER_DEFAULTVALUE(T2)):
- _data(t0, typename TypeListType<T1,T2>::HeadType
- (t1, typename TypeListType<T2>::HeadType
- (t2, NullTypeList())))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0,
- class T1>
-struct Tuple<T0, T1, NullTypeList>
-{
- typedef typename TypeListType<T0,T1>::HeadType Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0,
- typename TypeWrapper<T1>::CONSTTYPE& t1 = POCO_TYPEWRAPPER_DEFAULTVALUE(T1)):
- _data(t0, typename TypeListType<T1>::HeadType(t1, NullTypeList()))
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-template <class T0>
-struct Tuple<T0, NullTypeList>
-{
- typedef TypeList<T0, NullTypeList> Type;
-
- enum TupleLengthType
- {
- length = Type::length
- };
-
- Tuple():_data()
- {
- }
-
- Tuple(typename TypeWrapper<T0>::CONSTTYPE& t0):
- _data(t0, NullTypeList())
- {
- }
-
- template <int N>
- typename TypeGetter<N, Type>::ConstHeadType& get() const
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- typename TypeGetter<N, Type>::HeadType& get()
- {
- return Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data);
- }
-
- template <int N>
- void set(typename TypeGetter<N, Type>::ConstHeadType& val)
- {
- Getter<N>::template get<typename TypeGetter<N, Type>::HeadType, typename Type::HeadType, typename Type::TailType>(_data) = val;
- }
-
- bool operator == (const Tuple& other) const
- {
- return _data == other._data;
- }
-
- bool operator != (const Tuple& other) const
- {
- return !(_data == other._data);
- }
-
- bool operator < (const Tuple& other) const
- {
- return _data < other._data;
- }
-
-private:
- Type _data;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Tuple_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/TypeList.h b/Utilities/Poco/Foundation/include/Poco/TypeList.h
deleted file mode 100755
index a26394bfe4..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/TypeList.h
+++ /dev/null
@@ -1,487 +0,0 @@
-//
-// TypeList.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: TypeList
-//
-// Implementation of the TypeList template.
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// and Contributors.
-//
-// Portions extracted and adapted from
-// The Loki Library
-// Copyright (c) 2001 by Andrei Alexandrescu
-//
-// 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.
-//
-
-
-#ifndef Foundation_TypeList_INCLUDED
-#define Foundation_TypeList_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/MetaProgramming.h"
-
-
-namespace Poco {
-
-
-template <class Head, class Tail>
-struct TypeList;
-
-
-struct NullTypeList
-{
- enum
- {
- length = 0
- };
-
- bool operator == (const NullTypeList&) const
- {
- return true;
- }
-
- bool operator != (const NullTypeList&) const
- {
- return false;
- }
-
- bool operator < (const NullTypeList&) const
- {
- return false;
- }
-};
-
-
-template <class Head, class Tail>
-struct TypeList
- /// Compile Time List of Types
-{
- typedef Head HeadType;
- typedef Tail TailType;
- typedef typename TypeWrapper<HeadType>::CONSTTYPE ConstHeadType;
- typedef typename TypeWrapper<TailType>::CONSTTYPE ConstTailType;
- enum
- {
- length = TailType::length+1
- };
-
- TypeList():head(), tail()
- {
- }
-
- TypeList(ConstHeadType& h, ConstTailType& t):head(h), tail(t)
- {
- }
-
- TypeList(const TypeList& tl): head(tl.head), tail(tl.tail)
- {
- }
-
- TypeList& operator = (const TypeList& tl)
- {
- if (this != &tl)
- {
- TypeList tmp(tl);
- swap(tmp);
- }
- return *this;
- }
-
- bool operator == (const TypeList& tl) const
- {
- return tl.head == head && tl.tail == tail;
- }
-
- bool operator != (const TypeList& tl) const
- {
- return !(*this == tl);
- }
-
- bool operator < (const TypeList& tl) const
- {
- if (head < tl.head)
- return true;
- else if (head == tl.head)
- return tail < tl.tail;
- return false;
- }
-
- void swap(TypeList& tl)
- {
- std::swap(head, tl.head);
- std::swap(tail, tl.tail);
- }
-
- HeadType head;
- TailType tail;
-};
-
-
-template <typename T0 = NullTypeList,
- typename T1 = NullTypeList,
- typename T2 = NullTypeList,
- typename T3 = NullTypeList,
- typename T4 = NullTypeList,
- typename T5 = NullTypeList,
- typename T6 = NullTypeList,
- typename T7 = NullTypeList,
- typename T8 = NullTypeList,
- typename T9 = NullTypeList,
- typename T10 = NullTypeList,
- typename T11 = NullTypeList,
- typename T12 = NullTypeList,
- typename T13 = NullTypeList,
- typename T14 = NullTypeList,
- typename T15 = NullTypeList,
- typename T16 = NullTypeList,
- typename T17 = NullTypeList,
- typename T18 = NullTypeList,
- typename T19 = NullTypeList>
-struct TypeListType
- /// TypeListType takes 1 - 20 typename arguments.
- /// Usage:
- ///
- /// TypeListType<T0, T1, ... , Tn>::HeadType typeList;
- ///
- /// typeList is a TypeList of T0, T1, ... , Tn
-{
-private:
- typedef typename TypeListType<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::HeadType TailType;
-
-public:
- typedef TypeList<T0, TailType> HeadType;
-};
-
-
-template <>
-struct TypeListType<>
-{
- typedef NullTypeList HeadType;
-};
-
-
-template <int n>
-struct Getter
-{
- template <class Ret, class Head, class Tail>
- inline static Ret& get(TypeList<Head, Tail>& val)
- {
- return Getter<n-1>::template get<Ret, typename Tail::HeadType, typename Tail::TailType>(val.tail);
- }
-
- template <class Ret, class Head, class Tail>
- inline static const Ret& get(const TypeList<Head, Tail>& val)
- {
- return Getter<n-1>::template get<Ret, typename Tail::HeadType, typename Tail::TailType>(val.tail);
- }
-};
-
-
-template <>
-struct Getter<0>
-{
- template <class Ret, class Head, class Tail>
- inline static Ret& get(TypeList<Head, Tail>& val)
- {
- return val.head;
- }
-
- template <class Ret, class Head, class Tail>
- inline static const Ret& get(const TypeList<Head, Tail>& val)
- {
- return val.head;
- }
-};
-
-
-template <int N, class Head>
-struct TypeGetter;
-
-
-template <int N, class Head, class Tail>
-struct TypeGetter<N, TypeList<Head, Tail> >
-{
- typedef typename TypeGetter<N-1, Tail>::HeadType HeadType;
- typedef typename TypeWrapper<HeadType>::CONSTTYPE ConstHeadType;
-};
-
-
-template <class Head, class Tail>
-struct TypeGetter<0, TypeList<Head, Tail> >
-{
- typedef typename TypeList<Head, Tail>::HeadType HeadType;
- typedef typename TypeWrapper<HeadType>::CONSTTYPE ConstHeadType;
-};
-
-
-template <class Head, class T>
-struct TypeLocator;
- /// TypeLocator returns the first occurrence of the type T in Head
- /// or -1 if the type is not found.
- ///
- /// Usage example:
- ///
- /// TypeLocator<Head, int>::HeadType TypeLoc;
- ///
- /// if (2 == TypeLoc.value) ...
- ///
-
-
-template <class T>
-struct TypeLocator<NullTypeList, T>
-{
- enum { value = -1 };
-};
-
-
-template <class T, class Tail>
-struct TypeLocator<TypeList<T, Tail>, T>
-{
- enum { value = 0 };
-};
-
-
-template <class Head, class Tail, class T>
-struct TypeLocator<TypeList<Head, Tail>, T>
-{
-private:
- enum { tmp = TypeLocator<Tail, T>::value };
-public:
- enum { value = tmp == -1 ? -1 : 1 + tmp };
-};
-
-
-template <class Head, class T>
-struct TypeAppender;
- /// TypeAppender appends T (type or a TypeList) to Head.
- ///
- /// Usage:
- ///
- /// typedef TypeListType<char>::HeadType Type1;
- /// typedef TypeAppender<Type1, int>::HeadType Type2;
- /// (Type2 is a TypeList of char,int)
- ///
- /// typedef TypeListType<float, double>::HeadType Type3;
- /// typedef TypeAppender<Type2, Type3>::HeadType Type4;
- /// (Type4 is a TypeList of char,int,float,double)
- ///
-
-
-template <>
-struct TypeAppender<NullTypeList, NullTypeList>
-{
- typedef NullTypeList HeadType;
-};
-
-
-template <class T>
-struct TypeAppender<NullTypeList, T>
-{
- typedef TypeList<T, NullTypeList> HeadType;
-};
-
-
-template <class Head, class Tail>
-struct TypeAppender<NullTypeList, TypeList<Head, Tail> >
-{
- typedef TypeList<Head, Tail> HeadType;
-};
-
-
-template <class Head, class Tail, class T>
-struct TypeAppender<TypeList<Head, Tail>, T>
-{
- typedef TypeList<Head, typename TypeAppender<Tail, T>::HeadType> HeadType;
-};
-
-
-template <class Head, class T>
-struct TypeOneEraser;
- /// TypeOneEraser erases the first occurence of the type T in Head.
- /// Usage:
- ///
- /// typedef TypeListType<char, int, float>::HeadType Type3;
- /// typedef TypeOneEraser<Type3, int>::HeadType Type2;
- /// (Type2 is a TypeList of char,float)
- ///
-
-
-template <class T>
-struct TypeOneEraser<NullTypeList, T>
-{
- typedef NullTypeList HeadType;
-};
-
-
-template <class T, class Tail>
-struct TypeOneEraser<TypeList<T, Tail>, T>
-{
- typedef Tail HeadType;
-};
-
-
-template <class Head, class Tail, class T>
-struct TypeOneEraser<TypeList<Head, Tail>, T>
-{
- typedef TypeList <Head, typename TypeOneEraser<Tail, T>::HeadType> HeadType;
-};
-
-
-template <class Head, class T>
-struct TypeAllEraser;
- /// TypeAllEraser erases all the occurences of the type T in Head.
- /// Usage:
- ///
- /// typedef TypeListType<char, int, float, int>::HeadType Type4;
- /// typedef TypeAllEraser<Type4, int>::HeadType Type2;
- /// (Type2 is a TypeList of char,float)
- ///
-
-
-template <class T>
-struct TypeAllEraser<NullTypeList, T>
-{
- typedef NullTypeList HeadType;
-};
-
-
-template <class T, class Tail>
-struct TypeAllEraser<TypeList<T, Tail>, T>
-{
- typedef typename TypeAllEraser<Tail, T>::HeadType HeadType;
-};
-
-
-template <class Head, class Tail, class T>
-struct TypeAllEraser<TypeList<Head, Tail>, T>
-{
- typedef TypeList <Head, typename TypeAllEraser<Tail, T>::HeadType> HeadType;
-};
-
-
-template <class Head>
-struct TypeDuplicateEraser;
- /// TypeDuplicateEraser erases all but the first occurence of the type T in Head.
- /// Usage:
- ///
- /// typedef TypeListType<char, int, float, int>::HeadType Type4;
- /// typedef TypeDuplicateEraser<Type4, int>::HeadType Type3;
- /// (Type3 is a TypeList of char,int,float)
- ///
-
-
-template <>
-struct TypeDuplicateEraser<NullTypeList>
-{
- typedef NullTypeList HeadType;
-};
-
-
-template <class Head, class Tail>
-struct TypeDuplicateEraser<TypeList<Head, Tail> >
-{
-private:
- typedef typename TypeDuplicateEraser<Tail>::HeadType L1;
- typedef typename TypeOneEraser<L1, Head>::HeadType L2;
-public:
- typedef TypeList<Head, L2> HeadType;
-};
-
-
-template <class Head, class T, class R>
-struct TypeOneReplacer;
- /// TypeOneReplacer replaces the first occurence
- /// of the type T in Head with type R.
- /// Usage:
- ///
- /// typedef TypeListType<char, int, float, int>::HeadType Type4;
- /// typedef TypeOneReplacer<Type4, int, double>::HeadType TypeR;
- /// (TypeR is a TypeList of char,double,float,int)
- ///
-
-
-template <class T, class R>
-struct TypeOneReplacer<NullTypeList, T, R>
-{
- typedef NullTypeList HeadType;
-};
-
-
-template <class T, class Tail, class R>
-struct TypeOneReplacer<TypeList<T, Tail>, T, R>
-{
- typedef TypeList<R, Tail> HeadType;
-};
-
-
-template <class Head, class Tail, class T, class R>
-struct TypeOneReplacer<TypeList<Head, Tail>, T, R>
-{
- typedef TypeList<Head, typename TypeOneReplacer<Tail, T, R>::HeadType> HeadType;
-};
-
-
-template <class Head, class T, class R>
-struct TypeAllReplacer;
- /// TypeAllReplacer replaces all the occurences
- /// of the type T in Head with type R.
- /// Usage:
- ///
- /// typedef TypeListType<char, int, float, int>::HeadType Type4;
- /// typedef TypeAllReplacer<Type4, int, double>::HeadType TypeR;
- /// (TypeR is a TypeList of char,double,float,double)
- ///
-
-
-template <class T, class R>
-struct TypeAllReplacer<NullTypeList, T, R>
-{
- typedef NullTypeList HeadType;
-};
-
-
-template <class T, class Tail, class R>
-struct TypeAllReplacer<TypeList<T, Tail>, T, R>
-{
- typedef TypeList<R, typename TypeAllReplacer<Tail, T, R>::HeadType> HeadType;
-};
-
-
-template <class Head, class Tail, class T, class R>
-struct TypeAllReplacer<TypeList<Head, Tail>, T, R>
-{
- typedef TypeList<Head, typename TypeAllReplacer<Tail, T, R>::HeadType> HeadType;
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/Types.h b/Utilities/Poco/Foundation/include/Poco/Types.h
deleted file mode 100755
index 942f9d3f71..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Types.h
+++ /dev/null
@@ -1,214 +0,0 @@
-//
-// Types.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Types
-//
-// Definitions of fixed-size integer types for various platforms
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_Types_INCLUDED
-#define Foundation_Types_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-#if defined(_MSC_VER)
- //
- // Windows/Visual C++
- //
- typedef signed char Int8;
- typedef unsigned char UInt8;
- typedef signed short Int16;
- typedef unsigned short UInt16;
- typedef signed int Int32;
- typedef unsigned int UInt32;
- typedef signed __int64 Int64;
- typedef unsigned __int64 UInt64;
- #if defined(_WIN64)
- #define POCO_PTR_IS_64_BIT 1
- typedef signed __int64 IntPtr;
- typedef unsigned __int64 UIntPtr;
- #else
- typedef signed long IntPtr;
- typedef unsigned long UIntPtr;
- #endif
- #define POCO_HAVE_INT64 1
-#elif defined(__GNUC__)
- //
- // Unix/GCC
- //
- typedef signed char Int8;
- typedef unsigned char UInt8;
- typedef signed short Int16;
- typedef unsigned short UInt16;
- typedef signed int Int32;
- typedef unsigned int UInt32;
- typedef signed long IntPtr;
- typedef unsigned long UIntPtr;
- #if defined(__LP64__)
- #define POCO_PTR_IS_64_BIT 1
- #define POCO_LONG_IS_64_BIT 1
- typedef signed long Int64;
- typedef unsigned long UInt64;
- #else
- typedef signed long long Int64;
- typedef unsigned long long UInt64;
- #endif
- #define POCO_HAVE_INT64 1
-#elif defined(__DECCXX)
- //
- // Compaq C++
- //
- typedef signed char Int8;
- typedef unsigned char UInt8;
- typedef signed short Int16;
- typedef unsigned short UInt16;
- typedef signed int Int32;
- typedef unsigned int UInt32;
- typedef signed __int64 Int64;
- typedef unsigned __int64 UInt64;
- #if defined(__VMS)
- #if defined(__32BITS)
- typedef signed long IntPtr;
- typedef unsigned long UIntPtr;
- #else
- typedef Int64 IntPtr;
- typedef UInt64 UIntPtr;
- #define POCO_PTR_IS_64_BIT 1
- #endif
- #else
- typedef signed long IntPtr;
- typedef unsigned long UIntPtr;
- #define POCO_PTR_IS_64_BIT 1
- #define POCO_LONG_IS_64_BIT 1
- #endif
- #define POCO_HAVE_INT64 1
-#elif defined(__HP_aCC)
- //
- // HP Ansi C++
- //
- typedef signed char Int8;
- typedef unsigned char UInt8;
- typedef signed short Int16;
- typedef unsigned short UInt16;
- typedef signed int Int32;
- typedef unsigned int UInt32;
- typedef signed long IntPtr;
- typedef unsigned long UIntPtr;
- #if defined(__LP64__)
- #define POCO_PTR_IS_64_BIT 1
- #define POCO_LONG_IS_64_BIT 1
- typedef signed long Int64;
- typedef unsigned long UInt64;
- #else
- typedef signed long long Int64;
- typedef unsigned long long UInt64;
- #endif
- #define POCO_HAVE_INT64 1
-#elif defined(__SUNPRO_CC)
- //
- // SUN Forte C++
- //
- typedef signed char Int8;
- typedef unsigned char UInt8;
- typedef signed short Int16;
- typedef unsigned short UInt16;
- typedef signed int Int32;
- typedef unsigned int UInt32;
- typedef signed long IntPtr;
- typedef unsigned long UIntPtr;
- #if defined(__sparcv9)
- #define POCO_PTR_IS_64_BIT 1
- #define POCO_LONG_IS_64_BIT 1
- typedef signed long Int64;
- typedef unsigned long UInt64;
- #else
- typedef signed long long Int64;
- typedef unsigned long long UInt64;
- #endif
- #define POCO_HAVE_INT64 1
-#elif defined(__IBMCPP__)
- //
- // IBM XL C++
- //
- typedef signed char Int8;
- typedef unsigned char UInt8;
- typedef signed short Int16;
- typedef unsigned short UInt16;
- typedef signed int Int32;
- typedef unsigned int UInt32;
- typedef signed long IntPtr;
- typedef unsigned long UIntPtr;
- #if defined(__64BIT__)
- #define POCO_PTR_IS_64_BIT 1
- #define POCO_LONG_IS_64_BIT 1
- typedef signed long Int64;
- typedef unsigned long UInt64;
- #else
- typedef signed long long Int64;
- typedef unsigned long long UInt64;
- #endif
- #define POCO_HAVE_INT64 1
-#elif defined(__sgi)
- //
- // MIPSpro C++
- //
- typedef signed char Int8;
- typedef unsigned char UInt8;
- typedef signed short Int16;
- typedef unsigned short UInt16;
- typedef signed int Int32;
- typedef unsigned int UInt32;
- typedef signed long IntPtr;
- typedef unsigned long UIntPtr;
- #if _MIPS_SZLONG == 64
- #define POCO_PTR_IS_64_BIT 1
- #define POCO_LONG_IS_64_BIT 1
- typedef signed long Int64;
- typedef unsigned long UInt64;
- #else
- typedef signed long long Int64;
- typedef unsigned long long UInt64;
- #endif
- #define POCO_HAVE_INT64 1
-#endif
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Types_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/URI.h b/Utilities/Poco/Foundation/include/Poco/URI.h
deleted file mode 100755
index 9656917ee6..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/URI.h
+++ /dev/null
@@ -1,365 +0,0 @@
-//
-// URI.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: URI
-// Module: URI
-//
-// Definition of the URI class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_URI_INCLUDED
-#define Foundation_URI_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <vector>
-
-
-namespace Poco {
-
-
-class Foundation_API URI
- /// A Uniform Resource Identifier, as specified in RFC 3986.
- ///
- /// The URI class provides methods for building URIs from their
- /// parts, as well as for splitting URIs into their parts.
- /// Furthermore, the class provides methods for resolving
- /// relative URIs against base URIs.
- ///
- /// The class automatically performs a few normalizations on
- /// all URIs and URI parts passed to it:
- /// * scheme identifiers are converted to lower case.
- /// * percent-encoded characters are decoded
- /// * optionally, dot segments are removed from paths (see normalize())
-{
-public:
- URI();
- /// Creates an empty URI.
-
- explicit URI(const std::string& uri);
- /// Parses an URI from the given string. Throws a
- /// SyntaxException if the uri is not valid.
-
- explicit URI(const char* uri);
- /// Parses an URI from the given string. Throws a
- /// SyntaxException if the uri is not valid.
-
- URI(const std::string& scheme, const std::string& pathEtc);
- /// Creates an URI from its parts.
-
- URI(const std::string& scheme, const std::string& authority, const std::string& pathEtc);
- /// Creates an URI from its parts.
-
- URI(const std::string& scheme, const std::string& authority, const std::string& path, const std::string& query);
- /// Creates an URI from its parts.
-
- URI(const std::string& scheme, const std::string& authority, const std::string& path, const std::string& query, const std::string& fragment);
- /// Creates an URI from its parts.
-
- URI(const URI& uri);
- /// Copy constructor. Creates an URI from another one.
-
- URI(const URI& baseURI, const std::string& relativeURI);
- /// Creates an URI from a base URI and a relative URI, according to
- /// the algorithm in section 5.2 of RFC 3986.
-
- ~URI();
- /// Destroys the URI.
-
- URI& operator = (const URI& uri);
- /// Assignment operator.
-
- URI& operator = (const std::string& uri);
- /// Parses and assigns an URI from the given string. Throws a
- /// SyntaxException if the uri is not valid.
-
- URI& operator = (const char* uri);
- /// Parses and assigns an URI from the given string. Throws a
- /// SyntaxException if the uri is not valid.
-
- void swap(URI& uri);
- /// Swaps the URI with another one.
-
- void clear();
- /// Clears all parts of the URI.
-
- std::string toString() const;
- /// Returns a string representation of the URI.
- ///
- /// Characters in the path, query and fragment parts will be
- /// percent-encoded as necessary.
-
- const std::string& getScheme() const;
- /// Returns the scheme part of the URI.
-
- void setScheme(const std::string& scheme);
- /// Sets the scheme part of the URI. The given scheme
- /// is converted to lower-case.
- ///
- /// A list of registered URI schemes can be found
- /// at <http://www.iana.org/assignments/uri-schemes>.
-
- const std::string& getUserInfo() const;
- /// Returns the user-info part of the URI.
-
- void setUserInfo(const std::string& userInfo);
- /// Sets the user-info part of the URI.
-
- const std::string& getHost() const;
- /// Returns the host part of the URI.
-
- void setHost(const std::string& host);
- /// Sets the host part of the URI.
-
- unsigned short getPort() const;
- /// Returns the port number part of the URI.
- ///
- /// If no port number (0) has been specified, the
- /// well-known port number (e.g., 80 for http) for
- /// the given scheme is returned if it is known.
- /// Otherwise, 0 is returned.
-
- void setPort(unsigned short port);
- /// Sets the port number part of the URI.
-
- std::string getAuthority() const;
- /// Returns the authority part (userInfo, host and port)
- /// of the URI.
- ///
- /// If the port number is a well-known port
- /// number for the given scheme (e.g., 80 for http), it
- /// is not included in the authority.
-
- void setAuthority(const std::string& authority);
- /// Parses the given authority part for the URI and sets
- /// the user-info, host, port components accordingly.
-
- const std::string& getPath() const;
- /// Returns the path part of the URI.
-
- void setPath(const std::string& path);
- /// Sets the path part of the URI.
-
- std::string getQuery() const;
- /// Returns the query part of the URI.
-
- void setQuery(const std::string& query);
- /// Sets the query part of the URI.
-
- const std::string& getRawQuery() const;
- /// Returns the unencoded query part of the URI.
-
- void setRawQuery(const std::string& query);
- /// Sets the query part of the URI.
-
- const std::string& getFragment() const;
- /// Returns the fragment part of the URI.
-
- void setFragment(const std::string& fragment);
- /// Sets the fragment part of the URI.
-
- void setPathEtc(const std::string& pathEtc);
- /// Sets the path, query and fragment parts of the URI.
-
- std::string getPathEtc() const;
- /// Returns the path, query and fragment parts of the URI.
-
- std::string getPathAndQuery() const;
- /// Returns the path and query parts of the URI.
-
- void resolve(const std::string& relativeURI);
- /// Resolves the given relative URI against the base URI.
- /// See section 5.2 of RFC 3986 for the algorithm used.
-
- void resolve(const URI& relativeURI);
- /// Resolves the given relative URI against the base URI.
- /// See section 5.2 of RFC 3986 for the algorithm used.
-
- bool isRelative() const;
- /// Returns true if the URI is a relative reference, false otherwise.
- ///
- /// A relative reference does not contain a scheme identifier.
- /// Relative references are usually resolved against an absolute
- /// base reference.
-
- bool empty() const;
- /// Returns true if the URI is empty, false otherwise.
-
- bool operator == (const URI& uri) const;
- /// Returns true if both URIs are identical, false otherwise.
- ///
- /// Two URIs are identical if their scheme, authority,
- /// path, query and fragment part are identical.
-
- bool operator == (const std::string& uri) const;
- /// Parses the given URI and returns true if both URIs are identical,
- /// false otherwise.
-
- bool operator != (const URI& uri) const;
- /// Returns true if both URIs are identical, false otherwise.
-
- bool operator != (const std::string& uri) const;
- /// Parses the given URI and returns true if both URIs are identical,
- /// false otherwise.
-
- void normalize();
- /// Normalizes the URI by removing all but leading . and .. segments from the path.
- ///
- /// If the first path segment in a relative path contains a colon (:),
- /// such as in a Windows path containing a drive letter, a dot segment (./)
- /// is prepended in accordance with section 3.3 of RFC 3986.
-
- void getPathSegments(std::vector<std::string>& segments);
- /// Places the single path segments (delimited by slashes) into the
- /// given vector.
-
- static void encode(const std::string& str, const std::string& reserved, std::string& encodedStr);
- /// URI-encodes the given string by escaping reserved and non-ASCII
- /// characters. The encoded string is appended to encodedStr.
-
- static void decode(const std::string& str, std::string& decodedStr);
- /// URI-decodes the given string by replacing percent-encoded
- /// characters with the actual character. The decoded string
- /// is appended to decodedStr.
-
-protected:
- bool equals(const URI& uri) const;
- /// Returns true if both uri's are equivalent.
-
- bool isWellKnownPort() const;
- /// Returns true if the URI's port number is a well-known one
- /// (for example, 80, if the scheme is http).
-
- unsigned short getWellKnownPort() const;
- /// Returns the well-known port number for the URI's scheme,
- /// or 0 if the port number is not known.
-
- void parse(const std::string& uri);
- /// Parses and assigns an URI from the given string. Throws a
- /// SyntaxException if the uri is not valid.
-
- void parseAuthority(std::string::const_iterator& it, const std::string::const_iterator& end);
- /// Parses and sets the user-info, host and port from the given data.
-
- void parseHostAndPort(std::string::const_iterator& it, const std::string::const_iterator& end);
- /// Parses and sets the host and port from the given data.
-
- void parsePath(std::string::const_iterator& it, const std::string::const_iterator& end);
- /// Parses and sets the path from the given data.
-
- void parsePathEtc(std::string::const_iterator& it, const std::string::const_iterator& end);
- /// Parses and sets the path, query and fragment from the given data.
-
- void parseQuery(std::string::const_iterator& it, const std::string::const_iterator& end);
- /// Parses and sets the query from the given data.
-
- void parseFragment(std::string::const_iterator& it, const std::string::const_iterator& end);
- /// Parses and sets the fragment from the given data.
-
- void mergePath(const std::string& path);
- /// Appends a path to the URI's path.
-
- void removeDotSegments(bool removeLeading = true);
- /// Removes all dot segments from the path.
-
- static void getPathSegments(const std::string& path, std::vector<std::string>& segments);
- /// Places the single path segments (delimited by slashes) into the
- /// given vector.
-
- void buildPath(const std::vector<std::string>& segments, bool leadingSlash, bool trailingSlash);
- /// Builds the path from the given segments.
-
- static const std::string RESERVED_PATH;
- static const std::string RESERVED_QUERY;
- static const std::string RESERVED_FRAGMENT;
- static const std::string ILLEGAL;
-
-private:
- std::string _scheme;
- std::string _userInfo;
- std::string _host;
- unsigned short _port;
- std::string _path;
- std::string _query;
- std::string _fragment;
-};
-
-
-//
-// inlines
-//
-inline const std::string& URI::getScheme() const
-{
- return _scheme;
-}
-
-
-inline const std::string& URI::getUserInfo() const
-{
- return _userInfo;
-}
-
-
-inline const std::string& URI::getHost() const
-{
- return _host;
-}
-
-
-inline const std::string& URI::getPath() const
-{
- return _path;
-}
-
-
-inline const std::string& URI::getRawQuery() const
-{
- return _query;
-}
-
-
-inline const std::string& URI::getFragment() const
-{
- return _fragment;
-}
-
-
-inline void swap(URI& u1, URI& u2)
-{
- u1.swap(u2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_URI_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/URIStreamFactory.h b/Utilities/Poco/Foundation/include/Poco/URIStreamFactory.h
deleted file mode 100755
index df96d2b75b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/URIStreamFactory.h
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// URIStreamFactory.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: URI
-// Module: URIStreamFactory
-//
-// Definition of the URIStreamFactory class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_URIStreamFactory_INCLUDED
-#define Foundation_URIStreamFactory_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include <istream>
-
-
-namespace Poco {
-
-
-class URI;
-
-
-class Foundation_API URIStreamFactory
- /// This class defines the interface that all
- /// URI stream factories must implement.
- ///
- /// Subclasses must implement the open() method.
-{
-public:
- URIStreamFactory();
- /// Creates the URIStreamFactory.
-
- virtual std::istream* open(const URI& uri) = 0;
- /// Tries to create and open an input stream for the
- /// resource specified by the given URI.
- ///
- /// If the stream cannot be opened for whatever reason,
- /// an appropriate IOException must be thrown.
- ///
- /// If opening the stream results in a redirect, a
- /// URIRedirection exception should be thrown.
-
-protected:
- virtual ~URIStreamFactory();
- /// Destroys the URIStreamFactory.
-
-private:
- URIStreamFactory(const URIStreamFactory&);
- URIStreamFactory& operator = (const URIStreamFactory&);
-
- friend class URIStreamOpener;
-};
-
-
-class Foundation_API URIRedirection
- /// An instance of URIRedirection is thrown by a URIStreamFactory::open()
- /// if opening the original URI resulted in a redirection response
- /// (such as a MOVED PERMANENTLY in HTTP).
-{
-public:
- URIRedirection(const std::string& uri);
- URIRedirection(const URIRedirection& redir);
-
- URIRedirection& operator = (const URIRedirection& redir);
- void swap(URIRedirection& redir);
-
- const std::string& uri() const;
- /// Returns the new URI.
-
-private:
- URIRedirection();
-
- std::string _uri;
-};
-
-
-//
-// inlines
-//
-inline const std::string& URIRedirection::uri() const
-{
- return _uri;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_URIStreamFactory_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/URIStreamOpener.h b/Utilities/Poco/Foundation/include/Poco/URIStreamOpener.h
deleted file mode 100755
index 071f95c7c7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/URIStreamOpener.h
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// URIStreamOpener.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: URI
-// Module: URIStreamOpener
-//
-// Definition of the URIStreamOpener class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_URIStreamOpener_INCLUDED
-#define Foundation_URIStreamOpener_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Mutex.h"
-#include <istream>
-#include <map>
-
-
-namespace Poco {
-
-
-class URI;
-class URIStreamFactory;
-class Path;
-
-
-class Foundation_API URIStreamOpener
- /// The URIStreamOpener class is used to create and open input streams
- /// for resourced identified by Uniform Resource Identifiers.
- ///
- /// For every URI scheme used, a URIStreamFactory must be registered.
- /// A FileStreamFactory is automatically registered for file URIs.
-{
-public:
- enum
- {
- MAX_REDIRECTS = 10
- };
-
- URIStreamOpener();
- /// Creates the URIStreamOpener and registers a FileStreamFactory
- /// for file URIs.
-
- ~URIStreamOpener();
- /// Destroys the URIStreamOpener and deletes all registered
- /// URI stream factories.
-
- std::istream* open(const URI& uri) const;
- /// Tries to create and open an input stream for the resource specified
- /// by the given uniform resource identifier.
- ///
- /// If no URIStreamFactory has been registered for the URI's
- /// scheme, a UnknownURIScheme exception is thrown.
- /// If the stream cannot be opened for any reason, an
- /// IOException is thrown.
- ///
- /// The given URI must be a valid one. This excludes file system paths.
- ///
- /// Whoever calls the method is responsible for deleting
- /// the returned stream.
-
- std::istream* open(const std::string& pathOrURI) const;
- /// Tries to create and open an input stream for the resource specified
- /// by the given path or uniform resource identifier.
- ///
- /// If the stream cannot be opened for any reason, an
- /// Exception is thrown.
- ///
- /// The method first tries to interpret the given pathOrURI as an URI.
- /// If this fails, the pathOrURI is treated as local filesystem path.
- /// If this also fails, an exception is thrown.
- ///
- /// Whoever calls the method is responsible for deleting
- /// the returned stream.
-
- std::istream* open(const std::string& basePathOrURI, const std::string& pathOrURI) const;
- /// Tries to create and open an input stream for the resource specified
- /// by the given path or uniform resource identifier.
- ///
- /// pathOrURI is resolved against basePathOrURI (see URI::resolve() and
- /// Path::resolve() for more information).
- ///
- /// If the stream cannot be opened for any reason, an
- /// Exception is thrown.
- ///
- /// Whoever calls the method is responsible for deleting
- /// the returned stream.
-
- void registerStreamFactory(const std::string& scheme, URIStreamFactory* pFactory);
- /// Registers a URIStreamFactory for the given scheme. If another factory
- /// has already been registered for the scheme, an ExistsException is thrown.
- ///
- /// The URIStreamOpener takes ownership of the factory and deletes it when it is
- /// no longer needed (in other words, when the URIStreamOpener is deleted).
-
- void unregisterStreamFactory(const std::string& scheme);
- /// Unregisters and deletes the URIStreamFactory for the given scheme.
- ///
- /// Throws a NotFoundException if no URIStreamFactory has been registered
- /// for the given scheme.
-
- bool supportsScheme(const std::string& scheme);
- /// Returns true iff a URIStreamFactory for the given scheme
- /// has been registered.
-
- static URIStreamOpener& defaultOpener();
- /// Returns a reference to the default URIStreamOpener.
-
-protected:
- std::istream* openFile(const Path& path) const;
- std::istream* openURI(const std::string& scheme, const URI& uri) const;
-
-private:
- URIStreamOpener(const URIStreamOpener&);
- URIStreamOpener& operator = (const URIStreamOpener&);
-
- typedef std::map<std::string, URIStreamFactory*> FactoryMap;
-
- FactoryMap _map;
- mutable FastMutex _mutex;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_URIStreamOpener_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UTF16Encoding.h b/Utilities/Poco/Foundation/include/Poco/UTF16Encoding.h
deleted file mode 100755
index 52fbde1945..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UTF16Encoding.h
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// UTF16Encoding.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: UTF16Encoding
-//
-// Definition of the UTF16Encoding class.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_UTF16Encoding_INCLUDED
-#define Foundation_UTF16Encoding_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/TextEncoding.h"
-
-
-namespace Poco {
-
-
-class Foundation_API UTF16Encoding: public TextEncoding
- /// UTF-16 text encoding, as defined in RFC 2781.
- ///
- /// When converting from UTF-16 to Unicode, surrogates are
- /// reported as they are - in other words, surrogate pairs
- /// are not combined into one Unicode character.
- /// When converting from Unicode to UTF-16, however, characters
- /// outside the 16-bit range are converted into a low and
- /// high surrogate.
-{
-public:
- enum ByteOrderType
- {
- BIG_ENDIAN_BYTE_ORDER,
- LITTLE_ENDIAN_BYTE_ORDER,
- NATIVE_BYTE_ORDER
- };
-
- UTF16Encoding(ByteOrderType byteOrder = NATIVE_BYTE_ORDER);
- /// Creates and initializes the encoding for the given byte order.
-
- UTF16Encoding(int byteOrderMark);
- /// Creates and initializes the encoding for the byte-order
- /// indicated by the given byte-order mark, which is the Unicode
- /// character 0xFEFF.
-
- ~UTF16Encoding();
-
- ByteOrderType getByteOrder() const;
- /// Returns the byte-order currently in use.
-
- void setByteOrder(ByteOrderType byteOrder);
- /// Sets the byte order.
-
- void setByteOrder(int byteOrderMark);
- /// Sets the byte order according to the given
- /// byte order mark, which is the Unicode
- /// character 0xFEFF.
-
- const char* canonicalName() const;
- bool isA(const std::string& encodingName) const;
- const CharacterMap& characterMap() const;
- int convert(const unsigned char* bytes) const;
- int convert(int ch, unsigned char* bytes, int length) const;
-
-private:
- bool _flipBytes;
- static const char* _names[];
- static const CharacterMap _charMap;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_UTF16Encoding_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UTF8Encoding.h b/Utilities/Poco/Foundation/include/Poco/UTF8Encoding.h
deleted file mode 100755
index ed9239f5d5..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UTF8Encoding.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// UTF8Encoding.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: UTF8Encoding
-//
-// Definition of the UTF8Encoding class.
-//
-// Copyright (c) 2004-2007, 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.
-//
-
-
-#ifndef Foundation_UTF8Encoding_INCLUDED
-#define Foundation_UTF8Encoding_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/TextEncoding.h"
-
-
-namespace Poco {
-
-
-class Foundation_API UTF8Encoding: public TextEncoding
- /// UTF-8 text encoding, as defined in RFC 2279.
-{
-public:
- UTF8Encoding();
- ~UTF8Encoding();
- const char* canonicalName() const;
- bool isA(const std::string& encodingName) const;
- const CharacterMap& characterMap() const;
- int convert(const unsigned char* bytes) const;
- int convert(int ch, unsigned char* bytes, int length) const;
-
- static bool isLegal(const unsigned char *bytes, int length);
- /// Utility routine to tell whether a sequence of bytes is legal UTF-8.
- /// This must be called with the length pre-determined by the first byte.
- /// The sequence is illegal right away if there aren't enough bytes
- /// available. If presented with a length > 4, this function returns false.
- /// The Unicode definition of UTF-8 goes up to 4-byte sequences.
- ///
- /// Adapted from ftp://ftp.unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.c
- /// Copyright 2001-2004 Unicode, Inc.
-
-private:
- static const char* _names[];
- static const CharacterMap _charMap;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_UTF8Encoding_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UTF8String.h b/Utilities/Poco/Foundation/include/Poco/UTF8String.h
deleted file mode 100755
index fd80813dd4..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UTF8String.h
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// UTF8String.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: UTF8String
-//
-// Definition of the UTF8 string functions.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_UTF8String_INCLUDED
-#define Foundation_UTF8String_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-struct Foundation_API UTF8
- /// This class provides static methods that are UTF-8 capable variants
- /// of the same functions in Poco/String.h.
- ///
- /// The various variants of icompare() provide case insensitive comparison
- /// for UTF-8 encoded strings.
- ///
- /// toUpper(), toUpperInPlace(), toLower() and toLowerInPlace() provide
- /// Unicode-based character case transformation for UTF-8 encoded strings.
-{
- static int icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, std::string::const_iterator it2, std::string::const_iterator end2);
- static int icompare(const std::string& str1, const std::string& str2);
- static int icompare(const std::string& str1, std::string::size_type n1, const std::string& str2, std::string::size_type n2);
- static int icompare(const std::string& str1, std::string::size_type n, const std::string& str2);
- static int icompare(const std::string& str1, std::string::size_type pos, std::string::size_type n, const std::string& str2);
- static int icompare(const std::string& str1, std::string::size_type pos1, std::string::size_type n1, const std::string& str2, std::string::size_type pos2, std::string::size_type n2);
- static int icompare(const std::string& str1, std::string::size_type pos1, std::string::size_type n, const std::string& str2, std::string::size_type pos2);
- static int icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, const std::string::value_type* ptr);
- static int icompare(const std::string& str, std::string::size_type pos, const std::string::value_type* ptr);
- static int icompare(const std::string& str, const std::string::value_type* ptr);
-
- static std::string toUpper(const std::string& str);
- static std::string& toUpperInPlace(std::string& str);
- static std::string toLower(const std::string& str);
- static std::string& toLowerInPlace(std::string& str);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_UTF8String_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UUID.h b/Utilities/Poco/Foundation/include/Poco/UUID.h
deleted file mode 100755
index fa670d4c89..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UUID.h
+++ /dev/null
@@ -1,233 +0,0 @@
-//
-// UUID.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: UUID
-// Module: UUID
-//
-// Definition of the UUID class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_UUID_INCLUDED
-#define Foundation_UUID_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API UUID
- /// A UUID is an identifier that is unique across both space and time,
- /// with respect to the space of all UUIDs. Since a UUID is a fixed
- /// size and contains a time field, it is possible for values to
- /// rollover (around A.D. 3400, depending on the specific algorithm
- /// used). A UUID can be used for multiple purposes, from tagging
- /// objects with an extremely short lifetime, to reliably identifying
- /// very persistent objects across a network.
- /// This class implements a Universal Unique Identifier,
- /// as specified in Appendix A of the DCE 1.1 Remote Procedure
- /// Call Specification (http://www.opengroup.org/onlinepubs/9629399/),
- /// RFC 2518 (WebDAV), section 6.4.1 and the UUIDs and GUIDs internet
- /// draft by Leach/Salz from February, 1998
- /// (http://ftp.ics.uci.edu/pub/ietf/webdav/uuid-guid/draft-leach-uuids-guids-01.txt)
- /// and also
- /// http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt
-{
-public:
- enum Version
- {
- UUID_TIME_BASED = 0x01,
- UUID_DCE_UID = 0x02,
- UUID_NAME_BASED = 0x03,
- UUID_RANDOM = 0x04
- };
-
- UUID();
- /// Creates a nil (all zero) UUID.
-
- UUID(const UUID& uuid);
- /// Copy constructor.
-
- explicit UUID(const std::string& uuid);
- /// Parses the UUID from a string.
-
- explicit UUID(const char* uuid);
- /// Parses the UUID from a string.
-
- ~UUID();
- /// Destroys the UUID.
-
- UUID& operator = (const UUID& uuid);
- /// Assignment operator.
-
- void swap(UUID& uuid);
- /// Swaps the UUID with another one.
-
- void parse(const std::string& uuid);
- /// Parses the UUID from its string representation.
-
- std::string toString() const;
- /// Returns a string representation of the UUID consisting
- /// of groups of hexadecimal digits separated by hyphens.
-
- void copyFrom(const char* buffer);
- /// Copies the UUID (16 bytes) from a buffer or byte array.
- /// The UUID fields are expected to be
- /// stored in network byte order.
- /// The buffer need not be aligned.
-
- void copyTo(char* buffer) const;
- /// Copies the UUID to the buffer. The fields
- /// are in network byte order.
- /// The buffer need not be aligned.
- /// There must have room for at least 16 bytes.
-
- Version version() const;
- /// Returns the version of the UUID.
-
- int variant() const;
- /// Returns the variant number of the UUID:
- /// - 0 reserved for NCS backward compatibility
- /// - 2 the Leach-Salz variant (used by this class)
- /// - 6 reserved, Microsoft Corporation backward compatibility
- /// - 7 reserved for future definition
-
- bool operator == (const UUID& uuid) const;
- bool operator != (const UUID& uuid) const;
- bool operator < (const UUID& uuid) const;
- bool operator <= (const UUID& uuid) const;
- bool operator > (const UUID& uuid) const;
- bool operator >= (const UUID& uuid) const;
-
- bool isNil() const;
- /// Returns true iff the UUID is nil (in other words,
- /// consists of all zeros).
-
- static const UUID& nil();
- /// Returns a nil UUID.
-
- static const UUID& dns();
- /// Returns the namespace identifier for the DNS namespace.
-
- static const UUID& uri();
- /// Returns the namespace identifier for the URI (former URL) namespace.
-
- static const UUID& oid();
- /// Returns the namespace identifier for the OID namespace.
-
- static const UUID& x500();
- /// Returns the namespace identifier for the X500 namespace.
-
-protected:
- UUID(UInt32 timeLow, UInt32 timeMid, UInt32 timeHiAndVersion, UInt16 clockSeq, UInt8 node[]);
- UUID(const char* bytes, Version version);
- int compare(const UUID& uuid) const;
- static void appendHex(std::string& str, UInt8 n);
- static void appendHex(std::string& str, UInt16 n);
- static void appendHex(std::string& str, UInt32 n);
- static UInt8 nibble(char hex);
- void fromNetwork();
- void toNetwork();
-
-private:
- UInt32 _timeLow;
- UInt16 _timeMid;
- UInt16 _timeHiAndVersion;
- UInt16 _clockSeq;
- UInt8 _node[6];
-
- friend class UUIDGenerator;
-};
-
-
-//
-// inlines
-//
-inline bool UUID::operator == (const UUID& uuid) const
-{
- return compare(uuid) == 0;
-}
-
-
-inline bool UUID::operator != (const UUID& uuid) const
-{
- return compare(uuid) != 0;
-}
-
-
-inline bool UUID::operator < (const UUID& uuid) const
-{
- return compare(uuid) < 0;
-}
-
-
-inline bool UUID::operator <= (const UUID& uuid) const
-{
- return compare(uuid) <= 0;
-}
-
-
-inline bool UUID::operator > (const UUID& uuid) const
-{
- return compare(uuid) > 0;
-}
-
-
-inline bool UUID::operator >= (const UUID& uuid) const
-{
- return compare(uuid) >= 0;
-}
-
-
-inline UUID::Version UUID::version() const
-{
- return Version(_timeHiAndVersion >> 12);
-}
-
-
-inline bool UUID::isNil() const
-{
- return compare(nil()) == 0;
-}
-
-
-inline void swap(UUID& u1, UUID& u2)
-{
- u1.swap(u2);
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_UUID_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UUIDGenerator.h b/Utilities/Poco/Foundation/include/Poco/UUIDGenerator.h
deleted file mode 100755
index a02d6c37e1..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UUIDGenerator.h
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// UUIDGenerator.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: UUID
-// Module: UUID
-//
-// Definition of the UUIDGenerator class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_UUIDGenerator_INCLUDED
-#define Foundation_UUIDGenerator_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/UUID.h"
-#include "Poco/Mutex.h"
-#include "Poco/Random.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Environment.h"
-
-
-namespace Poco {
-
-
-class DigestEngine;
-
-
-class Foundation_API UUIDGenerator
- /// This class implements a generator for Universal Unique Identifiers,
- /// as specified in Appendix A of the DCE 1.1 Remote Procedure
- /// Call Specification (http://www.opengroup.org/onlinepubs/9629399/),
- /// RFC 2518 (WebDAV), section 6.4.1 and the UUIDs and GUIDs internet
- /// draft by Leach/Salz from February, 1998
- /// (http://ftp.ics.uci.edu/pub/ietf/webdav/uuid-guid/draft-leach-uuids-guids-01.txt)
-{
-public:
- UUIDGenerator();
- /// Creates the UUIDGenerator.
-
- ~UUIDGenerator();
- /// Destroys the UUIDGenerator.
-
- UUID create();
- /// Creates a new time-based UUID, using the MAC address of
- /// one of the system's ethernet adapters.
- ///
- /// Throws a SystemException if no MAC address can be
- /// obtained.
-
- UUID createFromName(const UUID& nsid, const std::string& name);
- /// Creates a name-based UUID.
-
- UUID createFromName(const UUID& nsid, const std::string& name, DigestEngine& de);
- /// Creates a name-based UUID, using the given digest engine.
-
- UUID createRandom();
- /// Creates a random UUID.
-
- UUID createOne();
- /// Tries to create and return a time-based UUID (see create()), and,
- /// if that does not work due to the unavailability of a MAC address,
- /// creates and returns a random UUID (see createRandom()).
- ///
- /// The UUID::version() method can be used to determine the actual kind of
- /// the UUID generated.
-
- static UUIDGenerator& defaultGenerator();
- /// Returns a reference to the default UUIDGenerator.
-
-protected:
- Timestamp::UtcTimeVal timeStamp();
- void getNode();
-
-private:
- FastMutex _mutex;
- Random _random;
- Timestamp _lastTime;
- int _ticks;
- Environment::NodeId _node;
- bool _haveNode;
-
- UUIDGenerator(const UUIDGenerator&);
- UUIDGenerator& operator = (const UUIDGenerator&);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_UUIDGenerator_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UnWindows.h b/Utilities/Poco/Foundation/include/Poco/UnWindows.h
deleted file mode 100755
index b6792d453e..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UnWindows.h
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// UnWindows.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: UnWindows
-//
-// A wrapper around the <windows.h> header file that #undef's some
-// of the macros for function names defined by <windows.h> that
-// are a frequent source of conflicts (e.g., GetUserName).
-//
-// Remember, that most of the WIN32 API functions come in two variants,
-// an Unicode variant (e.g., GetUserNameA) and an ASCII variant (GetUserNameW).
-// There is also a macro (GetUserName) that's either defined to be the Unicode
-// name or the ASCII name, depending on whether the UNICODE macro is #define'd
-// or not. POCO always calls the Unicode or ASCII functions directly (depending
-// on whether POCO_WIN32_UTF8 is #define'd or not), so the macros are not ignored.
-//
-// These macro definitions are a frequent case of problems and naming conflicts,
-// especially for C++ programmers. Say, you define a class with a member function named
-// GetUserName. Depending on whether "Poco/UnWindows.h" has been included by a particular
-// translation unit or not, this might be changed to GetUserNameA/GetUserNameW, or not.
-// While, due to naming conventions used, this is less of a problem in POCO, some
-// of the users of POCO might use a different naming convention where this can become
-// a problem.
-//
-// To disable the #undef's, compile POCO with the POCO_NO_UNWINDOWS macro #define'd.
-//
-// Copyright (c) 2007, 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 <windows.h>
-
-
-#if !defined(POCO_NO_UNWINDOWS)
-// A list of annoying macros to #undef.
-// Feel free to extend as required.
-#undef GetBinaryType
-#undef GetShortPathName
-#undef GetLongPathName
-#undef GetEnvironmentStrings
-#undef SetEnvironmentStrings
-#undef FreeEnvironmentStrings
-#undef FormatMessage
-#undef EncryptFile
-#undef DecryptFile
-#undef CreateMutex
-#undef OpenMutex
-#undef CreateEvent
-#undef OpenEvent
-#undef CreateSemaphore
-#undef OpenSemaphore
-#undef LoadLibrary
-#undef GetModuleFileName
-#undef CreateProcess
-#undef GetCommandLine
-#undef GetEnvironmentVariable
-#undef SetEnvironmentVariable
-#undef ExpandEnvironmentStrings
-#undef OutputDebugString
-#undef FindResource
-#undef UpdateResource
-#undef FindAtom
-#undef AddAtom
-#undef GetSystemDirector
-#undef GetTempPath
-#undef GetTempFileName
-#undef SetCurrentDirectory
-#undef GetCurrentDirectory
-#undef CreateDirectory
-#undef RemoveDirectory
-#undef CreateFile
-#undef DeleteFile
-#undef SearchPath
-#undef CopyFile
-#undef MoveFile
-#undef ReplaceFile
-#undef GetComputerName
-#undef SetComputerName
-#undef GetUserName
-#undef LogonUser
-#undef GetVersion
-#undef GetObject
-#endif // POCO_NO_UNWINDOWS
diff --git a/Utilities/Poco/Foundation/include/Poco/UnbufferedStreamBuf.h b/Utilities/Poco/Foundation/include/Poco/UnbufferedStreamBuf.h
deleted file mode 100755
index 3a5fcc740c..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UnbufferedStreamBuf.h
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// UnufferedStreamBuf.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: StreamBuf
-//
-// Definition of template BasicUnbufferedStreamBuf and class UnbufferedStreamBuf.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Foundation_UnbufferedStreamBuf_INCLUDED
-#define Foundation_UnbufferedStreamBuf_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/StreamUtil.h"
-#include <streambuf>
-#include <iosfwd>
-#include <ios>
-
-
-namespace Poco {
-
-
-template <typename ch, typename tr>
-class BasicUnbufferedStreamBuf: public std::basic_streambuf<ch, tr>
- /// This is an implementation of an unbuffered streambuf
- /// that greatly simplifies the implementation of
- /// custom streambufs of various kinds.
- /// Derived classes only have to override the methods
- /// readFromDevice() or writeToDevice().
-{
-protected:
- typedef std::basic_streambuf<ch, tr> Base;
- typedef std::basic_ios<ch, tr> IOS;
- typedef ch char_type;
- typedef tr char_traits;
- typedef typename Base::int_type int_type;
- typedef typename Base::pos_type pos_type;
- typedef typename Base::off_type off_type;
- typedef typename IOS::openmode openmode;
-
-public:
- BasicUnbufferedStreamBuf():
- _pb(char_traits::eof()),
- _ispb(false)
- {
- this->setg(0, 0, 0);
- this->setp(0, 0);
- }
-
- ~BasicUnbufferedStreamBuf()
- {
- }
-
- virtual int_type overflow(int_type c)
- {
- if (c != char_traits::eof())
- return writeToDevice(char_traits::to_char_type(c));
- else
- return c;
- }
-
- virtual int_type underflow()
- {
- if (_ispb)
- {
- return _pb;
- }
- else
- {
- int_type c = readFromDevice();
- if (c != char_traits::eof())
- {
- _ispb = true;
- _pb = c;
- }
- return c;
- }
- }
-
- virtual int_type uflow()
- {
- if (_ispb)
- {
- _ispb = false;
- return _pb;
- }
- else
- {
- int_type c = readFromDevice();
- if (c != char_traits::eof())
- {
- _pb = c;
- }
- return c;
- }
- }
-
- virtual int_type pbackfail(int_type c)
- {
- if (_ispb)
- {
- return char_traits::eof();
- }
- else
- {
- _ispb = true;
- _pb = c;
- return c;
- }
- }
-
- virtual std::streamsize xsgetn(char_type* p, std::streamsize count)
- /// Some platforms (for example, Compaq C++) have buggy implementations of
- /// xsgetn that handle null buffers incorrectly.
- /// Anyway, it does not hurt to provide an optimized implementation
- /// of xsgetn for this streambuf implementation.
- {
- std::streamsize copied = 0;
- while (count > 0)
- {
- int_type c = uflow();
- if (c == char_traits::eof()) break;
- *p++ = char_traits::to_char_type(c);
- ++copied;
- --count;
- }
- return copied;
- }
-
-protected:
- static int_type charToInt(char_type c)
- {
- return char_traits::to_int_type(c);
- }
-
-private:
- virtual int_type readFromDevice()
- {
- return char_traits::eof();
- }
-
- virtual int_type writeToDevice(char_type)
- {
- return char_traits::eof();
- }
-
- int_type _pb;
- bool _ispb;
-
- BasicUnbufferedStreamBuf(const BasicUnbufferedStreamBuf&);
- BasicUnbufferedStreamBuf& operator = (const BasicUnbufferedStreamBuf&);
-};
-
-
-//
-// We provide an instantiation for char
-//
-typedef BasicUnbufferedStreamBuf<char, std::char_traits<char> > UnbufferedStreamBuf;
-
-
-} // namespace Poco
-
-
-#endif // Foundation_UnbufferedStreamBuf_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Unicode.h b/Utilities/Poco/Foundation/include/Poco/Unicode.h
deleted file mode 100755
index c6d99d55e2..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Unicode.h
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// Unicode.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: Unicode
-//
-// Definition of the Unicode class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_Unicode_INCLUDED
-#define Foundation_Unicode_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Unicode
- /// This class contains enumerations and static
- /// utility functions for dealing with Unicode characters
- /// and their properties.
- ///
- /// For more information on Unicode, see <http://www.unicode.org>.
- ///
- /// The implementation is based on the Unicode support
- /// functions in PCRE.
-{
-public:
- // Implementation note: the following definitions must be kept
- // in sync with those from ucp.h (PCRE).
- enum CharacterCategory
- /// Unicode 5.0 character categories.
- {
- UCP_OTHER,
- UCP_LETTER,
- UCP_MARK,
- UCP_NUMBER,
- UCP_PUNCTUATION,
- UCP_SYMBOL,
- UCP_SEPARATOR
- };
-
- enum CharacterType
- /// Unicode 5.0 character types.
- {
- UCP_CONTROL,
- UCP_FORMAT,
- UCP_UNASSIGNED,
- UCP_PRIVATE_USE,
- UCP_SURROGATE,
- UCP_LOWER_CASE_LETTER,
- UCP_MODIFIER_LETTER,
- UCP_OTHER_LETTER,
- UCP_TITLE_CASE_LETTER,
- UCP_UPPER_CASE_LETTER,
- UCP_SPACING_MARK,
- UCP_ENCLOSING_MARK,
- UCP_NON_SPACING_MARK,
- UCP_DECIMAL_NUMBER,
- UCP_LETTER_NUMBER,
- UCP_OTHER_NUMBER,
- UCP_CONNECTOR_PUNCTUATION,
- UCP_DASH_PUNCTUATION,
- UCP_CLOSE_PUNCTUATION,
- UCP_FINAL_PUNCTUATION,
- UCP_INITIAL_PUNCTUATION,
- UCP_OTHER_PUNCTUATION,
- UCP_OPEN_PUNCTUATION,
- UCP_CURRENCY_SYMBOL,
- UCP_MODIFIER_SYMBOL,
- UCP_MATHEMATICAL_SYMBOL,
- UCP_OTHER_SYMBOL,
- UCP_LINE_SEPARATOR,
- UCP_PARAGRAPH_SEPARATOR,
- UCP_SPACE_SEPARATOR
- };
-
- enum Script
- /// Unicode 5.0 scripts.
- {
- UCP_ARABIC,
- UCP_ARMENIAN,
- UCP_BENGALI,
- UCP_BOPOMOFO,
- UCP_BRAILLE,
- UCP_BUGINESE,
- UCP_BUHID,
- UCP_CANADIAN_ABORIGINAL,
- UCP_CHEROKEE,
- UCP_COMMON,
- UCP_COPTIC,
- UCP_CYPRIOT,
- UCP_CYRILLIC,
- UCP_DESERET,
- UCP_DEVANAGARI,
- UCP_ETHIOPIC,
- UCP_GEORGIAN,
- UCP_GLAGOLITIC,
- UCP_GOTHIC,
- UCP_GREEK,
- UCP_GUJARATI,
- UCP_GURMUKHI,
- UCP_HAN,
- UCP_HANGUL,
- UCP_HANUNOO,
- UCP_HEBREW,
- UCP_HIRAGANA,
- UCP_INHERITED,
- UCP_KANNADA,
- UCP_KATAKANA,
- UCP_KHAROSHTHI,
- UCP_KHMER,
- UCP_LAO,
- UCP_LATIN,
- UCP_LIMBU,
- UCP_LINEAR_B,
- UCP_MALAYALAM,
- UCP_MONGOLIAN,
- UCP_MYANMAR,
- UCP_NEW_TAI_LUE,
- UCP_OGHAM,
- UCP_OLD_ITALIC,
- UCP_OLD_PERSIAN,
- UCP_ORIYA,
- UCP_OSMANYA,
- UCP_RUNIC,
- UCP_SHAVIAN,
- UCP_SINHALA,
- UCP_SYLOTI_NAGRI,
- UCP_SYRIAC,
- UCP_TAGALOG,
- UCP_TAGBANWA,
- UCP_TAI_LE,
- UCP_TAMIL,
- UCP_TELUGU,
- UCP_THAANA,
- UCP_THAI,
- UCP_TIBETAN,
- UCP_TIFINAGH,
- UCP_UGARITIC,
- UCP_YI,
- UCP_BALINESE,
- UCP_CUNEIFORM,
- UCP_NKO,
- UCP_PHAGS_PA,
- UCP_PHOENICIAN,
- UCP_CARIAN,
- UCP_CHAM,
- UCP_KAYAH_LI,
- UCP_LEPCHA,
- UCP_LYCIAN,
- UCP_LYDIAN,
- UCP_OL_CHIKI,
- UCP_REJANG,
- UCP_SAURASHTRA,
- UCP_SUNDANESE,
- UCP_VAI
- };
-
- struct CharacterProperties
- /// This structure holds the character properties
- /// of an Unicode character.
- {
- CharacterCategory category;
- CharacterType type;
- Script script;
- };
-
- static void properties(int ch, CharacterProperties& props);
- /// Return the Unicode character properties for the
- /// character with the given Unicode value.
-
- static bool isLower(int ch);
- /// Returns true iff the given character is a lowercase
- /// character.
-
- static bool isUpper(int ch);
- /// Returns true iff the given character is an uppercase
- /// character.
-
- static int toLower(int ch);
- /// If the given character is an uppercase character,
- /// return its lowercase counterpart, otherwise return
- /// the character.
-
- static int toUpper(int ch);
- /// If the given character is a lowercase character,
- /// return its uppercase counterpart, otherwise return
- /// the character.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Unicode_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UnicodeConverter.h b/Utilities/Poco/Foundation/include/Poco/UnicodeConverter.h
deleted file mode 100755
index df2938f1aa..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UnicodeConverter.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// UnicodeConverter.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: UnicodeConverter
-//
-// Definition of the UnicodeConverter class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_UnicodeConverter_INCLUDED
-#define Foundation_UnicodeConverter_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API UnicodeConverter
- /// A convenience class that converts strings from
- /// UTF-8 encoded std::strings to UTF-16 encoded std::wstrings
- /// and vice-versa.
- ///
- /// This class is mainly used for working with the Unicode Windows APIs
- /// and probably won't be of much use anywhere else.
-{
-public:
- static void toUTF16(const std::string& utf8String, std::wstring& utf16String);
- /// Converts the given UTF-8 encoded string into an UTF-16 encoded wstring.
-
- static void toUTF16(const char* utf8String, int length, std::wstring& utf16String);
- /// Converts the given UTF-8 encoded character sequence into an UTF-16 encoded string.
-
- static void toUTF16(const char* utf8String, std::wstring& utf16String);
- /// Converts the given zero-terminated UTF-8 encoded character sequence into an UTF-16 encoded wstring.
-
- static void toUTF8(const std::wstring& utf16String, std::string& utf8String);
- /// Converts the given UTF-16 encoded wstring into an UTF-8 encoded string.
-
- static void toUTF8(const wchar_t* utf16String, int length, std::string& utf8String);
- /// Converts the given zero-terminated UTF-16 encoded wide character sequence into an UTF-8 encoded wstring.
-
- static void toUTF8(const wchar_t* utf16String, std::string& utf8String);
- /// Converts the given UTF-16 encoded zero terminated character sequence into an UTF-8 encoded string.
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_UnicodeConverter_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UniqueAccessExpireCache.h b/Utilities/Poco/Foundation/include/Poco/UniqueAccessExpireCache.h
deleted file mode 100755
index eaaf44855a..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UniqueAccessExpireCache.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// UniqueAccessExpireCache.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: UniqueAccessExpireCache
-//
-// Definition of the UniqueAccessExpireCache class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_UniqueAccessExpireCache_INCLUDED
-#define Foundation_UniqueAccessExpireCache_INCLUDED
-
-
-#include "Poco/AbstractCache.h"
-#include "Poco/UniqueAccessExpireStrategy.h"
-
-
-namespace Poco {
-
-
-template <class TKey, class TValue>
-class UniqueAccessExpireCache: public AbstractCache<TKey, TValue, UniqueAccessExpireStrategy<TKey, TValue> >
- /// An UniqueAccessExpireCache caches entries for a given time span. In contrast
- /// to ExpireCache which only allows to set a per cache expiration value, it allows to define
- /// expiration per CacheEntry.
- /// Each TValue object must thus offer the following method:
- ///
- /// const Poco::Timespan& getTimeout() const;
- ///
- /// which returns the relative timespan for how long the entry should be valid without being accessed!
- /// The absolute expire timepoint is calculated as now() + getTimeout().
- /// Accessing an object will update this absolute expire timepoint.
- /// You can use the Poco::AccessExpirationDecorator to add the getExpiration
- /// method to values that do not have a getExpiration function.
- ///
- /// Be careful when using an UniqueAccessExpireCache. A cache is often used
- /// like cache.has(x) followed by cache.get x). Note that it could happen
- /// that the "has" call works, then the current execution thread gets descheduled, time passes,
- /// the entry gets invalid, thus leading to an empty SharedPtr being returned
- /// when "get" is invoked.
-{
-public:
- UniqueAccessExpireCache():
- AbstractCache<TKey, TValue, UniqueAccessExpireStrategy<TKey, TValue> >(UniqueAccessExpireStrategy<TKey, TValue>())
- {
- }
-
- ~UniqueAccessExpireCache()
- {
- }
-
-private:
- UniqueAccessExpireCache(const UniqueAccessExpireCache& aCache);
- UniqueAccessExpireCache& operator = (const UniqueAccessExpireCache& aCache);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_UniqueAccessExpireCache_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UniqueAccessExpireLRUCache.h b/Utilities/Poco/Foundation/include/Poco/UniqueAccessExpireLRUCache.h
deleted file mode 100755
index 4a06574f1c..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UniqueAccessExpireLRUCache.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// UniqueAccessExpireLRUCache.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: UniqueAccessExpireLRUCache
-//
-// Definition of the UniqueAccessExpireLRUCache class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_UniqueAccessExpireLRUCache_INCLUDED
-#define Foundation_UniqueAccessExpireLRUCache_INCLUDED
-
-
-#include "Poco/AbstractCache.h"
-#include "Poco/StrategyCollection.h"
-#include "Poco/UniqueAccessExpireStrategy.h"
-#include "Poco/LRUStrategy.h"
-
-
-namespace Poco {
-
-
-template <
- class TKey,
- class TValue
->
-class UniqueAccessExpireLRUCache: public AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue> >
- /// A UniqueAccessExpireLRUCache combines LRU caching and time based per entry expire caching.
- /// One can define for each cache entry a seperate timepoint
- /// but also limit the size of the cache (per default: 1024).
- /// Each TValue object must thus offer the following method:
- ///
- /// const Poco::Timespan& getTimeout() const;
- ///
- /// which returns the relative timespan for how long the entry should be valid without being accessed!
- /// The absolute expire timepoint is calculated as now() + getTimeout().
- /// Accessing an object will update this absolute expire timepoint.
- /// You can use the Poco::AccessExpirationDecorator to add the getExpiration
- /// method to values that do not have a getExpiration function.
-{
-public:
- UniqueAccessExpireLRUCache(long cacheSize = 1024):
- AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue> >(StrategyCollection<TKey, TValue>())
- {
- this->_strategy.pushBack(new LRUStrategy<TKey, TValue>(cacheSize));
- this->_strategy.pushBack(new UniqueAccessExpireStrategy<TKey, TValue>());
- }
-
- ~UniqueAccessExpireLRUCache()
- {
- }
-
-private:
- UniqueAccessExpireLRUCache(const UniqueAccessExpireLRUCache& aCache);
- UniqueAccessExpireLRUCache& operator = (const UniqueAccessExpireLRUCache& aCache);
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_UniqueAccessExpireLRUCache_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UniqueAccessExpireStrategy.h b/Utilities/Poco/Foundation/include/Poco/UniqueAccessExpireStrategy.h
deleted file mode 100755
index ec877335f1..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UniqueAccessExpireStrategy.h
+++ /dev/null
@@ -1,178 +0,0 @@
-//
-// UniqueAccessExpireStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: UniqueAccessExpireStrategy
-//
-// Definition of the UniqueAccessExpireStrategy class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_UniqueAccessExpireStrategy_INCLUDED
-#define Foundation_UniqueAccessExpireStrategy_INCLUDED
-
-
-#include "Poco/KeyValueArgs.h"
-#include "Poco/ValidArgs.h"
-#include "Poco/AbstractStrategy.h"
-#include "Poco/Bugcheck.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Timespan.h"
-#include "Poco/EventArgs.h"
-#include "Poco/UniqueExpireStrategy.h"
-#include <set>
-#include <map>
-
-
-namespace Poco {
-
-
-template <
- class TKey,
- class TValue
->
-class UniqueAccessExpireStrategy: public AbstractStrategy<TKey, TValue>
- /// An UniqueExpireStrategy implements time based expiration of cache entries. In contrast
- /// to ExpireStrategy which only allows to set a per cache expiration value, it allows to define
- /// expiration per CacheEntry.
- /// Each TValue object must thus offer the following method:
- ///
- /// const Poco::Timestamp& getTimeout() const;
- ///
- /// which returns the timespan for how long an object will be valid without being accessed.
-{
-public:
- typedef std::pair<TKey, Timespan> KeyExpire;
- typedef std::multimap<Timestamp, KeyExpire> TimeIndex;
- typedef typename TimeIndex::iterator IndexIterator;
- typedef typename TimeIndex::const_iterator ConstIndexIterator;
- typedef std::map<TKey, IndexIterator> Keys;
- typedef typename Keys::iterator Iterator;
-
-public:
- UniqueAccessExpireStrategy()
- /// Create an unique expire strategy.
- {
- }
-
- ~UniqueAccessExpireStrategy()
- {
- }
-
- void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args)
- {
- // the expire value defines how many millisecs in the future the
- // value will expire, even insert negative values!
- Timestamp expire;
- expire += args.value().getTimeout().totalMicroseconds();
-
- IndexIterator it = _keyIndex.insert(std::make_pair(expire, std::make_pair(args.key(), args.value().getTimeout())));
- std::pair<Iterator, bool> stat = _keys.insert(std::make_pair(args.key(), it));
- if (!stat.second)
- {
- _keyIndex.erase(stat.first->second);
- stat.first->second = it;
- }
- }
-
- void onRemove(const void*, const TKey& key)
- {
- Iterator it = _keys.find(key);
- if (it != _keys.end())
- {
- _keyIndex.erase(it->second);
- _keys.erase(it);
- }
- }
-
- void onGet(const void*, const TKey& key)
- {
- // get updates the expiration time stamp
- Iterator it = _keys.find(key);
- if (it != _keys.end())
- {
- KeyExpire ke = it->second->second;
- // gen new absolute expire value
- Timestamp expire;
- expire += ke.second.totalMicroseconds();
- // delete old index
- _keyIndex.erase(it->second);
- IndexIterator itt = _keyIndex.insert(std::make_pair(expire, ke));
- // update iterator
- it->second = itt;
- }
- }
-
- void onClear(const void*, const EventArgs& args)
- {
- _keys.clear();
- _keyIndex.clear();
- }
-
- void onIsValid(const void*, ValidArgs<TKey>& args)
- {
- Iterator it = _keys.find(args.key());
- if (it != _keys.end())
- {
- Timestamp now;
- if (it->second->first <= now)
- {
- args.invalidate();
- }
- }
- else //not found: probably removed by onReplace
- args.invalidate();
- }
-
- void onReplace(const void*, std::set<TKey>& elemsToRemove)
- {
- // Note: replace only informs the cache which elements
- // it would like to remove!
- // it does not remove them on its own!
- IndexIterator it = _keyIndex.begin();
- Timestamp now;
- while (it != _keyIndex.end() && it->first < now)
- {
- elemsToRemove.insert(it->second.first);
- ++it;
- }
- }
-
-protected:
- Keys _keys; /// For faster replacement of keys, the iterator points to the _keyIndex map
- TimeIndex _keyIndex; /// Maps time to key value
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_UniqueAccessExpireStrategy_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/UniqueExpireCache.h b/Utilities/Poco/Foundation/include/Poco/UniqueExpireCache.h
deleted file mode 100755
index 424ef56234..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UniqueExpireCache.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// UniqueExpireCache.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: UniqueExpireCache
-//
-// Definition of the UniqueExpireCache class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_UniqueExpireCache_INCLUDED
-#define Foundation_UniqueExpireCache_INCLUDED
-
-
-#include "Poco/AbstractCache.h"
-#include "Poco/UniqueExpireStrategy.h"
-
-
-namespace Poco {
-
-
-template <class TKey, class TValue>
-class UniqueExpireCache: public AbstractCache<TKey, TValue, UniqueExpireStrategy<TKey, TValue> >
- /// An UniqueExpireCache caches entries for a given time amount. In contrast
- /// to ExpireCache which only allows to set a per cache expiration value, it allows to define
- /// expiration per CacheEntry.
- /// Each TValue object must thus offer the following method:
- ///
- /// const Poco::Timestamp& getExpiration() const;
- ///
- /// which returns the absolute timepoint when the entry will be invalidated.
- /// Accessing an object will NOT update this absolute expire timepoint.
- /// You can use the Poco::ExpirationDecorator to add the getExpiration
- /// method to values that do not have a getExpiration function.
- ///
- /// Be careful when using an UniqueExpireCache. A cache is often used
- /// like cache.has(x) followed by cache.get x). Note that it could happen
- /// that the "has" call works, then the current execution thread gets descheduled, time passes,
- /// the entry gets invalid, thus leading to an empty SharedPtr being returned
- /// when "get" is invoked.
-{
-public:
- UniqueExpireCache():
- AbstractCache<TKey, TValue, UniqueExpireStrategy<TKey, TValue> >(UniqueExpireStrategy<TKey, TValue>())
- {
- }
-
- ~UniqueExpireCache()
- {
- }
-
-private:
- UniqueExpireCache(const UniqueExpireCache& aCache);
- UniqueExpireCache& operator = (const UniqueExpireCache& aCache);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/UniqueExpireLRUCache.h b/Utilities/Poco/Foundation/include/Poco/UniqueExpireLRUCache.h
deleted file mode 100755
index 3ba65fd6a2..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UniqueExpireLRUCache.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// UniqueExpireLRUCache.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: UniqueExpireLRUCache
-//
-// Definition of the UniqueExpireLRUCache class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_UniqueExpireLRUCache_INCLUDED
-#define Foundation_UniqueExpireLRUCache_INCLUDED
-
-
-#include "Poco/AbstractCache.h"
-#include "Poco/StrategyCollection.h"
-#include "Poco/UniqueExpireStrategy.h"
-#include "Poco/LRUStrategy.h"
-
-
-namespace Poco {
-
-
-template <
- class TKey,
- class TValue
->
-class UniqueExpireLRUCache: public AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue> >
- /// A UniqueExpireLRUCache combines LRU caching and time based per entry expire caching.
- /// One can define for each cache entry a seperate timepoint
- /// but also limit the size of the cache (per default: 1024).
- /// Each TValue object must thus offer the following method:
- ///
- /// const Poco::Timestamp& getExpiration() const;
- ///
- /// which returns the absolute timepoint when the entry will be invalidated.
- /// Accessing an object will NOT update this absolute expire timepoint.
- /// You can use the Poco::ExpirationDecorator to add the getExpiration
- /// method to values that do not have a getExpiration function.
-{
-public:
- UniqueExpireLRUCache(long cacheSize = 1024):
- AbstractCache<TKey, TValue, StrategyCollection<TKey, TValue> >(StrategyCollection<TKey, TValue>())
- {
- this->_strategy.pushBack(new LRUStrategy<TKey, TValue>(cacheSize));
- this->_strategy.pushBack(new UniqueExpireStrategy<TKey, TValue>());
- }
-
- ~UniqueExpireLRUCache()
- {
- }
-
-private:
- UniqueExpireLRUCache(const UniqueExpireLRUCache& aCache);
- UniqueExpireLRUCache& operator = (const UniqueExpireLRUCache& aCache);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/UniqueExpireStrategy.h b/Utilities/Poco/Foundation/include/Poco/UniqueExpireStrategy.h
deleted file mode 100755
index 2aa87a0976..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/UniqueExpireStrategy.h
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// UniqueExpireStrategy.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: UniqueExpireStrategy
-//
-// Definition of the UniqueExpireStrategy class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_UniqueExpireStrategy_INCLUDED
-#define Foundation_UniqueExpireStrategy_INCLUDED
-
-
-#include "Poco/KeyValueArgs.h"
-#include "Poco/ValidArgs.h"
-#include "Poco/AbstractStrategy.h"
-#include "Poco/Bugcheck.h"
-#include "Poco/Timestamp.h"
-#include "Poco/EventArgs.h"
-#include <set>
-#include <map>
-
-
-namespace Poco {
-
-
-template <
- class TKey,
- class TValue
->
-class UniqueExpireStrategy: public AbstractStrategy<TKey, TValue>
- /// An UniqueExpireStrategy implements time based expiration of cache entries. In contrast
- /// to ExpireStrategy which only allows to set a per cache expiration value, it allows to define
- /// expiration per CacheEntry.
- /// Each TValue object must thus offer the following method:
- ///
- /// const Poco::Timestamp& getExpiration() const;
- ///
- /// which returns the absolute timepoint when the entry will be invalidated.
-{
-public:
- typedef std::multimap<Timestamp, TKey> TimeIndex;
- typedef typename TimeIndex::iterator IndexIterator;
- typedef typename TimeIndex::const_iterator ConstIndexIterator;
- typedef std::map<TKey, IndexIterator> Keys;
- typedef typename Keys::iterator Iterator;
-
-public:
- UniqueExpireStrategy()
- /// Create an unique expire strategy.
- {
- }
-
- ~UniqueExpireStrategy()
- {
- }
-
- void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args)
- {
- // note: we have to insert even if the expire timepoint is in the past (for StrategyCollection classes to avoid inconsistency with LRU)
- // no problem: will be removed with next get
- const Timestamp& expire = args.value().getExpiration();
- IndexIterator it = _keyIndex.insert(std::make_pair(expire, args.key()));
- std::pair<Iterator, bool> stat = _keys.insert(std::make_pair(args.key(), it));
- if (!stat.second)
- {
- _keyIndex.erase(stat.first->second);
- stat.first->second = it;
- }
- }
-
- void onRemove(const void*, const TKey& key)
- {
- Iterator it = _keys.find(key);
- if (it != _keys.end())
- {
- _keyIndex.erase(it->second);
- _keys.erase(it);
- }
- }
-
- void onGet(const void*, const TKey& key)
- {
- // get triggers no changes in an expire
- }
-
- void onClear(const void*, const EventArgs& args)
- {
- _keys.clear();
- _keyIndex.clear();
- }
-
- void onIsValid(const void*, ValidArgs<TKey>& args)
- {
- Iterator it = _keys.find(args.key());
- if (it != _keys.end())
- {
- Timestamp now;
- if (it->second->first <= now)
- {
- args.invalidate();
- }
- }
- else //not found: probably removed by onReplace
- args.invalidate();
- }
-
- void onReplace(const void*, std::set<TKey>& elemsToRemove)
- {
- // Note: replace only informs the cache which elements
- // it would like to remove!
- // it does not remove them on its own!
- IndexIterator it = _keyIndex.begin();
- Timestamp now;
- while (it != _keyIndex.end() && it->first < now)
- {
- elemsToRemove.insert(it->second);
- ++it;
- }
- }
-
-protected:
- Keys _keys; /// For faster replacement of keys, the iterator points to the _keyIndex map
- TimeIndex _keyIndex; /// Maps time to key value
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/ValidArgs.h b/Utilities/Poco/Foundation/include/Poco/ValidArgs.h
deleted file mode 100755
index f9eab98184..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/ValidArgs.h
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// ValidArgs.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Cache
-// Module: ValidArgs
-//
-// Definition of the ValidArgs class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Foundation_ValidArgs_INCLUDED
-#define Foundation_ValidArgs_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-template <class TKey>
-class ValidArgs
-{
-public:
- ValidArgs(const TKey& key):
- _key(key),
- _isValid(true)
- {
- }
-
- ValidArgs(const ValidArgs& args):
- _key(args._key),
- _isValid(args._isValid)
- {
- }
-
- ~ValidArgs()
- {
- }
-
- const TKey& key() const
- {
- return _key;
- }
-
- bool isValid() const
- {
- return _isValid;
- }
-
- void invalidate()
- {
- _isValid = false;
- }
-
-protected:
- const TKey& _key;
- bool _isValid;
-
-private:
- ValidArgs& operator = (const ValidArgs& args);
-};
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/include/Poco/Void.h b/Utilities/Poco/Foundation/include/Poco/Void.h
deleted file mode 100755
index d1189b0975..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Void.h
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// Void.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Void
-//
-// Definition of the Void class.
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Redistributions in any form must be accompanied by information on
-// how to obtain complete source code for this software and any
-// accompanying software that uses this software. The source code
-// must either be included in the distribution or be available for no
-// more than the cost of distribution plus a nominal fee, and must be
-// freely redistributable under reasonable conditions. For an
-// executable file, complete source code means the source code for all
-// modules it contains. It does not include source code for modules or
-// files that typically accompany the major components of the operating
-// system on which the executable file runs.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#ifndef Foundation_Void_INCLUDED
-#define Foundation_Void_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Void
- /// A dummy class with value-type semantics,
- /// mostly useful as a template argument.
- ///
- /// This class is typically used together with ActiveMethod,
- /// if no argument or return value is needed.
-{
-public:
- Void();
- /// Creates the Void.
-
- Void(const Void& v);
- /// Creates the Void from another Void.
- ///
- /// The philosophical aspects of this operation
- /// remain undiscussed for now.
-
- ~Void();
- /// Destroys the Void.
-
- Void& operator = (const Void& v);
- /// Assigns another void.
-
- bool operator ==(const Void& v) const;
- /// Will return always true due to Voids having no members.
-
- bool operator !=(const Void& v) const;
- /// Will return always false due to Voids having no members.
-};
-
-
-inline bool Void::operator ==(const Void& v) const
-{
- return true;
-}
-
-
-inline bool Void::operator !=(const Void& v) const
-{
- return false;
-}
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Void_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/Windows1252Encoding.h b/Utilities/Poco/Foundation/include/Poco/Windows1252Encoding.h
deleted file mode 100755
index 5192289e9f..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/Windows1252Encoding.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// Windows1252Encoding.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: Windows1252Encoding
-//
-// Definition of the Windows1252Encoding class.
-//
-// Copyright (c) 2005-2007, 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.
-//
-
-
-#ifndef Foundation_Windows1252Encoding_INCLUDED
-#define Foundation_Windows1252Encoding_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/TextEncoding.h"
-
-
-namespace Poco {
-
-
-class Foundation_API Windows1252Encoding: public TextEncoding
- /// Windows Codepage 1252 text encoding.
-{
-public:
- Windows1252Encoding();
- ~Windows1252Encoding();
- const char* canonicalName() const;
- bool isA(const std::string& encodingName) const;
- const CharacterMap& characterMap() const;
- int convert(const unsigned char* bytes) const;
- int convert(int ch, unsigned char* bytes, int length) const;
-
-private:
- static const char* _names[];
- static const CharacterMap _charMap;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_Windows1252Encoding_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/WindowsConsoleChannel.h b/Utilities/Poco/Foundation/include/Poco/WindowsConsoleChannel.h
deleted file mode 100755
index 50148e05b7..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/WindowsConsoleChannel.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// WindowsConsoleChannel.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: WindowsConsoleChannel
-//
-// Definition of the WindowsConsoleChannel class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Foundation_WindowsConsoleChannel_INCLUDED
-#define Foundation_WindowsConsoleChannel_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Channel.h"
-#include "Poco/Mutex.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class Foundation_API WindowsConsoleChannel: public Channel
- /// A channel that writes to the Windows console.
- ///
- /// Only the message's text is written, followed
- /// by a newline.
- ///
- /// If POCO has been compiled with POCO_WIN32_UTF8,
- /// log messages are assumed to be UTF-8 encoded, and
- /// are converted to UTF-16 prior to writing them to the
- /// console. This is the main difference to the ConsoleChannel
- /// class, which cannot handle UTF-8 encoded messages on Windows.
- ///
- /// Chain this channel to a FormattingChannel with an
- /// appropriate Formatter to control what is contained
- /// in the text.
- ///
- /// Only available on Windows platforms.
-{
-public:
- WindowsConsoleChannel();
- /// Creates the WindowsConsoleChannel.
-
- void log(const Message& msg);
- /// Logs the given message to the channel's stream.
-
-protected:
- ~WindowsConsoleChannel();
-
-private:
- HANDLE _hConsole;
- bool _isFile;
-};
-
-
-} // namespace Poco
-
-
-#endif // Foundation_WindowsConsoleChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/include/Poco/zconf.h b/Utilities/Poco/Foundation/include/Poco/zconf.h
deleted file mode 100755
index 03a9431c8b..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/zconf.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZCONF_H
-#define ZCONF_H
-
-/*
- * If you *really* need a unique prefix for all types and library functions,
- * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
- */
-#ifdef Z_PREFIX
-# define deflateInit_ z_deflateInit_
-# define deflate z_deflate
-# define deflateEnd z_deflateEnd
-# define inflateInit_ z_inflateInit_
-# define inflate z_inflate
-# define inflateEnd z_inflateEnd
-# define deflateInit2_ z_deflateInit2_
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateCopy z_deflateCopy
-# define deflateReset z_deflateReset
-# define deflateParams z_deflateParams
-# define deflateBound z_deflateBound
-# define deflatePrime z_deflatePrime
-# define inflateInit2_ z_inflateInit2_
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateCopy z_inflateCopy
-# define inflateReset z_inflateReset
-# define inflateBack z_inflateBack
-# define inflateBackEnd z_inflateBackEnd
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
-# define uncompress z_uncompress
-# define adler32 z_adler32
-# define crc32 z_crc32
-# define get_crc_table z_get_crc_table
-# define zError z_zError
-
-# define alloc_func z_alloc_func
-# define free_func z_free_func
-# define in_func z_in_func
-# define out_func z_out_func
-# define Byte z_Byte
-# define uInt z_uInt
-# define uLong z_uLong
-# define Bytef z_Bytef
-# define charf z_charf
-# define intf z_intf
-# define uIntf z_uIntf
-# define uLongf z_uLongf
-# define voidpf z_voidpf
-# define voidp z_voidp
-#endif
-
-#if defined(__MSDOS__) && !defined(MSDOS)
-# define MSDOS
-#endif
-#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
-# define OS2
-#endif
-#if defined(_WINDOWS) && !defined(WINDOWS)
-# define WINDOWS
-#endif
-#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
-# ifndef WIN32
-# define WIN32
-# endif
-#endif
-#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
-# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
-# ifndef SYS16BIT
-# define SYS16BIT
-# endif
-# endif
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#ifdef SYS16BIT
-# define MAXSEG_64K
-#endif
-#ifdef MSDOS
-# define UNALIGNED_OK
-#endif
-
-#ifdef __STDC_VERSION__
-# ifndef STDC
-# define STDC
-# endif
-# if __STDC_VERSION__ >= 199901L
-# ifndef STDC99
-# define STDC99
-# endif
-# endif
-#endif
-#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
-# define STDC
-#endif
-
-#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
-# define STDC
-#endif
-
-#ifndef STDC
-# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-# define const /* note: need a more gentle solution here */
-# endif
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
-# define NO_DUMMY_DECL
-#endif
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-# ifdef MAXSEG_64K
-# define MAX_MEM_LEVEL 8
-# else
-# define MAX_MEM_LEVEL 9
-# endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-# define MAX_WBITS 15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
- (1 << (windowBits+2)) + (1 << (memLevel+9))
- that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
- make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
- The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
- /* Type declarations */
-
-#ifndef OF /* function prototypes */
-# ifdef STDC
-# define OF(args) args
-# else
-# define OF(args) ()
-# endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#ifdef SYS16BIT
-# if defined(M_I86SM) || defined(M_I86MM)
- /* MSC small or medium model */
-# define SMALL_MEDIUM
-# ifdef _MSC_VER
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-# if (defined(__SMALL__) || defined(__MEDIUM__))
- /* Turbo C small or medium model */
-# define SMALL_MEDIUM
-# ifdef __BORLANDC__
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
- /* If building or using zlib as a DLL, define ZLIB_DLL.
- * This is not mandatory, but it offers a little performance increase.
- */
-# ifdef ZLIB_DLL
-# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-# ifdef ZLIB_INTERNAL
-# define ZEXTERN extern __declspec(dllexport)
-# else
-# define ZEXTERN extern __declspec(dllimport)
-# endif
-# endif
-# endif /* ZLIB_DLL */
- /* If building or using zlib with the WINAPI/WINAPIV calling convention,
- * define ZLIB_WINAPI.
- * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
- */
-# ifdef ZLIB_WINAPI
-# ifdef FAR
-# undef FAR
-# endif
-# include <windows.h>
- /* No need for _export, use ZLIB.DEF instead. */
- /* For complete Windows compatibility, use WINAPI, not __stdcall. */
-# define ZEXPORT WINAPI
-# ifdef WIN32
-# define ZEXPORTVA WINAPIV
-# else
-# define ZEXPORTVA FAR CDECL
-# endif
-# endif
-#endif
-
-#if defined (__BEOS__)
-# ifdef ZLIB_DLL
-# ifdef ZLIB_INTERNAL
-# define ZEXPORT __declspec(dllexport)
-# define ZEXPORTVA __declspec(dllexport)
-# else
-# define ZEXPORT __declspec(dllimport)
-# define ZEXPORTVA __declspec(dllimport)
-# endif
-# endif
-#endif
-
-#ifndef ZEXTERN
-# define ZEXTERN extern
-#endif
-#ifndef ZEXPORT
-# define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-# define ZEXPORTVA
-#endif
-
-#ifndef FAR
-# define FAR
-#endif
-
-#if !defined(__MACTYPES__)
-typedef unsigned char Byte; /* 8 bits */
-#endif
-typedef unsigned int uInt; /* 16 bits or more */
-typedef unsigned long uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
- /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-# define Bytef Byte FAR
-#else
- typedef Byte FAR Bytef;
-#endif
-typedef char FAR charf;
-typedef int FAR intf;
-typedef uInt FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
- typedef void const *voidpc;
- typedef void FAR *voidpf;
- typedef void *voidp;
-#else
- typedef Byte const *voidpc;
- typedef Byte FAR *voidpf;
- typedef Byte *voidp;
-#endif
-
-#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
-# include <sys/types.h> /* for off_t */
-# include <unistd.h> /* for SEEK_* and off_t */
-# ifdef VMS
-# include <unixio.h> /* for off_t */
-# endif
-# define z_off_t off_t
-#endif
-#ifndef SEEK_SET
-# define SEEK_SET 0 /* Seek from beginning of file. */
-# define SEEK_CUR 1 /* Seek from current position. */
-# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
-#endif
-#ifndef z_off_t
-# define z_off_t long
-#endif
-
-#if defined(__OS400__)
-# define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-# define NO_vsnprintf
-# ifdef FAR
-# undef FAR
-# endif
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
-# pragma map(deflateInit_,"DEIN")
-# pragma map(deflateInit2_,"DEIN2")
-# pragma map(deflateEnd,"DEEND")
-# pragma map(deflateBound,"DEBND")
-# pragma map(inflateInit_,"ININ")
-# pragma map(inflateInit2_,"ININ2")
-# pragma map(inflateEnd,"INEND")
-# pragma map(inflateSync,"INSY")
-# pragma map(inflateSetDictionary,"INSEDI")
-# pragma map(compressBound,"CMBND")
-# pragma map(inflate_table,"INTABL")
-# pragma map(inflate_fast,"INFA")
-# pragma map(inflate_copyright,"INCOPY")
-#endif
-
-#endif /* ZCONF_H */
diff --git a/Utilities/Poco/Foundation/include/Poco/zlib.h b/Utilities/Poco/Foundation/include/Poco/zlib.h
deleted file mode 100755
index 022817927c..0000000000
--- a/Utilities/Poco/Foundation/include/Poco/zlib.h
+++ /dev/null
@@ -1,1357 +0,0 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.3, July 18th, 2005
-
- Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly Mark Adler
- jloup@gzip.org madler@alumni.caltech.edu
-
-
- The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
- (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-*/
-
-#ifndef ZLIB_H
-#define ZLIB_H
-
-#include "zconf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.2.3"
-#define ZLIB_VERNUM 0x1230
-
-/*
- The 'zlib' compression library provides in-memory compression and
- decompression functions, including integrity checks of the uncompressed
- data. This version of the library supports only one compression method
- (deflation) but other algorithms will be added later and will have the same
- stream interface.
-
- Compression can be done in a single step if the buffers are large
- enough (for example if an input file is mmap'ed), or can be done by
- repeated calls of the compression function. In the latter case, the
- application must provide more input and/or consume the output
- (providing more output space) before each call.
-
- The compressed data format used by default by the in-memory functions is
- the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
- around a deflate stream, which is itself documented in RFC 1951.
-
- The library also supports reading and writing files in gzip (.gz) format
- with an interface similar to that of stdio using the functions that start
- with "gz". The gzip format is different from the zlib format. gzip is a
- gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
-
- This library can optionally read and write gzip streams in memory as well.
-
- The zlib format was designed to be compact and fast for use in memory
- and on communications channels. The gzip format was designed for single-
- file compression on file systems, has a larger header than zlib to maintain
- directory information, and uses a different, slower check method than zlib.
-
- The library does not install any signal handler. The decoder checks
- the consistency of the compressed data, so the library should never
- crash even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void (*free_func) OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
- Bytef *next_in; /* next input byte */
- uInt avail_in; /* number of bytes available at next_in */
- uLong total_in; /* total nb of input bytes read so far */
-
- Bytef *next_out; /* next output byte should be put there */
- uInt avail_out; /* remaining free space at next_out */
- uLong total_out; /* total nb of bytes output so far */
-
- char *msg; /* last error message, NULL if no error */
- struct internal_state FAR *state; /* not visible by applications */
-
- alloc_func zalloc; /* used to allocate the internal state */
- free_func zfree; /* used to free the internal state */
- voidpf opaque; /* private data object passed to zalloc and zfree */
-
- int data_type; /* best guess about the data type: binary or text */
- uLong adler; /* adler32 value of the uncompressed data */
- uLong reserved; /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
- gzip header information passed to and from zlib routines. See RFC 1952
- for more details on the meanings of these fields.
-*/
-typedef struct gz_header_s {
- int text; /* true if compressed data believed to be text */
- uLong time; /* modification time */
- int xflags; /* extra flags (not used when writing a gzip file) */
- int os; /* operating system */
- Bytef *extra; /* pointer to extra field or Z_NULL if none */
- uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
- uInt extra_max; /* space at extra (only when reading header) */
- Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
- uInt name_max; /* space at name (only when reading header) */
- Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
- uInt comm_max; /* space at comment (only when reading header) */
- int hcrc; /* true if there was or will be a header crc */
- int done; /* true when done reading gzip header (not used
- when writing a gzip file) */
-} gz_header;
-
-typedef gz_header FAR *gz_headerp;
-
-/*
- The application must update next_in and avail_in when avail_in has
- dropped to zero. It must update next_out and avail_out when avail_out
- has dropped to zero. The application must initialize zalloc, zfree and
- opaque before calling the init function. All other fields are set by the
- compression library and must not be updated by the application.
-
- The opaque value provided by the application will be passed as the first
- parameter for calls of zalloc and zfree. This can be useful for custom
- memory management. The compression library attaches no meaning to the
- opaque value.
-
- zalloc must return Z_NULL if there is not enough memory for the object.
- If zlib is used in a multi-threaded application, zalloc and zfree must be
- thread safe.
-
- On 16-bit systems, the functions zalloc and zfree must be able to allocate
- exactly 65536 bytes, but will not be required to allocate more than this
- if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
- pointers returned by zalloc for objects of exactly 65536 bytes *must*
- have their offset normalized to zero. The default allocation function
- provided by this library ensures this (see zutil.c). To reduce memory
- requirements and avoid any allocation of 64K objects, at the expense of
- compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
-
- The fields total_in and total_out can be used for statistics or
- progress reports. After compression, total_in holds the total size of
- the uncompressed data and may be saved for use in the decompressor
- (particularly if the decompressor wants to decompress everything in
- a single step).
-*/
-
- /* constants */
-
-#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
-#define Z_SYNC_FLUSH 2
-#define Z_FULL_FLUSH 3
-#define Z_FINISH 4
-#define Z_BLOCK 5
-/* Allowed flush values; see deflate() and inflate() below for details */
-
-#define Z_OK 0
-#define Z_STREAM_END 1
-#define Z_NEED_DICT 2
-#define Z_ERRNO (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR (-3)
-#define Z_MEM_ERROR (-4)
-#define Z_BUF_ERROR (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative
- * values are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION 0
-#define Z_BEST_SPEED 1
-#define Z_BEST_COMPRESSION 9
-#define Z_DEFAULT_COMPRESSION (-1)
-/* compression levels */
-
-#define Z_FILTERED 1
-#define Z_HUFFMAN_ONLY 2
-#define Z_RLE 3
-#define Z_FIXED 4
-#define Z_DEFAULT_STRATEGY 0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY 0
-#define Z_TEXT 1
-#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
-#define Z_UNKNOWN 2
-/* Possible values of the data_type field (though see inflate()) */
-
-#define Z_DEFLATED 8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
- /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
- If the first character differs, the library code actually used is
- not compatible with the zlib.h header file used by the application.
- This check is automatically made by deflateInit and inflateInit.
- */
-
-/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
- Initializes the internal stream state for compression. The fields
- zalloc, zfree and opaque must be initialized before by the caller.
- If zalloc and zfree are set to Z_NULL, deflateInit updates them to
- use default allocation functions.
-
- The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
- 1 gives best speed, 9 gives best compression, 0 gives no compression at
- all (the input data is simply copied a block at a time).
- Z_DEFAULT_COMPRESSION requests a default compromise between speed and
- compression (currently equivalent to level 6).
-
- deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if level is not a valid compression level,
- Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
- with the version assumed by the caller (ZLIB_VERSION).
- msg is set to null if there is no error message. deflateInit does not
- perform any compression: this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
- deflate compresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce some
- output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. deflate performs one or both of the
- following actions:
-
- - Compress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in and avail_in are updated and
- processing will resume at this point for the next call of deflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. This action is forced if the parameter flush is non zero.
- Forcing flush frequently degrades the compression ratio, so this parameter
- should be set only when necessary (in interactive applications).
- Some output may be provided even if flush is not set.
-
- Before the call of deflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating avail_in or avail_out accordingly; avail_out
- should never be zero before the call. The application can consume the
- compressed output when it wants, for example when the output buffer is full
- (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
- and with zero avail_out, it must be called again after making room in the
- output buffer because there might be more output pending.
-
- Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
- decide how much data to accumualte before producing output, in order to
- maximize compression.
-
- If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
- flushed to the output buffer and the output is aligned on a byte boundary, so
- that the decompressor can get all input data available so far. (In particular
- avail_in is zero after the call if enough output space has been provided
- before the call.) Flushing may degrade compression for some compression
- algorithms and so it should be used only when necessary.
-
- If flush is set to Z_FULL_FLUSH, all output is flushed as with
- Z_SYNC_FLUSH, and the compression state is reset so that decompression can
- restart from this point if previous compressed data has been damaged or if
- random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
- compression.
-
- If deflate returns with avail_out == 0, this function must be called again
- with the same value of the flush parameter and more output space (updated
- avail_out), until the flush is complete (deflate returns with non-zero
- avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
- avail_out is greater than six to avoid repeated flush markers due to
- avail_out == 0 on return.
-
- If the parameter flush is set to Z_FINISH, pending input is processed,
- pending output is flushed and deflate returns with Z_STREAM_END if there
- was enough output space; if deflate returns with Z_OK, this function must be
- called again with Z_FINISH and more output space (updated avail_out) but no
- more input data, until it returns with Z_STREAM_END or an error. After
- deflate has returned Z_STREAM_END, the only possible operations on the
- stream are deflateReset or deflateEnd.
-
- Z_FINISH can be used immediately after deflateInit if all the compression
- is to be done in a single step. In this case, avail_out must be at least
- the value returned by deflateBound (see below). If deflate does not return
- Z_STREAM_END, then it must be called again as described above.
-
- deflate() sets strm->adler to the adler32 checksum of all input read
- so far (that is, total_in bytes).
-
- deflate() may update strm->data_type if it can make a good guess about
- the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
- binary. This field is only for information purposes and does not affect
- the compression algorithm in any manner.
-
- deflate() returns Z_OK if some progress has been made (more input
- processed or more output produced), Z_STREAM_END if all input has been
- consumed and all output has been produced (only when flush is set to
- Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
- (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
- fatal, and deflate() can be called again with more input and more output
- space to continue compressing.
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
-
- deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
- stream state was inconsistent, Z_DATA_ERROR if the stream was freed
- prematurely (some input or output was discarded). In the error case,
- msg may be set but then points to a static string (which must not be
- deallocated).
-*/
-
-
-/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-
- Initializes the internal stream state for decompression. The fields
- next_in, avail_in, zalloc, zfree and opaque must be initialized before by
- the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
- value depends on the compression method), inflateInit determines the
- compression method from the zlib header and allocates all data structures
- accordingly; otherwise the allocation will be deferred to the first call of
- inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
- use default allocation functions.
-
- inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller. msg is set to null if there is no error
- message. inflateInit does not perform any decompression apart from reading
- the zlib header if present: this will be done by inflate(). (So next_in and
- avail_in may be modified, but next_out and avail_out are unchanged.)
-*/
-
-
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
-/*
- inflate decompresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce
- some output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. inflate performs one or both of the
- following actions:
-
- - Decompress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in is updated and processing
- will resume at this point for the next call of inflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. inflate() provides as much output as possible, until there
- is no more input data or no more space in the output buffer (see below
- about the flush parameter).
-
- Before the call of inflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating the next_* and avail_* values accordingly.
- The application can consume the uncompressed output when it wants, for
- example when the output buffer is full (avail_out == 0), or after each
- call of inflate(). If inflate returns Z_OK and with zero avail_out, it
- must be called again after making room in the output buffer because there
- might be more output pending.
-
- The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
- Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
- output as possible to the output buffer. Z_BLOCK requests that inflate() stop
- if and when it gets to the next deflate block boundary. When decoding the
- zlib or gzip format, this will cause inflate() to return immediately after
- the header and before the first block. When doing a raw inflate, inflate()
- will go ahead and process the first block, and will return when it gets to
- the end of that block, or when it runs out of data.
-
- The Z_BLOCK option assists in appending to or combining deflate streams.
- Also to assist in this, on return inflate() will set strm->data_type to the
- number of unused bits in the last byte taken from strm->next_in, plus 64
- if inflate() is currently decoding the last block in the deflate stream,
- plus 128 if inflate() returned immediately after decoding an end-of-block
- code or decoding the complete header up to just before the first byte of the
- deflate stream. The end-of-block will not be indicated until all of the
- uncompressed data from that block has been written to strm->next_out. The
- number of unused bits may in general be greater than seven, except when
- bit 7 of data_type is set, in which case the number of unused bits will be
- less than eight.
-
- inflate() should normally be called until it returns Z_STREAM_END or an
- error. However if all decompression is to be performed in a single step
- (a single call of inflate), the parameter flush should be set to
- Z_FINISH. In this case all pending input is processed and all pending
- output is flushed; avail_out must be large enough to hold all the
- uncompressed data. (The size of the uncompressed data may have been saved
- by the compressor for this purpose.) The next operation on this stream must
- be inflateEnd to deallocate the decompression state. The use of Z_FINISH
- is never required, but can be used to inform inflate that a faster approach
- may be used for the single inflate() call.
-
- In this implementation, inflate() always flushes as much output as
- possible to the output buffer, and always uses the faster approach on the
- first call. So the only effect of the flush parameter in this implementation
- is on the return value of inflate(), as noted below, or when it returns early
- because Z_BLOCK is used.
-
- If a preset dictionary is needed after this call (see inflateSetDictionary
- below), inflate sets strm->adler to the adler32 checksum of the dictionary
- chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
- strm->adler to the adler32 checksum of all output produced so far (that is,
- total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
- below. At the end of the stream, inflate() checks that its computed adler32
- checksum is equal to that saved by the compressor and returns Z_STREAM_END
- only if the checksum is correct.
-
- inflate() will decompress and check either zlib-wrapped or gzip-wrapped
- deflate data. The header type is detected automatically. Any information
- contained in the gzip header is not retained, so applications that need that
- information should instead use raw inflate, see inflateInit2() below, or
- inflateBack() and perform their own processing of the gzip header and
- trailer.
-
- inflate() returns Z_OK if some progress has been made (more input processed
- or more output produced), Z_STREAM_END if the end of the compressed data has
- been reached and all uncompressed output has been produced, Z_NEED_DICT if a
- preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
- corrupted (input stream not conforming to the zlib format or incorrect check
- value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
- if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
- Z_BUF_ERROR if no progress is possible or if there was not enough room in the
- output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
- inflate() can be called again with more input and more output space to
- continue decompressing. If Z_DATA_ERROR is returned, the application may then
- call inflateSync() to look for a good compression block if a partial recovery
- of the data is desired.
-*/
-
-
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
-
- inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
- was inconsistent. In the error case, msg may be set but then points to a
- static string (which must not be deallocated).
-*/
-
- /* Advanced functions */
-
-/*
- The following functions are needed only in some special applications.
-*/
-
-/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
- int level,
- int method,
- int windowBits,
- int memLevel,
- int strategy));
-
- This is another version of deflateInit with more compression options. The
- fields next_in, zalloc, zfree and opaque must be initialized before by
- the caller.
-
- The method parameter is the compression method. It must be Z_DEFLATED in
- this version of the library.
-
- The windowBits parameter is the base two logarithm of the window size
- (the size of the history buffer). It should be in the range 8..15 for this
- version of the library. Larger values of this parameter result in better
- compression at the expense of memory usage. The default value is 15 if
- deflateInit is used instead.
-
- windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
- determines the window size. deflate() will then generate raw deflate data
- with no zlib header or trailer, and will not compute an adler32 check value.
-
- windowBits can also be greater than 15 for optional gzip encoding. Add
- 16 to windowBits to write a simple gzip header and trailer around the
- compressed data instead of a zlib wrapper. The gzip header will have no
- file name, no extra data, no comment, no modification time (set to zero),
- no header crc, and the operating system will be set to 255 (unknown). If a
- gzip stream is being written, strm->adler is a crc32 instead of an adler32.
-
- The memLevel parameter specifies how much memory should be allocated
- for the internal compression state. memLevel=1 uses minimum memory but
- is slow and reduces compression ratio; memLevel=9 uses maximum memory
- for optimal speed. The default value is 8. See zconf.h for total memory
- usage as a function of windowBits and memLevel.
-
- The strategy parameter is used to tune the compression algorithm. Use the
- value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
- filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
- string match), or Z_RLE to limit match distances to one (run-length
- encoding). Filtered data consists mostly of small values with a somewhat
- random distribution. In this case, the compression algorithm is tuned to
- compress them better. The effect of Z_FILTERED is to force more Huffman
- coding and less string matching; it is somewhat intermediate between
- Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
- Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
- parameter only affects the compression ratio but not the correctness of the
- compressed output even if it is not set appropriately. Z_FIXED prevents the
- use of dynamic Huffman codes, allowing for a simpler decoder for special
- applications.
-
- deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
- method). msg is set to null if there is no error message. deflateInit2 does
- not perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the compression dictionary from the given byte sequence
- without producing any compressed output. This function must be called
- immediately after deflateInit, deflateInit2 or deflateReset, before any
- call of deflate. The compressor and decompressor must use exactly the same
- dictionary (see inflateSetDictionary).
-
- The dictionary should consist of strings (byte sequences) that are likely
- to be encountered later in the data to be compressed, with the most commonly
- used strings preferably put towards the end of the dictionary. Using a
- dictionary is most useful when the data to be compressed is short and can be
- predicted with good accuracy; the data can then be compressed better than
- with the default empty dictionary.
-
- Depending on the size of the compression data structures selected by
- deflateInit or deflateInit2, a part of the dictionary may in effect be
- discarded, for example if the dictionary is larger than the window size in
- deflate or deflate2. Thus the strings most likely to be useful should be
- put at the end of the dictionary, not at the front. In addition, the
- current implementation of deflate will use at most the window size minus
- 262 bytes of the provided dictionary.
-
- Upon return of this function, strm->adler is set to the adler32 value
- of the dictionary; the decompressor may later use this value to determine
- which dictionary has been used by the compressor. (The adler32 value
- applies to the whole dictionary even if only a subset of the dictionary is
- actually used by the compressor.) If a raw deflate was requested, then the
- adler32 value is not computed and strm->adler is not set.
-
- deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
- inconsistent (for example if deflate has already been called for this stream
- or if the compression method is bsort). deflateSetDictionary does not
- perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when several compression strategies will be
- tried, for example when there are several ways of pre-processing the input
- data with a filter. The streams that will be discarded should then be freed
- by calling deflateEnd. Note that deflateCopy duplicates the internal
- compression state which can be quite large, so this strategy is slow and
- can consume lots of memory.
-
- deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
- This function is equivalent to deflateEnd followed by deflateInit,
- but does not free and reallocate all the internal compression state.
- The stream will keep the same compression level and any other attributes
- that may have been set by deflateInit2.
-
- deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
- int level,
- int strategy));
-/*
- Dynamically update the compression level and compression strategy. The
- interpretation of level and strategy is as in deflateInit2. This can be
- used to switch between compression and straight copy of the input data, or
- to switch to a different kind of input data requiring a different
- strategy. If the compression level is changed, the input available so far
- is compressed with the old level (and may be flushed); the new level will
- take effect only at the next call of deflate().
-
- Before the call of deflateParams, the stream state must be set as for
- a call of deflate(), since the currently available input may have to
- be compressed and flushed. In particular, strm->avail_out must be non-zero.
-
- deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
- stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
- if strm->avail_out was zero.
-*/
-
-ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
- int good_length,
- int max_lazy,
- int nice_length,
- int max_chain));
-/*
- Fine tune deflate's internal compression parameters. This should only be
- used by someone who understands the algorithm used by zlib's deflate for
- searching for the best matching string, and even then only by the most
- fanatic optimizer trying to squeeze out the last compressed bit for their
- specific input data. Read the deflate.c source code for the meaning of the
- max_lazy, good_length, nice_length, and max_chain parameters.
-
- deflateTune() can be called after deflateInit() or deflateInit2(), and
- returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
- */
-
-ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
- uLong sourceLen));
-/*
- deflateBound() returns an upper bound on the compressed size after
- deflation of sourceLen bytes. It must be called after deflateInit()
- or deflateInit2(). This would be used to allocate an output buffer
- for deflation in a single pass, and so would be called before deflate().
-*/
-
-ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
- int bits,
- int value));
-/*
- deflatePrime() inserts bits in the deflate output stream. The intent
- is that this function is used to start off the deflate output with the
- bits leftover from a previous deflate stream when appending to it. As such,
- this function can only be used for raw deflate, and must be used before the
- first deflate() call after a deflateInit2() or deflateReset(). bits must be
- less than or equal to 16, and that many of the least significant bits of
- value will be inserted in the output.
-
- deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
- gz_headerp head));
-/*
- deflateSetHeader() provides gzip header information for when a gzip
- stream is requested by deflateInit2(). deflateSetHeader() may be called
- after deflateInit2() or deflateReset() and before the first call of
- deflate(). The text, time, os, extra field, name, and comment information
- in the provided gz_header structure are written to the gzip header (xflag is
- ignored -- the extra flags are set according to the compression level). The
- caller must assure that, if not Z_NULL, name and comment are terminated with
- a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
- available there. If hcrc is true, a gzip header crc is included. Note that
- the current versions of the command-line version of gzip (up through version
- 1.3.x) do not support header crc's, and will report that it is a "multi-part
- gzip file" and give up.
-
- If deflateSetHeader is not used, the default gzip header has text false,
- the time set to zero, and os set to 255, with no extra, name, or comment
- fields. The gzip header is returned to the default state by deflateReset().
-
- deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
- int windowBits));
-
- This is another version of inflateInit with an extra parameter. The
- fields next_in, avail_in, zalloc, zfree and opaque must be initialized
- before by the caller.
-
- The windowBits parameter is the base two logarithm of the maximum window
- size (the size of the history buffer). It should be in the range 8..15 for
- this version of the library. The default value is 15 if inflateInit is used
- instead. windowBits must be greater than or equal to the windowBits value
- provided to deflateInit2() while compressing, or it must be equal to 15 if
- deflateInit2() was not used. If a compressed stream with a larger window
- size is given as input, inflate() will return with the error code
- Z_DATA_ERROR instead of trying to allocate a larger window.
-
- windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
- determines the window size. inflate() will then process raw deflate data,
- not looking for a zlib or gzip header, not generating a check value, and not
- looking for any check values for comparison at the end of the stream. This
- is for use with other formats that use the deflate compressed data format
- such as zip. Those formats provide their own check values. If a custom
- format is developed using the raw deflate format for compressed data, it is
- recommended that a check value such as an adler32 or a crc32 be applied to
- the uncompressed data as is done in the zlib, gzip, and zip formats. For
- most applications, the zlib format should be used as is. Note that comments
- above on the use in deflateInit2() applies to the magnitude of windowBits.
-
- windowBits can also be greater than 15 for optional gzip decoding. Add
- 32 to windowBits to enable zlib and gzip decoding with automatic header
- detection, or add 16 to decode only the gzip format (the zlib format will
- return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is
- a crc32 instead of an adler32.
-
- inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
- is set to null if there is no error message. inflateInit2 does not perform
- any decompression apart from reading the zlib header if present: this will
- be done by inflate(). (So next_in and avail_in may be modified, but next_out
- and avail_out are unchanged.)
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the decompression dictionary from the given uncompressed byte
- sequence. This function must be called immediately after a call of inflate,
- if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
- can be determined from the adler32 value returned by that call of inflate.
- The compressor and decompressor must use exactly the same dictionary (see
- deflateSetDictionary). For raw inflate, this function can be called
- immediately after inflateInit2() or inflateReset() and before any call of
- inflate() to set the dictionary. The application must insure that the
- dictionary that was used for compression is provided.
-
- inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
- inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
- expected one (incorrect adler32 value). inflateSetDictionary does not
- perform any decompression: this will be done by subsequent calls of
- inflate().
-*/
-
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
-/*
- Skips invalid compressed data until a full flush point (see above the
- description of deflate with Z_FULL_FLUSH) can be found, or until all
- available input is skipped. No output is provided.
-
- inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
- if no more input was provided, Z_DATA_ERROR if no flush point has been found,
- or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
- case, the application may save the current current value of total_in which
- indicates where valid compressed data was found. In the error case, the
- application may repeatedly call inflateSync, providing more input each time,
- until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when randomly accessing a large stream. The
- first pass through the stream can periodically record the inflate state,
- allowing restarting inflate at those points when randomly accessing the
- stream.
-
- inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
-/*
- This function is equivalent to inflateEnd followed by inflateInit,
- but does not free and reallocate all the internal decompression state.
- The stream will keep attributes that may have been set by inflateInit2.
-
- inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
- int bits,
- int value));
-/*
- This function inserts bits in the inflate input stream. The intent is
- that this function is used to start inflating at a bit position in the
- middle of a byte. The provided bits will be used before any bytes are used
- from next_in. This function should only be used with raw inflate, and
- should be used before the first inflate() call after inflateInit2() or
- inflateReset(). bits must be less than or equal to 16, and that many of the
- least significant bits of value will be inserted in the input.
-
- inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
- gz_headerp head));
-/*
- inflateGetHeader() requests that gzip header information be stored in the
- provided gz_header structure. inflateGetHeader() may be called after
- inflateInit2() or inflateReset(), and before the first call of inflate().
- As inflate() processes the gzip stream, head->done is zero until the header
- is completed, at which time head->done is set to one. If a zlib stream is
- being decoded, then head->done is set to -1 to indicate that there will be
- no gzip header information forthcoming. Note that Z_BLOCK can be used to
- force inflate() to return immediately after header processing is complete
- and before any actual data is decompressed.
-
- The text, time, xflags, and os fields are filled in with the gzip header
- contents. hcrc is set to true if there is a header CRC. (The header CRC
- was valid if done is set to one.) If extra is not Z_NULL, then extra_max
- contains the maximum number of bytes to write to extra. Once done is true,
- extra_len contains the actual extra field length, and extra contains the
- extra field, or that field truncated if extra_max is less than extra_len.
- If name is not Z_NULL, then up to name_max characters are written there,
- terminated with a zero unless the length is greater than name_max. If
- comment is not Z_NULL, then up to comm_max characters are written there,
- terminated with a zero unless the length is greater than comm_max. When
- any of extra, name, or comment are not Z_NULL and the respective field is
- not present in the header, then that field is set to Z_NULL to signal its
- absence. This allows the use of deflateSetHeader() with the returned
- structure to duplicate the header. However if those fields are set to
- allocated memory, then the application will need to save those pointers
- elsewhere so that they can be eventually freed.
-
- If inflateGetHeader is not used, then the header information is simply
- discarded. The header is always checked for validity, including the header
- CRC if present. inflateReset() will reset the process to discard the header
- information. The application would need to call inflateGetHeader() again to
- retrieve the header from the next gzip stream.
-
- inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
- unsigned char FAR *window));
-
- Initialize the internal stream state for decompression using inflateBack()
- calls. The fields zalloc, zfree and opaque in strm must be initialized
- before the call. If zalloc and zfree are Z_NULL, then the default library-
- derived memory allocation routines are used. windowBits is the base two
- logarithm of the window size, in the range 8..15. window is a caller
- supplied buffer of that size. Except for special applications where it is
- assured that deflate was used with small window sizes, windowBits must be 15
- and a 32K byte window must be supplied to be able to decompress general
- deflate streams.
-
- See inflateBack() for the usage of these routines.
-
- inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
- the paramaters are invalid, Z_MEM_ERROR if the internal state could not
- be allocated, or Z_VERSION_ERROR if the version of the library does not
- match the version of the header file.
-*/
-
-typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
-typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
-
-ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
- in_func in, void FAR *in_desc,
- out_func out, void FAR *out_desc));
-/*
- inflateBack() does a raw inflate with a single call using a call-back
- interface for input and output. This is more efficient than inflate() for
- file i/o applications in that it avoids copying between the output and the
- sliding window by simply making the window itself the output buffer. This
- function trusts the application to not change the output buffer passed by
- the output function, at least until inflateBack() returns.
-
- inflateBackInit() must be called first to allocate the internal state
- and to initialize the state with the user-provided window buffer.
- inflateBack() may then be used multiple times to inflate a complete, raw
- deflate stream with each call. inflateBackEnd() is then called to free
- the allocated state.
-
- A raw deflate stream is one with no zlib or gzip header or trailer.
- This routine would normally be used in a utility that reads zip or gzip
- files and writes out uncompressed files. The utility would decode the
- header and process the trailer on its own, hence this routine expects
- only the raw deflate stream to decompress. This is different from the
- normal behavior of inflate(), which expects either a zlib or gzip header and
- trailer around the deflate stream.
-
- inflateBack() uses two subroutines supplied by the caller that are then
- called by inflateBack() for input and output. inflateBack() calls those
- routines until it reads a complete deflate stream and writes out all of the
- uncompressed data, or until it encounters an error. The function's
- parameters and return types are defined above in the in_func and out_func
- typedefs. inflateBack() will call in(in_desc, &buf) which should return the
- number of bytes of provided input, and a pointer to that input in buf. If
- there is no input available, in() must return zero--buf is ignored in that
- case--and inflateBack() will return a buffer error. inflateBack() will call
- out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
- should return zero on success, or non-zero on failure. If out() returns
- non-zero, inflateBack() will return with an error. Neither in() nor out()
- are permitted to change the contents of the window provided to
- inflateBackInit(), which is also the buffer that out() uses to write from.
- The length written by out() will be at most the window size. Any non-zero
- amount of input may be provided by in().
-
- For convenience, inflateBack() can be provided input on the first call by
- setting strm->next_in and strm->avail_in. If that input is exhausted, then
- in() will be called. Therefore strm->next_in must be initialized before
- calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
- immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
- must also be initialized, and then if strm->avail_in is not zero, input will
- initially be taken from strm->next_in[0 .. strm->avail_in - 1].
-
- The in_desc and out_desc parameters of inflateBack() is passed as the
- first parameter of in() and out() respectively when they are called. These
- descriptors can be optionally used to pass any information that the caller-
- supplied in() and out() functions need to do their job.
-
- On return, inflateBack() will set strm->next_in and strm->avail_in to
- pass back any unused input that was provided by the last in() call. The
- return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
- if in() or out() returned an error, Z_DATA_ERROR if there was a format
- error in the deflate stream (in which case strm->msg is set to indicate the
- nature of the error), or Z_STREAM_ERROR if the stream was not properly
- initialized. In the case of Z_BUF_ERROR, an input or output error can be
- distinguished using strm->next_in which will be Z_NULL only if in() returned
- an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
- out() returning non-zero. (in() will always be called before out(), so
- strm->next_in is assured to be defined if out() returns non-zero.) Note
- that inflateBack() cannot return Z_OK.
-*/
-
-ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
-/*
- All memory allocated by inflateBackInit() is freed.
-
- inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
- state was inconsistent.
-*/
-
-ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
-/* Return flags indicating compile-time options.
-
- Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
- 1.0: size of uInt
- 3.2: size of uLong
- 5.4: size of voidpf (pointer)
- 7.6: size of z_off_t
-
- Compiler, assembler, and debug options:
- 8: DEBUG
- 9: ASMV or ASMINF -- use ASM code
- 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
- 11: 0 (reserved)
-
- One-time table building (smaller code, but not thread-safe if true):
- 12: BUILDFIXED -- build static block decoding tables when needed
- 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
- 14,15: 0 (reserved)
-
- Library content (indicates missing functionality):
- 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
- deflate code when not needed)
- 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
- and decode gzip streams (to avoid linking crc code)
- 18-19: 0 (reserved)
-
- Operation variations (changes in library functionality):
- 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
- 21: FASTEST -- deflate algorithm with only one, lowest compression level
- 22,23: 0 (reserved)
-
- The sprintf variant used by gzprintf (zero is best):
- 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
- 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
- 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
-
- Remainder:
- 27-31: 0 (reserved)
- */
-
-
- /* utility functions */
-
-/*
- The following utility functions are implemented on top of the
- basic stream-oriented functions. To simplify the interface, some
- default options are assumed (compression level and memory usage,
- standard memory allocation functions). The source code of these
- utility functions can easily be modified if you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Compresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be at least the value returned
- by compressBound(sourceLen). Upon exit, destLen is the actual size of the
- compressed buffer.
- This function can be used to compress a whole file at once if the
- input file is mmap'ed.
- compress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen,
- int level));
-/*
- Compresses the source buffer into the destination buffer. The level
- parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
- destination buffer, which must be at least the value returned by
- compressBound(sourceLen). Upon exit, destLen is the actual size of the
- compressed buffer.
-
- compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_BUF_ERROR if there was not enough room in the output buffer,
- Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
-/*
- compressBound() returns an upper bound on the compressed size after
- compress() or compress2() on sourceLen bytes. It would be used before
- a compress() or compress2() call to allocate the destination buffer.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Decompresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be large enough to hold the
- entire uncompressed data. (The size of the uncompressed data must have
- been saved previously by the compressor and transmitted to the decompressor
- by some mechanism outside the scope of this compression library.)
- Upon exit, destLen is the actual size of the compressed buffer.
- This function can be used to decompress a whole file at once if the
- input file is mmap'ed.
-
- uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
-*/
-
-
-typedef voidp gzFile;
-
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
-/*
- Opens a gzip (.gz) file for reading or writing. The mode parameter
- is as in fopen ("rb" or "wb") but can also include a compression level
- ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
- Huffman only compression as in "wb1h", or 'R' for run-length encoding
- as in "wb1R". (See the description of deflateInit2 for more information
- about the strategy parameter.)
-
- gzopen can be used to read a file which is not in gzip format; in this
- case gzread will directly read from the file without decompression.
-
- gzopen returns NULL if the file could not be opened or if there was
- insufficient memory to allocate the (de)compression state; errno
- can be checked to distinguish the two cases (if errno is zero, the
- zlib error is Z_MEM_ERROR). */
-
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
-/*
- gzdopen() associates a gzFile with the file descriptor fd. File
- descriptors are obtained from calls like open, dup, creat, pipe or
- fileno (in the file has been previously opened with fopen).
- The mode parameter is as in gzopen.
- The next call of gzclose on the returned gzFile will also close the
- file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
- descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
- gzdopen returns NULL if there was insufficient memory to allocate
- the (de)compression state.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
- Dynamically update the compression level or strategy. See the description
- of deflateInit2 for the meaning of these parameters.
- gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
- opened for writing.
-*/
-
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
-/*
- Reads the given number of uncompressed bytes from the compressed file.
- If the input file was not in gzip format, gzread copies the given number
- of bytes into the buffer.
- gzread returns the number of uncompressed bytes actually read (0 for
- end of file, -1 for error). */
-
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
- voidpc buf, unsigned len));
-/*
- Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of uncompressed bytes actually written
- (0 in case of error).
-*/
-
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
-/*
- Converts, formats, and writes the args to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
- uncompressed bytes actually written (0 in case of error). The number of
- uncompressed bytes written is limited to 4095. The caller should assure that
- this limit is not exceeded. If it is exceeded, then gzprintf() will return
- return an error (0) with nothing written. In this case, there may also be a
- buffer overflow with unpredictable consequences, which is possible only if
- zlib was compiled with the insecure functions sprintf() or vsprintf()
- because the secure snprintf() or vsnprintf() functions were not available.
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
- Writes the given null-terminated string to the compressed file, excluding
- the terminating null character.
- gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
- Reads bytes from the compressed file until len-1 characters are read, or
- a newline character is read and transferred to buf, or an end-of-file
- condition is encountered. The string is then terminated with a null
- character.
- gzgets returns buf, or Z_NULL in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
-/*
- Writes c, converted to an unsigned char, into the compressed file.
- gzputc returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
-/*
- Reads one byte from the compressed file. gzgetc returns this byte
- or -1 in case of end of file or error.
-*/
-
-ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
-/*
- Push one character back onto the stream to be read again later.
- Only one character of push-back is allowed. gzungetc() returns the
- character pushed, or -1 on failure. gzungetc() will fail if a
- character has been pushed but not read yet, or if c is -1. The pushed
- character will be discarded if the stream is repositioned with gzseek()
- or gzrewind().
-*/
-
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
-/*
- Flushes all pending output into the compressed file. The parameter
- flush is as in the deflate() function. The return value is the zlib
- error number (see function gzerror below). gzflush returns Z_OK if
- the flush parameter is Z_FINISH and all output could be flushed.
- gzflush should be called only when strictly necessary because it can
- degrade compression.
-*/
-
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
- z_off_t offset, int whence));
-/*
- Sets the starting position for the next gzread or gzwrite on the
- given compressed file. The offset represents a number of bytes in the
- uncompressed data stream. The whence parameter is defined as in lseek(2);
- the value SEEK_END is not supported.
- If the file is opened for reading, this function is emulated but can be
- extremely slow. If the file is opened for writing, only forward seeks are
- supported; gzseek then compresses a sequence of zeroes up to the new
- starting position.
-
- gzseek returns the resulting offset location as measured in bytes from
- the beginning of the uncompressed stream, or -1 in case of error, in
- particular if the file is opened for writing and the new starting position
- would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
-/*
- Rewinds the given file. This function is supported only for reading.
-
- gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
-/*
- Returns the starting position for the next gzread or gzwrite on the
- given compressed file. This position represents a number of bytes in the
- uncompressed data stream.
-
- gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
- Returns 1 when EOF has previously been detected reading the given
- input stream, otherwise zero.
-*/
-
-ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
-/*
- Returns 1 if file is being read directly without decompression, otherwise
- zero.
-*/
-
-ZEXTERN int ZEXPORT gzclose OF((gzFile file));
-/*
- Flushes all pending output if necessary, closes the compressed file
- and deallocates all the (de)compression state. The return value is the zlib
- error number (see function gzerror below).
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
- Returns the error message for the last error which occurred on the
- given compressed file. errnum is set to zlib error number. If an
- error occurred in the file system and not in the compression library,
- errnum is set to Z_ERRNO and the application may consult errno
- to get the exact error code.
-*/
-
-ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
-/*
- Clears the error and end-of-file flags for file. This is analogous to the
- clearerr() function in stdio. This is useful for continuing to read a gzip
- file that is being written concurrently.
-*/
-
- /* checksum functions */
-
-/*
- These functions are not related to compression but are exported
- anyway because they might be useful in applications using the
- compression library.
-*/
-
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
-/*
- Update a running Adler-32 checksum with the bytes buf[0..len-1] and
- return the updated checksum. If buf is NULL, this function returns
- the required initial value for the checksum.
- An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
- much faster. Usage example:
-
- uLong adler = adler32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- adler = adler32(adler, buffer, length);
- }
- if (adler != original_adler) error();
-*/
-
-ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
- z_off_t len2));
-/*
- Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
- and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
- each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
- seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
-*/
-
-ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
-/*
- Update a running CRC-32 with the bytes buf[0..len-1] and return the
- updated CRC-32. If buf is NULL, this function returns the required initial
- value for the for the crc. Pre- and post-conditioning (one's complement) is
- performed within this function so it shouldn't be done by the application.
- Usage example:
-
- uLong crc = crc32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- crc = crc32(crc, buffer, length);
- }
- if (crc != original_crc) error();
-*/
-
-ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
-
-/*
- Combine two CRC-32 check values into one. For two sequences of bytes,
- seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
- calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
- check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
- len2.
-*/
-
-
- /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
- int windowBits, int memLevel,
- int strategy, const char *version,
- int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
- unsigned char FAR *window,
- const char *version,
- int stream_size));
-#define deflateInit(strm, level) \
- deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit(strm) \
- inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
- deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
- inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
-#define inflateBackInit(strm, windowBits, window) \
- inflateBackInit_((strm), (windowBits), (window), \
- ZLIB_VERSION, sizeof(z_stream))
-
-
-#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
- struct internal_state {int dummy;}; /* hack for buggy compilers */
-#endif
-
-ZEXTERN const char * ZEXPORT zError OF((int));
-ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
-ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ZLIB_H */
diff --git a/Utilities/Poco/Foundation/src/ASCIIEncoding.cpp b/Utilities/Poco/Foundation/src/ASCIIEncoding.cpp
deleted file mode 100755
index 7d17b3ea45..0000000000
--- a/Utilities/Poco/Foundation/src/ASCIIEncoding.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// ASCIIEncoding.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: ASCIIEncoding
-//
-// Copyright (c) 2004-2007, 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/ASCIIEncoding.h"
-#include "Poco/String.h"
-
-
-namespace Poco {
-
-
-const char* ASCIIEncoding::_names[] =
-{
- "ASCII",
- NULL
-};
-
-
-const TextEncoding::CharacterMap ASCIIEncoding::_charMap =
-{
- /* 00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- /* 10 */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- /* 20 */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- /* 30 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- /* 40 */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- /* 50 */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- /* 60 */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- /* 70 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- /* 80 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* 90 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* a0 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* b0 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* c0 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* d0 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* e0 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* f0 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-};
-
-
-ASCIIEncoding::ASCIIEncoding()
-{
-}
-
-
-ASCIIEncoding::~ASCIIEncoding()
-{
-}
-
-
-const char* ASCIIEncoding::canonicalName() const
-{
- return _names[0];
-}
-
-
-bool ASCIIEncoding::isA(const std::string& encodingName) const
-{
- for (const char** name = _names; *name; ++name)
- {
- if (Poco::icompare(encodingName, *name) == 0)
- return true;
- }
- return false;
-}
-
-
-const TextEncoding::CharacterMap& ASCIIEncoding::characterMap() const
-{
- return _charMap;
-}
-
-
-int ASCIIEncoding::convert(const unsigned char* bytes) const
-{
- return *bytes;
-}
-
-
-int ASCIIEncoding::convert(int ch, unsigned char* bytes, int length) const
-{
- if (ch >= 0 && ch <= 127)
- {
- if (bytes && length >= 1)
- *bytes = (unsigned char) ch;
- return 1;
- }
- else return 0;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/AbstractObserver.cpp b/Utilities/Poco/Foundation/src/AbstractObserver.cpp
deleted file mode 100755
index 811bfe308b..0000000000
--- a/Utilities/Poco/Foundation/src/AbstractObserver.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// AbstractObserver.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: NotificationCenter
-//
-// Copyright (c) 2004-2006, 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/AbstractObserver.h"
-
-
-namespace Poco {
-
-
-AbstractObserver::AbstractObserver()
-{
-}
-
-
-AbstractObserver::AbstractObserver(const AbstractObserver& observer)
-{
-}
-
-
-AbstractObserver::~AbstractObserver()
-{
-}
-
-
-AbstractObserver& AbstractObserver::operator = (const AbstractObserver& observer)
-{
- return *this;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/ActiveDispatcher.cpp b/Utilities/Poco/Foundation/src/ActiveDispatcher.cpp
deleted file mode 100755
index ed55b64680..0000000000
--- a/Utilities/Poco/Foundation/src/ActiveDispatcher.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// ActiveDispatcher.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ActiveObjects
-//
-// Copyright (c) 2006-2007, 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/ActiveDispatcher.h"
-#include "Poco/Notification.h"
-#include "Poco/AutoPtr.h"
-
-
-namespace Poco {
-
-
-namespace
-{
- class MethodNotification: public Notification
- {
- public:
- MethodNotification(ActiveRunnableBase::Ptr pRunnable):
- _pRunnable(pRunnable)
- {
- }
-
- ActiveRunnableBase::Ptr runnable() const
- {
- return _pRunnable;
- }
-
- private:
- ActiveRunnableBase::Ptr _pRunnable;
- };
-
- class StopNotification: public Notification
- {
- };
-}
-
-
-ActiveDispatcher::ActiveDispatcher()
-{
- _thread.start(*this);
-}
-
-
-ActiveDispatcher::ActiveDispatcher(Thread::Priority prio)
-{
- _thread.setPriority(prio);
- _thread.start(*this);
-}
-
-
-ActiveDispatcher::~ActiveDispatcher()
-{
- try
- {
- stop();
- }
- catch (...)
- {
- }
-}
-
-
-void ActiveDispatcher::start(ActiveRunnableBase::Ptr pRunnable)
-{
- poco_check_ptr (pRunnable);
-
- _queue.enqueueNotification(new MethodNotification(pRunnable));
-}
-
-
-void ActiveDispatcher::cancel()
-{
- _queue.clear();
-}
-
-
-void ActiveDispatcher::run()
-{
- AutoPtr<Notification> pNf = _queue.waitDequeueNotification();
- while (pNf && !dynamic_cast<StopNotification*>(pNf.get()))
- {
- MethodNotification* pMethodNf = dynamic_cast<MethodNotification*>(pNf.get());
- poco_check_ptr (pMethodNf);
- ActiveRunnableBase::Ptr pRunnable = pMethodNf->runnable();
- pRunnable->duplicate(); // run will release
- pRunnable->run();
- pNf = _queue.waitDequeueNotification();
- }
-}
-
-
-void ActiveDispatcher::stop()
-{
- _queue.clear();
- _queue.wakeUpAll();
- _queue.enqueueNotification(new StopNotification);
- _thread.join();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/ArchiveStrategy.cpp b/Utilities/Poco/Foundation/src/ArchiveStrategy.cpp
deleted file mode 100755
index e2bab61b7d..0000000000
--- a/Utilities/Poco/Foundation/src/ArchiveStrategy.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-//
-// ArchiveStrategy.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: FileChannel
-//
-// Copyright (c) 2004-2006, 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/ArchiveStrategy.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/File.h"
-#include "Poco/Path.h"
-#include "Poco/DeflatingStream.h"
-#include "Poco/StreamCopier.h"
-#include "Poco/Exception.h"
-#include "Poco/ActiveDispatcher.h"
-#include "Poco/ActiveMethod.h"
-#include "Poco/Void.h"
-#include "Poco/FileStream.h"
-
-
-namespace Poco {
-
-
-//
-// ArchiveCompressor
-//
-
-
-class ArchiveCompressor: public ActiveDispatcher
-{
-public:
- ArchiveCompressor():
- compress(this, &ArchiveCompressor::compressImpl)
- {
- }
-
- ~ArchiveCompressor()
- {
- }
-
- ActiveMethod<Void, std::string, ArchiveCompressor, ActiveStarter<ActiveDispatcher> > compress;
-
-protected:
- Void compressImpl(const std::string& path)
- {
- std::string gzPath(path);
- gzPath.append(".gz");
- FileInputStream istr(path, std::ios::binary | std::ios::in);
- if (!istr.good()) throw OpenFileException(path);
- FileOutputStream ostr(gzPath, std::ios::binary | std::ios::out);
- if (ostr.good())
- {
- DeflatingOutputStream deflater(ostr, DeflatingStreamBuf::STREAM_GZIP);
- StreamCopier::copyStream(istr, deflater);
- deflater.close();
- ostr.close();
- istr.close();
- File f(path);
- f.remove();
- }
- else throw CreateFileException(gzPath);
- return Void();
- }
-};
-
-
-//
-// ArchiveStrategy
-//
-
-
-ArchiveStrategy::ArchiveStrategy():
- _compress(false),
- _pCompressor(0)
-{
-}
-
-
-ArchiveStrategy::~ArchiveStrategy()
-{
- delete _pCompressor;
-}
-
-
-void ArchiveStrategy::compress(bool flag)
-{
- _compress = flag;
-}
-
-
-void ArchiveStrategy::moveFile(const std::string& oldPath, const std::string& newPath)
-{
- bool compressed = false;
- Path p(oldPath);
- File f(oldPath);
- if (!f.exists())
- {
- f = oldPath + ".gz";
- compressed = true;
- }
- std::string mvPath(newPath);
- if (_compress || compressed)
- mvPath.append(".gz");
- if (!_compress || compressed)
- {
- f.renameTo(mvPath);
- }
- else
- {
- f.renameTo(newPath);
- if (!_pCompressor) _pCompressor = new ArchiveCompressor;
- _pCompressor->compress(newPath);
- }
-}
-
-
-bool ArchiveStrategy::exists(const std::string& name)
-{
- File f(name);
- if (f.exists())
- {
- return true;
- }
- else if (_compress)
- {
- std::string gzName(name);
- gzName.append(".gz");
- File gzf(gzName);
- return gzf.exists();
- }
- else return false;
-}
-
-
-//
-// ArchiveByNumberStrategy
-//
-
-
-ArchiveByNumberStrategy::ArchiveByNumberStrategy()
-{
-}
-
-
-ArchiveByNumberStrategy::~ArchiveByNumberStrategy()
-{
-}
-
-
-LogFile* ArchiveByNumberStrategy::archive(LogFile* pFile)
-{
- std::string basePath = pFile->path();
- delete pFile;
- int n = -1;
- std::string path;
- do
- {
- path = basePath;
- path.append(".");
- NumberFormatter::append(path, ++n);
- }
- while (exists(path));
-
- while (n >= 0)
- {
- std::string oldPath = basePath;
- if (n > 0)
- {
- oldPath.append(".");
- NumberFormatter::append(oldPath, n - 1);
- }
- std::string newPath = basePath;
- newPath.append(".");
- NumberFormatter::append(newPath, n);
- moveFile(oldPath, newPath);
- --n;
- }
- return new LogFile(basePath);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/AsyncChannel.cpp b/Utilities/Poco/Foundation/src/AsyncChannel.cpp
deleted file mode 100755
index 528b1794c3..0000000000
--- a/Utilities/Poco/Foundation/src/AsyncChannel.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-//
-// AsyncChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: AsyncChannel
-//
-// Copyright (c) 2004-2007, 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/AsyncChannel.h"
-#include "Poco/Notification.h"
-#include "Poco/Message.h"
-#include "Poco/Formatter.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/LoggingRegistry.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-class MessageNotification: public Notification
-{
-public:
- MessageNotification(const Message& msg)
- {
- _msg = msg;
- }
-
- ~MessageNotification()
- {
- }
-
- const Message& message() const
- {
- return _msg;
- }
-
-private:
- Message _msg;
-};
-
-
-AsyncChannel::AsyncChannel(Channel* pChannel, Thread::Priority prio):
- _pChannel(pChannel),
- _thread("AsyncChannel")
-{
- if (_pChannel) _pChannel->duplicate();
- _thread.setPriority(prio);
-}
-
-
-AsyncChannel::~AsyncChannel()
-{
- close();
- if (_pChannel) _pChannel->release();
-}
-
-
-void AsyncChannel::setChannel(Channel* pChannel)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_pChannel) _pChannel->release();
- _pChannel = pChannel;
- if (_pChannel) _pChannel->duplicate();
-}
-
-
-Channel* AsyncChannel::getChannel() const
-{
- return _pChannel;
-}
-
-
-void AsyncChannel::open()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (!_thread.isRunning())
- _thread.start(*this);
-}
-
-
-void AsyncChannel::close()
-{
- if (_thread.isRunning())
- {
- while (!_queue.empty()) Thread::sleep(100);
-
- do
- {
- _queue.wakeUpAll();
- }
- while (!_thread.tryJoin(100));
- }
-}
-
-
-void AsyncChannel::log(const Message& msg)
-{
- open();
-
- _queue.enqueueNotification(new MessageNotification(msg));
-}
-
-
-void AsyncChannel::setProperty(const std::string& name, const std::string& value)
-{
- if (name == "channel")
- setChannel(LoggingRegistry::defaultRegistry().channelForName(value));
- else if (name == "priority")
- setPriority(value);
- else
- Channel::setProperty(name, value);
-}
-
-
-void AsyncChannel::run()
-{
- AutoPtr<Notification> nf = _queue.waitDequeueNotification();
- while (nf)
- {
- MessageNotification* pNf = dynamic_cast<MessageNotification*>(nf.get());
- {
- FastMutex::ScopedLock lock(_mutex);
-
- if (pNf && _pChannel) _pChannel->log(pNf->message());
- }
- nf = _queue.waitDequeueNotification();
- }
-}
-
-
-void AsyncChannel::setPriority(const std::string& value)
-{
- Thread::Priority prio = Thread::PRIO_NORMAL;
-
- if (value == "lowest")
- prio = Thread::PRIO_LOWEST;
- else if (value == "low")
- prio = Thread::PRIO_LOW;
- else if (value == "normal")
- prio = Thread::PRIO_NORMAL;
- else if (value == "high")
- prio = Thread::PRIO_HIGH;
- else if (value == "highest")
- prio = Thread::PRIO_HIGHEST;
- else
- throw InvalidArgumentException("thread priority", value);
-
- _thread.setPriority(prio);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/AtomicCounter.cpp b/Utilities/Poco/Foundation/src/AtomicCounter.cpp
deleted file mode 100644
index db010b432a..0000000000
--- a/Utilities/Poco/Foundation/src/AtomicCounter.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// AtomicCounter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: AtomicCounter
-//
-// Copyright (c) 2009, 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/AtomicCounter.h"
-
-
-namespace Poco {
-
-
-#if POCO_OS == POCO_OS_WINDOWS_NT
-//
-// Windows
-//
-AtomicCounter::AtomicCounter():
- _counter(0)
-{
-}
-
-
-AtomicCounter::AtomicCounter(AtomicCounter::ValueType initialValue):
- _counter(initialValue)
-{
-}
-
-
-AtomicCounter::AtomicCounter(const AtomicCounter& counter):
- _counter(counter.value())
-{
-}
-
-
-AtomicCounter::~AtomicCounter()
-{
-}
-
-
-AtomicCounter& AtomicCounter::operator = (const AtomicCounter& counter)
-{
- InterlockedExchange(&_counter, counter.value());
- return *this;
-}
-
-
-AtomicCounter& AtomicCounter::operator = (AtomicCounter::ValueType value)
-{
- InterlockedExchange(&_counter, value);
- return *this;
-}
-
-
-#elif POCO_OS == POCO_OS_MAC_OS_X
-//
-// Mac OS X
-//
-AtomicCounter::AtomicCounter():
- _counter(0)
-{
-}
-
-
-AtomicCounter::AtomicCounter(AtomicCounter::ValueType initialValue):
- _counter(initialValue)
-{
-}
-
-
-AtomicCounter::AtomicCounter(const AtomicCounter& counter):
- _counter(counter.value())
-{
-}
-
-
-AtomicCounter::~AtomicCounter()
-{
-}
-
-
-AtomicCounter& AtomicCounter::operator = (const AtomicCounter& counter)
-{
- _counter = counter.value();
- return *this;
-}
-
-
-AtomicCounter& AtomicCounter::operator = (AtomicCounter::ValueType value)
-{
- _counter = value;
- return *this;
-}
-
-
-#else
-//
-// Generic implementation based on FastMutex
-//
-AtomicCounter::AtomicCounter()
-{
- _counter.value = 0;
-}
-
-
-AtomicCounter::AtomicCounter(AtomicCounter::ValueType initialValue)
-{
- _counter.value = initialValue;
-}
-
-
-AtomicCounter::AtomicCounter(const AtomicCounter& counter)
-{
- _counter.value = counter.value();
-}
-
-
-AtomicCounter::~AtomicCounter()
-{
-}
-
-
-AtomicCounter& AtomicCounter::operator = (const AtomicCounter& counter)
-{
- FastMutex::ScopedLock lock(_counter.mutex);
- _counter.value = counter.value();
- return *this;
-}
-
-
-AtomicCounter& AtomicCounter::operator = (AtomicCounter::ValueType value)
-{
- FastMutex::ScopedLock lock(_counter.mutex);
- _counter.value = value;
- return *this;
-}
-
-
-#endif // POCO_OS
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Base64Decoder.cpp b/Utilities/Poco/Foundation/src/Base64Decoder.cpp
deleted file mode 100755
index 4bada36199..0000000000
--- a/Utilities/Poco/Foundation/src/Base64Decoder.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-//
-// Base64Decoder.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: Base64
-//
-// Copyright (c) 2004-2006, 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/Base64Decoder.h"
-#include "Poco/Base64Encoder.h"
-#include "Poco/Exception.h"
-#include "Poco/Mutex.h"
-
-
-namespace Poco {
-
-
-unsigned char Base64DecoderBuf::IN_ENCODING[256];
-bool Base64DecoderBuf::IN_ENCODING_INIT = false;
-
-
-Base64DecoderBuf::Base64DecoderBuf(std::istream& istr):
- _groupLength(0),
- _groupIndex(0),
- _istr(istr)
-{
- static FastMutex mutex;
- FastMutex::ScopedLock lock(mutex);
- if (!IN_ENCODING_INIT)
- {
- for (unsigned i = 0; i < sizeof(IN_ENCODING); i++)
- {
- IN_ENCODING[i] = 0xFF;
- }
- for (unsigned i = 0; i < sizeof(Base64EncoderBuf::OUT_ENCODING); i++)
- {
- IN_ENCODING[Base64EncoderBuf::OUT_ENCODING[i]] = i;
- }
- IN_ENCODING[static_cast<unsigned char>('=')] = '\0';
- IN_ENCODING_INIT = true;
- }
-}
-
-
-Base64DecoderBuf::~Base64DecoderBuf()
-{
-}
-
-
-int Base64DecoderBuf::readFromDevice()
-{
- if (_groupIndex < _groupLength)
- {
- return _group[_groupIndex++];
- }
- else
- {
- unsigned char buffer[4];
- int c;
- if ((c = readOne()) == -1) return -1;
- buffer[0] = (unsigned char) c;
- if (IN_ENCODING[buffer[0]] == 0xFF) throw DataFormatException();
- if ((c = readOne()) == -1) return -1;
- buffer[1] = (unsigned char) c;
- if (IN_ENCODING[buffer[1]] == 0xFF) throw DataFormatException();
- if ((c = readOne()) == -1) return -1;
- buffer[2] = c;
- if (IN_ENCODING[buffer[2]] == 0xFF) throw DataFormatException();
- if ((c = readOne()) == -1) return -1;
- buffer[3] = c;
- if (IN_ENCODING[buffer[3]] == 0xFF) throw DataFormatException();
-
- _group[0] = (IN_ENCODING[buffer[0]] << 2) | (IN_ENCODING[buffer[1]] >> 4);
- _group[1] = ((IN_ENCODING[buffer[1]] & 0x0F) << 4) | (IN_ENCODING[buffer[2]] >> 2);
- _group[2] = (IN_ENCODING[buffer[2]] << 6) | IN_ENCODING[buffer[3]];
-
- if (buffer[2] == '=')
- _groupLength = 1;
- else if (buffer[3] == '=')
- _groupLength = 2;
- else
- _groupLength = 3;
- _groupIndex = 1;
- return _group[0];
- }
-}
-
-
-int Base64DecoderBuf::readOne()
-{
- int ch = _istr.get();
- while (ch == ' ' || ch == '\r' || ch == '\t' || ch == '\n')
- ch = _istr.get();
- return ch;
-}
-
-
-Base64DecoderIOS::Base64DecoderIOS(std::istream& istr): _buf(istr)
-{
- poco_ios_init(&_buf);
-}
-
-
-Base64DecoderIOS::~Base64DecoderIOS()
-{
-}
-
-
-Base64DecoderBuf* Base64DecoderIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-Base64Decoder::Base64Decoder(std::istream& istr): Base64DecoderIOS(istr), std::istream(&_buf)
-{
-}
-
-
-Base64Decoder::~Base64Decoder()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Base64Encoder.cpp b/Utilities/Poco/Foundation/src/Base64Encoder.cpp
deleted file mode 100755
index 3ee2804b9c..0000000000
--- a/Utilities/Poco/Foundation/src/Base64Encoder.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-//
-// Base64Encoder.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: Base64
-//
-// Copyright (c) 2004-2006, 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/Base64Encoder.h"
-
-
-namespace Poco {
-
-
-const unsigned char Base64EncoderBuf::OUT_ENCODING[64] =
-{
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
- 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
- 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
- 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
- 'w', 'x', 'y', 'z', '0', '1', '2', '3',
- '4', '5', '6', '7', '8', '9', '+', '/'
-};
-
-
-Base64EncoderBuf::Base64EncoderBuf(std::ostream& ostr):
- _groupLength(0),
- _pos(0),
- _lineLength(72),
- _ostr(ostr)
-{
-}
-
-
-Base64EncoderBuf::~Base64EncoderBuf()
-{
- try
- {
- close();
- }
- catch (...)
- {
- }
-}
-
-
-void Base64EncoderBuf::setLineLength(int lineLength)
-{
- _lineLength = lineLength;
-}
-
-
-int Base64EncoderBuf::getLineLength() const
-{
- return _lineLength;
-}
-
-
-int Base64EncoderBuf::writeToDevice(char c)
-{
- _group[_groupLength++] = (unsigned char) c;
- if (_groupLength == 3)
- {
- unsigned char idx;
- idx = _group[0] >> 2;
- _ostr.put(OUT_ENCODING[idx]);
- idx = ((_group[0] & 0x03) << 4) | (_group[1] >> 4);
- _ostr.put(OUT_ENCODING[idx]);
- idx = ((_group[1] & 0x0F) << 2) | (_group[2] >> 6);
- _ostr.put(OUT_ENCODING[idx]);
- idx = _group[2] & 0x3F;
- _ostr.put(OUT_ENCODING[idx]);
- _pos += 4;
- if (_lineLength > 0 && _pos >= _lineLength)
- {
- _ostr << "\r\n";
- _pos = 0;
- }
- _groupLength = 0;
- }
- return _ostr ? charToInt(c) : -1;
-}
-
-
-int Base64EncoderBuf::close()
-{
- sync();
- if (_groupLength == 1)
- {
- _group[1] = 0;
- unsigned char idx;
- idx = _group[0] >> 2;
- _ostr.put(OUT_ENCODING[idx]);
- idx = ((_group[0] & 0x03) << 4) | (_group[1] >> 4);
- _ostr.put(OUT_ENCODING[idx]);
- _ostr << "==";
- }
- else if (_groupLength == 2)
- {
- _group[2] = 0;
- unsigned char idx;
- idx = _group[0] >> 2;
- _ostr.put(OUT_ENCODING[idx]);
- idx = ((_group[0] & 0x03) << 4) | (_group[1] >> 4);
- _ostr.put(OUT_ENCODING[idx]);
- idx = ((_group[1] & 0x0F) << 2) | (_group[2] >> 6);
- _ostr.put(OUT_ENCODING[idx]);
- _ostr.put('=');
- }
- _ostr.flush();
- _groupLength = 0;
- return _ostr ? 0 : -1;
-}
-
-
-Base64EncoderIOS::Base64EncoderIOS(std::ostream& ostr): _buf(ostr)
-{
- poco_ios_init(&_buf);
-}
-
-
-Base64EncoderIOS::~Base64EncoderIOS()
-{
-}
-
-
-int Base64EncoderIOS::close()
-{
- return _buf.close();
-}
-
-
-Base64EncoderBuf* Base64EncoderIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-Base64Encoder::Base64Encoder(std::ostream& ostr): Base64EncoderIOS(ostr), std::ostream(&_buf)
-{
-}
-
-
-Base64Encoder::~Base64Encoder()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/BinaryReader.cpp b/Utilities/Poco/Foundation/src/BinaryReader.cpp
deleted file mode 100755
index 7f93b4e8ed..0000000000
--- a/Utilities/Poco/Foundation/src/BinaryReader.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// BinaryReader.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: BinaryReaderWriter
-//
-// Copyright (c) 2004-2006, 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/BinaryReader.h"
-#include "Poco/ByteOrder.h"
-
-
-namespace Poco {
-
-
-BinaryReader::BinaryReader(std::istream& istr, StreamByteOrder byteOrder):
- _istr(istr)
-{
-#if defined(POCO_ARCH_BIG_ENDIAN)
- _flipBytes = (byteOrder == LITTLE_ENDIAN_BYTE_ORDER);
-#else
- _flipBytes = (byteOrder == BIG_ENDIAN_BYTE_ORDER);
-#endif
-}
-
-
-BinaryReader::~BinaryReader()
-{
-}
-
-
-BinaryReader& BinaryReader::operator >> (bool& value)
-{
- _istr.read((char*) &value, sizeof(value));
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (char& value)
-{
- _istr.read((char*) &value, sizeof(value));
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (unsigned char& value)
-{
- _istr.read((char*) &value, sizeof(value));
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (signed char& value)
-{
- _istr.read((char*) &value, sizeof(value));
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (short& value)
-{
- _istr.read((char*) &value, sizeof(value));
- if (_flipBytes) value = ByteOrder::flipBytes(value);
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (unsigned short& value)
-{
- _istr.read((char*) &value, sizeof(value));
- if (_flipBytes) value = ByteOrder::flipBytes(value);
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (int& value)
-{
- _istr.read((char*) &value, sizeof(value));
- if (_flipBytes) value = ByteOrder::flipBytes(value);
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (unsigned int& value)
-{
- _istr.read((char*) &value, sizeof(value));
- if (_flipBytes) value = ByteOrder::flipBytes(value);
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (long& value)
-{
- _istr.read((char*) &value, sizeof(value));
-#if defined(POCO_LONG_IS_64_BIT)
- if (_flipBytes) value = ByteOrder::flipBytes((Int64) value);
-#else
- if (_flipBytes) value = ByteOrder::flipBytes((Int32) value);
-#endif
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (unsigned long& value)
-{
- _istr.read((char*) &value, sizeof(value));
-#if defined(POCO_LONG_IS_64_BIT)
- if (_flipBytes) value = ByteOrder::flipBytes((UInt64) value);
-#else
- if (_flipBytes) value = ByteOrder::flipBytes((UInt32) value);
-#endif
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (float& value)
-{
- if (_flipBytes)
- {
- char* ptr = (char*) &value;
- ptr += sizeof(value);
- for (unsigned i = 0; i < sizeof(value); ++i)
- _istr.read(--ptr, 1);
- }
- else
- {
- _istr.read((char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (double& value)
-{
- if (_flipBytes)
- {
- char* ptr = (char*) &value;
- ptr += sizeof(value);
- for (unsigned i = 0; i < sizeof(value); ++i)
- _istr.read(--ptr, 1);
- }
- else
- {
- _istr.read((char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
-
-
-BinaryReader& BinaryReader::operator >> (Int64& value)
-{
- _istr.read((char*) &value, sizeof(value));
- if (_flipBytes) value = ByteOrder::flipBytes(value);
- return *this;
-}
-
-
-BinaryReader& BinaryReader::operator >> (UInt64& value)
-{
- _istr.read((char*) &value, sizeof(value));
- if (_flipBytes) value = ByteOrder::flipBytes(value);
- return *this;
-}
-
-
-#endif
-
-
-BinaryReader& BinaryReader::operator >> (std::string& value)
-{
- UInt32 size = 0;
- read7BitEncoded(size);
- value.clear();
- value.reserve(size);
- while (size--)
- {
- char c;
- _istr.read(&c, 1);
- value += c;
- }
- return *this;
-}
-
-
-void BinaryReader::read7BitEncoded(UInt32& value)
-{
- char c;
- value = 0;
- int s = 0;
- do
- {
- c = 0;
- _istr.read(&c, 1);
- UInt32 x = (c & 0x7F);
- x <<= s;
- value += x;
- s += 7;
- }
- while (c & 0x80);
-}
-
-
-#if defined(POCO_HAVE_INT64)
-
-
-void BinaryReader::read7BitEncoded(UInt64& value)
-{
- char c;
- value = 0;
- int s = 0;
- do
- {
- c = 0;
- _istr.read(&c, 1);
- UInt64 x = (c & 0x7F);
- x <<= s;
- value += x;
- s += 7;
- }
- while (c & 0x80);
-}
-
-
-#endif
-
-
-void BinaryReader::readRaw(int length, std::string& value)
-{
- value.clear();
- value.reserve(length);
- while (length--)
- {
- char c;
- _istr.read(&c, 1);
- value += c;
- }
-}
-
-
-void BinaryReader::readBOM()
-{
- UInt16 bom;
- _istr.read((char*) &bom, sizeof(bom));
- _flipBytes = bom != 0xFEFF;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/BinaryWriter.cpp b/Utilities/Poco/Foundation/src/BinaryWriter.cpp
deleted file mode 100755
index 64a5fe8e8a..0000000000
--- a/Utilities/Poco/Foundation/src/BinaryWriter.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-//
-// BinaryWriter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: BinaryReaderWriter
-//
-// Copyright (c) 2004-2006, 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/BinaryWriter.h"
-#include "Poco/ByteOrder.h"
-#include <cstring>
-
-
-namespace Poco {
-
-
-BinaryWriter::BinaryWriter(std::ostream& ostr, StreamByteOrder byteOrder):
- _ostr(ostr)
-{
-#if defined(POCO_ARCH_BIG_ENDIAN)
- _flipBytes = (byteOrder == LITTLE_ENDIAN_BYTE_ORDER);
-#else
- _flipBytes = (byteOrder == BIG_ENDIAN_BYTE_ORDER);
-#endif
-}
-
-
-BinaryWriter::~BinaryWriter()
-{
-}
-
-
-BinaryWriter& BinaryWriter::operator << (bool value)
-{
- _ostr.write((const char*) &value, sizeof(value));
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (char value)
-{
- _ostr.write((const char*) &value, sizeof(value));
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (unsigned char value)
-{
- _ostr.write((const char*) &value, sizeof(value));
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (signed char value)
-{
- _ostr.write((const char*) &value, sizeof(value));
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (short value)
-{
- if (_flipBytes)
- {
- short fValue = ByteOrder::flipBytes(value);
- _ostr.write((const char*) &fValue, sizeof(fValue));
- }
- else
- {
- _ostr.write((const char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (unsigned short value)
-{
- if (_flipBytes)
- {
- unsigned short fValue = ByteOrder::flipBytes(value);
- _ostr.write((const char*) &fValue, sizeof(fValue));
- }
- else
- {
- _ostr.write((const char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (int value)
-{
- if (_flipBytes)
- {
- int fValue = ByteOrder::flipBytes(value);
- _ostr.write((const char*) &fValue, sizeof(fValue));
- }
- else
- {
- _ostr.write((const char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (unsigned int value)
-{
- if (_flipBytes)
- {
- unsigned int fValue = ByteOrder::flipBytes(value);
- _ostr.write((const char*) &fValue, sizeof(fValue));
- }
- else
- {
- _ostr.write((const char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (long value)
-{
- if (_flipBytes)
- {
-#if defined(POCO_LONG_IS_64_BIT)
- long fValue = ByteOrder::flipBytes((Int64) value);
-#else
- long fValue = ByteOrder::flipBytes((Int32) value);
-#endif
- _ostr.write((const char*) &fValue, sizeof(fValue));
- }
- else
- {
- _ostr.write((const char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (unsigned long value)
-{
- if (_flipBytes)
- {
-#if defined(POCO_LONG_IS_64_BIT)
- long fValue = ByteOrder::flipBytes((UInt64) value);
-#else
- long fValue = ByteOrder::flipBytes((UInt32) value);
-#endif
- _ostr.write((const char*) &fValue, sizeof(fValue));
- }
- else
- {
- _ostr.write((const char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (float value)
-{
- if (_flipBytes)
- {
- const char* ptr = (const char*) &value;
- ptr += sizeof(value);
- for (unsigned i = 0; i < sizeof(value); ++i)
- _ostr.write(--ptr, 1);
- }
- else
- {
- _ostr.write((const char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (double value)
-{
- if (_flipBytes)
- {
- const char* ptr = (const char*) &value;
- ptr += sizeof(value);
- for (unsigned i = 0; i < sizeof(value); ++i)
- _ostr.write(--ptr, 1);
- }
- else
- {
- _ostr.write((const char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
-
-
-BinaryWriter& BinaryWriter::operator << (Int64 value)
-{
- if (_flipBytes)
- {
- Int64 fValue = ByteOrder::flipBytes(value);
- _ostr.write((const char*) &fValue, sizeof(fValue));
- }
- else
- {
- _ostr.write((const char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (UInt64 value)
-{
- if (_flipBytes)
- {
- UInt64 fValue = ByteOrder::flipBytes(value);
- _ostr.write((const char*) &fValue, sizeof(fValue));
- }
- else
- {
- _ostr.write((const char*) &value, sizeof(value));
- }
- return *this;
-}
-
-
-#endif
-
-
-BinaryWriter& BinaryWriter::operator << (const std::string& value)
-{
- UInt32 length = (UInt32) value.size();
- write7BitEncoded(length);
- _ostr.write(value.data(), length);
- return *this;
-}
-
-
-BinaryWriter& BinaryWriter::operator << (const char* value)
-{
- poco_check_ptr (value);
- UInt32 length = (UInt32) std::strlen(value);
- write7BitEncoded(length);
- _ostr.write(value, length);
- return *this;
-}
-
-
-void BinaryWriter::write7BitEncoded(UInt32 value)
-{
- do
- {
- unsigned char c = (unsigned char) (value & 0x7F);
- value >>= 7;
- if (value) c |= 0x80;
- _ostr.write((const char*) &c, 1);
- }
- while (value);
-}
-
-
-#if defined(POCO_HAVE_INT64)
-
-
-void BinaryWriter::write7BitEncoded(UInt64 value)
-{
- do
- {
- unsigned char c = (unsigned char) (value & 0x7F);
- value >>= 7;
- if (value) c |= 0x80;
- _ostr.write((const char*) &c, 1);
- }
- while (value);
-}
-
-
-#endif
-
-
-void BinaryWriter::writeRaw(const std::string& rawData)
-{
- _ostr.write(rawData.data(), (std::streamsize) rawData.length());
-}
-
-
-void BinaryWriter::writeBOM()
-{
- UInt16 value = 0xFEFF;
- if (_flipBytes) value = ByteOrder::flipBytes(value);
- _ostr.write((const char*) &value, sizeof(value));
-}
-
-
-void BinaryWriter::flush()
-{
- _ostr.flush();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Bugcheck.cpp b/Utilities/Poco/Foundation/src/Bugcheck.cpp
deleted file mode 100755
index 2338c17508..0000000000
--- a/Utilities/Poco/Foundation/src/Bugcheck.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Bugcheck.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Bugcheck
-//
-// Copyright (c) 2004-2006, 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/Bugcheck.h"
-#include "Poco/Debugger.h"
-#include "Poco/Exception.h"
-#include <sstream>
-
-
-namespace Poco {
-
-
-void Bugcheck::assertion(const char* cond, const char* file, int line)
-{
- Debugger::enter(std::string("Assertion violation: ") + cond, file, line);
- throw AssertionViolationException(what(cond, file, line));
-}
-
-
-void Bugcheck::nullPointer(const char* ptr, const char* file, int line)
-{
- Debugger::enter(std::string("NULL pointer: ") + ptr, file, line);
- throw NullPointerException(what(ptr, file, line));
-}
-
-
-void Bugcheck::bugcheck(const char* file, int line)
-{
- Debugger::enter("Bugcheck", file, line);
- throw BugcheckException(what(0, file, line));
-}
-
-
-void Bugcheck::bugcheck(const char* msg, const char* file, int line)
-{
- std::string m("Bugcheck");
- if (msg)
- {
- m.append(": ");
- m.append(msg);
- }
- Debugger::enter(m, file, line);
- throw BugcheckException(what(msg, file, line));
-}
-
-
-void Bugcheck::debugger(const char* file, int line)
-{
- Debugger::enter(file, line);
-}
-
-
-void Bugcheck::debugger(const char* msg, const char* file, int line)
-{
- Debugger::enter(msg, file, line);
-}
-
-
-std::string Bugcheck::what(const char* msg, const char* file, int line)
-{
- std::ostringstream str;
- if (msg) str << msg << " ";
- str << "in file \"" << file << "\", line " << line;
- return str.str();
-}
-
-
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/ByteOrder.cpp b/Utilities/Poco/Foundation/src/ByteOrder.cpp
deleted file mode 100755
index 00339fc2ce..0000000000
--- a/Utilities/Poco/Foundation/src/ByteOrder.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// ByteOrder.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: ByteOrder
-//
-// Copyright (c) 2004-2006, 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/ByteOrder.h"
diff --git a/Utilities/Poco/Foundation/src/Channel.cpp b/Utilities/Poco/Foundation/src/Channel.cpp
deleted file mode 100755
index c3fd911175..0000000000
--- a/Utilities/Poco/Foundation/src/Channel.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// Channel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Channel
-//
-// Copyright (c) 2004-2006, 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/Channel.h"
-
-
-namespace Poco {
-
-
-Channel::Channel()
-{
-}
-
-
-Channel::~Channel()
-{
-}
-
-
-void Channel::open()
-{
-}
-
-
-void Channel::close()
-{
-}
-
-
-void Channel::setProperty(const std::string& name, const std::string& value)
-{
- throw PropertyNotSupportedException(name);
-}
-
-
-std::string Channel::getProperty(const std::string& name) const
-{
- throw PropertyNotSupportedException(name);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Checksum.cpp b/Utilities/Poco/Foundation/src/Checksum.cpp
deleted file mode 100755
index e3c4874796..0000000000
--- a/Utilities/Poco/Foundation/src/Checksum.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// Checksum.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Checksum
-//
-// Copyright (c) 2007, 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/Checksum.h"
-#include "Poco/zlib.h"
-
-
-namespace Poco {
-
-
-Checksum::Checksum():
- _type(TYPE_CRC32),
- _value(crc32(0L, Z_NULL, 0))
-{
-}
-
-
-Checksum::Checksum(Type t):
- _type(t),
- _value(0)
-{
- if (t == TYPE_CRC32)
- _value = crc32(0L, Z_NULL, 0);
- else
- _value = adler32(0L, Z_NULL, 0);
-}
-
-
-Checksum::~Checksum()
-{
-}
-
-
-void Checksum::update(const char* data, unsigned length)
-{
- if (_type == TYPE_ADLER32)
- _value = adler32(_value, reinterpret_cast<const Bytef*>(data), length);
- else
- _value = crc32(_value, reinterpret_cast<const Bytef*>(data), length);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Condition.cpp b/Utilities/Poco/Foundation/src/Condition.cpp
deleted file mode 100755
index 6f1c4c17da..0000000000
--- a/Utilities/Poco/Foundation/src/Condition.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// Condition.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Condition
-//
-// Copyright (c) 2007, 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/Condition.h"
-
-
-namespace Poco {
-
-
-Condition::Condition()
-{
-}
-
-Condition::~Condition()
-{
-}
-
-
-void Condition::signal()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (!_waitQueue.empty())
- {
- _waitQueue.front()->set();
- dequeue();
- }
-}
-
-
-void Condition::broadcast()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- for (WaitQueue::iterator it = _waitQueue.begin(); it != _waitQueue.end(); ++it)
- {
- (*it)->set();
- }
- _waitQueue.clear();
-}
-
-
-void Condition::enqueue(Event& event)
-{
- _waitQueue.push_back(&event);
-}
-
-
-void Condition::dequeue()
-{
- _waitQueue.pop_front();
-}
-
-
-void Condition::dequeue(Event& event)
-{
- for (WaitQueue::iterator it = _waitQueue.begin(); it != _waitQueue.end(); ++it)
- {
- if (*it == &event)
- {
- _waitQueue.erase(it);
- break;
- }
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Configurable.cpp b/Utilities/Poco/Foundation/src/Configurable.cpp
deleted file mode 100755
index 33e34dc523..0000000000
--- a/Utilities/Poco/Foundation/src/Configurable.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Configurable.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Configurable
-//
-// Copyright (c) 2004-2006, 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/Configurable.h"
-
-
-namespace Poco {
-
-
-Configurable::Configurable()
-{
-}
-
-
-Configurable::~Configurable()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/ConsoleChannel.cpp b/Utilities/Poco/Foundation/src/ConsoleChannel.cpp
deleted file mode 100755
index 45c431a103..0000000000
--- a/Utilities/Poco/Foundation/src/ConsoleChannel.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// ConsoleChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: ConsoleChannel
-//
-// Copyright (c) 2004-2006, 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/ConsoleChannel.h"
-#include "Poco/Message.h"
-#include <iostream>
-
-
-namespace Poco {
-
-
-FastMutex ConsoleChannel::_mutex;
-
-
-ConsoleChannel::ConsoleChannel(): _str(std::clog)
-{
-}
-
-
-ConsoleChannel::ConsoleChannel(std::ostream& str): _str(str)
-{
-}
-
-
-ConsoleChannel::~ConsoleChannel()
-{
-}
-
-
-void ConsoleChannel::log(const Message& msg)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- _str << msg.getText() << std::endl;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/CountingStream.cpp b/Utilities/Poco/Foundation/src/CountingStream.cpp
deleted file mode 100755
index e820585a28..0000000000
--- a/Utilities/Poco/Foundation/src/CountingStream.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-//
-// CountingStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: CountingStream
-//
-// Copyright (c) 2004-2006, 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/CountingStream.h"
-
-
-namespace Poco {
-
-
-CountingStreamBuf::CountingStreamBuf():
- _pIstr(0),
- _pOstr(0),
- _chars(0),
- _lines(0),
- _pos(0)
-{
-}
-
-
-CountingStreamBuf::CountingStreamBuf(std::istream& istr):
- _pIstr(&istr),
- _pOstr(0),
- _chars(0),
- _lines(0),
- _pos(0)
-{
-}
-
-
-CountingStreamBuf::CountingStreamBuf(std::ostream& ostr):
- _pIstr(0),
- _pOstr(&ostr),
- _chars(0),
- _lines(0),
- _pos(0)
-{
-}
-
-
-CountingStreamBuf::~CountingStreamBuf()
-{
-}
-
-
-int CountingStreamBuf::readFromDevice()
-{
- if (_pIstr)
- {
- int c = _pIstr->get();
- if (c != -1)
- {
- ++_chars;
- if (_pos++ == 0) ++_lines;
- if (c == '\n') _pos = 0;
- }
- return c;
- }
- return -1;
-}
-
-
-int CountingStreamBuf::writeToDevice(char c)
-{
- ++_chars;
- if (_pos++ == 0) ++_lines;
- if (c == '\n') _pos = 0;
- if (_pOstr) _pOstr->put(c);
- return charToInt(c);
-}
-
-
-void CountingStreamBuf::reset()
-{
- _chars = 0;
- _lines = 0;
- _pos = 0;
-}
-
-
-void CountingStreamBuf::setCurrentLineNumber(int line)
-{
- _lines = line;
-}
-
-
-CountingIOS::CountingIOS()
-{
- poco_ios_init(&_buf);
-}
-
-
-CountingIOS::CountingIOS(std::istream& istr): _buf(istr)
-{
- poco_ios_init(&_buf);
-}
-
-
-CountingIOS::CountingIOS(std::ostream& ostr): _buf(ostr)
-{
- poco_ios_init(&_buf);
-}
-
-
-CountingIOS::~CountingIOS()
-{
-}
-
-
-void CountingIOS::reset()
-{
- _buf.reset();
-}
-
-
-void CountingIOS::setCurrentLineNumber(int line)
-{
- _buf.setCurrentLineNumber(line);
-}
-
-
-CountingStreamBuf* CountingIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-CountingInputStream::CountingInputStream(std::istream& istr): CountingIOS(istr), std::istream(&_buf)
-{
-}
-
-
-CountingInputStream::~CountingInputStream()
-{
-}
-
-
-CountingOutputStream::CountingOutputStream(): std::ostream(&_buf)
-{
-}
-
-
-CountingOutputStream::CountingOutputStream(std::ostream& ostr): CountingIOS(ostr), std::ostream(&_buf)
-{
-}
-
-
-CountingOutputStream::~CountingOutputStream()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DateTime.cpp b/Utilities/Poco/Foundation/src/DateTime.cpp
deleted file mode 100755
index 5f8ee11e46..0000000000
--- a/Utilities/Poco/Foundation/src/DateTime.cpp
+++ /dev/null
@@ -1,423 +0,0 @@
-//
-// DateTime.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: DateTime
-//
-// Copyright (c) 2004-2006, 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/DateTime.h"
-#include "Poco/Timespan.h"
-#include <algorithm>
-#include <cmath>
-
-
-namespace Poco {
-
-
-inline double DateTime::toJulianDay(Timestamp::UtcTimeVal utcTime)
-{
- double utcDays = double(utcTime)/864000000000.0;
- return utcDays + 2299160.5; // first day of Gregorian reform (Oct 15 1582)
-}
-
-
-inline Timestamp::UtcTimeVal DateTime::toUtcTime(double julianDay)
-{
- return Timestamp::UtcTimeVal((julianDay - 2299160.5)*864000000000.0);
-}
-
-
-DateTime::DateTime()
-{
- Timestamp now;
- _utcTime = now.utcTime();
- computeGregorian(julianDay());
- computeDaytime();
-}
-
-
-DateTime::DateTime(const Timestamp& timestamp):
- _utcTime(timestamp.utcTime())
-{
- computeGregorian(julianDay());
- computeDaytime();
-}
-
-
-DateTime::DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond):
- _year(year),
- _month(month),
- _day(day),
- _hour(hour),
- _minute(minute),
- _second(second),
- _millisecond(millisecond),
- _microsecond(microsecond)
-{
- poco_assert (year >= 0 && year <= 9999);
- poco_assert (month >= 1 && month <= 12);
- poco_assert (day >= 1 && day <= daysOfMonth(year, month));
- poco_assert (hour >= 0 && hour <= 23);
- poco_assert (minute >= 0 && minute <= 59);
- poco_assert (second >= 0 && second <= 59);
- poco_assert (millisecond >= 0 && millisecond <= 999);
- poco_assert (microsecond >= 0 && microsecond <= 999);
-
- _utcTime = toUtcTime(toJulianDay(year, month, day)) + 10*(hour*Timespan::HOURS + minute*Timespan::MINUTES + second*Timespan::SECONDS + millisecond*Timespan::MILLISECONDS + microsecond);
-}
-
-
-DateTime::DateTime(double julianDay):
- _utcTime(toUtcTime(julianDay))
-{
- computeGregorian(julianDay);
-}
-
-
-DateTime::DateTime(Timestamp::UtcTimeVal utcTime, Timestamp::TimeDiff diff):
- _utcTime(utcTime + diff*10)
-{
- computeGregorian(julianDay());
- computeDaytime();
-}
-
-
-DateTime::DateTime(const DateTime& dateTime):
- _utcTime(dateTime._utcTime),
- _year(dateTime._year),
- _month(dateTime._month),
- _day(dateTime._day),
- _hour(dateTime._hour),
- _minute(dateTime._minute),
- _second(dateTime._second),
- _millisecond(dateTime._millisecond),
- _microsecond(dateTime._microsecond)
-{
-}
-
-
-DateTime::~DateTime()
-{
-}
-
-
-DateTime& DateTime::operator = (const DateTime& dateTime)
-{
- if (&dateTime != this)
- {
- _utcTime = dateTime._utcTime;
- _year = dateTime._year;
- _month = dateTime._month;
- _day = dateTime._day;
- _hour = dateTime._hour;
- _minute = dateTime._minute;
- _second = dateTime._second;
- _millisecond = dateTime._millisecond;
- _microsecond = dateTime._microsecond;
- }
- return *this;
-}
-
-
-DateTime& DateTime::operator = (const Timestamp& timestamp)
-{
- _utcTime = timestamp.utcTime();
- computeGregorian(julianDay());
- computeDaytime();
- return *this;
-}
-
-
-DateTime& DateTime::operator = (double julianDay)
-{
- _utcTime = toUtcTime(julianDay);
- computeGregorian(julianDay);
- return *this;
-}
-
-
-DateTime& DateTime::assign(int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond)
-{
- poco_assert (year >= 0 && year <= 9999);
- poco_assert (month >= 1 && month <= 12);
- poco_assert (day >= 1 && day <= daysOfMonth(year, month));
- poco_assert (hour >= 0 && hour <= 23);
- poco_assert (minute >= 0 && minute <= 59);
- poco_assert (second >= 0 && second <= 59);
- poco_assert (millisecond >= 0 && millisecond <= 999);
- poco_assert (microsecond >= 0 && microsecond <= 999);
-
- _utcTime = toUtcTime(toJulianDay(year, month, day)) + 10*(hour*Timespan::HOURS + minute*Timespan::MINUTES + second*Timespan::SECONDS + millisecond*Timespan::MILLISECONDS + microsecond);
- _year = year;
- _month = month;
- _day = day;
- _hour = hour;
- _minute = minute;
- _second = second;
- _millisecond = millisecond;
- _microsecond = microsecond;
-
- return *this;
-}
-
-
-void DateTime::swap(DateTime& dateTime)
-{
- std::swap(_utcTime, dateTime._utcTime);
- std::swap(_year, dateTime._year);
- std::swap(_month, dateTime._month);
- std::swap(_day, dateTime._day);
- std::swap(_hour, dateTime._hour);
- std::swap(_minute, dateTime._minute);
- std::swap(_second, dateTime._second);
- std::swap(_millisecond, dateTime._millisecond);
- std::swap(_microsecond, dateTime._microsecond);
-}
-
-
-int DateTime::dayOfWeek() const
-{
- return int((std::floor(julianDay() + 1.5))) % 7;
-}
-
-
-int DateTime::dayOfYear() const
-{
- int doy = 0;
- for (int month = 1; month < _month; ++month)
- doy += daysOfMonth(_year, month);
- doy += _day;
- return doy;
-}
-
-
-int DateTime::daysOfMonth(int year, int month)
-{
- poco_assert (month >= 1 && month <= 12);
-
- static int daysOfMonthTable[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-
- if (month == 2 && isLeapYear(year))
- return 29;
- else
- return daysOfMonthTable[month];
-}
-
-
-bool DateTime::isValid(int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond)
-{
- return
- (year >= 0 && year <= 9999) &&
- (month >= 1 && month <= 12) &&
- (day >= 1 && day <= daysOfMonth(year, month)) &&
- (hour >= 0 && hour <= 23) &&
- (minute >= 0 && minute <= 59) &&
- (second >= 0 && second <= 59) &&
- (millisecond >= 0 && millisecond <= 999) &&
- (microsecond >= 0 && microsecond <= 999);
-}
-
-
-int DateTime::week(int firstDayOfWeek) const
-{
- poco_assert (firstDayOfWeek >= 0 && firstDayOfWeek <= 6);
-
- /// find the first firstDayOfWeek.
- int baseDay = 1;
- while (DateTime(_year, 1, baseDay).dayOfWeek() != firstDayOfWeek) ++baseDay;
-
- int doy = dayOfYear();
- int offs = baseDay <= 4 ? 0 : 1;
- if (doy < baseDay)
- return offs;
- else
- return (doy - baseDay)/7 + 1 + offs;
-}
-
-
-double DateTime::julianDay() const
-{
- return toJulianDay(_utcTime);
-}
-
-
-DateTime DateTime::operator + (const Timespan& span) const
-{
- return DateTime(_utcTime, span.totalMicroseconds());
-}
-
-
-DateTime DateTime::operator - (const Timespan& span) const
-{
- return DateTime(_utcTime, -span.totalMicroseconds());
-}
-
-
-Timespan DateTime::operator - (const DateTime& dateTime) const
-{
- return Timespan((_utcTime - dateTime._utcTime)/10);
-}
-
-
-DateTime& DateTime::operator += (const Timespan& span)
-{
- _utcTime += span.totalMicroseconds()*10;
- computeGregorian(julianDay());
- computeDaytime();
- return *this;
-}
-
-
-DateTime& DateTime::operator -= (const Timespan& span)
-{
- _utcTime -= span.totalMicroseconds()*10;
- computeGregorian(julianDay());
- computeDaytime();
- return *this;
-}
-
-
-void DateTime::makeUTC(int tzd)
-{
- operator -= (Timespan(((Timestamp::TimeDiff) tzd)*Timespan::SECONDS));
-}
-
-
-void DateTime::makeLocal(int tzd)
-{
- operator += (Timespan(((Timestamp::TimeDiff) tzd)*Timespan::SECONDS));
-}
-
-
-double DateTime::toJulianDay(int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond)
-{
- // lookup table for (153*month - 457)/5 - note that 3 <= month <= 14.
- static int lookup[] = {-91, -60, -30, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275, 306, 337};
-
- // day to double
- double dday = double(day) + ((double((hour*60 + minute)*60 + second)*1000 + millisecond)*1000 + microsecond)/86400000000.0;
- if (month < 3)
- {
- month += 12;
- --year;
- }
- double dyear = double(year);
- return dday + lookup[month] + 365*year + std::floor(dyear/4) - std::floor(dyear/100) + std::floor(dyear/400) + 1721118.5;
-}
-
-
-void DateTime::checkLimit(short& lower, short& higher, short limit)
-{
- if (lower > limit)
- {
- higher += short(lower / limit);
- lower = short(lower % limit);
- }
-}
-
-
-void DateTime::normalize()
-{
- checkLimit(_microsecond, _millisecond, 999);
- checkLimit(_millisecond, _second, 999);
- checkLimit(_second, _minute, 59);
- checkLimit(_minute, _hour, 59);
- checkLimit(_hour, _day, 23);
-
- if (_day > daysOfMonth(_year, _month))
- {
- _day -= daysOfMonth(_year, _month);
- if (++_month > 12)
- {
- ++_year;
- _month -= 12;
- }
- }
-}
-
-
-void DateTime::computeGregorian(double julianDay)
-{
- double z = std::floor(julianDay - 1721118.5);
- double r = julianDay - 1721118.5 - z;
- double g = z - 0.25;
- double a = std::floor(g / 36524.25);
- double b = a - std::floor(a/4);
- _year = short(std::floor((b + g)/365.25));
- double c = b + z - std::floor(365.25*_year);
- _month = short(std::floor((5*c + 456)/153));
- double dday = c - std::floor((153.0*_month - 457)/5) + r;
- _day = short(dday);
- if (_month > 12)
- {
- ++_year;
- _month -= 12;
- }
- r *= 24;
- _hour = short(std::floor(r));
- r -= std::floor(r);
- r *= 60;
- _minute = short(std::floor(r));
- r -= std::floor(r);
- r *= 60;
- _second = short(std::floor(r));
- r -= std::floor(r);
- r *= 1000;
- _millisecond = short(std::floor(r));
- r -= std::floor(r);
- r *= 1000;
- _microsecond = short(r + 0.5);
-
- normalize();
-
- poco_assert_dbg (_month >= 1 && _month <= 12);
- poco_assert_dbg (_day >= 1 && _day <= daysOfMonth(_year, _month));
- poco_assert_dbg (_hour >= 0 && _hour <= 23);
- poco_assert_dbg (_minute >= 0 && _minute <= 59);
- poco_assert_dbg (_second >= 0 && _second <= 59);
- poco_assert_dbg (_millisecond >= 0 && _millisecond <= 999);
- poco_assert_dbg (_microsecond >= 0 && _microsecond <= 999);
-}
-
-
-void DateTime::computeDaytime()
-{
- Timespan span(_utcTime/10);
- _hour = span.hours();
- _minute = span.minutes();
- _second = span.seconds();
- _millisecond = span.milliseconds();
- _microsecond = span.microseconds();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DateTimeFormat.cpp b/Utilities/Poco/Foundation/src/DateTimeFormat.cpp
deleted file mode 100755
index df1cc2189a..0000000000
--- a/Utilities/Poco/Foundation/src/DateTimeFormat.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// DateTimeFormat.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: DateTimeFormat
-//
-// Copyright (c) 2004-2006, 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/DateTimeFormat.h"
-
-
-namespace Poco {
-
-
-const std::string DateTimeFormat::ISO8601_FORMAT = "%Y-%m-%dT%H:%M:%S%z";
-const std::string DateTimeFormat::RFC822_FORMAT = "%w, %e %b %y %H:%M:%S %Z";
-const std::string DateTimeFormat::RFC1123_FORMAT = "%w, %e %b %Y %H:%M:%S %Z";
-const std::string DateTimeFormat::HTTP_FORMAT = "%w, %d %b %Y %H:%M:%S %Z";
-const std::string DateTimeFormat::RFC850_FORMAT = "%W, %e-%b-%y %H:%M:%S %Z";
-const std::string DateTimeFormat::RFC1036_FORMAT = "%W, %e %b %y %H:%M:%S %Z";
-const std::string DateTimeFormat::ASCTIME_FORMAT = "%w %b %f %H:%M:%S %Y";
-const std::string DateTimeFormat::SORTABLE_FORMAT = "%Y-%m-%d %H:%M:%S";
-
-
-const std::string DateTimeFormat::WEEKDAY_NAMES[] =
-{
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday"
-};
-
-
-const std::string DateTimeFormat::MONTH_NAMES[] =
-{
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December"
-};
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DateTimeFormatter.cpp b/Utilities/Poco/Foundation/src/DateTimeFormatter.cpp
deleted file mode 100755
index 50f49762ac..0000000000
--- a/Utilities/Poco/Foundation/src/DateTimeFormatter.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// DateTimeFormatter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: DateTimeFormatter
-//
-// Copyright (c) 2004-2006, 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/DateTimeFormatter.h"
-#include "Poco/DateTimeFormat.h"
-#include "Poco/Timestamp.h"
-#include "Poco/NumberFormatter.h"
-
-
-namespace Poco {
-
-
-void DateTimeFormatter::append(std::string& str, const DateTime& dateTime, const std::string& fmt, int timeZoneDifferential)
-{
- std::string::const_iterator it = fmt.begin();
- std::string::const_iterator end = fmt.end();
- while (it != end)
- {
- if (*it == '%')
- {
- if (++it != end)
- {
- switch (*it)
- {
- case 'w': str.append(DateTimeFormat::WEEKDAY_NAMES[dateTime.dayOfWeek()], 0, 3); break;
- case 'W': str.append(DateTimeFormat::WEEKDAY_NAMES[dateTime.dayOfWeek()]); break;
- case 'b': str.append(DateTimeFormat::MONTH_NAMES[dateTime.month() - 1], 0, 3); break;
- case 'B': str.append(DateTimeFormat::MONTH_NAMES[dateTime.month() - 1]); break;
- case 'd': NumberFormatter::append0(str, dateTime.day(), 2); break;
- case 'e': NumberFormatter::append(str, dateTime.day()); break;
- case 'f': NumberFormatter::append(str, dateTime.day(), 2); break;
- case 'm': NumberFormatter::append0(str, dateTime.month(), 2); break;
- case 'n': NumberFormatter::append(str, dateTime.month()); break;
- case 'o': NumberFormatter::append(str, dateTime.month(), 2); break;
- case 'y': NumberFormatter::append0(str, dateTime.year() % 100, 2); break;
- case 'Y': NumberFormatter::append0(str, dateTime.year(), 4); break;
- case 'H': NumberFormatter::append0(str, dateTime.hour(), 2); break;
- case 'h': NumberFormatter::append0(str, dateTime.hourAMPM(), 2); break;
- case 'a': str.append(dateTime.isAM() ? "am" : "pm"); break;
- case 'A': str.append(dateTime.isAM() ? "AM" : "PM"); break;
- case 'M': NumberFormatter::append0(str, dateTime.minute(), 2); break;
- case 'S': NumberFormatter::append0(str, dateTime.second(), 2); break;
- case 'i': NumberFormatter::append0(str, dateTime.millisecond(), 3); break;
- case 'c': NumberFormatter::append(str, dateTime.millisecond()/100); break;
- case 'F': NumberFormatter::append0(str, dateTime.millisecond()*1000 + dateTime.microsecond(), 6); break;
- case 'z': tzdISO(str, timeZoneDifferential); break;
- case 'Z': tzdRFC(str, timeZoneDifferential); break;
- default: str += *it;
- }
- ++it;
- }
- }
- else str += *it++;
- }
-}
-
-
-void DateTimeFormatter::append(std::string& str, const Timespan& timespan, const std::string& fmt)
-{
- std::string::const_iterator it = fmt.begin();
- std::string::const_iterator end = fmt.end();
- while (it != end)
- {
- if (*it == '%')
- {
- if (++it != end)
- {
- switch (*it)
- {
- case 'd': NumberFormatter::append(str, timespan.days()); break;
- case 'H': NumberFormatter::append0(str, timespan.hours(), 2); break;
- case 'h': NumberFormatter::append(str, timespan.totalHours()); break;
- case 'M': NumberFormatter::append0(str, timespan.minutes(), 2); break;
- case 'm': NumberFormatter::append(str, timespan.totalMinutes()); break;
- case 'S': NumberFormatter::append0(str, timespan.seconds(), 2); break;
- case 's': NumberFormatter::append(str, timespan.totalSeconds()); break;
- case 'i': NumberFormatter::append0(str, timespan.milliseconds(), 3); break;
- case 'c': NumberFormatter::append(str, timespan.milliseconds()/100); break;
- case 'F': NumberFormatter::append0(str, timespan.milliseconds()*1000 + timespan.microseconds(), 6); break;
- default: str += *it;
- }
- ++it;
- }
- }
- else str += *it++;
- }
-}
-
-
-void DateTimeFormatter::tzdISO(std::string& str, int timeZoneDifferential)
-{
- if (timeZoneDifferential != UTC)
- {
- if (timeZoneDifferential >= 0)
- {
- str += '+';
- NumberFormatter::append0(str, timeZoneDifferential/3600, 2);
- str += ':';
- NumberFormatter::append0(str, (timeZoneDifferential%3600)/60, 2);
- }
- else
- {
- str += '-';
- NumberFormatter::append0(str, -timeZoneDifferential/3600, 2);
- str += ':';
- NumberFormatter::append0(str, (-timeZoneDifferential%3600)/60, 2);
- }
- }
- else str += 'Z';
-}
-
-
-void DateTimeFormatter::tzdRFC(std::string& str, int timeZoneDifferential)
-{
- if (timeZoneDifferential != UTC)
- {
- if (timeZoneDifferential >= 0)
- {
- str += '+';
- NumberFormatter::append0(str, timeZoneDifferential/3600, 2);
- NumberFormatter::append0(str, (timeZoneDifferential%3600)/60, 2);
- }
- else
- {
- str += '-';
- NumberFormatter::append0(str, -timeZoneDifferential/3600, 2);
- NumberFormatter::append0(str, (-timeZoneDifferential%3600)/60, 2);
- }
- }
- else str += "GMT";
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DateTimeParser.cpp b/Utilities/Poco/Foundation/src/DateTimeParser.cpp
deleted file mode 100755
index d3288dd2f4..0000000000
--- a/Utilities/Poco/Foundation/src/DateTimeParser.cpp
+++ /dev/null
@@ -1,375 +0,0 @@
-//
-// DateTimeParser.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: DateTimeParser
-//
-// Copyright (c) 2004-2006, 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/DateTimeParser.h"
-#include "Poco/DateTimeFormat.h"
-#include "Poco/DateTime.h"
-#include "Poco/Exception.h"
-#include <cctype>
-
-
-namespace Poco {
-
-
-#define SKIP_JUNK() \
- while (it != end && !std::isdigit(*it)) ++it
-
-
-#define PARSE_NUMBER(var) \
- while (it != end && std::isdigit(*it)) var = var*10 + ((*it++) - '0')
-
-
-#define PARSE_NUMBER_N(var, n) \
- { int i = 0; while (i++ < n && it != end && std::isdigit(*it)) var = var*10 + ((*it++) - '0'); }
-
-
-void DateTimeParser::parse(const std::string& fmt, const std::string& str, DateTime& dateTime, int& timeZoneDifferential)
-{
- int year = 0;
- int month = 0;
- int day = 0;
- int hour = 0;
- int minute = 0;
- int second = 0;
- int millis = 0;
- int micros = 0;
- int tzd = 0;
-
- std::string::const_iterator it = str.begin();
- std::string::const_iterator end = str.end();
- std::string::const_iterator itf = fmt.begin();
- std::string::const_iterator endf = fmt.end();
-
- while (itf != endf && it != end)
- {
- if (*itf == '%')
- {
- if (++itf != endf)
- {
- switch (*itf)
- {
- case 'w':
- case 'W':
- while (it != end && std::isspace(*it)) ++it;
- while (it != end && std::isalpha(*it)) ++it;
- break;
- case 'b':
- case 'B':
- month = parseMonth(it, end);
- break;
- case 'd':
- case 'e':
- case 'f':
- SKIP_JUNK();
- PARSE_NUMBER_N(day, 2);
- break;
- case 'm':
- case 'n':
- case 'o':
- SKIP_JUNK();
- PARSE_NUMBER_N(month, 2);
- break;
- case 'y':
- SKIP_JUNK();
- PARSE_NUMBER_N(year, 2);
- if (year >= 70)
- year += 1900;
- else
- year += 2000;
- break;
- case 'Y':
- SKIP_JUNK();
- PARSE_NUMBER_N(year, 4);
- break;
- case 'H':
- case 'h':
- SKIP_JUNK();
- PARSE_NUMBER_N(hour, 2);
- break;
- case 'a':
- case 'A':
- hour = parseAMPM(it, end, hour);
- break;
- case 'M':
- SKIP_JUNK();
- PARSE_NUMBER_N(minute, 2);
- break;
- case 'S':
- SKIP_JUNK();
- PARSE_NUMBER_N(second, 2);
- break;
- case 'i':
- SKIP_JUNK();
- PARSE_NUMBER_N(millis, 3);
- break;
- case 'c':
- SKIP_JUNK();
- PARSE_NUMBER_N(millis, 1);
- millis *= 100;
- break;
- case 'F':
- SKIP_JUNK();
- PARSE_NUMBER_N(millis, 3);
- PARSE_NUMBER_N(micros, 3);
- break;
- case 'z':
- case 'Z':
- tzd = parseTZD(it, end);
- break;
- }
- ++itf;
- }
- }
- else ++itf;
- }
- if (month == 0) month = 1;
- if (day == 0) day = 1;
- if (DateTime::isValid(year, month, day, hour, minute, second, millis, micros))
- dateTime.assign(year, month, day, hour, minute, second, millis, micros);
- else
- throw SyntaxException("date/time component out of range");
- timeZoneDifferential = tzd;
-}
-
-
-DateTime DateTimeParser::parse(const std::string& fmt, const std::string& str, int& timeZoneDifferential)
-{
- DateTime result;
- parse(fmt, str, result, timeZoneDifferential);
- return result;
-}
-
-
-bool DateTimeParser::tryParse(const std::string& fmt, const std::string& str, DateTime& dateTime, int& timeZoneDifferential)
-{
- try
- {
- parse(fmt, str, dateTime, timeZoneDifferential);
- }
- catch (Exception&)
- {
- return false;
- }
- return true;
-}
-
-
-void DateTimeParser::parse(const std::string& str, DateTime& dateTime, int& timeZoneDifferential)
-{
- if (!tryParse(str, dateTime, timeZoneDifferential))
- throw SyntaxException("Unsupported or invalid date/time format");
-}
-
-
-DateTime DateTimeParser::parse(const std::string& str, int& timeZoneDifferential)
-{
- DateTime result;
- if (tryParse(str, result, timeZoneDifferential))
- return result;
- else
- throw SyntaxException("Unsupported or invalid date/time format");
-}
-
-
-bool DateTimeParser::tryParse(const std::string& str, DateTime& dateTime, int& timeZoneDifferential)
-{
- if (str.length() < 4) return false;
-
- if (str[3] == ',')
- return tryParse(DateTimeFormat::RFC822_FORMAT, str, dateTime, timeZoneDifferential);
- else if (str[3] == ' ')
- return tryParse(DateTimeFormat::ASCTIME_FORMAT, str, dateTime, timeZoneDifferential);
- else if (str.find(',') != std::string::npos)
- return tryParse(DateTimeFormat::RFC850_FORMAT, str, dateTime, timeZoneDifferential);
- else if (std::isdigit(str[0]))
- {
- if (str.find(' ') != std::string::npos || str.length() == 10)
- return tryParse(DateTimeFormat::SORTABLE_FORMAT, str, dateTime, timeZoneDifferential);
- else
- return tryParse(DateTimeFormat::ISO8601_FORMAT, str, dateTime, timeZoneDifferential);
- }
- else return false;
-}
-
-
-int DateTimeParser::parseTZD(std::string::const_iterator& it, const std::string::const_iterator& end)
-{
- struct Zone
- {
- const char* designator;
- int timeZoneDifferential;
- };
-
- static Zone zones[] =
- {
- {"Z", 0},
- {"UT", 0},
- {"GMT", 0},
- {"BST", 1*3600},
- {"IST", 1*3600},
- {"WET", 0},
- {"WEST", 1*3600},
- {"CET", 1*3600},
- {"CEST", 2*3600},
- {"EET", 2*3600},
- {"EEST", 3*3600},
- {"MSK", 3*3600},
- {"MSD", 4*3600},
- {"NST", -3*3600-1800},
- {"NDT", -2*3600-1800},
- {"AST", -4*3600},
- {"ADT", -3*3600},
- {"EST", -5*3600},
- {"EDT", -4*3600},
- {"CST", -6*3600},
- {"CDT", -5*3600},
- {"MST", -7*3600},
- {"MDT", -6*3600},
- {"PST", -8*3600},
- {"PDT", -7*3600},
- {"AKST", -9*3600},
- {"AKDT", -8*3600},
- {"HST", -10*3600},
- {"AEST", 10*3600},
- {"AEDT", 11*3600},
- {"ACST", 9*3600+1800},
- {"ACDT", 10*3600+1800},
- {"AWST", 8*3600},
- {"AWDT", 9*3600}
- };
-
- while (it != end && std::isspace(*it)) ++it;
- if (it != end)
- {
- if (std::isalpha(*it))
- {
- std::string designator;
- designator += *it++;
- if (it != end && std::isalpha(*it)) designator += *it++;
- if (it != end && std::isalpha(*it)) designator += *it++;
- if (it != end && std::isalpha(*it)) designator += *it++;
- for (unsigned i = 0; i < sizeof(zones)/sizeof(Zone); ++i)
- {
- if (designator == zones[i].designator)
- return zones[i].timeZoneDifferential;
- }
- }
- else if (*it == '+' || *it == '-')
- {
- int sign = *it == '+' ? 1 : -1;
- ++it;
- int hours = 0;
- PARSE_NUMBER_N(hours, 2);
- if (it != end && *it == ':') ++it;
- int minutes = 0;
- PARSE_NUMBER_N(minutes, 2);
- return sign*(hours*3600 + minutes*60);
- }
- }
- return 0;
-}
-
-
-int DateTimeParser::parseMonth(std::string::const_iterator& it, const std::string::const_iterator& end)
-{
- std::string month;
- while ((it != end && std::isspace(*it)) || std::ispunct(*it)) ++it;
- bool isFirst = true;
- while (it != end && std::isalpha(*it))
- {
- char ch = (*it++);
- if (isFirst) { month += std::toupper(ch); isFirst = false; }
- else month += std::tolower(ch);
- }
- if (month.length() < 3) throw SyntaxException("Month name must be at least three characters long", month);
- for (int i = 0; i < 12; ++i)
- {
- if (DateTimeFormat::MONTH_NAMES[i].find(month) == 0)
- return i + 1;
- }
- throw SyntaxException("Not a valid month name", month);
-}
-
-
-int DateTimeParser::parseDayOfWeek(std::string::const_iterator& it, const std::string::const_iterator& end)
-{
- std::string dow;
- while ((it != end && std::isspace(*it)) || std::ispunct(*it)) ++it;
- bool isFirst = true;
- while (it != end && std::isalpha(*it))
- {
- char ch = (*it++);
- if (isFirst) { dow += std::toupper(ch); isFirst = false; }
- else dow += std::tolower(ch);
- }
- if (dow.length() < 3) throw SyntaxException("Weekday name must be at least three characters long", dow);
- for (int i = 0; i < 7; ++i)
- {
- if (DateTimeFormat::WEEKDAY_NAMES[i].find(dow) == 0)
- return i;
- }
- throw SyntaxException("Not a valid weekday name", dow);
-}
-
-
-int DateTimeParser::parseAMPM(std::string::const_iterator& it, const std::string::const_iterator& end, int hour)
-{
- std::string ampm;
- while ((it != end && std::isspace(*it)) || std::ispunct(*it)) ++it;
- while (it != end && std::isalpha(*it))
- {
- char ch = (*it++);
- ampm += std::toupper(ch);
- }
- if (ampm == "AM")
- {
- if (hour == 12)
- return 0;
- else
- return hour;
- }
- else if (ampm == "PM")
- {
- if (hour < 12)
- return hour + 12;
- else
- return hour;
- }
- else throw SyntaxException("Not a valid AM/PM designator", ampm);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Debugger.cpp b/Utilities/Poco/Foundation/src/Debugger.cpp
deleted file mode 100755
index e6cf3425be..0000000000
--- a/Utilities/Poco/Foundation/src/Debugger.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// Debugger.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Debugger
-//
-// Copyright (c) 2004-2006, 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/Debugger.h"
-#include <sstream>
-#include <cstdlib>
-#include <cstdio>
-#if defined(POCO_OS_FAMILY_WINDOWS)
- #include "Poco/UnWindows.h"
-#elif defined(POCO_OS_FAMILY_UNIX)
- #include <unistd.h>
- #include <signal.h>
-#elif defined(POCO_OS_FAMILY_VMS)
- #include <lib$routines.h>
- #include <ssdef.h>
-#endif
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
-#include "Poco/UnicodeConverter.h"
-#endif
-
-
-// NOTE: In this module, we use the C library functions (fputs) for,
-// output since, at the time we're called, the C++ iostream objects std::cout, etc.
-// might not have been initialized yet.
-
-
-namespace Poco {
-
-
-bool Debugger::isAvailable()
-{
-#if defined(_DEBUG)
- #if defined(POCO_OS_FAMILY_WINDOWS)
- return IsDebuggerPresent() ? true : false;
- #elif defined(POCO_OS_FAMILY_UNIX)
- return std::getenv("POCO_ENABLE_DEBUGGER") ? true : false;
- #elif defined(POCO_OS_FAMILY_VMS)
- return true;
- #endif
-#else
- return false;
-#endif
-}
-
-
-void Debugger::message(const std::string& msg)
-{
-#if defined(_DEBUG)
- std::fputs("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", stderr);
- std::fputs(msg.c_str(), stderr);
- std::fputs("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", stderr);
- #if defined(POCO_OS_FAMILY_WINDOWS)
- if (IsDebuggerPresent())
- {
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
- std::wstring umsg;
- UnicodeConverter::toUTF16(msg, umsg);
- umsg += '\n';
- OutputDebugStringW(umsg.c_str());
-#else
- OutputDebugStringA(msg.c_str());
- OutputDebugStringA("\n");
-#endif
- }
- #elif defined(POCO_OS_FAMILY_UNIX)
- #elif defined(POCO_OS_FAMILY_VMS)
- #endif
-#endif
-}
-
-
-void Debugger::message(const std::string& msg, const char* file, int line)
-{
-#if defined(_DEBUG)
- std::ostringstream str;
- str << msg << " [in file \"" << file << "\", line " << line << "]";
- message(str.str());
-#endif
-}
-
-
-void Debugger::enter()
-{
-#if defined(_DEBUG)
- #if defined(POCO_OS_FAMILY_WINDOWS)
- if (IsDebuggerPresent())
- {
- DebugBreak();
- }
- #elif defined(POCO_OS_FAMILY_UNIX)
- if (isAvailable())
- {
- kill(getpid(), SIGINT);
- }
- #elif defined(POCO_OS_FAMILY_VMS)
- {
- const char* cmd = "\012SHOW CALLS";
- lib$signal(SS$_DEBUG, 1, cmd);
- }
- #endif
-#endif
-}
-
-
-void Debugger::enter(const std::string& msg)
-{
-#if defined(_DEBUG)
- message(msg);
- enter();
-#endif
-}
-
-
-void Debugger::enter(const std::string& msg, const char* file, int line)
-{
-#if defined(_DEBUG)
- message(msg, file, line);
- enter();
-#endif
-}
-
-
-void Debugger::enter(const char* file, int line)
-{
-#if defined(_DEBUG)
- message("BREAK", file, line);
- enter();
-#endif
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DeflatingStream.cpp b/Utilities/Poco/Foundation/src/DeflatingStream.cpp
deleted file mode 100755
index 4c6eef9173..0000000000
--- a/Utilities/Poco/Foundation/src/DeflatingStream.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-//
-// DeflatingStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: ZLibStream
-//
-// Copyright (c) 2004-2006, 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/DeflatingStream.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-DeflatingStreamBuf::DeflatingStreamBuf(std::istream& istr, StreamType type, int level):
- BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::in),
- _pIstr(&istr),
- _pOstr(0),
- _eof(false)
-{
- _zstr.zalloc = Z_NULL;
- _zstr.zfree = Z_NULL;
- _zstr.opaque = Z_NULL;
- _zstr.next_in = 0;
- _zstr.avail_in = 0;
- _zstr.next_out = 0;
- _zstr.avail_out = 0;
-
- int rc = deflateInit2(&_zstr, level, Z_DEFLATED, 15 + (type == STREAM_GZIP ? 16 : 0), 8, Z_DEFAULT_STRATEGY);
- if (rc != Z_OK) throw IOException(zError(rc));
-
- _buffer = new char[DEFLATE_BUFFER_SIZE];
-}
-
-
-DeflatingStreamBuf::DeflatingStreamBuf(std::ostream& ostr, StreamType type, int level):
- BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::out),
- _pIstr(0),
- _pOstr(&ostr),
- _eof(false)
-{
- _zstr.zalloc = Z_NULL;
- _zstr.zfree = Z_NULL;
- _zstr.opaque = Z_NULL;
- _zstr.next_in = 0;
- _zstr.avail_in = 0;
- _zstr.next_out = 0;
- _zstr.avail_out = 0;
-
- int rc = deflateInit2(&_zstr, level, Z_DEFLATED, 15 + (type == STREAM_GZIP ? 16 : 0), 8, Z_DEFAULT_STRATEGY);
- if (rc != Z_OK) throw IOException(zError(rc));
-
- _buffer = new char[DEFLATE_BUFFER_SIZE];
-}
-
-
-DeflatingStreamBuf::~DeflatingStreamBuf()
-{
- try
- {
- close();
- }
- catch (...)
- {
- }
- delete [] _buffer;
-}
-
-
-int DeflatingStreamBuf::close()
-{
- sync();
- if (_pIstr)
- {
- int rc = deflateEnd(&_zstr);
- if (rc != Z_OK) throw IOException(zError(rc));
- _pIstr = 0;
- }
- else if (_pOstr)
- {
- if (_zstr.next_out)
- {
- int rc = deflate(&_zstr, Z_FINISH);
- if (rc != Z_OK && rc != Z_STREAM_END) throw IOException(zError(rc));
- _pOstr->write(_buffer, DEFLATE_BUFFER_SIZE - _zstr.avail_out);
- if (!_pOstr->good()) throw IOException(zError(rc));
- _zstr.next_out = (unsigned char*) _buffer;
- _zstr.avail_out = DEFLATE_BUFFER_SIZE;
- while (rc != Z_STREAM_END)
- {
- rc = deflate(&_zstr, Z_FINISH);
- if (rc != Z_OK && rc != Z_STREAM_END) throw IOException(zError(rc));
- _pOstr->write(_buffer, DEFLATE_BUFFER_SIZE - _zstr.avail_out);
- if (!_pOstr->good()) throw IOException(zError(rc));
- _zstr.next_out = (unsigned char*) _buffer;
- _zstr.avail_out = DEFLATE_BUFFER_SIZE;
- }
- rc = deflateEnd(&_zstr);
- if (rc != Z_OK) throw IOException(zError(rc));
- }
- _pOstr = 0;
- }
- return 0;
-}
-
-
-int DeflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length)
-{
- if (!_pIstr) return 0;
- if (_zstr.avail_in == 0 && !_eof)
- {
- int n = 0;
- if (_pIstr->good())
- {
- _pIstr->read(_buffer, DEFLATE_BUFFER_SIZE);
- n = static_cast<int>(_pIstr->gcount());
- }
- if (n > 0)
- {
- _zstr.next_in = (unsigned char*) _buffer;
- _zstr.avail_in = n;
- }
- else
- {
- _zstr.next_in = 0;
- _zstr.avail_in = 0;
- _eof = true;
- }
- }
- _zstr.next_out = (unsigned char*) buffer;
- _zstr.avail_out = static_cast<unsigned>(length);
- for (;;)
- {
- int rc = deflate(&_zstr, _eof ? Z_FINISH : Z_NO_FLUSH);
- if (_eof && rc == Z_STREAM_END)
- {
- rc = deflateEnd(&_zstr);
- if (rc != Z_OK) throw IOException(zError(rc));
- _pIstr = 0;
- return static_cast<int>(length) - _zstr.avail_out;
- }
- if (rc != Z_OK) throw IOException(zError(rc));
- if (_zstr.avail_out == 0)
- {
- return static_cast<int>(length);
- }
- if (_zstr.avail_in == 0)
- {
- int n = 0;
- if (_pIstr->good())
- {
- _pIstr->read(_buffer, DEFLATE_BUFFER_SIZE);
- n = static_cast<int>(_pIstr->gcount());
- }
- if (n > 0)
- {
- _zstr.next_in = (unsigned char*) _buffer;
- _zstr.avail_in = n;
- }
- else
- {
- _zstr.next_in = 0;
- _zstr.avail_in = 0;
- _eof = true;
- }
- }
- }
-}
-
-
-int DeflatingStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
-{
- if (length == 0 || !_pOstr) return 0;
-
- _zstr.next_in = (unsigned char*) buffer;
- _zstr.avail_in = static_cast<unsigned>(length);
- _zstr.next_out = (unsigned char*) _buffer;
- _zstr.avail_out = DEFLATE_BUFFER_SIZE;
- for (;;)
- {
- int rc = deflate(&_zstr, Z_NO_FLUSH);
- if (rc != Z_OK) throw IOException(zError(rc));
- if (_zstr.avail_out == 0)
- {
- _pOstr->write(_buffer, DEFLATE_BUFFER_SIZE);
- if (!_pOstr->good()) throw IOException(zError(rc));
- _zstr.next_out = (unsigned char*) _buffer;
- _zstr.avail_out = DEFLATE_BUFFER_SIZE;
- }
- if (_zstr.avail_in == 0)
- {
- _pOstr->write(_buffer, DEFLATE_BUFFER_SIZE - _zstr.avail_out);
- if (!_pOstr->good()) throw IOException(zError(rc));
- _zstr.next_out = (unsigned char*) _buffer;
- _zstr.avail_out = DEFLATE_BUFFER_SIZE;
- break;
- }
- }
- return static_cast<int>(length);
-}
-
-
-DeflatingIOS::DeflatingIOS(std::ostream& ostr, DeflatingStreamBuf::StreamType type, int level):
- _buf(ostr, type, level)
-{
- poco_ios_init(&_buf);
-}
-
-
-DeflatingIOS::DeflatingIOS(std::istream& istr, DeflatingStreamBuf::StreamType type, int level):
- _buf(istr, type, level)
-{
- poco_ios_init(&_buf);
-}
-
-
-DeflatingIOS::~DeflatingIOS()
-{
-}
-
-
-DeflatingStreamBuf* DeflatingIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-DeflatingOutputStream::DeflatingOutputStream(std::ostream& ostr, DeflatingStreamBuf::StreamType type, int level):
- DeflatingIOS(ostr, type, level),
- std::ostream(&_buf)
-{
-}
-
-
-DeflatingOutputStream::~DeflatingOutputStream()
-{
-}
-
-
-int DeflatingOutputStream::close()
-{
- return _buf.close();
-}
-
-
-DeflatingInputStream::DeflatingInputStream(std::istream& istr, DeflatingStreamBuf::StreamType type, int level):
- DeflatingIOS(istr, type, level),
- std::istream(&_buf)
-{
-}
-
-
-DeflatingInputStream::~DeflatingInputStream()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DigestEngine.cpp b/Utilities/Poco/Foundation/src/DigestEngine.cpp
deleted file mode 100755
index d391c628e5..0000000000
--- a/Utilities/Poco/Foundation/src/DigestEngine.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// DigestEngine.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: DigestEngine
-//
-// Copyright (c) 2004-2006, 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/DigestEngine.h"
-
-
-namespace Poco {
-
-
-DigestEngine::DigestEngine()
-{
-}
-
-
-DigestEngine::~DigestEngine()
-{
-}
-
-
-std::string DigestEngine::digestToHex(const Digest& bytes)
-{
- static const char digits[] = "0123456789abcdef";
- std::string result;
- result.reserve(bytes.size()*2);
- for (Digest::const_iterator it = bytes.begin(); it != bytes.end(); ++it)
- {
- unsigned char c = *it;
- result += digits[(c >> 4) & 0xF];
- result += digits[c & 0xF];
- }
- return result;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DigestStream.cpp b/Utilities/Poco/Foundation/src/DigestStream.cpp
deleted file mode 100755
index 9c149e84f2..0000000000
--- a/Utilities/Poco/Foundation/src/DigestStream.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-// DigestStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: DigestStream
-//
-// Copyright (c) 2004-2006, 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/DigestStream.h"
-
-
-namespace Poco {
-
-
-const int DigestBuf::BUFFER_SIZE = 256;
-
-
-DigestBuf::DigestBuf(DigestEngine& eng):
- BufferedStreamBuf(BUFFER_SIZE, std::ios::out),
- _eng(eng),
- _pIstr(0),
- _pOstr(0)
-{
-}
-
-
-DigestBuf::DigestBuf(DigestEngine& eng, std::istream& istr):
- BufferedStreamBuf(BUFFER_SIZE, std::ios::in),
- _eng(eng),
- _pIstr(&istr),
- _pOstr(0)
-{
-}
-
-
-DigestBuf::DigestBuf(DigestEngine& eng, std::ostream& ostr):
- BufferedStreamBuf(BUFFER_SIZE, std::ios::out),
- _eng(eng),
- _pIstr(0),
- _pOstr(&ostr)
-{
-}
-
-
-DigestBuf::~DigestBuf()
-{
-}
-
-
-int DigestBuf::readFromDevice(char* buffer, std::streamsize length)
-{
- if (_pIstr && _pIstr->good())
- {
- _pIstr->read(buffer, length);
- std::streamsize n = _pIstr->gcount();
- if (n > 0) _eng.update(buffer, static_cast<unsigned>(n));
- return static_cast<int>(n);
- }
- return -1;
-}
-
-
-int DigestBuf::writeToDevice(const char* buffer, std::streamsize length)
-{
- _eng.update(buffer, (unsigned) length);
- if (_pOstr) _pOstr->write(buffer, length);
- return static_cast<int>(length);
-}
-
-
-void DigestBuf::close()
-{
- sync();
- if (_pOstr) _pOstr->flush();
-}
-
-
-DigestIOS::DigestIOS(DigestEngine& eng): _buf(eng)
-{
- poco_ios_init(&_buf);
-}
-
-
-DigestIOS::DigestIOS(DigestEngine& eng, std::istream& istr): _buf(eng, istr)
-{
- poco_ios_init(&_buf);
-}
-
-
-DigestIOS::DigestIOS(DigestEngine& eng, std::ostream& ostr): _buf(eng, ostr)
-{
- poco_ios_init(&_buf);
-}
-
-
-DigestIOS::~DigestIOS()
-{
-}
-
-
-DigestBuf* DigestIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-DigestInputStream::DigestInputStream(DigestEngine& eng, std::istream& istr):
- DigestIOS(eng, istr),
- std::istream(&_buf)
-{
-}
-
-
-DigestInputStream::~DigestInputStream()
-{
-}
-
-
-DigestOutputStream::DigestOutputStream(DigestEngine& eng):
- DigestIOS(eng),
- std::ostream(&_buf)
-{
-}
-
-
-DigestOutputStream::DigestOutputStream(DigestEngine& eng, std::ostream& ostr):
- DigestIOS(eng, ostr),
- std::ostream(&_buf)
-{
-}
-
-
-DigestOutputStream::~DigestOutputStream()
-{
-}
-
-
-void DigestOutputStream::close()
-{
- _buf.close();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DirectoryIterator.cpp b/Utilities/Poco/Foundation/src/DirectoryIterator.cpp
deleted file mode 100755
index 66ade9798a..0000000000
--- a/Utilities/Poco/Foundation/src/DirectoryIterator.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// DirectoryIterator.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: DirectoryIterator
-//
-// Copyright (c) 2004-2006, 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/DirectoryIterator.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "DirectoryIterator_WIN32U.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "DirectoryIterator_WIN32.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "DirectoryIterator_UNIX.cpp"
-#else
-#include "DirectoryIterator_VMS.cpp"
-#endif
-
-
-namespace Poco {
-
-
-DirectoryIterator::DirectoryIterator(): _pImpl(0)
-{
-}
-
-
-DirectoryIterator::DirectoryIterator(const std::string& path): _path(path), _pImpl(new DirectoryIteratorImpl(path))
-{
- _path.makeDirectory();
- _path.setFileName(_pImpl->get());
- _file = _path;
-}
-
-
-DirectoryIterator::DirectoryIterator(const DirectoryIterator& iterator): _path(iterator._path), _pImpl(iterator._pImpl)
-{
- _path.makeDirectory();
- if (_pImpl)
- {
- _pImpl->duplicate();
- _path.setFileName(_pImpl->get());
- _file = _path;
- }
-}
-
-
-DirectoryIterator::DirectoryIterator(const File& file): _path(file.path()), _pImpl(new DirectoryIteratorImpl(file.path()))
-{
- _path.makeDirectory();
- _path.setFileName(_pImpl->get());
- _file = _path;
-}
-
-
-DirectoryIterator::DirectoryIterator(const Path& path): _path(path), _pImpl(new DirectoryIteratorImpl(path.toString()))
-{
- _path.makeDirectory();
- _path.setFileName(_pImpl->get());
- _file = _path;
-}
-
-
-DirectoryIterator::~DirectoryIterator()
-{
- if (_pImpl) _pImpl->release();
-}
-
-
-DirectoryIterator& DirectoryIterator::operator = (const DirectoryIterator& it)
-{
- if (_pImpl) _pImpl->release();
- _pImpl = it._pImpl;
- if (_pImpl)
- {
- _pImpl->duplicate();
- _path = it._path;
- _file = _path;
- }
- return *this;
-}
-
-
-DirectoryIterator& DirectoryIterator::operator = (const File& file)
-{
- if (_pImpl) _pImpl->release();
- _pImpl = new DirectoryIteratorImpl(file.path());
- _path.parseDirectory(file.path());
- _path.setFileName(_pImpl->get());
- _file = _path;
- return *this;
-}
-
-
-DirectoryIterator& DirectoryIterator::operator = (const Path& path)
-{
- if (_pImpl) _pImpl->release();
- _pImpl = new DirectoryIteratorImpl(path.toString());
- _path = path;
- _path.makeDirectory();
- _path.setFileName(_pImpl->get());
- _file = _path;
- return *this;
-}
-
-
-DirectoryIterator& DirectoryIterator::operator = (const std::string& path)
-{
- if (_pImpl) _pImpl->release();
- _pImpl = new DirectoryIteratorImpl(path);
- _path.parseDirectory(path);
- _path.setFileName(_pImpl->get());
- _file = _path;
- return *this;
-}
-
-
-DirectoryIterator& DirectoryIterator::operator ++ ()
-{
- if (_pImpl)
- {
- _path.setFileName(_pImpl->next());
- _file = _path;
- }
- return *this;
-}
-
-
-DirectoryIterator DirectoryIterator::operator ++ (int dummy)
-{
- if (_pImpl)
- {
- _path.setFileName(_pImpl->next());
- _file = _path;
- }
- return *this;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DirectoryIterator_UNIX.cpp b/Utilities/Poco/Foundation/src/DirectoryIterator_UNIX.cpp
deleted file mode 100755
index 3d1931185e..0000000000
--- a/Utilities/Poco/Foundation/src/DirectoryIterator_UNIX.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// DirectoryIterator_UNIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: DirectoryIterator
-//
-// Copyright (c) 2004-2006, 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/DirectoryIterator_UNIX.h"
-#include "Poco/File_UNIX.h"
-#include "Poco/Path.h"
-
-
-namespace Poco {
-
-
-DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _pDir(0), _rc(1)
-{
- Path p(path);
- p.makeFile();
-
- _pDir = opendir(p.toString().c_str());
- if (!_pDir) File::handleLastError(path);
-
- next();
-}
-
-
-DirectoryIteratorImpl::~DirectoryIteratorImpl()
-{
- if (_pDir) closedir(_pDir);
-}
-
-
-const std::string& DirectoryIteratorImpl::next()
-{
- do
- {
- struct dirent* pEntry = readdir(_pDir);
- if (pEntry)
- _current = pEntry->d_name;
- else
- _current.clear();
- }
- while (_current == "." || _current == "..");
- return _current;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DirectoryIterator_VMS.cpp b/Utilities/Poco/Foundation/src/DirectoryIterator_VMS.cpp
deleted file mode 100755
index bee84434f2..0000000000
--- a/Utilities/Poco/Foundation/src/DirectoryIterator_VMS.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// DirectoryIterator_VMS.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: DirectoryIterator
-//
-// Copyright (c) 2004-2006, 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/DirectoryIterator_VMS.h"
-#include "Poco/Path.h"
-#include "Poco/Exception.h"
-#include <iodef.h>
-#include <atrdef.h>
-#include <fibdef.h>
-#include <starlet.h>
-
-
-namespace Poco {
-
-
-DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _rc(1)
-{
- Path p(path);
- p.makeDirectory();
- _search = p.toString();
- _search.append("*.*;*");
-
- _fab = cc$rms_fab;
- _fab.fab$l_fna = (char*) _search.c_str();
- _fab.fab$b_fns = _search.size();
- _fab.fab$l_nam = &_nam;
-
- _nam = cc$rms_nam;
- _nam.nam$l_esa = _spec;
- _nam.nam$b_ess = sizeof(_spec);
-
- if (sys$parse(&_fab) & 1)
- throw OpenFileException(path);
-
- next();
-}
-
-
-DirectoryIteratorImpl::~DirectoryIteratorImpl()
-{
-}
-
-
-const std::string& DirectoryIteratorImpl::next()
-{
- if (sys$search(&_fab) & 1)
- _current.clear();
- else
- _current.assign(_fab.fab$l_nam->nam$l_name, _fab.fab$l_nam->nam$b_name + _fab.fab$l_nam->nam$b_type);
- return _current;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DirectoryIterator_WIN32.cpp b/Utilities/Poco/Foundation/src/DirectoryIterator_WIN32.cpp
deleted file mode 100755
index 831c1d367f..0000000000
--- a/Utilities/Poco/Foundation/src/DirectoryIterator_WIN32.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// DirectoryIterator_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: DirectoryIterator
-//
-// Copyright (c) 2004-2006, 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/DirectoryIterator_WIN32.h"
-#include "Poco/File_WIN32.h"
-#include "Poco/Path.h"
-
-
-namespace Poco {
-
-
-DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _fh(INVALID_HANDLE_VALUE), _rc(1)
-{
- Path p(path);
- p.makeDirectory();
- std::string findPath = p.toString();
- findPath.append("*");
-
- _fh = FindFirstFile(findPath.c_str(), &_fd);
- if (_fh == INVALID_HANDLE_VALUE)
- {
- if (GetLastError() != ERROR_NO_MORE_FILES)
- File::handleLastError(path);
- }
- else
- {
- _current = _fd.cFileName;
- if (_current == "." || _current == "..")
- next();
- }
-}
-
-
-DirectoryIteratorImpl::~DirectoryIteratorImpl()
-{
- if (_fh != INVALID_HANDLE_VALUE)
- FindClose(_fh);
-}
-
-
-const std::string& DirectoryIteratorImpl::next()
-{
- do
- {
- if (FindNextFile(_fh, &_fd) != 0)
- _current = _fd.cFileName;
- else
- _current.clear();
- }
- while (_current == "." || _current == "..");
- return _current;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DirectoryIterator_WIN32U.cpp b/Utilities/Poco/Foundation/src/DirectoryIterator_WIN32U.cpp
deleted file mode 100755
index 5644182b7f..0000000000
--- a/Utilities/Poco/Foundation/src/DirectoryIterator_WIN32U.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// DirectoryIterator_WIN32U.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: DirectoryIterator
-//
-// Copyright (c) 2006, 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/DirectoryIterator_WIN32U.h"
-#include "Poco/File_WIN32U.h"
-#include "Poco/Path.h"
-#include "Poco/UnicodeConverter.h"
-#include <cstring>
-
-
-namespace Poco {
-
-
-DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _fh(INVALID_HANDLE_VALUE), _rc(1)
-{
- Path p(path);
- p.makeDirectory();
- std::string findPath = p.toString();
- findPath.append("*");
- std::wstring uFindPath;
- UnicodeConverter::toUTF16(findPath, uFindPath);
-
- _fh = FindFirstFileW(uFindPath.c_str(), &_fd);
- if (_fh == INVALID_HANDLE_VALUE)
- {
- if (GetLastError() != ERROR_NO_MORE_FILES)
- File::handleLastError(path);
- }
- else
- {
- UnicodeConverter::toUTF8(_fd.cFileName, _current);
- if (_current == "." || _current == "..")
- next();
- }
-}
-
-
-DirectoryIteratorImpl::~DirectoryIteratorImpl()
-{
- if (_fh != INVALID_HANDLE_VALUE)
- FindClose(_fh);
-}
-
-
-const std::string& DirectoryIteratorImpl::next()
-{
- do
- {
- _current.clear();
- if (FindNextFileW(_fh, &_fd) != 0)
- {
- UnicodeConverter::toUTF8(_fd.cFileName, _current);
- }
- }
- while (_current == "." || _current == "..");
- return _current;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/DynamicAny.cpp b/Utilities/Poco/Foundation/src/DynamicAny.cpp
deleted file mode 100755
index 68da27efc0..0000000000
--- a/Utilities/Poco/Foundation/src/DynamicAny.cpp
+++ /dev/null
@@ -1,326 +0,0 @@
-//
-// DynamicAny.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: DynamicAny
-//
-// Copyright (c) 2007, 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/DynamicAny.h"
-#include <algorithm>
-#include <cctype>
-
-
-namespace Poco {
-
-
-DynamicAny::DynamicAny(): _pHolder(0)
-{
-}
-
-
-DynamicAny::DynamicAny(const char* pVal):
- _pHolder(new DynamicAnyHolderImpl<std::string>(pVal))
-{
-}
-
-
-DynamicAny::DynamicAny(const DynamicAny& other):
- _pHolder(0)
-{
- if (other._pHolder)
- _pHolder = other._pHolder->clone();
-}
-
-
-DynamicAny::~DynamicAny()
-{
- delete _pHolder;
-}
-
-
-DynamicAny& DynamicAny::operator = (const DynamicAny& other)
-{
- DynamicAny tmp(other);
- swap(tmp);
- return *this;
-}
-
-
-const DynamicAny DynamicAny::operator + (const DynamicAny& other) const
-{
- if (isInteger())
- {
- if(isSigned())
- return add<Poco::Int64>(other);
- else
- return add<Poco::UInt64>(other);
- }
- else if (isNumeric())
- return add<double>(other);
- else if (isString())
- return add<std::string>(other);
- else
- throw InvalidArgumentException("Invalid operation for this data type.");
-}
-
-
-DynamicAny& DynamicAny::operator += (const DynamicAny& other)
-{
- if (isInteger())
- {
- if(isSigned())
- return *this = add<Poco::Int64>(other);
- else
- return *this = add<Poco::UInt64>(other);
- }
- else if (isNumeric())
- return *this = add<double>(other);
- else if (isString())
- return *this = add<std::string>(other);
- else
- throw InvalidArgumentException("Invalid operation for this data type.");
-}
-
-
-const DynamicAny DynamicAny::operator - (const DynamicAny& other) const
-{
- if (isInteger())
- {
- if(isSigned())
- return subtract<Poco::Int64>(other);
- else
- return subtract<Poco::UInt64>(other);
- }
- else if (isNumeric())
- return subtract<double>(other);
- else
- throw InvalidArgumentException("Invalid operation for this data type.");
-}
-
-
-DynamicAny& DynamicAny::operator -= (const DynamicAny& other)
-{
- if (isInteger())
- {
- if(isSigned())
- return *this = subtract<Poco::Int64>(other);
- else
- return *this = subtract<Poco::UInt64>(other);
- }
- else if (isNumeric())
- return *this = subtract<double>(other);
- else
- throw InvalidArgumentException("Invalid operation for this data type.");
-}
-
-
-const DynamicAny DynamicAny::operator * (const DynamicAny& other) const
-{
- if (isInteger())
- {
- if(isSigned())
- return multiply<Poco::Int64>(other);
- else
- return multiply<Poco::UInt64>(other);
- }
- else if (isNumeric())
- return multiply<double>(other);
- else
- throw InvalidArgumentException("Invalid operation for this data type.");
-}
-
-
-DynamicAny& DynamicAny::operator *= (const DynamicAny& other)
-{
- if (isInteger())
- {
- if(isSigned())
- return *this = multiply<Poco::Int64>(other);
- else
- return *this = multiply<Poco::UInt64>(other);
- }
- else if (isNumeric())
- return *this = multiply<double>(other);
- else
- throw InvalidArgumentException("Invalid operation for this data type.");
-}
-
-
-const DynamicAny DynamicAny::operator / (const DynamicAny& other) const
-{
- if (isInteger())
- {
- if(isSigned())
- return divide<Poco::Int64>(other);
- else
- return divide<Poco::UInt64>(other);
- }
- else if (isNumeric())
- return divide<double>(other);
- else
- throw InvalidArgumentException("Invalid operation for this data type.");
-}
-
-
-DynamicAny& DynamicAny::operator /= (const DynamicAny& other)
-{
- if (isInteger())
- {
- if(isSigned())
- return *this = divide<Poco::Int64>(other);
- else
- return *this = divide<Poco::UInt64>(other);
- }
- else if (isNumeric())
- return *this = divide<double>(other);
- else
- throw InvalidArgumentException("Invalid operation for this data type.");
-}
-
-
-DynamicAny& DynamicAny::operator ++ ()
-{
- if (!isInteger())
- throw InvalidArgumentException("Invalid operation for this data type.");
-
- return *this = *this + 1;
-}
-
-const DynamicAny DynamicAny::operator ++ (int)
-{
- if (!isInteger())
- throw InvalidArgumentException("Invalid operation for this data type.");
-
- DynamicAny tmp(*this);
- *this += 1;
- return tmp;
-}
-
-DynamicAny& DynamicAny::operator -- ()
-{
- if (!isInteger())
- throw InvalidArgumentException("Invalid operation for this data type.");
-
- return *this = *this - 1;
-}
-
-const DynamicAny DynamicAny::operator -- (int)
-{
- if (!isInteger())
- throw InvalidArgumentException("Invalid operation for this data type.");
-
- DynamicAny tmp(*this);
- *this -= 1;
- return tmp;
-}
-
-
-bool DynamicAny::operator == (const DynamicAny& other) const
-{
- if (isEmpty() || other.isEmpty()) return false;
- return convert<std::string>() == other.convert<std::string>();
-}
-
-
-bool DynamicAny::operator == (const char* other) const
-{
- if (isEmpty()) return false;
- return convert<std::string>() == other;
-}
-
-
-bool DynamicAny::operator != (const DynamicAny& other) const
-{
- if (isEmpty() && other.isEmpty()) return false;
- else if (isEmpty() || other.isEmpty()) return true;
-
- return convert<std::string>() != other.convert<std::string>();
-}
-
-
-bool DynamicAny::operator != (const char* other) const
-{
- if (isEmpty()) return true;
- return convert<std::string>() != other;
-}
-
-
-bool DynamicAny::operator < (const DynamicAny& other) const
-{
- if (isEmpty() || other.isEmpty()) return false;
- return convert<std::string>() < other.convert<std::string>();
-}
-
-
-bool DynamicAny::operator <= (const DynamicAny& other) const
-{
- if (isEmpty() || other.isEmpty()) return false;
- return convert<std::string>() <= other.convert<std::string>();
-}
-
-
-bool DynamicAny::operator > (const DynamicAny& other) const
-{
- if (isEmpty() || other.isEmpty()) return false;
- return convert<std::string>() > other.convert<std::string>();
-}
-
-
-bool DynamicAny::operator >= (const DynamicAny& other) const
-{
- if (isEmpty() || other.isEmpty()) return false;
- return convert<std::string>() >= other.convert<std::string>();
-}
-
-
-bool DynamicAny::operator || (const DynamicAny& other) const
-{
- if (isEmpty() || other.isEmpty()) return false;
- return convert<bool>() || other.convert<bool>();
-}
-
-
-bool DynamicAny::operator && (const DynamicAny& other) const
-{
- if (isEmpty() || other.isEmpty()) return false;
- return convert<bool>() && other.convert<bool>();
-}
-
-
-void DynamicAny::empty()
-{
- delete _pHolder;
- _pHolder = 0;
-}
-
-
-} // namespace Poco::Poco
diff --git a/Utilities/Poco/Foundation/src/DynamicAnyHolder.cpp b/Utilities/Poco/Foundation/src/DynamicAnyHolder.cpp
deleted file mode 100755
index 15aa75cc73..0000000000
--- a/Utilities/Poco/Foundation/src/DynamicAnyHolder.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// DynamicAnyHolder.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: DynamicAnyHolder
-//
-// Copyright (c) 2007, 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/DynamicAnyHolder.h"
-#include "Poco/DynamicAny.h"
-
-
-namespace Poco {
-
-
-DynamicAnyHolder::DynamicAnyHolder()
-{
-}
-
-
-DynamicAnyHolder::~DynamicAnyHolder()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Environment.cpp b/Utilities/Poco/Foundation/src/Environment.cpp
deleted file mode 100755
index 1cdef88c76..0000000000
--- a/Utilities/Poco/Foundation/src/Environment.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// Environment.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Environment
-//
-// Copyright (c) 2004-2006, 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/Environment.h"
-#include <cstdlib>
-#include <cstdio> // sprintf()
-
-
-#if defined(POCO_OS_FAMILY_VMS)
-#include "Environment_VMS.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "Environment_UNIX.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "Environment_WIN32U.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Environment_WIN32.cpp"
-#endif
-
-
-namespace Poco {
-
-
-std::string Environment::get(const std::string& name)
-{
- return EnvironmentImpl::getImpl(name);
-}
-
-
-std::string Environment::get(const std::string& name, const std::string& defaultValue)
-{
- if (has(name))
- return get(name);
- else
- return defaultValue;
-}
-
-
-bool Environment::has(const std::string& name)
-{
- return EnvironmentImpl::hasImpl(name);
-}
-
-
-void Environment::set(const std::string& name, const std::string& value)
-{
- EnvironmentImpl::setImpl(name, value);
-}
-
-
-std::string Environment::osName()
-{
- return EnvironmentImpl::osNameImpl();
-}
-
-
-std::string Environment::osVersion()
-{
- return EnvironmentImpl::osVersionImpl();
-}
-
-
-std::string Environment::osArchitecture()
-{
- return EnvironmentImpl::osArchitectureImpl();
-}
-
-
-std::string Environment::nodeName()
-{
- return EnvironmentImpl::nodeNameImpl();
-}
-
-
-std::string Environment::nodeId()
-{
- NodeId id;
- nodeId(id);
- char result[18];
- std::sprintf(result, "%02x:%02x:%02x:%02x:%02x:%02x",
- id[0],
- id[1],
- id[2],
- id[3],
- id[4],
- id[5]);
- return std::string(result);
-}
-
-
-void Environment::nodeId(NodeId& id)
-{
- return EnvironmentImpl::nodeIdImpl(id);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Environment_UNIX.cpp b/Utilities/Poco/Foundation/src/Environment_UNIX.cpp
deleted file mode 100755
index d6e2e2038a..0000000000
--- a/Utilities/Poco/Foundation/src/Environment_UNIX.cpp
+++ /dev/null
@@ -1,255 +0,0 @@
-
-// Environment_UNIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Environment
-//
-// Copyright (c) 2004-2006, 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/Environment_UNIX.h"
-#include "Poco/Exception.h"
-#include <cstring>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/utsname.h>
-#include <sys/param.h>
-#include <cstring>
-
-
-namespace Poco {
-
-
-EnvironmentImpl::StringMap EnvironmentImpl::_map;
-FastMutex EnvironmentImpl::_mutex;
-
-
-std::string EnvironmentImpl::getImpl(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- const char* val = getenv(name.c_str());
- if (val)
- return std::string(val);
- else
- throw NotFoundException(name);
-}
-
-
-bool EnvironmentImpl::hasImpl(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return getenv(name.c_str()) != 0;
-}
-
-
-void EnvironmentImpl::setImpl(const std::string& name, const std::string& value)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string var = name;
- var.append("=");
- var.append(value);
- _map[name] = var;
- if (putenv((char*) _map[name].c_str()))
- {
- std::string msg = "cannot set environment variable: ";
- msg.append(name);
- throw SystemException(msg);
- }
-}
-
-
-std::string EnvironmentImpl::osNameImpl()
-{
- struct utsname uts;
- uname(&uts);
- return uts.sysname;
-}
-
-
-std::string EnvironmentImpl::osVersionImpl()
-{
- struct utsname uts;
- uname(&uts);
- return uts.release;
-}
-
-
-std::string EnvironmentImpl::osArchitectureImpl()
-{
- struct utsname uts;
- uname(&uts);
- return uts.machine;
-}
-
-
-std::string EnvironmentImpl::nodeNameImpl()
-{
- struct utsname uts;
- uname(&uts);
- return uts.nodename;
-}
-
-
-} // namespace Poco
-
-
-//
-// nodeIdImpl
-//
-#if defined(POCO_OS_FAMILY_BSD) || POCO_OS == POCO_OS_QNX
-//
-// BSD variants
-//
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <ifaddrs.h>
-#include <net/if_dl.h>
-
-
-namespace Poco {
-
-
-void EnvironmentImpl::nodeIdImpl(NodeId& id)
-{
- struct ifaddrs* ifaphead;
- int rc = getifaddrs(&ifaphead);
- if (rc) throw SystemException("cannot get network adapter list");
-
- bool foundAdapter = false;
- for (struct ifaddrs* ifap = ifaphead; ifap; ifap = ifap->ifa_next)
- {
- if (ifap->ifa_addr && ifap->ifa_addr->sa_family == AF_LINK)
- {
- struct sockaddr_dl* sdl = reinterpret_cast<struct sockaddr_dl*>(ifap->ifa_addr);
- caddr_t ap = (caddr_t) (sdl->sdl_data + sdl->sdl_nlen);
- int alen = sdl->sdl_alen;
- if (ap && alen > 0)
- {
- std::memcpy(&id, ap, sizeof(id));
- foundAdapter = true;
- break;
- }
- }
- }
- freeifaddrs(ifaphead);
- if (!foundAdapter) throw SystemException("cannot determine MAC address (no suitable network adapter found)");
-}
-
-
-} // namespace Poco
-
-
-#elif defined(__CYGWIN__) || POCO_OS == POCO_OS_LINUX
-//
-// Linux, Cygwin
-//
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <net/if.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-
-
-namespace Poco {
-
-
-void EnvironmentImpl::nodeIdImpl(NodeId& id)
-{
- struct ifreq ifr;
-
- int s = socket(PF_INET, SOCK_DGRAM, 0);
- if (s == -1) throw SystemException("cannot open socket");
-
- std::strcpy(ifr.ifr_name, "eth0");
- int rc = ioctl(s, SIOCGIFHWADDR, &ifr);
- close(s);
- if (rc < 0) throw SystemException("cannot get MAC address");
- struct sockaddr* sa = reinterpret_cast<struct sockaddr*>(&ifr.ifr_addr);
- std::memcpy(&id, sa->sa_data, sizeof(id));
-}
-
-
-} // namespace Poco
-
-
-#elif defined(POCO_OS_FAMILY_UNIX)
-//
-// General Unix
-//
-#include <sys/ioctl.h>
-#if defined(sun) || defined(__sun)
-#include <sys/sockio.h>
-#endif
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <net/if.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <unistd.h>
-
-
-namespace Poco {
-
-
-void EnvironmentImpl::nodeIdImpl(NodeId& id)
-{
- char name[MAXHOSTNAMELEN];
- if (gethostname(name, sizeof(name)))
- throw SystemException("cannot get host name");
-
- struct hostent* pHost = gethostbyname(name);
- if (!pHost) throw SystemException("cannot get host IP address");
-
- int s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
- if (s == -1) throw SystemException("cannot open socket");
-
- struct arpreq ar;
- std::memset(&ar, 0, sizeof(ar));
- struct sockaddr_in* pAddr = reinterpret_cast<struct sockaddr_in*>(&ar.arp_pa);
- pAddr->sin_family = AF_INET;
- std::memcpy(&pAddr->sin_addr, *pHost->h_addr_list, sizeof(struct in_addr));
- int rc = ioctl(s, SIOCGARP, &ar);
- close(s);
- if (rc < 0) throw SystemException("cannot get MAC address");
- std::memcpy(&id, ar.arp_ha.sa_data, sizeof(id));
-}
-
-
-} // namespace Poco
-
-
-#endif
diff --git a/Utilities/Poco/Foundation/src/Environment_VMS.cpp b/Utilities/Poco/Foundation/src/Environment_VMS.cpp
deleted file mode 100755
index 3eee2c8a5f..0000000000
--- a/Utilities/Poco/Foundation/src/Environment_VMS.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-// Environment_VMS.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Environment
-//
-// Copyright (c) 2004-2006, 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/Environment_VMS.h"
-#include "Poco/Exception.h"
-#include <stdlib.h>
-#include <starlet.h>
-#include <descrip.h>
-#include <ssdef.h>
-#include <syidef.h>
-#include <iledef.h>
-#include <lnmdef.h>
-#include <ioctl.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <net/if.h>
-#include <inet.h>
-#include <netdb.h>
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <unistd.h>
-
-
-#define MAXHOSTNAMELEN 64
-
-
-namespace Poco {
-
-
-FastMutex EnvironmentImpl::_mutex;
-
-
-std::string EnvironmentImpl::getImpl(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- const char* val = getenv(name.c_str());
- if (val)
- return std::string(val);
- else
- throw NotFoundException(name);
-}
-
-
-bool EnvironmentImpl::hasImpl(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return getenv(name.c_str()) != 0;
-}
-
-
-void EnvironmentImpl::setImpl(const std::string& name, const std::string& value)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (setenv(name.c_str(), value.c_str(), 1))
- {
- std::string msg = "cannot set environment variable: ";
- msg.append(name);
- throw SystemException(msg);
- }
-}
-
-
-std::string EnvironmentImpl::osNameImpl()
-{
- return getsyi(SYI$_NODE_SWTYPE);
-}
-
-
-std::string EnvironmentImpl::osVersionImpl()
-{
- return getsyi(SYI$_VERSION);
-}
-
-
-std::string EnvironmentImpl::osArchitectureImpl()
-{
- return getsyi(SYI$_ARCH_NAME);
-}
-
-
-std::string EnvironmentImpl::nodeNameImpl()
-{
- return getsyi(SYI$_NODENAME);
-}
-
-
-void EnvironmentImpl::nodeIdImpl(NodeId& id)
-{
- char name[MAXHOSTNAMELEN];
- if (gethostname(name, sizeof(name)))
- throw SystemException("cannot get host name");
-
- struct hostent* pHost = gethostbyname(name);
- if (!pHost) throw SystemException("cannot get host IP address");
-
- int s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
- if (s == -1) throw SystemException("cannot open socket");
-
- struct arpreq ar;
- std::memset(&ar, 0, sizeof(ar));
- struct sockaddr_in* pAddr = reinterpret_cast<struct sockaddr_in*>(&ar.arp_pa);
- pAddr->sin_family = AF_INET;
- std::memcpy(&pAddr->sin_addr, *pHost->h_addr_list, sizeof(struct in_addr));
- int rc = ioctl(s, SIOCGARP, &ar);
- close(s);
- if (rc < 0) throw SystemException("cannot get MAC address");
- std::memcpy(&id, ar.arp_ha.sa_data, sizeof(id));
-}
-
-
-std::string EnvironmentImpl::getsyi(unsigned short code)
-{
- #pragma pointer_size save
- #pragma pointer_size 32
-
- unsigned char result[16];
- unsigned short length;
-
- ILE3 items[2];
- items[0].ile3$w_code = code;
- items[0].ile3$w_length = sizeof(result);
- items[0].ile3$ps_bufaddr = result;
- items[0].ile3$ps_retlen_addr = &length;
- items[1].ile3$w_code = 0;
- items[1].ile3$w_length = 0;
-
- if (sys$getsyiw(0, 0, 0, items, 0, 0, 0) == 1)
- return std::string((char*) result, length);
- else
- throw SystemException("$GETSYI failed");
-
- #pragma pointer_size restore
-}
-
-
-std::string EnvironmentImpl::trnlnm(const std::string& name)
-{
- #pragma pointer_size save
- #pragma pointer_size 32
-
- unsigned char result[LNM$C_NAMLENGTH];
- unsigned short length;
-
- ILE3 items[2];
- items[0].ile3$w_code = LNM$_STRING;
- items[0].ile3$w_length = sizeof(result);
- items[0].ile3$ps_bufaddr = result;
- items[0].ile3$ps_retlen_addr = &length;
- items[1].ile3$w_code = 0;
- items[1].ile3$w_length = 0;
-
- #pragma pointer_size restore
-
- unsigned int trnAttr = LNM$M_CASE_BLIND;
- POCO_DESCRIPTOR_LITERAL(tableDsc, "LNM$FILE_DEV");
- POCO_DESCRIPTOR_STRING(nameDsc, name);
- if (sys$trnlnm(&trnAttr, &tableDsc, &nameDsc, 0, &items) == 1)
- {
- if (result[0] == 0x1B)
- return std::string((char*) result + 4, length - 4);
- else
- return std::string((char*) result, length);
- }
- else
- {
- return std::string();
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Environment_WIN32.cpp b/Utilities/Poco/Foundation/src/Environment_WIN32.cpp
deleted file mode 100755
index 27d16d4ce4..0000000000
--- a/Utilities/Poco/Foundation/src/Environment_WIN32.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-//
-// Environment_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Environment
-//
-// Copyright (c) 2004-2006, 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/Environment_WIN32.h"
-#include "Poco/Exception.h"
-#include <sstream>
-#include <cstring>
-#include "Poco/UnWindows.h"
-#include <iphlpapi.h>
-
-
-namespace Poco {
-
-
-std::string EnvironmentImpl::getImpl(const std::string& name)
-{
- DWORD len = GetEnvironmentVariableA(name.c_str(), 0, 0);
- if (len == 0) throw NotFoundException(name);
- char* buffer = new char[len];
- GetEnvironmentVariableA(name.c_str(), buffer, len);
- std::string result(buffer);
- delete [] buffer;
- return result;
-}
-
-
-bool EnvironmentImpl::hasImpl(const std::string& name)
-{
- DWORD len = GetEnvironmentVariableA(name.c_str(), 0, 0);
- return len > 0;
-}
-
-
-void EnvironmentImpl::setImpl(const std::string& name, const std::string& value)
-{
- if (SetEnvironmentVariableA(name.c_str(), value.c_str()) == 0)
- {
- std::string msg = "cannot set environment variable: ";
- msg.append(name);
- throw SystemException(msg);
- }
-}
-
-
-std::string EnvironmentImpl::osNameImpl()
-{
- OSVERSIONINFO vi;
- vi.dwOSVersionInfoSize = sizeof(vi);
- if (GetVersionEx(&vi) == 0) throw SystemException("Cannot get OS version information");
- switch (vi.dwPlatformId)
- {
- case VER_PLATFORM_WIN32s:
- return "Windows 3.x";
- case VER_PLATFORM_WIN32_WINDOWS:
- return vi.dwMinorVersion == 0 ? "Windows 95" : "Windows 98";
- case VER_PLATFORM_WIN32_NT:
- return "Windows NT";
- default:
- return "Unknown";
- }
-}
-
-
-std::string EnvironmentImpl::osVersionImpl()
-{
- OSVERSIONINFO vi;
- vi.dwOSVersionInfoSize = sizeof(vi);
- if (GetVersionEx(&vi) == 0) throw SystemException("Cannot get OS version information");
- std::ostringstream str;
- str << vi.dwMajorVersion << "." << vi.dwMinorVersion << " (Build " << (vi.dwBuildNumber & 0xFFFF);
- if (vi.szCSDVersion[0]) str << ": " << vi.szCSDVersion;
- str << ")";
- return str.str();
-}
-
-
-std::string EnvironmentImpl::osArchitectureImpl()
-{
- SYSTEM_INFO si;
- GetSystemInfo(&si);
- switch (si.wProcessorArchitecture)
- {
- case PROCESSOR_ARCHITECTURE_INTEL:
- return "IA32";
- case PROCESSOR_ARCHITECTURE_MIPS:
- return "MIPS";
- case PROCESSOR_ARCHITECTURE_ALPHA:
- return "ALPHA";
- case PROCESSOR_ARCHITECTURE_PPC:
- return "PPC";
- case PROCESSOR_ARCHITECTURE_IA64:
- return "IA64";
-#ifdef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64
- case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
- return "IA64/32";
-#endif
-#ifdef PROCESSOR_ARCHITECTURE_AMD64
- case PROCESSOR_ARCHITECTURE_AMD64:
- return "AMD64";
-#endif
- default:
- return "Unknown";
- }
-}
-
-
-std::string EnvironmentImpl::nodeNameImpl()
-{
- char name[MAX_COMPUTERNAME_LENGTH + 1];
- DWORD size = sizeof(name);
- if (GetComputerNameA(name, &size) == 0) throw SystemException("Cannot get computer name");
- return std::string(name);
-}
-
-
-void EnvironmentImpl::nodeIdImpl(NodeId& id)
-{
- PIP_ADAPTER_INFO pAdapterInfo;
- PIP_ADAPTER_INFO pAdapter = 0;
- ULONG len = sizeof(IP_ADAPTER_INFO);
- pAdapterInfo = reinterpret_cast<IP_ADAPTER_INFO*>(new char[len]);
- // Make an initial call to GetAdaptersInfo to get
- // the necessary size into len
- DWORD rc = GetAdaptersInfo(pAdapterInfo, &len);
- if (rc == ERROR_BUFFER_OVERFLOW)
- {
- delete [] reinterpret_cast<char*>(pAdapterInfo);
- pAdapterInfo = reinterpret_cast<IP_ADAPTER_INFO*>(new char[len]);
- }
- else if (rc != ERROR_SUCCESS)
- {
- throw SystemException("cannot get network adapter list");
- }
- try
- {
- bool found = false;
- if (GetAdaptersInfo(pAdapterInfo, &len) == NO_ERROR)
- {
- pAdapter = pAdapterInfo;
- while (pAdapter && !found)
- {
- if (pAdapter->Type == MIB_IF_TYPE_ETHERNET && pAdapter->AddressLength == sizeof(id))
- {
- std::memcpy(&id, pAdapter->Address, pAdapter->AddressLength);
- found = true;
- }
- pAdapter = pAdapter->Next;
- }
- }
- else throw SystemException("cannot get network adapter list");
- if (!found) throw SystemException("no Ethernet adapter found");
- }
- catch (Exception&)
- {
- delete [] reinterpret_cast<char*>(pAdapterInfo);
- throw;
- }
- delete [] reinterpret_cast<char*>(pAdapterInfo);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Environment_WIN32U.cpp b/Utilities/Poco/Foundation/src/Environment_WIN32U.cpp
deleted file mode 100755
index 9d5a65a414..0000000000
--- a/Utilities/Poco/Foundation/src/Environment_WIN32U.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-//
-// Environment_WIN32U.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Environment
-//
-// Copyright (c) 2006, 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/Environment_WIN32U.h"
-#include "Poco/Exception.h"
-#include "Poco/UnicodeConverter.h"
-#include "Poco/Buffer.h"
-#include <sstream>
-#include <cstring>
-#include "Poco/UnWindows.h"
-#include <iphlpapi.h>
-
-
-namespace Poco {
-
-
-std::string EnvironmentImpl::getImpl(const std::string& name)
-{
- std::wstring uname;
- UnicodeConverter::toUTF16(name, uname);
- DWORD len = GetEnvironmentVariableW(uname.c_str(), 0, 0);
- if (len == 0) throw NotFoundException(name);
- Buffer<wchar_t> buffer(len);
- GetEnvironmentVariableW(uname.c_str(), buffer.begin(), len);
- std::string result;
- UnicodeConverter::toUTF8(buffer.begin(), len - 1, result);
- return result;
-}
-
-
-bool EnvironmentImpl::hasImpl(const std::string& name)
-{
- std::wstring uname;
- UnicodeConverter::toUTF16(name, uname);
- DWORD len = GetEnvironmentVariableW(uname.c_str(), 0, 0);
- return len > 0;
-}
-
-
-void EnvironmentImpl::setImpl(const std::string& name, const std::string& value)
-{
- std::wstring uname;
- std::wstring uvalue;
- UnicodeConverter::toUTF16(name, uname);
- UnicodeConverter::toUTF16(value, uvalue);
- if (SetEnvironmentVariableW(uname.c_str(), uvalue.c_str()) == 0)
- {
- std::string msg = "cannot set environment variable: ";
- msg.append(name);
- throw SystemException(msg);
- }
-}
-
-
-std::string EnvironmentImpl::osNameImpl()
-{
- OSVERSIONINFO vi;
- vi.dwOSVersionInfoSize = sizeof(vi);
- if (GetVersionEx(&vi) == 0) throw SystemException("Cannot get OS version information");
- switch (vi.dwPlatformId)
- {
- case VER_PLATFORM_WIN32s:
- return "Windows 3.x";
- case VER_PLATFORM_WIN32_WINDOWS:
- return vi.dwMinorVersion == 0 ? "Windows 95" : "Windows 98";
- case VER_PLATFORM_WIN32_NT:
- return "Windows NT";
- default:
- return "Unknown";
- }
-}
-
-
-std::string EnvironmentImpl::osVersionImpl()
-{
- OSVERSIONINFOW vi;
- vi.dwOSVersionInfoSize = sizeof(vi);
- if (GetVersionExW(&vi) == 0) throw SystemException("Cannot get OS version information");
- std::ostringstream str;
- str << vi.dwMajorVersion << "." << vi.dwMinorVersion << " (Build " << (vi.dwBuildNumber & 0xFFFF);
- std::string version;
- UnicodeConverter::toUTF8(vi.szCSDVersion, version);
- if (!version.empty()) str << ": " << version;
- str << ")";
- return str.str();
-}
-
-
-std::string EnvironmentImpl::osArchitectureImpl()
-{
- SYSTEM_INFO si;
- GetSystemInfo(&si);
- switch (si.wProcessorArchitecture)
- {
- case PROCESSOR_ARCHITECTURE_INTEL:
- return "IA32";
- case PROCESSOR_ARCHITECTURE_MIPS:
- return "MIPS";
- case PROCESSOR_ARCHITECTURE_ALPHA:
- return "ALPHA";
- case PROCESSOR_ARCHITECTURE_PPC:
- return "PPC";
- case PROCESSOR_ARCHITECTURE_IA64:
- return "IA64";
-#ifdef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64
- case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
- return "IA64/32";
-#endif
-#ifdef PROCESSOR_ARCHITECTURE_AMD64
- case PROCESSOR_ARCHITECTURE_AMD64:
- return "AMD64";
-#endif
- default:
- return "Unknown";
- }
-}
-
-
-std::string EnvironmentImpl::nodeNameImpl()
-{
- wchar_t name[MAX_COMPUTERNAME_LENGTH + 1];
- DWORD size = MAX_COMPUTERNAME_LENGTH + 1;
- if (GetComputerNameW(name, &size) == 0) throw SystemException("Cannot get computer name");
- std::string result;
- UnicodeConverter::toUTF8(name, result);
- return result;
-}
-
-
-void EnvironmentImpl::nodeIdImpl(NodeId& id)
-{
- PIP_ADAPTER_INFO pAdapterInfo;
- PIP_ADAPTER_INFO pAdapter = 0;
- ULONG len = sizeof(IP_ADAPTER_INFO);
- pAdapterInfo = reinterpret_cast<IP_ADAPTER_INFO*>(new char[len]);
- // Make an initial call to GetAdaptersInfo to get
- // the necessary size into len
- DWORD rc = GetAdaptersInfo(pAdapterInfo, &len);
- if (rc == ERROR_BUFFER_OVERFLOW)
- {
- delete [] reinterpret_cast<char*>(pAdapterInfo);
- pAdapterInfo = reinterpret_cast<IP_ADAPTER_INFO*>(new char[len]);
- }
- else if (rc != ERROR_SUCCESS)
- {
- throw SystemException("cannot get network adapter list");
- }
- try
- {
- bool found = false;
- if (GetAdaptersInfo(pAdapterInfo, &len) == NO_ERROR)
- {
- pAdapter = pAdapterInfo;
- while (pAdapter && !found)
- {
- if (pAdapter->Type == MIB_IF_TYPE_ETHERNET && pAdapter->AddressLength == sizeof(id))
- {
- std::memcpy(&id, pAdapter->Address, pAdapter->AddressLength);
- found = true;
- }
- pAdapter = pAdapter->Next;
- }
- }
- else throw SystemException("cannot get network adapter list");
- if (!found) throw SystemException("no Ethernet adapter found");
- }
- catch (Exception&)
- {
- delete [] reinterpret_cast<char*>(pAdapterInfo);
- throw;
- }
- delete [] reinterpret_cast<char*>(pAdapterInfo);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/ErrorHandler.cpp b/Utilities/Poco/Foundation/src/ErrorHandler.cpp
deleted file mode 100755
index cc9ecd5053..0000000000
--- a/Utilities/Poco/Foundation/src/ErrorHandler.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// ErrorHandler.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ErrorHandler
-//
-// Copyright (c) 2005-2006, 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/ErrorHandler.h"
-#include "Poco/SingletonHolder.h"
-
-
-namespace Poco {
-
-
-ErrorHandler* ErrorHandler::_pHandler = ErrorHandler::defaultHandler();
-FastMutex ErrorHandler::_mutex;
-
-
-ErrorHandler::ErrorHandler()
-{
-}
-
-
-ErrorHandler::~ErrorHandler()
-{
-}
-
-
-void ErrorHandler::exception(const Exception& exc)
-{
- poco_debugger_msg(exc.what());
-}
-
-
-void ErrorHandler::exception(const std::exception& exc)
-{
- poco_debugger_msg(exc.what());
-}
-
-
-void ErrorHandler::exception()
-{
- poco_debugger_msg("unknown exception");
-}
-
-
-void ErrorHandler::handle(const Exception& exc)
-{
- FastMutex::ScopedLock lock(_mutex);
- try
- {
- _pHandler->exception(exc);
- }
- catch (...)
- {
- }
-}
-
-
-void ErrorHandler::handle(const std::exception& exc)
-{
- FastMutex::ScopedLock lock(_mutex);
- try
- {
- _pHandler->exception(exc);
- }
- catch (...)
- {
- }
-}
-
-
-void ErrorHandler::handle()
-{
- FastMutex::ScopedLock lock(_mutex);
- try
- {
- _pHandler->exception();
- }
- catch (...)
- {
- }
-}
-
-
-ErrorHandler* ErrorHandler::set(ErrorHandler* pHandler)
-{
- poco_check_ptr(pHandler);
-
- FastMutex::ScopedLock lock(_mutex);
- ErrorHandler* pOld = _pHandler;
- _pHandler = pHandler;
- return pOld;
-}
-
-
-ErrorHandler* ErrorHandler::defaultHandler()
-{
- static SingletonHolder<ErrorHandler> sh;
- return sh.get();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Event.cpp b/Utilities/Poco/Foundation/src/Event.cpp
deleted file mode 100755
index aa55430990..0000000000
--- a/Utilities/Poco/Foundation/src/Event.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// Event.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Event
-//
-// Copyright (c) 2004-2006, 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/Event.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Event_WIN32.cpp"
-#else
-#include "Event_POSIX.cpp"
-#endif
-
-
-namespace Poco {
-
-
-Event::Event(bool autoReset): EventImpl(autoReset)
-{
-}
-
-
-Event::~Event()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/EventArgs.cpp b/Utilities/Poco/Foundation/src/EventArgs.cpp
deleted file mode 100755
index 2fbbaebf3f..0000000000
--- a/Utilities/Poco/Foundation/src/EventArgs.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// EventArgs.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Events
-// Module: EventArgs
-//
-// Implementation of EventArgs
-//
-// Copyright (c) 2006, 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/EventArgs.h"
-
-
-namespace Poco {
-
-
-EventArgs::EventArgs()
-{
-}
-
-
-EventArgs::~EventArgs()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/EventLogChannel.cpp b/Utilities/Poco/Foundation/src/EventLogChannel.cpp
deleted file mode 100755
index 24450b24c7..0000000000
--- a/Utilities/Poco/Foundation/src/EventLogChannel.cpp
+++ /dev/null
@@ -1,315 +0,0 @@
-//
-// EventLogChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: EventLogChannel
-//
-// Copyright (c) 2004-2006, 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/EventLogChannel.h"
-#include "Poco/Message.h"
-#include "Poco/String.h"
-#include "pocomsg.h"
-#if defined(POCO_WIN32_UTF8)
-#include "Poco/UnicodeConverter.h"
-#endif
-
-
-namespace Poco {
-
-
-const std::string EventLogChannel::PROP_NAME = "name";
-const std::string EventLogChannel::PROP_HOST = "host";
-const std::string EventLogChannel::PROP_LOGHOST = "loghost";
-const std::string EventLogChannel::PROP_LOGFILE = "logfile";
-
-
-EventLogChannel::EventLogChannel():
- _logFile("Application"),
- _h(0)
-{
-#if defined(POCO_WIN32_UTF8)
- wchar_t name[256];
- int n = GetModuleFileNameW(NULL, name, sizeof(name));
- if (n > 0)
- {
- wchar_t* end = name + n - 1;
- while (end > name && *end != '\\') --end;
- if (*end == '\\') ++end;
- std::wstring uname(end);
- UnicodeConverter::toUTF8(uname, _name);
- }
-#else
- char name[256];
- int n = GetModuleFileNameA(NULL, name, sizeof(name));
- if (n > 0)
- {
- char* end = name + n - 1;
- while (end > name && *end != '\\') --end;
- if (*end == '\\') ++end;
- _name = end;
- }
-#endif
-}
-
-
-EventLogChannel::EventLogChannel(const std::string& name):
- _name(name),
- _logFile("Application"),
- _h(0)
-{
-}
-
-
-EventLogChannel::EventLogChannel(const std::string& name, const std::string& host):
- _name(name),
- _host(host),
- _logFile("Application"),
- _h(0)
-{
-}
-
-
-EventLogChannel::~EventLogChannel()
-{
- close();
-}
-
-
-void EventLogChannel::open()
-{
- setUpRegistry();
-#if defined(POCO_WIN32_UTF8)
- std::wstring uhost;
- UnicodeConverter::toUTF16(_host, uhost);
- std::wstring uname;
- UnicodeConverter::toUTF16(_name, uname);
- _h = RegisterEventSourceW(uhost.empty() ? NULL : uhost.c_str(), uname.c_str());
-#else
- _h = RegisterEventSource(_host.empty() ? NULL : _host.c_str(), _name.c_str());
-#endif
- if (!_h) throw SystemException("cannot register event source");
-}
-
-
-void EventLogChannel::close()
-{
- if (_h) DeregisterEventSource(_h);
- _h = 0;
-}
-
-
-void EventLogChannel::log(const Message& msg)
-{
- if (!_h) open();
-#if defined(POCO_WIN32_UTF8)
- std::wstring utext;
- UnicodeConverter::toUTF16(msg.getText(), utext);
- const wchar_t* pMsg = utext.c_str();
- ReportEventW(_h, getType(msg), getCategory(msg), POCO_MSG_LOG, NULL, 1, 0, &pMsg, NULL);
-#else
- const char* pMsg = msg.getText().c_str();
- ReportEvent(_h, getType(msg), getCategory(msg), POCO_MSG_LOG, NULL, 1, 0, &pMsg, NULL);
-#endif
-}
-
-
-void EventLogChannel::setProperty(const std::string& name, const std::string& value)
-{
- if (icompare(name, PROP_NAME) == 0)
- _name = value;
- else if (icompare(name, PROP_HOST) == 0)
- _host = value;
- else if (icompare(name, PROP_LOGHOST) == 0)
- _host = value;
- else if (icompare(name, PROP_LOGFILE) == 0)
- _logFile = value;
- else
- Channel::setProperty(name, value);
-}
-
-
-std::string EventLogChannel::getProperty(const std::string& name) const
-{
- if (icompare(name, PROP_NAME) == 0)
- return _name;
- else if (icompare(name, PROP_HOST) == 0)
- return _host;
- else if (icompare(name, PROP_LOGHOST) == 0)
- return _host;
- else if (icompare(name, PROP_LOGFILE) == 0)
- return _logFile;
- else
- return Channel::getProperty(name);
-}
-
-
-int EventLogChannel::getType(const Message& msg)
-{
- switch (msg.getPriority())
- {
- case Message::PRIO_TRACE:
- case Message::PRIO_DEBUG:
- case Message::PRIO_INFORMATION:
- return EVENTLOG_INFORMATION_TYPE;
- case Message::PRIO_NOTICE:
- case Message::PRIO_WARNING:
- return EVENTLOG_WARNING_TYPE;
- default:
- return EVENTLOG_ERROR_TYPE;
- }
-}
-
-
-int EventLogChannel::getCategory(const Message& msg)
-{
- switch (msg.getPriority())
- {
- case Message::PRIO_TRACE:
- return POCO_CTG_TRACE;
- case Message::PRIO_DEBUG:
- return POCO_CTG_DEBUG;
- case Message::PRIO_INFORMATION:
- return POCO_CTG_INFORMATION;
- case Message::PRIO_NOTICE:
- return POCO_CTG_NOTICE;
- case Message::PRIO_WARNING:
- return POCO_CTG_WARNING;
- case Message::PRIO_ERROR:
- return POCO_CTG_ERROR;
- case Message::PRIO_CRITICAL:
- return POCO_CTG_CRITICAL;
- case Message::PRIO_FATAL:
- return POCO_CTG_FATAL;
- default:
- return 0;
- }
-}
-
-
-void EventLogChannel::setUpRegistry() const
-{
- std::string key = "SYSTEM\\CurrentControlSet\\Services\\EventLog\\";
- key.append(_logFile);
- key.append("\\");
- key.append(_name);
- HKEY hKey;
- DWORD disp;
-#if defined(POCO_WIN32_UTF8)
- std::wstring ukey;
- UnicodeConverter::toUTF16(key, ukey);
- DWORD rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, ukey.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
-#else
- DWORD rc = RegCreateKeyEx(HKEY_LOCAL_MACHINE, key.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
-#endif
- if (rc != ERROR_SUCCESS) return;
-
- if (disp == REG_CREATED_NEW_KEY)
- {
-#if defined(POCO_WIN32_UTF8)
- std::wstring path;
- #if defined(POCO_DLL)
- #if defined(_DEBUG)
- path = findLibrary(L"PocoFoundationd.dll");
- #else
- path = findLibrary(L"PocoFoundation.dll");
- #endif
- #endif
-
- if (path.empty())
- path = findLibrary(L"PocoMsg.dll");
-#else
- std::string path;
- #if defined(POCO_DLL)
- #if defined(_DEBUG)
- path = findLibrary("PocoFoundationd.dll");
- #else
- path = findLibrary("PocoFoundation.dll");
- #endif
- #endif
-
- if (path.empty())
- path = findLibrary("PocoMsg.dll");
-#endif
-
- if (!path.empty())
- {
- DWORD count = 8;
- DWORD types = 7;
-#if defined(POCO_WIN32_UTF8)
- RegSetValueExW(hKey, L"CategoryMessageFile", 0, REG_SZ, (const BYTE*) path.c_str(), (DWORD) sizeof(wchar_t)*(path.size() + 1));
- RegSetValueExW(hKey, L"EventMessageFile", 0, REG_SZ, (const BYTE*) path.c_str(), (DWORD) sizeof(wchar_t)*(path.size() + 1));
- RegSetValueExW(hKey, L"CategoryCount", 0, REG_DWORD, (const BYTE*) &count, (DWORD) sizeof(count));
- RegSetValueExW(hKey, L"TypesSupported", 0, REG_DWORD, (const BYTE*) &types, (DWORD) sizeof(types));
-#else
- RegSetValueEx(hKey, "CategoryMessageFile", 0, REG_SZ, (const BYTE*) path.c_str(), (DWORD) path.size() + 1);
- RegSetValueEx(hKey, "EventMessageFile", 0, REG_SZ, (const BYTE*) path.c_str(), (DWORD) path.size() + 1);
- RegSetValueEx(hKey, "CategoryCount", 0, REG_DWORD, (const BYTE*) &count, (DWORD) sizeof(count));
- RegSetValueEx(hKey, "TypesSupported", 0, REG_DWORD, (const BYTE*) &types, (DWORD) sizeof(types));
-#endif
- }
- }
- RegCloseKey(hKey);
-}
-
-
-#if defined(POCO_WIN32_UTF8)
-std::wstring EventLogChannel::findLibrary(const wchar_t* name)
-{
- std::wstring path;
- HMODULE dll = LoadLibraryW(name);
- if (dll)
- {
- wchar_t name[MAX_PATH + 1];
- int n = GetModuleFileNameW(dll, name, sizeof(name));
- if (n > 0) path = name;
- FreeLibrary(dll);
- }
- return path;
-}
-#else
-std::string EventLogChannel::findLibrary(const char* name)
-{
- std::string path;
- HMODULE dll = LoadLibraryA(name);
- if (dll)
- {
- char name[MAX_PATH + 1];
- int n = GetModuleFileNameA(dll, name, sizeof(name));
- if (n > 0) path = name;
- FreeLibrary(dll);
- }
- return path;
-}
-#endif
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Event_POSIX.cpp b/Utilities/Poco/Foundation/src/Event_POSIX.cpp
deleted file mode 100755
index 9b9342d8fe..0000000000
--- a/Utilities/Poco/Foundation/src/Event_POSIX.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// Event_POSIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Event
-//
-// Copyright (c) 2004-2006, 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/Event_POSIX.h"
-#include <sys/time.h>
-
-
-namespace Poco {
-
-
-EventImpl::EventImpl(bool autoReset): _auto(autoReset), _state(false)
-{
- if (pthread_mutex_init(&_mutex, NULL))
- throw SystemException("cannot create event (mutex)");
- if (pthread_cond_init(&_cond, NULL))
- throw SystemException("cannot create event (condition)");
-}
-
-
-EventImpl::~EventImpl()
-{
- pthread_cond_destroy(&_cond);
- pthread_mutex_destroy(&_mutex);
-}
-
-
-void EventImpl::waitImpl()
-{
- if (pthread_mutex_lock(&_mutex))
- throw SystemException("wait for event failed (lock)");
- while (!_state)
- {
- if (pthread_cond_wait(&_cond, &_mutex))
- {
- pthread_mutex_unlock(&_mutex);
- throw SystemException("wait for event failed");
- }
- }
- if (_auto)
- _state = false;
- pthread_mutex_unlock(&_mutex);
-}
-
-
-bool EventImpl::waitImpl(long milliseconds)
-{
- int rc = 0;
- struct timespec abstime;
-
-#if defined(__VMS)
- struct timespec delta;
- delta.tv_sec = milliseconds / 1000;
- delta.tv_nsec = (milliseconds % 1000)*1000000;
- pthread_get_expiration_np(&delta, &abstime);
-#else
- struct timeval tv;
- gettimeofday(&tv, NULL);
- abstime.tv_sec = tv.tv_sec + milliseconds / 1000;
- abstime.tv_nsec = tv.tv_usec*1000 + (milliseconds % 1000)*1000000;
- if (abstime.tv_nsec >= 1000000000)
- {
- abstime.tv_nsec -= 1000000000;
- abstime.tv_sec++;
- }
-#endif
-
- if (pthread_mutex_lock(&_mutex) != 0)
- throw SystemException("wait for event failed (lock)");
- while (!_state)
- {
- if ((rc = pthread_cond_timedwait(&_cond, &_mutex, &abstime)))
- {
- if (rc == ETIMEDOUT) break;
- pthread_mutex_unlock(&_mutex);
- throw SystemException("cannot wait for event");
- }
- }
- if (rc == 0 && _auto) _state = false;
- pthread_mutex_unlock(&_mutex);
- return rc == 0;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Event_WIN32.cpp b/Utilities/Poco/Foundation/src/Event_WIN32.cpp
deleted file mode 100755
index 2648251478..0000000000
--- a/Utilities/Poco/Foundation/src/Event_WIN32.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// Event_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Event
-//
-// Copyright (c) 2004-2006, 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/Event_WIN32.h"
-
-
-namespace Poco {
-
-
-EventImpl::EventImpl(bool autoReset)
-{
- _event = CreateEventW(NULL, autoReset ? FALSE : TRUE, FALSE, NULL);
- if (!_event)
- throw SystemException("cannot create event");
-}
-
-
-EventImpl::~EventImpl()
-{
- CloseHandle(_event);
-}
-
-
-void EventImpl::waitImpl()
-{
- switch (WaitForSingleObject(_event, INFINITE))
- {
- case WAIT_OBJECT_0:
- return;
- default:
- throw SystemException("wait for event failed");
- }
-}
-
-
-bool EventImpl::waitImpl(long milliseconds)
-{
- switch (WaitForSingleObject(_event, milliseconds + 1))
- {
- case WAIT_TIMEOUT:
- return false;
- case WAIT_OBJECT_0:
- return true;
- default:
- throw SystemException("wait for event failed");
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Exception.cpp b/Utilities/Poco/Foundation/src/Exception.cpp
deleted file mode 100755
index 65c93dd7f9..0000000000
--- a/Utilities/Poco/Foundation/src/Exception.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-//
-// Exception.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Exception
-//
-// Copyright (c) 2004-2006, 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/Exception.h"
-#include <typeinfo>
-
-
-namespace Poco {
-
-
-Exception::Exception(int code): _pNested(0), _code(code)
-{
-}
-
-
-Exception::Exception(const std::string& msg, int code): _msg(msg), _pNested(0), _code(code)
-{
-}
-
-
-Exception::Exception(const std::string& msg, const std::string& arg, int code): _msg(msg), _pNested(0), _code(code)
-{
- if (!arg.empty())
- {
- _msg.append(": ");
- _msg.append(arg);
- }
-}
-
-
-Exception::Exception(const std::string& msg, const Exception& nested, int code): _msg(msg), _pNested(nested.clone()), _code(code)
-{
-}
-
-
-Exception::Exception(const Exception& exc):
- std::exception(exc),
- _msg(exc._msg),
- _code(exc._code)
-{
- _pNested = exc._pNested ? exc._pNested->clone() : 0;
-}
-
-
-Exception::~Exception() throw()
-{
- delete _pNested;
-}
-
-
-Exception& Exception::operator = (const Exception& exc)
-{
- if (&exc != this)
- {
- delete _pNested;
- _msg = exc._msg;
- _pNested = exc._pNested ? exc._pNested->clone() : 0;
- _code = exc._code;
- }
- return *this;
-}
-
-
-const char* Exception::name() const throw()
-{
- return "Exception";
-}
-
-
-const char* Exception::className() const throw()
-{
- return typeid(*this).name();
-}
-
-
-const char* Exception::what() const throw()
-{
- return name();
-}
-
-
-std::string Exception::displayText() const
-{
- std::string txt = name();
- if (!_msg.empty())
- {
- txt.append(": ");
- txt.append(_msg);
- }
- return txt;
-}
-
-
-Exception* Exception::clone() const
-{
- return new Exception(*this);
-}
-
-
-void Exception::rethrow() const
-{
- throw *this;
-}
-
-
-POCO_IMPLEMENT_EXCEPTION(LogicException, Exception, "Logic exception")
-POCO_IMPLEMENT_EXCEPTION(AssertionViolationException, LogicException, "Assertion violation")
-POCO_IMPLEMENT_EXCEPTION(NullPointerException, LogicException, "Null pointer")
-POCO_IMPLEMENT_EXCEPTION(BugcheckException, LogicException, "Bugcheck")
-POCO_IMPLEMENT_EXCEPTION(InvalidArgumentException, LogicException, "Invalid argument")
-POCO_IMPLEMENT_EXCEPTION(NotImplementedException, LogicException, "Not implemented")
-POCO_IMPLEMENT_EXCEPTION(RangeException, LogicException, "Out of range")
-POCO_IMPLEMENT_EXCEPTION(IllegalStateException, LogicException, "Illegal state")
-POCO_IMPLEMENT_EXCEPTION(InvalidAccessException, LogicException, "Invalid access")
-POCO_IMPLEMENT_EXCEPTION(SignalException, LogicException, "Signal received")
-POCO_IMPLEMENT_EXCEPTION(UnhandledException, LogicException, "Unhandled exception")
-
-POCO_IMPLEMENT_EXCEPTION(RuntimeException, Exception, "Runtime exception")
-POCO_IMPLEMENT_EXCEPTION(NotFoundException, RuntimeException, "Not found")
-POCO_IMPLEMENT_EXCEPTION(ExistsException, RuntimeException, "Exists")
-POCO_IMPLEMENT_EXCEPTION(TimeoutException, RuntimeException, "Timeout")
-POCO_IMPLEMENT_EXCEPTION(SystemException, RuntimeException, "System exception")
-POCO_IMPLEMENT_EXCEPTION(RegularExpressionException, RuntimeException, "Error in regular expression")
-POCO_IMPLEMENT_EXCEPTION(LibraryLoadException, RuntimeException, "Cannot load library")
-POCO_IMPLEMENT_EXCEPTION(LibraryAlreadyLoadedException, RuntimeException, "Library already loaded")
-POCO_IMPLEMENT_EXCEPTION(NoThreadAvailableException, RuntimeException, "No thread available")
-POCO_IMPLEMENT_EXCEPTION(PropertyNotSupportedException, RuntimeException, "Property not supported")
-POCO_IMPLEMENT_EXCEPTION(PoolOverflowException, RuntimeException, "Pool overflow")
-POCO_IMPLEMENT_EXCEPTION(NoPermissionException, RuntimeException, "No permission")
-POCO_IMPLEMENT_EXCEPTION(OutOfMemoryException, RuntimeException, "Out of memory")
-POCO_IMPLEMENT_EXCEPTION(DataException, RuntimeException, "Data error")
-
-POCO_IMPLEMENT_EXCEPTION(DataFormatException, DataException, "Bad data format")
-POCO_IMPLEMENT_EXCEPTION(SyntaxException, DataException, "Syntax error")
-POCO_IMPLEMENT_EXCEPTION(CircularReferenceException, DataException, "Circular reference")
-POCO_IMPLEMENT_EXCEPTION(PathSyntaxException, SyntaxException, "Bad path syntax")
-POCO_IMPLEMENT_EXCEPTION(IOException, RuntimeException, "I/O error")
-POCO_IMPLEMENT_EXCEPTION(FileException, IOException, "File access error")
-POCO_IMPLEMENT_EXCEPTION(FileExistsException, FileException, "File exists")
-POCO_IMPLEMENT_EXCEPTION(FileNotFoundException, FileException, "File not found")
-POCO_IMPLEMENT_EXCEPTION(PathNotFoundException, FileException, "Path not found")
-POCO_IMPLEMENT_EXCEPTION(FileReadOnlyException, FileException, "File is read-only")
-POCO_IMPLEMENT_EXCEPTION(FileAccessDeniedException, FileException, "Access to file denied")
-POCO_IMPLEMENT_EXCEPTION(CreateFileException, FileException, "Cannot create file")
-POCO_IMPLEMENT_EXCEPTION(OpenFileException, FileException, "Cannot open file")
-POCO_IMPLEMENT_EXCEPTION(WriteFileException, FileException, "Cannot write file")
-POCO_IMPLEMENT_EXCEPTION(ReadFileException, FileException, "Cannot read file")
-POCO_IMPLEMENT_EXCEPTION(UnknownURISchemeException, RuntimeException, "Unknown URI scheme")
-
-
-POCO_IMPLEMENT_EXCEPTION(ApplicationException, Exception, "Application exception")
-POCO_IMPLEMENT_EXCEPTION(BadCastException, RuntimeException, "Bad cast exception")
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FPEnvironment.cpp b/Utilities/Poco/Foundation/src/FPEnvironment.cpp
deleted file mode 100755
index 2bcc0d562a..0000000000
--- a/Utilities/Poco/Foundation/src/FPEnvironment.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// FPEnvironment.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-// pull in platform identification macros needed below
-#include "Poco/Platform.h"
-
-
-#if defined(POCO_NO_FPENVIRONMENT)
-#include "FPEnvironment_DUMMY.cpp"
-#elif defined(__osf__) || defined(__VMS)
-#include "FPEnvironment_DEC.cpp"
-#elif defined(sun) || defined(__sun)
-#include "FPEnvironment_SUN.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "FPEnvironment_C99.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "FPEnvironment_WIN32.cpp"
-#else
-#include "FPEnvironment_DUMMY.cpp"
-#endif
-
-
-// header file must be included after platform-specific part
-// due to _XOPEN_SOURCE conflict on Tru64 (see FPEnvironment_DEC.cpp)
-#include "Poco/FPEnvironment.h"
-
-
-namespace Poco {
-
-
-FPEnvironment::FPEnvironment()
-{
-}
-
-
-FPEnvironment::FPEnvironment(RoundingMode rm)
-{
- setRoundingMode(rm);
-}
-
-
-FPEnvironment::FPEnvironment(const FPEnvironment& env): FPEnvironmentImpl(env)
-{
-}
-
-
-FPEnvironment::~FPEnvironment()
-{
-}
-
-
-FPEnvironment& FPEnvironment::operator = (const FPEnvironment& env)
-{
- if (&env != this)
- {
- FPEnvironmentImpl::operator = (env);
- }
- return *this;
-}
-
-
-void FPEnvironment::keepCurrent()
-{
- keepCurrentImpl();
-}
-
-
-void FPEnvironment::clearFlags()
-{
- clearFlagsImpl();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FPEnvironment_C99.cpp b/Utilities/Poco/Foundation/src/FPEnvironment_C99.cpp
deleted file mode 100755
index 40805e3426..0000000000
--- a/Utilities/Poco/Foundation/src/FPEnvironment_C99.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// FPEnvironment_C99.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Copyright (c) 2004-2006, 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/FPEnvironment_C99.h"
-
-
-namespace Poco {
-
-
-FPEnvironmentImpl::FPEnvironmentImpl()
-{
- fegetenv(&_env);
-}
-
-
-FPEnvironmentImpl::FPEnvironmentImpl(const FPEnvironmentImpl& env)
-{
- _env = env._env;
-}
-
-
-FPEnvironmentImpl::~FPEnvironmentImpl()
-{
- fesetenv(&_env);
-}
-
-
-FPEnvironmentImpl& FPEnvironmentImpl::operator = (const FPEnvironmentImpl& env)
-{
- _env = env._env;
- return *this;
-}
-
-
-void FPEnvironmentImpl::keepCurrentImpl()
-{
- fegetenv(&_env);
-}
-
-
-void FPEnvironmentImpl::clearFlagsImpl()
-{
- feclearexcept(FE_ALL_EXCEPT);
-}
-
-
-bool FPEnvironmentImpl::isFlagImpl(FlagImpl flag)
-{
- return fetestexcept(flag) != 0;
-}
-
-
-void FPEnvironmentImpl::setRoundingModeImpl(RoundingModeImpl mode)
-{
- fesetround(mode);
-}
-
-
-FPEnvironmentImpl::RoundingModeImpl FPEnvironmentImpl::getRoundingModeImpl()
-{
- return (RoundingModeImpl) fegetround();
-}
-
-
-long double FPEnvironmentImpl::copySignImpl(long double target, long double source)
-{
- return (source >= 0 && target >= 0) || (source < 0 && target < 0) ? target : -target;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FPEnvironment_DEC.cpp b/Utilities/Poco/Foundation/src/FPEnvironment_DEC.cpp
deleted file mode 100755
index 459922d969..0000000000
--- a/Utilities/Poco/Foundation/src/FPEnvironment_DEC.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-//
-// FPEnvironment_DEC.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-//
-// _XOPEN_SOURCE disables the ieee fp functions
-// in <math.h>, therefore we undefine it for this file.
-//
-#undef _XOPEN_SOURCE
-
-
-#include <math.h>
-#include <fp.h>
-#include <fp_class.h>
-#if defined(__VMS)
-#include <starlet.h>
-#endif
-#include "Poco/FPEnvironment_DEC.h"
-
-
-namespace Poco {
-
-
-FPEnvironmentImpl::FPEnvironmentImpl()
-{
-#if defined(__VMS)
- #pragma pointer_size save
- #pragma pointer_size 32
- struct _ieee env;
- sys$ieee_set_fp_control(0, 0, &env);
- #pragma pointer_size restore
- _env = env;
-#else
- _env = ieee_get_fp_control();
-#endif
-}
-
-
-FPEnvironmentImpl::FPEnvironmentImpl(const FPEnvironmentImpl& env)
-{
- _env = env._env;
-}
-
-
-FPEnvironmentImpl::~FPEnvironmentImpl()
-{
-#if defined(__VMS)
- #pragma pointer_size save
- #pragma pointer_size 32
- struct _ieee mask;
- mask.ieee$q_flags = 0xFFFFFFFFFFFFFFFF;
- struct _ieee env = _env;
- sys$ieee_set_fp_control(&mask, &env, 0);
- #pragma pointer_size restore
-#else
- ieee_set_fp_control(_env);
-#endif
-}
-
-
-FPEnvironmentImpl& FPEnvironmentImpl::operator = (const FPEnvironmentImpl& env)
-{
- _env = env._env;
- return *this;
-}
-
-
-bool FPEnvironmentImpl::isInfiniteImpl(float value)
-{
- int cls = fp_classf(value);
- return cls == FP_POS_INF || cls == FP_NEG_INF;
-}
-
-
-bool FPEnvironmentImpl::isInfiniteImpl(double value)
-{
- int cls = fp_class(value);
- return cls == FP_POS_INF || cls == FP_NEG_INF;
-}
-
-
-bool FPEnvironmentImpl::isInfiniteImpl(long double value)
-{
- int cls = fp_classl(value);
- return cls == FP_POS_INF || cls == FP_NEG_INF;
-}
-
-
-bool FPEnvironmentImpl::isNaNImpl(float value)
-{
- return isnanf(value) != 0;
-}
-
-
-bool FPEnvironmentImpl::isNaNImpl(double value)
-{
- return isnan(value) != 0;
-}
-
-
-bool FPEnvironmentImpl::isNaNImpl(long double value)
-{
- return isnanl(value) != 0;
-}
-
-
-float FPEnvironmentImpl::copySignImpl(float target, float source)
-{
- return copysignf(target, source);
-}
-
-
-double FPEnvironmentImpl::copySignImpl(double target, double source)
-{
- return copysign(target, source);
-}
-
-
-long double FPEnvironmentImpl::copySignImpl(long double target, long double source)
-{
- return copysignl(target, source);
-}
-
-
-void FPEnvironmentImpl::keepCurrentImpl()
-{
-#if defined(__VMS)
- #pragma pointer_size save
- #pragma pointer_size 32
- struct _ieee env;
- sys$ieee_set_fp_control(0, 0, &env);
- #pragma pointer_size restore
- _env = env;
-#else
- ieee_set_fp_control(_env);
-#endif
-}
-
-
-void FPEnvironmentImpl::clearFlagsImpl()
-{
-#if defined(__VMS)
- #pragma pointer_size save
- #pragma pointer_size 32
- struct _ieee mask;
- mask.ieee$q_flags = 0xFFFFFFFFFFFFFFFF;
- struct _ieee clr;
- clr.ieee$q_flags = 0;
- sys$ieee_set_fp_control(&mask, &clr, 0);
- #pragma pointer_size restore
-#else
- ieee_set_fp_control(0);
-#endif
-}
-
-
-bool FPEnvironmentImpl::isFlagImpl(FlagImpl flag)
-{
-#if defined(__VMS)
- #pragma pointer_size save
- #pragma pointer_size 32
- struct _ieee flags;
- sys$ieee_set_fp_control(0, 0, &flags);
- return (flags.ieee$q_flags & flag) != 0;
- #pragma pointer_size restore
-#else
- return (ieee_get_fp_control() & flag) != 0;
-#endif
-}
-
-
-void FPEnvironmentImpl::setRoundingModeImpl(RoundingModeImpl mode)
-{
- // not supported
-}
-
-
-FPEnvironmentImpl::RoundingModeImpl FPEnvironmentImpl::getRoundingModeImpl()
-{
- // not supported
- return FPEnvironmentImpl::RoundingModeImpl(0);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FPEnvironment_DUMMY.cpp b/Utilities/Poco/Foundation/src/FPEnvironment_DUMMY.cpp
deleted file mode 100755
index a227f48372..0000000000
--- a/Utilities/Poco/Foundation/src/FPEnvironment_DUMMY.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// FPEnvironment_C99.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Copyright (c) 2004-2006, 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/FPEnvironment_DUMMY.h"
-
-
-namespace Poco {
-
-
-FPEnvironmentImpl::RoundingModeImpl FPEnvironmentImpl::_roundingMode;
-
-
-FPEnvironmentImpl::FPEnvironmentImpl()
-{
-}
-
-
-FPEnvironmentImpl::FPEnvironmentImpl(const FPEnvironmentImpl& env)
-{
-}
-
-
-FPEnvironmentImpl::~FPEnvironmentImpl()
-{
-}
-
-
-FPEnvironmentImpl& FPEnvironmentImpl::operator = (const FPEnvironmentImpl& env)
-{
- return *this;
-}
-
-
-void FPEnvironmentImpl::keepCurrentImpl()
-{
-}
-
-
-void FPEnvironmentImpl::clearFlagsImpl()
-{
-}
-
-
-bool FPEnvironmentImpl::isFlagImpl(FlagImpl flag)
-{
- return false;
-}
-
-
-void FPEnvironmentImpl::setRoundingModeImpl(RoundingModeImpl mode)
-{
- _roundingMode = mode;
-}
-
-
-FPEnvironmentImpl::RoundingModeImpl FPEnvironmentImpl::getRoundingModeImpl()
-{
- return _roundingMode;
-}
-
-
-long double FPEnvironmentImpl::copySignImpl(long double target, long double source)
-{
- return (source >= 0 && target >= 0) || (source < 0 && target < 0) ? target : -target;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FPEnvironment_SUN.cpp b/Utilities/Poco/Foundation/src/FPEnvironment_SUN.cpp
deleted file mode 100755
index f17c2d59cc..0000000000
--- a/Utilities/Poco/Foundation/src/FPEnvironment_SUN.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// FPEnvironment_SUN.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Copyright (c) 2005-2006, 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 <math.h>
-#include "Poco/FPEnvironment_SUN.h"
-
-
-namespace Poco {
-
-
-FPEnvironmentImpl::FPEnvironmentImpl()
-{
- _rnd = fpgetround();
- _exc = fpgetmask();
-}
-
-
-FPEnvironmentImpl::FPEnvironmentImpl(const FPEnvironmentImpl& env)
-{
- _rnd = env._rnd;
- _exc = env._exc;
-}
-
-
-FPEnvironmentImpl::~FPEnvironmentImpl()
-{
- fpsetround(_rnd);
- fpsetmask(_exc);
-}
-
-
-FPEnvironmentImpl& FPEnvironmentImpl::operator = (const FPEnvironmentImpl& env)
-{
- _rnd = env._rnd;
- _exc = env._exc;
- return *this;
-}
-
-
-bool FPEnvironmentImpl::isInfiniteImpl(float value)
-{
- int cls = fpclass(value);
- return cls == FP_PINF || cls == FP_NINF;
-}
-
-
-bool FPEnvironmentImpl::isInfiniteImpl(double value)
-{
- int cls = fpclass(value);
- return cls == FP_PINF || cls == FP_NINF;
-}
-
-
-bool FPEnvironmentImpl::isInfiniteImpl(long double value)
-{
- int cls = fpclass(value);
- return cls == FP_PINF || cls == FP_NINF;
-}
-
-
-bool FPEnvironmentImpl::isNaNImpl(float value)
-{
- return isnanf(value) != 0;
-}
-
-
-bool FPEnvironmentImpl::isNaNImpl(double value)
-{
- return isnan(value) != 0;
-}
-
-
-bool FPEnvironmentImpl::isNaNImpl(long double value)
-{
- return isnan((double) value) != 0;
-}
-
-
-float FPEnvironmentImpl::copySignImpl(float target, float source)
-{
- return (float) copysign(target, source);
-}
-
-
-double FPEnvironmentImpl::copySignImpl(double target, double source)
-{
- return (float) copysign(target, source);
-}
-
-
-long double FPEnvironmentImpl::copySignImpl(long double target, long double source)
-{
- return (source > 0 && target > 0) || (source < 0 && target < 0) ? target : -target;
-}
-
-
-void FPEnvironmentImpl::keepCurrentImpl()
-{
- fpsetround(_rnd);
- fpsetmask(_exc);
-}
-
-
-void FPEnvironmentImpl::clearFlagsImpl()
-{
- fpsetsticky(0);
-}
-
-
-bool FPEnvironmentImpl::isFlagImpl(FlagImpl flag)
-{
- return (fpgetsticky() & flag) != 0;
-}
-
-
-void FPEnvironmentImpl::setRoundingModeImpl(RoundingModeImpl mode)
-{
- fpsetround((fp_rnd) mode);
-}
-
-
-FPEnvironmentImpl::RoundingModeImpl FPEnvironmentImpl::getRoundingModeImpl()
-{
- return (FPEnvironmentImpl::RoundingModeImpl) fpgetround();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FPEnvironment_WIN32.cpp b/Utilities/Poco/Foundation/src/FPEnvironment_WIN32.cpp
deleted file mode 100755
index b4cc24eae9..0000000000
--- a/Utilities/Poco/Foundation/src/FPEnvironment_WIN32.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// FPEnvironment_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: FPEnvironment
-//
-// Copyright (c) 2004-2006, 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/FPEnvironment_WIN32.h"
-
-
-namespace Poco {
-
-
-FPEnvironmentImpl::FPEnvironmentImpl()
-{
- _env = _controlfp(0, 0);
-}
-
-
-FPEnvironmentImpl::FPEnvironmentImpl(const FPEnvironmentImpl& env)
-{
- _env = env._env;
-}
-
-
-FPEnvironmentImpl::~FPEnvironmentImpl()
-{
- _controlfp(_env, MCW_RC);
-}
-
-
-FPEnvironmentImpl& FPEnvironmentImpl::operator = (const FPEnvironmentImpl& env)
-{
- _env = env._env;
- return *this;
-}
-
-
-void FPEnvironmentImpl::keepCurrentImpl()
-{
- _env = _controlfp(0, 0);
-}
-
-
-void FPEnvironmentImpl::clearFlagsImpl()
-{
- _clearfp();
-}
-
-
-bool FPEnvironmentImpl::isFlagImpl(FlagImpl flag)
-{
- return (_statusfp() & flag) != 0;
-}
-
-
-void FPEnvironmentImpl::setRoundingModeImpl(RoundingModeImpl mode)
-{
- _controlfp(mode, MCW_RC);
-}
-
-
-FPEnvironmentImpl::RoundingModeImpl FPEnvironmentImpl::getRoundingModeImpl()
-{
- return RoundingModeImpl(_controlfp(0, 0) & MCW_RC);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/File.cpp b/Utilities/Poco/Foundation/src/File.cpp
deleted file mode 100755
index 6a672c632f..0000000000
--- a/Utilities/Poco/Foundation/src/File.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-//
-// File.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: File
-//
-// Copyright (c) 2004-2006, 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/File.h"
-#include "Poco/Path.h"
-#include "Poco/DirectoryIterator.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "File_WIN32U.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "File_WIN32.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "File_UNIX.cpp"
-#else
-#include "File_VMS.cpp"
-#endif
-
-
-namespace Poco {
-
-
-File::File()
-{
-}
-
-
-File::File(const std::string& path): FileImpl(path)
-{
-}
-
-
-File::File(const char* path): FileImpl(std::string(path))
-{
-}
-
-
-File::File(const Path& path): FileImpl(path.toString())
-{
-}
-
-
-File::File(const File& file): FileImpl(file.getPathImpl())
-{
-}
-
-
-File::~File()
-{
-}
-
-
-File& File::operator = (const File& file)
-{
- setPathImpl(file.getPathImpl());
- return *this;
-}
-
-
-File& File::operator = (const std::string& path)
-{
- setPathImpl(path);
- return *this;
-}
-
-
-File& File::operator = (const char* path)
-{
- poco_check_ptr (path);
- setPathImpl(path);
- return *this;
-}
-
-
-File& File::operator = (const Path& path)
-{
- setPathImpl(path.toString());
- return *this;
-}
-
-
-void File::swap(File& file)
-{
- swapImpl(file);
-}
-
-
-bool File::exists() const
-{
- return existsImpl();
-}
-
-
-bool File::canRead() const
-{
- return canReadImpl();
-}
-
-
-bool File::canWrite() const
-{
- return canWriteImpl();
-}
-
-
-bool File::canExecute() const
-{
- return canExecuteImpl();
-}
-
-
-bool File::isFile() const
-{
- return isFileImpl();
-}
-
-
-bool File::isDirectory() const
-{
- return isDirectoryImpl();
-}
-
-
-bool File::isLink() const
-{
- return isLinkImpl();
-}
-
-
-bool File::isDevice() const
-{
- return isDeviceImpl();
-}
-
-
-bool File::isHidden() const
-{
- return isHiddenImpl();
-}
-
-
-Timestamp File::created() const
-{
- return createdImpl();
-}
-
-
-Timestamp File::getLastModified() const
-{
- return getLastModifiedImpl();
-}
-
-
-void File::setLastModified(const Timestamp& ts)
-{
- setLastModifiedImpl(ts);
-}
-
-
-File::FileSize File::getSize() const
-{
- return getSizeImpl();
-}
-
-
-void File::setSize(FileSizeImpl size)
-{
- setSizeImpl(size);
-}
-
-
-void File::setWriteable(bool flag)
-{
- setWriteableImpl(flag);
-}
-
-
-void File::setReadOnly(bool flag)
-{
- setWriteableImpl(!flag);
-}
-
-
-void File::setExecutable(bool flag)
-{
- setExecutableImpl(flag);
-}
-
-
-void File::copyTo(const std::string& path) const
-{
- Path src(getPathImpl());
- Path dest(path);
- File destFile(path);
- if ((destFile.exists() && destFile.isDirectory()) || dest.isDirectory())
- {
- dest.makeDirectory();
- dest.setFileName(src.getFileName());
- }
- if (isDirectory())
- copyDirectory(dest.toString());
- else
- copyToImpl(dest.toString());
-}
-
-
-void File::copyDirectory(const std::string& path) const
-{
- File target(path);
- target.createDirectories();
-
- Path src(getPathImpl());
- src.makeFile();
- DirectoryIterator it(src);
- DirectoryIterator end;
- for (; it != end; ++it)
- {
- it->copyTo(path);
- }
-}
-
-
-void File::moveTo(const std::string& path)
-{
- copyTo(path);
- remove(true);
- setPathImpl(path);
-}
-
-
-void File::renameTo(const std::string& path)
-{
- renameToImpl(path);
- setPathImpl(path);
-}
-
-
-void File::remove(bool recursive)
-{
- if (recursive && !isLink() && isDirectory())
- {
- std::vector<File> files;
- list(files);
- for (std::vector<File>::iterator it = files.begin(); it != files.end(); ++it)
- {
- it->remove(true);
- }
- }
- removeImpl();
-}
-
-
-bool File::createFile()
-{
- return createFileImpl();
-}
-
-
-bool File::createDirectory()
-{
- return createDirectoryImpl();
-}
-
-
-void File::createDirectories()
-{
- if (!exists())
- {
- Path p(getPathImpl());
- p.makeDirectory();
- if (p.depth() > 1)
- {
- p.makeParent();
- File f(p);
- f.createDirectories();
- }
- createDirectoryImpl();
- }
-}
-
-
-void File::list(std::vector<std::string>& files) const
-{
- files.clear();
- DirectoryIterator it(*this);
- DirectoryIterator end;
- while (it != end)
- {
- files.push_back(it.name());
- ++it;
- }
-}
-
-
-void File::list(std::vector<File>& files) const
-{
- files.clear();
- DirectoryIterator it(*this);
- DirectoryIterator end;
- while (it != end)
- {
- files.push_back(*it);
- ++it;
- }
-}
-
-
-void File::handleLastError(const std::string& path)
-{
- handleLastErrorImpl(path);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FileChannel.cpp b/Utilities/Poco/Foundation/src/FileChannel.cpp
deleted file mode 100755
index 9fc2f1e173..0000000000
--- a/Utilities/Poco/Foundation/src/FileChannel.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-//
-// FileChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: FileChannel
-//
-// Copyright (c) 2004-2006, 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/FileChannel.h"
-#include "Poco/ArchiveStrategy.h"
-#include "Poco/RotateStrategy.h"
-#include "Poco/PurgeStrategy.h"
-#include "Poco/Message.h"
-#include "Poco/NumberParser.h"
-#include "Poco/DateTimeFormatter.h"
-#include "Poco/DateTime.h"
-#include "Poco/LocalDateTime.h"
-#include "Poco/String.h"
-#include "Poco/Timespan.h"
-#include "Poco/Exception.h"
-#include <cctype>
-
-
-namespace Poco {
-
-
-const std::string FileChannel::PROP_PATH = "path";
-const std::string FileChannel::PROP_ROTATION = "rotation";
-const std::string FileChannel::PROP_ARCHIVE = "archive";
-const std::string FileChannel::PROP_TIMES = "times";
-const std::string FileChannel::PROP_COMPRESS = "compress";
-const std::string FileChannel::PROP_PURGEAGE = "purgeAge";
-const std::string FileChannel::PROP_PURGECOUNT = "purgeCount";
-
-
-FileChannel::FileChannel():
- _times("utc"),
- _compress(false),
- _pFile(0),
- _pRotateStrategy(0),
- _pArchiveStrategy(new ArchiveByNumberStrategy),
- _pPurgeStrategy(0)
-{
-}
-
-
-FileChannel::FileChannel(const std::string& path):
- _path(path),
- _times("utc"),
- _compress(false),
- _pFile(0),
- _pRotateStrategy(0),
- _pArchiveStrategy(new ArchiveByNumberStrategy),
- _pPurgeStrategy(0)
-{
-}
-
-
-FileChannel::~FileChannel()
-{
- close();
- delete _pRotateStrategy;
- delete _pArchiveStrategy;
- delete _pPurgeStrategy;
-}
-
-
-void FileChannel::open()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (!_pFile)
- {
- _pFile = new LogFile(_path);
- }
-}
-
-
-void FileChannel::close()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- delete _pFile;
- _pFile = 0;
-}
-
-
-void FileChannel::log(const Message& msg)
-{
- open();
-
- FastMutex::ScopedLock lock(_mutex);
-
- if (_pRotateStrategy && _pArchiveStrategy && _pRotateStrategy->mustRotate(_pFile))
- {
- try
- {
- _pFile = _pArchiveStrategy->archive(_pFile);
- purge();
- }
- catch (...)
- {
- _pFile = new LogFile(_path);
- }
- // we must call mustRotate() again to give the
- // RotateByIntervalStrategy a chance to write its timestamp
- // to the new file.
- _pRotateStrategy->mustRotate(_pFile);
- }
- _pFile->write(msg.getText());
-}
-
-
-void FileChannel::setProperty(const std::string& name, const std::string& value)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (name == PROP_TIMES)
- {
- _times = value;
-
- if (!_rotation.empty())
- setRotation(_rotation);
-
- if (!_archive.empty())
- setArchive(_archive);
- }
- else if (name == PROP_PATH)
- _path = value;
- else if (name == PROP_ROTATION)
- setRotation(value);
- else if (name == PROP_ARCHIVE)
- setArchive(value);
- else if (name == PROP_COMPRESS)
- setCompress(value);
- else if (name == PROP_PURGEAGE)
- setPurgeAge(value);
- else if (name == PROP_PURGECOUNT)
- setPurgeCount(value);
- else
- Channel::setProperty(name, value);
-}
-
-
-std::string FileChannel::getProperty(const std::string& name) const
-{
- if (name == PROP_TIMES)
- return _times;
- else if (name == PROP_PATH)
- return _path;
- else if (name == PROP_ROTATION)
- return _rotation;
- else if (name == PROP_ARCHIVE)
- return _archive;
- else if (name == PROP_COMPRESS)
- return std::string(_compress ? "true" : "false");
- else if (name == PROP_PURGEAGE)
- return _purgeAge;
- else if (name == PROP_PURGECOUNT)
- return _purgeCount;
- else
- return Channel::getProperty(name);
-}
-
-
-Timestamp FileChannel::creationDate() const
-{
- if (_pFile)
- return _pFile->creationDate();
- else
- return 0;
-}
-
-
-UInt64 FileChannel::size() const
-{
- if (_pFile)
- return _pFile->size();
- else
- return 0;
-}
-
-
-const std::string& FileChannel::path() const
-{
- return _path;
-}
-
-
-void FileChannel::setRotation(const std::string& rotation)
-{
- std::string::const_iterator it = rotation.begin();
- std::string::const_iterator end = rotation.end();
- int n = 0;
- while (it != end && std::isspace(*it)) ++it;
- while (it != end && std::isdigit(*it)) { n *= 10; n += *it++ - '0'; }
- while (it != end && std::isspace(*it)) ++it;
- std::string unit;
- while (it != end && std::isalpha(*it)) unit += *it++;
-
- RotateStrategy* pStrategy = 0;
- if ((rotation.find(',') != std::string::npos) || (rotation.find(':') != std::string::npos))
- {
- if (_times == "utc")
- pStrategy = new RotateAtTimeStrategy<DateTime>(rotation);
- else if (_times == "local")
- pStrategy = new RotateAtTimeStrategy<LocalDateTime>(rotation);
- else
- throw PropertyNotSupportedException("times", _times);
- }
- else if (unit == "daily")
- pStrategy = new RotateByIntervalStrategy(Timespan(1*Timespan::DAYS));
- else if (unit == "weekly")
- pStrategy = new RotateByIntervalStrategy(Timespan(7*Timespan::DAYS));
- else if (unit == "monthly")
- pStrategy = new RotateByIntervalStrategy(Timespan(30*Timespan::DAYS));
- else if (unit == "seconds") // for testing only
- pStrategy = new RotateByIntervalStrategy(Timespan(n*Timespan::SECONDS));
- else if (unit == "minutes")
- pStrategy = new RotateByIntervalStrategy(Timespan(n*Timespan::MINUTES));
- else if (unit == "hours")
- pStrategy = new RotateByIntervalStrategy(Timespan(n*Timespan::HOURS));
- else if (unit == "days")
- pStrategy = new RotateByIntervalStrategy(Timespan(n*Timespan::DAYS));
- else if (unit == "weeks")
- pStrategy = new RotateByIntervalStrategy(Timespan(n*7*Timespan::DAYS));
- else if (unit == "months")
- pStrategy = new RotateByIntervalStrategy(Timespan(n*30*Timespan::DAYS));
- else if (unit == "K")
- pStrategy = new RotateBySizeStrategy(n*1024);
- else if (unit == "M")
- pStrategy = new RotateBySizeStrategy(n*1024*1024);
- else if (unit.empty())
- pStrategy = new RotateBySizeStrategy(n);
- else if (unit != "never")
- throw InvalidArgumentException("rotation", rotation);
- delete _pRotateStrategy;
- _pRotateStrategy = pStrategy;
- _rotation = rotation;
-}
-
-
-void FileChannel::setArchive(const std::string& archive)
-{
- ArchiveStrategy* pStrategy = 0;
- if (archive == "number")
- {
- pStrategy = new ArchiveByNumberStrategy;
- }
- else if (archive == "timestamp")
- {
- if (_times == "utc")
- pStrategy = new ArchiveByTimestampStrategy<DateTime>;
- else if (_times == "local")
- pStrategy = new ArchiveByTimestampStrategy<LocalDateTime>;
- else
- throw PropertyNotSupportedException("times", _times);
- }
- else throw InvalidArgumentException("archive", archive);
- delete _pArchiveStrategy;
- pStrategy->compress(_compress);
- _pArchiveStrategy = pStrategy;
- _archive = archive;
-}
-
-
-void FileChannel::setCompress(const std::string& compress)
-{
- _compress = icompare(compress, "true") == 0;
- if (_pArchiveStrategy)
- _pArchiveStrategy->compress(_compress);
-}
-
-
-void FileChannel::setPurgeAge(const std::string& age)
-{
- std::string::const_iterator it = age.begin();
- std::string::const_iterator end = age.end();
- int n = 0;
- while (it != end && std::isspace(*it)) ++it;
- while (it != end && std::isdigit(*it)) { n *= 10; n += *it++ - '0'; }
- while (it != end && std::isspace(*it)) ++it;
- std::string unit;
- while (it != end && std::isalpha(*it)) unit += *it++;
-
- Timespan::TimeDiff factor = Timespan::SECONDS;
- if (unit == "minutes")
- factor = Timespan::MINUTES;
- else if (unit == "hours")
- factor = Timespan::HOURS;
- else if (unit == "days")
- factor = Timespan::DAYS;
- else if (unit == "weeks")
- factor = 7*Timespan::DAYS;
- else if (unit == "months")
- factor = 30*Timespan::DAYS;
- else if (unit != "seconds")
- throw InvalidArgumentException("purgeAge", age);
-
- delete _pPurgeStrategy;
- _pPurgeStrategy = new PurgeByAgeStrategy(Timespan(factor*n));
- _purgeAge = age;
-}
-
-
-void FileChannel::setPurgeCount(const std::string& count)
-{
- std::string::const_iterator it = count.begin();
- std::string::const_iterator end = count.end();
- int n = 0;
- while (it != end && std::isspace(*it)) ++it;
- while (it != end && std::isdigit(*it)) { n *= 10; n += *it++ - '0'; }
- while (it != end && std::isspace(*it)) ++it;
-
- delete _pPurgeStrategy;
- _pPurgeStrategy = new PurgeByCountStrategy(n);
- _purgeCount = count;
-}
-
-
-void FileChannel::purge()
-{
- if (_pPurgeStrategy)
- {
- try
- {
- _pPurgeStrategy->purge(_path);
- }
- catch (...)
- {
- }
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FileStream.cpp b/Utilities/Poco/Foundation/src/FileStream.cpp
deleted file mode 100755
index d1e15c36cd..0000000000
--- a/Utilities/Poco/Foundation/src/FileStream.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-//
-// FileStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: FileStream
-//
-// Copyright (c) 2007, 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/FileStream.h"
-#include "Poco/Exception.h"
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "FileStream_WIN32.cpp"
-#else
-#include "FileStream_POSIX.cpp"
-#endif
-
-
-namespace Poco {
-
-
-FileIOS::FileIOS(std::ios::openmode defaultMode):
- _defaultMode(defaultMode)
-{
- poco_ios_init(&_buf);
-}
-
-
-FileIOS::~FileIOS()
-{
-}
-
-
-void FileIOS::open(const std::string& path, std::ios::openmode mode)
-{
- clear();
- _buf.open(path, mode | _defaultMode);
-}
-
-
-void FileIOS::close()
-{
- _buf.close();
-}
-
-
-FileStreamBuf* FileIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-FileInputStream::FileInputStream():
- FileIOS(std::ios::in),
- std::istream(&_buf)
-{
-}
-
-
-FileInputStream::FileInputStream(const std::string& path, std::ios::openmode mode):
- FileIOS(std::ios::in),
- std::istream(&_buf)
-{
- open(path, mode);
-}
-
-
-FileInputStream::~FileInputStream()
-{
-}
-
-
-FileOutputStream::FileOutputStream():
- FileIOS(std::ios::out),
- std::ostream(&_buf)
-{
-}
-
-
-FileOutputStream::FileOutputStream(const std::string& path, std::ios::openmode mode):
- FileIOS(std::ios::out),
- std::ostream(&_buf)
-{
- open(path, mode);
-}
-
-
-FileOutputStream::~FileOutputStream()
-{
-}
-
-
-FileStream::FileStream():
- FileIOS(std::ios::in | std::ios::out),
- std::iostream(&_buf)
-{
-}
-
-
-FileStream::FileStream(const std::string& path, std::ios::openmode mode):
- FileIOS(std::ios::in | std::ios::out),
- std::iostream(&_buf)
-{
- open(path, mode);
-}
-
-
-FileStream::~FileStream()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FileStreamFactory.cpp b/Utilities/Poco/Foundation/src/FileStreamFactory.cpp
deleted file mode 100755
index e955717550..0000000000
--- a/Utilities/Poco/Foundation/src/FileStreamFactory.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// FileStreamFactory.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: URI
-// Module: FileStreamFactory
-//
-// Copyright (c) 2004-2006, 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/FileStreamFactory.h"
-#include "Poco/URI.h"
-#include "Poco/Path.h"
-#include "Poco/File.h"
-#include "Poco/Exception.h"
-#include "Poco/FileStream.h"
-
-
-namespace Poco {
-
-
-FileStreamFactory::FileStreamFactory()
-{
-}
-
-
-FileStreamFactory::~FileStreamFactory()
-{
-}
-
-
-std::istream* FileStreamFactory::open(const URI& uri)
-{
- poco_assert (uri.isRelative() || uri.getScheme() == "file");
-
- std::string uriPath = uri.getPath();
- if (uriPath.substr(0, 2) == "./")
- uriPath.erase(0, 2);
- Path p(uriPath, Path::PATH_UNIX);
- p.setNode(uri.getHost());
- return open(p);
-}
-
-
-std::istream* FileStreamFactory::open(const Path& path)
-{
- File file(path);
- if (!file.exists()) throw FileNotFoundException(path.toString());
-
- FileInputStream* istr = new FileInputStream(path.toString(), std::ios::binary);
- if (!istr->good())
- {
- delete istr;
- throw OpenFileException(path.toString());
- }
- return istr;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FileStream_POSIX.cpp b/Utilities/Poco/Foundation/src/FileStream_POSIX.cpp
deleted file mode 100755
index 50a5755955..0000000000
--- a/Utilities/Poco/Foundation/src/FileStream_POSIX.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-//
-// FileStream_POSIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: FileStream
-//
-// Copyright (c) 2007, 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/FileStream.h"
-#include "Poco/File.h"
-#include "Poco/Exception.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-
-namespace Poco {
-
-
-FileStreamBuf::FileStreamBuf():
- BufferedBidirectionalStreamBuf(BUFFER_SIZE, std::ios::in | std::ios::out),
- _fd(-1),
- _pos(0)
-{
-}
-
-
-FileStreamBuf::~FileStreamBuf()
-{
- try
- {
- close();
- }
- catch (...)
- {
- }
-}
-
-
-void FileStreamBuf::open(const std::string& path, std::ios::openmode mode)
-{
- poco_assert (_fd == -1);
-
- _path = path;
- setMode(mode);
-
- int flags(0);
- if (mode & std::ios::trunc)
- flags |= O_TRUNC;
- if (mode & std::ios::app)
- flags |= O_APPEND;
- if (mode & std::ios::out)
- flags |= O_CREAT;
- if ((mode & std::ios::in) && (mode & std::ios::out))
- flags |= O_RDWR;
- else if (mode & std::ios::in)
- flags |= O_RDONLY;
- else
- flags |= O_WRONLY;
-
- _fd = ::open(path.c_str(), flags, S_IRUSR | S_IWUSR | S_IRGRP);
- if (_fd == -1)
- File::handleLastError(_path);
-
- if ((mode & std::ios::app) || (mode & std::ios::ate))
- seekoff(0, std::ios::end, mode);
-}
-
-
-int FileStreamBuf::readFromDevice(char* buffer, std::streamsize length)
-{
- if (_fd == -1) return -1;
-
- if (getMode() & std::ios::out)
- sync();
-
- int n = read(_fd, buffer, length);
- if (n == -1)
- File::handleLastError(_path);
- _pos += n;
- return n;
-}
-
-
-int FileStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
-{
- if (_fd == -1) return -1;
-
- int n = write(_fd, buffer, length);
- if (n == -1)
- File::handleLastError(_path);
- _pos += n;
- return n;
-}
-
-
-void FileStreamBuf::close()
-{
- if (_fd != -1)
- {
- sync();
- ::close(_fd);
- _fd = -1;
- }
-}
-
-
-std::streampos FileStreamBuf::seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode)
-{
- if (_fd == -1 || !(getMode() & mode))
- return -1;
-
- if (getMode() & std::ios::out)
- sync();
-
- std::streamoff adj;
- if (mode & std::ios::in)
- adj = static_cast<std::streamoff>(egptr() - gptr());
- else
- adj = 0;
-
- resetBuffers();
-
- int whence = SEEK_SET;
- if (dir == std::ios::cur)
- {
- whence = SEEK_CUR;
- off -= adj;
- }
- else if (dir == std::ios::end)
- {
- whence = SEEK_END;
- }
- _pos = lseek(_fd, off, whence);
- return _pos;
-}
-
-
-std::streampos FileStreamBuf::seekpos(std::streampos pos, std::ios::openmode mode)
-{
- if (_fd == -1 || !(getMode() & mode))
- return -1;
-
- if (getMode() & std::ios::out)
- sync();
-
- resetBuffers();
-
- _pos = lseek(_fd, pos, SEEK_SET);
- return _pos;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FileStream_WIN32.cpp b/Utilities/Poco/Foundation/src/FileStream_WIN32.cpp
deleted file mode 100755
index de21ca7ae1..0000000000
--- a/Utilities/Poco/Foundation/src/FileStream_WIN32.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-//
-// FileStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: FileStream
-//
-// Copyright (c) 2007, 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/FileStream.h"
-#include "Poco/File.h"
-#include "Poco/Exception.h"
-#if defined (POCO_WIN32_UTF8)
-#include "Poco/UnicodeConverter.h"
-#endif
-
-
-namespace Poco {
-
-
-FileStreamBuf::FileStreamBuf():
- BufferedBidirectionalStreamBuf(BUFFER_SIZE, std::ios::in | std::ios::out),
- _handle(INVALID_HANDLE_VALUE),
- _pos(0)
-{
-}
-
-
-FileStreamBuf::~FileStreamBuf()
-{
- try
- {
- close();
- }
- catch (...)
- {
- }
-}
-
-
-void FileStreamBuf::open(const std::string& path, std::ios::openmode mode)
-{
- poco_assert (_handle == INVALID_HANDLE_VALUE);
-
- _path = path;
- setMode(mode);
-
- DWORD access = 0;
- if (mode & std::ios::in)
- access |= GENERIC_READ;
- if (mode & std::ios::out)
- access |= GENERIC_WRITE;
-
- DWORD shareMode = FILE_SHARE_READ;
- DWORD creationDisp = OPEN_EXISTING;
- if (mode & std::ios::trunc)
- creationDisp = CREATE_ALWAYS;
- else if (mode & std::ios::out)
- creationDisp = OPEN_ALWAYS;
-
- DWORD flags = FILE_ATTRIBUTE_NORMAL;
-
-#if defined (POCO_WIN32_UTF8)
- std::wstring utf16Path;
- UnicodeConverter::toUTF16(path, utf16Path);
- _handle = CreateFileW(utf16Path.c_str(), access, shareMode, NULL, creationDisp, flags, NULL);
-#else
- _handle = CreateFileA(path.c_str(), access, shareMode, NULL, creationDisp, flags, NULL);
-#endif
-
- if (_handle == INVALID_HANDLE_VALUE)
- File::handleLastError(_path);
-
- if ((mode & std::ios::ate) || (mode & std::ios::app))
- seekoff(0, std::ios::end, mode);
-}
-
-
-int FileStreamBuf::readFromDevice(char* buffer, std::streamsize length)
-{
- if (INVALID_HANDLE_VALUE == _handle || !(getMode() & std::ios::in))
- return -1;
-
- if (getMode() & std::ios::out)
- sync();
-
- DWORD bytesRead(0);
- BOOL rc = ReadFile(_handle, buffer, static_cast<DWORD>(length), &bytesRead, NULL);
- if (rc == 0)
- File::handleLastError(_path);
-
- _pos += bytesRead;
-
- return static_cast<int>(bytesRead);
-}
-
-
-int FileStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
-{
- if (INVALID_HANDLE_VALUE == _handle || !(getMode() & std::ios::out))
- return -1;
-
- if (getMode() & std::ios::app)
- {
- LARGE_INTEGER li;
- li.QuadPart = 0;
- li.LowPart = SetFilePointer(_handle, li.LowPart, &li.HighPart, FILE_END);
- if (li.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR)
- File::handleLastError(_path);
- _pos = li.QuadPart;
- }
-
- DWORD bytesWritten(0);
- BOOL rc = WriteFile(_handle, buffer, static_cast<DWORD>(length), &bytesWritten, NULL);
- if (rc == 0)
- File::handleLastError(_path);
-
- _pos += bytesWritten;
-
- return static_cast<int>(bytesWritten);
-}
-
-
-void FileStreamBuf::close()
-{
- if (_handle != INVALID_HANDLE_VALUE)
- {
- if (getMode() & std::ios::out)
- sync();
-
- CloseHandle(_handle);
- _handle = INVALID_HANDLE_VALUE;
- }
-}
-
-
-std::streampos FileStreamBuf::seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode)
-{
- if (INVALID_HANDLE_VALUE == _handle || !(getMode() & mode))
- return -1;
-
- if (getMode() & std::ios::out)
- sync();
-
- std::streamoff adj;
- if (mode & std::ios::in)
- adj = static_cast<std::streamoff>(egptr() - gptr());
- else
- adj = 0;
-
- resetBuffers();
-
- DWORD offset = FILE_BEGIN;
- if (dir == std::ios::cur)
- {
- offset = FILE_CURRENT;
- off -= adj;
- }
- else if (dir == std::ios::end)
- {
- offset = FILE_END;
- }
-
- LARGE_INTEGER li;
- li.QuadPart = off;
- li.LowPart = SetFilePointer(_handle, li.LowPart, &li.HighPart, offset);
-
- if (li.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR)
- File::handleLastError(_path);
- _pos = li.QuadPart;
- return std::streampos(static_cast<std::streamoff>(_pos));
-}
-
-
-std::streampos FileStreamBuf::seekpos(std::streampos pos, std::ios::openmode mode)
-{
- if (INVALID_HANDLE_VALUE == _handle || !(getMode() & mode))
- return -1;
-
- if (getMode() & std::ios::out)
- sync();
-
- resetBuffers();
-
- LARGE_INTEGER li;
- li.QuadPart = pos;
- li.LowPart = SetFilePointer(_handle, li.LowPart, &li.HighPart, FILE_BEGIN);
-
- if (li.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR)
- File::handleLastError(_path);
- _pos = li.QuadPart;
- return std::streampos(static_cast<std::streamoff>(_pos));
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/File_UNIX.cpp b/Utilities/Poco/Foundation/src/File_UNIX.cpp
deleted file mode 100755
index 8fbf4835c7..0000000000
--- a/Utilities/Poco/Foundation/src/File_UNIX.cpp
+++ /dev/null
@@ -1,474 +0,0 @@
-//
-// File_UNIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: File
-//
-// Copyright (c) 2004-2006, 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/File_UNIX.h"
-#include "Poco/Buffer.h"
-#include "Poco/Exception.h"
-#include <algorithm>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <utime.h>
-#include <cstring>
-
-
-namespace Poco {
-
-
-FileImpl::FileImpl()
-{
-}
-
-
-FileImpl::FileImpl(const std::string& path): _path(path)
-{
- std::string::size_type n = _path.size();
- if (n > 1 && _path[n - 1] == '/')
- _path.resize(n - 1);
-}
-
-
-FileImpl::~FileImpl()
-{
-}
-
-
-void FileImpl::swapImpl(FileImpl& file)
-{
- std::swap(_path, file._path);
-}
-
-
-void FileImpl::setPathImpl(const std::string& path)
-{
- _path = path;
- std::string::size_type n = _path.size();
- if (n > 1 && _path[n - 1] == '/')
- _path.resize(n - 1);
-}
-
-
-bool FileImpl::existsImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- return stat(_path.c_str(), &st) == 0;
-}
-
-
-bool FileImpl::canReadImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- {
- if (geteuid() == 0)
- return true;
- else if (st.st_uid == geteuid())
- return (st.st_mode & S_IRUSR) != 0;
- else if (st.st_gid == getegid())
- return (st.st_mode & S_IRGRP) != 0;
- else
- return (st.st_mode & S_IROTH) != 0;
- }
- else handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::canWriteImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- {
- if (geteuid() == 0)
- return true;
- else if (st.st_uid == geteuid())
- return (st.st_mode & S_IWUSR) != 0;
- else if (st.st_gid == getegid())
- return (st.st_mode & S_IWGRP) != 0;
- else
- return (st.st_mode & S_IWOTH) != 0;
- }
- else handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::canExecuteImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- {
- if (st.st_uid == geteuid() || geteuid() == 0)
- return (st.st_mode & S_IXUSR) != 0;
- else if (st.st_gid == getegid())
- return (st.st_mode & S_IXGRP) != 0;
- else
- return (st.st_mode & S_IXOTH) != 0;
- }
- else handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::isFileImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return S_ISREG(st.st_mode);
- else
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::isDirectoryImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return S_ISDIR(st.st_mode);
- else
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::isLinkImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (lstat(_path.c_str(), &st) == 0)
- return S_ISLNK(st.st_mode);
- else
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::isDeviceImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode);
- else
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::isHiddenImpl() const
-{
- poco_assert (!_path.empty());
- Path p(_path);
- p.makeFile();
-
- return p.getFileName()[0] == '.';
-}
-
-
-Timestamp FileImpl::createdImpl() const
-{
- poco_assert (!_path.empty());
-
-#if defined(__APPLE__) && defined(st_birthtime) && !defined(POCO_NO_STAT64) // st_birthtime is available only on 10.5
- struct stat64 st;
- if (stat64(_path.c_str(), &st) == 0)
- return Timestamp::fromEpochTime(st.st_birthtime);
-#elif defined(__FreeBSD__)
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return Timestamp::fromEpochTime(st.st_birthtime);
-#else
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return Timestamp::fromEpochTime(st.st_ctime);
-#endif
- else
- handleLastErrorImpl(_path);
- return 0;
-}
-
-
-Timestamp FileImpl::getLastModifiedImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return Timestamp::fromEpochTime(st.st_mtime);
- else
- handleLastErrorImpl(_path);
- return 0;
-}
-
-
-void FileImpl::setLastModifiedImpl(const Timestamp& ts)
-{
- poco_assert (!_path.empty());
-
- struct utimbuf tb;
- tb.actime = ts.epochTime();
- tb.modtime = ts.epochTime();
- if (utime(_path.c_str(), &tb) != 0)
- handleLastErrorImpl(_path);
-}
-
-
-FileImpl::FileSizeImpl FileImpl::getSizeImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return st.st_size;
- else
- handleLastErrorImpl(_path);
- return 0;
-}
-
-
-void FileImpl::setSizeImpl(FileSizeImpl size)
-{
- poco_assert (!_path.empty());
-
- if (truncate(_path.c_str(), size) != 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::setWriteableImpl(bool flag)
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) != 0)
- handleLastErrorImpl(_path);
- mode_t mode;
- if (flag)
- {
- mode = st.st_mode | S_IWUSR;
- }
- else
- {
- mode_t wmask = S_IWUSR | S_IWGRP | S_IWOTH;
- mode = st.st_mode & ~wmask;
- }
- if (chmod(_path.c_str(), mode) != 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::setExecutableImpl(bool flag)
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) != 0)
- handleLastErrorImpl(_path);
- mode_t mode;
- if (flag)
- {
- mode = st.st_mode | S_IXUSR;
- }
- else
- {
- mode_t wmask = S_IXUSR | S_IXGRP | S_IXOTH;
- mode = st.st_mode & ~wmask;
- }
- if (chmod(_path.c_str(), mode) != 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::copyToImpl(const std::string& path) const
-{
- poco_assert (!_path.empty());
-
- int sd = open(_path.c_str(), O_RDONLY);
- if (sd == -1) handleLastErrorImpl(_path);
-
- struct stat st;
- if (fstat(sd, &st) != 0)
- {
- close(sd);
- handleLastErrorImpl(_path);
- }
- const long blockSize = st.st_blksize;
-
- int dd = open(path.c_str(), O_CREAT | O_TRUNC | O_WRONLY, st.st_mode & S_IRWXU);
- if (dd == -1)
- {
- close(sd);
- handleLastErrorImpl(path);
- }
- Buffer<char> buffer(blockSize);
- try
- {
- int n;
- while ((n = read(sd, buffer.begin(), blockSize)) > 0)
- {
- if (write(dd, buffer.begin(), n) != n)
- handleLastErrorImpl(path);
- }
- if (n < 0)
- handleLastErrorImpl(_path);
- }
- catch (...)
- {
- close(sd);
- close(dd);
- throw;
- }
- close(sd);
- if (fsync(dd) != 0)
- {
- close(dd);
- handleLastErrorImpl(path);
- }
- if (close(dd) != 0)
- handleLastErrorImpl(path);
-}
-
-
-void FileImpl::renameToImpl(const std::string& path)
-{
- poco_assert (!_path.empty());
-
- if (rename(_path.c_str(), path.c_str()) != 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::removeImpl()
-{
- poco_assert (!_path.empty());
-
- int rc;
- if (!isLinkImpl() && isDirectoryImpl())
- rc = rmdir(_path.c_str());
- else
- rc = unlink(_path.c_str());
- if (rc) handleLastErrorImpl(_path);
-}
-
-
-bool FileImpl::createFileImpl()
-{
- poco_assert (!_path.empty());
-
- int n = open(_path.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
- if (n != -1)
- {
- close(n);
- return true;
- }
- if (n == -1 && errno == EEXIST)
- return false;
- else
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::createDirectoryImpl()
-{
- poco_assert (!_path.empty());
-
- if (existsImpl() && isDirectoryImpl())
- return false;
- if (mkdir(_path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0)
- handleLastErrorImpl(_path);
- return true;
-}
-
-
-void FileImpl::handleLastErrorImpl(const std::string& path)
-{
- switch (errno)
- {
- case EIO:
- throw IOException(path);
- case EPERM:
- throw FileAccessDeniedException("insufficient permissions", path);
- case EACCES:
- throw FileAccessDeniedException(path);
- case ENOENT:
- throw FileNotFoundException(path);
- case ENOTDIR:
- throw OpenFileException("not a directory", path);
- case EISDIR:
- throw OpenFileException("not a file", path);
- case EROFS:
- throw FileReadOnlyException(path);
- case EEXIST:
- throw FileExistsException(path);
- case ENOSPC:
- throw FileException("no space left on device", path);
- case EDQUOT:
- throw FileException("disk quota exceeded", path);
-#if !defined(_AIX)
- case ENOTEMPTY:
- throw FileException("directory not empty", path);
-#endif
- case ENAMETOOLONG:
- throw PathSyntaxException(path);
- case ENFILE:
- case EMFILE:
- throw FileException("too many open files", path);
- default:
- throw FileException(std::strerror(errno), path);
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/File_VMS.cpp b/Utilities/Poco/Foundation/src/File_VMS.cpp
deleted file mode 100755
index 4485b4414e..0000000000
--- a/Utilities/Poco/Foundation/src/File_VMS.cpp
+++ /dev/null
@@ -1,407 +0,0 @@
-//
-// File_VMS.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: File
-//
-// Copyright (c) 2004-2006, 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/File_VMS.h"
-#include "Poco/Exception.h"
-#include "Poco/Path.h"
-#include "Poco/String.h"
-#include <stdio.h>
-#include <unistd.h>
-#include <unixio.h>
-#include <file.h>
-#include <stat.h>
-#include <errno.h>
-#include <utime.h>
-#include <lib$routines.h>
-#include <rmsdef.h>
-#include <starlet.h>
-#include <lnmdef.h>
-#include <ssdef.h>
-#include <descrip.h>
-
-
-namespace Poco {
-
-
-FileImpl::FileImpl()
-{
-}
-
-
-FileImpl::FileImpl(const std::string& path): _path(path)
-{
- if (!_path.empty())
- {
- Path p(_path);
- p.makeFile();
- _path = p.toString();
- }
-}
-
-
-FileImpl::~FileImpl()
-{
-}
-
-
-void FileImpl::swapImpl(FileImpl& file)
-{
- std::swap(_path, file._path);
-}
-
-
-void FileImpl::setPathImpl(const std::string& path)
-{
- _path = path;
-}
-
-
-bool FileImpl::existsImpl() const
-{
- poco_assert (!_path.empty());
-
- return access(_path.c_str(), F_OK) == 0;
-}
-
-
-bool FileImpl::canReadImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- {
- if (st.st_uid == geteuid())
- return (st.st_mode & S_IRUSR) != 0;
- else if (st.st_gid == getegid())
- return (st.st_mode & S_IRGRP) != 0;
- else
- return (st.st_mode & S_IROTH) != 0;
- }
- else handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::canWriteImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- {
- if (st.st_uid == geteuid())
- return (st.st_mode & S_IWUSR) != 0;
- else if (st.st_gid == getegid())
- return (st.st_mode & S_IWGRP) != 0;
- else
- return (st.st_mode & S_IWOTH) != 0;
- }
- else handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::canExecuteImpl() const
-{
- Path p(_path);
- return icompare(p.getExtension(), "exe") == 0;
-}
-
-
-bool FileImpl::isFileImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return S_ISREG(st.st_mode);
- else
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::isDirectoryImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return S_ISDIR(st.st_mode);
- else
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::isLinkImpl() const
-{
- return false;
-}
-
-
-bool FileImpl::isLinkImpl() const
-{
- return false;
-}
-
-
-bool FileImpl::isHiddenImpl() const
-{
- return false;
-}
-
-
-Timestamp FileImpl::createdImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return Timestamp(st.st_ctime);
- else
- handleLastErrorImpl(_path);
- return 0;
-}
-
-
-Timestamp FileImpl::getLastModifiedImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return Timestamp(st.st_mtime);
- else
- handleLastErrorImpl(_path);
- return 0;
-}
-
-
-void FileImpl::setLastModifiedImpl(const Timestamp& ts)
-{
- poco_assert (!_path.empty());
-
- struct utimbuf tb;
- tb.actime = ts.epochTime();
- tb.modtime = ts.epochTime();
- if (utime(_path.c_str(), &tb) != 0)
- handleLastErrorImpl(_path);
-}
-
-
-FileImpl::FileSizeImpl FileImpl::getSizeImpl() const
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) == 0)
- return st.st_size;
- else
- handleLastErrorImpl(_path);
- return 0;
-}
-
-
-void FileImpl::setSizeImpl(FileSizeImpl size)
-{
- poco_assert (!_path.empty());
-
- if (truncate(_path.c_str(), size) != 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::setWriteableImpl(bool flag)
-{
- poco_assert (!_path.empty());
-
- struct stat st;
- if (stat(_path.c_str(), &st) != 0)
- handleLastErrorImpl(_path);
- mode_t mode;
- if (flag)
- {
- mode = st.st_mode | S_IWUSR;
- }
- else
- {
- mode_t wmask = S_IWUSR | S_IWGRP | S_IWOTH;
- mode = st.st_mode & ~wmask;
- }
- if (chmod(_path.c_str(), mode) != 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::setExecutableImpl(bool flag)
-{
- // not supported
-}
-
-
-void FileImpl::copyToImpl(const std::string& path) const
-{
- poco_assert (!_path.empty());
-
- // copying a file correctly under OpenVMS is non-trivial,
- // so we just invoke the COPY program.
- std::string cmd = "COPY ";
- cmd.append(_path);
- cmd.append(" ");
- cmd.append(path);
- if (system(cmd.c_str()) != 0)
- throw FileException("COPY command failed", _path);
-}
-
-
-void FileImpl::renameToImpl(const std::string& path)
-{
- poco_assert (!_path.empty());
-
- POCO_DESCRIPTOR_STRING(oldNameDsc, _path);
- POCO_DESCRIPTOR_STRING(newNameDsc, path);
-
- int res;
- if ((res = lib$rename_file(&oldNameDsc, &newNameDsc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) != 1)
- {
- switch (res & 0x0FFFFFFF)
- {
- case RMS$_FNF:
- throw FileNotFoundException(_path);
- case RMS$_DEV:
- case RMS$_DNF:
- throw PathNotFoundException(_path);
- case RMS$_SYN:
- throw PathSyntaxException(path);
- case RMS$_RMV:
- throw FileAccessDeniedException(_path);
- case RMS$_PRV:
- throw FileAccessDeniedException("insufficient privileges", _path);
- default:
- throw FileException(path);
- }
- }
-}
-
-
-void FileImpl::removeImpl()
-{
- poco_assert (!_path.empty());
-
- int rc;
- if (isDirectoryImpl())
- {
- setWriteableImpl(true);
- rc = rmdir(_path.c_str());
- }
- else
- {
- rc = unlink(_path.c_str());
- }
- if (rc) handleLastErrorImpl(_path);
-}
-
-
-
-bool FileImpl::createFileImpl()
-{
- poco_assert (!_path.empty());
-
- int n = open(_path.c_str(), O_WRONLY | O_CREAT | O_EXCL);
- if (n != -1)
- {
- close(n);
- return true;
- }
- if (n == -1 && errno == EEXIST)
- return false;
- else
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::createDirectoryImpl()
-{
- poco_assert (!_path.empty());
-
- if (existsImpl() && isDirectoryImpl())
- return false;
- Path p(_path);
- p.makeDirectory();
- if (mkdir(p.toString().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0)
- handleLastErrorImpl(_path);
- return true;
-}
-
-
-void FileImpl::handleLastErrorImpl(const std::string& path)
-{
- switch (errno)
- {
- case EIO:
- throw IOException(path);
- case EPERM:
- throw FileAccessDeniedException("insufficient permissions", path);
- case EACCES:
- throw FileAccessDeniedException(path);
- case ENOENT:
- throw FileNotFoundException(path);
- case ENOTDIR:
- throw OpenFileException("not a directory", path);
- case EISDIR:
- throw OpenFileException("not a file", path);
- case EROFS:
- throw FileReadOnlyException(path);
- case EEXIST:
- throw FileExistsException(path);
- case ENOSPC:
- throw FileException("no space left on device", path);
- case EDQUOT:
- throw FileException("disk quota exceeded", path);
- case ENOTEMPTY:
- throw FileException("directory not empty", path);
- case ENAMETOOLONG:
- throw PathSyntaxException(path);
- default:
- throw FileException(strerror(errno), path);
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/File_WIN32.cpp b/Utilities/Poco/Foundation/src/File_WIN32.cpp
deleted file mode 100755
index 4b21c3ad8d..0000000000
--- a/Utilities/Poco/Foundation/src/File_WIN32.cpp
+++ /dev/null
@@ -1,419 +0,0 @@
-//
-// File_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: File
-//
-// Copyright (c) 2004-2006, 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/File_WIN32.h"
-#include "Poco/Exception.h"
-#include "Poco/String.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class FileHandle
-{
-public:
- FileHandle(const std::string& path, DWORD access, DWORD share, DWORD disp)
- {
- _h = CreateFileA(path.c_str(), access, share, 0, disp, 0, 0);
- if (!_h) FileImpl::handleLastErrorImpl(path);
- }
-
- ~FileHandle()
- {
- if (_h) CloseHandle(_h);
- }
-
- HANDLE get() const
- {
- return _h;
- }
-
-private:
- HANDLE _h;
-};
-
-
-FileImpl::FileImpl()
-{
-}
-
-
-FileImpl::FileImpl(const std::string& path): _path(path)
-{
- std::string::size_type n = _path.size();
- if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':')))
- {
- _path.resize(n - 1);
- }
-}
-
-
-FileImpl::~FileImpl()
-{
-}
-
-
-void FileImpl::swapImpl(FileImpl& file)
-{
- std::swap(_path, file._path);
-}
-
-
-void FileImpl::setPathImpl(const std::string& path)
-{
- _path = path;
- std::string::size_type n = _path.size();
- if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':')))
- {
- _path.resize(n - 1);
- }
-}
-
-
-bool FileImpl::existsImpl() const
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributes(_path.c_str());
- if (attr == 0xFFFFFFFF)
- {
- switch (GetLastError())
- {
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- case ERROR_NOT_READY:
- case ERROR_INVALID_DRIVE:
- return false;
- default:
- handleLastErrorImpl(_path);
- }
- }
- return true;
-}
-
-
-bool FileImpl::canReadImpl() const
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributes(_path.c_str());
- if (attr == 0xFFFFFFFF)
- {
- switch (GetLastError())
- {
- case ERROR_ACCESS_DENIED:
- return false;
- default:
- handleLastErrorImpl(_path);
- }
- }
- return true;
-}
-
-
-bool FileImpl::canWriteImpl() const
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributes(_path.c_str());
- if (attr == 0xFFFFFFFF)
- handleLastErrorImpl(_path);
- return (attr & FILE_ATTRIBUTE_READONLY) == 0;
-}
-
-
-bool FileImpl::canExecuteImpl() const
-{
- Path p(_path);
- return icompare(p.getExtension(), "exe") == 0;
-}
-
-
-bool FileImpl::isFileImpl() const
-{
- return !isDirectoryImpl() && !isDeviceImpl();
-}
-
-
-bool FileImpl::isDirectoryImpl() const
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributes(_path.c_str());
- if (attr == 0xFFFFFFFF)
- handleLastErrorImpl(_path);
- return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0;
-}
-
-
-bool FileImpl::isLinkImpl() const
-{
- return false;
-}
-
-
-bool FileImpl::isDeviceImpl() const
-{
- poco_assert (!_path.empty());
-
- FileHandle fh(_path, GENERIC_READ, 0, OPEN_EXISTING);
- DWORD type = GetFileType(fh.get());
- if (type == FILE_TYPE_CHAR)
- return true;
- else if (type == FILE_TYPE_UNKNOWN && GetLastError() != NO_ERROR)
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::isHiddenImpl() const
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributes(_path.c_str());
- if (attr == 0xFFFFFFFF)
- handleLastErrorImpl(_path);
- return (attr & FILE_ATTRIBUTE_HIDDEN) != 0;
-}
-
-
-Timestamp FileImpl::createdImpl() const
-{
- poco_assert (!_path.empty());
-
- WIN32_FILE_ATTRIBUTE_DATA fad;
- if (GetFileAttributesEx(_path.c_str(), GetFileExInfoStandard, &fad) == 0)
- handleLastErrorImpl(_path);
- return Timestamp::fromFileTimeNP(fad.ftCreationTime.dwLowDateTime, fad.ftCreationTime.dwHighDateTime);
-}
-
-
-Timestamp FileImpl::getLastModifiedImpl() const
-{
- poco_assert (!_path.empty());
-
- WIN32_FILE_ATTRIBUTE_DATA fad;
- if (GetFileAttributesEx(_path.c_str(), GetFileExInfoStandard, &fad) == 0)
- handleLastErrorImpl(_path);
- return Timestamp::fromFileTimeNP(fad.ftLastWriteTime.dwLowDateTime, fad.ftLastWriteTime.dwHighDateTime);
-}
-
-
-void FileImpl::setLastModifiedImpl(const Timestamp& ts)
-{
- poco_assert (!_path.empty());
-
- UInt32 low;
- UInt32 high;
- ts.toFileTimeNP(low, high);
- FILETIME ft;
- ft.dwLowDateTime = low;
- ft.dwHighDateTime = high;
- FileHandle fh(_path, FILE_ALL_ACCESS, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING);
- if (SetFileTime(fh.get(), 0, &ft, &ft) == 0)
- handleLastErrorImpl(_path);
-}
-
-
-FileImpl::FileSizeImpl FileImpl::getSizeImpl() const
-{
- poco_assert (!_path.empty());
-
- WIN32_FILE_ATTRIBUTE_DATA fad;
- if (GetFileAttributesEx(_path.c_str(), GetFileExInfoStandard, &fad) == 0)
- handleLastErrorImpl(_path);
- LARGE_INTEGER li;
- li.LowPart = fad.nFileSizeLow;
- li.HighPart = fad.nFileSizeHigh;
- return li.QuadPart;
-}
-
-
-void FileImpl::setSizeImpl(FileSizeImpl size)
-{
- poco_assert (!_path.empty());
-
- FileHandle fh(_path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING);
- LARGE_INTEGER li;
- li.QuadPart = size;
- if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == -1)
- handleLastErrorImpl(_path);
- if (SetEndOfFile(fh.get()) == 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::setWriteableImpl(bool flag)
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributes(_path.c_str());
- if (attr == -1)
- handleLastErrorImpl(_path);
- if (flag)
- attr &= ~FILE_ATTRIBUTE_READONLY;
- else
- attr |= FILE_ATTRIBUTE_READONLY;
- if (SetFileAttributes(_path.c_str(), attr) == 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::setExecutableImpl(bool flag)
-{
- // not supported
-}
-
-
-void FileImpl::copyToImpl(const std::string& path) const
-{
- poco_assert (!_path.empty());
-
- if (CopyFileA(_path.c_str(), path.c_str(), FALSE) != 0)
- {
- FileImpl copy(path);
- copy.setWriteableImpl(true);
- }
- else handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::renameToImpl(const std::string& path)
-{
- poco_assert (!_path.empty());
-
- if (MoveFileA(_path.c_str(), path.c_str()) == 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::removeImpl()
-{
- poco_assert (!_path.empty());
-
- if (isDirectoryImpl())
- {
- if (RemoveDirectoryA(_path.c_str()) == 0)
- handleLastErrorImpl(_path);
- }
- else
- {
- if (DeleteFileA(_path.c_str()) == 0)
- handleLastErrorImpl(_path);
- }
-}
-
-
-bool FileImpl::createFileImpl()
-{
- poco_assert (!_path.empty());
-
- HANDLE hFile = CreateFileA(_path.c_str(), GENERIC_WRITE, 0, 0, CREATE_NEW, 0, 0);
- if (hFile != INVALID_HANDLE_VALUE)
- {
- CloseHandle(hFile);
- return true;
- }
- else if (GetLastError() == ERROR_FILE_EXISTS)
- return false;
- else
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::createDirectoryImpl()
-{
- poco_assert (!_path.empty());
-
- if (existsImpl() && isDirectoryImpl())
- return false;
- if (CreateDirectoryA(_path.c_str(), 0) == 0)
- handleLastErrorImpl(_path);
- return true;
-}
-
-
-void FileImpl::handleLastErrorImpl(const std::string& path)
-{
- switch (GetLastError())
- {
- case ERROR_FILE_NOT_FOUND:
- throw FileNotFoundException(path);
- case ERROR_PATH_NOT_FOUND:
- case ERROR_BAD_NETPATH:
- case ERROR_CANT_RESOLVE_FILENAME:
- case ERROR_INVALID_DRIVE:
- throw PathNotFoundException(path);
- case ERROR_ACCESS_DENIED:
- throw FileAccessDeniedException(path);
- case ERROR_ALREADY_EXISTS:
- case ERROR_FILE_EXISTS:
- throw FileExistsException(path);
- case ERROR_INVALID_NAME:
- case ERROR_DIRECTORY:
- case ERROR_FILENAME_EXCED_RANGE:
- case ERROR_BAD_PATHNAME:
- throw PathSyntaxException(path);
- case ERROR_FILE_READ_ONLY:
- throw FileReadOnlyException(path);
- case ERROR_CANNOT_MAKE:
- throw CreateFileException(path);
- case ERROR_DIR_NOT_EMPTY:
- throw FileException("directory not empty", path);
- case ERROR_WRITE_FAULT:
- throw WriteFileException(path);
- case ERROR_READ_FAULT:
- throw ReadFileException(path);
- case ERROR_SHARING_VIOLATION:
- throw FileException("sharing violation", path);
- case ERROR_LOCK_VIOLATION:
- throw FileException("lock violation", path);
- case ERROR_HANDLE_EOF:
- throw ReadFileException("EOF reached", path);
- case ERROR_HANDLE_DISK_FULL:
- case ERROR_DISK_FULL:
- throw WriteFileException("disk is full", path);
- case ERROR_NEGATIVE_SEEK:
- throw FileException("negative seek", path);
- default:
- throw FileException(path);
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/File_WIN32U.cpp b/Utilities/Poco/Foundation/src/File_WIN32U.cpp
deleted file mode 100755
index a6b1dbd55f..0000000000
--- a/Utilities/Poco/Foundation/src/File_WIN32U.cpp
+++ /dev/null
@@ -1,427 +0,0 @@
-//
-// File_WIN32U.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: File
-//
-// Copyright (c) 2006, 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/File_WIN32U.h"
-#include "Poco/Exception.h"
-#include "Poco/String.h"
-#include "Poco/UnicodeConverter.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-class FileHandle
-{
-public:
- FileHandle(const std::string& path, const std::wstring& upath, DWORD access, DWORD share, DWORD disp)
- {
- _h = CreateFileW(upath.c_str(), access, share, 0, disp, 0, 0);
- if (!_h) FileImpl::handleLastErrorImpl(path);
- }
-
- ~FileHandle()
- {
- if (_h) CloseHandle(_h);
- }
-
- HANDLE get() const
- {
- return _h;
- }
-
-private:
- HANDLE _h;
-};
-
-
-FileImpl::FileImpl()
-{
-}
-
-
-FileImpl::FileImpl(const std::string& path): _path(path)
-{
- std::string::size_type n = _path.size();
- if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':')))
- {
- _path.resize(n - 1);
- }
- UnicodeConverter::toUTF16(_path, _upath);
-}
-
-
-FileImpl::~FileImpl()
-{
-}
-
-
-void FileImpl::swapImpl(FileImpl& file)
-{
- std::swap(_path, file._path);
- std::swap(_upath, file._upath);
-}
-
-
-void FileImpl::setPathImpl(const std::string& path)
-{
- _path = path;
- std::string::size_type n = _path.size();
- if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':')))
- {
- _path.resize(n - 1);
- }
- UnicodeConverter::toUTF16(_path, _upath);
-}
-
-
-bool FileImpl::existsImpl() const
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributesW(_upath.c_str());
- if (attr == 0xFFFFFFFF)
- {
- switch (GetLastError())
- {
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- case ERROR_NOT_READY:
- case ERROR_INVALID_DRIVE:
- return false;
- default:
- handleLastErrorImpl(_path);
- }
- }
- return true;
-}
-
-
-bool FileImpl::canReadImpl() const
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributesW(_upath.c_str());
- if (attr == 0xFFFFFFFF)
- {
- switch (GetLastError())
- {
- case ERROR_ACCESS_DENIED:
- return false;
- default:
- handleLastErrorImpl(_path);
- }
- }
- return true;
-}
-
-
-bool FileImpl::canWriteImpl() const
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributesW(_upath.c_str());
- if (attr == 0xFFFFFFFF)
- handleLastErrorImpl(_path);
- return (attr & FILE_ATTRIBUTE_READONLY) == 0;
-}
-
-
-bool FileImpl::canExecuteImpl() const
-{
- Path p(_path);
- return icompare(p.getExtension(), "exe") == 0;
-}
-
-
-bool FileImpl::isFileImpl() const
-{
- return !isDirectoryImpl() && !isDeviceImpl();
-}
-
-
-bool FileImpl::isDirectoryImpl() const
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributesW(_upath.c_str());
- if (attr == 0xFFFFFFFF)
- handleLastErrorImpl(_path);
- return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0;
-}
-
-
-bool FileImpl::isLinkImpl() const
-{
- return false;
-}
-
-
-bool FileImpl::isDeviceImpl() const
-{
- poco_assert (!_path.empty());
-
- FileHandle fh(_path, _upath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING);
- DWORD type = GetFileType(fh.get());
- if (type == FILE_TYPE_CHAR)
- return true;
- else if (type == FILE_TYPE_UNKNOWN && GetLastError() != NO_ERROR)
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::isHiddenImpl() const
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributesW(_upath.c_str());
- if (attr == 0xFFFFFFFF)
- handleLastErrorImpl(_path);
- return (attr & FILE_ATTRIBUTE_HIDDEN) != 0;
-}
-
-
-Timestamp FileImpl::createdImpl() const
-{
- poco_assert (!_path.empty());
-
- WIN32_FILE_ATTRIBUTE_DATA fad;
- if (GetFileAttributesExW(_upath.c_str(), GetFileExInfoStandard, &fad) == 0)
- handleLastErrorImpl(_path);
- return Timestamp::fromFileTimeNP(fad.ftCreationTime.dwLowDateTime, fad.ftCreationTime.dwHighDateTime);
-}
-
-
-Timestamp FileImpl::getLastModifiedImpl() const
-{
- poco_assert (!_path.empty());
-
- WIN32_FILE_ATTRIBUTE_DATA fad;
- if (GetFileAttributesExW(_upath.c_str(), GetFileExInfoStandard, &fad) == 0)
- handleLastErrorImpl(_path);
- return Timestamp::fromFileTimeNP(fad.ftLastWriteTime.dwLowDateTime, fad.ftLastWriteTime.dwHighDateTime);
-}
-
-
-void FileImpl::setLastModifiedImpl(const Timestamp& ts)
-{
- poco_assert (!_path.empty());
-
- UInt32 low;
- UInt32 high;
- ts.toFileTimeNP(low, high);
- FILETIME ft;
- ft.dwLowDateTime = low;
- ft.dwHighDateTime = high;
- FileHandle fh(_path, _upath, FILE_ALL_ACCESS, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING);
- if (SetFileTime(fh.get(), 0, &ft, &ft) == 0)
- handleLastErrorImpl(_path);
-}
-
-
-FileImpl::FileSizeImpl FileImpl::getSizeImpl() const
-{
- poco_assert (!_path.empty());
-
- WIN32_FILE_ATTRIBUTE_DATA fad;
- if (GetFileAttributesExW(_upath.c_str(), GetFileExInfoStandard, &fad) == 0)
- handleLastErrorImpl(_path);
- LARGE_INTEGER li;
- li.LowPart = fad.nFileSizeLow;
- li.HighPart = fad.nFileSizeHigh;
- return li.QuadPart;
-}
-
-
-void FileImpl::setSizeImpl(FileSizeImpl size)
-{
- poco_assert (!_path.empty());
-
- FileHandle fh(_path, _upath, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING);
- LARGE_INTEGER li;
- li.QuadPart = size;
- if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == -1)
- handleLastErrorImpl(_path);
- if (SetEndOfFile(fh.get()) == 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::setWriteableImpl(bool flag)
-{
- poco_assert (!_path.empty());
-
- DWORD attr = GetFileAttributesW(_upath.c_str());
- if (attr == -1)
- handleLastErrorImpl(_path);
- if (flag)
- attr &= ~FILE_ATTRIBUTE_READONLY;
- else
- attr |= FILE_ATTRIBUTE_READONLY;
- if (SetFileAttributesW(_upath.c_str(), attr) == 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::setExecutableImpl(bool flag)
-{
- // not supported
-}
-
-
-void FileImpl::copyToImpl(const std::string& path) const
-{
- poco_assert (!_path.empty());
-
- std::wstring upath;
- UnicodeConverter::toUTF16(path, upath);
- if (CopyFileW(_upath.c_str(), upath.c_str(), FALSE) != 0)
- {
- FileImpl copy(path);
- copy.setWriteableImpl(true);
- }
- else handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::renameToImpl(const std::string& path)
-{
- poco_assert (!_path.empty());
-
- std::wstring upath;
- UnicodeConverter::toUTF16(path, upath);
- if (MoveFileW(_upath.c_str(), upath.c_str()) == 0)
- handleLastErrorImpl(_path);
-}
-
-
-void FileImpl::removeImpl()
-{
- poco_assert (!_path.empty());
-
- if (isDirectoryImpl())
- {
- if (RemoveDirectoryW(_upath.c_str()) == 0)
- handleLastErrorImpl(_path);
- }
- else
- {
- if (DeleteFileW(_upath.c_str()) == 0)
- handleLastErrorImpl(_path);
- }
-}
-
-
-bool FileImpl::createFileImpl()
-{
- poco_assert (!_path.empty());
-
- HANDLE hFile = CreateFileW(_upath.c_str(), GENERIC_WRITE, 0, 0, CREATE_NEW, 0, 0);
- if (hFile != INVALID_HANDLE_VALUE)
- {
- CloseHandle(hFile);
- return true;
- }
- else if (GetLastError() == ERROR_FILE_EXISTS)
- return false;
- else
- handleLastErrorImpl(_path);
- return false;
-}
-
-
-bool FileImpl::createDirectoryImpl()
-{
- poco_assert (!_path.empty());
-
- if (existsImpl() && isDirectoryImpl())
- return false;
- if (CreateDirectoryW(_upath.c_str(), 0) == 0)
- handleLastErrorImpl(_path);
- return true;
-}
-
-
-void FileImpl::handleLastErrorImpl(const std::string& path)
-{
- switch (GetLastError())
- {
- case ERROR_FILE_NOT_FOUND:
- throw FileNotFoundException(path);
- case ERROR_PATH_NOT_FOUND:
- case ERROR_BAD_NETPATH:
- case ERROR_CANT_RESOLVE_FILENAME:
- case ERROR_INVALID_DRIVE:
- throw PathNotFoundException(path);
- case ERROR_ACCESS_DENIED:
- throw FileAccessDeniedException(path);
- case ERROR_ALREADY_EXISTS:
- case ERROR_FILE_EXISTS:
- throw FileExistsException(path);
- case ERROR_INVALID_NAME:
- case ERROR_DIRECTORY:
- case ERROR_FILENAME_EXCED_RANGE:
- case ERROR_BAD_PATHNAME:
- throw PathSyntaxException(path);
- case ERROR_FILE_READ_ONLY:
- throw FileReadOnlyException(path);
- case ERROR_CANNOT_MAKE:
- throw CreateFileException(path);
- case ERROR_DIR_NOT_EMPTY:
- throw FileException("directory not empty", path);
- case ERROR_WRITE_FAULT:
- throw WriteFileException(path);
- case ERROR_READ_FAULT:
- throw ReadFileException(path);
- case ERROR_SHARING_VIOLATION:
- throw FileException("sharing violation", path);
- case ERROR_LOCK_VIOLATION:
- throw FileException("lock violation", path);
- case ERROR_HANDLE_EOF:
- throw ReadFileException("EOF reached", path);
- case ERROR_HANDLE_DISK_FULL:
- case ERROR_DISK_FULL:
- throw WriteFileException("disk is full", path);
- case ERROR_NEGATIVE_SEEK:
- throw FileException("negative seek", path);
- default:
- throw FileException(path);
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Format.cpp b/Utilities/Poco/Foundation/src/Format.cpp
deleted file mode 100755
index 6c8793aa88..0000000000
--- a/Utilities/Poco/Foundation/src/Format.cpp
+++ /dev/null
@@ -1,375 +0,0 @@
-//
-// Format.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Format
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Redistributions in any form must be accompanied by information on
-// how to obtain complete source code for this software and any
-// accompanying software that uses this software. The source code
-// must either be included in the distribution or be available for no
-// more than the cost of distribution plus a nominal fee, and must be
-// freely redistributable under reasonable conditions. For an
-// executable file, complete source code means the source code for all
-// modules it contains. It does not include source code for modules or
-// files that typically accompany the major components of the operating
-// system on which the executable file runs.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#include "Poco/Format.h"
-#include "Poco/Exception.h"
-#include <sstream>
-#include <cctype>
-#include <cstddef>
-
-
-namespace Poco {
-
-
-namespace
-{
- void parseFlags(std::ostream& str, std::string::const_iterator& itFmt, const std::string::const_iterator& endFmt)
- {
- bool isFlag = true;
- while (isFlag && itFmt != endFmt)
- {
- switch (*itFmt)
- {
- case '-': str.setf(std::ios::left); ++itFmt; break;
- case '+': str.setf(std::ios::showpos); ++itFmt; break;
- case '0': str.fill('0'); ++itFmt; break;
- case '#': str.setf(std::ios::showpoint | std::ios_base::showbase); ++itFmt; break;
- default: isFlag = false; break;
- }
- }
- }
-
-
- void parseWidth(std::ostream& str, std::string::const_iterator& itFmt, const std::string::const_iterator& endFmt)
- {
- int width = 0;
- while (itFmt != endFmt && std::isdigit(*itFmt))
- {
- width = 10*width + *itFmt - '0';
- ++itFmt;
- }
- if (width != 0) str.width(width);
- }
-
-
- void parsePrec(std::ostream& str, std::string::const_iterator& itFmt, const std::string::const_iterator& endFmt)
- {
- if (itFmt != endFmt && *itFmt == '.')
- {
- ++itFmt;
- int prec = 0;
- while (itFmt != endFmt && std::isdigit(*itFmt))
- {
- prec = 10*prec + *itFmt - '0';
- ++itFmt;
- }
- if (prec != 0) str.precision(prec);
- }
- }
-
- char parseMod(std::string::const_iterator& itFmt, const std::string::const_iterator& endFmt)
- {
- char mod = 0;
- if (itFmt != endFmt)
- {
- switch (*itFmt)
- {
- case 'l':
- case 'h':
- case 'L':
- case '?': mod = *itFmt++; break;
- }
- }
- return mod;
- }
-
-
- void prepareFormat(std::ostream& str, char type)
- {
- switch (type)
- {
- case 'd':
- case 'i': str << std::dec; break;
- case 'o': str << std::oct; break;
- case 'x': str << std::hex; break;
- case 'X': str << std::hex << std::uppercase; break;
- case 'e': str << std::scientific; break;
- case 'E': str << std::scientific << std::uppercase; break;
- case 'f': str << std::fixed; break;
- }
- }
-
-
- void writeAnyInt(std::ostream& str, const Any& any)
- {
- if (any.type() == typeid(char))
- str << static_cast<int>(AnyCast<char>(any));
- else if (any.type() == typeid(signed char))
- str << static_cast<int>(AnyCast<signed char>(any));
- else if (any.type() == typeid(unsigned char))
- str << static_cast<unsigned>(AnyCast<unsigned char>(any));
- else if (any.type() == typeid(short))
- str << AnyCast<short>(any);
- else if (any.type() == typeid(unsigned short))
- str << AnyCast<unsigned short>(any);
- else if (any.type() == typeid(int))
- str << AnyCast<int>(any);
- else if (any.type() == typeid(unsigned int))
- str << AnyCast<unsigned int>(any);
- else if (any.type() == typeid(long))
- str << AnyCast<long>(any);
- else if (any.type() == typeid(unsigned long))
- str << AnyCast<unsigned long>(any);
- else if (any.type() == typeid(Int64))
- str << AnyCast<Int64>(any);
- else if (any.type() == typeid(UInt64))
- str << AnyCast<UInt64>(any);
- else if (any.type() == typeid(bool))
- str << AnyCast<bool>(any);
- }
-
-
- void formatOne(std::string& result, std::string::const_iterator& itFmt, const std::string::const_iterator& endFmt, std::vector<Any>::const_iterator& itVal)
- {
- std::ostringstream str;
- parseFlags(str, itFmt, endFmt);
- parseWidth(str, itFmt, endFmt);
- parsePrec(str, itFmt, endFmt);
- char mod = parseMod(itFmt, endFmt);
- if (itFmt != endFmt)
- {
- char type = *itFmt++;
- prepareFormat(str, type);
- switch (type)
- {
- case 'b':
- str << AnyCast<bool>(*itVal++);
- break;
- case 'c':
- str << AnyCast<char>(*itVal++);
- break;
- case 'd':
- case 'i':
- switch (mod)
- {
- case 'l': str << AnyCast<long>(*itVal++); break;
- case 'L': str << AnyCast<Int64>(*itVal++); break;
- case 'h': str << AnyCast<short>(*itVal++); break;
- case '?': writeAnyInt(str, *itVal++); break;
- default: str << AnyCast<int>(*itVal++); break;
- }
- break;
- case 'o':
- case 'u':
- case 'x':
- case 'X':
- switch (mod)
- {
- case 'l': str << AnyCast<unsigned long>(*itVal++); break;
- case 'L': str << AnyCast<UInt64>(*itVal++); break;
- case 'h': str << AnyCast<unsigned short>(*itVal++); break;
- case '?': writeAnyInt(str, *itVal++); break;
- default: str << AnyCast<unsigned>(*itVal++); break;
- }
- break;
- case 'e':
- case 'E':
- case 'f':
- switch (mod)
- {
- case 'l': str << AnyCast<long double>(*itVal++); break;
- case 'L': str << AnyCast<long double>(*itVal++); break;
- case 'h': str << AnyCast<float>(*itVal++); break;
- default: str << AnyCast<double>(*itVal++); break;
- }
- break;
- case 's':
- str << RefAnyCast<std::string>(*itVal++);
- break;
- case 'z':
- str << AnyCast<std::size_t>(*itVal++);
- break;
- case 'I':
- case 'D':
- default:
- str << type;
- }
- }
- result.append(str.str());
- }
-}
-
-
-std::string format(const std::string& fmt, const Any& value)
-{
- std::string result;
- format(result, fmt, value);
- return result;
-}
-
-
-std::string format(const std::string& fmt, const Any& value1, const Any& value2)
-{
- std::string result;
- format(result, fmt, value1, value2);
- return result;
-}
-
-
-std::string format(const std::string& fmt, const Any& value1, const Any& value2, const Any& value3)
-{
- std::string result;
- format(result, fmt, value1, value2, value3);
- return result;
-}
-
-
-std::string format(const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4)
-{
- std::string result;
- format(result, fmt, value1, value2, value3, value4);
- return result;
-}
-
-
-std::string format(const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4, const Any& value5)
-{
- std::string result;
- format(result, fmt, value1, value2, value3, value4, value5);
- return result;
-}
-
-
-std::string format(const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4, const Any& value5, const Any& value6)
-{
- std::string result;
- format(result, fmt, value1, value2, value3, value4, value5, value6);
- return result;
-}
-
-
-void format(std::string& result, const std::string& fmt, const Any& value)
-{
- std::vector<Any> args;
- args.push_back(value);
- format(result, fmt, args);
-}
-
-
-void format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2)
-{
- std::vector<Any> args;
- args.push_back(value1);
- args.push_back(value2);
- format(result, fmt, args);
-}
-
-
-void format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2, const Any& value3)
-{
- std::vector<Any> args;
- args.push_back(value1);
- args.push_back(value2);
- args.push_back(value3);
- format(result, fmt, args);
-}
-
-
-void format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4)
-{
- std::vector<Any> args;
- args.push_back(value1);
- args.push_back(value2);
- args.push_back(value3);
- args.push_back(value4);
- format(result, fmt, args);
-}
-
-
-void format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4, const Any& value5)
-{
- std::vector<Any> args;
- args.push_back(value1);
- args.push_back(value2);
- args.push_back(value3);
- args.push_back(value4);
- args.push_back(value5);
- format(result, fmt, args);
-}
-
-
-void format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2, const Any& value3, const Any& value4, const Any& value5, const Any& value6)
-{
- std::vector<Any> args;
- args.push_back(value1);
- args.push_back(value2);
- args.push_back(value3);
- args.push_back(value4);
- args.push_back(value5);
- args.push_back(value6);
- format(result, fmt, args);
-}
-
-
-void format(std::string& result, const std::string& fmt, const std::vector<Any>& values)
-{
- std::string::const_iterator itFmt = fmt.begin();
- std::string::const_iterator endFmt = fmt.end();
- std::vector<Any>::const_iterator itVal = values.begin();
- std::vector<Any>::const_iterator endVal = values.end();
- while (itFmt != endFmt)
- {
- switch (*itFmt)
- {
- case '%':
- ++itFmt;
- if (itFmt != endFmt && itVal != endVal)
- formatOne(result, itFmt, endFmt, itVal);
- else if (itFmt != endFmt)
- result += *itFmt++;
- break;
- default:
- result += *itFmt;
- ++itFmt;
- }
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Formatter.cpp b/Utilities/Poco/Foundation/src/Formatter.cpp
deleted file mode 100755
index 2ea8b484df..0000000000
--- a/Utilities/Poco/Foundation/src/Formatter.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// Formatter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Formatter
-//
-// Copyright (c) 2004-2006, 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/Formatter.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-Formatter::Formatter()
-{
-}
-
-
-Formatter::~Formatter()
-{
-}
-
-
-void Formatter::setProperty(const std::string& name, const std::string& value)
-{
- throw PropertyNotSupportedException();
-}
-
-
-std::string Formatter::getProperty(const std::string& name) const
-{
- throw PropertyNotSupportedException();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/FormattingChannel.cpp b/Utilities/Poco/Foundation/src/FormattingChannel.cpp
deleted file mode 100755
index aceb481125..0000000000
--- a/Utilities/Poco/Foundation/src/FormattingChannel.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// FormattingChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Formatter
-//
-// Copyright (c) 2004-2006, 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/FormattingChannel.h"
-#include "Poco/Formatter.h"
-#include "Poco/Message.h"
-#include "Poco/LoggingRegistry.h"
-
-
-namespace Poco {
-
-
-FormattingChannel::FormattingChannel():
- _pFormatter(0),
- _pChannel(0)
-{
-}
-
-
-FormattingChannel::FormattingChannel(Formatter* pFormatter):
- _pFormatter(pFormatter),
- _pChannel(0)
-{
- if (_pFormatter) _pFormatter->duplicate();
-}
-
-
-FormattingChannel::FormattingChannel(Formatter* pFormatter, Channel* pChannel):
- _pFormatter(pFormatter),
- _pChannel(pChannel)
-{
- if (_pFormatter) _pFormatter->duplicate();
- if (_pChannel) _pChannel->duplicate();
-}
-
-
-FormattingChannel::~FormattingChannel()
-{
- if (_pChannel) _pChannel->release();
- if (_pFormatter) _pFormatter->release();
-}
-
-
-void FormattingChannel::setFormatter(Formatter* pFormatter)
-{
- if (_pFormatter) _pFormatter->release();
- _pFormatter = pFormatter;
- if (_pFormatter) _pFormatter->duplicate();
-}
-
-
-Formatter* FormattingChannel::getFormatter() const
-{
- return _pFormatter;
-}
-
-
-void FormattingChannel::setChannel(Channel* pChannel)
-{
- if (_pChannel) _pChannel->release();
- _pChannel = pChannel;
- if (_pChannel) _pChannel->duplicate();
-}
-
-
-Channel* FormattingChannel::getChannel() const
-{
- return _pChannel;
-}
-
-
-void FormattingChannel::log(const Message& msg)
-{
- if (_pChannel)
- {
- if (_pFormatter)
- {
- std::string text;
- _pFormatter->format(msg, text);
- _pChannel->log(Message(msg, text));
- }
- else
- {
- _pChannel->log(msg);
- }
- }
-};
-
-
-void FormattingChannel::setProperty(const std::string& name, const std::string& value)
-{
- if (name == "channel")
- setChannel(LoggingRegistry::defaultRegistry().channelForName(value));
- else if (name == "formatter")
- setFormatter(LoggingRegistry::defaultRegistry().formatterForName(value));
- else if (_pChannel)
- _pChannel->setProperty(name, value);
-}
-
-
-void FormattingChannel::open()
-{
- if (_pChannel)
- _pChannel->open();
-}
-
-
-void FormattingChannel::close()
-{
- if (_pChannel)
- _pChannel->close();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Glob.cpp b/Utilities/Poco/Foundation/src/Glob.cpp
deleted file mode 100755
index 3697475d29..0000000000
--- a/Utilities/Poco/Foundation/src/Glob.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-//
-// Glob.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Glob
-//
-// Copyright (c) 2004-2006, 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/Glob.h"
-#include "Poco/Path.h"
-#include "Poco/Exception.h"
-#include "Poco/DirectoryIterator.h"
-#include "Poco/File.h"
-#include "Poco/UTF8Encoding.h"
-#include "Poco/Unicode.h"
-
-
-namespace Poco {
-
-
-Glob::Glob(const std::string& pattern, int options):
- _pattern(pattern),
- _options(options)
-{
- poco_assert (!_pattern.empty());
-}
-
-
-Glob::~Glob()
-{
-}
-
-
-bool Glob::match(const std::string& subject)
-{
- UTF8Encoding utf8;
- TextIterator itp(_pattern, utf8);
- TextIterator endp(_pattern);
- TextIterator its(subject, utf8);
- TextIterator ends(subject);
-
- if ((_options & GLOB_DOT_SPECIAL) && its != ends && *its == '.' && (*itp == '?' || *itp == '*'))
- return false;
- else
- return match(itp, endp, its, ends);
-}
-
-
-void Glob::glob(const std::string& pathPattern, std::set<std::string>& files, int options)
-{
- glob(Path(Path::expand(pathPattern), Path::PATH_GUESS), files, options);
-}
-
-
-void Glob::glob(const char* pathPattern, std::set<std::string>& files, int options)
-{
- glob(Path(Path::expand(pathPattern), Path::PATH_GUESS), files, options);
-}
-
-
-void Glob::glob(const Path& pathPattern, std::set<std::string>& files, int options)
-{
- Path pattern(pathPattern);
- pattern.makeDirectory(); // to simplify pattern handling later on
- Path base(pattern);
- Path absBase(base);
- absBase.makeAbsolute();
- while (base.depth() > 0 && base[base.depth() - 1] != "..")
- {
- base.popDirectory();
- absBase.popDirectory();
- }
- if (pathPattern.isDirectory()) options |= GLOB_DIRS_ONLY;
- collect(pattern, absBase, base, pathPattern[base.depth()], files, options);
-}
-
-
-bool Glob::match(TextIterator& itp, const TextIterator& endp, TextIterator& its, const TextIterator& ends)
-{
- while (itp != endp)
- {
- if (its == ends)
- {
- while (itp != endp && *itp == '*') ++itp;
- break;
- }
- switch (*itp)
- {
- case '?':
- ++itp; ++its;
- break;
- case '*':
- if (++itp != endp)
- {
- while (its != ends && !matchAfterAsterisk(itp, endp, its, ends)) ++its;
- return its != ends;
- }
- return true;
- case '[':
- if (++itp != endp)
- {
- bool invert = *itp == '!';
- if (invert) ++itp;
- if (itp != endp)
- {
- bool mtch = matchSet(itp, endp, *its++);
- if ((invert && mtch) || (!invert && !mtch)) return false;
- break;
- }
- }
- throw SyntaxException("bad range syntax in glob pattern");
- case '\\':
- if (++itp == endp) throw SyntaxException("backslash must be followed by character in glob pattern");
- // fallthrough
- default:
- if (_options & GLOB_CASELESS)
- {
- if (Unicode::toLower(*itp) != Unicode::toLower(*its)) return false;
- }
- else
- {
- if (*itp != *its) return false;
- }
- ++itp; ++its;
- }
- }
- return itp == endp && its == ends;
-}
-
-
-bool Glob::matchAfterAsterisk(TextIterator itp, const TextIterator& endp, TextIterator its, const TextIterator& ends)
-{
- return match(itp, endp, its, ends);
-}
-
-
-bool Glob::matchSet(TextIterator& itp, const TextIterator& endp, int c)
-{
- if (_options & GLOB_CASELESS)
- c = Unicode::toLower(c);
-
- while (itp != endp)
- {
- switch (*itp)
- {
- case ']':
- ++itp;
- return false;
- case '\\':
- if (++itp == endp) throw SyntaxException("backslash must be followed by character in glob pattern");
- }
- int first = *itp;
- int last = first;
- if (++itp != endp && *itp == '-')
- {
- if (++itp != endp)
- last = *itp++;
- else
- throw SyntaxException("bad range syntax in glob pattern");
- }
- if (_options & GLOB_CASELESS)
- {
- first = Unicode::toLower(first);
- last = Unicode::toLower(last);
- }
- if (first <= c && c <= last)
- {
- while (itp != endp)
- {
- switch (*itp)
- {
- case ']':
- ++itp;
- return true;
- case '\\':
- if (++itp == endp) break;
- default:
- ++itp;
- }
- }
- throw SyntaxException("range must be terminated by closing bracket in glob pattern");
- }
- }
- return false;
-}
-
-
-void Glob::collect(const Path& pathPattern, const Path& base, const Path& current, const std::string& pattern, std::set<std::string>& files, int options)
-{
- try
- {
- std::string pp = pathPattern.toString();
- std::string basep = base.toString();
- std::string curp = current.toString();
- Glob g(pattern, options);
- DirectoryIterator it(base);
- DirectoryIterator end;
- while (it != end)
- {
- const std::string& name = it.name();
- if (g.match(name))
- {
- Path p(current);
- if (p.depth() < pathPattern.depth() - 1)
- {
- p.pushDirectory(name);
- collect(pathPattern, it.path(), p, pathPattern[p.depth()], files, options);
- }
- else
- {
- p.setFileName(name);
- if (isDirectory(p, (options & GLOB_FOLLOW_SYMLINKS) != 0))
- {
- p.makeDirectory();
- files.insert(p.toString());
- }
- else if (!(options & GLOB_DIRS_ONLY))
- {
- files.insert(p.toString());
- }
- }
- }
- ++it;
- }
- }
- catch (Exception&)
- {
- }
-}
-
-
-bool Glob::isDirectory(const Path& path, bool followSymlink)
-{
- File f(path);
- if (f.isDirectory())
- {
- return true;
- }
- else if (followSymlink && f.isLink())
- {
- try
- {
- // Test if link resolves to a directory.
- DirectoryIterator it(f);
- return true;
- }
- catch (Exception&)
- {
- }
- }
- return false;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Hash.cpp b/Utilities/Poco/Foundation/src/Hash.cpp
deleted file mode 100755
index 1e6970843f..0000000000
--- a/Utilities/Poco/Foundation/src/Hash.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// Hash.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Hashing
-// Module: Hash
-//
-// Copyright (c) 2006, 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/Hash.h"
-
-
-namespace Poco {
-
-
-std::size_t hash(const std::string& str)
-{
- std::size_t h = 0;
- std::string::const_iterator it = str.begin();
- std::string::const_iterator end = str.end();
- while (it != end)
- {
- h = h * 0xf4243 ^ *it++;
- }
- return h;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/HashStatistic.cpp b/Utilities/Poco/Foundation/src/HashStatistic.cpp
deleted file mode 100755
index 9eb3693d49..0000000000
--- a/Utilities/Poco/Foundation/src/HashStatistic.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// HashStatistic.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Hashing
-// Module: HashStatistic
-//
-// Copyright (c) 2006, 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/HashStatistic.h"
-#include <sstream>
-
-namespace Poco {
-
-
-HashStatistic::HashStatistic(
- UInt32 tableSize,
- UInt32 numEntries,
- UInt32 numZeroEntries,
- UInt32 maxEntry,
- std::vector<UInt32> details):
- _sizeOfTable(tableSize),
- _numberOfEntries(numEntries),
- _numZeroEntries(numZeroEntries),
- _maxEntriesPerHash(maxEntry),
- _detailedEntriesPerHash(details)
-{
-}
-
-
-HashStatistic::~HashStatistic()
-{
-}
-
-
-std::string HashStatistic::toString() const
-{
- std::ostringstream str;
- str << "HashTable of size " << _sizeOfTable << " containing " << _numberOfEntries << " entries:\n";
- str << " NumberOfZeroEntries: " << _numZeroEntries << "\n";
- str << " MaxEntry: " << _maxEntriesPerHash << "\n";
- str << " AvgEntry: " << avgEntriesPerHash() << ", excl Zero slots: " << avgEntriesPerHashExclZeroEntries() << "\n";
- str << " DetailedStatistics: \n";
- for (int i = 0; i < _detailedEntriesPerHash.size(); ++i)
- {
- // 10 entries per line
- if (i % 10 == 0)
- {
- str << "\n " << i << ":";
- }
- str << " " << _detailedEntriesPerHash[i];
- }
- str << "\n";
- str.flush();
- return str.str();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/HexBinaryDecoder.cpp b/Utilities/Poco/Foundation/src/HexBinaryDecoder.cpp
deleted file mode 100755
index 406c61c759..0000000000
--- a/Utilities/Poco/Foundation/src/HexBinaryDecoder.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// HexBinaryDecoder.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: HexBinary
-//
-// Copyright (c) 2004-2006, 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/HexBinaryDecoder.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-HexBinaryDecoderBuf::HexBinaryDecoderBuf(std::istream& istr): _istr(istr)
-{
-}
-
-
-HexBinaryDecoderBuf::~HexBinaryDecoderBuf()
-{
-}
-
-
-int HexBinaryDecoderBuf::readFromDevice()
-{
- int c;
- int n;
- if ((n = readOne()) == -1) return -1;
- if (n >= '0' && n <= '9')
- c = n - '0';
- else if (n >= 'A' && n <= 'F')
- c = n - 'A' + 10;
- else if (n >= 'a' && n <= 'f')
- c = n - 'a' + 10;
- else throw DataFormatException();
- c <<= 4;
- if ((n = readOne()) == -1) return -1;
- if (n >= '0' && n <= '9')
- c |= n - '0';
- else if (n >= 'A' && n <= 'F')
- c |= n - 'A' + 10;
- else if (n >= 'a' && n <= 'f')
- c |= n - 'a' + 10;
- else throw DataFormatException();
- return c;
-}
-
-
-int HexBinaryDecoderBuf::readOne()
-{
- int ch = _istr.get();
- while (ch == ' ' || ch == '\r' || ch == '\t' || ch == '\n')
- ch = _istr.get();
- return ch;
-}
-
-
-HexBinaryDecoderIOS::HexBinaryDecoderIOS(std::istream& istr): _buf(istr)
-{
- poco_ios_init(&_buf);
-}
-
-
-HexBinaryDecoderIOS::~HexBinaryDecoderIOS()
-{
-}
-
-
-HexBinaryDecoderBuf* HexBinaryDecoderIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-HexBinaryDecoder::HexBinaryDecoder(std::istream& istr): HexBinaryDecoderIOS(istr), std::istream(&_buf)
-{
-}
-
-
-HexBinaryDecoder::~HexBinaryDecoder()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/HexBinaryEncoder.cpp b/Utilities/Poco/Foundation/src/HexBinaryEncoder.cpp
deleted file mode 100755
index ab8474555e..0000000000
--- a/Utilities/Poco/Foundation/src/HexBinaryEncoder.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// HexBinaryEncoder.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: HexBinary
-//
-// Copyright (c) 2004-2006, 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/HexBinaryEncoder.h"
-
-
-namespace Poco {
-
-
-HexBinaryEncoderBuf::HexBinaryEncoderBuf(std::ostream& ostr):
- _pos(0),
- _lineLength(72),
- _uppercase(0),
- _ostr(ostr)
-{
-}
-
-
-HexBinaryEncoderBuf::~HexBinaryEncoderBuf()
-{
- try
- {
- close();
- }
- catch (...)
- {
- }
-}
-
-
-void HexBinaryEncoderBuf::setLineLength(int lineLength)
-{
- _lineLength = lineLength;
-}
-
-
-int HexBinaryEncoderBuf::getLineLength() const
-{
- return _lineLength;
-}
-
-
-void HexBinaryEncoderBuf::setUppercase(bool flag)
-{
- _uppercase = flag ? 16 : 0;
-}
-
-
-int HexBinaryEncoderBuf::writeToDevice(char c)
-{
- static const char digits[] = "0123456789abcdef0123456789ABCDEF";
- _ostr.put(digits[_uppercase + ((c >> 4) & 0xF)]);
- ++_pos;
- _ostr.put(digits[_uppercase + (c & 0xF)]);
- if (++_pos >= _lineLength && _lineLength > 0)
- {
- _ostr << std::endl;
- _pos = 0;
- }
- return _ostr ? charToInt(c) : -1;
-}
-
-
-int HexBinaryEncoderBuf::close()
-{
- sync();
- _ostr.flush();
- return _ostr ? 0 : -1;
-}
-
-
-HexBinaryEncoderIOS::HexBinaryEncoderIOS(std::ostream& ostr): _buf(ostr)
-{
- poco_ios_init(&_buf);
-}
-
-
-HexBinaryEncoderIOS::~HexBinaryEncoderIOS()
-{
-}
-
-
-int HexBinaryEncoderIOS::close()
-{
- return _buf.close();
-}
-
-
-HexBinaryEncoderBuf* HexBinaryEncoderIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-HexBinaryEncoder::HexBinaryEncoder(std::ostream& ostr): HexBinaryEncoderIOS(ostr), std::ostream(&_buf)
-{
-}
-
-
-HexBinaryEncoder::~HexBinaryEncoder()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/InflatingStream.cpp b/Utilities/Poco/Foundation/src/InflatingStream.cpp
deleted file mode 100755
index 8fb950db99..0000000000
--- a/Utilities/Poco/Foundation/src/InflatingStream.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-//
-// InflatingStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: ZLibStream
-//
-// Copyright (c) 2004-2006, 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/InflatingStream.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-InflatingStreamBuf::InflatingStreamBuf(std::istream& istr, StreamType type):
- BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::in),
- _pIstr(&istr),
- _pOstr(0),
- _eof(false),
- _check(type != STREAM_ZIP)
-{
- _zstr.zalloc = Z_NULL;
- _zstr.zfree = Z_NULL;
- _zstr.opaque = Z_NULL;
- _zstr.next_in = 0;
- _zstr.avail_in = 0;
- _zstr.next_out = 0;
- _zstr.avail_out = 0;
-
- int rc = inflateInit2(&_zstr, 15 + (type == STREAM_GZIP ? 16 : 0));
- if (rc != Z_OK) throw IOException(zError(rc));
-
- _buffer = new char[INFLATE_BUFFER_SIZE];
-}
-
-
-InflatingStreamBuf::InflatingStreamBuf(std::ostream& ostr, StreamType type):
- BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::out),
- _pIstr(0),
- _pOstr(&ostr),
- _eof(false),
- _check(type != STREAM_ZIP)
-{
- _zstr.zalloc = Z_NULL;
- _zstr.zfree = Z_NULL;
- _zstr.opaque = Z_NULL;
- _zstr.next_in = 0;
- _zstr.avail_in = 0;
- _zstr.next_out = 0;
- _zstr.avail_out = 0;
-
- int rc = inflateInit2(&_zstr, 15 + (type == STREAM_GZIP ? 16 : 0));
- if (rc != Z_OK) throw IOException(zError(rc));
-
- _buffer = new char[INFLATE_BUFFER_SIZE];
-}
-
-
-InflatingStreamBuf::~InflatingStreamBuf()
-{
- try
- {
- close();
- }
- catch (...)
- {
- }
- delete [] _buffer;
-}
-
-
-int InflatingStreamBuf::close()
-{
- sync();
- if (_pIstr || _pOstr)
- {
- int rc = inflateEnd(&_zstr);
- if (rc != Z_OK) throw IOException(zError(rc));
- _pIstr = 0;
- _pOstr = 0;
- }
- return 0;
-}
-
-
-int InflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length)
-{
- if (_eof || !_pIstr) return 0;
-
- if (_zstr.avail_in == 0)
- {
- int n = 0;
- if (_pIstr->good())
- {
- _pIstr->read(_buffer, INFLATE_BUFFER_SIZE);
- n = static_cast<int>(_pIstr->gcount());
- }
- if (n == 0) return 0;
- _zstr.next_in = (unsigned char*) _buffer;
- _zstr.avail_in = n;
- }
- _zstr.next_out = (unsigned char*) buffer;
- _zstr.avail_out = static_cast<unsigned>(length);
- for (;;)
- {
- int rc = inflate(&_zstr, Z_NO_FLUSH);
- if (rc == Z_DATA_ERROR && !_check)
- {
- if (_zstr.avail_in == 0)
- {
- if (_pIstr->good())
- rc = Z_OK;
- else
- rc = Z_STREAM_END;
- }
- }
- if (rc == Z_STREAM_END)
- {
- _eof = true;
- return static_cast<int>(length) - _zstr.avail_out;
- }
- if (rc != Z_OK) throw IOException(zError(rc));
- if (_zstr.avail_out == 0)
- return static_cast<int>(length);
- if (_zstr.avail_in == 0)
- {
- int n = 0;
- if (_pIstr->good())
- {
- _pIstr->read(_buffer, INFLATE_BUFFER_SIZE);
- n = static_cast<int>(_pIstr->gcount());
- }
- if (n > 0)
- {
- _zstr.next_in = (unsigned char*) _buffer;
- _zstr.avail_in = n;
- }
- }
- }
-}
-
-
-int InflatingStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
-{
- if (length == 0 || !_pOstr) return 0;
-
- _zstr.next_in = (unsigned char*) buffer;
- _zstr.avail_in = static_cast<unsigned>(length);
- _zstr.next_out = (unsigned char*) _buffer;
- _zstr.avail_out = INFLATE_BUFFER_SIZE;
- for (;;)
- {
- int rc = inflate(&_zstr, Z_NO_FLUSH);
- if (rc == Z_STREAM_END)
- {
- _pOstr->write(_buffer, INFLATE_BUFFER_SIZE - _zstr.avail_out);
- if (!_pOstr->good()) throw IOException(zError(rc));
- break;
- }
- if (rc != Z_OK) throw IOException(zError(rc));
- if (_zstr.avail_out == 0)
- {
- _pOstr->write(_buffer, INFLATE_BUFFER_SIZE);
- if (!_pOstr->good()) throw IOException(zError(rc));
- _zstr.next_out = (unsigned char*) _buffer;
- _zstr.avail_out = INFLATE_BUFFER_SIZE;
- }
- if (_zstr.avail_in == 0)
- {
- _pOstr->write(_buffer, INFLATE_BUFFER_SIZE - _zstr.avail_out);
- if (!_pOstr->good()) throw IOException(zError(rc));
- _zstr.next_out = (unsigned char*) _buffer;
- _zstr.avail_out = INFLATE_BUFFER_SIZE;
- break;
- }
- }
- return static_cast<int>(length);
-}
-
-
-InflatingIOS::InflatingIOS(std::ostream& ostr, InflatingStreamBuf::StreamType type):
- _buf(ostr, type)
-{
- poco_ios_init(&_buf);
-}
-
-
-InflatingIOS::InflatingIOS(std::istream& istr, InflatingStreamBuf::StreamType type):
- _buf(istr, type)
-{
- poco_ios_init(&_buf);
-}
-
-
-InflatingIOS::~InflatingIOS()
-{
-}
-
-
-InflatingStreamBuf* InflatingIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-InflatingOutputStream::InflatingOutputStream(std::ostream& ostr, InflatingStreamBuf::StreamType type):
- InflatingIOS(ostr, type),
- std::ostream(&_buf)
-{
-}
-
-
-InflatingOutputStream::~InflatingOutputStream()
-{
-}
-
-
-int InflatingOutputStream::close()
-{
- return _buf.close();
-}
-
-
-InflatingInputStream::InflatingInputStream(std::istream& istr, InflatingStreamBuf::StreamType type):
- InflatingIOS(istr, type),
- std::istream(&_buf)
-{
-}
-
-
-InflatingInputStream::~InflatingInputStream()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Latin1Encoding.cpp b/Utilities/Poco/Foundation/src/Latin1Encoding.cpp
deleted file mode 100755
index 8fe2cb24c9..0000000000
--- a/Utilities/Poco/Foundation/src/Latin1Encoding.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// Latin1Encoding.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: Latin1Encoding
-//
-// Copyright (c) 2004-2007, 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/Latin1Encoding.h"
-#include "Poco/String.h"
-
-
-namespace Poco {
-
-
-const char* Latin1Encoding::_names[] =
-{
- "ISO-8859-1",
- "Latin1",
- "Latin-1",
- NULL
-};
-
-
-const TextEncoding::CharacterMap Latin1Encoding::_charMap =
-{
- /* 00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- /* 10 */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- /* 20 */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- /* 30 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- /* 40 */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- /* 50 */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- /* 60 */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- /* 70 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- /* 80 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- /* 90 */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- /* a0 */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- /* b0 */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- /* c0 */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- /* d0 */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- /* e0 */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- /* f0 */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-};
-
-
-Latin1Encoding::Latin1Encoding()
-{
-}
-
-
-Latin1Encoding::~Latin1Encoding()
-{
-}
-
-
-const char* Latin1Encoding::canonicalName() const
-{
- return _names[0];
-}
-
-
-bool Latin1Encoding::isA(const std::string& encodingName) const
-{
- for (const char** name = _names; *name; ++name)
- {
- if (Poco::icompare(encodingName, *name) == 0)
- return true;
- }
- return false;
-}
-
-
-const TextEncoding::CharacterMap& Latin1Encoding::characterMap() const
-{
- return _charMap;
-}
-
-
-int Latin1Encoding::convert(const unsigned char* bytes) const
-{
- return *bytes;
-}
-
-
-int Latin1Encoding::convert(int ch, unsigned char* bytes, int length) const
-{
- if (ch >= 0 && ch <= 255)
- {
- if (bytes && length >= 1)
- *bytes = (unsigned char) ch;
- return 1;
- }
- else return 0;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Latin9Encoding.cpp b/Utilities/Poco/Foundation/src/Latin9Encoding.cpp
deleted file mode 100755
index ba195582e5..0000000000
--- a/Utilities/Poco/Foundation/src/Latin9Encoding.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// Latin9Encoding.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: Latin9Encoding
-//
-// Copyright (c) 2004-2007, 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/Latin9Encoding.h"
-#include "Poco/String.h"
-
-
-namespace Poco {
-
-
-const char* Latin9Encoding::_names[] =
-{
- "ISO-8859-15",
- "Latin9",
- "Latin-9",
- NULL
-};
-
-
-const TextEncoding::CharacterMap Latin9Encoding::_charMap =
-{
- /* 00 */ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
- /* 10 */ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
- /* 20 */ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
- /* 30 */ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
- /* 40 */ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
- /* 50 */ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
- /* 60 */ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
- /* 70 */ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
- /* 80 */ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
- /* 90 */ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
- /* a0 */ 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7, 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
- /* b0 */ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7, 0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf,
- /* c0 */ 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
- /* d0 */ 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
- /* e0 */ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- /* f0 */ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
-};
-
-
-Latin9Encoding::Latin9Encoding()
-{
-}
-
-
-Latin9Encoding::~Latin9Encoding()
-{
-}
-
-
-const char* Latin9Encoding::canonicalName() const
-{
- return _names[0];
-}
-
-
-bool Latin9Encoding::isA(const std::string& encodingName) const
-{
- for (const char** name = _names; *name; ++name)
- {
- if (Poco::icompare(encodingName, *name) == 0)
- return true;
- }
- return false;
-}
-
-
-const TextEncoding::CharacterMap& Latin9Encoding::characterMap() const
-{
- return _charMap;
-}
-
-
-int Latin9Encoding::convert(const unsigned char* bytes) const
-{
- return _charMap[*bytes];
-}
-
-
-int Latin9Encoding::convert(int ch, unsigned char* bytes, int length) const
-{
- if (ch >= 0 && ch <= 255 && _charMap[ch] == ch)
- {
- if (bytes && length >= 1)
- *bytes = ch;
- return 1;
- }
- else switch (ch)
- {
- case 0x0152: if (bytes && length >= 1) *bytes = 0xbc; return 1;
- case 0x0153: if (bytes && length >= 1) *bytes = 0xbd; return 1;
- case 0x0160: if (bytes && length >= 1) *bytes = 0xa6; return 1;
- case 0x0161: if (bytes && length >= 1) *bytes = 0xa8; return 1;
- case 0x017d: if (bytes && length >= 1) *bytes = 0xb4; return 1;
- case 0x017e: if (bytes && length >= 1) *bytes = 0xb8; return 1;
- case 0x0178: if (bytes && length >= 1) *bytes = 0xbe; return 1;
- case 0x20ac: if (bytes && length >= 1) *bytes = 0xa4; return 1;
- default: return 0;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/LineEndingConverter.cpp b/Utilities/Poco/Foundation/src/LineEndingConverter.cpp
deleted file mode 100755
index 3e607dc741..0000000000
--- a/Utilities/Poco/Foundation/src/LineEndingConverter.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// LineEndingConverter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: LineEndingConverter
-//
-// Copyright (c) 2005-2006, 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/LineEndingConverter.h"
-
-
-namespace Poco {
-
-
-#if defined(_WIN32)
-#define POCO_DEFAULT_NEWLINE_CHARS "\r\n"
-#else
-#define POCO_DEFAULT_NEWLINE_CHARS "\n"
-#endif
-
-
-const std::string LineEnding::NEWLINE_DEFAULT(POCO_DEFAULT_NEWLINE_CHARS);
-const std::string LineEnding::NEWLINE_CR("\r");
-const std::string LineEnding::NEWLINE_CRLF("\r\n");
-const std::string LineEnding::NEWLINE_LF("\n");
-
-
-LineEndingConverterStreamBuf::LineEndingConverterStreamBuf(std::istream& istr):
- _pIstr(&istr),
- _pOstr(0),
- _newLine(LineEnding::NEWLINE_DEFAULT),
- _lastChar(0)
-{
- _it = _newLine.end();
-}
-
-
-LineEndingConverterStreamBuf::LineEndingConverterStreamBuf(std::ostream& ostr):
- _pIstr(0),
- _pOstr(&ostr),
- _newLine(LineEnding::NEWLINE_DEFAULT),
- _lastChar(0)
-{
- _it = _newLine.end();
-}
-
-
-LineEndingConverterStreamBuf::~LineEndingConverterStreamBuf()
-{
-}
-
-
-void LineEndingConverterStreamBuf::setNewLine(const std::string& newLineCharacters)
-{
- _newLine = newLineCharacters;
- _it = _newLine.end();
-}
-
-
-const std::string& LineEndingConverterStreamBuf::getNewLine() const
-{
- return _newLine;
-}
-
-
-int LineEndingConverterStreamBuf::readFromDevice()
-{
- poco_assert_dbg (_pIstr);
-
- while (_it == _newLine.end())
- {
- int c = _pIstr->get();
- if (c == '\r')
- {
- if (_pIstr->peek() == '\n') _pIstr->get();
- _it = _newLine.begin();
- }
- else if (c == '\n')
- {
- _it = _newLine.begin();
- }
- else return c;
- }
- return *_it++;
-}
-
-
-int LineEndingConverterStreamBuf::writeToDevice(char c)
-{
- poco_assert_dbg (_pOstr);
-
- if (c == '\r' || (c == '\n' && _lastChar != '\r'))
- _pOstr->write(_newLine.data(), (std::streamsize) _newLine.length());
- if (c != '\n' && c != '\r')
- _pOstr->put(c);
- _lastChar = c;
- return charToInt(c);
-}
-
-
-LineEndingConverterIOS::LineEndingConverterIOS(std::istream& istr): _buf(istr)
-{
- poco_ios_init(&_buf);
-}
-
-
-LineEndingConverterIOS::LineEndingConverterIOS(std::ostream& ostr): _buf(ostr)
-{
- poco_ios_init(&_buf);
-}
-
-
-LineEndingConverterIOS::~LineEndingConverterIOS()
-{
-}
-
-
-void LineEndingConverterIOS::setNewLine(const std::string& newLineCharacters)
-{
- _buf.setNewLine(newLineCharacters);
-}
-
-
-const std::string& LineEndingConverterIOS::getNewLine() const
-{
- return _buf.getNewLine();
-}
-
-
-LineEndingConverterStreamBuf* LineEndingConverterIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-InputLineEndingConverter::InputLineEndingConverter(std::istream& istr):
- LineEndingConverterIOS(istr),
- std::istream(&_buf)
-{
-}
-
-
-InputLineEndingConverter::InputLineEndingConverter(std::istream& istr, const std::string& newLineCharacters):
- LineEndingConverterIOS(istr),
- std::istream(&_buf)
-{
- setNewLine(newLineCharacters);
-}
-
-
-InputLineEndingConverter::~InputLineEndingConverter()
-{
-}
-
-
-OutputLineEndingConverter::OutputLineEndingConverter(std::ostream& ostr):
- LineEndingConverterIOS(ostr),
- std::ostream(&_buf)
-{
-}
-
-
-OutputLineEndingConverter::OutputLineEndingConverter(std::ostream& ostr, const std::string& newLineCharacters):
- LineEndingConverterIOS(ostr),
- std::ostream(&_buf)
-{
- setNewLine(newLineCharacters);
-}
-
-
-OutputLineEndingConverter::~OutputLineEndingConverter()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/LocalDateTime.cpp b/Utilities/Poco/Foundation/src/LocalDateTime.cpp
deleted file mode 100755
index fb7c71270e..0000000000
--- a/Utilities/Poco/Foundation/src/LocalDateTime.cpp
+++ /dev/null
@@ -1,297 +0,0 @@
-//
-// LocalDateTime.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: LocalDateTime
-//
-// Copyright (c) 2004-2006, 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/LocalDateTime.h"
-#include "Poco/Timezone.h"
-#include "Poco/Timespan.h"
-#include <algorithm>
-#include <ctime>
-
-
-namespace Poco {
-
-
-LocalDateTime::LocalDateTime()
-{
- determineTzd(true);
-}
-
-
-LocalDateTime::LocalDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond):
- _dateTime(year, month, day, hour, minute, second, millisecond, microsecond)
-{
- determineTzd();
-}
-
-
-LocalDateTime::LocalDateTime(int tzd, int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond):
- _dateTime(year, month, day, hour, minute, second, millisecond, microsecond),
- _tzd(tzd)
-{
-}
-
-
-LocalDateTime::LocalDateTime(double julianDay):
- _dateTime(julianDay)
-{
- determineTzd(true);
-}
-
-
-LocalDateTime::LocalDateTime(int tzd, double julianDay):
- _dateTime(julianDay),
- _tzd(tzd)
-{
- adjustForTzd();
-}
-
-
-LocalDateTime::LocalDateTime(const DateTime& dateTime):
- _dateTime(dateTime)
-{
- determineTzd(true);
-}
-
-
-LocalDateTime::LocalDateTime(int tzd, const DateTime& dateTime):
- _dateTime(dateTime),
- _tzd(tzd)
-{
- adjustForTzd();
-}
-
-
-LocalDateTime::LocalDateTime(int tzd, const DateTime& dateTime, bool adjust):
- _dateTime(dateTime),
- _tzd(tzd)
-{
- if (adjust)
- adjustForTzd();
-}
-
-
-LocalDateTime::LocalDateTime(const LocalDateTime& dateTime):
- _dateTime(dateTime._dateTime),
- _tzd(dateTime._tzd)
-{
-}
-
-
-LocalDateTime::LocalDateTime(Timestamp::UtcTimeVal utcTime, Timestamp::TimeDiff diff, int tzd):
- _dateTime(utcTime, diff),
- _tzd(tzd)
-{
- adjustForTzd();
-}
-
-
-LocalDateTime::~LocalDateTime()
-{
-}
-
-
-LocalDateTime& LocalDateTime::operator = (const LocalDateTime& dateTime)
-{
- if (&dateTime != this)
- {
- _dateTime = dateTime._dateTime;
- _tzd = dateTime._tzd;
- }
- return *this;
-}
-
-
-LocalDateTime& LocalDateTime::operator = (const Timestamp& timestamp)
-{
- if (timestamp != this->timestamp())
- {
- _dateTime = timestamp;
- determineTzd(true);
- }
- return *this;
-}
-
-
-LocalDateTime& LocalDateTime::operator = (double julianDay)
-{
- _dateTime = julianDay;
- determineTzd(true);
- return *this;
-}
-
-
-LocalDateTime& LocalDateTime::assign(int year, int month, int day, int hour, int minute, int second, int millisecond, int microseconds)
-{
- _dateTime.assign(year, month, day, hour, minute, second, millisecond, microseconds);
- determineTzd(false);
- return *this;
-}
-
-
-LocalDateTime& LocalDateTime::assign(int tzd, int year, int month, int day, int hour, int minute, int second, int millisecond, int microseconds)
-{
- _dateTime.assign(year, month, day, hour, minute, second, millisecond, microseconds);
- _tzd = tzd;
- return *this;
-}
-
-
-LocalDateTime& LocalDateTime::assign(int tzd, double julianDay)
-{
- _tzd = tzd;
- _dateTime = julianDay;
- adjustForTzd();
- return *this;
-}
-
-
-void LocalDateTime::swap(LocalDateTime& dateTime)
-{
- _dateTime.swap(dateTime._dateTime);
- std::swap(_tzd, dateTime._tzd);
-}
-
-
-DateTime LocalDateTime::utc() const
-{
- return DateTime(_dateTime.utcTime(), -((Timestamp::TimeDiff) _tzd)*Timespan::SECONDS);
-}
-
-
-bool LocalDateTime::operator == (const LocalDateTime& dateTime) const
-{
- return utcTime() == dateTime.utcTime();
-}
-
-
-bool LocalDateTime::operator != (const LocalDateTime& dateTime) const
-{
- return utcTime() != dateTime.utcTime();
-}
-
-
-bool LocalDateTime::operator < (const LocalDateTime& dateTime) const
-{
- return utcTime() < dateTime.utcTime();
-}
-
-
-bool LocalDateTime::operator <= (const LocalDateTime& dateTime) const
-{
- return utcTime() <= dateTime.utcTime();
-}
-
-
-bool LocalDateTime::operator > (const LocalDateTime& dateTime) const
-{
- return utcTime() > dateTime.utcTime();
-}
-
-
-bool LocalDateTime::operator >= (const LocalDateTime& dateTime) const
-{
- return utcTime() >= dateTime.utcTime();
-}
-
-
-LocalDateTime LocalDateTime::operator + (const Timespan& span) const
-{
- // First calculate the adjusted UTC time, then calculate the
- // locally adjusted time by constructing a new LocalDateTime.
- DateTime tmp(utcTime(), span.totalMicroseconds());
- return LocalDateTime(tmp);
-}
-
-
-LocalDateTime LocalDateTime::operator - (const Timespan& span) const
-{
- // First calculate the adjusted UTC time, then calculate the
- // locally adjusted time by constructing a new LocalDateTime.
- DateTime tmp(utcTime(), -span.totalMicroseconds());
- return LocalDateTime(tmp);
-}
-
-
-Timespan LocalDateTime::operator - (const LocalDateTime& dateTime) const
-{
- return Timespan((utcTime() - dateTime.utcTime())/10);
-}
-
-
-LocalDateTime& LocalDateTime::operator += (const Timespan& span)
-{
- // Use the same trick as in operator+. Create a UTC time, adjust
- // it for the span, and convert back to LocalDateTime. This will
- // recalculate the tzd correctly in the case where the addition
- // crosses a DST boundary.
- *this = DateTime(utcTime(), span.totalMicroseconds());
- return *this;
-}
-
-
-LocalDateTime& LocalDateTime::operator -= (const Timespan& span)
-{
- // Use the same trick as in operator-. Create a UTC time, adjust
- // it for the span, and convert back to LocalDateTime. This will
- // recalculate the tzd correctly in the case where the subtraction
- // crosses a DST boundary.
- *this = DateTime(utcTime(), -span.totalMicroseconds());
- return *this;
-}
-
-
-void LocalDateTime::determineTzd(bool adjust)
-{
- std::time_t local;
- std::tm broken;
-
- broken.tm_year = (_dateTime.year() - 1900);
- broken.tm_mon = (_dateTime.month() - 1);
- broken.tm_mday = _dateTime.day();
- broken.tm_hour = _dateTime.hour();
- broken.tm_min = _dateTime.minute();
- broken.tm_sec = _dateTime.second();
- broken.tm_isdst = -1;
- local = std::mktime(&broken);
-
- _tzd = (Timezone::utcOffset() + ((broken.tm_isdst == 1) ? 3600 : 0));
- if (adjust)
- adjustForTzd();
-}
-
-
-} // namespace Poco
-
diff --git a/Utilities/Poco/Foundation/src/LogFile.cpp b/Utilities/Poco/Foundation/src/LogFile.cpp
deleted file mode 100755
index 4aa015f983..0000000000
--- a/Utilities/Poco/Foundation/src/LogFile.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// LogFile.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogFile
-//
-// Copyright (c) 2004-2006, 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/LogFile.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "LogFile_WIN32U.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "LogFile_WIN32.cpp"
-#elif defined(POCO_OS_FAMILY_VMS)
-#include "LogFile_VMS.cpp"
-#else
-#include "LogFile_STD.cpp"
-#endif
-
-
-namespace Poco {
-
-
-LogFile::LogFile(const std::string& path): LogFileImpl(path)
-{
-}
-
-
-LogFile::~LogFile()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/LogFile_STD.cpp b/Utilities/Poco/Foundation/src/LogFile_STD.cpp
deleted file mode 100755
index 044df7d751..0000000000
--- a/Utilities/Poco/Foundation/src/LogFile_STD.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// LogFile_STD.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogFile
-//
-// Copyright (c) 2004-2006, 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/LogFile_STD.h"
-#include "Poco/File.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-LogFileImpl::LogFileImpl(const std::string& path):
- _path(path),
- _str(_path, std::ios::app)
-{
- if (sizeImpl() == 0)
- _creationDate = File(path).getLastModified();
- else
- _creationDate = File(path).created();
-}
-
-
-LogFileImpl::~LogFileImpl()
-{
-}
-
-
-void LogFileImpl::writeImpl(const std::string& text)
-{
- _str << text << std::endl;
- if (!_str.good()) throw WriteFileException(_path);
-}
-
-
-UInt64 LogFileImpl::sizeImpl() const
-{
- return (UInt64) _str.tellp();
-}
-
-
-Timestamp LogFileImpl::creationDateImpl() const
-{
- return _creationDate;
-}
-
-
-const std::string& LogFileImpl::pathImpl() const
-{
- return _path;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/LogFile_VMS.cpp b/Utilities/Poco/Foundation/src/LogFile_VMS.cpp
deleted file mode 100755
index d38e3d789e..0000000000
--- a/Utilities/Poco/Foundation/src/LogFile_VMS.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// LogFile_VMS.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogFile
-//
-// Copyright (c) 2004-2006, 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/LogFile_VMS.h"
-#include "Poco/File.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-LogFileImpl::LogFileImpl(const std::string& path): _path(path)
-{
- _file = fopen(path.c_str(), "a", "ctx=rec,bin", "shr=get", "fop=dfw", "alq=500", "deq=500");
- if (!_file) throw OpenFileException(path);
- if (size() == 0)
- _creationDate = File(path).getLastModified();
- else
- _creationDate = File(path).created();
-}
-
-
-LogFileImpl::~LogFileImpl()
-{
- fclose(_file);
-}
-
-
-void LogFileImpl::writeImpl(const std::string& text)
-{
- int rc = fputs(text.c_str(), _file);
- if (rc == EOF) throw WriteFileException(_path);
- rc = fputc('\n', _file);
- if (rc == EOF) throw WriteFileException(_path);
- rc = fflush(_file);
- if (rc == EOF) throw WriteFileException(_path);
-}
-
-
-UInt64 LogFileImpl::sizeImpl() const
-{
- return (UInt64) ftell(_file);
-}
-
-
-Timestamp LogFileImpl::creationDateImpl() const
-{
- return _creationDate;
-}
-
-
-const std::string& LogFileImpl::pathImpl() const
-{
- return _path;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/LogFile_WIN32.cpp b/Utilities/Poco/Foundation/src/LogFile_WIN32.cpp
deleted file mode 100755
index 31d45edfe1..0000000000
--- a/Utilities/Poco/Foundation/src/LogFile_WIN32.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-//
-// LogFile_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogFile
-//
-// Copyright (c) 2004-2006, 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/LogFile_WIN32.h"
-#include "Poco/File.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-LogFileImpl::LogFileImpl(const std::string& path): _path(path), _hFile(INVALID_HANDLE_VALUE)
-{
- File file(path);
- if (file.exists())
- {
- if (0 == sizeImpl())
- _creationDate = file.getLastModified();
- else
- _creationDate = file.created();
- }
-}
-
-
-LogFileImpl::~LogFileImpl()
-{
- CloseHandle(_hFile);
-}
-
-
-void LogFileImpl::writeImpl(const std::string& text)
-{
- if (INVALID_HANDLE_VALUE == _hFile) createFile();
-
- DWORD bytesWritten;
- BOOL res = WriteFile(_hFile, text.data(), (DWORD) text.size(), &bytesWritten, NULL);
- if (!res) throw WriteFileException(_path);
- res = WriteFile(_hFile, "\r\n", 2, &bytesWritten, NULL);
- if (!res) throw WriteFileException(_path);
- res = FlushFileBuffers(_hFile);
- if (!res) throw WriteFileException(_path);
-}
-
-
-UInt64 LogFileImpl::sizeImpl() const
-{
- if (INVALID_HANDLE_VALUE == _hFile)
- {
- File file(_path);
- if (file.exists()) return file.getSize();
- else return 0;
- }
-
- LARGE_INTEGER li;
- li.HighPart = 0;
- li.LowPart = SetFilePointer(_hFile, 0, &li.HighPart, FILE_CURRENT);
- return li.QuadPart;
-}
-
-
-Timestamp LogFileImpl::creationDateImpl() const
-{
- return _creationDate;
-}
-
-
-const std::string& LogFileImpl::pathImpl() const
-{
- return _path;
-}
-
-
-void LogFileImpl::createFile()
-{
- _hFile = CreateFileA(_path.c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- if (_hFile == INVALID_HANDLE_VALUE) throw OpenFileException(_path);
- SetFilePointer(_hFile, 0, 0, FILE_END);
- // There seems to be a strange "optimization" in the Windows NTFS
- // filesystem that causes it to reuse directory entries of deleted
- // files. Example:
- // 1. create a file named "test.dat"
- // note the file's creation date
- // 2. delete the file "test.dat"
- // 3. wait a few seconds
- // 4. create a file named "test.dat"
- // the new file will have the same creation
- // date as the old one.
- // We work around this bug by taking the file's
- // modification date as a reference when the
- // file is empty.
- if (sizeImpl() == 0)
- _creationDate = File(_path).getLastModified();
- else
- _creationDate = File(_path).created();
-}
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/LogFile_WIN32U.cpp b/Utilities/Poco/Foundation/src/LogFile_WIN32U.cpp
deleted file mode 100755
index e845933f27..0000000000
--- a/Utilities/Poco/Foundation/src/LogFile_WIN32U.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// LogFile_WIN32U.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogFile
-//
-// Copyright (c) 2004-2006, 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/LogFile_WIN32U.h"
-#include "Poco/File.h"
-#include "Poco/Exception.h"
-#include "Poco/UnicodeConverter.h"
-
-
-namespace Poco {
-
-
-LogFileImpl::LogFileImpl(const std::string& path): _path(path), _hFile(INVALID_HANDLE_VALUE)
-{
- File file(path);
- if (file.exists())
- {
- if (0 == sizeImpl())
- _creationDate = file.getLastModified();
- else
- _creationDate = file.created();
- }
-}
-
-
-LogFileImpl::~LogFileImpl()
-{
- CloseHandle(_hFile);
-}
-
-
-void LogFileImpl::writeImpl(const std::string& text)
-{
- if (INVALID_HANDLE_VALUE == _hFile) createFile();
-
- DWORD bytesWritten;
- BOOL res = WriteFile(_hFile, text.data(), (DWORD) text.size(), &bytesWritten, NULL);
- if (!res) throw WriteFileException(_path);
- res = WriteFile(_hFile, "\r\n", 2, &bytesWritten, NULL);
- if (!res) throw WriteFileException(_path);
- res = FlushFileBuffers(_hFile);
- if (!res) throw WriteFileException(_path);
-}
-
-
-UInt64 LogFileImpl::sizeImpl() const
-{
- if (INVALID_HANDLE_VALUE == _hFile)
- {
- File file(_path);
- if (file.exists()) return file.getSize();
- else return 0;
- }
-
- LARGE_INTEGER li;
- li.HighPart = 0;
- li.LowPart = SetFilePointer(_hFile, 0, &li.HighPart, FILE_CURRENT);
- return li.QuadPart;
-}
-
-
-Timestamp LogFileImpl::creationDateImpl() const
-{
- return _creationDate;
-}
-
-
-const std::string& LogFileImpl::pathImpl() const
-{
- return _path;
-}
-
-
-void LogFileImpl::createFile()
-{
- std::wstring upath;
- UnicodeConverter::toUTF16(_path, upath);
-
- _hFile = CreateFileW(upath.c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- if (_hFile == INVALID_HANDLE_VALUE) throw OpenFileException(_path);
- SetFilePointer(_hFile, 0, 0, FILE_END);
- // There seems to be a strange "optimization" in the Windows NTFS
- // filesystem that causes it to reuse directory entries of deleted
- // files. Example:
- // 1. create a file named "test.dat"
- // note the file's creation date
- // 2. delete the file "test.dat"
- // 3. wait a few seconds
- // 4. create a file named "test.dat"
- // the new file will have the same creation
- // date as the old one.
- // We work around this bug by taking the file's
- // modification date as a reference when the
- // file is empty.
- if (sizeImpl() == 0)
- _creationDate = File(_path).getLastModified();
- else
- _creationDate = File(_path).created();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/LogStream.cpp b/Utilities/Poco/Foundation/src/LogStream.cpp
deleted file mode 100755
index 0d5145401c..0000000000
--- a/Utilities/Poco/Foundation/src/LogStream.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-//
-// LogStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LogStream
-//
-// Copyright (c) 2006-2007, 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/LogStream.h"
-
-
-namespace Poco {
-
-
-//
-// LogStreamBuf
-//
-
-
-LogStreamBuf::LogStreamBuf(Logger& logger, Message::Priority priority):
- _logger(logger),
- _priority(priority)
-{
-}
-
-
-LogStreamBuf::~LogStreamBuf()
-{
-}
-
-
-void LogStreamBuf::setPriority(Message::Priority priority)
-{
- _priority = priority;
-}
-
-
-int LogStreamBuf::writeToDevice(char c)
-{
- if (c == '\n' || c == '\r')
- {
- Message msg(_logger.name(), _message, _priority);
- _message.clear();
- _logger.log(msg);
- }
- else _message += c;
- return c;
-}
-
-
-//
-// LogIOS
-//
-
-
-LogIOS::LogIOS(Logger& logger, Message::Priority priority):
- _buf(logger, priority)
-{
- poco_ios_init(&_buf);
-}
-
-
-LogIOS::~LogIOS()
-{
-}
-
-
-LogStreamBuf* LogIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-//
-// LogStream
-//
-
-
-LogStream::LogStream(Logger& logger, Message::Priority priority):
- LogIOS(logger, priority),
- std::ostream(&_buf)
-{
-}
-
-
-LogStream::LogStream(const std::string& loggerName, Message::Priority priority):
- LogIOS(Logger::get(loggerName), priority),
- std::ostream(&_buf)
-{
-}
-
-
-LogStream::~LogStream()
-{
-}
-
-
-LogStream& LogStream::fatal()
-{
- return priority(Message::PRIO_FATAL);
-}
-
-
-LogStream& LogStream::fatal(const std::string& message)
-{
- _buf.logger().fatal(message);
- return priority(Message::PRIO_FATAL);
-}
-
-
-LogStream& LogStream::critical()
-{
- return priority(Message::PRIO_CRITICAL);
-}
-
-
-LogStream& LogStream::critical(const std::string& message)
-{
- _buf.logger().critical(message);
- return priority(Message::PRIO_CRITICAL);
-}
-
-
-LogStream& LogStream::error()
-{
- return priority(Message::PRIO_ERROR);
-}
-
-
-LogStream& LogStream::error(const std::string& message)
-{
- _buf.logger().error(message);
- return priority(Message::PRIO_ERROR);
-}
-
-
-LogStream& LogStream::warning()
-{
- return priority(Message::PRIO_WARNING);
-}
-
-
-LogStream& LogStream::warning(const std::string& message)
-{
- _buf.logger().warning(message);
- return priority(Message::PRIO_WARNING);
-}
-
-
-LogStream& LogStream::notice()
-{
- return priority(Message::PRIO_NOTICE);
-}
-
-
-LogStream& LogStream::notice(const std::string& message)
-{
- _buf.logger().notice(message);
- return priority(Message::PRIO_NOTICE);
-}
-
-
-LogStream& LogStream::information()
-{
- return priority(Message::PRIO_INFORMATION);
-}
-
-
-LogStream& LogStream::information(const std::string& message)
-{
- _buf.logger().information(message);
- return priority(Message::PRIO_INFORMATION);
-}
-
-
-LogStream& LogStream::debug()
-{
- return priority(Message::PRIO_DEBUG);
-}
-
-
-LogStream& LogStream::debug(const std::string& message)
-{
- _buf.logger().debug(message);
- return priority(Message::PRIO_DEBUG);
-}
-
-
-LogStream& LogStream::trace()
-{
- return priority(Message::PRIO_TRACE);
-}
-
-
-LogStream& LogStream::trace(const std::string& message)
-{
- _buf.logger().trace(message);
- return priority(Message::PRIO_TRACE);
-}
-
-
-LogStream& LogStream::priority(Message::Priority priority)
-{
- _buf.setPriority(priority);
- return *this;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Logger.cpp b/Utilities/Poco/Foundation/src/Logger.cpp
deleted file mode 100755
index f845a6b0dc..0000000000
--- a/Utilities/Poco/Foundation/src/Logger.cpp
+++ /dev/null
@@ -1,467 +0,0 @@
-//
-// Logger.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Logger
-//
-// Copyright (c) 2004-2006, 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/Logger.h"
-#include "Poco/Formatter.h"
-#include "Poco/LoggingRegistry.h"
-#include "Poco/Exception.h"
-#include "Poco/NumberFormatter.h"
-
-
-namespace Poco {
-
-
-Logger::LoggerMap* Logger::_pLoggerMap = 0;
-Mutex Logger::_mapMtx;
-const std::string Logger::ROOT;
-
-
-Logger::Logger(const std::string& name, Channel* pChannel, int level): _name(name), _pChannel(pChannel), _level(level)
-{
- if (pChannel) pChannel->duplicate();
-}
-
-
-Logger::~Logger()
-{
- if (_pChannel) _pChannel->release();
-}
-
-
-void Logger::setChannel(Channel* pChannel)
-{
- if (_pChannel) _pChannel->release();
- _pChannel = pChannel;
- if (_pChannel) _pChannel->duplicate();
-}
-
-
-Channel* Logger::getChannel() const
-{
- return _pChannel;
-}
-
-
-void Logger::setLevel(int level)
-{
- _level = level;
-}
-
-
-void Logger::setLevel(const std::string& level)
-{
- if (level == "fatal")
- setLevel(Message::PRIO_FATAL);
- else if (level == "critical")
- setLevel(Message::PRIO_CRITICAL);
- else if (level == "error")
- setLevel(Message::PRIO_ERROR);
- else if (level == "warning")
- setLevel(Message::PRIO_WARNING);
- else if (level == "notice")
- setLevel(Message::PRIO_NOTICE);
- else if (level == "information")
- setLevel(Message::PRIO_INFORMATION);
- else if (level == "debug")
- setLevel(Message::PRIO_DEBUG);
- else if (level == "trace")
- setLevel(Message::PRIO_TRACE);
- else
- throw InvalidArgumentException("Not a valid log level", level);
-}
-
-
-void Logger::setProperty(const std::string& name, const std::string& value)
-{
- if (name == "channel")
- setChannel(LoggingRegistry::defaultRegistry().channelForName(value));
- else if (name == "level")
- setLevel(value);
- else
- Channel::setProperty(name, value);
-}
-
-
-void Logger::log(const Message& msg)
-{
- if (_level >= msg.getPriority() && _pChannel)
- {
- _pChannel->log(msg);
- }
-}
-
-
-void Logger::log(const Exception& exc)
-{
- error(exc.displayText());
-}
-
-
-void Logger::dump(const std::string& msg, const void* buffer, std::size_t length, Message::Priority prio)
-{
- if (_level >= prio && _pChannel)
- {
- std::string text(msg);
- formatDump(text, buffer, length);
- _pChannel->log(Message(_name, text, prio));
- }
-}
-
-
-void Logger::setLevel(const std::string& name, int level)
-{
- Mutex::ScopedLock lock(_mapMtx);
-
- if (_pLoggerMap)
- {
- std::string::size_type len = name.length();
- for (LoggerMap::iterator it = _pLoggerMap->begin(); it != _pLoggerMap->end(); ++it)
- {
- if (len == 0 ||
- (it->first.compare(0, len, name) == 0 && (it->first.length() == len || it->first[len] == '.')))
- {
- it->second->setLevel(level);
- }
- }
- }
-}
-
-
-void Logger::setChannel(const std::string& name, Channel* pChannel)
-{
- Mutex::ScopedLock lock(_mapMtx);
-
- if (_pLoggerMap)
- {
- std::string::size_type len = name.length();
- for (LoggerMap::iterator it = _pLoggerMap->begin(); it != _pLoggerMap->end(); ++it)
- {
- if (len == 0 ||
- (it->first.compare(0, len, name) == 0 && (it->first.length() == len || it->first[len] == '.')))
- {
- it->second->setChannel(pChannel);
- }
- }
- }
-}
-
-
-void Logger::setProperty(const std::string& loggerName, const std::string& propertyName, const std::string& value)
-{
- Mutex::ScopedLock lock(_mapMtx);
-
- if (_pLoggerMap)
- {
- std::string::size_type len = loggerName.length();
- for (LoggerMap::iterator it = _pLoggerMap->begin(); it != _pLoggerMap->end(); ++it)
- {
- if (len == 0 ||
- (it->first.compare(0, len, loggerName) == 0 && (it->first.length() == len || it->first[len] == '.')))
- {
- it->second->setProperty(propertyName, value);
- }
- }
- }
-}
-
-
-std::string Logger::format(const std::string& fmt, const std::string& arg)
-{
- std::string args[] =
- {
- arg
- };
- return format(fmt, 1, args);
-}
-
-
-std::string Logger::format(const std::string& fmt, const std::string& arg0, const std::string& arg1)
-{
- std::string args[] =
- {
- arg0,
- arg1
- };
- return format(fmt, 2, args);
-}
-
-
-std::string Logger::format(const std::string& fmt, const std::string& arg0, const std::string& arg1, const std::string& arg2)
-{
- std::string args[] =
- {
- arg0,
- arg1,
- arg2
- };
- return format(fmt, 3, args);
-}
-
-
-std::string Logger::format(const std::string& fmt, const std::string& arg0, const std::string& arg1, const std::string& arg2, const std::string& arg3)
-{
- std::string args[] =
- {
- arg0,
- arg1,
- arg2,
- arg3
- };
- return format(fmt, 4, args);
-}
-
-
-std::string Logger::format(const std::string& fmt, int argc, std::string argv[])
-{
- std::string result;
- std::string::const_iterator it = fmt.begin();
- while (it != fmt.end())
- {
- if (*it == '$')
- {
- ++it;
- if (*it == '$')
- {
- result += '$';
- }
- else if (*it >= '0' && *it <= '9')
- {
- int i = *it - '0';
- if (i < argc)
- result += argv[i];
- }
- else
- {
- result += '$';
- result += *it;
- }
- }
- else result += *it;
- ++it;
- }
- return result;
-}
-
-
-void Logger::formatDump(std::string& message, const void* buffer, std::size_t length)
-{
- const int BYTES_PER_LINE = 16;
-
- message.reserve(message.size() + length*6);
- if (!message.empty()) message.append("\n");
- unsigned char* base = (unsigned char*) buffer;
- int addr = 0;
- while (addr < length)
- {
- if (addr > 0) message.append("\n");
- message.append(NumberFormatter::formatHex(addr, 4));
- message.append(" ");
- int offset = 0;
- while (addr + offset < length && offset < BYTES_PER_LINE)
- {
- message.append(NumberFormatter::formatHex(base[addr + offset], 2));
- message.append(offset == 7 ? " " : " ");
- ++offset;
- }
- if (offset < 7) message.append(" ");
- while (offset < BYTES_PER_LINE) { message.append(" "); ++offset; }
- message.append(" ");
- offset = 0;
- while (addr + offset < length && offset < BYTES_PER_LINE)
- {
- unsigned char c = base[addr + offset];
- message += (c >= 32 && c < 127) ? (char) c : '.';
- ++offset;
- }
- addr += BYTES_PER_LINE;
- }
-}
-
-
-Logger& Logger::get(const std::string& name)
-{
- Mutex::ScopedLock lock(_mapMtx);
-
- return unsafeGet(name);
-}
-
-
-Logger& Logger::unsafeGet(const std::string& name)
-{
- Logger* pLogger = find(name);
- if (!pLogger)
- {
- if (name == ROOT)
- {
- pLogger = new Logger(name, 0, Message::PRIO_INFORMATION);
- }
- else
- {
- Logger& par = parent(name);
- pLogger = new Logger(name, par.getChannel(), par.getLevel());
- }
- add(pLogger);
- }
- return *pLogger;
-}
-
-
-Logger& Logger::create(const std::string& name, Channel* pChannel, int level)
-{
- Mutex::ScopedLock lock(_mapMtx);
-
- if (find(name)) throw ExistsException();
- Logger* pLogger = new Logger(name, pChannel, level);
- add(pLogger);
- return *pLogger;
-}
-
-
-Logger& Logger::root()
-{
- Mutex::ScopedLock lock(_mapMtx);
-
- return unsafeGet(ROOT);
-}
-
-
-Logger* Logger::has(const std::string& name)
-{
- Mutex::ScopedLock lock(_mapMtx);
-
- return find(name);
-}
-
-
-void Logger::shutdown()
-{
- Mutex::ScopedLock lock(_mapMtx);
-
- if (_pLoggerMap)
- {
- for (LoggerMap::iterator it = _pLoggerMap->begin(); it != _pLoggerMap->end(); ++it)
- {
- it->second->release();
- }
- delete _pLoggerMap;
- _pLoggerMap = 0;
- }
-}
-
-
-Logger* Logger::find(const std::string& name)
-{
- if (_pLoggerMap)
- {
- LoggerMap::iterator it = _pLoggerMap->find(name);
- if (it != _pLoggerMap->end())
- return it->second;
- }
- return 0;
-}
-
-
-void Logger::destroy(const std::string& name)
-{
- Mutex::ScopedLock lock(_mapMtx);
-
- if (_pLoggerMap)
- {
- LoggerMap::iterator it = _pLoggerMap->find(name);
- if (it != _pLoggerMap->end())
- {
- it->second->release();
- _pLoggerMap->erase(it);
- }
- }
-}
-
-
-void Logger::names(std::vector<std::string>& names)
-{
- Mutex::ScopedLock lock(_mapMtx);
-
- names.clear();
- if (_pLoggerMap)
- {
- for (LoggerMap::const_iterator it = _pLoggerMap->begin(); it != _pLoggerMap->end(); ++it)
- {
- names.push_back(it->first);
- }
- }
-}
-
-
-Logger& Logger::parent(const std::string& name)
-{
- std::string::size_type pos = name.rfind('.');
- if (pos != std::string::npos)
- {
- std::string pname = name.substr(0, pos);
- Logger* pParent = find(pname);
- if (pParent)
- return *pParent;
- else
- return parent(pname);
- }
- else return unsafeGet(ROOT);
-}
-
-
-class AutoLoggerShutdown
-{
-public:
- AutoLoggerShutdown()
- {
- }
- ~AutoLoggerShutdown()
- {
- Logger::shutdown();
- }
-};
-
-
-void Logger::add(Logger* pLogger)
-{
- static AutoLoggerShutdown als;
-
- if (!_pLoggerMap)
- _pLoggerMap = new LoggerMap;
- _pLoggerMap->insert(LoggerMap::value_type(pLogger->name(), pLogger));
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/LoggingFactory.cpp b/Utilities/Poco/Foundation/src/LoggingFactory.cpp
deleted file mode 100755
index 39d0f42a40..0000000000
--- a/Utilities/Poco/Foundation/src/LoggingFactory.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// LoggingFactory.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LoggingFactory
-//
-// Copyright (c) 2004-2006, 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/LoggingFactory.h"
-#include "Poco/SingletonHolder.h"
-#include "Poco/AsyncChannel.h"
-#include "Poco/ConsoleChannel.h"
-#include "Poco/FileChannel.h"
-#include "Poco/FormattingChannel.h"
-#include "Poco/SplitterChannel.h"
-#include "Poco/NullChannel.h"
-#if defined(POCO_OS_FAMILY_UNIX)
-#include "Poco/SyslogChannel.h"
-#endif
-#if defined(POCO_OS_FAMILY_VMS)
-#include "Poco/OpcomChannel.h"
-#endif
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/EventLogChannel.h"
-#include "Poco/WindowsConsoleChannel.h"
-#endif
-#include "Poco/PatternFormatter.h"
-
-
-namespace Poco {
-
-
-LoggingFactory::LoggingFactory()
-{
- registerBuiltins();
-}
-
-
-LoggingFactory::~LoggingFactory()
-{
-}
-
-
-void LoggingFactory::registerChannelClass(const std::string& className, ChannelInstantiator* pFactory)
-{
- _channelFactory.registerClass(className, pFactory);
-}
-
-
-void LoggingFactory::registerFormatterClass(const std::string& className, FormatterFactory* pFactory)
-{
- _formatterFactory.registerClass(className, pFactory);
-}
-
-
-Channel* LoggingFactory::createChannel(const std::string& className) const
-{
- return _channelFactory.createInstance(className);
-}
-
-
-Formatter* LoggingFactory::createFormatter(const std::string& className) const
-{
- return _formatterFactory.createInstance(className);
-}
-
-
-LoggingFactory& LoggingFactory::defaultFactory()
-{
- static SingletonHolder<LoggingFactory> sh;
- return *sh.get();
-}
-
-
-void LoggingFactory::registerBuiltins()
-{
- _channelFactory.registerClass("AsyncChannel", new Instantiator<AsyncChannel, Channel>);
-#if defined(POCO_OS_FAMILY_WINDOWS)
- _channelFactory.registerClass("ConsoleChannel", new Instantiator<WindowsConsoleChannel, Channel>);
-#else
- _channelFactory.registerClass("ConsoleChannel", new Instantiator<ConsoleChannel, Channel>);
-#endif
-#ifndef POCO_NO_FILECHANNEL
- _channelFactory.registerClass("FileChannel", new Instantiator<FileChannel, Channel>);
-#endif
- _channelFactory.registerClass("FormattingChannel", new Instantiator<FormattingChannel, Channel>);
-#ifndef POCO_NO_SPLITTERCHANNEL
- _channelFactory.registerClass("SplitterChannel", new Instantiator<SplitterChannel, Channel>);
-#endif
- _channelFactory.registerClass("NullChannel", new Instantiator<NullChannel, Channel>);
-
-#if defined(POCO_OS_FAMILY_UNIX)
-#ifndef POCO_NO_SYSLOGCHANNEL
- _channelFactory.registerClass("SyslogChannel", new Instantiator<SyslogChannel, Channel>);
-#endif
-#endif
-#if defined(POCO_OS_FAMILY_VMS)
- _channelFactory.registerClass("OpcomChannel", new Instantiator<OpcomChannel, Channel>);
-#endif
-#if defined(POCO_OS_FAMILY_WINDOWS)
- _channelFactory.registerClass("EventLogChannel", new Instantiator<EventLogChannel, Channel>);
-#endif
-
- _formatterFactory.registerClass("PatternFormatter", new Instantiator<PatternFormatter, Formatter>);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/LoggingRegistry.cpp b/Utilities/Poco/Foundation/src/LoggingRegistry.cpp
deleted file mode 100755
index 4c6c4ff782..0000000000
--- a/Utilities/Poco/Foundation/src/LoggingRegistry.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// LoggingRegistry.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: LoggingRegistry
-//
-// Copyright (c) 2004-2006, 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/LoggingRegistry.h"
-#include "Poco/SingletonHolder.h"
-
-
-namespace Poco {
-
-
-LoggingRegistry::LoggingRegistry()
-{
-}
-
-
-LoggingRegistry::~LoggingRegistry()
-{
-}
-
-
-Channel* LoggingRegistry::channelForName(const std::string& name) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- ChannelMap::const_iterator it = _channelMap.find(name);
- if (it != _channelMap.end())
- return const_cast<Channel*>(it->second.get());
- else
- throw NotFoundException("logging channel", name);
-}
-
-
-Formatter* LoggingRegistry::formatterForName(const std::string& name) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- FormatterMap::const_iterator it = _formatterMap.find(name);
- if (it != _formatterMap.end())
- return const_cast<Formatter*>(it->second.get());
- else
- throw NotFoundException("logging formatter", name);
-}
-
-
-void LoggingRegistry::registerChannel(const std::string& name, Channel* pChannel)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- _channelMap[name] = ChannelPtr(pChannel, true);
-}
-
-
-void LoggingRegistry::registerFormatter(const std::string& name, Formatter* pFormatter)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- _formatterMap[name] = FormatterPtr(pFormatter, true);
-}
-
-
-void LoggingRegistry::unregisterChannel(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- ChannelMap::iterator it = _channelMap.find(name);
- if (it != _channelMap.end())
- _channelMap.erase(it);
- else
- throw NotFoundException("logging channel", name);
-}
-
-
-void LoggingRegistry::unregisterFormatter(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- FormatterMap::iterator it = _formatterMap.find(name);
- if (it != _formatterMap.end())
- _formatterMap.erase(it);
- else
- throw NotFoundException("logging formatter", name);
-}
-
-
-void LoggingRegistry::clear()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- _channelMap.clear();
- _formatterMap.clear();
-}
-
-
-LoggingRegistry& LoggingRegistry::defaultRegistry()
-{
- static SingletonHolder<LoggingRegistry> sh;
- return *sh.get();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/MD2Engine.cpp b/Utilities/Poco/Foundation/src/MD2Engine.cpp
deleted file mode 100755
index a082389806..0000000000
--- a/Utilities/Poco/Foundation/src/MD2Engine.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-//
-// MD2Engine.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: MD2Engine
-//
-// Copyright (c) 2004-2006, 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.
-//
-//
-// MD2 (RFC 1319) algorithm:
-// Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
-// rights reserved.
-//
-// License to copy and use this software is granted for
-// non-commercial Internet Privacy-Enhanced Mail provided that it is
-// identified as the "RSA Data Security, Inc. MD2 Message Digest
-// Algorithm" in all material mentioning or referencing this software
-// or this function.
-//
-// RSA Data Security, Inc. makes no representations concerning either
-// the merchantability of this software or the suitability of this
-// software for any particular purpose. It is provided "as is"
-// without express or implied warranty of any kind.
-//
-// These notices must be retained in any copies of any part of this
-// documentation and/or software.
-//
-
-
-#include "Poco/MD2Engine.h"
-#include <cstring>
-
-
-namespace Poco {
-
-
-MD2Engine::MD2Engine()
-{
- _digest.reserve(16);
- reset();
-}
-
-
-MD2Engine::~MD2Engine()
-{
- reset();
-}
-
-
-void MD2Engine::updateImpl(const void* input_, unsigned inputLen)
-{
- const unsigned char* input = (const unsigned char*) input_;
- unsigned int i, index, partLen;
-
- /* Update number of bytes mod 16 */
- index = _context.count;
- _context.count = (index + inputLen) & 0xf;
-
- partLen = 16 - index;
-
- /* Transform as many times as possible. */
- if (inputLen >= partLen)
- {
- std::memcpy(&_context.buffer[index], input, partLen);
- transform(_context.state, _context.checksum, _context.buffer);
-
- for (i = partLen; i + 15 < inputLen; i += 16)
- transform(_context.state, _context.checksum, &input[i]);
-
- index = 0;
- }
- else i = 0;
-
- /* Buffer remaining input */
- std::memcpy(&_context.buffer[index], &input[i], inputLen-i);
-}
-
-
-unsigned MD2Engine::digestLength() const
-{
- return DIGEST_SIZE;
-}
-
-
-void MD2Engine::reset()
-{
- std::memset(&_context, 0, sizeof(_context));
-}
-
-
-const DigestEngine::Digest& MD2Engine::digest()
-{
- static const unsigned char* PADDING[] =
- {
- (unsigned char*) "",
- (unsigned char*) "\001",
- (unsigned char*) "\002\002",
- (unsigned char*) "\003\003\003",
- (unsigned char*) "\004\004\004\004",
- (unsigned char*) "\005\005\005\005\005",
- (unsigned char*) "\006\006\006\006\006\006",
- (unsigned char*) "\007\007\007\007\007\007\007",
- (unsigned char*) "\010\010\010\010\010\010\010\010",
- (unsigned char*) "\011\011\011\011\011\011\011\011\011",
- (unsigned char*) "\012\012\012\012\012\012\012\012\012\012",
- (unsigned char*) "\013\013\013\013\013\013\013\013\013\013\013",
- (unsigned char*) "\014\014\014\014\014\014\014\014\014\014\014\014",
- (unsigned char*) "\015\015\015\015\015\015\015\015\015\015\015\015\015",
- (unsigned char *) "\016\016\016\016\016\016\016\016\016\016\016\016\016\016",
- (unsigned char *) "\017\017\017\017\017\017\017\017\017\017\017\017\017\017\017",
- (unsigned char *) "\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020"
- };
- unsigned int index, padLen;
-
- /* Pad out to multiple of 16. */
- index = _context.count;
- padLen = 16 - index;
- update((const char*) PADDING[padLen], padLen);
-
- /* Extend with checksum */
- update((const char*) _context.checksum, 16);
-
- /* Store state in digest */
- _digest.clear();
- _digest.insert(_digest.begin(), _context.state, _context.state + 16);
-
- /* Zeroize sensitive information. */
- std::memset(&_context, 0, sizeof(_context));
- reset();
- return _digest;
-}
-
-
-void MD2Engine::transform(unsigned char state[16], unsigned char checksum[16], const unsigned char block[16])
-{
- // Permutation of 0..255 constructed from the digits of pi. It gives a
- // "random" nonlinear byte substitution operation.
- static const unsigned char PI_SUBST[256] =
- {
- 41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6,
- 19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188,
- 76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24,
- 138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251,
- 245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63,
- 148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50,
- 39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165,
- 181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210,
- 150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157,
- 112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27,
- 96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15,
- 85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197,
- 234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65,
- 129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123,
- 8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233,
- 203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228,
- 166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237,
- 31, 26, 219, 153, 141, 51, 159, 17, 131, 20
- };
- unsigned int i, j, t;
- unsigned char x[48];
-
- /* Form encryption block from state, block, state ^ block. */
- std::memcpy(x, state, 16);
- std::memcpy(x+16, block, 16);
- for (i = 0; i < 16; i++)
- x[i+32] = state[i] ^ block[i];
-
- /* Encrypt block (18 rounds). */
- t = 0;
- for (i = 0; i < 18; i++)
- {
- for (j = 0; j < 48; j++)
- t = x[j] ^= PI_SUBST[t];
- t = (t + i) & 0xff;
- }
-
- /* Save new state */
- std::memcpy(state, x, 16);
-
- /* Update checksum. */
- t = checksum[15];
- for (i = 0; i < 16; i++)
- t = checksum[i] ^= PI_SUBST[block[i] ^ t];
-
- /* Zeroize sensitive information. */
- std::memset(x, 0, sizeof(x));
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/MD4Engine.cpp b/Utilities/Poco/Foundation/src/MD4Engine.cpp
deleted file mode 100755
index 330a7a5e1d..0000000000
--- a/Utilities/Poco/Foundation/src/MD4Engine.cpp
+++ /dev/null
@@ -1,300 +0,0 @@
-//
-// MD4Engine.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: MD4Engine
-//
-// Copyright (c) 2004-2006, 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.
-//
-//
-// MD4 (RFC 1320) algorithm:
-// Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
-// rights reserved.
-//
-// License to copy and use this software is granted provided that it
-// is identified as the "RSA Data Security, Inc. MD4 Message-Digest
-// Algorithm" in all material mentioning or referencing this software
-// or this function.
-//
-// License is also granted to make and use derivative works provided
-// that such works are identified as "derived from the RSA Data
-// Security, Inc. MD4 Message-Digest Algorithm" in all material
-// mentioning or referencing the derived work.
-//
-// RSA Data Security, Inc. makes no representations concerning either
-// the merchantability of this software or the suitability of this
-// software for any particular purpose. It is provided "as is"
-// without express or implied warranty of any kind.
-//
-// These notices must be retained in any copies of any part of this
-// documentation and/or software.
-//
-
-
-#include "Poco/MD4Engine.h"
-#include <cstring>
-
-
-namespace Poco {
-
-
-MD4Engine::MD4Engine()
-{
- _digest.reserve(16);
- reset();
-}
-
-
-MD4Engine::~MD4Engine()
-{
- reset();
-}
-
-
-void MD4Engine::updateImpl(const void* input_, unsigned inputLen)
-{
- const unsigned char* input = (const unsigned char*) input_;
- unsigned int i, index, partLen;
-
- /* Compute number of bytes mod 64 */
- index = (unsigned int)((_context.count[0] >> 3) & 0x3F);
-
- /* Update number of bits */
- if ((_context.count[0] += ((UInt32) inputLen << 3)) < ((UInt32) inputLen << 3))
- _context.count[1]++;
- _context.count[1] += ((UInt32) inputLen >> 29);
-
- partLen = 64 - index;
-
- /* Transform as many times as possible. */
- if (inputLen >= partLen)
- {
- std::memcpy(&_context.buffer[index], input, partLen);
- transform(_context.state, _context.buffer);
-
- for (i = partLen; i + 63 < inputLen; i += 64)
- transform(_context.state, &input[i]);
-
- index = 0;
- }
- else i = 0;
-
- /* Buffer remaining input */
- std::memcpy(&_context.buffer[index], &input[i], inputLen-i);
-}
-
-
-unsigned MD4Engine::digestLength() const
-{
- return DIGEST_SIZE;
-}
-
-
-void MD4Engine::reset()
-{
- std::memset(&_context, 0, sizeof(_context));
- _context.count[0] = _context.count[1] = 0;
- _context.state[0] = 0x67452301;
- _context.state[1] = 0xefcdab89;
- _context.state[2] = 0x98badcfe;
- _context.state[3] = 0x10325476;
-}
-
-
-const DigestEngine::Digest& MD4Engine::digest()
-{
- static const unsigned char PADDING[64] =
- {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
- unsigned char bits[8];
- unsigned int index, padLen;
-
- /* Save number of bits */
- encode(bits, _context.count, 8);
-
- /* Pad out to 56 mod 64. */
- index = (unsigned int)((_context.count[0] >> 3) & 0x3f);
- padLen = (index < 56) ? (56 - index) : (120 - index);
- update(PADDING, padLen);
-
- /* Append length (before padding) */
- update(bits, 8);
-
- /* Store state in digest */
- unsigned char digest[16];
- encode(digest, _context.state, 16);
- _digest.clear();
- _digest.insert(_digest.begin(), digest, digest + sizeof(digest));
-
- /* Zeroize sensitive information. */
- std::memset(&_context, 0, sizeof (_context));
- reset();
- return _digest;
-}
-
-
-/* Constants for MD4Transform routine. */
-#define S11 3
-#define S12 7
-#define S13 11
-#define S14 19
-#define S21 3
-#define S22 5
-#define S23 9
-#define S24 13
-#define S31 3
-#define S32 9
-#define S33 11
-#define S34 15
-
-
-/* F, G and H are basic MD4 functions. */
-#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
-#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
-#define H(x, y, z) ((x) ^ (y) ^ (z))
-
-
-/* ROTATE_LEFT rotates x left n bits. */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
-
-
-/* FF, GG and HH are transformations for rounds 1, 2 and 3 */
-/* Rotation is separate from addition to prevent recomputation */
-#define FF(a, b, c, d, x, s) { \
- (a) += F ((b), (c), (d)) + (x); \
- (a) = ROTATE_LEFT ((a), (s)); \
- }
-#define GG(a, b, c, d, x, s) { \
- (a) += G ((b), (c), (d)) + (x) + (UInt32)0x5a827999; \
- (a) = ROTATE_LEFT ((a), (s)); \
- }
-#define HH(a, b, c, d, x, s) { \
- (a) += H ((b), (c), (d)) + (x) + (UInt32)0x6ed9eba1; \
- (a) = ROTATE_LEFT ((a), (s)); \
- }
-
-
-void MD4Engine::transform (UInt32 state[4], const unsigned char block[64])
-{
- UInt32 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
-
- decode(x, block, 64);
-
- /* Round 1 */
- FF (a, b, c, d, x[ 0], S11); /* 1 */
- FF (d, a, b, c, x[ 1], S12); /* 2 */
- FF (c, d, a, b, x[ 2], S13); /* 3 */
- FF (b, c, d, a, x[ 3], S14); /* 4 */
- FF (a, b, c, d, x[ 4], S11); /* 5 */
- FF (d, a, b, c, x[ 5], S12); /* 6 */
- FF (c, d, a, b, x[ 6], S13); /* 7 */
- FF (b, c, d, a, x[ 7], S14); /* 8 */
- FF (a, b, c, d, x[ 8], S11); /* 9 */
- FF (d, a, b, c, x[ 9], S12); /* 10 */
- FF (c, d, a, b, x[10], S13); /* 11 */
- FF (b, c, d, a, x[11], S14); /* 12 */
- FF (a, b, c, d, x[12], S11); /* 13 */
- FF (d, a, b, c, x[13], S12); /* 14 */
- FF (c, d, a, b, x[14], S13); /* 15 */
- FF (b, c, d, a, x[15], S14); /* 16 */
-
- /* Round 2 */
- GG (a, b, c, d, x[ 0], S21); /* 17 */
- GG (d, a, b, c, x[ 4], S22); /* 18 */
- GG (c, d, a, b, x[ 8], S23); /* 19 */
- GG (b, c, d, a, x[12], S24); /* 20 */
- GG (a, b, c, d, x[ 1], S21); /* 21 */
- GG (d, a, b, c, x[ 5], S22); /* 22 */
- GG (c, d, a, b, x[ 9], S23); /* 23 */
- GG (b, c, d, a, x[13], S24); /* 24 */
- GG (a, b, c, d, x[ 2], S21); /* 25 */
- GG (d, a, b, c, x[ 6], S22); /* 26 */
- GG (c, d, a, b, x[10], S23); /* 27 */
- GG (b, c, d, a, x[14], S24); /* 28 */
- GG (a, b, c, d, x[ 3], S21); /* 29 */
- GG (d, a, b, c, x[ 7], S22); /* 30 */
- GG (c, d, a, b, x[11], S23); /* 31 */
- GG (b, c, d, a, x[15], S24); /* 32 */
-
- /* Round 3 */
- HH (a, b, c, d, x[ 0], S31); /* 33 */
- HH (d, a, b, c, x[ 8], S32); /* 34 */
- HH (c, d, a, b, x[ 4], S33); /* 35 */
- HH (b, c, d, a, x[12], S34); /* 36 */
- HH (a, b, c, d, x[ 2], S31); /* 37 */
- HH (d, a, b, c, x[10], S32); /* 38 */
- HH (c, d, a, b, x[ 6], S33); /* 39 */
- HH (b, c, d, a, x[14], S34); /* 40 */
- HH (a, b, c, d, x[ 1], S31); /* 41 */
- HH (d, a, b, c, x[ 9], S32); /* 42 */
- HH (c, d, a, b, x[ 5], S33); /* 43 */
- HH (b, c, d, a, x[13], S34); /* 44 */
- HH (a, b, c, d, x[ 3], S31); /* 45 */
- HH (d, a, b, c, x[11], S32); /* 46 */
- HH (c, d, a, b, x[ 7], S33); /* 47 */
- HH (b, c, d, a, x[15], S34); /* 48 */
-
- state[0] += a;
- state[1] += b;
- state[2] += c;
- state[3] += d;
-
- /* Zeroize sensitive information. */
- std::memset(x, 0, sizeof(x));
-}
-
-
-void MD4Engine::encode(unsigned char* output, const UInt32* input, unsigned int len)
-{
- unsigned int i, j;
-
- for (i = 0, j = 0; j < len; i++, j += 4)
- {
- output[j] = (unsigned char)(input[i] & 0xff);
- output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
- output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
- output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
- }
-}
-
-
-void MD4Engine::decode(UInt32* output, const unsigned char* input, unsigned int len)
-{
- unsigned int i, j;
-
- for (i = 0, j = 0; j < len; i++, j += 4)
- output[i] = ((UInt32)input[j]) | (((UInt32)input[j+1]) << 8) |
- (((UInt32)input[j+2]) << 16) | (((UInt32)input[j+3]) << 24);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/MD5Engine.cpp b/Utilities/Poco/Foundation/src/MD5Engine.cpp
deleted file mode 100755
index 3b03ed17fd..0000000000
--- a/Utilities/Poco/Foundation/src/MD5Engine.cpp
+++ /dev/null
@@ -1,331 +0,0 @@
-//
-// MD5Engine.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: MD5Engine
-//
-// Copyright (c) 2004-2006, 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.
-//
-//
-// MD5 (RFC 1321) algorithm:
-// Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
-// rights reserved.
-//
-// License to copy and use this software is granted provided that it
-// is identified as the "RSA Data Security, Inc. MD5 Message-Digest
-// Algorithm" in all material mentioning or referencing this software
-// or this function.
-//
-// License is also granted to make and use derivative works provided
-// that such works are identified as "derived from the RSA Data
-// Security, Inc. MD5 Message-Digest Algorithm" in all material
-// mentioning or referencing the derived work.
-//
-// RSA Data Security, Inc. makes no representations concerning either
-// the merchantability of this software or the suitability of this
-// software for any particular purpose. It is provided "as is"
-// without express or implied warranty of any kind.
-//
-// These notices must be retained in any copies of any part of this
-// documentation and/or software.
-//
-
-
-#include "Poco/MD5Engine.h"
-#include <cstring>
-
-
-namespace Poco {
-
-
-MD5Engine::MD5Engine()
-{
- _digest.reserve(16);
- reset();
-}
-
-
-MD5Engine::~MD5Engine()
-{
- reset();
-}
-
-
-void MD5Engine::updateImpl(const void* input_, unsigned inputLen)
-{
- const unsigned char* input = (const unsigned char*) input_;
- unsigned int i, index, partLen;
-
- /* Compute number of bytes mod 64 */
- index = (unsigned int)((_context.count[0] >> 3) & 0x3F);
-
- /* Update number of bits */
- if ((_context.count[0] += ((UInt32) inputLen << 3)) < ((UInt32) inputLen << 3))
- _context.count[1]++;
- _context.count[1] += ((UInt32) inputLen >> 29);
-
- partLen = 64 - index;
-
- /* Transform as many times as possible. */
- if (inputLen >= partLen)
- {
- std::memcpy(&_context.buffer[index], input, partLen);
- transform(_context.state, _context.buffer);
-
- for (i = partLen; i + 63 < inputLen; i += 64)
- transform(_context.state, &input[i]);
-
- index = 0;
- }
- else i = 0;
-
- /* Buffer remaining input */
- std::memcpy(&_context.buffer[index], &input[i],inputLen-i);
-}
-
-
-unsigned MD5Engine::digestLength() const
-{
- return DIGEST_SIZE;
-}
-
-
-void MD5Engine::reset()
-{
- std::memset(&_context, 0, sizeof(_context));
- _context.count[0] = _context.count[1] = 0;
- _context.state[0] = 0x67452301;
- _context.state[1] = 0xefcdab89;
- _context.state[2] = 0x98badcfe;
- _context.state[3] = 0x10325476;
-}
-
-
-const DigestEngine::Digest& MD5Engine::digest()
-{
- static const unsigned char PADDING[64] =
- {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
- unsigned char bits[8];
- unsigned int index, padLen;
-
- /* Save number of bits */
- encode(bits, _context.count, 8);
-
- /* Pad out to 56 mod 64. */
- index = (unsigned int)((_context.count[0] >> 3) & 0x3f);
- padLen = (index < 56) ? (56 - index) : (120 - index);
- update(PADDING, padLen);
-
- /* Append length (before padding) */
- update(bits, 8);
-
- /* Store state in digest */
- unsigned char digest[16];
- encode(digest, _context.state, 16);
- _digest.clear();
- _digest.insert(_digest.begin(), digest, digest + sizeof(digest));
-
- /* Zeroize sensitive information. */
- std::memset(&_context, 0, sizeof (_context));
- reset();
- return _digest;
-}
-
-
-/* Constants for MD5Transform routine. */
-#define S11 7
-#define S12 12
-#define S13 17
-#define S14 22
-#define S21 5
-#define S22 9
-#define S23 14
-#define S24 20
-#define S31 4
-#define S32 11
-#define S33 16
-#define S34 23
-#define S41 6
-#define S42 10
-#define S43 15
-#define S44 21
-
-
-/* F, G, H and I are basic MD5 functions. */
-#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
-#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
-#define H(x, y, z) ((x) ^ (y) ^ (z))
-#define I(x, y, z) ((y) ^ ((x) | (~z)))
-
-
-/* ROTATE_LEFT rotates x left n bits. */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
-
-
-/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
- Rotation is separate from addition to prevent recomputation. */
-#define FF(a, b, c, d, x, s, ac) { \
- (a) += F ((b), (c), (d)) + (x) + (UInt32)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-#define GG(a, b, c, d, x, s, ac) { \
- (a) += G ((b), (c), (d)) + (x) + (UInt32)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-#define HH(a, b, c, d, x, s, ac) { \
- (a) += H ((b), (c), (d)) + (x) + (UInt32)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-#define II(a, b, c, d, x, s, ac) { \
- (a) += I ((b), (c), (d)) + (x) + (UInt32)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-
-
-void MD5Engine::transform (UInt32 state[4], const unsigned char block[64])
-{
- UInt32 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
-
- decode(x, block, 64);
-
- /* Round 1 */
- FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
- FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
- FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
- FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
- FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
- FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
- FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
- FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
- FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
- FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
- FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
- FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
- FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
- FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
- FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
- FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
-
- /* Round 2 */
- GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
- GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
- GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
- GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
- GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
- GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
- GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
- GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
- GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
- GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
- GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
- GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
- GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
- GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
- GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
- GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
-
- /* Round 3 */
- HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
- HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
- HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
- HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
- HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
- HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
- HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
- HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
- HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
- HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
- HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
- HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
- HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
- HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
- HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
- HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
-
- /* Round 4 */
- II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
- II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
- II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
- II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
- II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
- II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
- II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
- II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
- II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
- II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
- II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
- II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
- II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
- II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
- II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
- II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
-
- state[0] += a;
- state[1] += b;
- state[2] += c;
- state[3] += d;
-
- /* Zeroize sensitive information. */
- std::memset(x, 0, sizeof(x));
-}
-
-
-void MD5Engine::encode(unsigned char* output, const UInt32* input, unsigned int len)
-{
- unsigned int i, j;
-
- for (i = 0, j = 0; j < len; i++, j += 4)
- {
- output[j] = (unsigned char)(input[i] & 0xff);
- output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
- output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
- output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
- }
-}
-
-
-void MD5Engine::decode(UInt32* output, const unsigned char* input, unsigned int len)
-{
- unsigned int i, j;
-
- for (i = 0, j = 0; j < len; i++, j += 4)
- output[i] = ((UInt32)input[j]) | (((UInt32)input[j+1]) << 8) |
- (((UInt32)input[j+2]) << 16) | (((UInt32)input[j+3]) << 24);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/MSG00001.bin b/Utilities/Poco/Foundation/src/MSG00001.bin
deleted file mode 100755
index 45ecf37e0e..0000000000
Binary files a/Utilities/Poco/Foundation/src/MSG00001.bin and /dev/null differ
diff --git a/Utilities/Poco/Foundation/src/Manifest.cpp b/Utilities/Poco/Foundation/src/Manifest.cpp
deleted file mode 100755
index c72856f109..0000000000
--- a/Utilities/Poco/Foundation/src/Manifest.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Manifest.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: ClassLoader
-//
-// Copyright (c) 2004-2006, 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/Manifest.h"
-
-
-namespace Poco {
-
-
-ManifestBase::ManifestBase()
-{
-}
-
-
-ManifestBase::~ManifestBase()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/MemoryPool.cpp b/Utilities/Poco/Foundation/src/MemoryPool.cpp
deleted file mode 100755
index 2e84c5893a..0000000000
--- a/Utilities/Poco/Foundation/src/MemoryPool.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// MemoryPool.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: MemoryPool
-//
-// Copyright (c) 2005-2006, 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/MemoryPool.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-MemoryPool::MemoryPool(std::size_t blockSize, int preAlloc, int maxAlloc):
- _blockSize(blockSize),
- _maxAlloc(maxAlloc),
- _allocated(preAlloc)
-{
- poco_assert (maxAlloc == 0 || maxAlloc >= preAlloc);
- poco_assert (preAlloc >= 0 && maxAlloc >= 0);
-
- int r = BLOCK_RESERVE;
- if (preAlloc > r)
- r = preAlloc;
- if (maxAlloc > 0 && maxAlloc < r)
- r = maxAlloc;
- _blocks.reserve(r);
- for (int i = 0; i < preAlloc; ++i)
- {
- _blocks.push_back(new char[_blockSize]);
- }
-}
-
-
-MemoryPool::~MemoryPool()
-{
- for (BlockVec::iterator it = _blocks.begin(); it != _blocks.end(); ++it)
- {
- delete [] *it;
- }
-}
-
-
-void* MemoryPool::get()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_blocks.empty())
- {
- if (_maxAlloc == 0 || _allocated < _maxAlloc)
- {
- ++_allocated;
- return new char[_blockSize];
- }
- else throw OutOfMemoryException("MemoryPool exhausted");
- }
- else
- {
- char* ptr = _blocks.back();
- _blocks.pop_back();
- return ptr;
- }
-}
-
-
-void MemoryPool::release(void* ptr)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- _blocks.push_back(reinterpret_cast<char*>(ptr));
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Message.cpp b/Utilities/Poco/Foundation/src/Message.cpp
deleted file mode 100755
index 45b09c6a63..0000000000
--- a/Utilities/Poco/Foundation/src/Message.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-//
-// Message.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: Message
-//
-// Copyright (c) 2004-2006, 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/Message.h"
-#include "Poco/Exception.h"
-#include "Poco/Process.h"
-#include "Poco/Thread.h"
-#include <algorithm>
-
-
-namespace Poco {
-
-
-Message::Message():
- _prio(PRIO_FATAL),
- _tid(0),
- _pid(0),
- _pMap(0)
-{
- init();
-}
-
-
-Message::Message(const std::string& source, const std::string& text, Priority prio):
- _source(source),
- _text(text),
- _prio(prio),
- _tid(0),
- _pid(0),
- _pMap(0)
-{
- init();
-}
-
-
-Message::Message(const Message& msg):
- _source(msg._source),
- _text(msg._text),
- _prio(msg._prio),
- _time(msg._time),
- _tid(msg._tid),
- _thread(msg._thread),
- _pid(msg._pid)
-{
- if (msg._pMap)
- _pMap = new StringMap(*msg._pMap);
- else
- _pMap = 0;
-}
-
-
-Message::Message(const Message& msg, const std::string& text):
- _source(msg._source),
- _text(text),
- _prio(msg._prio),
- _time(msg._time),
- _tid(msg._tid),
- _thread(msg._thread),
- _pid(msg._pid)
-{
- if (msg._pMap)
- _pMap = new StringMap(*msg._pMap);
- else
- _pMap = 0;
-}
-
-
-Message::~Message()
-{
- delete _pMap;
-}
-
-
-void Message::init()
-{
- _pid = Process::id();
- Thread* pThread = Thread::current();
- if (pThread)
- {
- _tid = pThread->id();
- _thread = pThread->name();
- }
-}
-
-
-Message& Message::operator = (const Message& msg)
-{
- if (&msg != this)
- {
- Message tmp(msg);
- swap(tmp);
- }
- return *this;
-}
-
-
-void Message::swap(Message& msg)
-{
- using std::swap;
- swap(_source, msg._source);
- swap(_text, msg._text);
- swap(_prio, msg._prio);
- swap(_time, msg._time);
- swap(_tid, msg._tid);
- swap(_thread, msg._thread);
- swap(_pid, msg._pid);
- swap(_pMap, msg._pMap);
-}
-
-
-void Message::setSource(const std::string& src)
-{
- _source = src;
-}
-
-
-void Message::setText(const std::string& text)
-{
- _text = text;
-}
-
-
-void Message::setPriority(Priority prio)
-{
- _prio = prio;
-}
-
-
-void Message::setTime(const Timestamp& t)
-{
- _time = t;
-}
-
-
-void Message::setThread(const std::string& thread)
-{
- _thread = thread;
-}
-
-
-void Message::setTid(long tid)
-{
- _tid = tid;
-}
-
-
-void Message::setPid(long pid)
-{
- _pid = pid;
-}
-
-
-const std::string& Message::operator [] (const std::string& param) const
-{
- if (_pMap)
- return (*_pMap)[param];
- else
- throw NotFoundException();
-}
-
-
-std::string& Message::operator [] (const std::string& param)
-{
- if (!_pMap)
- _pMap = new StringMap;
- return (*_pMap)[param];
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Mutex.cpp b/Utilities/Poco/Foundation/src/Mutex.cpp
deleted file mode 100755
index 71fc350ded..0000000000
--- a/Utilities/Poco/Foundation/src/Mutex.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// Mutex.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Mutex
-//
-// Copyright (c) 2004-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/Mutex.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Mutex_WIN32.cpp"
-#else
-#include "Mutex_POSIX.cpp"
-#endif
-
-
-namespace Poco {
-
-
-Mutex::Mutex()
-{
-}
-
-
-Mutex::~Mutex()
-{
-}
-
-
-FastMutex::FastMutex()
-{
-}
-
-
-FastMutex::~FastMutex()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Mutex_POSIX.cpp b/Utilities/Poco/Foundation/src/Mutex_POSIX.cpp
deleted file mode 100755
index d2df8936b3..0000000000
--- a/Utilities/Poco/Foundation/src/Mutex_POSIX.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-//
-// Mutex_POSIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Mutex
-//
-// Copyright (c) 2004-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/Mutex_POSIX.h"
-#include "Poco/Timestamp.h"
-#if !defined(POCO_NO_SYS_SELECT_H)
-#include <sys/select.h>
-#endif
-#include <unistd.h>
-#include <sys/time.h>
-
-
-#if defined(_POSIX_TIMEOUTS) && (_POSIX_TIMEOUTS - 200112L) >= 0L
-#if defined(_POSIX_THREADS) && (_POSIX_THREADS - 200112L) >= 0L
-#define POCO_HAVE_MUTEX_TIMEOUT
-#endif
-#endif
-
-
-namespace Poco {
-
-
-MutexImpl::MutexImpl()
-{
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
-#if defined(PTHREAD_MUTEX_RECURSIVE_NP)
- pthread_mutexattr_settype_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
-#else
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-#endif
- if (pthread_mutex_init(&_mutex, &attr))
- {
- pthread_mutexattr_destroy(&attr);
- throw SystemException("cannot create mutex");
- }
- pthread_mutexattr_destroy(&attr);
-}
-
-
-MutexImpl::MutexImpl(bool fast)
-{
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
-#if defined(PTHREAD_MUTEX_RECURSIVE_NP)
- pthread_mutexattr_settype_np(&attr, fast ? PTHREAD_MUTEX_NORMAL_NP : PTHREAD_MUTEX_RECURSIVE_NP);
-#else
- pthread_mutexattr_settype(&attr, fast ? PTHREAD_MUTEX_NORMAL : PTHREAD_MUTEX_RECURSIVE);
-#endif
- if (pthread_mutex_init(&_mutex, &attr))
- {
- pthread_mutexattr_destroy(&attr);
- throw SystemException("cannot create mutex");
- }
- pthread_mutexattr_destroy(&attr);
-}
-
-
-MutexImpl::~MutexImpl()
-{
- pthread_mutex_destroy(&_mutex);
-}
-
-
-bool MutexImpl::tryLockImpl(long milliseconds)
-{
-#if defined(POCO_HAVE_MUTEX_TIMEOUT)
- struct timespec abstime;
- struct timeval tv;
- gettimeofday(&tv, NULL);
- abstime.tv_sec = tv.tv_sec + milliseconds / 1000;
- abstime.tv_nsec = tv.tv_usec*1000 + (milliseconds % 1000)*1000000;
- if (abstime.tv_nsec >= 1000000000)
- {
- abstime.tv_nsec -= 1000000000;
- abstime.tv_sec++;
- }
- int rc = pthread_mutex_timedlock(&_mutex, &abstime);
- if (rc == 0)
- return true;
- else if (rc == ETIMEDOUT)
- return false;
- else
- throw SystemException("cannot lock mutex");
-#else
- const int sleepMillis = 5;
- Timestamp now;
- Timestamp::TimeDiff diff(Timestamp::TimeDiff(milliseconds)*1000);
- do
- {
- int rc = pthread_mutex_trylock(&_mutex);
- if (rc == 0)
- return true;
- else if (rc != EBUSY)
- throw SystemException("cannot lock mutex");
- struct timeval tv;
- tv.tv_sec = 0;
- tv.tv_usec = sleepMillis * 1000;
- select(0, NULL, NULL, NULL, &tv);
- }
- while (!now.isElapsed(diff));
- return false;
-#endif
-}
-
-
-FastMutexImpl::FastMutexImpl(): MutexImpl(true)
-{
-}
-
-
-FastMutexImpl::~FastMutexImpl()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Mutex_WIN32.cpp b/Utilities/Poco/Foundation/src/Mutex_WIN32.cpp
deleted file mode 100755
index 37facfd914..0000000000
--- a/Utilities/Poco/Foundation/src/Mutex_WIN32.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// Mutex_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Mutex
-//
-// Copyright (c) 2004-2006, 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/Mutex_WIN32.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-
-
-MutexImpl::MutexImpl()
-{
- // the fct has a boolean return value under WInnNt/2000/XP but not on Win98
- // the return only checks if the input address of &_cs was valid, so it is safe to omit it
- InitializeCriticalSectionAndSpinCount(&_cs, 4000);
-}
-
-
-MutexImpl::~MutexImpl()
-{
- DeleteCriticalSection(&_cs);
-}
-
-
-bool MutexImpl::tryLockImpl(long milliseconds)
-{
- const int sleepMillis = 5;
- Timestamp now;
- Timestamp::TimeDiff diff(Timestamp::TimeDiff(milliseconds)*1000);
- do
- {
- try
- {
- if (TryEnterCriticalSection(&_cs) == TRUE)
- return true;
- }
- catch (...)
- {
- throw SystemException("cannot lock mutex");
- }
- Sleep(sleepMillis);
- }
- while (!now.isElapsed(diff));
- return false;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NamedEvent.cpp b/Utilities/Poco/Foundation/src/NamedEvent.cpp
deleted file mode 100755
index 6b6c63461b..0000000000
--- a/Utilities/Poco/Foundation/src/NamedEvent.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// NamedEvent.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedEvent
-//
-// Copyright (c) 2004-2006, 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/NamedEvent.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "NamedEvent_WIN32U.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "NamedEvent_WIN32.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "NamedEvent_UNIX.cpp"
-#else
-#include "NamedEvent_VMS.cpp"
-#endif
-
-
-namespace Poco {
-
-
-NamedEvent::NamedEvent(const std::string& name):
- NamedEventImpl(name)
-{
-}
-
-
-NamedEvent::~NamedEvent()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NamedEvent_UNIX.cpp b/Utilities/Poco/Foundation/src/NamedEvent_UNIX.cpp
deleted file mode 100755
index 1ae3634230..0000000000
--- a/Utilities/Poco/Foundation/src/NamedEvent_UNIX.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-//
-// NamedEvent_UNIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedEvent
-//
-// Copyright (c) 2004-2006, 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/NamedEvent_UNIX.h"
-#include "Poco/Exception.h"
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
-#include <semaphore.h>
-#else
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-#endif
-
-
-namespace Poco {
-
-
-#if defined(linux) || defined(__CYGWIN__)
- union semun
- {
- int val;
- struct semid_ds* buf;
- unsigned short int* array;
- struct seminfo* __buf;
- };
-#elif defined(__hpux)
- union semun
- {
- int val;
- struct semid_ds* buf;
- ushort* array;
- };
-#endif
-
-
-NamedEventImpl::NamedEventImpl(const std::string& name):
- _name(name)
-{
- std::string fileName = getFileName();
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- _sem = sem_open(fileName.c_str(), O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 0);
- if ((long) _sem == (long) SEM_FAILED)
- throw SystemException("cannot create named event (sem_open() failed)", _name);
-#else
- int fd = open(fileName.c_str(), O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
- if (fd != -1)
- close(fd);
- else
- throw SystemException("cannot create named event (lockfile)", _name);
- key_t key = ftok(fileName.c_str(), 0);
- if (key == -1)
- throw SystemException("cannot create named event (ftok() failed)", _name);
- _semid = semget(key, 1, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH | IPC_CREAT | IPC_EXCL);
- if (_semid >= 0)
- {
- union semun arg;
- arg.val = 0;
- semctl(_semid, 0, SETVAL, arg);
- }
- else if (errno == EEXIST)
- {
- _semid = semget(key, 1, 0);
- }
- else throw SystemException("cannot create named event (semget() failed)", _name);
-#endif // defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
-}
-
-
-NamedEventImpl::~NamedEventImpl()
-{
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- sem_close(_sem);
-#endif
-}
-
-
-void NamedEventImpl::setImpl()
-{
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- if (sem_post(_sem) != 0)
- throw SystemException("cannot set named event", _name);
-#else
- struct sembuf op;
- op.sem_num = 0;
- op.sem_op = 1;
- op.sem_flg = 0;
- if (semop(_semid, &op, 1) != 0)
- throw SystemException("cannot set named event", _name);
-#endif
-}
-
-
-void NamedEventImpl::waitImpl()
-{
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- int err;
- do
- {
- err = sem_wait(_sem);
- }
- while (err && errno == EINTR);
- if (err) throw SystemException("cannot wait for named event", _name);
-#else
- struct sembuf op;
- op.sem_num = 0;
- op.sem_op = -1;
- op.sem_flg = 0;
- int err;
- do
- {
- err = semop(_semid, &op, 1);
- }
- while (err && errno == EINTR);
- if (err) throw SystemException("cannot wait for named event", _name);
-#endif
-}
-
-
-std::string NamedEventImpl::getFileName()
-{
-#if defined(sun) || defined(__APPLE__) || defined(__QNX__)
- std::string fn = "/";
-#else
- std::string fn = "/tmp/";
-#endif
- fn.append(_name);
- fn.append(".event");
- return fn;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NamedEvent_VMS.cpp b/Utilities/Poco/Foundation/src/NamedEvent_VMS.cpp
deleted file mode 100755
index 33b346bae5..0000000000
--- a/Utilities/Poco/Foundation/src/NamedEvent_VMS.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// NamedEvent_VMS.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedEvent
-//
-// Copyright (c) 2004-2006, 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/NamedEvent_VMS.h"
-#include <lib$routines.h>
-#include <starlet.h>
-#include <descrip.h>
-#include <iodef.h>
-
-
-namespace Poco {
-
-
-NamedEventImpl::NamedEventImpl(const std::string& name):
- _name(name)
-{
- struct dsc$descriptor_s mbxDesc;
- mbxDesc.dsc$w_length = _name.length();
- mbxDesc.dsc$b_dtype = DSC$K_DTYPE_T;
- mbxDesc.dsc$b_class = DSC$K_CLASS_S;
- mbxDesc.dsc$a_pointer = _name.c_str();
- if (sys$crembx(0, &_mbxChan, 0, 0, 0, 0, &mbxDesc, 0, 0) != 1)
- throw SystemException("cannot create named event", _name);
-}
-
-
-NamedEventImpl::~NamedEventImpl()
-{
- sys$dassgn(_mbxChan);
-}
-
-
-void NamedEventImpl::setImpl()
-{
- char buffer = 0xFF;
- if (sys$qio(0, _mbxChan, IO$_WRITEVBLK, 0, 0, 0, &buffer, sizeof(buffer), 0, 0, 0, 0) != 1)
- throw SystemException("cannot set named event", _name);
-}
-
-
-void NamedEventImpl::waitImpl()
-{
- char buffer = 0;
- while (buffer == 0)
- {
- if (sys$qiow(0, _mbxChan, IO$_READVBLK, 0, 0, 0, &buffer, sizeof(buffer), 0, 0, 0, 0) != 1)
- throw SystemException("cannot wait for named event", _name);
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NamedEvent_WIN32.cpp b/Utilities/Poco/Foundation/src/NamedEvent_WIN32.cpp
deleted file mode 100755
index 19f8c8777d..0000000000
--- a/Utilities/Poco/Foundation/src/NamedEvent_WIN32.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// NamedEvent_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedEvent
-//
-// Copyright (c) 2004-2006, 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/NamedEvent_WIN32.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-NamedEventImpl::NamedEventImpl(const std::string& name):
- _name(name)
-{
- _event = CreateEventA(NULL, FALSE, FALSE, _name.c_str());
- if (!_event)
- throw SystemException("cannot create named event", _name);
-}
-
-
-NamedEventImpl::~NamedEventImpl()
-{
- CloseHandle(_event);
-}
-
-
-void NamedEventImpl::setImpl()
-{
- if (!SetEvent(_event))
- throw SystemException("cannot signal named event", _name);
-}
-
-
-void NamedEventImpl::waitImpl()
-{
- switch (WaitForSingleObject(_event, INFINITE))
- {
- case WAIT_OBJECT_0:
- return;
- default:
- throw SystemException("wait for named event failed", _name);
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NamedEvent_WIN32U.cpp b/Utilities/Poco/Foundation/src/NamedEvent_WIN32U.cpp
deleted file mode 100755
index 2207470d55..0000000000
--- a/Utilities/Poco/Foundation/src/NamedEvent_WIN32U.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// NamedEvent_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedEvent
-//
-// Copyright (c) 2004-2006, 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/NamedEvent_WIN32U.h"
-#include "Poco/Exception.h"
-#include "Poco/UnicodeConverter.h"
-
-
-namespace Poco {
-
-
-NamedEventImpl::NamedEventImpl(const std::string& name):
- _name(name)
-{
- UnicodeConverter::toUTF16(_name, _uname);
- _event = CreateEventW(NULL, FALSE, FALSE, _uname.c_str());
- if (!_event)
- throw SystemException("cannot create named event", _name);
-}
-
-
-NamedEventImpl::~NamedEventImpl()
-{
- CloseHandle(_event);
-}
-
-
-void NamedEventImpl::setImpl()
-{
- if (!SetEvent(_event))
- throw SystemException("cannot signal named event", _name);
-}
-
-
-void NamedEventImpl::waitImpl()
-{
- switch (WaitForSingleObject(_event, INFINITE))
- {
- case WAIT_OBJECT_0:
- return;
- default:
- throw SystemException("wait for named event failed", _name);
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NamedMutex.cpp b/Utilities/Poco/Foundation/src/NamedMutex.cpp
deleted file mode 100755
index 4c2690a365..0000000000
--- a/Utilities/Poco/Foundation/src/NamedMutex.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// NamedMutex.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedMutex
-//
-// Copyright (c) 2004-2006, 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/NamedMutex.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "NamedMutex_WIN32U.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "NamedMutex_WIN32.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "NamedMutex_UNIX.cpp"
-#else
-#include "NamedMutex_VMS.cpp"
-#endif
-
-
-namespace Poco {
-
-
-NamedMutex::NamedMutex(const std::string& name):
- NamedMutexImpl(name)
-{
-}
-
-
-NamedMutex::~NamedMutex()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NamedMutex_UNIX.cpp b/Utilities/Poco/Foundation/src/NamedMutex_UNIX.cpp
deleted file mode 100755
index 2376244bd7..0000000000
--- a/Utilities/Poco/Foundation/src/NamedMutex_UNIX.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-//
-// NamedMutex_UNIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedMutex
-//
-// Copyright (c) 2004-2006, 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/NamedMutex_UNIX.h"
-#include "Poco/Exception.h"
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(_AIX)
-#include <semaphore.h>
-#else
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-#endif
-
-
-namespace Poco {
-
-
-#if defined(linux) || defined(__CYGWIN__)
- union semun
- {
- int val;
- struct semid_ds* buf;
- unsigned short int* array;
- struct seminfo* __buf;
- };
-#elif defined(__hpux)
- union semun
- {
- int val;
- struct semid_ds* buf;
- ushort* array;
- };
-#endif
-
-
-NamedMutexImpl::NamedMutexImpl(const std::string& name):
- _name(name)
-{
- std::string fileName = getFileName();
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- _sem = sem_open(fileName.c_str(), O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 1);
- if ((long) _sem == (long) SEM_FAILED)
- throw SystemException("cannot create named mutex (sem_open() failed)", _name);
-#else
- int fd = open(fileName.c_str(), O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
- if (fd != -1)
- close(fd);
- else
- throw SystemException("cannot create named mutex (lockfile)", _name);
- key_t key = ftok(fileName.c_str(), 0);
- if (key == -1)
- throw SystemException("cannot create named mutex (ftok() failed)", _name);
- _semid = semget(key, 1, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH | IPC_CREAT | IPC_EXCL);
- if (_semid >= 0)
- {
- union semun arg;
- arg.val = 1;
- semctl(_semid, 0, SETVAL, arg);
- }
- else if (errno == EEXIST)
- {
- _semid = semget(key, 1, 0);
- }
- else throw SystemException("cannot create named mutex (semget() failed)", _name);
-#endif // defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
-}
-
-
-NamedMutexImpl::~NamedMutexImpl()
-{
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- sem_close(_sem);
-#endif
-}
-
-
-void NamedMutexImpl::lockImpl()
-{
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- int err;
- do
- {
- err = sem_wait(_sem);
- }
- while (err && errno == EINTR);
- if (err) throw SystemException("cannot lock named mutex", _name);
-#else
- struct sembuf op;
- op.sem_num = 0;
- op.sem_op = -1;
- op.sem_flg = SEM_UNDO;
- int err;
- do
- {
- err = semop(_semid, &op, 1);
- }
- while (err && errno == EINTR);
- if (err) throw SystemException("cannot lock named mutex", _name);
-#endif
-}
-
-
-bool NamedMutexImpl::tryLockImpl()
-{
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- return sem_trywait(_sem) == 0;
-#else
- struct sembuf op;
- op.sem_num = 0;
- op.sem_op = -1;
- op.sem_flg = SEM_UNDO | IPC_NOWAIT;
- return semop(_semid, &op, 1) == 0;
-#endif
-}
-
-
-void NamedMutexImpl::unlockImpl()
-{
-#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX)
- if (sem_post(_sem) != 0)
- throw SystemException("cannot unlock named mutex", _name);
-#else
- struct sembuf op;
- op.sem_num = 0;
- op.sem_op = 1;
- op.sem_flg = SEM_UNDO;
- if (semop(_semid, &op, 1) != 0)
- throw SystemException("cannot unlock named mutex", _name);
-#endif
-}
-
-
-std::string NamedMutexImpl::getFileName()
-{
-#if defined(sun) || defined(__APPLE__) || defined(__QNX__)
- std::string fn = "/";
-#else
- std::string fn = "/tmp/";
-#endif
- fn.append(_name);
- fn.append(".mutex");
- return fn;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NamedMutex_VMS.cpp b/Utilities/Poco/Foundation/src/NamedMutex_VMS.cpp
deleted file mode 100755
index 0f32270295..0000000000
--- a/Utilities/Poco/Foundation/src/NamedMutex_VMS.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// NamedMutex_VMS.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedMutex
-//
-// Copyright (c) 2004-2006, 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/NamedMutex_VMS.h"
-#include <starlet.h>
-#include <iodef.h>
-
-
-namespace Poco {
-
-
-NamedMutexImpl::NamedMutexImpl(const std::string& name):
- _name(name)
-{
- _nameDesc.dsc$w_length = _name.length();
- _nameDesc.dsc$b_dtype = DSC$K_DTYPE_T;
- _nameDesc.dsc$b_class = DSC$K_CLASS_S;
- _nameDesc.dsc$a_pointer = _name.data();
- int status = sys$enqw(0, LCK$K_NLMODE, (struct _lksb*) &_lksb, 0, &_nameDesc, 0, 0, 0, 0, 0, 0);
- if (status != 1)
- throw SystemException("cannot create named mutex", _name);
-}
-
-
-NamedMutexImpl::~NamedMutexImpl()
-{
- sys$deq(m_lksb[1], 0, 0, 0);
-}
-
-
-void NamedMutexImpl::lockImpl()
-{
- int status = sys$enqw(0, LCK$K_EXMODE, (struct _lksb*) &_lksb, LCK$M_CONVERT, &_nameDesc, 0, 0, 0, 0, 0, 0);
- if (status != 1)
- throw SystemException("cannot lock named mutex", _name);
-}
-
-
-bool NamedMutexImpl::tryLockImpl()
-{
- int status = sys$enqw(0, LCK$K_EXMODE, (struct _lksb*) &_lksb, LCK$M_CONVERT | LCK$M_NOQUEUE, &_nameDesc, 0, 0, 0, 0, 0, 0);
- return status == 1;
-}
-
-
-void NamedMutexImpl::unlockImpl()
-{
- int status = sys$enqw(0, LCK$K_NLMODE, (struct _lksb*) &_lksb, LCK$M_CONVERT, &_nameDesc, 0, 0, 0, 0, 0, 0);
- if (status != 1)
- throw SystemException("cannot unlock named mutex", _name);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NamedMutex_WIN32.cpp b/Utilities/Poco/Foundation/src/NamedMutex_WIN32.cpp
deleted file mode 100755
index 6f93d102aa..0000000000
--- a/Utilities/Poco/Foundation/src/NamedMutex_WIN32.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// NamedMutex_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedMutex
-//
-// Copyright (c) 2004-2006, 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/NamedMutex_WIN32.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-NamedMutexImpl::NamedMutexImpl(const std::string& name):
- _name(name)
-{
- _mutex = CreateMutexA(NULL, FALSE, _name.c_str());
- if (!_mutex)
- throw SystemException("cannot create named mutex", _name);
-}
-
-
-NamedMutexImpl::~NamedMutexImpl()
-{
- CloseHandle(_mutex);
-}
-
-
-void NamedMutexImpl::lockImpl()
-{
- switch (WaitForSingleObject(_mutex, INFINITE))
- {
- case WAIT_OBJECT_0:
- return;
- case WAIT_ABANDONED:
- throw SystemException("cannot lock named mutex (abadoned)", _name);
- default:
- throw SystemException("cannot lock named mutex", _name);
- }
-}
-
-
-bool NamedMutexImpl::tryLockImpl()
-{
- switch (WaitForSingleObject(_mutex, 0))
- {
- case WAIT_OBJECT_0:
- return true;
- case WAIT_TIMEOUT:
- return false;
- case WAIT_ABANDONED:
- throw SystemException("cannot lock named mutex (abadoned)", _name);
- default:
- throw SystemException("cannot lock named mutex", _name);
- }
-}
-
-
-void NamedMutexImpl::unlockImpl()
-{
- ReleaseMutex(_mutex);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NamedMutex_WIN32U.cpp b/Utilities/Poco/Foundation/src/NamedMutex_WIN32U.cpp
deleted file mode 100755
index c327a4333a..0000000000
--- a/Utilities/Poco/Foundation/src/NamedMutex_WIN32U.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// NamedMutex_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: NamedMutex
-//
-// Copyright (c) 2004-2006, 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/NamedMutex_WIN32U.h"
-#include "Poco/Exception.h"
-#include "Poco/UnicodeConverter.h"
-
-
-namespace Poco {
-
-
-NamedMutexImpl::NamedMutexImpl(const std::string& name):
- _name(name)
-{
- UnicodeConverter::toUTF16(_name, _uname);
- _mutex = CreateMutexW(NULL, FALSE, _uname.c_str());
- if (!_mutex)
- throw SystemException("cannot create named mutex", _name);
-}
-
-
-NamedMutexImpl::~NamedMutexImpl()
-{
- CloseHandle(_mutex);
-}
-
-
-void NamedMutexImpl::lockImpl()
-{
- switch (WaitForSingleObject(_mutex, INFINITE))
- {
- case WAIT_OBJECT_0:
- return;
- case WAIT_ABANDONED:
- throw SystemException("cannot lock named mutex (abadoned)", _name);
- default:
- throw SystemException("cannot lock named mutex", _name);
- }
-}
-
-
-bool NamedMutexImpl::tryLockImpl()
-{
- switch (WaitForSingleObject(_mutex, 0))
- {
- case WAIT_OBJECT_0:
- return true;
- case WAIT_TIMEOUT:
- return false;
- case WAIT_ABANDONED:
- throw SystemException("cannot lock named mutex (abadoned)", _name);
- default:
- throw SystemException("cannot lock named mutex", _name);
- }
-}
-
-
-void NamedMutexImpl::unlockImpl()
-{
- ReleaseMutex(_mutex);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NestedDiagnosticContext.cpp b/Utilities/Poco/Foundation/src/NestedDiagnosticContext.cpp
deleted file mode 100755
index 7d6b0bf961..0000000000
--- a/Utilities/Poco/Foundation/src/NestedDiagnosticContext.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-//
-// NestedDiagnosticContext.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: NestedDiagnosticContext
-//
-// Copyright (c) 2004-2006, 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/NestedDiagnosticContext.h"
-#include "Poco/SingletonHolder.h"
-#include "Poco/ThreadLocal.h"
-
-
-namespace Poco {
-
-
-NestedDiagnosticContext::NestedDiagnosticContext()
-{
-}
-
-
-NestedDiagnosticContext::NestedDiagnosticContext(const NestedDiagnosticContext& ctx)
-{
- _stack = ctx._stack;
-}
-
-
-NestedDiagnosticContext::~NestedDiagnosticContext()
-{
-}
-
-
-NestedDiagnosticContext& NestedDiagnosticContext::operator = (const NestedDiagnosticContext& ctx)
-{
- if (&ctx != this)
- _stack = ctx._stack;
- return *this;
-}
-
-
-void NestedDiagnosticContext::push(const std::string& info)
-{
- Context ctx;
- ctx.info = info;
- ctx.line = -1;
- ctx.file = 0;
- _stack.push_back(ctx);
-}
-
-
-void NestedDiagnosticContext::push(const std::string& info, int line, const char* filename)
-{
- Context ctx;
- ctx.info = info;
- ctx.line = line;
- ctx.file = filename;
- _stack.push_back(ctx);
-}
-
-
-void NestedDiagnosticContext::pop()
-{
- if (!_stack.empty())
- _stack.pop_back();
-}
-
-
-int NestedDiagnosticContext::depth() const
-{
- return int(_stack.size());
-}
-
-
-std::string NestedDiagnosticContext::toString() const
-{
- std::string result;
- for (Stack::const_iterator it = _stack.begin(); it != _stack.end(); ++it)
- {
- if (!result.empty())
- result.append(":");
- result.append(it->info);
- }
- return result;
-}
-
-
-void NestedDiagnosticContext::dump(std::ostream& ostr) const
-{
- dump(ostr, "\n");
-}
-
-
-void NestedDiagnosticContext::dump(std::ostream& ostr, const std::string& delimiter) const
-{
- for (Stack::const_iterator it = _stack.begin(); it != _stack.end(); ++it)
- {
- ostr << it->info;
- if (it->file)
- ostr << " (in \"" << it->file << "\", line " << it->line << ")";
- ostr << delimiter;
- }
-}
-
-
-void NestedDiagnosticContext::clear()
-{
- _stack.clear();
-}
-
-
-NestedDiagnosticContext& NestedDiagnosticContext::current()
-{
- static ThreadLocal<NestedDiagnosticContext> ndc;
- return ndc.get();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Notification.cpp b/Utilities/Poco/Foundation/src/Notification.cpp
deleted file mode 100755
index 881be4e4ee..0000000000
--- a/Utilities/Poco/Foundation/src/Notification.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// Notification.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: Notification
-//
-// Copyright (c) 2004-2006, 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/Notification.h"
-#include <typeinfo>
-
-
-namespace Poco {
-
-
-Notification::Notification()
-{
-}
-
-
-Notification::~Notification()
-{
-}
-
-
-std::string Notification::name() const
-{
- return typeid(*this).name();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NotificationCenter.cpp b/Utilities/Poco/Foundation/src/NotificationCenter.cpp
deleted file mode 100755
index 1ea60e0969..0000000000
--- a/Utilities/Poco/Foundation/src/NotificationCenter.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// NotificationCenter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: NotificationCenter
-//
-// Copyright (c) 2004-2006, 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/NotificationCenter.h"
-#include "Poco/Notification.h"
-#include "Poco/Observer.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/SingletonHolder.h"
-
-
-namespace Poco {
-
-
-NotificationCenter::NotificationCenter()
-{
-}
-
-
-NotificationCenter::~NotificationCenter()
-{
- for (ObserverList::iterator it = _observers.begin(); it != _observers.end(); ++it)
- {
- delete *it;
- }
-}
-
-
-void NotificationCenter::addObserver(const AbstractObserver& observer)
-{
- Mutex::ScopedLock lock(_mutex);
- _observers.push_front(observer.clone());
-}
-
-
-void NotificationCenter::removeObserver(const AbstractObserver& observer)
-{
- Mutex::ScopedLock lock(_mutex);
- for (ObserverList::iterator it = _observers.begin(); it != _observers.end(); ++it)
- {
- if (*it && observer.equals(**it))
- {
- delete *it;
- *it = 0;
- return;
- }
- }
-}
-
-
-void NotificationCenter::postNotification(Notification::Ptr pNotification)
-{
- poco_check_ptr (pNotification);
-
- Mutex::ScopedLock lock(_mutex);
- ObserverList::iterator it = _observers.begin();
- while (it != _observers.end())
- {
- ObserverList::iterator cur = it++;
- if (*cur)
- {
- (*cur)->notify(pNotification);
- }
- else
- {
- _observers.erase(cur);
- }
- }
-}
-
-
-bool NotificationCenter::hasObservers() const
-{
- Mutex::ScopedLock lock(_mutex);
-
- ObserverList::const_iterator it = _observers.begin();
- while (it != _observers.end())
- {
- if (*it) return true;
- ++it;
- }
- return false;
-}
-
-
-NotificationCenter& NotificationCenter::defaultCenter()
-{
- static SingletonHolder<NotificationCenter> sh;
- return *sh.get();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NotificationQueue.cpp b/Utilities/Poco/Foundation/src/NotificationQueue.cpp
deleted file mode 100755
index 92ce96e734..0000000000
--- a/Utilities/Poco/Foundation/src/NotificationQueue.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-//
-// NotificationQueue.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: NotificationQueue
-//
-// Copyright (c) 2004-2006, 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/NotificationQueue.h"
-#include "Poco/NotificationCenter.h"
-#include "Poco/Notification.h"
-#include "Poco/SingletonHolder.h"
-
-
-namespace Poco {
-
-
-NotificationQueue::NotificationQueue()
-{
-}
-
-
-NotificationQueue::~NotificationQueue()
-{
- clear();
-}
-
-
-void NotificationQueue::enqueueNotification(Notification::Ptr pNotification)
-{
- poco_check_ptr (pNotification);
- FastMutex::ScopedLock lock(_mutex);
- if (_waitQueue.empty())
- {
- _nfQueue.push_back(pNotification);
- }
- else
- {
- WaitInfo* pWI = _waitQueue.front();
- _waitQueue.pop_front();
- pWI->pNf = pNotification;
- pWI->nfAvailable.set();
- }
-}
-
-
-void NotificationQueue::enqueueUrgentNotification(Notification::Ptr pNotification)
-{
- poco_check_ptr (pNotification);
- FastMutex::ScopedLock lock(_mutex);
- if (_waitQueue.empty())
- {
- _nfQueue.push_front(pNotification);
- }
- else
- {
- WaitInfo* pWI = _waitQueue.front();
- _waitQueue.pop_front();
- pWI->pNf = pNotification;
- pWI->nfAvailable.set();
- }
-}
-
-
-Notification* NotificationQueue::dequeueNotification()
-{
- FastMutex::ScopedLock lock(_mutex);
- return dequeueOne().duplicate();
-}
-
-
-Notification* NotificationQueue::waitDequeueNotification()
-{
- Notification::Ptr pNf;
- WaitInfo* pWI = 0;
- {
- FastMutex::ScopedLock lock(_mutex);
- pNf = dequeueOne();
- if (pNf) return pNf.duplicate();
- pWI = new WaitInfo;
- _waitQueue.push_back(pWI);
- }
- pWI->nfAvailable.wait();
- pNf = pWI->pNf;
- delete pWI;
- return pNf.duplicate();
-}
-
-
-Notification* NotificationQueue::waitDequeueNotification(long milliseconds)
-{
- Notification::Ptr pNf;
- WaitInfo* pWI = 0;
- {
- FastMutex::ScopedLock lock(_mutex);
- pNf = dequeueOne();
- if (pNf) return pNf.duplicate();
- pWI = new WaitInfo;
- _waitQueue.push_back(pWI);
- }
- if (pWI->nfAvailable.tryWait(milliseconds))
- {
- pNf = pWI->pNf;
- }
- else
- {
- FastMutex::ScopedLock lock(_mutex);
- pNf = pWI->pNf;
- for (WaitQueue::iterator it = _waitQueue.begin(); it != _waitQueue.end(); ++it)
- {
- if (*it == pWI)
- {
- _waitQueue.erase(it);
- break;
- }
- }
- }
- delete pWI;
- return pNf.duplicate();
-}
-
-
-void NotificationQueue::dispatch(NotificationCenter& notificationCenter)
-{
- FastMutex::ScopedLock lock(_mutex);
- Notification::Ptr pNf = dequeueOne();
- while (pNf)
- {
- notificationCenter.postNotification(pNf);
- pNf = dequeueOne();
- }
-}
-
-
-void NotificationQueue::wakeUpAll()
-{
- FastMutex::ScopedLock lock(_mutex);
- for (WaitQueue::iterator it = _waitQueue.begin(); it != _waitQueue.end(); ++it)
- {
- (*it)->nfAvailable.set();
- }
- _waitQueue.clear();
-}
-
-
-bool NotificationQueue::empty() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return _nfQueue.empty();
-}
-
-
-int NotificationQueue::size() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return static_cast<int>(_nfQueue.size());
-}
-
-
-void NotificationQueue::clear()
-{
- FastMutex::ScopedLock lock(_mutex);
- _nfQueue.clear();
-}
-
-
-bool NotificationQueue::hasIdleThreads() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return !_waitQueue.empty();
-}
-
-
-Notification::Ptr NotificationQueue::dequeueOne()
-{
- Notification::Ptr pNf;
- if (!_nfQueue.empty())
- {
- pNf = _nfQueue.front();
- _nfQueue.pop_front();
- }
- return pNf;
-}
-
-
-NotificationQueue& NotificationQueue::defaultQueue()
-{
- static SingletonHolder<NotificationQueue> sh;
- return *sh.get();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NullChannel.cpp b/Utilities/Poco/Foundation/src/NullChannel.cpp
deleted file mode 100755
index c3e8d62e04..0000000000
--- a/Utilities/Poco/Foundation/src/NullChannel.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// NullChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: NullChannel
-//
-// Copyright (c) 2004-2006, 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/NullChannel.h"
-
-
-namespace Poco {
-
-
-NullChannel::NullChannel()
-{
-}
-
-
-NullChannel::~NullChannel()
-{
-}
-
-
-void NullChannel::log(const Message&)
-{
-}
-
-
-void NullChannel::setProperty(const std::string&, const std::string&)
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NullStream.cpp b/Utilities/Poco/Foundation/src/NullStream.cpp
deleted file mode 100755
index 6efa81513b..0000000000
--- a/Utilities/Poco/Foundation/src/NullStream.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// NullStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: NullStream
-//
-// Copyright (c) 2004-2006, 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/NullStream.h"
-
-
-namespace Poco {
-
-
-NullStreamBuf::NullStreamBuf()
-{
-}
-
-
-NullStreamBuf::~NullStreamBuf()
-{
-}
-
-
-int NullStreamBuf::readFromDevice()
-{
- return -1;
-}
-
-
-int NullStreamBuf::writeToDevice(char c)
-{
- return charToInt(c);
-}
-
-
-NullIOS::NullIOS()
-{
- poco_ios_init(&_buf);
-}
-
-
-NullIOS::~NullIOS()
-{
-}
-
-
-NullInputStream::NullInputStream(): std::istream(&_buf)
-{
-}
-
-
-NullInputStream::~NullInputStream()
-{
-}
-
-
-NullOutputStream::NullOutputStream(): std::ostream(&_buf)
-{
-}
-
-
-NullOutputStream::~NullOutputStream()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NumberFormatter.cpp b/Utilities/Poco/Foundation/src/NumberFormatter.cpp
deleted file mode 100755
index 29eec11326..0000000000
--- a/Utilities/Poco/Foundation/src/NumberFormatter.cpp
+++ /dev/null
@@ -1,384 +0,0 @@
-//
-// NumberFormatter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: NumberFormatter
-//
-// Copyright (c) 2004-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/NumberFormatter.h"
-#include <cstdio>
-#include <cctype>
-
-
-#if defined(_MSC_VER)
- #define I64_FMT "I64"
-#elif defined(__APPLE__)
- #define I64_FMT "q"
-#else
- #define I64_FMT "ll"
-#endif
-
-
-namespace Poco {
-
-
-void NumberFormatter::append(std::string& str, int value)
-{
- char buffer[64];
- std::sprintf(buffer, "%d", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, int value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%*d", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append0(std::string& str, int value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*d", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, int value)
-{
- char buffer[64];
- std::sprintf(buffer, "%X", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, int value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*X", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, unsigned value)
-{
- char buffer[64];
- std::sprintf(buffer, "%u", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, unsigned value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%*u", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append0(std::string& str, unsigned int value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*u", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, unsigned value)
-{
- char buffer[64];
- std::sprintf(buffer, "%X", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, unsigned value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*X", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, long value)
-{
- char buffer[64];
- std::sprintf(buffer, "%ld", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, long value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%*ld", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append0(std::string& str, long value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*ld", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, long value)
-{
- char buffer[64];
- std::sprintf(buffer, "%lX", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, long value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*lX", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, unsigned long value)
-{
- char buffer[64];
- std::sprintf(buffer, "%lu", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, unsigned long value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%*lu", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append0(std::string& str, unsigned long value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*lu", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, unsigned long value)
-{
- char buffer[64];
- std::sprintf(buffer, "%lX", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, unsigned long value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*lX", width, value);
- str.append(buffer);
-}
-
-
-#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
-
-
-void NumberFormatter::append(std::string& str, Int64 value)
-{
- char buffer[64];
- std::sprintf(buffer, "%"I64_FMT"d", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, Int64 value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%*"I64_FMT"d", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append0(std::string& str, Int64 value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*"I64_FMT"d", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, Int64 value)
-{
- char buffer[64];
- std::sprintf(buffer, "%"I64_FMT"X", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, Int64 value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*"I64_FMT"X", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, UInt64 value)
-{
- char buffer[64];
- std::sprintf(buffer, "%"I64_FMT"u", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, UInt64 value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%*"I64_FMT"u", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append0(std::string& str, UInt64 value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*"I64_FMT"u", width, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, UInt64 value)
-{
- char buffer[64];
- std::sprintf(buffer, "%"I64_FMT"X", value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::appendHex(std::string& str, UInt64 value, int width)
-{
- poco_assert (width > 0 && width < 64);
-
- char buffer[64];
- std::sprintf(buffer, "%0*"I64_FMT"X", width, value);
- str.append(buffer);
-}
-
-
-#endif // defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
-
-
-void NumberFormatter::append(std::string& str, float value)
-{
- char buffer[64];
- std::sprintf(buffer, "%.*g", 8, (double) value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, double value)
-{
- char buffer[64];
- std::sprintf(buffer, "%.*g", 16, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, double value, int precision)
-{
- poco_assert (precision >= 0 && precision < 32);
-
- char buffer[64];
- std::sprintf(buffer, "%.*f", precision, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, double value, int width, int precision)
-{
- poco_assert (width > 0 && width < 64 && precision >= 0 && precision < width);
-
- char buffer[64];
- std::sprintf(buffer, "%*.*f", width, precision, value);
- str.append(buffer);
-}
-
-
-void NumberFormatter::append(std::string& str, const void* ptr)
-{
- char buffer[24];
-#if defined(POCO_PTR_IS_64_BIT)
- std::sprintf(buffer, "%016"I64_FMT"X", (UIntPtr) ptr);
-#else
- std::sprintf(buffer, "%08lX", (UIntPtr) ptr);
-#endif
- str.append(buffer);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/NumberParser.cpp b/Utilities/Poco/Foundation/src/NumberParser.cpp
deleted file mode 100755
index 5257366d44..0000000000
--- a/Utilities/Poco/Foundation/src/NumberParser.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-//
-// NumberParser.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: NumberParser
-//
-// Copyright (c) 2004-2006, 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/NumberParser.h"
-#include "Poco/Exception.h"
-#include <cstdio>
-#include <cctype>
-
-
-#if defined(_MSC_VER)
- #define I64_FMT "I64"
-#elif defined(__APPLE__)
- #define I64_FMT "q"
-#else
- #define I64_FMT "ll"
-#endif
-
-
-namespace Poco {
-
-
-int NumberParser::parse(const std::string& s)
-{
- int result;
- if (tryParse(s, result))
- return result;
- else
- throw SyntaxException("Not a valid integer", s);
-}
-
-
-bool NumberParser::tryParse(const std::string& s, int& value)
-{
- char temp;
- return std::sscanf(s.c_str(), "%d%c", &value, &temp) == 1;
-}
-
-
-unsigned NumberParser::parseUnsigned(const std::string& s)
-{
- unsigned result;
- if (tryParseUnsigned(s, result))
- return result;
- else
- throw SyntaxException("Not a valid unsigned integer", s);
-}
-
-
-bool NumberParser::tryParseUnsigned(const std::string& s, unsigned& value)
-{
- char temp;
- return std::sscanf(s.c_str(), "%u%c", &value, &temp) == 1;
-}
-
-
-unsigned NumberParser::parseHex(const std::string& s)
-{
- unsigned result;
- if (tryParseHex(s, result))
- return result;
- else
- throw SyntaxException("Not a valid hexadecimal integer", s);
-}
-
-
-bool NumberParser::tryParseHex(const std::string& s, unsigned& value)
-{
- char temp;
- return std::sscanf(s.c_str(), "%x%c", &value, &temp) == 1;
-}
-
-
-#if defined(POCO_HAVE_INT64)
-
-
-Int64 NumberParser::parse64(const std::string& s)
-{
- Int64 result;
- if (tryParse64(s, result))
- return result;
- else
- throw SyntaxException("Not a valid integer", s);
-}
-
-
-bool NumberParser::tryParse64(const std::string& s, Int64& value)
-{
- char temp;
- return std::sscanf(s.c_str(), "%"I64_FMT"d%c", &value, &temp) == 1;
-}
-
-
-UInt64 NumberParser::parseUnsigned64(const std::string& s)
-{
- UInt64 result;
- if (tryParseUnsigned64(s, result))
- return result;
- else
- throw SyntaxException("Not a valid unsigned integer", s);
-}
-
-
-bool NumberParser::tryParseUnsigned64(const std::string& s, UInt64& value)
-{
- char temp;
- return std::sscanf(s.c_str(), "%"I64_FMT"u%c", &value, &temp) == 1;
-}
-
-
-UInt64 NumberParser::parseHex64(const std::string& s)
-{
- UInt64 result;
- if (tryParseHex64(s, result))
- return result;
- else
- throw SyntaxException("Not a valid hexadecimal integer", s);
-}
-
-
-bool NumberParser::tryParseHex64(const std::string& s, UInt64& value)
-{
- char temp;
- return std::sscanf(s.c_str(), "%"I64_FMT"x%c", &value, &temp) == 1;
-}
-
-
-#endif // defined(POCO_HAVE_INT64)
-
-
-double NumberParser::parseFloat(const std::string& s)
-{
- double result;
- if (tryParseFloat(s, result))
- return result;
- else
- throw SyntaxException("Not a valid floating-point number", s);
-}
-
-
-bool NumberParser::tryParseFloat(const std::string& s, double& value)
-{
- char temp;
- return std::sscanf(s.c_str(), "%lf%c", &value, &temp) == 1;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/OpcomChannel.cpp b/Utilities/Poco/Foundation/src/OpcomChannel.cpp
deleted file mode 100755
index 57a8b21cfc..0000000000
--- a/Utilities/Poco/Foundation/src/OpcomChannel.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-//
-// OpcomChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: OpcomChannel
-//
-// Copyright (c) 2004-2006, 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/OpcomChannel.h"
-#include "Poco/Message.h"
-#include <starlet.h>
-#include <opcdef.h>
-#include <descrip.h>
-
-
-namespace Poco {
-
-
-const std::string OpcomChannel::PROP_TARGET = "target";
-
-
-OpcomChannel::OpcomChannel(): _target(OPC$M_NM_CENTRL)
-{
-}
-
-
-OpcomChannel::OpcomChannel(int target): _target(target)
-{
-}
-
-
-OpcomChannel::~OpcomChannel()
-{
-}
-
-
-void OpcomChannel::log(const Message& msg)
-{
- const std::string& text = msg.getText();
- // set up OPC buffer
- struct _opcdef buffer;
- buffer.opc$b_ms_type = OPC$_RQ_RQST;
- buffer.opc$b_ms_target = _target;
- buffer.opc$l_ms_rqstid = 0;
- int len = text.size();
- // restrict message text to 128 chars
- if (len > 128) len = 128;
- // copy message text into buffer
- memcpy(&buffer.opc$l_ms_text, text.data(), len);
-
- // sys$sndopr only accepts 32-bit pointers
- #pragma pointer_size save
- #pragma pointer_size 32
-
- // set up the descriptor
- struct dsc$descriptor bufferDsc;
- bufferDsc.dsc$w_length = len + 8;
- bufferDsc.dsc$a_pointer = (char*) &buffer;
- // call the system service
- sys$sndopr(&bufferDsc, 0);
-
- #pragma pointer_size restore
-}
-
-
-void OpcomChannel::setProperty(const std::string& name, const std::string& value)
-{
- if (name == PROP_TARGET)
- {
- if (value == "CARDS")
- _target = OPC$M_NM_CARDS;
- else if (value == "CENTRL")
- _target = OPC$M_NM_CENTRL;
- else if (value == "CLUSTER")
- _target = OPC$M_NM_CLUSTER;
- else if (value == "DEVICE")
- _target = OPC$M_NM_DEVICE;
- else if (value == "DISKS")
- _target = OPC$M_NM_DISKS;
- else if (value == "NTWORK")
- _target = OPC$M_NM_NTWORK;
- else if (value == "TAPES")
- _target = OPC$M_NM_TAPES;
- else if (value == "PRINT")
- _target = OPC$M_NM_PRINT;
- else if (value == "SECURITY")
- _target = OPC$M_NM_SECURITY;
- else if (value == "OPER1")
- _target = OPC$M_NM_OPER1;
- else if (value == "OPER2")
- _target = OPC$M_NM_OPER2;
- else if (value == "OPER3")
- _target = OPC$M_NM_OPER3;
- else if (value == "OPER4")
- _target = OPC$M_NM_OPER4;
- else if (value == "OPER5")
- _target = OPC$M_NM_OPER5;
- else if (value == "OPER6")
- _target = OPC$M_NM_OPER6;
- else if (value == "OPER7")
- _target = OPC$M_NM_OPER7;
- else if (value == "OPER8")
- _target = OPC$M_NM_OPER8;
- else if (value == "OPER9")
- _target = OPC$M_NM_OPER9;
- else if (value == "OPER10")
- _target = OPC$M_NM_OPER10;
- else if (value == "OPER11")
- _target = OPC$M_NM_OPER11;
- else if (value == "OPER12")
- _target = OPC$M_NM_OPER12;
- }
- else
- {
- Channel::setProperty(name, value);
- }
-}
-
-
-std::string OpcomChannel::getProperty(const std::string& name) const
-{
- if (name == PROP_TARGET)
- {
- if (_target == OPC$M_NM_CARDS)
- return "CARDS";
- else if (_target == OPC$M_NM_CENTRL)
- return "CENTRL";
- else if (_target == OPC$M_NM_CLUSTER)
- return "CLUSTER";
- else if (_target == OPC$M_NM_DEVICE)
- return "DEVICE";
- else if (_target == OPC$M_NM_DISKS)
- return "DISKS";
- else if (_target == OPC$M_NM_NTWORK)
- return "NTWORK";
- else if (_target == OPC$M_NM_TAPES)
- return "TAPES";
- else if (_target == OPC$M_NM_PRINT)
- return "PRINT";
- else if (_target == OPC$M_NM_SECURITY)
- return "SECURITY";
- else if (_target == OPC$M_NM_OPER1)
- return "OPER1";
- else if (_target == OPC$M_NM_OPER2)
- return "OPER2";
- else if (_target == OPC$M_NM_OPER3)
- return "OPER3";
- else if (_target == OPC$M_NM_OPER4)
- return "OPER4";
- else if (_target == OPC$M_NM_OPER5)
- return "OPER5";
- else if (_target == OPC$M_NM_OPER6)
- return "OPER6";
- else if (_target == OPC$M_NM_OPER7)
- return "OPER7";
- else if (_target == OPC$M_NM_OPER8)
- return "OPER8";
- else if (_target == OPC$M_NM_OPER9)
- return "OPER9";
- else if (_target == OPC$M_NM_OPER10)
- return "OPER10";
- else if (_target == OPC$M_NM_OPER11)
- return "OPER11";
- else if (_target == OPC$M_NM_OPER12)
- return "OPER12";
- }
- return Channel::getProperty(name);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Path.cpp b/Utilities/Poco/Foundation/src/Path.cpp
deleted file mode 100755
index 1f52923042..0000000000
--- a/Utilities/Poco/Foundation/src/Path.cpp
+++ /dev/null
@@ -1,1024 +0,0 @@
-//
-// Path.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Path
-//
-// Copyright (c) 2004-2006, 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/Path.h"
-#include "Poco/File.h"
-#include "Poco/Exception.h"
-#include "Poco/StringTokenizer.h"
-#if defined(_WIN32) && defined(POCO_WIN32_UTF8)
-#include "Poco/UnicodeConverter.h"
-#include "Poco/Buffer.h"
-#endif
-#include <algorithm>
-
-
-#if defined(POCO_OS_FAMILY_VMS)
-#include "Path_VMS.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "Path_UNIX.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "Path_WIN32U.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Path_WIN32.cpp"
-#endif
-
-
-namespace Poco {
-
-
-Path::Path(): _absolute(false)
-{
-}
-
-
-Path::Path(bool absolute): _absolute(absolute)
-{
-}
-
-
-Path::Path(const std::string& path)
-{
- assign(path);
-}
-
-
-Path::Path(const std::string& path, Style style)
-{
- assign(path, style);
-}
-
-
-Path::Path(const char* path)
-{
- poco_check_ptr(path);
- assign(path);
-}
-
-
-Path::Path(const char* path, Style style)
-{
- poco_check_ptr(path);
- assign(path, style);
-}
-
-
-Path::Path(const Path& path):
- _node(path._node),
- _device(path._device),
- _name(path._name),
- _version(path._version),
- _dirs(path._dirs),
- _absolute(path._absolute)
-{
-}
-
-
-Path::Path(const Path& parent, const std::string& fileName):
- _node(parent._node),
- _device(parent._device),
- _name(parent._name),
- _version(parent._version),
- _dirs(parent._dirs),
- _absolute(parent._absolute)
-{
- makeDirectory();
- _name = fileName;
-}
-
-
-Path::Path(const Path& parent, const char* fileName):
- _node(parent._node),
- _device(parent._device),
- _name(parent._name),
- _version(parent._version),
- _dirs(parent._dirs),
- _absolute(parent._absolute)
-{
- makeDirectory();
- _name = fileName;
-}
-
-
-Path::Path(const Path& parent, const Path& relative):
- _node(parent._node),
- _device(parent._device),
- _name(parent._name),
- _version(parent._version),
- _dirs(parent._dirs),
- _absolute(parent._absolute)
-{
- resolve(relative);
-}
-
-
-Path::~Path()
-{
-}
-
-
-Path& Path::operator = (const Path& path)
-{
- return assign(path);
-}
-
-
-Path& Path::operator = (const std::string& path)
-{
- return assign(path);
-}
-
-
-Path& Path::operator = (const char* path)
-{
- poco_check_ptr(path);
- return assign(path);
-}
-
-
-void Path::swap(Path& path)
-{
- std::swap(_node, path._node);
- std::swap(_device, path._device);
- std::swap(_name, path._name);
- std::swap(_version, path._version);
- std::swap(_dirs, path._dirs);
- std::swap(_absolute, path._absolute);
-}
-
-
-Path& Path::assign(const Path& path)
-{
- if (&path != this)
- {
- _node = path._node;
- _device = path._device;
- _name = path._name;
- _version = path._version;
- _dirs = path._dirs;
- _absolute = path._absolute;
- }
- return *this;
-}
-
-
-Path& Path::assign(const std::string& path)
-{
-#if defined(POCO_OS_FAMILY_VMS)
- parseVMS(path);
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- parseWindows(path);
-#else
- parseUnix(path);
-#endif
- return *this;
-}
-
-
-Path& Path::assign(const std::string& path, Style style)
-{
- switch (style)
- {
- case PATH_UNIX:
- parseUnix(path);
- break;
- case PATH_WINDOWS:
- parseWindows(path);
- break;
- case PATH_VMS:
- parseVMS(path);
- break;
- case PATH_NATIVE:
- assign(path);
- break;
- case PATH_GUESS:
- parseGuess(path);
- break;
- default:
- poco_bugcheck();
- }
- return *this;
-}
-
-
-Path& Path::assign(const char* path)
-{
- return assign(std::string(path));
-}
-
-
-std::string Path::toString() const
-{
-#if defined(POCO_OS_FAMILY_UNIX)
- return buildUnix();
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- return buildWindows();
-#else
- return buildVMS();
-#endif
-}
-
-
-std::string Path::toString(Style style) const
-{
- switch (style)
- {
- case PATH_UNIX:
- return buildUnix();
- case PATH_WINDOWS:
- return buildWindows();
- case PATH_VMS:
- return buildVMS();
- case PATH_NATIVE:
- case PATH_GUESS:
- return toString();
- default:
- poco_bugcheck();
- }
- return std::string();
-}
-
-
-bool Path::tryParse(const std::string& path)
-{
- try
- {
- Path p;
- p.parse(path);
- assign(p);
- return true;
- }
- catch (...)
- {
- return false;
- }
-}
-
-
-bool Path::tryParse(const std::string& path, Style style)
-{
- try
- {
- Path p;
- p.parse(path, style);
- assign(p);
- return true;
- }
- catch (...)
- {
- return false;
- }
-}
-
-
-Path& Path::parseDirectory(const std::string& path)
-{
- assign(path);
- return makeDirectory();
-}
-
-
-Path& Path::parseDirectory(const std::string& path, Style style)
-{
- assign(path, style);
- return makeDirectory();
-}
-
-
-Path& Path::makeDirectory()
-{
-#if defined(POCO_OS_FAMILY_VMS)
- pushDirectory(getBaseName());
-#else
- pushDirectory(_name);
-#endif
- _name.clear();
- _version.clear();
- return *this;
-}
-
-
-Path& Path::makeFile()
-{
- if (!_dirs.empty() && _name.empty())
- {
- _name = _dirs.back();
- _dirs.pop_back();
-#if defined(POCO_OS_FAMILY_VMS)
- setExtension("DIR");
-#endif
- }
- return *this;
-}
-
-
-Path& Path::makeAbsolute()
-{
- return makeAbsolute(current());
-}
-
-
-Path& Path::makeAbsolute(const Path& base)
-{
- if (!_absolute)
- {
- Path tmp = base;
- tmp.makeDirectory();
- for (StringVec::const_iterator it = _dirs.begin(); it != _dirs.end(); ++it)
- {
- tmp.pushDirectory(*it);
- }
- _node = tmp._node;
- _device = tmp._device;
- _dirs = tmp._dirs;
- _absolute = base._absolute;
- }
- return *this;
-}
-
-
-Path Path::absolute() const
-{
- Path result(*this);
- if (!result._absolute)
- {
- result.makeAbsolute();
- }
- return result;
-}
-
-
-Path Path::absolute(const Path& base) const
-{
- Path result(*this);
- if (!result._absolute)
- {
- result.makeAbsolute(base);
- }
- return result;
-}
-
-
-Path Path::parent() const
-{
- Path p(*this);
- return p.makeParent();
-}
-
-
-Path& Path::makeParent()
-{
- if (_name.empty())
- {
- if (_dirs.empty())
- {
- if (!_absolute)
- _dirs.push_back("..");
- }
- else
- {
- if (_dirs.back() == "..")
- _dirs.push_back("..");
- else
- _dirs.pop_back();
- }
- }
- else
- {
- _name.clear();
- _version.clear();
- }
- return *this;
-}
-
-
-Path& Path::append(const Path& path)
-{
- makeDirectory();
- _dirs.insert(_dirs.end(), path._dirs.begin(), path._dirs.end());
- _name = path._name;
- _version = path._version;
- return *this;
-}
-
-
-Path& Path::resolve(const Path& path)
-{
- if (path.isAbsolute())
- {
- assign(path);
- }
- else
- {
- for (int i = 0; i < path.depth(); ++i)
- pushDirectory(path[i]);
- _name = path._name;
- }
- return *this;
-}
-
-
-void Path::setNode(const std::string& node)
-{
- _node = node;
- _absolute = _absolute || !node.empty();
-}
-
-
-void Path::setDevice(const std::string& device)
-{
- _device = device;
- _absolute = _absolute || !device.empty();
-}
-
-
-const std::string& Path::directory(int n) const
-{
- poco_assert (0 <= n && n <= _dirs.size());
-
- if (n < _dirs.size())
- return _dirs[n];
- else
- return _name;
-}
-
-
-const std::string& Path::operator [] (int n) const
-{
- poco_assert (0 <= n && n <= _dirs.size());
-
- if (n < _dirs.size())
- return _dirs[n];
- else
- return _name;
-}
-
-
-void Path::pushDirectory(const std::string& dir)
-{
- if (!dir.empty() && dir != ".")
- {
-#if defined(POCO_OS_FAMILY_VMS)
- if (dir == ".." || dir == "-")
- {
- if (!_dirs.empty() && _dirs.back() != ".." && _dirs.back() != "-")
- _dirs.pop_back();
- else if (!_absolute)
- _dirs.push_back(dir);
- }
- else _dirs.push_back(dir);
-#else
- if (dir == "..")
- {
- if (!_dirs.empty() && _dirs.back() != "..")
- _dirs.pop_back();
- else if (!_absolute)
- _dirs.push_back(dir);
- }
- else _dirs.push_back(dir);
-#endif
- }
-}
-
-
-void Path::popDirectory()
-{
- poco_assert (!_dirs.empty());
-
- _dirs.pop_back();
-}
-
-
-void Path::setFileName(const std::string& name)
-{
- _name = name;
-}
-
-
-void Path::setBaseName(const std::string& name)
-{
- std::string ext = getExtension();
- _name = name;
- if (!ext.empty())
- {
- _name.append(".");
- _name.append(ext);
- }
-}
-
-
-std::string Path::getBaseName() const
-{
- std::string::size_type pos = _name.rfind('.');
- if (pos != std::string::npos)
- return _name.substr(0, pos);
- else
- return _name;
-}
-
-
-void Path::setExtension(const std::string& extension)
-{
- _name = getBaseName();
- if (!extension.empty())
- {
- _name.append(".");
- _name.append(extension);
- }
-}
-
-
-std::string Path::getExtension() const
-{
- std::string::size_type pos = _name.rfind('.');
- if (pos != std::string::npos)
- return _name.substr(pos + 1);
- else
- return std::string();
-}
-
-
-void Path::clear()
-{
- _node.clear();
- _device.clear();
- _name.clear();
- _dirs.clear();
- _version.clear();
- _absolute = false;
-}
-
-
-std::string Path::current()
-{
- return PathImpl::currentImpl();
-}
-
-
-std::string Path::home()
-{
- return PathImpl::homeImpl();
-}
-
-
-std::string Path::temp()
-{
- return PathImpl::tempImpl();
-}
-
-
-std::string Path::null()
-{
- return PathImpl::nullImpl();
-}
-
-
-std::string Path::expand(const std::string& path)
-{
- return PathImpl::expandImpl(path);
-}
-
-
-void Path::listRoots(std::vector<std::string>& roots)
-{
- PathImpl::listRootsImpl(roots);
-}
-
-
-bool Path::find(StringVec::const_iterator it, StringVec::const_iterator end, const std::string& name, Path& path)
-{
- while (it != end)
- {
- Path p(*it);
- p.makeDirectory();
- p.resolve(Path(name));
- File f(p);
- if (f.exists())
- {
- path = p;
- return true;
- }
- ++it;
- }
- return false;
-}
-
-
-bool Path::find(const std::string& pathList, const std::string& name, Path& path)
-{
- StringTokenizer st(pathList, std::string(1, pathSeparator()), StringTokenizer::TOK_IGNORE_EMPTY + StringTokenizer::TOK_TRIM);
- return find(st.begin(), st.end(), name, path);
-}
-
-
-void Path::parseUnix(const std::string& path)
-{
- clear();
-
- std::string::const_iterator it = path.begin();
- std::string::const_iterator end = path.end();
-
- if (it != end)
- {
- if (*it == '/')
- {
- _absolute = true; ++it;
- }
- else if (*it == '~')
- {
- ++it;
- if (it == end || *it == '/')
- {
- Path cwd(home());
- _dirs = cwd._dirs;
- _absolute = true;
- }
- else --it;
- }
-
- while (it != end)
- {
- std::string name;
- while (it != end && *it != '/') name += *it++;
- if (it != end)
- {
- if (_dirs.empty())
- {
- if (!name.empty() && *(name.rbegin()) == ':')
- _device.assign(name, 0, name.length() - 1);
- else
- pushDirectory(name);
- }
- else pushDirectory(name);
- }
- else _name = name;
- if (it != end) ++it;
- }
- }
-}
-
-
-void Path::parseWindows(const std::string& path)
-{
- clear();
-
- std::string::const_iterator it = path.begin();
- std::string::const_iterator end = path.end();
-
- if (it != end)
- {
- if (*it == '\\' || *it == '/') { _absolute = true; ++it; }
- if (_absolute && it != end && (*it == '\\' || *it == '/')) // UNC
- {
- ++it;
- while (it != end && *it != '\\' && *it != '/') _node += *it++;
- if (it != end) ++it;
- }
- else if (it != end)
- {
- char d = *it++;
- if (it != end && *it == ':') // drive letter
- {
- if (_absolute || !((d >= 'a' && d <= 'z') || (d >= 'A' && d <= 'Z'))) throw PathSyntaxException(path);
- _absolute = true;
- _device += d;
- ++it;
- if (it == end || (*it != '\\' && *it != '/')) throw PathSyntaxException(path);
- ++it;
- }
- else --it;
- }
- while (it != end)
- {
- std::string name;
- while (it != end && *it != '\\' && *it != '/') name += *it++;
- if (it != end)
- pushDirectory(name);
- else
- _name = name;
- if (it != end) ++it;
- }
- }
- if (!_node.empty() && _dirs.empty() && !_name.empty())
- makeDirectory();
-}
-
-
-void Path::parseVMS(const std::string& path)
-{
- clear();
-
- std::string::const_iterator it = path.begin();
- std::string::const_iterator end = path.end();
-
- if (it != end)
- {
- std::string name;
- while (it != end && *it != ':' && *it != '[' && *it != ';') name += *it++;
- if (it != end)
- {
- if (*it == ':')
- {
- ++it;
- if (it != end && *it == ':')
- {
- _node = name;
- ++it;
- }
- else _device = name;
- _absolute = true;
- name.clear();
- }
- if (it != end)
- {
- if (_device.empty() && *it != '[')
- {
- while (it != end && *it != ':' && *it != ';') name += *it++;
- if (it != end)
- {
- if (*it == ':')
- {
- _device = name;
- _absolute = true;
- name.clear();
- ++it;
- }
- }
- }
- }
- if (name.empty())
- {
- if (it != end && *it == '[')
- {
- ++it;
- if (it != end)
- {
- _absolute = true;
- if (*it == '.')
- { _absolute = false; ++it; }
- else if (*it == ']' || *it == '-')
- _absolute = false;
- while (it != end && *it != ']')
- {
- name.clear();
- if (*it == '-')
- name = "-";
- else
- while (it != end && *it != '.' && *it != ']') name += *it++;
- if (!name.empty())
- {
- if (name == "-")
- {
- if (_dirs.empty() || _dirs.back() == "..")
- _dirs.push_back("..");
- else
- _dirs.pop_back();
- }
- else _dirs.push_back(name);
- }
- if (it != end && *it != ']') ++it;
- }
- if (it == end) throw PathSyntaxException(path);
- ++it;
- if (it != end && *it == '[')
- {
- if (!_absolute) throw PathSyntaxException(path);
- ++it;
- if (it != end && *it == '.') throw PathSyntaxException(path);
- int d = int(_dirs.size());
- while (it != end && *it != ']')
- {
- name.clear();
- if (*it == '-')
- name = "-";
- else
- while (it != end && *it != '.' && *it != ']') name += *it++;
- if (!name.empty())
- {
- if (name == "-")
- {
- if (_dirs.size() > d)
- _dirs.pop_back();
- }
- else _dirs.push_back(name);
- }
- if (it != end && *it != ']') ++it;
- }
- if (it == end) throw PathSyntaxException(path);
- ++it;
- }
- }
- _name.clear();
- }
- while (it != end && *it != ';') _name += *it++;
- }
- else _name = name;
- if (it != end && *it == ';')
- {
- ++it;
- while (it != end) _version += *it++;
- }
- }
- else _name = name;
- }
-}
-
-
-void Path::parseGuess(const std::string& path)
-{
- bool hasBackslash = false;
- bool hasSlash = false;
- bool hasOpenBracket = false;
- bool hasClosBracket = false;
- bool isWindows = path.length() > 2 && path[1] == ':' && (path[2] == '/' || path[2] == '\\');
- std::string::const_iterator end = path.end();
- std::string::const_iterator semiIt = end;
- if (!isWindows)
- {
- for (std::string::const_iterator it = path.begin(); it != end; ++it)
- {
- switch (*it)
- {
- case '\\': hasBackslash = true; break;
- case '/': hasSlash = true; break;
- case '[': hasOpenBracket = true;
- case ']': hasClosBracket = hasOpenBracket;
- case ';': semiIt = it; break;
- }
- }
- }
- if (hasBackslash || isWindows)
- {
- parseWindows(path);
- }
- else if (hasSlash)
- {
- parseUnix(path);
- }
- else
- {
- bool isVMS = hasClosBracket;
- if (!isVMS && semiIt != end)
- {
- isVMS = true;
- ++semiIt;
- while (semiIt != end)
- {
- if (*semiIt < '0' || *semiIt > '9')
- {
- isVMS = false; break;
- }
- ++semiIt;
- }
- }
- if (isVMS)
- parseVMS(path);
- else
- parseUnix(path);
- }
-}
-
-
-std::string Path::buildUnix() const
-{
- std::string result;
- if (!_device.empty())
- {
- result.append("/");
- result.append(_device);
- result.append(":/");
- }
- else if (_absolute)
- {
- result.append("/");
- }
- for (StringVec::const_iterator it = _dirs.begin(); it != _dirs.end(); ++it)
- {
- result.append(*it);
- result.append("/");
- }
- result.append(_name);
- return result;
-}
-
-
-std::string Path::buildWindows() const
-{
- std::string result;
- if (!_node.empty())
- {
- result.append("\\\\");
- result.append(_node);
- result.append("\\");
- }
- else if (!_device.empty())
- {
- result.append(_device);
- result.append(":\\");
- }
- else if (_absolute)
- {
- result.append("\\");
- }
- for (StringVec::const_iterator it = _dirs.begin(); it != _dirs.end(); ++it)
- {
- result.append(*it);
- result.append("\\");
- }
- result.append(_name);
- return result;
-}
-
-
-std::string Path::buildVMS() const
-{
- std::string result;
- if (!_node.empty())
- {
- result.append(_node);
- result.append("::");
- }
- if (!_device.empty())
- {
- result.append(_device);
- result.append(":");
- }
- if (!_dirs.empty())
- {
- result.append("[");
- if (!_absolute && _dirs[0] != "..")
- result.append(".");
- for (StringVec::const_iterator it = _dirs.begin(); it != _dirs.end(); ++it)
- {
- if (it != _dirs.begin() && *it != "..")
- result.append(".");
- if (*it == "..")
- result.append("-");
- else
- result.append(*it);
- }
- result.append("]");
- }
- result.append(_name);
- if (!_version.empty())
- {
- result.append(";");
- result.append(_version);
- }
- return result;
-}
-
-
-std::string Path::transcode(const std::string& path)
-{
-#if defined(_WIN32) && defined(POCO_WIN32_UTF8)
- std::wstring uniPath;
- UnicodeConverter::toUTF16(path, uniPath);
- DWORD len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, uniPath.c_str(), static_cast<int>(uniPath.length()), NULL, 0, NULL, NULL);
- if (len > 0)
- {
- Buffer<char> buffer(len);
- DWORD rc = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, uniPath.c_str(), static_cast<int>(uniPath.length()), buffer.begin(), static_cast<int>(buffer.size()), NULL, NULL);
- if (rc)
- {
- return std::string(buffer.begin(), buffer.size());
- }
- }
-#endif
- return path;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Path_UNIX.cpp b/Utilities/Poco/Foundation/src/Path_UNIX.cpp
deleted file mode 100755
index d3282f2254..0000000000
--- a/Utilities/Poco/Foundation/src/Path_UNIX.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// Path_UNIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Path
-//
-// Copyright (c) 2004-2006, 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/Path_UNIX.h"
-#include "Poco/Exception.h"
-#include "Poco/Environment_UNIX.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <cctype>
-#include <climits>
-
-
-#ifndef PATH_MAX
-#define PATH_MAX 1024 // fallback
-#endif
-
-
-namespace Poco {
-
-
-std::string PathImpl::currentImpl()
-{
- std::string path;
- char cwd[PATH_MAX];
- if (getcwd(cwd, sizeof(cwd)))
- path = cwd;
- else
- throw SystemException("cannot get current directory");
- std::string::size_type n = path.size();
- if (n > 0 && path[n - 1] != '/') path.append("/");
- return path;
-}
-
-
-std::string PathImpl::homeImpl()
-{
- std::string path;
- struct passwd* pwd = getpwuid(getuid());
- if (pwd)
- path = pwd->pw_dir;
- else
- {
- pwd = getpwuid(geteuid());
- if (pwd)
- path = pwd->pw_dir;
- else
- path = EnvironmentImpl::getImpl("HOME");
- }
- std::string::size_type n = path.size();
- if (n > 0 && path[n - 1] != '/') path.append("/");
- return path;
-}
-
-
-std::string PathImpl::tempImpl()
-{
- std::string path;
- char* tmp = getenv("TMPDIR");
- if (tmp)
- {
- path = tmp;
- std::string::size_type n = path.size();
- if (n > 0 && path[n - 1] != '/') path.append("/");
- }
- else
- {
- path = "/tmp/";
- }
- return path;
-}
-
-
-std::string PathImpl::nullImpl()
-{
- return "/dev/null";
-}
-
-
-std::string PathImpl::expandImpl(const std::string& path)
-{
- std::string result;
- std::string::const_iterator it = path.begin();
- std::string::const_iterator end = path.end();
- if (it != end && *it == '~')
- {
- ++it;
- if (it != end && *it == '/')
- {
- result += homeImpl(); ++it;
- }
- else result += '~';
- }
- while (it != end)
- {
- if (*it == '$')
- {
- std::string var;
- ++it;
- if (it != end && *it == '{')
- {
- ++it;
- while (it != end && *it != '}') var += *it++;
- if (it != end) ++it;
- }
- else
- {
- while (it != end && (std::isalnum(*it) || *it == '_')) var += *it++;
- }
- char* val = getenv(var.c_str());
- if (val) result += val;
- }
- else result += *it++;
- }
- return result;
-}
-
-
-void PathImpl::listRootsImpl(std::vector<std::string>& roots)
-{
- roots.clear();
- roots.push_back("/");
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Path_VMS.cpp b/Utilities/Poco/Foundation/src/Path_VMS.cpp
deleted file mode 100755
index ea84de0391..0000000000
--- a/Utilities/Poco/Foundation/src/Path_VMS.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// Path_VMS.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Path
-//
-// Copyright (c) 2004-2006, 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/Path_VMS.h"
-#include "Poco/Environment_VMS.h"
-#include <unistd.h>
-#include <descrip.h>
-#include <dvsdef.h>
-#include <dcdef.h>
-#include <iledef.h>
-#include <gen64def.h>
-#include <starlet.h>
-
-
-namespace Poco {
-
-
-std::string PathImpl::currentImpl()
-{
- std::string path;
- char cwd[PATH_MAX];
- if (getcwd(cwd, sizeof(cwd)))
- path = cwd;
- else
- throw SystemException("cannot get current directory");
- return path;
-}
-
-
-std::string PathImpl::homeImpl()
-{
- return EnvironmentImpl::trnlnm("SYS$LOGIN");
-}
-
-
-std::string PathImpl::tempImpl()
-{
- std::string result = EnvironmentImpl::trnlnm("SYS$SCRATCH");
- if (result.empty())
- return homeImpl();
- else
- return result;
-}
-
-
-std::string PathImpl::nullImpl()
-{
- return "NLA0:";
-}
-
-
-std::string PathImpl::expandImpl(const std::string& path)
-{
- std::string result = path;
- std::string::const_iterator it = result.begin();
- std::string::const_iterator end = result.end();
- int n = 0;
- while (it != end && n < 10)
- {
- std::string logical;
- while (it != end && *it != ':') logical += *it++;
- if (it != end)
- {
- ++it;
- if (it != end && *it == ':') return result;
- std::string val = EnvironmentImpl::trnlnm(logical);
- if (val.empty())
- return result;
- else
- result = val + std::string(it, end);
- it = result.begin();
- end = result.end();
- ++n;
- }
- }
- return result;
-}
-
-
-void PathImpl::listRootsImpl(std::vector<std::string>& roots)
-{
- char device[64];
- $DESCRIPTOR(deviceDsc, device);
- int clss = DC$_DISK;
- ILE3 items[2];
- items[0].ile3$w_code = DVS$_DEVCLASS;
- items[0].ile3$w_length = sizeof(clss);
- items[0].ile3$ps_bufaddr = &clss;
- items[0].ile3$ps_retlen_addr = 0;
- items[1].ile3$w_code = 0;
- items[1].ile3$w_length = 0;
- int stat;
- GENERIC_64 context;
- context.gen64$q_quadword = 0;
- do
- {
- unsigned short length;
- stat = sys$device_scan(&deviceDsc, &length, 0, &items, &context);
- if (stat == SS$_NORMAL)
- roots.push_back(std::string(device, length));
- }
- while (stat == SS$_NORMAL);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Path_WIN32.cpp b/Utilities/Poco/Foundation/src/Path_WIN32.cpp
deleted file mode 100755
index 72f4da4805..0000000000
--- a/Utilities/Poco/Foundation/src/Path_WIN32.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// Path_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Path
-//
-// Copyright (c) 2004-2006, 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/Path_WIN32.h"
-#include "Poco/Environment_WIN32.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-std::string PathImpl::currentImpl()
-{
- char buffer[_MAX_PATH];
- DWORD n = GetCurrentDirectoryA(sizeof(buffer), buffer);
- if (n > 0 && n < sizeof(buffer))
- {
- std::string result(buffer, n);
- if (result[n - 1] != '\\')
- result.append("\\");
- return result;
- }
- else throw SystemException("Cannot get current directory");
-}
-
-
-std::string PathImpl::homeImpl()
-{
- std::string result = EnvironmentImpl::getImpl("HOMEDRIVE");
- result.append(EnvironmentImpl::getImpl("HOMEPATH"));
- std::string::size_type n = result.size();
- if (n > 0 && result[n - 1] != '\\')
- result.append("\\");
- return result;
-}
-
-
-std::string PathImpl::tempImpl()
-{
- char buffer[_MAX_PATH];
- DWORD n = GetTempPathA(sizeof(buffer), buffer);
- if (n > 0 && n < sizeof(buffer))
- {
- std::string result(buffer, n);
- if (result[n - 1] != '\\')
- result.append("\\");
- return result;
- }
- else throw SystemException("Cannot get current directory");
-}
-
-
-std::string PathImpl::nullImpl()
-{
- return "NUL:";
-}
-
-
-std::string PathImpl::expandImpl(const std::string& path)
-{
- char buffer[_MAX_PATH];
- DWORD n = ExpandEnvironmentStringsA(path.c_str(), buffer, sizeof(buffer));
- if (n > 0 && n < sizeof(buffer))
- return std::string(buffer, n - 1);
- else
- return path;
-}
-
-
-void PathImpl::listRootsImpl(std::vector<std::string>& roots)
-{
- roots.clear();
- char buffer[128];
- DWORD n = GetLogicalDriveStrings(sizeof(buffer) - 1, buffer);
- char* it = buffer;
- char* end = buffer + (n > sizeof(buffer) ? sizeof(buffer) : n);
- while (it < end)
- {
- std::string dev;
- while (it < end && *it) dev += *it++;
- roots.push_back(dev);
- ++it;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Path_WIN32U.cpp b/Utilities/Poco/Foundation/src/Path_WIN32U.cpp
deleted file mode 100755
index 2883487e09..0000000000
--- a/Utilities/Poco/Foundation/src/Path_WIN32U.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// Path_WIN32U.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: Path
-//
-// Copyright (c) 2006, 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/Path_WIN32U.h"
-#include "Poco/Environment_WIN32.h"
-#include "Poco/UnicodeConverter.h"
-#include "Poco/Buffer.h"
-#include "Poco/Exception.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-std::string PathImpl::currentImpl()
-{
- std::string result;
- DWORD len = GetCurrentDirectoryW(0, NULL);
- if (len > 0)
- {
- Buffer<wchar_t> buffer(len);
- DWORD n = GetCurrentDirectoryW(len, buffer.begin());
- if (n > 0 && n <= len)
- {
- UnicodeConverter::toUTF8(buffer.begin(), result);
- if (result[n - 1] != '\\')
- result.append("\\");
- return result;
- }
- }
- throw SystemException("Cannot get current directory");
-}
-
-
-std::string PathImpl::homeImpl()
-{
- std::string result = EnvironmentImpl::getImpl("HOMEDRIVE");
- result.append(EnvironmentImpl::getImpl("HOMEPATH"));
- std::string::size_type n = result.size();
- if (n > 0 && result[n - 1] != '\\')
- result.append("\\");
- return result;
-}
-
-
-std::string PathImpl::tempImpl()
-{
- Buffer<wchar_t> buffer(MAX_PATH_LEN);
- DWORD n = GetTempPathW(static_cast<DWORD>(buffer.size()), buffer.begin());
- if (n > 0)
- {
- std::string result;
- UnicodeConverter::toUTF8(buffer.begin(), result);
- if (result[n - 1] != '\\')
- result.append("\\");
- return result;
- }
- throw SystemException("Cannot get current directory");
-}
-
-
-std::string PathImpl::nullImpl()
-{
- return "NUL:";
-}
-
-
-std::string PathImpl::expandImpl(const std::string& path)
-{
- std::wstring upath;
- UnicodeConverter::toUTF16(path, upath);
- Buffer<wchar_t> buffer(MAX_PATH_LEN);
- DWORD n = ExpandEnvironmentStringsW(upath.c_str(), buffer.begin(), static_cast<DWORD>(buffer.size()));
- if (n > 0 && n < buffer.size() - 1)
- {
- buffer[n + 1] = 0;
- std::string result;
- UnicodeConverter::toUTF8(buffer.begin(), result);
- return result;
- }
- else return path;
-}
-
-
-void PathImpl::listRootsImpl(std::vector<std::string>& roots)
-{
- roots.clear();
- wchar_t buffer[128];
- DWORD n = GetLogicalDriveStringsW(sizeof(buffer)/sizeof(wchar_t) - 1, buffer);
- wchar_t* it = buffer;
- wchar_t* end = buffer + (n > sizeof(buffer) ? sizeof(buffer) : n);
- while (it < end)
- {
- std::wstring udev;
- while (it < end && *it) udev += *it++;
- std::string dev;
- UnicodeConverter::toUTF8(udev, dev);
- roots.push_back(dev);
- ++it;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/PatternFormatter.cpp b/Utilities/Poco/Foundation/src/PatternFormatter.cpp
deleted file mode 100755
index 95b7620b83..0000000000
--- a/Utilities/Poco/Foundation/src/PatternFormatter.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-//
-// PatternFormatter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: PatternFormatter
-//
-// Copyright (c) 2004-2006, 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/PatternFormatter.h"
-#include "Poco/Message.h"
-#include "Poco/DateTimeFormat.h"
-#include "Poco/DateTimeFormatter.h"
-#include "Poco/DateTime.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Timezone.h"
-#include "Poco/Environment.h"
-#include <cstdio>
-#include <cctype>
-
-
-namespace Poco {
-
-
-const std::string PatternFormatter::PROP_PATTERN = "pattern";
-const std::string PatternFormatter::PROP_TIMES = "times";
-
-
-PatternFormatter::PatternFormatter():
- _localTime(false)
-{
-}
-
-
-PatternFormatter::PatternFormatter(const std::string& format):
- _localTime(false),
- _pattern(format)
-{
-}
-
-
-PatternFormatter::~PatternFormatter()
-{
-}
-
-
-inline void PatternFormatter::fmt(std::string& str, int value)
-{
- char buffer[64];
- std::sprintf(buffer, "%d", value);
- str.append(buffer);
-}
-
-
-inline void PatternFormatter::fmt(std::string& str, int value, int width)
-{
- char buffer[64];
- std::sprintf(buffer, "%*d", width, value);
- str.append(buffer);
-}
-
-
-inline void PatternFormatter::fmt0(std::string& str, int value, int width)
-{
- char buffer[64];
- std::sprintf(buffer, "%0*d", width, value);
- str.append(buffer);
-}
-
-
-void PatternFormatter::format(const Message& msg, std::string& text)
-{
- Timestamp timestamp = msg.getTime();
- if (_localTime)
- {
- timestamp += Timezone::utcOffset()*Timestamp::resolution();
- timestamp += Timezone::dst()*Timestamp::resolution();
- }
- DateTime dateTime = timestamp;
- std::string::const_iterator it = _pattern.begin();
- std::string::const_iterator end = _pattern.end();
- while (it != end)
- {
- if (*it == '%')
- {
- if (++it != end)
- {
- switch (*it)
- {
- case 's': text.append(msg.getSource()); break;
- case 't': text.append(msg.getText()); break;
- case 'l': fmt(text, (int) msg.getPriority()); break;
- case 'p': text.append(getPriorityName((int) msg.getPriority())); break;
- case 'q': text += getPriorityName((int) msg.getPriority()).at(0); break;
- case 'P': fmt(text, msg.getPid()); break;
- case 'T': text.append(msg.getThread()); break;
- case 'I': fmt(text, msg.getTid()); break;
- case 'N': text.append(Environment::nodeName()); break;
- case 'w': text.append(DateTimeFormat::WEEKDAY_NAMES[dateTime.dayOfWeek()], 0, 3); break;
- case 'W': text.append(DateTimeFormat::WEEKDAY_NAMES[dateTime.dayOfWeek()]); break;
- case 'b': text.append(DateTimeFormat::MONTH_NAMES[dateTime.month() - 1], 0, 3); break;
- case 'B': text.append(DateTimeFormat::MONTH_NAMES[dateTime.month() - 1]); break;
- case 'd': fmt0(text, dateTime.day(), 2); break;
- case 'e': fmt(text, dateTime.day()); break;
- case 'f': fmt(text, dateTime.day(), 2); break;
- case 'm': fmt0(text, dateTime.month(), 2); break;
- case 'n': fmt(text, dateTime.month()); break;
- case 'o': fmt(text, dateTime.month(), 2); break;
- case 'y': fmt0(text, dateTime.year() % 100, 2); break;
- case 'Y': fmt0(text, dateTime.year(), 4); break;
- case 'H': fmt0(text, dateTime.hour(), 2); break;
- case 'h': fmt0(text, dateTime.hourAMPM(), 2); break;
- case 'a': text.append(dateTime.isAM() ? "am" : "pm"); break;
- case 'A': text.append(dateTime.isAM() ? "AM" : "PM"); break;
- case 'M': fmt0(text, dateTime.minute(), 2); break;
- case 'S': fmt0(text, dateTime.second(), 2); break;
- case 'i': fmt0(text, dateTime.millisecond(), 3); break;
- case 'c': fmt(text, dateTime.millisecond()/100); break;
- case 'F': fmt0(text, dateTime.millisecond()*1000 + dateTime.microsecond(), 6); break;
- case 'z': text.append(DateTimeFormatter::tzdISO(_localTime ? Timezone::tzd() : DateTimeFormatter::UTC)); break;
- case 'Z': text.append(DateTimeFormatter::tzdRFC(_localTime ? Timezone::tzd() : DateTimeFormatter::UTC)); break;
- case '[':
- {
- ++it;
- std::string prop;
- while (it != end && *it != ']') prop += *it++;
- if (it == end) --it;
- try
- {
- text.append(msg[prop]);
- }
- catch (...)
- {
- }
- break;
- }
- default: text += *it;
- }
- ++it;
- }
- }
- else text += *it++;
- }
-}
-
-
-void PatternFormatter::setProperty(const std::string& name, const std::string& value)
-{
- if (name == PROP_PATTERN)
- _pattern = value;
- else if (name == PROP_TIMES)
- _localTime = (value == "local");
- else
- Formatter::setProperty(name, value);
-}
-
-
-std::string PatternFormatter::getProperty(const std::string& name) const
-{
- if (name == PROP_PATTERN)
- return _pattern;
- else if (name == PROP_TIMES)
- return _localTime ? "local" : "UTC";
- else
- return Formatter::getProperty(name);
-}
-
-
-const std::string& PatternFormatter::getPriorityName(int prio)
-{
- static std::string priorities[] =
- {
- "",
- "Fatal",
- "Critical",
- "Error",
- "Warning",
- "Notice",
- "Information",
- "Debug",
- "Trace"
- };
-
- poco_assert (1 <= prio && prio <= 8);
- return priorities[prio];
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Pipe.cpp b/Utilities/Poco/Foundation/src/Pipe.cpp
deleted file mode 100755
index 7683b271d5..0000000000
--- a/Utilities/Poco/Foundation/src/Pipe.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// Pipe.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Pipe
-//
-// Copyright (c) 2004-2006, 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/Pipe.h"
-
-
-namespace Poco {
-
-
-Pipe::Pipe():
- _pImpl(new PipeImpl)
-{
-}
-
-
-Pipe::Pipe(const Pipe& pipe):
- _pImpl(pipe._pImpl)
-{
- _pImpl->duplicate();
-}
-
-
-Pipe::~Pipe()
-{
- _pImpl->release();
-}
-
-
-Pipe& Pipe::operator = (const Pipe& pipe)
-{
- if (this != &pipe)
- {
- _pImpl->release();
- _pImpl = pipe._pImpl;
- _pImpl->duplicate();
- }
- return *this;
-}
-
-
-void Pipe::close(CloseMode mode)
-{
- switch (mode)
- {
- case CLOSE_READ:
- _pImpl->closeRead();
- break;
- case CLOSE_WRITE:
- _pImpl->closeWrite();
- break;
- default:
- _pImpl->closeRead();
- _pImpl->closeWrite();
- break;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/PipeImpl.cpp b/Utilities/Poco/Foundation/src/PipeImpl.cpp
deleted file mode 100755
index be3f411aa1..0000000000
--- a/Utilities/Poco/Foundation/src/PipeImpl.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// PipeImpl.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: PipeImpl
-//
-// Copyright (c) 2004-2006, 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/PipeImpl.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "PipeImpl_WIN32.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "PipeImpl_POSIX.cpp"
-#else
-#include "PipeImpl_DUMMY.cpp"
-#endif
diff --git a/Utilities/Poco/Foundation/src/PipeImpl_DUMMY.cpp b/Utilities/Poco/Foundation/src/PipeImpl_DUMMY.cpp
deleted file mode 100755
index fff5427004..0000000000
--- a/Utilities/Poco/Foundation/src/PipeImpl_DUMMY.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// PipeImpl_DUMMY.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: PipeImpl
-//
-// Copyright (c) 2004-2006, 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/PipeImpl_DUMMY.h"
-
-
-namespace Poco {
-
-
-PipeImpl::PipeImpl()
-{
-}
-
-
-PipeImpl::~PipeImpl()
-{
-}
-
-
-int PipeImpl::writeBytes(const void* buffer, int length)
-{
- return 0;
-}
-
-
-int PipeImpl::readBytes(void* buffer, int length)
-{
- return 0;
-}
-
-
-PipeImpl::Handle PipeImpl::readHandle() const
-{
- return 0;
-}
-
-
-PipeImpl::Handle PipeImpl::writeHandle() const
-{
- return 0;
-}
-
-
-void PipeImpl::closeRead()
-{
-}
-
-
-void PipeImpl::closeWrite()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/PipeImpl_POSIX.cpp b/Utilities/Poco/Foundation/src/PipeImpl_POSIX.cpp
deleted file mode 100755
index 4f1472ff74..0000000000
--- a/Utilities/Poco/Foundation/src/PipeImpl_POSIX.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// PipeImpl_POSIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: PipeImpl
-//
-// Copyright (c) 2004-2006, 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/PipeImpl_POSIX.h"
-#include "Poco/Exception.h"
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-
-
-namespace Poco {
-
-
-PipeImpl::PipeImpl()
-{
- int fds[2];
- int rc = pipe(fds);
- if (rc == 0)
- {
- _readfd = fds[0];
- _writefd = fds[1];
- }
- else throw CreateFileException("anonymous pipe");
-}
-
-
-PipeImpl::~PipeImpl()
-{
- closeRead();
- closeWrite();
-}
-
-
-int PipeImpl::writeBytes(const void* buffer, int length)
-{
- poco_assert (_writefd != -1);
-
- int n;
- do
- {
- n = write(_writefd, buffer, length);
- }
- while (n < 0 && errno == EINTR);
- if (n >= 0)
- return n;
- else
- throw WriteFileException("anonymous pipe");
-}
-
-
-int PipeImpl::readBytes(void* buffer, int length)
-{
- poco_assert (_readfd != -1);
-
- int n;
- do
- {
- n = read(_readfd, buffer, length);
- }
- while (n < 0 && errno == EINTR);
- if (n >= 0)
- return n;
- else
- throw ReadFileException("anonymous pipe");
-}
-
-
-PipeImpl::Handle PipeImpl::readHandle() const
-{
- return _readfd;
-}
-
-
-PipeImpl::Handle PipeImpl::writeHandle() const
-{
- return _writefd;
-}
-
-
-void PipeImpl::closeRead()
-{
- if (_readfd != -1)
- {
- close(_readfd);
- _readfd = -1;
- }
-}
-
-
-void PipeImpl::closeWrite()
-{
- if (_writefd != -1)
- {
- close(_writefd);
- _writefd = -1;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/PipeImpl_WIN32.cpp b/Utilities/Poco/Foundation/src/PipeImpl_WIN32.cpp
deleted file mode 100755
index 46179ff385..0000000000
--- a/Utilities/Poco/Foundation/src/PipeImpl_WIN32.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// PipeImpl_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: PipeImpl
-//
-// Copyright (c) 2004-2006, 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/PipeImpl_WIN32.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-PipeImpl::PipeImpl()
-{
- SECURITY_ATTRIBUTES attr;
- attr.nLength = sizeof(attr);
- attr.lpSecurityDescriptor = NULL;
- attr.bInheritHandle = FALSE;
-
- if (!CreatePipe(&_readHandle, &_writeHandle, &attr, 0))
- throw CreateFileException("anonymous pipe");
-}
-
-
-PipeImpl::~PipeImpl()
-{
- closeRead();
- closeWrite();
-}
-
-
-int PipeImpl::writeBytes(const void* buffer, int length)
-{
- poco_assert (_writeHandle != INVALID_HANDLE_VALUE);
-
- DWORD bytesWritten = 0;
- if (!WriteFile(_writeHandle, buffer, length, &bytesWritten, NULL))
- throw WriteFileException("anonymous pipe");
- return bytesWritten;
-}
-
-
-int PipeImpl::readBytes(void* buffer, int length)
-{
- poco_assert (_readHandle != INVALID_HANDLE_VALUE);
-
- DWORD bytesRead = 0;
- BOOL ok = ReadFile(_readHandle, buffer, length, &bytesRead, NULL);
- if (ok || GetLastError() == ERROR_BROKEN_PIPE)
- return bytesRead;
- else
- throw ReadFileException("anonymous pipe");
-}
-
-
-PipeImpl::Handle PipeImpl::readHandle() const
-{
- return _readHandle;
-}
-
-
-PipeImpl::Handle PipeImpl::writeHandle() const
-{
- return _writeHandle;
-}
-
-
-void PipeImpl::closeRead()
-{
- if (_readHandle != INVALID_HANDLE_VALUE)
- {
- CloseHandle(_readHandle);
- _readHandle = INVALID_HANDLE_VALUE;
- }
-}
-
-
-void PipeImpl::closeWrite()
-{
- if (_writeHandle != INVALID_HANDLE_VALUE)
- {
- CloseHandle(_writeHandle);
- _writeHandle = INVALID_HANDLE_VALUE;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/PipeStream.cpp b/Utilities/Poco/Foundation/src/PipeStream.cpp
deleted file mode 100755
index 599efaa625..0000000000
--- a/Utilities/Poco/Foundation/src/PipeStream.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// PipeStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: PipeStream
-//
-// Copyright (c) 2004-2006, 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/PipeStream.h"
-
-
-namespace Poco {
-
-
-//
-// PipeStreamBuf
-//
-
-
-PipeStreamBuf::PipeStreamBuf(const Pipe& pipe, openmode mode):
- BufferedStreamBuf(STREAM_BUFFER_SIZE, mode),
- _pipe(pipe)
-{
-}
-
-
-PipeStreamBuf::~PipeStreamBuf()
-{
-}
-
-
-int PipeStreamBuf::readFromDevice(char* buffer, std::streamsize length)
-{
- return _pipe.readBytes(buffer, (int) length);
-}
-
-
-int PipeStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
-{
- return _pipe.writeBytes(buffer, (int) length);
-}
-
-
-void PipeStreamBuf::close()
-{
- _pipe.close(Pipe::CLOSE_BOTH);
-}
-
-
-//
-// PipeIOS
-//
-
-
-PipeIOS::PipeIOS(const Pipe& pipe, openmode mode):
- _buf(pipe, mode)
-{
- poco_ios_init(&_buf);
-}
-
-
-PipeIOS::~PipeIOS()
-{
- try
- {
- _buf.sync();
- }
- catch (...)
- {
- }
-}
-
-
-PipeStreamBuf* PipeIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-void PipeIOS::close()
-{
- _buf.sync();
- _buf.close();
-}
-
-
-//
-// PipeOutputStream
-//
-
-
-PipeOutputStream::PipeOutputStream(const Pipe& pipe):
- PipeIOS(pipe, std::ios::out),
- std::ostream(&_buf)
-{
-}
-
-
-PipeOutputStream::~PipeOutputStream()
-{
-}
-
-
-//
-// PipeInputStream
-//
-
-
-PipeInputStream::PipeInputStream(const Pipe& pipe):
- PipeIOS(pipe, std::ios::in),
- std::istream(&_buf)
-{
-}
-
-
-PipeInputStream::~PipeInputStream()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/PriorityNotificationQueue.cpp b/Utilities/Poco/Foundation/src/PriorityNotificationQueue.cpp
deleted file mode 100644
index 07b930b404..0000000000
--- a/Utilities/Poco/Foundation/src/PriorityNotificationQueue.cpp
+++ /dev/null
@@ -1,205 +0,0 @@
-//
-// PriorityNotificationQueue.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: PriorityNotificationQueue
-//
-// Copyright (c) 2009, 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/PriorityNotificationQueue.h"
-#include "Poco/NotificationCenter.h"
-#include "Poco/Notification.h"
-#include "Poco/SingletonHolder.h"
-
-
-namespace Poco {
-
-
-PriorityNotificationQueue::PriorityNotificationQueue()
-{
-}
-
-
-PriorityNotificationQueue::~PriorityNotificationQueue()
-{
- clear();
-}
-
-
-void PriorityNotificationQueue::enqueueNotification(Notification::Ptr pNotification, int priority)
-{
- poco_check_ptr (pNotification);
- FastMutex::ScopedLock lock(_mutex);
- if (_waitQueue.empty())
- {
- _nfQueue.insert(NfQueue::value_type(priority, pNotification));
- }
- else
- {
- poco_assert_dbg(_nfQueue.empty());
- WaitInfo* pWI = _waitQueue.front();
- _waitQueue.pop_front();
- pWI->pNf = pNotification;
- pWI->nfAvailable.set();
- }
-}
-
-
-Notification* PriorityNotificationQueue::dequeueNotification()
-{
- FastMutex::ScopedLock lock(_mutex);
- return dequeueOne().duplicate();
-}
-
-
-Notification* PriorityNotificationQueue::waitDequeueNotification()
-{
- Notification::Ptr pNf;
- WaitInfo* pWI = 0;
- {
- FastMutex::ScopedLock lock(_mutex);
- pNf = dequeueOne();
- if (pNf) return pNf.duplicate();
- pWI = new WaitInfo;
- _waitQueue.push_back(pWI);
- }
- pWI->nfAvailable.wait();
- pNf = pWI->pNf;
- delete pWI;
- return pNf.duplicate();
-}
-
-
-Notification* PriorityNotificationQueue::waitDequeueNotification(long milliseconds)
-{
- Notification::Ptr pNf;
- WaitInfo* pWI = 0;
- {
- FastMutex::ScopedLock lock(_mutex);
- pNf = dequeueOne();
- if (pNf) return pNf.duplicate();
- pWI = new WaitInfo;
- _waitQueue.push_back(pWI);
- }
- if (pWI->nfAvailable.tryWait(milliseconds))
- {
- pNf = pWI->pNf;
- }
- else
- {
- FastMutex::ScopedLock lock(_mutex);
- pNf = pWI->pNf;
- for (WaitQueue::iterator it = _waitQueue.begin(); it != _waitQueue.end(); ++it)
- {
- if (*it == pWI)
- {
- _waitQueue.erase(it);
- break;
- }
- }
- }
- delete pWI;
- return pNf.duplicate();
-}
-
-
-void PriorityNotificationQueue::dispatch(NotificationCenter& notificationCenter)
-{
- FastMutex::ScopedLock lock(_mutex);
- Notification::Ptr pNf = dequeueOne();
- while (pNf)
- {
- notificationCenter.postNotification(pNf);
- pNf = dequeueOne();
- }
-}
-
-
-void PriorityNotificationQueue::wakeUpAll()
-{
- FastMutex::ScopedLock lock(_mutex);
- for (WaitQueue::iterator it = _waitQueue.begin(); it != _waitQueue.end(); ++it)
- {
- (*it)->nfAvailable.set();
- }
- _waitQueue.clear();
-}
-
-
-bool PriorityNotificationQueue::empty() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return _nfQueue.empty();
-}
-
-
-int PriorityNotificationQueue::size() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return static_cast<int>(_nfQueue.size());
-}
-
-
-void PriorityNotificationQueue::clear()
-{
- FastMutex::ScopedLock lock(_mutex);
- _nfQueue.clear();
-}
-
-
-bool PriorityNotificationQueue::hasIdleThreads() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return !_waitQueue.empty();
-}
-
-
-Notification::Ptr PriorityNotificationQueue::dequeueOne()
-{
- Notification::Ptr pNf;
- NfQueue::iterator it = _nfQueue.begin();
- if (it != _nfQueue.end())
- {
- pNf = it->second;
- _nfQueue.erase(it);
- }
- return pNf;
-}
-
-
-PriorityNotificationQueue& PriorityNotificationQueue::defaultQueue()
-{
- static SingletonHolder<PriorityNotificationQueue> sh;
- return *sh.get();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Process.cpp b/Utilities/Poco/Foundation/src/Process.cpp
deleted file mode 100755
index a2649a3e5a..0000000000
--- a/Utilities/Poco/Foundation/src/Process.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// Process.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Process
-//
-// Copyright (c) 2004-2006, 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/Process.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "Process_WIN32U.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Process_WIN32.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "Process_UNIX.cpp"
-#else
-#include "Process_VMS.cpp"
-#endif
-
-
-namespace Poco {
-
-
-//
-// ProcessHandle
-//
-ProcessHandle::ProcessHandle(const ProcessHandle& handle):
- _pImpl(handle._pImpl)
-{
- _pImpl->duplicate();
-}
-
-
-ProcessHandle::~ProcessHandle()
-{
- _pImpl->release();
-}
-
-
-ProcessHandle::ProcessHandle(ProcessHandleImpl* pImpl):
- _pImpl(pImpl)
-{
- poco_check_ptr (_pImpl);
-}
-
-
-ProcessHandle& ProcessHandle::operator = (const ProcessHandle& handle)
-{
- if (&handle != this)
- {
- _pImpl->release();
- _pImpl = handle._pImpl;
- _pImpl->duplicate();
- }
- return *this;
-}
-
-
-ProcessHandle::PID ProcessHandle::id() const
-{
- return _pImpl->id();
-}
-
-
-int ProcessHandle::wait() const
-{
- return _pImpl->wait();
-}
-
-
-//
-// Process
-//
-ProcessHandle Process::launch(const std::string& command, const Args& args)
-{
- return ProcessHandle(launchImpl(command, args, 0, 0, 0));
-}
-
-
-ProcessHandle Process::launch(const std::string& command, const Args& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe)
-{
- poco_assert (inPipe == 0 || (inPipe != outPipe && inPipe != errPipe));
-
- return ProcessHandle(launchImpl(command, args, inPipe, outPipe, errPipe));
-}
-
-
-int Process::wait(const ProcessHandle& handle)
-{
- return handle.wait();
-}
-
-
-void Process::kill(PID pid)
-{
- killImpl(pid);
-}
-
-
-void Process::requestTermination(PID pid)
-{
- requestTerminationImpl(pid);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Process_UNIX.cpp b/Utilities/Poco/Foundation/src/Process_UNIX.cpp
deleted file mode 100755
index 3986eed92a..0000000000
--- a/Utilities/Poco/Foundation/src/Process_UNIX.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-//
-// Process_UNIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Process
-//
-// Copyright (c) 2004-2006, 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/Process_UNIX.h"
-#include "Poco/Exception.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/Pipe.h"
-#include <errno.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-
-
-#if defined(__QNX__)
-#include <process.h>
-#include <spawn.h>
-#include <cstring>
-#endif
-
-
-namespace Poco {
-
-
-//
-// ProcessHandleImpl
-//
-ProcessHandleImpl::ProcessHandleImpl(pid_t pid):
- _pid(pid)
-{
-}
-
-
-ProcessHandleImpl::~ProcessHandleImpl()
-{
-}
-
-
-pid_t ProcessHandleImpl::id() const
-{
- return _pid;
-}
-
-
-int ProcessHandleImpl::wait() const
-{
- int status;
- int rc;
- do
- {
- rc = waitpid(_pid, &status, 0);
- }
- while (rc < 0 && errno == EINTR);
- if (rc != _pid)
- throw SystemException("Cannot wait for process", NumberFormatter::format(_pid));
- return WEXITSTATUS(status);
-}
-
-
-//
-// ProcessImpl
-//
-ProcessImpl::PIDImpl ProcessImpl::idImpl()
-{
- return getpid();
-}
-
-
-void ProcessImpl::timesImpl(long& userTime, long& kernelTime)
-{
- struct rusage usage;
- getrusage(RUSAGE_SELF, &usage);
- userTime = usage.ru_utime.tv_sec;
- kernelTime = usage.ru_stime.tv_sec;
-}
-
-
-ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe)
-{
-#if defined(__QNX__)
- /// use QNX's spawn system call which is more efficient than fork/exec.
- char** argv = new char*[args.size() + 2];
- int i = 0;
- argv[i++] = const_cast<char*>(command.c_str());
- for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it)
- argv[i++] = const_cast<char*>(it->c_str());
- argv[i] = NULL;
- struct inheritance inherit;
- std::memset(&inherit, 0, sizeof(inherit));
- inherit.flags = SPAWN_ALIGN_DEFAULT | SPAWN_CHECK_SCRIPT | SPAWN_SEARCH_PATH;
- int fdmap[3];
- fdmap[0] = inPipe ? inPipe->readHandle() : 0;
- fdmap[1] = outPipe ? outPipe->writeHandle() : 1;
- fdmap[2] = errPipe ? errPipe->writeHandle() : 2;
- int pid = spawn(command.c_str(), 3, fdmap, &inherit, argv, NULL);
- delete [] argv;
- if (pid == -1) throw SystemException("cannot spawn", command);
-#else
- int pid = fork();
- if (pid < 0)
- {
- throw SystemException("Cannot fork process for", command);
- }
- else if (pid == 0)
- {
- // setup redirection
- if (inPipe)
- {
- dup2(inPipe->readHandle(), STDIN_FILENO);
- inPipe->close(Pipe::CLOSE_BOTH);
- }
- // outPipe and errPipe may be the same, so we dup first and close later
- if (outPipe) dup2(outPipe->writeHandle(), STDOUT_FILENO);
- if (errPipe) dup2(errPipe->writeHandle(), STDERR_FILENO);
- if (outPipe) outPipe->close(Pipe::CLOSE_BOTH);
- if (errPipe) errPipe->close(Pipe::CLOSE_BOTH);
- // close all open file descriptors other than stdin, stdout, stderr
- for (int i = 3; i < getdtablesize(); ++i)
- close(i);
-
- char** argv = new char*[args.size() + 2];
- int i = 0;
- argv[i++] = const_cast<char*>(command.c_str());
- for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it)
- argv[i++] = const_cast<char*>(it->c_str());
- argv[i] = NULL;
- execvp(command.c_str(), argv);
- _exit(72);
- }
-#endif
- if (inPipe) inPipe->close(Pipe::CLOSE_READ);
- if (outPipe) outPipe->close(Pipe::CLOSE_WRITE);
- if (errPipe) errPipe->close(Pipe::CLOSE_WRITE);
- return new ProcessHandleImpl(pid);
-}
-
-
-void ProcessImpl::killImpl(PIDImpl pid)
-{
- if (kill(pid, SIGKILL) != 0)
- {
- switch (errno)
- {
- case ESRCH:
- throw NotFoundException("cannot kill process");
- case EPERM:
- throw NoPermissionException("cannot kill process");
- default:
- throw SystemException("cannot kill process");
- }
- }
-}
-
-
-void ProcessImpl::requestTerminationImpl(PIDImpl pid)
-{
- if (kill(pid, SIGINT) != 0)
- {
- switch (errno)
- {
- case ESRCH:
- throw NotFoundException("cannot terminate process");
- case EPERM:
- throw NoPermissionException("cannot terminate process");
- default:
- throw SystemException("cannot terminate process");
- }
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Process_VMS.cpp b/Utilities/Poco/Foundation/src/Process_VMS.cpp
deleted file mode 100755
index 717f2d6c03..0000000000
--- a/Utilities/Poco/Foundation/src/Process_VMS.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// Process_VMS.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Process
-//
-// Copyright (c) 2004-2006, 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/Process_VMS.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/NamedEvent.h"
-#include <times.h>
-#include <time.h>
-
-
-namespace Poco {
-
-
-//
-// ProcessHandleImpl
-//
-ProcessHandleImpl::ProcessHandleImpl(pid_t pid):
- _pid(pid)
-{
-}
-
-
-ProcessHandleImpl::~ProcessHandleImpl()
-{
-}
-
-
-pid_t ProcessHandleImpl::id() const
-{
- return _pid;
-}
-
-
-int ProcessHandleImpl::wait() const
-{
- int status;
- if (waitpid(_pid, &status, 0) != _pid)
- throw SystemException("Cannot wait for process", NumberFormatter::format(_pid));
- return WEXITSTATUS(status);
-}
-
-
-//
-// ProcessImpl
-//
-ProcessImpl::PIDImpl ProcessImpl::idImpl()
-{
- return getpid();
-}
-
-
-void ProcessImpl::timesImpl(long& userTime, long& kernelTime)
-{
- struct tms buffer;
- times(&buffer)*1000/CLOCKS_PER_SEC;
- userTime = buffer.tms_utime/CLOCKS_PER_SEC;
- kernelTime = buffer.tms_stime/CLOCKS_PER_SEC;
-}
-
-
-ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe)
-{
- char** argv = new char*[args.size() + 2];
- int i = 0;
- argv[i++] = const_cast<char*>(command.c_str());
- for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it)
- argv[i++] = const_cast<char*>(it->c_str());
- argv[i] = NULL;
- try
- {
- int pid = vfork();
- if (pid < 0)
- {
- throw SystemException("Cannot fork process for", command);
- }
- else if (pid == 0)
- {
- if (execvp(command.c_str(), argv) == -1)
- throw SystemException("Cannot execute command", command);
- }
- else
- {
- delete [] argv;
- return new ProcessHandleImpl(pid);
- }
- }
- catch (...)
- {
- delete [] argv;
- throw;
- }
-}
-
-
-void ProcessImpl::killImpl(PIDImpl pid)
-{
- if (kill(pid, SIGKILL) != 0)
- {
- switch (errno)
- {
- case ESRCH:
- throw NotFoundException("cannot kill process");
- case EPERM:
- throw NoPermissionException("cannot kill process");
- default:
- throw SystemException("cannot kill process");
- }
- }
-}
-
-
-void ProcessImpl::requestTerminationImpl(PIDImpl pid)
-{
- std::string evName("POCOTRM");
- evName.append(NumberFormatter::formatHex(pid, 8));
- NamedEvent ev(evName);
- ev.set();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Process_WIN32.cpp b/Utilities/Poco/Foundation/src/Process_WIN32.cpp
deleted file mode 100755
index 281d8c64aa..0000000000
--- a/Utilities/Poco/Foundation/src/Process_WIN32.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-//
-// Process_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Process
-//
-// Copyright (c) 2004-2006, 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/Process_WIN32.h"
-#include "Poco/Exception.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/NamedEvent.h"
-#include "Poco/Pipe.h"
-
-
-namespace Poco {
-
-
-//
-// ProcessHandleImpl
-//
-ProcessHandleImpl::ProcessHandleImpl(HANDLE hProcess, UInt32 pid):
- _hProcess(hProcess),
- _pid(pid)
-{
-}
-
-
-ProcessHandleImpl::~ProcessHandleImpl()
-{
- CloseHandle(_hProcess);
-}
-
-
-UInt32 ProcessHandleImpl::id() const
-{
- return _pid;
-}
-
-
-int ProcessHandleImpl::wait() const
-{
- DWORD rc = WaitForSingleObject(_hProcess, INFINITE);
- if (rc != WAIT_OBJECT_0)
- throw SystemException("Wait failed for process", NumberFormatter::format(_pid));
-
- DWORD exitCode;
- if (GetExitCodeProcess(_hProcess, &exitCode) == 0)
- throw SystemException("Cannot get exit code for process", NumberFormatter::format(_pid));
-
- return exitCode;
-}
-
-
-//
-// ProcessImpl
-//
-ProcessImpl::PIDImpl ProcessImpl::idImpl()
-{
- return GetCurrentProcessId();
-}
-
-
-void ProcessImpl::timesImpl(long& userTime, long& kernelTime)
-{
- FILETIME ftCreation;
- FILETIME ftExit;
- FILETIME ftKernel;
- FILETIME ftUser;
-
- if (GetProcessTimes(GetCurrentProcess(), &ftCreation, &ftExit, &ftKernel, &ftUser) != 0)
- {
- ULARGE_INTEGER time;
- time.LowPart = ftKernel.dwLowDateTime;
- time.HighPart = ftKernel.dwHighDateTime;
- kernelTime = long(time.QuadPart/10000000L);
- time.LowPart = ftUser.dwLowDateTime;
- time.HighPart = ftUser.dwHighDateTime;
- userTime = long(time.QuadPart/10000000L);
- }
- else
- {
- userTime = kernelTime = -1;
- }
-}
-
-
-ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe)
-{
- std::string commandLine = command;
- for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it)
- {
- commandLine.append(" ");
- commandLine.append(*it);
- }
-
- STARTUPINFO startupInfo;
- GetStartupInfo(&startupInfo); // take defaults from current process
- startupInfo.cb = sizeof(STARTUPINFO);
- startupInfo.lpReserved = NULL;
- startupInfo.lpDesktop = NULL;
- startupInfo.lpTitle = NULL;
- startupInfo.dwFlags = STARTF_FORCEOFFFEEDBACK | STARTF_USESTDHANDLES;
- startupInfo.cbReserved2 = 0;
- startupInfo.lpReserved2 = NULL;
-
- HANDLE hProc = GetCurrentProcess();
- if (inPipe)
- {
- DuplicateHandle(hProc, inPipe->readHandle(), hProc, &startupInfo.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS);
- inPipe->close(Pipe::CLOSE_READ);
- }
- else DuplicateHandle(hProc, GetStdHandle(STD_INPUT_HANDLE), hProc, &startupInfo.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS);
- // outPipe may be the same as errPipe, so we duplicate first and close later.
- if (outPipe)
- DuplicateHandle(hProc, outPipe->writeHandle(), hProc, &startupInfo.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS);
- else
- DuplicateHandle(hProc, GetStdHandle(STD_OUTPUT_HANDLE), hProc, &startupInfo.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS);
- if (errPipe)
- DuplicateHandle(hProc, errPipe->writeHandle(), hProc, &startupInfo.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS);
- else
- DuplicateHandle(hProc, GetStdHandle(STD_ERROR_HANDLE), hProc, &startupInfo.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS);
- if (outPipe) outPipe->close(Pipe::CLOSE_WRITE);
- if (errPipe) errPipe->close(Pipe::CLOSE_WRITE);
-
- PROCESS_INFORMATION processInfo;
- BOOL rc = CreateProcessA(
- NULL,
- const_cast<char*>(commandLine.c_str()),
- NULL,
- NULL,
- TRUE,
- 0,
- NULL,
- NULL,
- &startupInfo,
- &processInfo
- );
- CloseHandle(startupInfo.hStdInput);
- CloseHandle(startupInfo.hStdOutput);
- CloseHandle(startupInfo.hStdError);
- if (rc)
- {
- CloseHandle(processInfo.hThread);
- return new ProcessHandleImpl(processInfo.hProcess, processInfo.dwProcessId);
- }
- else throw SystemException("Cannot launch process", command);
-}
-
-
-void ProcessImpl::killImpl(PIDImpl pid)
-{
- HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
- if (hProc)
- {
- if (TerminateProcess(hProc, 0) == 0)
- {
- CloseHandle(hProc);
- throw SystemException("cannot kill process");
- }
- CloseHandle(hProc);
- }
- else
- {
- switch (GetLastError())
- {
- case ERROR_ACCESS_DENIED:
- throw NoPermissionException("cannot kill process");
- case ERROR_NOT_FOUND:
- throw NotFoundException("cannot kill process");
- default:
- throw SystemException("cannot kill process");
- }
- }
-}
-
-
-void ProcessImpl::requestTerminationImpl(PIDImpl pid)
-{
- std::string evName("POCOTRM");
- evName.append(NumberFormatter::formatHex(pid, 8));
- NamedEvent ev(evName);
- ev.set();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Process_WIN32U.cpp b/Utilities/Poco/Foundation/src/Process_WIN32U.cpp
deleted file mode 100755
index 795121474f..0000000000
--- a/Utilities/Poco/Foundation/src/Process_WIN32U.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-//
-// Process_WIN32U.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: Process
-//
-// Copyright (c) 2004-2006, 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/Process_WIN32U.h"
-#include "Poco/Exception.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/NamedEvent.h"
-#include "Poco/UnicodeConverter.h"
-#include "Poco/Pipe.h"
-
-
-namespace Poco {
-
-
-//
-// ProcessHandleImpl
-//
-ProcessHandleImpl::ProcessHandleImpl(HANDLE hProcess, UInt32 pid):
- _hProcess(hProcess),
- _pid(pid)
-{
-}
-
-
-ProcessHandleImpl::~ProcessHandleImpl()
-{
- CloseHandle(_hProcess);
-}
-
-
-UInt32 ProcessHandleImpl::id() const
-{
- return _pid;
-}
-
-
-int ProcessHandleImpl::wait() const
-{
- DWORD rc = WaitForSingleObject(_hProcess, INFINITE);
- if (rc != WAIT_OBJECT_0)
- throw SystemException("Wait failed for process", NumberFormatter::format(_pid));
-
- DWORD exitCode;
- if (GetExitCodeProcess(_hProcess, &exitCode) == 0)
- throw SystemException("Cannot get exit code for process", NumberFormatter::format(_pid));
-
- return exitCode;
-}
-
-
-//
-// ProcessImpl
-//
-ProcessImpl::PIDImpl ProcessImpl::idImpl()
-{
- return GetCurrentProcessId();
-}
-
-
-void ProcessImpl::timesImpl(long& userTime, long& kernelTime)
-{
- FILETIME ftCreation;
- FILETIME ftExit;
- FILETIME ftKernel;
- FILETIME ftUser;
-
- if (GetProcessTimes(GetCurrentProcess(), &ftCreation, &ftExit, &ftKernel, &ftUser) != 0)
- {
- ULARGE_INTEGER time;
- time.LowPart = ftKernel.dwLowDateTime;
- time.HighPart = ftKernel.dwHighDateTime;
- kernelTime = long(time.QuadPart/10000000L);
- time.LowPart = ftUser.dwLowDateTime;
- time.HighPart = ftUser.dwHighDateTime;
- userTime = long(time.QuadPart/10000000L);
- }
- else
- {
- userTime = kernelTime = -1;
- }
-}
-
-
-ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe)
-{
- std::string commandLine = command;
- for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it)
- {
- commandLine.append(" ");
- commandLine.append(*it);
- }
-
- std::wstring ucommandLine;
- UnicodeConverter::toUTF16(commandLine, ucommandLine);
-
- STARTUPINFOW startupInfo;
- GetStartupInfoW(&startupInfo); // take defaults from current process
- startupInfo.cb = sizeof(STARTUPINFO);
- startupInfo.lpReserved = NULL;
- startupInfo.lpDesktop = NULL;
- startupInfo.lpTitle = NULL;
- startupInfo.dwFlags = STARTF_FORCEOFFFEEDBACK | STARTF_USESTDHANDLES;
- startupInfo.cbReserved2 = 0;
- startupInfo.lpReserved2 = NULL;
-
- HANDLE hProc = GetCurrentProcess();
- if (inPipe)
- {
- DuplicateHandle(hProc, inPipe->readHandle(), hProc, &startupInfo.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS);
- inPipe->close(Pipe::CLOSE_READ);
- }
- else DuplicateHandle(hProc, GetStdHandle(STD_INPUT_HANDLE), hProc, &startupInfo.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS);
- // outPipe may be the same as errPipe, so we duplicate first and close later.
- if (outPipe)
- DuplicateHandle(hProc, outPipe->writeHandle(), hProc, &startupInfo.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS);
- else
- DuplicateHandle(hProc, GetStdHandle(STD_OUTPUT_HANDLE), hProc, &startupInfo.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS);
- if (errPipe)
- DuplicateHandle(hProc, errPipe->writeHandle(), hProc, &startupInfo.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS);
- else
- DuplicateHandle(hProc, GetStdHandle(STD_ERROR_HANDLE), hProc, &startupInfo.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS);
- if (outPipe) outPipe->close(Pipe::CLOSE_WRITE);
- if (errPipe) errPipe->close(Pipe::CLOSE_WRITE);
-
- PROCESS_INFORMATION processInfo;
- BOOL rc = CreateProcessW(
- NULL,
- const_cast<wchar_t*>(ucommandLine.c_str()),
- NULL,
- NULL,
- TRUE,
- 0,
- NULL,
- NULL,
- &startupInfo,
- &processInfo
- );
- CloseHandle(startupInfo.hStdInput);
- CloseHandle(startupInfo.hStdOutput);
- CloseHandle(startupInfo.hStdError);
- if (rc)
- {
- CloseHandle(processInfo.hThread);
- return new ProcessHandleImpl(processInfo.hProcess, processInfo.dwProcessId);
- }
- else throw SystemException("Cannot launch process", command);
-}
-
-
-void ProcessImpl::killImpl(PIDImpl pid)
-{
- HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
- if (hProc)
- {
- if (TerminateProcess(hProc, 0) == 0)
- {
- CloseHandle(hProc);
- throw SystemException("cannot kill process");
- }
- CloseHandle(hProc);
- }
- else
- {
- switch (GetLastError())
- {
- case ERROR_ACCESS_DENIED:
- throw NoPermissionException("cannot kill process");
- case ERROR_NOT_FOUND:
- throw NotFoundException("cannot kill process");
- default:
- throw SystemException("cannot kill process");
- }
- }
-}
-
-
-void ProcessImpl::requestTerminationImpl(PIDImpl pid)
-{
- std::string evName("POCOTRM");
- evName.append(NumberFormatter::formatHex(pid, 8));
- NamedEvent ev(evName);
- ev.set();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/PurgeStrategy.cpp b/Utilities/Poco/Foundation/src/PurgeStrategy.cpp
deleted file mode 100755
index dc1ba8eb54..0000000000
--- a/Utilities/Poco/Foundation/src/PurgeStrategy.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-//
-// PurgeStrategy.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: FileChannel
-//
-// Copyright (c) 2004-2006, 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/PurgeStrategy.h"
-#include "Poco/Path.h"
-#include "Poco/DirectoryIterator.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-
-
-//
-// PurgeStrategy
-//
-
-
-PurgeStrategy::PurgeStrategy()
-{
-}
-
-
-PurgeStrategy::~PurgeStrategy()
-{
-}
-
-
-void PurgeStrategy::list(const std::string& path, std::vector<File>& files)
-{
- Path p(path);
- p.makeAbsolute();
- Path parent = p.parent();
- std::string baseName = p.getFileName();
- baseName.append(".");
-
- DirectoryIterator it(parent);
- DirectoryIterator end;
- while (it != end)
- {
- if (it.name().compare(0, baseName.size(), baseName) == 0)
- {
- files.push_back(*it);
- }
- ++it;
- }
-}
-
-
-//
-// PurgeByAgeStrategy
-//
-
-
-PurgeByAgeStrategy::PurgeByAgeStrategy(const Timespan& age): _age(age)
-{
-}
-
-
-PurgeByAgeStrategy::~PurgeByAgeStrategy()
-{
-}
-
-
-void PurgeByAgeStrategy::purge(const std::string& path)
-{
- std::vector<File> files;
- list(path, files);
- for (std::vector<File>::iterator it = files.begin(); it != files.end(); ++it)
- {
- if (it->getLastModified().isElapsed(_age.totalMicroseconds()))
- {
- it->remove();
- }
- }
-}
-
-
-//
-// PurgeByCountStrategy
-//
-
-
-PurgeByCountStrategy::PurgeByCountStrategy(int count): _count(count)
-{
- poco_assert(count > 0);
-}
-
-
-PurgeByCountStrategy::~PurgeByCountStrategy()
-{
-}
-
-
-void PurgeByCountStrategy::purge(const std::string& path)
-{
- std::vector<File> files;
- list(path, files);
- while (files.size() > _count)
- {
- std::vector<File>::iterator it = files.begin();
- std::vector<File>::iterator purgeIt = it;
- Timestamp purgeTS = purgeIt->getLastModified();
- ++it;
- while (it != files.end())
- {
- Timestamp md(it->getLastModified());
- if (md <= purgeTS)
- {
- purgeTS = md;
- purgeIt = it;
- }
- ++it;
- }
- purgeIt->remove();
- files.erase(purgeIt);
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/RWLock.cpp b/Utilities/Poco/Foundation/src/RWLock.cpp
deleted file mode 100755
index bc60ae1597..0000000000
--- a/Utilities/Poco/Foundation/src/RWLock.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// RWLock.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: RWLock
-//
-// Copyright (c) 2004-2006, 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/RWLock.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "RWLock_WIN32.cpp"
-#else
-#include "RWLock_POSIX.cpp"
-#endif
-
-
-namespace Poco {
-
-
-RWLock::RWLock()
-{
-}
-
-
-RWLock::~RWLock()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/RWLock_POSIX.cpp b/Utilities/Poco/Foundation/src/RWLock_POSIX.cpp
deleted file mode 100755
index ace0045b5e..0000000000
--- a/Utilities/Poco/Foundation/src/RWLock_POSIX.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// RWLock_POSIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: RWLock
-//
-// Copyright (c) 2004-2006, 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/RWLock_POSIX.h"
-
-
-namespace Poco {
-
-
-RWLockImpl::RWLockImpl()
-{
- if (pthread_rwlock_init(&_rwl, NULL))
- throw SystemException("cannot create reader/writer lock");
-}
-
-
-RWLockImpl::~RWLockImpl()
-{
- pthread_rwlock_destroy(&_rwl);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/RWLock_WIN32.cpp b/Utilities/Poco/Foundation/src/RWLock_WIN32.cpp
deleted file mode 100755
index 7195799868..0000000000
--- a/Utilities/Poco/Foundation/src/RWLock_WIN32.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-//
-// RWLock_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: RWLock
-//
-// Copyright (c) 2004-2006, 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/RWLock_WIN32.h"
-
-
-namespace Poco {
-
-
-RWLockImpl::RWLockImpl(): _readers(0), _writersWaiting(0), _writers(0)
-{
- _mutex = CreateMutexW(NULL, FALSE, NULL);
- if (_mutex == NULL)
- throw SystemException("cannot create reader/writer lock");
-
- _readEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
- if (_readEvent == NULL)
- throw SystemException("cannot create reader/writer lock");
-
- _writeEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
- if (_writeEvent == NULL)
- throw SystemException("cannot create reader/writer lock");
-}
-
-
-RWLockImpl::~RWLockImpl()
-{
- CloseHandle(_mutex);
- CloseHandle(_readEvent);
- CloseHandle(_writeEvent);
-}
-
-
-inline void RWLockImpl::addWriter()
-{
- switch (WaitForSingleObject(_mutex, INFINITE))
- {
- case WAIT_OBJECT_0:
- if (++_writersWaiting == 1) ResetEvent(_readEvent);
- ReleaseMutex(_mutex);
- break;
- default:
- throw SystemException("cannot lock reader/writer lock");
- }
-}
-
-
-inline void RWLockImpl::removeWriter()
-{
- switch (WaitForSingleObject(_mutex, INFINITE))
- {
- case WAIT_OBJECT_0:
- if (--_writersWaiting == 0 && _writers == 0) SetEvent(_readEvent);
- ReleaseMutex(_mutex);
- break;
- default:
- throw SystemException("cannot lock reader/writer lock");
- }
-}
-
-
-void RWLockImpl::readLockImpl()
-{
- HANDLE h[2];
- h[0] = _mutex;
- h[1] = _readEvent;
- switch (WaitForMultipleObjects(2, h, TRUE, INFINITE))
- {
- case WAIT_OBJECT_0:
- case WAIT_OBJECT_0 + 1:
- ++_readers;
- ResetEvent(_writeEvent);
- ReleaseMutex(_mutex);
- poco_assert_dbg(_writers == 0);
- break;
- default:
- throw SystemException("cannot lock reader/writer lock");
- }
-}
-
-
-bool RWLockImpl::tryReadLockImpl()
-{
- HANDLE h[2];
- h[0] = _mutex;
- h[1] = _readEvent;
- switch (WaitForMultipleObjects(2, h, TRUE, 1))
- {
- case WAIT_OBJECT_0:
- case WAIT_OBJECT_0 + 1:
- ++_readers;
- ResetEvent(_writeEvent);
- ReleaseMutex(_mutex);
- poco_assert_dbg(_writers == 0);
- return true;
- case WAIT_TIMEOUT:
- return false;
- default:
- throw SystemException("cannot lock reader/writer lock");
- }
-}
-
-
-void RWLockImpl::writeLockImpl()
-{
- addWriter();
- HANDLE h[2];
- h[0] = _mutex;
- h[1] = _writeEvent;
- switch (WaitForMultipleObjects(2, h, TRUE, INFINITE))
- {
- case WAIT_OBJECT_0:
- case WAIT_OBJECT_0 + 1:
- --_writersWaiting;
- ++_readers;
- ++_writers;
- ResetEvent(_readEvent);
- ResetEvent(_writeEvent);
- ReleaseMutex(_mutex);
- poco_assert_dbg(_writers == 1);
- break;
- default:
- removeWriter();
- throw SystemException("cannot lock reader/writer lock");
- }
-}
-
-
-bool RWLockImpl::tryWriteLockImpl()
-{
- addWriter();
- HANDLE h[2];
- h[0] = _mutex;
- h[1] = _writeEvent;
- switch (WaitForMultipleObjects(2, h, TRUE, 1))
- {
- case WAIT_OBJECT_0:
- case WAIT_OBJECT_0 + 1:
- --_writersWaiting;
- ++_readers;
- ++_writers;
- ResetEvent(_readEvent);
- ResetEvent(_writeEvent);
- ReleaseMutex(_mutex);
- poco_assert_dbg(_writers == 1);
- return true;
- case WAIT_TIMEOUT:
- removeWriter();
- return false;
- default:
- removeWriter();
- throw SystemException("cannot lock reader/writer lock");
- }
-}
-
-
-void RWLockImpl::unlockImpl()
-{
- switch (WaitForSingleObject(_mutex, INFINITE))
- {
- case WAIT_OBJECT_0:
- _writers = 0;
- if (_writersWaiting == 0) SetEvent(_readEvent);
- if (--_readers == 0) SetEvent(_writeEvent);
- ReleaseMutex(_mutex);
- break;
- default:
- throw SystemException("cannot unlock reader/writer lock");
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Random.cpp b/Utilities/Poco/Foundation/src/Random.cpp
deleted file mode 100755
index 3548a10984..0000000000
--- a/Utilities/Poco/Foundation/src/Random.cpp
+++ /dev/null
@@ -1,379 +0,0 @@
-//
-// Random.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: Random
-//
-// Definition of class Random.
-//
-// Copyright (c) 2004-2006, 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.
-//
-//
-// Based on the FreeBSD random number generator.
-// src/lib/libc/stdlib/random.c,v 1.25
-//
-// Copyright (c) 1983, 1993
-// The Regents of the University of California. All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 4. Neither the name of the University nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE.
-//
-
-
-#include "Poco/Random.h"
-#include "Poco/RandomStream.h"
-#include <ctime>
-
-
-/*
- * random.c:
- *
- * An improved random number generation package. In addition to the standard
- * rand()/srand() like interface, this package also has a special state info
- * interface. The initstate() routine is called with a seed, an array of
- * bytes, and a count of how many bytes are being passed in; this array is
- * then initialized to contain information for random number generation with
- * that much state information. Good sizes for the amount of state
- * information are 32, 64, 128, and 256 bytes. The state can be switched by
- * calling the setstate() routine with the same array as was initiallized
- * with initstate(). By default, the package runs with 128 bytes of state
- * information and generates far better random numbers than a linear
- * congruential generator. If the amount of state information is less than
- * 32 bytes, a simple linear congruential R.N.G. is used.
- *
- * Internally, the state information is treated as an array of uint32_t's; the
- * zeroeth element of the array is the type of R.N.G. being used (small
- * integer); the remainder of the array is the state information for the
- * R.N.G. Thus, 32 bytes of state information will give 7 ints worth of
- * state information, which will allow a degree seven polynomial. (Note:
- * the zeroeth word of state information also has some other information
- * stored in it -- see setstate() for details).
- *
- * The random number generation technique is a linear feedback shift register
- * approach, employing trinomials (since there are fewer terms to sum up that
- * way). In this approach, the least significant bit of all the numbers in
- * the state table will act as a linear feedback shift register, and will
- * have period 2^deg - 1 (where deg is the degree of the polynomial being
- * used, assuming that the polynomial is irreducible and primitive). The
- * higher order bits will have longer periods, since their values are also
- * influenced by pseudo-random carries out of the lower bits. The total
- * period of the generator is approximately deg*(2**deg - 1); thus doubling
- * the amount of state information has a vast influence on the period of the
- * generator. Note: the deg*(2**deg - 1) is an approximation only good for
- * large deg, when the period of the shift is the dominant factor.
- * With deg equal to seven, the period is actually much longer than the
- * 7*(2**7 - 1) predicted by this formula.
- *
- * Modified 28 December 1994 by Jacob S. Rosenberg.
- * The following changes have been made:
- * All references to the type u_int have been changed to unsigned long.
- * All references to type int have been changed to type long. Other
- * cleanups have been made as well. A warning for both initstate and
- * setstate has been inserted to the effect that on Sparc platforms
- * the 'arg_state' variable must be forced to begin on word boundaries.
- * This can be easily done by casting a long integer array to char *.
- * The overall logic has been left STRICTLY alone. This software was
- * tested on both a VAX and Sun SpacsStation with exactly the same
- * results. The new version and the original give IDENTICAL results.
- * The new version is somewhat faster than the original. As the
- * documentation says: "By default, the package runs with 128 bytes of
- * state information and generates far better random numbers than a linear
- * congruential generator. If the amount of state information is less than
- * 32 bytes, a simple linear congruential R.N.G. is used." For a buffer of
- * 128 bytes, this new version runs about 19 percent faster and for a 16
- * byte buffer it is about 5 percent faster.
- */
-
-
-/*
- * For each of the currently supported random number generators, we have a
- * break value on the amount of state information (you need at least this
- * many bytes of state info to support this random number generator), a degree
- * for the polynomial (actually a trinomial) that the R.N.G. is based on, and
- * the separation between the two lower order coefficients of the trinomial.
- */
-#define TYPE_0 0 /* linear congruential */
-#define BREAK_0 8
-#define DEG_0 0
-#define SEP_0 0
-
-#define TYPE_1 1 /* x**7 + x**3 + 1 */
-#define BREAK_1 32
-#define DEG_1 7
-#define SEP_1 3
-
-#define TYPE_2 2 /* x**15 + x + 1 */
-#define BREAK_2 64
-#define DEG_2 15
-#define SEP_2 1
-
-#define TYPE_3 3 /* x**31 + x**3 + 1 */
-#define BREAK_3 128
-#define DEG_3 31
-#define SEP_3 3
-
-#define TYPE_4 4 /* x**63 + x + 1 */
-#define BREAK_4 256
-#define DEG_4 63
-#define SEP_4 1
-
-
-namespace Poco {
-
-
-Random::Random(int stateSize)
-{
- poco_assert (BREAK_0 <= stateSize && stateSize <= BREAK_4);
-
- _pBuffer = new char[stateSize];
- initState((UInt32) std::time(NULL), _pBuffer, stateSize);
-}
-
-
-Random::~Random()
-{
- delete [] _pBuffer;
-}
-
-
-/*
- * Compute x = (7^5 * x) mod (2^31 - 1)
- * wihout overflowing 31 bits:
- * (2^31 - 1) = 127773 * (7^5) + 2836
- * From "Random number generators: good ones are hard to find",
- * Park and Miller, Communications of the ACM, vol. 31, no. 10,
- * October 1988, p. 1195.
- */
-inline UInt32 Random::goodRand(Int32 x)
-{
- Int32 hi, lo;
-
- if (x == 0) x = 123459876;
- hi = x / 127773;
- lo = x % 127773;
- x = 16807 * lo - 2836 * hi;
- if (x < 0) x += 0x7FFFFFFF;
-
- return x;
-}
-
-
-/*
- * Initialize the random number generator based on the given seed. If the
- * type is the trivial no-state-information type, just remember the seed.
- * Otherwise, initializes state[] based on the given "seed" via a linear
- * congruential generator. Then, the pointers are set to known locations
- * that are exactly rand_sep places apart. Lastly, it cycles the state
- * information a given number of times to get rid of any initial dependencies
- * introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
- * for default usage relies on values produced by this routine.
- */
-void Random::seed(UInt32 x)
-{
- int i, lim;
-
- _state[0] = x;
- if (_randType == TYPE_0)
- lim = NSHUFF;
- else
- {
- for (i = 1; i < _randDeg; i++)
- _state[i] = goodRand(_state[i - 1]);
- _fptr = &_state[_randSep];
- _rptr = &_state[0];
- lim = 10 * _randDeg;
- }
- for (i = 0; i < lim; i++)
- next();
-}
-
-
-/*
- * Many programs choose the seed value in a totally predictable manner.
- * This often causes problems. We seed the generator using the much more
- * secure random(4) interface. Note that this particular seeding
- * procedure can generate states which are impossible to reproduce by
- * calling srandom() with any value, since the succeeding terms in the
- * state buffer are no longer derived from the LC algorithm applied to
- * a fixed seed.
- */
-void Random::seed()
-{
- std::streamsize len;
-
- if (_randType == TYPE_0)
- len = sizeof _state[0];
- else
- len = _randDeg * sizeof _state[0];
-
- RandomInputStream rstr;
- rstr.read((char*) _state, len);
-}
-
-
-/*
- * Initialize the state information in the given array of n bytes for future
- * random number generation. Based on the number of bytes we are given, and
- * the break values for the different R.N.G.'s, we choose the best (largest)
- * one we can and set things up for it. srandom() is then called to
- * initialize the state information.
- *
- * Note that on return from srandom(), we set state[-1] to be the type
- * multiplexed with the current value of the rear pointer; this is so
- * successive calls to initstate() won't lose this information and will be
- * able to restart with setstate().
- *
- * Note: the first thing we do is save the current state, if any, just like
- * setstate() so that it doesn't matter when initstate is called.
- *
- * Returns a pointer to the old state.
- *
- * Note: The Sparc platform requires that arg_state begin on an int
- * word boundary; otherwise a bus error will occur. Even so, lint will
- * complain about mis-alignment, but you should disregard these messages.
- */
-void Random::initState(UInt32 s, char* argState, Int32 n)
-{
- UInt32* intArgState = (UInt32*) argState;
-
- if (n < BREAK_0)
- {
- poco_bugcheck_msg("not enough state");
- return;
- }
- if (n < BREAK_1)
- {
- _randType = TYPE_0;
- _randDeg = DEG_0;
- _randSep = SEP_0;
- }
- else if (n < BREAK_2)
- {
- _randType = TYPE_1;
- _randDeg = DEG_1;
- _randSep = SEP_1;
- }
- else if (n < BREAK_3)
- {
- _randType = TYPE_2;
- _randDeg = DEG_2;
- _randSep = SEP_2;
- }
- else if (n < BREAK_4)
- {
- _randType = TYPE_3;
- _randDeg = DEG_3;
- _randSep = SEP_3;
- }
- else
- {
- _randType = TYPE_4;
- _randDeg = DEG_4;
- _randSep = SEP_4;
- }
- _state = intArgState + 1; /* first location */
- _endPtr = &_state[_randDeg]; /* must set end_ptr before seed */
- seed(s);
- if (_randType == TYPE_0)
- intArgState[0] = _randType;
- else
- intArgState[0] = MAX_TYPES * (int) (_rptr - _state) + _randType;
-}
-
-
-/*
- * Next:
- *
- * If we are using the trivial TYPE_0 R.N.G., just do the old linear
- * congruential bit. Otherwise, we do our fancy trinomial stuff, which is
- * the same in all the other cases due to all the global variables that have
- * been set up. The basic operation is to add the number at the rear pointer
- * into the one at the front pointer. Then both pointers are advanced to
- * the next location cyclically in the table. The value returned is the sum
- * generated, reduced to 31 bits by throwing away the "least random" low bit.
- *
- * Note: the code takes advantage of the fact that both the front and
- * rear pointers can't wrap on the same call by not testing the rear
- * pointer if the front one has wrapped.
- *
- * Returns a 31-bit random number.
- */
-UInt32 Random::next()
-{
- UInt32 i;
- UInt32 *f, *r;
-
- if (_randType == TYPE_0)
- {
- i = _state[0];
- _state[0] = i = goodRand(i) & 0x7FFFFFFF;
- }
- else
- {
- /*
- * Use local variables rather than static variables for speed.
- */
- f = _fptr; r = _rptr;
- *f += *r;
- i = (*f >> 1) & 0x7FFFFFFF; /* chucking least random bit */
- if (++f >= _endPtr) {
- f = _state;
- ++r;
- }
- else if (++r >= _endPtr) {
- r = _state;
- }
-
- _fptr = f; _rptr = r;
- }
- return i;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/RandomStream.cpp b/Utilities/Poco/Foundation/src/RandomStream.cpp
deleted file mode 100755
index 6b8e145bec..0000000000
--- a/Utilities/Poco/Foundation/src/RandomStream.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// RandomStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: RandomStream
-//
-// Copyright (c) 2004-2006, 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/RandomStream.h"
-#include "Poco/Random.h"
-#include "Poco/SHA1Engine.h"
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/UnWindows.h"
-#include <wincrypt.h>
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include <fcntl.h>
-#include <unistd.h>
-#endif
-#include <ctime>
-
-
-namespace Poco {
-
-
-RandomBuf::RandomBuf(): BufferedStreamBuf(256, std::ios::in)
-{
-}
-
-
-RandomBuf::~RandomBuf()
-{
-}
-
-
-int RandomBuf::readFromDevice(char* buffer, std::streamsize length)
-{
- int n = 0;
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
- HCRYPTPROV hProvider = 0;
- CryptAcquireContext(&hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
- CryptGenRandom(hProvider, (DWORD) length, (BYTE*) buffer);
- CryptReleaseContext(hProvider, 0);
- n = static_cast<int>(length);
-#else
- #if defined(POCO_OS_FAMILY_UNIX)
- int fd = open("/dev/urandom", O_RDONLY, 0);
- if (fd >= 0)
- {
- n = read(fd, buffer, length);
- close(fd);
- }
- #endif
- if (n <= 0)
- {
- // x is here as a source of randomness, so it does not make
- // much sense to protect it with a Mutex.
- static UInt32 x = 0;
- Random rnd1(256);
- Random rnd2(64);
- x += rnd1.next();
-
- n = 0;
- SHA1Engine engine;
- UInt32 t = (UInt32) std::time(NULL);
- engine.update(&t, sizeof(t));
- void* p = this;
- engine.update(&p, sizeof(p));
- engine.update(buffer, length);
- UInt32 junk[32];
- engine.update(junk, sizeof(junk));
- while (n < length)
- {
- for (int i = 0; i < 100; ++i)
- {
- UInt32 r = rnd2.next();
- engine.update(&r, sizeof(r));
- engine.update(&x, sizeof(x));
- x += rnd1.next();
- }
- DigestEngine::Digest d = engine.digest();
- for (DigestEngine::Digest::const_iterator it = d.begin(); it != d.end() && n < length; ++it, ++n)
- {
- engine.update(*it);
- *buffer++ = *it++;
- }
- }
- }
-#endif
- return n;
-}
-
-
-RandomIOS::RandomIOS()
-{
- poco_ios_init(&_buf);
-}
-
-
-RandomIOS::~RandomIOS()
-{
-}
-
-
-RandomBuf* RandomIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-RandomInputStream::RandomInputStream(): std::istream(&_buf)
-{
-}
-
-
-RandomInputStream::~RandomInputStream()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/RefCountedObject.cpp b/Utilities/Poco/Foundation/src/RefCountedObject.cpp
deleted file mode 100755
index 1121e9281f..0000000000
--- a/Utilities/Poco/Foundation/src/RefCountedObject.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// RefCountedObject.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: RefCountedObject
-//
-// Copyright (c) 2004-2006, 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/RefCountedObject.h"
-
-
-namespace Poco {
-
-
-RefCountedObject::RefCountedObject(): _counter(1)
-{
-}
-
-
-RefCountedObject::~RefCountedObject()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/RegularExpression.cpp b/Utilities/Poco/Foundation/src/RegularExpression.cpp
deleted file mode 100755
index 34afd7d250..0000000000
--- a/Utilities/Poco/Foundation/src/RegularExpression.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-//
-// RegularExpression.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: RegExp
-// Module: RegularExpression
-//
-// Copyright (c) 2004-2006, 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/RegularExpression.h"
-#include "Poco/Exception.h"
-#include <sstream>
-#include "pcre.h"
-
-
-namespace Poco {
-
-
-const int RegularExpression::OVEC_SIZE = 64;
-
-
-RegularExpression::RegularExpression(const std::string& pattern, int options, bool study): _pcre(0), _extra(0)
-{
- const char* error;
- int offs;
- _pcre = pcre_compile(pattern.c_str(), options, &error, &offs, 0);
- if (!_pcre)
- {
- std::ostringstream msg;
- msg << error << " (at offset " << offs << ")";
- throw RegularExpressionException(msg.str());
- }
- if (study)
- _extra = pcre_study(_pcre, 0, &error);
-}
-
-
-RegularExpression::~RegularExpression()
-{
- if (_pcre) pcre_free(_pcre);
- if (_extra) pcre_free(_extra);
-}
-
-
-int RegularExpression::match(const std::string& subject, std::string::size_type offset, Match& mtch, int options) const
-{
- poco_assert (offset <= subject.length());
-
- int ovec[OVEC_SIZE];
- int rc = pcre_exec(_pcre, _extra, subject.c_str(), int(subject.size()), int(offset), options & 0xFFFF, ovec, OVEC_SIZE);
- if (rc == PCRE_ERROR_NOMATCH)
- {
- mtch.offset = std::string::npos;
- mtch.length = 0;
- return 0;
- }
- else if (rc == PCRE_ERROR_BADOPTION)
- {
- throw RegularExpressionException("bad option");
- }
- else if (rc == 0)
- {
- throw RegularExpressionException("too many captured substrings");
- }
- else if (rc < 0)
- {
- std::ostringstream msg;
- msg << "PCRE error " << rc;
- throw RegularExpressionException(msg.str());
- }
- mtch.offset = ovec[0] < 0 ? std::string::npos : ovec[0];
- mtch.length = ovec[1] - mtch.offset;
- return rc;
-}
-
-
-int RegularExpression::match(const std::string& subject, std::string::size_type offset, MatchVec& matches, int options) const
-{
- poco_assert (offset <= subject.length());
-
- matches.clear();
-
- int ovec[OVEC_SIZE];
- int rc = pcre_exec(_pcre, _extra, subject.c_str(), int(subject.size()), int(offset), options & 0xFFFF, ovec, OVEC_SIZE);
- if (rc == PCRE_ERROR_NOMATCH)
- {
- return 0;
- }
- else if (rc == PCRE_ERROR_BADOPTION)
- {
- throw RegularExpressionException("bad option");
- }
- else if (rc == 0)
- {
- throw RegularExpressionException("too many captured substrings");
- }
- else if (rc < 0)
- {
- std::ostringstream msg;
- msg << "PCRE error " << rc;
- throw RegularExpressionException(msg.str());
- }
- matches.reserve(rc);
- for (int i = 0; i < rc; ++i)
- {
- Match m;
- m.offset = ovec[i*2] < 0 ? std::string::npos : ovec[i*2] ;
- m.length = ovec[i*2 + 1] - m.offset;
- matches.push_back(m);
- }
- return rc;
-}
-
-
-bool RegularExpression::match(const std::string& subject, std::string::size_type offset) const
-{
- Match mtch;
- match(subject, offset, mtch, RE_ANCHORED | RE_NOTEMPTY);
- return mtch.offset == offset && mtch.length == subject.length() - offset;
-}
-
-
-bool RegularExpression::match(const std::string& subject, std::string::size_type offset, int options) const
-{
- Match mtch;
- match(subject, offset, mtch, options);
- return mtch.offset == offset && mtch.length == subject.length() - offset;
-}
-
-
-int RegularExpression::extract(const std::string& subject, std::string& str, int options) const
-{
- Match mtch;
- int rc = match(subject, 0, mtch, options);
- if (mtch.offset != std::string::npos)
- str.assign(subject, mtch.offset, mtch.length);
- else
- str.clear();
- return rc;
-}
-
-
-int RegularExpression::extract(const std::string& subject, std::string::size_type offset, std::string& str, int options) const
-{
- Match mtch;
- int rc = match(subject, offset, mtch, options);
- if (mtch.offset != std::string::npos)
- str.assign(subject, mtch.offset, mtch.length);
- else
- str.clear();
- return rc;
-}
-
-
-int RegularExpression::split(const std::string& subject, std::string::size_type offset, std::vector<std::string>& strings, int options) const
-{
- MatchVec matches;
- strings.clear();
- int rc = match(subject, offset, matches, options);
- strings.reserve(matches.size());
- for (MatchVec::const_iterator it = matches.begin(); it != matches.end(); ++it)
- {
- if (it->offset != std::string::npos)
- strings.push_back(subject.substr(it->offset, it->length));
- else
- strings.push_back(std::string());
- }
- return rc;
-}
-
-
-int RegularExpression::subst(std::string& subject, std::string::size_type offset, const std::string& replacement, int options) const
-{
- if (options & RE_GLOBAL)
- {
- int rc = 0;
- std::string::size_type pos = substOne(subject, offset, replacement, options);
- while (pos != std::string::npos)
- {
- ++rc;
- pos = substOne(subject, pos, replacement, options);
- }
- return rc;
- }
- else
- {
- return substOne(subject, offset, replacement, options) != std::string::npos ? 1 : 0;
- }
-}
-
-
-std::string::size_type RegularExpression::substOne(std::string& subject, std::string::size_type offset, const std::string& replacement, int options) const
-{
- if (offset >= subject.length()) return std::string::npos;
-
- int ovec[OVEC_SIZE];
- int rc = pcre_exec(_pcre, _extra, subject.c_str(), int(subject.size()), int(offset), options & 0xFFFF, ovec, OVEC_SIZE);
- if (rc == PCRE_ERROR_NOMATCH)
- {
- return std::string::npos;
- }
- else if (rc == PCRE_ERROR_BADOPTION)
- {
- throw RegularExpressionException("bad option");
- }
- else if (rc == 0)
- {
- throw RegularExpressionException("too many captured substrings");
- }
- else if (rc < 0)
- {
- std::ostringstream msg;
- msg << "PCRE error " << rc;
- throw RegularExpressionException(msg.str());
- }
- std::string result;
- std::string::size_type len = subject.length();
- std::string::size_type pos = 0;
- std::string::size_type rp = std::string::npos;
- while (pos < len)
- {
- if (ovec[0] == pos)
- {
- std::string::const_iterator it = replacement.begin();
- std::string::const_iterator end = replacement.end();
- while (it != end)
- {
- if (*it == '$' && !(options & RE_NO_VARS))
- {
- ++it;
- if (it != end)
- {
- char d = *it;
- if (d >= '0' && d <= '9')
- {
- int c = d - '0';
- if (c < rc)
- {
- int o = ovec[c*2];
- int l = ovec[c*2 + 1] - o;
- result.append(subject, o, l);
- }
- }
- else
- {
- result += '$';
- result += d;
- }
- ++it;
- }
- else result += '$';
- }
- else result += *it++;
- }
- pos = ovec[1];
- rp = result.length();
- }
- else result += subject[pos++];
- }
- subject = result;
- return rp;
-}
-
-
-bool RegularExpression::match(const std::string& subject, const std::string& pattern, int options)
-{
- int ctorOptions = options & (RE_CASELESS | RE_MULTILINE | RE_DOTALL | RE_EXTENDED | RE_ANCHORED | RE_DOLLAR_ENDONLY | RE_EXTRA | RE_UNGREEDY | RE_UTF8 | RE_NO_AUTO_CAPTURE);
- int mtchOptions = options & (RE_ANCHORED | RE_NOTBOL | RE_NOTEOL | RE_NOTEMPTY | RE_NO_AUTO_CAPTURE | RE_NO_UTF8_CHECK);
- RegularExpression re(pattern, ctorOptions, false);
- return re.match(subject, 0, mtchOptions);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/RotateStrategy.cpp b/Utilities/Poco/Foundation/src/RotateStrategy.cpp
deleted file mode 100755
index 9e4e09675f..0000000000
--- a/Utilities/Poco/Foundation/src/RotateStrategy.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// RotateStrategy.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: FileChannel
-//
-// Copyright (c) 2004-2006, 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/RotateStrategy.h"
-#include "Poco/FileStream.h"
-#include "Poco/DateTimeParser.h"
-#include "Poco/DateTimeFormatter.h"
-#include "Poco/DateTimeFormat.h"
-
-
-namespace Poco {
-
-
-//
-// RotateStrategy
-//
-
-
-RotateStrategy::RotateStrategy()
-{
-}
-
-
-RotateStrategy::~RotateStrategy()
-{
-}
-
-
-//
-// RotateByIntervalStrategy
-//
-
-
-const std::string RotateByIntervalStrategy::ROTATE_TEXT("# Log file created/rotated ");
-
-
-RotateByIntervalStrategy::RotateByIntervalStrategy(const Timespan& span):
- _span(span),
- _lastRotate(0)
-{
- if (span.totalMicroseconds() <= 0) throw InvalidArgumentException("time span must be greater than zero");
-}
-
-
-RotateByIntervalStrategy::~RotateByIntervalStrategy()
-{
-}
-
-
-bool RotateByIntervalStrategy::mustRotate(LogFile* pFile)
-{
- if (_lastRotate == 0 || pFile->size() == 0)
- {
- if (pFile->size() != 0)
- {
- Poco::FileInputStream istr(pFile->path());
- std::string tag;
- std::getline(istr, tag);
- if (tag.compare(0, ROTATE_TEXT.size(), ROTATE_TEXT) == 0)
- {
- std::string timestamp(tag, ROTATE_TEXT.size());
- int tzd;
- _lastRotate = DateTimeParser::parse(DateTimeFormat::RFC1036_FORMAT, timestamp, tzd).timestamp();
- }
- else _lastRotate = pFile->creationDate();
- }
- else
- {
- _lastRotate.update();
- std::string tag(ROTATE_TEXT);
- DateTimeFormatter::append(tag, _lastRotate, DateTimeFormat::RFC1036_FORMAT);
- pFile->write(tag);
- }
- }
- Timestamp now;
- return _span <= now - _lastRotate;
-}
-
-
-//
-// RotateBySizeStrategy
-//
-
-
-RotateBySizeStrategy::RotateBySizeStrategy(UInt64 size): _size(size)
-{
- if (size == 0) throw InvalidArgumentException("size must be greater than zero");
-}
-
-
-RotateBySizeStrategy::~RotateBySizeStrategy()
-{
-}
-
-
-bool RotateBySizeStrategy::mustRotate(LogFile* pFile)
-{
- return pFile->size() >= _size;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Runnable.cpp b/Utilities/Poco/Foundation/src/Runnable.cpp
deleted file mode 100755
index f501228e5a..0000000000
--- a/Utilities/Poco/Foundation/src/Runnable.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Runnable.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Copyright (c) 2004-2006, 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/Runnable.h"
-
-
-namespace Poco {
-
-
-Runnable::Runnable()
-{
-}
-
-
-Runnable::~Runnable()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SHA1Engine.cpp b/Utilities/Poco/Foundation/src/SHA1Engine.cpp
deleted file mode 100755
index bca6420a3c..0000000000
--- a/Utilities/Poco/Foundation/src/SHA1Engine.cpp
+++ /dev/null
@@ -1,305 +0,0 @@
-//
-// SHA1Engine.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Crypt
-// Module: SHA1Engine
-//
-// Based on the public domain implementation by Peter C. Gutmann
-// on 2 Sep 1992, modified by Carl Ellison to be SHA-1.
-//
-// Copyright (c) 2004-2006, 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/SHA1Engine.h"
-#include <cstring>
-
-
-#ifdef POCO_ARCH_LITTLE_ENDIAN
- #define SHA1_BYTE_REVERSE(x, y) byteReverse(x, y)
-#else
- #define SHA1_BYTE_REVERSE(x, y)
-#endif
-
-
-namespace Poco {
-
-
-SHA1Engine::SHA1Engine()
-{
- _digest.reserve(16);
- reset();
-}
-
-
-SHA1Engine::~SHA1Engine()
-{
- reset();
-}
-
-
-inline void SHA1Engine::byteReverse(UInt32* buffer, int byteCount)
-{
-#ifdef POCO_ARCH_LITTLE_ENDIAN
- byteCount /= sizeof(UInt32);
- for(int count = 0; count < byteCount; count++)
- {
- UInt32 value = (buffer[ count ] << 16) | (buffer[ count ] >> 16);
- buffer[count] = ((value & 0xFF00FF00L) >> 8) | ((value & 0x00FF00FFL) << 8);
- }
-#endif // POCO_ARCH_LITTLE_ENDIAN
-}
-
-
-void SHA1Engine::updateImpl(const void* buffer_, unsigned count)
-{
- const BYTE* buffer = (const BYTE*) buffer_;
- BYTE* db = (BYTE*) &_context.data[0];
-
- /* Update bitcount */
- if ((_context.countLo + ((UInt32) count << 3)) < _context.countLo)
- _context.countHi++; /* Carry from low to high bitCount */
- _context.countLo += ((UInt32) count << 3);
- _context.countHi += ((UInt32 ) count >> 29);
-
- /* Process data in BLOCK_SIZE chunks */
- while (count-- > 0)
- {
- db[_context.slop++] = *(buffer++);
- if (_context.slop == BLOCK_SIZE)
- {
- /* transform this one block */
- SHA1_BYTE_REVERSE(_context.data, BLOCK_SIZE);
- transform();
- _context.slop = 0 ; /* no slop left */
- }
- }
-}
-
-
-unsigned SHA1Engine::digestLength() const
-{
- return DIGEST_SIZE;
-}
-
-
-void SHA1Engine::reset()
-{
- _context.digest[0] = 0x67452301L;
- _context.digest[1] = 0xEFCDAB89L;
- _context.digest[2] = 0x98BADCFEL;
- _context.digest[3] = 0x10325476L;
- _context.digest[4] = 0xC3D2E1F0L;
- _context.countLo = 0;
- _context.countHi = 0;
- _context.slop = 0;
- std::memset(_context.data, 0, sizeof(_context.data));
-}
-
-
-const DigestEngine::Digest& SHA1Engine::digest()
-{
- int count;
- UInt32 lowBitcount = _context.countLo;
- UInt32 highBitcount = _context.countHi;
-
- /* Compute number of bytes mod 64 */
- count = (int) ((_context.countLo >> 3) & 0x3F);
-
- /* Set the first char of padding to 0x80. This is safe since there is
- always at least one byte free */
- ((BYTE*) _context.data)[count++] = 0x80;
-
- /* Pad out to 56 mod 64 */
- if (count > 56)
- {
- /* Two lots of padding: Pad the first block to 64 bytes */
- std::memset((BYTE*) &_context.data + count, 0, 64 - count);
- SHA1_BYTE_REVERSE(_context.data, BLOCK_SIZE);
- transform();
-
- /* Now fill the next block with 56 bytes */
- std::memset(&_context.data, 0, 56);
- }
- else
- {
- /* Pad block to 56 bytes */
- std::memset((BYTE*) &_context.data + count, 0, 56 - count);
- }
- SHA1_BYTE_REVERSE(_context.data, BLOCK_SIZE);
-
- /* Append length in bits and transform */
- _context.data[14] = highBitcount;
- _context.data[15] = lowBitcount;
-
- transform();
- SHA1_BYTE_REVERSE(_context.data, DIGEST_SIZE);
-
- unsigned char hash[DIGEST_SIZE];
- for (count = 0; count < DIGEST_SIZE; count++)
- hash[count] = (BYTE) ((_context.digest[count>>2]) >> (8*(3-(count & 0x3)))) & 0xff;
- _digest.clear();
- _digest.insert(_digest.begin(), hash, hash + DIGEST_SIZE);
- reset();
- return _digest;
-}
-
-
-/* The SHA f()-functions */
-#define f1(x,y,z) ( ( x & y ) | ( ~x & z ) ) /* Rounds 0-19 */
-#define f2(x,y,z) ( x ^ y ^ z ) /* Rounds 20-39 */
-#define f3(x,y,z) ( ( x & y ) | ( x & z ) | ( y & z ) ) /* Rounds 40-59 */
-#define f4(x,y,z) ( x ^ y ^ z ) /* Rounds 60-79 */
-
-
-/* The SHA Mysterious Constants */
-#define K1 0x5A827999L /* Rounds 0-19 */
-#define K2 0x6ED9EBA1L /* Rounds 20-39 */
-#define K3 0x8F1BBCDCL /* Rounds 40-59 */
-#define K4 0xCA62C1D6L /* Rounds 60-79 */
-
-
-/* 32-bit rotate - kludged with shifts */
-typedef UInt32 UL; /* to save space */
-
-
-#define S(n,X) ( ( ((UL)X) << n ) | ( ((UL)X) >> ( 32 - n ) ) )
-
-
-/* The initial expanding function */
-#define expand(count) W[ count ] = S(1,(W[ count - 3 ] ^ W[ count - 8 ] ^ W[ count - 14 ] ^ W[ count - 16 ])) /* to make this SHA-1 */
-
-
-/* The four SHA sub-rounds */
-#define subRound1(count) \
-{ \
- temp = S( 5, A ) + f1( B, C, D ) + E + W[ count ] + K1; \
- E = D; \
- D = C; \
- C = S( 30, B ); \
- B = A; \
- A = temp; \
-}
-
-#define subRound2(count) \
-{ \
- temp = S( 5, A ) + f2( B, C, D ) + E + W[ count ] + K2; \
- E = D; \
- D = C; \
- C = S( 30, B ); \
- B = A; \
- A = temp; \
-}
-
-#define subRound3(count) \
-{ \
- temp = S( 5, A ) + f3( B, C, D ) + E + W[ count ] + K3; \
- E = D; \
- D = C; \
- C = S( 30, B ); \
- B = A; \
- A = temp; \
-}
-
-#define subRound4(count) \
-{ \
- temp = S( 5, A ) + f4( B, C, D ) + E + W[ count ] + K4; \
- E = D; \
- D = C; \
- C = S( 30, B ); \
- B = A; \
- A = temp; \
-}
-
-
-void SHA1Engine::transform()
-{
- UInt32 W[80];
- UInt32 temp;
- UInt32 A, B, C, D, E;
- int i;
-
- /* Step A. Copy the data buffer into the local work buffer */
- for( i = 0; i < 16; i++ )
- W[ i ] = _context.data[ i ];
-
- /* Step B. Expand the 16 words into 64 temporary data words */
- expand( 16 ); expand( 17 ); expand( 18 ); expand( 19 ); expand( 20 );
- expand( 21 ); expand( 22 ); expand( 23 ); expand( 24 ); expand( 25 );
- expand( 26 ); expand( 27 ); expand( 28 ); expand( 29 ); expand( 30 );
- expand( 31 ); expand( 32 ); expand( 33 ); expand( 34 ); expand( 35 );
- expand( 36 ); expand( 37 ); expand( 38 ); expand( 39 ); expand( 40 );
- expand( 41 ); expand( 42 ); expand( 43 ); expand( 44 ); expand( 45 );
- expand( 46 ); expand( 47 ); expand( 48 ); expand( 49 ); expand( 50 );
- expand( 51 ); expand( 52 ); expand( 53 ); expand( 54 ); expand( 55 );
- expand( 56 ); expand( 57 ); expand( 58 ); expand( 59 ); expand( 60 );
- expand( 61 ); expand( 62 ); expand( 63 ); expand( 64 ); expand( 65 );
- expand( 66 ); expand( 67 ); expand( 68 ); expand( 69 ); expand( 70 );
- expand( 71 ); expand( 72 ); expand( 73 ); expand( 74 ); expand( 75 );
- expand( 76 ); expand( 77 ); expand( 78 ); expand( 79 );
-
- /* Step C. Set up first buffer */
- A = _context.digest[ 0 ];
- B = _context.digest[ 1 ];
- C = _context.digest[ 2 ];
- D = _context.digest[ 3 ];
- E = _context.digest[ 4 ];
-
- /* Step D. Serious mangling, divided into four sub-rounds */
- subRound1( 0 ); subRound1( 1 ); subRound1( 2 ); subRound1( 3 );
- subRound1( 4 ); subRound1( 5 ); subRound1( 6 ); subRound1( 7 );
- subRound1( 8 ); subRound1( 9 ); subRound1( 10 ); subRound1( 11 );
- subRound1( 12 ); subRound1( 13 ); subRound1( 14 ); subRound1( 15 );
- subRound1( 16 ); subRound1( 17 ); subRound1( 18 ); subRound1( 19 );
- subRound2( 20 ); subRound2( 21 ); subRound2( 22 ); subRound2( 23 );
- subRound2( 24 ); subRound2( 25 ); subRound2( 26 ); subRound2( 27 );
- subRound2( 28 ); subRound2( 29 ); subRound2( 30 ); subRound2( 31 );
- subRound2( 32 ); subRound2( 33 ); subRound2( 34 ); subRound2( 35 );
- subRound2( 36 ); subRound2( 37 ); subRound2( 38 ); subRound2( 39 );
- subRound3( 40 ); subRound3( 41 ); subRound3( 42 ); subRound3( 43 );
- subRound3( 44 ); subRound3( 45 ); subRound3( 46 ); subRound3( 47 );
- subRound3( 48 ); subRound3( 49 ); subRound3( 50 ); subRound3( 51 );
- subRound3( 52 ); subRound3( 53 ); subRound3( 54 ); subRound3( 55 );
- subRound3( 56 ); subRound3( 57 ); subRound3( 58 ); subRound3( 59 );
- subRound4( 60 ); subRound4( 61 ); subRound4( 62 ); subRound4( 63 );
- subRound4( 64 ); subRound4( 65 ); subRound4( 66 ); subRound4( 67 );
- subRound4( 68 ); subRound4( 69 ); subRound4( 70 ); subRound4( 71 );
- subRound4( 72 ); subRound4( 73 ); subRound4( 74 ); subRound4( 75 );
- subRound4( 76 ); subRound4( 77 ); subRound4( 78 ); subRound4( 79 );
-
- /* Step E. Build message digest */
- _context.digest[ 0 ] += A;
- _context.digest[ 1 ] += B;
- _context.digest[ 2 ] += C;
- _context.digest[ 3 ] += D;
- _context.digest[ 4 ] += E;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Semaphore.cpp b/Utilities/Poco/Foundation/src/Semaphore.cpp
deleted file mode 100755
index 69c5e438cf..0000000000
--- a/Utilities/Poco/Foundation/src/Semaphore.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// Semaphore.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Semaphore
-//
-// Copyright (c) 2004-2006, 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/Semaphore.h"
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Semaphore_WIN32.cpp"
-#else
-#include "Semaphore_POSIX.cpp"
-#endif
-
-
-namespace Poco {
-
-
-Semaphore::Semaphore(int n): SemaphoreImpl(n, n)
-{
-}
-
-
-Semaphore::Semaphore(int n, int max): SemaphoreImpl(n, max)
-{
-}
-
-
-Semaphore::~Semaphore()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Semaphore_POSIX.cpp b/Utilities/Poco/Foundation/src/Semaphore_POSIX.cpp
deleted file mode 100755
index 579a3a5bbc..0000000000
--- a/Utilities/Poco/Foundation/src/Semaphore_POSIX.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// Semaphore_POSIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Semaphore
-//
-// Copyright (c) 2004-2006, 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/Semaphore_POSIX.h"
-#include <sys/time.h>
-
-
-namespace Poco {
-
-
-SemaphoreImpl::SemaphoreImpl(int n, int max): _n(n), _max(max)
-{
- poco_assert (n >= 0 && max > 0 && n <= max);
-
- if (pthread_mutex_init(&_mutex, NULL))
- throw SystemException("cannot create semaphore (mutex)");
- if (pthread_cond_init(&_cond, NULL))
- throw SystemException("cannot create semaphore (condition)");
-}
-
-
-SemaphoreImpl::~SemaphoreImpl()
-{
- pthread_cond_destroy(&_cond);
- pthread_mutex_destroy(&_mutex);
-}
-
-
-void SemaphoreImpl::waitImpl()
-{
- if (pthread_mutex_lock(&_mutex))
- throw SystemException("wait for semaphore failed (lock)");
- while (_n < 1)
- {
- if (pthread_cond_wait(&_cond, &_mutex))
- {
- pthread_mutex_unlock(&_mutex);
- throw SystemException("wait for semaphore failed");
- }
- }
- --_n;
- pthread_mutex_unlock(&_mutex);
-}
-
-
-bool SemaphoreImpl::waitImpl(long milliseconds)
-{
- int rc = 0;
- struct timespec abstime;
-
-#if defined(__VMS)
- struct timespec delta;
- delta.tv_sec = milliseconds / 1000;
- delta.tv_nsec = (milliseconds % 1000)*1000000;
- pthread_get_expiration_np(&delta, &abstime);
-#else
- struct timeval tv;
- gettimeofday(&tv, NULL);
- abstime.tv_sec = tv.tv_sec + milliseconds / 1000;
- abstime.tv_nsec = tv.tv_usec*1000 + (milliseconds % 1000)*1000000;
- if (abstime.tv_nsec >= 1000000000)
- {
- abstime.tv_nsec -= 1000000000;
- abstime.tv_sec++;
- }
-#endif
-
- if (pthread_mutex_lock(&_mutex) != 0)
- throw SystemException("wait for semaphore failed (lock)");
- while (_n < 1)
- {
- if ((rc = pthread_cond_timedwait(&_cond, &_mutex, &abstime)))
- {
- if (rc == ETIMEDOUT) break;
- pthread_mutex_unlock(&_mutex);
- throw SystemException("cannot wait for semaphore");
- }
- }
- if (rc == 0) --_n;
- pthread_mutex_unlock(&_mutex);
- return rc == 0;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Semaphore_WIN32.cpp b/Utilities/Poco/Foundation/src/Semaphore_WIN32.cpp
deleted file mode 100755
index 541cee7377..0000000000
--- a/Utilities/Poco/Foundation/src/Semaphore_WIN32.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// Semaphore_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Semaphore
-//
-// Copyright (c) 2004-2006, 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/Semaphore_WIN32.h"
-
-
-namespace Poco {
-
-
-SemaphoreImpl::SemaphoreImpl(int n, int max)
-{
- poco_assert (n >= 0 && max > 0 && n <= max);
-
- _sema = CreateSemaphoreW(NULL, n, max, NULL);
- if (!_sema)
- {
- throw SystemException("cannot create semaphore");
- }
-}
-
-
-SemaphoreImpl::~SemaphoreImpl()
-{
- CloseHandle(_sema);
-}
-
-
-void SemaphoreImpl::waitImpl()
-{
- switch (WaitForSingleObject(_sema, INFINITE))
- {
- case WAIT_OBJECT_0:
- return;
- default:
- throw SystemException("wait for semaphore failed");
- }
-}
-
-
-bool SemaphoreImpl::waitImpl(long milliseconds)
-{
- switch (WaitForSingleObject(_sema, milliseconds + 1))
- {
- case WAIT_TIMEOUT:
- return false;
- case WAIT_OBJECT_0:
- return true;
- default:
- throw SystemException("wait for semaphore failed");
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SharedLibrary.cpp b/Utilities/Poco/Foundation/src/SharedLibrary.cpp
deleted file mode 100755
index 292b18c6bb..0000000000
--- a/Utilities/Poco/Foundation/src/SharedLibrary.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// SharedLibrary.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Copyright (c) 2004-2006, 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/SharedLibrary.h"
-#include "Poco/Exception.h"
-
-
-#if defined(hpux) || defined(_hpux)
-#include "SharedLibrary_HPUX.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "SharedLibrary_UNIX.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
-#include "SharedLibrary_WIN32U.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "SharedLibrary_WIN32.cpp"
-#elif defined(POCO_OS_FAMILY_VMS)
-#include "SharedLibrary_VMS.cpp"
-#endif
-
-
-namespace Poco {
-
-
-SharedLibrary::SharedLibrary()
-{
-}
-
-
-SharedLibrary::SharedLibrary(const std::string& path)
-{
- loadImpl(path);
-}
-
-
-SharedLibrary::~SharedLibrary()
-{
-}
-
-
-void SharedLibrary::load(const std::string& path)
-{
- loadImpl(path);
-}
-
-
-void SharedLibrary::unload()
-{
- unloadImpl();
-}
-
-
-bool SharedLibrary::isLoaded() const
-{
- return isLoadedImpl();
-}
-
-
-bool SharedLibrary::hasSymbol(const std::string& name)
-{
- return findSymbolImpl(name) != 0;
-}
-
-
-void* SharedLibrary::getSymbol(const std::string& name)
-{
- void* result = findSymbolImpl(name);
- if (result)
- return result;
- else
- throw NotFoundException(name);
-}
-
-
-const std::string& SharedLibrary::getPath() const
-{
- return getPathImpl();
-}
-
-
-std::string SharedLibrary::suffix()
-{
- return suffixImpl();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SharedLibrary_HPUX.cpp b/Utilities/Poco/Foundation/src/SharedLibrary_HPUX.cpp
deleted file mode 100755
index b401c9d039..0000000000
--- a/Utilities/Poco/Foundation/src/SharedLibrary_HPUX.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// SharedLibrary_HPUX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Copyright (c) 2004-2006, 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/SharedLibrary_HPUX.h"
-#include <dl.h>
-
-
-namespace Poco {
-
-
-FastMutex SharedLibraryImpl::_mutex;
-
-
-SharedLibraryImpl::SharedLibraryImpl()
-{
- _handle = 0;
-}
-
-
-SharedLibraryImpl::~SharedLibraryImpl()
-{
-}
-
-
-void SharedLibraryImpl::loadImpl(const std::string& path)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_handle) throw LibraryAlreadyLoadedException(path);
- _handle = shl_load(path.c_str(), BIND_DEFERRED, 0);
- if (!_handle) throw LibraryLoadException(path);
- _path = path;
-}
-
-
-void SharedLibraryImpl::unloadImpl()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_handle)
- {
- shl_unload(_handle);
- _handle = 0;
- _path.clear();
- }
-}
-
-
-bool SharedLibraryImpl::isLoadedImpl() const
-{
- return _handle != 0;
-}
-
-
-void* SharedLibraryImpl::findSymbolImpl(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- void* result = 0;
- if (_handle && shl_findsym(&_handle, name.c_str(), TYPE_UNDEFINED, &result) != -1)
- return result;
- else
- return 0;
-}
-
-
-const std::string& SharedLibraryImpl::getPathImpl() const
-{
- return _path;
-}
-
-
-std::string SharedLibraryImpl::suffixImpl()
-{
-#if defined(_DEBUG)
- return "d.sl";
-#else
- return ".sl";
-#endif
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SharedLibrary_UNIX.cpp b/Utilities/Poco/Foundation/src/SharedLibrary_UNIX.cpp
deleted file mode 100755
index e19fa9decd..0000000000
--- a/Utilities/Poco/Foundation/src/SharedLibrary_UNIX.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// SharedLibrary_UNIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Copyright (c) 2004-2006, 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/SharedLibrary_UNIX.h"
-#include "Poco/Exception.h"
-#include <dlfcn.h>
-
-
-// Note: cygwin is missing RTLD_LOCAL, set it to 0
-#if defined(__CYGWIN__) && !defined(RTLD_LOCAL)
-#define RTLD_LOCAL 0
-#endif
-
-
-namespace Poco {
-
-
-FastMutex SharedLibraryImpl::_mutex;
-
-
-SharedLibraryImpl::SharedLibraryImpl()
-{
- _handle = 0;
-}
-
-
-SharedLibraryImpl::~SharedLibraryImpl()
-{
-}
-
-
-void SharedLibraryImpl::loadImpl(const std::string& path)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_handle) throw LibraryAlreadyLoadedException(path);
- _handle = dlopen(path.c_str(), RTLD_LAZY | RTLD_GLOBAL);
- if (!_handle)
- {
- const char* err = dlerror();
- throw LibraryLoadException(err ? std::string(err) : path);
- }
- _path = path;
-}
-
-
-void SharedLibraryImpl::unloadImpl()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_handle)
- {
- dlclose(_handle);
- _handle = 0;
- }
-}
-
-
-bool SharedLibraryImpl::isLoadedImpl() const
-{
- return _handle != 0;
-}
-
-
-void* SharedLibraryImpl::findSymbolImpl(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- void* result = 0;
- if (_handle)
- {
- result = dlsym(_handle, name.c_str());
- }
- return result;
-}
-
-
-const std::string& SharedLibraryImpl::getPathImpl() const
-{
- return _path;
-}
-
-
-std::string SharedLibraryImpl::suffixImpl()
-{
-#if defined(__APPLE__)
- #if defined(_DEBUG)
- return "d.dylib";
- #else
- return ".dylib";
- #endif
-#elif defined(hpux) || defined(_hpux)
- #if defined(_DEBUG)
- return "d.sl";
- #else
- return ".sl";
- #endif
-#elif defined(__CYGWIN__)
- #if defined(_DEBUG)
- return "d.dll";
- #else
- return ".dll";
- #endif
-#else
- #if defined(_DEBUG)
- return "d.so";
- #else
- return ".so";
- #endif
-#endif
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SharedLibrary_VMS.cpp b/Utilities/Poco/Foundation/src/SharedLibrary_VMS.cpp
deleted file mode 100755
index ec942a5071..0000000000
--- a/Utilities/Poco/Foundation/src/SharedLibrary_VMS.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// SharedLibrary_VMS.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Copyright (c) 2004-2006, 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/SharedLibrary_VMS.h"
-#include "Poco/Path.h"
-#include <lib$routines.h>
-#include <libdef.h>
-#include <descrip.h>
-#include <chfdef.h>
-#include <libfisdef.h>
-
-
-namespace Poco {
-
-
-FastMutex SharedLibraryImpl::_mutex;
-
-
-SharedLibraryImpl::SharedLibraryImpl()
-{
-}
-
-
-SharedLibraryImpl::~SharedLibraryImpl()
-{
-}
-
-
-void SharedLibraryImpl::loadImpl(const std::string& path)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (!_path.empty()) throw LibraryAlreadyLoadedException(path);
- _path = path;
-}
-
-
-void SharedLibraryImpl::unloadImpl()
-{
- _path.clear();
-}
-
-
-bool SharedLibraryImpl::isLoadedImpl() const
-{
- return !_path.empty();
-}
-
-
-void* SharedLibraryImpl::findSymbolImpl(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_path.empty()) return NULL;
-
- Path p(_path);
- std::string filename = p.getBaseName();
- std::string ext = p.getExtension();
- std::string imageSpec = p.makeParent().toString();
- if (!imageSpec.empty() && !ext.empty())
- {
- imageSpec.append(".");
- imageSpec.append(ext);
- }
- int value = 0;
- long flags = LIB$M_FIS_MIXEDCASE;
- POCO_DESCRIPTOR_STRING(filenameDsc, filename);
- POCO_DESCRIPTOR_STRING(symbolDsc, name);
- POCO_DESCRIPTOR_STRING(imageSpecDsc, imageSpec);
-
- try
- {
- // lib$find_image_symbol only accepts 32-bit pointers
- #pragma pointer_size save
- #pragma pointer_size 32
- lib$find_image_symbol(&filenameDsc, &symbolDsc, &value, imageSpec.empty() ? 0 : &imageSpecDsc, flags);
- #pragma pointer_size restore
- }
- catch (struct chf$signal_array& sigarr)
- {
- unsigned sig = sigarr.chf$is_sig_name;
- unsigned act = LIB$_ACTIMAGE;
- if (lib$match_cond(&sig, &act))
- throw LibraryLoadException(_path);
- }
- return (void*) value;
-}
-
-
-const std::string& SharedLibraryImpl::getPathImpl() const
-{
- return _path;
-}
-
-
-std::string SharedLibraryImpl::suffixImpl()
-{
-#if defined(_DEBUG)
- return "d.exe";
-#else
- return ".exe";
-#endif
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SharedLibrary_WIN32.cpp b/Utilities/Poco/Foundation/src/SharedLibrary_WIN32.cpp
deleted file mode 100755
index be30269986..0000000000
--- a/Utilities/Poco/Foundation/src/SharedLibrary_WIN32.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// SharedLibrary_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Copyright (c) 2004-2006, 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/SharedLibrary_WIN32.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-FastMutex SharedLibraryImpl::_mutex;
-
-
-SharedLibraryImpl::SharedLibraryImpl()
-{
- _handle = 0;
-}
-
-
-SharedLibraryImpl::~SharedLibraryImpl()
-{
-}
-
-
-void SharedLibraryImpl::loadImpl(const std::string& path)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_handle) throw LibraryAlreadyLoadedException(_path);
- _handle = LoadLibraryA(path.c_str());
- if (!_handle) throw LibraryLoadException(path);
- _path = path;
-}
-
-
-void SharedLibraryImpl::unloadImpl()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_handle)
- {
- FreeLibrary((HMODULE) _handle);
- _handle = 0;
- }
- _path.clear();
-}
-
-
-bool SharedLibraryImpl::isLoadedImpl() const
-{
- return _handle != 0;
-}
-
-
-void* SharedLibraryImpl::findSymbolImpl(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_handle)
- {
- return (void*) GetProcAddress((HMODULE) _handle, name.c_str());
- }
- else return 0;
-}
-
-
-const std::string& SharedLibraryImpl::getPathImpl() const
-{
- return _path;
-}
-
-
-std::string SharedLibraryImpl::suffixImpl()
-{
-#if defined(_DEBUG)
- return "d.dll";
-#else
- return ".dll";
-#endif
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SharedLibrary_WIN32U.cpp b/Utilities/Poco/Foundation/src/SharedLibrary_WIN32U.cpp
deleted file mode 100755
index 1d2383e1e4..0000000000
--- a/Utilities/Poco/Foundation/src/SharedLibrary_WIN32U.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// SharedLibrary_WIN32U.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: SharedLibrary
-// Module: SharedLibrary
-//
-// Copyright (c) 2004-2006, 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/SharedLibrary_WIN32U.h"
-#include "Poco/UnicodeConverter.h"
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-FastMutex SharedLibraryImpl::_mutex;
-
-
-SharedLibraryImpl::SharedLibraryImpl()
-{
- _handle = 0;
-}
-
-
-SharedLibraryImpl::~SharedLibraryImpl()
-{
-}
-
-
-void SharedLibraryImpl::loadImpl(const std::string& path)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_handle) throw LibraryAlreadyLoadedException(_path);
- std::wstring upath;
- UnicodeConverter::toUTF16(path, upath);
- _handle = LoadLibraryW(upath.c_str());
- if (!_handle) throw LibraryLoadException(path);
- _path = path;
-}
-
-
-void SharedLibraryImpl::unloadImpl()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_handle)
- {
- FreeLibrary((HMODULE) _handle);
- _handle = 0;
- }
- _path.clear();
-}
-
-
-bool SharedLibraryImpl::isLoadedImpl() const
-{
- return _handle != 0;
-}
-
-
-void* SharedLibraryImpl::findSymbolImpl(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_handle)
- {
- return (void*) GetProcAddress((HMODULE) _handle, name.c_str());
- }
- else return 0;
-}
-
-
-const std::string& SharedLibraryImpl::getPathImpl() const
-{
- return _path;
-}
-
-
-std::string SharedLibraryImpl::suffixImpl()
-{
-#if defined(_DEBUG)
- return "d.dll";
-#else
- return ".dll";
-#endif
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SharedMemory.cpp b/Utilities/Poco/Foundation/src/SharedMemory.cpp
deleted file mode 100755
index dbb258477e..0000000000
--- a/Utilities/Poco/Foundation/src/SharedMemory.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// SharedMemory.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: SharedMemory
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#if defined(__sun)
-#undef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-
-#include "Poco/SharedMemory.h"
-#include "Poco/Exception.h"
-#if defined(POCO_NO_SHAREDMEMORY)
-#include "SharedMemory_DUMMY.cpp"
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "SharedMemory_WIN32.cpp"
-#elif defined(POCO_OS_FAMILY_UNIX)
-#include "SharedMemory_POSIX.cpp"
-#else
-#include "SharedMemory_DUMMY.cpp"
-#endif
-
-
-namespace Poco {
-
-
-SharedMemory::SharedMemory():
- _pImpl(0)
-{
-}
-
-
-SharedMemory::SharedMemory(const std::string& name, std::size_t size, AccessMode mode, const void* addrHint, bool server):
- _pImpl(new SharedMemoryImpl(name, size, mode, addrHint, server))
-{
-}
-
-
-SharedMemory::SharedMemory(const Poco::File& file, AccessMode mode, const void* addrHint):
- _pImpl(new SharedMemoryImpl(file, mode, addrHint))
-{
-}
-
-
-SharedMemory::SharedMemory(const SharedMemory& other):
- _pImpl(other._pImpl)
-{
- if (_pImpl)
- _pImpl->duplicate();
-}
-
-
-SharedMemory::~SharedMemory()
-{
- if (_pImpl)
- _pImpl->release();
-}
-
-
-SharedMemory& SharedMemory::operator = (const SharedMemory& other)
-{
- SharedMemory tmp(other);
- swap(tmp);
- return *this;
-}
-
-
-char* SharedMemory::begin() const
-{
- if (_pImpl)
- return _pImpl->begin();
- else
- return 0;
-}
-
-
-char* SharedMemory::end() const
-{
- if (_pImpl)
- return _pImpl->end();
- else
- return 0;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SharedMemory_DUMMY.cpp b/Utilities/Poco/Foundation/src/SharedMemory_DUMMY.cpp
deleted file mode 100755
index 5a6e6d7bb8..0000000000
--- a/Utilities/Poco/Foundation/src/SharedMemory_DUMMY.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// SharedMemoryImpl.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: SharedMemoryImpl
-//
-// Copyright (c) 2007, 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/SharedMemory_DUMMY.h"
-
-
-namespace Poco {
-
-
-SharedMemoryImpl::SharedMemoryImpl(const std::string&, std::size_t, SharedMemory::AccessMode, const void*, bool)
-{
-}
-
-
-SharedMemoryImpl::SharedMemoryImpl(const Poco::File&, SharedMemory::AccessMode, const void*)
-{
-}
-
-
-SharedMemoryImpl::~SharedMemoryImpl()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SharedMemory_POSIX.cpp b/Utilities/Poco/Foundation/src/SharedMemory_POSIX.cpp
deleted file mode 100755
index 9ee5b24a8c..0000000000
--- a/Utilities/Poco/Foundation/src/SharedMemory_POSIX.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-//
-// SharedMemoryImpl.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: SharedMemoryImpl
-//
-// Copyright (c) 2007, 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/SharedMemory_POSIX.h"
-#include "Poco/Exception.h"
-#include "Poco/File.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-
-namespace Poco {
-
-
-SharedMemoryImpl::SharedMemoryImpl(const std::string& name, std::size_t size, SharedMemory::AccessMode mode, const void* addrHint, bool server):
- _size(size),
- _fd(-1),
- _address(0),
- _access(mode),
- _name("/"),
- _fileMapped(false),
- _server(server)
-{
-#if POCO_OS == POCO_OS_HPUX
- _name.append("tmp/");
-#endif
-
- _name.append(name);
-
- int flags = O_CREAT;
- if (_access == SharedMemory::AM_WRITE)
- flags |= O_RDWR;
- else
- flags |= O_RDONLY;
-
- // open the shared memory segment
- _fd = ::shm_open(_name.c_str(), flags, S_IRUSR | S_IWUSR);
- if (_fd == -1)
- throw SystemException("Cannot create shared memory object", _name);
-
- // now set the correct size for the segment
- if (-1 == ::ftruncate(_fd, size))
- {
- ::close(_fd);
- _fd = -1;
- ::shm_unlink(_name.c_str());
- throw SystemException("Cannot resize shared memory object", _name);
- }
- map(addrHint);
-}
-
-
-SharedMemoryImpl::SharedMemoryImpl(const Poco::File& file, SharedMemory::AccessMode mode, const void* addrHint):
- _size(0),
- _fd(-1),
- _address(0),
- _access(mode),
- _name(file.path()),
- _fileMapped(true),
- _server(false)
-{
- if (!file.exists() || !file.isFile())
- throw FileNotFoundException(file.path());
-
- _size = file.getSize();
- int flag = O_RDONLY;
- if (mode == SharedMemory::AM_WRITE)
- flag = O_RDWR;
- _fd = ::open(_name.c_str(), flag);
- if (-1 == _fd)
- throw OpenFileException("Cannot open memory mapped file", _name);
-
- map(addrHint);
-}
-
-
-SharedMemoryImpl::~SharedMemoryImpl()
-{
- unmap();
- close();
-}
-
-
-void SharedMemoryImpl::map(const void* addrHint)
-{
- int access = PROT_READ;
- if (_access == SharedMemory::AM_WRITE)
- access |= PROT_WRITE;
-
- void* addr = ::mmap(const_cast<void*>(addrHint), _size, access, MAP_SHARED, _fd, 0);
- if (addr == MAP_FAILED)
- throw SystemException("Cannot map file into shared memory", _name);
-
- _address = static_cast<char*>(addr);
-}
-
-
-void SharedMemoryImpl::unmap()
-{
- if (_address)
- {
- ::munmap(_address, _size);
- }
-}
-
-
-void SharedMemoryImpl::close()
-{
- if (_fd != -1)
- {
- ::close(_fd);
- _fd = -1;
- }
- if (!_fileMapped && _server)
- {
- ::shm_unlink(_name.c_str());
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SharedMemory_WIN32.cpp b/Utilities/Poco/Foundation/src/SharedMemory_WIN32.cpp
deleted file mode 100755
index dd08a6ee30..0000000000
--- a/Utilities/Poco/Foundation/src/SharedMemory_WIN32.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// SharedMemoryImpl.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Processes
-// Module: SharedMemoryImpl
-//
-// Copyright (c) 2007, 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/SharedMemory_WIN32.h"
-#include "Poco/Exception.h"
-#include "Poco/File.h"
-#if defined (POCO_WIN32_UTF8)
-#include "Poco/UnicodeConverter.h"
-#endif
-#include "Poco/UnWindows.h"
-
-
-namespace Poco {
-
-
-SharedMemoryImpl::SharedMemoryImpl(const std::string& name, std::size_t size, SharedMemory::AccessMode mode, const void*, bool):
- _name(name),
- _memHandle(INVALID_HANDLE_VALUE),
- _fileHandle(INVALID_HANDLE_VALUE),
- _size(static_cast<DWORD>(size)),
- _mode(PAGE_READONLY),
- _address(0)
-{
- if (mode == SharedMemory::AM_WRITE)
- _mode = PAGE_READWRITE;
-
-#if defined (POCO_WIN32_UTF8)
- std::wstring utf16name;
- UnicodeConverter::toUTF16(_name, utf16name);
- _memHandle = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, _mode, 0, _size, utf16name.c_str());
-#else
- _memHandle = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, _mode, 0, _size, _name.c_str());
-#endif
-
- if (!_memHandle)
- throw SystemException("Cannot create shared memory object", _name);
-
- map();
-}
-
-
-SharedMemoryImpl::SharedMemoryImpl(const Poco::File& file, SharedMemory::AccessMode mode, const void*):
- _name(file.path()),
- _memHandle(INVALID_HANDLE_VALUE),
- _fileHandle(INVALID_HANDLE_VALUE),
- _size(0),
- _mode(PAGE_READONLY),
- _address(0)
-{
- if (!file.exists() || !file.isFile())
- throw FileNotFoundException(_name);
-
- _size = static_cast<DWORD>(file.getSize());
-
- DWORD shareMode = FILE_SHARE_READ;
- DWORD fileMode = GENERIC_READ;
-
- if (mode == SharedMemory::AM_WRITE)
- {
- _mode = PAGE_READWRITE;
- fileMode |= GENERIC_WRITE;
- }
-
-#if defined (POCO_WIN32_UTF8)
- std::wstring utf16name;
- UnicodeConverter::toUTF16(_name, utf16name);
- _fileHandle = CreateFileW(utf16name.c_str(), fileMode, shareMode, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-#else
- _fileHandle = CreateFileA(_name.c_str(), fileMode, shareMode, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-#endif
-
- if (_fileHandle == INVALID_HANDLE_VALUE)
- throw OpenFileException("Cannot open memory mapped file", _name);
-
- _memHandle = CreateFileMapping(_fileHandle, NULL, _mode, 0, 0, NULL);
- if (!_memHandle)
- {
- CloseHandle(_fileHandle);
- _fileHandle = INVALID_HANDLE_VALUE;
- throw SystemException("Cannot map file into shared memory", _name);
- }
- map();
-}
-
-
-SharedMemoryImpl::~SharedMemoryImpl()
-{
- unmap();
- close();
-}
-
-
-void SharedMemoryImpl::map()
-{
- DWORD access = FILE_MAP_READ;
- if (_mode == PAGE_READWRITE)
- access = FILE_MAP_WRITE;
- LPVOID addr = MapViewOfFile(_memHandle, access, 0, 0, _size);
- if (!addr)
- throw SystemException("Cannot map shared memory object", _name);
-
- _address = static_cast<char*>(addr);
-}
-
-
-void SharedMemoryImpl::unmap()
-{
- if (_address)
- {
- UnmapViewOfFile(_address);
- _address = 0;
- return;
- }
-}
-
-
-void SharedMemoryImpl::close()
-{
- if (_memHandle != INVALID_HANDLE_VALUE)
- {
- CloseHandle(_memHandle);
- _memHandle = INVALID_HANDLE_VALUE;
- }
-
- if (_fileHandle != INVALID_HANDLE_VALUE)
- {
- CloseHandle(_fileHandle);
- _fileHandle = INVALID_HANDLE_VALUE;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SignalHandler.cpp b/Utilities/Poco/Foundation/src/SignalHandler.cpp
deleted file mode 100755
index 0e1fb6588b..0000000000
--- a/Utilities/Poco/Foundation/src/SignalHandler.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// SignalHandler.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: SignalHandler
-//
-// Copyright (c) 2004-2006, 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/SignalHandler.h"
-
-
-#if defined(POCO_OS_FAMILY_UNIX)
-
-
-#include "Poco/Thread.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/Exception.h"
-#include <cstdlib>
-#include <signal.h>
-
-
-namespace Poco {
-
-
-SignalHandler::JumpBufferVec SignalHandler::_jumpBufferVec;
-
-
-SignalHandler::SignalHandler()
-{
- JumpBufferVec& jbv = jumpBufferVec();
- JumpBuffer buf;
- jbv.push_back(buf);
-}
-
-
-SignalHandler::~SignalHandler()
-{
- jumpBufferVec().pop_back();
-}
-
-
-sigjmp_buf& SignalHandler::jumpBuffer()
-{
- return jumpBufferVec().back().buf;
-}
-
-
-void SignalHandler::throwSignalException(int sig)
-{
- switch (sig)
- {
- case SIGILL:
- throw SignalException("Illegal instruction");
- case SIGBUS:
- throw SignalException("Bus error");
- case SIGSEGV:
- throw SignalException("Segmentation violation");
- case SIGSYS:
- throw SignalException("Invalid system call");
- default:
- throw SignalException(NumberFormatter::formatHex(sig));
- }
-}
-
-
-void SignalHandler::install()
-{
-#ifndef POCO_NO_SIGNAL_HANDLER
- struct sigaction sa;
- sa.sa_handler = handleSignal;
- sa.sa_flags = 0;
- sigemptyset(&sa.sa_mask);
- sigaction(SIGILL, &sa, 0);
- sigaction(SIGBUS, &sa, 0);
- sigaction(SIGSEGV, &sa, 0);
- sigaction(SIGSYS, &sa, 0);
-#endif
-}
-
-
-void SignalHandler::handleSignal(int sig)
-{
- JumpBufferVec& jb = jumpBufferVec();
- if (!jb.empty())
- siglongjmp(jb.back().buf, sig);
-
- // Abort if no jump buffer registered
- std::abort();
-}
-
-
-SignalHandler::JumpBufferVec& SignalHandler::jumpBufferVec()
-{
- ThreadImpl* pThread = ThreadImpl::currentImpl();
- if (pThread)
- return pThread->_jumpBufferVec;
- else
- return _jumpBufferVec;
-}
-
-
-} // namespace Poco
-
-
-#endif // POCO_OS_FAMILY_UNIX
diff --git a/Utilities/Poco/Foundation/src/SimpleFileChannel.cpp b/Utilities/Poco/Foundation/src/SimpleFileChannel.cpp
deleted file mode 100755
index 2da502c070..0000000000
--- a/Utilities/Poco/Foundation/src/SimpleFileChannel.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// SimpleFileChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: SimpleFileChannel
-//
-// Copyright (c) 2005-2006, 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/SimpleFileChannel.h"
-#include "Poco/LogFile.h"
-#include "Poco/File.h"
-#include "Poco/Message.h"
-#include "Poco/Exception.h"
-#include <cctype>
-
-
-namespace Poco {
-
-
-const std::string SimpleFileChannel::PROP_PATH = "path";
-const std::string SimpleFileChannel::PROP_SECONDARYPATH = "secondaryPath";
-const std::string SimpleFileChannel::PROP_ROTATION = "rotation";
-
-
-SimpleFileChannel::SimpleFileChannel():
- _limit(0),
- _pFile(0)
-{
-}
-
-
-SimpleFileChannel::SimpleFileChannel(const std::string& path):
- _path(path),
- _secondaryPath(path + ".0"),
- _limit(0),
- _pFile(0)
-{
-}
-
-
-SimpleFileChannel::~SimpleFileChannel()
-{
- close();
-}
-
-
-void SimpleFileChannel::open()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (!_pFile)
- {
- File primary(_path);
- File secondary(_secondaryPath);
- Timestamp pt = primary.exists() ? primary.getLastModified() : 0;
- Timestamp st = secondary.exists() ? secondary.getLastModified() : 0;
- std::string path;
- if (pt >= st)
- path = _path;
- else
- path = _secondaryPath;
- _pFile = new LogFile(path);
- }
-}
-
-
-void SimpleFileChannel::close()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- delete _pFile;
- _pFile = 0;
-}
-
-
-void SimpleFileChannel::log(const Message& msg)
-{
- open();
-
- FastMutex::ScopedLock lock(_mutex);
-
- if (_limit > 0 && _pFile->size() >= _limit)
- {
- rotate();
- }
- _pFile->write(msg.getText());
-}
-
-
-void SimpleFileChannel::setProperty(const std::string& name, const std::string& value)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (name == PROP_PATH)
- {
- _path = value;
- if (_secondaryPath.empty())
- _secondaryPath = _path + ".0";
- }
- else if (name == PROP_SECONDARYPATH)
- _secondaryPath = value;
- else if (name == PROP_ROTATION)
- setRotation(value);
- else
- Channel::setProperty(name, value);
-}
-
-
-std::string SimpleFileChannel::getProperty(const std::string& name) const
-{
- if (name == PROP_PATH)
- return _path;
- else if (name == PROP_SECONDARYPATH)
- return _secondaryPath;
- else if (name == PROP_ROTATION)
- return _rotation;
- else
- return Channel::getProperty(name);
-}
-
-
-Timestamp SimpleFileChannel::creationDate() const
-{
- if (_pFile)
- return _pFile->creationDate();
- else
- return 0;
-}
-
-
-UInt64 SimpleFileChannel::size() const
-{
- if (_pFile)
- return _pFile->size();
- else
- return 0;
-}
-
-
-const std::string& SimpleFileChannel::path() const
-{
- return _path;
-}
-
-
-const std::string& SimpleFileChannel::secondaryPath() const
-{
- return _secondaryPath;
-}
-
-
-void SimpleFileChannel::setRotation(const std::string& rotation)
-{
- std::string::const_iterator it = rotation.begin();
- std::string::const_iterator end = rotation.end();
- UInt64 n = 0;
- while (it != end && std::isspace(*it)) ++it;
- while (it != end && std::isdigit(*it)) { n *= 10; n += *it++ - '0'; }
- while (it != end && std::isspace(*it)) ++it;
- std::string unit;
- while (it != end && std::isalpha(*it)) unit += *it++;
-
- if (unit == "K")
- _limit = n*1024;
- else if (unit == "M")
- _limit = n*1024*1024;
- else if (unit.empty())
- _limit = n;
- else if (unit == "never")
- _limit = 0;
- else
- throw InvalidArgumentException("rotation", rotation);
- _rotation = rotation;
-}
-
-
-void SimpleFileChannel::rotate()
-{
- std::string newPath;
- if (_pFile->path() == _path)
- newPath = _secondaryPath;
- else
- newPath = _path;
- File f(newPath);
- if (f.exists())
- {
- try
- {
- f.remove();
- }
- catch (...)
- {
- }
- }
- delete _pFile;
- _pFile = new LogFile(newPath);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SplitterChannel.cpp b/Utilities/Poco/Foundation/src/SplitterChannel.cpp
deleted file mode 100755
index 4e4e1f9aa3..0000000000
--- a/Utilities/Poco/Foundation/src/SplitterChannel.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// SplitterChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: SplitterChannel
-//
-// Copyright (c) 2004-2006, 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/SplitterChannel.h"
-#include "Poco/LoggingRegistry.h"
-#include "Poco/StringTokenizer.h"
-
-
-namespace Poco {
-
-
-SplitterChannel::SplitterChannel()
-{
-}
-
-
-SplitterChannel::~SplitterChannel()
-{
- close();
-}
-
-
-void SplitterChannel::addChannel(Channel* pChannel)
-{
- poco_check_ptr (pChannel);
-
- FastMutex::ScopedLock lock(_mutex);
-
- pChannel->duplicate();
- _channels.push_back(pChannel);
-}
-
-
-void SplitterChannel::removeChannel(Channel* pChannel)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- for (ChannelVec::iterator it = _channels.begin(); it != _channels.end(); ++it)
- {
- if (*it == pChannel)
- {
- pChannel->release();
- _channels.erase(it);
- break;
- }
- }
-}
-
-
-void SplitterChannel::setProperty(const std::string& name, const std::string& value)
-{
- if (name.compare(0, 7, "channel") == 0)
- {
- StringTokenizer tokenizer(value, ",;", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
- for (StringTokenizer::Iterator it = tokenizer.begin(); it != tokenizer.end(); ++it)
- {
- addChannel(LoggingRegistry::defaultRegistry().channelForName(*it));
- }
- }
- else Channel::setProperty(name, value);
-}
-
-
-void SplitterChannel::log(const Message& msg)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- for (ChannelVec::iterator it = _channels.begin(); it != _channels.end(); ++it)
- {
- (*it)->log(msg);
- }
-}
-
-
-void SplitterChannel::close()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- for (ChannelVec::iterator it = _channels.begin(); it != _channels.end(); ++it)
- {
- (*it)->release();
- }
- _channels.clear();
-}
-
-
-int SplitterChannel::count() const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return (int) _channels.size();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Stopwatch.cpp b/Utilities/Poco/Foundation/src/Stopwatch.cpp
deleted file mode 100755
index d9acaac85d..0000000000
--- a/Utilities/Poco/Foundation/src/Stopwatch.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// Stopwatch.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: Stopwatch
-//
-// Copyright (c) 2004-2006, 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/Stopwatch.h"
-
-
-namespace Poco {
-
-
-Stopwatch::Stopwatch(): _elapsed(0), _running(false)
-{
-}
-
-
-Stopwatch::~Stopwatch()
-{
-}
-
-
-Timestamp::TimeDiff Stopwatch::elapsed() const
-{
- if (_running)
- {
- Timestamp current;
- return _elapsed + (current - _start);
- }
- else
- {
- return _elapsed;
- }
-}
-
-
-void Stopwatch::reset()
-{
- _elapsed = 0;
- _running = false;
-}
-
-
-void Stopwatch::restart()
-{
- _elapsed = 0;
- _start.update();
- _running = true;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/StreamChannel.cpp b/Utilities/Poco/Foundation/src/StreamChannel.cpp
deleted file mode 100755
index ca21cdbc2e..0000000000
--- a/Utilities/Poco/Foundation/src/StreamChannel.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// StreamChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: StreamChannel
-//
-// Copyright (c) 2004-2006, 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/StreamChannel.h"
-#include "Poco/Message.h"
-
-
-namespace Poco {
-
-
-StreamChannel::StreamChannel(std::ostream& str): _str(str)
-{
-}
-
-
-StreamChannel::~StreamChannel()
-{
-}
-
-
-void StreamChannel::log(const Message& msg)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- _str << msg.getText() << std::endl;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/StreamConverter.cpp b/Utilities/Poco/Foundation/src/StreamConverter.cpp
deleted file mode 100755
index 70017bb41a..0000000000
--- a/Utilities/Poco/Foundation/src/StreamConverter.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-//
-// StreamConverter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: StreamConverter
-//
-// Copyright (c) 2004-2006, 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/StreamConverter.h"
-#include "Poco/TextEncoding.h"
-
-
-namespace Poco {
-
-
-StreamConverterBuf::StreamConverterBuf(std::istream& istr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar):
- _pIstr(&istr),
- _pOstr(0),
- _inEncoding(inEncoding),
- _outEncoding(outEncoding),
- _defaultChar(defaultChar),
- _sequenceLength(0),
- _pos(0),
- _errors(0)
-{
-}
-
-
-StreamConverterBuf::StreamConverterBuf(std::ostream& ostr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar):
- _pIstr(0),
- _pOstr(&ostr),
- _inEncoding(inEncoding),
- _outEncoding(outEncoding),
- _defaultChar(defaultChar),
- _sequenceLength(0),
- _pos(0),
- _errors(0)
-{
-}
-
-
-StreamConverterBuf::~StreamConverterBuf()
-{
-}
-
-
-int StreamConverterBuf::readFromDevice()
-{
- poco_assert_dbg (_pIstr);
-
- if (_pos < _sequenceLength) return _buffer[_pos++];
-
- _pos = 0;
- _sequenceLength = 0;
- int c = _pIstr->get();
- if (c == -1) return -1;
-
- poco_assert (c < 256);
- int uc;
- int n = _inEncoding.characterMap()[c];
- if (n == -1)
- {
- uc = _defaultChar;
- ++_errors;
- }
- else if (n >= 0)
- uc = n;
- else
- {
- poco_assert_dbg(-n <= sizeof(_buffer));
- _buffer[0] = (unsigned char) c;
- _pIstr->read((char*) _buffer + 1, -n - 1);
- if (_pIstr->gcount() == -n - 1)
- {
- uc = _inEncoding.convert(_buffer);
- if (uc == -1)
- {
- uc = _defaultChar;
- ++_errors;
- }
- }
- else
- {
- uc = _defaultChar;
- ++_errors;
- }
- }
- _sequenceLength = _outEncoding.convert(uc, _buffer, sizeof(_buffer));
- if (_sequenceLength == 0)
- _sequenceLength = _outEncoding.convert(_defaultChar, _buffer, sizeof(_buffer));
- if (_sequenceLength == 0)
- return -1;
- else
- return _buffer[_pos++];
-}
-
-
-int StreamConverterBuf::writeToDevice(char c)
-{
- poco_assert_dbg (_pOstr);
-
- if (_sequenceLength == 0)
- {
- int n = _inEncoding.characterMap()[(unsigned char) c];
- if (n == -1)
- {
- ++_errors;
- return -1;
- }
- _buffer[0] = (unsigned char) c;
- _sequenceLength = n < 0 ? -n : 1;
- _pos = 1;
- }
- else _buffer[_pos++] = (unsigned char) c;
- if (_pos == _sequenceLength)
- {
- int uc = _inEncoding.convert(_buffer);
- if (uc == -1)
- {
- ++_errors;
- return -1;
- }
- int n = _outEncoding.convert(uc, _buffer, sizeof(_buffer));
- if (n == 0) n = _outEncoding.convert(_defaultChar, _buffer, sizeof(_buffer));
- poco_assert_dbg (n <= sizeof(_buffer));
- _pOstr->write((char*) _buffer, n);
- _sequenceLength = 0;
- _pos = 0;
- }
- return charToInt(c);
-}
-
-
-int StreamConverterBuf::errors() const
-{
- return _errors;
-}
-
-
-StreamConverterIOS::StreamConverterIOS(std::istream& istr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar):
- _buf(istr, inEncoding, outEncoding, defaultChar)
-{
- poco_ios_init(&_buf);
-}
-
-
-StreamConverterIOS::StreamConverterIOS(std::ostream& ostr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar):
- _buf(ostr, inEncoding, outEncoding, defaultChar)
-{
- poco_ios_init(&_buf);
-}
-
-
-StreamConverterIOS::~StreamConverterIOS()
-{
-}
-
-
-StreamConverterBuf* StreamConverterIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-int StreamConverterIOS::errors() const
-{
- return _buf.errors();
-}
-
-
-InputStreamConverter::InputStreamConverter(std::istream& istr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar):
- StreamConverterIOS(istr, inEncoding, outEncoding, defaultChar),
- std::istream(&_buf)
-{
-}
-
-
-InputStreamConverter::~InputStreamConverter()
-{
-}
-
-
-OutputStreamConverter::OutputStreamConverter(std::ostream& ostr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar):
- StreamConverterIOS(ostr, inEncoding, outEncoding, defaultChar),
- std::ostream(&_buf)
-{
-}
-
-
-OutputStreamConverter::~OutputStreamConverter()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/StreamCopier.cpp b/Utilities/Poco/Foundation/src/StreamCopier.cpp
deleted file mode 100755
index 79231094a1..0000000000
--- a/Utilities/Poco/Foundation/src/StreamCopier.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// StreamCopier.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: StreamCopier
-//
-// Copyright (c) 2004-2006, 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/StreamCopier.h"
-#include "Poco/Buffer.h"
-
-
-namespace Poco {
-
-
-std::streamsize StreamCopier::copyStream(std::istream& istr, std::ostream& ostr, unsigned bufferSize)
-{
- poco_assert (bufferSize > 0);
-
- Buffer<char> buffer(bufferSize);
- std::streamsize len = 0;
- istr.read(buffer.begin(), bufferSize);
- std::streamsize n = istr.gcount();
- while (n > 0)
- {
- len += n;
- ostr.write(buffer.begin(), n);
- if (istr && ostr)
- {
- istr.read(buffer.begin(), bufferSize);
- n = istr.gcount();
- }
- else n = 0;
- }
- return len;
-}
-
-
-std::streamsize StreamCopier::copyToString(std::istream& istr, std::string& str, unsigned bufferSize)
-{
- poco_assert (bufferSize > 0);
-
- Buffer<char> buffer(bufferSize);
- std::streamsize len = 0;
- istr.read(buffer.begin(), bufferSize);
- std::streamsize n = istr.gcount();
- while (n > 0)
- {
- len += n;
- str.append(buffer.begin(), static_cast<std::string::size_type>(n));
- if (istr)
- {
- istr.read(buffer.begin(), bufferSize);
- n = istr.gcount();
- }
- else n = 0;
- }
- return len;
-}
-
-
-std::streamsize StreamCopier::copyStreamUnbuffered(std::istream& istr, std::ostream& ostr)
-{
- char c;
- std::streamsize len = 0;
- istr.get(c);
- while (istr && ostr)
- {
- ++len;
- ostr.put(c);
- istr.get(c);
- }
- return len;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/StreamTokenizer.cpp b/Utilities/Poco/Foundation/src/StreamTokenizer.cpp
deleted file mode 100755
index 8cf67de363..0000000000
--- a/Utilities/Poco/Foundation/src/StreamTokenizer.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// StreamTokenizer.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: StreamTokenizer
-//
-// Copyright (c) 2004-2006, 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/StreamTokenizer.h"
-
-
-namespace Poco {
-
-
-StreamTokenizer::StreamTokenizer():
- _pIstr(0)
-{
-}
-
-
-StreamTokenizer::StreamTokenizer(std::istream& istr):
- _pIstr(&istr)
-{
-}
-
-
-StreamTokenizer::~StreamTokenizer()
-{
- for (TokenVec::iterator it = _tokens.begin(); it != _tokens.end(); ++it)
- {
- delete it->pToken;
- }
-}
-
-
-void StreamTokenizer::attachToStream(std::istream& istr)
-{
- _pIstr = &istr;
-}
-
-
-void StreamTokenizer::addToken(Token* pToken)
-{
- poco_check_ptr (pToken);
-
- TokenInfo ti;
- ti.pToken = pToken;
- ti.ignore = (pToken->tokenClass() == Token::COMMENT_TOKEN || pToken->tokenClass() == Token::WHITESPACE_TOKEN);
- _tokens.push_back(ti);
-}
-
-
-void StreamTokenizer::addToken(Token* pToken, bool ignore)
-{
- poco_check_ptr (pToken);
-
- TokenInfo ti;
- ti.pToken = pToken;
- ti.ignore = ignore;
- _tokens.push_back(ti);
-}
-
-
-const Token* StreamTokenizer::next()
-{
- poco_check_ptr (_pIstr);
-
- static const int eof = std::char_traits<char>::eof();
-
- int first = _pIstr->get();
- TokenVec::const_iterator it = _tokens.begin();
- while (first != eof && it != _tokens.end())
- {
- const TokenInfo& ti = *it;
- if (ti.pToken->start((char) first, *_pIstr))
- {
- ti.pToken->finish(*_pIstr);
- if (ti.ignore)
- {
- first = _pIstr->get();
- it = _tokens.begin();
- }
- else return ti.pToken;
- }
- else ++it;
- }
- if (first == eof)
- {
- return &_eofToken;
- }
- else
- {
- _invalidToken.start((char) first, *_pIstr);
- return &_invalidToken;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/String.cpp b/Utilities/Poco/Foundation/src/String.cpp
deleted file mode 100755
index 7235a53614..0000000000
--- a/Utilities/Poco/Foundation/src/String.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-//
-// String.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: String
-//
-// Copyright (c) 2004-2006, 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/String.h"
-
-
-namespace Poco {
-
-
-#if defined(POCO_NO_TEMPLATE_ICOMPARE)
-
-
-int icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, std::string::const_iterator it2, std::string::const_iterator end2)
-{
- std::string::size_type sz = str.size();
- if (pos > sz) pos = sz;
- if (pos + n > sz) n = sz - pos;
- std::string::const_iterator it1 = str.begin() + pos;
- std::string::const_iterator end1 = str.begin() + pos + n;
- while (it1 != end1 && it2 != end2)
- {
- std::string::value_type c1 = std::tolower(*it1);
- std::string::value_type c2 = std::tolower(*it2);
- if (c1 < c2)
- return -1;
- else if (c1 > c2)
- return 1;
- ++it1; ++it2;
- }
-
- if (it1 == end1)
- return it2 == end2 ? 0 : -1;
- else
- return 1;
-}
-
-
-int icompare(const std::string& str1, const std::string& str2)
-{
- return icompare(str1, 0, str1.size(), str2.begin(), str2.end());
-}
-
-
-int icompare(const std::string& str1, std::string::size_type n1, const std::string& str2, std::string::size_type n2)
-{
- if (n2 > str2.size()) n2 = str2.size();
- return icompare(str1, 0, n1, str2.begin(), str2.begin() + n2);
-}
-
-
-int icompare(const std::string& str1, std::string::size_type n, const std::string& str2)
-{
- if (n > str2.size()) n = str2.size();
- return icompare(str1, 0, n, str2.begin(), str2.begin() + n);
-}
-
-
-int icompare(const std::string& str1, std::string::size_type pos, std::string::size_type n, const std::string& str2)
-{
- return icompare(str1, pos, n, str2.begin(), str2.end());
-}
-
-
-int icompare(const std::string& str1, std::string::size_type pos1, std::string::size_type n1, const std::string& str2, std::string::size_type pos2, std::string::size_type n2)
-{
- std::string::size_type sz2 = str2.size();
- if (pos2 > sz2) pos2 = sz2;
- if (pos2 + n2 > sz2) n2 = sz2 - pos2;
- return icompare(str1, pos1, n1, str2.begin() + pos2, str2.begin() + pos2 + n2);
-}
-
-
-int icompare(const std::string& str1, std::string::size_type pos1, std::string::size_type n, const std::string& str2, std::string::size_type pos2)
-{
- std::string::size_type sz2 = str2.size();
- if (pos2 > sz2) pos2 = sz2;
- if (pos2 + n > sz2) n = sz2 - pos2;
- return icompare(str1, pos1, n, str2.begin() + pos2, str2.begin() + pos2 + n);
-}
-
-
-int icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, const std::string::value_type* ptr)
-{
- poco_check_ptr (ptr);
- std::string::size_type sz = str.size();
- if (pos > sz) pos = sz;
- if (pos + n > sz) n = sz - pos;
- std::string::const_iterator it = str.begin() + pos;
- std::string::const_iterator end = str.begin() + pos + n;
- while (it != end && *ptr)
- {
- std::string::value_type c1 = std::tolower(*it);
- std::string::value_type c2 = std::tolower(*ptr);
- if (c1 < c2)
- return -1;
- else if (c1 > c2)
- return 1;
- ++it; ++ptr;
- }
-
- if (it == end)
- return *ptr == 0 ? 0 : -1;
- else
- return 1;
-}
-
-
-int icompare(const std::string& str, std::string::size_type pos, const std::string::value_type* ptr)
-{
- return icompare(str, pos, str.size() - pos, ptr);
-}
-
-
-int icompare(const std::string& str, const std::string::value_type* ptr)
-{
- return icompare(str, 0, str.size(), ptr);
-}
-
-
-std::string replace(const std::string& str, const std::string& from, const std::string& to, std::string::size_type start)
-{
- std::string result(str);
- replaceInPlace(result, from, to, start);
- return result;
-}
-
-
-std::string replace(const std::string& str, const std::string::value_type* from, const std::string::value_type* to, std::string::size_type start)
-{
- std::string result(str);
- replaceInPlace(result, from, to, start);
- return result;
-}
-
-
-std::string& replaceInPlace(std::string& str, const std::string& from, const std::string& to, std::string::size_type start)
-{
- poco_assert (from.size() > 0);
-
- std::string result;
- std::string::size_type pos = 0;
- result.append(str, 0, start);
- do
- {
- pos = str.find(from, start);
- if (pos != std::string::npos)
- {
- result.append(str, start, pos - start);
- result.append(to);
- start = pos + from.length();
- }
- else result.append(str, start, str.size() - start);
- }
- while (pos != std::string::npos);
- str.swap(result);
- return str;
-}
-
-
-std::string& replaceInPlace(std::string& str, const std::string::value_type* from, const std::string::value_type* to, std::string::size_type start)
-{
- poco_assert (*from);
-
- std::string result;
- std::string::size_type pos = 0;
- std::string::size_type fromLen = std::strlen(from);
- result.append(str, 0, start);
- do
- {
- pos = str.find(from, start);
- if (pos != std::string::npos)
- {
- result.append(str, start, pos - start);
- result.append(to);
- start = pos + fromLen;
- }
- else result.append(str, start, str.size() - start);
- }
- while (pos != std::string::npos);
- str.swap(result);
- return str;
-}
-
-
-#endif
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/StringTokenizer.cpp b/Utilities/Poco/Foundation/src/StringTokenizer.cpp
deleted file mode 100755
index 5e5663d8ec..0000000000
--- a/Utilities/Poco/Foundation/src/StringTokenizer.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// StringTokenizer.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: StringTokenizer
-//
-// Copyright (c) 2004-2006, 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/StringTokenizer.h"
-#include <cctype>
-
-
-namespace Poco {
-
-
-StringTokenizer::StringTokenizer(const std::string& str, const std::string& separators, int options)
-{
- std::string::const_iterator it1 = str.begin();
- std::string::const_iterator it2;
- std::string::const_iterator it3;
- std::string::const_iterator end = str.end();
-
- while (it1 != end)
- {
- if (options & TOK_TRIM)
- {
- while (it1 != end && std::isspace(*it1)) ++it1;
- }
- it2 = it1;
- while (it2 != end && separators.find(*it2) == std::string::npos) ++it2;
- it3 = it2;
- if (it3 != it1 && (options & TOK_TRIM))
- {
- --it3;
- while (it3 != it1 && std::isspace(*it3)) --it3;
- if (!std::isspace(*it3)) ++it3;
- }
- if (options & TOK_IGNORE_EMPTY)
- {
- if (it3 != it1)
- _tokens.push_back(std::string(it1, it3));
- }
- else
- {
- _tokens.push_back(std::string(it1, it3));
- }
- it1 = it2;
- if (it1 != end) ++it1;
- }
-}
-
-
-StringTokenizer::~StringTokenizer()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SynchronizedObject.cpp b/Utilities/Poco/Foundation/src/SynchronizedObject.cpp
deleted file mode 100755
index e72ad93d2e..0000000000
--- a/Utilities/Poco/Foundation/src/SynchronizedObject.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// SynchronizedObject.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: SynchronizedObject
-//
-// Copyright (c) 2004-2006, 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/SynchronizedObject.h"
-
-
-namespace Poco {
-
-
-SynchronizedObject::SynchronizedObject()
-{
-}
-
-
-SynchronizedObject::~SynchronizedObject()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/SyslogChannel.cpp b/Utilities/Poco/Foundation/src/SyslogChannel.cpp
deleted file mode 100755
index 2677fcdb8e..0000000000
--- a/Utilities/Poco/Foundation/src/SyslogChannel.cpp
+++ /dev/null
@@ -1,278 +0,0 @@
-//
-// SyslogChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: SyslogChannel
-//
-// Copyright (c) 2004-2006, 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/SyslogChannel.h"
-#include "Poco/Message.h"
-#include "Poco/StringTokenizer.h"
-#include <syslog.h>
-
-
-namespace Poco {
-
-
-const std::string SyslogChannel::PROP_NAME = "name";
-const std::string SyslogChannel::PROP_FACILITY = "facility";
-const std::string SyslogChannel::PROP_OPTIONS = "options";
-
-
-SyslogChannel::SyslogChannel():
- _options(SYSLOG_CONS),
- _facility(SYSLOG_USER),
- _open(false)
-{
-}
-
-
-SyslogChannel::SyslogChannel(const std::string& name, int options, int facility):
- _name(name),
- _options(options),
- _facility(facility),
- _open(false)
-{
-}
-
-
-SyslogChannel::~SyslogChannel()
-{
- close();
-}
-
-
-void SyslogChannel::open()
-{
- openlog(_name.c_str(), _options, _facility);
- _open = true;
-}
-
-
-void SyslogChannel::close()
-{
- if (_open)
- {
- closelog();
- _open = false;
- }
-}
-
-
-void SyslogChannel::log(const Message& msg)
-{
- if (!_open) open();
- syslog(getPrio(msg), "%s", msg.getText().c_str());
-}
-
-
-void SyslogChannel::setProperty(const std::string& name, const std::string& value)
-{
- if (name == PROP_NAME)
- {
- _name = value;
- }
- else if (name == PROP_FACILITY)
- {
- if (value == "LOG_KERN")
- _facility = SYSLOG_KERN;
- else if (value == "LOG_USER")
- _facility = SYSLOG_USER;
- else if (value == "LOG_MAIL")
- _facility = SYSLOG_MAIL;
- else if (value == "LOG_DAEMON")
- _facility = SYSLOG_DAEMON;
- else if (value == "LOG_AUTH")
- _facility = SYSLOG_AUTH;
- else if (value == "LOG_AUTHPRIV")
- _facility = SYSLOG_AUTHPRIV;
- else if (value == "LOG_SYSLOG")
- _facility = SYSLOG_SYSLOG;
- else if (value == "LOG_LPR")
- _facility = SYSLOG_LPR;
- else if (value == "LOG_NEWS")
- _facility = SYSLOG_NEWS;
- else if (value == "LOG_UUCP")
- _facility = SYSLOG_UUCP;
- else if (value == "LOG_CRON")
- _facility = SYSLOG_CRON;
- else if (value == "LOG_FTP")
- _facility = SYSLOG_FTP;
- else if (value == "LOG_LOCAL0")
- _facility = SYSLOG_LOCAL0;
- else if (value == "LOG_LOCAL1")
- _facility = SYSLOG_LOCAL1;
- else if (value == "LOG_LOCAL2")
- _facility = SYSLOG_LOCAL2;
- else if (value == "LOG_LOCAL3")
- _facility = SYSLOG_LOCAL3;
- else if (value == "LOG_LOCAL4")
- _facility = SYSLOG_LOCAL4;
- else if (value == "LOG_LOCAL5")
- _facility = SYSLOG_LOCAL5;
- else if (value == "LOG_LOCAL6")
- _facility = SYSLOG_LOCAL6;
- else if (value == "LOG_LOCAL7")
- _facility = SYSLOG_LOCAL7;
- }
- else if (name == PROP_OPTIONS)
- {
- _options = 0;
- StringTokenizer tokenizer(value, "|+:;,", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
- for (StringTokenizer::Iterator it = tokenizer.begin(); it != tokenizer.end(); ++it)
- {
- if (*it == "LOG_CONS")
- _options |= SYSLOG_CONS;
- else if (*it == "LOG_NDELAY")
- _options |= SYSLOG_NDELAY;
- else if (*it == "LOG_PERROR")
- _options |= SYSLOG_PERROR;
- else if (*it == "LOG_PID")
- _options |= SYSLOG_PID;
- }
- }
- else
- {
- Channel::setProperty(name, value);
- }
-}
-
-
-std::string SyslogChannel::getProperty(const std::string& name) const
-{
- if (name == PROP_NAME)
- {
- return _name;
- }
- else if (name == PROP_FACILITY)
- {
- if (_facility == SYSLOG_KERN)
- return "LOG_KERN";
- else if (_facility == SYSLOG_USER)
- return "LOG_USER";
- else if (_facility == SYSLOG_MAIL)
- return "LOG_MAIL";
- else if (_facility == SYSLOG_DAEMON)
- return "LOG_DAEMON";
- else if (_facility == SYSLOG_AUTH)
- return "LOG_AUTH";
- else if (_facility == SYSLOG_AUTHPRIV)
- return "LOG_AUTHPRIV";
- else if (_facility == SYSLOG_SYSLOG)
- return "LOG_SYSLOG";
- else if (_facility == SYSLOG_LPR)
- return "LOG_LPR";
- else if (_facility == SYSLOG_NEWS)
- return "LOG_NEWS";
- else if (_facility == SYSLOG_UUCP)
- return "LOG_UUCP";
- else if (_facility == SYSLOG_CRON)
- return "LOG_CRON";
- else if (_facility == SYSLOG_FTP)
- return "LOG_FTP";
- else if (_facility == SYSLOG_LOCAL0)
- return "LOG_LOCAL0";
- else if (_facility == SYSLOG_LOCAL1)
- return "LOG_LOCAL1";
- else if (_facility == SYSLOG_LOCAL2)
- return "LOG_LOCAL2";
- else if (_facility == SYSLOG_LOCAL3)
- return "LOG_LOCAL3";
- else if (_facility == SYSLOG_LOCAL4)
- return "LOG_LOCAL4";
- else if (_facility == SYSLOG_LOCAL5)
- return "LOG_LOCAL5";
- else if (_facility == SYSLOG_LOCAL6)
- return "LOG_LOCAL6";
- else if (_facility == SYSLOG_LOCAL7)
- return "LOG_LOCAL7";
- else
- return "";
- }
- else if (name == PROP_OPTIONS)
- {
- std::string result;
- if (_options & SYSLOG_CONS)
- {
- if (!result.empty()) result.append("|");
- result.append("LOG_CONS");
- }
- if (_options & SYSLOG_NDELAY)
- {
- if (!result.empty()) result.append("|");
- result.append("LOG_NDELAY");
- }
- if (_options & SYSLOG_PERROR)
- {
- if (!result.empty()) result.append("|");
- result.append("LOG_PERROR");
- }
- if (_options & SYSLOG_PID)
- {
- if (!result.empty()) result.append("|");
- result.append("LOG_PID");
- }
- return result;
- }
- else
- {
- return Channel::getProperty(name);
- }
-}
-
-
-int SyslogChannel::getPrio(const Message& msg)
-{
- switch (msg.getPriority())
- {
- case Message::PRIO_TRACE:
- case Message::PRIO_DEBUG:
- return LOG_DEBUG;
- case Message::PRIO_INFORMATION:
- return LOG_INFO;
- case Message::PRIO_NOTICE:
- return LOG_NOTICE;
- case Message::PRIO_WARNING:
- return LOG_WARNING;
- case Message::PRIO_ERROR:
- return LOG_ERR;
- case Message::PRIO_CRITICAL:
- return LOG_CRIT;
- case Message::PRIO_FATAL:
- return LOG_ALERT;
- default:
- return 0;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Task.cpp b/Utilities/Poco/Foundation/src/Task.cpp
deleted file mode 100755
index 2275c9d563..0000000000
--- a/Utilities/Poco/Foundation/src/Task.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-//
-// Task.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Tasks
-// Module: Tasks
-//
-// Copyright (c) 2004-2006, 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/Task.h"
-#include "Poco/TaskManager.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-Task::Task(const std::string& name):
- _name(name),
- _pOwner(0),
- _progress(0),
- _state(TASK_IDLE),
- _cancelEvent(false)
-{
-}
-
-
-Task::~Task()
-{
-}
-
-
-void Task::cancel()
-{
- _state = TASK_CANCELLING;
- _cancelEvent.set();
- if (_pOwner)
- _pOwner->taskCancelled(this);
-}
-
-
-void Task::reset()
-{
- _progress = 0.0;
- _state = TASK_IDLE;
- _cancelEvent.reset();
-}
-
-
-void Task::run()
-{
- TaskManager* pOwner = getOwner();
- if (pOwner)
- pOwner->taskStarted(this);
- try
- {
- _state = TASK_RUNNING;
- runTask();
- }
- catch (Exception& exc)
- {
- if (pOwner)
- pOwner->taskFailed(this, exc);
- }
- catch (std::exception& exc)
- {
- if (pOwner)
- pOwner->taskFailed(this, SystemException(exc.what()));
- }
- catch (...)
- {
- if (pOwner)
- pOwner->taskFailed(this, SystemException("unknown exception"));
- }
- _state = TASK_FINISHED;
- if (pOwner)
- pOwner->taskFinished(this);
-}
-
-
-bool Task::sleep(long milliseconds)
-{
- return _cancelEvent.tryWait(milliseconds);
-}
-
-
-void Task::setProgress(float progress)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- _progress = progress;
- if (_pOwner)
- _pOwner->taskProgress(this, _progress);
-}
-
-
-void Task::setOwner(TaskManager* pOwner)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- _pOwner = pOwner;
-}
-
-
-void Task::setState(TaskState state)
-{
- _state = state;
-}
-
-
-void Task::postNotification(Notification* pNf)
-{
- poco_check_ptr (pNf);
-
- FastMutex::ScopedLock lock(_mutex);
-
- if (_pOwner)
- {
- _pOwner->postNotification(pNf);
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/TaskManager.cpp b/Utilities/Poco/Foundation/src/TaskManager.cpp
deleted file mode 100755
index 664ac0fb50..0000000000
--- a/Utilities/Poco/Foundation/src/TaskManager.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-//
-// TaskManager.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Tasks
-// Module: Tasks
-//
-// Copyright (c) 2004-2006, 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/TaskManager.h"
-#include "Poco/TaskNotification.h"
-#include "Poco/ThreadPool.h"
-
-
-namespace Poco {
-
-
-const int TaskManager::MIN_PROGRESS_NOTIFICATION_INTERVAL = 100000; // 100 milliseconds
-
-
-TaskManager::TaskManager():
- _threadPool(ThreadPool::defaultPool())
-{
-}
-
-
-TaskManager::TaskManager(ThreadPool& pool):
- _threadPool(pool)
-{
-}
-
-
-TaskManager::~TaskManager()
-{
-}
-
-
-void TaskManager::start(Task* pTask)
-{
- TaskPtr pAutoTask(pTask); // take ownership immediately
- FastMutex::ScopedLock lock(_mutex);
-
- pAutoTask->setOwner(this);
- pAutoTask->setState(Task::TASK_STARTING);
- _taskList.push_back(pAutoTask);
- try
- {
- _threadPool.start(*pAutoTask, pAutoTask->name());
- }
- catch (...)
- {
- // Make sure that we don't act like we own the task since
- // we never started it. If we leave the task on our task
- // list, the size of the list is incorrect.
- _taskList.pop_back();
- throw;
- }
-}
-
-
-void TaskManager::cancelAll()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- for (TaskList::iterator it = _taskList.begin(); it != _taskList.end(); ++it)
- {
- (*it)->cancel();
- }
-}
-
-
-void TaskManager::joinAll()
-{
- _threadPool.joinAll();
-}
-
-
-TaskManager::TaskList TaskManager::taskList() const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return _taskList;
-}
-
-
-void TaskManager::addObserver(const AbstractObserver& observer)
-{
- _nc.addObserver(observer);
-}
-
-
-void TaskManager::removeObserver(const AbstractObserver& observer)
-{
- _nc.removeObserver(observer);
-}
-
-
-void TaskManager::postNotification(Notification* pNf)
-{
- _nc.postNotification(pNf);
-}
-
-
-void TaskManager::taskStarted(Task* pTask)
-{
- _nc.postNotification(new TaskStartedNotification(pTask));
-}
-
-
-void TaskManager::taskProgress(Task* pTask, float progress)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (_lastProgressNotification.isElapsed(MIN_PROGRESS_NOTIFICATION_INTERVAL))
- {
- _lastProgressNotification.update();
- _nc.postNotification(new TaskProgressNotification(pTask, progress));
- }
-}
-
-
-void TaskManager::taskCancelled(Task* pTask)
-{
- _nc.postNotification(new TaskCancelledNotification(pTask));
-}
-
-
-void TaskManager::taskFinished(Task* pTask)
-{
- _nc.postNotification(new TaskFinishedNotification(pTask));
-
- FastMutex::ScopedLock lock(_mutex);
- for (TaskList::iterator it = _taskList.begin(); it != _taskList.end(); ++it)
- {
- if (*it == pTask)
- {
- _taskList.erase(it);
- break;
- }
- }
-}
-
-
-void TaskManager::taskFailed(Task* pTask, const Exception& exc)
-{
- _nc.postNotification(new TaskFailedNotification(pTask, exc));
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/TaskNotification.cpp b/Utilities/Poco/Foundation/src/TaskNotification.cpp
deleted file mode 100755
index 72f9d5e488..0000000000
--- a/Utilities/Poco/Foundation/src/TaskNotification.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// TaskNotification.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Tasks
-// Module: Tasks
-//
-// Copyright (c) 2004-2006, 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/TaskNotification.h"
-
-
-namespace Poco {
-
-
-TaskNotification::TaskNotification(Task* pTask):
- _pTask(pTask)
-{
- if (_pTask) _pTask->duplicate();
-}
-
-
-TaskNotification::~TaskNotification()
-{
- if (_pTask) _pTask->release();
-}
-
-
-TaskStartedNotification::TaskStartedNotification(Task* pTask):
- TaskNotification(pTask)
-{
-}
-
-
-TaskStartedNotification::~TaskStartedNotification()
-{
-}
-
-
-TaskCancelledNotification::TaskCancelledNotification(Task* pTask):
- TaskNotification(pTask)
-{
-}
-
-
-TaskCancelledNotification::~TaskCancelledNotification()
-{
-}
-
-
-TaskFinishedNotification::TaskFinishedNotification(Task* pTask):
- TaskNotification(pTask)
-{
-}
-
-
-TaskFinishedNotification::~TaskFinishedNotification()
-{
-}
-
-
-TaskFailedNotification::TaskFailedNotification(Task* pTask, const Exception& exc):
- TaskNotification(pTask),
- _pException(exc.clone())
-{
-}
-
-
-TaskFailedNotification::~TaskFailedNotification()
-{
- delete _pException;
-}
-
-
-TaskProgressNotification::TaskProgressNotification(Task* pTask, float progress):
- TaskNotification(pTask),
- _progress(progress)
-{
-}
-
-
-TaskProgressNotification::~TaskProgressNotification()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/TeeStream.cpp b/Utilities/Poco/Foundation/src/TeeStream.cpp
deleted file mode 100755
index 1696457213..0000000000
--- a/Utilities/Poco/Foundation/src/TeeStream.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// TeeStream.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: TeeStream
-//
-// Copyright (c) 2005-2006, 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/TeeStream.h"
-
-
-namespace Poco {
-
-
-TeeStreamBuf::TeeStreamBuf():
- _pIstr(0)
-{
-}
-
-
-TeeStreamBuf::TeeStreamBuf(std::istream& istr):
- _pIstr(&istr)
-{
-}
-
-
-TeeStreamBuf::TeeStreamBuf(std::ostream& ostr):
- _pIstr(0)
-{
- _streams.push_back(&ostr);
-}
-
-
-TeeStreamBuf::~TeeStreamBuf()
-{
-}
-
-
-void TeeStreamBuf::addStream(std::ostream& ostr)
-{
- _streams.push_back(&ostr);
-}
-
-
-int TeeStreamBuf::readFromDevice()
-{
- if (_pIstr)
- {
- int c = _pIstr->get();
- if (c != -1) writeToDevice((char) c);
- return c;
- }
- return -1;
-}
-
-
-int TeeStreamBuf::writeToDevice(char c)
-{
- for (StreamVec::iterator it = _streams.begin(); it != _streams.end(); ++it)
- {
- (*it)->put(c);
- }
- return charToInt(c);
-}
-
-
-TeeIOS::TeeIOS()
-{
- poco_ios_init(&_buf);
-}
-
-
-TeeIOS::TeeIOS(std::istream& istr): _buf(istr)
-{
- poco_ios_init(&_buf);
-}
-
-
-TeeIOS::TeeIOS(std::ostream& ostr): _buf(ostr)
-{
- poco_ios_init(&_buf);
-}
-
-
-TeeIOS::~TeeIOS()
-{
-}
-
-
-void TeeIOS::addStream(std::ostream& ostr)
-{
- _buf.addStream(ostr);
-}
-
-
-TeeStreamBuf* TeeIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-TeeInputStream::TeeInputStream(std::istream& istr): TeeIOS(istr), std::istream(&_buf)
-{
-}
-
-
-TeeInputStream::~TeeInputStream()
-{
-}
-
-
-TeeOutputStream::TeeOutputStream(): std::ostream(&_buf)
-{
-}
-
-
-TeeOutputStream::TeeOutputStream(std::ostream& ostr): TeeIOS(ostr), std::ostream(&_buf)
-{
-}
-
-
-TeeOutputStream::~TeeOutputStream()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/TemporaryFile.cpp b/Utilities/Poco/Foundation/src/TemporaryFile.cpp
deleted file mode 100755
index 409f173074..0000000000
--- a/Utilities/Poco/Foundation/src/TemporaryFile.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// TemporaryFile.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Filesystem
-// Module: TemporaryFile
-//
-// Copyright (c) 2004-2006, 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/TemporaryFile.h"
-#include "Poco/Path.h"
-#include "Poco/Exception.h"
-#include "Poco/Process.h"
-#include "Poco/Mutex.h"
-#include <set>
-#include <sstream>
-
-
-namespace Poco {
-
-
-class TempFileCollector
-{
-public:
- TempFileCollector()
- {
- }
-
- ~TempFileCollector()
- {
- for (std::set<std::string>::iterator it = _files.begin(); it != _files.end(); ++it)
- {
- try
- {
- File f(*it);
- f.remove(true);
- }
- catch (Exception&)
- {
- }
- }
- }
-
- void registerFile(const std::string& path)
- {
- FastMutex::ScopedLock lock(_mutex);
-
- Path p(path);
- _files.insert(p.absolute().toString());
- }
-
-private:
- std::set<std::string> _files;
- FastMutex _mutex;
-};
-
-
-TemporaryFile::TemporaryFile(): File(tempName()), _keep(false)
-{
-}
-
-
-TemporaryFile::~TemporaryFile()
-{
- if (!_keep)
- {
- try
- {
- if (exists())
- remove(true);
- }
- catch (Exception&)
- {
- }
- }
-}
-
-
-void TemporaryFile::keep()
-{
- _keep = true;
-}
-
-
-void TemporaryFile::keepUntilExit()
-{
- _keep = true;
- registerForDeletion(path());
-}
-
-
-void TemporaryFile::registerForDeletion(const std::string& path)
-{
- static TempFileCollector fc;
- fc.registerFile(path);
-}
-
-
-std::string TemporaryFile::tempName()
-{
- std::ostringstream name;
- static FastMutex mutex;
- static unsigned long count = 0;
- mutex.lock();
- unsigned long n = count++;
- mutex.unlock();
- name << Path::temp();
- name << "tmp" << Process::id();
- for (int i = 0; i < 6; ++i)
- {
- name << char('a' + (n % 26));
- n /= 26;
- }
- return name.str();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/TextConverter.cpp b/Utilities/Poco/Foundation/src/TextConverter.cpp
deleted file mode 100755
index 01591e5175..0000000000
--- a/Utilities/Poco/Foundation/src/TextConverter.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// TextConverter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: TextConverter
-//
-// Copyright (c) 2004-2006, 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/TextConverter.h"
-#include "Poco/TextIterator.h"
-#include "Poco/TextEncoding.h"
-
-
-namespace {
- int nullTransform(int ch)
- {
- return ch;
- }
-}
-
-
-namespace Poco {
-
-
-TextConverter::TextConverter(const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar):
- _inEncoding(inEncoding),
- _outEncoding(outEncoding),
- _defaultChar(defaultChar)
-{
-}
-
-
-TextConverter::~TextConverter()
-{
-}
-
-
-int TextConverter::convert(const std::string& source, std::string& destination, Transform trans)
-{
- int errors = 0;
- TextIterator it(source, _inEncoding);
- TextIterator end(source);
- unsigned char buffer[TextEncoding::MAX_SEQUENCE_LENGTH];
-
- while (it != end)
- {
- int c = *it;
- if (c == -1) { ++errors; c = _defaultChar; }
- c = trans(c);
- int n = _outEncoding.convert(c, buffer, sizeof(buffer));
- if (n == 0) n = _outEncoding.convert(_defaultChar, buffer, sizeof(buffer));
- poco_assert (n <= sizeof(buffer));
- destination.append((const char*) buffer, n);
- ++it;
- }
- return errors;
-}
-
-
-int TextConverter::convert(const void* source, int length, std::string& destination, Transform trans)
-{
- poco_check_ptr (source);
-
- int errors = 0;
- const unsigned char* it = (const unsigned char*) source;
- const unsigned char* end = (const unsigned char*) source + length;
- unsigned char buffer[TextEncoding::MAX_SEQUENCE_LENGTH];
-
- while (it < end)
- {
- unsigned char c = *it;
- int n = _inEncoding.characterMap()[c];
- int uc;
- if (n == -1)
- {
- ++errors;
- uc = _defaultChar;
- ++it;
- }
- else if (n >= 0)
- {
- uc = n;
- ++it;
- }
- else
- {
- if (it - n <= end)
- {
- uc = _inEncoding.convert(it);
- if (uc == -1) uc = _defaultChar;
- }
- else
- {
- ++errors;
- uc = _defaultChar;
- }
- it -= n;
- }
- uc = trans(uc);
- n = _outEncoding.convert(uc, buffer, sizeof(buffer));
- if (n == 0) n = _outEncoding.convert(_defaultChar, buffer, sizeof(buffer));
- poco_assert (n <= sizeof(buffer));
- destination.append((const char*) buffer, n);
- }
- return errors;
-}
-
-
-int TextConverter::convert(const std::string& source, std::string& destination)
-{
- return convert(source, destination, nullTransform);
-}
-
-
-int TextConverter::convert(const void* source, int length, std::string& destination)
-{
- return convert(source, length, destination, nullTransform);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/TextEncoding.cpp b/Utilities/Poco/Foundation/src/TextEncoding.cpp
deleted file mode 100755
index e11780abe1..0000000000
--- a/Utilities/Poco/Foundation/src/TextEncoding.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-//
-// TextEncoding.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: TextEncoding
-//
-// Copyright (c) 2004-2006, 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/TextEncoding.h"
-#include "Poco/Exception.h"
-#include "Poco/String.h"
-#include "Poco/ASCIIEncoding.h"
-#include "Poco/Latin1Encoding.h"
-#include "Poco/Latin9Encoding.h"
-#include "Poco/UTF16Encoding.h"
-#include "Poco/UTF8Encoding.h"
-#include "Poco/Windows1252Encoding.h"
-#include "Poco/RWLock.h"
-#include "Poco/SingletonHolder.h"
-#include <map>
-
-
-namespace Poco {
-
-
-//
-// TextEncodingManager
-//
-
-
-class TextEncodingManager
-{
-public:
- TextEncodingManager()
- {
- TextEncoding::Ptr pUtf8Encoding(new UTF8Encoding);
- add(pUtf8Encoding, TextEncoding::GLOBAL);
-
- add(new ASCIIEncoding);
- add(new Latin1Encoding);
- add(new Latin9Encoding);
- add(pUtf8Encoding);
- add(new UTF16Encoding);
- add(new Windows1252Encoding);
- }
-
- ~TextEncodingManager()
- {
- }
-
- void add(TextEncoding::Ptr pEncoding)
- {
- add(pEncoding, pEncoding->canonicalName());
- }
-
- void add(TextEncoding::Ptr pEncoding, const std::string& name)
- {
- RWLock::ScopedLock lock(_lock, true);
-
- _encodings[name] = pEncoding;
- }
-
- void remove(const std::string& name)
- {
- RWLock::ScopedLock lock(_lock, true);
-
- _encodings.erase(name);
- }
-
- TextEncoding::Ptr find(const std::string& name) const
- {
- RWLock::ScopedLock lock(_lock);
-
- EncodingMap::const_iterator it = _encodings.find(name);
- if (it != _encodings.end())
- return it->second;
-
- for (it = _encodings.begin(); it != _encodings.end(); ++it)
- {
- if (it->second->isA(name))
- return it->second;
- }
- return TextEncoding::Ptr();
- }
-
-private:
- TextEncodingManager(const TextEncodingManager&);
- TextEncodingManager& operator = (const TextEncodingManager&);
-
- struct ILT
- {
- bool operator() (const std::string& s1, const std::string& s2) const
- {
- return Poco::icompare(s1, s2) < 0;
- }
- };
-
- typedef std::map<std::string, TextEncoding::Ptr, ILT> EncodingMap;
-
- EncodingMap _encodings;
- mutable RWLock _lock;
-};
-
-
-//
-// TextEncoding
-//
-
-
-const std::string TextEncoding::GLOBAL;
-
-
-TextEncoding::~TextEncoding()
-{
-}
-
-
-int TextEncoding::convert(const unsigned char* bytes) const
-{
- return (int) *bytes;
-}
-
-
-int TextEncoding::convert(int ch, unsigned char* bytes, int length) const
-{
- return 0;
-}
-
-
-TextEncoding& TextEncoding::byName(const std::string& encodingName)
-{
- TextEncoding* pEncoding = manager().find(encodingName);
- if (pEncoding)
- return *pEncoding;
- else
- throw NotFoundException(encodingName);
-}
-
-
-TextEncoding::Ptr TextEncoding::find(const std::string& encodingName)
-{
- return manager().find(encodingName);
-}
-
-
-void TextEncoding::add(TextEncoding::Ptr pEncoding)
-{
- manager().add(pEncoding, pEncoding->canonicalName());
-}
-
-
-void TextEncoding::add(TextEncoding::Ptr pEncoding, const std::string& name)
-{
- manager().add(pEncoding, name);
-}
-
-
-void TextEncoding::remove(const std::string& encodingName)
-{
- manager().remove(encodingName);
-}
-
-
-TextEncoding::Ptr TextEncoding::global(TextEncoding::Ptr encoding)
-{
- TextEncoding::Ptr prev = find(GLOBAL);
- add(encoding, GLOBAL);
- return prev;
-}
-
-
-TextEncoding& TextEncoding::global()
-{
- return byName(GLOBAL);
-}
-
-
-TextEncodingManager& TextEncoding::manager()
-{
- static SingletonHolder<TextEncodingManager> sh;
- return *sh.get();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/TextIterator.cpp b/Utilities/Poco/Foundation/src/TextIterator.cpp
deleted file mode 100755
index db3ea0acff..0000000000
--- a/Utilities/Poco/Foundation/src/TextIterator.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-//
-// TextIterator.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: TextIterator
-//
-// Copyright (c) 2004-2006, 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/TextIterator.h"
-#include "Poco/TextEncoding.h"
-#include <algorithm>
-
-
-namespace Poco {
-
-
-TextIterator::TextIterator():
- _pEncoding(0)
-{
-}
-
-
-TextIterator::TextIterator(const std::string& str, const TextEncoding& encoding):
- _pEncoding(&encoding),
- _it(str.begin()),
- _end(str.end())
-{
-}
-
-TextIterator::TextIterator(const std::string::const_iterator& begin, const std::string::const_iterator& end, const TextEncoding& encoding):
- _pEncoding(&encoding),
- _it(begin),
- _end(end)
-{
-}
-
-
-TextIterator::TextIterator(const std::string& str):
- _pEncoding(0),
- _it(str.end()),
- _end(str.end())
-{
-}
-
-
-TextIterator::TextIterator(const std::string::const_iterator& end):
- _pEncoding(0),
- _it(end),
- _end(end)
-{
-}
-
-
-TextIterator::~TextIterator()
-{
-}
-
-
-TextIterator::TextIterator(const TextIterator& it):
- _pEncoding(it._pEncoding),
- _it(it._it),
- _end(it._end)
-{
-}
-
-
-TextIterator& TextIterator::operator = (const TextIterator& it)
-{
- if (&it != this)
- {
- _pEncoding = it._pEncoding;
- _it = it._it;
- _end = it._end;
- }
- return *this;
-}
-
-
-void TextIterator::swap(TextIterator& it)
-{
- std::swap(_pEncoding, it._pEncoding);
- std::swap(_it, it._it);
- std::swap(_end, it._end);
-}
-
-
-int TextIterator::operator * () const
-{
- poco_check_ptr (_pEncoding);
- poco_assert (_it != _end);
-
- unsigned char c = (unsigned char) *_it;
- int n = _pEncoding->characterMap()[c];
- if (n >= -1) return n;
- else
- {
- poco_assert_dbg (n >= -TextEncoding::MAX_SEQUENCE_LENGTH);
- unsigned char buffer[TextEncoding::MAX_SEQUENCE_LENGTH];
- unsigned char* p = buffer;
- std::string::const_iterator it = _it;
- while (n < 0 && it != _end) { *p++ = *it++; ++n; }
- if (n == 0)
- return _pEncoding->convert(buffer);
- else
- return -1;
- }
-}
-
-
-TextIterator& TextIterator::operator ++ ()
-{
- poco_check_ptr (_pEncoding);
- poco_assert (_it != _end);
-
- unsigned char c = (unsigned char) *_it;
- int n = _pEncoding->characterMap()[c];
- if (n >= -1)
- ++_it;
- else
- while (n < 0 && _it != _end) { ++_it; ++n; }
-
- return *this;
-}
-
-
-TextIterator TextIterator::operator ++ (int)
-{
- TextIterator prev(*this);
- operator ++ ();
- return prev;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Thread.cpp b/Utilities/Poco/Foundation/src/Thread.cpp
deleted file mode 100755
index 7a7ec04b8d..0000000000
--- a/Utilities/Poco/Foundation/src/Thread.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-//
-// Thread.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Copyright (c) 2004-2006, 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/Thread.h"
-#include "Poco/Mutex.h"
-#include "Poco/Exception.h"
-#include "Poco/ThreadLocal.h"
-#include <sstream>
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Thread_WIN32.cpp"
-#else
-#include "Thread_POSIX.cpp"
-#endif
-
-
-namespace Poco {
-
-
-Thread::Thread():
- _id(uniqueId()),
- _name(makeName()),
- _pTLS(0)
-{
-}
-
-
-Thread::Thread(const std::string& name):
- _id(uniqueId()),
- _name(name),
- _pTLS(0)
-{
-}
-
-
-Thread::~Thread()
-{
- delete _pTLS;
-}
-
-
-void Thread::setPriority(Priority prio)
-{
- setPriorityImpl(prio);
-}
-
-
-Thread::Priority Thread::getPriority() const
-{
- return Priority(getPriorityImpl());
-}
-
-
-void Thread::start(Runnable& target)
-{
- startImpl(target);
-}
-
-
-void Thread::start(Callable target, void* pData)
-{
- startImpl(target, pData);
-}
-
-
-void Thread::join()
-{
- joinImpl();
-}
-
-
-void Thread::join(long milliseconds)
-{
- if (!joinImpl(milliseconds))
- throw TimeoutException();
-}
-
-
-bool Thread::tryJoin(long milliseconds)
-{
- return joinImpl(milliseconds);
-}
-
-
-ThreadLocalStorage& Thread::tls()
-{
- if (!_pTLS)
- _pTLS = new ThreadLocalStorage;
- return *_pTLS;
-}
-
-
-void Thread::clearTLS()
-{
- if (_pTLS)
- {
- delete _pTLS;
- _pTLS = 0;
- }
-}
-
-
-std::string Thread::makeName()
-{
- std::ostringstream name;
- name << '#' << _id;
- return name.str();
-}
-
-
-int Thread::uniqueId()
-{
- static FastMutex mtx;
- FastMutex::ScopedLock lock(mtx);
-
- static unsigned count = 0;
- ++count;
- return count;
-}
-
-
-void Thread::setName(const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- _name = name;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/ThreadLocal.cpp b/Utilities/Poco/Foundation/src/ThreadLocal.cpp
deleted file mode 100755
index 186c4d726f..0000000000
--- a/Utilities/Poco/Foundation/src/ThreadLocal.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// ThreadLocal.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Copyright (c) 2004-2006, 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/ThreadLocal.h"
-#include "Poco/SingletonHolder.h"
-#include "Poco/Thread.h"
-
-
-namespace Poco {
-
-
-TLSAbstractSlot::TLSAbstractSlot()
-{
-}
-
-
-TLSAbstractSlot::~TLSAbstractSlot()
-{
-}
-
-
-ThreadLocalStorage::ThreadLocalStorage()
-{
-}
-
-
-ThreadLocalStorage::~ThreadLocalStorage()
-{
- for (TLSMap::iterator it = _map.begin(); it != _map.end(); ++it)
- {
- delete it->second;
- }
-}
-
-
-TLSAbstractSlot*& ThreadLocalStorage::get(const void* key)
-{
-
- TLSMap::iterator it = _map.find(key);
- if (it == _map.end())
- {
- #if (_MSC_VER > 1500)
- return _map.insert(TLSMap::value_type(key, nullptr)).first->second;
- #else
- return _map.insert(TLSMap::value_type(key, 0)).first->second;
- #endif
- }
-
- else
- return it->second;
-}
-
-
-ThreadLocalStorage& ThreadLocalStorage::current()
-{
- Thread* pThread = Thread::current();
- if (pThread)
- {
- return pThread->tls();
- }
- else
- {
- static SingletonHolder<ThreadLocalStorage> sh;
- return *sh.get();
- }
-}
-
-
-void ThreadLocalStorage::clear()
-{
- Thread* pThread = Thread::current();
- if (pThread)
- pThread->clearTLS();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/ThreadPool.cpp b/Utilities/Poco/Foundation/src/ThreadPool.cpp
deleted file mode 100755
index 1b38d24ecb..0000000000
--- a/Utilities/Poco/Foundation/src/ThreadPool.cpp
+++ /dev/null
@@ -1,507 +0,0 @@
-//
-// ThreadPool.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ThreadPool
-//
-// Copyright (c) 2004-2006, 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/ThreadPool.h"
-#include "Poco/Runnable.h"
-#include "Poco/Thread.h"
-#include "Poco/Event.h"
-#include "Poco/ThreadLocal.h"
-#include "Poco/ErrorHandler.h"
-#include <sstream>
-#include <ctime>
-
-
-namespace Poco {
-
-
-class PooledThread: public Runnable
-{
-public:
- PooledThread(const std::string& name, int stackSize = POCO_THREAD_STACK_SIZE);
- ~PooledThread();
-
- void start();
- void start(Thread::Priority priority, Runnable& target);
- void start(Thread::Priority priority, Runnable& target, const std::string& name);
- bool idle();
- int idleTime();
- void join();
- void activate();
- void release();
- void run();
-
-private:
- volatile bool _idle;
- volatile std::time_t _idleTime;
- Runnable* _pTarget;
- std::string _name;
- Thread _thread;
- Event _targetReady;
- Event _targetCompleted;
- Event _started;
- FastMutex _mutex;
-};
-
-
-PooledThread::PooledThread(const std::string& name, int stackSize):
- _idle(true),
- _idleTime(0),
- _pTarget(0),
- _name(name),
- _thread(name),
- _targetCompleted(false)
-{
- poco_assert_dbg (stackSize >= 0);
- _thread.setStackSize(stackSize);
- _idleTime = time(NULL);
-}
-
-
-PooledThread::~PooledThread()
-{
-}
-
-
-void PooledThread::start()
-{
- _thread.start(*this);
- _started.wait();
-}
-
-
-void PooledThread::start(Thread::Priority priority, Runnable& target)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- poco_assert (_pTarget == 0);
-
- _pTarget = &target;
- _thread.setPriority(priority);
- _targetReady.set();
-}
-
-
-void PooledThread::start(Thread::Priority priority, Runnable& target, const std::string& name)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string fullName(name);
- if (name.empty())
- {
- fullName = _name;
- }
- else
- {
- fullName.append(" (");
- fullName.append(_name);
- fullName.append(")");
- }
- _thread.setName(fullName);
- _thread.setPriority(priority);
-
- poco_assert (_pTarget == 0);
-
- _pTarget = &target;
- _targetReady.set();
-}
-
-
-inline bool PooledThread::idle()
-{
- return _idle;
-}
-
-
-int PooledThread::idleTime()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return (int) (time(NULL) - _idleTime);
-}
-
-
-void PooledThread::join()
-{
- _mutex.lock();
- Runnable* pTarget = _pTarget;
- _mutex.unlock();
- if (pTarget)
- _targetCompleted.wait();
-}
-
-
-void PooledThread::activate()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- poco_assert (_idle);
- _idle = false;
- _targetCompleted.reset();
-}
-
-
-void PooledThread::release()
-{
- _mutex.lock();
- _pTarget = 0;
- _mutex.unlock();
- // In case of a statically allocated thread pool (such
- // as the default thread pool), Windows may have already
- // terminated the thread before we got here.
- if (_thread.isRunning())
- _targetReady.set();
- else
- delete this;
-}
-
-
-void PooledThread::run()
-{
- _started.set();
- for (;;)
- {
- _targetReady.wait();
- _mutex.lock();
- if (_pTarget) // a NULL target means kill yourself
- {
- _mutex.unlock();
- try
- {
- _pTarget->run();
- }
- catch (Exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (std::exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (...)
- {
- ErrorHandler::handle();
- }
- FastMutex::ScopedLock lock(_mutex);
- _pTarget = 0;
- _idleTime = time(NULL);
- _idle = true;
- _targetCompleted.set();
- ThreadLocalStorage::clear();
- _thread.setName(_name);
- _thread.setPriority(Thread::PRIO_NORMAL);
- }
- else
- {
- _mutex.unlock();
- break;
- }
- }
- delete this;
-}
-
-
-ThreadPool::ThreadPool(int minCapacity,
- int maxCapacity,
- int idleTime,
- int stackSize):
- _minCapacity(minCapacity),
- _maxCapacity(maxCapacity),
- _idleTime(idleTime),
- _serial(0),
- _age(0),
- _stackSize(stackSize)
-{
- poco_assert (minCapacity >= 1 && maxCapacity >= minCapacity && idleTime > 0);
-
- for (int i = 0; i < _minCapacity; i++)
- {
- PooledThread* pThread = createThread();
- _threads.push_back(pThread);
- pThread->start();
- }
-}
-
-
-ThreadPool::ThreadPool(const std::string& name,
- int minCapacity,
- int maxCapacity,
- int idleTime,
- int stackSize):
- _name(name),
- _minCapacity(minCapacity),
- _maxCapacity(maxCapacity),
- _idleTime(idleTime),
- _serial(0),
- _age(0),
- _stackSize(stackSize)
-{
- poco_assert (minCapacity >= 1 && maxCapacity >= minCapacity && idleTime > 0);
-
- for (int i = 0; i < _minCapacity; i++)
- {
- PooledThread* pThread = createThread();
- _threads.push_back(pThread);
- pThread->start();
- }
-}
-
-
-ThreadPool::~ThreadPool()
-{
- stopAll();
-}
-
-
-void ThreadPool::addCapacity(int n)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- poco_assert (_maxCapacity + n >= _minCapacity);
- _maxCapacity += n;
- housekeep();
-}
-
-
-int ThreadPool::capacity() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return _maxCapacity;
-}
-
-
-int ThreadPool::available() const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- int count = 0;
- for (ThreadVec::const_iterator it = _threads.begin(); it != _threads.end(); ++it)
- {
- if ((*it)->idle()) ++count;
- }
- return (int) (count + _maxCapacity - _threads.size());
-}
-
-
-int ThreadPool::used() const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- int count = 0;
- for (ThreadVec::const_iterator it = _threads.begin(); it != _threads.end(); ++it)
- {
- if (!(*it)->idle()) ++count;
- }
- return count;
-}
-
-
-int ThreadPool::allocated() const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return int(_threads.size());
-}
-
-
-void ThreadPool::start(Runnable& target)
-{
- getThread()->start(Thread::PRIO_NORMAL, target);
-}
-
-
-void ThreadPool::start(Runnable& target, const std::string& name)
-{
- getThread()->start(Thread::PRIO_NORMAL, target, name);
-}
-
-
-void ThreadPool::startWithPriority(Thread::Priority priority, Runnable& target)
-{
- getThread()->start(priority, target);
-}
-
-
-void ThreadPool::startWithPriority(Thread::Priority priority, Runnable& target, const std::string& name)
-{
- getThread()->start(priority, target, name);
-}
-
-
-void ThreadPool::stopAll()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- for (ThreadVec::iterator it = _threads.begin(); it != _threads.end(); ++it)
- {
- (*it)->release();
- }
- _threads.clear();
-}
-
-
-void ThreadPool::joinAll()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- for (ThreadVec::iterator it = _threads.begin(); it != _threads.end(); ++it)
- {
- (*it)->join();
- }
- housekeep();
-}
-
-
-void ThreadPool::collect()
-{
- FastMutex::ScopedLock lock(_mutex);
- housekeep();
-}
-
-
-void ThreadPool::housekeep()
-{
- _age = 0;
- if (_threads.size() <= _minCapacity)
- return;
-
- ThreadVec idleThreads;
- ThreadVec expiredThreads;
- ThreadVec activeThreads;
- idleThreads.reserve(_threads.size());
- activeThreads.reserve(_threads.size());
-
- for (ThreadVec::iterator it = _threads.begin(); it != _threads.end(); ++it)
- {
- if ((*it)->idle())
- {
- if ((*it)->idleTime() < _idleTime)
- idleThreads.push_back(*it);
- else
- expiredThreads.push_back(*it);
- }
- else activeThreads.push_back(*it);
- }
- int n = (int) activeThreads.size();
- int limit = (int) idleThreads.size() + n;
- if (limit < _minCapacity) limit = _minCapacity;
- idleThreads.insert(idleThreads.end(), expiredThreads.begin(), expiredThreads.end());
- _threads.clear();
- for (ThreadVec::iterator it = idleThreads.begin(); it != idleThreads.end(); ++it)
- {
- if (n < limit)
- {
- _threads.push_back(*it);
- ++n;
- }
- else (*it)->release();
- }
- _threads.insert(_threads.end(), activeThreads.begin(), activeThreads.end());
-}
-
-
-PooledThread* ThreadPool::getThread()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (++_age == 32)
- housekeep();
-
- PooledThread* pThread = 0;
- for (ThreadVec::iterator it = _threads.begin(); !pThread && it != _threads.end(); ++it)
- {
- if ((*it)->idle()) pThread = *it;
- }
- if (!pThread)
- {
- if (_threads.size() < _maxCapacity)
- {
- pThread = createThread();
- _threads.push_back(pThread);
- pThread->start();
- }
- else throw NoThreadAvailableException();
- }
- pThread->activate();
- return pThread;
-}
-
-
-PooledThread* ThreadPool::createThread()
-{
- std::ostringstream name;
- name << _name << "[#" << ++_serial << "]";
- return new PooledThread(name.str(), _stackSize);
-}
-
-
-class ThreadPoolSingletonHolder
-{
-public:
- ThreadPoolSingletonHolder()
- {
- _pPool = 0;
- }
- ~ThreadPoolSingletonHolder()
- {
- delete _pPool;
- }
- ThreadPool* pool()
- {
- FastMutex::ScopedLock lock(_mutex);
-
- if (!_pPool)
- {
- _pPool = new ThreadPool("default");
- if (POCO_THREAD_STACK_SIZE > 0)
- _pPool->setStackSize(POCO_THREAD_STACK_SIZE);
- }
- return _pPool;
- }
-
-private:
- ThreadPool* _pPool;
- FastMutex _mutex;
-};
-
-
-ThreadPool& ThreadPool::defaultPool()
-{
- static ThreadPoolSingletonHolder sh;
- return *sh.pool();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/ThreadTarget.cpp b/Utilities/Poco/Foundation/src/ThreadTarget.cpp
deleted file mode 100755
index a7fd772e54..0000000000
--- a/Utilities/Poco/Foundation/src/ThreadTarget.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// ThreadTarget.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: ThreadTarget
-//
-// 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/ThreadTarget.h"
-
-
-namespace Poco {
-
-
-ThreadTarget::ThreadTarget(Callback method): _method(method)
-{
-}
-
-
-ThreadTarget::ThreadTarget(const ThreadTarget& te): _method(te._method)
-{
-}
-
-
-ThreadTarget& ThreadTarget::operator = (const ThreadTarget& te)
-{
- _method = te._method;
- return *this;
-}
-
-
-ThreadTarget::~ThreadTarget()
-{
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Thread_POSIX.cpp b/Utilities/Poco/Foundation/src/Thread_POSIX.cpp
deleted file mode 100755
index 836e58d2bc..0000000000
--- a/Utilities/Poco/Foundation/src/Thread_POSIX.cpp
+++ /dev/null
@@ -1,418 +0,0 @@
-//
-// Thread_POSIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Copyright (c) 2004-2007, 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/Thread_POSIX.h"
-#include "Poco/Exception.h"
-#include "Poco/ErrorHandler.h"
-#include "Poco/Timespan.h"
-#include "Poco/Timestamp.h"
-#include <signal.h>
-#if defined(__sun) && defined(__SVR4)
-# if !defined(__EXTENSIONS__)
-# define __EXTENSIONS__
-# endif
-#endif
-
-
-//
-// Block SIGPIPE in main thread.
-//
-#if defined(POCO_OS_FAMILY_UNIX)
-namespace
-{
- class SignalBlocker
- {
- public:
- SignalBlocker()
- {
- sigset_t sset;
- sigemptyset(&sset);
- sigaddset(&sset, SIGPIPE);
- pthread_sigmask(SIG_BLOCK, &sset, 0);
- }
- ~SignalBlocker()
- {
- }
- };
-
- static SignalBlocker signalBlocker;
-}
-#endif
-
-
-namespace Poco {
-
-
-ThreadImpl::CurrentThreadHolder ThreadImpl::_currentThreadHolder;
-
-
-ThreadImpl::ThreadImpl():
- _pData(new ThreadData)
-{
-}
-
-
-ThreadImpl::~ThreadImpl()
-{
- if (isRunningImpl())
- pthread_detach(_pData->thread);
-}
-
-
-void ThreadImpl::setPriorityImpl(int prio)
-{
- if (prio != _pData->prio)
- {
- _pData->prio = prio;
- if (isRunningImpl())
- {
- struct sched_param par;
- par.sched_priority = mapPrio(_pData->prio);
- if (pthread_setschedparam(_pData->thread, SCHED_OTHER, &par))
- throw SystemException("cannot set thread priority");
- }
- }
-}
-
-
-void ThreadImpl::setOSPriorityImpl(int prio)
-{
- if (prio != _pData->osPrio)
- {
- if (_pData->pRunnableTarget || _pData->pCallbackTarget)
- {
- struct sched_param par;
- par.sched_priority = prio;
- if (pthread_setschedparam(_pData->thread, SCHED_OTHER, &par))
- throw SystemException("cannot set thread priority");
- }
- _pData->prio = reverseMapPrio(prio);
- _pData->osPrio = prio;
- }
-}
-
-
-int ThreadImpl::getMinOSPriorityImpl()
-{
-#if defined(__VMS) || defined(__digital__)
- return PRI_OTHER_MIN;
-#else
- return sched_get_priority_min(SCHED_OTHER);
-#endif
-}
-
-
-int ThreadImpl::getMaxOSPriorityImpl()
-{
-#if defined(__VMS) || defined(__digital__)
- return PRI_OTHER_MAX;
-#else
- return sched_get_priority_max(SCHED_OTHER);
-#endif
-}
-
-
-void ThreadImpl::setStackSizeImpl(int size)
-{
-#ifndef PTHREAD_STACK_MIN
- _pData->stackSize = 0;
-#else
- if (size != 0)
- {
-#if defined(__APPLE__)
- // we must round up to a multiple of the memory page size
- const int PAGE_SIZE = 4096;
- size = ((size + PAGE_SIZE - 1)/PAGE_SIZE)*PAGE_SIZE;
-#endif
- if (size < PTHREAD_STACK_MIN)
- size = PTHREAD_STACK_MIN;
- }
- _pData->stackSize = size;
-#endif
-}
-
-
-void ThreadImpl::startImpl(Runnable& target)
-{
- if (_pData->pRunnableTarget)
- throw SystemException("thread already running");
-
- pthread_attr_t attributes;
- pthread_attr_init(&attributes);
-
- if (_pData->stackSize != 0)
- {
- if (0 != pthread_attr_setstacksize(&attributes, _pData->stackSize))
- throw SystemException("cannot set thread stack size");
- }
-
- _pData->pRunnableTarget = &target;
- if (pthread_create(&_pData->thread, &attributes, runnableEntry, this))
- {
- _pData->pRunnableTarget = 0;
- throw SystemException("cannot start thread");
- }
-
- if (_pData->prio != PRIO_NORMAL_IMPL)
- {
- struct sched_param par;
- par.sched_priority = mapPrio(_pData->prio);
- if (pthread_setschedparam(_pData->thread, SCHED_OTHER, &par))
- throw SystemException("cannot set thread priority");
- }
-}
-
-
-void ThreadImpl::startImpl(Callable target, void* pData)
-{
- if (_pData->pCallbackTarget && _pData->pCallbackTarget->callback)
- throw SystemException("thread already running");
-
- pthread_attr_t attributes;
- pthread_attr_init(&attributes);
-
- if (_pData->stackSize != 0)
- {
- if (0 != pthread_attr_setstacksize(&attributes, _pData->stackSize))
- throw SystemException("can not set thread stack size");
- }
-
- if (0 == _pData->pCallbackTarget.get())
- _pData->pCallbackTarget = new CallbackData;
-
- _pData->pCallbackTarget->callback = target;
- _pData->pCallbackTarget->pData = pData;
-
- if (pthread_create(&_pData->thread, &attributes, callableEntry, this))
- {
- _pData->pCallbackTarget->callback = 0;
- _pData->pCallbackTarget->pData = 0;
- throw SystemException("cannot start thread");
- }
-
- if (_pData->prio != PRIO_NORMAL_IMPL)
- {
- struct sched_param par;
- par.sched_priority = mapPrio(_pData->prio);
- if (pthread_setschedparam(_pData->thread, SCHED_OTHER, &par))
- throw SystemException("cannot set thread priority");
- }
-}
-
-
-void ThreadImpl::joinImpl()
-{
- _pData->done.wait();
- void* result;
- if (pthread_join(_pData->thread, &result))
- throw SystemException("cannot join thread");
-}
-
-
-bool ThreadImpl::joinImpl(long milliseconds)
-{
- if (_pData->done.tryWait(milliseconds))
- {
- void* result;
- if (pthread_join(_pData->thread, &result))
- throw SystemException("cannot join thread");
- return true;
- }
- else return false;
-}
-
-
-ThreadImpl* ThreadImpl::currentImpl()
-{
- return _currentThreadHolder.get();
-}
-
-
-void ThreadImpl::sleepImpl(long milliseconds)
-{
-#if defined(__VMS) || defined(__digital__)
- // This is specific to DECThreads
- struct timespec interval;
- interval.tv_sec = milliseconds / 1000;
- interval.tv_nsec = (milliseconds % 1000)*1000000;
- pthread_delay_np(&interval);
-#else
- Poco::Timespan remainingTime(1000*Poco::Timespan::TimeDiff(milliseconds));
- int rc;
- do
- {
- struct timeval tv;
- tv.tv_sec = (long) remainingTime.totalSeconds();
- tv.tv_usec = (long) remainingTime.useconds();
- Poco::Timestamp start;
- rc = ::select(0, NULL, NULL, NULL, &tv);
- if (rc < 0 && errno == EINTR)
- {
- Poco::Timestamp end;
- Poco::Timespan waited = start.elapsed();
- if (waited < remainingTime)
- remainingTime -= waited;
- else
- remainingTime = 0;
- }
- }
- while (remainingTime > 0 && rc < 0 && errno == EINTR);
- if (rc < 0) throw Poco::SystemException("Thread::sleep(): select() failed");
-#endif
-}
-
-
-void* ThreadImpl::runnableEntry(void* pThread)
-{
- _currentThreadHolder.set(reinterpret_cast<ThreadImpl*>(pThread));
-
-#if defined(POCO_OS_FAMILY_UNIX)
- sigset_t sset;
- sigemptyset(&sset);
- sigaddset(&sset, SIGQUIT);
- sigaddset(&sset, SIGTERM);
- sigaddset(&sset, SIGPIPE);
- pthread_sigmask(SIG_BLOCK, &sset, 0);
-#endif
-
- ThreadImpl* pThreadImpl = reinterpret_cast<ThreadImpl*>(pThread);
- AutoPtr<ThreadData> pData = pThreadImpl->_pData;
- try
- {
- pData->pRunnableTarget->run();
- }
- catch (Exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (std::exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (...)
- {
- ErrorHandler::handle();
- }
-
- pData->pRunnableTarget = 0;
- pData->done.set();
- return 0;
-}
-
-
-void* ThreadImpl::callableEntry(void* pThread)
-{
- _currentThreadHolder.set(reinterpret_cast<ThreadImpl*>(pThread));
-
-#if defined(POCO_OS_FAMILY_UNIX)
- sigset_t sset;
- sigemptyset(&sset);
- sigaddset(&sset, SIGQUIT);
- sigaddset(&sset, SIGTERM);
- sigaddset(&sset, SIGPIPE);
- pthread_sigmask(SIG_BLOCK, &sset, 0);
-#endif
-
- ThreadImpl* pThreadImpl = reinterpret_cast<ThreadImpl*>(pThread);
- AutoPtr<ThreadData> pData = pThreadImpl->_pData;
- try
- {
- pData->pCallbackTarget->callback(pData->pCallbackTarget->pData);
- }
- catch (Exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (std::exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (...)
- {
- ErrorHandler::handle();
- }
-
- pData->pCallbackTarget->callback = 0;
- pData->pCallbackTarget->pData = 0;
-
- pData->done.set();
- return 0;
-}
-
-
-int ThreadImpl::mapPrio(int prio)
-{
- int pmin = getMinOSPriorityImpl();
- int pmax = getMaxOSPriorityImpl();
-
- switch (prio)
- {
- case PRIO_LOWEST_IMPL:
- return pmin;
- case PRIO_LOW_IMPL:
- return pmin + (pmax - pmin)/4;
- case PRIO_NORMAL_IMPL:
- return pmin + (pmax - pmin)/2;
- case PRIO_HIGH_IMPL:
- return pmin + 3*(pmax - pmin)/4;
- case PRIO_HIGHEST_IMPL:
- return pmax;
- default:
- poco_bugcheck_msg("invalid thread priority");
- }
- return -1; // just to satisfy compiler - we'll never get here anyway
-}
-
-
-int ThreadImpl::reverseMapPrio(int prio)
-{
- int pmin = getMinOSPriorityImpl();
- int pmax = getMaxOSPriorityImpl();
- int normal = pmin + (pmax - pmin)/2;
- if (prio == pmax)
- return PRIO_HIGHEST_IMPL;
- if (prio > normal)
- return PRIO_HIGH_IMPL;
- else if (prio == normal)
- return PRIO_NORMAL_IMPL;
- else if (prio > pmin)
- return PRIO_LOW_IMPL;
- else
- return PRIO_LOWEST_IMPL;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Thread_WIN32.cpp b/Utilities/Poco/Foundation/src/Thread_WIN32.cpp
deleted file mode 100755
index 9b77418e36..0000000000
--- a/Utilities/Poco/Foundation/src/Thread_WIN32.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// Thread_WIN32.h
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Thread
-//
-// Copyright (c) 2004-2006, 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/Thread_WIN32.h"
-#include "Poco/Exception.h"
-#include "Poco/ErrorHandler.h"
-#include <process.h>
-
-
-namespace Poco {
-
-
-ThreadImpl::CurrentThreadHolder ThreadImpl::_currentThreadHolder;
-
-
-ThreadImpl::ThreadImpl():
- _pRunnableTarget(0),
- _thread(0),
- _prio(PRIO_NORMAL_IMPL),
- _stackSize(POCO_THREAD_STACK_SIZE)
-{
-}
-
-
-ThreadImpl::~ThreadImpl()
-{
- if (_thread) CloseHandle(_thread);
-}
-
-
-void ThreadImpl::setPriorityImpl(int prio)
-{
- if (prio != _prio)
- {
- _prio = prio;
- if (_thread)
- {
- if (SetThreadPriority(_thread, _prio) == 0)
- throw SystemException("cannot set thread priority");
- }
- }
-}
-
-
-void ThreadImpl::setOSPriorityImpl(int prio)
-{
- setPriorityImpl(prio);
-}
-
-
-void ThreadImpl::startImpl(Runnable& target)
-{
- if (isRunningImpl())
- throw SystemException("thread already running");
-
- _pRunnableTarget = &target;
-
- createImpl(runnableEntry, this);
-}
-
-
-void ThreadImpl::startImpl(Callable target, void* pData)
-{
- if (isRunningImpl())
- throw SystemException("thread already running");
-
- _callbackTarget.callback = target;
- _callbackTarget.pData = pData;
-
- createImpl(callableEntry, this);
-}
-
-
-void ThreadImpl::createImpl(Entry ent, void* pData)
-{
-#if defined(_DLL)
- DWORD threadId;
- _thread = CreateThread(NULL, _stackSize, ent, pData, 0, &threadId);
-#else
- unsigned threadId;
- _thread = (HANDLE) _beginthreadex(NULL, _stackSize, ent, this, 0, &threadId);
-#endif
- if (!_thread)
- throw SystemException("cannot create thread");
- if (_prio != PRIO_NORMAL_IMPL && !SetThreadPriority(_thread, _prio))
- throw SystemException("cannot set thread priority");
-}
-
-
-void ThreadImpl::joinImpl()
-{
- if (!_thread) return;
-
- switch (WaitForSingleObject(_thread, INFINITE))
- {
- case WAIT_OBJECT_0:
- threadCleanup();
- return;
- default:
- throw SystemException("cannot join thread");
- }
-}
-
-
-bool ThreadImpl::joinImpl(long milliseconds)
-{
- if (!_thread) return true;
-
- switch (WaitForSingleObject(_thread, milliseconds + 1))
- {
- case WAIT_TIMEOUT:
- return false;
- case WAIT_OBJECT_0:
- threadCleanup();
- return true;
- default:
- throw SystemException("cannot join thread");
- }
-}
-
-
-bool ThreadImpl::isRunningImpl() const
-{
- if (_thread)
- {
- DWORD ec = 0;
- return GetExitCodeThread(_thread, &ec) && ec == STILL_ACTIVE;
- }
- return false;
-}
-
-
-void ThreadImpl::threadCleanup()
-{
- if (!_thread) return;
- if (CloseHandle(_thread)) _thread = 0;
-}
-
-
-ThreadImpl* ThreadImpl::currentImpl()
-{
- return _currentThreadHolder.get();
-}
-
-
-#if defined(_DLL)
-DWORD WINAPI ThreadImpl::runnableEntry(LPVOID pThread)
-#else
-unsigned __stdcall ThreadImpl::runnableEntry(void* pThread)
-#endif
-{
- _currentThreadHolder.set(reinterpret_cast<ThreadImpl*>(pThread));
- try
- {
- reinterpret_cast<ThreadImpl*>(pThread)->_pRunnableTarget->run();
- }
- catch (Exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (std::exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (...)
- {
- ErrorHandler::handle();
- }
- return 0;
-}
-
-
-#if defined(_DLL)
-DWORD WINAPI ThreadImpl::callableEntry(LPVOID pThread)
-#else
-unsigned __stdcall ThreadImpl::callableEntry(void* pThread)
-#endif
-{
- _currentThreadHolder.set(reinterpret_cast<ThreadImpl*>(pThread));
- try
- {
- ThreadImpl* pTI = reinterpret_cast<ThreadImpl*>(pThread);
- pTI->_callbackTarget.callback(pTI->_callbackTarget.pData);
- }
- catch (Exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (std::exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (...)
- {
- ErrorHandler::handle();
- }
- return 0;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/TimedNotificationQueue.cpp b/Utilities/Poco/Foundation/src/TimedNotificationQueue.cpp
deleted file mode 100644
index f50ae167bf..0000000000
--- a/Utilities/Poco/Foundation/src/TimedNotificationQueue.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-//
-// TimedNotificationQueue.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Notifications
-// Module: TimedNotificationQueue
-//
-// Copyright (c) 2009, 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/TimedNotificationQueue.h"
-#include "Poco/Notification.h"
-#include <limits>
-
-
-namespace Poco {
-
-
-TimedNotificationQueue::TimedNotificationQueue()
-{
-}
-
-
-TimedNotificationQueue::~TimedNotificationQueue()
-{
- clear();
-}
-
-
-void TimedNotificationQueue::enqueueNotification(Notification::Ptr pNotification, Timestamp timestamp)
-{
- poco_check_ptr (pNotification);
-
- FastMutex::ScopedLock lock(_mutex);
- _nfQueue.insert(NfQueue::value_type(timestamp, pNotification));
- _nfAvailable.set();
-}
-
-
-Notification* TimedNotificationQueue::dequeueNotification()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- NfQueue::iterator it = _nfQueue.begin();
- if (it != _nfQueue.end())
- {
- Timestamp::TimeDiff sleep = -it->first.elapsed();
- if (sleep <= 0)
- {
- Notification::Ptr pNf = it->second;
- _nfQueue.erase(it);
- return pNf.duplicate();
- }
- }
- return 0;
-}
-
-
-Notification* TimedNotificationQueue::waitDequeueNotification()
-{
- for (;;)
- {
- _mutex.lock();
- NfQueue::iterator it = _nfQueue.begin();
- if (it != _nfQueue.end())
- {
- _mutex.unlock();
- Timestamp::TimeDiff sleep = -it->first.elapsed();
- if (sleep <= 0)
- {
- return dequeueOne(it).duplicate();
- }
- else if (!wait(sleep))
- {
- return dequeueOne(it).duplicate();
- }
- else continue;
- }
- else
- {
- _mutex.unlock();
- }
- _nfAvailable.wait();
- }
-}
-
-
-Notification* TimedNotificationQueue::waitDequeueNotification(long milliseconds)
-{
- while (milliseconds >= 0)
- {
- _mutex.lock();
- NfQueue::iterator it = _nfQueue.begin();
- if (it != _nfQueue.end())
- {
- _mutex.unlock();
- Poco::Timestamp now;
- Timestamp::TimeDiff sleep = it->first - now;
- if (sleep <= 0)
- {
- return dequeueOne(it).duplicate();
- }
- else if (sleep <= 1000*Timestamp::TimeDiff(milliseconds))
- {
- if (!wait(sleep))
- {
- return dequeueOne(it).duplicate();
- }
- else
- {
- milliseconds -= static_cast<long>((now.elapsed() + 999)/1000);
- continue;
- }
- }
- }
- else
- {
- _mutex.unlock();
- }
- if (milliseconds > 0)
- {
- Poco::Timestamp now;
- _nfAvailable.tryWait(milliseconds);
- milliseconds -= static_cast<long>((now.elapsed() + 999)/1000);
- }
- else return 0;
- }
- return 0;
-}
-
-
-bool TimedNotificationQueue::wait(Timestamp::TimeDiff interval)
-{
- const Timestamp::TimeDiff MAX_SLEEP = 8*60*60*Timestamp::TimeDiff(1000000); // sleep at most 8 hours at a time
- while (interval > 0)
- {
- Timestamp now;
- Timestamp::TimeDiff sleep = interval <= MAX_SLEEP ? interval : MAX_SLEEP;
- if (_nfAvailable.tryWait(static_cast<long>((sleep + 999)/1000)))
- return true;
- interval -= now.elapsed();
- }
- return false;
-}
-
-
-bool TimedNotificationQueue::empty() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return _nfQueue.empty();
-}
-
-
-int TimedNotificationQueue::size() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return static_cast<int>(_nfQueue.size());
-}
-
-
-void TimedNotificationQueue::clear()
-{
- FastMutex::ScopedLock lock(_mutex);
- _nfQueue.clear();
-}
-
-
-Notification::Ptr TimedNotificationQueue::dequeueOne(NfQueue::iterator& it)
-{
- FastMutex::ScopedLock lock(_mutex);
- Notification::Ptr pNf = it->second;
- _nfQueue.erase(it);
- return pNf;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Timer.cpp b/Utilities/Poco/Foundation/src/Timer.cpp
deleted file mode 100755
index 2fa59b3682..0000000000
--- a/Utilities/Poco/Foundation/src/Timer.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// Timer.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Threading
-// Module: Timer
-//
-// Copyright (c) 2004-2006, 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/Timer.h"
-#include "Poco/ThreadPool.h"
-#include "Poco/Exception.h"
-#include "Poco/ErrorHandler.h"
-
-
-namespace Poco {
-
-
-Timer::Timer(long startInterval, long periodicInterval):
- _startInterval(startInterval),
- _periodicInterval(periodicInterval),
- _pCallback(0)
-{
- poco_assert (startInterval >= 0 && periodicInterval >= 0);
-}
-
-
-Timer::~Timer()
-{
- stop();
-}
-
-
-void Timer::start(const AbstractTimerCallback& method)
-{
- start(method, Thread::PRIO_NORMAL, ThreadPool::defaultPool());
-}
-
-
-void Timer::start(const AbstractTimerCallback& method, Thread::Priority priority)
-{
- start(method, priority, ThreadPool::defaultPool());
-}
-
-
-void Timer::start(const AbstractTimerCallback& method, ThreadPool& threadPool)
-{
- start(method, Thread::PRIO_NORMAL, threadPool);
-}
-
-
-void Timer::start(const AbstractTimerCallback& method, Thread::Priority priority, ThreadPool& threadPool)
-{
- Poco::Timestamp nextInvocation;
- nextInvocation += _startInterval*1000;
-
- poco_assert (!_pCallback);
-
- FastMutex::ScopedLock lock(_mutex);
- _nextInvocation = nextInvocation;
- _pCallback = method.clone();
- _wakeUp.reset();
- threadPool.startWithPriority(priority, *this);
-}
-
-
-void Timer::stop()
-{
- FastMutex::ScopedLock lock(_mutex);
- if (_pCallback)
- {
- _periodicInterval = 0;
- _mutex.unlock();
- _wakeUp.set();
- _done.wait(); // warning: deadlock if called from timer callback
- _mutex.lock();
- delete _pCallback;
- _pCallback = 0;
- }
-}
-
-
-void Timer::restart()
-{
- FastMutex::ScopedLock lock(_mutex);
- if (_pCallback)
- {
- _wakeUp.set();
- }
-}
-
-
-void Timer::restart(long milliseconds)
-{
- poco_assert (milliseconds >= 0);
- FastMutex::ScopedLock lock(_mutex);
- if (_pCallback)
- {
- _periodicInterval = milliseconds;
- _wakeUp.set();
- }
-}
-
-
-long Timer::getStartInterval() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return _startInterval;
-}
-
-
-void Timer::setStartInterval(long milliseconds)
-{
- poco_assert (milliseconds >= 0);
- FastMutex::ScopedLock lock(_mutex);
- _startInterval = milliseconds;
-}
-
-
-long Timer::getPeriodicInterval() const
-{
- FastMutex::ScopedLock lock(_mutex);
- return _periodicInterval;
-}
-
-
-void Timer::setPeriodicInterval(long milliseconds)
-{
- poco_assert (milliseconds >= 0);
- FastMutex::ScopedLock lock(_mutex);
- _periodicInterval = milliseconds;
-}
-
-
-void Timer::run()
-{
- Poco::Timestamp now;
- long interval(0);
- do
- {
- now.update();
- long sleep = static_cast<long>((_nextInvocation - now)/1000);
- if (sleep < 0) sleep = 0;
- if (_wakeUp.tryWait(sleep))
- {
- FastMutex::ScopedLock lock(_mutex);
- _nextInvocation.update();
- interval = _periodicInterval;
- }
- else
- {
- try
- {
- _pCallback->invoke(*this);
- }
- catch (Exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (std::exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (...)
- {
- ErrorHandler::handle();
- }
- {
- FastMutex::ScopedLock lock(_mutex);
- interval = _periodicInterval;
- }
- }
- _nextInvocation += interval*1000;
- }
- while (interval > 0);
- _done.set();
-}
-
-
-AbstractTimerCallback::AbstractTimerCallback()
-{
-}
-
-
-AbstractTimerCallback::AbstractTimerCallback(const AbstractTimerCallback& callback)
-{
-}
-
-
-AbstractTimerCallback::~AbstractTimerCallback()
-{
-}
-
-
-AbstractTimerCallback& AbstractTimerCallback::operator = (const AbstractTimerCallback& callback)
-{
- return *this;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Timespan.cpp b/Utilities/Poco/Foundation/src/Timespan.cpp
deleted file mode 100755
index 81e27128d1..0000000000
--- a/Utilities/Poco/Foundation/src/Timespan.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-// Timespan.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: Timespan
-//
-// Copyright (c) 2004-2006, 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/Timespan.h"
-#include <algorithm>
-
-
-namespace Poco {
-
-
-const Timespan::TimeDiff Timespan::MILLISECONDS = 1000;
-const Timespan::TimeDiff Timespan::SECONDS = 1000*Timespan::MILLISECONDS;
-const Timespan::TimeDiff Timespan::MINUTES = 60*Timespan::SECONDS;
-const Timespan::TimeDiff Timespan::HOURS = 60*Timespan::MINUTES;
-const Timespan::TimeDiff Timespan::DAYS = 24*Timespan::HOURS;
-
-
-Timespan::Timespan():
- _span(0)
-{
-}
-
-
-Timespan::Timespan(TimeDiff microseconds):
- _span(microseconds)
-{
-}
-
-
-Timespan::Timespan(long seconds, long microseconds):
- _span(TimeDiff(seconds)*SECONDS + microseconds)
-{
-}
-
-
-Timespan::Timespan(int days, int hours, int minutes, int seconds, int microseconds):
- _span(TimeDiff(microseconds) + TimeDiff(seconds)*SECONDS + TimeDiff(minutes)*MINUTES + TimeDiff(hours)*HOURS + TimeDiff(days)*DAYS)
-{
-}
-
-
-Timespan::Timespan(const Timespan& timespan):
- _span(timespan._span)
-{
-}
-
-
-Timespan::~Timespan()
-{
-}
-
-
-Timespan& Timespan::operator = (const Timespan& timespan)
-{
- _span = timespan._span;
- return *this;
-}
-
-
-Timespan& Timespan::operator = (TimeDiff microseconds)
-{
- _span = microseconds;
- return *this;
-}
-
-
-Timespan& Timespan::assign(int days, int hours, int minutes, int seconds, int microseconds)
-{
- _span = TimeDiff(microseconds) + TimeDiff(seconds)*SECONDS + TimeDiff(minutes)*MINUTES + TimeDiff(hours)*HOURS + TimeDiff(days)*DAYS;
- return *this;
-}
-
-
-Timespan& Timespan::assign(long seconds, long microseconds)
-{
- _span = TimeDiff(seconds)*SECONDS + TimeDiff(microseconds);
- return *this;
-}
-
-
-void Timespan::swap(Timespan& timespan)
-{
- std::swap(_span, timespan._span);
-}
-
-
-Timespan Timespan::operator + (const Timespan& d) const
-{
- return Timespan(_span + d._span);
-}
-
-
-Timespan Timespan::operator - (const Timespan& d) const
-{
- return Timespan(_span - d._span);
-}
-
-
-Timespan& Timespan::operator += (const Timespan& d)
-{
- _span += d._span;
- return *this;
-}
-
-
-Timespan& Timespan::operator -= (const Timespan& d)
-{
- _span -= d._span;
- return *this;
-}
-
-
-Timespan Timespan::operator + (TimeDiff microseconds) const
-{
- return Timespan(_span + microseconds);
-}
-
-
-Timespan Timespan::operator - (TimeDiff microseconds) const
-{
- return Timespan(_span - microseconds);
-}
-
-
-Timespan& Timespan::operator += (TimeDiff microseconds)
-{
- _span += microseconds;
- return *this;
-}
-
-
-Timespan& Timespan::operator -= (TimeDiff microseconds)
-{
- _span -= microseconds;
- return *this;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Timestamp.cpp b/Utilities/Poco/Foundation/src/Timestamp.cpp
deleted file mode 100755
index 8d9e63ffb5..0000000000
--- a/Utilities/Poco/Foundation/src/Timestamp.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-//
-// Timestamp.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: Timestamp
-//
-// Copyright (c) 2004-2006, 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/Timestamp.h"
-#include "Poco/Exception.h"
-#include <algorithm>
-#if defined(POCO_OS_FAMILY_UNIX)
-#include <time.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/times.h>
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/UnWindows.h"
-#endif
-
-
-namespace Poco {
-
-
-Timestamp::Timestamp()
-{
- update();
-}
-
-
-Timestamp::Timestamp(TimeVal tv)
-{
- _ts = tv;
-}
-
-
-Timestamp::Timestamp(const Timestamp& other)
-{
- _ts = other._ts;
-}
-
-
-Timestamp::~Timestamp()
-{
-}
-
-
-Timestamp& Timestamp::operator = (const Timestamp& other)
-{
- _ts = other._ts;
- return *this;
-}
-
-
-Timestamp& Timestamp::operator = (TimeVal tv)
-{
- _ts = tv;
- return *this;
-}
-
-
-void Timestamp::swap(Timestamp& timestamp)
-{
- std::swap(_ts, timestamp._ts);
-}
-
-
-Timestamp Timestamp::fromEpochTime(std::time_t t)
-{
- return Timestamp(TimeVal(t)*resolution());
-}
-
-
-Timestamp Timestamp::fromUtcTime(UtcTimeVal val)
-{
- val -= (TimeDiff(0x01b21dd2) << 32) + 0x13814000;
- val /= 10;
- return Timestamp(val);
-}
-
-
-void Timestamp::update()
-{
-#if defined(POCO_OS_FAMILY_WINDOWS)
-
- FILETIME ft;
- GetSystemTimeAsFileTime(&ft);
- ULARGE_INTEGER epoch; // UNIX epoch (1970-01-01 00:00:00) expressed in Windows NT FILETIME
- epoch.LowPart = 0xD53E8000;
- epoch.HighPart = 0x019DB1DE;
-
- ULARGE_INTEGER ts;
- ts.LowPart = ft.dwLowDateTime;
- ts.HighPart = ft.dwHighDateTime;
- ts.QuadPart -= epoch.QuadPart;
- _ts = ts.QuadPart/10;
-
-#else
-
- struct timeval tv;
- if (gettimeofday(&tv, NULL))
- throw SystemException("cannot get time of day");
- _ts = TimeVal(tv.tv_sec)*resolution() + tv.tv_usec;
-
-#endif
-}
-
-
-#if defined(_WIN32)
-
-
-Timestamp Timestamp::fromFileTimeNP(UInt32 fileTimeLow, UInt32 fileTimeHigh)
-{
- ULARGE_INTEGER epoch; // UNIX epoch (1970-01-01 00:00:00) expressed in Windows NT FILETIME
- epoch.LowPart = 0xD53E8000;
- epoch.HighPart = 0x019DB1DE;
-
- ULARGE_INTEGER ts;
- ts.LowPart = fileTimeLow;
- ts.HighPart = fileTimeHigh;
- ts.QuadPart -= epoch.QuadPart;
-
- return Timestamp(ts.QuadPart/10);
-}
-
-
-void Timestamp::toFileTimeNP(UInt32& fileTimeLow, UInt32& fileTimeHigh) const
-{
- ULARGE_INTEGER epoch; // UNIX epoch (1970-01-01 00:00:00) expressed in Windows NT FILETIME
- epoch.LowPart = 0xD53E8000;
- epoch.HighPart = 0x019DB1DE;
-
- ULARGE_INTEGER ts;
- ts.QuadPart = _ts*10;
- ts.QuadPart += epoch.QuadPart;
- fileTimeLow = ts.LowPart;
- fileTimeHigh = ts.HighPart;
-}
-
-
-#endif
-
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Timezone.cpp b/Utilities/Poco/Foundation/src/Timezone.cpp
deleted file mode 100755
index 86302bc344..0000000000
--- a/Utilities/Poco/Foundation/src/Timezone.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// Timezone.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: Timezone
-//
-// Copyright (c) 2004-2006, 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/Timezone.h"
-#include <ctime>
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Timezone_WIN32.cpp"
-#else
-#include "Timezone_UNIX.cpp"
-#endif
-
-
-namespace Poco {
-
-
-int Timezone::tzd()
-{
- return utcOffset() + dst();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Timezone_UNIX.cpp b/Utilities/Poco/Foundation/src/Timezone_UNIX.cpp
deleted file mode 100755
index d086ee067c..0000000000
--- a/Utilities/Poco/Foundation/src/Timezone_UNIX.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// Timezone_UNIX.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: Timezone
-//
-// Copyright (c) 2004-2006, 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/Timezone.h"
-#include <ctime>
-
-
-namespace Poco {
-
-
-class TZInfo
-{
-public:
- TZInfo()
- {
- tzset();
- }
-
- int timeZone()
- {
- #if defined(__APPLE__) || defined(__FreeBSD__) // no timezone global var
- std::time_t now = std::time(NULL);
- struct std::tm t;
- gmtime_r(&now, &t);
- std::time_t utc = std::mktime(&t);
- return now - utc;
- #elif defined(__CYGWIN__)
- return -_timezone;
- #else
- return -timezone;
- #endif
- }
-
- const char* name(bool dst)
- {
- return tzname[dst ? 1 : 0];
- }
-};
-
-
-static TZInfo tzInfo;
-
-
-int Timezone::utcOffset()
-{
- return tzInfo.timeZone();
-}
-
-
-int Timezone::dst()
-{
- std::time_t now = std::time(NULL);
- struct std::tm t;
- localtime_r(&now, &t);
- return t.tm_isdst == 1 ? 3600 : 0;
-}
-
-
-bool Timezone::isDst(const Timestamp& timestamp)
-{
- std::time_t time = timestamp.epochTime();
- struct std::tm* tms = std::localtime(&time);
- return tms->tm_isdst > 0;
-}
-
-
-std::string Timezone::name()
-{
- return std::string(tzInfo.name(dst() != 0));
-}
-
-
-std::string Timezone::standardName()
-{
- return std::string(tzInfo.name(false));
-}
-
-
-std::string Timezone::dstName()
-{
- return std::string(tzInfo.name(true));
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Timezone_WIN32.cpp b/Utilities/Poco/Foundation/src/Timezone_WIN32.cpp
deleted file mode 100755
index cbe88b55f2..0000000000
--- a/Utilities/Poco/Foundation/src/Timezone_WIN32.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// Timezone_WIN32.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: DateTime
-// Module: Timezone
-//
-// Copyright (c) 2004-2006, 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/Timezone.h"
-#include "Poco/UnicodeConverter.h"
-#include "Poco/UnWindows.h"
-#include <ctime>
-
-
-namespace Poco {
-
-
-int Timezone::utcOffset()
-{
- TIME_ZONE_INFORMATION tzInfo;
- DWORD dstFlag = GetTimeZoneInformation(&tzInfo);
- return -tzInfo.Bias*60;
-}
-
-
-int Timezone::dst()
-{
- TIME_ZONE_INFORMATION tzInfo;
- DWORD dstFlag = GetTimeZoneInformation(&tzInfo);
- return dstFlag == TIME_ZONE_ID_DAYLIGHT ? -tzInfo.DaylightBias*60 : 0;
-}
-
-
-bool Timezone::isDst(const Timestamp& timestamp)
-{
- std::time_t time = timestamp.epochTime();
- struct std::tm* tms = std::localtime(&time);
- return tms->tm_isdst > 0;
-}
-
-
-std::string Timezone::name()
-{
- std::string result;
- TIME_ZONE_INFORMATION tzInfo;
- DWORD dstFlag = GetTimeZoneInformation(&tzInfo);
- WCHAR* ptr = dstFlag == TIME_ZONE_ID_DAYLIGHT ? tzInfo.DaylightName : tzInfo.StandardName;
-#if defined(POCO_WIN32_UTF8)
- UnicodeConverter::toUTF8(ptr, result);
-#else
- char buffer[256];
- DWORD rc = WideCharToMultiByte(CP_ACP, 0, ptr, -1, buffer, sizeof(buffer), NULL, NULL);
- if (rc) result = buffer;
-#endif
- return result;
-}
-
-
-std::string Timezone::standardName()
-{
- std::string result;
- TIME_ZONE_INFORMATION tzInfo;
- DWORD dstFlag = GetTimeZoneInformation(&tzInfo);
- WCHAR* ptr = tzInfo.StandardName;
-#if defined(POCO_WIN32_UTF8)
- UnicodeConverter::toUTF8(ptr, result);
-#else
- char buffer[256];
- DWORD rc = WideCharToMultiByte(CP_ACP, 0, ptr, -1, buffer, sizeof(buffer), NULL, NULL);
- if (rc) result = buffer;
-#endif
- return result;
-}
-
-
-std::string Timezone::dstName()
-{
- std::string result;
- TIME_ZONE_INFORMATION tzInfo;
- DWORD dstFlag = GetTimeZoneInformation(&tzInfo);
- WCHAR* ptr = tzInfo.DaylightName;
-#if defined(POCO_WIN32_UTF8)
- UnicodeConverter::toUTF8(ptr, result);
-#else
- char buffer[256];
- DWORD rc = WideCharToMultiByte(CP_ACP, 0, ptr, -1, buffer, sizeof(buffer), NULL, NULL);
- if (rc) result = buffer;
-#endif
- return result;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Token.cpp b/Utilities/Poco/Foundation/src/Token.cpp
deleted file mode 100755
index b23999c8f8..0000000000
--- a/Utilities/Poco/Foundation/src/Token.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// Token.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Streams
-// Module: StringTokenizer
-//
-// Copyright (c) 2004-2006, 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/Token.h"
-#include "Poco/NumberParser.h"
-#include <cctype>
-
-
-namespace Poco {
-
-
-Token::Token()
-{
-}
-
-
-Token::~Token()
-{
-}
-
-
-bool Token::start(char c, std::istream& istr)
-{
- _value = c;
- return false;
-}
-
-
-void Token::finish(std::istream& istr)
-{
-}
-
-
-Token::Class Token::tokenClass() const
-{
- return INVALID_TOKEN;
-}
-
-
-std::string Token::asString() const
-{
- return _value;
-}
-
-
-int Token::asInteger() const
-{
- return NumberParser::parse(_value);
-}
-
-
-double Token::asFloat() const
-{
- return NumberParser::parseFloat(_value);
-}
-
-
-char Token::asChar() const
-{
- return _value.empty() ? 0 : _value[0];
-}
-
-
-InvalidToken::InvalidToken()
-{
-}
-
-
-InvalidToken::~InvalidToken()
-{
-}
-
-
-Token::Class InvalidToken::tokenClass() const
-{
- return INVALID_TOKEN;
-}
-
-
-EOFToken::EOFToken()
-{
-}
-
-
-EOFToken::~EOFToken()
-{
-}
-
-
-Token::Class EOFToken::tokenClass() const
-{
- return EOF_TOKEN;
-}
-
-
-WhitespaceToken::WhitespaceToken()
-{
-}
-
-
-WhitespaceToken::~WhitespaceToken()
-{
-}
-
-
-Token::Class WhitespaceToken::tokenClass() const
-{
- return WHITESPACE_TOKEN;
-}
-
-
-bool WhitespaceToken::start(char c, std::istream& istr)
-{
- if (std::isspace(c))
- {
- _value = c;
- return true;
- }
- return false;
-}
-
-
-void WhitespaceToken::finish(std::istream& istr)
-{
- int c = istr.peek();
- while (std::isspace(c))
- {
- istr.get();
- _value += (char) c;
- c = istr.peek();
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/URI.cpp b/Utilities/Poco/Foundation/src/URI.cpp
deleted file mode 100755
index 5760d49fb1..0000000000
--- a/Utilities/Poco/Foundation/src/URI.cpp
+++ /dev/null
@@ -1,841 +0,0 @@
-//
-// URI.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: URI
-// Module: URI
-//
-// Copyright (c) 2004-2006, 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/URI.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/Exception.h"
-#include "Poco/String.h"
-#include "Poco/NumberParser.h"
-
-
-namespace Poco {
-
-
-const std::string URI::RESERVED_PATH = "?#";
-const std::string URI::RESERVED_QUERY = "#";
-const std::string URI::RESERVED_FRAGMENT = "";
-const std::string URI::ILLEGAL = "%<>{}|\\\"^`";
-
-
-URI::URI():
- _port(0)
-{
-}
-
-
-URI::URI(const std::string& uri):
- _port(0)
-{
- parse(uri);
-}
-
-
-URI::URI(const char* uri):
- _port(0)
-{
- parse(std::string(uri));
-}
-
-
-URI::URI(const std::string& scheme, const std::string& pathEtc):
- _scheme(scheme),
- _port(0)
-{
- toLowerInPlace(_scheme);
- _port = getWellKnownPort();
- std::string::const_iterator beg = pathEtc.begin();
- std::string::const_iterator end = pathEtc.end();
- parsePathEtc(beg, end);
-}
-
-
-URI::URI(const std::string& scheme, const std::string& authority, const std::string& pathEtc):
- _scheme(scheme)
-{
- toLowerInPlace(_scheme);
- std::string::const_iterator beg = authority.begin();
- std::string::const_iterator end = authority.end();
- parseAuthority(beg, end);
- beg = pathEtc.begin();
- end = pathEtc.end();
- parsePathEtc(beg, end);
-}
-
-
-URI::URI(const std::string& scheme, const std::string& authority, const std::string& path, const std::string& query):
- _scheme(scheme),
- _path(path),
- _query(query)
-{
- toLowerInPlace(_scheme);
- std::string::const_iterator beg = authority.begin();
- std::string::const_iterator end = authority.end();
- parseAuthority(beg, end);
-}
-
-
-URI::URI(const std::string& scheme, const std::string& authority, const std::string& path, const std::string& query, const std::string& fragment):
- _scheme(scheme),
- _path(path),
- _query(query),
- _fragment(fragment)
-{
- toLowerInPlace(_scheme);
- std::string::const_iterator beg = authority.begin();
- std::string::const_iterator end = authority.end();
- parseAuthority(beg, end);
-}
-
-
-URI::URI(const URI& uri):
- _scheme(uri._scheme),
- _userInfo(uri._userInfo),
- _host(uri._host),
- _port(uri._port),
- _path(uri._path),
- _query(uri._query),
- _fragment(uri._fragment)
-{
-}
-
-
-URI::URI(const URI& baseURI, const std::string& relativeURI):
- _scheme(baseURI._scheme),
- _userInfo(baseURI._userInfo),
- _host(baseURI._host),
- _port(baseURI._port),
- _path(baseURI._path),
- _query(baseURI._query),
- _fragment(baseURI._fragment)
-{
- resolve(relativeURI);
-}
-
-
-URI::~URI()
-{
-}
-
-
-URI& URI::operator = (const URI& uri)
-{
- if (&uri != this)
- {
- _scheme = uri._scheme;
- _userInfo = uri._userInfo;
- _host = uri._host;
- _port = uri._port;
- _path = uri._path;
- _query = uri._query;
- _fragment = uri._fragment;
- }
- return *this;
-}
-
-
-URI& URI::operator = (const std::string& uri)
-{
- clear();
- parse(uri);
- return *this;
-}
-
-
-URI& URI::operator = (const char* uri)
-{
- clear();
- parse(std::string(uri));
- return *this;
-}
-
-
-void URI::swap(URI& uri)
-{
- std::swap(_scheme, uri._scheme);
- std::swap(_userInfo, uri._userInfo);
- std::swap(_host, uri._host);
- std::swap(_port, uri._port);
- std::swap(_path, uri._path);
- std::swap(_query, uri._query);
- std::swap(_fragment, uri._fragment);
-}
-
-
-void URI::clear()
-{
- _scheme.clear();
- _userInfo.clear();
- _host.clear();
- _port = 0;
- _path.clear();
- _query.clear();
- _fragment.clear();
-}
-
-
-std::string URI::toString() const
-{
- std::string uri;
- if (isRelative())
- {
- encode(_path, RESERVED_PATH, uri);
- }
- else
- {
- uri = _scheme;
- uri += ':';
- std::string auth = getAuthority();
- if (!auth.empty() || _scheme == "file")
- {
- uri.append("//");
- uri.append(auth);
- }
- if (!_path.empty())
- {
- if (!auth.empty() && _path[0] != '/')
- uri += '/';
- encode(_path, RESERVED_PATH, uri);
- }
- }
- if (!_query.empty())
- {
- uri += '?';
- uri.append(_query);
- }
- if (!_fragment.empty())
- {
- uri += '#';
- encode(_fragment, RESERVED_FRAGMENT, uri);
- }
- return uri;
-}
-
-
-void URI::setScheme(const std::string& scheme)
-{
- _scheme = scheme;
- toLowerInPlace(_scheme);
- if (_port == 0)
- _port = getWellKnownPort();
-}
-
-
-void URI::setUserInfo(const std::string& userInfo)
-{
- _userInfo.clear();
- decode(userInfo, _userInfo);
-}
-
-
-void URI::setHost(const std::string& host)
-{
- _host = host;
-}
-
-
-unsigned short URI::getPort() const
-{
- if (_port == 0)
- return getWellKnownPort();
- else
- return _port;
-}
-
-
-void URI::setPort(unsigned short port)
-{
- _port = port;
-}
-
-
-std::string URI::getAuthority() const
-{
- std::string auth;
- if (!_userInfo.empty())
- {
- auth.append(_userInfo);
- auth += '@';
- }
- auth.append(_host);
- if (_port && !isWellKnownPort())
- {
- auth += ':';
- NumberFormatter::append(auth, _port);
- }
- return auth;
-}
-
-
-void URI::setAuthority(const std::string& authority)
-{
- _userInfo.clear();
- _host.clear();
- _port = 0;
- std::string::const_iterator beg = authority.begin();
- std::string::const_iterator end = authority.end();
- parseAuthority(beg, end);
-}
-
-
-void URI::setPath(const std::string& path)
-{
- _path.clear();
- decode(path, _path);
-}
-
-
-void URI::setRawQuery(const std::string& query)
-{
- _query = query;
-}
-
-
-void URI::setQuery(const std::string& query)
-{
- _query.clear();
- encode(query, RESERVED_QUERY, _query);
-}
-
-
-std::string URI::getQuery() const
-{
- std::string query;
- decode(_query, query);
- return query;
-}
-
-
-void URI::setFragment(const std::string& fragment)
-{
- _fragment.clear();
- decode(fragment, _fragment);
-}
-
-
-void URI::setPathEtc(const std::string& pathEtc)
-{
- _path.clear();
- _query.clear();
- _fragment.clear();
- std::string::const_iterator beg = pathEtc.begin();
- std::string::const_iterator end = pathEtc.end();
- parsePathEtc(beg, end);
-}
-
-
-std::string URI::getPathEtc() const
-{
- std::string pathEtc;
- encode(_path, RESERVED_PATH, pathEtc);
- if (!_query.empty())
- {
- pathEtc += '?';
- encode(_query, RESERVED_QUERY, pathEtc);
- }
- if (!_fragment.empty())
- {
- pathEtc += '#';
- encode(_fragment, RESERVED_FRAGMENT, pathEtc);
- }
- return pathEtc;
-}
-
-
-std::string URI::getPathAndQuery() const
-{
- std::string pathAndQuery;
- encode(_path, RESERVED_PATH, pathAndQuery);
- if (!_query.empty())
- {
- pathAndQuery += '?';
- encode(_query, RESERVED_QUERY, pathAndQuery);
- }
- return pathAndQuery;
-}
-
-
-void URI::resolve(const std::string& relativeURI)
-{
- URI parsedURI(relativeURI);
- resolve(parsedURI);
-}
-
-
-void URI::resolve(const URI& relativeURI)
-{
- if (!relativeURI._scheme.empty())
- {
- _scheme = relativeURI._scheme;
- _userInfo = relativeURI._userInfo;
- _host = relativeURI._host;
- _port = relativeURI._port;
- _path = relativeURI._path;
- _query = relativeURI._query;
- removeDotSegments();
- }
- else
- {
- if (!relativeURI._host.empty())
- {
- _userInfo = relativeURI._userInfo;
- _host = relativeURI._host;
- _port = relativeURI._port;
- _path = relativeURI._path;
- _query = relativeURI._query;
- removeDotSegments();
- }
- else
- {
- if (relativeURI._path.empty())
- {
- if (!relativeURI._query.empty())
- _query = relativeURI._query;
- }
- else
- {
- if (relativeURI._path[0] == '/')
- {
- _path = relativeURI._path;
- removeDotSegments();
- }
- else
- {
- mergePath(relativeURI._path);
- }
- _query = relativeURI._query;
- }
- }
- }
- _fragment = relativeURI._fragment;
-}
-
-
-bool URI::isRelative() const
-{
- return _scheme.empty();
-}
-
-
-bool URI::empty() const
-{
- return _scheme.empty() && _host.empty() && _path.empty() && _query.empty() && _fragment.empty();
-}
-
-
-bool URI::operator == (const URI& uri) const
-{
- return equals(uri);
-}
-
-
-bool URI::operator == (const std::string& uri) const
-{
- URI parsedURI(uri);
- return equals(parsedURI);
-}
-
-
-bool URI::operator != (const URI& uri) const
-{
- return !equals(uri);
-}
-
-
-bool URI::operator != (const std::string& uri) const
-{
- URI parsedURI(uri);
- return !equals(parsedURI);
-}
-
-
-bool URI::equals(const URI& uri) const
-{
- return _scheme == uri._scheme
- && _userInfo == uri._userInfo
- && _host == uri._host
- && getPort() == uri.getPort()
- && _path == uri._path
- && _query == uri._query
- && _fragment == uri._fragment;
-}
-
-
-void URI::normalize()
-{
- removeDotSegments(!isRelative());
-}
-
-
-void URI::removeDotSegments(bool removeLeading)
-{
- if (_path.empty()) return;
-
- bool leadingSlash = *(_path.begin()) == '/';
- bool trailingSlash = *(_path.rbegin()) == '/';
- std::vector<std::string> segments;
- std::vector<std::string> normalizedSegments;
- getPathSegments(segments);
- for (std::vector<std::string>::const_iterator it = segments.begin(); it != segments.end(); ++it)
- {
- if (*it == "..")
- {
- if (!normalizedSegments.empty())
- {
- if (normalizedSegments.back() == "..")
- normalizedSegments.push_back(*it);
- else
- normalizedSegments.pop_back();
- }
- else if (!removeLeading)
- {
- normalizedSegments.push_back(*it);
- }
- }
- else if (*it != ".")
- {
- normalizedSegments.push_back(*it);
- }
- }
- buildPath(normalizedSegments, leadingSlash, trailingSlash);
-}
-
-
-void URI::getPathSegments(std::vector<std::string>& segments)
-{
- getPathSegments(_path, segments);
-}
-
-
-void URI::getPathSegments(const std::string& path, std::vector<std::string>& segments)
-{
- std::string::const_iterator it = path.begin();
- std::string::const_iterator end = path.end();
- std::string seg;
- while (it != end)
- {
- if (*it == '/')
- {
- if (!seg.empty())
- {
- segments.push_back(seg);
- seg.clear();
- }
- }
- else seg += *it;
- ++it;
- }
- if (!seg.empty())
- segments.push_back(seg);
-}
-
-
-void URI::encode(const std::string& str, const std::string& reserved, std::string& encodedStr)
-{
- for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
- {
- char c = *it;
- if ((c >= 'a' && c <= 'z') ||
- (c >= 'A' && c <= 'Z') ||
- (c >= '0' && c <= '9') ||
- c == '-' || c == '_' ||
- c == '.' || c == '~')
- {
- encodedStr += c;
- }
- else if (c <= 0x20 || c >= 0x7F || ILLEGAL.find(c) != std::string::npos || reserved.find(c) != std::string::npos)
- {
- encodedStr += '%';
- encodedStr += NumberFormatter::formatHex((unsigned) (unsigned char) c, 2);
- }
- else encodedStr += c;
- }
-}
-
-
-void URI::decode(const std::string& str, std::string& decodedStr)
-{
- std::string::const_iterator it = str.begin();
- std::string::const_iterator end = str.end();
- while (it != end)
- {
- char c = *it++;
- if (c == '%')
- {
- if (it == end) throw SyntaxException("URI encoding: no hex digit following percent sign", str);
- char hi = *it++;
- if (it == end) throw SyntaxException("URI encoding: two hex digits must follow percent sign", str);
- char lo = *it++;
- if (hi >= '0' && hi <= '9')
- c = hi - '0';
- else if (hi >= 'A' && hi <= 'F')
- c = hi - 'A' + 10;
- else if (hi >= 'a' && hi <= 'f')
- c = hi - 'a' + 10;
- else throw SyntaxException("URI encoding: not a hex digit");
- c *= 16;
- if (lo >= '0' && lo <= '9')
- c += lo - '0';
- else if (lo >= 'A' && lo <= 'F')
- c += lo - 'A' + 10;
- else if (lo >= 'a' && lo <= 'f')
- c += lo - 'a' + 10;
- else throw SyntaxException("URI encoding: not a hex digit");
- }
- decodedStr += c;
- }
-}
-
-
-bool URI::isWellKnownPort() const
-{
- return _port == getWellKnownPort();
-}
-
-
-unsigned short URI::getWellKnownPort() const
-{
- if (_scheme == "ftp")
- return 21;
- else if (_scheme == "ssh")
- return 22;
- else if (_scheme == "telnet")
- return 23;
- else if (_scheme == "http")
- return 80;
- else if (_scheme == "nntp")
- return 119;
- else if (_scheme == "ldap")
- return 389;
- else if (_scheme == "https")
- return 443;
- else
- return 0;
-}
-
-
-void URI::parse(const std::string& uri)
-{
- std::string::const_iterator it = uri.begin();
- std::string::const_iterator end = uri.end();
- if (it == end) return;
- if (*it != '/' && *it != '.' && *it != '?' && *it != '#')
- {
- std::string scheme;
- while (it != end && *it != ':' && *it != '?' && *it != '#' && *it != '/') scheme += *it++;
- if (it != end && *it == ':')
- {
- ++it;
- if (it == end) throw SyntaxException("URI scheme must be followed by authority or path", uri);
- setScheme(scheme);
- if (*it == '/')
- {
- ++it;
- if (it != end && *it == '/')
- {
- ++it;
- parseAuthority(it, end);
- }
- else --it;
- }
- parsePathEtc(it, end);
- }
- else
- {
- it = uri.begin();
- parsePathEtc(it, end);
- }
- }
- else parsePathEtc(it, end);
-}
-
-
-void URI::parseAuthority(std::string::const_iterator& it, const std::string::const_iterator& end)
-{
- std::string userInfo;
- std::string part;
- while (it != end && *it != '/' && *it != '?' && *it != '#')
- {
- if (*it == '@')
- {
- userInfo = part;
- part.clear();
- }
- else part += *it;
- ++it;
- }
- std::string::const_iterator pbeg = part.begin();
- std::string::const_iterator pend = part.end();
- parseHostAndPort(pbeg, pend);
- _userInfo = userInfo;
-}
-
-
-void URI::parseHostAndPort(std::string::const_iterator& it, const std::string::const_iterator& end)
-{
- if (it == end) return;
- std::string host;
- if (*it == '[')
- {
- // IPv6 address
- while (it != end && *it != ']') host += *it++;
- if (it == end) throw SyntaxException("unterminated IPv6 address");
- host += *it++;
- }
- else
- {
- while (it != end && *it != ':') host += *it++;
- }
- if (it != end && *it == ':')
- {
- ++it;
- std::string port;
- while (it != end) port += *it++;
- if (!port.empty())
- {
- int nport = 0;
- if (NumberParser::tryParse(port, nport) && nport > 0 && nport < 65536)
- _port = (unsigned short) nport;
- else
- throw SyntaxException("bad or invalid port number", port);
- }
- else _port = getWellKnownPort();
- }
- else _port = getWellKnownPort();
- _host = host;
- toLowerInPlace(_host);
-}
-
-
-void URI::parsePath(std::string::const_iterator& it, const std::string::const_iterator& end)
-{
- std::string path;
- while (it != end && *it != '?' && *it != '#') path += *it++;
- decode(path, _path);
-}
-
-
-void URI::parsePathEtc(std::string::const_iterator& it, const std::string::const_iterator& end)
-{
- if (it == end) return;
- if (*it != '?' && *it != '#')
- parsePath(it, end);
- if (it != end && *it == '?')
- {
- ++it;
- parseQuery(it, end);
- }
- if (it != end && *it == '#')
- {
- ++it;
- parseFragment(it, end);
- }
-}
-
-
-void URI::parseQuery(std::string::const_iterator& it, const std::string::const_iterator& end)
-{
- _query.clear();
- while (it != end && *it != '#') _query += *it++;
-}
-
-
-void URI::parseFragment(std::string::const_iterator& it, const std::string::const_iterator& end)
-{
- std::string fragment;
- while (it != end) fragment += *it++;
- decode(fragment, _fragment);
-}
-
-
-void URI::mergePath(const std::string& path)
-{
- std::vector<std::string> segments;
- std::vector<std::string> normalizedSegments;
- bool addLeadingSlash = false;
- if (!_path.empty())
- {
- getPathSegments(segments);
- bool endsWithSlash = *(_path.rbegin()) == '/';
- if (!endsWithSlash && !segments.empty())
- segments.pop_back();
- addLeadingSlash = _path[0] == '/';
- }
- getPathSegments(path, segments);
- addLeadingSlash = addLeadingSlash || (!path.empty() && path[0] == '/');
- bool hasTrailingSlash = (!path.empty() && *(path.rbegin()) == '/');
- bool addTrailingSlash = false;
- for (std::vector<std::string>::const_iterator it = segments.begin(); it != segments.end(); ++it)
- {
- if (*it == "..")
- {
- addTrailingSlash = true;
- if (!normalizedSegments.empty())
- normalizedSegments.pop_back();
- }
- else if (*it != ".")
- {
- addTrailingSlash = false;
- normalizedSegments.push_back(*it);
- }
- else addTrailingSlash = true;
- }
- buildPath(normalizedSegments, addLeadingSlash, hasTrailingSlash || addTrailingSlash);
-}
-
-
-void URI::buildPath(const std::vector<std::string>& segments, bool leadingSlash, bool trailingSlash)
-{
- _path.clear();
- bool first = true;
- for (std::vector<std::string>::const_iterator it = segments.begin(); it != segments.end(); ++it)
- {
- if (first)
- {
- first = false;
- if (leadingSlash)
- _path += '/';
- else if (_scheme.empty() && (*it).find(':') != std::string::npos)
- _path.append("./");
- }
- else _path += '/';
- _path.append(*it);
- }
- if (trailingSlash)
- _path += '/';
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/URIStreamFactory.cpp b/Utilities/Poco/Foundation/src/URIStreamFactory.cpp
deleted file mode 100755
index b0955df0ad..0000000000
--- a/Utilities/Poco/Foundation/src/URIStreamFactory.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// URIStreamFactory.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: URI
-// Module: URIStreamFactory
-//
-// Copyright (c) 2004-2006, 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/URIStreamFactory.h"
-#include <algorithm>
-
-
-namespace Poco {
-
-
-URIStreamFactory::URIStreamFactory()
-{
-}
-
-
-URIStreamFactory::~URIStreamFactory()
-{
-}
-
-
-URIRedirection::URIRedirection(const std::string& uri):
- _uri(uri)
-{
-}
-
-
-URIRedirection::URIRedirection(const URIRedirection& redir):
- _uri(redir._uri)
-{
-}
-
-
-URIRedirection& URIRedirection::operator = (const URIRedirection& redir)
-{
- URIRedirection tmp(redir);
- swap(tmp);
- return *this;
-}
-
-
-void URIRedirection::swap(URIRedirection& redir)
-{
- std::swap(_uri, redir._uri);
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/URIStreamOpener.cpp b/Utilities/Poco/Foundation/src/URIStreamOpener.cpp
deleted file mode 100755
index 3ca5001d4c..0000000000
--- a/Utilities/Poco/Foundation/src/URIStreamOpener.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// URIStreamOpener.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: URI
-// Module: URIStreamOpener
-//
-// Copyright (c) 2004-2006, 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/URIStreamOpener.h"
-#include "Poco/URIStreamFactory.h"
-#include "Poco/FileStreamFactory.h"
-#include "Poco/URI.h"
-#include "Poco/Path.h"
-#include "Poco/SingletonHolder.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-
-
-URIStreamOpener::URIStreamOpener()
-{
- registerStreamFactory("file", new FileStreamFactory);
-}
-
-
-URIStreamOpener::~URIStreamOpener()
-{
- for (FactoryMap::iterator it = _map.begin(); it != _map.end(); ++it)
- delete it->second;
-}
-
-
-std::istream* URIStreamOpener::open(const URI& uri) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string scheme;
- if (uri.isRelative())
- scheme = "file";
- else
- scheme = uri.getScheme();
- return openURI(scheme, uri);
-}
-
-
-std::istream* URIStreamOpener::open(const std::string& pathOrURI) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- try
- {
- URI uri(pathOrURI);
- std::string scheme(uri.getScheme());
- FactoryMap::const_iterator it = _map.find(scheme);
- if (it != _map.end())
- return openURI(scheme, uri);
- }
- catch (Exception&)
- {
- }
- Path path(pathOrURI, Path::PATH_GUESS);
- return openFile(path);
-}
-
-
-std::istream* URIStreamOpener::open(const std::string& basePathOrURI, const std::string& pathOrURI) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- try
- {
- URI uri(basePathOrURI);
- std::string scheme(uri.getScheme());
- FactoryMap::const_iterator it = _map.find(scheme);
- if (it != _map.end())
- {
- uri.resolve(pathOrURI);
- return openURI(scheme, uri);
- }
- }
- catch (Exception&)
- {
- }
- Path base(basePathOrURI, Path::PATH_GUESS);
- Path path(pathOrURI, Path::PATH_GUESS);
- base.resolve(path);
- return openFile(base);
-}
-
-
-void URIStreamOpener::registerStreamFactory(const std::string& scheme, URIStreamFactory* pFactory)
-{
- poco_check_ptr (pFactory);
-
- FastMutex::ScopedLock lock(_mutex);
- if (_map.find(scheme) == _map.end())
- {
- _map[scheme] = pFactory;
- }
- else throw ExistsException("An URIStreamFactory for the given scheme has already been registered", scheme);
-}
-
-
-void URIStreamOpener::unregisterStreamFactory(const std::string& scheme)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- FactoryMap::iterator it = _map.find(scheme);
- if (it != _map.end())
- {
- URIStreamFactory* pFactory = it->second;
- _map.erase(it);
- delete pFactory;
- }
- else throw NotFoundException("No URIStreamFactory has been registered for the given scheme", scheme);
-}
-
-
-bool URIStreamOpener::supportsScheme(const std::string& scheme)
-{
- FastMutex::ScopedLock lock(_mutex);
- return _map.find(scheme) != _map.end();
-}
-
-
-URIStreamOpener& URIStreamOpener::defaultOpener()
-{
- static SingletonHolder<URIStreamOpener> sh;
- return *sh.get();
-}
-
-
-std::istream* URIStreamOpener::openFile(const Path& path) const
-{
- FileStreamFactory factory;
- return factory.open(path);
-}
-
-
-std::istream* URIStreamOpener::openURI(const std::string& scheme, const URI& uri) const
-{
- std::string actualScheme(scheme);
- URI actualURI(uri);
- int redirects = 0;
-
- while (redirects < MAX_REDIRECTS)
- {
- try
- {
- FactoryMap::const_iterator it = _map.find(actualScheme);
- if (it != _map.end())
- return it->second->open(actualURI);
- else if (redirects > 0)
- throw UnknownURISchemeException(actualURI.toString() + std::string("; redirected from ") + uri.toString());
- else
- throw UnknownURISchemeException(actualURI.toString());
- }
- catch (URIRedirection& redir)
- {
- actualURI = redir.uri();
- actualScheme = actualURI.getScheme();
- ++redirects;
- }
- }
- throw IOException("Too many redirects while opening URI", uri.toString());
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/UTF16Encoding.cpp b/Utilities/Poco/Foundation/src/UTF16Encoding.cpp
deleted file mode 100755
index 38d9343eba..0000000000
--- a/Utilities/Poco/Foundation/src/UTF16Encoding.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-//
-// UTF16Encoding.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: UTF16Encoding
-//
-// Copyright (c) 2004-2007, 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/UTF16Encoding.h"
-#include "Poco/ByteOrder.h"
-#include "Poco/String.h"
-
-
-namespace Poco {
-
-
-const char* UTF16Encoding::_names[] =
-{
- "UTF-16",
- "UTF16",
- NULL
-};
-
-
-const TextEncoding::CharacterMap UTF16Encoding::_charMap =
-{
- /* 00 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* 10 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* 20 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* 30 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* 40 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* 50 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* 60 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* 70 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* 80 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* 90 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* a0 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* b0 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* c0 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* d0 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* e0 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* f0 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-};
-
-
-UTF16Encoding::UTF16Encoding(ByteOrderType byteOrder)
-{
- setByteOrder(byteOrder);
-}
-
-
-UTF16Encoding::UTF16Encoding(int byteOrderMark)
-{
- setByteOrder(byteOrderMark);
-}
-
-
-UTF16Encoding::~UTF16Encoding()
-{
-}
-
-
-UTF16Encoding::ByteOrderType UTF16Encoding::getByteOrder() const
-{
-#if defined(POCO_ARCH_BIG_ENDIAN)
- return _flipBytes ? LITTLE_ENDIAN_BYTE_ORDER : BIG_ENDIAN_BYTE_ORDER;
-#else
- return _flipBytes ? BIG_ENDIAN_BYTE_ORDER : LITTLE_ENDIAN_BYTE_ORDER;
-#endif
-}
-
-
-void UTF16Encoding::setByteOrder(ByteOrderType byteOrder)
-{
-#if defined(POCO_ARCH_BIG_ENDIAN)
- _flipBytes = byteOrder == LITTLE_ENDIAN_BYTE_ORDER;
-#else
- _flipBytes = byteOrder == BIG_ENDIAN_BYTE_ORDER;;
-#endif
-}
-
-
-void UTF16Encoding::setByteOrder(int byteOrderMark)
-{
- _flipBytes = byteOrderMark != 0xFEFF;
-}
-
-
-const char* UTF16Encoding::canonicalName() const
-{
- return _names[0];
-}
-
-
-bool UTF16Encoding::isA(const std::string& encodingName) const
-{
- for (const char** name = _names; *name; ++name)
- {
- if (Poco::icompare(encodingName, *name) == 0)
- return true;
- }
- return false;
-}
-
-
-const TextEncoding::CharacterMap& UTF16Encoding::characterMap() const
-{
- return _charMap;
-}
-
-
-int UTF16Encoding::convert(const unsigned char* bytes) const
-{
- UInt16 uc;
- unsigned char* p = (unsigned char*) &uc;
- *p++ = *bytes++;
- *p++ = *bytes++;
- return _flipBytes ? ByteOrder::flipBytes(uc) : uc;
-}
-
-
-int UTF16Encoding::convert(int ch, unsigned char* bytes, int length) const
-{
- if (ch <= 0xFFFF)
- {
- if (bytes && length >= 2)
- {
- UInt16 ch1 = _flipBytes ? ByteOrder::flipBytes((UInt16) ch) : (UInt16) ch;
- unsigned char* p = (unsigned char*) &ch1;
- *bytes++ = *p++;
- *bytes++ = *p++;
- }
- return 2;
- }
- else
- {
- if (bytes && length >= 4)
- {
- int ch1 = ch - 0x10000;
- UInt16 w1 = 0xD800 + ((ch1 >> 10) & 0x3FF);
- UInt16 w2 = 0xDC00 + (ch1 & 0x3FF);
- if (_flipBytes)
- {
- w1 = ByteOrder::flipBytes(w1);
- w2 = ByteOrder::flipBytes(w2);
- }
- unsigned char* p = (unsigned char*) &w1;
- *bytes++ = *p++;
- *bytes++ = *p++;
- p = (unsigned char*) &w2;
- *bytes++ = *p++;
- *bytes++ = *p++;
- }
- return 4;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/UTF8Encoding.cpp b/Utilities/Poco/Foundation/src/UTF8Encoding.cpp
deleted file mode 100755
index 39b4cd82ac..0000000000
--- a/Utilities/Poco/Foundation/src/UTF8Encoding.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-//
-// UTF8Encoding.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: UTF8Encoding
-//
-// Copyright (c) 2004-2007, 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/UTF8Encoding.h"
-#include "Poco/String.h"
-
-
-namespace Poco {
-
-
-const char* UTF8Encoding::_names[] =
-{
- "UTF-8",
- "UTF8",
- NULL
-};
-
-
-const TextEncoding::CharacterMap UTF8Encoding::_charMap =
-{
- /* 00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- /* 10 */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- /* 20 */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- /* 30 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- /* 40 */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- /* 50 */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- /* 60 */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- /* 70 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- /* 80 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* 90 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* a0 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* b0 */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- /* c0 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* d0 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- /* e0 */ -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
- /* f0 */ -4, -4, -4, -4, -4, -4, -4, -4, -5, -5, -5, -5, -6, -6, -1, -1,
-};
-
-
-UTF8Encoding::UTF8Encoding()
-{
-}
-
-
-UTF8Encoding::~UTF8Encoding()
-{
-}
-
-
-const char* UTF8Encoding::canonicalName() const
-{
- return _names[0];
-}
-
-
-bool UTF8Encoding::isA(const std::string& encodingName) const
-{
- for (const char** name = _names; *name; ++name)
- {
- if (Poco::icompare(encodingName, *name) == 0)
- return true;
- }
- return false;
-}
-
-
-const TextEncoding::CharacterMap& UTF8Encoding::characterMap() const
-{
- return _charMap;
-}
-
-
-bool UTF8Encoding::isLegal(const unsigned char *bytes, int length)
-{
- // Note: The following is loosely based on the isLegalUTF8 function
- // from ftp://ftp.unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.c
- // Excuse the ugliness...
-
- if (0 == bytes || 0 == length) return false;
-
- unsigned char a;
- const unsigned char* srcptr = bytes + length;
- switch (length)
- {
- default:
- return false;
- // Everything else falls through when true.
- case 4:
- if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
- case 3:
- if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
- case 2:
- if ((a = (*--srcptr)) > 0xBF) return false;
- switch (*bytes)
- {
- case 0xE0:
- if (a < 0xA0) return false;
- break;
- case 0xED:
- if (a > 0x9F) return false;
- break;
- case 0xF0:
- if (a < 0x90) return false;
- break;
- case 0xF4:
- if (a > 0x8F) return false;
- break;
- default:
- if (a < 0x80) return false;
- }
- case 1:
- if (*bytes >= 0x80 && *bytes < 0xC2) return false;
- }
- return *bytes <= 0xF4;
-}
-
-
-int UTF8Encoding::convert(const unsigned char* bytes) const
-{
- int n = _charMap[*bytes];
- int uc;
-
- switch (n)
- {
- case -6:
- case -5:
- case -1:
- return -1;
- case -4:
- case -3:
- case -2:
- if (!isLegal(bytes, -n)) return -1;
- uc = *bytes & ((0x07 << (n + 4)) | 0x03);
- break;
- default:
- return n;
- }
-
- while (n++ < -1)
- {
- uc <<= 6;
- uc |= (*++bytes & 0x3F);
- }
- return uc;
-}
-
-
-int UTF8Encoding::convert(int ch, unsigned char* bytes, int length) const
-{
-#ifdef _DEBUG
- unsigned char* lb = bytes;
-#endif
-
- if (ch <= 0x7F)
- {
- if (bytes && length >= 1)
- *bytes = (unsigned char) ch;
- return 1;
- }
- else if (ch <= 0x7FF)
- {
- if (bytes && length >= 2)
- {
- *bytes++ = (unsigned char) (((ch >> 6) & 0x1F) | 0xC0);
- *bytes = (unsigned char) ((ch & 0x3F) | 0x80);
- }
- poco_assert_dbg (isLegal(lb, 2));
- return 2;
- }
- else if (ch <= 0xFFFF)
- {
- if (bytes && length >= 3)
- {
- *bytes++ = (unsigned char) (((ch >> 12) & 0x0F) | 0xE0);
- *bytes++ = (unsigned char) (((ch >> 6) & 0x3F) | 0x80);
- *bytes = (unsigned char) ((ch & 0x3F) | 0x80);
- }
- poco_assert_dbg (isLegal(lb, 3));
- return 3;
- }
- else if (ch <= 0x10FFFF)
- {
- if (bytes && length >= 4)
- {
- *bytes++ = (unsigned char) (((ch >> 18) & 0x07) | 0xF0);
- *bytes++ = (unsigned char) (((ch >> 12) & 0x3F) | 0x80);
- *bytes++ = (unsigned char) (((ch >> 6) & 0x3F) | 0x80);
- *bytes = (unsigned char) ((ch & 0x3F) | 0x80);
- }
- poco_assert_dbg (isLegal(lb, 4));
- return 4;
- }
- else return 0;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/UTF8String.cpp b/Utilities/Poco/Foundation/src/UTF8String.cpp
deleted file mode 100755
index 0248594c6b..0000000000
--- a/Utilities/Poco/Foundation/src/UTF8String.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-//
-// UTF8String.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: UTF8String
-//
-// Copyright (c) 2007, 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/UTF8String.h"
-#include "Poco/Unicode.h"
-#include "Poco/TextIterator.h"
-#include "Poco/TextConverter.h"
-#include "Poco/UTF8Encoding.h"
-#include <algorithm>
-
-
-namespace Poco {
-
-
-int UTF8::icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, std::string::const_iterator it2, std::string::const_iterator end2)
-{
- static UTF8Encoding utf8;
-
- std::string::size_type sz = str.size();
- if (pos > sz) pos = sz;
- if (pos + n > sz) n = sz - pos;
- TextIterator uit1(str.begin() + pos, str.begin() + pos + n, utf8);
- TextIterator uend1(str.begin() + pos + n);
- TextIterator uit2(it2, end2, utf8);
- TextIterator uend2(end2);
- while (uit1 != uend1 && uit2 != uend2)
- {
- int c1 = Unicode::toLower(*uit1);
- int c2 = Unicode::toLower(*uit2);
- if (c1 < c2)
- return -1;
- else if (c1 > c2)
- return 1;
- ++uit1; ++uit2;
- }
-
- if (uit1 == uend1)
- return uit2 == uend2 ? 0 : -1;
- else
- return 1;
-}
-
-
-int UTF8::icompare(const std::string& str1, const std::string& str2)
-{
- return icompare(str1, 0, str1.size(), str2.begin(), str2.end());
-}
-
-
-int UTF8::icompare(const std::string& str1, std::string::size_type n1, const std::string& str2, std::string::size_type n2)
-{
- if (n2 > str2.size()) n2 = str2.size();
- return icompare(str1, 0, n1, str2.begin(), str2.begin() + n2);
-}
-
-
-int UTF8::icompare(const std::string& str1, std::string::size_type n, const std::string& str2)
-{
- if (n > str2.size()) n = str2.size();
- return icompare(str1, 0, n, str2.begin(), str2.begin() + n);
-}
-
-
-int UTF8::icompare(const std::string& str1, std::string::size_type pos, std::string::size_type n, const std::string& str2)
-{
- return icompare(str1, pos, n, str2.begin(), str2.end());
-}
-
-
-int UTF8::icompare(const std::string& str1, std::string::size_type pos1, std::string::size_type n1, const std::string& str2, std::string::size_type pos2, std::string::size_type n2)
-{
- std::string::size_type sz2 = str2.size();
- if (pos2 > sz2) pos2 = sz2;
- if (pos2 + n2 > sz2) n2 = sz2 - pos2;
- return icompare(str1, pos1, n1, str2.begin() + pos2, str2.begin() + pos2 + n2);
-}
-
-
-int UTF8::icompare(const std::string& str1, std::string::size_type pos1, std::string::size_type n, const std::string& str2, std::string::size_type pos2)
-{
- std::string::size_type sz2 = str2.size();
- if (pos2 > sz2) pos2 = sz2;
- if (pos2 + n > sz2) n = sz2 - pos2;
- return icompare(str1, pos1, n, str2.begin() + pos2, str2.begin() + pos2 + n);
-}
-
-
-int UTF8::icompare(const std::string& str, std::string::size_type pos, std::string::size_type n, const std::string::value_type* ptr)
-{
- static UTF8Encoding utf8;
-
- poco_check_ptr (ptr);
- std::string::size_type sz = str.size();
- if (pos > sz) pos = sz;
- if (pos + n > sz) n = sz - pos;
- TextIterator uit(str.begin() + pos, str.begin() + pos + n, utf8);
- TextIterator uend(str.begin() + pos + n);
- while (uit != uend && *ptr)
- {
- int c1 = Unicode::toLower(*uit);
- int c2 = Unicode::toLower(*ptr);
- if (c1 < c2)
- return -1;
- else if (c1 > c2)
- return 1;
- ++uit; ++ptr;
- }
-
- if (uit == uend)
- return *ptr == 0 ? 0 : -1;
- else
- return 1;
-}
-
-
-int UTF8::icompare(const std::string& str, std::string::size_type pos, const std::string::value_type* ptr)
-{
- return icompare(str, pos, str.size() - pos, ptr);
-}
-
-
-int UTF8::icompare(const std::string& str, const std::string::value_type* ptr)
-{
- return icompare(str, 0, str.size(), ptr);
-}
-
-
-std::string UTF8::toUpper(const std::string& str)
-{
- static UTF8Encoding utf8;
- std::string result;
- TextConverter converter(utf8, utf8);
- converter.convert(str, result, Unicode::toUpper);
- return result;
-}
-
-
-std::string& UTF8::toUpperInPlace(std::string& str)
-{
- static UTF8Encoding utf8;
- std::string result;
- TextConverter converter(utf8, utf8);
- converter.convert(str, result, Unicode::toUpper);
- std::swap(str, result);
- return str;
-}
-
-
-std::string UTF8::toLower(const std::string& str)
-{
- static UTF8Encoding utf8;
- std::string result;
- TextConverter converter(utf8, utf8);
- converter.convert(str, result, Unicode::toLower);
- return result;
-}
-
-
-std::string& UTF8::toLowerInPlace(std::string& str)
-{
- static UTF8Encoding utf8;
- std::string result;
- TextConverter converter(utf8, utf8);
- converter.convert(str, result, Unicode::toLower);
- std::swap(str, result);
- return str;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/UUID.cpp b/Utilities/Poco/Foundation/src/UUID.cpp
deleted file mode 100755
index c29ebdcb8b..0000000000
--- a/Utilities/Poco/Foundation/src/UUID.cpp
+++ /dev/null
@@ -1,357 +0,0 @@
-//
-// UUID.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: UUID
-// Module: UUID
-//
-// Copyright (c) 2004-2006, 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/UUID.h"
-#include "Poco/ByteOrder.h"
-#include "Poco/Exception.h"
-#include <algorithm>
-#include <cstring>
-
-
-namespace Poco {
-
-
-UUID::UUID():
- _timeLow(0),
- _timeMid(0),
- _timeHiAndVersion(0),
- _clockSeq(0)
-{
- std::memset(_node, 0, sizeof(_node));
-}
-
-
-UUID::UUID(const UUID& uuid):
- _timeLow(uuid._timeLow),
- _timeMid(uuid._timeMid),
- _timeHiAndVersion(uuid._timeHiAndVersion),
- _clockSeq(uuid._clockSeq)
-{
- std::memcpy(_node, uuid._node, sizeof(_node));
-}
-
-
-UUID::UUID(const std::string& uuid)
-{
- parse(uuid);
-}
-
-
-UUID::UUID(const char* uuid)
-{
- poco_check_ptr (uuid);
- parse(std::string(uuid));
-}
-
-
-UUID::UUID(UInt32 timeLow, UInt32 timeMid, UInt32 timeHiAndVersion, UInt16 clockSeq, UInt8 node[]):
- _timeLow(timeLow),
- _timeMid(timeMid),
- _timeHiAndVersion(timeHiAndVersion),
- _clockSeq(clockSeq)
-{
- std::memcpy(_node, node, sizeof(_node));
-}
-
-
-UUID::UUID(const char* bytes, Version version)
-{
- UInt32 i32;
- UInt16 i16;
- std::memcpy(&i32, bytes, sizeof(i32));
- _timeLow = ByteOrder::fromNetwork(i32);
- bytes += sizeof(i32);
- std::memcpy(&i16, bytes, sizeof(i16));
- _timeMid = ByteOrder::fromNetwork(i16);
- bytes += sizeof(i16);
- std::memcpy(&i16, bytes, sizeof(i16));
- _timeHiAndVersion = ByteOrder::fromNetwork(i16);
- bytes += sizeof(i16);
- std::memcpy(&i16, bytes, sizeof(i16));
- _clockSeq = ByteOrder::fromNetwork(i16);
- bytes += sizeof(i16);
- std::memcpy(_node, bytes, sizeof(_node));
-
- _timeHiAndVersion &= 0x0FFF;
- _timeHiAndVersion |= (version << 12);
- _clockSeq &= 0x3FFF;
- _clockSeq |= 0x8000;
-}
-
-
-UUID::~UUID()
-{
-}
-
-
-UUID& UUID::operator = (const UUID& uuid)
-{
- if (&uuid != this)
- {
- _timeLow = uuid._timeLow;
- _timeMid = uuid._timeMid;
- _timeHiAndVersion = uuid._timeHiAndVersion;
- _clockSeq = uuid._clockSeq;
- std::memcpy(_node, uuid._node, sizeof(_node));
- }
- return *this;
-}
-
-
-void UUID::swap(UUID& uuid)
-{
- std::swap(_timeLow, uuid._timeLow);
- std::swap(_timeMid, uuid._timeMid);
- std::swap(_timeHiAndVersion, uuid._timeHiAndVersion);
- std::swap(_clockSeq, uuid._clockSeq);
- std::swap_ranges(_node, _node + 6, &uuid._node[0]);
-}
-
-
-void UUID::parse(const std::string& uuid)
-{
- if (uuid.size() < 36)
- throw SyntaxException(uuid);
-
- if (uuid[8] != '-'|| uuid[13] != '-' || uuid[18] != '-' || uuid[23] != '-')
- throw SyntaxException(uuid);
-
- std::string::const_iterator it = uuid.begin();
- _timeLow = 0;
- for (int i = 0; i < 8; ++i)
- {
- _timeLow = (_timeLow << 4) | nibble(*it++);
- }
- ++it;
- _timeMid = 0;
- for (int i = 0; i < 4; ++i)
- {
- _timeMid = (_timeMid << 4) | nibble(*it++);
- }
- ++it;
- _timeHiAndVersion = 0;
- for (int i = 0; i < 4; ++i)
- {
- _timeHiAndVersion = (_timeHiAndVersion << 4) | nibble(*it++);
- }
- ++it;
- _clockSeq = 0;
- for (int i = 0; i < 4; ++i)
- {
- _clockSeq = (_clockSeq << 4) | nibble(*it++);
- }
- ++it;
- for (int i = 0; i < 6; ++i)
- {
- _node[i] = (nibble(*it++) << 4) | nibble(*it++) ;
- }
-}
-
-
-std::string UUID::toString() const
-{
- std::string result;
- result.reserve(36);
- appendHex(result, _timeLow);
- result += '-';
- appendHex(result, _timeMid);
- result += '-';
- appendHex(result, _timeHiAndVersion);
- result += '-';
- appendHex(result, _clockSeq);
- result += '-';
- for (int i = 0; i < sizeof(_node); ++i)
- appendHex(result, _node[i]);
- return result;
-}
-
-
-void UUID::copyFrom(const char* buffer)
-{
- UInt32 i32;
- UInt16 i16;
- std::memcpy(&i32, buffer, sizeof(i32));
- _timeLow = ByteOrder::fromNetwork(i32);
- buffer += sizeof(i32);
- std::memcpy(&i16, buffer, sizeof(i16));
- _timeMid = ByteOrder::fromNetwork(i16);
- buffer += sizeof(i16);
- std::memcpy(&i16, buffer, sizeof(i16));
- _timeHiAndVersion = ByteOrder::fromNetwork(i16);
- buffer += sizeof(i16);
- std::memcpy(&i16, buffer, sizeof(i16));
- _clockSeq = ByteOrder::fromNetwork(i16);
- buffer += sizeof(i16);
- std::memcpy(_node, buffer, sizeof(_node));
-}
-
-
-void UUID::copyTo(char* buffer) const
-{
- UInt32 i32 = ByteOrder::toNetwork(_timeLow);
- std::memcpy(buffer, &i32, sizeof(i32));
- buffer += sizeof(i32);
- UInt16 i16 = ByteOrder::toNetwork(_timeMid);
- std::memcpy(buffer, &i16, sizeof(i16));
- buffer += sizeof(i16);
- i16 = ByteOrder::toNetwork(_timeHiAndVersion);
- std::memcpy(buffer, &i16, sizeof(i16));
- buffer += sizeof(i16);
- i16 = ByteOrder::toNetwork(_clockSeq);
- std::memcpy(buffer, &i16, sizeof(i16));
- buffer += sizeof(i16);
- std::memcpy(buffer, _node, sizeof(_node));
-}
-
-
-int UUID::variant() const
-{
- int v = _clockSeq >> 13;
- if ((v & 6) == 6)
- return v;
- else if (v & 4)
- return 2;
- else
- return 0;
-}
-
-
-int UUID::compare(const UUID& uuid) const
-{
- if (_timeLow != uuid._timeLow) return _timeLow < uuid._timeLow ? -1 : 1;
- if (_timeMid != uuid._timeMid) return _timeMid < uuid._timeMid ? -1 : 1;
- if (_timeHiAndVersion != uuid._timeHiAndVersion) return _timeHiAndVersion < uuid._timeHiAndVersion ? -1 : 1;
- if (_clockSeq != uuid._clockSeq) return _clockSeq < uuid._clockSeq ? -1 : 1;
- for (int i = 0; i < sizeof(_node); ++i)
- {
- if (_node[i] < uuid._node[i])
- return -1;
- else if (_node[i] > uuid._node[i])
- return 1;
- }
- return 0;
-}
-
-
-void UUID::appendHex(std::string& str, UInt8 n)
-{
- static const char* digits = "0123456789abcdef";
- str += digits[(n >> 4) & 0xF];
- str += digits[n & 0xF];
-}
-
-
-void UUID::appendHex(std::string& str, UInt16 n)
-{
- appendHex(str, UInt8(n >> 8));
- appendHex(str, UInt8(n & 0xFF));
-}
-
-
-void UUID::appendHex(std::string& str, UInt32 n)
-{
- appendHex(str, UInt16(n >> 16));
- appendHex(str, UInt16(n & 0xFFFF));
-}
-
-
-UInt8 UUID::nibble(char hex)
-{
- if (hex >= 'a' && hex <= 'f')
- return UInt8(hex - 'a' + 10);
- else if (hex >= 'A' && hex <= 'F')
- return UInt8(hex - 'A' + 10);
- else if (hex >= '0' && hex <= '9')
- return UInt8(hex - '0');
- else
- return UInt8(0);
-}
-
-
-void UUID::fromNetwork()
-{
- _timeLow = ByteOrder::fromNetwork(_timeLow);
- _timeMid = ByteOrder::fromNetwork(_timeMid);
- _timeHiAndVersion = ByteOrder::fromNetwork(_timeHiAndVersion);
- _clockSeq = ByteOrder::fromNetwork(_clockSeq);
-}
-
-
-void UUID::toNetwork()
-{
- _timeLow = ByteOrder::toNetwork(_timeLow);
- _timeMid = ByteOrder::toNetwork(_timeMid);
- _timeHiAndVersion = ByteOrder::toNetwork(_timeHiAndVersion);
- _clockSeq = ByteOrder::toNetwork(_clockSeq);
-}
-
-
-const UUID& UUID::nil()
-{
- static UUID nil;
- return nil;
-}
-
-
-const UUID& UUID::dns()
-{
- static UUID uuidDNS("6ba7b810-9dad-11d1-80b4-00c04fd430c8");
- return uuidDNS;
-}
-
-
-const UUID& UUID::uri()
-{
- static UUID uuidURI("6ba7b811-9dad-11d1-80b4-00c04fd430c8");
- return uuidURI;
-}
-
-
-const UUID& UUID::oid()
-{
- static UUID uuidOID("6ba7b812-9dad-11d1-80b4-00c04fd430c8");
- return uuidOID;
-}
-
-
-const UUID& UUID::x500()
-{
- static UUID uuidX500("6ba7b814-9dad-11d1-80b4-00c04fd430c8");
- return uuidX500;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/UUIDGenerator.cpp b/Utilities/Poco/Foundation/src/UUIDGenerator.cpp
deleted file mode 100755
index fc922a954a..0000000000
--- a/Utilities/Poco/Foundation/src/UUIDGenerator.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// UUIDGenerator.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: UUID
-// Module: UUID
-//
-// Copyright (c) 2004-2006, 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/UUIDGenerator.h"
-#include "Poco/Thread.h"
-#include "Poco/RandomStream.h"
-#include "Poco/DigestEngine.h"
-#include "Poco/MD5Engine.h"
-#include "Poco/SingletonHolder.h"
-#include <cstring>
-
-
-namespace Poco {
-
-
-UUIDGenerator::UUIDGenerator(): _ticks(0), _haveNode(false)
-{
-}
-
-
-UUIDGenerator::~UUIDGenerator()
-{
-}
-
-
-UUID UUIDGenerator::create()
-{
- FastMutex::ScopedLock lock(_mutex);
-
- if (!_haveNode)
- {
- Environment::nodeId(_node);
- _haveNode = true;
- }
- Timestamp::UtcTimeVal tv = timeStamp();
- UInt32 timeLow = UInt32(tv & 0xFFFFFFFF);
- UInt16 timeMid = UInt16((tv >> 32) & 0xFFFF);
- UInt16 timeHiAndVersion = UInt16((tv >> 48) & 0x0FFF) + (UUID::UUID_TIME_BASED << 12);
- UInt16 clockSeq = (UInt16(_random.next() >> 4) & 0x3FFF) | 0x8000;
- return UUID(timeLow, timeMid, timeHiAndVersion, clockSeq, _node);
-}
-
-
-UUID UUIDGenerator::createFromName(const UUID& nsid, const std::string& name)
-{
- MD5Engine md5;
- return createFromName(nsid, name, md5);
-}
-
-
-UUID UUIDGenerator::createFromName(const UUID& nsid, const std::string& name, DigestEngine& de)
-{
- poco_assert_dbg (de.digestLength() >= 16);
-
- UUID netNsid = nsid;
- netNsid.toNetwork();
- de.reset();
- de.update(&netNsid, sizeof(netNsid));
- de.update(name);
- char buffer[16];
- const DigestEngine::Digest& d = de.digest();
- for (int i = 0; i < 16; ++i)
- {
- buffer[i] = d[i];
- }
- return UUID(buffer, UUID::UUID_NAME_BASED);
-}
-
-
-UUID UUIDGenerator::createRandom()
-{
- char buffer[16];
- RandomInputStream ris;
- ris.read(buffer, sizeof(buffer));
- return UUID(buffer, UUID::UUID_RANDOM);
-}
-
-
-Timestamp::UtcTimeVal UUIDGenerator::timeStamp()
-{
- Timestamp now;
- for (;;)
- {
- if (now != _lastTime)
- {
- _lastTime = now;
- _ticks = 0;
- break;
- }
- if (_ticks < 100)
- {
- ++_ticks;
- break;
- }
- now.update();
- }
- Timestamp::UtcTimeVal tv = now.utcTime();
- return tv + _ticks;
-}
-
-
-UUID UUIDGenerator::createOne()
-{
- try
- {
- return create();
- }
- catch (Exception&)
- {
- return createRandom();
- }
-}
-
-
-UUIDGenerator& UUIDGenerator::defaultGenerator()
-{
- static SingletonHolder<UUIDGenerator> sh;
- return *sh.get();
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Unicode.cpp b/Utilities/Poco/Foundation/src/Unicode.cpp
deleted file mode 100755
index a2f5e849d1..0000000000
--- a/Utilities/Poco/Foundation/src/Unicode.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// Unicode.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: Unicode
-//
-// Copyright (c) 2007, 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/Unicode.h"
-
-
-extern "C"
-{
-#include "pcre_config.h"
-#include "pcre_internal.h"
-}
-
-
-namespace Poco {
-
-
-void Unicode::properties(int ch, CharacterProperties& props)
-{
- const ucd_record* ucd = GET_UCD(ch);
- props.category = static_cast<CharacterCategory>(_pcre_ucp_gentype[ucd->chartype]);
- props.type = static_cast<CharacterType>(ucd->chartype);
- props.script = static_cast<Script>(ucd->script);
-}
-
-
-bool Unicode::isLower(int ch)
-{
- CharacterProperties props;
- properties(ch, props);
- return props.category == UCP_LETTER && props.type == UCP_LOWER_CASE_LETTER;
-}
-
-
-bool Unicode::isUpper(int ch)
-{
- CharacterProperties props;
- properties(ch, props);
- return props.category == UCP_LETTER && props.type == UCP_UPPER_CASE_LETTER;
-}
-
-
-int Unicode::toLower(int ch)
-{
- if (isUpper(ch))
- return static_cast<int>(UCD_OTHERCASE(static_cast<unsigned>(ch)));
- else
- return ch;
-}
-
-
-int Unicode::toUpper(int ch)
-{
- if (isLower(ch))
- return static_cast<int>(UCD_OTHERCASE(static_cast<unsigned>(ch)));
- else
- return ch;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/UnicodeConverter.cpp b/Utilities/Poco/Foundation/src/UnicodeConverter.cpp
deleted file mode 100755
index 4be3ae32d6..0000000000
--- a/Utilities/Poco/Foundation/src/UnicodeConverter.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// UnicodeConverter.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: UnicodeConverter
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef POCO_NO_WSTRING
-
-
-#include "Poco/UnicodeConverter.h"
-#include "Poco/TextConverter.h"
-#include "Poco/TextIterator.h"
-#include "Poco/UTF8Encoding.h"
-#include "Poco/UTF16Encoding.h"
-#include <cstring>
-#include <wchar.h>
-
-
-namespace Poco {
-
-
-void UnicodeConverter::toUTF16(const std::string& utf8String, std::wstring& utf16String)
-{
- utf16String.clear();
- UTF8Encoding utf8Encoding;
- TextIterator it(utf8String, utf8Encoding);
- TextIterator end(utf8String);
- while (it != end) utf16String += (wchar_t) *it++;
-}
-
-
-void UnicodeConverter::toUTF16(const char* utf8String, int length, std::wstring& utf16String)
-{
- poco_check_ptr (utf8String);
-
- utf16String.clear();
-
- UTF8Encoding utf8Encoding;
- UTF16Encoding utf16Encoding;
- const unsigned char* it = (const unsigned char*) utf8String;
- const unsigned char* end = (const unsigned char*) utf8String + length;
-
- while (it < end)
- {
- unsigned char c = *it;
- int n = utf8Encoding.characterMap()[c];
- int uc = '?';
- if (n == -1)
- {
- ++it;
- }
- else if (n >= 0)
- {
- uc = n;
- ++it;
- }
- else
- {
- if (it - n <= end)
- {
- uc = utf8Encoding.convert(it);
- if (uc == -1) uc = '?';
- }
- it -= n;
- }
- utf16String += (wchar_t) uc; // TODO: surrogates
- }
-}
-
-
-void UnicodeConverter::toUTF16(const char* utf8String, std::wstring& utf16String)
-{
- toUTF16(utf8String, (int) std::strlen(utf8String), utf16String);
-}
-
-
-void UnicodeConverter::toUTF8(const std::wstring& utf16String, std::string& utf8String)
-{
- utf8String.clear();
- UTF8Encoding utf8Encoding;
- UTF16Encoding utf16Encoding;
- TextConverter converter(utf16Encoding, utf8Encoding);
- converter.convert(utf16String.data(), (int) utf16String.length()*sizeof(wchar_t), utf8String);
-}
-
-
-void UnicodeConverter::toUTF8(const wchar_t* utf16String, int length, std::string& utf8String)
-{
- utf8String.clear();
- UTF8Encoding utf8Encoding;
- UTF16Encoding utf16Encoding;
- TextConverter converter(utf16Encoding, utf8Encoding);
- converter.convert(utf16String, (int) length*sizeof(wchar_t), utf8String);
-}
-
-
-void UnicodeConverter::toUTF8(const wchar_t* utf16String, std::string& utf8String)
-{
- toUTF8(utf16String, (int) wcslen(utf16String), utf8String);
-}
-
-
-} // namespace Poco
-
-
-#endif // POCO_NO_WSTRING
diff --git a/Utilities/Poco/Foundation/src/Void.cpp b/Utilities/Poco/Foundation/src/Void.cpp
deleted file mode 100755
index ac7d930d7f..0000000000
--- a/Utilities/Poco/Foundation/src/Void.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// Void.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Core
-// Module: Void
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Redistributions in any form must be accompanied by information on
-// how to obtain complete source code for this software and any
-// accompanying software that uses this software. The source code
-// must either be included in the distribution or be available for no
-// more than the cost of distribution plus a nominal fee, and must be
-// freely redistributable under reasonable conditions. For an
-// executable file, complete source code means the source code for all
-// modules it contains. It does not include source code for modules or
-// files that typically accompany the major components of the operating
-// system on which the executable file runs.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#include "Poco/Void.h"
-
-
-namespace Poco {
-
-
-Void::Void()
-{
-}
-
-
-Void::Void(const Void&)
-{
-}
-
-
-Void::~Void()
-{
-}
-
-
-Void& Void::operator = (const Void&)
-{
- return *this;
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/Windows1252Encoding.cpp b/Utilities/Poco/Foundation/src/Windows1252Encoding.cpp
deleted file mode 100755
index 100b0c5780..0000000000
--- a/Utilities/Poco/Foundation/src/Windows1252Encoding.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-//
-// Windows1252Encoding.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Text
-// Module: Windows1252Encoding
-//
-// Copyright (c) 2005-2007, 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/Windows1252Encoding.h"
-#include "Poco/String.h"
-#include <map>
-
-
-namespace Poco {
-
-
-const char* Windows1252Encoding::_names[] =
-{
- "Windows-1252",
- "CP1252",
- NULL
-};
-
-
-const TextEncoding::CharacterMap Windows1252Encoding::_charMap =
-{
- /* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f */
- /* 00 */ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
- /* 10 */ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
- /* 20 */ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
- /* 30 */ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
- /* 40 */ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
- /* 50 */ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
- /* 60 */ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
- /* 70 */ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
- /* 80 */ 0x20AC, 0x0081, 0x201A, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008d, 0x017d, 0x008f,
- /* 90 */ 0x0090, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x009d, 0x017e, 0x0178,
- /* a0 */ 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
- /* b0 */ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
- /* c0 */ 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
- /* d0 */ 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
- /* e0 */ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- /* f0 */ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
-};
-
-
-Windows1252Encoding::Windows1252Encoding()
-{
-}
-
-
-Windows1252Encoding::~Windows1252Encoding()
-{
-}
-
-
-const char* Windows1252Encoding::canonicalName() const
-{
- return _names[0];
-}
-
-
-bool Windows1252Encoding::isA(const std::string& encodingName) const
-{
- for (const char** name = _names; *name; ++name)
- {
- if (Poco::icompare(encodingName, *name) == 0)
- return true;
- }
- return false;
-}
-
-
-const TextEncoding::CharacterMap& Windows1252Encoding::characterMap() const
-{
- return _charMap;
-}
-
-
-int Windows1252Encoding::convert(const unsigned char* bytes) const
-{
- return _charMap[*bytes];
-}
-
-
-int Windows1252Encoding::convert(int ch, unsigned char* bytes, int length) const
-{
- if (ch >= 0 && ch <= 255 && _charMap[ch] == ch)
- {
- if (bytes && length >= 1)
- *bytes = ch;
- return 1;
- }
- else switch (ch)
- {
- case 0x20ac: if (bytes && length >= 1) *bytes = 0x80; return 1;
- case 0x201a: if (bytes && length >= 1) *bytes = 0x82; return 1;
- case 0x0192: if (bytes && length >= 1) *bytes = 0x83; return 1;
- case 0x201e: if (bytes && length >= 1) *bytes = 0x84; return 1;
- case 0x2026: if (bytes && length >= 1) *bytes = 0x85; return 1;
- case 0x2020: if (bytes && length >= 1) *bytes = 0x86; return 1;
- case 0x2021: if (bytes && length >= 1) *bytes = 0x87; return 1;
- case 0x02c6: if (bytes && length >= 1) *bytes = 0x88; return 1;
- case 0x2030: if (bytes && length >= 1) *bytes = 0x89; return 1;
- case 0x0160: if (bytes && length >= 1) *bytes = 0x8a; return 1;
- case 0x2039: if (bytes && length >= 1) *bytes = 0x8b; return 1;
- case 0x0152: if (bytes && length >= 1) *bytes = 0x8c; return 1;
- case 0x017d: if (bytes && length >= 1) *bytes = 0x8e; return 1;
- case 0x2018: if (bytes && length >= 1) *bytes = 0x91; return 1;
- case 0x2019: if (bytes && length >= 1) *bytes = 0x92; return 1;
- case 0x201c: if (bytes && length >= 1) *bytes = 0x93; return 1;
- case 0x201d: if (bytes && length >= 1) *bytes = 0x94; return 1;
- case 0x2022: if (bytes && length >= 1) *bytes = 0x95; return 1;
- case 0x2013: if (bytes && length >= 1) *bytes = 0x96; return 1;
- case 0x2014: if (bytes && length >= 1) *bytes = 0x97; return 1;
- case 0x02dc: if (bytes && length >= 1) *bytes = 0x98; return 1;
- case 0x2122: if (bytes && length >= 1) *bytes = 0x99; return 1;
- case 0x0161: if (bytes && length >= 1) *bytes = 0x9a; return 1;
- case 0x203a: if (bytes && length >= 1) *bytes = 0x9b; return 1;
- case 0x0153: if (bytes && length >= 1) *bytes = 0x9c; return 1;
- case 0x017e: if (bytes && length >= 1) *bytes = 0x9e; return 1;
- case 0x0178: if (bytes && length >= 1) *bytes = 0x9f; return 1;
- default: return 0;
- }
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/WindowsConsoleChannel.cpp b/Utilities/Poco/Foundation/src/WindowsConsoleChannel.cpp
deleted file mode 100755
index 15a9841433..0000000000
--- a/Utilities/Poco/Foundation/src/WindowsConsoleChannel.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// WindowsConsoleChannel.cpp
-//
-// $Id$
-//
-// Library: Foundation
-// Package: Logging
-// Module: WindowsConsoleChannel
-//
-// Copyright (c) 2007, 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/WindowsConsoleChannel.h"
-#include "Poco/Message.h"
-#if defined(POCO_WIN32_UTF8)
-#include "Poco/UnicodeConverter.h"
-#endif
-
-
-namespace Poco {
-
-
-WindowsConsoleChannel::WindowsConsoleChannel():
- _isFile(false),
- _hConsole(INVALID_HANDLE_VALUE)
-{
- _hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
- // check whether the console has been redirected
- DWORD mode;
- _isFile = (GetConsoleMode(_hConsole, &mode) == 0);
-}
-
-
-WindowsConsoleChannel::~WindowsConsoleChannel()
-{
-}
-
-
-void WindowsConsoleChannel::log(const Message& msg)
-{
- std::string text = msg.getText();
- text += "\r\n";
-
-#if defined(POCO_WIN32_UTF8)
- if (_isFile)
- {
- DWORD written;
- WriteFile(_hConsole, text.data(), text.size(), &written, NULL);
- }
- else
- {
- std::wstring utext;
- UnicodeConverter::toUTF16(text, utext);
- DWORD written;
- WriteConsoleW(_hConsole, utext.data(), utext.size(), &written, NULL);
- }
-#else
- DWORD written;
- WriteFile(_hConsole, text.data(), text.size(), &written, NULL);
-#endif
-}
-
-
-} // namespace Poco
diff --git a/Utilities/Poco/Foundation/src/adler32.c b/Utilities/Poco/Foundation/src/adler32.c
deleted file mode 100755
index 007ba26277..0000000000
--- a/Utilities/Poco/Foundation/src/adler32.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2004 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#define ZLIB_INTERNAL
-#include "zlib.h"
-
-#define BASE 65521UL /* largest prime smaller than 65536 */
-#define NMAX 5552
-/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
-
-#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
-#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
-#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
-#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
-#define DO16(buf) DO8(buf,0); DO8(buf,8);
-
-/* use NO_DIVIDE if your processor does not do division in hardware */
-#ifdef NO_DIVIDE
-# define MOD(a) \
- do { \
- if (a >= (BASE << 16)) a -= (BASE << 16); \
- if (a >= (BASE << 15)) a -= (BASE << 15); \
- if (a >= (BASE << 14)) a -= (BASE << 14); \
- if (a >= (BASE << 13)) a -= (BASE << 13); \
- if (a >= (BASE << 12)) a -= (BASE << 12); \
- if (a >= (BASE << 11)) a -= (BASE << 11); \
- if (a >= (BASE << 10)) a -= (BASE << 10); \
- if (a >= (BASE << 9)) a -= (BASE << 9); \
- if (a >= (BASE << 8)) a -= (BASE << 8); \
- if (a >= (BASE << 7)) a -= (BASE << 7); \
- if (a >= (BASE << 6)) a -= (BASE << 6); \
- if (a >= (BASE << 5)) a -= (BASE << 5); \
- if (a >= (BASE << 4)) a -= (BASE << 4); \
- if (a >= (BASE << 3)) a -= (BASE << 3); \
- if (a >= (BASE << 2)) a -= (BASE << 2); \
- if (a >= (BASE << 1)) a -= (BASE << 1); \
- if (a >= BASE) a -= BASE; \
- } while (0)
-# define MOD4(a) \
- do { \
- if (a >= (BASE << 4)) a -= (BASE << 4); \
- if (a >= (BASE << 3)) a -= (BASE << 3); \
- if (a >= (BASE << 2)) a -= (BASE << 2); \
- if (a >= (BASE << 1)) a -= (BASE << 1); \
- if (a >= BASE) a -= BASE; \
- } while (0)
-#else
-# define MOD(a) a %= BASE
-# define MOD4(a) a %= BASE
-#endif
-
-/* ========================================================================= */
-uLong ZEXPORT adler32(adler, buf, len)
- uLong adler;
- const Bytef *buf;
- uInt len;
-{
- unsigned long sum2;
- unsigned n;
-
- /* split Adler-32 into component sums */
- sum2 = (adler >> 16) & 0xffff;
- adler &= 0xffff;
-
- /* in case user likes doing a byte at a time, keep it fast */
- if (len == 1) {
- adler += buf[0];
- if (adler >= BASE)
- adler -= BASE;
- sum2 += adler;
- if (sum2 >= BASE)
- sum2 -= BASE;
- return adler | (sum2 << 16);
- }
-
- /* initial Adler-32 value (deferred check for len == 1 speed) */
- if (buf == Z_NULL)
- return 1L;
-
- /* in case short lengths are provided, keep it somewhat fast */
- if (len < 16) {
- while (len--) {
- adler += *buf++;
- sum2 += adler;
- }
- if (adler >= BASE)
- adler -= BASE;
- MOD4(sum2); /* only added so many BASE's */
- return adler | (sum2 << 16);
- }
-
- /* do length NMAX blocks -- requires just one modulo operation */
- while (len >= NMAX) {
- len -= NMAX;
- n = NMAX / 16; /* NMAX is divisible by 16 */
- do {
- DO16(buf); /* 16 sums unrolled */
- buf += 16;
- } while (--n);
- MOD(adler);
- MOD(sum2);
- }
-
- /* do remaining bytes (less than NMAX, still just one modulo) */
- if (len) { /* avoid modulos if none remaining */
- while (len >= 16) {
- len -= 16;
- DO16(buf);
- buf += 16;
- }
- while (len--) {
- adler += *buf++;
- sum2 += adler;
- }
- MOD(adler);
- MOD(sum2);
- }
-
- /* return recombined sums */
- return adler | (sum2 << 16);
-}
-
-/* ========================================================================= */
-uLong ZEXPORT adler32_combine(adler1, adler2, len2)
- uLong adler1;
- uLong adler2;
- z_off_t len2;
-{
- unsigned long sum1;
- unsigned long sum2;
- unsigned rem;
-
- /* the derivation of this formula is left as an exercise for the reader */
- rem = (unsigned)(len2 % BASE);
- sum1 = adler1 & 0xffff;
- sum2 = rem * sum1;
- MOD(sum2);
- sum1 += (adler2 & 0xffff) + BASE - 1;
- sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
- if (sum1 > BASE) sum1 -= BASE;
- if (sum1 > BASE) sum1 -= BASE;
- if (sum2 > (BASE << 1)) sum2 -= (BASE << 1);
- if (sum2 > BASE) sum2 -= BASE;
- return sum1 | (sum2 << 16);
-}
diff --git a/Utilities/Poco/Foundation/src/compress.c b/Utilities/Poco/Foundation/src/compress.c
deleted file mode 100755
index df04f0148e..0000000000
--- a/Utilities/Poco/Foundation/src/compress.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* compress.c -- compress a memory buffer
- * Copyright (C) 1995-2003 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#define ZLIB_INTERNAL
-#include "zlib.h"
-
-/* ===========================================================================
- Compresses the source buffer into the destination buffer. The level
- parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
- destination buffer, which must be at least 0.1% larger than sourceLen plus
- 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
-
- compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_BUF_ERROR if there was not enough room in the output buffer,
- Z_STREAM_ERROR if the level parameter is invalid.
-*/
-int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
- Bytef *dest;
- uLongf *destLen;
- const Bytef *source;
- uLong sourceLen;
- int level;
-{
- z_stream stream;
- int err;
-
- stream.next_in = (Bytef*)source;
- stream.avail_in = (uInt)sourceLen;
-#ifdef MAXSEG_64K
- /* Check for source > 64K on 16-bit machine: */
- if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
-#endif
- stream.next_out = dest;
- stream.avail_out = (uInt)*destLen;
- if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
-
- stream.zalloc = (alloc_func)0;
- stream.zfree = (free_func)0;
- stream.opaque = (voidpf)0;
-
- err = deflateInit(&stream, level);
- if (err != Z_OK) return err;
-
- err = deflate(&stream, Z_FINISH);
- if (err != Z_STREAM_END) {
- deflateEnd(&stream);
- return err == Z_OK ? Z_BUF_ERROR : err;
- }
- *destLen = stream.total_out;
-
- err = deflateEnd(&stream);
- return err;
-}
-
-/* ===========================================================================
- */
-int ZEXPORT compress (dest, destLen, source, sourceLen)
- Bytef *dest;
- uLongf *destLen;
- const Bytef *source;
- uLong sourceLen;
-{
- return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
-}
-
-/* ===========================================================================
- If the default memLevel or windowBits for deflateInit() is changed, then
- this function needs to be updated.
- */
-uLong ZEXPORT compressBound (sourceLen)
- uLong sourceLen;
-{
- return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11;
-}
diff --git a/Utilities/Poco/Foundation/src/crc32.c b/Utilities/Poco/Foundation/src/crc32.c
deleted file mode 100755
index f658a9ef55..0000000000
--- a/Utilities/Poco/Foundation/src/crc32.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2005 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
- * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
- * tables for updating the shift register in one step with three exclusive-ors
- * instead of four steps with four exclusive-ors. This results in about a
- * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
- */
-
-/* @(#) $Id$ */
-
-/*
- Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
- protection on the static variables used to control the first-use generation
- of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
- first call get_crc_table() to initialize the tables before allowing more than
- one thread to use crc32().
- */
-
-#ifdef MAKECRCH
-# include <stdio.h>
-# ifndef DYNAMIC_CRC_TABLE
-# define DYNAMIC_CRC_TABLE
-# endif /* !DYNAMIC_CRC_TABLE */
-#endif /* MAKECRCH */
-
-#include "zutil.h" /* for STDC and FAR definitions */
-
-#define local static
-
-/* Find a four-byte integer type for crc32_little() and crc32_big(). */
-#ifndef NOBYFOUR
-# ifdef STDC /* need ANSI C limits.h to determine sizes */
-# include <limits.h>
-# define BYFOUR
-# if (UINT_MAX == 0xffffffffUL)
- typedef unsigned int u4;
-# else
-# if (ULONG_MAX == 0xffffffffUL)
- typedef unsigned long u4;
-# else
-# if (USHRT_MAX == 0xffffffffUL)
- typedef unsigned short u4;
-# else
-# undef BYFOUR /* can't find a four-byte integer type! */
-# endif
-# endif
-# endif
-# endif /* STDC */
-#endif /* !NOBYFOUR */
-
-/* Definitions for doing the crc four data bytes at a time. */
-#ifdef BYFOUR
-# define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \
- (((w)&0xff00)<<8)+(((w)&0xff)<<24))
- local unsigned long crc32_little OF((unsigned long,
- const unsigned char FAR *, unsigned));
- local unsigned long crc32_big OF((unsigned long,
- const unsigned char FAR *, unsigned));
-# define TBLS 8
-#else
-# define TBLS 1
-#endif /* BYFOUR */
-
-/* Local functions for crc concatenation */
-local unsigned long gf2_matrix_times OF((unsigned long *mat,
- unsigned long vec));
-local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
-
-#ifdef DYNAMIC_CRC_TABLE
-
-local volatile int crc_table_empty = 1;
-local unsigned long FAR crc_table[TBLS][256];
-local void make_crc_table OF((void));
-#ifdef MAKECRCH
- local void write_table OF((FILE *, const unsigned long FAR *));
-#endif /* MAKECRCH */
-/*
- Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
- x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
-
- Polynomials over GF(2) are represented in binary, one bit per coefficient,
- with the lowest powers in the most significant bit. Then adding polynomials
- is just exclusive-or, and multiplying a polynomial by x is a right shift by
- one. If we call the above polynomial p, and represent a byte as the
- polynomial q, also with the lowest power in the most significant bit (so the
- byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
- where a mod b means the remainder after dividing a by b.
-
- This calculation is done using the shift-register method of multiplying and
- taking the remainder. The register is initialized to zero, and for each
- incoming bit, x^32 is added mod p to the register if the bit is a one (where
- x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
- x (which is shifting right by one and adding x^32 mod p if the bit shifted
- out is a one). We start with the highest power (least significant bit) of
- q and repeat for all eight bits of q.
-
- The first table is simply the CRC of all possible eight bit values. This is
- all the information needed to generate CRCs on data a byte at a time for all
- combinations of CRC register values and incoming bytes. The remaining tables
- allow for word-at-a-time CRC calculation for both big-endian and little-
- endian machines, where a word is four bytes.
-*/
-local void make_crc_table()
-{
- unsigned long c;
- int n, k;
- unsigned long poly; /* polynomial exclusive-or pattern */
- /* terms of polynomial defining this crc (except x^32): */
- static volatile int first = 1; /* flag to limit concurrent making */
- static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
-
- /* See if another task is already doing this (not thread-safe, but better
- than nothing -- significantly reduces duration of vulnerability in
- case the advice about DYNAMIC_CRC_TABLE is ignored) */
- if (first) {
- first = 0;
-
- /* make exclusive-or pattern from polynomial (0xedb88320UL) */
- poly = 0UL;
- for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
- poly |= 1UL << (31 - p[n]);
-
- /* generate a crc for every 8-bit value */
- for (n = 0; n < 256; n++) {
- c = (unsigned long)n;
- for (k = 0; k < 8; k++)
- c = c & 1 ? poly ^ (c >> 1) : c >> 1;
- crc_table[0][n] = c;
- }
-
-#ifdef BYFOUR
- /* generate crc for each value followed by one, two, and three zeros,
- and then the byte reversal of those as well as the first table */
- for (n = 0; n < 256; n++) {
- c = crc_table[0][n];
- crc_table[4][n] = REV(c);
- for (k = 1; k < 4; k++) {
- c = crc_table[0][c & 0xff] ^ (c >> 8);
- crc_table[k][n] = c;
- crc_table[k + 4][n] = REV(c);
- }
- }
-#endif /* BYFOUR */
-
- crc_table_empty = 0;
- }
- else { /* not first */
- /* wait for the other guy to finish (not efficient, but rare) */
- while (crc_table_empty)
- ;
- }
-
-#ifdef MAKECRCH
- /* write out CRC tables to crc32.h */
- {
- FILE *out;
-
- out = fopen("crc32.h", "w");
- if (out == NULL) return;
- fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
- fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
- fprintf(out, "local const unsigned long FAR ");
- fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
- write_table(out, crc_table[0]);
-# ifdef BYFOUR
- fprintf(out, "#ifdef BYFOUR\n");
- for (k = 1; k < 8; k++) {
- fprintf(out, " },\n {\n");
- write_table(out, crc_table[k]);
- }
- fprintf(out, "#endif\n");
-# endif /* BYFOUR */
- fprintf(out, " }\n};\n");
- fclose(out);
- }
-#endif /* MAKECRCH */
-}
-
-#ifdef MAKECRCH
-local void write_table(out, table)
- FILE *out;
- const unsigned long FAR *table;
-{
- int n;
-
- for (n = 0; n < 256; n++)
- fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n],
- n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
-}
-#endif /* MAKECRCH */
-
-#else /* !DYNAMIC_CRC_TABLE */
-/* ========================================================================
- * Tables of CRC-32s of all single-byte values, made by make_crc_table().
- */
-#include "crc32.h"
-#endif /* DYNAMIC_CRC_TABLE */
-
-/* =========================================================================
- * This function can be used by asm versions of crc32()
- */
-const unsigned long FAR * ZEXPORT get_crc_table()
-{
-#ifdef DYNAMIC_CRC_TABLE
- if (crc_table_empty)
- make_crc_table();
-#endif /* DYNAMIC_CRC_TABLE */
- return (const unsigned long FAR *)crc_table;
-}
-
-/* ========================================================================= */
-#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
-#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
-
-/* ========================================================================= */
-unsigned long ZEXPORT crc32(crc, buf, len)
- unsigned long crc;
- const unsigned char FAR *buf;
- unsigned len;
-{
- if (buf == Z_NULL) return 0UL;
-
-#ifdef DYNAMIC_CRC_TABLE
- if (crc_table_empty)
- make_crc_table();
-#endif /* DYNAMIC_CRC_TABLE */
-
-#ifdef BYFOUR
- if (sizeof(void *) == sizeof(ptrdiff_t)) {
- u4 endian;
-
- endian = 1;
- if (*((unsigned char *)(&endian)))
- return crc32_little(crc, buf, len);
- else
- return crc32_big(crc, buf, len);
- }
-#endif /* BYFOUR */
- crc = crc ^ 0xffffffffUL;
- while (len >= 8) {
- DO8;
- len -= 8;
- }
- if (len) do {
- DO1;
- } while (--len);
- return crc ^ 0xffffffffUL;
-}
-
-#ifdef BYFOUR
-
-/* ========================================================================= */
-#define DOLIT4 c ^= *buf4++; \
- c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
- crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
-#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
-
-/* ========================================================================= */
-local unsigned long crc32_little(crc, buf, len)
- unsigned long crc;
- const unsigned char FAR *buf;
- unsigned len;
-{
- register u4 c;
- register const u4 FAR *buf4;
-
- c = (u4)crc;
- c = ~c;
- while (len && ((ptrdiff_t)buf & 3)) {
- c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
- len--;
- }
-
- buf4 = (const u4 FAR *)(const void FAR *)buf;
- while (len >= 32) {
- DOLIT32;
- len -= 32;
- }
- while (len >= 4) {
- DOLIT4;
- len -= 4;
- }
- buf = (const unsigned char FAR *)buf4;
-
- if (len) do {
- c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
- } while (--len);
- c = ~c;
- return (unsigned long)c;
-}
-
-/* ========================================================================= */
-#define DOBIG4 c ^= *++buf4; \
- c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
- crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
-#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
-
-/* ========================================================================= */
-local unsigned long crc32_big(crc, buf, len)
- unsigned long crc;
- const unsigned char FAR *buf;
- unsigned len;
-{
- register u4 c;
- register const u4 FAR *buf4;
-
- c = REV((u4)crc);
- c = ~c;
- while (len && ((ptrdiff_t)buf & 3)) {
- c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
- len--;
- }
-
- buf4 = (const u4 FAR *)(const void FAR *)buf;
- buf4--;
- while (len >= 32) {
- DOBIG32;
- len -= 32;
- }
- while (len >= 4) {
- DOBIG4;
- len -= 4;
- }
- buf4++;
- buf = (const unsigned char FAR *)buf4;
-
- if (len) do {
- c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
- } while (--len);
- c = ~c;
- return (unsigned long)(REV(c));
-}
-
-#endif /* BYFOUR */
-
-#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */
-
-/* ========================================================================= */
-local unsigned long gf2_matrix_times(mat, vec)
- unsigned long *mat;
- unsigned long vec;
-{
- unsigned long sum;
-
- sum = 0;
- while (vec) {
- if (vec & 1)
- sum ^= *mat;
- vec >>= 1;
- mat++;
- }
- return sum;
-}
-
-/* ========================================================================= */
-local void gf2_matrix_square(square, mat)
- unsigned long *square;
- unsigned long *mat;
-{
- int n;
-
- for (n = 0; n < GF2_DIM; n++)
- square[n] = gf2_matrix_times(mat, mat[n]);
-}
-
-/* ========================================================================= */
-uLong ZEXPORT crc32_combine(crc1, crc2, len2)
- uLong crc1;
- uLong crc2;
- z_off_t len2;
-{
- int n;
- unsigned long row;
- unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */
- unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */
-
- /* degenerate case */
- if (len2 == 0)
- return crc1;
-
- /* put operator for one zero bit in odd */
- odd[0] = 0xedb88320L; /* CRC-32 polynomial */
- row = 1;
- for (n = 1; n < GF2_DIM; n++) {
- odd[n] = row;
- row <<= 1;
- }
-
- /* put operator for two zero bits in even */
- gf2_matrix_square(even, odd);
-
- /* put operator for four zero bits in odd */
- gf2_matrix_square(odd, even);
-
- /* apply len2 zeros to crc1 (first square will put the operator for one
- zero byte, eight zero bits, in even) */
- do {
- /* apply zeros operator for this bit of len2 */
- gf2_matrix_square(even, odd);
- if (len2 & 1)
- crc1 = gf2_matrix_times(even, crc1);
- len2 >>= 1;
-
- /* if no more bits set, then done */
- if (len2 == 0)
- break;
-
- /* another iteration of the loop with odd and even swapped */
- gf2_matrix_square(odd, even);
- if (len2 & 1)
- crc1 = gf2_matrix_times(odd, crc1);
- len2 >>= 1;
-
- /* if no more bits set, then done */
- } while (len2 != 0);
-
- /* return combined crc */
- crc1 ^= crc2;
- return crc1;
-}
diff --git a/Utilities/Poco/Foundation/src/crc32.h b/Utilities/Poco/Foundation/src/crc32.h
deleted file mode 100755
index 8053b6117c..0000000000
--- a/Utilities/Poco/Foundation/src/crc32.h
+++ /dev/null
@@ -1,441 +0,0 @@
-/* crc32.h -- tables for rapid CRC calculation
- * Generated automatically by crc32.c
- */
-
-local const unsigned long FAR crc_table[TBLS][256] =
-{
- {
- 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
- 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
- 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
- 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
- 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
- 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
- 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
- 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
- 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
- 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
- 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
- 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
- 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
- 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
- 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
- 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
- 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
- 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
- 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
- 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
- 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
- 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
- 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
- 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
- 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
- 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
- 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
- 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
- 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
- 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
- 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
- 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
- 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
- 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
- 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
- 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
- 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
- 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
- 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
- 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
- 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
- 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
- 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
- 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
- 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
- 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
- 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
- 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
- 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
- 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
- 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
- 0x2d02ef8dUL
-#ifdef BYFOUR
- },
- {
- 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
- 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
- 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
- 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
- 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
- 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
- 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
- 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
- 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
- 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
- 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
- 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
- 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
- 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
- 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
- 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
- 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
- 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
- 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
- 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
- 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
- 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
- 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
- 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
- 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
- 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
- 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
- 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
- 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
- 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
- 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
- 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
- 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
- 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
- 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
- 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
- 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
- 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
- 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
- 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
- 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
- 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
- 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
- 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
- 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
- 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
- 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
- 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
- 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
- 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
- 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
- 0x9324fd72UL
- },
- {
- 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
- 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
- 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
- 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
- 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
- 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
- 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
- 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
- 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
- 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
- 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
- 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
- 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
- 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
- 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
- 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
- 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
- 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
- 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
- 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
- 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
- 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
- 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
- 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
- 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
- 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
- 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
- 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
- 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
- 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
- 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
- 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
- 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
- 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
- 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
- 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
- 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
- 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
- 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
- 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
- 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
- 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
- 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
- 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
- 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
- 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
- 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
- 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
- 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
- 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
- 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
- 0xbe9834edUL
- },
- {
- 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
- 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
- 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
- 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
- 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
- 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
- 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
- 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
- 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
- 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
- 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
- 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
- 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
- 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
- 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
- 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
- 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
- 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
- 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
- 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
- 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
- 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
- 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
- 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
- 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
- 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
- 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
- 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
- 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
- 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
- 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
- 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
- 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
- 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
- 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
- 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
- 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
- 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
- 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
- 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
- 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
- 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
- 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
- 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
- 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
- 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
- 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
- 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
- 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
- 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
- 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
- 0xde0506f1UL
- },
- {
- 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
- 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
- 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
- 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
- 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
- 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
- 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
- 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
- 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
- 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
- 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
- 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
- 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
- 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
- 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
- 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
- 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
- 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
- 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
- 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
- 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
- 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
- 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
- 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
- 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
- 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
- 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
- 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
- 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
- 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
- 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
- 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
- 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
- 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
- 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
- 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
- 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
- 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
- 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
- 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
- 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
- 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
- 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
- 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
- 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
- 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
- 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
- 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
- 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
- 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
- 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
- 0x8def022dUL
- },
- {
- 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
- 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
- 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
- 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
- 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
- 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
- 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
- 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
- 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
- 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
- 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
- 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
- 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
- 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
- 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
- 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
- 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
- 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
- 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
- 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
- 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
- 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
- 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
- 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
- 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
- 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
- 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
- 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
- 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
- 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
- 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
- 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
- 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
- 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
- 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
- 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
- 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
- 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
- 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
- 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
- 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
- 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
- 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
- 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
- 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
- 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
- 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
- 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
- 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
- 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
- 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
- 0x72fd2493UL
- },
- {
- 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
- 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
- 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
- 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
- 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
- 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
- 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
- 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
- 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
- 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
- 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
- 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
- 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
- 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
- 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
- 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
- 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
- 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
- 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
- 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
- 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
- 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
- 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
- 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
- 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
- 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
- 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
- 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
- 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
- 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
- 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
- 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
- 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
- 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
- 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
- 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
- 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
- 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
- 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
- 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
- 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
- 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
- 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
- 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
- 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
- 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
- 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
- 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
- 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
- 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
- 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
- 0xed3498beUL
- },
- {
- 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
- 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
- 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
- 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
- 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
- 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
- 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
- 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
- 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
- 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
- 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
- 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
- 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
- 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
- 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
- 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
- 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
- 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
- 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
- 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
- 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
- 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
- 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
- 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
- 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
- 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
- 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
- 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
- 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
- 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
- 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
- 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
- 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
- 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
- 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
- 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
- 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
- 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
- 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
- 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
- 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
- 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
- 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
- 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
- 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
- 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
- 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
- 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
- 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
- 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
- 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
- 0xf10605deUL
-#endif
- }
-};
diff --git a/Utilities/Poco/Foundation/src/deflate.c b/Utilities/Poco/Foundation/src/deflate.c
deleted file mode 100755
index 29ce1f64a5..0000000000
--- a/Utilities/Poco/Foundation/src/deflate.c
+++ /dev/null
@@ -1,1736 +0,0 @@
-/* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
- * ALGORITHM
- *
- * The "deflation" process depends on being able to identify portions
- * of the input text which are identical to earlier input (within a
- * sliding window trailing behind the input currently being processed).
- *
- * The most straightforward technique turns out to be the fastest for
- * most input files: try all possible matches and select the longest.
- * The key feature of this algorithm is that insertions into the string
- * dictionary are very simple and thus fast, and deletions are avoided
- * completely. Insertions are performed at each input character, whereas
- * string matches are performed only when the previous match ends. So it
- * is preferable to spend more time in matches to allow very fast string
- * insertions and avoid deletions. The matching algorithm for small
- * strings is inspired from that of Rabin & Karp. A brute force approach
- * is used to find longer strings when a small match has been found.
- * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
- * (by Leonid Broukhis).
- * A previous version of this file used a more sophisticated algorithm
- * (by Fiala and Greene) which is guaranteed to run in linear amortized
- * time, but has a larger average cost, uses more memory and is patented.
- * However the F&G algorithm may be faster for some highly redundant
- * files if the parameter max_chain_length (described below) is too large.
- *
- * ACKNOWLEDGEMENTS
- *
- * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
- * I found it in 'freeze' written by Leonid Broukhis.
- * Thanks to many people for bug reports and testing.
- *
- * REFERENCES
- *
- * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
- * Available in http://www.ietf.org/rfc/rfc1951.txt
- *
- * A description of the Rabin and Karp algorithm is given in the book
- * "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
- *
- * Fiala,E.R., and Greene,D.H.
- * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
- *
- */
-
-/* @(#) $Id$ */
-
-#include "deflate.h"
-
-const char deflate_copyright[] =
- " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly ";
-/*
- If you use the zlib library in a product, an acknowledgment is welcome
- in the documentation of your product. If for some reason you cannot
- include such an acknowledgment, I would appreciate that you keep this
- copyright string in the executable of your product.
- */
-
-/* ===========================================================================
- * Function prototypes.
- */
-typedef enum {
- need_more, /* block not completed, need more input or more output */
- block_done, /* block flush performed */
- finish_started, /* finish started, need only more output at next deflate */
- finish_done /* finish done, accept no more input or output */
-} block_state;
-
-typedef block_state (*compress_func) OF((deflate_state *s, int flush));
-/* Compression function. Returns the block state after the call. */
-
-local void fill_window OF((deflate_state *s));
-local block_state deflate_stored OF((deflate_state *s, int flush));
-local block_state deflate_fast OF((deflate_state *s, int flush));
-#ifndef FASTEST
-local block_state deflate_slow OF((deflate_state *s, int flush));
-#endif
-local void lm_init OF((deflate_state *s));
-local void putShortMSB OF((deflate_state *s, uInt b));
-local void flush_pending OF((z_streamp strm));
-local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
-#ifndef FASTEST
-#ifdef ASMV
- void match_init OF((void)); /* asm code initialization */
- uInt longest_match OF((deflate_state *s, IPos cur_match));
-#else
-local uInt longest_match OF((deflate_state *s, IPos cur_match));
-#endif
-#endif
-local uInt longest_match_fast OF((deflate_state *s, IPos cur_match));
-
-#ifdef DEBUG
-local void check_match OF((deflate_state *s, IPos start, IPos match,
- int length));
-#endif
-
-/* ===========================================================================
- * Local data
- */
-
-#define NIL 0
-/* Tail of hash chains */
-
-#ifndef TOO_FAR
-# define TOO_FAR 4096
-#endif
-/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
-
-#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
-/* Minimum amount of lookahead, except at the end of the input file.
- * See deflate.c for comments about the MIN_MATCH+1.
- */
-
-/* Values for max_lazy_match, good_match and max_chain_length, depending on
- * the desired pack level (0..9). The values given below have been tuned to
- * exclude worst case performance for pathological files. Better values may be
- * found for specific files.
- */
-typedef struct config_s {
- ush good_length; /* reduce lazy search above this match length */
- ush max_lazy; /* do not perform lazy search above this match length */
- ush nice_length; /* quit search above this match length */
- ush max_chain;
- compress_func func;
-} config;
-
-#ifdef FASTEST
-local const config configuration_table[2] = {
-/* good lazy nice chain */
-/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
-/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */
-#else
-local const config configuration_table[10] = {
-/* good lazy nice chain */
-/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
-/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */
-/* 2 */ {4, 5, 16, 8, deflate_fast},
-/* 3 */ {4, 6, 32, 32, deflate_fast},
-
-/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */
-/* 5 */ {8, 16, 32, 32, deflate_slow},
-/* 6 */ {8, 16, 128, 128, deflate_slow},
-/* 7 */ {8, 32, 128, 256, deflate_slow},
-/* 8 */ {32, 128, 258, 1024, deflate_slow},
-/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */
-#endif
-
-/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
- * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
- * meaning.
- */
-
-#define EQUAL 0
-/* result of memcmp for equal strings */
-
-#ifndef NO_DUMMY_DECL
-struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
-#endif
-
-/* ===========================================================================
- * Update a hash value with the given input byte
- * IN assertion: all calls to to UPDATE_HASH are made with consecutive
- * input characters, so that a running hash key can be computed from the
- * previous key instead of complete recalculation each time.
- */
-#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
-
-
-/* ===========================================================================
- * Insert string str in the dictionary and set match_head to the previous head
- * of the hash chain (the most recent string with same hash key). Return
- * the previous length of the hash chain.
- * If this file is compiled with -DFASTEST, the compression level is forced
- * to 1, and no hash chains are maintained.
- * IN assertion: all calls to to INSERT_STRING are made with consecutive
- * input characters and the first MIN_MATCH bytes of str are valid
- * (except for the last MIN_MATCH-1 bytes of the input file).
- */
-#ifdef FASTEST
-#define INSERT_STRING(s, str, match_head) \
- (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
- match_head = s->head[s->ins_h], \
- s->head[s->ins_h] = (Pos)(str))
-#else
-#define INSERT_STRING(s, str, match_head) \
- (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
- match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
- s->head[s->ins_h] = (Pos)(str))
-#endif
-
-/* ===========================================================================
- * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
- * prev[] will be initialized on the fly.
- */
-#define CLEAR_HASH(s) \
- s->head[s->hash_size-1] = NIL; \
- zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
-
-/* ========================================================================= */
-int ZEXPORT deflateInit_(strm, level, version, stream_size)
- z_streamp strm;
- int level;
- const char *version;
- int stream_size;
-{
- return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
- Z_DEFAULT_STRATEGY, version, stream_size);
- /* To do: ignore strm->next_in if we use it as window */
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
- version, stream_size)
- z_streamp strm;
- int level;
- int method;
- int windowBits;
- int memLevel;
- int strategy;
- const char *version;
- int stream_size;
-{
- deflate_state *s;
- int wrap = 1;
- static const char my_version[] = ZLIB_VERSION;
-
- ushf *overlay;
- /* We overlay pending_buf and d_buf+l_buf. This works since the average
- * output size for (length,distance) codes is <= 24 bits.
- */
-
- if (version == Z_NULL || version[0] != my_version[0] ||
- stream_size != sizeof(z_stream)) {
- return Z_VERSION_ERROR;
- }
- if (strm == Z_NULL) return Z_STREAM_ERROR;
-
- strm->msg = Z_NULL;
- if (strm->zalloc == (alloc_func)0) {
- strm->zalloc = zcalloc;
- strm->opaque = (voidpf)0;
- }
- if (strm->zfree == (free_func)0) strm->zfree = zcfree;
-
-#ifdef FASTEST
- if (level != 0) level = 1;
-#else
- if (level == Z_DEFAULT_COMPRESSION) level = 6;
-#endif
-
- if (windowBits < 0) { /* suppress zlib wrapper */
- wrap = 0;
- windowBits = -windowBits;
- }
-#ifdef GZIP
- else if (windowBits > 15) {
- wrap = 2; /* write gzip wrapper instead */
- windowBits -= 16;
- }
-#endif
- if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
- windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
- strategy < 0 || strategy > Z_FIXED) {
- return Z_STREAM_ERROR;
- }
- if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */
- s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
- if (s == Z_NULL) return Z_MEM_ERROR;
- strm->state = (struct internal_state FAR *)s;
- s->strm = strm;
-
- s->wrap = wrap;
- s->gzhead = Z_NULL;
- s->w_bits = windowBits;
- s->w_size = 1 << s->w_bits;
- s->w_mask = s->w_size - 1;
-
- s->hash_bits = memLevel + 7;
- s->hash_size = 1 << s->hash_bits;
- s->hash_mask = s->hash_size - 1;
- s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
-
- s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
- s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
- s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
-
- s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
-
- overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
- s->pending_buf = (uchf *) overlay;
- s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
-
- if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
- s->pending_buf == Z_NULL) {
- s->status = FINISH_STATE;
- strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
- deflateEnd (strm);
- return Z_MEM_ERROR;
- }
- s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
- s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
-
- s->level = level;
- s->strategy = strategy;
- s->method = (Byte)method;
-
- return deflateReset(strm);
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
- z_streamp strm;
- const Bytef *dictionary;
- uInt dictLength;
-{
- deflate_state *s;
- uInt length = dictLength;
- uInt n;
- IPos hash_head = 0;
-
- if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
- strm->state->wrap == 2 ||
- (strm->state->wrap == 1 && strm->state->status != INIT_STATE))
- return Z_STREAM_ERROR;
-
- s = strm->state;
- if (s->wrap)
- strm->adler = adler32(strm->adler, dictionary, dictLength);
-
- if (length < MIN_MATCH) return Z_OK;
- if (length > MAX_DIST(s)) {
- length = MAX_DIST(s);
- dictionary += dictLength - length; /* use the tail of the dictionary */
- }
- zmemcpy(s->window, dictionary, length);
- s->strstart = length;
- s->block_start = (long)length;
-
- /* Insert all strings in the hash table (except for the last two bytes).
- * s->lookahead stays null, so s->ins_h will be recomputed at the next
- * call of fill_window.
- */
- s->ins_h = s->window[0];
- UPDATE_HASH(s, s->ins_h, s->window[1]);
- for (n = 0; n <= length - MIN_MATCH; n++) {
- INSERT_STRING(s, n, hash_head);
- }
- if (hash_head) hash_head = 0; /* to make compiler happy */
- return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateReset (strm)
- z_streamp strm;
-{
- deflate_state *s;
-
- if (strm == Z_NULL || strm->state == Z_NULL ||
- strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
- return Z_STREAM_ERROR;
- }
-
- strm->total_in = strm->total_out = 0;
- strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
- strm->data_type = Z_UNKNOWN;
-
- s = (deflate_state *)strm->state;
- s->pending = 0;
- s->pending_out = s->pending_buf;
-
- if (s->wrap < 0) {
- s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
- }
- s->status = s->wrap ? INIT_STATE : BUSY_STATE;
- strm->adler =
-#ifdef GZIP
- s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
-#endif
- adler32(0L, Z_NULL, 0);
- s->last_flush = Z_NO_FLUSH;
-
- _tr_init(s);
- lm_init(s);
-
- return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateSetHeader (strm, head)
- z_streamp strm;
- gz_headerp head;
-{
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- if (strm->state->wrap != 2) return Z_STREAM_ERROR;
- strm->state->gzhead = head;
- return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflatePrime (strm, bits, value)
- z_streamp strm;
- int bits;
- int value;
-{
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- strm->state->bi_valid = bits;
- strm->state->bi_buf = (ush)(value & ((1 << bits) - 1));
- return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateParams(strm, level, strategy)
- z_streamp strm;
- int level;
- int strategy;
-{
- deflate_state *s;
- compress_func func;
- int err = Z_OK;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- s = strm->state;
-
-#ifdef FASTEST
- if (level != 0) level = 1;
-#else
- if (level == Z_DEFAULT_COMPRESSION) level = 6;
-#endif
- if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
- return Z_STREAM_ERROR;
- }
- func = configuration_table[s->level].func;
-
- if (func != configuration_table[level].func && strm->total_in != 0) {
- /* Flush the last buffer: */
- err = deflate(strm, Z_PARTIAL_FLUSH);
- }
- if (s->level != level) {
- s->level = level;
- s->max_lazy_match = configuration_table[level].max_lazy;
- s->good_match = configuration_table[level].good_length;
- s->nice_match = configuration_table[level].nice_length;
- s->max_chain_length = configuration_table[level].max_chain;
- }
- s->strategy = strategy;
- return err;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
- z_streamp strm;
- int good_length;
- int max_lazy;
- int nice_length;
- int max_chain;
-{
- deflate_state *s;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- s = strm->state;
- s->good_match = good_length;
- s->max_lazy_match = max_lazy;
- s->nice_match = nice_length;
- s->max_chain_length = max_chain;
- return Z_OK;
-}
-
-/* =========================================================================
- * For the default windowBits of 15 and memLevel of 8, this function returns
- * a close to exact, as well as small, upper bound on the compressed size.
- * They are coded as constants here for a reason--if the #define's are
- * changed, then this function needs to be changed as well. The return
- * value for 15 and 8 only works for those exact settings.
- *
- * For any setting other than those defaults for windowBits and memLevel,
- * the value returned is a conservative worst case for the maximum expansion
- * resulting from using fixed blocks instead of stored blocks, which deflate
- * can emit on compressed data for some combinations of the parameters.
- *
- * This function could be more sophisticated to provide closer upper bounds
- * for every combination of windowBits and memLevel, as well as wrap.
- * But even the conservative upper bound of about 14% expansion does not
- * seem onerous for output buffer allocation.
- */
-uLong ZEXPORT deflateBound(strm, sourceLen)
- z_streamp strm;
- uLong sourceLen;
-{
- deflate_state *s;
- uLong destLen;
-
- /* conservative upper bound */
- destLen = sourceLen +
- ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11;
-
- /* if can't get parameters, return conservative bound */
- if (strm == Z_NULL || strm->state == Z_NULL)
- return destLen;
-
- /* if not default parameters, return conservative bound */
- s = strm->state;
- if (s->w_bits != 15 || s->hash_bits != 8 + 7)
- return destLen;
-
- /* default settings: return tight bound for that case */
- return compressBound(sourceLen);
-}
-
-/* =========================================================================
- * Put a short in the pending buffer. The 16-bit value is put in MSB order.
- * IN assertion: the stream state is correct and there is enough room in
- * pending_buf.
- */
-local void putShortMSB (s, b)
- deflate_state *s;
- uInt b;
-{
- put_byte(s, (Byte)(b >> 8));
- put_byte(s, (Byte)(b & 0xff));
-}
-
-/* =========================================================================
- * Flush as much pending output as possible. All deflate() output goes
- * through this function so some applications may wish to modify it
- * to avoid allocating a large strm->next_out buffer and copying into it.
- * (See also read_buf()).
- */
-local void flush_pending(strm)
- z_streamp strm;
-{
- unsigned len = strm->state->pending;
-
- if (len > strm->avail_out) len = strm->avail_out;
- if (len == 0) return;
-
- zmemcpy(strm->next_out, strm->state->pending_out, len);
- strm->next_out += len;
- strm->state->pending_out += len;
- strm->total_out += len;
- strm->avail_out -= len;
- strm->state->pending -= len;
- if (strm->state->pending == 0) {
- strm->state->pending_out = strm->state->pending_buf;
- }
-}
-
-/* ========================================================================= */
-int ZEXPORT deflate (strm, flush)
- z_streamp strm;
- int flush;
-{
- int old_flush; /* value of flush param for previous deflate call */
- deflate_state *s;
-
- if (strm == Z_NULL || strm->state == Z_NULL ||
- flush > Z_FINISH || flush < 0) {
- return Z_STREAM_ERROR;
- }
- s = strm->state;
-
- if (strm->next_out == Z_NULL ||
- (strm->next_in == Z_NULL && strm->avail_in != 0) ||
- (s->status == FINISH_STATE && flush != Z_FINISH)) {
- ERR_RETURN(strm, Z_STREAM_ERROR);
- }
- if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
-
- s->strm = strm; /* just in case */
- old_flush = s->last_flush;
- s->last_flush = flush;
-
- /* Write the header */
- if (s->status == INIT_STATE) {
-#ifdef GZIP
- if (s->wrap == 2) {
- strm->adler = crc32(0L, Z_NULL, 0);
- put_byte(s, 31);
- put_byte(s, 139);
- put_byte(s, 8);
- if (s->gzhead == NULL) {
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, s->level == 9 ? 2 :
- (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
- 4 : 0));
- put_byte(s, OS_CODE);
- s->status = BUSY_STATE;
- }
- else {
- put_byte(s, (s->gzhead->text ? 1 : 0) +
- (s->gzhead->hcrc ? 2 : 0) +
- (s->gzhead->extra == Z_NULL ? 0 : 4) +
- (s->gzhead->name == Z_NULL ? 0 : 8) +
- (s->gzhead->comment == Z_NULL ? 0 : 16)
- );
- put_byte(s, (Byte)(s->gzhead->time & 0xff));
- put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
- put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
- put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
- put_byte(s, s->level == 9 ? 2 :
- (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
- 4 : 0));
- put_byte(s, s->gzhead->os & 0xff);
- if (s->gzhead->extra != NULL) {
- put_byte(s, s->gzhead->extra_len & 0xff);
- put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
- }
- if (s->gzhead->hcrc)
- strm->adler = crc32(strm->adler, s->pending_buf,
- s->pending);
- s->gzindex = 0;
- s->status = EXTRA_STATE;
- }
- }
- else
-#endif
- {
- uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
- uInt level_flags;
-
- if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
- level_flags = 0;
- else if (s->level < 6)
- level_flags = 1;
- else if (s->level == 6)
- level_flags = 2;
- else
- level_flags = 3;
- header |= (level_flags << 6);
- if (s->strstart != 0) header |= PRESET_DICT;
- header += 31 - (header % 31);
-
- s->status = BUSY_STATE;
- putShortMSB(s, header);
-
- /* Save the adler32 of the preset dictionary: */
- if (s->strstart != 0) {
- putShortMSB(s, (uInt)(strm->adler >> 16));
- putShortMSB(s, (uInt)(strm->adler & 0xffff));
- }
- strm->adler = adler32(0L, Z_NULL, 0);
- }
- }
-#ifdef GZIP
- if (s->status == EXTRA_STATE) {
- if (s->gzhead->extra != NULL) {
- uInt beg = s->pending; /* start of bytes to update crc */
-
- while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
- if (s->pending == s->pending_buf_size) {
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- flush_pending(strm);
- beg = s->pending;
- if (s->pending == s->pending_buf_size)
- break;
- }
- put_byte(s, s->gzhead->extra[s->gzindex]);
- s->gzindex++;
- }
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- if (s->gzindex == s->gzhead->extra_len) {
- s->gzindex = 0;
- s->status = NAME_STATE;
- }
- }
- else
- s->status = NAME_STATE;
- }
- if (s->status == NAME_STATE) {
- if (s->gzhead->name != NULL) {
- uInt beg = s->pending; /* start of bytes to update crc */
- int val;
-
- do {
- if (s->pending == s->pending_buf_size) {
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- flush_pending(strm);
- beg = s->pending;
- if (s->pending == s->pending_buf_size) {
- val = 1;
- break;
- }
- }
- val = s->gzhead->name[s->gzindex++];
- put_byte(s, val);
- } while (val != 0);
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- if (val == 0) {
- s->gzindex = 0;
- s->status = COMMENT_STATE;
- }
- }
- else
- s->status = COMMENT_STATE;
- }
- if (s->status == COMMENT_STATE) {
- if (s->gzhead->comment != NULL) {
- uInt beg = s->pending; /* start of bytes to update crc */
- int val;
-
- do {
- if (s->pending == s->pending_buf_size) {
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- flush_pending(strm);
- beg = s->pending;
- if (s->pending == s->pending_buf_size) {
- val = 1;
- break;
- }
- }
- val = s->gzhead->comment[s->gzindex++];
- put_byte(s, val);
- } while (val != 0);
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- if (val == 0)
- s->status = HCRC_STATE;
- }
- else
- s->status = HCRC_STATE;
- }
- if (s->status == HCRC_STATE) {
- if (s->gzhead->hcrc) {
- if (s->pending + 2 > s->pending_buf_size)
- flush_pending(strm);
- if (s->pending + 2 <= s->pending_buf_size) {
- put_byte(s, (Byte)(strm->adler & 0xff));
- put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
- strm->adler = crc32(0L, Z_NULL, 0);
- s->status = BUSY_STATE;
- }
- }
- else
- s->status = BUSY_STATE;
- }
-#endif
-
- /* Flush as much pending output as possible */
- if (s->pending != 0) {
- flush_pending(strm);
- if (strm->avail_out == 0) {
- /* Since avail_out is 0, deflate will be called again with
- * more output space, but possibly with both pending and
- * avail_in equal to zero. There won't be anything to do,
- * but this is not an error situation so make sure we
- * return OK instead of BUF_ERROR at next call of deflate:
- */
- s->last_flush = -1;
- return Z_OK;
- }
-
- /* Make sure there is something to do and avoid duplicate consecutive
- * flushes. For repeated and useless calls with Z_FINISH, we keep
- * returning Z_STREAM_END instead of Z_BUF_ERROR.
- */
- } else if (strm->avail_in == 0 && flush <= old_flush &&
- flush != Z_FINISH) {
- ERR_RETURN(strm, Z_BUF_ERROR);
- }
-
- /* User must not provide more input after the first FINISH: */
- if (s->status == FINISH_STATE && strm->avail_in != 0) {
- ERR_RETURN(strm, Z_BUF_ERROR);
- }
-
- /* Start a new block or continue the current one.
- */
- if (strm->avail_in != 0 || s->lookahead != 0 ||
- (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
- block_state bstate;
-
- bstate = (*(configuration_table[s->level].func))(s, flush);
-
- if (bstate == finish_started || bstate == finish_done) {
- s->status = FINISH_STATE;
- }
- if (bstate == need_more || bstate == finish_started) {
- if (strm->avail_out == 0) {
- s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
- }
- return Z_OK;
- /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
- * of deflate should use the same flush parameter to make sure
- * that the flush is complete. So we don't have to output an
- * empty block here, this will be done at next call. This also
- * ensures that for a very small output buffer, we emit at most
- * one empty block.
- */
- }
- if (bstate == block_done) {
- if (flush == Z_PARTIAL_FLUSH) {
- _tr_align(s);
- } else { /* FULL_FLUSH or SYNC_FLUSH */
- _tr_stored_block(s, (char*)0, 0L, 0);
- /* For a full flush, this empty block will be recognized
- * as a special marker by inflate_sync().
- */
- if (flush == Z_FULL_FLUSH) {
- CLEAR_HASH(s); /* forget history */
- }
- }
- flush_pending(strm);
- if (strm->avail_out == 0) {
- s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
- return Z_OK;
- }
- }
- }
- Assert(strm->avail_out > 0, "bug2");
-
- if (flush != Z_FINISH) return Z_OK;
- if (s->wrap <= 0) return Z_STREAM_END;
-
- /* Write the trailer */
-#ifdef GZIP
- if (s->wrap == 2) {
- put_byte(s, (Byte)(strm->adler & 0xff));
- put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
- put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
- put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
- put_byte(s, (Byte)(strm->total_in & 0xff));
- put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
- put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
- put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
- }
- else
-#endif
- {
- putShortMSB(s, (uInt)(strm->adler >> 16));
- putShortMSB(s, (uInt)(strm->adler & 0xffff));
- }
- flush_pending(strm);
- /* If avail_out is zero, the application will call deflate again
- * to flush the rest.
- */
- if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
- return s->pending != 0 ? Z_OK : Z_STREAM_END;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateEnd (strm)
- z_streamp strm;
-{
- int status;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-
- status = strm->state->status;
- if (status != INIT_STATE &&
- status != EXTRA_STATE &&
- status != NAME_STATE &&
- status != COMMENT_STATE &&
- status != HCRC_STATE &&
- status != BUSY_STATE &&
- status != FINISH_STATE) {
- return Z_STREAM_ERROR;
- }
-
- /* Deallocate in reverse order of allocations: */
- TRY_FREE(strm, strm->state->pending_buf);
- TRY_FREE(strm, strm->state->head);
- TRY_FREE(strm, strm->state->prev);
- TRY_FREE(strm, strm->state->window);
-
- ZFREE(strm, strm->state);
- strm->state = Z_NULL;
-
- return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
-}
-
-/* =========================================================================
- * Copy the source state to the destination state.
- * To simplify the source, this is not supported for 16-bit MSDOS (which
- * doesn't have enough memory anyway to duplicate compression states).
- */
-int ZEXPORT deflateCopy (dest, source)
- z_streamp dest;
- z_streamp source;
-{
-#ifdef MAXSEG_64K
- return Z_STREAM_ERROR;
-#else
- deflate_state *ds;
- deflate_state *ss;
- ushf *overlay;
-
-
- if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
- return Z_STREAM_ERROR;
- }
-
- ss = source->state;
-
- zmemcpy(dest, source, sizeof(z_stream));
-
- ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
- if (ds == Z_NULL) return Z_MEM_ERROR;
- dest->state = (struct internal_state FAR *) ds;
- zmemcpy(ds, ss, sizeof(deflate_state));
- ds->strm = dest;
-
- ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
- ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
- ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
- overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
- ds->pending_buf = (uchf *) overlay;
-
- if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
- ds->pending_buf == Z_NULL) {
- deflateEnd (dest);
- return Z_MEM_ERROR;
- }
- /* following zmemcpy do not work for 16-bit MSDOS */
- zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
- zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
- zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
- zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
-
- ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
- ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
- ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
-
- ds->l_desc.dyn_tree = ds->dyn_ltree;
- ds->d_desc.dyn_tree = ds->dyn_dtree;
- ds->bl_desc.dyn_tree = ds->bl_tree;
-
- return Z_OK;
-#endif /* MAXSEG_64K */
-}
-
-/* ===========================================================================
- * Read a new buffer from the current input stream, update the adler32
- * and total number of bytes read. All deflate() input goes through
- * this function so some applications may wish to modify it to avoid
- * allocating a large strm->next_in buffer and copying from it.
- * (See also flush_pending()).
- */
-local int read_buf(strm, buf, size)
- z_streamp strm;
- Bytef *buf;
- unsigned size;
-{
- unsigned len = strm->avail_in;
-
- if (len > size) len = size;
- if (len == 0) return 0;
-
- strm->avail_in -= len;
-
- if (strm->state->wrap == 1) {
- strm->adler = adler32(strm->adler, strm->next_in, len);
- }
-#ifdef GZIP
- else if (strm->state->wrap == 2) {
- strm->adler = crc32(strm->adler, strm->next_in, len);
- }
-#endif
- zmemcpy(buf, strm->next_in, len);
- strm->next_in += len;
- strm->total_in += len;
-
- return (int)len;
-}
-
-/* ===========================================================================
- * Initialize the "longest match" routines for a new zlib stream
- */
-local void lm_init (s)
- deflate_state *s;
-{
- s->window_size = (ulg)2L*s->w_size;
-
- CLEAR_HASH(s);
-
- /* Set the default configuration parameters:
- */
- s->max_lazy_match = configuration_table[s->level].max_lazy;
- s->good_match = configuration_table[s->level].good_length;
- s->nice_match = configuration_table[s->level].nice_length;
- s->max_chain_length = configuration_table[s->level].max_chain;
-
- s->strstart = 0;
- s->block_start = 0L;
- s->lookahead = 0;
- s->match_length = s->prev_length = MIN_MATCH-1;
- s->match_available = 0;
- s->ins_h = 0;
-#ifndef FASTEST
-#ifdef ASMV
- match_init(); /* initialize the asm code */
-#endif
-#endif
-}
-
-#ifndef FASTEST
-/* ===========================================================================
- * Set match_start to the longest match starting at the given string and
- * return its length. Matches shorter or equal to prev_length are discarded,
- * in which case the result is equal to prev_length and match_start is
- * garbage.
- * IN assertions: cur_match is the head of the hash chain for the current
- * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
- * OUT assertion: the match length is not greater than s->lookahead.
- */
-#ifndef ASMV
-/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
- * match.S. The code will be functionally equivalent.
- */
-local uInt longest_match(s, cur_match)
- deflate_state *s;
- IPos cur_match; /* current match */
-{
- unsigned chain_length = s->max_chain_length;/* max hash chain length */
- register Bytef *scan = s->window + s->strstart; /* current string */
- register Bytef *match; /* matched string */
- register int len; /* length of current match */
- int best_len = s->prev_length; /* best match length so far */
- int nice_match = s->nice_match; /* stop if match long enough */
- IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
- s->strstart - (IPos)MAX_DIST(s) : NIL;
- /* Stop when cur_match becomes <= limit. To simplify the code,
- * we prevent matches with the string of window index 0.
- */
- Posf *prev = s->prev;
- uInt wmask = s->w_mask;
-
-#ifdef UNALIGNED_OK
- /* Compare two bytes at a time. Note: this is not always beneficial.
- * Try with and without -DUNALIGNED_OK to check.
- */
- register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
- register ush scan_start = *(ushf*)scan;
- register ush scan_end = *(ushf*)(scan+best_len-1);
-#else
- register Bytef *strend = s->window + s->strstart + MAX_MATCH;
- register Byte scan_end1 = scan[best_len-1];
- register Byte scan_end = scan[best_len];
-#endif
-
- /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
- * It is easy to get rid of this optimization if necessary.
- */
- Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
- /* Do not waste too much time if we already have a good match: */
- if (s->prev_length >= s->good_match) {
- chain_length >>= 2;
- }
- /* Do not look for matches beyond the end of the input. This is necessary
- * to make deflate deterministic.
- */
- if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
-
- Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
- do {
- Assert(cur_match < s->strstart, "no future");
- match = s->window + cur_match;
-
- /* Skip to next match if the match length cannot increase
- * or if the match length is less than 2. Note that the checks below
- * for insufficient lookahead only occur occasionally for performance
- * reasons. Therefore uninitialized memory will be accessed, and
- * conditional jumps will be made that depend on those values.
- * However the length of the match is limited to the lookahead, so
- * the output of deflate is not affected by the uninitialized values.
- */
-#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
- /* This code assumes sizeof(unsigned short) == 2. Do not use
- * UNALIGNED_OK if your compiler uses a different size.
- */
- if (*(ushf*)(match+best_len-1) != scan_end ||
- *(ushf*)match != scan_start) continue;
-
- /* It is not necessary to compare scan[2] and match[2] since they are
- * always equal when the other bytes match, given that the hash keys
- * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
- * strstart+3, +5, ... up to strstart+257. We check for insufficient
- * lookahead only every 4th comparison; the 128th check will be made
- * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
- * necessary to put more guard bytes at the end of the window, or
- * to check more often for insufficient lookahead.
- */
- Assert(scan[2] == match[2], "scan[2]?");
- scan++, match++;
- do {
- } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- scan < strend);
- /* The funny "do {}" generates better code on most compilers */
-
- /* Here, scan <= window+strstart+257 */
- Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
- if (*scan == *match) scan++;
-
- len = (MAX_MATCH - 1) - (int)(strend-scan);
- scan = strend - (MAX_MATCH-1);
-
-#else /* UNALIGNED_OK */
-
- if (match[best_len] != scan_end ||
- match[best_len-1] != scan_end1 ||
- *match != *scan ||
- *++match != scan[1]) continue;
-
- /* The check at best_len-1 can be removed because it will be made
- * again later. (This heuristic is not always a win.)
- * It is not necessary to compare scan[2] and match[2] since they
- * are always equal when the other bytes match, given that
- * the hash keys are equal and that HASH_BITS >= 8.
- */
- scan += 2, match++;
- Assert(*scan == *match, "match[2]?");
-
- /* We check for insufficient lookahead only every 8th comparison;
- * the 256th check will be made at strstart+258.
- */
- do {
- } while (*++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- scan < strend);
-
- Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
- len = MAX_MATCH - (int)(strend - scan);
- scan = strend - MAX_MATCH;
-
-#endif /* UNALIGNED_OK */
-
- if (len > best_len) {
- s->match_start = cur_match;
- best_len = len;
- if (len >= nice_match) break;
-#ifdef UNALIGNED_OK
- scan_end = *(ushf*)(scan+best_len-1);
-#else
- scan_end1 = scan[best_len-1];
- scan_end = scan[best_len];
-#endif
- }
- } while ((cur_match = prev[cur_match & wmask]) > limit
- && --chain_length != 0);
-
- if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
- return s->lookahead;
-}
-#endif /* ASMV */
-#endif /* FASTEST */
-
-/* ---------------------------------------------------------------------------
- * Optimized version for level == 1 or strategy == Z_RLE only
- */
-local uInt longest_match_fast(s, cur_match)
- deflate_state *s;
- IPos cur_match; /* current match */
-{
- register Bytef *scan = s->window + s->strstart; /* current string */
- register Bytef *match; /* matched string */
- register int len; /* length of current match */
- register Bytef *strend = s->window + s->strstart + MAX_MATCH;
-
- /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
- * It is easy to get rid of this optimization if necessary.
- */
- Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
- Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
- Assert(cur_match < s->strstart, "no future");
-
- match = s->window + cur_match;
-
- /* Return failure if the match length is less than 2:
- */
- if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
-
- /* The check at best_len-1 can be removed because it will be made
- * again later. (This heuristic is not always a win.)
- * It is not necessary to compare scan[2] and match[2] since they
- * are always equal when the other bytes match, given that
- * the hash keys are equal and that HASH_BITS >= 8.
- */
- scan += 2, match += 2;
- Assert(*scan == *match, "match[2]?");
-
- /* We check for insufficient lookahead only every 8th comparison;
- * the 256th check will be made at strstart+258.
- */
- do {
- } while (*++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- scan < strend);
-
- Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
- len = MAX_MATCH - (int)(strend - scan);
-
- if (len < MIN_MATCH) return MIN_MATCH - 1;
-
- s->match_start = cur_match;
- return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
-}
-
-#ifdef DEBUG
-/* ===========================================================================
- * Check that the match at match_start is indeed a match.
- */
-local void check_match(s, start, match, length)
- deflate_state *s;
- IPos start, match;
- int length;
-{
- /* check that the match is indeed a match */
- if (zmemcmp(s->window + match,
- s->window + start, length) != EQUAL) {
- fprintf(stderr, " start %u, match %u, length %d\n",
- start, match, length);
- do {
- fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
- } while (--length != 0);
- z_error("invalid match");
- }
- if (z_verbose > 1) {
- fprintf(stderr,"\\[%d,%d]", start-match, length);
- do { putc(s->window[start++], stderr); } while (--length != 0);
- }
-}
-#else
-# define check_match(s, start, match, length)
-#endif /* DEBUG */
-
-/* ===========================================================================
- * Fill the window when the lookahead becomes insufficient.
- * Updates strstart and lookahead.
- *
- * IN assertion: lookahead < MIN_LOOKAHEAD
- * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
- * At least one byte has been read, or avail_in == 0; reads are
- * performed for at least two bytes (required for the zip translate_eol
- * option -- not supported here).
- */
-local void fill_window(s)
- deflate_state *s;
-{
- register unsigned n, m;
- register Posf *p;
- unsigned more; /* Amount of free space at the end of the window. */
- uInt wsize = s->w_size;
-
- do {
- more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
-
- /* Deal with !@#$% 64K limit: */
- if (sizeof(int) <= 2) {
- if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
- more = wsize;
-
- } else if (more == (unsigned)(-1)) {
- /* Very unlikely, but possible on 16 bit machine if
- * strstart == 0 && lookahead == 1 (input done a byte at time)
- */
- more--;
- }
- }
-
- /* If the window is almost full and there is insufficient lookahead,
- * move the upper half to the lower one to make room in the upper half.
- */
- if (s->strstart >= wsize+MAX_DIST(s)) {
-
- zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
- s->match_start -= wsize;
- s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
- s->block_start -= (long) wsize;
-
- /* Slide the hash table (could be avoided with 32 bit values
- at the expense of memory usage). We slide even when level == 0
- to keep the hash table consistent if we switch back to level > 0
- later. (Using level 0 permanently is not an optimal usage of
- zlib, so we don't care about this pathological case.)
- */
- /* %%% avoid this when Z_RLE */
- n = s->hash_size;
- p = &s->head[n];
- do {
- m = *--p;
- *p = (Pos)(m >= wsize ? m-wsize : NIL);
- } while (--n);
-
- n = wsize;
-#ifndef FASTEST
- p = &s->prev[n];
- do {
- m = *--p;
- *p = (Pos)(m >= wsize ? m-wsize : NIL);
- /* If n is not on any hash chain, prev[n] is garbage but
- * its value will never be used.
- */
- } while (--n);
-#endif
- more += wsize;
- }
- if (s->strm->avail_in == 0) return;
-
- /* If there was no sliding:
- * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
- * more == window_size - lookahead - strstart
- * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
- * => more >= window_size - 2*WSIZE + 2
- * In the BIG_MEM or MMAP case (not yet supported),
- * window_size == input_size + MIN_LOOKAHEAD &&
- * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
- * Otherwise, window_size == 2*WSIZE so more >= 2.
- * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
- */
- Assert(more >= 2, "more < 2");
-
- n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
- s->lookahead += n;
-
- /* Initialize the hash value now that we have some input: */
- if (s->lookahead >= MIN_MATCH) {
- s->ins_h = s->window[s->strstart];
- UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
-#if MIN_MATCH != 3
- Call UPDATE_HASH() MIN_MATCH-3 more times
-#endif
- }
- /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
- * but this is not important since only literal bytes will be emitted.
- */
-
- } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
-}
-
-/* ===========================================================================
- * Flush the current block, with given end-of-file flag.
- * IN assertion: strstart is set to the end of the current match.
- */
-#define FLUSH_BLOCK_ONLY(s, eof) { \
- _tr_flush_block(s, (s->block_start >= 0L ? \
- (charf *)&s->window[(unsigned)s->block_start] : \
- (charf *)Z_NULL), \
- (ulg)((long)s->strstart - s->block_start), \
- (eof)); \
- s->block_start = s->strstart; \
- flush_pending(s->strm); \
- Tracev((stderr,"[FLUSH]")); \
-}
-
-/* Same but force premature exit if necessary. */
-#define FLUSH_BLOCK(s, eof) { \
- FLUSH_BLOCK_ONLY(s, eof); \
- if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
-}
-
-/* ===========================================================================
- * Copy without compression as much as possible from the input stream, return
- * the current block state.
- * This function does not insert new strings in the dictionary since
- * uncompressible data is probably not useful. This function is used
- * only for the level=0 compression option.
- * NOTE: this function should be optimized to avoid extra copying from
- * window to pending_buf.
- */
-local block_state deflate_stored(s, flush)
- deflate_state *s;
- int flush;
-{
- /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
- * to pending_buf_size, and each stored block has a 5 byte header:
- */
- ulg max_block_size = 0xffff;
- ulg max_start;
-
- if (max_block_size > s->pending_buf_size - 5) {
- max_block_size = s->pending_buf_size - 5;
- }
-
- /* Copy as much as possible from input to output: */
- for (;;) {
- /* Fill the window as much as possible: */
- if (s->lookahead <= 1) {
-
- Assert(s->strstart < s->w_size+MAX_DIST(s) ||
- s->block_start >= (long)s->w_size, "slide too late");
-
- fill_window(s);
- if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
-
- if (s->lookahead == 0) break; /* flush the current block */
- }
- Assert(s->block_start >= 0L, "block gone");
-
- s->strstart += s->lookahead;
- s->lookahead = 0;
-
- /* Emit a stored block if pending_buf will be full: */
- max_start = s->block_start + max_block_size;
- if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
- /* strstart == 0 is possible when wraparound on 16-bit machine */
- s->lookahead = (uInt)(s->strstart - max_start);
- s->strstart = (uInt)max_start;
- FLUSH_BLOCK(s, 0);
- }
- /* Flush if we may have to slide, otherwise block_start may become
- * negative and the data will be gone:
- */
- if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
- FLUSH_BLOCK(s, 0);
- }
- }
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
-}
-
-/* ===========================================================================
- * Compress as much as possible from the input stream, return the current
- * block state.
- * This function does not perform lazy evaluation of matches and inserts
- * new strings in the dictionary only for unmatched strings or for short
- * matches. It is used only for the fast compression options.
- */
-local block_state deflate_fast(s, flush)
- deflate_state *s;
- int flush;
-{
- IPos hash_head = NIL; /* head of the hash chain */
- int bflush; /* set if current block must be flushed */
-
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the next match, plus MIN_MATCH bytes to insert the
- * string following the next match.
- */
- if (s->lookahead < MIN_LOOKAHEAD) {
- fill_window(s);
- if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
- return need_more;
- }
- if (s->lookahead == 0) break; /* flush the current block */
- }
-
- /* Insert the string window[strstart .. strstart+2] in the
- * dictionary, and set hash_head to the head of the hash chain:
- */
- if (s->lookahead >= MIN_MATCH) {
- INSERT_STRING(s, s->strstart, hash_head);
- }
-
- /* Find the longest match, discarding those <= prev_length.
- * At this point we have always match_length < MIN_MATCH
- */
- if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
- /* To simplify the code, we prevent matches with the string
- * of window index 0 (in particular we have to avoid a match
- * of the string with itself at the start of the input file).
- */
-#ifdef FASTEST
- if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) ||
- (s->strategy == Z_RLE && s->strstart - hash_head == 1)) {
- s->match_length = longest_match_fast (s, hash_head);
- }
-#else
- if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
- s->match_length = longest_match (s, hash_head);
- } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
- s->match_length = longest_match_fast (s, hash_head);
- }
-#endif
- /* longest_match() or longest_match_fast() sets match_start */
- }
- if (s->match_length >= MIN_MATCH) {
- check_match(s, s->strstart, s->match_start, s->match_length);
-
- _tr_tally_dist(s, s->strstart - s->match_start,
- s->match_length - MIN_MATCH, bflush);
-
- s->lookahead -= s->match_length;
-
- /* Insert new strings in the hash table only if the match length
- * is not too large. This saves time but degrades compression.
- */
-#ifndef FASTEST
- if (s->match_length <= s->max_insert_length &&
- s->lookahead >= MIN_MATCH) {
- s->match_length--; /* string at strstart already in table */
- do {
- s->strstart++;
- INSERT_STRING(s, s->strstart, hash_head);
- /* strstart never exceeds WSIZE-MAX_MATCH, so there are
- * always MIN_MATCH bytes ahead.
- */
- } while (--s->match_length != 0);
- s->strstart++;
- } else
-#endif
- {
- s->strstart += s->match_length;
- s->match_length = 0;
- s->ins_h = s->window[s->strstart];
- UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
-#if MIN_MATCH != 3
- Call UPDATE_HASH() MIN_MATCH-3 more times
-#endif
- /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
- * matter since it will be recomputed at next deflate call.
- */
- }
- } else {
- /* No match, output a literal byte */
- Tracevv((stderr,"%c", s->window[s->strstart]));
- _tr_tally_lit (s, s->window[s->strstart], bflush);
- s->lookahead--;
- s->strstart++;
- }
- if (bflush) FLUSH_BLOCK(s, 0);
- }
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
-}
-
-#ifndef FASTEST
-/* ===========================================================================
- * Same as above, but achieves better compression. We use a lazy
- * evaluation for matches: a match is finally adopted only if there is
- * no better match at the next window position.
- */
-local block_state deflate_slow(s, flush)
- deflate_state *s;
- int flush;
-{
- IPos hash_head = NIL; /* head of hash chain */
- int bflush; /* set if current block must be flushed */
-
- /* Process the input block. */
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the next match, plus MIN_MATCH bytes to insert the
- * string following the next match.
- */
- if (s->lookahead < MIN_LOOKAHEAD) {
- fill_window(s);
- if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
- return need_more;
- }
- if (s->lookahead == 0) break; /* flush the current block */
- }
-
- /* Insert the string window[strstart .. strstart+2] in the
- * dictionary, and set hash_head to the head of the hash chain:
- */
- if (s->lookahead >= MIN_MATCH) {
- INSERT_STRING(s, s->strstart, hash_head);
- }
-
- /* Find the longest match, discarding those <= prev_length.
- */
- s->prev_length = s->match_length, s->prev_match = s->match_start;
- s->match_length = MIN_MATCH-1;
-
- if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
- s->strstart - hash_head <= MAX_DIST(s)) {
- /* To simplify the code, we prevent matches with the string
- * of window index 0 (in particular we have to avoid a match
- * of the string with itself at the start of the input file).
- */
- if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
- s->match_length = longest_match (s, hash_head);
- } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
- s->match_length = longest_match_fast (s, hash_head);
- }
- /* longest_match() or longest_match_fast() sets match_start */
-
- if (s->match_length <= 5 && (s->strategy == Z_FILTERED
-#if TOO_FAR <= 32767
- || (s->match_length == MIN_MATCH &&
- s->strstart - s->match_start > TOO_FAR)
-#endif
- )) {
-
- /* If prev_match is also MIN_MATCH, match_start is garbage
- * but we will ignore the current match anyway.
- */
- s->match_length = MIN_MATCH-1;
- }
- }
- /* If there was a match at the previous step and the current
- * match is not better, output the previous match:
- */
- if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
- uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
- /* Do not insert strings in hash table beyond this. */
-
- check_match(s, s->strstart-1, s->prev_match, s->prev_length);
-
- _tr_tally_dist(s, s->strstart -1 - s->prev_match,
- s->prev_length - MIN_MATCH, bflush);
-
- /* Insert in hash table all strings up to the end of the match.
- * strstart-1 and strstart are already inserted. If there is not
- * enough lookahead, the last two strings are not inserted in
- * the hash table.
- */
- s->lookahead -= s->prev_length-1;
- s->prev_length -= 2;
- do {
- if (++s->strstart <= max_insert) {
- INSERT_STRING(s, s->strstart, hash_head);
- }
- } while (--s->prev_length != 0);
- s->match_available = 0;
- s->match_length = MIN_MATCH-1;
- s->strstart++;
-
- if (bflush) FLUSH_BLOCK(s, 0);
-
- } else if (s->match_available) {
- /* If there was no match at the previous position, output a
- * single literal. If there was a match but the current match
- * is longer, truncate the previous match to a single literal.
- */
- Tracevv((stderr,"%c", s->window[s->strstart-1]));
- _tr_tally_lit(s, s->window[s->strstart-1], bflush);
- if (bflush) {
- FLUSH_BLOCK_ONLY(s, 0);
- }
- s->strstart++;
- s->lookahead--;
- if (s->strm->avail_out == 0) return need_more;
- } else {
- /* There is no previous match to compare with, wait for
- * the next step to decide.
- */
- s->match_available = 1;
- s->strstart++;
- s->lookahead--;
- }
- }
- Assert (flush != Z_NO_FLUSH, "no flush?");
- if (s->match_available) {
- Tracevv((stderr,"%c", s->window[s->strstart-1]));
- _tr_tally_lit(s, s->window[s->strstart-1], bflush);
- s->match_available = 0;
- }
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
-}
-#endif /* FASTEST */
-
-#if 0
-/* ===========================================================================
- * For Z_RLE, simply look for runs of bytes, generate matches only of distance
- * one. Do not maintain a hash table. (It will be regenerated if this run of
- * deflate switches away from Z_RLE.)
- */
-local block_state deflate_rle(s, flush)
- deflate_state *s;
- int flush;
-{
- int bflush; /* set if current block must be flushed */
- uInt run; /* length of run */
- uInt max; /* maximum length of run */
- uInt prev; /* byte at distance one to match */
- Bytef *scan; /* scan for end of run */
-
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the longest encodable run.
- */
- if (s->lookahead < MAX_MATCH) {
- fill_window(s);
- if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) {
- return need_more;
- }
- if (s->lookahead == 0) break; /* flush the current block */
- }
-
- /* See how many times the previous byte repeats */
- run = 0;
- if (s->strstart > 0) { /* if there is a previous byte, that is */
- max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH;
- scan = s->window + s->strstart - 1;
- prev = *scan++;
- do {
- if (*scan++ != prev)
- break;
- } while (++run < max);
- }
-
- /* Emit match if have run of MIN_MATCH or longer, else emit literal */
- if (run >= MIN_MATCH) {
- check_match(s, s->strstart, s->strstart - 1, run);
- _tr_tally_dist(s, 1, run - MIN_MATCH, bflush);
- s->lookahead -= run;
- s->strstart += run;
- } else {
- /* No match, output a literal byte */
- Tracevv((stderr,"%c", s->window[s->strstart]));
- _tr_tally_lit (s, s->window[s->strstart], bflush);
- s->lookahead--;
- s->strstart++;
- }
- if (bflush) FLUSH_BLOCK(s, 0);
- }
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
-}
-#endif
diff --git a/Utilities/Poco/Foundation/src/deflate.h b/Utilities/Poco/Foundation/src/deflate.h
deleted file mode 100755
index 05a5ab3a2c..0000000000
--- a/Utilities/Poco/Foundation/src/deflate.h
+++ /dev/null
@@ -1,331 +0,0 @@
-/* deflate.h -- internal compression state
- * Copyright (C) 1995-2004 Jean-loup Gailly
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* @(#) $Id$ */
-
-#ifndef DEFLATE_H
-#define DEFLATE_H
-
-#include "zutil.h"
-
-/* define NO_GZIP when compiling if you want to disable gzip header and
- trailer creation by deflate(). NO_GZIP would be used to avoid linking in
- the crc code when it is not needed. For shared libraries, gzip encoding
- should be left enabled. */
-#ifndef NO_GZIP
-# define GZIP
-#endif
-
-/* ===========================================================================
- * Internal compression state.
- */
-
-#define LENGTH_CODES 29
-/* number of length codes, not counting the special END_BLOCK code */
-
-#define LITERALS 256
-/* number of literal bytes 0..255 */
-
-#define L_CODES (LITERALS+1+LENGTH_CODES)
-/* number of Literal or Length codes, including the END_BLOCK code */
-
-#define D_CODES 30
-/* number of distance codes */
-
-#define BL_CODES 19
-/* number of codes used to transfer the bit lengths */
-
-#define HEAP_SIZE (2*L_CODES+1)
-/* maximum heap size */
-
-#define MAX_BITS 15
-/* All codes must not exceed MAX_BITS bits */
-
-#define INIT_STATE 42
-#define EXTRA_STATE 69
-#define NAME_STATE 73
-#define COMMENT_STATE 91
-#define HCRC_STATE 103
-#define BUSY_STATE 113
-#define FINISH_STATE 666
-/* Stream status */
-
-
-/* Data structure describing a single value and its code string. */
-typedef struct ct_data_s {
- union {
- ush freq; /* frequency count */
- ush code; /* bit string */
- } fc;
- union {
- ush dad; /* father node in Huffman tree */
- ush len; /* length of bit string */
- } dl;
-} FAR ct_data;
-
-#define Freq fc.freq
-#define Code fc.code
-#define Dad dl.dad
-#define Len dl.len
-
-typedef struct static_tree_desc_s static_tree_desc;
-
-typedef struct tree_desc_s {
- ct_data *dyn_tree; /* the dynamic tree */
- int max_code; /* largest code with non zero frequency */
- static_tree_desc *stat_desc; /* the corresponding static tree */
-} FAR tree_desc;
-
-typedef ush Pos;
-typedef Pos FAR Posf;
-typedef unsigned IPos;
-
-/* A Pos is an index in the character window. We use short instead of int to
- * save space in the various tables. IPos is used only for parameter passing.
- */
-
-typedef struct internal_state {
- z_streamp strm; /* pointer back to this zlib stream */
- int status; /* as the name implies */
- Bytef *pending_buf; /* output still pending */
- ulg pending_buf_size; /* size of pending_buf */
- Bytef *pending_out; /* next pending byte to output to the stream */
- uInt pending; /* nb of bytes in the pending buffer */
- int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
- gz_headerp gzhead; /* gzip header information to write */
- uInt gzindex; /* where in extra, name, or comment */
- Byte method; /* STORED (for zip only) or DEFLATED */
- int last_flush; /* value of flush param for previous deflate call */
-
- /* used by deflate.c: */
-
- uInt w_size; /* LZ77 window size (32K by default) */
- uInt w_bits; /* log2(w_size) (8..16) */
- uInt w_mask; /* w_size - 1 */
-
- Bytef *window;
- /* Sliding window. Input bytes are read into the second half of the window,
- * and move to the first half later to keep a dictionary of at least wSize
- * bytes. With this organization, matches are limited to a distance of
- * wSize-MAX_MATCH bytes, but this ensures that IO is always
- * performed with a length multiple of the block size. Also, it limits
- * the window size to 64K, which is quite useful on MSDOS.
- * To do: use the user input buffer as sliding window.
- */
-
- ulg window_size;
- /* Actual size of window: 2*wSize, except when the user input buffer
- * is directly used as sliding window.
- */
-
- Posf *prev;
- /* Link to older string with same hash index. To limit the size of this
- * array to 64K, this link is maintained only for the last 32K strings.
- * An index in this array is thus a window index modulo 32K.
- */
-
- Posf *head; /* Heads of the hash chains or NIL. */
-
- uInt ins_h; /* hash index of string to be inserted */
- uInt hash_size; /* number of elements in hash table */
- uInt hash_bits; /* log2(hash_size) */
- uInt hash_mask; /* hash_size-1 */
-
- uInt hash_shift;
- /* Number of bits by which ins_h must be shifted at each input
- * step. It must be such that after MIN_MATCH steps, the oldest
- * byte no longer takes part in the hash key, that is:
- * hash_shift * MIN_MATCH >= hash_bits
- */
-
- long block_start;
- /* Window position at the beginning of the current output block. Gets
- * negative when the window is moved backwards.
- */
-
- uInt match_length; /* length of best match */
- IPos prev_match; /* previous match */
- int match_available; /* set if previous match exists */
- uInt strstart; /* start of string to insert */
- uInt match_start; /* start of matching string */
- uInt lookahead; /* number of valid bytes ahead in window */
-
- uInt prev_length;
- /* Length of the best match at previous step. Matches not greater than this
- * are discarded. This is used in the lazy match evaluation.
- */
-
- uInt max_chain_length;
- /* To speed up deflation, hash chains are never searched beyond this
- * length. A higher limit improves compression ratio but degrades the
- * speed.
- */
-
- uInt max_lazy_match;
- /* Attempt to find a better match only when the current match is strictly
- * smaller than this value. This mechanism is used only for compression
- * levels >= 4.
- */
-# define max_insert_length max_lazy_match
- /* Insert new strings in the hash table only if the match length is not
- * greater than this length. This saves time but degrades compression.
- * max_insert_length is used only for compression levels <= 3.
- */
-
- int level; /* compression level (1..9) */
- int strategy; /* favor or force Huffman coding*/
-
- uInt good_match;
- /* Use a faster search when the previous match is longer than this */
-
- int nice_match; /* Stop searching when current match exceeds this */
-
- /* used by trees.c: */
- /* Didn't use ct_data typedef below to supress compiler warning */
- struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
- struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
- struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
-
- struct tree_desc_s l_desc; /* desc. for literal tree */
- struct tree_desc_s d_desc; /* desc. for distance tree */
- struct tree_desc_s bl_desc; /* desc. for bit length tree */
-
- ush bl_count[MAX_BITS+1];
- /* number of codes at each bit length for an optimal tree */
-
- int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
- int heap_len; /* number of elements in the heap */
- int heap_max; /* element of largest frequency */
- /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
- * The same heap array is used to build all trees.
- */
-
- uch depth[2*L_CODES+1];
- /* Depth of each subtree used as tie breaker for trees of equal frequency
- */
-
- uchf *l_buf; /* buffer for literals or lengths */
-
- uInt lit_bufsize;
- /* Size of match buffer for literals/lengths. There are 4 reasons for
- * limiting lit_bufsize to 64K:
- * - frequencies can be kept in 16 bit counters
- * - if compression is not successful for the first block, all input
- * data is still in the window so we can still emit a stored block even
- * when input comes from standard input. (This can also be done for
- * all blocks if lit_bufsize is not greater than 32K.)
- * - if compression is not successful for a file smaller than 64K, we can
- * even emit a stored file instead of a stored block (saving 5 bytes).
- * This is applicable only for zip (not gzip or zlib).
- * - creating new Huffman trees less frequently may not provide fast
- * adaptation to changes in the input data statistics. (Take for
- * example a binary file with poorly compressible code followed by
- * a highly compressible string table.) Smaller buffer sizes give
- * fast adaptation but have of course the overhead of transmitting
- * trees more frequently.
- * - I can't count above 4
- */
-
- uInt last_lit; /* running index in l_buf */
-
- ushf *d_buf;
- /* Buffer for distances. To simplify the code, d_buf and l_buf have
- * the same number of elements. To use different lengths, an extra flag
- * array would be necessary.
- */
-
- ulg opt_len; /* bit length of current block with optimal trees */
- ulg static_len; /* bit length of current block with static trees */
- uInt matches; /* number of string matches in current block */
- int last_eob_len; /* bit length of EOB code for last block */
-
-#ifdef DEBUG
- ulg compressed_len; /* total bit length of compressed file mod 2^32 */
- ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
-#endif
-
- ush bi_buf;
- /* Output buffer. bits are inserted starting at the bottom (least
- * significant bits).
- */
- int bi_valid;
- /* Number of valid bits in bi_buf. All bits above the last valid bit
- * are always zero.
- */
-
-} FAR deflate_state;
-
-/* Output a byte on the stream.
- * IN assertion: there is enough room in pending_buf.
- */
-#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
-
-
-#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
-/* Minimum amount of lookahead, except at the end of the input file.
- * See deflate.c for comments about the MIN_MATCH+1.
- */
-
-#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
-/* In order to simplify the code, particularly on 16 bit machines, match
- * distances are limited to MAX_DIST instead of WSIZE.
- */
-
- /* in trees.c */
-void _tr_init OF((deflate_state *s));
-int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
-void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
- int eof));
-void _tr_align OF((deflate_state *s));
-void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
- int eof));
-
-#define d_code(dist) \
- ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
-/* Mapping from a distance to a distance code. dist is the distance - 1 and
- * must not have side effects. _dist_code[256] and _dist_code[257] are never
- * used.
- */
-
-#ifndef DEBUG
-/* Inline versions of _tr_tally for speed: */
-
-#if defined(GEN_TREES_H) || !defined(STDC)
- extern uch _length_code[];
- extern uch _dist_code[];
-#else
- extern const uch _length_code[];
- extern const uch _dist_code[];
-#endif
-
-# define _tr_tally_lit(s, c, flush) \
- { uch cc = (c); \
- s->d_buf[s->last_lit] = 0; \
- s->l_buf[s->last_lit++] = cc; \
- s->dyn_ltree[cc].Freq++; \
- flush = (s->last_lit == s->lit_bufsize-1); \
- }
-# define _tr_tally_dist(s, distance, length, flush) \
- { uch len = (length); \
- ush dist = (distance); \
- s->d_buf[s->last_lit] = dist; \
- s->l_buf[s->last_lit++] = len; \
- dist--; \
- s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
- s->dyn_dtree[d_code(dist)].Freq++; \
- flush = (s->last_lit == s->lit_bufsize-1); \
- }
-#else
-# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
-# define _tr_tally_dist(s, distance, length, flush) \
- flush = _tr_tally(s, distance, length)
-#endif
-
-#endif /* DEFLATE_H */
diff --git a/Utilities/Poco/Foundation/src/gzio.c b/Utilities/Poco/Foundation/src/gzio.c
deleted file mode 100755
index 7e90f4928f..0000000000
--- a/Utilities/Poco/Foundation/src/gzio.c
+++ /dev/null
@@ -1,1026 +0,0 @@
-/* gzio.c -- IO on .gz files
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Compile this file with -DNO_GZCOMPRESS to avoid the compression code.
- */
-
-/* @(#) $Id$ */
-
-#include <stdio.h>
-
-#include "zutil.h"
-
-#ifdef NO_DEFLATE /* for compatibility with old definition */
-# define NO_GZCOMPRESS
-#endif
-
-#ifndef NO_DUMMY_DECL
-struct internal_state {int dummy;}; /* for buggy compilers */
-#endif
-
-#ifndef Z_BUFSIZE
-# ifdef MAXSEG_64K
-# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
-# else
-# define Z_BUFSIZE 16384
-# endif
-#endif
-#ifndef Z_PRINTF_BUFSIZE
-# define Z_PRINTF_BUFSIZE 4096
-#endif
-
-#ifdef __MVS__
-# pragma map (fdopen , "\174\174FDOPEN")
- FILE *fdopen(int, const char *);
-#endif
-
-#ifndef STDC
-extern voidp malloc OF((uInt size));
-extern void free OF((voidpf ptr));
-#endif
-
-#define ALLOC(size) malloc(size)
-#define TRYFREE(p) {if (p) free(p);}
-
-static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
-
-/* gzip flag byte */
-#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
-#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */
-#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
-#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
-#define COMMENT 0x10 /* bit 4 set: file comment present */
-#define RESERVED 0xE0 /* bits 5..7: reserved */
-
-typedef struct gz_stream {
- z_stream stream;
- int z_err; /* error code for last stream operation */
- int z_eof; /* set if end of input file */
- FILE *file; /* .gz file */
- Byte *inbuf; /* input buffer */
- Byte *outbuf; /* output buffer */
- uLong crc; /* crc32 of uncompressed data */
- char *msg; /* error message */
- char *path; /* path name for debugging only */
- int transparent; /* 1 if input file is not a .gz file */
- char mode; /* 'w' or 'r' */
- z_off_t start; /* start of compressed data in file (header skipped) */
- z_off_t in; /* bytes into deflate or inflate */
- z_off_t out; /* bytes out of deflate or inflate */
- int back; /* one character push-back */
- int last; /* true if push-back is last character */
-} gz_stream;
-
-
-local gzFile gz_open OF((const char *path, const char *mode, int fd));
-local int do_flush OF((gzFile file, int flush));
-local int get_byte OF((gz_stream *s));
-local void check_header OF((gz_stream *s));
-local int destroy OF((gz_stream *s));
-local void putLong OF((FILE *file, uLong x));
-local uLong getLong OF((gz_stream *s));
-
-/* ===========================================================================
- Opens a gzip (.gz) file for reading or writing. The mode parameter
- is as in fopen ("rb" or "wb"). The file is given either by file descriptor
- or path name (if fd == -1).
- gz_open returns NULL if the file could not be opened or if there was
- insufficient memory to allocate the (de)compression state; errno
- can be checked to distinguish the two cases (if errno is zero, the
- zlib error is Z_MEM_ERROR).
-*/
-local gzFile gz_open (path, mode, fd)
- const char *path;
- const char *mode;
- int fd;
-{
- int err;
- int level = Z_DEFAULT_COMPRESSION; /* compression level */
- int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
- char *p = (char*)mode;
- gz_stream *s;
- char fmode[80]; /* copy of mode, without the compression level */
- char *m = fmode;
-
- if (!path || !mode) return Z_NULL;
-
- s = (gz_stream *)ALLOC(sizeof(gz_stream));
- if (!s) return Z_NULL;
-
- s->stream.zalloc = (alloc_func)0;
- s->stream.zfree = (free_func)0;
- s->stream.opaque = (voidpf)0;
- s->stream.next_in = s->inbuf = Z_NULL;
- s->stream.next_out = s->outbuf = Z_NULL;
- s->stream.avail_in = s->stream.avail_out = 0;
- s->file = NULL;
- s->z_err = Z_OK;
- s->z_eof = 0;
- s->in = 0;
- s->out = 0;
- s->back = EOF;
- s->crc = crc32(0L, Z_NULL, 0);
- s->msg = NULL;
- s->transparent = 0;
-
- s->path = (char*)ALLOC(strlen(path)+1);
- if (s->path == NULL) {
- return destroy(s), (gzFile)Z_NULL;
- }
- strcpy(s->path, path); /* do this early for debugging */
-
- s->mode = '\0';
- do {
- if (*p == 'r') s->mode = 'r';
- if (*p == 'w' || *p == 'a') s->mode = 'w';
- if (*p >= '0' && *p <= '9') {
- level = *p - '0';
- } else if (*p == 'f') {
- strategy = Z_FILTERED;
- } else if (*p == 'h') {
- strategy = Z_HUFFMAN_ONLY;
- } else if (*p == 'R') {
- strategy = Z_RLE;
- } else {
- *m++ = *p; /* copy the mode */
- }
- } while (*p++ && m != fmode + sizeof(fmode));
- if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
-
- if (s->mode == 'w') {
-#ifdef NO_GZCOMPRESS
- err = Z_STREAM_ERROR;
-#else
- err = deflateInit2(&(s->stream), level,
- Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
- /* windowBits is passed < 0 to suppress zlib header */
-
- s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
-#endif
- if (err != Z_OK || s->outbuf == Z_NULL) {
- return destroy(s), (gzFile)Z_NULL;
- }
- } else {
- s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
-
- err = inflateInit2(&(s->stream), -MAX_WBITS);
- /* windowBits is passed < 0 to tell that there is no zlib header.
- * Note that in this case inflate *requires* an extra "dummy" byte
- * after the compressed stream in order to complete decompression and
- * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
- * present after the compressed stream.
- */
- if (err != Z_OK || s->inbuf == Z_NULL) {
- return destroy(s), (gzFile)Z_NULL;
- }
- }
- s->stream.avail_out = Z_BUFSIZE;
-
- errno = 0;
- s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);
-
- if (s->file == NULL) {
- return destroy(s), (gzFile)Z_NULL;
- }
- if (s->mode == 'w') {
- /* Write a very simple .gz header:
- */
- fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
- Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
- s->start = 10L;
- /* We use 10L instead of ftell(s->file) to because ftell causes an
- * fflush on some systems. This version of the library doesn't use
- * start anyway in write mode, so this initialization is not
- * necessary.
- */
- } else {
- check_header(s); /* skip the .gz header */
- s->start = ftell(s->file) - s->stream.avail_in;
- }
-
- return (gzFile)s;
-}
-
-/* ===========================================================================
- Opens a gzip (.gz) file for reading or writing.
-*/
-gzFile ZEXPORT gzopen (path, mode)
- const char *path;
- const char *mode;
-{
- return gz_open (path, mode, -1);
-}
-
-/* ===========================================================================
- Associate a gzFile with the file descriptor fd. fd is not dup'ed here
- to mimic the behavio(u)r of fdopen.
-*/
-gzFile ZEXPORT gzdopen (fd, mode)
- int fd;
- const char *mode;
-{
- char name[46]; /* allow for up to 128-bit integers */
-
- if (fd < 0) return (gzFile)Z_NULL;
- sprintf(name, "<fd:%d>", fd); /* for debugging */
-
- return gz_open (name, mode, fd);
-}
-
-/* ===========================================================================
- * Update the compression level and strategy
- */
-int ZEXPORT gzsetparams (file, level, strategy)
- gzFile file;
- int level;
- int strategy;
-{
- gz_stream *s = (gz_stream*)file;
-
- if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
-
- /* Make room to allow flushing */
- if (s->stream.avail_out == 0) {
-
- s->stream.next_out = s->outbuf;
- if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
- s->z_err = Z_ERRNO;
- }
- s->stream.avail_out = Z_BUFSIZE;
- }
-
- return deflateParams (&(s->stream), level, strategy);
-}
-
-/* ===========================================================================
- Read a byte from a gz_stream; update next_in and avail_in. Return EOF
- for end of file.
- IN assertion: the stream s has been sucessfully opened for reading.
-*/
-local int get_byte(s)
- gz_stream *s;
-{
- if (s->z_eof) return EOF;
- if (s->stream.avail_in == 0) {
- errno = 0;
- s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
- if (s->stream.avail_in == 0) {
- s->z_eof = 1;
- if (ferror(s->file)) s->z_err = Z_ERRNO;
- return EOF;
- }
- s->stream.next_in = s->inbuf;
- }
- s->stream.avail_in--;
- return *(s->stream.next_in)++;
-}
-
-/* ===========================================================================
- Check the gzip header of a gz_stream opened for reading. Set the stream
- mode to transparent if the gzip magic header is not present; set s->err
- to Z_DATA_ERROR if the magic header is present but the rest of the header
- is incorrect.
- IN assertion: the stream s has already been created sucessfully;
- s->stream.avail_in is zero for the first time, but may be non-zero
- for concatenated .gz files.
-*/
-local void check_header(s)
- gz_stream *s;
-{
- int method; /* method byte */
- int flags; /* flags byte */
- uInt len;
- int c;
-
- /* Assure two bytes in the buffer so we can peek ahead -- handle case
- where first byte of header is at the end of the buffer after the last
- gzip segment */
- len = s->stream.avail_in;
- if (len < 2) {
- if (len) s->inbuf[0] = s->stream.next_in[0];
- errno = 0;
- len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
- if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;
- s->stream.avail_in += len;
- s->stream.next_in = s->inbuf;
- if (s->stream.avail_in < 2) {
- s->transparent = s->stream.avail_in;
- return;
- }
- }
-
- /* Peek ahead to check the gzip magic header */
- if (s->stream.next_in[0] != gz_magic[0] ||
- s->stream.next_in[1] != gz_magic[1]) {
- s->transparent = 1;
- return;
- }
- s->stream.avail_in -= 2;
- s->stream.next_in += 2;
-
- /* Check the rest of the gzip header */
- method = get_byte(s);
- flags = get_byte(s);
- if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
- s->z_err = Z_DATA_ERROR;
- return;
- }
-
- /* Discard time, xflags and OS code: */
- for (len = 0; len < 6; len++) (void)get_byte(s);
-
- if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
- len = (uInt)get_byte(s);
- len += ((uInt)get_byte(s))<<8;
- /* len is garbage if EOF but the loop below will quit anyway */
- while (len-- != 0 && get_byte(s) != EOF) ;
- }
- if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
- while ((c = get_byte(s)) != 0 && c != EOF) ;
- }
- if ((flags & COMMENT) != 0) { /* skip the .gz file comment */
- while ((c = get_byte(s)) != 0 && c != EOF) ;
- }
- if ((flags & HEAD_CRC) != 0) { /* skip the header crc */
- for (len = 0; len < 2; len++) (void)get_byte(s);
- }
- s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK;
-}
-
- /* ===========================================================================
- * Cleanup then free the given gz_stream. Return a zlib error code.
- Try freeing in the reverse order of allocations.
- */
-local int destroy (s)
- gz_stream *s;
-{
- int err = Z_OK;
-
- if (!s) return Z_STREAM_ERROR;
-
- TRYFREE(s->msg);
-
- if (s->stream.state != NULL) {
- if (s->mode == 'w') {
-#ifdef NO_GZCOMPRESS
- err = Z_STREAM_ERROR;
-#else
- err = deflateEnd(&(s->stream));
-#endif
- } else if (s->mode == 'r') {
- err = inflateEnd(&(s->stream));
- }
- }
- if (s->file != NULL && fclose(s->file)) {
-#ifdef ESPIPE
- if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
-#endif
- err = Z_ERRNO;
- }
- if (s->z_err < 0) err = s->z_err;
-
- TRYFREE(s->inbuf);
- TRYFREE(s->outbuf);
- TRYFREE(s->path);
- TRYFREE(s);
- return err;
-}
-
-/* ===========================================================================
- Reads the given number of uncompressed bytes from the compressed file.
- gzread returns the number of bytes actually read (0 for end of file).
-*/
-int ZEXPORT gzread (file, buf, len)
- gzFile file;
- voidp buf;
- unsigned len;
-{
- gz_stream *s = (gz_stream*)file;
- Bytef *start = (Bytef*)buf; /* starting point for crc computation */
- Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
-
- if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
-
- if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
- if (s->z_err == Z_STREAM_END) return 0; /* EOF */
-
- next_out = (Byte*)buf;
- s->stream.next_out = (Bytef*)buf;
- s->stream.avail_out = len;
-
- if (s->stream.avail_out && s->back != EOF) {
- *next_out++ = s->back;
- s->stream.next_out++;
- s->stream.avail_out--;
- s->back = EOF;
- s->out++;
- start++;
- if (s->last) {
- s->z_err = Z_STREAM_END;
- return 1;
- }
- }
-
- while (s->stream.avail_out != 0) {
-
- if (s->transparent) {
- /* Copy first the lookahead bytes: */
- uInt n = s->stream.avail_in;
- if (n > s->stream.avail_out) n = s->stream.avail_out;
- if (n > 0) {
- zmemcpy(s->stream.next_out, s->stream.next_in, n);
- next_out += n;
- s->stream.next_out = next_out;
- s->stream.next_in += n;
- s->stream.avail_out -= n;
- s->stream.avail_in -= n;
- }
- if (s->stream.avail_out > 0) {
- s->stream.avail_out -=
- (uInt)fread(next_out, 1, s->stream.avail_out, s->file);
- }
- len -= s->stream.avail_out;
- s->in += len;
- s->out += len;
- if (len == 0) s->z_eof = 1;
- return (int)len;
- }
- if (s->stream.avail_in == 0 && !s->z_eof) {
-
- errno = 0;
- s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
- if (s->stream.avail_in == 0) {
- s->z_eof = 1;
- if (ferror(s->file)) {
- s->z_err = Z_ERRNO;
- break;
- }
- }
- s->stream.next_in = s->inbuf;
- }
- s->in += s->stream.avail_in;
- s->out += s->stream.avail_out;
- s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
- s->in -= s->stream.avail_in;
- s->out -= s->stream.avail_out;
-
- if (s->z_err == Z_STREAM_END) {
- /* Check CRC and original size */
- s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
- start = s->stream.next_out;
-
- if (getLong(s) != s->crc) {
- s->z_err = Z_DATA_ERROR;
- } else {
- (void)getLong(s);
- /* The uncompressed length returned by above getlong() may be
- * different from s->out in case of concatenated .gz files.
- * Check for such files:
- */
- check_header(s);
- if (s->z_err == Z_OK) {
- inflateReset(&(s->stream));
- s->crc = crc32(0L, Z_NULL, 0);
- }
- }
- }
- if (s->z_err != Z_OK || s->z_eof) break;
- }
- s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
-
- if (len == s->stream.avail_out &&
- (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO))
- return -1;
- return (int)(len - s->stream.avail_out);
-}
-
-
-/* ===========================================================================
- Reads one byte from the compressed file. gzgetc returns this byte
- or -1 in case of end of file or error.
-*/
-int ZEXPORT gzgetc(file)
- gzFile file;
-{
- unsigned char c;
-
- return gzread(file, &c, 1) == 1 ? c : -1;
-}
-
-
-/* ===========================================================================
- Push one byte back onto the stream.
-*/
-int ZEXPORT gzungetc(c, file)
- int c;
- gzFile file;
-{
- gz_stream *s = (gz_stream*)file;
-
- if (s == NULL || s->mode != 'r' || c == EOF || s->back != EOF) return EOF;
- s->back = c;
- s->out--;
- s->last = (s->z_err == Z_STREAM_END);
- if (s->last) s->z_err = Z_OK;
- s->z_eof = 0;
- return c;
-}
-
-
-/* ===========================================================================
- Reads bytes from the compressed file until len-1 characters are
- read, or a newline character is read and transferred to buf, or an
- end-of-file condition is encountered. The string is then terminated
- with a null character.
- gzgets returns buf, or Z_NULL in case of error.
-
- The current implementation is not optimized at all.
-*/
-char * ZEXPORT gzgets(file, buf, len)
- gzFile file;
- char *buf;
- int len;
-{
- char *b = buf;
- if (buf == Z_NULL || len <= 0) return Z_NULL;
-
- while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
- *buf = '\0';
- return b == buf && len > 0 ? Z_NULL : b;
-}
-
-
-#ifndef NO_GZCOMPRESS
-/* ===========================================================================
- Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of bytes actually written (0 in case of error).
-*/
-int ZEXPORT gzwrite (file, buf, len)
- gzFile file;
- voidpc buf;
- unsigned len;
-{
- gz_stream *s = (gz_stream*)file;
-
- if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
-
- s->stream.next_in = (Bytef*)buf;
- s->stream.avail_in = len;
-
- while (s->stream.avail_in != 0) {
-
- if (s->stream.avail_out == 0) {
-
- s->stream.next_out = s->outbuf;
- if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
- s->z_err = Z_ERRNO;
- break;
- }
- s->stream.avail_out = Z_BUFSIZE;
- }
- s->in += s->stream.avail_in;
- s->out += s->stream.avail_out;
- s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
- s->in -= s->stream.avail_in;
- s->out -= s->stream.avail_out;
- if (s->z_err != Z_OK) break;
- }
- s->crc = crc32(s->crc, (const Bytef *)buf, len);
-
- return (int)(len - s->stream.avail_in);
-}
-
-
-/* ===========================================================================
- Converts, formats, and writes the args to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
- uncompressed bytes actually written (0 in case of error).
-*/
-#ifdef STDC
-#include <stdarg.h>
-
-int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...)
-{
- char buf[Z_PRINTF_BUFSIZE];
- va_list va;
- int len;
-
- buf[sizeof(buf) - 1] = 0;
- va_start(va, format);
-#ifdef NO_vsnprintf
-# ifdef HAS_vsprintf_void
- (void)vsprintf(buf, format, va);
- va_end(va);
- for (len = 0; len < sizeof(buf); len++)
- if (buf[len] == 0) break;
-# else
- len = vsprintf(buf, format, va);
- va_end(va);
-# endif
-#else
-# ifdef HAS_vsnprintf_void
- (void)vsnprintf(buf, sizeof(buf), format, va);
- va_end(va);
- len = strlen(buf);
-# else
- len = vsnprintf(buf, sizeof(buf), format, va);
- va_end(va);
-# endif
-#endif
- if (len <= 0 || len >= (int)sizeof(buf) || buf[sizeof(buf) - 1] != 0)
- return 0;
- return gzwrite(file, buf, (unsigned)len);
-}
-#else /* not ANSI C */
-
-int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
- a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
- gzFile file;
- const char *format;
- int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
- a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
-{
- char buf[Z_PRINTF_BUFSIZE];
- int len;
-
- buf[sizeof(buf) - 1] = 0;
-#ifdef NO_snprintf
-# ifdef HAS_sprintf_void
- sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
- a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
- for (len = 0; len < sizeof(buf); len++)
- if (buf[len] == 0) break;
-# else
- len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
- a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-# endif
-#else
-# ifdef HAS_snprintf_void
- snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
- a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
- len = strlen(buf);
-# else
- len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
- a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-# endif
-#endif
- if (len <= 0 || len >= sizeof(buf) || buf[sizeof(buf) - 1] != 0)
- return 0;
- return gzwrite(file, buf, len);
-}
-#endif
-
-/* ===========================================================================
- Writes c, converted to an unsigned char, into the compressed file.
- gzputc returns the value that was written, or -1 in case of error.
-*/
-int ZEXPORT gzputc(file, c)
- gzFile file;
- int c;
-{
- unsigned char cc = (unsigned char) c; /* required for big endian systems */
-
- return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1;
-}
-
-
-/* ===========================================================================
- Writes the given null-terminated string to the compressed file, excluding
- the terminating null character.
- gzputs returns the number of characters written, or -1 in case of error.
-*/
-int ZEXPORT gzputs(file, s)
- gzFile file;
- const char *s;
-{
- return gzwrite(file, (char*)s, (unsigned)strlen(s));
-}
-
-
-/* ===========================================================================
- Flushes all pending output into the compressed file. The parameter
- flush is as in the deflate() function.
-*/
-local int do_flush (file, flush)
- gzFile file;
- int flush;
-{
- uInt len;
- int done = 0;
- gz_stream *s = (gz_stream*)file;
-
- if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
-
- s->stream.avail_in = 0; /* should be zero already anyway */
-
- for (;;) {
- len = Z_BUFSIZE - s->stream.avail_out;
-
- if (len != 0) {
- if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
- s->z_err = Z_ERRNO;
- return Z_ERRNO;
- }
- s->stream.next_out = s->outbuf;
- s->stream.avail_out = Z_BUFSIZE;
- }
- if (done) break;
- s->out += s->stream.avail_out;
- s->z_err = deflate(&(s->stream), flush);
- s->out -= s->stream.avail_out;
-
- /* Ignore the second of two consecutive flushes: */
- if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
-
- /* deflate has finished flushing only when it hasn't used up
- * all the available space in the output buffer:
- */
- done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
-
- if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
- }
- return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
-}
-
-int ZEXPORT gzflush (file, flush)
- gzFile file;
- int flush;
-{
- gz_stream *s = (gz_stream*)file;
- int err = do_flush (file, flush);
-
- if (err) return err;
- fflush(s->file);
- return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
-}
-#endif /* NO_GZCOMPRESS */
-
-/* ===========================================================================
- Sets the starting position for the next gzread or gzwrite on the given
- compressed file. The offset represents a number of bytes in the
- gzseek returns the resulting offset location as measured in bytes from
- the beginning of the uncompressed stream, or -1 in case of error.
- SEEK_END is not implemented, returns error.
- In this version of the library, gzseek can be extremely slow.
-*/
-z_off_t ZEXPORT gzseek (file, offset, whence)
- gzFile file;
- z_off_t offset;
- int whence;
-{
- gz_stream *s = (gz_stream*)file;
-
- if (s == NULL || whence == SEEK_END ||
- s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) {
- return -1L;
- }
-
- if (s->mode == 'w') {
-#ifdef NO_GZCOMPRESS
- return -1L;
-#else
- if (whence == SEEK_SET) {
- offset -= s->in;
- }
- if (offset < 0) return -1L;
-
- /* At this point, offset is the number of zero bytes to write. */
- if (s->inbuf == Z_NULL) {
- s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */
- if (s->inbuf == Z_NULL) return -1L;
- zmemzero(s->inbuf, Z_BUFSIZE);
- }
- while (offset > 0) {
- uInt size = Z_BUFSIZE;
- if (offset < Z_BUFSIZE) size = (uInt)offset;
-
- size = gzwrite(file, s->inbuf, size);
- if (size == 0) return -1L;
-
- offset -= size;
- }
- return s->in;
-#endif
- }
- /* Rest of function is for reading only */
-
- /* compute absolute position */
- if (whence == SEEK_CUR) {
- offset += s->out;
- }
- if (offset < 0) return -1L;
-
- if (s->transparent) {
- /* map to fseek */
- s->back = EOF;
- s->stream.avail_in = 0;
- s->stream.next_in = s->inbuf;
- if (fseek(s->file, offset, SEEK_SET) < 0) return -1L;
-
- s->in = s->out = offset;
- return offset;
- }
-
- /* For a negative seek, rewind and use positive seek */
- if (offset >= s->out) {
- offset -= s->out;
- } else if (gzrewind(file) < 0) {
- return -1L;
- }
- /* offset is now the number of bytes to skip. */
-
- if (offset != 0 && s->outbuf == Z_NULL) {
- s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
- if (s->outbuf == Z_NULL) return -1L;
- }
- if (offset && s->back != EOF) {
- s->back = EOF;
- s->out++;
- offset--;
- if (s->last) s->z_err = Z_STREAM_END;
- }
- while (offset > 0) {
- int size = Z_BUFSIZE;
- if (offset < Z_BUFSIZE) size = (int)offset;
-
- size = gzread(file, s->outbuf, (uInt)size);
- if (size <= 0) return -1L;
- offset -= size;
- }
- return s->out;
-}
-
-/* ===========================================================================
- Rewinds input file.
-*/
-int ZEXPORT gzrewind (file)
- gzFile file;
-{
- gz_stream *s = (gz_stream*)file;
-
- if (s == NULL || s->mode != 'r') return -1;
-
- s->z_err = Z_OK;
- s->z_eof = 0;
- s->back = EOF;
- s->stream.avail_in = 0;
- s->stream.next_in = s->inbuf;
- s->crc = crc32(0L, Z_NULL, 0);
- if (!s->transparent) (void)inflateReset(&s->stream);
- s->in = 0;
- s->out = 0;
- return fseek(s->file, s->start, SEEK_SET);
-}
-
-/* ===========================================================================
- Returns the starting position for the next gzread or gzwrite on the
- given compressed file. This position represents a number of bytes in the
- uncompressed data stream.
-*/
-z_off_t ZEXPORT gztell (file)
- gzFile file;
-{
- return gzseek(file, 0L, SEEK_CUR);
-}
-
-/* ===========================================================================
- Returns 1 when EOF has previously been detected reading the given
- input stream, otherwise zero.
-*/
-int ZEXPORT gzeof (file)
- gzFile file;
-{
- gz_stream *s = (gz_stream*)file;
-
- /* With concatenated compressed files that can have embedded
- * crc trailers, z_eof is no longer the only/best indicator of EOF
- * on a gz_stream. Handle end-of-stream error explicitly here.
- */
- if (s == NULL || s->mode != 'r') return 0;
- if (s->z_eof) return 1;
- return s->z_err == Z_STREAM_END;
-}
-
-/* ===========================================================================
- Returns 1 if reading and doing so transparently, otherwise zero.
-*/
-int ZEXPORT gzdirect (file)
- gzFile file;
-{
- gz_stream *s = (gz_stream*)file;
-
- if (s == NULL || s->mode != 'r') return 0;
- return s->transparent;
-}
-
-/* ===========================================================================
- Outputs a long in LSB order to the given file
-*/
-local void putLong (file, x)
- FILE *file;
- uLong x;
-{
- int n;
- for (n = 0; n < 4; n++) {
- fputc((int)(x & 0xff), file);
- x >>= 8;
- }
-}
-
-/* ===========================================================================
- Reads a long in LSB order from the given gz_stream. Sets z_err in case
- of error.
-*/
-local uLong getLong (s)
- gz_stream *s;
-{
- uLong x = (uLong)get_byte(s);
- int c;
-
- x += ((uLong)get_byte(s))<<8;
- x += ((uLong)get_byte(s))<<16;
- c = get_byte(s);
- if (c == EOF) s->z_err = Z_DATA_ERROR;
- x += ((uLong)c)<<24;
- return x;
-}
-
-/* ===========================================================================
- Flushes all pending output if necessary, closes the compressed file
- and deallocates all the (de)compression state.
-*/
-int ZEXPORT gzclose (file)
- gzFile file;
-{
- gz_stream *s = (gz_stream*)file;
-
- if (s == NULL) return Z_STREAM_ERROR;
-
- if (s->mode == 'w') {
-#ifdef NO_GZCOMPRESS
- return Z_STREAM_ERROR;
-#else
- if (do_flush (file, Z_FINISH) != Z_OK)
- return destroy((gz_stream*)file);
-
- putLong (s->file, s->crc);
- putLong (s->file, (uLong)(s->in & 0xffffffff));
-#endif
- }
- return destroy((gz_stream*)file);
-}
-
-#ifdef STDC
-# define zstrerror(errnum) strerror(errnum)
-#else
-# define zstrerror(errnum) ""
-#endif
-
-/* ===========================================================================
- Returns the error message for the last error which occurred on the
- given compressed file. errnum is set to zlib error number. If an
- error occurred in the file system and not in the compression library,
- errnum is set to Z_ERRNO and the application may consult errno
- to get the exact error code.
-*/
-const char * ZEXPORT gzerror (file, errnum)
- gzFile file;
- int *errnum;
-{
- char *m;
- gz_stream *s = (gz_stream*)file;
-
- if (s == NULL) {
- *errnum = Z_STREAM_ERROR;
- return (const char*)ERR_MSG(Z_STREAM_ERROR);
- }
- *errnum = s->z_err;
- if (*errnum == Z_OK) return (const char*)"";
-
- m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
-
- if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
-
- TRYFREE(s->msg);
- s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
- if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR);
- strcpy(s->msg, s->path);
- strcat(s->msg, ": ");
- strcat(s->msg, m);
- return (const char*)s->msg;
-}
-
-/* ===========================================================================
- Clear the error and end-of-file flags, and do the same for the real file.
-*/
-void ZEXPORT gzclearerr (file)
- gzFile file;
-{
- gz_stream *s = (gz_stream*)file;
-
- if (s == NULL) return;
- if (s->z_err != Z_STREAM_END) s->z_err = Z_OK;
- s->z_eof = 0;
- clearerr(s->file);
-}
diff --git a/Utilities/Poco/Foundation/src/infback.c b/Utilities/Poco/Foundation/src/infback.c
deleted file mode 100755
index 455dbc9ee8..0000000000
--- a/Utilities/Poco/Foundation/src/infback.c
+++ /dev/null
@@ -1,623 +0,0 @@
-/* infback.c -- inflate using a call-back interface
- * Copyright (C) 1995-2005 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
- This code is largely copied from inflate.c. Normally either infback.o or
- inflate.o would be linked into an application--not both. The interface
- with inffast.c is retained so that optimized assembler-coded versions of
- inflate_fast() can be used with either inflate.c or infback.c.
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-/* function prototypes */
-local void fixedtables OF((struct inflate_state FAR *state));
-
-/*
- strm provides memory allocation functions in zalloc and zfree, or
- Z_NULL to use the library memory allocation functions.
-
- windowBits is in the range 8..15, and window is a user-supplied
- window and output buffer that is 2**windowBits bytes.
- */
-int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
-z_streamp strm;
-int windowBits;
-unsigned char FAR *window;
-const char *version;
-int stream_size;
-{
- struct inflate_state FAR *state;
-
- if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
- stream_size != (int)(sizeof(z_stream)))
- return Z_VERSION_ERROR;
- if (strm == Z_NULL || window == Z_NULL ||
- windowBits < 8 || windowBits > 15)
- return Z_STREAM_ERROR;
- strm->msg = Z_NULL; /* in case we return an error */
- if (strm->zalloc == (alloc_func)0) {
- strm->zalloc = zcalloc;
- strm->opaque = (voidpf)0;
- }
- if (strm->zfree == (free_func)0) strm->zfree = zcfree;
- state = (struct inflate_state FAR *)ZALLOC(strm, 1,
- sizeof(struct inflate_state));
- if (state == Z_NULL) return Z_MEM_ERROR;
- Tracev((stderr, "inflate: allocated\n"));
- strm->state = (struct internal_state FAR *)state;
- state->dmax = 32768U;
- state->wbits = windowBits;
- state->wsize = 1U << windowBits;
- state->window = window;
- state->write = 0;
- state->whave = 0;
- return Z_OK;
-}
-
-/*
- Return state with length and distance decoding tables and index sizes set to
- fixed code decoding. Normally this returns fixed tables from inffixed.h.
- If BUILDFIXED is defined, then instead this routine builds the tables the
- first time it's called, and returns those tables the first time and
- thereafter. This reduces the size of the code by about 2K bytes, in
- exchange for a little execution time. However, BUILDFIXED should not be
- used for threaded applications, since the rewriting of the tables and virgin
- may not be thread-safe.
- */
-local void fixedtables(state)
-struct inflate_state FAR *state;
-{
-#ifdef BUILDFIXED
- static int virgin = 1;
- static code *lenfix, *distfix;
- static code fixed[544];
-
- /* build fixed huffman tables if first call (may not be thread safe) */
- if (virgin) {
- unsigned sym, bits;
- static code *next;
-
- /* literal/length table */
- sym = 0;
- while (sym < 144) state->lens[sym++] = 8;
- while (sym < 256) state->lens[sym++] = 9;
- while (sym < 280) state->lens[sym++] = 7;
- while (sym < 288) state->lens[sym++] = 8;
- next = fixed;
- lenfix = next;
- bits = 9;
- inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
-
- /* distance table */
- sym = 0;
- while (sym < 32) state->lens[sym++] = 5;
- distfix = next;
- bits = 5;
- inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
-
- /* do this just once */
- virgin = 0;
- }
-#else /* !BUILDFIXED */
-# include "inffixed.h"
-#endif /* BUILDFIXED */
- state->lencode = lenfix;
- state->lenbits = 9;
- state->distcode = distfix;
- state->distbits = 5;
-}
-
-/* Macros for inflateBack(): */
-
-/* Load returned state from inflate_fast() */
-#define LOAD() \
- do { \
- put = strm->next_out; \
- left = strm->avail_out; \
- next = strm->next_in; \
- have = strm->avail_in; \
- hold = state->hold; \
- bits = state->bits; \
- } while (0)
-
-/* Set state from registers for inflate_fast() */
-#define RESTORE() \
- do { \
- strm->next_out = put; \
- strm->avail_out = left; \
- strm->next_in = next; \
- strm->avail_in = have; \
- state->hold = hold; \
- state->bits = bits; \
- } while (0)
-
-/* Clear the input bit accumulator */
-#define INITBITS() \
- do { \
- hold = 0; \
- bits = 0; \
- } while (0)
-
-/* Assure that some input is available. If input is requested, but denied,
- then return a Z_BUF_ERROR from inflateBack(). */
-#define PULL() \
- do { \
- if (have == 0) { \
- have = in(in_desc, &next); \
- if (have == 0) { \
- next = Z_NULL; \
- ret = Z_BUF_ERROR; \
- goto inf_leave; \
- } \
- } \
- } while (0)
-
-/* Get a byte of input into the bit accumulator, or return from inflateBack()
- with an error if there is no input available. */
-#define PULLBYTE() \
- do { \
- PULL(); \
- have--; \
- hold += (unsigned long)(*next++) << bits; \
- bits += 8; \
- } while (0)
-
-/* Assure that there are at least n bits in the bit accumulator. If there is
- not enough available input to do that, then return from inflateBack() with
- an error. */
-#define NEEDBITS(n) \
- do { \
- while (bits < (unsigned)(n)) \
- PULLBYTE(); \
- } while (0)
-
-/* Return the low n bits of the bit accumulator (n < 16) */
-#define BITS(n) \
- ((unsigned)hold & ((1U << (n)) - 1))
-
-/* Remove n bits from the bit accumulator */
-#define DROPBITS(n) \
- do { \
- hold >>= (n); \
- bits -= (unsigned)(n); \
- } while (0)
-
-/* Remove zero to seven bits as needed to go to a byte boundary */
-#define BYTEBITS() \
- do { \
- hold >>= bits & 7; \
- bits -= bits & 7; \
- } while (0)
-
-/* Assure that some output space is available, by writing out the window
- if it's full. If the write fails, return from inflateBack() with a
- Z_BUF_ERROR. */
-#define ROOM() \
- do { \
- if (left == 0) { \
- put = state->window; \
- left = state->wsize; \
- state->whave = left; \
- if (out(out_desc, put, left)) { \
- ret = Z_BUF_ERROR; \
- goto inf_leave; \
- } \
- } \
- } while (0)
-
-/*
- strm provides the memory allocation functions and window buffer on input,
- and provides information on the unused input on return. For Z_DATA_ERROR
- returns, strm will also provide an error message.
-
- in() and out() are the call-back input and output functions. When
- inflateBack() needs more input, it calls in(). When inflateBack() has
- filled the window with output, or when it completes with data in the
- window, it calls out() to write out the data. The application must not
- change the provided input until in() is called again or inflateBack()
- returns. The application must not change the window/output buffer until
- inflateBack() returns.
-
- in() and out() are called with a descriptor parameter provided in the
- inflateBack() call. This parameter can be a structure that provides the
- information required to do the read or write, as well as accumulated
- information on the input and output such as totals and check values.
-
- in() should return zero on failure. out() should return non-zero on
- failure. If either in() or out() fails, than inflateBack() returns a
- Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it
- was in() or out() that caused in the error. Otherwise, inflateBack()
- returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
- error, or Z_MEM_ERROR if it could not allocate memory for the state.
- inflateBack() can also return Z_STREAM_ERROR if the input parameters
- are not correct, i.e. strm is Z_NULL or the state was not initialized.
- */
-int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
-z_streamp strm;
-in_func in;
-void FAR *in_desc;
-out_func out;
-void FAR *out_desc;
-{
- struct inflate_state FAR *state;
- unsigned char FAR *next; /* next input */
- unsigned char FAR *put; /* next output */
- unsigned have, left; /* available input and output */
- unsigned long hold; /* bit buffer */
- unsigned bits; /* bits in bit buffer */
- unsigned copy; /* number of stored or match bytes to copy */
- unsigned char FAR *from; /* where to copy match bytes from */
- code this; /* current decoding table entry */
- code last; /* parent table entry */
- unsigned len; /* length to copy for repeats, bits to drop */
- int ret; /* return code */
- static const unsigned short order[19] = /* permutation of code lengths */
- {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
-
- /* Check that the strm exists and that the state was initialized */
- if (strm == Z_NULL || strm->state == Z_NULL)
- return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
-
- /* Reset the state */
- strm->msg = Z_NULL;
- state->mode = TYPE;
- state->last = 0;
- state->whave = 0;
- next = strm->next_in;
- have = next != Z_NULL ? strm->avail_in : 0;
- hold = 0;
- bits = 0;
- put = state->window;
- left = state->wsize;
-
- /* Inflate until end of block marked as last */
- for (;;)
- switch (state->mode) {
- case TYPE:
- /* determine and dispatch block type */
- if (state->last) {
- BYTEBITS();
- state->mode = DONE;
- break;
- }
- NEEDBITS(3);
- state->last = BITS(1);
- DROPBITS(1);
- switch (BITS(2)) {
- case 0: /* stored block */
- Tracev((stderr, "inflate: stored block%s\n",
- state->last ? " (last)" : ""));
- state->mode = STORED;
- break;
- case 1: /* fixed block */
- fixedtables(state);
- Tracev((stderr, "inflate: fixed codes block%s\n",
- state->last ? " (last)" : ""));
- state->mode = LEN; /* decode codes */
- break;
- case 2: /* dynamic block */
- Tracev((stderr, "inflate: dynamic codes block%s\n",
- state->last ? " (last)" : ""));
- state->mode = TABLE;
- break;
- case 3:
- strm->msg = (char *)"invalid block type";
- state->mode = BAD;
- }
- DROPBITS(2);
- break;
-
- case STORED:
- /* get and verify stored block length */
- BYTEBITS(); /* go to byte boundary */
- NEEDBITS(32);
- if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
- strm->msg = (char *)"invalid stored block lengths";
- state->mode = BAD;
- break;
- }
- state->length = (unsigned)hold & 0xffff;
- Tracev((stderr, "inflate: stored length %u\n",
- state->length));
- INITBITS();
-
- /* copy stored block from input to output */
- while (state->length != 0) {
- copy = state->length;
- PULL();
- ROOM();
- if (copy > have) copy = have;
- if (copy > left) copy = left;
- zmemcpy(put, next, copy);
- have -= copy;
- next += copy;
- left -= copy;
- put += copy;
- state->length -= copy;
- }
- Tracev((stderr, "inflate: stored end\n"));
- state->mode = TYPE;
- break;
-
- case TABLE:
- /* get dynamic table entries descriptor */
- NEEDBITS(14);
- state->nlen = BITS(5) + 257;
- DROPBITS(5);
- state->ndist = BITS(5) + 1;
- DROPBITS(5);
- state->ncode = BITS(4) + 4;
- DROPBITS(4);
-#ifndef PKZIP_BUG_WORKAROUND
- if (state->nlen > 286 || state->ndist > 30) {
- strm->msg = (char *)"too many length or distance symbols";
- state->mode = BAD;
- break;
- }
-#endif
- Tracev((stderr, "inflate: table sizes ok\n"));
-
- /* get code length code lengths (not a typo) */
- state->have = 0;
- while (state->have < state->ncode) {
- NEEDBITS(3);
- state->lens[order[state->have++]] = (unsigned short)BITS(3);
- DROPBITS(3);
- }
- while (state->have < 19)
- state->lens[order[state->have++]] = 0;
- state->next = state->codes;
- state->lencode = (code const FAR *)(state->next);
- state->lenbits = 7;
- ret = inflate_table(CODES, state->lens, 19, &(state->next),
- &(state->lenbits), state->work);
- if (ret) {
- strm->msg = (char *)"invalid code lengths set";
- state->mode = BAD;
- break;
- }
- Tracev((stderr, "inflate: code lengths ok\n"));
-
- /* get length and distance code code lengths */
- state->have = 0;
- while (state->have < state->nlen + state->ndist) {
- for (;;) {
- this = state->lencode[BITS(state->lenbits)];
- if ((unsigned)(this.bits) <= bits) break;
- PULLBYTE();
- }
- if (this.val < 16) {
- NEEDBITS(this.bits);
- DROPBITS(this.bits);
- state->lens[state->have++] = this.val;
- }
- else {
- if (this.val == 16) {
- NEEDBITS(this.bits + 2);
- DROPBITS(this.bits);
- if (state->have == 0) {
- strm->msg = (char *)"invalid bit length repeat";
- state->mode = BAD;
- break;
- }
- len = (unsigned)(state->lens[state->have - 1]);
- copy = 3 + BITS(2);
- DROPBITS(2);
- }
- else if (this.val == 17) {
- NEEDBITS(this.bits + 3);
- DROPBITS(this.bits);
- len = 0;
- copy = 3 + BITS(3);
- DROPBITS(3);
- }
- else {
- NEEDBITS(this.bits + 7);
- DROPBITS(this.bits);
- len = 0;
- copy = 11 + BITS(7);
- DROPBITS(7);
- }
- if (state->have + copy > state->nlen + state->ndist) {
- strm->msg = (char *)"invalid bit length repeat";
- state->mode = BAD;
- break;
- }
- while (copy--)
- state->lens[state->have++] = (unsigned short)len;
- }
- }
-
- /* handle error breaks in while */
- if (state->mode == BAD) break;
-
- /* build code tables */
- state->next = state->codes;
- state->lencode = (code const FAR *)(state->next);
- state->lenbits = 9;
- ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
- &(state->lenbits), state->work);
- if (ret) {
- strm->msg = (char *)"invalid literal/lengths set";
- state->mode = BAD;
- break;
- }
- state->distcode = (code const FAR *)(state->next);
- state->distbits = 6;
- ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
- &(state->next), &(state->distbits), state->work);
- if (ret) {
- strm->msg = (char *)"invalid distances set";
- state->mode = BAD;
- break;
- }
- Tracev((stderr, "inflate: codes ok\n"));
- state->mode = LEN;
-
- case LEN:
- /* use inflate_fast() if we have enough input and output */
- if (have >= 6 && left >= 258) {
- RESTORE();
- if (state->whave < state->wsize)
- state->whave = state->wsize - left;
- inflate_fast(strm, state->wsize);
- LOAD();
- break;
- }
-
- /* get a literal, length, or end-of-block code */
- for (;;) {
- this = state->lencode[BITS(state->lenbits)];
- if ((unsigned)(this.bits) <= bits) break;
- PULLBYTE();
- }
- if (this.op && (this.op & 0xf0) == 0) {
- last = this;
- for (;;) {
- this = state->lencode[last.val +
- (BITS(last.bits + last.op) >> last.bits)];
- if ((unsigned)(last.bits + this.bits) <= bits) break;
- PULLBYTE();
- }
- DROPBITS(last.bits);
- }
- DROPBITS(this.bits);
- state->length = (unsigned)this.val;
-
- /* process literal */
- if (this.op == 0) {
- Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
- "inflate: literal '%c'\n" :
- "inflate: literal 0x%02x\n", this.val));
- ROOM();
- *put++ = (unsigned char)(state->length);
- left--;
- state->mode = LEN;
- break;
- }
-
- /* process end of block */
- if (this.op & 32) {
- Tracevv((stderr, "inflate: end of block\n"));
- state->mode = TYPE;
- break;
- }
-
- /* invalid code */
- if (this.op & 64) {
- strm->msg = (char *)"invalid literal/length code";
- state->mode = BAD;
- break;
- }
-
- /* length code -- get extra bits, if any */
- state->extra = (unsigned)(this.op) & 15;
- if (state->extra != 0) {
- NEEDBITS(state->extra);
- state->length += BITS(state->extra);
- DROPBITS(state->extra);
- }
- Tracevv((stderr, "inflate: length %u\n", state->length));
-
- /* get distance code */
- for (;;) {
- this = state->distcode[BITS(state->distbits)];
- if ((unsigned)(this.bits) <= bits) break;
- PULLBYTE();
- }
- if ((this.op & 0xf0) == 0) {
- last = this;
- for (;;) {
- this = state->distcode[last.val +
- (BITS(last.bits + last.op) >> last.bits)];
- if ((unsigned)(last.bits + this.bits) <= bits) break;
- PULLBYTE();
- }
- DROPBITS(last.bits);
- }
- DROPBITS(this.bits);
- if (this.op & 64) {
- strm->msg = (char *)"invalid distance code";
- state->mode = BAD;
- break;
- }
- state->offset = (unsigned)this.val;
-
- /* get distance extra bits, if any */
- state->extra = (unsigned)(this.op) & 15;
- if (state->extra != 0) {
- NEEDBITS(state->extra);
- state->offset += BITS(state->extra);
- DROPBITS(state->extra);
- }
- if (state->offset > state->wsize - (state->whave < state->wsize ?
- left : 0)) {
- strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
- }
- Tracevv((stderr, "inflate: distance %u\n", state->offset));
-
- /* copy match from window to output */
- do {
- ROOM();
- copy = state->wsize - state->offset;
- if (copy < left) {
- from = put + copy;
- copy = left - copy;
- }
- else {
- from = put - state->offset;
- copy = left;
- }
- if (copy > state->length) copy = state->length;
- state->length -= copy;
- left -= copy;
- do {
- *put++ = *from++;
- } while (--copy);
- } while (state->length != 0);
- break;
-
- case DONE:
- /* inflate stream terminated properly -- write leftover output */
- ret = Z_STREAM_END;
- if (left < state->wsize) {
- if (out(out_desc, state->window, state->wsize - left))
- ret = Z_BUF_ERROR;
- }
- goto inf_leave;
-
- case BAD:
- ret = Z_DATA_ERROR;
- goto inf_leave;
-
- default: /* can't happen, but makes compilers happy */
- ret = Z_STREAM_ERROR;
- goto inf_leave;
- }
-
- /* Return unused input */
- inf_leave:
- strm->next_in = next;
- strm->avail_in = have;
- return ret;
-}
-
-int ZEXPORT inflateBackEnd(strm)
-z_streamp strm;
-{
- if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
- return Z_STREAM_ERROR;
- ZFREE(strm, strm->state);
- strm->state = Z_NULL;
- Tracev((stderr, "inflate: end\n"));
- return Z_OK;
-}
diff --git a/Utilities/Poco/Foundation/src/inffast.c b/Utilities/Poco/Foundation/src/inffast.c
deleted file mode 100755
index bbee92ed1e..0000000000
--- a/Utilities/Poco/Foundation/src/inffast.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/* inffast.c -- fast decoding
- * Copyright (C) 1995-2004 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-#ifndef ASMINF
-
-/* Allow machine dependent optimization for post-increment or pre-increment.
- Based on testing to date,
- Pre-increment preferred for:
- - PowerPC G3 (Adler)
- - MIPS R5000 (Randers-Pehrson)
- Post-increment preferred for:
- - none
- No measurable difference:
- - Pentium III (Anderson)
- - M68060 (Nikl)
- */
-#ifdef POSTINC
-# define OFF 0
-# define PUP(a) *(a)++
-#else
-# define OFF 1
-# define PUP(a) *++(a)
-#endif
-
-/*
- Decode literal, length, and distance codes and write out the resulting
- literal and match bytes until either not enough input or output is
- available, an end-of-block is encountered, or a data error is encountered.
- When large enough input and output buffers are supplied to inflate(), for
- example, a 16K input buffer and a 64K output buffer, more than 95% of the
- inflate execution time is spent in this routine.
-
- Entry assumptions:
-
- state->mode == LEN
- strm->avail_in >= 6
- strm->avail_out >= 258
- start >= strm->avail_out
- state->bits < 8
-
- On return, state->mode is one of:
-
- LEN -- ran out of enough output space or enough available input
- TYPE -- reached end of block code, inflate() to interpret next block
- BAD -- error in block data
-
- Notes:
-
- - The maximum input bits used by a length/distance pair is 15 bits for the
- length code, 5 bits for the length extra, 15 bits for the distance code,
- and 13 bits for the distance extra. This totals 48 bits, or six bytes.
- Therefore if strm->avail_in >= 6, then there is enough input to avoid
- checking for available input while decoding.
-
- - The maximum bytes that a single length/distance pair can output is 258
- bytes, which is the maximum length that can be coded. inflate_fast()
- requires strm->avail_out >= 258 for each loop to avoid checking for
- output space.
- */
-void inflate_fast(strm, start)
-z_streamp strm;
-unsigned start; /* inflate()'s starting value for strm->avail_out */
-{
- struct inflate_state FAR *state;
- unsigned char FAR *in; /* local strm->next_in */
- unsigned char FAR *last; /* while in < last, enough input available */
- unsigned char FAR *out; /* local strm->next_out */
- unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
- unsigned char FAR *end; /* while out < end, enough space available */
-#ifdef INFLATE_STRICT
- unsigned dmax; /* maximum distance from zlib header */
-#endif
- unsigned wsize; /* window size or zero if not using window */
- unsigned whave; /* valid bytes in the window */
- unsigned write; /* window write index */
- unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
- unsigned long hold; /* local strm->hold */
- unsigned bits; /* local strm->bits */
- code const FAR *lcode; /* local strm->lencode */
- code const FAR *dcode; /* local strm->distcode */
- unsigned lmask; /* mask for first level of length codes */
- unsigned dmask; /* mask for first level of distance codes */
- code this; /* retrieved table entry */
- unsigned op; /* code bits, operation, extra bits, or */
- /* window position, window bytes to copy */
- unsigned len; /* match length, unused bytes */
- unsigned dist; /* match distance */
- unsigned char FAR *from; /* where to copy match from */
-
- /* copy state to local variables */
- state = (struct inflate_state FAR *)strm->state;
- in = strm->next_in - OFF;
- last = in + (strm->avail_in - 5);
- out = strm->next_out - OFF;
- beg = out - (start - strm->avail_out);
- end = out + (strm->avail_out - 257);
-#ifdef INFLATE_STRICT
- dmax = state->dmax;
-#endif
- wsize = state->wsize;
- whave = state->whave;
- write = state->write;
- window = state->window;
- hold = state->hold;
- bits = state->bits;
- lcode = state->lencode;
- dcode = state->distcode;
- lmask = (1U << state->lenbits) - 1;
- dmask = (1U << state->distbits) - 1;
-
- /* decode literals and length/distances until end-of-block or not enough
- input data or output space */
- do {
- if (bits < 15) {
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- }
- this = lcode[hold & lmask];
- dolen:
- op = (unsigned)(this.bits);
- hold >>= op;
- bits -= op;
- op = (unsigned)(this.op);
- if (op == 0) { /* literal */
- Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
- "inflate: literal '%c'\n" :
- "inflate: literal 0x%02x\n", this.val));
- PUP(out) = (unsigned char)(this.val);
- }
- else if (op & 16) { /* length base */
- len = (unsigned)(this.val);
- op &= 15; /* number of extra bits */
- if (op) {
- if (bits < op) {
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- }
- len += (unsigned)hold & ((1U << op) - 1);
- hold >>= op;
- bits -= op;
- }
- Tracevv((stderr, "inflate: length %u\n", len));
- if (bits < 15) {
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- }
- this = dcode[hold & dmask];
- dodist:
- op = (unsigned)(this.bits);
- hold >>= op;
- bits -= op;
- op = (unsigned)(this.op);
- if (op & 16) { /* distance base */
- dist = (unsigned)(this.val);
- op &= 15; /* number of extra bits */
- if (bits < op) {
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- if (bits < op) {
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- }
- }
- dist += (unsigned)hold & ((1U << op) - 1);
-#ifdef INFLATE_STRICT
- if (dist > dmax) {
- strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
- }
-#endif
- hold >>= op;
- bits -= op;
- Tracevv((stderr, "inflate: distance %u\n", dist));
- op = (unsigned)(out - beg); /* max distance in output */
- if (dist > op) { /* see if copy from window */
- op = dist - op; /* distance back in window */
- if (op > whave) {
- strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
- }
- from = window - OFF;
- if (write == 0) { /* very common case */
- from += wsize - op;
- if (op < len) { /* some from window */
- len -= op;
- do {
- PUP(out) = PUP(from);
- } while (--op);
- from = out - dist; /* rest from output */
- }
- }
- else if (write < op) { /* wrap around window */
- from += wsize + write - op;
- op -= write;
- if (op < len) { /* some from end of window */
- len -= op;
- do {
- PUP(out) = PUP(from);
- } while (--op);
- from = window - OFF;
- if (write < len) { /* some from start of window */
- op = write;
- len -= op;
- do {
- PUP(out) = PUP(from);
- } while (--op);
- from = out - dist; /* rest from output */
- }
- }
- }
- else { /* contiguous in window */
- from += write - op;
- if (op < len) { /* some from window */
- len -= op;
- do {
- PUP(out) = PUP(from);
- } while (--op);
- from = out - dist; /* rest from output */
- }
- }
- while (len > 2) {
- PUP(out) = PUP(from);
- PUP(out) = PUP(from);
- PUP(out) = PUP(from);
- len -= 3;
- }
- if (len) {
- PUP(out) = PUP(from);
- if (len > 1)
- PUP(out) = PUP(from);
- }
- }
- else {
- from = out - dist; /* copy direct from output */
- do { /* minimum length is three */
- PUP(out) = PUP(from);
- PUP(out) = PUP(from);
- PUP(out) = PUP(from);
- len -= 3;
- } while (len > 2);
- if (len) {
- PUP(out) = PUP(from);
- if (len > 1)
- PUP(out) = PUP(from);
- }
- }
- }
- else if ((op & 64) == 0) { /* 2nd level distance code */
- this = dcode[this.val + (hold & ((1U << op) - 1))];
- goto dodist;
- }
- else {
- strm->msg = (char *)"invalid distance code";
- state->mode = BAD;
- break;
- }
- }
- else if ((op & 64) == 0) { /* 2nd level length code */
- this = lcode[this.val + (hold & ((1U << op) - 1))];
- goto dolen;
- }
- else if (op & 32) { /* end-of-block */
- Tracevv((stderr, "inflate: end of block\n"));
- state->mode = TYPE;
- break;
- }
- else {
- strm->msg = (char *)"invalid literal/length code";
- state->mode = BAD;
- break;
- }
- } while (in < last && out < end);
-
- /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
- len = bits >> 3;
- in -= len;
- bits -= len << 3;
- hold &= (1U << bits) - 1;
-
- /* update state and return */
- strm->next_in = in + OFF;
- strm->next_out = out + OFF;
- strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
- strm->avail_out = (unsigned)(out < end ?
- 257 + (end - out) : 257 - (out - end));
- state->hold = hold;
- state->bits = bits;
- return;
-}
-
-/*
- inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
- - Using bit fields for code structure
- - Different op definition to avoid & for extra bits (do & for table bits)
- - Three separate decoding do-loops for direct, window, and write == 0
- - Special case for distance > 1 copies to do overlapped load and store copy
- - Explicit branch predictions (based on measured branch probabilities)
- - Deferring match copy and interspersed it with decoding subsequent codes
- - Swapping literal/length else
- - Swapping window/direct else
- - Larger unrolled copy loops (three is about right)
- - Moving len -= 3 statement into middle of loop
- */
-
-#endif /* !ASMINF */
diff --git a/Utilities/Poco/Foundation/src/inffast.h b/Utilities/Poco/Foundation/src/inffast.h
deleted file mode 100755
index 1e88d2d97b..0000000000
--- a/Utilities/Poco/Foundation/src/inffast.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-2003 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-void inflate_fast OF((z_streamp strm, unsigned start));
diff --git a/Utilities/Poco/Foundation/src/inffixed.h b/Utilities/Poco/Foundation/src/inffixed.h
deleted file mode 100755
index 75ed4b5978..0000000000
--- a/Utilities/Poco/Foundation/src/inffixed.h
+++ /dev/null
@@ -1,94 +0,0 @@
- /* inffixed.h -- table for decoding fixed codes
- * Generated automatically by makefixed().
- */
-
- /* WARNING: this file should *not* be used by applications. It
- is part of the implementation of the compression library and
- is subject to change. Applications should only use zlib.h.
- */
-
- static const code lenfix[512] = {
- {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
- {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
- {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
- {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
- {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
- {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
- {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
- {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
- {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
- {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
- {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
- {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
- {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
- {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
- {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
- {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
- {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
- {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
- {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
- {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
- {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
- {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
- {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
- {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
- {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
- {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
- {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
- {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
- {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
- {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
- {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
- {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
- {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
- {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
- {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
- {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
- {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
- {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
- {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
- {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
- {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
- {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
- {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
- {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
- {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
- {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
- {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
- {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
- {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
- {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
- {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
- {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
- {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
- {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
- {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
- {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
- {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
- {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
- {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
- {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
- {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
- {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
- {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
- {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
- {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
- {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
- {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
- {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
- {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
- {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
- {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
- {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
- {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
- {0,9,255}
- };
-
- static const code distfix[32] = {
- {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
- {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
- {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
- {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
- {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
- {22,5,193},{64,5,0}
- };
diff --git a/Utilities/Poco/Foundation/src/inflate.c b/Utilities/Poco/Foundation/src/inflate.c
deleted file mode 100755
index 792fdee8e9..0000000000
--- a/Utilities/Poco/Foundation/src/inflate.c
+++ /dev/null
@@ -1,1368 +0,0 @@
-/* inflate.c -- zlib decompression
- * Copyright (C) 1995-2005 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
- * Change history:
- *
- * 1.2.beta0 24 Nov 2002
- * - First version -- complete rewrite of inflate to simplify code, avoid
- * creation of window when not needed, minimize use of window when it is
- * needed, make inffast.c even faster, implement gzip decoding, and to
- * improve code readability and style over the previous zlib inflate code
- *
- * 1.2.beta1 25 Nov 2002
- * - Use pointers for available input and output checking in inffast.c
- * - Remove input and output counters in inffast.c
- * - Change inffast.c entry and loop from avail_in >= 7 to >= 6
- * - Remove unnecessary second byte pull from length extra in inffast.c
- * - Unroll direct copy to three copies per loop in inffast.c
- *
- * 1.2.beta2 4 Dec 2002
- * - Change external routine names to reduce potential conflicts
- * - Correct filename to inffixed.h for fixed tables in inflate.c
- * - Make hbuf[] unsigned char to match parameter type in inflate.c
- * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
- * to avoid negation problem on Alphas (64 bit) in inflate.c
- *
- * 1.2.beta3 22 Dec 2002
- * - Add comments on state->bits assertion in inffast.c
- * - Add comments on op field in inftrees.h
- * - Fix bug in reuse of allocated window after inflateReset()
- * - Remove bit fields--back to byte structure for speed
- * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths
- * - Change post-increments to pre-increments in inflate_fast(), PPC biased?
- * - Add compile time option, POSTINC, to use post-increments instead (Intel?)
- * - Make MATCH copy in inflate() much faster for when inflate_fast() not used
- * - Use local copies of stream next and avail values, as well as local bit
- * buffer and bit count in inflate()--for speed when inflate_fast() not used
- *
- * 1.2.beta4 1 Jan 2003
- * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings
- * - Move a comment on output buffer sizes from inffast.c to inflate.c
- * - Add comments in inffast.c to introduce the inflate_fast() routine
- * - Rearrange window copies in inflate_fast() for speed and simplification
- * - Unroll last copy for window match in inflate_fast()
- * - Use local copies of window variables in inflate_fast() for speed
- * - Pull out common write == 0 case for speed in inflate_fast()
- * - Make op and len in inflate_fast() unsigned for consistency
- * - Add FAR to lcode and dcode declarations in inflate_fast()
- * - Simplified bad distance check in inflate_fast()
- * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new
- * source file infback.c to provide a call-back interface to inflate for
- * programs like gzip and unzip -- uses window as output buffer to avoid
- * window copying
- *
- * 1.2.beta5 1 Jan 2003
- * - Improved inflateBack() interface to allow the caller to provide initial
- * input in strm.
- * - Fixed stored blocks bug in inflateBack()
- *
- * 1.2.beta6 4 Jan 2003
- * - Added comments in inffast.c on effectiveness of POSTINC
- * - Typecasting all around to reduce compiler warnings
- * - Changed loops from while (1) or do {} while (1) to for (;;), again to
- * make compilers happy
- * - Changed type of window in inflateBackInit() to unsigned char *
- *
- * 1.2.beta7 27 Jan 2003
- * - Changed many types to unsigned or unsigned short to avoid warnings
- * - Added inflateCopy() function
- *
- * 1.2.0 9 Mar 2003
- * - Changed inflateBack() interface to provide separate opaque descriptors
- * for the in() and out() functions
- * - Changed inflateBack() argument and in_func typedef to swap the length
- * and buffer address return values for the input function
- * - Check next_in and next_out for Z_NULL on entry to inflate()
- *
- * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-#ifdef MAKEFIXED
-# ifndef BUILDFIXED
-# define BUILDFIXED
-# endif
-#endif
-
-/* function prototypes */
-local void fixedtables OF((struct inflate_state FAR *state));
-local int updatewindow OF((z_streamp strm, unsigned out));
-#ifdef BUILDFIXED
- void makefixed OF((void));
-#endif
-local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf,
- unsigned len));
-
-int ZEXPORT inflateReset(strm)
-z_streamp strm;
-{
- struct inflate_state FAR *state;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- strm->total_in = strm->total_out = state->total = 0;
- strm->msg = Z_NULL;
- strm->adler = 1; /* to support ill-conceived Java test suite */
- state->mode = HEAD;
- state->last = 0;
- state->havedict = 0;
- state->dmax = 32768U;
- state->head = Z_NULL;
- state->wsize = 0;
- state->whave = 0;
- state->write = 0;
- state->hold = 0;
- state->bits = 0;
- state->lencode = state->distcode = state->next = state->codes;
- Tracev((stderr, "inflate: reset\n"));
- return Z_OK;
-}
-
-int ZEXPORT inflatePrime(strm, bits, value)
-z_streamp strm;
-int bits;
-int value;
-{
- struct inflate_state FAR *state;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
- value &= (1L << bits) - 1;
- state->hold += value << state->bits;
- state->bits += bits;
- return Z_OK;
-}
-
-int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
-z_streamp strm;
-int windowBits;
-const char *version;
-int stream_size;
-{
- struct inflate_state FAR *state;
-
- if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
- stream_size != (int)(sizeof(z_stream)))
- return Z_VERSION_ERROR;
- if (strm == Z_NULL) return Z_STREAM_ERROR;
- strm->msg = Z_NULL; /* in case we return an error */
- if (strm->zalloc == (alloc_func)0) {
- strm->zalloc = zcalloc;
- strm->opaque = (voidpf)0;
- }
- if (strm->zfree == (free_func)0) strm->zfree = zcfree;
- state = (struct inflate_state FAR *)
- ZALLOC(strm, 1, sizeof(struct inflate_state));
- if (state == Z_NULL) return Z_MEM_ERROR;
- Tracev((stderr, "inflate: allocated\n"));
- strm->state = (struct internal_state FAR *)state;
- if (windowBits < 0) {
- state->wrap = 0;
- windowBits = -windowBits;
- }
- else {
- state->wrap = (windowBits >> 4) + 1;
-#ifdef GUNZIP
- if (windowBits < 48) windowBits &= 15;
-#endif
- }
- if (windowBits < 8 || windowBits > 15) {
- ZFREE(strm, state);
- strm->state = Z_NULL;
- return Z_STREAM_ERROR;
- }
- state->wbits = (unsigned)windowBits;
- state->window = Z_NULL;
- return inflateReset(strm);
-}
-
-int ZEXPORT inflateInit_(strm, version, stream_size)
-z_streamp strm;
-const char *version;
-int stream_size;
-{
- return inflateInit2_(strm, DEF_WBITS, version, stream_size);
-}
-
-/*
- Return state with length and distance decoding tables and index sizes set to
- fixed code decoding. Normally this returns fixed tables from inffixed.h.
- If BUILDFIXED is defined, then instead this routine builds the tables the
- first time it's called, and returns those tables the first time and
- thereafter. This reduces the size of the code by about 2K bytes, in
- exchange for a little execution time. However, BUILDFIXED should not be
- used for threaded applications, since the rewriting of the tables and virgin
- may not be thread-safe.
- */
-local void fixedtables(state)
-struct inflate_state FAR *state;
-{
-#ifdef BUILDFIXED
- static int virgin = 1;
- static code *lenfix, *distfix;
- static code fixed[544];
-
- /* build fixed huffman tables if first call (may not be thread safe) */
- if (virgin) {
- unsigned sym, bits;
- static code *next;
-
- /* literal/length table */
- sym = 0;
- while (sym < 144) state->lens[sym++] = 8;
- while (sym < 256) state->lens[sym++] = 9;
- while (sym < 280) state->lens[sym++] = 7;
- while (sym < 288) state->lens[sym++] = 8;
- next = fixed;
- lenfix = next;
- bits = 9;
- inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
-
- /* distance table */
- sym = 0;
- while (sym < 32) state->lens[sym++] = 5;
- distfix = next;
- bits = 5;
- inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
-
- /* do this just once */
- virgin = 0;
- }
-#else /* !BUILDFIXED */
-# include "inffixed.h"
-#endif /* BUILDFIXED */
- state->lencode = lenfix;
- state->lenbits = 9;
- state->distcode = distfix;
- state->distbits = 5;
-}
-
-#ifdef MAKEFIXED
-#include <stdio.h>
-
-/*
- Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also
- defines BUILDFIXED, so the tables are built on the fly. makefixed() writes
- those tables to stdout, which would be piped to inffixed.h. A small program
- can simply call makefixed to do this:
-
- void makefixed(void);
-
- int main(void)
- {
- makefixed();
- return 0;
- }
-
- Then that can be linked with zlib built with MAKEFIXED defined and run:
-
- a.out > inffixed.h
- */
-void makefixed()
-{
- unsigned low, size;
- struct inflate_state state;
-
- fixedtables(&state);
- puts(" /* inffixed.h -- table for decoding fixed codes");
- puts(" * Generated automatically by makefixed().");
- puts(" */");
- puts("");
- puts(" /* WARNING: this file should *not* be used by applications.");
- puts(" It is part of the implementation of this library and is");
- puts(" subject to change. Applications should only use zlib.h.");
- puts(" */");
- puts("");
- size = 1U << 9;
- printf(" static const code lenfix[%u] = {", size);
- low = 0;
- for (;;) {
- if ((low % 7) == 0) printf("\n ");
- printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits,
- state.lencode[low].val);
- if (++low == size) break;
- putchar(',');
- }
- puts("\n };");
- size = 1U << 5;
- printf("\n static const code distfix[%u] = {", size);
- low = 0;
- for (;;) {
- if ((low % 6) == 0) printf("\n ");
- printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
- state.distcode[low].val);
- if (++low == size) break;
- putchar(',');
- }
- puts("\n };");
-}
-#endif /* MAKEFIXED */
-
-/*
- Update the window with the last wsize (normally 32K) bytes written before
- returning. If window does not exist yet, create it. This is only called
- when a window is already in use, or when output has been written during this
- inflate call, but the end of the deflate stream has not been reached yet.
- It is also called to create a window for dictionary data when a dictionary
- is loaded.
-
- Providing output buffers larger than 32K to inflate() should provide a speed
- advantage, since only the last 32K of output is copied to the sliding window
- upon return from inflate(), and since all distances after the first 32K of
- output will fall in the output data, making match copies simpler and faster.
- The advantage may be dependent on the size of the processor's data caches.
- */
-local int updatewindow(strm, out)
-z_streamp strm;
-unsigned out;
-{
- struct inflate_state FAR *state;
- unsigned copy, dist;
-
- state = (struct inflate_state FAR *)strm->state;
-
- /* if it hasn't been done already, allocate space for the window */
- if (state->window == Z_NULL) {
- state->window = (unsigned char FAR *)
- ZALLOC(strm, 1U << state->wbits,
- sizeof(unsigned char));
- if (state->window == Z_NULL) return 1;
- }
-
- /* if window not in use yet, initialize */
- if (state->wsize == 0) {
- state->wsize = 1U << state->wbits;
- state->write = 0;
- state->whave = 0;
- }
-
- /* copy state->wsize or less output bytes into the circular window */
- copy = out - strm->avail_out;
- if (copy >= state->wsize) {
- zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
- state->write = 0;
- state->whave = state->wsize;
- }
- else {
- dist = state->wsize - state->write;
- if (dist > copy) dist = copy;
- zmemcpy(state->window + state->write, strm->next_out - copy, dist);
- copy -= dist;
- if (copy) {
- zmemcpy(state->window, strm->next_out - copy, copy);
- state->write = copy;
- state->whave = state->wsize;
- }
- else {
- state->write += dist;
- if (state->write == state->wsize) state->write = 0;
- if (state->whave < state->wsize) state->whave += dist;
- }
- }
- return 0;
-}
-
-/* Macros for inflate(): */
-
-/* check function to use adler32() for zlib or crc32() for gzip */
-#ifdef GUNZIP
-# define UPDATE(check, buf, len) \
- (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
-#else
-# define UPDATE(check, buf, len) adler32(check, buf, len)
-#endif
-
-/* check macros for header crc */
-#ifdef GUNZIP
-# define CRC2(check, word) \
- do { \
- hbuf[0] = (unsigned char)(word); \
- hbuf[1] = (unsigned char)((word) >> 8); \
- check = crc32(check, hbuf, 2); \
- } while (0)
-
-# define CRC4(check, word) \
- do { \
- hbuf[0] = (unsigned char)(word); \
- hbuf[1] = (unsigned char)((word) >> 8); \
- hbuf[2] = (unsigned char)((word) >> 16); \
- hbuf[3] = (unsigned char)((word) >> 24); \
- check = crc32(check, hbuf, 4); \
- } while (0)
-#endif
-
-/* Load registers with state in inflate() for speed */
-#define LOAD() \
- do { \
- put = strm->next_out; \
- left = strm->avail_out; \
- next = strm->next_in; \
- have = strm->avail_in; \
- hold = state->hold; \
- bits = state->bits; \
- } while (0)
-
-/* Restore state from registers in inflate() */
-#define RESTORE() \
- do { \
- strm->next_out = put; \
- strm->avail_out = left; \
- strm->next_in = next; \
- strm->avail_in = have; \
- state->hold = hold; \
- state->bits = bits; \
- } while (0)
-
-/* Clear the input bit accumulator */
-#define INITBITS() \
- do { \
- hold = 0; \
- bits = 0; \
- } while (0)
-
-/* Get a byte of input into the bit accumulator, or return from inflate()
- if there is no input available. */
-#define PULLBYTE() \
- do { \
- if (have == 0) goto inf_leave; \
- have--; \
- hold += (unsigned long)(*next++) << bits; \
- bits += 8; \
- } while (0)
-
-/* Assure that there are at least n bits in the bit accumulator. If there is
- not enough available input to do that, then return from inflate(). */
-#define NEEDBITS(n) \
- do { \
- while (bits < (unsigned)(n)) \
- PULLBYTE(); \
- } while (0)
-
-/* Return the low n bits of the bit accumulator (n < 16) */
-#define BITS(n) \
- ((unsigned)hold & ((1U << (n)) - 1))
-
-/* Remove n bits from the bit accumulator */
-#define DROPBITS(n) \
- do { \
- hold >>= (n); \
- bits -= (unsigned)(n); \
- } while (0)
-
-/* Remove zero to seven bits as needed to go to a byte boundary */
-#define BYTEBITS() \
- do { \
- hold >>= bits & 7; \
- bits -= bits & 7; \
- } while (0)
-
-/* Reverse the bytes in a 32-bit value */
-#define REVERSE(q) \
- ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
- (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
-
-/*
- inflate() uses a state machine to process as much input data and generate as
- much output data as possible before returning. The state machine is
- structured roughly as follows:
-
- for (;;) switch (state) {
- ...
- case STATEn:
- if (not enough input data or output space to make progress)
- return;
- ... make progress ...
- state = STATEm;
- break;
- ...
- }
-
- so when inflate() is called again, the same case is attempted again, and
- if the appropriate resources are provided, the machine proceeds to the
- next state. The NEEDBITS() macro is usually the way the state evaluates
- whether it can proceed or should return. NEEDBITS() does the return if
- the requested bits are not available. The typical use of the BITS macros
- is:
-
- NEEDBITS(n);
- ... do something with BITS(n) ...
- DROPBITS(n);
-
- where NEEDBITS(n) either returns from inflate() if there isn't enough
- input left to load n bits into the accumulator, or it continues. BITS(n)
- gives the low n bits in the accumulator. When done, DROPBITS(n) drops
- the low n bits off the accumulator. INITBITS() clears the accumulator
- and sets the number of available bits to zero. BYTEBITS() discards just
- enough bits to put the accumulator on a byte boundary. After BYTEBITS()
- and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
-
- NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
- if there is no input available. The decoding of variable length codes uses
- PULLBYTE() directly in order to pull just enough bytes to decode the next
- code, and no more.
-
- Some states loop until they get enough input, making sure that enough
- state information is maintained to continue the loop where it left off
- if NEEDBITS() returns in the loop. For example, want, need, and keep
- would all have to actually be part of the saved state in case NEEDBITS()
- returns:
-
- case STATEw:
- while (want < need) {
- NEEDBITS(n);
- keep[want++] = BITS(n);
- DROPBITS(n);
- }
- state = STATEx;
- case STATEx:
-
- As shown above, if the next state is also the next case, then the break
- is omitted.
-
- A state may also return if there is not enough output space available to
- complete that state. Those states are copying stored data, writing a
- literal byte, and copying a matching string.
-
- When returning, a "goto inf_leave" is used to update the total counters,
- update the check value, and determine whether any progress has been made
- during that inflate() call in order to return the proper return code.
- Progress is defined as a change in either strm->avail_in or strm->avail_out.
- When there is a window, goto inf_leave will update the window with the last
- output written. If a goto inf_leave occurs in the middle of decompression
- and there is no window currently, goto inf_leave will create one and copy
- output to the window for the next call of inflate().
-
- In this implementation, the flush parameter of inflate() only affects the
- return code (per zlib.h). inflate() always writes as much as possible to
- strm->next_out, given the space available and the provided input--the effect
- documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers
- the allocation of and copying into a sliding window until necessary, which
- provides the effect documented in zlib.h for Z_FINISH when the entire input
- stream available. So the only thing the flush parameter actually does is:
- when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it
- will return Z_BUF_ERROR if it has not reached the end of the stream.
- */
-
-int ZEXPORT inflate(strm, flush)
-z_streamp strm;
-int flush;
-{
- struct inflate_state FAR *state;
- unsigned char FAR *next; /* next input */
- unsigned char FAR *put; /* next output */
- unsigned have, left; /* available input and output */
- unsigned long hold; /* bit buffer */
- unsigned bits; /* bits in bit buffer */
- unsigned in, out; /* save starting available input and output */
- unsigned copy; /* number of stored or match bytes to copy */
- unsigned char FAR *from; /* where to copy match bytes from */
- code this; /* current decoding table entry */
- code last; /* parent table entry */
- unsigned len; /* length to copy for repeats, bits to drop */
- int ret; /* return code */
-#ifdef GUNZIP
- unsigned char hbuf[4]; /* buffer for gzip header crc calculation */
-#endif
- static const unsigned short order[19] = /* permutation of code lengths */
- {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
-
- if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
- (strm->next_in == Z_NULL && strm->avail_in != 0))
- return Z_STREAM_ERROR;
-
- state = (struct inflate_state FAR *)strm->state;
- if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */
- LOAD();
- in = have;
- out = left;
- ret = Z_OK;
- for (;;)
- switch (state->mode) {
- case HEAD:
- if (state->wrap == 0) {
- state->mode = TYPEDO;
- break;
- }
- NEEDBITS(16);
-#ifdef GUNZIP
- if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */
- state->check = crc32(0L, Z_NULL, 0);
- CRC2(state->check, hold);
- INITBITS();
- state->mode = FLAGS;
- break;
- }
- state->flags = 0; /* expect zlib header */
- if (state->head != Z_NULL)
- state->head->done = -1;
- if (!(state->wrap & 1) || /* check if zlib header allowed */
-#else
- if (
-#endif
- ((BITS(8) << 8) + (hold >> 8)) % 31) {
- strm->msg = (char *)"incorrect header check";
- state->mode = BAD;
- break;
- }
- if (BITS(4) != Z_DEFLATED) {
- strm->msg = (char *)"unknown compression method";
- state->mode = BAD;
- break;
- }
- DROPBITS(4);
- len = BITS(4) + 8;
- if (len > state->wbits) {
- strm->msg = (char *)"invalid window size";
- state->mode = BAD;
- break;
- }
- state->dmax = 1U << len;
- Tracev((stderr, "inflate: zlib header ok\n"));
- strm->adler = state->check = adler32(0L, Z_NULL, 0);
- state->mode = hold & 0x200 ? DICTID : TYPE;
- INITBITS();
- break;
-#ifdef GUNZIP
- case FLAGS:
- NEEDBITS(16);
- state->flags = (int)(hold);
- if ((state->flags & 0xff) != Z_DEFLATED) {
- strm->msg = (char *)"unknown compression method";
- state->mode = BAD;
- break;
- }
- if (state->flags & 0xe000) {
- strm->msg = (char *)"unknown header flags set";
- state->mode = BAD;
- break;
- }
- if (state->head != Z_NULL)
- state->head->text = (int)((hold >> 8) & 1);
- if (state->flags & 0x0200) CRC2(state->check, hold);
- INITBITS();
- state->mode = TIME;
- case TIME:
- NEEDBITS(32);
- if (state->head != Z_NULL)
- state->head->time = hold;
- if (state->flags & 0x0200) CRC4(state->check, hold);
- INITBITS();
- state->mode = OS;
- case OS:
- NEEDBITS(16);
- if (state->head != Z_NULL) {
- state->head->xflags = (int)(hold & 0xff);
- state->head->os = (int)(hold >> 8);
- }
- if (state->flags & 0x0200) CRC2(state->check, hold);
- INITBITS();
- state->mode = EXLEN;
- case EXLEN:
- if (state->flags & 0x0400) {
- NEEDBITS(16);
- state->length = (unsigned)(hold);
- if (state->head != Z_NULL)
- state->head->extra_len = (unsigned)hold;
- if (state->flags & 0x0200) CRC2(state->check, hold);
- INITBITS();
- }
- else if (state->head != Z_NULL)
- state->head->extra = Z_NULL;
- state->mode = EXTRA;
- case EXTRA:
- if (state->flags & 0x0400) {
- copy = state->length;
- if (copy > have) copy = have;
- if (copy) {
- if (state->head != Z_NULL &&
- state->head->extra != Z_NULL) {
- len = state->head->extra_len - state->length;
- zmemcpy(state->head->extra + len, next,
- len + copy > state->head->extra_max ?
- state->head->extra_max - len : copy);
- }
- if (state->flags & 0x0200)
- state->check = crc32(state->check, next, copy);
- have -= copy;
- next += copy;
- state->length -= copy;
- }
- if (state->length) goto inf_leave;
- }
- state->length = 0;
- state->mode = NAME;
- case NAME:
- if (state->flags & 0x0800) {
- if (have == 0) goto inf_leave;
- copy = 0;
- do {
- len = (unsigned)(next[copy++]);
- if (state->head != Z_NULL &&
- state->head->name != Z_NULL &&
- state->length < state->head->name_max)
- state->head->name[state->length++] = len;
- } while (len && copy < have);
- if (state->flags & 0x0200)
- state->check = crc32(state->check, next, copy);
- have -= copy;
- next += copy;
- if (len) goto inf_leave;
- }
- else if (state->head != Z_NULL)
- state->head->name = Z_NULL;
- state->length = 0;
- state->mode = COMMENT;
- case COMMENT:
- if (state->flags & 0x1000) {
- if (have == 0) goto inf_leave;
- copy = 0;
- do {
- len = (unsigned)(next[copy++]);
- if (state->head != Z_NULL &&
- state->head->comment != Z_NULL &&
- state->length < state->head->comm_max)
- state->head->comment[state->length++] = len;
- } while (len && copy < have);
- if (state->flags & 0x0200)
- state->check = crc32(state->check, next, copy);
- have -= copy;
- next += copy;
- if (len) goto inf_leave;
- }
- else if (state->head != Z_NULL)
- state->head->comment = Z_NULL;
- state->mode = HCRC;
- case HCRC:
- if (state->flags & 0x0200) {
- NEEDBITS(16);
- if (hold != (state->check & 0xffff)) {
- strm->msg = (char *)"header crc mismatch";
- state->mode = BAD;
- break;
- }
- INITBITS();
- }
- if (state->head != Z_NULL) {
- state->head->hcrc = (int)((state->flags >> 9) & 1);
- state->head->done = 1;
- }
- strm->adler = state->check = crc32(0L, Z_NULL, 0);
- state->mode = TYPE;
- break;
-#endif
- case DICTID:
- NEEDBITS(32);
- strm->adler = state->check = REVERSE(hold);
- INITBITS();
- state->mode = DICT;
- case DICT:
- if (state->havedict == 0) {
- RESTORE();
- return Z_NEED_DICT;
- }
- strm->adler = state->check = adler32(0L, Z_NULL, 0);
- state->mode = TYPE;
- case TYPE:
- if (flush == Z_BLOCK) goto inf_leave;
- case TYPEDO:
- if (state->last) {
- BYTEBITS();
- state->mode = CHECK;
- break;
- }
- NEEDBITS(3);
- state->last = BITS(1);
- DROPBITS(1);
- switch (BITS(2)) {
- case 0: /* stored block */
- Tracev((stderr, "inflate: stored block%s\n",
- state->last ? " (last)" : ""));
- state->mode = STORED;
- break;
- case 1: /* fixed block */
- fixedtables(state);
- Tracev((stderr, "inflate: fixed codes block%s\n",
- state->last ? " (last)" : ""));
- state->mode = LEN; /* decode codes */
- break;
- case 2: /* dynamic block */
- Tracev((stderr, "inflate: dynamic codes block%s\n",
- state->last ? " (last)" : ""));
- state->mode = TABLE;
- break;
- case 3:
- strm->msg = (char *)"invalid block type";
- state->mode = BAD;
- }
- DROPBITS(2);
- break;
- case STORED:
- BYTEBITS(); /* go to byte boundary */
- NEEDBITS(32);
- if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
- strm->msg = (char *)"invalid stored block lengths";
- state->mode = BAD;
- break;
- }
- state->length = (unsigned)hold & 0xffff;
- Tracev((stderr, "inflate: stored length %u\n",
- state->length));
- INITBITS();
- state->mode = COPY;
- case COPY:
- copy = state->length;
- if (copy) {
- if (copy > have) copy = have;
- if (copy > left) copy = left;
- if (copy == 0) goto inf_leave;
- zmemcpy(put, next, copy);
- have -= copy;
- next += copy;
- left -= copy;
- put += copy;
- state->length -= copy;
- break;
- }
- Tracev((stderr, "inflate: stored end\n"));
- state->mode = TYPE;
- break;
- case TABLE:
- NEEDBITS(14);
- state->nlen = BITS(5) + 257;
- DROPBITS(5);
- state->ndist = BITS(5) + 1;
- DROPBITS(5);
- state->ncode = BITS(4) + 4;
- DROPBITS(4);
-#ifndef PKZIP_BUG_WORKAROUND
- if (state->nlen > 286 || state->ndist > 30) {
- strm->msg = (char *)"too many length or distance symbols";
- state->mode = BAD;
- break;
- }
-#endif
- Tracev((stderr, "inflate: table sizes ok\n"));
- state->have = 0;
- state->mode = LENLENS;
- case LENLENS:
- while (state->have < state->ncode) {
- NEEDBITS(3);
- state->lens[order[state->have++]] = (unsigned short)BITS(3);
- DROPBITS(3);
- }
- while (state->have < 19)
- state->lens[order[state->have++]] = 0;
- state->next = state->codes;
- state->lencode = (code const FAR *)(state->next);
- state->lenbits = 7;
- ret = inflate_table(CODES, state->lens, 19, &(state->next),
- &(state->lenbits), state->work);
- if (ret) {
- strm->msg = (char *)"invalid code lengths set";
- state->mode = BAD;
- break;
- }
- Tracev((stderr, "inflate: code lengths ok\n"));
- state->have = 0;
- state->mode = CODELENS;
- case CODELENS:
- while (state->have < state->nlen + state->ndist) {
- for (;;) {
- this = state->lencode[BITS(state->lenbits)];
- if ((unsigned)(this.bits) <= bits) break;
- PULLBYTE();
- }
- if (this.val < 16) {
- NEEDBITS(this.bits);
- DROPBITS(this.bits);
- state->lens[state->have++] = this.val;
- }
- else {
- if (this.val == 16) {
- NEEDBITS(this.bits + 2);
- DROPBITS(this.bits);
- if (state->have == 0) {
- strm->msg = (char *)"invalid bit length repeat";
- state->mode = BAD;
- break;
- }
- len = state->lens[state->have - 1];
- copy = 3 + BITS(2);
- DROPBITS(2);
- }
- else if (this.val == 17) {
- NEEDBITS(this.bits + 3);
- DROPBITS(this.bits);
- len = 0;
- copy = 3 + BITS(3);
- DROPBITS(3);
- }
- else {
- NEEDBITS(this.bits + 7);
- DROPBITS(this.bits);
- len = 0;
- copy = 11 + BITS(7);
- DROPBITS(7);
- }
- if (state->have + copy > state->nlen + state->ndist) {
- strm->msg = (char *)"invalid bit length repeat";
- state->mode = BAD;
- break;
- }
- while (copy--)
- state->lens[state->have++] = (unsigned short)len;
- }
- }
-
- /* handle error breaks in while */
- if (state->mode == BAD) break;
-
- /* build code tables */
- state->next = state->codes;
- state->lencode = (code const FAR *)(state->next);
- state->lenbits = 9;
- ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
- &(state->lenbits), state->work);
- if (ret) {
- strm->msg = (char *)"invalid literal/lengths set";
- state->mode = BAD;
- break;
- }
- state->distcode = (code const FAR *)(state->next);
- state->distbits = 6;
- ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
- &(state->next), &(state->distbits), state->work);
- if (ret) {
- strm->msg = (char *)"invalid distances set";
- state->mode = BAD;
- break;
- }
- Tracev((stderr, "inflate: codes ok\n"));
- state->mode = LEN;
- case LEN:
- if (have >= 6 && left >= 258) {
- RESTORE();
- inflate_fast(strm, out);
- LOAD();
- break;
- }
- for (;;) {
- this = state->lencode[BITS(state->lenbits)];
- if ((unsigned)(this.bits) <= bits) break;
- PULLBYTE();
- }
- if (this.op && (this.op & 0xf0) == 0) {
- last = this;
- for (;;) {
- this = state->lencode[last.val +
- (BITS(last.bits + last.op) >> last.bits)];
- if ((unsigned)(last.bits + this.bits) <= bits) break;
- PULLBYTE();
- }
- DROPBITS(last.bits);
- }
- DROPBITS(this.bits);
- state->length = (unsigned)this.val;
- if ((int)(this.op) == 0) {
- Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
- "inflate: literal '%c'\n" :
- "inflate: literal 0x%02x\n", this.val));
- state->mode = LIT;
- break;
- }
- if (this.op & 32) {
- Tracevv((stderr, "inflate: end of block\n"));
- state->mode = TYPE;
- break;
- }
- if (this.op & 64) {
- strm->msg = (char *)"invalid literal/length code";
- state->mode = BAD;
- break;
- }
- state->extra = (unsigned)(this.op) & 15;
- state->mode = LENEXT;
- case LENEXT:
- if (state->extra) {
- NEEDBITS(state->extra);
- state->length += BITS(state->extra);
- DROPBITS(state->extra);
- }
- Tracevv((stderr, "inflate: length %u\n", state->length));
- state->mode = DIST;
- case DIST:
- for (;;) {
- this = state->distcode[BITS(state->distbits)];
- if ((unsigned)(this.bits) <= bits) break;
- PULLBYTE();
- }
- if ((this.op & 0xf0) == 0) {
- last = this;
- for (;;) {
- this = state->distcode[last.val +
- (BITS(last.bits + last.op) >> last.bits)];
- if ((unsigned)(last.bits + this.bits) <= bits) break;
- PULLBYTE();
- }
- DROPBITS(last.bits);
- }
- DROPBITS(this.bits);
- if (this.op & 64) {
- strm->msg = (char *)"invalid distance code";
- state->mode = BAD;
- break;
- }
- state->offset = (unsigned)this.val;
- state->extra = (unsigned)(this.op) & 15;
- state->mode = DISTEXT;
- case DISTEXT:
- if (state->extra) {
- NEEDBITS(state->extra);
- state->offset += BITS(state->extra);
- DROPBITS(state->extra);
- }
-#ifdef INFLATE_STRICT
- if (state->offset > state->dmax) {
- strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
- }
-#endif
- if (state->offset > state->whave + out - left) {
- strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
- }
- Tracevv((stderr, "inflate: distance %u\n", state->offset));
- state->mode = MATCH;
- case MATCH:
- if (left == 0) goto inf_leave;
- copy = out - left;
- if (state->offset > copy) { /* copy from window */
- copy = state->offset - copy;
- if (copy > state->write) {
- copy -= state->write;
- from = state->window + (state->wsize - copy);
- }
- else
- from = state->window + (state->write - copy);
- if (copy > state->length) copy = state->length;
- }
- else { /* copy from output */
- from = put - state->offset;
- copy = state->length;
- }
- if (copy > left) copy = left;
- left -= copy;
- state->length -= copy;
- do {
- *put++ = *from++;
- } while (--copy);
- if (state->length == 0) state->mode = LEN;
- break;
- case LIT:
- if (left == 0) goto inf_leave;
- *put++ = (unsigned char)(state->length);
- left--;
- state->mode = LEN;
- break;
- case CHECK:
- if (state->wrap) {
- NEEDBITS(32);
- out -= left;
- strm->total_out += out;
- state->total += out;
- if (out)
- strm->adler = state->check =
- UPDATE(state->check, put - out, out);
- out = left;
- if ((
-#ifdef GUNZIP
- state->flags ? hold :
-#endif
- REVERSE(hold)) != state->check) {
- strm->msg = (char *)"incorrect data check";
- state->mode = BAD;
- break;
- }
- INITBITS();
- Tracev((stderr, "inflate: check matches trailer\n"));
- }
-#ifdef GUNZIP
- state->mode = LENGTH;
- case LENGTH:
- if (state->wrap && state->flags) {
- NEEDBITS(32);
- if (hold != (state->total & 0xffffffffUL)) {
- strm->msg = (char *)"incorrect length check";
- state->mode = BAD;
- break;
- }
- INITBITS();
- Tracev((stderr, "inflate: length matches trailer\n"));
- }
-#endif
- state->mode = DONE;
- case DONE:
- ret = Z_STREAM_END;
- goto inf_leave;
- case BAD:
- ret = Z_DATA_ERROR;
- goto inf_leave;
- case MEM:
- return Z_MEM_ERROR;
- case SYNC:
- default:
- return Z_STREAM_ERROR;
- }
-
- /*
- Return from inflate(), updating the total counts and the check value.
- If there was no progress during the inflate() call, return a buffer
- error. Call updatewindow() to create and/or update the window state.
- Note: a memory error from inflate() is non-recoverable.
- */
- inf_leave:
- RESTORE();
- if (state->wsize || (state->mode < CHECK && out != strm->avail_out))
- if (updatewindow(strm, out)) {
- state->mode = MEM;
- return Z_MEM_ERROR;
- }
- in -= strm->avail_in;
- out -= strm->avail_out;
- strm->total_in += in;
- strm->total_out += out;
- state->total += out;
- if (state->wrap && out)
- strm->adler = state->check =
- UPDATE(state->check, strm->next_out - out, out);
- strm->data_type = state->bits + (state->last ? 64 : 0) +
- (state->mode == TYPE ? 128 : 0);
- if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
- ret = Z_BUF_ERROR;
- return ret;
-}
-
-int ZEXPORT inflateEnd(strm)
-z_streamp strm;
-{
- struct inflate_state FAR *state;
- if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
- return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- if (state->window != Z_NULL) ZFREE(strm, state->window);
- ZFREE(strm, strm->state);
- strm->state = Z_NULL;
- Tracev((stderr, "inflate: end\n"));
- return Z_OK;
-}
-
-int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
-z_streamp strm;
-const Bytef *dictionary;
-uInt dictLength;
-{
- struct inflate_state FAR *state;
- unsigned long id;
-
- /* check state */
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- if (state->wrap != 0 && state->mode != DICT)
- return Z_STREAM_ERROR;
-
- /* check for correct dictionary id */
- if (state->mode == DICT) {
- id = adler32(0L, Z_NULL, 0);
- id = adler32(id, dictionary, dictLength);
- if (id != state->check)
- return Z_DATA_ERROR;
- }
-
- /* copy dictionary to window */
- if (updatewindow(strm, strm->avail_out)) {
- state->mode = MEM;
- return Z_MEM_ERROR;
- }
- if (dictLength > state->wsize) {
- zmemcpy(state->window, dictionary + dictLength - state->wsize,
- state->wsize);
- state->whave = state->wsize;
- }
- else {
- zmemcpy(state->window + state->wsize - dictLength, dictionary,
- dictLength);
- state->whave = dictLength;
- }
- state->havedict = 1;
- Tracev((stderr, "inflate: dictionary set\n"));
- return Z_OK;
-}
-
-int ZEXPORT inflateGetHeader(strm, head)
-z_streamp strm;
-gz_headerp head;
-{
- struct inflate_state FAR *state;
-
- /* check state */
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
-
- /* save header structure */
- state->head = head;
- head->done = 0;
- return Z_OK;
-}
-
-/*
- Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found
- or when out of input. When called, *have is the number of pattern bytes
- found in order so far, in 0..3. On return *have is updated to the new
- state. If on return *have equals four, then the pattern was found and the
- return value is how many bytes were read including the last byte of the
- pattern. If *have is less than four, then the pattern has not been found
- yet and the return value is len. In the latter case, syncsearch() can be
- called again with more data and the *have state. *have is initialized to
- zero for the first call.
- */
-local unsigned syncsearch(have, buf, len)
-unsigned FAR *have;
-unsigned char FAR *buf;
-unsigned len;
-{
- unsigned got;
- unsigned next;
-
- got = *have;
- next = 0;
- while (next < len && got < 4) {
- if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
- got++;
- else if (buf[next])
- got = 0;
- else
- got = 4 - got;
- next++;
- }
- *have = got;
- return next;
-}
-
-int ZEXPORT inflateSync(strm)
-z_streamp strm;
-{
- unsigned len; /* number of bytes to look at or looked at */
- unsigned long in, out; /* temporary to save total_in and total_out */
- unsigned char buf[4]; /* to restore bit buffer to byte string */
- struct inflate_state FAR *state;
-
- /* check parameters */
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
-
- /* if first time, start search in bit buffer */
- if (state->mode != SYNC) {
- state->mode = SYNC;
- state->hold <<= state->bits & 7;
- state->bits -= state->bits & 7;
- len = 0;
- while (state->bits >= 8) {
- buf[len++] = (unsigned char)(state->hold);
- state->hold >>= 8;
- state->bits -= 8;
- }
- state->have = 0;
- syncsearch(&(state->have), buf, len);
- }
-
- /* search available input */
- len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
- strm->avail_in -= len;
- strm->next_in += len;
- strm->total_in += len;
-
- /* return no joy or set up to restart inflate() on a new block */
- if (state->have != 4) return Z_DATA_ERROR;
- in = strm->total_in; out = strm->total_out;
- inflateReset(strm);
- strm->total_in = in; strm->total_out = out;
- state->mode = TYPE;
- return Z_OK;
-}
-
-/*
- Returns true if inflate is currently at the end of a block generated by
- Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
- implementation to provide an additional safety check. PPP uses
- Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored
- block. When decompressing, PPP checks that at the end of input packet,
- inflate is waiting for these length bytes.
- */
-int ZEXPORT inflateSyncPoint(strm)
-z_streamp strm;
-{
- struct inflate_state FAR *state;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- return state->mode == STORED && state->bits == 0;
-}
-
-int ZEXPORT inflateCopy(dest, source)
-z_streamp dest;
-z_streamp source;
-{
- struct inflate_state FAR *state;
- struct inflate_state FAR *copy;
- unsigned char FAR *window;
- unsigned wsize;
-
- /* check input */
- if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
- source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
- return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)source->state;
-
- /* allocate space */
- copy = (struct inflate_state FAR *)
- ZALLOC(source, 1, sizeof(struct inflate_state));
- if (copy == Z_NULL) return Z_MEM_ERROR;
- window = Z_NULL;
- if (state->window != Z_NULL) {
- window = (unsigned char FAR *)
- ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
- if (window == Z_NULL) {
- ZFREE(source, copy);
- return Z_MEM_ERROR;
- }
- }
-
- /* copy state */
- zmemcpy(dest, source, sizeof(z_stream));
- zmemcpy(copy, state, sizeof(struct inflate_state));
- if (state->lencode >= state->codes &&
- state->lencode <= state->codes + ENOUGH - 1) {
- copy->lencode = copy->codes + (state->lencode - state->codes);
- copy->distcode = copy->codes + (state->distcode - state->codes);
- }
- copy->next = copy->codes + (state->next - state->codes);
- if (window != Z_NULL) {
- wsize = 1U << state->wbits;
- zmemcpy(window, state->window, wsize);
- }
- copy->window = window;
- dest->state = (struct internal_state FAR *)copy;
- return Z_OK;
-}
diff --git a/Utilities/Poco/Foundation/src/inflate.h b/Utilities/Poco/Foundation/src/inflate.h
deleted file mode 100755
index 07bd3e78a7..0000000000
--- a/Utilities/Poco/Foundation/src/inflate.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* inflate.h -- internal inflate state definition
- * Copyright (C) 1995-2004 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* define NO_GZIP when compiling if you want to disable gzip header and
- trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
- the crc code when it is not needed. For shared libraries, gzip decoding
- should be left enabled. */
-#ifndef NO_GZIP
-# define GUNZIP
-#endif
-
-/* Possible inflate modes between inflate() calls */
-typedef enum {
- HEAD, /* i: waiting for magic header */
- FLAGS, /* i: waiting for method and flags (gzip) */
- TIME, /* i: waiting for modification time (gzip) */
- OS, /* i: waiting for extra flags and operating system (gzip) */
- EXLEN, /* i: waiting for extra length (gzip) */
- EXTRA, /* i: waiting for extra bytes (gzip) */
- NAME, /* i: waiting for end of file name (gzip) */
- COMMENT, /* i: waiting for end of comment (gzip) */
- HCRC, /* i: waiting for header crc (gzip) */
- DICTID, /* i: waiting for dictionary check value */
- DICT, /* waiting for inflateSetDictionary() call */
- TYPE, /* i: waiting for type bits, including last-flag bit */
- TYPEDO, /* i: same, but skip check to exit inflate on new block */
- STORED, /* i: waiting for stored size (length and complement) */
- COPY, /* i/o: waiting for input or output to copy stored block */
- TABLE, /* i: waiting for dynamic block table lengths */
- LENLENS, /* i: waiting for code length code lengths */
- CODELENS, /* i: waiting for length/lit and distance code lengths */
- LEN, /* i: waiting for length/lit code */
- LENEXT, /* i: waiting for length extra bits */
- DIST, /* i: waiting for distance code */
- DISTEXT, /* i: waiting for distance extra bits */
- MATCH, /* o: waiting for output space to copy string */
- LIT, /* o: waiting for output space to write literal */
- CHECK, /* i: waiting for 32-bit check value */
- LENGTH, /* i: waiting for 32-bit length (gzip) */
- DONE, /* finished check, done -- remain here until reset */
- BAD, /* got a data error -- remain here until reset */
- MEM, /* got an inflate() memory error -- remain here until reset */
- SYNC /* looking for synchronization bytes to restart inflate() */
-} inflate_mode;
-
-/*
- State transitions between above modes -
-
- (most modes can go to the BAD or MEM mode -- not shown for clarity)
-
- Process header:
- HEAD -> (gzip) or (zlib)
- (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME
- NAME -> COMMENT -> HCRC -> TYPE
- (zlib) -> DICTID or TYPE
- DICTID -> DICT -> TYPE
- Read deflate blocks:
- TYPE -> STORED or TABLE or LEN or CHECK
- STORED -> COPY -> TYPE
- TABLE -> LENLENS -> CODELENS -> LEN
- Read deflate codes:
- LEN -> LENEXT or LIT or TYPE
- LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
- LIT -> LEN
- Process trailer:
- CHECK -> LENGTH -> DONE
- */
-
-/* state maintained between inflate() calls. Approximately 7K bytes. */
-struct inflate_state {
- inflate_mode mode; /* current inflate mode */
- int last; /* true if processing last block */
- int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
- int havedict; /* true if dictionary provided */
- int flags; /* gzip header method and flags (0 if zlib) */
- unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
- unsigned long check; /* protected copy of check value */
- unsigned long total; /* protected copy of output count */
- gz_headerp head; /* where to save gzip header information */
- /* sliding window */
- unsigned wbits; /* log base 2 of requested window size */
- unsigned wsize; /* window size or zero if not using window */
- unsigned whave; /* valid bytes in the window */
- unsigned write; /* window write index */
- unsigned char FAR *window; /* allocated sliding window, if needed */
- /* bit accumulator */
- unsigned long hold; /* input bit accumulator */
- unsigned bits; /* number of bits in "in" */
- /* for string and stored block copying */
- unsigned length; /* literal or length of data to copy */
- unsigned offset; /* distance back to copy string from */
- /* for table and code decoding */
- unsigned extra; /* extra bits needed */
- /* fixed and dynamic code tables */
- code const FAR *lencode; /* starting table for length/literal codes */
- code const FAR *distcode; /* starting table for distance codes */
- unsigned lenbits; /* index bits for lencode */
- unsigned distbits; /* index bits for distcode */
- /* dynamic table building */
- unsigned ncode; /* number of code length code lengths */
- unsigned nlen; /* number of length code lengths */
- unsigned ndist; /* number of distance code lengths */
- unsigned have; /* number of code lengths in lens[] */
- code FAR *next; /* next available space in codes[] */
- unsigned short lens[320]; /* temporary storage for code lengths */
- unsigned short work[288]; /* work area for code table building */
- code codes[ENOUGH]; /* space for code tables */
-};
diff --git a/Utilities/Poco/Foundation/src/inftrees.c b/Utilities/Poco/Foundation/src/inftrees.c
deleted file mode 100755
index 8a9c13ff03..0000000000
--- a/Utilities/Poco/Foundation/src/inftrees.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2005 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-
-#define MAXBITS 15
-
-const char inflate_copyright[] =
- " inflate 1.2.3 Copyright 1995-2005 Mark Adler ";
-/*
- If you use the zlib library in a product, an acknowledgment is welcome
- in the documentation of your product. If for some reason you cannot
- include such an acknowledgment, I would appreciate that you keep this
- copyright string in the executable of your product.
- */
-
-/*
- Build a set of tables to decode the provided canonical Huffman code.
- The code lengths are lens[0..codes-1]. The result starts at *table,
- whose indices are 0..2^bits-1. work is a writable array of at least
- lens shorts, which is used as a work area. type is the type of code
- to be generated, CODES, LENS, or DISTS. On return, zero is success,
- -1 is an invalid code, and +1 means that ENOUGH isn't enough. table
- on return points to the next available entry's address. bits is the
- requested root table index bits, and on return it is the actual root
- table index bits. It will differ if the request is greater than the
- longest code or if it is less than the shortest code.
- */
-int inflate_table(type, lens, codes, table, bits, work)
-codetype type;
-unsigned short FAR *lens;
-unsigned codes;
-code FAR * FAR *table;
-unsigned FAR *bits;
-unsigned short FAR *work;
-{
- unsigned len; /* a code's length in bits */
- unsigned sym; /* index of code symbols */
- unsigned min, max; /* minimum and maximum code lengths */
- unsigned root; /* number of index bits for root table */
- unsigned curr; /* number of index bits for current table */
- unsigned drop; /* code bits to drop for sub-table */
- int left; /* number of prefix codes available */
- unsigned used; /* code entries in table used */
- unsigned huff; /* Huffman code */
- unsigned incr; /* for incrementing code, index */
- unsigned fill; /* index for replicating entries */
- unsigned low; /* low bits for current root entry */
- unsigned mask; /* mask for low root bits */
- code this; /* table entry for duplication */
- code FAR *next; /* next available space in table */
- const unsigned short FAR *base; /* base value table to use */
- const unsigned short FAR *extra; /* extra bits table to use */
- int end; /* use base and extra for symbol > end */
- unsigned short count[MAXBITS+1]; /* number of codes of each length */
- unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
- static const unsigned short lbase[31] = { /* Length codes 257..285 base */
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
- 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
- static const unsigned short lext[31] = { /* Length codes 257..285 extra */
- 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196};
- static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
- 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
- 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
- 8193, 12289, 16385, 24577, 0, 0};
- static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
- 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
- 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
- 28, 28, 29, 29, 64, 64};
-
- /*
- Process a set of code lengths to create a canonical Huffman code. The
- code lengths are lens[0..codes-1]. Each length corresponds to the
- symbols 0..codes-1. The Huffman code is generated by first sorting the
- symbols by length from short to long, and retaining the symbol order
- for codes with equal lengths. Then the code starts with all zero bits
- for the first code of the shortest length, and the codes are integer
- increments for the same length, and zeros are appended as the length
- increases. For the deflate format, these bits are stored backwards
- from their more natural integer increment ordering, and so when the
- decoding tables are built in the large loop below, the integer codes
- are incremented backwards.
-
- This routine assumes, but does not check, that all of the entries in
- lens[] are in the range 0..MAXBITS. The caller must assure this.
- 1..MAXBITS is interpreted as that code length. zero means that that
- symbol does not occur in this code.
-
- The codes are sorted by computing a count of codes for each length,
- creating from that a table of starting indices for each length in the
- sorted table, and then entering the symbols in order in the sorted
- table. The sorted table is work[], with that space being provided by
- the caller.
-
- The length counts are used for other purposes as well, i.e. finding
- the minimum and maximum length codes, determining if there are any
- codes at all, checking for a valid set of lengths, and looking ahead
- at length counts to determine sub-table sizes when building the
- decoding tables.
- */
-
- /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
- for (len = 0; len <= MAXBITS; len++)
- count[len] = 0;
- for (sym = 0; sym < codes; sym++)
- count[lens[sym]]++;
-
- /* bound code lengths, force root to be within code lengths */
- root = *bits;
- for (max = MAXBITS; max >= 1; max--)
- if (count[max] != 0) break;
- if (root > max) root = max;
- if (max == 0) { /* no symbols to code at all */
- this.op = (unsigned char)64; /* invalid code marker */
- this.bits = (unsigned char)1;
- this.val = (unsigned short)0;
- *(*table)++ = this; /* make a table to force an error */
- *(*table)++ = this;
- *bits = 1;
- return 0; /* no symbols, but wait for decoding to report error */
- }
- for (min = 1; min <= MAXBITS; min++)
- if (count[min] != 0) break;
- if (root < min) root = min;
-
- /* check for an over-subscribed or incomplete set of lengths */
- left = 1;
- for (len = 1; len <= MAXBITS; len++) {
- left <<= 1;
- left -= count[len];
- if (left < 0) return -1; /* over-subscribed */
- }
- if (left > 0 && (type == CODES || max != 1))
- return -1; /* incomplete set */
-
- /* generate offsets into symbol table for each length for sorting */
- offs[1] = 0;
- for (len = 1; len < MAXBITS; len++)
- offs[len + 1] = offs[len] + count[len];
-
- /* sort symbols by length, by symbol order within each length */
- for (sym = 0; sym < codes; sym++)
- if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
-
- /*
- Create and fill in decoding tables. In this loop, the table being
- filled is at next and has curr index bits. The code being used is huff
- with length len. That code is converted to an index by dropping drop
- bits off of the bottom. For codes where len is less than drop + curr,
- those top drop + curr - len bits are incremented through all values to
- fill the table with replicated entries.
-
- root is the number of index bits for the root table. When len exceeds
- root, sub-tables are created pointed to by the root entry with an index
- of the low root bits of huff. This is saved in low to check for when a
- new sub-table should be started. drop is zero when the root table is
- being filled, and drop is root when sub-tables are being filled.
-
- When a new sub-table is needed, it is necessary to look ahead in the
- code lengths to determine what size sub-table is needed. The length
- counts are used for this, and so count[] is decremented as codes are
- entered in the tables.
-
- used keeps track of how many table entries have been allocated from the
- provided *table space. It is checked when a LENS table is being made
- against the space in *table, ENOUGH, minus the maximum space needed by
- the worst case distance code, MAXD. This should never happen, but the
- sufficiency of ENOUGH has not been proven exhaustively, hence the check.
- This assumes that when type == LENS, bits == 9.
-
- sym increments through all symbols, and the loop terminates when
- all codes of length max, i.e. all codes, have been processed. This
- routine permits incomplete codes, so another loop after this one fills
- in the rest of the decoding tables with invalid code markers.
- */
-
- /* set up for code type */
- switch (type) {
- case CODES:
- base = extra = work; /* dummy value--not used */
- end = 19;
- break;
- case LENS:
- base = lbase;
- base -= 257;
- extra = lext;
- extra -= 257;
- end = 256;
- break;
- default: /* DISTS */
- base = dbase;
- extra = dext;
- end = -1;
- }
-
- /* initialize state for loop */
- huff = 0; /* starting code */
- sym = 0; /* starting code symbol */
- len = min; /* starting code length */
- next = *table; /* current table to fill in */
- curr = root; /* current table index bits */
- drop = 0; /* current bits to drop from code for index */
- low = (unsigned)(-1); /* trigger new sub-table when len > root */
- used = 1U << root; /* use root table entries */
- mask = used - 1; /* mask for comparing low */
-
- /* check available table space */
- if (type == LENS && used >= ENOUGH - MAXD)
- return 1;
-
- /* process all codes and make table entries */
- for (;;) {
- /* create table entry */
- this.bits = (unsigned char)(len - drop);
- if ((int)(work[sym]) < end) {
- this.op = (unsigned char)0;
- this.val = work[sym];
- }
- else if ((int)(work[sym]) > end) {
- this.op = (unsigned char)(extra[work[sym]]);
- this.val = base[work[sym]];
- }
- else {
- this.op = (unsigned char)(32 + 64); /* end of block */
- this.val = 0;
- }
-
- /* replicate for those indices with low len bits equal to huff */
- incr = 1U << (len - drop);
- fill = 1U << curr;
- min = fill; /* save offset to next table */
- do {
- fill -= incr;
- next[(huff >> drop) + fill] = this;
- } while (fill != 0);
-
- /* backwards increment the len-bit code huff */
- incr = 1U << (len - 1);
- while (huff & incr)
- incr >>= 1;
- if (incr != 0) {
- huff &= incr - 1;
- huff += incr;
- }
- else
- huff = 0;
-
- /* go to next symbol, update count, len */
- sym++;
- if (--(count[len]) == 0) {
- if (len == max) break;
- len = lens[work[sym]];
- }
-
- /* create new sub-table if needed */
- if (len > root && (huff & mask) != low) {
- /* if first time, transition to sub-tables */
- if (drop == 0)
- drop = root;
-
- /* increment past last table */
- next += min; /* here min is 1 << curr */
-
- /* determine length of next table */
- curr = len - drop;
- left = (int)(1 << curr);
- while (curr + drop < max) {
- left -= count[curr + drop];
- if (left <= 0) break;
- curr++;
- left <<= 1;
- }
-
- /* check for enough space */
- used += 1U << curr;
- if (type == LENS && used >= ENOUGH - MAXD)
- return 1;
-
- /* point entry in root table to sub-table */
- low = huff & mask;
- (*table)[low].op = (unsigned char)curr;
- (*table)[low].bits = (unsigned char)root;
- (*table)[low].val = (unsigned short)(next - *table);
- }
- }
-
- /*
- Fill in rest of table for incomplete codes. This loop is similar to the
- loop above in incrementing huff for table indices. It is assumed that
- len is equal to curr + drop, so there is no loop needed to increment
- through high index bits. When the current sub-table is filled, the loop
- drops back to the root table to fill in any remaining entries there.
- */
- this.op = (unsigned char)64; /* invalid code marker */
- this.bits = (unsigned char)(len - drop);
- this.val = (unsigned short)0;
- while (huff != 0) {
- /* when done with sub-table, drop back to root table */
- if (drop != 0 && (huff & mask) != low) {
- drop = 0;
- len = root;
- next = *table;
- this.bits = (unsigned char)len;
- }
-
- /* put invalid code marker in table */
- next[huff >> drop] = this;
-
- /* backwards increment the len-bit code huff */
- incr = 1U << (len - 1);
- while (huff & incr)
- incr >>= 1;
- if (incr != 0) {
- huff &= incr - 1;
- huff += incr;
- }
- else
- huff = 0;
- }
-
- /* set return parameters */
- *table += used;
- *bits = root;
- return 0;
-}
diff --git a/Utilities/Poco/Foundation/src/inftrees.h b/Utilities/Poco/Foundation/src/inftrees.h
deleted file mode 100755
index b1104c87e7..0000000000
--- a/Utilities/Poco/Foundation/src/inftrees.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-2005 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* Structure for decoding tables. Each entry provides either the
- information needed to do the operation requested by the code that
- indexed that table entry, or it provides a pointer to another
- table that indexes more bits of the code. op indicates whether
- the entry is a pointer to another table, a literal, a length or
- distance, an end-of-block, or an invalid code. For a table
- pointer, the low four bits of op is the number of index bits of
- that table. For a length or distance, the low four bits of op
- is the number of extra bits to get after the code. bits is
- the number of bits in this code or part of the code to drop off
- of the bit buffer. val is the actual byte to output in the case
- of a literal, the base length or distance, or the offset from
- the current table to the next table. Each entry is four bytes. */
-typedef struct {
- unsigned char op; /* operation, extra bits, table bits */
- unsigned char bits; /* bits in this part of the code */
- unsigned short val; /* offset in table or code value */
-} code;
-
-/* op values as set by inflate_table():
- 00000000 - literal
- 0000tttt - table link, tttt != 0 is the number of table index bits
- 0001eeee - length or distance, eeee is the number of extra bits
- 01100000 - end of block
- 01000000 - invalid code
- */
-
-/* Maximum size of dynamic tree. The maximum found in a long but non-
- exhaustive search was 1444 code structures (852 for length/literals
- and 592 for distances, the latter actually the result of an
- exhaustive search). The true maximum is not known, but the value
- below is more than safe. */
-#define ENOUGH 2048
-#define MAXD 592
-
-/* Type of code to build for inftable() */
-typedef enum {
- CODES,
- LENS,
- DISTS
-} codetype;
-
-extern int inflate_table OF((codetype type, unsigned short FAR *lens,
- unsigned codes, code FAR * FAR *table,
- unsigned FAR *bits, unsigned short FAR *work));
diff --git a/Utilities/Poco/Foundation/src/pcre.h b/Utilities/Poco/Foundation/src/pcre.h
deleted file mode 100755
index 29a7345103..0000000000
--- a/Utilities/Poco/Foundation/src/pcre.h
+++ /dev/null
@@ -1,304 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* This is the public header file for the PCRE library, to be #included by
-applications that call the PCRE functions.
-
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-#ifndef _PCRE_H
-#define _PCRE_H
-
-/* The current PCRE version information. */
-
-#define PCRE_MAJOR 7
-#define PCRE_MINOR 8
-#define PCRE_PRERELEASE
-#define PCRE_DATE 2008-09-05
-
-/* When an application links to a PCRE DLL in Windows, the symbols that are
-imported have to be identified as such. When building PCRE, the appropriate
-export setting is defined in pcre_internal.h, which includes this file. So we
-don't change existing definitions of PCRE_EXP_DECL and PCRECPP_EXP_DECL. */
-
-#if defined(_WIN32) && !defined(PCRE_STATIC)
-# ifndef PCRE_EXP_DECL
-# define PCRE_EXP_DECL extern __declspec(dllimport)
-# endif
-# ifdef __cplusplus
-# ifndef PCRECPP_EXP_DECL
-# define PCRECPP_EXP_DECL extern __declspec(dllimport)
-# endif
-# ifndef PCRECPP_EXP_DEFN
-# define PCRECPP_EXP_DEFN __declspec(dllimport)
-# endif
-# endif
-#endif
-
-/* By default, we use the standard "extern" declarations. */
-
-#ifndef PCRE_EXP_DECL
-# ifdef __cplusplus
-# define PCRE_EXP_DECL extern "C"
-# else
-# define PCRE_EXP_DECL extern
-# endif
-#endif
-
-#ifdef __cplusplus
-# ifndef PCRECPP_EXP_DECL
-# define PCRECPP_EXP_DECL extern
-# endif
-# ifndef PCRECPP_EXP_DEFN
-# define PCRECPP_EXP_DEFN
-# endif
-#endif
-
-/* Have to include stdlib.h in order to ensure that size_t is defined;
-it is needed here for malloc. */
-
-#include <stdlib.h>
-
-/* Allow for C++ users */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Options */
-
-#define PCRE_CASELESS 0x00000001
-#define PCRE_MULTILINE 0x00000002
-#define PCRE_DOTALL 0x00000004
-#define PCRE_EXTENDED 0x00000008
-#define PCRE_ANCHORED 0x00000010
-#define PCRE_DOLLAR_ENDONLY 0x00000020
-#define PCRE_EXTRA 0x00000040
-#define PCRE_NOTBOL 0x00000080
-#define PCRE_NOTEOL 0x00000100
-#define PCRE_UNGREEDY 0x00000200
-#define PCRE_NOTEMPTY 0x00000400
-#define PCRE_UTF8 0x00000800
-#define PCRE_NO_AUTO_CAPTURE 0x00001000
-#define PCRE_NO_UTF8_CHECK 0x00002000
-#define PCRE_AUTO_CALLOUT 0x00004000
-#define PCRE_PARTIAL 0x00008000
-#define PCRE_DFA_SHORTEST 0x00010000
-#define PCRE_DFA_RESTART 0x00020000
-#define PCRE_FIRSTLINE 0x00040000
-#define PCRE_DUPNAMES 0x00080000
-#define PCRE_NEWLINE_CR 0x00100000
-#define PCRE_NEWLINE_LF 0x00200000
-#define PCRE_NEWLINE_CRLF 0x00300000
-#define PCRE_NEWLINE_ANY 0x00400000
-#define PCRE_NEWLINE_ANYCRLF 0x00500000
-#define PCRE_BSR_ANYCRLF 0x00800000
-#define PCRE_BSR_UNICODE 0x01000000
-#define PCRE_JAVASCRIPT_COMPAT 0x02000000
-
-/* Exec-time and get/set-time error codes */
-
-#define PCRE_ERROR_NOMATCH (-1)
-#define PCRE_ERROR_NULL (-2)
-#define PCRE_ERROR_BADOPTION (-3)
-#define PCRE_ERROR_BADMAGIC (-4)
-#define PCRE_ERROR_UNKNOWN_OPCODE (-5)
-#define PCRE_ERROR_UNKNOWN_NODE (-5) /* For backward compatibility */
-#define PCRE_ERROR_NOMEMORY (-6)
-#define PCRE_ERROR_NOSUBSTRING (-7)
-#define PCRE_ERROR_MATCHLIMIT (-8)
-#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */
-#define PCRE_ERROR_BADUTF8 (-10)
-#define PCRE_ERROR_BADUTF8_OFFSET (-11)
-#define PCRE_ERROR_PARTIAL (-12)
-#define PCRE_ERROR_BADPARTIAL (-13)
-#define PCRE_ERROR_INTERNAL (-14)
-#define PCRE_ERROR_BADCOUNT (-15)
-#define PCRE_ERROR_DFA_UITEM (-16)
-#define PCRE_ERROR_DFA_UCOND (-17)
-#define PCRE_ERROR_DFA_UMLIMIT (-18)
-#define PCRE_ERROR_DFA_WSSIZE (-19)
-#define PCRE_ERROR_DFA_RECURSE (-20)
-#define PCRE_ERROR_RECURSIONLIMIT (-21)
-#define PCRE_ERROR_NULLWSLIMIT (-22) /* No longer actually used */
-#define PCRE_ERROR_BADNEWLINE (-23)
-
-/* Request types for pcre_fullinfo() */
-
-#define PCRE_INFO_OPTIONS 0
-#define PCRE_INFO_SIZE 1
-#define PCRE_INFO_CAPTURECOUNT 2
-#define PCRE_INFO_BACKREFMAX 3
-#define PCRE_INFO_FIRSTBYTE 4
-#define PCRE_INFO_FIRSTCHAR 4 /* For backwards compatibility */
-#define PCRE_INFO_FIRSTTABLE 5
-#define PCRE_INFO_LASTLITERAL 6
-#define PCRE_INFO_NAMEENTRYSIZE 7
-#define PCRE_INFO_NAMECOUNT 8
-#define PCRE_INFO_NAMETABLE 9
-#define PCRE_INFO_STUDYSIZE 10
-#define PCRE_INFO_DEFAULT_TABLES 11
-#define PCRE_INFO_OKPARTIAL 12
-#define PCRE_INFO_JCHANGED 13
-#define PCRE_INFO_HASCRORLF 14
-
-/* Request types for pcre_config(). Do not re-arrange, in order to remain
-compatible. */
-
-#define PCRE_CONFIG_UTF8 0
-#define PCRE_CONFIG_NEWLINE 1
-#define PCRE_CONFIG_LINK_SIZE 2
-#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3
-#define PCRE_CONFIG_MATCH_LIMIT 4
-#define PCRE_CONFIG_STACKRECURSE 5
-#define PCRE_CONFIG_UNICODE_PROPERTIES 6
-#define PCRE_CONFIG_MATCH_LIMIT_RECURSION 7
-#define PCRE_CONFIG_BSR 8
-
-/* Bit flags for the pcre_extra structure. Do not re-arrange or redefine
-these bits, just add new ones on the end, in order to remain compatible. */
-
-#define PCRE_EXTRA_STUDY_DATA 0x0001
-#define PCRE_EXTRA_MATCH_LIMIT 0x0002
-#define PCRE_EXTRA_CALLOUT_DATA 0x0004
-#define PCRE_EXTRA_TABLES 0x0008
-#define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0x0010
-
-/* Types */
-
-struct real_pcre; /* declaration; the definition is private */
-typedef struct real_pcre pcre;
-
-/* When PCRE is compiled as a C++ library, the subject pointer type can be
-replaced with a custom type. For conventional use, the public interface is a
-const char *. */
-
-#ifndef PCRE_SPTR
-#define PCRE_SPTR const char *
-#endif
-
-/* The structure for passing additional data to pcre_exec(). This is defined in
-such as way as to be extensible. Always add new fields at the end, in order to
-remain compatible. */
-
-typedef struct pcre_extra {
- unsigned long int flags; /* Bits for which fields are set */
- void *study_data; /* Opaque data from pcre_study() */
- unsigned long int match_limit; /* Maximum number of calls to match() */
- void *callout_data; /* Data passed back in callouts */
- const unsigned char *tables; /* Pointer to character tables */
- unsigned long int match_limit_recursion; /* Max recursive calls to match() */
-} pcre_extra;
-
-/* The structure for passing out data via the pcre_callout_function. We use a
-structure so that new fields can be added on the end in future versions,
-without changing the API of the function, thereby allowing old clients to work
-without modification. */
-
-typedef struct pcre_callout_block {
- int version; /* Identifies version of block */
- /* ------------------------ Version 0 ------------------------------- */
- int callout_number; /* Number compiled into pattern */
- int *offset_vector; /* The offset vector */
- PCRE_SPTR subject; /* The subject being matched */
- int subject_length; /* The length of the subject */
- int start_match; /* Offset to start of this match attempt */
- int current_position; /* Where we currently are in the subject */
- int capture_top; /* Max current capture */
- int capture_last; /* Most recently closed capture */
- void *callout_data; /* Data passed in with the call */
- /* ------------------- Added for Version 1 -------------------------- */
- int pattern_position; /* Offset to next item in the pattern */
- int next_item_length; /* Length of next item in the pattern */
- /* ------------------------------------------------------------------ */
-} pcre_callout_block;
-
-/* Indirection for store get and free functions. These can be set to
-alternative malloc/free functions if required. Special ones are used in the
-non-recursive case for "frames". There is also an optional callout function
-that is triggered by the (?) regex item. For Virtual Pascal, these definitions
-have to take another form. */
-
-#ifndef VPCOMPAT
-PCRE_EXP_DECL void *(*pcre_malloc)(size_t);
-PCRE_EXP_DECL void (*pcre_free)(void *);
-PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t);
-PCRE_EXP_DECL void (*pcre_stack_free)(void *);
-PCRE_EXP_DECL int (*pcre_callout)(pcre_callout_block *);
-#else /* VPCOMPAT */
-PCRE_EXP_DECL void *pcre_malloc(size_t);
-PCRE_EXP_DECL void pcre_free(void *);
-PCRE_EXP_DECL void *pcre_stack_malloc(size_t);
-PCRE_EXP_DECL void pcre_stack_free(void *);
-PCRE_EXP_DECL int pcre_callout(pcre_callout_block *);
-#endif /* VPCOMPAT */
-
-/* Exported PCRE functions */
-
-PCRE_EXP_DECL pcre *pcre_compile(const char *, int, const char **, int *,
- const unsigned char *);
-PCRE_EXP_DECL pcre *pcre_compile2(const char *, int, int *, const char **,
- int *, const unsigned char *);
-PCRE_EXP_DECL int pcre_config(int, void *);
-PCRE_EXP_DECL int pcre_copy_named_substring(const pcre *, const char *,
- int *, int, const char *, char *, int);
-PCRE_EXP_DECL int pcre_copy_substring(const char *, int *, int, int, char *,
- int);
-PCRE_EXP_DECL int pcre_dfa_exec(const pcre *, const pcre_extra *,
- const char *, int, int, int, int *, int , int *, int);
-PCRE_EXP_DECL int pcre_exec(const pcre *, const pcre_extra *, PCRE_SPTR,
- int, int, int, int *, int);
-PCRE_EXP_DECL void pcre_free_substring(const char *);
-PCRE_EXP_DECL void pcre_free_substring_list(const char **);
-PCRE_EXP_DECL int pcre_fullinfo(const pcre *, const pcre_extra *, int,
- void *);
-PCRE_EXP_DECL int pcre_get_named_substring(const pcre *, const char *,
- int *, int, const char *, const char **);
-PCRE_EXP_DECL int pcre_get_stringnumber(const pcre *, const char *);
-PCRE_EXP_DECL int pcre_get_stringtable_entries(const pcre *, const char *,
- char **, char **);
-PCRE_EXP_DECL int pcre_get_substring(const char *, int *, int, int,
- const char **);
-PCRE_EXP_DECL int pcre_get_substring_list(const char *, int *, int,
- const char ***);
-PCRE_EXP_DECL int pcre_info(const pcre *, int *, int *);
-PCRE_EXP_DECL const unsigned char *pcre_maketables(void);
-PCRE_EXP_DECL int pcre_refcount(pcre *, int);
-PCRE_EXP_DECL pcre_extra *pcre_study(const pcre *, int, const char **);
-PCRE_EXP_DECL const char *pcre_version(void);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* End of pcre.h */
diff --git a/Utilities/Poco/Foundation/src/pcre_chartables.c b/Utilities/Poco/Foundation/src/pcre_chartables.c
deleted file mode 100755
index 1ed9d8d874..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_chartables.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* This file contains character tables that are used when no external tables
-are passed to PCRE by the application that calls it. The tables are used only
-for characters whose code values are less than 256.
-
-This is a default version of the tables that assumes ASCII encoding. A program
-called dftables (which is distributed with PCRE) can be used to build
-alternative versions of this file. This is necessary if you are running in an
-EBCDIC environment, or if you want to default to a different encoding, for
-example ISO-8859-1. When dftables is run, it creates these tables in the
-current locale. If PCRE is configured with --enable-rebuild-chartables, this
-happens automatically.
-
-The following #includes are present because without the gcc 4.x may remove the
-array definition from the final binary if PCRE is built into a static library
-and dead code stripping is activated. This leads to link errors. Pulling in the
-header ensures that the array gets flagged as "someone outside this compilation
-unit might reference this" and so it will always be supplied to the linker. */
-
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-const unsigned char _pcre_default_tables[] = {
-
-/* This table is a lower casing table. */
-
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63,
- 64, 97, 98, 99,100,101,102,103,
- 104,105,106,107,108,109,110,111,
- 112,113,114,115,116,117,118,119,
- 120,121,122, 91, 92, 93, 94, 95,
- 96, 97, 98, 99,100,101,102,103,
- 104,105,106,107,108,109,110,111,
- 112,113,114,115,116,117,118,119,
- 120,121,122,123,124,125,126,127,
- 128,129,130,131,132,133,134,135,
- 136,137,138,139,140,141,142,143,
- 144,145,146,147,148,149,150,151,
- 152,153,154,155,156,157,158,159,
- 160,161,162,163,164,165,166,167,
- 168,169,170,171,172,173,174,175,
- 176,177,178,179,180,181,182,183,
- 184,185,186,187,188,189,190,191,
- 192,193,194,195,196,197,198,199,
- 200,201,202,203,204,205,206,207,
- 208,209,210,211,212,213,214,215,
- 216,217,218,219,220,221,222,223,
- 224,225,226,227,228,229,230,231,
- 232,233,234,235,236,237,238,239,
- 240,241,242,243,244,245,246,247,
- 248,249,250,251,252,253,254,255,
-
-/* This table is a case flipping table. */
-
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63,
- 64, 97, 98, 99,100,101,102,103,
- 104,105,106,107,108,109,110,111,
- 112,113,114,115,116,117,118,119,
- 120,121,122, 91, 92, 93, 94, 95,
- 96, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90,123,124,125,126,127,
- 128,129,130,131,132,133,134,135,
- 136,137,138,139,140,141,142,143,
- 144,145,146,147,148,149,150,151,
- 152,153,154,155,156,157,158,159,
- 160,161,162,163,164,165,166,167,
- 168,169,170,171,172,173,174,175,
- 176,177,178,179,180,181,182,183,
- 184,185,186,187,188,189,190,191,
- 192,193,194,195,196,197,198,199,
- 200,201,202,203,204,205,206,207,
- 208,209,210,211,212,213,214,215,
- 216,217,218,219,220,221,222,223,
- 224,225,226,227,228,229,230,231,
- 232,233,234,235,236,237,238,239,
- 240,241,242,243,244,245,246,247,
- 248,249,250,251,252,253,254,255,
-
-/* This table contains bit maps for various character classes. Each map is 32
-bytes long and the bits run from the least significant end of each byte. The
-classes that have their own maps are: space, xdigit, digit, upper, lower, word,
-graph, print, punct, and cntrl. Other classes are built from combinations. */
-
- 0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
- 0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
- 0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc,
- 0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
-/* This table identifies various classes of character by individual bits:
- 0x01 white space character
- 0x02 letter
- 0x04 decimal digit
- 0x08 hexadecimal digit
- 0x10 alphanumeric or '_'
- 0x80 regular expression metacharacter or binary zero
-*/
-
- 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */
- 0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */
- 0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */
- 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */
- 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */
- 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */
- 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */
- 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */
- 0x12,0x12,0x12,0x80,0x80,0x00,0x80,0x10, /* X - _ */
- 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */
- 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */
- 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */
- 0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /* x -127 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
-
-/* End of pcre_chartables.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_compile.c b/Utilities/Poco/Foundation/src/pcre_compile.c
deleted file mode 100755
index 5cc29ad313..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_compile.c
+++ /dev/null
@@ -1,6380 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains the external function pcre_compile(), along with
-supporting internal functions that are not used by other modules. */
-
-
-#include "pcre_config.h"
-
-#define NLBLOCK cd /* Block containing newline information */
-#define PSSTART start_pattern /* Field containing processed string start */
-#define PSEND end_pattern /* Field containing processed string end */
-
-#include "pcre_internal.h"
-
-
-/* When DEBUG is defined, we need the pcre_printint() function, which is also
-used by pcretest. DEBUG is not defined when building a production library. */
-
-#ifdef DEBUG
-#include "pcre_printint.src"
-#endif
-
-
-/* Macro for setting individual bits in class bitmaps. */
-
-#define SETBIT(a,b) a[b/8] |= (1 << (b%8))
-
-/* Maximum length value to check against when making sure that the integer that
-holds the compiled pattern length does not overflow. We make it a bit less than
-INT_MAX to allow for adding in group terminating bytes, so that we don't have
-to check them every time. */
-
-#define OFLOW_MAX (INT_MAX - 20)
-
-
-/*************************************************
-* Code parameters and static tables *
-*************************************************/
-
-/* This value specifies the size of stack workspace that is used during the
-first pre-compile phase that determines how much memory is required. The regex
-is partly compiled into this space, but the compiled parts are discarded as
-soon as they can be, so that hopefully there will never be an overrun. The code
-does, however, check for an overrun. The largest amount I've seen used is 218,
-so this number is very generous.
-
-The same workspace is used during the second, actual compile phase for
-remembering forward references to groups so that they can be filled in at the
-end. Each entry in this list occupies LINK_SIZE bytes, so even when LINK_SIZE
-is 4 there is plenty of room. */
-
-#define COMPILE_WORK_SIZE (4096)
-
-
-/* Table for handling escaped characters in the range '0'-'z'. Positive returns
-are simple data values; negative values are for special things like \d and so
-on. Zero means further processing is needed (for things like \x), or the escape
-is invalid. */
-
-#ifndef EBCDIC /* This is the "normal" table for ASCII systems */
-static const short int escapes[] = {
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0 - 7 */
- 0, 0, ':', ';', '<', '=', '>', '?', /* 8 - ? */
- '@', -ESC_A, -ESC_B, -ESC_C, -ESC_D, -ESC_E, 0, -ESC_G, /* @ - G */
--ESC_H, 0, 0, -ESC_K, 0, 0, 0, 0, /* H - O */
--ESC_P, -ESC_Q, -ESC_R, -ESC_S, 0, 0, -ESC_V, -ESC_W, /* P - W */
--ESC_X, 0, -ESC_Z, '[', '\\', ']', '^', '_', /* X - _ */
- '`', 7, -ESC_b, 0, -ESC_d, ESC_e, ESC_f, 0, /* ` - g */
--ESC_h, 0, 0, -ESC_k, 0, 0, ESC_n, 0, /* h - o */
--ESC_p, 0, ESC_r, -ESC_s, ESC_tee, 0, -ESC_v, -ESC_w, /* p - w */
- 0, 0, -ESC_z /* x - z */
-};
-
-#else /* This is the "abnormal" table for EBCDIC systems */
-static const short int escapes[] = {
-/* 48 */ 0, 0, 0, '.', '<', '(', '+', '|',
-/* 50 */ '&', 0, 0, 0, 0, 0, 0, 0,
-/* 58 */ 0, 0, '!', '$', '*', ')', ';', '~',
-/* 60 */ '-', '/', 0, 0, 0, 0, 0, 0,
-/* 68 */ 0, 0, '|', ',', '%', '_', '>', '?',
-/* 70 */ 0, 0, 0, 0, 0, 0, 0, 0,
-/* 78 */ 0, '`', ':', '#', '@', '\'', '=', '"',
-/* 80 */ 0, 7, -ESC_b, 0, -ESC_d, ESC_e, ESC_f, 0,
-/* 88 */-ESC_h, 0, 0, '{', 0, 0, 0, 0,
-/* 90 */ 0, 0, -ESC_k, 'l', 0, ESC_n, 0, -ESC_p,
-/* 98 */ 0, ESC_r, 0, '}', 0, 0, 0, 0,
-/* A0 */ 0, '~', -ESC_s, ESC_tee, 0,-ESC_v, -ESC_w, 0,
-/* A8 */ 0,-ESC_z, 0, 0, 0, '[', 0, 0,
-/* B0 */ 0, 0, 0, 0, 0, 0, 0, 0,
-/* B8 */ 0, 0, 0, 0, 0, ']', '=', '-',
-/* C0 */ '{',-ESC_A, -ESC_B, -ESC_C, -ESC_D,-ESC_E, 0, -ESC_G,
-/* C8 */-ESC_H, 0, 0, 0, 0, 0, 0, 0,
-/* D0 */ '}', 0, -ESC_K, 0, 0, 0, 0, -ESC_P,
-/* D8 */-ESC_Q,-ESC_R, 0, 0, 0, 0, 0, 0,
-/* E0 */ '\\', 0, -ESC_S, 0, 0,-ESC_V, -ESC_W, -ESC_X,
-/* E8 */ 0,-ESC_Z, 0, 0, 0, 0, 0, 0,
-/* F0 */ 0, 0, 0, 0, 0, 0, 0, 0,
-/* F8 */ 0, 0, 0, 0, 0, 0, 0, 0
-};
-#endif
-
-
-/* Table of special "verbs" like (*PRUNE). This is a short table, so it is
-searched linearly. Put all the names into a single string, in order to reduce
-the number of relocations when a shared library is dynamically linked. */
-
-typedef struct verbitem {
- int len;
- int op;
-} verbitem;
-
-static const char verbnames[] =
- "ACCEPT\0"
- "COMMIT\0"
- "F\0"
- "FAIL\0"
- "PRUNE\0"
- "SKIP\0"
- "THEN";
-
-static const verbitem verbs[] = {
- { 6, OP_ACCEPT },
- { 6, OP_COMMIT },
- { 1, OP_FAIL },
- { 4, OP_FAIL },
- { 5, OP_PRUNE },
- { 4, OP_SKIP },
- { 4, OP_THEN }
-};
-
-static const int verbcount = sizeof(verbs)/sizeof(verbitem);
-
-
-/* Tables of names of POSIX character classes and their lengths. The names are
-now all in a single string, to reduce the number of relocations when a shared
-library is dynamically loaded. The list of lengths is terminated by a zero
-length entry. The first three must be alpha, lower, upper, as this is assumed
-for handling case independence. */
-
-static const char posix_names[] =
- "alpha\0" "lower\0" "upper\0" "alnum\0" "ascii\0" "blank\0"
- "cntrl\0" "digit\0" "graph\0" "print\0" "punct\0" "space\0"
- "word\0" "xdigit";
-
-static const uschar posix_name_lengths[] = {
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 6, 0 };
-
-/* Table of class bit maps for each POSIX class. Each class is formed from a
-base map, with an optional addition or removal of another map. Then, for some
-classes, there is some additional tweaking: for [:blank:] the vertical space
-characters are removed, and for [:alpha:] and [:alnum:] the underscore
-character is removed. The triples in the table consist of the base map offset,
-second map offset or -1 if no second map, and a non-negative value for map
-addition or a negative value for map subtraction (if there are two maps). The
-absolute value of the third field has these meanings: 0 => no tweaking, 1 =>
-remove vertical space characters, 2 => remove underscore. */
-
-static const int posix_class_maps[] = {
- cbit_word, cbit_digit, -2, /* alpha */
- cbit_lower, -1, 0, /* lower */
- cbit_upper, -1, 0, /* upper */
- cbit_word, -1, 2, /* alnum - word without underscore */
- cbit_print, cbit_cntrl, 0, /* ascii */
- cbit_space, -1, 1, /* blank - a GNU extension */
- cbit_cntrl, -1, 0, /* cntrl */
- cbit_digit, -1, 0, /* digit */
- cbit_graph, -1, 0, /* graph */
- cbit_print, -1, 0, /* print */
- cbit_punct, -1, 0, /* punct */
- cbit_space, -1, 0, /* space */
- cbit_word, -1, 0, /* word - a Perl extension */
- cbit_xdigit,-1, 0 /* xdigit */
-};
-
-
-#define STRING(a) # a
-#define XSTRING(s) STRING(s)
-
-/* The texts of compile-time error messages. These are "char *" because they
-are passed to the outside world. Do not ever re-use any error number, because
-they are documented. Always add a new error instead. Messages marked DEAD below
-are no longer used. This used to be a table of strings, but in order to reduce
-the number of relocations needed when a shared library is loaded dynamically,
-it is now one long string. We cannot use a table of offsets, because the
-lengths of inserts such as XSTRING(MAX_NAME_SIZE) are not known. Instead, we
-simply count through to the one we want - this isn't a performance issue
-because these strings are used only when there is a compilation error. */
-
-static const char error_texts[] =
- "no error\0"
- "\\ at end of pattern\0"
- "\\c at end of pattern\0"
- "unrecognized character follows \\\0"
- "numbers out of order in {} quantifier\0"
- /* 5 */
- "number too big in {} quantifier\0"
- "missing terminating ] for character class\0"
- "invalid escape sequence in character class\0"
- "range out of order in character class\0"
- "nothing to repeat\0"
- /* 10 */
- "operand of unlimited repeat could match the empty string\0" /** DEAD **/
- "internal error: unexpected repeat\0"
- "unrecognized character after (? or (?-\0"
- "POSIX named classes are supported only within a class\0"
- "missing )\0"
- /* 15 */
- "reference to non-existent subpattern\0"
- "erroffset passed as NULL\0"
- "unknown option bit(s) set\0"
- "missing ) after comment\0"
- "parentheses nested too deeply\0" /** DEAD **/
- /* 20 */
- "regular expression is too large\0"
- "failed to get memory\0"
- "unmatched parentheses\0"
- "internal error: code overflow\0"
- "unrecognized character after (?<\0"
- /* 25 */
- "lookbehind assertion is not fixed length\0"
- "malformed number or name after (?(\0"
- "conditional group contains more than two branches\0"
- "assertion expected after (?(\0"
- "(?R or (?[+-]digits must be followed by )\0"
- /* 30 */
- "unknown POSIX class name\0"
- "POSIX collating elements are not supported\0"
- "this version of PCRE is not compiled with PCRE_UTF8 support\0"
- "spare error\0" /** DEAD **/
- "character value in \\x{...} sequence is too large\0"
- /* 35 */
- "invalid condition (?(0)\0"
- "\\C not allowed in lookbehind assertion\0"
- "PCRE does not support \\L, \\l, \\N, \\U, or \\u\0"
- "number after (?C is > 255\0"
- "closing ) for (?C expected\0"
- /* 40 */
- "recursive call could loop indefinitely\0"
- "unrecognized character after (?P\0"
- "syntax error in subpattern name (missing terminator)\0"
- "two named subpatterns have the same name\0"
- "invalid UTF-8 string\0"
- /* 45 */
- "support for \\P, \\p, and \\X has not been compiled\0"
- "malformed \\P or \\p sequence\0"
- "unknown property name after \\P or \\p\0"
- "subpattern name is too long (maximum " XSTRING(MAX_NAME_SIZE) " characters)\0"
- "too many named subpatterns (maximum " XSTRING(MAX_NAME_COUNT) ")\0"
- /* 50 */
- "repeated subpattern is too long\0" /** DEAD **/
- "octal value is greater than \\377 (not in UTF-8 mode)\0"
- "internal error: overran compiling workspace\0"
- "internal error: previously-checked referenced subpattern not found\0"
- "DEFINE group contains more than one branch\0"
- /* 55 */
- "repeating a DEFINE group is not allowed\0"
- "inconsistent NEWLINE options\0"
- "\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number\0"
- "a numbered reference must not be zero\0"
- "(*VERB) with an argument is not supported\0"
- /* 60 */
- "(*VERB) not recognized\0"
- "number is too big\0"
- "subpattern name expected\0"
- "digit expected after (?+\0"
- "] is an invalid data character in JavaScript compatibility mode";
-
-
-/* Table to identify digits and hex digits. This is used when compiling
-patterns. Note that the tables in chartables are dependent on the locale, and
-may mark arbitrary characters as digits - but the PCRE compiling code expects
-to handle only 0-9, a-z, and A-Z as digits when compiling. That is why we have
-a private table here. It costs 256 bytes, but it is a lot faster than doing
-character value tests (at least in some simple cases I timed), and in some
-applications one wants PCRE to compile efficiently as well as match
-efficiently.
-
-For convenience, we use the same bit definitions as in chartables:
-
- 0x04 decimal digit
- 0x08 hexadecimal digit
-
-Then we can use ctype_digit and ctype_xdigit in the code. */
-
-#ifndef EBCDIC /* This is the "normal" case, for ASCII systems */
-static const unsigned char digitab[] =
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - ' */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ( - / */
- 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 */
- 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, /* 8 - ? */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* @ - G */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* H - O */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* P - W */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* X - _ */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* ` - g */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* h - o */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* p - w */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* x -127 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
-
-#else /* This is the "abnormal" case, for EBCDIC systems */
-static const unsigned char digitab[] =
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 10 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 32- 39 20 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 40- 47 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 48- 55 30 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 56- 63 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 40 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 72- | */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 50 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 88- 95 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 60 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 104- ? */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 70 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- " */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* 128- g 80 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* h -143 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144- p 90 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* q -159 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160- x A0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* y -175 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ^ -183 B0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* { - G C0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* H -207 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* } - P D0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* Q -223 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* \ - X E0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* Y -239 */
- 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 F0 */
- 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */
-
-static const unsigned char ebcdic_chartab[] = { /* chartable partial dup */
- 0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 0- 7 */
- 0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 16- 23 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 32- 39 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 40- 47 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 48- 55 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 56- 63 */
- 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 */
- 0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80, /* 72- | */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 */
- 0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00, /* 88- 95 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 */
- 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x80, /* 104- ? */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- " */
- 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* 128- g */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* h -143 */
- 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* 144- p */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* q -159 */
- 0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* 160- x */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* y -175 */
- 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ^ -183 */
- 0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x80,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* { - G */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* H -207 */
- 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* } - P */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* Q -223 */
- 0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* \ - X */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* Y -239 */
- 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */
- 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */
-#endif
-
-
-/* Definition to allow mutual recursion */
-
-static BOOL
- compile_regex(int, int, uschar **, const uschar **, int *, BOOL, BOOL, int,
- int *, int *, branch_chain *, compile_data *, int *);
-
-
-
-/*************************************************
-* Find an error text *
-*************************************************/
-
-/* The error texts are now all in one long string, to save on relocations. As
-some of the text is of unknown length, we can't use a table of offsets.
-Instead, just count through the strings. This is not a performance issue
-because it happens only when there has been a compilation error.
-
-Argument: the error number
-Returns: pointer to the error string
-*/
-
-static const char *
-find_error_text(int n)
-{
-const char *s = error_texts;
-for (; n > 0; n--) while (*s++ != 0) {};
-return s;
-}
-
-
-/*************************************************
-* Handle escapes *
-*************************************************/
-
-/* This function is called when a \ has been encountered. It either returns a
-positive value for a simple escape such as \n, or a negative value which
-encodes one of the more complicated things such as \d. A backreference to group
-n is returned as -(ESC_REF + n); ESC_REF is the highest ESC_xxx macro. When
-UTF-8 is enabled, a positive value greater than 255 may be returned. On entry,
-ptr is pointing at the \. On exit, it is on the final character of the escape
-sequence.
-
-Arguments:
- ptrptr points to the pattern position pointer
- errorcodeptr points to the errorcode variable
- bracount number of previous extracting brackets
- options the options bits
- isclass TRUE if inside a character class
-
-Returns: zero or positive => a data character
- negative => a special escape sequence
- on error, errorcodeptr is set
-*/
-
-static int
-check_escape(const uschar **ptrptr, int *errorcodeptr, int bracount,
- int options, BOOL isclass)
-{
-BOOL utf8 = (options & PCRE_UTF8) != 0;
-const uschar *ptr = *ptrptr + 1;
-int c, i;
-
-GETCHARINCTEST(c, ptr); /* Get character value, increment pointer */
-ptr--; /* Set pointer back to the last byte */
-
-/* If backslash is at the end of the pattern, it's an error. */
-
-if (c == 0) *errorcodeptr = ERR1;
-
-/* Non-alphanumerics are literals. For digits or letters, do an initial lookup
-in a table. A non-zero result is something that can be returned immediately.
-Otherwise further processing may be required. */
-
-#ifndef EBCDIC /* ASCII coding */
-else if (c < '0' || c > 'z') {} /* Not alphanumeric */
-else if ((i = escapes[c - '0']) != 0) c = i;
-
-#else /* EBCDIC coding */
-else if (c < 'a' || (ebcdic_chartab[c] & 0x0E) == 0) {} /* Not alphanumeric */
-else if ((i = escapes[c - 0x48]) != 0) c = i;
-#endif
-
-/* Escapes that need further processing, or are illegal. */
-
-else
- {
- const uschar *oldptr;
- BOOL braced, negated;
-
- switch (c)
- {
- /* A number of Perl escapes are not handled by PCRE. We give an explicit
- error. */
-
- case 'l':
- case 'L':
- case 'N':
- case 'u':
- case 'U':
- *errorcodeptr = ERR37;
- break;
-
- /* \g must be followed by one of a number of specific things:
-
- (1) A number, either plain or braced. If positive, it is an absolute
- backreference. If negative, it is a relative backreference. This is a Perl
- 5.10 feature.
-
- (2) Perl 5.10 also supports \g{name} as a reference to a named group. This
- is part of Perl's movement towards a unified syntax for back references. As
- this is synonymous with \k{name}, we fudge it up by pretending it really
- was \k.
-
- (3) For Oniguruma compatibility we also support \g followed by a name or a
- number either in angle brackets or in single quotes. However, these are
- (possibly recursive) subroutine calls, _not_ backreferences. Just return
- the -ESC_g code (cf \k). */
-
- case 'g':
- if (ptr[1] == '<' || ptr[1] == '\'')
- {
- c = -ESC_g;
- break;
- }
-
- /* Handle the Perl-compatible cases */
-
- if (ptr[1] == '{')
- {
- const uschar *p;
- for (p = ptr+2; *p != 0 && *p != '}'; p++)
- if (*p != '-' && (digitab[*p] & ctype_digit) == 0) break;
- if (*p != 0 && *p != '}')
- {
- c = -ESC_k;
- break;
- }
- braced = TRUE;
- ptr++;
- }
- else braced = FALSE;
-
- if (ptr[1] == '-')
- {
- negated = TRUE;
- ptr++;
- }
- else negated = FALSE;
-
- c = 0;
- while ((digitab[ptr[1]] & ctype_digit) != 0)
- c = c * 10 + *(++ptr) - '0';
-
- if (c < 0) /* Integer overflow */
- {
- *errorcodeptr = ERR61;
- break;
- }
-
- if (braced && *(++ptr) != '}')
- {
- *errorcodeptr = ERR57;
- break;
- }
-
- if (c == 0)
- {
- *errorcodeptr = ERR58;
- break;
- }
-
- if (negated)
- {
- if (c > bracount)
- {
- *errorcodeptr = ERR15;
- break;
- }
- c = bracount - (c - 1);
- }
-
- c = -(ESC_REF + c);
- break;
-
- /* The handling of escape sequences consisting of a string of digits
- starting with one that is not zero is not straightforward. By experiment,
- the way Perl works seems to be as follows:
-
- Outside a character class, the digits are read as a decimal number. If the
- number is less than 10, or if there are that many previous extracting
- left brackets, then it is a back reference. Otherwise, up to three octal
- digits are read to form an escaped byte. Thus \123 is likely to be octal
- 123 (cf \0123, which is octal 012 followed by the literal 3). If the octal
- value is greater than 377, the least significant 8 bits are taken. Inside a
- character class, \ followed by a digit is always an octal number. */
-
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
-
- if (!isclass)
- {
- oldptr = ptr;
- c -= '0';
- while ((digitab[ptr[1]] & ctype_digit) != 0)
- c = c * 10 + *(++ptr) - '0';
- if (c < 0) /* Integer overflow */
- {
- *errorcodeptr = ERR61;
- break;
- }
- if (c < 10 || c <= bracount)
- {
- c = -(ESC_REF + c);
- break;
- }
- ptr = oldptr; /* Put the pointer back and fall through */
- }
-
- /* Handle an octal number following \. If the first digit is 8 or 9, Perl
- generates a binary zero byte and treats the digit as a following literal.
- Thus we have to pull back the pointer by one. */
-
- if ((c = *ptr) >= '8')
- {
- ptr--;
- c = 0;
- break;
- }
-
- /* \0 always starts an octal number, but we may drop through to here with a
- larger first octal digit. The original code used just to take the least
- significant 8 bits of octal numbers (I think this is what early Perls used
- to do). Nowadays we allow for larger numbers in UTF-8 mode, but no more
- than 3 octal digits. */
-
- case '0':
- c -= '0';
- while(i++ < 2 && ptr[1] >= '0' && ptr[1] <= '7')
- c = c * 8 + *(++ptr) - '0';
- if (!utf8 && c > 255) *errorcodeptr = ERR51;
- break;
-
- /* \x is complicated. \x{ddd} is a character number which can be greater
- than 0xff in utf8 mode, but only if the ddd are hex digits. If not, { is
- treated as a data character. */
-
- case 'x':
- if (ptr[1] == '{')
- {
- const uschar *pt = ptr + 2;
- int count = 0;
-
- c = 0;
- while ((digitab[*pt] & ctype_xdigit) != 0)
- {
- register int cc = *pt++;
- if (c == 0 && cc == '0') continue; /* Leading zeroes */
- count++;
-
-#ifndef EBCDIC /* ASCII coding */
- if (cc >= 'a') cc -= 32; /* Convert to upper case */
- c = (c << 4) + cc - ((cc < 'A')? '0' : ('A' - 10));
-#else /* EBCDIC coding */
- if (cc >= 'a' && cc <= 'z') cc += 64; /* Convert to upper case */
- c = (c << 4) + cc - ((cc >= '0')? '0' : ('A' - 10));
-#endif
- }
-
- if (*pt == '}')
- {
- if (c < 0 || count > (utf8? 8 : 2)) *errorcodeptr = ERR34;
- ptr = pt;
- break;
- }
-
- /* If the sequence of hex digits does not end with '}', then we don't
- recognize this construct; fall through to the normal \x handling. */
- }
-
- /* Read just a single-byte hex-defined char */
-
- c = 0;
- while (i++ < 2 && (digitab[ptr[1]] & ctype_xdigit) != 0)
- {
- int cc; /* Some compilers don't like ++ */
- cc = *(++ptr); /* in initializers */
-#ifndef EBCDIC /* ASCII coding */
- if (cc >= 'a') cc -= 32; /* Convert to upper case */
- c = c * 16 + cc - ((cc < 'A')? '0' : ('A' - 10));
-#else /* EBCDIC coding */
- if (cc <= 'z') cc += 64; /* Convert to upper case */
- c = c * 16 + cc - ((cc >= '0')? '0' : ('A' - 10));
-#endif
- }
- break;
-
- /* For \c, a following letter is upper-cased; then the 0x40 bit is flipped.
- This coding is ASCII-specific, but then the whole concept of \cx is
- ASCII-specific. (However, an EBCDIC equivalent has now been added.) */
-
- case 'c':
- c = *(++ptr);
- if (c == 0)
- {
- *errorcodeptr = ERR2;
- break;
- }
-
-#ifndef EBCDIC /* ASCII coding */
- if (c >= 'a' && c <= 'z') c -= 32;
- c ^= 0x40;
-#else /* EBCDIC coding */
- if (c >= 'a' && c <= 'z') c += 64;
- c ^= 0xC0;
-#endif
- break;
-
- /* PCRE_EXTRA enables extensions to Perl in the matter of escapes. Any
- other alphanumeric following \ is an error if PCRE_EXTRA was set;
- otherwise, for Perl compatibility, it is a literal. This code looks a bit
- odd, but there used to be some cases other than the default, and there may
- be again in future, so I haven't "optimized" it. */
-
- default:
- if ((options & PCRE_EXTRA) != 0) switch(c)
- {
- default:
- *errorcodeptr = ERR3;
- break;
- }
- break;
- }
- }
-
-*ptrptr = ptr;
-return c;
-}
-
-
-
-#ifdef SUPPORT_UCP
-/*************************************************
-* Handle \P and \p *
-*************************************************/
-
-/* This function is called after \P or \p has been encountered, provided that
-PCRE is compiled with support for Unicode properties. On entry, ptrptr is
-pointing at the P or p. On exit, it is pointing at the final character of the
-escape sequence.
-
-Argument:
- ptrptr points to the pattern position pointer
- negptr points to a boolean that is set TRUE for negation else FALSE
- dptr points to an int that is set to the detailed property value
- errorcodeptr points to the error code variable
-
-Returns: type value from ucp_type_table, or -1 for an invalid type
-*/
-
-static int
-get_ucp(const uschar **ptrptr, BOOL *negptr, int *dptr, int *errorcodeptr)
-{
-int c, i, bot, top;
-const uschar *ptr = *ptrptr;
-char name[32];
-
-c = *(++ptr);
-if (c == 0) goto ERROR_RETURN;
-
-*negptr = FALSE;
-
-/* \P or \p can be followed by a name in {}, optionally preceded by ^ for
-negation. */
-
-if (c == '{')
- {
- if (ptr[1] == '^')
- {
- *negptr = TRUE;
- ptr++;
- }
- for (i = 0; i < (int)sizeof(name) - 1; i++)
- {
- c = *(++ptr);
- if (c == 0) goto ERROR_RETURN;
- if (c == '}') break;
- name[i] = c;
- }
- if (c !='}') goto ERROR_RETURN;
- name[i] = 0;
- }
-
-/* Otherwise there is just one following character */
-
-else
- {
- name[0] = c;
- name[1] = 0;
- }
-
-*ptrptr = ptr;
-
-/* Search for a recognized property name using binary chop */
-
-bot = 0;
-top = _pcre_utt_size;
-
-while (bot < top)
- {
- i = (bot + top) >> 1;
- c = strcmp(name, _pcre_utt_names + _pcre_utt[i].name_offset);
- if (c == 0)
- {
- *dptr = _pcre_utt[i].value;
- return _pcre_utt[i].type;
- }
- if (c > 0) bot = i + 1; else top = i;
- }
-
-*errorcodeptr = ERR47;
-*ptrptr = ptr;
-return -1;
-
-ERROR_RETURN:
-*errorcodeptr = ERR46;
-*ptrptr = ptr;
-return -1;
-}
-#endif
-
-
-
-
-/*************************************************
-* Check for counted repeat *
-*************************************************/
-
-/* This function is called when a '{' is encountered in a place where it might
-start a quantifier. It looks ahead to see if it really is a quantifier or not.
-It is only a quantifier if it is one of the forms {ddd} {ddd,} or {ddd,ddd}
-where the ddds are digits.
-
-Arguments:
- p pointer to the first char after '{'
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-is_counted_repeat(const uschar *p)
-{
-if ((digitab[*p++] & ctype_digit) == 0) return FALSE;
-while ((digitab[*p] & ctype_digit) != 0) p++;
-if (*p == '}') return TRUE;
-
-if (*p++ != ',') return FALSE;
-if (*p == '}') return TRUE;
-
-if ((digitab[*p++] & ctype_digit) == 0) return FALSE;
-while ((digitab[*p] & ctype_digit) != 0) p++;
-
-return (*p == '}');
-}
-
-
-
-/*************************************************
-* Read repeat counts *
-*************************************************/
-
-/* Read an item of the form {n,m} and return the values. This is called only
-after is_counted_repeat() has confirmed that a repeat-count quantifier exists,
-so the syntax is guaranteed to be correct, but we need to check the values.
-
-Arguments:
- p pointer to first char after '{'
- minp pointer to int for min
- maxp pointer to int for max
- returned as -1 if no max
- errorcodeptr points to error code variable
-
-Returns: pointer to '}' on success;
- current ptr on error, with errorcodeptr set non-zero
-*/
-
-static const uschar *
-read_repeat_counts(const uschar *p, int *minp, int *maxp, int *errorcodeptr)
-{
-int min = 0;
-int max = -1;
-
-/* Read the minimum value and do a paranoid check: a negative value indicates
-an integer overflow. */
-
-while ((digitab[*p] & ctype_digit) != 0) min = min * 10 + *p++ - '0';
-if (min < 0 || min > 65535)
- {
- *errorcodeptr = ERR5;
- return p;
- }
-
-/* Read the maximum value if there is one, and again do a paranoid on its size.
-Also, max must not be less than min. */
-
-if (*p == '}') max = min; else
- {
- if (*(++p) != '}')
- {
- max = 0;
- while((digitab[*p] & ctype_digit) != 0) max = max * 10 + *p++ - '0';
- if (max < 0 || max > 65535)
- {
- *errorcodeptr = ERR5;
- return p;
- }
- if (max < min)
- {
- *errorcodeptr = ERR4;
- return p;
- }
- }
- }
-
-/* Fill in the required variables, and pass back the pointer to the terminating
-'}'. */
-
-*minp = min;
-*maxp = max;
-return p;
-}
-
-
-
-/*************************************************
-* Find forward referenced subpattern *
-*************************************************/
-
-/* This function scans along a pattern's text looking for capturing
-subpatterns, and counting them. If it finds a named pattern that matches the
-name it is given, it returns its number. Alternatively, if the name is NULL, it
-returns when it reaches a given numbered subpattern. This is used for forward
-references to subpatterns. We know that if (?P< is encountered, the name will
-be terminated by '>' because that is checked in the first pass.
-
-Arguments:
- ptr current position in the pattern
- cd compile background data
- name name to seek, or NULL if seeking a numbered subpattern
- lorn name length, or subpattern number if name is NULL
- xmode TRUE if we are in /x mode
-
-Returns: the number of the named subpattern, or -1 if not found
-*/
-
-static int
-find_parens(const uschar *ptr, compile_data *cd, const uschar *name, int lorn,
- BOOL xmode)
-{
-const uschar *thisname;
-int count = cd->bracount;
-
-for (; *ptr != 0; ptr++)
- {
- int term;
-
- /* Skip over backslashed characters and also entire \Q...\E */
-
- if (*ptr == '\\')
- {
- if (*(++ptr) == 0) return -1;
- if (*ptr == 'Q') for (;;)
- {
- while (*(++ptr) != 0 && *ptr != '\\') {};
- if (*ptr == 0) return -1;
- if (*(++ptr) == 'E') break;
- }
- continue;
- }
-
- /* Skip over character classes; this logic must be similar to the way they
- are handled for real. If the first character is '^', skip it. Also, if the
- first few characters (either before or after ^) are \Q\E or \E we skip them
- too. This makes for compatibility with Perl. */
-
- if (*ptr == '[')
- {
- BOOL negate_class = FALSE;
- for (;;)
- {
- int c = *(++ptr);
- if (c == '\\')
- {
- if (ptr[1] == 'E') ptr++;
- else if (strncmp((const char *)ptr+1, "Q\\E", 3) == 0) ptr += 3;
- else break;
- }
- else if (!negate_class && c == '^')
- negate_class = TRUE;
- else break;
- }
-
- /* If the next character is ']', it is a data character that must be
- skipped, except in JavaScript compatibility mode. */
-
- if (ptr[1] == ']' && (cd->external_options & PCRE_JAVASCRIPT_COMPAT) == 0)
- ptr++;
-
- while (*(++ptr) != ']')
- {
- if (*ptr == 0) return -1;
- if (*ptr == '\\')
- {
- if (*(++ptr) == 0) return -1;
- if (*ptr == 'Q') for (;;)
- {
- while (*(++ptr) != 0 && *ptr != '\\') {};
- if (*ptr == 0) return -1;
- if (*(++ptr) == 'E') break;
- }
- continue;
- }
- }
- continue;
- }
-
- /* Skip comments in /x mode */
-
- if (xmode && *ptr == '#')
- {
- while (*(++ptr) != 0 && *ptr != '\n') {};
- if (*ptr == 0) return -1;
- continue;
- }
-
- /* An opening parens must now be a real metacharacter */
-
- if (*ptr != '(') continue;
- if (ptr[1] != '?' && ptr[1] != '*')
- {
- count++;
- if (name == NULL && count == lorn) return count;
- continue;
- }
-
- ptr += 2;
- if (*ptr == 'P') ptr++; /* Allow optional P */
-
- /* We have to disambiguate (?<! and (?<= from (?<name> */
-
- if ((*ptr != '<' || ptr[1] == '!' || ptr[1] == '=') &&
- *ptr != '\'')
- continue;
-
- count++;
-
- if (name == NULL && count == lorn) return count;
- term = *ptr++;
- if (term == '<') term = '>';
- thisname = ptr;
- while (*ptr != term) ptr++;
- if (name != NULL && lorn == ptr - thisname &&
- strncmp((const char *)name, (const char *)thisname, lorn) == 0)
- return count;
- }
-
-return -1;
-}
-
-
-
-/*************************************************
-* Find first significant op code *
-*************************************************/
-
-/* This is called by several functions that scan a compiled expression looking
-for a fixed first character, or an anchoring op code etc. It skips over things
-that do not influence this. For some calls, a change of option is important.
-For some calls, it makes sense to skip negative forward and all backward
-assertions, and also the \b assertion; for others it does not.
-
-Arguments:
- code pointer to the start of the group
- options pointer to external options
- optbit the option bit whose changing is significant, or
- zero if none are
- skipassert TRUE if certain assertions are to be skipped
-
-Returns: pointer to the first significant opcode
-*/
-
-static const uschar*
-first_significant_code(const uschar *code, int *options, int optbit,
- BOOL skipassert)
-{
-for (;;)
- {
- switch ((int)*code)
- {
- case OP_OPT:
- if (optbit > 0 && ((int)code[1] & optbit) != (*options & optbit))
- *options = (int)code[1];
- code += 2;
- break;
-
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- if (!skipassert) return code;
- do code += GET(code, 1); while (*code == OP_ALT);
- code += _pcre_OP_lengths[*code];
- break;
-
- case OP_WORD_BOUNDARY:
- case OP_NOT_WORD_BOUNDARY:
- if (!skipassert) return code;
- /* Fall through */
-
- case OP_CALLOUT:
- case OP_CREF:
- case OP_RREF:
- case OP_DEF:
- code += _pcre_OP_lengths[*code];
- break;
-
- default:
- return code;
- }
- }
-/* Control never reaches here */
-}
-
-
-
-
-/*************************************************
-* Find the fixed length of a pattern *
-*************************************************/
-
-/* Scan a pattern and compute the fixed length of subject that will match it,
-if the length is fixed. This is needed for dealing with backward assertions.
-In UTF8 mode, the result is in characters rather than bytes.
-
-Arguments:
- code points to the start of the pattern (the bracket)
- options the compiling options
-
-Returns: the fixed length, or -1 if there is no fixed length,
- or -2 if \C was encountered
-*/
-
-static int
-find_fixedlength(uschar *code, int options)
-{
-int length = -1;
-
-register int branchlength = 0;
-register uschar *cc = code + 1 + LINK_SIZE;
-
-/* Scan along the opcodes for this branch. If we get to the end of the
-branch, check the length against that of the other branches. */
-
-for (;;)
- {
- int d;
- register int op = *cc;
- switch (op)
- {
- case OP_CBRA:
- case OP_BRA:
- case OP_ONCE:
- case OP_COND:
- d = find_fixedlength(cc + ((op == OP_CBRA)? 2:0), options);
- if (d < 0) return d;
- branchlength += d;
- do cc += GET(cc, 1); while (*cc == OP_ALT);
- cc += 1 + LINK_SIZE;
- break;
-
- /* Reached end of a branch; if it's a ket it is the end of a nested
- call. If it's ALT it is an alternation in a nested call. If it is
- END it's the end of the outer call. All can be handled by the same code. */
-
- case OP_ALT:
- case OP_KET:
- case OP_KETRMAX:
- case OP_KETRMIN:
- case OP_END:
- if (length < 0) length = branchlength;
- else if (length != branchlength) return -1;
- if (*cc != OP_ALT) return length;
- cc += 1 + LINK_SIZE;
- branchlength = 0;
- break;
-
- /* Skip over assertive subpatterns */
-
- case OP_ASSERT:
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- do cc += GET(cc, 1); while (*cc == OP_ALT);
- /* Fall through */
-
- /* Skip over things that don't match chars */
-
- case OP_REVERSE:
- case OP_CREF:
- case OP_RREF:
- case OP_DEF:
- case OP_OPT:
- case OP_CALLOUT:
- case OP_SOD:
- case OP_SOM:
- case OP_EOD:
- case OP_EODN:
- case OP_CIRC:
- case OP_DOLL:
- case OP_NOT_WORD_BOUNDARY:
- case OP_WORD_BOUNDARY:
- cc += _pcre_OP_lengths[*cc];
- break;
-
- /* Handle literal characters */
-
- case OP_CHAR:
- case OP_CHARNC:
- case OP_NOT:
- branchlength++;
- cc += 2;
-#ifdef SUPPORT_UTF8
- if ((options & PCRE_UTF8) != 0)
- {
- while ((*cc & 0xc0) == 0x80) cc++;
- }
-#endif
- break;
-
- /* Handle exact repetitions. The count is already in characters, but we
- need to skip over a multibyte character in UTF8 mode. */
-
- case OP_EXACT:
- branchlength += GET2(cc,1);
- cc += 4;
-#ifdef SUPPORT_UTF8
- if ((options & PCRE_UTF8) != 0)
- {
- while((*cc & 0x80) == 0x80) cc++;
- }
-#endif
- break;
-
- case OP_TYPEEXACT:
- branchlength += GET2(cc,1);
- if (cc[3] == OP_PROP || cc[3] == OP_NOTPROP) cc += 2;
- cc += 4;
- break;
-
- /* Handle single-char matchers */
-
- case OP_PROP:
- case OP_NOTPROP:
- cc += 2;
- /* Fall through */
-
- case OP_NOT_DIGIT:
- case OP_DIGIT:
- case OP_NOT_WHITESPACE:
- case OP_WHITESPACE:
- case OP_NOT_WORDCHAR:
- case OP_WORDCHAR:
- case OP_ANY:
- case OP_ALLANY:
- branchlength++;
- cc++;
- break;
-
- /* The single-byte matcher isn't allowed */
-
- case OP_ANYBYTE:
- return -2;
-
- /* Check a class for variable quantification */
-
-#ifdef SUPPORT_UTF8
- case OP_XCLASS:
- cc += GET(cc, 1) - 33;
- /* Fall through */
-#endif
-
- case OP_CLASS:
- case OP_NCLASS:
- cc += 33;
-
- switch (*cc)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- return -1;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- if (GET2(cc,1) != GET2(cc,3)) return -1;
- branchlength += GET2(cc,1);
- cc += 5;
- break;
-
- default:
- branchlength++;
- }
- break;
-
- /* Anything else is variable length */
-
- default:
- return -1;
- }
- }
-/* Control never gets here */
-}
-
-
-
-
-/*************************************************
-* Scan compiled regex for numbered bracket *
-*************************************************/
-
-/* This little function scans through a compiled pattern until it finds a
-capturing bracket with the given number.
-
-Arguments:
- code points to start of expression
- utf8 TRUE in UTF-8 mode
- number the required bracket number
-
-Returns: pointer to the opcode for the bracket, or NULL if not found
-*/
-
-static const uschar *
-find_bracket(const uschar *code, BOOL utf8, int number)
-{
-for (;;)
- {
- register int c = *code;
- if (c == OP_END) return NULL;
-
- /* XCLASS is used for classes that cannot be represented just by a bit
- map. This includes negated single high-valued characters. The length in
- the table is zero; the actual length is stored in the compiled code. */
-
- if (c == OP_XCLASS) code += GET(code, 1);
-
- /* Handle capturing bracket */
-
- else if (c == OP_CBRA)
- {
- int n = GET2(code, 1+LINK_SIZE);
- if (n == number) return (uschar *)code;
- code += _pcre_OP_lengths[c];
- }
-
- /* Otherwise, we can get the item's length from the table, except that for
- repeated character types, we have to test for \p and \P, which have an extra
- two bytes of parameters. */
-
- else
- {
- switch(c)
- {
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEEXACT:
- case OP_TYPEPOSUPTO:
- if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2;
- break;
- }
-
- /* Add in the fixed length from the table */
-
- code += _pcre_OP_lengths[c];
-
- /* In UTF-8 mode, opcodes that are followed by a character may be followed by
- a multi-byte character. The length in the table is a minimum, so we have to
- arrange to skip the extra bytes. */
-
-#ifdef SUPPORT_UTF8
- if (utf8) switch(c)
- {
- case OP_CHAR:
- case OP_CHARNC:
- case OP_EXACT:
- case OP_UPTO:
- case OP_MINUPTO:
- case OP_POSUPTO:
- case OP_STAR:
- case OP_MINSTAR:
- case OP_POSSTAR:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_POSPLUS:
- case OP_QUERY:
- case OP_MINQUERY:
- case OP_POSQUERY:
- if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f];
- break;
- }
-#else
- (void)(utf8); /* Keep compiler happy by referencing function argument */
-#endif
- }
- }
-}
-
-
-
-/*************************************************
-* Scan compiled regex for recursion reference *
-*************************************************/
-
-/* This little function scans through a compiled pattern until it finds an
-instance of OP_RECURSE.
-
-Arguments:
- code points to start of expression
- utf8 TRUE in UTF-8 mode
-
-Returns: pointer to the opcode for OP_RECURSE, or NULL if not found
-*/
-
-static const uschar *
-find_recurse(const uschar *code, BOOL utf8)
-{
-for (;;)
- {
- register int c = *code;
- if (c == OP_END) return NULL;
- if (c == OP_RECURSE) return code;
-
- /* XCLASS is used for classes that cannot be represented just by a bit
- map. This includes negated single high-valued characters. The length in
- the table is zero; the actual length is stored in the compiled code. */
-
- if (c == OP_XCLASS) code += GET(code, 1);
-
- /* Otherwise, we can get the item's length from the table, except that for
- repeated character types, we have to test for \p and \P, which have an extra
- two bytes of parameters. */
-
- else
- {
- switch(c)
- {
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- case OP_TYPEPOSUPTO:
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEEXACT:
- if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2;
- break;
- }
-
- /* Add in the fixed length from the table */
-
- code += _pcre_OP_lengths[c];
-
- /* In UTF-8 mode, opcodes that are followed by a character may be followed
- by a multi-byte character. The length in the table is a minimum, so we have
- to arrange to skip the extra bytes. */
-
-#ifdef SUPPORT_UTF8
- if (utf8) switch(c)
- {
- case OP_CHAR:
- case OP_CHARNC:
- case OP_EXACT:
- case OP_UPTO:
- case OP_MINUPTO:
- case OP_POSUPTO:
- case OP_STAR:
- case OP_MINSTAR:
- case OP_POSSTAR:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_POSPLUS:
- case OP_QUERY:
- case OP_MINQUERY:
- case OP_POSQUERY:
- if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f];
- break;
- }
-#else
- (void)(utf8); /* Keep compiler happy by referencing function argument */
-#endif
- }
- }
-}
-
-
-
-/*************************************************
-* Scan compiled branch for non-emptiness *
-*************************************************/
-
-/* This function scans through a branch of a compiled pattern to see whether it
-can match the empty string or not. It is called from could_be_empty()
-below and from compile_branch() when checking for an unlimited repeat of a
-group that can match nothing. Note that first_significant_code() skips over
-backward and negative forward assertions when its final argument is TRUE. If we
-hit an unclosed bracket, we return "empty" - this means we've struck an inner
-bracket whose current branch will already have been scanned.
-
-Arguments:
- code points to start of search
- endcode points to where to stop
- utf8 TRUE if in UTF8 mode
-
-Returns: TRUE if what is matched could be empty
-*/
-
-static BOOL
-could_be_empty_branch(const uschar *code, const uschar *endcode, BOOL utf8)
-{
-register int c;
-for (code = first_significant_code(code + _pcre_OP_lengths[*code], NULL, 0, TRUE);
- code < endcode;
- code = first_significant_code(code + _pcre_OP_lengths[c], NULL, 0, TRUE))
- {
- const uschar *ccode;
-
- c = *code;
-
- /* Skip over forward assertions; the other assertions are skipped by
- first_significant_code() with a TRUE final argument. */
-
- if (c == OP_ASSERT)
- {
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
- }
-
- /* Groups with zero repeats can of course be empty; skip them. */
-
- if (c == OP_BRAZERO || c == OP_BRAMINZERO || c == OP_SKIPZERO)
- {
- code += _pcre_OP_lengths[c];
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
- }
-
- /* For other groups, scan the branches. */
-
- if (c == OP_BRA || c == OP_CBRA || c == OP_ONCE || c == OP_COND)
- {
- BOOL empty_branch;
- if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */
-
- /* Scan a closed bracket */
-
- empty_branch = FALSE;
- do
- {
- if (!empty_branch && could_be_empty_branch(code, endcode, utf8))
- empty_branch = TRUE;
- code += GET(code, 1);
- }
- while (*code == OP_ALT);
- if (!empty_branch) return FALSE; /* All branches are non-empty */
- c = *code;
- continue;
- }
-
- /* Handle the other opcodes */
-
- switch (c)
- {
- /* Check for quantifiers after a class. XCLASS is used for classes that
- cannot be represented just by a bit map. This includes negated single
- high-valued characters. The length in _pcre_OP_lengths[] is zero; the
- actual length is stored in the compiled code, so we must update "code"
- here. */
-
-#ifdef SUPPORT_UTF8
- case OP_XCLASS:
- ccode = code += GET(code, 1);
- goto CHECK_CLASS_REPEAT;
-#endif
-
- case OP_CLASS:
- case OP_NCLASS:
- ccode = code + 33;
-
-#ifdef SUPPORT_UTF8
- CHECK_CLASS_REPEAT:
-#endif
-
- switch (*ccode)
- {
- case OP_CRSTAR: /* These could be empty; continue */
- case OP_CRMINSTAR:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- break;
-
- default: /* Non-repeat => class must match */
- case OP_CRPLUS: /* These repeats aren't empty */
- case OP_CRMINPLUS:
- return FALSE;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- if (GET2(ccode, 1) > 0) return FALSE; /* Minimum > 0 */
- break;
- }
- break;
-
- /* Opcodes that must match a character */
-
- case OP_PROP:
- case OP_NOTPROP:
- case OP_EXTUNI:
- case OP_NOT_DIGIT:
- case OP_DIGIT:
- case OP_NOT_WHITESPACE:
- case OP_WHITESPACE:
- case OP_NOT_WORDCHAR:
- case OP_WORDCHAR:
- case OP_ANY:
- case OP_ALLANY:
- case OP_ANYBYTE:
- case OP_CHAR:
- case OP_CHARNC:
- case OP_NOT:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_POSPLUS:
- case OP_EXACT:
- case OP_NOTPLUS:
- case OP_NOTMINPLUS:
- case OP_NOTPOSPLUS:
- case OP_NOTEXACT:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEPOSPLUS:
- case OP_TYPEEXACT:
- return FALSE;
-
- /* These are going to continue, as they may be empty, but we have to
- fudge the length for the \p and \P cases. */
-
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPOSSTAR:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- /* Same for these */
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEPOSUPTO:
- if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2;
- break;
-
- /* End of branch */
-
- case OP_KET:
- case OP_KETRMAX:
- case OP_KETRMIN:
- case OP_ALT:
- return TRUE;
-
- /* In UTF-8 mode, STAR, MINSTAR, POSSTAR, QUERY, MINQUERY, POSQUERY, UPTO,
- MINUPTO, and POSUPTO may be followed by a multibyte character */
-
-#ifdef SUPPORT_UTF8
- case OP_STAR:
- case OP_MINSTAR:
- case OP_POSSTAR:
- case OP_QUERY:
- case OP_MINQUERY:
- case OP_POSQUERY:
- case OP_UPTO:
- case OP_MINUPTO:
- case OP_POSUPTO:
- if (utf8) while ((code[2] & 0xc0) == 0x80) code++;
- break;
-#endif
- }
- }
-
-return TRUE;
-}
-
-
-
-/*************************************************
-* Scan compiled regex for non-emptiness *
-*************************************************/
-
-/* This function is called to check for left recursive calls. We want to check
-the current branch of the current pattern to see if it could match the empty
-string. If it could, we must look outwards for branches at other levels,
-stopping when we pass beyond the bracket which is the subject of the recursion.
-
-Arguments:
- code points to start of the recursion
- endcode points to where to stop (current RECURSE item)
- bcptr points to the chain of current (unclosed) branch starts
- utf8 TRUE if in UTF-8 mode
-
-Returns: TRUE if what is matched could be empty
-*/
-
-static BOOL
-could_be_empty(const uschar *code, const uschar *endcode, branch_chain *bcptr,
- BOOL utf8)
-{
-while (bcptr != NULL && bcptr->current >= code)
- {
- if (!could_be_empty_branch(bcptr->current, endcode, utf8)) return FALSE;
- bcptr = bcptr->outer;
- }
-return TRUE;
-}
-
-
-
-/*************************************************
-* Check for POSIX class syntax *
-*************************************************/
-
-/* This function is called when the sequence "[:" or "[." or "[=" is
-encountered in a character class. It checks whether this is followed by a
-sequence of characters terminated by a matching ":]" or ".]" or "=]". If we
-reach an unescaped ']' without the special preceding character, return FALSE.
-
-Originally, this function only recognized a sequence of letters between the
-terminators, but it seems that Perl recognizes any sequence of characters,
-though of course unknown POSIX names are subsequently rejected. Perl gives an
-"Unknown POSIX class" error for [:f\oo:] for example, where previously PCRE
-didn't consider this to be a POSIX class. Likewise for [:1234:].
-
-The problem in trying to be exactly like Perl is in the handling of escapes. We
-have to be sure that [abc[:x\]pqr] is *not* treated as containing a POSIX
-class, but [abc[:x\]pqr:]] is (so that an error can be generated). The code
-below handles the special case of \], but does not try to do any other escape
-processing. This makes it different from Perl for cases such as [:l\ower:]
-where Perl recognizes it as the POSIX class "lower" but PCRE does not recognize
-"l\ower". This is a lesser evil that not diagnosing bad classes when Perl does,
-I think.
-
-Arguments:
- ptr pointer to the initial [
- endptr where to return the end pointer
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-check_posix_syntax(const uschar *ptr, const uschar **endptr)
-{
-int terminator; /* Don't combine these lines; the Solaris cc */
-terminator = *(++ptr); /* compiler warns about "non-constant" initializer. */
-for (++ptr; *ptr != 0; ptr++)
- {
- if (*ptr == '\\' && ptr[1] == ']') ptr++; else
- {
- if (*ptr == ']') return FALSE;
- if (*ptr == terminator && ptr[1] == ']')
- {
- *endptr = ptr;
- return TRUE;
- }
- }
- }
-return FALSE;
-}
-
-
-
-
-/*************************************************
-* Check POSIX class name *
-*************************************************/
-
-/* This function is called to check the name given in a POSIX-style class entry
-such as [:alnum:].
-
-Arguments:
- ptr points to the first letter
- len the length of the name
-
-Returns: a value representing the name, or -1 if unknown
-*/
-
-static int
-check_posix_name(const uschar *ptr, int len)
-{
-const char *pn = posix_names;
-register int yield = 0;
-while (posix_name_lengths[yield] != 0)
- {
- if (len == posix_name_lengths[yield] &&
- strncmp((const char *)ptr, pn, len) == 0) return yield;
- pn += posix_name_lengths[yield] + 1;
- yield++;
- }
-return -1;
-}
-
-
-/*************************************************
-* Adjust OP_RECURSE items in repeated group *
-*************************************************/
-
-/* OP_RECURSE items contain an offset from the start of the regex to the group
-that is referenced. This means that groups can be replicated for fixed
-repetition simply by copying (because the recursion is allowed to refer to
-earlier groups that are outside the current group). However, when a group is
-optional (i.e. the minimum quantifier is zero), OP_BRAZERO or OP_SKIPZERO is
-inserted before it, after it has been compiled. This means that any OP_RECURSE
-items within it that refer to the group itself or any contained groups have to
-have their offsets adjusted. That one of the jobs of this function. Before it
-is called, the partially compiled regex must be temporarily terminated with
-OP_END.
-
-This function has been extended with the possibility of forward references for
-recursions and subroutine calls. It must also check the list of such references
-for the group we are dealing with. If it finds that one of the recursions in
-the current group is on this list, it adjusts the offset in the list, not the
-value in the reference (which is a group number).
-
-Arguments:
- group points to the start of the group
- adjust the amount by which the group is to be moved
- utf8 TRUE in UTF-8 mode
- cd contains pointers to tables etc.
- save_hwm the hwm forward reference pointer at the start of the group
-
-Returns: nothing
-*/
-
-static void
-adjust_recurse(uschar *group, int adjust, BOOL utf8, compile_data *cd,
- uschar *save_hwm)
-{
-uschar *ptr = group;
-
-while ((ptr = (uschar *)find_recurse(ptr, utf8)) != NULL)
- {
- int offset;
- uschar *hc;
-
- /* See if this recursion is on the forward reference list. If so, adjust the
- reference. */
-
- for (hc = save_hwm; hc < cd->hwm; hc += LINK_SIZE)
- {
- offset = GET(hc, 0);
- if (cd->start_code + offset == ptr + 1)
- {
- PUT(hc, 0, offset + adjust);
- break;
- }
- }
-
- /* Otherwise, adjust the recursion offset if it's after the start of this
- group. */
-
- if (hc >= cd->hwm)
- {
- offset = GET(ptr, 1);
- if (cd->start_code + offset >= group) PUT(ptr, 1, offset + adjust);
- }
-
- ptr += 1 + LINK_SIZE;
- }
-}
-
-
-
-/*************************************************
-* Insert an automatic callout point *
-*************************************************/
-
-/* This function is called when the PCRE_AUTO_CALLOUT option is set, to insert
-callout points before each pattern item.
-
-Arguments:
- code current code pointer
- ptr current pattern pointer
- cd pointers to tables etc
-
-Returns: new code pointer
-*/
-
-static uschar *
-auto_callout(uschar *code, const uschar *ptr, compile_data *cd)
-{
-*code++ = OP_CALLOUT;
-*code++ = 255;
-PUT(code, 0, ptr - cd->start_pattern); /* Pattern offset */
-PUT(code, LINK_SIZE, 0); /* Default length */
-return code + 2*LINK_SIZE;
-}
-
-
-
-/*************************************************
-* Complete a callout item *
-*************************************************/
-
-/* A callout item contains the length of the next item in the pattern, which
-we can't fill in till after we have reached the relevant point. This is used
-for both automatic and manual callouts.
-
-Arguments:
- previous_callout points to previous callout item
- ptr current pattern pointer
- cd pointers to tables etc
-
-Returns: nothing
-*/
-
-static void
-complete_callout(uschar *previous_callout, const uschar *ptr, compile_data *cd)
-{
-int length = ptr - cd->start_pattern - GET(previous_callout, 2);
-PUT(previous_callout, 2 + LINK_SIZE, length);
-}
-
-
-
-#ifdef SUPPORT_UCP
-/*************************************************
-* Get othercase range *
-*************************************************/
-
-/* This function is passed the start and end of a class range, in UTF-8 mode
-with UCP support. It searches up the characters, looking for internal ranges of
-characters in the "other" case. Each call returns the next one, updating the
-start address.
-
-Arguments:
- cptr points to starting character value; updated
- d end value
- ocptr where to put start of othercase range
- odptr where to put end of othercase range
-
-Yield: TRUE when range returned; FALSE when no more
-*/
-
-static BOOL
-get_othercase_range(unsigned int *cptr, unsigned int d, unsigned int *ocptr,
- unsigned int *odptr)
-{
-unsigned int c, othercase, next;
-
-for (c = *cptr; c <= d; c++)
- { if ((othercase = UCD_OTHERCASE(c)) != c) break; }
-
-if (c > d) return FALSE;
-
-*ocptr = othercase;
-next = othercase + 1;
-
-for (++c; c <= d; c++)
- {
- if (UCD_OTHERCASE(c) != next) break;
- next++;
- }
-
-*odptr = next - 1;
-*cptr = c;
-
-return TRUE;
-}
-#endif /* SUPPORT_UCP */
-
-
-
-/*************************************************
-* Check if auto-possessifying is possible *
-*************************************************/
-
-/* This function is called for unlimited repeats of certain items, to see
-whether the next thing could possibly match the repeated item. If not, it makes
-sense to automatically possessify the repeated item.
-
-Arguments:
- op_code the repeated op code
- this data for this item, depends on the opcode
- utf8 TRUE in UTF-8 mode
- utf8_char used for utf8 character bytes, NULL if not relevant
- ptr next character in pattern
- options options bits
- cd contains pointers to tables etc.
-
-Returns: TRUE if possessifying is wanted
-*/
-
-static BOOL
-check_auto_possessive(int op_code, int item, BOOL utf8, uschar *utf8_char,
- const uschar *ptr, int options, compile_data *cd)
-{
-int next;
-
-/* Skip whitespace and comments in extended mode */
-
-if ((options & PCRE_EXTENDED) != 0)
- {
- for (;;)
- {
- while ((cd->ctypes[*ptr] & ctype_space) != 0) ptr++;
- if (*ptr == '#')
- {
- while (*(++ptr) != 0)
- if (IS_NEWLINE(ptr)) { ptr += cd->nllen; break; }
- }
- else break;
- }
- }
-
-/* If the next item is one that we can handle, get its value. A non-negative
-value is a character, a negative value is an escape value. */
-
-if (*ptr == '\\')
- {
- int temperrorcode = 0;
- next = check_escape(&ptr, &temperrorcode, cd->bracount, options, FALSE);
- if (temperrorcode != 0) return FALSE;
- ptr++; /* Point after the escape sequence */
- }
-
-else if ((cd->ctypes[*ptr] & ctype_meta) == 0)
- {
-#ifdef SUPPORT_UTF8
- if (utf8) { GETCHARINC(next, ptr); } else
-#endif
- next = *ptr++;
- }
-
-else return FALSE;
-
-/* Skip whitespace and comments in extended mode */
-
-if ((options & PCRE_EXTENDED) != 0)
- {
- for (;;)
- {
- while ((cd->ctypes[*ptr] & ctype_space) != 0) ptr++;
- if (*ptr == '#')
- {
- while (*(++ptr) != 0)
- if (IS_NEWLINE(ptr)) { ptr += cd->nllen; break; }
- }
- else break;
- }
- }
-
-/* If the next thing is itself optional, we have to give up. */
-
-if (*ptr == '*' || *ptr == '?' || strncmp((char *)ptr, "{0,", 3) == 0)
- return FALSE;
-
-/* Now compare the next item with the previous opcode. If the previous is a
-positive single character match, "item" either contains the character or, if
-"item" is greater than 127 in utf8 mode, the character's bytes are in
-utf8_char. */
-
-
-/* Handle cases when the next item is a character. */
-
-if (next >= 0) switch(op_code)
- {
- case OP_CHAR:
-#ifdef SUPPORT_UTF8
- if (utf8 && item > 127) { GETCHAR(item, utf8_char); }
-#else
- (void)(utf8_char); /* Keep compiler happy by referencing function argument */
-#endif
- return item != next;
-
- /* For CHARNC (caseless character) we must check the other case. If we have
- Unicode property support, we can use it to test the other case of
- high-valued characters. */
-
- case OP_CHARNC:
-#ifdef SUPPORT_UTF8
- if (utf8 && item > 127) { GETCHAR(item, utf8_char); }
-#endif
- if (item == next) return FALSE;
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- unsigned int othercase;
- if (next < 128) othercase = cd->fcc[next]; else
-#ifdef SUPPORT_UCP
- othercase = UCD_OTHERCASE((unsigned int)next);
-#else
- othercase = NOTACHAR;
-#endif
- return (unsigned int)item != othercase;
- }
- else
-#endif /* SUPPORT_UTF8 */
- return (item != cd->fcc[next]); /* Non-UTF-8 mode */
-
- /* For OP_NOT, "item" must be a single-byte character. */
-
- case OP_NOT:
- if (item == next) return TRUE;
- if ((options & PCRE_CASELESS) == 0) return FALSE;
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- unsigned int othercase;
- if (next < 128) othercase = cd->fcc[next]; else
-#ifdef SUPPORT_UCP
- othercase = UCD_OTHERCASE(next);
-#else
- othercase = NOTACHAR;
-#endif
- return (unsigned int)item == othercase;
- }
- else
-#endif /* SUPPORT_UTF8 */
- return (item == cd->fcc[next]); /* Non-UTF-8 mode */
-
- case OP_DIGIT:
- return next > 127 || (cd->ctypes[next] & ctype_digit) == 0;
-
- case OP_NOT_DIGIT:
- return next <= 127 && (cd->ctypes[next] & ctype_digit) != 0;
-
- case OP_WHITESPACE:
- return next > 127 || (cd->ctypes[next] & ctype_space) == 0;
-
- case OP_NOT_WHITESPACE:
- return next <= 127 && (cd->ctypes[next] & ctype_space) != 0;
-
- case OP_WORDCHAR:
- return next > 127 || (cd->ctypes[next] & ctype_word) == 0;
-
- case OP_NOT_WORDCHAR:
- return next <= 127 && (cd->ctypes[next] & ctype_word) != 0;
-
- case OP_HSPACE:
- case OP_NOT_HSPACE:
- switch(next)
- {
- case 0x09:
- case 0x20:
- case 0xa0:
- case 0x1680:
- case 0x180e:
- case 0x2000:
- case 0x2001:
- case 0x2002:
- case 0x2003:
- case 0x2004:
- case 0x2005:
- case 0x2006:
- case 0x2007:
- case 0x2008:
- case 0x2009:
- case 0x200A:
- case 0x202f:
- case 0x205f:
- case 0x3000:
- return op_code != OP_HSPACE;
- default:
- return op_code == OP_HSPACE;
- }
-
- case OP_VSPACE:
- case OP_NOT_VSPACE:
- switch(next)
- {
- case 0x0a:
- case 0x0b:
- case 0x0c:
- case 0x0d:
- case 0x85:
- case 0x2028:
- case 0x2029:
- return op_code != OP_VSPACE;
- default:
- return op_code == OP_VSPACE;
- }
-
- default:
- return FALSE;
- }
-
-
-/* Handle the case when the next item is \d, \s, etc. */
-
-switch(op_code)
- {
- case OP_CHAR:
- case OP_CHARNC:
-#ifdef SUPPORT_UTF8
- if (utf8 && item > 127) { GETCHAR(item, utf8_char); }
-#endif
- switch(-next)
- {
- case ESC_d:
- return item > 127 || (cd->ctypes[item] & ctype_digit) == 0;
-
- case ESC_D:
- return item <= 127 && (cd->ctypes[item] & ctype_digit) != 0;
-
- case ESC_s:
- return item > 127 || (cd->ctypes[item] & ctype_space) == 0;
-
- case ESC_S:
- return item <= 127 && (cd->ctypes[item] & ctype_space) != 0;
-
- case ESC_w:
- return item > 127 || (cd->ctypes[item] & ctype_word) == 0;
-
- case ESC_W:
- return item <= 127 && (cd->ctypes[item] & ctype_word) != 0;
-
- case ESC_h:
- case ESC_H:
- switch(item)
- {
- case 0x09:
- case 0x20:
- case 0xa0:
- case 0x1680:
- case 0x180e:
- case 0x2000:
- case 0x2001:
- case 0x2002:
- case 0x2003:
- case 0x2004:
- case 0x2005:
- case 0x2006:
- case 0x2007:
- case 0x2008:
- case 0x2009:
- case 0x200A:
- case 0x202f:
- case 0x205f:
- case 0x3000:
- return -next != ESC_h;
- default:
- return -next == ESC_h;
- }
-
- case ESC_v:
- case ESC_V:
- switch(item)
- {
- case 0x0a:
- case 0x0b:
- case 0x0c:
- case 0x0d:
- case 0x85:
- case 0x2028:
- case 0x2029:
- return -next != ESC_v;
- default:
- return -next == ESC_v;
- }
-
- default:
- return FALSE;
- }
-
- case OP_DIGIT:
- return next == -ESC_D || next == -ESC_s || next == -ESC_W ||
- next == -ESC_h || next == -ESC_v;
-
- case OP_NOT_DIGIT:
- return next == -ESC_d;
-
- case OP_WHITESPACE:
- return next == -ESC_S || next == -ESC_d || next == -ESC_w;
-
- case OP_NOT_WHITESPACE:
- return next == -ESC_s || next == -ESC_h || next == -ESC_v;
-
- case OP_HSPACE:
- return next == -ESC_S || next == -ESC_H || next == -ESC_d || next == -ESC_w;
-
- case OP_NOT_HSPACE:
- return next == -ESC_h;
-
- /* Can't have \S in here because VT matches \S (Perl anomaly) */
- case OP_VSPACE:
- return next == -ESC_V || next == -ESC_d || next == -ESC_w;
-
- case OP_NOT_VSPACE:
- return next == -ESC_v;
-
- case OP_WORDCHAR:
- return next == -ESC_W || next == -ESC_s || next == -ESC_h || next == -ESC_v;
-
- case OP_NOT_WORDCHAR:
- return next == -ESC_w || next == -ESC_d;
-
- default:
- return FALSE;
- }
-
-/* Control does not reach here */
-}
-
-
-
-/*************************************************
-* Compile one branch *
-*************************************************/
-
-/* Scan the pattern, compiling it into the a vector. If the options are
-changed during the branch, the pointer is used to change the external options
-bits. This function is used during the pre-compile phase when we are trying
-to find out the amount of memory needed, as well as during the real compile
-phase. The value of lengthptr distinguishes the two phases.
-
-Arguments:
- optionsptr pointer to the option bits
- codeptr points to the pointer to the current code point
- ptrptr points to the current pattern pointer
- errorcodeptr points to error code variable
- firstbyteptr set to initial literal character, or < 0 (REQ_UNSET, REQ_NONE)
- reqbyteptr set to the last literal character required, else < 0
- bcptr points to current branch chain
- cd contains pointers to tables etc.
- lengthptr NULL during the real compile phase
- points to length accumulator during pre-compile phase
-
-Returns: TRUE on success
- FALSE, with *errorcodeptr set non-zero on error
-*/
-
-static BOOL
-compile_branch(int *optionsptr, uschar **codeptr, const uschar **ptrptr,
- int *errorcodeptr, int *firstbyteptr, int *reqbyteptr, branch_chain *bcptr,
- compile_data *cd, int *lengthptr)
-{
-int repeat_type, op_type;
-int repeat_min = 0, repeat_max = 0; /* To please picky compilers */
-int bravalue = 0;
-int greedy_default, greedy_non_default;
-int firstbyte, reqbyte;
-int zeroreqbyte, zerofirstbyte;
-int req_caseopt, reqvary, tempreqvary;
-int options = *optionsptr;
-int after_manual_callout = 0;
-int length_prevgroup = 0;
-register int c;
-register uschar *code = *codeptr;
-uschar *last_code = code;
-uschar *orig_code = code;
-uschar *tempcode;
-BOOL inescq = FALSE;
-BOOL groupsetfirstbyte = FALSE;
-const uschar *ptr = *ptrptr;
-const uschar *tempptr;
-uschar *previous = NULL;
-uschar *previous_callout = NULL;
-uschar *save_hwm = NULL;
-uschar classbits[32];
-
-#ifdef SUPPORT_UTF8
-BOOL class_utf8;
-BOOL utf8 = (options & PCRE_UTF8) != 0;
-uschar *class_utf8data;
-uschar *class_utf8data_base;
-uschar utf8_char[6];
-#else
-BOOL utf8 = FALSE;
-uschar *utf8_char = NULL;
-#endif
-
-#ifdef DEBUG
-if (lengthptr != NULL) DPRINTF((">> start branch\n"));
-#endif
-
-/* Set up the default and non-default settings for greediness */
-
-greedy_default = ((options & PCRE_UNGREEDY) != 0);
-greedy_non_default = greedy_default ^ 1;
-
-/* Initialize no first byte, no required byte. REQ_UNSET means "no char
-matching encountered yet". It gets changed to REQ_NONE if we hit something that
-matches a non-fixed char first char; reqbyte just remains unset if we never
-find one.
-
-When we hit a repeat whose minimum is zero, we may have to adjust these values
-to take the zero repeat into account. This is implemented by setting them to
-zerofirstbyte and zeroreqbyte when such a repeat is encountered. The individual
-item types that can be repeated set these backoff variables appropriately. */
-
-firstbyte = reqbyte = zerofirstbyte = zeroreqbyte = REQ_UNSET;
-
-/* The variable req_caseopt contains either the REQ_CASELESS value or zero,
-according to the current setting of the caseless flag. REQ_CASELESS is a bit
-value > 255. It is added into the firstbyte or reqbyte variables to record the
-case status of the value. This is used only for ASCII characters. */
-
-req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0;
-
-/* Switch on next character until the end of the branch */
-
-for (;; ptr++)
- {
- BOOL negate_class;
- BOOL should_flip_negation;
- BOOL possessive_quantifier;
- BOOL is_quantifier;
- BOOL is_recurse;
- BOOL reset_bracount;
- int class_charcount;
- int class_lastchar;
- int newoptions;
- int recno;
- int refsign;
- int skipbytes;
- int subreqbyte;
- int subfirstbyte;
- int terminator;
- int mclength;
- uschar mcbuffer[8];
-
- /* Get next byte in the pattern */
-
- c = *ptr;
-
- /* If we are in the pre-compile phase, accumulate the length used for the
- previous cycle of this loop. */
-
- if (lengthptr != NULL)
- {
-#ifdef DEBUG
- if (code > cd->hwm) cd->hwm = code; /* High water info */
-#endif
- if (code > cd->start_workspace + COMPILE_WORK_SIZE) /* Check for overrun */
- {
- *errorcodeptr = ERR52;
- goto FAILED;
- }
-
- /* There is at least one situation where code goes backwards: this is the
- case of a zero quantifier after a class (e.g. [ab]{0}). At compile time,
- the class is simply eliminated. However, it is created first, so we have to
- allow memory for it. Therefore, don't ever reduce the length at this point.
- */
-
- if (code < last_code) code = last_code;
-
- /* Paranoid check for integer overflow */
-
- if (OFLOW_MAX - *lengthptr < code - last_code)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
-
- *lengthptr += code - last_code;
- DPRINTF(("length=%d added %d c=%c\n", *lengthptr, code - last_code, c));
-
- /* If "previous" is set and it is not at the start of the work space, move
- it back to there, in order to avoid filling up the work space. Otherwise,
- if "previous" is NULL, reset the current code pointer to the start. */
-
- if (previous != NULL)
- {
- if (previous > orig_code)
- {
- memmove(orig_code, previous, code - previous);
- code -= previous - orig_code;
- previous = orig_code;
- }
- }
- else code = orig_code;
-
- /* Remember where this code item starts so we can pick up the length
- next time round. */
-
- last_code = code;
- }
-
- /* In the real compile phase, just check the workspace used by the forward
- reference list. */
-
- else if (cd->hwm > cd->start_workspace + COMPILE_WORK_SIZE)
- {
- *errorcodeptr = ERR52;
- goto FAILED;
- }
-
- /* If in \Q...\E, check for the end; if not, we have a literal */
-
- if (inescq && c != 0)
- {
- if (c == '\\' && ptr[1] == 'E')
- {
- inescq = FALSE;
- ptr++;
- continue;
- }
- else
- {
- if (previous_callout != NULL)
- {
- if (lengthptr == NULL) /* Don't attempt in pre-compile phase */
- complete_callout(previous_callout, ptr, cd);
- previous_callout = NULL;
- }
- if ((options & PCRE_AUTO_CALLOUT) != 0)
- {
- previous_callout = code;
- code = auto_callout(code, ptr, cd);
- }
- goto NORMAL_CHAR;
- }
- }
-
- /* Fill in length of a previous callout, except when the next thing is
- a quantifier. */
-
- is_quantifier = c == '*' || c == '+' || c == '?' ||
- (c == '{' && is_counted_repeat(ptr+1));
-
- if (!is_quantifier && previous_callout != NULL &&
- after_manual_callout-- <= 0)
- {
- if (lengthptr == NULL) /* Don't attempt in pre-compile phase */
- complete_callout(previous_callout, ptr, cd);
- previous_callout = NULL;
- }
-
- /* In extended mode, skip white space and comments */
-
- if ((options & PCRE_EXTENDED) != 0)
- {
- if ((cd->ctypes[c] & ctype_space) != 0) continue;
- if (c == '#')
- {
- while (*(++ptr) != 0)
- {
- if (IS_NEWLINE(ptr)) { ptr += cd->nllen - 1; break; }
- }
- if (*ptr != 0) continue;
-
- /* Else fall through to handle end of string */
- c = 0;
- }
- }
-
- /* No auto callout for quantifiers. */
-
- if ((options & PCRE_AUTO_CALLOUT) != 0 && !is_quantifier)
- {
- previous_callout = code;
- code = auto_callout(code, ptr, cd);
- }
-
- switch(c)
- {
- /* ===================================================================*/
- case 0: /* The branch terminates at string end */
- case '|': /* or | or ) */
- case ')':
- *firstbyteptr = firstbyte;
- *reqbyteptr = reqbyte;
- *codeptr = code;
- *ptrptr = ptr;
- if (lengthptr != NULL)
- {
- if (OFLOW_MAX - *lengthptr < code - last_code)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += code - last_code; /* To include callout length */
- DPRINTF((">> end branch\n"));
- }
- return TRUE;
-
-
- /* ===================================================================*/
- /* Handle single-character metacharacters. In multiline mode, ^ disables
- the setting of any following char as a first character. */
-
- case '^':
- if ((options & PCRE_MULTILINE) != 0)
- {
- if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;
- }
- previous = NULL;
- *code++ = OP_CIRC;
- break;
-
- case '$':
- previous = NULL;
- *code++ = OP_DOLL;
- break;
-
- /* There can never be a first char if '.' is first, whatever happens about
- repeats. The value of reqbyte doesn't change either. */
-
- case '.':
- if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;
- zerofirstbyte = firstbyte;
- zeroreqbyte = reqbyte;
- previous = code;
- *code++ = ((options & PCRE_DOTALL) != 0)? OP_ALLANY: OP_ANY;
- break;
-
-
- /* ===================================================================*/
- /* Character classes. If the included characters are all < 256, we build a
- 32-byte bitmap of the permitted characters, except in the special case
- where there is only one such character. For negated classes, we build the
- map as usual, then invert it at the end. However, we use a different opcode
- so that data characters > 255 can be handled correctly.
-
- If the class contains characters outside the 0-255 range, a different
- opcode is compiled. It may optionally have a bit map for characters < 256,
- but those above are are explicitly listed afterwards. A flag byte tells
- whether the bitmap is present, and whether this is a negated class or not.
-
- In JavaScript compatibility mode, an isolated ']' causes an error. In
- default (Perl) mode, it is treated as a data character. */
-
- case ']':
- if ((cd->external_options & PCRE_JAVASCRIPT_COMPAT) != 0)
- {
- *errorcodeptr = ERR64;
- goto FAILED;
- }
- goto NORMAL_CHAR;
-
- case '[':
- previous = code;
-
- /* PCRE supports POSIX class stuff inside a class. Perl gives an error if
- they are encountered at the top level, so we'll do that too. */
-
- if ((ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') &&
- check_posix_syntax(ptr, &tempptr))
- {
- *errorcodeptr = (ptr[1] == ':')? ERR13 : ERR31;
- goto FAILED;
- }
-
- /* If the first character is '^', set the negation flag and skip it. Also,
- if the first few characters (either before or after ^) are \Q\E or \E we
- skip them too. This makes for compatibility with Perl. */
-
- negate_class = FALSE;
- for (;;)
- {
- c = *(++ptr);
- if (c == '\\')
- {
- if (ptr[1] == 'E') ptr++;
- else if (strncmp((const char *)ptr+1, "Q\\E", 3) == 0) ptr += 3;
- else break;
- }
- else if (!negate_class && c == '^')
- negate_class = TRUE;
- else break;
- }
-
- /* Empty classes are allowed in JavaScript compatibility mode. Otherwise,
- an initial ']' is taken as a data character -- the code below handles
- that. In JS mode, [] must always fail, so generate OP_FAIL, whereas
- [^] must match any character, so generate OP_ALLANY. */
-
- if (c ==']' && (cd->external_options & PCRE_JAVASCRIPT_COMPAT) != 0)
- {
- *code++ = negate_class? OP_ALLANY : OP_FAIL;
- if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;
- zerofirstbyte = firstbyte;
- break;
- }
-
- /* If a class contains a negative special such as \S, we need to flip the
- negation flag at the end, so that support for characters > 255 works
- correctly (they are all included in the class). */
-
- should_flip_negation = FALSE;
-
- /* Keep a count of chars with values < 256 so that we can optimize the case
- of just a single character (as long as it's < 256). However, For higher
- valued UTF-8 characters, we don't yet do any optimization. */
-
- class_charcount = 0;
- class_lastchar = -1;
-
- /* Initialize the 32-char bit map to all zeros. We build the map in a
- temporary bit of memory, in case the class contains only 1 character (less
- than 256), because in that case the compiled code doesn't use the bit map.
- */
-
- memset(classbits, 0, 32 * sizeof(uschar));
-
-#ifdef SUPPORT_UTF8
- class_utf8 = FALSE; /* No chars >= 256 */
- class_utf8data = code + LINK_SIZE + 2; /* For UTF-8 items */
- class_utf8data_base = class_utf8data; /* For resetting in pass 1 */
-#endif
-
- /* Process characters until ] is reached. By writing this as a "do" it
- means that an initial ] is taken as a data character. At the start of the
- loop, c contains the first byte of the character. */
-
- if (c != 0) do
- {
- const uschar *oldptr;
-
-#ifdef SUPPORT_UTF8
- if (utf8 && c > 127)
- { /* Braces are required because the */
- GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */
- }
-
- /* In the pre-compile phase, accumulate the length of any UTF-8 extra
- data and reset the pointer. This is so that very large classes that
- contain a zillion UTF-8 characters no longer overwrite the work space
- (which is on the stack). */
-
- if (lengthptr != NULL)
- {
- *lengthptr += class_utf8data - class_utf8data_base;
- class_utf8data = class_utf8data_base;
- }
-
-#endif
-
- /* Inside \Q...\E everything is literal except \E */
-
- if (inescq)
- {
- if (c == '\\' && ptr[1] == 'E') /* If we are at \E */
- {
- inescq = FALSE; /* Reset literal state */
- ptr++; /* Skip the 'E' */
- continue; /* Carry on with next */
- }
- goto CHECK_RANGE; /* Could be range if \E follows */
- }
-
- /* Handle POSIX class names. Perl allows a negation extension of the
- form [:^name:]. A square bracket that doesn't match the syntax is
- treated as a literal. We also recognize the POSIX constructions
- [.ch.] and [=ch=] ("collating elements") and fault them, as Perl
- 5.6 and 5.8 do. */
-
- if (c == '[' &&
- (ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') &&
- check_posix_syntax(ptr, &tempptr))
- {
- BOOL local_negate = FALSE;
- int posix_class, taboffset, tabopt;
- register const uschar *cbits = cd->cbits;
- uschar pbits[32];
-
- if (ptr[1] != ':')
- {
- *errorcodeptr = ERR31;
- goto FAILED;
- }
-
- ptr += 2;
- if (*ptr == '^')
- {
- local_negate = TRUE;
- should_flip_negation = TRUE; /* Note negative special */
- ptr++;
- }
-
- posix_class = check_posix_name(ptr, tempptr - ptr);
- if (posix_class < 0)
- {
- *errorcodeptr = ERR30;
- goto FAILED;
- }
-
- /* If matching is caseless, upper and lower are converted to
- alpha. This relies on the fact that the class table starts with
- alpha, lower, upper as the first 3 entries. */
-
- if ((options & PCRE_CASELESS) != 0 && posix_class <= 2)
- posix_class = 0;
-
- /* We build the bit map for the POSIX class in a chunk of local store
- because we may be adding and subtracting from it, and we don't want to
- subtract bits that may be in the main map already. At the end we or the
- result into the bit map that is being built. */
-
- posix_class *= 3;
-
- /* Copy in the first table (always present) */
-
- memcpy(pbits, cbits + posix_class_maps[posix_class],
- 32 * sizeof(uschar));
-
- /* If there is a second table, add or remove it as required. */
-
- taboffset = posix_class_maps[posix_class + 1];
- tabopt = posix_class_maps[posix_class + 2];
-
- if (taboffset >= 0)
- {
- if (tabopt >= 0)
- for (c = 0; c < 32; c++) pbits[c] |= cbits[c + taboffset];
- else
- for (c = 0; c < 32; c++) pbits[c] &= ~cbits[c + taboffset];
- }
-
- /* Not see if we need to remove any special characters. An option
- value of 1 removes vertical space and 2 removes underscore. */
-
- if (tabopt < 0) tabopt = -tabopt;
- if (tabopt == 1) pbits[1] &= ~0x3c;
- else if (tabopt == 2) pbits[11] &= 0x7f;
-
- /* Add the POSIX table or its complement into the main table that is
- being built and we are done. */
-
- if (local_negate)
- for (c = 0; c < 32; c++) classbits[c] |= ~pbits[c];
- else
- for (c = 0; c < 32; c++) classbits[c] |= pbits[c];
-
- ptr = tempptr + 1;
- class_charcount = 10; /* Set > 1; assumes more than 1 per class */
- continue; /* End of POSIX syntax handling */
- }
-
- /* Backslash may introduce a single character, or it may introduce one
- of the specials, which just set a flag. The sequence \b is a special
- case. Inside a class (and only there) it is treated as backspace.
- Elsewhere it marks a word boundary. Other escapes have preset maps ready
- to 'or' into the one we are building. We assume they have more than one
- character in them, so set class_charcount bigger than one. */
-
- if (c == '\\')
- {
- c = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE);
- if (*errorcodeptr != 0) goto FAILED;
-
- if (-c == ESC_b) c = '\b'; /* \b is backspace in a class */
- else if (-c == ESC_X) c = 'X'; /* \X is literal X in a class */
- else if (-c == ESC_R) c = 'R'; /* \R is literal R in a class */
- else if (-c == ESC_Q) /* Handle start of quoted string */
- {
- if (ptr[1] == '\\' && ptr[2] == 'E')
- {
- ptr += 2; /* avoid empty string */
- }
- else inescq = TRUE;
- continue;
- }
- else if (-c == ESC_E) continue; /* Ignore orphan \E */
-
- if (c < 0)
- {
- register const uschar *cbits = cd->cbits;
- class_charcount += 2; /* Greater than 1 is what matters */
-
- /* Save time by not doing this in the pre-compile phase. */
-
- if (lengthptr == NULL) switch (-c)
- {
- case ESC_d:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_digit];
- continue;
-
- case ESC_D:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_digit];
- continue;
-
- case ESC_w:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_word];
- continue;
-
- case ESC_W:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word];
- continue;
-
- case ESC_s:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_space];
- classbits[1] &= ~0x08; /* Perl 5.004 onwards omits VT from \s */
- continue;
-
- case ESC_S:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space];
- classbits[1] |= 0x08; /* Perl 5.004 onwards omits VT from \s */
- continue;
-
- default: /* Not recognized; fall through */
- break; /* Need "default" setting to stop compiler warning. */
- }
-
- /* In the pre-compile phase, just do the recognition. */
-
- else if (c == -ESC_d || c == -ESC_D || c == -ESC_w ||
- c == -ESC_W || c == -ESC_s || c == -ESC_S) continue;
-
- /* We need to deal with \H, \h, \V, and \v in both phases because
- they use extra memory. */
-
- if (-c == ESC_h)
- {
- SETBIT(classbits, 0x09); /* VT */
- SETBIT(classbits, 0x20); /* SPACE */
- SETBIT(classbits, 0xa0); /* NSBP */
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- class_utf8 = TRUE;
- *class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(0x1680, class_utf8data);
- *class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(0x180e, class_utf8data);
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x2000, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x200A, class_utf8data);
- *class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(0x202f, class_utf8data);
- *class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(0x205f, class_utf8data);
- *class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(0x3000, class_utf8data);
- }
-#endif
- continue;
- }
-
- if (-c == ESC_H)
- {
- for (c = 0; c < 32; c++)
- {
- int x = 0xff;
- switch (c)
- {
- case 0x09/8: x ^= 1 << (0x09%8); break;
- case 0x20/8: x ^= 1 << (0x20%8); break;
- case 0xa0/8: x ^= 1 << (0xa0%8); break;
- default: break;
- }
- classbits[c] |= x;
- }
-
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- class_utf8 = TRUE;
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x0100, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x167f, class_utf8data);
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x1681, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x180d, class_utf8data);
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x180f, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x1fff, class_utf8data);
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x200B, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x202e, class_utf8data);
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x2030, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x205e, class_utf8data);
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x2060, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x2fff, class_utf8data);
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x3001, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x7fffffff, class_utf8data);
- }
-#endif
- continue;
- }
-
- if (-c == ESC_v)
- {
- SETBIT(classbits, 0x0a); /* LF */
- SETBIT(classbits, 0x0b); /* VT */
- SETBIT(classbits, 0x0c); /* FF */
- SETBIT(classbits, 0x0d); /* CR */
- SETBIT(classbits, 0x85); /* NEL */
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- class_utf8 = TRUE;
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x2028, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x2029, class_utf8data);
- }
-#endif
- continue;
- }
-
- if (-c == ESC_V)
- {
- for (c = 0; c < 32; c++)
- {
- int x = 0xff;
- switch (c)
- {
- case 0x0a/8: x ^= 1 << (0x0a%8);
- x ^= 1 << (0x0b%8);
- x ^= 1 << (0x0c%8);
- x ^= 1 << (0x0d%8);
- break;
- case 0x85/8: x ^= 1 << (0x85%8); break;
- default: break;
- }
- classbits[c] |= x;
- }
-
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- class_utf8 = TRUE;
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x0100, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x2027, class_utf8data);
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x2029, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x7fffffff, class_utf8data);
- }
-#endif
- continue;
- }
-
- /* We need to deal with \P and \p in both phases. */
-
-#ifdef SUPPORT_UCP
- if (-c == ESC_p || -c == ESC_P)
- {
- BOOL negated;
- int pdata;
- int ptype = get_ucp(&ptr, &negated, &pdata, errorcodeptr);
- if (ptype < 0) goto FAILED;
- class_utf8 = TRUE;
- *class_utf8data++ = ((-c == ESC_p) != negated)?
- XCL_PROP : XCL_NOTPROP;
- *class_utf8data++ = ptype;
- *class_utf8data++ = pdata;
- class_charcount -= 2; /* Not a < 256 character */
- continue;
- }
-#endif
- /* Unrecognized escapes are faulted if PCRE is running in its
- strict mode. By default, for compatibility with Perl, they are
- treated as literals. */
-
- if ((options & PCRE_EXTRA) != 0)
- {
- *errorcodeptr = ERR7;
- goto FAILED;
- }
-
- class_charcount -= 2; /* Undo the default count from above */
- c = *ptr; /* Get the final character and fall through */
- }
-
- /* Fall through if we have a single character (c >= 0). This may be
- greater than 256 in UTF-8 mode. */
-
- } /* End of backslash handling */
-
- /* A single character may be followed by '-' to form a range. However,
- Perl does not permit ']' to be the end of the range. A '-' character
- at the end is treated as a literal. Perl ignores orphaned \E sequences
- entirely. The code for handling \Q and \E is messy. */
-
- CHECK_RANGE:
- while (ptr[1] == '\\' && ptr[2] == 'E')
- {
- inescq = FALSE;
- ptr += 2;
- }
-
- oldptr = ptr;
-
- /* Remember \r or \n */
-
- if (c == '\r' || c == '\n') cd->external_flags |= PCRE_HASCRORLF;
-
- /* Check for range */
-
- if (!inescq && ptr[1] == '-')
- {
- int d;
- ptr += 2;
- while (*ptr == '\\' && ptr[1] == 'E') ptr += 2;
-
- /* If we hit \Q (not followed by \E) at this point, go into escaped
- mode. */
-
- while (*ptr == '\\' && ptr[1] == 'Q')
- {
- ptr += 2;
- if (*ptr == '\\' && ptr[1] == 'E') { ptr += 2; continue; }
- inescq = TRUE;
- break;
- }
-
- if (*ptr == 0 || (!inescq && *ptr == ']'))
- {
- ptr = oldptr;
- goto LONE_SINGLE_CHARACTER;
- }
-
-#ifdef SUPPORT_UTF8
- if (utf8)
- { /* Braces are required because the */
- GETCHARLEN(d, ptr, ptr); /* macro generates multiple statements */
- }
- else
-#endif
- d = *ptr; /* Not UTF-8 mode */
-
- /* The second part of a range can be a single-character escape, but
- not any of the other escapes. Perl 5.6 treats a hyphen as a literal
- in such circumstances. */
-
- if (!inescq && d == '\\')
- {
- d = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE);
- if (*errorcodeptr != 0) goto FAILED;
-
- /* \b is backspace; \X is literal X; \R is literal R; any other
- special means the '-' was literal */
-
- if (d < 0)
- {
- if (d == -ESC_b) d = '\b';
- else if (d == -ESC_X) d = 'X';
- else if (d == -ESC_R) d = 'R'; else
- {
- ptr = oldptr;
- goto LONE_SINGLE_CHARACTER; /* A few lines below */
- }
- }
- }
-
- /* Check that the two values are in the correct order. Optimize
- one-character ranges */
-
- if (d < c)
- {
- *errorcodeptr = ERR8;
- goto FAILED;
- }
-
- if (d == c) goto LONE_SINGLE_CHARACTER; /* A few lines below */
-
- /* Remember \r or \n */
-
- if (d == '\r' || d == '\n') cd->external_flags |= PCRE_HASCRORLF;
-
- /* In UTF-8 mode, if the upper limit is > 255, or > 127 for caseless
- matching, we have to use an XCLASS with extra data items. Caseless
- matching for characters > 127 is available only if UCP support is
- available. */
-
-#ifdef SUPPORT_UTF8
- if (utf8 && (d > 255 || ((options & PCRE_CASELESS) != 0 && d > 127)))
- {
- class_utf8 = TRUE;
-
- /* With UCP support, we can find the other case equivalents of
- the relevant characters. There may be several ranges. Optimize how
- they fit with the basic range. */
-
-#ifdef SUPPORT_UCP
- if ((options & PCRE_CASELESS) != 0)
- {
- unsigned int occ, ocd;
- unsigned int cc = c;
- unsigned int origd = d;
- while (get_othercase_range(&cc, origd, &occ, &ocd))
- {
- if (occ >= (unsigned int)c &&
- ocd <= (unsigned int)d)
- continue; /* Skip embedded ranges */
-
- if (occ < (unsigned int)c &&
- ocd >= (unsigned int)c - 1) /* Extend the basic range */
- { /* if there is overlap, */
- c = occ; /* noting that if occ < c */
- continue; /* we can't have ocd > d */
- } /* because a subrange is */
- if (ocd > (unsigned int)d &&
- occ <= (unsigned int)d + 1) /* always shorter than */
- { /* the basic range. */
- d = ocd;
- continue;
- }
-
- if (occ == ocd)
- {
- *class_utf8data++ = XCL_SINGLE;
- }
- else
- {
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(occ, class_utf8data);
- }
- class_utf8data += _pcre_ord2utf8(ocd, class_utf8data);
- }
- }
-#endif /* SUPPORT_UCP */
-
- /* Now record the original range, possibly modified for UCP caseless
- overlapping ranges. */
-
- *class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(c, class_utf8data);
- class_utf8data += _pcre_ord2utf8(d, class_utf8data);
-
- /* With UCP support, we are done. Without UCP support, there is no
- caseless matching for UTF-8 characters > 127; we can use the bit map
- for the smaller ones. */
-
-#ifdef SUPPORT_UCP
- continue; /* With next character in the class */
-#else
- if ((options & PCRE_CASELESS) == 0 || c > 127) continue;
-
- /* Adjust upper limit and fall through to set up the map */
-
- d = 127;
-
-#endif /* SUPPORT_UCP */
- }
-#endif /* SUPPORT_UTF8 */
-
- /* We use the bit map for all cases when not in UTF-8 mode; else
- ranges that lie entirely within 0-127 when there is UCP support; else
- for partial ranges without UCP support. */
-
- class_charcount += d - c + 1;
- class_lastchar = d;
-
- /* We can save a bit of time by skipping this in the pre-compile. */
-
- if (lengthptr == NULL) for (; c <= d; c++)
- {
- classbits[c/8] |= (1 << (c&7));
- if ((options & PCRE_CASELESS) != 0)
- {
- int uc = cd->fcc[c]; /* flip case */
- classbits[uc/8] |= (1 << (uc&7));
- }
- }
-
- continue; /* Go get the next char in the class */
- }
-
- /* Handle a lone single character - we can get here for a normal
- non-escape char, or after \ that introduces a single character or for an
- apparent range that isn't. */
-
- LONE_SINGLE_CHARACTER:
-
- /* Handle a character that cannot go in the bit map */
-
-#ifdef SUPPORT_UTF8
- if (utf8 && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127)))
- {
- class_utf8 = TRUE;
- *class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(c, class_utf8data);
-
-#ifdef SUPPORT_UCP
- if ((options & PCRE_CASELESS) != 0)
- {
- unsigned int othercase;
- if ((othercase = UCD_OTHERCASE(c)) != c)
- {
- *class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(othercase, class_utf8data);
- }
- }
-#endif /* SUPPORT_UCP */
-
- }
- else
-#endif /* SUPPORT_UTF8 */
-
- /* Handle a single-byte character */
- {
- classbits[c/8] |= (1 << (c&7));
- if ((options & PCRE_CASELESS) != 0)
- {
- c = cd->fcc[c]; /* flip case */
- classbits[c/8] |= (1 << (c&7));
- }
- class_charcount++;
- class_lastchar = c;
- }
- }
-
- /* Loop until ']' reached. This "while" is the end of the "do" above. */
-
- while ((c = *(++ptr)) != 0 && (c != ']' || inescq));
-
- if (c == 0) /* Missing terminating ']' */
- {
- *errorcodeptr = ERR6;
- goto FAILED;
- }
-
-
-/* This code has been disabled because it would mean that \s counts as
-an explicit \r or \n reference, and that's not really what is wanted. Now
-we set the flag only if there is a literal "\r" or "\n" in the class. */
-
-#if 0
- /* Remember whether \r or \n are in this class */
-
- if (negate_class)
- {
- if ((classbits[1] & 0x24) != 0x24) cd->external_flags |= PCRE_HASCRORLF;
- }
- else
- {
- if ((classbits[1] & 0x24) != 0) cd->external_flags |= PCRE_HASCRORLF;
- }
-#endif
-
-
- /* If class_charcount is 1, we saw precisely one character whose value is
- less than 256. As long as there were no characters >= 128 and there was no
- use of \p or \P, in other words, no use of any XCLASS features, we can
- optimize.
-
- In UTF-8 mode, we can optimize the negative case only if there were no
- characters >= 128 because OP_NOT and the related opcodes like OP_NOTSTAR
- operate on single-bytes only. This is an historical hangover. Maybe one day
- we can tidy these opcodes to handle multi-byte characters.
-
- The optimization throws away the bit map. We turn the item into a
- 1-character OP_CHAR[NC] if it's positive, or OP_NOT if it's negative. Note
- that OP_NOT does not support multibyte characters. In the positive case, it
- can cause firstbyte to be set. Otherwise, there can be no first char if
- this item is first, whatever repeat count may follow. In the case of
- reqbyte, save the previous value for reinstating. */
-
-#ifdef SUPPORT_UTF8
- if (class_charcount == 1 && !class_utf8 &&
- (!utf8 || !negate_class || class_lastchar < 128))
-#else
- if (class_charcount == 1)
-#endif
- {
- zeroreqbyte = reqbyte;
-
- /* The OP_NOT opcode works on one-byte characters only. */
-
- if (negate_class)
- {
- if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;
- zerofirstbyte = firstbyte;
- *code++ = OP_NOT;
- *code++ = class_lastchar;
- break;
- }
-
- /* For a single, positive character, get the value into mcbuffer, and
- then we can handle this with the normal one-character code. */
-
-#ifdef SUPPORT_UTF8
- if (utf8 && class_lastchar > 127)
- mclength = _pcre_ord2utf8(class_lastchar, mcbuffer);
- else
-#endif
- {
- mcbuffer[0] = class_lastchar;
- mclength = 1;
- }
- goto ONE_CHAR;
- } /* End of 1-char optimization */
-
- /* The general case - not the one-char optimization. If this is the first
- thing in the branch, there can be no first char setting, whatever the
- repeat count. Any reqbyte setting must remain unchanged after any kind of
- repeat. */
-
- if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;
- zerofirstbyte = firstbyte;
- zeroreqbyte = reqbyte;
-
- /* If there are characters with values > 255, we have to compile an
- extended class, with its own opcode, unless there was a negated special
- such as \S in the class, because in that case all characters > 255 are in
- the class, so any that were explicitly given as well can be ignored. If
- (when there are explicit characters > 255 that must be listed) there are no
- characters < 256, we can omit the bitmap in the actual compiled code. */
-
-#ifdef SUPPORT_UTF8
- if (class_utf8 && !should_flip_negation)
- {
- *class_utf8data++ = XCL_END; /* Marks the end of extra data */
- *code++ = OP_XCLASS;
- code += LINK_SIZE;
- *code = negate_class? XCL_NOT : 0;
-
- /* If the map is required, move up the extra data to make room for it;
- otherwise just move the code pointer to the end of the extra data. */
-
- if (class_charcount > 0)
- {
- *code++ |= XCL_MAP;
- memmove(code + 32, code, class_utf8data - code);
- memcpy(code, classbits, 32);
- code = class_utf8data + 32;
- }
- else code = class_utf8data;
-
- /* Now fill in the complete length of the item */
-
- PUT(previous, 1, code - previous);
- break; /* End of class handling */
- }
-#endif
-
- /* If there are no characters > 255, set the opcode to OP_CLASS or
- OP_NCLASS, depending on whether the whole class was negated and whether
- there were negative specials such as \S in the class. Then copy the 32-byte
- map into the code vector, negating it if necessary. */
-
- *code++ = (negate_class == should_flip_negation) ? OP_CLASS : OP_NCLASS;
- if (negate_class)
- {
- if (lengthptr == NULL) /* Save time in the pre-compile phase */
- for (c = 0; c < 32; c++) code[c] = ~classbits[c];
- }
- else
- {
- memcpy(code, classbits, 32);
- }
- code += 32;
- break;
-
-
- /* ===================================================================*/
- /* Various kinds of repeat; '{' is not necessarily a quantifier, but this
- has been tested above. */
-
- case '{':
- if (!is_quantifier) goto NORMAL_CHAR;
- ptr = read_repeat_counts(ptr+1, &repeat_min, &repeat_max, errorcodeptr);
- if (*errorcodeptr != 0) goto FAILED;
- goto REPEAT;
-
- case '*':
- repeat_min = 0;
- repeat_max = -1;
- goto REPEAT;
-
- case '+':
- repeat_min = 1;
- repeat_max = -1;
- goto REPEAT;
-
- case '?':
- repeat_min = 0;
- repeat_max = 1;
-
- REPEAT:
- if (previous == NULL)
- {
- *errorcodeptr = ERR9;
- goto FAILED;
- }
-
- if (repeat_min == 0)
- {
- firstbyte = zerofirstbyte; /* Adjust for zero repeat */
- reqbyte = zeroreqbyte; /* Ditto */
- }
-
- /* Remember whether this is a variable length repeat */
-
- reqvary = (repeat_min == repeat_max)? 0 : REQ_VARY;
-
- op_type = 0; /* Default single-char op codes */
- possessive_quantifier = FALSE; /* Default not possessive quantifier */
-
- /* Save start of previous item, in case we have to move it up to make space
- for an inserted OP_ONCE for the additional '+' extension. */
-
- tempcode = previous;
-
- /* If the next character is '+', we have a possessive quantifier. This
- implies greediness, whatever the setting of the PCRE_UNGREEDY option.
- If the next character is '?' this is a minimizing repeat, by default,
- but if PCRE_UNGREEDY is set, it works the other way round. We change the
- repeat type to the non-default. */
-
- if (ptr[1] == '+')
- {
- repeat_type = 0; /* Force greedy */
- possessive_quantifier = TRUE;
- ptr++;
- }
- else if (ptr[1] == '?')
- {
- repeat_type = greedy_non_default;
- ptr++;
- }
- else repeat_type = greedy_default;
-
- /* If previous was a character match, abolish the item and generate a
- repeat item instead. If a char item has a minumum of more than one, ensure
- that it is set in reqbyte - it might not be if a sequence such as x{3} is
- the first thing in a branch because the x will have gone into firstbyte
- instead. */
-
- if (*previous == OP_CHAR || *previous == OP_CHARNC)
- {
- /* Deal with UTF-8 characters that take up more than one byte. It's
- easier to write this out separately than try to macrify it. Use c to
- hold the length of the character in bytes, plus 0x80 to flag that it's a
- length rather than a small character. */
-
-#ifdef SUPPORT_UTF8
- if (utf8 && (code[-1] & 0x80) != 0)
- {
- uschar *lastchar = code - 1;
- while((*lastchar & 0xc0) == 0x80) lastchar--;
- c = code - lastchar; /* Length of UTF-8 character */
- memcpy(utf8_char, lastchar, c); /* Save the char */
- c |= 0x80; /* Flag c as a length */
- }
- else
-#endif
-
- /* Handle the case of a single byte - either with no UTF8 support, or
- with UTF-8 disabled, or for a UTF-8 character < 128. */
-
- {
- c = code[-1];
- if (repeat_min > 1) reqbyte = c | req_caseopt | cd->req_varyopt;
- }
-
- /* If the repetition is unlimited, it pays to see if the next thing on
- the line is something that cannot possibly match this character. If so,
- automatically possessifying this item gains some performance in the case
- where the match fails. */
-
- if (!possessive_quantifier &&
- repeat_max < 0 &&
- check_auto_possessive(*previous, c, utf8, utf8_char, ptr + 1,
- options, cd))
- {
- repeat_type = 0; /* Force greedy */
- possessive_quantifier = TRUE;
- }
-
- goto OUTPUT_SINGLE_REPEAT; /* Code shared with single character types */
- }
-
- /* If previous was a single negated character ([^a] or similar), we use
- one of the special opcodes, replacing it. The code is shared with single-
- character repeats by setting opt_type to add a suitable offset into
- repeat_type. We can also test for auto-possessification. OP_NOT is
- currently used only for single-byte chars. */
-
- else if (*previous == OP_NOT)
- {
- op_type = OP_NOTSTAR - OP_STAR; /* Use "not" opcodes */
- c = previous[1];
- if (!possessive_quantifier &&
- repeat_max < 0 &&
- check_auto_possessive(OP_NOT, c, utf8, NULL, ptr + 1, options, cd))
- {
- repeat_type = 0; /* Force greedy */
- possessive_quantifier = TRUE;
- }
- goto OUTPUT_SINGLE_REPEAT;
- }
-
- /* If previous was a character type match (\d or similar), abolish it and
- create a suitable repeat item. The code is shared with single-character
- repeats by setting op_type to add a suitable offset into repeat_type. Note
- the the Unicode property types will be present only when SUPPORT_UCP is
- defined, but we don't wrap the little bits of code here because it just
- makes it horribly messy. */
-
- else if (*previous < OP_EODN)
- {
- uschar *oldcode;
- int prop_type, prop_value;
- op_type = OP_TYPESTAR - OP_STAR; /* Use type opcodes */
- c = *previous;
-
- if (!possessive_quantifier &&
- repeat_max < 0 &&
- check_auto_possessive(c, 0, utf8, NULL, ptr + 1, options, cd))
- {
- repeat_type = 0; /* Force greedy */
- possessive_quantifier = TRUE;
- }
-
- OUTPUT_SINGLE_REPEAT:
- if (*previous == OP_PROP || *previous == OP_NOTPROP)
- {
- prop_type = previous[1];
- prop_value = previous[2];
- }
- else prop_type = prop_value = -1;
-
- oldcode = code;
- code = previous; /* Usually overwrite previous item */
-
- /* If the maximum is zero then the minimum must also be zero; Perl allows
- this case, so we do too - by simply omitting the item altogether. */
-
- if (repeat_max == 0) goto END_REPEAT;
-
- /* All real repeats make it impossible to handle partial matching (maybe
- one day we will be able to remove this restriction). */
-
- if (repeat_max != 1) cd->external_flags |= PCRE_NOPARTIAL;
-
- /* Combine the op_type with the repeat_type */
-
- repeat_type += op_type;
-
- /* A minimum of zero is handled either as the special case * or ?, or as
- an UPTO, with the maximum given. */
-
- if (repeat_min == 0)
- {
- if (repeat_max == -1) *code++ = OP_STAR + repeat_type;
- else if (repeat_max == 1) *code++ = OP_QUERY + repeat_type;
- else
- {
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max);
- }
- }
-
- /* A repeat minimum of 1 is optimized into some special cases. If the
- maximum is unlimited, we use OP_PLUS. Otherwise, the original item is
- left in place and, if the maximum is greater than 1, we use OP_UPTO with
- one less than the maximum. */
-
- else if (repeat_min == 1)
- {
- if (repeat_max == -1)
- *code++ = OP_PLUS + repeat_type;
- else
- {
- code = oldcode; /* leave previous item in place */
- if (repeat_max == 1) goto END_REPEAT;
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max - 1);
- }
- }
-
- /* The case {n,n} is just an EXACT, while the general case {n,m} is
- handled as an EXACT followed by an UPTO. */
-
- else
- {
- *code++ = OP_EXACT + op_type; /* NB EXACT doesn't have repeat_type */
- PUT2INC(code, 0, repeat_min);
-
- /* If the maximum is unlimited, insert an OP_STAR. Before doing so,
- we have to insert the character for the previous code. For a repeated
- Unicode property match, there are two extra bytes that define the
- required property. In UTF-8 mode, long characters have their length in
- c, with the 0x80 bit as a flag. */
-
- if (repeat_max < 0)
- {
-#ifdef SUPPORT_UTF8
- if (utf8 && c >= 128)
- {
- memcpy(code, utf8_char, c & 7);
- code += c & 7;
- }
- else
-#endif
- {
- *code++ = c;
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
- }
- *code++ = OP_STAR + repeat_type;
- }
-
- /* Else insert an UPTO if the max is greater than the min, again
- preceded by the character, for the previously inserted code. If the
- UPTO is just for 1 instance, we can use QUERY instead. */
-
- else if (repeat_max != repeat_min)
- {
-#ifdef SUPPORT_UTF8
- if (utf8 && c >= 128)
- {
- memcpy(code, utf8_char, c & 7);
- code += c & 7;
- }
- else
-#endif
- *code++ = c;
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
- repeat_max -= repeat_min;
-
- if (repeat_max == 1)
- {
- *code++ = OP_QUERY + repeat_type;
- }
- else
- {
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max);
- }
- }
- }
-
- /* The character or character type itself comes last in all cases. */
-
-#ifdef SUPPORT_UTF8
- if (utf8 && c >= 128)
- {
- memcpy(code, utf8_char, c & 7);
- code += c & 7;
- }
- else
-#endif
- *code++ = c;
-
- /* For a repeated Unicode property match, there are two extra bytes that
- define the required property. */
-
-#ifdef SUPPORT_UCP
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
-#endif
- }
-
- /* If previous was a character class or a back reference, we put the repeat
- stuff after it, but just skip the item if the repeat was {0,0}. */
-
- else if (*previous == OP_CLASS ||
- *previous == OP_NCLASS ||
-#ifdef SUPPORT_UTF8
- *previous == OP_XCLASS ||
-#endif
- *previous == OP_REF)
- {
- if (repeat_max == 0)
- {
- code = previous;
- goto END_REPEAT;
- }
-
- /* All real repeats make it impossible to handle partial matching (maybe
- one day we will be able to remove this restriction). */
-
- if (repeat_max != 1) cd->external_flags |= PCRE_NOPARTIAL;
-
- if (repeat_min == 0 && repeat_max == -1)
- *code++ = OP_CRSTAR + repeat_type;
- else if (repeat_min == 1 && repeat_max == -1)
- *code++ = OP_CRPLUS + repeat_type;
- else if (repeat_min == 0 && repeat_max == 1)
- *code++ = OP_CRQUERY + repeat_type;
- else
- {
- *code++ = OP_CRRANGE + repeat_type;
- PUT2INC(code, 0, repeat_min);
- if (repeat_max == -1) repeat_max = 0; /* 2-byte encoding for max */
- PUT2INC(code, 0, repeat_max);
- }
- }
-
- /* If previous was a bracket group, we may have to replicate it in certain
- cases. */
-
- else if (*previous == OP_BRA || *previous == OP_CBRA ||
- *previous == OP_ONCE || *previous == OP_COND)
- {
- register int i;
- int ketoffset = 0;
- int len = code - previous;
- uschar *bralink = NULL;
-
- /* Repeating a DEFINE group is pointless */
-
- if (*previous == OP_COND && previous[LINK_SIZE+1] == OP_DEF)
- {
- *errorcodeptr = ERR55;
- goto FAILED;
- }
-
- /* If the maximum repeat count is unlimited, find the end of the bracket
- by scanning through from the start, and compute the offset back to it
- from the current code pointer. There may be an OP_OPT setting following
- the final KET, so we can't find the end just by going back from the code
- pointer. */
-
- if (repeat_max == -1)
- {
- register uschar *ket = previous;
- do ket += GET(ket, 1); while (*ket != OP_KET);
- ketoffset = code - ket;
- }
-
- /* The case of a zero minimum is special because of the need to stick
- OP_BRAZERO in front of it, and because the group appears once in the
- data, whereas in other cases it appears the minimum number of times. For
- this reason, it is simplest to treat this case separately, as otherwise
- the code gets far too messy. There are several special subcases when the
- minimum is zero. */
-
- if (repeat_min == 0)
- {
- /* If the maximum is also zero, we used to just omit the group from the
- output altogether, like this:
-
- ** if (repeat_max == 0)
- ** {
- ** code = previous;
- ** goto END_REPEAT;
- ** }
-
- However, that fails when a group is referenced as a subroutine from
- elsewhere in the pattern, so now we stick in OP_SKIPZERO in front of it
- so that it is skipped on execution. As we don't have a list of which
- groups are referenced, we cannot do this selectively.
-
- If the maximum is 1 or unlimited, we just have to stick in the BRAZERO
- and do no more at this point. However, we do need to adjust any
- OP_RECURSE calls inside the group that refer to the group itself or any
- internal or forward referenced group, because the offset is from the
- start of the whole regex. Temporarily terminate the pattern while doing
- this. */
-
- if (repeat_max <= 1) /* Covers 0, 1, and unlimited */
- {
- *code = OP_END;
- adjust_recurse(previous, 1, utf8, cd, save_hwm);
- memmove(previous+1, previous, len);
- code++;
- if (repeat_max == 0)
- {
- *previous++ = OP_SKIPZERO;
- goto END_REPEAT;
- }
- *previous++ = OP_BRAZERO + repeat_type;
- }
-
- /* If the maximum is greater than 1 and limited, we have to replicate
- in a nested fashion, sticking OP_BRAZERO before each set of brackets.
- The first one has to be handled carefully because it's the original
- copy, which has to be moved up. The remainder can be handled by code
- that is common with the non-zero minimum case below. We have to
- adjust the value or repeat_max, since one less copy is required. Once
- again, we may have to adjust any OP_RECURSE calls inside the group. */
-
- else
- {
- int offset;
- *code = OP_END;
- adjust_recurse(previous, 2 + LINK_SIZE, utf8, cd, save_hwm);
- memmove(previous + 2 + LINK_SIZE, previous, len);
- code += 2 + LINK_SIZE;
- *previous++ = OP_BRAZERO + repeat_type;
- *previous++ = OP_BRA;
-
- /* We chain together the bracket offset fields that have to be
- filled in later when the ends of the brackets are reached. */
-
- offset = (bralink == NULL)? 0 : previous - bralink;
- bralink = previous;
- PUTINC(previous, 0, offset);
- }
-
- repeat_max--;
- }
-
- /* If the minimum is greater than zero, replicate the group as many
- times as necessary, and adjust the maximum to the number of subsequent
- copies that we need. If we set a first char from the group, and didn't
- set a required char, copy the latter from the former. If there are any
- forward reference subroutine calls in the group, there will be entries on
- the workspace list; replicate these with an appropriate increment. */
-
- else
- {
- if (repeat_min > 1)
- {
- /* In the pre-compile phase, we don't actually do the replication. We
- just adjust the length as if we had. Do some paranoid checks for
- potential integer overflow. */
-
- if (lengthptr != NULL)
- {
- int delta = (repeat_min - 1)*length_prevgroup;
- if ((double)(repeat_min - 1)*(double)length_prevgroup >
- (double)INT_MAX ||
- OFLOW_MAX - *lengthptr < delta)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += delta;
- }
-
- /* This is compiling for real */
-
- else
- {
- if (groupsetfirstbyte && reqbyte < 0) reqbyte = firstbyte;
- for (i = 1; i < repeat_min; i++)
- {
- uschar *hc;
- uschar *this_hwm = cd->hwm;
- memcpy(code, previous, len);
- for (hc = save_hwm; hc < this_hwm; hc += LINK_SIZE)
- {
- PUT(cd->hwm, 0, GET(hc, 0) + len);
- cd->hwm += LINK_SIZE;
- }
- save_hwm = this_hwm;
- code += len;
- }
- }
- }
-
- if (repeat_max > 0) repeat_max -= repeat_min;
- }
-
- /* This code is common to both the zero and non-zero minimum cases. If
- the maximum is limited, it replicates the group in a nested fashion,
- remembering the bracket starts on a stack. In the case of a zero minimum,
- the first one was set up above. In all cases the repeat_max now specifies
- the number of additional copies needed. Again, we must remember to
- replicate entries on the forward reference list. */
-
- if (repeat_max >= 0)
- {
- /* In the pre-compile phase, we don't actually do the replication. We
- just adjust the length as if we had. For each repetition we must add 1
- to the length for BRAZERO and for all but the last repetition we must
- add 2 + 2*LINKSIZE to allow for the nesting that occurs. Do some
- paranoid checks to avoid integer overflow. */
-
- if (lengthptr != NULL && repeat_max > 0)
- {
- int delta = repeat_max * (length_prevgroup + 1 + 2 + 2*LINK_SIZE) -
- 2 - 2*LINK_SIZE; /* Last one doesn't nest */
- if ((double)repeat_max *
- (double)(length_prevgroup + 1 + 2 + 2*LINK_SIZE)
- > (double)INT_MAX ||
- OFLOW_MAX - *lengthptr < delta)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += delta;
- }
-
- /* This is compiling for real */
-
- else for (i = repeat_max - 1; i >= 0; i--)
- {
- uschar *hc;
- uschar *this_hwm = cd->hwm;
-
- *code++ = OP_BRAZERO + repeat_type;
-
- /* All but the final copy start a new nesting, maintaining the
- chain of brackets outstanding. */
-
- if (i != 0)
- {
- int offset;
- *code++ = OP_BRA;
- offset = (bralink == NULL)? 0 : code - bralink;
- bralink = code;
- PUTINC(code, 0, offset);
- }
-
- memcpy(code, previous, len);
- for (hc = save_hwm; hc < this_hwm; hc += LINK_SIZE)
- {
- PUT(cd->hwm, 0, GET(hc, 0) + len + ((i != 0)? 2+LINK_SIZE : 1));
- cd->hwm += LINK_SIZE;
- }
- save_hwm = this_hwm;
- code += len;
- }
-
- /* Now chain through the pending brackets, and fill in their length
- fields (which are holding the chain links pro tem). */
-
- while (bralink != NULL)
- {
- int oldlinkoffset;
- int offset = code - bralink + 1;
- uschar *bra = code - offset;
- oldlinkoffset = GET(bra, 1);
- bralink = (oldlinkoffset == 0)? NULL : bralink - oldlinkoffset;
- *code++ = OP_KET;
- PUTINC(code, 0, offset);
- PUT(bra, 1, offset);
- }
- }
-
- /* If the maximum is unlimited, set a repeater in the final copy. We
- can't just offset backwards from the current code point, because we
- don't know if there's been an options resetting after the ket. The
- correct offset was computed above.
-
- Then, when we are doing the actual compile phase, check to see whether
- this group is a non-atomic one that could match an empty string. If so,
- convert the initial operator to the S form (e.g. OP_BRA -> OP_SBRA) so
- that runtime checking can be done. [This check is also applied to
- atomic groups at runtime, but in a different way.] */
-
- else
- {
- uschar *ketcode = code - ketoffset;
- uschar *bracode = ketcode - GET(ketcode, 1);
- *ketcode = OP_KETRMAX + repeat_type;
- if (lengthptr == NULL && *bracode != OP_ONCE)
- {
- uschar *scode = bracode;
- do
- {
- if (could_be_empty_branch(scode, ketcode, utf8))
- {
- *bracode += OP_SBRA - OP_BRA;
- break;
- }
- scode += GET(scode, 1);
- }
- while (*scode == OP_ALT);
- }
- }
- }
-
- /* If previous is OP_FAIL, it was generated by an empty class [] in
- JavaScript mode. The other ways in which OP_FAIL can be generated, that is
- by (*FAIL) or (?!) set previous to NULL, which gives a "nothing to repeat"
- error above. We can just ignore the repeat in JS case. */
-
- else if (*previous == OP_FAIL) goto END_REPEAT;
-
- /* Else there's some kind of shambles */
-
- else
- {
- *errorcodeptr = ERR11;
- goto FAILED;
- }
-
- /* If the character following a repeat is '+', or if certain optimization
- tests above succeeded, possessive_quantifier is TRUE. For some of the
- simpler opcodes, there is an special alternative opcode for this. For
- anything else, we wrap the entire repeated item inside OP_ONCE brackets.
- The '+' notation is just syntactic sugar, taken from Sun's Java package,
- but the special opcodes can optimize it a bit. The repeated item starts at
- tempcode, not at previous, which might be the first part of a string whose
- (former) last char we repeated.
-
- Possessifying an 'exact' quantifier has no effect, so we can ignore it. But
- an 'upto' may follow. We skip over an 'exact' item, and then test the
- length of what remains before proceeding. */
-
- if (possessive_quantifier)
- {
- int len;
- if (*tempcode == OP_EXACT || *tempcode == OP_TYPEEXACT ||
- *tempcode == OP_NOTEXACT)
- tempcode += _pcre_OP_lengths[*tempcode] +
- ((*tempcode == OP_TYPEEXACT &&
- (tempcode[3] == OP_PROP || tempcode[3] == OP_NOTPROP))? 2:0);
- len = code - tempcode;
- if (len > 0) switch (*tempcode)
- {
- case OP_STAR: *tempcode = OP_POSSTAR; break;
- case OP_PLUS: *tempcode = OP_POSPLUS; break;
- case OP_QUERY: *tempcode = OP_POSQUERY; break;
- case OP_UPTO: *tempcode = OP_POSUPTO; break;
-
- case OP_TYPESTAR: *tempcode = OP_TYPEPOSSTAR; break;
- case OP_TYPEPLUS: *tempcode = OP_TYPEPOSPLUS; break;
- case OP_TYPEQUERY: *tempcode = OP_TYPEPOSQUERY; break;
- case OP_TYPEUPTO: *tempcode = OP_TYPEPOSUPTO; break;
-
- case OP_NOTSTAR: *tempcode = OP_NOTPOSSTAR; break;
- case OP_NOTPLUS: *tempcode = OP_NOTPOSPLUS; break;
- case OP_NOTQUERY: *tempcode = OP_NOTPOSQUERY; break;
- case OP_NOTUPTO: *tempcode = OP_NOTPOSUPTO; break;
-
- default:
- memmove(tempcode + 1+LINK_SIZE, tempcode, len);
- code += 1 + LINK_SIZE;
- len += 1 + LINK_SIZE;
- tempcode[0] = OP_ONCE;
- *code++ = OP_KET;
- PUTINC(code, 0, len);
- PUT(tempcode, 1, len);
- break;
- }
- }
-
- /* In all case we no longer have a previous item. We also set the
- "follows varying string" flag for subsequently encountered reqbytes if
- it isn't already set and we have just passed a varying length item. */
-
- END_REPEAT:
- previous = NULL;
- cd->req_varyopt |= reqvary;
- break;
-
-
- /* ===================================================================*/
- /* Start of nested parenthesized sub-expression, or comment or lookahead or
- lookbehind or option setting or condition or all the other extended
- parenthesis forms. */
-
- case '(':
- newoptions = options;
- skipbytes = 0;
- bravalue = OP_CBRA;
- save_hwm = cd->hwm;
- reset_bracount = FALSE;
-
- /* First deal with various "verbs" that can be introduced by '*'. */
-
- if (*(++ptr) == '*' && (cd->ctypes[ptr[1]] & ctype_letter) != 0)
- {
- int i, namelen;
- const char *vn = verbnames;
- const uschar *name = ++ptr;
- previous = NULL;
- while ((cd->ctypes[*++ptr] & ctype_letter) != 0) {};
- if (*ptr == ':')
- {
- *errorcodeptr = ERR59; /* Not supported */
- goto FAILED;
- }
- if (*ptr != ')')
- {
- *errorcodeptr = ERR60;
- goto FAILED;
- }
- namelen = ptr - name;
- for (i = 0; i < verbcount; i++)
- {
- if (namelen == verbs[i].len &&
- strncmp((char *)name, vn, namelen) == 0)
- {
- *code = verbs[i].op;
- if (*code++ == OP_ACCEPT) cd->had_accept = TRUE;
- break;
- }
- vn += verbs[i].len + 1;
- }
- if (i < verbcount) continue;
- *errorcodeptr = ERR60;
- goto FAILED;
- }
-
- /* Deal with the extended parentheses; all are introduced by '?', and the
- appearance of any of them means that this is not a capturing group. */
-
- else if (*ptr == '?')
- {
- int i, set, unset, namelen;
- int *optset;
- const uschar *name;
- uschar *slot;
-
- switch (*(++ptr))
- {
- case '#': /* Comment; skip to ket */
- ptr++;
- while (*ptr != 0 && *ptr != ')') ptr++;
- if (*ptr == 0)
- {
- *errorcodeptr = ERR18;
- goto FAILED;
- }
- continue;
-
-
- /* ------------------------------------------------------------ */
- case '|': /* Reset capture count for each branch */
- reset_bracount = TRUE;
- /* Fall through */
-
- /* ------------------------------------------------------------ */
- case ':': /* Non-capturing bracket */
- bravalue = OP_BRA;
- ptr++;
- break;
-
-
- /* ------------------------------------------------------------ */
- case '(':
- bravalue = OP_COND; /* Conditional group */
-
- /* A condition can be an assertion, a number (referring to a numbered
- group), a name (referring to a named group), or 'R', referring to
- recursion. R<digits> and R&name are also permitted for recursion tests.
-
- There are several syntaxes for testing a named group: (?(name)) is used
- by Python; Perl 5.10 onwards uses (?(<name>) or (?('name')).
-
- There are two unfortunate ambiguities, caused by history. (a) 'R' can
- be the recursive thing or the name 'R' (and similarly for 'R' followed
- by digits), and (b) a number could be a name that consists of digits.
- In both cases, we look for a name first; if not found, we try the other
- cases. */
-
- /* For conditions that are assertions, check the syntax, and then exit
- the switch. This will take control down to where bracketed groups,
- including assertions, are processed. */
-
- if (ptr[1] == '?' && (ptr[2] == '=' || ptr[2] == '!' || ptr[2] == '<'))
- break;
-
- /* Most other conditions use OP_CREF (a couple change to OP_RREF
- below), and all need to skip 3 bytes at the start of the group. */
-
- code[1+LINK_SIZE] = OP_CREF;
- skipbytes = 3;
- refsign = -1;
-
- /* Check for a test for recursion in a named group. */
-
- if (ptr[1] == 'R' && ptr[2] == '&')
- {
- terminator = -1;
- ptr += 2;
- code[1+LINK_SIZE] = OP_RREF; /* Change the type of test */
- }
-
- /* Check for a test for a named group's having been set, using the Perl
- syntax (?(<name>) or (?('name') */
-
- else if (ptr[1] == '<')
- {
- terminator = '>';
- ptr++;
- }
- else if (ptr[1] == '\'')
- {
- terminator = '\'';
- ptr++;
- }
- else
- {
- terminator = 0;
- if (ptr[1] == '-' || ptr[1] == '+') refsign = *(++ptr);
- }
-
- /* We now expect to read a name; any thing else is an error */
-
- if ((cd->ctypes[ptr[1]] & ctype_word) == 0)
- {
- ptr += 1; /* To get the right offset */
- *errorcodeptr = ERR28;
- goto FAILED;
- }
-
- /* Read the name, but also get it as a number if it's all digits */
-
- recno = 0;
- name = ++ptr;
- while ((cd->ctypes[*ptr] & ctype_word) != 0)
- {
- if (recno >= 0)
- recno = ((digitab[*ptr] & ctype_digit) != 0)?
- recno * 10 + *ptr - '0' : -1;
- ptr++;
- }
- namelen = ptr - name;
-
- if ((terminator > 0 && *ptr++ != terminator) || *ptr++ != ')')
- {
- ptr--; /* Error offset */
- *errorcodeptr = ERR26;
- goto FAILED;
- }
-
- /* Do no further checking in the pre-compile phase. */
-
- if (lengthptr != NULL) break;
-
- /* In the real compile we do the work of looking for the actual
- reference. If the string started with "+" or "-" we require the rest to
- be digits, in which case recno will be set. */
-
- if (refsign > 0)
- {
- if (recno <= 0)
- {
- *errorcodeptr = ERR58;
- goto FAILED;
- }
- recno = (refsign == '-')?
- cd->bracount - recno + 1 : recno +cd->bracount;
- if (recno <= 0 || recno > cd->final_bracount)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- PUT2(code, 2+LINK_SIZE, recno);
- break;
- }
-
- /* Otherwise (did not start with "+" or "-"), start by looking for the
- name. */
-
- slot = cd->name_table;
- for (i = 0; i < cd->names_found; i++)
- {
- if (strncmp((char *)name, (char *)slot+2, namelen) == 0) break;
- slot += cd->name_entry_size;
- }
-
- /* Found a previous named subpattern */
-
- if (i < cd->names_found)
- {
- recno = GET2(slot, 0);
- PUT2(code, 2+LINK_SIZE, recno);
- }
-
- /* Search the pattern for a forward reference */
-
- else if ((i = find_parens(ptr, cd, name, namelen,
- (options & PCRE_EXTENDED) != 0)) > 0)
- {
- PUT2(code, 2+LINK_SIZE, i);
- }
-
- /* If terminator == 0 it means that the name followed directly after
- the opening parenthesis [e.g. (?(abc)...] and in this case there are
- some further alternatives to try. For the cases where terminator != 0
- [things like (?(<name>... or (?('name')... or (?(R&name)... ] we have
- now checked all the possibilities, so give an error. */
-
- else if (terminator != 0)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
-
- /* Check for (?(R) for recursion. Allow digits after R to specify a
- specific group number. */
-
- else if (*name == 'R')
- {
- recno = 0;
- for (i = 1; i < namelen; i++)
- {
- if ((digitab[name[i]] & ctype_digit) == 0)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- recno = recno * 10 + name[i] - '0';
- }
- if (recno == 0) recno = RREF_ANY;
- code[1+LINK_SIZE] = OP_RREF; /* Change test type */
- PUT2(code, 2+LINK_SIZE, recno);
- }
-
- /* Similarly, check for the (?(DEFINE) "condition", which is always
- false. */
-
- else if (namelen == 6 && strncmp((char *)name, "DEFINE", 6) == 0)
- {
- code[1+LINK_SIZE] = OP_DEF;
- skipbytes = 1;
- }
-
- /* Check for the "name" actually being a subpattern number. We are
- in the second pass here, so final_bracount is set. */
-
- else if (recno > 0 && recno <= cd->final_bracount)
- {
- PUT2(code, 2+LINK_SIZE, recno);
- }
-
- /* Either an unidentified subpattern, or a reference to (?(0) */
-
- else
- {
- *errorcodeptr = (recno == 0)? ERR35: ERR15;
- goto FAILED;
- }
- break;
-
-
- /* ------------------------------------------------------------ */
- case '=': /* Positive lookahead */
- bravalue = OP_ASSERT;
- ptr++;
- break;
-
-
- /* ------------------------------------------------------------ */
- case '!': /* Negative lookahead */
- ptr++;
- if (*ptr == ')') /* Optimize (?!) */
- {
- *code++ = OP_FAIL;
- previous = NULL;
- continue;
- }
- bravalue = OP_ASSERT_NOT;
- break;
-
-
- /* ------------------------------------------------------------ */
- case '<': /* Lookbehind or named define */
- switch (ptr[1])
- {
- case '=': /* Positive lookbehind */
- bravalue = OP_ASSERTBACK;
- ptr += 2;
- break;
-
- case '!': /* Negative lookbehind */
- bravalue = OP_ASSERTBACK_NOT;
- ptr += 2;
- break;
-
- default: /* Could be name define, else bad */
- if ((cd->ctypes[ptr[1]] & ctype_word) != 0) goto DEFINE_NAME;
- ptr++; /* Correct offset for error */
- *errorcodeptr = ERR24;
- goto FAILED;
- }
- break;
-
-
- /* ------------------------------------------------------------ */
- case '>': /* One-time brackets */
- bravalue = OP_ONCE;
- ptr++;
- break;
-
-
- /* ------------------------------------------------------------ */
- case 'C': /* Callout - may be followed by digits; */
- previous_callout = code; /* Save for later completion */
- after_manual_callout = 1; /* Skip one item before completing */
- *code++ = OP_CALLOUT;
- {
- int n = 0;
- while ((digitab[*(++ptr)] & ctype_digit) != 0)
- n = n * 10 + *ptr - '0';
- if (*ptr != ')')
- {
- *errorcodeptr = ERR39;
- goto FAILED;
- }
- if (n > 255)
- {
- *errorcodeptr = ERR38;
- goto FAILED;
- }
- *code++ = n;
- PUT(code, 0, ptr - cd->start_pattern + 1); /* Pattern offset */
- PUT(code, LINK_SIZE, 0); /* Default length */
- code += 2 * LINK_SIZE;
- }
- previous = NULL;
- continue;
-
-
- /* ------------------------------------------------------------ */
- case 'P': /* Python-style named subpattern handling */
- if (*(++ptr) == '=' || *ptr == '>') /* Reference or recursion */
- {
- is_recurse = *ptr == '>';
- terminator = ')';
- goto NAMED_REF_OR_RECURSE;
- }
- else if (*ptr != '<') /* Test for Python-style definition */
- {
- *errorcodeptr = ERR41;
- goto FAILED;
- }
- /* Fall through to handle (?P< as (?< is handled */
-
-
- /* ------------------------------------------------------------ */
- DEFINE_NAME: /* Come here from (?< handling */
- case '\'':
- {
- terminator = (*ptr == '<')? '>' : '\'';
- name = ++ptr;
-
- while ((cd->ctypes[*ptr] & ctype_word) != 0) ptr++;
- namelen = ptr - name;
-
- /* In the pre-compile phase, just do a syntax check. */
-
- if (lengthptr != NULL)
- {
- if (*ptr != terminator)
- {
- *errorcodeptr = ERR42;
- goto FAILED;
- }
- if (cd->names_found >= MAX_NAME_COUNT)
- {
- *errorcodeptr = ERR49;
- goto FAILED;
- }
- if (namelen + 3 > cd->name_entry_size)
- {
- cd->name_entry_size = namelen + 3;
- if (namelen > MAX_NAME_SIZE)
- {
- *errorcodeptr = ERR48;
- goto FAILED;
- }
- }
- }
-
- /* In the real compile, create the entry in the table */
-
- else
- {
- slot = cd->name_table;
- for (i = 0; i < cd->names_found; i++)
- {
- int crc = memcmp(name, slot+2, namelen);
- if (crc == 0)
- {
- if (slot[2+namelen] == 0)
- {
- if ((options & PCRE_DUPNAMES) == 0)
- {
- *errorcodeptr = ERR43;
- goto FAILED;
- }
- }
- else crc = -1; /* Current name is substring */
- }
- if (crc < 0)
- {
- memmove(slot + cd->name_entry_size, slot,
- (cd->names_found - i) * cd->name_entry_size);
- break;
- }
- slot += cd->name_entry_size;
- }
-
- PUT2(slot, 0, cd->bracount + 1);
- memcpy(slot + 2, name, namelen);
- slot[2+namelen] = 0;
- }
- }
-
- /* In both cases, count the number of names we've encountered. */
-
- ptr++; /* Move past > or ' */
- cd->names_found++;
- goto NUMBERED_GROUP;
-
-
- /* ------------------------------------------------------------ */
- case '&': /* Perl recursion/subroutine syntax */
- terminator = ')';
- is_recurse = TRUE;
- /* Fall through */
-
- /* We come here from the Python syntax above that handles both
- references (?P=name) and recursion (?P>name), as well as falling
- through from the Perl recursion syntax (?&name). We also come here from
- the Perl \k<name> or \k'name' back reference syntax and the \k{name}
- .NET syntax, and the Oniguruma \g<...> and \g'...' subroutine syntax. */
-
- NAMED_REF_OR_RECURSE:
- name = ++ptr;
- while ((cd->ctypes[*ptr] & ctype_word) != 0) ptr++;
- namelen = ptr - name;
-
- /* In the pre-compile phase, do a syntax check and set a dummy
- reference number. */
-
- if (lengthptr != NULL)
- {
- if (namelen == 0)
- {
- *errorcodeptr = ERR62;
- goto FAILED;
- }
- if (*ptr != terminator)
- {
- *errorcodeptr = ERR42;
- goto FAILED;
- }
- if (namelen > MAX_NAME_SIZE)
- {
- *errorcodeptr = ERR48;
- goto FAILED;
- }
- recno = 0;
- }
-
- /* In the real compile, seek the name in the table. We check the name
- first, and then check that we have reached the end of the name in the
- table. That way, if the name that is longer than any in the table,
- the comparison will fail without reading beyond the table entry. */
-
- else
- {
- slot = cd->name_table;
- for (i = 0; i < cd->names_found; i++)
- {
- if (strncmp((char *)name, (char *)slot+2, namelen) == 0 &&
- slot[2+namelen] == 0)
- break;
- slot += cd->name_entry_size;
- }
-
- if (i < cd->names_found) /* Back reference */
- {
- recno = GET2(slot, 0);
- }
- else if ((recno = /* Forward back reference */
- find_parens(ptr, cd, name, namelen,
- (options & PCRE_EXTENDED) != 0)) <= 0)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- }
-
- /* In both phases, we can now go to the code than handles numerical
- recursion or backreferences. */
-
- if (is_recurse) goto HANDLE_RECURSION;
- else goto HANDLE_REFERENCE;
-
-
- /* ------------------------------------------------------------ */
- case 'R': /* Recursion */
- ptr++; /* Same as (?0) */
- /* Fall through */
-
-
- /* ------------------------------------------------------------ */
- case '-': case '+':
- case '0': case '1': case '2': case '3': case '4': /* Recursion or */
- case '5': case '6': case '7': case '8': case '9': /* subroutine */
- {
- const uschar *called;
- terminator = ')';
-
- /* Come here from the \g<...> and \g'...' code (Oniguruma
- compatibility). However, the syntax has been checked to ensure that
- the ... are a (signed) number, so that neither ERR63 nor ERR29 will
- be called on this path, nor with the jump to OTHER_CHAR_AFTER_QUERY
- ever be taken. */
-
- HANDLE_NUMERICAL_RECURSION:
-
- if ((refsign = *ptr) == '+')
- {
- ptr++;
- if ((digitab[*ptr] & ctype_digit) == 0)
- {
- *errorcodeptr = ERR63;
- goto FAILED;
- }
- }
- else if (refsign == '-')
- {
- if ((digitab[ptr[1]] & ctype_digit) == 0)
- goto OTHER_CHAR_AFTER_QUERY;
- ptr++;
- }
-
- recno = 0;
- while((digitab[*ptr] & ctype_digit) != 0)
- recno = recno * 10 + *ptr++ - '0';
-
- if (*ptr != terminator)
- {
- *errorcodeptr = ERR29;
- goto FAILED;
- }
-
- if (refsign == '-')
- {
- if (recno == 0)
- {
- *errorcodeptr = ERR58;
- goto FAILED;
- }
- recno = cd->bracount - recno + 1;
- if (recno <= 0)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- }
- else if (refsign == '+')
- {
- if (recno == 0)
- {
- *errorcodeptr = ERR58;
- goto FAILED;
- }
- recno += cd->bracount;
- }
-
- /* Come here from code above that handles a named recursion */
-
- HANDLE_RECURSION:
-
- previous = code;
- called = cd->start_code;
-
- /* When we are actually compiling, find the bracket that is being
- referenced. Temporarily end the regex in case it doesn't exist before
- this point. If we end up with a forward reference, first check that
- the bracket does occur later so we can give the error (and position)
- now. Then remember this forward reference in the workspace so it can
- be filled in at the end. */
-
- if (lengthptr == NULL)
- {
- *code = OP_END;
- if (recno != 0) called = find_bracket(cd->start_code, utf8, recno);
-
- /* Forward reference */
-
- if (called == NULL)
- {
- if (find_parens(ptr, cd, NULL, recno,
- (options & PCRE_EXTENDED) != 0) < 0)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- called = cd->start_code + recno;
- PUTINC(cd->hwm, 0, code + 2 + LINK_SIZE - cd->start_code);
- }
-
- /* If not a forward reference, and the subpattern is still open,
- this is a recursive call. We check to see if this is a left
- recursion that could loop for ever, and diagnose that case. */
-
- else if (GET(called, 1) == 0 &&
- could_be_empty(called, code, bcptr, utf8))
- {
- *errorcodeptr = ERR40;
- goto FAILED;
- }
- }
-
- /* Insert the recursion/subroutine item, automatically wrapped inside
- "once" brackets. Set up a "previous group" length so that a
- subsequent quantifier will work. */
-
- *code = OP_ONCE;
- PUT(code, 1, 2 + 2*LINK_SIZE);
- code += 1 + LINK_SIZE;
-
- *code = OP_RECURSE;
- PUT(code, 1, called - cd->start_code);
- code += 1 + LINK_SIZE;
-
- *code = OP_KET;
- PUT(code, 1, 2 + 2*LINK_SIZE);
- code += 1 + LINK_SIZE;
-
- length_prevgroup = 3 + 3*LINK_SIZE;
- }
-
- /* Can't determine a first byte now */
-
- if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;
- continue;
-
-
- /* ------------------------------------------------------------ */
- default: /* Other characters: check option setting */
- OTHER_CHAR_AFTER_QUERY:
- set = unset = 0;
- optset = &set;
-
- while (*ptr != ')' && *ptr != ':')
- {
- switch (*ptr++)
- {
- case '-': optset = &unset; break;
-
- case 'J': /* Record that it changed in the external options */
- *optset |= PCRE_DUPNAMES;
- cd->external_flags |= PCRE_JCHANGED;
- break;
-
- case 'i': *optset |= PCRE_CASELESS; break;
- case 'm': *optset |= PCRE_MULTILINE; break;
- case 's': *optset |= PCRE_DOTALL; break;
- case 'x': *optset |= PCRE_EXTENDED; break;
- case 'U': *optset |= PCRE_UNGREEDY; break;
- case 'X': *optset |= PCRE_EXTRA; break;
-
- default: *errorcodeptr = ERR12;
- ptr--; /* Correct the offset */
- goto FAILED;
- }
- }
-
- /* Set up the changed option bits, but don't change anything yet. */
-
- newoptions = (options | set) & (~unset);
-
- /* If the options ended with ')' this is not the start of a nested
- group with option changes, so the options change at this level. If this
- item is right at the start of the pattern, the options can be
- abstracted and made external in the pre-compile phase, and ignored in
- the compile phase. This can be helpful when matching -- for instance in
- caseless checking of required bytes.
-
- If the code pointer is not (cd->start_code + 1 + LINK_SIZE), we are
- definitely *not* at the start of the pattern because something has been
- compiled. In the pre-compile phase, however, the code pointer can have
- that value after the start, because it gets reset as code is discarded
- during the pre-compile. However, this can happen only at top level - if
- we are within parentheses, the starting BRA will still be present. At
- any parenthesis level, the length value can be used to test if anything
- has been compiled at that level. Thus, a test for both these conditions
- is necessary to ensure we correctly detect the start of the pattern in
- both phases.
-
- If we are not at the pattern start, compile code to change the ims
- options if this setting actually changes any of them, and reset the
- greedy defaults and the case value for firstbyte and reqbyte. */
-
- if (*ptr == ')')
- {
- if (code == cd->start_code + 1 + LINK_SIZE &&
- (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE))
- {
- cd->external_options = newoptions;
- }
- else
- {
- if ((options & PCRE_IMS) != (newoptions & PCRE_IMS))
- {
- *code++ = OP_OPT;
- *code++ = newoptions & PCRE_IMS;
- }
- greedy_default = ((newoptions & PCRE_UNGREEDY) != 0);
- greedy_non_default = greedy_default ^ 1;
- req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS : 0;
- }
-
- /* Change options at this level, and pass them back for use
- in subsequent branches. When not at the start of the pattern, this
- information is also necessary so that a resetting item can be
- compiled at the end of a group (if we are in a group). */
-
- *optionsptr = options = newoptions;
- previous = NULL; /* This item can't be repeated */
- continue; /* It is complete */
- }
-
- /* If the options ended with ':' we are heading into a nested group
- with possible change of options. Such groups are non-capturing and are
- not assertions of any kind. All we need to do is skip over the ':';
- the newoptions value is handled below. */
-
- bravalue = OP_BRA;
- ptr++;
- } /* End of switch for character following (? */
- } /* End of (? handling */
-
- /* Opening parenthesis not followed by '?'. If PCRE_NO_AUTO_CAPTURE is set,
- all unadorned brackets become non-capturing and behave like (?:...)
- brackets. */
-
- else if ((options & PCRE_NO_AUTO_CAPTURE) != 0)
- {
- bravalue = OP_BRA;
- }
-
- /* Else we have a capturing group. */
-
- else
- {
- NUMBERED_GROUP:
- cd->bracount += 1;
- PUT2(code, 1+LINK_SIZE, cd->bracount);
- skipbytes = 2;
- }
-
- /* Process nested bracketed regex. Assertions may not be repeated, but
- other kinds can be. All their opcodes are >= OP_ONCE. We copy code into a
- non-register variable in order to be able to pass its address because some
- compilers complain otherwise. Pass in a new setting for the ims options if
- they have changed. */
-
- previous = (bravalue >= OP_ONCE)? code : NULL;
- *code = bravalue;
- tempcode = code;
- tempreqvary = cd->req_varyopt; /* Save value before bracket */
- length_prevgroup = 0; /* Initialize for pre-compile phase */
-
- if (!compile_regex(
- newoptions, /* The complete new option state */
- options & PCRE_IMS, /* The previous ims option state */
- &tempcode, /* Where to put code (updated) */
- &ptr, /* Input pointer (updated) */
- errorcodeptr, /* Where to put an error message */
- (bravalue == OP_ASSERTBACK ||
- bravalue == OP_ASSERTBACK_NOT), /* TRUE if back assert */
- reset_bracount, /* True if (?| group */
- skipbytes, /* Skip over bracket number */
- &subfirstbyte, /* For possible first char */
- &subreqbyte, /* For possible last char */
- bcptr, /* Current branch chain */
- cd, /* Tables block */
- (lengthptr == NULL)? NULL : /* Actual compile phase */
- &length_prevgroup /* Pre-compile phase */
- ))
- goto FAILED;
-
- /* At the end of compiling, code is still pointing to the start of the
- group, while tempcode has been updated to point past the end of the group
- and any option resetting that may follow it. The pattern pointer (ptr)
- is on the bracket. */
-
- /* If this is a conditional bracket, check that there are no more than
- two branches in the group, or just one if it's a DEFINE group. We do this
- in the real compile phase, not in the pre-pass, where the whole group may
- not be available. */
-
- if (bravalue == OP_COND && lengthptr == NULL)
- {
- uschar *tc = code;
- int condcount = 0;
-
- do {
- condcount++;
- tc += GET(tc,1);
- }
- while (*tc != OP_KET);
-
- /* A DEFINE group is never obeyed inline (the "condition" is always
- false). It must have only one branch. */
-
- if (code[LINK_SIZE+1] == OP_DEF)
- {
- if (condcount > 1)
- {
- *errorcodeptr = ERR54;
- goto FAILED;
- }
- bravalue = OP_DEF; /* Just a flag to suppress char handling below */
- }
-
- /* A "normal" conditional group. If there is just one branch, we must not
- make use of its firstbyte or reqbyte, because this is equivalent to an
- empty second branch. */
-
- else
- {
- if (condcount > 2)
- {
- *errorcodeptr = ERR27;
- goto FAILED;
- }
- if (condcount == 1) subfirstbyte = subreqbyte = REQ_NONE;
- }
- }
-
- /* Error if hit end of pattern */
-
- if (*ptr != ')')
- {
- *errorcodeptr = ERR14;
- goto FAILED;
- }
-
- /* In the pre-compile phase, update the length by the length of the group,
- less the brackets at either end. Then reduce the compiled code to just a
- set of non-capturing brackets so that it doesn't use much memory if it is
- duplicated by a quantifier.*/
-
- if (lengthptr != NULL)
- {
- if (OFLOW_MAX - *lengthptr < length_prevgroup - 2 - 2*LINK_SIZE)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += length_prevgroup - 2 - 2*LINK_SIZE;
- *code++ = OP_BRA;
- PUTINC(code, 0, 1 + LINK_SIZE);
- *code++ = OP_KET;
- PUTINC(code, 0, 1 + LINK_SIZE);
- break; /* No need to waste time with special character handling */
- }
-
- /* Otherwise update the main code pointer to the end of the group. */
-
- code = tempcode;
-
- /* For a DEFINE group, required and first character settings are not
- relevant. */
-
- if (bravalue == OP_DEF) break;
-
- /* Handle updating of the required and first characters for other types of
- group. Update for normal brackets of all kinds, and conditions with two
- branches (see code above). If the bracket is followed by a quantifier with
- zero repeat, we have to back off. Hence the definition of zeroreqbyte and
- zerofirstbyte outside the main loop so that they can be accessed for the
- back off. */
-
- zeroreqbyte = reqbyte;
- zerofirstbyte = firstbyte;
- groupsetfirstbyte = FALSE;
-
- if (bravalue >= OP_ONCE)
- {
- /* If we have not yet set a firstbyte in this branch, take it from the
- subpattern, remembering that it was set here so that a repeat of more
- than one can replicate it as reqbyte if necessary. If the subpattern has
- no firstbyte, set "none" for the whole branch. In both cases, a zero
- repeat forces firstbyte to "none". */
-
- if (firstbyte == REQ_UNSET)
- {
- if (subfirstbyte >= 0)
- {
- firstbyte = subfirstbyte;
- groupsetfirstbyte = TRUE;
- }
- else firstbyte = REQ_NONE;
- zerofirstbyte = REQ_NONE;
- }
-
- /* If firstbyte was previously set, convert the subpattern's firstbyte
- into reqbyte if there wasn't one, using the vary flag that was in
- existence beforehand. */
-
- else if (subfirstbyte >= 0 && subreqbyte < 0)
- subreqbyte = subfirstbyte | tempreqvary;
-
- /* If the subpattern set a required byte (or set a first byte that isn't
- really the first byte - see above), set it. */
-
- if (subreqbyte >= 0) reqbyte = subreqbyte;
- }
-
- /* For a forward assertion, we take the reqbyte, if set. This can be
- helpful if the pattern that follows the assertion doesn't set a different
- char. For example, it's useful for /(?=abcde).+/. We can't set firstbyte
- for an assertion, however because it leads to incorrect effect for patterns
- such as /(?=a)a.+/ when the "real" "a" would then become a reqbyte instead
- of a firstbyte. This is overcome by a scan at the end if there's no
- firstbyte, looking for an asserted first char. */
-
- else if (bravalue == OP_ASSERT && subreqbyte >= 0) reqbyte = subreqbyte;
- break; /* End of processing '(' */
-
-
- /* ===================================================================*/
- /* Handle metasequences introduced by \. For ones like \d, the ESC_ values
- are arranged to be the negation of the corresponding OP_values. For the
- back references, the values are ESC_REF plus the reference number. Only
- back references and those types that consume a character may be repeated.
- We can test for values between ESC_b and ESC_Z for the latter; this may
- have to change if any new ones are ever created. */
-
- case '\\':
- tempptr = ptr;
- c = check_escape(&ptr, errorcodeptr, cd->bracount, options, FALSE);
- if (*errorcodeptr != 0) goto FAILED;
-
- if (c < 0)
- {
- if (-c == ESC_Q) /* Handle start of quoted string */
- {
- if (ptr[1] == '\\' && ptr[2] == 'E') ptr += 2; /* avoid empty string */
- else inescq = TRUE;
- continue;
- }
-
- if (-c == ESC_E) continue; /* Perl ignores an orphan \E */
-
- /* For metasequences that actually match a character, we disable the
- setting of a first character if it hasn't already been set. */
-
- if (firstbyte == REQ_UNSET && -c > ESC_b && -c < ESC_Z)
- firstbyte = REQ_NONE;
-
- /* Set values to reset to if this is followed by a zero repeat. */
-
- zerofirstbyte = firstbyte;
- zeroreqbyte = reqbyte;
-
- /* \g<name> or \g'name' is a subroutine call by name and \g<n> or \g'n'
- is a subroutine call by number (Oniguruma syntax). In fact, the value
- -ESC_g is returned only for these cases. So we don't need to check for <
- or ' if the value is -ESC_g. For the Perl syntax \g{n} the value is
- -ESC_REF+n, and for the Perl syntax \g{name} the result is -ESC_k (as
- that is a synonym for a named back reference). */
-
- if (-c == ESC_g)
- {
- const uschar *p;
- save_hwm = cd->hwm; /* Normally this is set when '(' is read */
- terminator = (*(++ptr) == '<')? '>' : '\'';
-
- /* These two statements stop the compiler for warning about possibly
- unset variables caused by the jump to HANDLE_NUMERICAL_RECURSION. In
- fact, because we actually check for a number below, the paths that
- would actually be in error are never taken. */
-
- skipbytes = 0;
- reset_bracount = FALSE;
-
- /* Test for a name */
-
- if (ptr[1] != '+' && ptr[1] != '-')
- {
- BOOL isnumber = TRUE;
- for (p = ptr + 1; *p != 0 && *p != terminator; p++)
- {
- if ((cd->ctypes[*p] & ctype_digit) == 0) isnumber = FALSE;
- if ((cd->ctypes[*p] & ctype_word) == 0) break;
- }
- if (*p != terminator)
- {
- *errorcodeptr = ERR57;
- break;
- }
- if (isnumber)
- {
- ptr++;
- goto HANDLE_NUMERICAL_RECURSION;
- }
- is_recurse = TRUE;
- goto NAMED_REF_OR_RECURSE;
- }
-
- /* Test a signed number in angle brackets or quotes. */
-
- p = ptr + 2;
- while ((digitab[*p] & ctype_digit) != 0) p++;
- if (*p != terminator)
- {
- *errorcodeptr = ERR57;
- break;
- }
- ptr++;
- goto HANDLE_NUMERICAL_RECURSION;
- }
-
- /* \k<name> or \k'name' is a back reference by name (Perl syntax).
- We also support \k{name} (.NET syntax) */
-
- if (-c == ESC_k && (ptr[1] == '<' || ptr[1] == '\'' || ptr[1] == '{'))
- {
- is_recurse = FALSE;
- terminator = (*(++ptr) == '<')? '>' : (*ptr == '\'')? '\'' : '}';
- goto NAMED_REF_OR_RECURSE;
- }
-
- /* Back references are handled specially; must disable firstbyte if
- not set to cope with cases like (?=(\w+))\1: which would otherwise set
- ':' later. */
-
- if (-c >= ESC_REF)
- {
- recno = -c - ESC_REF;
-
- HANDLE_REFERENCE: /* Come here from named backref handling */
- if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;
- previous = code;
- *code++ = OP_REF;
- PUT2INC(code, 0, recno);
- cd->backref_map |= (recno < 32)? (1 << recno) : 1;
- if (recno > cd->top_backref) cd->top_backref = recno;
- }
-
- /* So are Unicode property matches, if supported. */
-
-#ifdef SUPPORT_UCP
- else if (-c == ESC_P || -c == ESC_p)
- {
- BOOL negated;
- int pdata;
- int ptype = get_ucp(&ptr, &negated, &pdata, errorcodeptr);
- if (ptype < 0) goto FAILED;
- previous = code;
- *code++ = ((-c == ESC_p) != negated)? OP_PROP : OP_NOTPROP;
- *code++ = ptype;
- *code++ = pdata;
- }
-#else
-
- /* If Unicode properties are not supported, \X, \P, and \p are not
- allowed. */
-
- else if (-c == ESC_X || -c == ESC_P || -c == ESC_p)
- {
- *errorcodeptr = ERR45;
- goto FAILED;
- }
-#endif
-
- /* For the rest (including \X when Unicode properties are supported), we
- can obtain the OP value by negating the escape value. */
-
- else
- {
- previous = (-c > ESC_b && -c < ESC_Z)? code : NULL;
- *code++ = -c;
- }
- continue;
- }
-
- /* We have a data character whose value is in c. In UTF-8 mode it may have
- a value > 127. We set its representation in the length/buffer, and then
- handle it as a data character. */
-
-#ifdef SUPPORT_UTF8
- if (utf8 && c > 127)
- mclength = _pcre_ord2utf8(c, mcbuffer);
- else
-#endif
-
- {
- mcbuffer[0] = c;
- mclength = 1;
- }
- goto ONE_CHAR;
-
-
- /* ===================================================================*/
- /* Handle a literal character. It is guaranteed not to be whitespace or #
- when the extended flag is set. If we are in UTF-8 mode, it may be a
- multi-byte literal character. */
-
- default:
- NORMAL_CHAR:
- mclength = 1;
- mcbuffer[0] = c;
-
-#ifdef SUPPORT_UTF8
- if (utf8 && c >= 0xc0)
- {
- while ((ptr[1] & 0xc0) == 0x80)
- mcbuffer[mclength++] = *(++ptr);
- }
-#endif
-
- /* At this point we have the character's bytes in mcbuffer, and the length
- in mclength. When not in UTF-8 mode, the length is always 1. */
-
- ONE_CHAR:
- previous = code;
- *code++ = ((options & PCRE_CASELESS) != 0)? OP_CHARNC : OP_CHAR;
- for (c = 0; c < mclength; c++) *code++ = mcbuffer[c];
-
- /* Remember if \r or \n were seen */
-
- if (mcbuffer[0] == '\r' || mcbuffer[0] == '\n')
- cd->external_flags |= PCRE_HASCRORLF;
-
- /* Set the first and required bytes appropriately. If no previous first
- byte, set it from this character, but revert to none on a zero repeat.
- Otherwise, leave the firstbyte value alone, and don't change it on a zero
- repeat. */
-
- if (firstbyte == REQ_UNSET)
- {
- zerofirstbyte = REQ_NONE;
- zeroreqbyte = reqbyte;
-
- /* If the character is more than one byte long, we can set firstbyte
- only if it is not to be matched caselessly. */
-
- if (mclength == 1 || req_caseopt == 0)
- {
- firstbyte = mcbuffer[0] | req_caseopt;
- if (mclength != 1) reqbyte = code[-1] | cd->req_varyopt;
- }
- else firstbyte = reqbyte = REQ_NONE;
- }
-
- /* firstbyte was previously set; we can set reqbyte only the length is
- 1 or the matching is caseful. */
-
- else
- {
- zerofirstbyte = firstbyte;
- zeroreqbyte = reqbyte;
- if (mclength == 1 || req_caseopt == 0)
- reqbyte = code[-1] | req_caseopt | cd->req_varyopt;
- }
-
- break; /* End of literal character handling */
- }
- } /* end of big loop */
-
-
-/* Control never reaches here by falling through, only by a goto for all the
-error states. Pass back the position in the pattern so that it can be displayed
-to the user for diagnosing the error. */
-
-FAILED:
-*ptrptr = ptr;
-return FALSE;
-}
-
-
-
-
-/*************************************************
-* Compile sequence of alternatives *
-*************************************************/
-
-/* On entry, ptr is pointing past the bracket character, but on return it
-points to the closing bracket, or vertical bar, or end of string. The code
-variable is pointing at the byte into which the BRA operator has been stored.
-If the ims options are changed at the start (for a (?ims: group) or during any
-branch, we need to insert an OP_OPT item at the start of every following branch
-to ensure they get set correctly at run time, and also pass the new options
-into every subsequent branch compile.
-
-This function is used during the pre-compile phase when we are trying to find
-out the amount of memory needed, as well as during the real compile phase. The
-value of lengthptr distinguishes the two phases.
-
-Arguments:
- options option bits, including any changes for this subpattern
- oldims previous settings of ims option bits
- codeptr -> the address of the current code pointer
- ptrptr -> the address of the current pattern pointer
- errorcodeptr -> pointer to error code variable
- lookbehind TRUE if this is a lookbehind assertion
- reset_bracount TRUE to reset the count for each branch
- skipbytes skip this many bytes at start (for brackets and OP_COND)
- firstbyteptr place to put the first required character, or a negative number
- reqbyteptr place to put the last required character, or a negative number
- bcptr pointer to the chain of currently open branches
- cd points to the data block with tables pointers etc.
- lengthptr NULL during the real compile phase
- points to length accumulator during pre-compile phase
-
-Returns: TRUE on success
-*/
-
-static BOOL
-compile_regex(int options, int oldims, uschar **codeptr, const uschar **ptrptr,
- int *errorcodeptr, BOOL lookbehind, BOOL reset_bracount, int skipbytes,
- int *firstbyteptr, int *reqbyteptr, branch_chain *bcptr, compile_data *cd,
- int *lengthptr)
-{
-const uschar *ptr = *ptrptr;
-uschar *code = *codeptr;
-uschar *last_branch = code;
-uschar *start_bracket = code;
-uschar *reverse_count = NULL;
-int firstbyte, reqbyte;
-int branchfirstbyte, branchreqbyte;
-int length;
-int orig_bracount;
-int max_bracount;
-branch_chain bc;
-
-bc.outer = bcptr;
-bc.current = code;
-
-firstbyte = reqbyte = REQ_UNSET;
-
-/* Accumulate the length for use in the pre-compile phase. Start with the
-length of the BRA and KET and any extra bytes that are required at the
-beginning. We accumulate in a local variable to save frequent testing of
-lenthptr for NULL. We cannot do this by looking at the value of code at the
-start and end of each alternative, because compiled items are discarded during
-the pre-compile phase so that the work space is not exceeded. */
-
-length = 2 + 2*LINK_SIZE + skipbytes;
-
-/* WARNING: If the above line is changed for any reason, you must also change
-the code that abstracts option settings at the start of the pattern and makes
-them global. It tests the value of length for (2 + 2*LINK_SIZE) in the
-pre-compile phase to find out whether anything has yet been compiled or not. */
-
-/* Offset is set zero to mark that this bracket is still open */
-
-PUT(code, 1, 0);
-code += 1 + LINK_SIZE + skipbytes;
-
-/* Loop for each alternative branch */
-
-orig_bracount = max_bracount = cd->bracount;
-for (;;)
- {
- /* For a (?| group, reset the capturing bracket count so that each branch
- uses the same numbers. */
-
- if (reset_bracount) cd->bracount = orig_bracount;
-
- /* Handle a change of ims options at the start of the branch */
-
- if ((options & PCRE_IMS) != oldims)
- {
- *code++ = OP_OPT;
- *code++ = options & PCRE_IMS;
- length += 2;
- }
-
- /* Set up dummy OP_REVERSE if lookbehind assertion */
-
- if (lookbehind)
- {
- *code++ = OP_REVERSE;
- reverse_count = code;
- PUTINC(code, 0, 0);
- length += 1 + LINK_SIZE;
- }
-
- /* Now compile the branch; in the pre-compile phase its length gets added
- into the length. */
-
- if (!compile_branch(&options, &code, &ptr, errorcodeptr, &branchfirstbyte,
- &branchreqbyte, &bc, cd, (lengthptr == NULL)? NULL : &length))
- {
- *ptrptr = ptr;
- return FALSE;
- }
-
- /* Keep the highest bracket count in case (?| was used and some branch
- has fewer than the rest. */
-
- if (cd->bracount > max_bracount) max_bracount = cd->bracount;
-
- /* In the real compile phase, there is some post-processing to be done. */
-
- if (lengthptr == NULL)
- {
- /* If this is the first branch, the firstbyte and reqbyte values for the
- branch become the values for the regex. */
-
- if (*last_branch != OP_ALT)
- {
- firstbyte = branchfirstbyte;
- reqbyte = branchreqbyte;
- }
-
- /* If this is not the first branch, the first char and reqbyte have to
- match the values from all the previous branches, except that if the
- previous value for reqbyte didn't have REQ_VARY set, it can still match,
- and we set REQ_VARY for the regex. */
-
- else
- {
- /* If we previously had a firstbyte, but it doesn't match the new branch,
- we have to abandon the firstbyte for the regex, but if there was
- previously no reqbyte, it takes on the value of the old firstbyte. */
-
- if (firstbyte >= 0 && firstbyte != branchfirstbyte)
- {
- if (reqbyte < 0) reqbyte = firstbyte;
- firstbyte = REQ_NONE;
- }
-
- /* If we (now or from before) have no firstbyte, a firstbyte from the
- branch becomes a reqbyte if there isn't a branch reqbyte. */
-
- if (firstbyte < 0 && branchfirstbyte >= 0 && branchreqbyte < 0)
- branchreqbyte = branchfirstbyte;
-
- /* Now ensure that the reqbytes match */
-
- if ((reqbyte & ~REQ_VARY) != (branchreqbyte & ~REQ_VARY))
- reqbyte = REQ_NONE;
- else reqbyte |= branchreqbyte; /* To "or" REQ_VARY */
- }
-
- /* If lookbehind, check that this branch matches a fixed-length string, and
- put the length into the OP_REVERSE item. Temporarily mark the end of the
- branch with OP_END. */
-
- if (lookbehind)
- {
- int fixed_length;
- *code = OP_END;
- fixed_length = find_fixedlength(last_branch, options);
- DPRINTF(("fixed length = %d\n", fixed_length));
- if (fixed_length < 0)
- {
- *errorcodeptr = (fixed_length == -2)? ERR36 : ERR25;
- *ptrptr = ptr;
- return FALSE;
- }
- PUT(reverse_count, 0, fixed_length);
- }
- }
-
- /* Reached end of expression, either ')' or end of pattern. In the real
- compile phase, go back through the alternative branches and reverse the chain
- of offsets, with the field in the BRA item now becoming an offset to the
- first alternative. If there are no alternatives, it points to the end of the
- group. The length in the terminating ket is always the length of the whole
- bracketed item. If any of the ims options were changed inside the group,
- compile a resetting op-code following, except at the very end of the pattern.
- Return leaving the pointer at the terminating char. */
-
- if (*ptr != '|')
- {
- if (lengthptr == NULL)
- {
- int branch_length = code - last_branch;
- do
- {
- int prev_length = GET(last_branch, 1);
- PUT(last_branch, 1, branch_length);
- branch_length = prev_length;
- last_branch -= branch_length;
- }
- while (branch_length > 0);
- }
-
- /* Fill in the ket */
-
- *code = OP_KET;
- PUT(code, 1, code - start_bracket);
- code += 1 + LINK_SIZE;
-
- /* Resetting option if needed */
-
- if ((options & PCRE_IMS) != oldims && *ptr == ')')
- {
- *code++ = OP_OPT;
- *code++ = oldims;
- length += 2;
- }
-
- /* Retain the highest bracket number, in case resetting was used. */
-
- cd->bracount = max_bracount;
-
- /* Set values to pass back */
-
- *codeptr = code;
- *ptrptr = ptr;
- *firstbyteptr = firstbyte;
- *reqbyteptr = reqbyte;
- if (lengthptr != NULL)
- {
- if (OFLOW_MAX - *lengthptr < length)
- {
- *errorcodeptr = ERR20;
- return FALSE;
- }
- *lengthptr += length;
- }
- return TRUE;
- }
-
- /* Another branch follows. In the pre-compile phase, we can move the code
- pointer back to where it was for the start of the first branch. (That is,
- pretend that each branch is the only one.)
-
- In the real compile phase, insert an ALT node. Its length field points back
- to the previous branch while the bracket remains open. At the end the chain
- is reversed. It's done like this so that the start of the bracket has a
- zero offset until it is closed, making it possible to detect recursion. */
-
- if (lengthptr != NULL)
- {
- code = *codeptr + 1 + LINK_SIZE + skipbytes;
- length += 1 + LINK_SIZE;
- }
- else
- {
- *code = OP_ALT;
- PUT(code, 1, code - last_branch);
- bc.current = last_branch = code;
- code += 1 + LINK_SIZE;
- }
-
- ptr++;
- }
-/* Control never reaches here */
-}
-
-
-
-
-/*************************************************
-* Check for anchored expression *
-*************************************************/
-
-/* Try to find out if this is an anchored regular expression. Consider each
-alternative branch. If they all start with OP_SOD or OP_CIRC, or with a bracket
-all of whose alternatives start with OP_SOD or OP_CIRC (recurse ad lib), then
-it's anchored. However, if this is a multiline pattern, then only OP_SOD
-counts, since OP_CIRC can match in the middle.
-
-We can also consider a regex to be anchored if OP_SOM starts all its branches.
-This is the code for \G, which means "match at start of match position, taking
-into account the match offset".
-
-A branch is also implicitly anchored if it starts with .* and DOTALL is set,
-because that will try the rest of the pattern at all possible matching points,
-so there is no point trying again.... er ....
-
-.... except when the .* appears inside capturing parentheses, and there is a
-subsequent back reference to those parentheses. We haven't enough information
-to catch that case precisely.
-
-At first, the best we could do was to detect when .* was in capturing brackets
-and the highest back reference was greater than or equal to that level.
-However, by keeping a bitmap of the first 31 back references, we can catch some
-of the more common cases more precisely.
-
-Arguments:
- code points to start of expression (the bracket)
- options points to the options setting
- bracket_map a bitmap of which brackets we are inside while testing; this
- handles up to substring 31; after that we just have to take
- the less precise approach
- backref_map the back reference bitmap
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-is_anchored(register const uschar *code, int *options, unsigned int bracket_map,
- unsigned int backref_map)
-{
-do {
- const uschar *scode = first_significant_code(code + _pcre_OP_lengths[*code],
- options, PCRE_MULTILINE, FALSE);
- register int op = *scode;
-
- /* Non-capturing brackets */
-
- if (op == OP_BRA)
- {
- if (!is_anchored(scode, options, bracket_map, backref_map)) return FALSE;
- }
-
- /* Capturing brackets */
-
- else if (op == OP_CBRA)
- {
- int n = GET2(scode, 1+LINK_SIZE);
- int new_map = bracket_map | ((n < 32)? (1 << n) : 1);
- if (!is_anchored(scode, options, new_map, backref_map)) return FALSE;
- }
-
- /* Other brackets */
-
- else if (op == OP_ASSERT || op == OP_ONCE || op == OP_COND)
- {
- if (!is_anchored(scode, options, bracket_map, backref_map)) return FALSE;
- }
-
- /* .* is not anchored unless DOTALL is set (which generates OP_ALLANY) and
- it isn't in brackets that are or may be referenced. */
-
- else if ((op == OP_TYPESTAR || op == OP_TYPEMINSTAR ||
- op == OP_TYPEPOSSTAR))
- {
- if (scode[1] != OP_ALLANY || (bracket_map & backref_map) != 0)
- return FALSE;
- }
-
- /* Check for explicit anchoring */
-
- else if (op != OP_SOD && op != OP_SOM &&
- ((*options & PCRE_MULTILINE) != 0 || op != OP_CIRC))
- return FALSE;
- code += GET(code, 1);
- }
-while (*code == OP_ALT); /* Loop for each alternative */
-return TRUE;
-}
-
-
-
-/*************************************************
-* Check for starting with ^ or .* *
-*************************************************/
-
-/* This is called to find out if every branch starts with ^ or .* so that
-"first char" processing can be done to speed things up in multiline
-matching and for non-DOTALL patterns that start with .* (which must start at
-the beginning or after \n). As in the case of is_anchored() (see above), we
-have to take account of back references to capturing brackets that contain .*
-because in that case we can't make the assumption.
-
-Arguments:
- code points to start of expression (the bracket)
- bracket_map a bitmap of which brackets we are inside while testing; this
- handles up to substring 31; after that we just have to take
- the less precise approach
- backref_map the back reference bitmap
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-is_startline(const uschar *code, unsigned int bracket_map,
- unsigned int backref_map)
-{
-do {
- const uschar *scode = first_significant_code(code + _pcre_OP_lengths[*code],
- NULL, 0, FALSE);
- register int op = *scode;
-
- /* Non-capturing brackets */
-
- if (op == OP_BRA)
- {
- if (!is_startline(scode, bracket_map, backref_map)) return FALSE;
- }
-
- /* Capturing brackets */
-
- else if (op == OP_CBRA)
- {
- int n = GET2(scode, 1+LINK_SIZE);
- int new_map = bracket_map | ((n < 32)? (1 << n) : 1);
- if (!is_startline(scode, new_map, backref_map)) return FALSE;
- }
-
- /* Other brackets */
-
- else if (op == OP_ASSERT || op == OP_ONCE || op == OP_COND)
- { if (!is_startline(scode, bracket_map, backref_map)) return FALSE; }
-
- /* .* means "start at start or after \n" if it isn't in brackets that
- may be referenced. */
-
- else if (op == OP_TYPESTAR || op == OP_TYPEMINSTAR || op == OP_TYPEPOSSTAR)
- {
- if (scode[1] != OP_ANY || (bracket_map & backref_map) != 0) return FALSE;
- }
-
- /* Check for explicit circumflex */
-
- else if (op != OP_CIRC) return FALSE;
-
- /* Move on to the next alternative */
-
- code += GET(code, 1);
- }
-while (*code == OP_ALT); /* Loop for each alternative */
-return TRUE;
-}
-
-
-
-/*************************************************
-* Check for asserted fixed first char *
-*************************************************/
-
-/* During compilation, the "first char" settings from forward assertions are
-discarded, because they can cause conflicts with actual literals that follow.
-However, if we end up without a first char setting for an unanchored pattern,
-it is worth scanning the regex to see if there is an initial asserted first
-char. If all branches start with the same asserted char, or with a bracket all
-of whose alternatives start with the same asserted char (recurse ad lib), then
-we return that char, otherwise -1.
-
-Arguments:
- code points to start of expression (the bracket)
- options pointer to the options (used to check casing changes)
- inassert TRUE if in an assertion
-
-Returns: -1 or the fixed first char
-*/
-
-static int
-find_firstassertedchar(const uschar *code, int *options, BOOL inassert)
-{
-register int c = -1;
-do {
- int d;
- const uschar *scode =
- first_significant_code(code + 1+LINK_SIZE, options, PCRE_CASELESS, TRUE);
- register int op = *scode;
-
- switch(op)
- {
- default:
- return -1;
-
- case OP_BRA:
- case OP_CBRA:
- case OP_ASSERT:
- case OP_ONCE:
- case OP_COND:
- if ((d = find_firstassertedchar(scode, options, op == OP_ASSERT)) < 0)
- return -1;
- if (c < 0) c = d; else if (c != d) return -1;
- break;
-
- case OP_EXACT: /* Fall through */
- scode += 2;
-
- case OP_CHAR:
- case OP_CHARNC:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_POSPLUS:
- if (!inassert) return -1;
- if (c < 0)
- {
- c = scode[1];
- if ((*options & PCRE_CASELESS) != 0) c |= REQ_CASELESS;
- }
- else if (c != scode[1]) return -1;
- break;
- }
-
- code += GET(code, 1);
- }
-while (*code == OP_ALT);
-return c;
-}
-
-
-
-/*************************************************
-* Compile a Regular Expression *
-*************************************************/
-
-/* This function takes a string and returns a pointer to a block of store
-holding a compiled version of the expression. The original API for this
-function had no error code return variable; it is retained for backwards
-compatibility. The new function is given a new name.
-
-Arguments:
- pattern the regular expression
- options various option bits
- errorcodeptr pointer to error code variable (pcre_compile2() only)
- can be NULL if you don't want a code value
- errorptr pointer to pointer to error text
- erroroffset ptr offset in pattern where error was detected
- tables pointer to character tables or NULL
-
-Returns: pointer to compiled data block, or NULL on error,
- with errorptr and erroroffset set
-*/
-
-PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION
-pcre_compile(const char *pattern, int options, const char **errorptr,
- int *erroroffset, const unsigned char *tables)
-{
-return pcre_compile2(pattern, options, NULL, errorptr, erroroffset, tables);
-}
-
-
-PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION
-pcre_compile2(const char *pattern, int options, int *errorcodeptr,
- const char **errorptr, int *erroroffset, const unsigned char *tables)
-{
-real_pcre *re;
-int length = 1; /* For final END opcode */
-int firstbyte, reqbyte, newline;
-int errorcode = 0;
-int skipatstart = 0;
-#ifdef SUPPORT_UTF8
-BOOL utf8;
-#endif
-size_t size;
-uschar *code;
-const uschar *codestart;
-const uschar *ptr;
-compile_data compile_block;
-compile_data *cd = &compile_block;
-
-/* This space is used for "compiling" into during the first phase, when we are
-computing the amount of memory that is needed. Compiled items are thrown away
-as soon as possible, so that a fairly large buffer should be sufficient for
-this purpose. The same space is used in the second phase for remembering where
-to fill in forward references to subpatterns. */
-
-uschar cworkspace[COMPILE_WORK_SIZE];
-
-/* Set this early so that early errors get offset 0. */
-
-ptr = (const uschar *)pattern;
-
-/* We can't pass back an error message if errorptr is NULL; I guess the best we
-can do is just return NULL, but we can set a code value if there is a code
-pointer. */
-
-if (errorptr == NULL)
- {
- if (errorcodeptr != NULL) *errorcodeptr = 99;
- return NULL;
- }
-
-*errorptr = NULL;
-if (errorcodeptr != NULL) *errorcodeptr = ERR0;
-
-/* However, we can give a message for this error */
-
-if (erroroffset == NULL)
- {
- errorcode = ERR16;
- goto PCRE_EARLY_ERROR_RETURN2;
- }
-
-*erroroffset = 0;
-
-/* Can't support UTF8 unless PCRE has been compiled to include the code. */
-
-#ifdef SUPPORT_UTF8
-utf8 = (options & PCRE_UTF8) != 0;
-if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 &&
- (*erroroffset = _pcre_valid_utf8((uschar *)pattern, -1)) >= 0)
- {
- errorcode = ERR44;
- goto PCRE_EARLY_ERROR_RETURN2;
- }
-#else
-if ((options & PCRE_UTF8) != 0)
- {
- errorcode = ERR32;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-#endif
-
-if ((options & ~PUBLIC_OPTIONS) != 0)
- {
- errorcode = ERR17;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* Set up pointers to the individual character tables */
-
-if (tables == NULL) tables = _pcre_default_tables;
-cd->lcc = tables + lcc_offset;
-cd->fcc = tables + fcc_offset;
-cd->cbits = tables + cbits_offset;
-cd->ctypes = tables + ctypes_offset;
-
-/* Check for global one-time settings at the start of the pattern, and remember
-the offset for later. */
-
-while (ptr[skipatstart] == '(' && ptr[skipatstart+1] == '*')
- {
- int newnl = 0;
- int newbsr = 0;
-
- if (strncmp((char *)(ptr+skipatstart+2), "CR)", 3) == 0)
- { skipatstart += 5; newnl = PCRE_NEWLINE_CR; }
- else if (strncmp((char *)(ptr+skipatstart+2), "LF)", 3) == 0)
- { skipatstart += 5; newnl = PCRE_NEWLINE_LF; }
- else if (strncmp((char *)(ptr+skipatstart+2), "CRLF)", 5) == 0)
- { skipatstart += 7; newnl = PCRE_NEWLINE_CR + PCRE_NEWLINE_LF; }
- else if (strncmp((char *)(ptr+skipatstart+2), "ANY)", 4) == 0)
- { skipatstart += 6; newnl = PCRE_NEWLINE_ANY; }
- else if (strncmp((char *)(ptr+skipatstart+2), "ANYCRLF)", 8) == 0)
- { skipatstart += 10; newnl = PCRE_NEWLINE_ANYCRLF; }
-
- else if (strncmp((char *)(ptr+skipatstart+2), "BSR_ANYCRLF)", 12) == 0)
- { skipatstart += 14; newbsr = PCRE_BSR_ANYCRLF; }
- else if (strncmp((char *)(ptr+skipatstart+2), "BSR_UNICODE)", 12) == 0)
- { skipatstart += 14; newbsr = PCRE_BSR_UNICODE; }
-
- if (newnl != 0)
- options = (options & ~PCRE_NEWLINE_BITS) | newnl;
- else if (newbsr != 0)
- options = (options & ~(PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) | newbsr;
- else break;
- }
-
-/* Check validity of \R options. */
-
-switch (options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE))
- {
- case 0:
- case PCRE_BSR_ANYCRLF:
- case PCRE_BSR_UNICODE:
- break;
- default: errorcode = ERR56; goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* Handle different types of newline. The three bits give seven cases. The
-current code allows for fixed one- or two-byte sequences, plus "any" and
-"anycrlf". */
-
-switch (options & PCRE_NEWLINE_BITS)
- {
- case 0: newline = NEWLINE; break; /* Build-time default */
- case PCRE_NEWLINE_CR: newline = '\r'; break;
- case PCRE_NEWLINE_LF: newline = '\n'; break;
- case PCRE_NEWLINE_CR+
- PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break;
- case PCRE_NEWLINE_ANY: newline = -1; break;
- case PCRE_NEWLINE_ANYCRLF: newline = -2; break;
- default: errorcode = ERR56; goto PCRE_EARLY_ERROR_RETURN;
- }
-
-if (newline == -2)
- {
- cd->nltype = NLTYPE_ANYCRLF;
- }
-else if (newline < 0)
- {
- cd->nltype = NLTYPE_ANY;
- }
-else
- {
- cd->nltype = NLTYPE_FIXED;
- if (newline > 255)
- {
- cd->nllen = 2;
- cd->nl[0] = (newline >> 8) & 255;
- cd->nl[1] = newline & 255;
- }
- else
- {
- cd->nllen = 1;
- cd->nl[0] = newline;
- }
- }
-
-/* Maximum back reference and backref bitmap. The bitmap records up to 31 back
-references to help in deciding whether (.*) can be treated as anchored or not.
-*/
-
-cd->top_backref = 0;
-cd->backref_map = 0;
-
-/* Reflect pattern for debugging output */
-
-DPRINTF(("------------------------------------------------------------------\n"));
-DPRINTF(("%s\n", pattern));
-
-/* Pretend to compile the pattern while actually just accumulating the length
-of memory required. This behaviour is triggered by passing a non-NULL final
-argument to compile_regex(). We pass a block of workspace (cworkspace) for it
-to compile parts of the pattern into; the compiled code is discarded when it is
-no longer needed, so hopefully this workspace will never overflow, though there
-is a test for its doing so. */
-
-cd->bracount = cd->final_bracount = 0;
-cd->names_found = 0;
-cd->name_entry_size = 0;
-cd->name_table = NULL;
-cd->start_workspace = cworkspace;
-cd->start_code = cworkspace;
-cd->hwm = cworkspace;
-cd->start_pattern = (const uschar *)pattern;
-cd->end_pattern = (const uschar *)(pattern + strlen(pattern));
-cd->req_varyopt = 0;
-cd->external_options = options;
-cd->external_flags = 0;
-
-/* Now do the pre-compile. On error, errorcode will be set non-zero, so we
-don't need to look at the result of the function here. The initial options have
-been put into the cd block so that they can be changed if an option setting is
-found within the regex right at the beginning. Bringing initial option settings
-outside can help speed up starting point checks. */
-
-ptr += skipatstart;
-code = cworkspace;
-*code = OP_BRA;
-(void)compile_regex(cd->external_options, cd->external_options & PCRE_IMS,
- &code, &ptr, &errorcode, FALSE, FALSE, 0, &firstbyte, &reqbyte, NULL, cd,
- &length);
-if (errorcode != 0) goto PCRE_EARLY_ERROR_RETURN;
-
-DPRINTF(("end pre-compile: length=%d workspace=%d\n", length,
- cd->hwm - cworkspace));
-
-if (length > MAX_PATTERN_SIZE)
- {
- errorcode = ERR20;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* Compute the size of data block needed and get it, either from malloc or
-externally provided function. Integer overflow should no longer be possible
-because nowadays we limit the maximum value of cd->names_found and
-cd->name_entry_size. */
-
-size = length + sizeof(real_pcre) + cd->names_found * (cd->name_entry_size + 3);
-re = (real_pcre *)(pcre_malloc)(size);
-
-if (re == NULL)
- {
- errorcode = ERR21;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* Put in the magic number, and save the sizes, initial options, internal
-flags, and character table pointer. NULL is used for the default character
-tables. The nullpad field is at the end; it's there to help in the case when a
-regex compiled on a system with 4-byte pointers is run on another with 8-byte
-pointers. */
-
-re->magic_number = MAGIC_NUMBER;
-re->size = size;
-re->options = cd->external_options;
-re->flags = cd->external_flags;
-re->dummy1 = 0;
-re->first_byte = 0;
-re->req_byte = 0;
-re->name_table_offset = sizeof(real_pcre);
-re->name_entry_size = cd->name_entry_size;
-re->name_count = cd->names_found;
-re->ref_count = 0;
-re->tables = (tables == _pcre_default_tables)? NULL : tables;
-re->nullpad = NULL;
-
-/* The starting points of the name/number translation table and of the code are
-passed around in the compile data block. The start/end pattern and initial
-options are already set from the pre-compile phase, as is the name_entry_size
-field. Reset the bracket count and the names_found field. Also reset the hwm
-field; this time it's used for remembering forward references to subpatterns.
-*/
-
-cd->final_bracount = cd->bracount; /* Save for checking forward references */
-cd->bracount = 0;
-cd->names_found = 0;
-cd->name_table = (uschar *)re + re->name_table_offset;
-codestart = cd->name_table + re->name_entry_size * re->name_count;
-cd->start_code = codestart;
-cd->hwm = cworkspace;
-cd->req_varyopt = 0;
-cd->had_accept = FALSE;
-
-/* Set up a starting, non-extracting bracket, then compile the expression. On
-error, errorcode will be set non-zero, so we don't need to look at the result
-of the function here. */
-
-ptr = (const uschar *)pattern + skipatstart;
-code = (uschar *)codestart;
-*code = OP_BRA;
-(void)compile_regex(re->options, re->options & PCRE_IMS, &code, &ptr,
- &errorcode, FALSE, FALSE, 0, &firstbyte, &reqbyte, NULL, cd, NULL);
-re->top_bracket = cd->bracount;
-re->top_backref = cd->top_backref;
-re->flags = cd->external_flags;
-
-if (cd->had_accept) reqbyte = -1; /* Must disable after (*ACCEPT) */
-
-/* If not reached end of pattern on success, there's an excess bracket. */
-
-if (errorcode == 0 && *ptr != 0) errorcode = ERR22;
-
-/* Fill in the terminating state and check for disastrous overflow, but
-if debugging, leave the test till after things are printed out. */
-
-*code++ = OP_END;
-
-#ifndef DEBUG
-if (code - codestart > length) errorcode = ERR23;
-#endif
-
-/* Fill in any forward references that are required. */
-
-while (errorcode == 0 && cd->hwm > cworkspace)
- {
- int offset, recno;
- const uschar *groupptr;
- cd->hwm -= LINK_SIZE;
- offset = GET(cd->hwm, 0);
- recno = GET(codestart, offset);
- groupptr = find_bracket(codestart, (re->options & PCRE_UTF8) != 0, recno);
- if (groupptr == NULL) errorcode = ERR53;
- else PUT(((uschar *)codestart), offset, groupptr - codestart);
- }
-
-/* Give an error if there's back reference to a non-existent capturing
-subpattern. */
-
-if (errorcode == 0 && re->top_backref > re->top_bracket) errorcode = ERR15;
-
-/* Failed to compile, or error while post-processing */
-
-if (errorcode != 0)
- {
- (pcre_free)(re);
- PCRE_EARLY_ERROR_RETURN:
- *erroroffset = ptr - (const uschar *)pattern;
- PCRE_EARLY_ERROR_RETURN2:
- *errorptr = find_error_text(errorcode);
- if (errorcodeptr != NULL) *errorcodeptr = errorcode;
- return NULL;
- }
-
-/* If the anchored option was not passed, set the flag if we can determine that
-the pattern is anchored by virtue of ^ characters or \A or anything else (such
-as starting with .* when DOTALL is set).
-
-Otherwise, if we know what the first byte has to be, save it, because that
-speeds up unanchored matches no end. If not, see if we can set the
-PCRE_STARTLINE flag. This is helpful for multiline matches when all branches
-start with ^. and also when all branches start with .* for non-DOTALL matches.
-*/
-
-if ((re->options & PCRE_ANCHORED) == 0)
- {
- int temp_options = re->options; /* May get changed during these scans */
- if (is_anchored(codestart, &temp_options, 0, cd->backref_map))
- re->options |= PCRE_ANCHORED;
- else
- {
- if (firstbyte < 0)
- firstbyte = find_firstassertedchar(codestart, &temp_options, FALSE);
- if (firstbyte >= 0) /* Remove caseless flag for non-caseable chars */
- {
- int ch = firstbyte & 255;
- re->first_byte = ((firstbyte & REQ_CASELESS) != 0 &&
- cd->fcc[ch] == ch)? ch : firstbyte;
- re->flags |= PCRE_FIRSTSET;
- }
- else if (is_startline(codestart, 0, cd->backref_map))
- re->flags |= PCRE_STARTLINE;
- }
- }
-
-/* For an anchored pattern, we use the "required byte" only if it follows a
-variable length item in the regex. Remove the caseless flag for non-caseable
-bytes. */
-
-if (reqbyte >= 0 &&
- ((re->options & PCRE_ANCHORED) == 0 || (reqbyte & REQ_VARY) != 0))
- {
- int ch = reqbyte & 255;
- re->req_byte = ((reqbyte & REQ_CASELESS) != 0 &&
- cd->fcc[ch] == ch)? (reqbyte & ~REQ_CASELESS) : reqbyte;
- re->flags |= PCRE_REQCHSET;
- }
-
-/* Print out the compiled data if debugging is enabled. This is never the
-case when building a production library. */
-
-#ifdef DEBUG
-
-printf("Length = %d top_bracket = %d top_backref = %d\n",
- length, re->top_bracket, re->top_backref);
-
-printf("Options=%08x\n", re->options);
-
-if ((re->flags & PCRE_FIRSTSET) != 0)
- {
- int ch = re->first_byte & 255;
- const char *caseless = ((re->first_byte & REQ_CASELESS) == 0)?
- "" : " (caseless)";
- if (isprint(ch)) printf("First char = %c%s\n", ch, caseless);
- else printf("First char = \\x%02x%s\n", ch, caseless);
- }
-
-if ((re->flags & PCRE_REQCHSET) != 0)
- {
- int ch = re->req_byte & 255;
- const char *caseless = ((re->req_byte & REQ_CASELESS) == 0)?
- "" : " (caseless)";
- if (isprint(ch)) printf("Req char = %c%s\n", ch, caseless);
- else printf("Req char = \\x%02x%s\n", ch, caseless);
- }
-
-pcre_printint(re, stdout, TRUE);
-
-/* This check is done here in the debugging case so that the code that
-was compiled can be seen. */
-
-if (code - codestart > length)
- {
- (pcre_free)(re);
- *errorptr = find_error_text(ERR23);
- *erroroffset = ptr - (uschar *)pattern;
- if (errorcodeptr != NULL) *errorcodeptr = ERR23;
- return NULL;
- }
-#endif /* DEBUG */
-
-return (pcre *)re;
-}
-
-/* End of pcre_compile.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_config.h b/Utilities/Poco/Foundation/src/pcre_config.h
deleted file mode 100755
index 792425beea..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_config.h
+++ /dev/null
@@ -1,275 +0,0 @@
-/* config.h. Generated from config.h.in by configure. */
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-
-/* On Unix-like systems config.h.in is converted by "configure" into config.h.
-Some other environments also support the use of "configure". PCRE is written in
-Standard C, but there are a few non-standard things it can cope with, allowing
-it to run on SunOS4 and other "close to standard" systems.
-
-If you are going to build PCRE "by hand" on a system without "configure" you
-should copy the distributed config.h.generic to config.h, and then set up the
-macros the way you need them. Alternatively, you can avoid editing by using -D
-on the compiler command line to set the macro values.
-
-PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if
-HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set
-them both to 0; an emulation function will be used. */
-
-/* If you are compiling for a system that uses EBCDIC instead of ASCII
- character codes, define this macro as 1. On systems that can use
- "configure", this can be done via --enable-ebcdic. */
-/* #undef EBCDIC */
-
-/* Define to 1 if you have the `bcopy' function. */
-
-/* Define to 1 if you have the <bits/type_traits.h> header file. */
-/* #undef HAVE_BITS_TYPE_TRAITS_H */
-
-/* Define to 1 if you have the <dirent.h> header file. */
-#ifndef HAVE_DIRENT_H
-#define HAVE_DIRENT_H 0
-#endif
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#ifndef HAVE_DLFCN_H
-#define HAVE_DLFCN_H 0
-#endif
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#ifndef HAVE_INTTYPES_H
-#define HAVE_INTTYPES_H 0
-#endif
-
-/* Define to 1 if you have the <limits.h> header file. */
-#ifndef HAVE_LIMITS_H
-#define HAVE_LIMITS_H 1
-#endif
-
-/* Define to 1 if the system has the type `long long'. */
-#ifndef HAVE_LONG_LONG
-#define HAVE_LONG_LONG 0
-#endif
-
-/* Define to 1 if you have the `memmove' function. */
-
-/* Define to 1 if you have the <memory.h> header file. */
-#ifndef HAVE_MEMORY_H
-#define HAVE_MEMORY_H 1
-#endif
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#ifndef HAVE_STDINT_H
-#define HAVE_STDINT_H 0
-#endif
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#ifndef HAVE_STDLIB_H
-#define HAVE_STDLIB_H 1
-#endif
-
-/* Define to 1 if you have the `strerror' function. */
-#ifndef HAVE_STRERROR
-#define HAVE_STRERROR 0
-#endif
-
-/* Define to 1 if you have the <string> header file. */
-#ifndef HAVE_STRING
-#define HAVE_STRING 0
-#endif
-
-/* Define to 1 if you have the <strings.h> header file. */
-#ifndef HAVE_STRINGS_H
-#define HAVE_STRINGS_H 0
-#endif
-
-/* Define to 1 if you have the <string.h> header file. */
-#ifndef HAVE_STRING_H
-#define HAVE_STRING_H 1
-#endif
-
-/* Define to 1 if you have the `strtoll' function. */
-#ifndef HAVE_STRTOLL
-#define HAVE_STRTOLL 0
-#endif
-
-/* Define to 1 if you have the `strtoq' function. */
-#ifndef HAVE_STRTOQ
-#define HAVE_STRTOQ 0
-#endif
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#ifndef HAVE_SYS_STAT_H
-#define HAVE_SYS_STAT_H 0
-#endif
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#ifndef HAVE_SYS_TYPES_H
-#define HAVE_SYS_TYPES_H 0
-#endif
-
-/* Define to 1 if you have the <type_traits.h> header file. */
-/* #undef HAVE_TYPE_TRAITS_H */
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#ifndef HAVE_UNISTD_H
-#define HAVE_UNISTD_H 0
-#endif
-
-/* Define to 1 if the system has the type `unsigned long long'. */
-#ifndef HAVE_UNSIGNED_LONG_LONG
-#define HAVE_UNSIGNED_LONG_LONG 0
-#endif
-
-/* Define to 1 if you have the "Poco/UnWindows.h" header file. */
-/* #undef HAVE_WINDOWS_H */
-
-/* The value of LINK_SIZE determines the number of bytes used to store links
- as offsets within the compiled regex. The default is 2, which allows for
- compiled patterns up to 64K long. This covers the vast majority of cases.
- However, PCRE can also be compiled to use 3 or 4 bytes instead. This allows
- for longer patterns in extreme cases. On systems that support it,
- "configure" can be used to override this default. */
-#ifndef LINK_SIZE
-#define LINK_SIZE 2
-#endif
-
-/* The value of MATCH_LIMIT determines the default number of times the
- internal match() function can be called during a single execution of
- pcre_exec(). There is a runtime interface for setting a different limit.
- The limit exists in order to catch runaway regular expressions that take
- for ever to determine that they do not match. The default is set very large
- so that it does not accidentally catch legitimate cases. On systems that
- support it, "configure" can be used to override this default default. */
-#ifndef MATCH_LIMIT
-#define MATCH_LIMIT 10000000
-#endif
-
-/* The above limit applies to all calls of match(), whether or not they
- increase the recursion depth. In some environments it is desirable to limit
- the depth of recursive calls of match() more strictly, in order to restrict
- the maximum amount of stack (or heap, if NO_RECURSE is defined) that is
- used. The value of MATCH_LIMIT_RECURSION applies only to recursive calls of
- match(). To have any useful effect, it must be less than the value of
- MATCH_LIMIT. The default is to use the same value as MATCH_LIMIT. There is
- a runtime method for setting a different limit. On systems that support it,
- "configure" can be used to override the default. */
-#ifndef MATCH_LIMIT_RECURSION
-#define MATCH_LIMIT_RECURSION MATCH_LIMIT
-#endif
-
-/* This limit is parameterized just in case anybody ever wants to change it.
- Care must be taken if it is increased, because it guards against integer
- overflow caused by enormously large patterns. */
-#ifndef MAX_DUPLENGTH
-#define MAX_DUPLENGTH 30000
-#endif
-
-/* This limit is parameterized just in case anybody ever wants to change it.
- Care must be taken if it is increased, because it guards against integer
- overflow caused by enormously large patterns. */
-#ifndef MAX_NAME_COUNT
-#define MAX_NAME_COUNT 10000
-#endif
-
-/* This limit is parameterized just in case anybody ever wants to change it.
- Care must be taken if it is increased, because it guards against integer
- overflow caused by enormously large patterns. */
-#ifndef MAX_NAME_SIZE
-#define MAX_NAME_SIZE 32
-#endif
-
-/* The value of NEWLINE determines the newline character sequence. On
- Unix-like systems, "configure" can be used to override the default, which
- is 10. The possible values are 10 (LF), 13 (CR), 3338 (CRLF), -1 (ANY), or
- -2 (ANYCRLF). */
-#ifndef NEWLINE
-#define NEWLINE 10
-#endif
-
-/* PCRE uses recursive function calls to handle backtracking while matching.
- This can sometimes be a problem on systems that have stacks of limited
- size. Define NO_RECURSE to get a version that doesn't use recursion in the
- match() function; instead it creates its own stack by steam using
- pcre_recurse_malloc() to obtain memory from the heap. For more detail, see
- the comments and other stuff just above the match() function. On systems
- that support it, "configure" can be used to set this in the Makefile (use
- --disable-stack-for-recursion). */
-/* #undef NO_RECURSE */
-
-/* Name of package */
-#define PACKAGE "pcre"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "PCRE"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "PCRE 7.1"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "pcre"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "7.1"
-
-
-/* If you are compiling for a system other than a Unix-like system or
- Win32, and it needs some magic to be inserted before the definition
- of a function that is exported by the library, define this macro to
- contain the relevant magic. If you do not define this macro, it
- defaults to "extern" for a C compiler and "extern C" for a C++
- compiler on non-Win32 systems. This macro apears at the start of
- every exported function that is part of the external API. It does
- not appear on functions that are "external" in the C sense, but
- which are internal to the library. */
-/* #undef PCRE_EXP_DEFN */
-
-/* Define if linking statically (TODO: make nice with Libtool) */
-#ifndef PCRE_STATIC
-#define PCRE_STATIC 1
-#endif
-
-/* When calling PCRE via the POSIX interface, additional working storage is
- required for holding the pointers to capturing substrings because PCRE
- requires three integers per substring, whereas the POSIX interface provides
- only two. If the number of expected substrings is small, the wrapper
- function uses space on the stack, because this is faster than using
- malloc() for each call. The threshold above which the stack is no longer
- used is defined by POSIX_MALLOC_THRESHOLD. On systems that support it,
- "configure" can be used to override this default. */
-#ifndef POSIX_MALLOC_THRESHOLD
-#define POSIX_MALLOC_THRESHOLD 10
-#endif
-
-/* Define to 1 if you have the ANSI C header files. */
-#ifndef STDC_HEADERS
-#define STDC_HEADERS 1
-#endif
-
-/* Define to enable support for Unicode properties */
-#ifndef SUPPORT_UCP
-#define SUPPORT_UCP
-#endif
-
-/* Define to enable support for the UTF-8 Unicode encoding. */
-#ifndef SUPPORT_UTF8
-#define SUPPORT_UTF8
-#endif
-
-/* Version number of package */
-#ifndef VERSION
-#define VERSION "7.1"
-#endif
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-/* #undef size_t */
-
-#if defined(_MSC_VER)
- #pragma warning(disable:4018) // signed/unsigned comparison
-#endif
diff --git a/Utilities/Poco/Foundation/src/pcre_exec.c b/Utilities/Poco/Foundation/src/pcre_exec.c
deleted file mode 100755
index 3838ed68b3..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_exec.c
+++ /dev/null
@@ -1,4997 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains pcre_exec(), the externally visible function that does
-pattern matching using an NFA algorithm, trying to mimic Perl as closely as
-possible. There are also some static supporting functions. */
-
-#include "pcre_config.h"
-
-#define NLBLOCK md /* Block containing newline information */
-#define PSSTART start_subject /* Field containing processed string start */
-#define PSEND end_subject /* Field containing processed string end */
-
-#include "pcre_internal.h"
-
-/* Undefine some potentially clashing cpp symbols */
-
-#undef min
-#undef max
-
-/* Flag bits for the match() function */
-
-#define match_condassert 0x01 /* Called to check a condition assertion */
-#define match_cbegroup 0x02 /* Could-be-empty unlimited repeat group */
-
-/* Non-error returns from the match() function. Error returns are externally
-defined PCRE_ERROR_xxx codes, which are all negative. */
-
-#define MATCH_MATCH 1
-#define MATCH_NOMATCH 0
-
-/* Special internal returns from the match() function. Make them sufficiently
-negative to avoid the external error codes. */
-
-#define MATCH_COMMIT (-999)
-#define MATCH_PRUNE (-998)
-#define MATCH_SKIP (-997)
-#define MATCH_THEN (-996)
-
-/* Maximum number of ints of offset to save on the stack for recursive calls.
-If the offset vector is bigger, malloc is used. This should be a multiple of 3,
-because the offset vector is always a multiple of 3 long. */
-
-#define REC_STACK_SAVE_MAX 30
-
-/* Min and max values for the common repeats; for the maxima, 0 => infinity */
-
-static const char rep_min[] = { 0, 0, 1, 1, 0, 0 };
-static const char rep_max[] = { 0, 0, 0, 0, 1, 1 };
-
-
-
-#ifdef DEBUG
-/*************************************************
-* Debugging function to print chars *
-*************************************************/
-
-/* Print a sequence of chars in printable format, stopping at the end of the
-subject if the requested.
-
-Arguments:
- p points to characters
- length number to print
- is_subject TRUE if printing from within md->start_subject
- md pointer to matching data block, if is_subject is TRUE
-
-Returns: nothing
-*/
-
-static void
-pchars(const uschar *p, int length, BOOL is_subject, match_data *md)
-{
-unsigned int c;
-if (is_subject && length > md->end_subject - p) length = md->end_subject - p;
-while (length-- > 0)
- if (isprint(c = *(p++))) printf("%c", c); else printf("\\x%02x", c);
-}
-#endif
-
-
-
-/*************************************************
-* Match a back-reference *
-*************************************************/
-
-/* If a back reference hasn't been set, the length that is passed is greater
-than the number of characters left in the string, so the match fails.
-
-Arguments:
- offset index into the offset vector
- eptr points into the subject
- length length to be matched
- md points to match data block
- ims the ims flags
-
-Returns: TRUE if matched
-*/
-
-static BOOL
-match_ref(int offset, register USPTR eptr, int length, match_data *md,
- unsigned long int ims)
-{
-USPTR p = md->start_subject + md->offset_vector[offset];
-
-#ifdef DEBUG
-if (eptr >= md->end_subject)
- printf("matching subject <null>");
-else
- {
- printf("matching subject ");
- pchars(eptr, length, TRUE, md);
- }
-printf(" against backref ");
-pchars(p, length, FALSE, md);
-printf("\n");
-#endif
-
-/* Always fail if not enough characters left */
-
-if (length > md->end_subject - eptr) return FALSE;
-
-/* Separate the caseless case for speed. In UTF-8 mode we can only do this
-properly if Unicode properties are supported. Otherwise, we can check only
-ASCII characters. */
-
-if ((ims & PCRE_CASELESS) != 0)
- {
-#ifdef SUPPORT_UTF8
-#ifdef SUPPORT_UCP
- if (md->utf8)
- {
- USPTR endptr = eptr + length;
- while (eptr < endptr)
- {
- int c, d;
- GETCHARINC(c, eptr);
- GETCHARINC(d, p);
- if (c != d && c != UCD_OTHERCASE(d)) return FALSE;
- }
- }
- else
-#endif
-#endif
-
- /* The same code works when not in UTF-8 mode and in UTF-8 mode when there
- is no UCP support. */
-
- while (length-- > 0)
- { if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE; }
- }
-
-/* In the caseful case, we can just compare the bytes, whether or not we
-are in UTF-8 mode. */
-
-else
- { while (length-- > 0) if (*p++ != *eptr++) return FALSE; }
-
-return TRUE;
-}
-
-
-
-/***************************************************************************
-****************************************************************************
- RECURSION IN THE match() FUNCTION
-
-The match() function is highly recursive, though not every recursive call
-increases the recursive depth. Nevertheless, some regular expressions can cause
-it to recurse to a great depth. I was writing for Unix, so I just let it call
-itself recursively. This uses the stack for saving everything that has to be
-saved for a recursive call. On Unix, the stack can be large, and this works
-fine.
-
-It turns out that on some non-Unix-like systems there are problems with
-programs that use a lot of stack. (This despite the fact that every last chip
-has oodles of memory these days, and techniques for extending the stack have
-been known for decades.) So....
-
-There is a fudge, triggered by defining NO_RECURSE, which avoids recursive
-calls by keeping local variables that need to be preserved in blocks of memory
-obtained from malloc() instead instead of on the stack. Macros are used to
-achieve this so that the actual code doesn't look very different to what it
-always used to.
-
-The original heap-recursive code used longjmp(). However, it seems that this
-can be very slow on some operating systems. Following a suggestion from Stan
-Switzer, the use of longjmp() has been abolished, at the cost of having to
-provide a unique number for each call to RMATCH. There is no way of generating
-a sequence of numbers at compile time in C. I have given them names, to make
-them stand out more clearly.
-
-Crude tests on x86 Linux show a small speedup of around 5-8%. However, on
-FreeBSD, avoiding longjmp() more than halves the time taken to run the standard
-tests. Furthermore, not using longjmp() means that local dynamic variables
-don't have indeterminate values; this has meant that the frame size can be
-reduced because the result can be "passed back" by straight setting of the
-variable instead of being passed in the frame.
-****************************************************************************
-***************************************************************************/
-
-/* Numbers for RMATCH calls. When this list is changed, the code at HEAP_RETURN
-below must be updated in sync. */
-
-enum { RM1=1, RM2, RM3, RM4, RM5, RM6, RM7, RM8, RM9, RM10,
- RM11, RM12, RM13, RM14, RM15, RM16, RM17, RM18, RM19, RM20,
- RM21, RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30,
- RM31, RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,
- RM41, RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,
- RM51, RM52, RM53, RM54 };
-
-/* These versions of the macros use the stack, as normal. There are debugging
-versions and production versions. Note that the "rw" argument of RMATCH isn't
-actuall used in this definition. */
-
-#ifndef NO_RECURSE
-#define REGISTER register
-
-#ifdef DEBUG
-#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \
- { \
- printf("match() called in line %d\n", __LINE__); \
- rrc = match(ra,rb,mstart,rc,rd,re,rf,rg,rdepth+1); \
- printf("to line %d\n", __LINE__); \
- }
-#define RRETURN(ra) \
- { \
- printf("match() returned %d from line %d ", ra, __LINE__); \
- return ra; \
- }
-#else
-#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \
- rrc = match(ra,rb,mstart,rc,rd,re,rf,rg,rdepth+1)
-#define RRETURN(ra) return ra
-#endif
-
-#else
-
-
-/* These versions of the macros manage a private stack on the heap. Note that
-the "rd" argument of RMATCH isn't actually used in this definition. It's the md
-argument of match(), which never changes. */
-
-#define REGISTER
-
-#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw)\
- {\
- heapframe *newframe = (pcre_stack_malloc)(sizeof(heapframe));\
- frame->Xwhere = rw; \
- newframe->Xeptr = ra;\
- newframe->Xecode = rb;\
- newframe->Xmstart = mstart;\
- newframe->Xoffset_top = rc;\
- newframe->Xims = re;\
- newframe->Xeptrb = rf;\
- newframe->Xflags = rg;\
- newframe->Xrdepth = frame->Xrdepth + 1;\
- newframe->Xprevframe = frame;\
- frame = newframe;\
- DPRINTF(("restarting from line %d\n", __LINE__));\
- goto HEAP_RECURSE;\
- L_##rw:\
- DPRINTF(("jumped back to line %d\n", __LINE__));\
- }
-
-#define RRETURN(ra)\
- {\
- heapframe *newframe = frame;\
- frame = newframe->Xprevframe;\
- (pcre_stack_free)(newframe);\
- if (frame != NULL)\
- {\
- rrc = ra;\
- goto HEAP_RETURN;\
- }\
- return ra;\
- }
-
-
-/* Structure for remembering the local variables in a private frame */
-
-typedef struct heapframe {
- struct heapframe *Xprevframe;
-
- /* Function arguments that may change */
-
- const uschar *Xeptr;
- const uschar *Xecode;
- const uschar *Xmstart;
- int Xoffset_top;
- long int Xims;
- eptrblock *Xeptrb;
- int Xflags;
- unsigned int Xrdepth;
-
- /* Function local variables */
-
- const uschar *Xcallpat;
- const uschar *Xcharptr;
- const uschar *Xdata;
- const uschar *Xnext;
- const uschar *Xpp;
- const uschar *Xprev;
- const uschar *Xsaved_eptr;
-
- recursion_info Xnew_recursive;
-
- BOOL Xcur_is_word;
- BOOL Xcondition;
- BOOL Xprev_is_word;
-
- unsigned long int Xoriginal_ims;
-
-#ifdef SUPPORT_UCP
- int Xprop_type;
- int Xprop_value;
- int Xprop_fail_result;
- int Xprop_category;
- int Xprop_chartype;
- int Xprop_script;
- int Xoclength;
- uschar Xocchars[8];
-#endif
-
- int Xctype;
- unsigned int Xfc;
- int Xfi;
- int Xlength;
- int Xmax;
- int Xmin;
- int Xnumber;
- int Xoffset;
- int Xop;
- int Xsave_capture_last;
- int Xsave_offset1, Xsave_offset2, Xsave_offset3;
- int Xstacksave[REC_STACK_SAVE_MAX];
-
- eptrblock Xnewptrb;
-
- /* Where to jump back to */
-
- int Xwhere;
-
-} heapframe;
-
-#endif
-
-
-/***************************************************************************
-***************************************************************************/
-
-
-
-/*************************************************
-* Match from current position *
-*************************************************/
-
-/* This function is called recursively in many circumstances. Whenever it
-returns a negative (error) response, the outer incarnation must also return the
-same response.
-
-Performance note: It might be tempting to extract commonly used fields from the
-md structure (e.g. utf8, end_subject) into individual variables to improve
-performance. Tests using gcc on a SPARC disproved this; in the first case, it
-made performance worse.
-
-Arguments:
- eptr pointer to current character in subject
- ecode pointer to current position in compiled code
- mstart pointer to the current match start position (can be modified
- by encountering \K)
- offset_top current top pointer
- md pointer to "static" info for the match
- ims current /i, /m, and /s options
- eptrb pointer to chain of blocks containing eptr at start of
- brackets - for testing for empty matches
- flags can contain
- match_condassert - this is an assertion condition
- match_cbegroup - this is the start of an unlimited repeat
- group that can match an empty string
- rdepth the recursion depth
-
-Returns: MATCH_MATCH if matched ) these values are >= 0
- MATCH_NOMATCH if failed to match )
- a negative PCRE_ERROR_xxx value if aborted by an error condition
- (e.g. stopped by repeated call or recursion limit)
-*/
-
-static int
-match(REGISTER USPTR eptr, REGISTER const uschar *ecode, const uschar *mstart,
- int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb,
- int flags, unsigned int rdepth)
-{
-/* These variables do not need to be preserved over recursion in this function,
-so they can be ordinary variables in all cases. Mark some of them with
-"register" because they are used a lot in loops. */
-
-register int rrc; /* Returns from recursive calls */
-register int i; /* Used for loops not involving calls to RMATCH() */
-register unsigned int c; /* Character values not kept over RMATCH() calls */
-register BOOL utf8; /* Local copy of UTF-8 flag for speed */
-
-BOOL minimize, possessive; /* Quantifier options */
-
-/* When recursion is not being used, all "local" variables that have to be
-preserved over calls to RMATCH() are part of a "frame" which is obtained from
-heap storage. Set up the top-level frame here; others are obtained from the
-heap whenever RMATCH() does a "recursion". See the macro definitions above. */
-
-#ifdef NO_RECURSE
-heapframe *frame = (pcre_stack_malloc)(sizeof(heapframe));
-frame->Xprevframe = NULL; /* Marks the top level */
-
-/* Copy in the original argument variables */
-
-frame->Xeptr = eptr;
-frame->Xecode = ecode;
-frame->Xmstart = mstart;
-frame->Xoffset_top = offset_top;
-frame->Xims = ims;
-frame->Xeptrb = eptrb;
-frame->Xflags = flags;
-frame->Xrdepth = rdepth;
-
-/* This is where control jumps back to to effect "recursion" */
-
-HEAP_RECURSE:
-
-/* Macros make the argument variables come from the current frame */
-
-#define eptr frame->Xeptr
-#define ecode frame->Xecode
-#define mstart frame->Xmstart
-#define offset_top frame->Xoffset_top
-#define ims frame->Xims
-#define eptrb frame->Xeptrb
-#define flags frame->Xflags
-#define rdepth frame->Xrdepth
-
-/* Ditto for the local variables */
-
-#ifdef SUPPORT_UTF8
-#define charptr frame->Xcharptr
-#endif
-#define callpat frame->Xcallpat
-#define data frame->Xdata
-#define next frame->Xnext
-#define pp frame->Xpp
-#define prev frame->Xprev
-#define saved_eptr frame->Xsaved_eptr
-
-#define new_recursive frame->Xnew_recursive
-
-#define cur_is_word frame->Xcur_is_word
-#define condition frame->Xcondition
-#define prev_is_word frame->Xprev_is_word
-
-#define original_ims frame->Xoriginal_ims
-
-#ifdef SUPPORT_UCP
-#define prop_type frame->Xprop_type
-#define prop_value frame->Xprop_value
-#define prop_fail_result frame->Xprop_fail_result
-#define prop_category frame->Xprop_category
-#define prop_chartype frame->Xprop_chartype
-#define prop_script frame->Xprop_script
-#define oclength frame->Xoclength
-#define occhars frame->Xocchars
-#endif
-
-#define ctype frame->Xctype
-#define fc frame->Xfc
-#define fi frame->Xfi
-#define length frame->Xlength
-#define max frame->Xmax
-#define min frame->Xmin
-#define number frame->Xnumber
-#define offset frame->Xoffset
-#define op frame->Xop
-#define save_capture_last frame->Xsave_capture_last
-#define save_offset1 frame->Xsave_offset1
-#define save_offset2 frame->Xsave_offset2
-#define save_offset3 frame->Xsave_offset3
-#define stacksave frame->Xstacksave
-
-#define newptrb frame->Xnewptrb
-
-/* When recursion is being used, local variables are allocated on the stack and
-get preserved during recursion in the normal way. In this environment, fi and
-i, and fc and c, can be the same variables. */
-
-#else /* NO_RECURSE not defined */
-#define fi i
-#define fc c
-
-
-#ifdef SUPPORT_UTF8 /* Many of these variables are used only */
-const uschar *charptr; /* in small blocks of the code. My normal */
-#endif /* style of coding would have declared */
-const uschar *callpat; /* them within each of those blocks. */
-const uschar *data; /* However, in order to accommodate the */
-const uschar *next; /* version of this code that uses an */
-USPTR pp; /* external "stack" implemented on the */
-const uschar *prev; /* heap, it is easier to declare them all */
-USPTR saved_eptr; /* here, so the declarations can be cut */
- /* out in a block. The only declarations */
-recursion_info new_recursive; /* within blocks below are for variables */
- /* that do not have to be preserved over */
-BOOL cur_is_word; /* a recursive call to RMATCH(). */
-BOOL condition;
-BOOL prev_is_word;
-
-unsigned long int original_ims;
-
-#ifdef SUPPORT_UCP
-int prop_type;
-int prop_value;
-int prop_fail_result;
-int prop_category;
-int prop_chartype;
-int prop_script;
-int oclength;
-uschar occhars[8];
-#endif
-
-int ctype;
-int length;
-int max;
-int min;
-int number;
-int offset;
-int op;
-int save_capture_last;
-int save_offset1, save_offset2, save_offset3;
-int stacksave[REC_STACK_SAVE_MAX];
-
-eptrblock newptrb;
-#endif /* NO_RECURSE */
-
-/* These statements are here to stop the compiler complaining about unitialized
-variables. */
-
-#ifdef SUPPORT_UCP
-prop_value = 0;
-prop_fail_result = 0;
-#endif
-
-
-/* This label is used for tail recursion, which is used in a few cases even
-when NO_RECURSE is not defined, in order to reduce the amount of stack that is
-used. Thanks to Ian Taylor for noticing this possibility and sending the
-original patch. */
-
-TAIL_RECURSE:
-
-/* OK, now we can get on with the real code of the function. Recursive calls
-are specified by the macro RMATCH and RRETURN is used to return. When
-NO_RECURSE is *not* defined, these just turn into a recursive call to match()
-and a "return", respectively (possibly with some debugging if DEBUG is
-defined). However, RMATCH isn't like a function call because it's quite a
-complicated macro. It has to be used in one particular way. This shouldn't,
-however, impact performance when true recursion is being used. */
-
-#ifdef SUPPORT_UTF8
-utf8 = md->utf8; /* Local copy of the flag */
-#else
-utf8 = FALSE;
-#endif
-
-/* First check that we haven't called match() too many times, or that we
-haven't exceeded the recursive call limit. */
-
-if (md->match_call_count++ >= md->match_limit) RRETURN(PCRE_ERROR_MATCHLIMIT);
-if (rdepth >= md->match_limit_recursion) RRETURN(PCRE_ERROR_RECURSIONLIMIT);
-
-original_ims = ims; /* Save for resetting on ')' */
-
-/* At the start of a group with an unlimited repeat that may match an empty
-string, the match_cbegroup flag is set. When this is the case, add the current
-subject pointer to the chain of such remembered pointers, to be checked when we
-hit the closing ket, in order to break infinite loops that match no characters.
-When match() is called in other circumstances, don't add to the chain. The
-match_cbegroup flag must NOT be used with tail recursion, because the memory
-block that is used is on the stack, so a new one may be required for each
-match(). */
-
-if ((flags & match_cbegroup) != 0)
- {
- newptrb.epb_saved_eptr = eptr;
- newptrb.epb_prev = eptrb;
- eptrb = &newptrb;
- }
-
-/* Now start processing the opcodes. */
-
-for (;;)
- {
- minimize = possessive = FALSE;
- op = *ecode;
-
- /* For partial matching, remember if we ever hit the end of the subject after
- matching at least one subject character. */
-
- if (md->partial &&
- eptr >= md->end_subject &&
- eptr > mstart)
- md->hitend = TRUE;
-
- switch(op)
- {
- case OP_FAIL:
- RRETURN(MATCH_NOMATCH);
-
- case OP_PRUNE:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
- ims, eptrb, flags, RM51);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- RRETURN(MATCH_PRUNE);
-
- case OP_COMMIT:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
- ims, eptrb, flags, RM52);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- RRETURN(MATCH_COMMIT);
-
- case OP_SKIP:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
- ims, eptrb, flags, RM53);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- md->start_match_ptr = eptr; /* Pass back current position */
- RRETURN(MATCH_SKIP);
-
- case OP_THEN:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
- ims, eptrb, flags, RM54);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- RRETURN(MATCH_THEN);
-
- /* Handle a capturing bracket. If there is space in the offset vector, save
- the current subject position in the working slot at the top of the vector.
- We mustn't change the current values of the data slot, because they may be
- set from a previous iteration of this group, and be referred to by a
- reference inside the group.
-
- If the bracket fails to match, we need to restore this value and also the
- values of the final offsets, in case they were set by a previous iteration
- of the same bracket.
-
- If there isn't enough space in the offset vector, treat this as if it were
- a non-capturing bracket. Don't worry about setting the flag for the error
- case here; that is handled in the code for KET. */
-
- case OP_CBRA:
- case OP_SCBRA:
- number = GET2(ecode, 1+LINK_SIZE);
- offset = number << 1;
-
-#ifdef DEBUG
- printf("start bracket %d\n", number);
- printf("subject=");
- pchars(eptr, 16, TRUE, md);
- printf("\n");
-#endif
-
- if (offset < md->offset_max)
- {
- save_offset1 = md->offset_vector[offset];
- save_offset2 = md->offset_vector[offset+1];
- save_offset3 = md->offset_vector[md->offset_end - number];
- save_capture_last = md->capture_last;
-
- DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3));
- md->offset_vector[md->offset_end - number] = eptr - md->start_subject;
-
- flags = (op == OP_SCBRA)? match_cbegroup : 0;
- do
- {
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
- ims, eptrb, flags, RM1);
- if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
- md->capture_last = save_capture_last;
- ecode += GET(ecode, 1);
- }
- while (*ecode == OP_ALT);
-
- DPRINTF(("bracket %d failed\n", number));
-
- md->offset_vector[offset] = save_offset1;
- md->offset_vector[offset+1] = save_offset2;
- md->offset_vector[md->offset_end - number] = save_offset3;
-
- RRETURN(MATCH_NOMATCH);
- }
-
- /* FALL THROUGH ... Insufficient room for saving captured contents. Treat
- as a non-capturing bracket. */
-
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
-
- DPRINTF(("insufficient capture room: treat as non-capturing\n"));
-
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
-
- /* Non-capturing bracket. Loop for all the alternatives. When we get to the
- final alternative within the brackets, we would return the result of a
- recursive call to match() whatever happened. We can reduce stack usage by
- turning this into a tail recursion, except in the case when match_cbegroup
- is set.*/
-
- case OP_BRA:
- case OP_SBRA:
- DPRINTF(("start non-capturing bracket\n"));
- flags = (op >= OP_SBRA)? match_cbegroup : 0;
- for (;;)
- {
- if (ecode[GET(ecode, 1)] != OP_ALT) /* Final alternative */
- {
- if (flags == 0) /* Not a possibly empty group */
- {
- ecode += _pcre_OP_lengths[*ecode];
- DPRINTF(("bracket 0 tail recursion\n"));
- goto TAIL_RECURSE;
- }
-
- /* Possibly empty group; can't use tail recursion. */
-
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, ims,
- eptrb, flags, RM48);
- RRETURN(rrc);
- }
-
- /* For non-final alternatives, continue the loop for a NOMATCH result;
- otherwise return. */
-
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, ims,
- eptrb, flags, RM2);
- if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
- ecode += GET(ecode, 1);
- }
- /* Control never reaches here. */
-
- /* Conditional group: compilation checked that there are no more than
- two branches. If the condition is false, skipping the first branch takes us
- past the end if there is only one branch, but that's OK because that is
- exactly what going to the ket would do. As there is only one branch to be
- obeyed, we can use tail recursion to avoid using another stack frame. */
-
- case OP_COND:
- case OP_SCOND:
- if (ecode[LINK_SIZE+1] == OP_RREF) /* Recursion test */
- {
- offset = GET2(ecode, LINK_SIZE + 2); /* Recursion group number*/
- condition = md->recursive != NULL &&
- (offset == RREF_ANY || offset == md->recursive->group_num);
- ecode += condition? 3 : GET(ecode, 1);
- }
-
- else if (ecode[LINK_SIZE+1] == OP_CREF) /* Group used test */
- {
- offset = GET2(ecode, LINK_SIZE+2) << 1; /* Doubled ref number */
- condition = offset < offset_top && md->offset_vector[offset] >= 0;
- ecode += condition? 3 : GET(ecode, 1);
- }
-
- else if (ecode[LINK_SIZE+1] == OP_DEF) /* DEFINE - always false */
- {
- condition = FALSE;
- ecode += GET(ecode, 1);
- }
-
- /* The condition is an assertion. Call match() to evaluate it - setting
- the final argument match_condassert causes it to stop at the end of an
- assertion. */
-
- else
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL,
- match_condassert, RM3);
- if (rrc == MATCH_MATCH)
- {
- condition = TRUE;
- ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE + 2);
- while (*ecode == OP_ALT) ecode += GET(ecode, 1);
- }
- else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN)
- {
- RRETURN(rrc); /* Need braces because of following else */
- }
- else
- {
- condition = FALSE;
- ecode += GET(ecode, 1);
- }
- }
-
- /* We are now at the branch that is to be obeyed. As there is only one,
- we can use tail recursion to avoid using another stack frame, except when
- match_cbegroup is required for an unlimited repeat of a possibly empty
- group. If the second alternative doesn't exist, we can just plough on. */
-
- if (condition || *ecode == OP_ALT)
- {
- ecode += 1 + LINK_SIZE;
- if (op == OP_SCOND) /* Possibly empty group */
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, match_cbegroup, RM49);
- RRETURN(rrc);
- }
- else /* Group must match something */
- {
- flags = 0;
- goto TAIL_RECURSE;
- }
- }
- else /* Condition false & no 2nd alternative */
- {
- ecode += 1 + LINK_SIZE;
- }
- break;
-
-
- /* End of the pattern, either real or forced. If we are in a top-level
- recursion, we should restore the offsets appropriately and continue from
- after the call. */
-
- case OP_ACCEPT:
- case OP_END:
- if (md->recursive != NULL && md->recursive->group_num == 0)
- {
- recursion_info *rec = md->recursive;
- DPRINTF(("End of pattern in a (?0) recursion\n"));
- md->recursive = rec->prevrec;
- memmove(md->offset_vector, rec->offset_save,
- rec->saved_max * sizeof(int));
- mstart = rec->save_start;
- ims = original_ims;
- ecode = rec->after_call;
- break;
- }
-
- /* Otherwise, if PCRE_NOTEMPTY is set, fail if we have matched an empty
- string - backtracking will then try other alternatives, if any. */
-
- if (md->notempty && eptr == mstart) RRETURN(MATCH_NOMATCH);
- md->end_match_ptr = eptr; /* Record where we ended */
- md->end_offset_top = offset_top; /* and how many extracts were taken */
- md->start_match_ptr = mstart; /* and the start (\K can modify) */
- RRETURN(MATCH_MATCH);
-
- /* Change option settings */
-
- case OP_OPT:
- ims = ecode[1];
- ecode += 2;
- DPRINTF(("ims set to %02lx\n", ims));
- break;
-
- /* Assertion brackets. Check the alternative branches in turn - the
- matching won't pass the KET for an assertion. If any one branch matches,
- the assertion is true. Lookbehind assertions have an OP_REVERSE item at the
- start of each branch to move the current point backwards, so the code at
- this level is identical to the lookahead case. */
-
- case OP_ASSERT:
- case OP_ASSERTBACK:
- do
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0,
- RM4);
- if (rrc == MATCH_MATCH) break;
- if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
- ecode += GET(ecode, 1);
- }
- while (*ecode == OP_ALT);
- if (*ecode == OP_KET) RRETURN(MATCH_NOMATCH);
-
- /* If checking an assertion for a condition, return MATCH_MATCH. */
-
- if ((flags & match_condassert) != 0) RRETURN(MATCH_MATCH);
-
- /* Continue from after the assertion, updating the offsets high water
- mark, since extracts may have been taken during the assertion. */
-
- do ecode += GET(ecode,1); while (*ecode == OP_ALT);
- ecode += 1 + LINK_SIZE;
- offset_top = md->end_offset_top;
- continue;
-
- /* Negative assertion: all branches must fail to match */
-
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK_NOT:
- do
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0,
- RM5);
- if (rrc == MATCH_MATCH) RRETURN(MATCH_NOMATCH);
- if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
- ecode += GET(ecode,1);
- }
- while (*ecode == OP_ALT);
-
- if ((flags & match_condassert) != 0) RRETURN(MATCH_MATCH);
-
- ecode += 1 + LINK_SIZE;
- continue;
-
- /* Move the subject pointer back. This occurs only at the start of
- each branch of a lookbehind assertion. If we are too close to the start to
- move back, this match function fails. When working with UTF-8 we move
- back a number of characters, not bytes. */
-
- case OP_REVERSE:
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- i = GET(ecode, 1);
- while (i-- > 0)
- {
- eptr--;
- if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH);
- BACKCHAR(eptr);
- }
- }
- else
-#endif
-
- /* No UTF-8 support, or not in UTF-8 mode: count is byte count */
-
- {
- eptr -= GET(ecode, 1);
- if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH);
- }
-
- /* Skip to next op code */
-
- ecode += 1 + LINK_SIZE;
- break;
-
- /* The callout item calls an external function, if one is provided, passing
- details of the match so far. This is mainly for debugging, though the
- function is able to force a failure. */
-
- case OP_CALLOUT:
- if (pcre_callout != NULL)
- {
- pcre_callout_block cb;
- cb.version = 1; /* Version 1 of the callout block */
- cb.callout_number = ecode[1];
- cb.offset_vector = md->offset_vector;
- cb.subject = (PCRE_SPTR)md->start_subject;
- cb.subject_length = md->end_subject - md->start_subject;
- cb.start_match = mstart - md->start_subject;
- cb.current_position = eptr - md->start_subject;
- cb.pattern_position = GET(ecode, 2);
- cb.next_item_length = GET(ecode, 2 + LINK_SIZE);
- cb.capture_top = offset_top/2;
- cb.capture_last = md->capture_last;
- cb.callout_data = md->callout_data;
- if ((rrc = (*pcre_callout)(&cb)) > 0) RRETURN(MATCH_NOMATCH);
- if (rrc < 0) RRETURN(rrc);
- }
- ecode += 2 + 2*LINK_SIZE;
- break;
-
- /* Recursion either matches the current regex, or some subexpression. The
- offset data is the offset to the starting bracket from the start of the
- whole pattern. (This is so that it works from duplicated subpatterns.)
-
- If there are any capturing brackets started but not finished, we have to
- save their starting points and reinstate them after the recursion. However,
- we don't know how many such there are (offset_top records the completed
- total) so we just have to save all the potential data. There may be up to
- 65535 such values, which is too large to put on the stack, but using malloc
- for small numbers seems expensive. As a compromise, the stack is used when
- there are no more than REC_STACK_SAVE_MAX values to store; otherwise malloc
- is used. A problem is what to do if the malloc fails ... there is no way of
- returning to the top level with an error. Save the top REC_STACK_SAVE_MAX
- values on the stack, and accept that the rest may be wrong.
-
- There are also other values that have to be saved. We use a chained
- sequence of blocks that actually live on the stack. Thanks to Robin Houston
- for the original version of this logic. */
-
- case OP_RECURSE:
- {
- callpat = md->start_code + GET(ecode, 1);
- new_recursive.group_num = (callpat == md->start_code)? 0 :
- GET2(callpat, 1 + LINK_SIZE);
-
- /* Add to "recursing stack" */
-
- new_recursive.prevrec = md->recursive;
- md->recursive = &new_recursive;
-
- /* Find where to continue from afterwards */
-
- ecode += 1 + LINK_SIZE;
- new_recursive.after_call = ecode;
-
- /* Now save the offset data. */
-
- new_recursive.saved_max = md->offset_end;
- if (new_recursive.saved_max <= REC_STACK_SAVE_MAX)
- new_recursive.offset_save = stacksave;
- else
- {
- new_recursive.offset_save =
- (int *)(pcre_malloc)(new_recursive.saved_max * sizeof(int));
- if (new_recursive.offset_save == NULL) RRETURN(PCRE_ERROR_NOMEMORY);
- }
-
- memcpy(new_recursive.offset_save, md->offset_vector,
- new_recursive.saved_max * sizeof(int));
- new_recursive.save_start = mstart;
- mstart = eptr;
-
- /* OK, now we can do the recursion. For each top-level alternative we
- restore the offset and recursion data. */
-
- DPRINTF(("Recursing into group %d\n", new_recursive.group_num));
- flags = (*callpat >= OP_SBRA)? match_cbegroup : 0;
- do
- {
- RMATCH(eptr, callpat + _pcre_OP_lengths[*callpat], offset_top,
- md, ims, eptrb, flags, RM6);
- if (rrc == MATCH_MATCH)
- {
- DPRINTF(("Recursion matched\n"));
- md->recursive = new_recursive.prevrec;
- if (new_recursive.offset_save != stacksave)
- (pcre_free)(new_recursive.offset_save);
- RRETURN(MATCH_MATCH);
- }
- else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN)
- {
- DPRINTF(("Recursion gave error %d\n", rrc));
- RRETURN(rrc);
- }
-
- md->recursive = &new_recursive;
- memcpy(md->offset_vector, new_recursive.offset_save,
- new_recursive.saved_max * sizeof(int));
- callpat += GET(callpat, 1);
- }
- while (*callpat == OP_ALT);
-
- DPRINTF(("Recursion didn't match\n"));
- md->recursive = new_recursive.prevrec;
- if (new_recursive.offset_save != stacksave)
- (pcre_free)(new_recursive.offset_save);
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never reaches here */
-
- /* "Once" brackets are like assertion brackets except that after a match,
- the point in the subject string is not moved back. Thus there can never be
- a move back into the brackets. Friedl calls these "atomic" subpatterns.
- Check the alternative branches in turn - the matching won't pass the KET
- for this kind of subpattern. If any one branch matches, we carry on as at
- the end of a normal bracket, leaving the subject pointer. */
-
- case OP_ONCE:
- prev = ecode;
- saved_eptr = eptr;
-
- do
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM7);
- if (rrc == MATCH_MATCH) break;
- if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
- ecode += GET(ecode,1);
- }
- while (*ecode == OP_ALT);
-
- /* If hit the end of the group (which could be repeated), fail */
-
- if (*ecode != OP_ONCE && *ecode != OP_ALT) RRETURN(MATCH_NOMATCH);
-
- /* Continue as from after the assertion, updating the offsets high water
- mark, since extracts may have been taken. */
-
- do ecode += GET(ecode, 1); while (*ecode == OP_ALT);
-
- offset_top = md->end_offset_top;
- eptr = md->end_match_ptr;
-
- /* For a non-repeating ket, just continue at this level. This also
- happens for a repeating ket if no characters were matched in the group.
- This is the forcible breaking of infinite loops as implemented in Perl
- 5.005. If there is an options reset, it will get obeyed in the normal
- course of events. */
-
- if (*ecode == OP_KET || eptr == saved_eptr)
- {
- ecode += 1+LINK_SIZE;
- break;
- }
-
- /* The repeating kets try the rest of the pattern or restart from the
- preceding bracket, in the appropriate order. The second "call" of match()
- uses tail recursion, to avoid using another stack frame. We need to reset
- any options that changed within the bracket before re-running it, so
- check the next opcode. */
-
- if (ecode[1+LINK_SIZE] == OP_OPT)
- {
- ims = (ims & ~PCRE_IMS) | ecode[4];
- DPRINTF(("ims set to %02lx at group repeat\n", ims));
- }
-
- if (*ecode == OP_KETRMIN)
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM8);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode = prev;
- flags = 0;
- goto TAIL_RECURSE;
- }
- else /* OP_KETRMAX */
- {
- RMATCH(eptr, prev, offset_top, md, ims, eptrb, match_cbegroup, RM9);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode += 1 + LINK_SIZE;
- flags = 0;
- goto TAIL_RECURSE;
- }
- /* Control never gets here */
-
- /* An alternation is the end of a branch; scan along to find the end of the
- bracketed group and go to there. */
-
- case OP_ALT:
- do ecode += GET(ecode,1); while (*ecode == OP_ALT);
- break;
-
- /* BRAZERO, BRAMINZERO and SKIPZERO occur just before a bracket group,
- indicating that it may occur zero times. It may repeat infinitely, or not
- at all - i.e. it could be ()* or ()? or even (){0} in the pattern. Brackets
- with fixed upper repeat limits are compiled as a number of copies, with the
- optional ones preceded by BRAZERO or BRAMINZERO. */
-
- case OP_BRAZERO:
- {
- next = ecode+1;
- RMATCH(eptr, next, offset_top, md, ims, eptrb, 0, RM10);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- do next += GET(next,1); while (*next == OP_ALT);
- ecode = next + 1 + LINK_SIZE;
- }
- break;
-
- case OP_BRAMINZERO:
- {
- next = ecode+1;
- do next += GET(next, 1); while (*next == OP_ALT);
- RMATCH(eptr, next + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0, RM11);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode++;
- }
- break;
-
- case OP_SKIPZERO:
- {
- next = ecode+1;
- do next += GET(next,1); while (*next == OP_ALT);
- ecode = next + 1 + LINK_SIZE;
- }
- break;
-
- /* End of a group, repeated or non-repeating. */
-
- case OP_KET:
- case OP_KETRMIN:
- case OP_KETRMAX:
- prev = ecode - GET(ecode, 1);
-
- /* If this was a group that remembered the subject start, in order to break
- infinite repeats of empty string matches, retrieve the subject start from
- the chain. Otherwise, set it NULL. */
-
- if (*prev >= OP_SBRA)
- {
- saved_eptr = eptrb->epb_saved_eptr; /* Value at start of group */
- eptrb = eptrb->epb_prev; /* Backup to previous group */
- }
- else saved_eptr = NULL;
-
- /* If we are at the end of an assertion group, stop matching and return
- MATCH_MATCH, but record the current high water mark for use by positive
- assertions. Do this also for the "once" (atomic) groups. */
-
- if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT ||
- *prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT ||
- *prev == OP_ONCE)
- {
- md->end_match_ptr = eptr; /* For ONCE */
- md->end_offset_top = offset_top;
- RRETURN(MATCH_MATCH);
- }
-
- /* For capturing groups we have to check the group number back at the start
- and if necessary complete handling an extraction by setting the offsets and
- bumping the high water mark. Note that whole-pattern recursion is coded as
- a recurse into group 0, so it won't be picked up here. Instead, we catch it
- when the OP_END is reached. Other recursion is handled here. */
-
- if (*prev == OP_CBRA || *prev == OP_SCBRA)
- {
- number = GET2(prev, 1+LINK_SIZE);
- offset = number << 1;
-
-#ifdef DEBUG
- printf("end bracket %d", number);
- printf("\n");
-#endif
-
- md->capture_last = number;
- if (offset >= md->offset_max) md->offset_overflow = TRUE; else
- {
- md->offset_vector[offset] =
- md->offset_vector[md->offset_end - number];
- md->offset_vector[offset+1] = eptr - md->start_subject;
- if (offset_top <= offset) offset_top = offset + 2;
- }
-
- /* Handle a recursively called group. Restore the offsets
- appropriately and continue from after the call. */
-
- if (md->recursive != NULL && md->recursive->group_num == number)
- {
- recursion_info *rec = md->recursive;
- DPRINTF(("Recursion (%d) succeeded - continuing\n", number));
- md->recursive = rec->prevrec;
- mstart = rec->save_start;
- memcpy(md->offset_vector, rec->offset_save,
- rec->saved_max * sizeof(int));
- ecode = rec->after_call;
- ims = original_ims;
- break;
- }
- }
-
- /* For both capturing and non-capturing groups, reset the value of the ims
- flags, in case they got changed during the group. */
-
- ims = original_ims;
- DPRINTF(("ims reset to %02lx\n", ims));
-
- /* For a non-repeating ket, just continue at this level. This also
- happens for a repeating ket if no characters were matched in the group.
- This is the forcible breaking of infinite loops as implemented in Perl
- 5.005. If there is an options reset, it will get obeyed in the normal
- course of events. */
-
- if (*ecode == OP_KET || eptr == saved_eptr)
- {
- ecode += 1 + LINK_SIZE;
- break;
- }
-
- /* The repeating kets try the rest of the pattern or restart from the
- preceding bracket, in the appropriate order. In the second case, we can use
- tail recursion to avoid using another stack frame, unless we have an
- unlimited repeat of a group that can match an empty string. */
-
- flags = (*prev >= OP_SBRA)? match_cbegroup : 0;
-
- if (*ecode == OP_KETRMIN)
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM12);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (flags != 0) /* Could match an empty string */
- {
- RMATCH(eptr, prev, offset_top, md, ims, eptrb, flags, RM50);
- RRETURN(rrc);
- }
- ecode = prev;
- goto TAIL_RECURSE;
- }
- else /* OP_KETRMAX */
- {
- RMATCH(eptr, prev, offset_top, md, ims, eptrb, flags, RM13);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode += 1 + LINK_SIZE;
- flags = 0;
- goto TAIL_RECURSE;
- }
- /* Control never gets here */
-
- /* Start of subject unless notbol, or after internal newline if multiline */
-
- case OP_CIRC:
- if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH);
- if ((ims & PCRE_MULTILINE) != 0)
- {
- if (eptr != md->start_subject &&
- (eptr == md->end_subject || !WAS_NEWLINE(eptr)))
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
- }
- /* ... else fall through */
-
- /* Start of subject assertion */
-
- case OP_SOD:
- if (eptr != md->start_subject) RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- /* Start of match assertion */
-
- case OP_SOM:
- if (eptr != md->start_subject + md->start_offset) RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- /* Reset the start of match point */
-
- case OP_SET_SOM:
- mstart = eptr;
- ecode++;
- break;
-
- /* Assert before internal newline if multiline, or before a terminating
- newline unless endonly is set, else end of subject unless noteol is set. */
-
- case OP_DOLL:
- if ((ims & PCRE_MULTILINE) != 0)
- {
- if (eptr < md->end_subject)
- { if (!IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); }
- else
- { if (md->noteol) RRETURN(MATCH_NOMATCH); }
- ecode++;
- break;
- }
- else
- {
- if (md->noteol) RRETURN(MATCH_NOMATCH);
- if (!md->endonly)
- {
- if (eptr != md->end_subject &&
- (!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen))
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
- }
- }
- /* ... else fall through for endonly */
-
- /* End of subject assertion (\z) */
-
- case OP_EOD:
- if (eptr < md->end_subject) RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- /* End of subject or ending \n assertion (\Z) */
-
- case OP_EODN:
- if (eptr != md->end_subject &&
- (!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen))
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- /* Word boundary assertions */
-
- case OP_NOT_WORD_BOUNDARY:
- case OP_WORD_BOUNDARY:
- {
-
- /* Find out if the previous and current characters are "word" characters.
- It takes a bit more work in UTF-8 mode. Characters > 255 are assumed to
- be "non-word" characters. */
-
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- if (eptr == md->start_subject) prev_is_word = FALSE; else
- {
- const uschar *lastptr = eptr - 1;
- while((*lastptr & 0xc0) == 0x80) lastptr--;
- GETCHAR(c, lastptr);
- prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;
- }
- if (eptr >= md->end_subject) cur_is_word = FALSE; else
- {
- GETCHAR(c, eptr);
- cur_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;
- }
- }
- else
-#endif
-
- /* More streamlined when not in UTF-8 mode */
-
- {
- prev_is_word = (eptr != md->start_subject) &&
- ((md->ctypes[eptr[-1]] & ctype_word) != 0);
- cur_is_word = (eptr < md->end_subject) &&
- ((md->ctypes[*eptr] & ctype_word) != 0);
- }
-
- /* Now see if the situation is what we want */
-
- if ((*ecode++ == OP_WORD_BOUNDARY)?
- cur_is_word == prev_is_word : cur_is_word != prev_is_word)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- /* Match a single character type; inline for speed */
-
- case OP_ANY:
- if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH);
- /* Fall through */
-
- case OP_ALLANY:
- if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH);
- if (utf8) while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;
- ecode++;
- break;
-
- /* Match a single byte, even in UTF-8 mode. This opcode really does match
- any byte, even newline, independent of the setting of PCRE_DOTALL. */
-
- case OP_ANYBYTE:
- if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_NOT_DIGIT:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_UTF8
- c < 256 &&
-#endif
- (md->ctypes[c] & ctype_digit) != 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_DIGIT:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_UTF8
- c >= 256 ||
-#endif
- (md->ctypes[c] & ctype_digit) == 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_NOT_WHITESPACE:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_UTF8
- c < 256 &&
-#endif
- (md->ctypes[c] & ctype_space) != 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_WHITESPACE:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_UTF8
- c >= 256 ||
-#endif
- (md->ctypes[c] & ctype_space) == 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_NOT_WORDCHAR:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_UTF8
- c < 256 &&
-#endif
- (md->ctypes[c] & ctype_word) != 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_WORDCHAR:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_UTF8
- c >= 256 ||
-#endif
- (md->ctypes[c] & ctype_word) == 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_ANYNL:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x000d:
- if (eptr < md->end_subject && *eptr == 0x0a) eptr++;
- break;
-
- case 0x000a:
- break;
-
- case 0x000b:
- case 0x000c:
- case 0x0085:
- case 0x2028:
- case 0x2029:
- if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH);
- break;
- }
- ecode++;
- break;
-
- case OP_NOT_HSPACE:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- default: break;
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- case 0x1680: /* OGHAM SPACE MARK */
- case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */
- case 0x2000: /* EN QUAD */
- case 0x2001: /* EM QUAD */
- case 0x2002: /* EN SPACE */
- case 0x2003: /* EM SPACE */
- case 0x2004: /* THREE-PER-EM SPACE */
- case 0x2005: /* FOUR-PER-EM SPACE */
- case 0x2006: /* SIX-PER-EM SPACE */
- case 0x2007: /* FIGURE SPACE */
- case 0x2008: /* PUNCTUATION SPACE */
- case 0x2009: /* THIN SPACE */
- case 0x200A: /* HAIR SPACE */
- case 0x202f: /* NARROW NO-BREAK SPACE */
- case 0x205f: /* MEDIUM MATHEMATICAL SPACE */
- case 0x3000: /* IDEOGRAPHIC SPACE */
- RRETURN(MATCH_NOMATCH);
- }
- ecode++;
- break;
-
- case OP_HSPACE:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- case 0x1680: /* OGHAM SPACE MARK */
- case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */
- case 0x2000: /* EN QUAD */
- case 0x2001: /* EM QUAD */
- case 0x2002: /* EN SPACE */
- case 0x2003: /* EM SPACE */
- case 0x2004: /* THREE-PER-EM SPACE */
- case 0x2005: /* FOUR-PER-EM SPACE */
- case 0x2006: /* SIX-PER-EM SPACE */
- case 0x2007: /* FIGURE SPACE */
- case 0x2008: /* PUNCTUATION SPACE */
- case 0x2009: /* THIN SPACE */
- case 0x200A: /* HAIR SPACE */
- case 0x202f: /* NARROW NO-BREAK SPACE */
- case 0x205f: /* MEDIUM MATHEMATICAL SPACE */
- case 0x3000: /* IDEOGRAPHIC SPACE */
- break;
- }
- ecode++;
- break;
-
- case OP_NOT_VSPACE:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- default: break;
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- case 0x2028: /* LINE SEPARATOR */
- case 0x2029: /* PARAGRAPH SEPARATOR */
- RRETURN(MATCH_NOMATCH);
- }
- ecode++;
- break;
-
- case OP_VSPACE:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- case 0x2028: /* LINE SEPARATOR */
- case 0x2029: /* PARAGRAPH SEPARATOR */
- break;
- }
- ecode++;
- break;
-
-#ifdef SUPPORT_UCP
- /* Check the next character by Unicode property. We will get here only
- if the support is in the binary; otherwise a compile-time error occurs. */
-
- case OP_PROP:
- case OP_NOTPROP:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- {
- const ucd_record * prop = GET_UCD(c);
-
- switch(ecode[1])
- {
- case PT_ANY:
- if (op == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_LAMP:
- if ((prop->chartype == ucp_Lu ||
- prop->chartype == ucp_Ll ||
- prop->chartype == ucp_Lt) == (op == OP_NOTPROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_GC:
- if ((ecode[2] != _pcre_ucp_gentype[prop->chartype]) == (op == OP_PROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_PC:
- if ((ecode[2] != prop->chartype) == (op == OP_PROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_SC:
- if ((ecode[2] != prop->script) == (op == OP_PROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
-
- ecode += 3;
- }
- break;
-
- /* Match an extended Unicode sequence. We will get here only if the support
- is in the binary; otherwise a compile-time error occurs. */
-
- case OP_EXTUNI:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- {
- int category = UCD_CATEGORY(c);
- if (category == ucp_M) RRETURN(MATCH_NOMATCH);
- while (eptr < md->end_subject)
- {
- int len = 1;
- if (!utf8) c = *eptr; else
- {
- GETCHARLEN(c, eptr, len);
- }
- category = UCD_CATEGORY(c);
- if (category != ucp_M) break;
- eptr += len;
- }
- }
- ecode++;
- break;
-#endif
-
-
- /* Match a back reference, possibly repeatedly. Look past the end of the
- item to see if there is repeat information following. The code is similar
- to that for character classes, but repeated for efficiency. Then obey
- similar code to character type repeats - written out again for speed.
- However, if the referenced string is the empty string, always treat
- it as matched, any number of times (otherwise there could be infinite
- loops). */
-
- case OP_REF:
- {
- offset = GET2(ecode, 1) << 1; /* Doubled ref number */
- ecode += 3;
-
- /* If the reference is unset, there are two possibilities:
-
- (a) In the default, Perl-compatible state, set the length to be longer
- than the amount of subject left; this ensures that every attempt at a
- match fails. We can't just fail here, because of the possibility of
- quantifiers with zero minima.
-
- (b) If the JavaScript compatibility flag is set, set the length to zero
- so that the back reference matches an empty string.
-
- Otherwise, set the length to the length of what was matched by the
- referenced subpattern. */
-
- if (offset >= offset_top || md->offset_vector[offset] < 0)
- length = (md->jscript_compat)? 0 : md->end_subject - eptr + 1;
- else
- length = md->offset_vector[offset+1] - md->offset_vector[offset];
-
- /* Set up for repetition, or handle the non-repeated case */
-
- switch (*ecode)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- c = *ecode++ - OP_CRSTAR;
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- minimize = (*ecode == OP_CRMINRANGE);
- min = GET2(ecode, 1);
- max = GET2(ecode, 3);
- if (max == 0) max = INT_MAX;
- ecode += 5;
- break;
-
- default: /* No repeat follows */
- if (!match_ref(offset, eptr, length, md, ims)) RRETURN(MATCH_NOMATCH);
- eptr += length;
- continue; /* With the main loop */
- }
-
- /* If the length of the reference is zero, just continue with the
- main loop. */
-
- if (length == 0) continue;
-
- /* First, ensure the minimum number of matches are present. We get back
- the length of the reference string explicitly rather than passing the
- address of eptr, so that eptr can be a register variable. */
-
- for (i = 1; i <= min; i++)
- {
- if (!match_ref(offset, eptr, length, md, ims)) RRETURN(MATCH_NOMATCH);
- eptr += length;
- }
-
- /* If min = max, continue at the same level without recursion.
- They are not both allowed to be zero. */
-
- if (min == max) continue;
-
- /* If minimizing, keep trying and advancing the pointer */
-
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM14);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || !match_ref(offset, eptr, length, md, ims))
- RRETURN(MATCH_NOMATCH);
- eptr += length;
- }
- /* Control never gets here */
- }
-
- /* If maximizing, find the longest string and work backwards */
-
- else
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- if (!match_ref(offset, eptr, length, md, ims)) break;
- eptr += length;
- }
- while (eptr >= pp)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM15);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr -= length;
- }
- RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
-
-
-
- /* Match a bit-mapped character class, possibly repeatedly. This op code is
- used when all the characters in the class have values in the range 0-255,
- and either the matching is caseful, or the characters are in the range
- 0-127 when UTF-8 processing is enabled. The only difference between
- OP_CLASS and OP_NCLASS occurs when a data character outside the range is
- encountered.
-
- First, look past the end of the item to see if there is repeat information
- following. Then obey similar code to character type repeats - written out
- again for speed. */
-
- case OP_NCLASS:
- case OP_CLASS:
- {
- data = ecode + 1; /* Save for matching */
- ecode += 33; /* Advance past the item */
-
- switch (*ecode)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- c = *ecode++ - OP_CRSTAR;
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- minimize = (*ecode == OP_CRMINRANGE);
- min = GET2(ecode, 1);
- max = GET2(ecode, 3);
- if (max == 0) max = INT_MAX;
- ecode += 5;
- break;
-
- default: /* No repeat follows */
- min = max = 1;
- break;
- }
-
- /* First, ensure the minimum number of matches are present. */
-
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
- if (utf8)
- {
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- if (c > 255)
- {
- if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);
- }
- else
- {
- if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
- }
- }
- }
- else
-#endif
- /* Not UTF-8 mode */
- {
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- c = *eptr++;
- if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
- }
- }
-
- /* If max == min we can continue with the main loop without the
- need to recurse. */
-
- if (min == max) continue;
-
- /* If minimizing, keep testing the rest of the expression and advancing
- the pointer while it matches the class. */
-
- if (minimize)
- {
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
- if (utf8)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM16);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- if (c > 255)
- {
- if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);
- }
- else
- {
- if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
- }
- }
- }
- else
-#endif
- /* Not UTF-8 mode */
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM17);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- c = *eptr++;
- if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
- }
-
- /* If maximizing, find the longest possible run, then work backwards. */
-
- else
- {
- pp = eptr;
-
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
- if (utf8)
- {
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- if (c > 255)
- {
- if (op == OP_CLASS) break;
- }
- else
- {
- if ((data[c/8] & (1 << (c&7))) == 0) break;
- }
- eptr += len;
- }
- for (;;)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM18);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
- BACKCHAR(eptr);
- }
- }
- else
-#endif
- /* Not UTF-8 mode */
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject) break;
- c = *eptr;
- if ((data[c/8] & (1 << (c&7))) == 0) break;
- eptr++;
- }
- while (eptr >= pp)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM19);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- }
- }
-
- RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
-
-
- /* Match an extended character class. This opcode is encountered only
- in UTF-8 mode, because that's the only time it is compiled. */
-
-#ifdef SUPPORT_UTF8
- case OP_XCLASS:
- {
- data = ecode + 1 + LINK_SIZE; /* Save for matching */
- ecode += GET(ecode, 1); /* Advance past the item */
-
- switch (*ecode)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- c = *ecode++ - OP_CRSTAR;
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- minimize = (*ecode == OP_CRMINRANGE);
- min = GET2(ecode, 1);
- max = GET2(ecode, 3);
- if (max == 0) max = INT_MAX;
- ecode += 5;
- break;
-
- default: /* No repeat follows */
- min = max = 1;
- break;
- }
-
- /* First, ensure the minimum number of matches are present. */
-
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- if (!_pcre_xclass(c, data)) RRETURN(MATCH_NOMATCH);
- }
-
- /* If max == min we can continue with the main loop without the
- need to recurse. */
-
- if (min == max) continue;
-
- /* If minimizing, keep testing the rest of the expression and advancing
- the pointer while it matches the class. */
-
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM20);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- if (!_pcre_xclass(c, data)) RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
- }
-
- /* If maximizing, find the longest possible run, then work backwards. */
-
- else
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- if (!_pcre_xclass(c, data)) break;
- eptr += len;
- }
- for(;;)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM21);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
- if (utf8) BACKCHAR(eptr);
- }
- RRETURN(MATCH_NOMATCH);
- }
-
- /* Control never gets here */
- }
-#endif /* End of XCLASS */
-
- /* Match a single character, casefully */
-
- case OP_CHAR:
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- length = 1;
- ecode++;
- GETCHARLEN(fc, ecode, length);
- if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);
- while (length-- > 0) if (*ecode++ != *eptr++) RRETURN(MATCH_NOMATCH);
- }
- else
-#endif
-
- /* Non-UTF-8 mode */
- {
- if (md->end_subject - eptr < 1) RRETURN(MATCH_NOMATCH);
- if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH);
- ecode += 2;
- }
- break;
-
- /* Match a single character, caselessly */
-
- case OP_CHARNC:
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- length = 1;
- ecode++;
- GETCHARLEN(fc, ecode, length);
-
- if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);
-
- /* If the pattern character's value is < 128, we have only one byte, and
- can use the fast lookup table. */
-
- if (fc < 128)
- {
- if (md->lcc[*ecode++] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);
- }
-
- /* Otherwise we must pick up the subject character */
-
- else
- {
- unsigned int dc;
- GETCHARINC(dc, eptr);
- ecode += length;
-
- /* If we have Unicode property support, we can use it to test the other
- case of the character, if there is one. */
-
- if (fc != dc)
- {
-#ifdef SUPPORT_UCP
- if (dc != UCD_OTHERCASE(fc))
-#endif
- RRETURN(MATCH_NOMATCH);
- }
- }
- }
- else
-#endif /* SUPPORT_UTF8 */
-
- /* Non-UTF-8 mode */
- {
- if (md->end_subject - eptr < 1) RRETURN(MATCH_NOMATCH);
- if (md->lcc[ecode[1]] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);
- ecode += 2;
- }
- break;
-
- /* Match a single character repeatedly. */
-
- case OP_EXACT:
- min = max = GET2(ecode, 1);
- ecode += 3;
- goto REPEATCHAR;
-
- case OP_POSUPTO:
- possessive = TRUE;
- /* Fall through */
-
- case OP_UPTO:
- case OP_MINUPTO:
- min = 0;
- max = GET2(ecode, 1);
- minimize = *ecode == OP_MINUPTO;
- ecode += 3;
- goto REPEATCHAR;
-
- case OP_POSSTAR:
- possessive = TRUE;
- min = 0;
- max = INT_MAX;
- ecode++;
- goto REPEATCHAR;
-
- case OP_POSPLUS:
- possessive = TRUE;
- min = 1;
- max = INT_MAX;
- ecode++;
- goto REPEATCHAR;
-
- case OP_POSQUERY:
- possessive = TRUE;
- min = 0;
- max = 1;
- ecode++;
- goto REPEATCHAR;
-
- case OP_STAR:
- case OP_MINSTAR:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_QUERY:
- case OP_MINQUERY:
- c = *ecode++ - OP_STAR;
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
-
- /* Common code for all repeated single-character matches. We can give
- up quickly if there are fewer than the minimum number of characters left in
- the subject. */
-
- REPEATCHAR:
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- length = 1;
- charptr = ecode;
- GETCHARLEN(fc, ecode, length);
- if (min * length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);
- ecode += length;
-
- /* Handle multibyte character matching specially here. There is
- support for caseless matching if UCP support is present. */
-
- if (length > 1)
- {
-#ifdef SUPPORT_UCP
- unsigned int othercase;
- if ((ims & PCRE_CASELESS) != 0 &&
- (othercase = UCD_OTHERCASE(fc)) != fc)
- oclength = _pcre_ord2utf8(othercase, occhars);
- else oclength = 0;
-#endif /* SUPPORT_UCP */
-
- for (i = 1; i <= min; i++)
- {
- if (memcmp(eptr, charptr, length) == 0) eptr += length;
-#ifdef SUPPORT_UCP
- /* Need braces because of following else */
- else if (oclength == 0) { RRETURN(MATCH_NOMATCH); }
- else
- {
- if (memcmp(eptr, occhars, oclength) != 0) RRETURN(MATCH_NOMATCH);
- eptr += oclength;
- }
-#else /* without SUPPORT_UCP */
- else { RRETURN(MATCH_NOMATCH); }
-#endif /* SUPPORT_UCP */
- }
-
- if (min == max) continue;
-
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM22);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- if (memcmp(eptr, charptr, length) == 0) eptr += length;
-#ifdef SUPPORT_UCP
- /* Need braces because of following else */
- else if (oclength == 0) { RRETURN(MATCH_NOMATCH); }
- else
- {
- if (memcmp(eptr, occhars, oclength) != 0) RRETURN(MATCH_NOMATCH);
- eptr += oclength;
- }
-#else /* without SUPPORT_UCP */
- else { RRETURN (MATCH_NOMATCH); }
-#endif /* SUPPORT_UCP */
- }
- /* Control never gets here */
- }
-
- else /* Maximize */
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- if (eptr > md->end_subject - length) break;
- if (memcmp(eptr, charptr, length) == 0) eptr += length;
-#ifdef SUPPORT_UCP
- else if (oclength == 0) break;
- else
- {
- if (memcmp(eptr, occhars, oclength) != 0) break;
- eptr += oclength;
- }
-#else /* without SUPPORT_UCP */
- else break;
-#endif /* SUPPORT_UCP */
- }
-
- if (possessive) continue;
- for(;;)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM23);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr == pp) RRETURN(MATCH_NOMATCH);
-#ifdef SUPPORT_UCP
- eptr--;
- BACKCHAR(eptr);
-#else /* without SUPPORT_UCP */
- eptr -= length;
-#endif /* SUPPORT_UCP */
- }
- }
- /* Control never gets here */
- }
-
- /* If the length of a UTF-8 character is 1, we fall through here, and
- obey the code as for non-UTF-8 characters below, though in this case the
- value of fc will always be < 128. */
- }
- else
-#endif /* SUPPORT_UTF8 */
-
- /* When not in UTF-8 mode, load a single-byte character. */
- {
- if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);
- fc = *ecode++;
- }
-
- /* The value of fc at this point is always less than 256, though we may or
- may not be in UTF-8 mode. The code is duplicated for the caseless and
- caseful cases, for speed, since matching characters is likely to be quite
- common. First, ensure the minimum number of matches are present. If min =
- max, continue at the same level without recursing. Otherwise, if
- minimizing, keep trying the rest of the expression and advancing one
- matching character if failing, up to the maximum. Alternatively, if
- maximizing, find the maximum number of characters and work backwards. */
-
- DPRINTF(("matching %c{%d,%d} against subject %.*s\n", fc, min, max,
- max, eptr));
-
- if ((ims & PCRE_CASELESS) != 0)
- {
- fc = md->lcc[fc];
- for (i = 1; i <= min; i++)
- if (fc != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);
- if (min == max) continue;
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM24);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject ||
- fc != md->lcc[*eptr++])
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
- }
- else /* Maximize */
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || fc != md->lcc[*eptr]) break;
- eptr++;
- }
- if (possessive) continue;
- while (eptr >= pp)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM25);
- eptr--;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- }
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
- }
-
- /* Caseful comparisons (includes all multi-byte characters) */
-
- else
- {
- for (i = 1; i <= min; i++) if (fc != *eptr++) RRETURN(MATCH_NOMATCH);
- if (min == max) continue;
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM26);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject || fc != *eptr++)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
- }
- else /* Maximize */
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || fc != *eptr) break;
- eptr++;
- }
- if (possessive) continue;
- while (eptr >= pp)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM27);
- eptr--;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- }
- RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
-
- /* Match a negated single one-byte character. The character we are
- checking can be multibyte. */
-
- case OP_NOT:
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- ecode++;
- GETCHARINCTEST(c, eptr);
- if ((ims & PCRE_CASELESS) != 0)
- {
-#ifdef SUPPORT_UTF8
- if (c < 256)
-#endif
- c = md->lcc[c];
- if (md->lcc[*ecode++] == c) RRETURN(MATCH_NOMATCH);
- }
- else
- {
- if (*ecode++ == c) RRETURN(MATCH_NOMATCH);
- }
- break;
-
- /* Match a negated single one-byte character repeatedly. This is almost a
- repeat of the code for a repeated single character, but I haven't found a
- nice way of commoning these up that doesn't require a test of the
- positive/negative option for each character match. Maybe that wouldn't add
- very much to the time taken, but character matching *is* what this is all
- about... */
-
- case OP_NOTEXACT:
- min = max = GET2(ecode, 1);
- ecode += 3;
- goto REPEATNOTCHAR;
-
- case OP_NOTUPTO:
- case OP_NOTMINUPTO:
- min = 0;
- max = GET2(ecode, 1);
- minimize = *ecode == OP_NOTMINUPTO;
- ecode += 3;
- goto REPEATNOTCHAR;
-
- case OP_NOTPOSSTAR:
- possessive = TRUE;
- min = 0;
- max = INT_MAX;
- ecode++;
- goto REPEATNOTCHAR;
-
- case OP_NOTPOSPLUS:
- possessive = TRUE;
- min = 1;
- max = INT_MAX;
- ecode++;
- goto REPEATNOTCHAR;
-
- case OP_NOTPOSQUERY:
- possessive = TRUE;
- min = 0;
- max = 1;
- ecode++;
- goto REPEATNOTCHAR;
-
- case OP_NOTPOSUPTO:
- possessive = TRUE;
- min = 0;
- max = GET2(ecode, 1);
- ecode += 3;
- goto REPEATNOTCHAR;
-
- case OP_NOTSTAR:
- case OP_NOTMINSTAR:
- case OP_NOTPLUS:
- case OP_NOTMINPLUS:
- case OP_NOTQUERY:
- case OP_NOTMINQUERY:
- c = *ecode++ - OP_NOTSTAR;
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
-
- /* Common code for all repeated single-byte matches. We can give up quickly
- if there are fewer than the minimum number of bytes left in the
- subject. */
-
- REPEATNOTCHAR:
- if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);
- fc = *ecode++;
-
- /* The code is duplicated for the caseless and caseful cases, for speed,
- since matching characters is likely to be quite common. First, ensure the
- minimum number of matches are present. If min = max, continue at the same
- level without recursing. Otherwise, if minimizing, keep trying the rest of
- the expression and advancing one matching character if failing, up to the
- maximum. Alternatively, if maximizing, find the maximum number of
- characters and work backwards. */
-
- DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", fc, min, max,
- max, eptr));
-
- if ((ims & PCRE_CASELESS) != 0)
- {
- fc = md->lcc[fc];
-
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
- if (utf8)
- {
- register unsigned int d;
- for (i = 1; i <= min; i++)
- {
- GETCHARINC(d, eptr);
- if (d < 256) d = md->lcc[d];
- if (fc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif
-
- /* Not UTF-8 mode */
- {
- for (i = 1; i <= min; i++)
- if (fc == md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);
- }
-
- if (min == max) continue;
-
- if (minimize)
- {
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
- if (utf8)
- {
- register unsigned int d;
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(d, eptr);
- if (d < 256) d = md->lcc[d];
- if (fc == d) RRETURN(MATCH_NOMATCH);
-
- }
- }
- else
-#endif
- /* Not UTF-8 mode */
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM29);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject || fc == md->lcc[*eptr++])
- RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
- }
-
- /* Maximize case */
-
- else
- {
- pp = eptr;
-
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
- if (utf8)
- {
- register unsigned int d;
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(d, eptr, len);
- if (d < 256) d = md->lcc[d];
- if (fc == d) break;
- eptr += len;
- }
- if (possessive) continue;
- for(;;)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM30);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
- BACKCHAR(eptr);
- }
- }
- else
-#endif
- /* Not UTF-8 mode */
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || fc == md->lcc[*eptr]) break;
- eptr++;
- }
- if (possessive) continue;
- while (eptr >= pp)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM31);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- }
- }
-
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
- }
-
- /* Caseful comparisons */
-
- else
- {
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
- if (utf8)
- {
- register unsigned int d;
- for (i = 1; i <= min; i++)
- {
- GETCHARINC(d, eptr);
- if (fc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif
- /* Not UTF-8 mode */
- {
- for (i = 1; i <= min; i++)
- if (fc == *eptr++) RRETURN(MATCH_NOMATCH);
- }
-
- if (min == max) continue;
-
- if (minimize)
- {
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
- if (utf8)
- {
- register unsigned int d;
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(d, eptr);
- if (fc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif
- /* Not UTF-8 mode */
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM33);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject || fc == *eptr++)
- RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
- }
-
- /* Maximize case */
-
- else
- {
- pp = eptr;
-
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
- if (utf8)
- {
- register unsigned int d;
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(d, eptr, len);
- if (fc == d) break;
- eptr += len;
- }
- if (possessive) continue;
- for(;;)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM34);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
- BACKCHAR(eptr);
- }
- }
- else
-#endif
- /* Not UTF-8 mode */
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || fc == *eptr) break;
- eptr++;
- }
- if (possessive) continue;
- while (eptr >= pp)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM35);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- }
- }
-
- RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
-
- /* Match a single character type repeatedly; several different opcodes
- share code. This is very similar to the code for single characters, but we
- repeat it in the interests of efficiency. */
-
- case OP_TYPEEXACT:
- min = max = GET2(ecode, 1);
- minimize = TRUE;
- ecode += 3;
- goto REPEATTYPE;
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- min = 0;
- max = GET2(ecode, 1);
- minimize = *ecode == OP_TYPEMINUPTO;
- ecode += 3;
- goto REPEATTYPE;
-
- case OP_TYPEPOSSTAR:
- possessive = TRUE;
- min = 0;
- max = INT_MAX;
- ecode++;
- goto REPEATTYPE;
-
- case OP_TYPEPOSPLUS:
- possessive = TRUE;
- min = 1;
- max = INT_MAX;
- ecode++;
- goto REPEATTYPE;
-
- case OP_TYPEPOSQUERY:
- possessive = TRUE;
- min = 0;
- max = 1;
- ecode++;
- goto REPEATTYPE;
-
- case OP_TYPEPOSUPTO:
- possessive = TRUE;
- min = 0;
- max = GET2(ecode, 1);
- ecode += 3;
- goto REPEATTYPE;
-
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- c = *ecode++ - OP_TYPESTAR;
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
-
- /* Common code for all repeated single character type matches. Note that
- in UTF-8 mode, '.' matches a character of any length, but for the other
- character types, the valid characters are all one-byte long. */
-
- REPEATTYPE:
- ctype = *ecode++; /* Code for the character type */
-
-#ifdef SUPPORT_UCP
- if (ctype == OP_PROP || ctype == OP_NOTPROP)
- {
- prop_fail_result = ctype == OP_NOTPROP;
- prop_type = *ecode++;
- prop_value = *ecode++;
- }
- else prop_type = -1;
-#endif
-
- /* First, ensure the minimum number of matches are present. Use inline
- code for maximizing the speed, and do the type test once at the start
- (i.e. keep it out of the loop). Also we can test that there are at least
- the minimum number of bytes before we start. This isn't as effective in
- UTF-8 mode, but it does no harm. Separate the UTF-8 code completely as that
- is tidier. Also separate the UCP code, which can be the same for both UTF-8
- and single-bytes. */
-
- if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);
- if (min > 0)
- {
-#ifdef SUPPORT_UCP
- if (prop_type >= 0)
- {
- switch(prop_type)
- {
- case PT_ANY:
- if (prop_fail_result) RRETURN(MATCH_NOMATCH);
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- }
- break;
-
- case PT_LAMP:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- prop_chartype = UCD_CHARTYPE(c);
- if ((prop_chartype == ucp_Lu ||
- prop_chartype == ucp_Ll ||
- prop_chartype == ucp_Lt) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case PT_GC:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- prop_category = UCD_CATEGORY(c);
- if ((prop_category == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case PT_PC:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- prop_chartype = UCD_CHARTYPE(c);
- if ((prop_chartype == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case PT_SC:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- prop_script = UCD_SCRIPT(c);
- if ((prop_script == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
- }
-
- /* Match extended Unicode sequences. We will get here only if the
- support is in the binary; otherwise a compile-time error occurs. */
-
- else if (ctype == OP_EXTUNI)
- {
- for (i = 1; i <= min; i++)
- {
- GETCHARINCTEST(c, eptr);
- prop_category = UCD_CATEGORY(c);
- if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH);
- while (eptr < md->end_subject)
- {
- int len = 1;
- if (!utf8) c = *eptr; else
- {
- GETCHARLEN(c, eptr, len);
- }
- prop_category = UCD_CATEGORY(c);
- if (prop_category != ucp_M) break;
- eptr += len;
- }
- }
- }
-
- else
-#endif /* SUPPORT_UCP */
-
-/* Handle all other cases when the coding is UTF-8 */
-
-#ifdef SUPPORT_UTF8
- if (utf8) switch(ctype)
- {
- case OP_ANY:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject || IS_NEWLINE(eptr))
- RRETURN(MATCH_NOMATCH);
- eptr++;
- while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;
- }
- break;
-
- case OP_ALLANY:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- eptr++;
- while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;
- }
- break;
-
- case OP_ANYBYTE:
- eptr += min;
- break;
-
- case OP_ANYNL:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x000d:
- if (eptr < md->end_subject && *eptr == 0x0a) eptr++;
- break;
-
- case 0x000a:
- break;
-
- case 0x000b:
- case 0x000c:
- case 0x0085:
- case 0x2028:
- case 0x2029:
- if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH);
- break;
- }
- }
- break;
-
- case OP_NOT_HSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- switch(c)
- {
- default: break;
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- case 0x1680: /* OGHAM SPACE MARK */
- case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */
- case 0x2000: /* EN QUAD */
- case 0x2001: /* EM QUAD */
- case 0x2002: /* EN SPACE */
- case 0x2003: /* EM SPACE */
- case 0x2004: /* THREE-PER-EM SPACE */
- case 0x2005: /* FOUR-PER-EM SPACE */
- case 0x2006: /* SIX-PER-EM SPACE */
- case 0x2007: /* FIGURE SPACE */
- case 0x2008: /* PUNCTUATION SPACE */
- case 0x2009: /* THIN SPACE */
- case 0x200A: /* HAIR SPACE */
- case 0x202f: /* NARROW NO-BREAK SPACE */
- case 0x205f: /* MEDIUM MATHEMATICAL SPACE */
- case 0x3000: /* IDEOGRAPHIC SPACE */
- RRETURN(MATCH_NOMATCH);
- }
- }
- break;
-
- case OP_HSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- case 0x1680: /* OGHAM SPACE MARK */
- case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */
- case 0x2000: /* EN QUAD */
- case 0x2001: /* EM QUAD */
- case 0x2002: /* EN SPACE */
- case 0x2003: /* EM SPACE */
- case 0x2004: /* THREE-PER-EM SPACE */
- case 0x2005: /* FOUR-PER-EM SPACE */
- case 0x2006: /* SIX-PER-EM SPACE */
- case 0x2007: /* FIGURE SPACE */
- case 0x2008: /* PUNCTUATION SPACE */
- case 0x2009: /* THIN SPACE */
- case 0x200A: /* HAIR SPACE */
- case 0x202f: /* NARROW NO-BREAK SPACE */
- case 0x205f: /* MEDIUM MATHEMATICAL SPACE */
- case 0x3000: /* IDEOGRAPHIC SPACE */
- break;
- }
- }
- break;
-
- case OP_NOT_VSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- switch(c)
- {
- default: break;
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- case 0x2028: /* LINE SEPARATOR */
- case 0x2029: /* PARAGRAPH SEPARATOR */
- RRETURN(MATCH_NOMATCH);
- }
- }
- break;
-
- case OP_VSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- case 0x2028: /* LINE SEPARATOR */
- case 0x2029: /* PARAGRAPH SEPARATOR */
- break;
- }
- }
- break;
-
- case OP_NOT_DIGIT:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- if (c < 128 && (md->ctypes[c] & ctype_digit) != 0)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case OP_DIGIT:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject ||
- *eptr >= 128 || (md->ctypes[*eptr++] & ctype_digit) == 0)
- RRETURN(MATCH_NOMATCH);
- /* No need to skip more bytes - we know it's a 1-byte character */
- }
- break;
-
- case OP_NOT_WHITESPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject ||
- (*eptr < 128 && (md->ctypes[*eptr] & ctype_space) != 0))
- RRETURN(MATCH_NOMATCH);
- while (++eptr < md->end_subject && (*eptr & 0xc0) == 0x80);
- }
- break;
-
- case OP_WHITESPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject ||
- *eptr >= 128 || (md->ctypes[*eptr++] & ctype_space) == 0)
- RRETURN(MATCH_NOMATCH);
- /* No need to skip more bytes - we know it's a 1-byte character */
- }
- break;
-
- case OP_NOT_WORDCHAR:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject ||
- (*eptr < 128 && (md->ctypes[*eptr] & ctype_word) != 0))
- RRETURN(MATCH_NOMATCH);
- while (++eptr < md->end_subject && (*eptr & 0xc0) == 0x80);
- }
- break;
-
- case OP_WORDCHAR:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject ||
- *eptr >= 128 || (md->ctypes[*eptr++] & ctype_word) == 0)
- RRETURN(MATCH_NOMATCH);
- /* No need to skip more bytes - we know it's a 1-byte character */
- }
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- } /* End switch(ctype) */
-
- else
-#endif /* SUPPORT_UTF8 */
-
- /* Code for the non-UTF-8 case for minimum matching of operators other
- than OP_PROP and OP_NOTPROP. We can assume that there are the minimum
- number of bytes present, as this was tested above. */
-
- switch(ctype)
- {
- case OP_ANY:
- for (i = 1; i <= min; i++)
- {
- if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- break;
-
- case OP_ALLANY:
- eptr += min;
- break;
-
- case OP_ANYBYTE:
- eptr += min;
- break;
-
- /* Because of the CRLF case, we can't assume the minimum number of
- bytes are present in this case. */
-
- case OP_ANYNL:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- switch(*eptr++)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x000d:
- if (eptr < md->end_subject && *eptr == 0x0a) eptr++;
- break;
- case 0x000a:
- break;
-
- case 0x000b:
- case 0x000c:
- case 0x0085:
- if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH);
- break;
- }
- }
- break;
-
- case OP_NOT_HSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- switch(*eptr++)
- {
- default: break;
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- RRETURN(MATCH_NOMATCH);
- }
- }
- break;
-
- case OP_HSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- switch(*eptr++)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- break;
- }
- }
- break;
-
- case OP_NOT_VSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- switch(*eptr++)
- {
- default: break;
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- RRETURN(MATCH_NOMATCH);
- }
- }
- break;
-
- case OP_VSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- switch(*eptr++)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- break;
- }
- }
- break;
-
- case OP_NOT_DIGIT:
- for (i = 1; i <= min; i++)
- if ((md->ctypes[*eptr++] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_DIGIT:
- for (i = 1; i <= min; i++)
- if ((md->ctypes[*eptr++] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_NOT_WHITESPACE:
- for (i = 1; i <= min; i++)
- if ((md->ctypes[*eptr++] & ctype_space) != 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_WHITESPACE:
- for (i = 1; i <= min; i++)
- if ((md->ctypes[*eptr++] & ctype_space) == 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_NOT_WORDCHAR:
- for (i = 1; i <= min; i++)
- if ((md->ctypes[*eptr++] & ctype_word) != 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_WORDCHAR:
- for (i = 1; i <= min; i++)
- if ((md->ctypes[*eptr++] & ctype_word) == 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
- }
-
- /* If min = max, continue at the same level without recursing */
-
- if (min == max) continue;
-
- /* If minimizing, we have to test the rest of the pattern before each
- subsequent match. Again, separate the UTF-8 case for speed, and also
- separate the UCP cases. */
-
- if (minimize)
- {
-#ifdef SUPPORT_UCP
- if (prop_type >= 0)
- {
- switch(prop_type)
- {
- case PT_ANY:
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM36);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- if (prop_fail_result) RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- case PT_LAMP:
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM37);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- prop_chartype = UCD_CHARTYPE(c);
- if ((prop_chartype == ucp_Lu ||
- prop_chartype == ucp_Ll ||
- prop_chartype == ucp_Lt) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- case PT_GC:
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM38);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- prop_category = UCD_CATEGORY(c);
- if ((prop_category == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- case PT_PC:
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- prop_chartype = UCD_CHARTYPE(c);
- if ((prop_chartype == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- case PT_SC:
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM40);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- prop_script = UCD_SCRIPT(c);
- if ((prop_script == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
- }
-
- /* Match extended Unicode sequences. We will get here only if the
- support is in the binary; otherwise a compile-time error occurs. */
-
- else if (ctype == OP_EXTUNI)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM41);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
- GETCHARINCTEST(c, eptr);
- prop_category = UCD_CATEGORY(c);
- if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH);
- while (eptr < md->end_subject)
- {
- int len = 1;
- if (!utf8) c = *eptr; else
- {
- GETCHARLEN(c, eptr, len);
- }
- prop_category = UCD_CATEGORY(c);
- if (prop_category != ucp_M) break;
- eptr += len;
- }
- }
- }
-
- else
-#endif /* SUPPORT_UCP */
-
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
- if (utf8)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM42);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject ||
- (ctype == OP_ANY && IS_NEWLINE(eptr)))
- RRETURN(MATCH_NOMATCH);
-
- GETCHARINC(c, eptr);
- switch(ctype)
- {
- case OP_ANY: /* This is the non-NL case */
- case OP_ALLANY:
- case OP_ANYBYTE:
- break;
-
- case OP_ANYNL:
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x000d:
- if (eptr < md->end_subject && *eptr == 0x0a) eptr++;
- break;
- case 0x000a:
- break;
-
- case 0x000b:
- case 0x000c:
- case 0x0085:
- case 0x2028:
- case 0x2029:
- if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH);
- break;
- }
- break;
-
- case OP_NOT_HSPACE:
- switch(c)
- {
- default: break;
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- case 0x1680: /* OGHAM SPACE MARK */
- case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */
- case 0x2000: /* EN QUAD */
- case 0x2001: /* EM QUAD */
- case 0x2002: /* EN SPACE */
- case 0x2003: /* EM SPACE */
- case 0x2004: /* THREE-PER-EM SPACE */
- case 0x2005: /* FOUR-PER-EM SPACE */
- case 0x2006: /* SIX-PER-EM SPACE */
- case 0x2007: /* FIGURE SPACE */
- case 0x2008: /* PUNCTUATION SPACE */
- case 0x2009: /* THIN SPACE */
- case 0x200A: /* HAIR SPACE */
- case 0x202f: /* NARROW NO-BREAK SPACE */
- case 0x205f: /* MEDIUM MATHEMATICAL SPACE */
- case 0x3000: /* IDEOGRAPHIC SPACE */
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case OP_HSPACE:
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- case 0x1680: /* OGHAM SPACE MARK */
- case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */
- case 0x2000: /* EN QUAD */
- case 0x2001: /* EM QUAD */
- case 0x2002: /* EN SPACE */
- case 0x2003: /* EM SPACE */
- case 0x2004: /* THREE-PER-EM SPACE */
- case 0x2005: /* FOUR-PER-EM SPACE */
- case 0x2006: /* SIX-PER-EM SPACE */
- case 0x2007: /* FIGURE SPACE */
- case 0x2008: /* PUNCTUATION SPACE */
- case 0x2009: /* THIN SPACE */
- case 0x200A: /* HAIR SPACE */
- case 0x202f: /* NARROW NO-BREAK SPACE */
- case 0x205f: /* MEDIUM MATHEMATICAL SPACE */
- case 0x3000: /* IDEOGRAPHIC SPACE */
- break;
- }
- break;
-
- case OP_NOT_VSPACE:
- switch(c)
- {
- default: break;
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- case 0x2028: /* LINE SEPARATOR */
- case 0x2029: /* PARAGRAPH SEPARATOR */
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case OP_VSPACE:
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- case 0x2028: /* LINE SEPARATOR */
- case 0x2029: /* PARAGRAPH SEPARATOR */
- break;
- }
- break;
-
- case OP_NOT_DIGIT:
- if (c < 256 && (md->ctypes[c] & ctype_digit) != 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_DIGIT:
- if (c >= 256 || (md->ctypes[c] & ctype_digit) == 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_NOT_WHITESPACE:
- if (c < 256 && (md->ctypes[c] & ctype_space) != 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_WHITESPACE:
- if (c >= 256 || (md->ctypes[c] & ctype_space) == 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_NOT_WORDCHAR:
- if (c < 256 && (md->ctypes[c] & ctype_word) != 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_WORDCHAR:
- if (c >= 256 || (md->ctypes[c] & ctype_word) == 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
- }
- }
- else
-#endif
- /* Not UTF-8 mode */
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM43);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max || eptr >= md->end_subject ||
- (ctype == OP_ANY && IS_NEWLINE(eptr)))
- RRETURN(MATCH_NOMATCH);
-
- c = *eptr++;
- switch(ctype)
- {
- case OP_ANY: /* This is the non-NL case */
- case OP_ALLANY:
- case OP_ANYBYTE:
- break;
-
- case OP_ANYNL:
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x000d:
- if (eptr < md->end_subject && *eptr == 0x0a) eptr++;
- break;
-
- case 0x000a:
- break;
-
- case 0x000b:
- case 0x000c:
- case 0x0085:
- if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH);
- break;
- }
- break;
-
- case OP_NOT_HSPACE:
- switch(c)
- {
- default: break;
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case OP_HSPACE:
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- break;
- }
- break;
-
- case OP_NOT_VSPACE:
- switch(c)
- {
- default: break;
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case OP_VSPACE:
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- break;
- }
- break;
-
- case OP_NOT_DIGIT:
- if ((md->ctypes[c] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_DIGIT:
- if ((md->ctypes[c] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_NOT_WHITESPACE:
- if ((md->ctypes[c] & ctype_space) != 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_WHITESPACE:
- if ((md->ctypes[c] & ctype_space) == 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_NOT_WORDCHAR:
- if ((md->ctypes[c] & ctype_word) != 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_WORDCHAR:
- if ((md->ctypes[c] & ctype_word) == 0) RRETURN(MATCH_NOMATCH);
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
- }
- }
- /* Control never gets here */
- }
-
- /* If maximizing, it is worth using inline code for speed, doing the type
- test once at the start (i.e. keep it out of the loop). Again, keep the
- UTF-8 and UCP stuff separate. */
-
- else
- {
- pp = eptr; /* Remember where we started */
-
-#ifdef SUPPORT_UCP
- if (prop_type >= 0)
- {
- switch(prop_type)
- {
- case PT_ANY:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- if (prop_fail_result) break;
- eptr+= len;
- }
- break;
-
- case PT_LAMP:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- prop_chartype = UCD_CHARTYPE(c);
- if ((prop_chartype == ucp_Lu ||
- prop_chartype == ucp_Ll ||
- prop_chartype == ucp_Lt) == prop_fail_result)
- break;
- eptr+= len;
- }
- break;
-
- case PT_GC:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- prop_category = UCD_CATEGORY(c);
- if ((prop_category == prop_value) == prop_fail_result)
- break;
- eptr+= len;
- }
- break;
-
- case PT_PC:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- prop_chartype = UCD_CHARTYPE(c);
- if ((prop_chartype == prop_value) == prop_fail_result)
- break;
- eptr+= len;
- }
- break;
-
- case PT_SC:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- prop_script = UCD_SCRIPT(c);
- if ((prop_script == prop_value) == prop_fail_result)
- break;
- eptr+= len;
- }
- break;
- }
-
- /* eptr is now past the end of the maximum run */
-
- if (possessive) continue;
- for(;;)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM44);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
- if (utf8) BACKCHAR(eptr);
- }
- }
-
- /* Match extended Unicode sequences. We will get here only if the
- support is in the binary; otherwise a compile-time error occurs. */
-
- else if (ctype == OP_EXTUNI)
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject) break;
- GETCHARINCTEST(c, eptr);
- prop_category = UCD_CATEGORY(c);
- if (prop_category == ucp_M) break;
- while (eptr < md->end_subject)
- {
- int len = 1;
- if (!utf8) c = *eptr; else
- {
- GETCHARLEN(c, eptr, len);
- }
- prop_category = UCD_CATEGORY(c);
- if (prop_category != ucp_M) break;
- eptr += len;
- }
- }
-
- /* eptr is now past the end of the maximum run */
-
- if (possessive) continue;
- for(;;)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM45);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
- for (;;) /* Move back over one extended */
- {
- int len = 1;
- if (!utf8) c = *eptr; else
- {
- BACKCHAR(eptr);
- GETCHARLEN(c, eptr, len);
- }
- prop_category = UCD_CATEGORY(c);
- if (prop_category != ucp_M) break;
- eptr--;
- }
- }
- }
-
- else
-#endif /* SUPPORT_UCP */
-
-#ifdef SUPPORT_UTF8
- /* UTF-8 mode */
-
- if (utf8)
- {
- switch(ctype)
- {
- case OP_ANY:
- if (max < INT_MAX)
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || IS_NEWLINE(eptr)) break;
- eptr++;
- while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;
- }
- }
-
- /* Handle unlimited UTF-8 repeat */
-
- else
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || IS_NEWLINE(eptr)) break;
- eptr++;
- while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;
- }
- }
- break;
-
- case OP_ALLANY:
- if (max < INT_MAX)
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject) break;
- eptr++;
- while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;
- }
- }
- else eptr = md->end_subject; /* Unlimited UTF-8 repeat */
- break;
-
- /* The byte case is the same as non-UTF8 */
-
- case OP_ANYBYTE:
- c = max - min;
- if (c > (unsigned int)(md->end_subject - eptr))
- c = md->end_subject - eptr;
- eptr += c;
- break;
-
- case OP_ANYNL:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- if (c == 0x000d)
- {
- if (++eptr >= md->end_subject) break;
- if (*eptr == 0x000a) eptr++;
- }
- else
- {
- if (c != 0x000a &&
- (md->bsr_anycrlf ||
- (c != 0x000b && c != 0x000c &&
- c != 0x0085 && c != 0x2028 && c != 0x2029)))
- break;
- eptr += len;
- }
- }
- break;
-
- case OP_NOT_HSPACE:
- case OP_HSPACE:
- for (i = min; i < max; i++)
- {
- BOOL gotspace;
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- switch(c)
- {
- default: gotspace = FALSE; break;
- case 0x09: /* HT */
- case 0x20: /* SPACE */
- case 0xa0: /* NBSP */
- case 0x1680: /* OGHAM SPACE MARK */
- case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */
- case 0x2000: /* EN QUAD */
- case 0x2001: /* EM QUAD */
- case 0x2002: /* EN SPACE */
- case 0x2003: /* EM SPACE */
- case 0x2004: /* THREE-PER-EM SPACE */
- case 0x2005: /* FOUR-PER-EM SPACE */
- case 0x2006: /* SIX-PER-EM SPACE */
- case 0x2007: /* FIGURE SPACE */
- case 0x2008: /* PUNCTUATION SPACE */
- case 0x2009: /* THIN SPACE */
- case 0x200A: /* HAIR SPACE */
- case 0x202f: /* NARROW NO-BREAK SPACE */
- case 0x205f: /* MEDIUM MATHEMATICAL SPACE */
- case 0x3000: /* IDEOGRAPHIC SPACE */
- gotspace = TRUE;
- break;
- }
- if (gotspace == (ctype == OP_NOT_HSPACE)) break;
- eptr += len;
- }
- break;
-
- case OP_NOT_VSPACE:
- case OP_VSPACE:
- for (i = min; i < max; i++)
- {
- BOOL gotspace;
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- switch(c)
- {
- default: gotspace = FALSE; break;
- case 0x0a: /* LF */
- case 0x0b: /* VT */
- case 0x0c: /* FF */
- case 0x0d: /* CR */
- case 0x85: /* NEL */
- case 0x2028: /* LINE SEPARATOR */
- case 0x2029: /* PARAGRAPH SEPARATOR */
- gotspace = TRUE;
- break;
- }
- if (gotspace == (ctype == OP_NOT_VSPACE)) break;
- eptr += len;
- }
- break;
-
- case OP_NOT_DIGIT:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) break;
- eptr+= len;
- }
- break;
-
- case OP_DIGIT:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- if (c >= 256 ||(md->ctypes[c] & ctype_digit) == 0) break;
- eptr+= len;
- }
- break;
-
- case OP_NOT_WHITESPACE:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- if (c < 256 && (md->ctypes[c] & ctype_space) != 0) break;
- eptr+= len;
- }
- break;
-
- case OP_WHITESPACE:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- if (c >= 256 ||(md->ctypes[c] & ctype_space) == 0) break;
- eptr+= len;
- }
- break;
-
- case OP_NOT_WORDCHAR:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- if (c < 256 && (md->ctypes[c] & ctype_word) != 0) break;
- eptr+= len;
- }
- break;
-
- case OP_WORDCHAR:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject) break;
- GETCHARLEN(c, eptr, len);
- if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) break;
- eptr+= len;
- }
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
-
- /* eptr is now past the end of the maximum run */
-
- if (possessive) continue;
- for(;;)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM46);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
- BACKCHAR(eptr);
- }
- }
- else
-#endif /* SUPPORT_UTF8 */
-
- /* Not UTF-8 mode */
- {
- switch(ctype)
- {
- case OP_ANY:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || IS_NEWLINE(eptr)) break;
- eptr++;
- }
- break;
-
- case OP_ALLANY:
- case OP_ANYBYTE:
- c = max - min;
- if (c > (unsigned int)(md->end_subject - eptr))
- c = md->end_subject - eptr;
- eptr += c;
- break;
-
- case OP_ANYNL:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject) break;
- c = *eptr;
- if (c == 0x000d)
- {
- if (++eptr >= md->end_subject) break;
- if (*eptr == 0x000a) eptr++;
- }
- else
- {
- if (c != 0x000a &&
- (md->bsr_anycrlf ||
- (c != 0x000b && c != 0x000c && c != 0x0085)))
- break;
- eptr++;
- }
- }
- break;
-
- case OP_NOT_HSPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject) break;
- c = *eptr;
- if (c == 0x09 || c == 0x20 || c == 0xa0) break;
- eptr++;
- }
- break;
-
- case OP_HSPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject) break;
- c = *eptr;
- if (c != 0x09 && c != 0x20 && c != 0xa0) break;
- eptr++;
- }
- break;
-
- case OP_NOT_VSPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject) break;
- c = *eptr;
- if (c == 0x0a || c == 0x0b || c == 0x0c || c == 0x0d || c == 0x85)
- break;
- eptr++;
- }
- break;
-
- case OP_VSPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject) break;
- c = *eptr;
- if (c != 0x0a && c != 0x0b && c != 0x0c && c != 0x0d && c != 0x85)
- break;
- eptr++;
- }
- break;
-
- case OP_NOT_DIGIT:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) != 0)
- break;
- eptr++;
- }
- break;
-
- case OP_DIGIT:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) == 0)
- break;
- eptr++;
- }
- break;
-
- case OP_NOT_WHITESPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) != 0)
- break;
- eptr++;
- }
- break;
-
- case OP_WHITESPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) == 0)
- break;
- eptr++;
- }
- break;
-
- case OP_NOT_WORDCHAR:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) != 0)
- break;
- eptr++;
- }
- break;
-
- case OP_WORDCHAR:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) == 0)
- break;
- eptr++;
- }
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
-
- /* eptr is now past the end of the maximum run */
-
- if (possessive) continue;
- while (eptr >= pp)
- {
- RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM47);
- eptr--;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- }
- }
-
- /* Get here if we can't make it match with any permitted repetitions */
-
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- /* There's been some horrible disaster. Arrival here can only mean there is
- something seriously wrong in the code above or the OP_xxx definitions. */
-
- default:
- DPRINTF(("Unknown opcode %d\n", *ecode));
- RRETURN(PCRE_ERROR_UNKNOWN_OPCODE);
- }
-
- /* Do not stick any code in here without much thought; it is assumed
- that "continue" in the code above comes out to here to repeat the main
- loop. */
-
- } /* End of main loop */
-/* Control never reaches here */
-
-
-/* When compiling to use the heap rather than the stack for recursive calls to
-match(), the RRETURN() macro jumps here. The number that is saved in
-frame->Xwhere indicates which label we actually want to return to. */
-
-#ifdef NO_RECURSE
-#define LBL(val) case val: goto L_RM##val;
-HEAP_RETURN:
-switch (frame->Xwhere)
- {
- LBL( 1) LBL( 2) LBL( 3) LBL( 4) LBL( 5) LBL( 6) LBL( 7) LBL( 8)
- LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(17)
- LBL(19) LBL(24) LBL(25) LBL(26) LBL(27) LBL(29) LBL(31) LBL(33)
- LBL(35) LBL(43) LBL(47) LBL(48) LBL(49) LBL(50) LBL(51) LBL(52)
- LBL(53) LBL(54)
-#ifdef SUPPORT_UTF8
- LBL(16) LBL(18) LBL(20) LBL(21) LBL(22) LBL(23) LBL(28) LBL(30)
- LBL(32) LBL(34) LBL(42) LBL(46)
-#ifdef SUPPORT_UCP
- LBL(36) LBL(37) LBL(38) LBL(39) LBL(40) LBL(41) LBL(44) LBL(45)
-#endif /* SUPPORT_UCP */
-#endif /* SUPPORT_UTF8 */
- default:
- DPRINTF(("jump error in pcre match: label %d non-existent\n", frame->Xwhere));
- return PCRE_ERROR_INTERNAL;
- }
-#undef LBL
-#endif /* NO_RECURSE */
-}
-
-
-/***************************************************************************
-****************************************************************************
- RECURSION IN THE match() FUNCTION
-
-Undefine all the macros that were defined above to handle this. */
-
-#ifdef NO_RECURSE
-#undef eptr
-#undef ecode
-#undef mstart
-#undef offset_top
-#undef ims
-#undef eptrb
-#undef flags
-
-#undef callpat
-#undef charptr
-#undef data
-#undef next
-#undef pp
-#undef prev
-#undef saved_eptr
-
-#undef new_recursive
-
-#undef cur_is_word
-#undef condition
-#undef prev_is_word
-
-#undef original_ims
-
-#undef ctype
-#undef length
-#undef max
-#undef min
-#undef number
-#undef offset
-#undef op
-#undef save_capture_last
-#undef save_offset1
-#undef save_offset2
-#undef save_offset3
-#undef stacksave
-
-#undef newptrb
-
-#endif
-
-/* These two are defined as macros in both cases */
-
-#undef fc
-#undef fi
-
-/***************************************************************************
-***************************************************************************/
-
-
-
-/*************************************************
-* Execute a Regular Expression *
-*************************************************/
-
-/* This function applies a compiled re to a subject string and picks out
-portions of the string if it matches. Two elements in the vector are set for
-each substring: the offsets to the start and end of the substring.
-
-Arguments:
- argument_re points to the compiled expression
- extra_data points to extra data or is NULL
- subject points to the subject string
- length length of subject string (may contain binary zeros)
- start_offset where to start in the subject string
- options option bits
- offsets points to a vector of ints to be filled in with offsets
- offsetcount the number of elements in the vector
-
-Returns: > 0 => success; value is the number of elements filled in
- = 0 => success, but offsets is not big enough
- -1 => failed to match
- < -1 => some kind of unexpected problem
-*/
-
-PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
-pcre_exec(const pcre *argument_re, const pcre_extra *extra_data,
- PCRE_SPTR subject, int length, int start_offset, int options, int *offsets,
- int offsetcount)
-{
-int rc, resetcount, ocount;
-int first_byte = -1;
-int req_byte = -1;
-int req_byte2 = -1;
-int newline;
-unsigned long int ims;
-BOOL using_temporary_offsets = FALSE;
-BOOL anchored;
-BOOL startline;
-BOOL firstline;
-BOOL first_byte_caseless = FALSE;
-BOOL req_byte_caseless = FALSE;
-BOOL utf8;
-match_data match_block;
-match_data *md = &match_block;
-const uschar *tables;
-const uschar *start_bits = NULL;
-USPTR start_match = (USPTR)subject + start_offset;
-USPTR end_subject;
-USPTR req_byte_ptr = start_match - 1;
-
-pcre_study_data internal_study;
-const pcre_study_data *study;
-
-real_pcre internal_re;
-const real_pcre *external_re = (const real_pcre *)argument_re;
-const real_pcre *re = external_re;
-
-/* Plausibility checks */
-
-if ((options & ~PUBLIC_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION;
-if (re == NULL || subject == NULL ||
- (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;
-if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;
-
-/* Fish out the optional data from the extra_data structure, first setting
-the default values. */
-
-study = NULL;
-md->match_limit = MATCH_LIMIT;
-md->match_limit_recursion = MATCH_LIMIT_RECURSION;
-md->callout_data = NULL;
-
-/* The table pointer is always in native byte order. */
-
-tables = external_re->tables;
-
-if (extra_data != NULL)
- {
- register unsigned int flags = extra_data->flags;
- if ((flags & PCRE_EXTRA_STUDY_DATA) != 0)
- study = (const pcre_study_data *)extra_data->study_data;
- if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0)
- md->match_limit = extra_data->match_limit;
- if ((flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION) != 0)
- md->match_limit_recursion = extra_data->match_limit_recursion;
- if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0)
- md->callout_data = extra_data->callout_data;
- if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables;
- }
-
-/* If the exec call supplied NULL for tables, use the inbuilt ones. This
-is a feature that makes it possible to save compiled regex and re-use them
-in other programs later. */
-
-if (tables == NULL) tables = _pcre_default_tables;
-
-/* Check that the first field in the block is the magic number. If it is not,
-test for a regex that was compiled on a host of opposite endianness. If this is
-the case, flipped values are put in internal_re and internal_study if there was
-study data too. */
-
-if (re->magic_number != MAGIC_NUMBER)
- {
- re = _pcre_try_flipped(re, &internal_re, study, &internal_study);
- if (re == NULL) return PCRE_ERROR_BADMAGIC;
- if (study != NULL) study = &internal_study;
- }
-
-/* Set up other data */
-
-anchored = ((re->options | options) & PCRE_ANCHORED) != 0;
-startline = (re->flags & PCRE_STARTLINE) != 0;
-firstline = (re->options & PCRE_FIRSTLINE) != 0;
-
-/* The code starts after the real_pcre block and the capture name table. */
-
-md->start_code = (const uschar *)external_re + re->name_table_offset +
- re->name_count * re->name_entry_size;
-
-md->start_subject = (USPTR)subject;
-md->start_offset = start_offset;
-md->end_subject = md->start_subject + length;
-end_subject = md->end_subject;
-
-md->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;
-utf8 = md->utf8 = (re->options & PCRE_UTF8) != 0;
-md->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0;
-
-md->notbol = (options & PCRE_NOTBOL) != 0;
-md->noteol = (options & PCRE_NOTEOL) != 0;
-md->notempty = (options & PCRE_NOTEMPTY) != 0;
-md->partial = (options & PCRE_PARTIAL) != 0;
-md->hitend = FALSE;
-
-md->recursive = NULL; /* No recursion at top level */
-
-md->lcc = tables + lcc_offset;
-md->ctypes = tables + ctypes_offset;
-
-/* Handle different \R options. */
-
-switch (options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE))
- {
- case 0:
- if ((re->options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) != 0)
- md->bsr_anycrlf = (re->options & PCRE_BSR_ANYCRLF) != 0;
- else
-#ifdef BSR_ANYCRLF
- md->bsr_anycrlf = TRUE;
-#else
- md->bsr_anycrlf = FALSE;
-#endif
- break;
-
- case PCRE_BSR_ANYCRLF:
- md->bsr_anycrlf = TRUE;
- break;
-
- case PCRE_BSR_UNICODE:
- md->bsr_anycrlf = FALSE;
- break;
-
- default: return PCRE_ERROR_BADNEWLINE;
- }
-
-/* Handle different types of newline. The three bits give eight cases. If
-nothing is set at run time, whatever was used at compile time applies. */
-
-switch ((((options & PCRE_NEWLINE_BITS) == 0)? re->options :
- (pcre_uint32)options) & PCRE_NEWLINE_BITS)
- {
- case 0: newline = NEWLINE; break; /* Compile-time default */
- case PCRE_NEWLINE_CR: newline = '\r'; break;
- case PCRE_NEWLINE_LF: newline = '\n'; break;
- case PCRE_NEWLINE_CR+
- PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break;
- case PCRE_NEWLINE_ANY: newline = -1; break;
- case PCRE_NEWLINE_ANYCRLF: newline = -2; break;
- default: return PCRE_ERROR_BADNEWLINE;
- }
-
-if (newline == -2)
- {
- md->nltype = NLTYPE_ANYCRLF;
- }
-else if (newline < 0)
- {
- md->nltype = NLTYPE_ANY;
- }
-else
- {
- md->nltype = NLTYPE_FIXED;
- if (newline > 255)
- {
- md->nllen = 2;
- md->nl[0] = (newline >> 8) & 255;
- md->nl[1] = newline & 255;
- }
- else
- {
- md->nllen = 1;
- md->nl[0] = newline;
- }
- }
-
-/* Partial matching is supported only for a restricted set of regexes at the
-moment. */
-
-if (md->partial && (re->flags & PCRE_NOPARTIAL) != 0)
- return PCRE_ERROR_BADPARTIAL;
-
-/* Check a UTF-8 string if required. Unfortunately there's no way of passing
-back the character offset. */
-
-#ifdef SUPPORT_UTF8
-if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
- {
- if (_pcre_valid_utf8((uschar *)subject, length) >= 0)
- return PCRE_ERROR_BADUTF8;
- if (start_offset > 0 && start_offset < length)
- {
- int tb = ((uschar *)subject)[start_offset];
- if (tb > 127)
- {
- tb &= 0xc0;
- if (tb != 0 && tb != 0xc0) return PCRE_ERROR_BADUTF8_OFFSET;
- }
- }
- }
-#endif
-
-/* The ims options can vary during the matching as a result of the presence
-of (?ims) items in the pattern. They are kept in a local variable so that
-restoring at the exit of a group is easy. */
-
-ims = re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL);
-
-/* If the expression has got more back references than the offsets supplied can
-hold, we get a temporary chunk of working store to use during the matching.
-Otherwise, we can use the vector supplied, rounding down its size to a multiple
-of 3. */
-
-ocount = offsetcount - (offsetcount % 3);
-
-if (re->top_backref > 0 && re->top_backref >= ocount/3)
- {
- ocount = re->top_backref * 3 + 3;
- md->offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int));
- if (md->offset_vector == NULL) return PCRE_ERROR_NOMEMORY;
- using_temporary_offsets = TRUE;
- DPRINTF(("Got memory to hold back references\n"));
- }
-else md->offset_vector = offsets;
-
-md->offset_end = ocount;
-md->offset_max = (2*ocount)/3;
-md->offset_overflow = FALSE;
-md->capture_last = -1;
-
-/* Compute the minimum number of offsets that we need to reset each time. Doing
-this makes a huge difference to execution time when there aren't many brackets
-in the pattern. */
-
-resetcount = 2 + re->top_bracket * 2;
-if (resetcount > offsetcount) resetcount = ocount;
-
-/* Reset the working variable associated with each extraction. These should
-never be used unless previously set, but they get saved and restored, and so we
-initialize them to avoid reading uninitialized locations. */
-
-if (md->offset_vector != NULL)
- {
- register int *iptr = md->offset_vector + ocount;
- register int *iend = iptr - resetcount/2 + 1;
- while (--iptr >= iend) *iptr = -1;
- }
-
-/* Set up the first character to match, if available. The first_byte value is
-never set for an anchored regular expression, but the anchoring may be forced
-at run time, so we have to test for anchoring. The first char may be unset for
-an unanchored pattern, of course. If there's no first char and the pattern was
-studied, there may be a bitmap of possible first characters. */
-
-if (!anchored)
- {
- if ((re->flags & PCRE_FIRSTSET) != 0)
- {
- first_byte = re->first_byte & 255;
- if ((first_byte_caseless = ((re->first_byte & REQ_CASELESS) != 0)) == TRUE)
- first_byte = md->lcc[first_byte];
- }
- else
- if (!startline && study != NULL &&
- (study->options & PCRE_STUDY_MAPPED) != 0)
- start_bits = study->start_bits;
- }
-
-/* For anchored or unanchored matches, there may be a "last known required
-character" set. */
-
-if ((re->flags & PCRE_REQCHSET) != 0)
- {
- req_byte = re->req_byte & 255;
- req_byte_caseless = (re->req_byte & REQ_CASELESS) != 0;
- req_byte2 = (tables + fcc_offset)[req_byte]; /* case flipped */
- }
-
-
-/* ==========================================================================*/
-
-/* Loop for handling unanchored repeated matching attempts; for anchored regexs
-the loop runs just once. */
-
-for(;;)
- {
- USPTR save_end_subject = end_subject;
- USPTR new_start_match;
-
- /* Reset the maximum number of extractions we might see. */
-
- if (md->offset_vector != NULL)
- {
- register int *iptr = md->offset_vector;
- register int *iend = iptr + resetcount;
- while (iptr < iend) *iptr++ = -1;
- }
-
- /* Advance to a unique first char if possible. If firstline is TRUE, the
- start of the match is constrained to the first line of a multiline string.
- That is, the match must be before or at the first newline. Implement this by
- temporarily adjusting end_subject so that we stop scanning at a newline. If
- the match fails at the newline, later code breaks this loop. */
-
- if (firstline)
- {
- USPTR t = start_match;
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- while (t < md->end_subject && !IS_NEWLINE(t))
- {
- t++;
- while (t < end_subject && (*t & 0xc0) == 0x80) t++;
- }
- }
- else
-#endif
- while (t < md->end_subject && !IS_NEWLINE(t)) t++;
- end_subject = t;
- }
-
- /* Now advance to a unique first byte if there is one. */
-
- if (first_byte >= 0)
- {
- if (first_byte_caseless)
- while (start_match < end_subject && md->lcc[*start_match] != first_byte)
- start_match++;
- else
- while (start_match < end_subject && *start_match != first_byte)
- start_match++;
- }
-
- /* Or to just after a linebreak for a multiline match */
-
- else if (startline)
- {
- if (start_match > md->start_subject + start_offset)
- {
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- while (start_match < end_subject && !WAS_NEWLINE(start_match))
- {
- start_match++;
- while(start_match < end_subject && (*start_match & 0xc0) == 0x80)
- start_match++;
- }
- }
- else
-#endif
- while (start_match < end_subject && !WAS_NEWLINE(start_match))
- start_match++;
-
- /* If we have just passed a CR and the newline option is ANY or ANYCRLF,
- and we are now at a LF, advance the match position by one more character.
- */
-
- if (start_match[-1] == '\r' &&
- (md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) &&
- start_match < end_subject &&
- *start_match == '\n')
- start_match++;
- }
- }
-
- /* Or to a non-unique first byte after study */
-
- else if (start_bits != NULL)
- {
- while (start_match < end_subject)
- {
- register unsigned int c = *start_match;
- if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++;
- else break;
- }
- }
-
- /* Restore fudged end_subject */
-
- end_subject = save_end_subject;
-
-#ifdef DEBUG /* Sigh. Some compilers never learn. */
- printf(">>>> Match against: ");
- pchars(start_match, end_subject - start_match, TRUE, md);
- printf("\n");
-#endif
-
- /* If req_byte is set, we know that that character must appear in the subject
- for the match to succeed. If the first character is set, req_byte must be
- later in the subject; otherwise the test starts at the match point. This
- optimization can save a huge amount of backtracking in patterns with nested
- unlimited repeats that aren't going to match. Writing separate code for
- cased/caseless versions makes it go faster, as does using an autoincrement
- and backing off on a match.
-
- HOWEVER: when the subject string is very, very long, searching to its end can
- take a long time, and give bad performance on quite ordinary patterns. This
- showed up when somebody was matching something like /^\d+C/ on a 32-megabyte
- string... so we don't do this when the string is sufficiently long.
-
- ALSO: this processing is disabled when partial matching is requested.
- */
-
- if (req_byte >= 0 &&
- end_subject - start_match < REQ_BYTE_MAX &&
- !md->partial)
- {
- register USPTR p = start_match + ((first_byte >= 0)? 1 : 0);
-
- /* We don't need to repeat the search if we haven't yet reached the
- place we found it at last time. */
-
- if (p > req_byte_ptr)
- {
- if (req_byte_caseless)
- {
- while (p < end_subject)
- {
- register int pp = *p++;
- if (pp == req_byte || pp == req_byte2) { p--; break; }
- }
- }
- else
- {
- while (p < end_subject)
- {
- if (*p++ == req_byte) { p--; break; }
- }
- }
-
- /* If we can't find the required character, break the matching loop,
- forcing a match failure. */
-
- if (p >= end_subject)
- {
- rc = MATCH_NOMATCH;
- break;
- }
-
- /* If we have found the required character, save the point where we
- found it, so that we don't search again next time round the loop if
- the start hasn't passed this character yet. */
-
- req_byte_ptr = p;
- }
- }
-
- /* OK, we can now run the match. */
-
- md->start_match_ptr = start_match;
- md->match_call_count = 0;
- rc = match(start_match, md->start_code, start_match, 2, md, ims, NULL, 0, 0);
-
- switch(rc)
- {
- /* NOMATCH and PRUNE advance by one character. THEN at this level acts
- exactly like PRUNE. */
-
- case MATCH_NOMATCH:
- case MATCH_PRUNE:
- case MATCH_THEN:
- new_start_match = start_match + 1;
-#ifdef SUPPORT_UTF8
- if (utf8)
- while(new_start_match < end_subject && (*new_start_match & 0xc0) == 0x80)
- new_start_match++;
-#endif
- break;
-
- /* SKIP passes back the next starting point explicitly. */
-
- case MATCH_SKIP:
- new_start_match = md->start_match_ptr;
- break;
-
- /* COMMIT disables the bumpalong, but otherwise behaves as NOMATCH. */
-
- case MATCH_COMMIT:
- rc = MATCH_NOMATCH;
- goto ENDLOOP;
-
- /* Any other return is some kind of error. */
-
- default:
- goto ENDLOOP;
- }
-
- /* Control reaches here for the various types of "no match at this point"
- result. Reset the code to MATCH_NOMATCH for subsequent checking. */
-
- rc = MATCH_NOMATCH;
-
- /* If PCRE_FIRSTLINE is set, the match must happen before or at the first
- newline in the subject (though it may continue over the newline). Therefore,
- if we have just failed to match, starting at a newline, do not continue. */
-
- if (firstline && IS_NEWLINE(start_match)) break;
-
- /* Advance to new matching position */
-
- start_match = new_start_match;
-
- /* Break the loop if the pattern is anchored or if we have passed the end of
- the subject. */
-
- if (anchored || start_match > end_subject) break;
-
- /* If we have just passed a CR and we are now at a LF, and the pattern does
- not contain any explicit matches for \r or \n, and the newline option is CRLF
- or ANY or ANYCRLF, advance the match position by one more character. */
-
- if (start_match[-1] == '\r' &&
- start_match < end_subject &&
- *start_match == '\n' &&
- (re->flags & PCRE_HASCRORLF) == 0 &&
- (md->nltype == NLTYPE_ANY ||
- md->nltype == NLTYPE_ANYCRLF ||
- md->nllen == 2))
- start_match++;
-
- } /* End of for(;;) "bumpalong" loop */
-
-/* ==========================================================================*/
-
-/* We reach here when rc is not MATCH_NOMATCH, or if one of the stopping
-conditions is true:
-
-(1) The pattern is anchored or the match was failed by (*COMMIT);
-
-(2) We are past the end of the subject;
-
-(3) PCRE_FIRSTLINE is set and we have failed to match at a newline, because
- this option requests that a match occur at or before the first newline in
- the subject.
-
-When we have a match and the offset vector is big enough to deal with any
-backreferences, captured substring offsets will already be set up. In the case
-where we had to get some local store to hold offsets for backreference
-processing, copy those that we can. In this case there need not be overflow if
-certain parts of the pattern were not used, even though there are more
-capturing parentheses than vector slots. */
-
-ENDLOOP:
-
-if (rc == MATCH_MATCH)
- {
- if (using_temporary_offsets)
- {
- if (offsetcount >= 4)
- {
- memcpy(offsets + 2, md->offset_vector + 2,
- (offsetcount - 2) * sizeof(int));
- DPRINTF(("Copied offsets from temporary memory\n"));
- }
- if (md->end_offset_top > offsetcount) md->offset_overflow = TRUE;
- DPRINTF(("Freeing temporary memory\n"));
- (pcre_free)(md->offset_vector);
- }
-
- /* Set the return code to the number of captured strings, or 0 if there are
- too many to fit into the vector. */
-
- rc = md->offset_overflow? 0 : md->end_offset_top/2;
-
- /* If there is space, set up the whole thing as substring 0. The value of
- md->start_match_ptr might be modified if \K was encountered on the success
- matching path. */
-
- if (offsetcount < 2) rc = 0; else
- {
- offsets[0] = md->start_match_ptr - md->start_subject;
- offsets[1] = md->end_match_ptr - md->start_subject;
- }
-
- DPRINTF((">>>> returning %d\n", rc));
- return rc;
- }
-
-/* Control gets here if there has been an error, or if the overall match
-attempt has failed at all permitted starting positions. */
-
-if (using_temporary_offsets)
- {
- DPRINTF(("Freeing temporary memory\n"));
- (pcre_free)(md->offset_vector);
- }
-
-if (rc != MATCH_NOMATCH)
- {
- DPRINTF((">>>> error: returning %d\n", rc));
- return rc;
- }
-else if (md->partial && md->hitend)
- {
- DPRINTF((">>>> returning PCRE_ERROR_PARTIAL\n"));
- return PCRE_ERROR_PARTIAL;
- }
-else
- {
- DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n"));
- return PCRE_ERROR_NOMATCH;
- }
-}
-
-/* End of pcre_exec.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_fullinfo.c b/Utilities/Poco/Foundation/src/pcre_fullinfo.c
deleted file mode 100755
index f309705c03..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_fullinfo.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains the external function pcre_fullinfo(), which returns
-information about a compiled pattern. */
-
-
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-
-/*************************************************
-* Return info about compiled pattern *
-*************************************************/
-
-/* This is a newer "info" function which has an extensible interface so
-that additional items can be added compatibly.
-
-Arguments:
- argument_re points to compiled code
- extra_data points extra data, or NULL
- what what information is required
- where where to put the information
-
-Returns: 0 if data returned, negative on error
-*/
-
-PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
-pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what,
- void *where)
-{
-real_pcre internal_re;
-pcre_study_data internal_study;
-const real_pcre *re = (const real_pcre *)argument_re;
-const pcre_study_data *study = NULL;
-
-if (re == NULL || where == NULL) return PCRE_ERROR_NULL;
-
-if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0)
- study = (const pcre_study_data *)extra_data->study_data;
-
-if (re->magic_number != MAGIC_NUMBER)
- {
- re = _pcre_try_flipped(re, &internal_re, study, &internal_study);
- if (re == NULL) return PCRE_ERROR_BADMAGIC;
- if (study != NULL) study = &internal_study;
- }
-
-switch (what)
- {
- case PCRE_INFO_OPTIONS:
- *((unsigned long int *)where) = re->options & PUBLIC_OPTIONS;
- break;
-
- case PCRE_INFO_SIZE:
- *((size_t *)where) = re->size;
- break;
-
- case PCRE_INFO_STUDYSIZE:
- *((size_t *)where) = (study == NULL)? 0 : study->size;
- break;
-
- case PCRE_INFO_CAPTURECOUNT:
- *((int *)where) = re->top_bracket;
- break;
-
- case PCRE_INFO_BACKREFMAX:
- *((int *)where) = re->top_backref;
- break;
-
- case PCRE_INFO_FIRSTBYTE:
- *((int *)where) =
- ((re->flags & PCRE_FIRSTSET) != 0)? re->first_byte :
- ((re->flags & PCRE_STARTLINE) != 0)? -1 : -2;
- break;
-
- /* Make sure we pass back the pointer to the bit vector in the external
- block, not the internal copy (with flipped integer fields). */
-
- case PCRE_INFO_FIRSTTABLE:
- *((const uschar **)where) =
- (study != NULL && (study->options & PCRE_STUDY_MAPPED) != 0)?
- ((const pcre_study_data *)extra_data->study_data)->start_bits : NULL;
- break;
-
- case PCRE_INFO_LASTLITERAL:
- *((int *)where) =
- ((re->flags & PCRE_REQCHSET) != 0)? re->req_byte : -1;
- break;
-
- case PCRE_INFO_NAMEENTRYSIZE:
- *((int *)where) = re->name_entry_size;
- break;
-
- case PCRE_INFO_NAMECOUNT:
- *((int *)where) = re->name_count;
- break;
-
- case PCRE_INFO_NAMETABLE:
- *((const uschar **)where) = (const uschar *)re + re->name_table_offset;
- break;
-
- case PCRE_INFO_DEFAULT_TABLES:
- *((const uschar **)where) = (const uschar *)(_pcre_default_tables);
- break;
-
- case PCRE_INFO_OKPARTIAL:
- *((int *)where) = (re->flags & PCRE_NOPARTIAL) == 0;
- break;
-
- case PCRE_INFO_JCHANGED:
- *((int *)where) = (re->flags & PCRE_JCHANGED) != 0;
- break;
-
- case PCRE_INFO_HASCRORLF:
- *((int *)where) = (re->flags & PCRE_HASCRORLF) != 0;
- break;
-
- default: return PCRE_ERROR_BADOPTION;
- }
-
-return 0;
-}
-
-/* End of pcre_fullinfo.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_globals.c b/Utilities/Poco/Foundation/src/pcre_globals.c
deleted file mode 100755
index fb496ca516..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_globals.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains global variables that are exported by the PCRE library.
-PCRE is thread-clean and doesn't use any global variables in the normal sense.
-However, it calls memory allocation and freeing functions via the four
-indirections below, and it can optionally do callouts, using the fifth
-indirection. These values can be changed by the caller, but are shared between
-all threads. However, when compiling for Virtual Pascal, things are done
-differently, and global variables are not used (see pcre.in). */
-
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-#ifndef VPCOMPAT
-PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = malloc;
-PCRE_EXP_DATA_DEFN void (*pcre_free)(void *) = free;
-PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = malloc;
-PCRE_EXP_DATA_DEFN void (*pcre_stack_free)(void *) = free;
-PCRE_EXP_DATA_DEFN int (*pcre_callout)(pcre_callout_block *) = NULL;
-#endif
-
-/* End of pcre_globals.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_internal.h b/Utilities/Poco/Foundation/src/pcre_internal.h
deleted file mode 100755
index dcded9fc34..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_internal.h
+++ /dev/null
@@ -1,1176 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-/* This header contains definitions that are shared between the different
-modules, but which are not relevant to the exported API. This includes some
-functions whose names all begin with "_pcre_". */
-
-#ifndef PCRE_INTERNAL_H
-#define PCRE_INTERNAL_H
-
-/* Define DEBUG to get debugging output on stdout. */
-
-#if 0
-#define DEBUG
-#endif
-
-/* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef
-inline, and there are *still* stupid compilers about that don't like indented
-pre-processor statements, or at least there were when I first wrote this. After
-all, it had only been about 10 years then...
-
-It turns out that the Mac Debugging.h header also defines the macro DPRINTF, so
-be absolutely sure we get our version. */
-
-#undef DPRINTF
-#ifdef DEBUG
-#define DPRINTF(p) printf p
-#else
-#define DPRINTF(p) /* Nothing */
-#endif
-
-
-/* Standard C headers plus the external interface definition. The only time
-setjmp and stdarg are used is when NO_RECURSE is set. */
-
-#include <ctype.h>
-#include <limits.h>
-#include <setjmp.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* When compiling a DLL for Windows, the exported symbols have to be declared
-using some MS magic. I found some useful information on this web page:
-http://msdn2.microsoft.com/en-us/library/y4h7bcy6(VS.80).aspx. According to the
-information there, using __declspec(dllexport) without "extern" we have a
-definition; with "extern" we have a declaration. The settings here override the
-setting in pcre.h (which is included below); it defines only PCRE_EXP_DECL,
-which is all that is needed for applications (they just import the symbols). We
-use:
-
- PCRE_EXP_DECL for declarations
- PCRE_EXP_DEFN for definitions of exported functions
- PCRE_EXP_DATA_DEFN for definitions of exported variables
-
-The reason for the two DEFN macros is that in non-Windows environments, one
-does not want to have "extern" before variable definitions because it leads to
-compiler warnings. So we distinguish between functions and variables. In
-Windows, the two should always be the same.
-
-The reason for wrapping this in #ifndef PCRE_EXP_DECL is so that pcretest,
-which is an application, but needs to import this file in order to "peek" at
-internals, can #include pcre.h first to get an application's-eye view.
-
-In principle, people compiling for non-Windows, non-Unix-like (i.e. uncommon,
-special-purpose environments) might want to stick other stuff in front of
-exported symbols. That's why, in the non-Windows case, we set PCRE_EXP_DEFN and
-PCRE_EXP_DATA_DEFN only if they are not already set. */
-
-#ifndef PCRE_EXP_DECL
-# ifdef _WIN32
-# ifndef PCRE_STATIC
-# define PCRE_EXP_DECL extern __declspec(dllexport)
-# define PCRE_EXP_DEFN __declspec(dllexport)
-# define PCRE_EXP_DATA_DEFN __declspec(dllexport)
-# else
-# define PCRE_EXP_DECL extern
-# define PCRE_EXP_DEFN
-# define PCRE_EXP_DATA_DEFN
-# endif
-# else
-# ifdef __cplusplus
-# define PCRE_EXP_DECL extern "C"
-# else
-# define PCRE_EXP_DECL extern
-# endif
-# ifndef PCRE_EXP_DEFN
-# define PCRE_EXP_DEFN PCRE_EXP_DECL
-# endif
-# ifndef PCRE_EXP_DATA_DEFN
-# define PCRE_EXP_DATA_DEFN
-# endif
-# endif
-#endif
-
-/* When compiling with the MSVC compiler, it is sometimes necessary to include
-a "calling convention" before exported function names. (This is secondhand
-information; I know nothing about MSVC myself). For example, something like
-
- void __cdecl function(....)
-
-might be needed. In order so make this easy, all the exported functions have
-PCRE_CALL_CONVENTION just before their names. It is rarely needed; if not
-set, we ensure here that it has no effect. */
-
-#ifndef PCRE_CALL_CONVENTION
-#define PCRE_CALL_CONVENTION
-#endif
-
-/* We need to have types that specify unsigned 16-bit and 32-bit integers. We
-cannot determine these outside the compilation (e.g. by running a program as
-part of "configure") because PCRE is often cross-compiled for use on other
-systems. Instead we make use of the maximum sizes that are available at
-preprocessor time in standard C environments. */
-
-#if USHRT_MAX == 65535
- typedef unsigned short pcre_uint16;
- typedef short pcre_int16;
-#elif UINT_MAX == 65535
- typedef unsigned int pcre_uint16;
- typedef int pcre_int16;
-#else
- #error Cannot determine a type for 16-bit unsigned integers
-#endif
-
-#if UINT_MAX == 4294967295
- typedef unsigned int pcre_uint32;
- typedef int pcre_int32;
-#elif ULONG_MAX == 4294967295
- typedef unsigned long int pcre_uint32;
- typedef long int pcre_int32;
-#else
- #error Cannot determine a type for 32-bit unsigned integers
-#endif
-
-/* All character handling must be done as unsigned characters. Otherwise there
-are problems with top-bit-set characters and functions such as isspace().
-However, we leave the interface to the outside world as char *, because that
-should make things easier for callers. We define a short type for unsigned char
-to save lots of typing. I tried "uchar", but it causes problems on Digital
-Unix, where it is defined in sys/types, so use "uschar" instead. */
-
-typedef unsigned char uschar;
-
-/* This is an unsigned int value that no character can ever have. UTF-8
-characters only go up to 0x7fffffff (though Unicode doesn't go beyond
-0x0010ffff). */
-
-#define NOTACHAR 0xffffffff
-
-/* PCRE is able to support several different kinds of newline (CR, LF, CRLF,
-"any" and "anycrlf" at present). The following macros are used to package up
-testing for newlines. NLBLOCK, PSSTART, and PSEND are defined in the various
-modules to indicate in which datablock the parameters exist, and what the
-start/end of string field names are. */
-
-#define NLTYPE_FIXED 0 /* Newline is a fixed length string */
-#define NLTYPE_ANY 1 /* Newline is any Unicode line ending */
-#define NLTYPE_ANYCRLF 2 /* Newline is CR, LF, or CRLF */
-
-/* This macro checks for a newline at the given position */
-
-#define IS_NEWLINE(p) \
- ((NLBLOCK->nltype != NLTYPE_FIXED)? \
- ((p) < NLBLOCK->PSEND && \
- _pcre_is_newline((p), NLBLOCK->nltype, NLBLOCK->PSEND, &(NLBLOCK->nllen),\
- utf8)) \
- : \
- ((p) <= NLBLOCK->PSEND - NLBLOCK->nllen && \
- (p)[0] == NLBLOCK->nl[0] && \
- (NLBLOCK->nllen == 1 || (p)[1] == NLBLOCK->nl[1]) \
- ) \
- )
-
-/* This macro checks for a newline immediately preceding the given position */
-
-#define WAS_NEWLINE(p) \
- ((NLBLOCK->nltype != NLTYPE_FIXED)? \
- ((p) > NLBLOCK->PSSTART && \
- _pcre_was_newline((p), NLBLOCK->nltype, NLBLOCK->PSSTART, \
- &(NLBLOCK->nllen), utf8)) \
- : \
- ((p) >= NLBLOCK->PSSTART + NLBLOCK->nllen && \
- (p)[-NLBLOCK->nllen] == NLBLOCK->nl[0] && \
- (NLBLOCK->nllen == 1 || (p)[-NLBLOCK->nllen+1] == NLBLOCK->nl[1]) \
- ) \
- )
-
-/* When PCRE is compiled as a C++ library, the subject pointer can be replaced
-with a custom type. This makes it possible, for example, to allow pcre_exec()
-to process subject strings that are discontinuous by using a smart pointer
-class. It must always be possible to inspect all of the subject string in
-pcre_exec() because of the way it backtracks. Two macros are required in the
-normal case, for sign-unspecified and unsigned char pointers. The former is
-used for the external interface and appears in pcre.h, which is why its name
-must begin with PCRE_. */
-
-#ifdef CUSTOM_SUBJECT_PTR
-#define PCRE_SPTR CUSTOM_SUBJECT_PTR
-#define USPTR CUSTOM_SUBJECT_PTR
-#else
-#define PCRE_SPTR const char *
-#define USPTR const unsigned char *
-#endif
-
-
-
-/* Include the public PCRE header and the definitions of UCP character property
-values. */
-
-#include "pcre.h"
-#include "ucp.h"
-
-/* When compiling for use with the Virtual Pascal compiler, these functions
-need to have their names changed. PCRE must be compiled with the -DVPCOMPAT
-option on the command line. */
-
-#ifdef VPCOMPAT
-#define strlen(s) _strlen(s)
-#define strncmp(s1,s2,m) _strncmp(s1,s2,m)
-#define memcmp(s,c,n) _memcmp(s,c,n)
-#define memcpy(d,s,n) _memcpy(d,s,n)
-#define memmove(d,s,n) _memmove(d,s,n)
-#define memset(s,c,n) _memset(s,c,n)
-#else /* VPCOMPAT */
-
-/* To cope with SunOS4 and other systems that lack memmove() but have bcopy(),
-define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY
-is set. Otherwise, include an emulating function for those systems that have
-neither (there some non-Unix environments where this is the case). */
-
-#ifndef HAVE_MEMMOVE
-#undef memmove /* some systems may have a macro */
-#ifdef HAVE_BCOPY
-#define memmove(a, b, c) bcopy(b, a, c)
-#else /* HAVE_BCOPY */
-static void *
-pcre_memmove(void *d, const void *s, size_t n)
-{
-size_t i;
-unsigned char *dest = (unsigned char *)d;
-const unsigned char *src = (const unsigned char *)s;
-if (dest > src)
- {
- dest += n;
- src += n;
- for (i = 0; i < n; ++i) *(--dest) = *(--src);
- return (void *)dest;
- }
-else
- {
- for (i = 0; i < n; ++i) *dest++ = *src++;
- return (void *)(dest - n);
- }
-}
-#define memmove(a, b, c) pcre_memmove(a, b, c)
-#endif /* not HAVE_BCOPY */
-#endif /* not HAVE_MEMMOVE */
-#endif /* not VPCOMPAT */
-
-
-/* PCRE keeps offsets in its compiled code as 2-byte quantities (always stored
-in big-endian order) by default. These are used, for example, to link from the
-start of a subpattern to its alternatives and its end. The use of 2 bytes per
-offset limits the size of the compiled regex to around 64K, which is big enough
-for almost everybody. However, I received a request for an even bigger limit.
-For this reason, and also to make the code easier to maintain, the storing and
-loading of offsets from the byte string is now handled by the macros that are
-defined here.
-
-The macros are controlled by the value of LINK_SIZE. This defaults to 2 in
-the config.h file, but can be overridden by using -D on the command line. This
-is automated on Unix systems via the "configure" command. */
-
-#if LINK_SIZE == 2
-
-#define PUT(a,n,d) \
- (a[n] = (d) >> 8), \
- (a[(n)+1] = (d) & 255)
-
-#define GET(a,n) \
- (((a)[n] << 8) | (a)[(n)+1])
-
-#define MAX_PATTERN_SIZE (1 << 16)
-
-
-#elif LINK_SIZE == 3
-
-#define PUT(a,n,d) \
- (a[n] = (d) >> 16), \
- (a[(n)+1] = (d) >> 8), \
- (a[(n)+2] = (d) & 255)
-
-#define GET(a,n) \
- (((a)[n] << 16) | ((a)[(n)+1] << 8) | (a)[(n)+2])
-
-#define MAX_PATTERN_SIZE (1 << 24)
-
-
-#elif LINK_SIZE == 4
-
-#define PUT(a,n,d) \
- (a[n] = (d) >> 24), \
- (a[(n)+1] = (d) >> 16), \
- (a[(n)+2] = (d) >> 8), \
- (a[(n)+3] = (d) & 255)
-
-#define GET(a,n) \
- (((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3])
-
-#define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */
-
-
-#else
-#error LINK_SIZE must be either 2, 3, or 4
-#endif
-
-
-/* Convenience macro defined in terms of the others */
-
-#define PUTINC(a,n,d) PUT(a,n,d), a += LINK_SIZE
-
-
-/* PCRE uses some other 2-byte quantities that do not change when the size of
-offsets changes. There are used for repeat counts and for other things such as
-capturing parenthesis numbers in back references. */
-
-#define PUT2(a,n,d) \
- a[n] = (d) >> 8; \
- a[(n)+1] = (d) & 255
-
-#define GET2(a,n) \
- (((a)[n] << 8) | (a)[(n)+1])
-
-#define PUT2INC(a,n,d) PUT2(a,n,d), a += 2
-
-
-/* When UTF-8 encoding is being used, a character is no longer just a single
-byte. The macros for character handling generate simple sequences when used in
-byte-mode, and more complicated ones for UTF-8 characters. BACKCHAR should
-never be called in byte mode. To make sure it can never even appear when UTF-8
-support is omitted, we don't even define it. */
-
-#ifndef SUPPORT_UTF8
-#define GETCHAR(c, eptr) c = *eptr;
-#define GETCHARTEST(c, eptr) c = *eptr;
-#define GETCHARINC(c, eptr) c = *eptr++;
-#define GETCHARINCTEST(c, eptr) c = *eptr++;
-#define GETCHARLEN(c, eptr, len) c = *eptr;
-/* #define BACKCHAR(eptr) */
-
-#else /* SUPPORT_UTF8 */
-
-/* Get the next UTF-8 character, not advancing the pointer. This is called when
-we know we are in UTF-8 mode. */
-
-#define GETCHAR(c, eptr) \
- c = *eptr; \
- if (c >= 0xc0) \
- { \
- int gcii; \
- int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \
- int gcss = 6*gcaa; \
- c = (c & _pcre_utf8_table3[gcaa]) << gcss; \
- for (gcii = 1; gcii <= gcaa; gcii++) \
- { \
- gcss -= 6; \
- c |= (eptr[gcii] & 0x3f) << gcss; \
- } \
- }
-
-/* Get the next UTF-8 character, testing for UTF-8 mode, and not advancing the
-pointer. */
-
-#define GETCHARTEST(c, eptr) \
- c = *eptr; \
- if (utf8 && c >= 0xc0) \
- { \
- int gcii; \
- int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \
- int gcss = 6*gcaa; \
- c = (c & _pcre_utf8_table3[gcaa]) << gcss; \
- for (gcii = 1; gcii <= gcaa; gcii++) \
- { \
- gcss -= 6; \
- c |= (eptr[gcii] & 0x3f) << gcss; \
- } \
- }
-
-/* Get the next UTF-8 character, advancing the pointer. This is called when we
-know we are in UTF-8 mode. */
-
-#define GETCHARINC(c, eptr) \
- c = *eptr++; \
- if (c >= 0xc0) \
- { \
- int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \
- int gcss = 6*gcaa; \
- c = (c & _pcre_utf8_table3[gcaa]) << gcss; \
- while (gcaa-- > 0) \
- { \
- gcss -= 6; \
- c |= (*eptr++ & 0x3f) << gcss; \
- } \
- }
-
-/* Get the next character, testing for UTF-8 mode, and advancing the pointer */
-
-#define GETCHARINCTEST(c, eptr) \
- c = *eptr++; \
- if (utf8 && c >= 0xc0) \
- { \
- int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \
- int gcss = 6*gcaa; \
- c = (c & _pcre_utf8_table3[gcaa]) << gcss; \
- while (gcaa-- > 0) \
- { \
- gcss -= 6; \
- c |= (*eptr++ & 0x3f) << gcss; \
- } \
- }
-
-/* Get the next UTF-8 character, not advancing the pointer, incrementing length
-if there are extra bytes. This is called when we know we are in UTF-8 mode. */
-
-#define GETCHARLEN(c, eptr, len) \
- c = *eptr; \
- if (c >= 0xc0) \
- { \
- int gcii; \
- int gcaa = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ \
- int gcss = 6*gcaa; \
- c = (c & _pcre_utf8_table3[gcaa]) << gcss; \
- for (gcii = 1; gcii <= gcaa; gcii++) \
- { \
- gcss -= 6; \
- c |= (eptr[gcii] & 0x3f) << gcss; \
- } \
- len += gcaa; \
- }
-
-/* If the pointer is not at the start of a character, move it back until
-it is. This is called only in UTF-8 mode - we don't put a test within the macro
-because almost all calls are already within a block of UTF-8 only code. */
-
-#define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--
-
-#endif
-
-
-/* In case there is no definition of offsetof() provided - though any proper
-Standard C system should have one. */
-
-#ifndef offsetof
-#define offsetof(p_type,field) ((size_t)&(((p_type *)0)->field))
-#endif
-
-
-/* These are the public options that can change during matching. */
-
-#define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL)
-
-/* Private flags containing information about the compiled regex. They used to
-live at the top end of the options word, but that got almost full, so now they
-are in a 16-bit flags word. */
-
-#define PCRE_NOPARTIAL 0x0001 /* can't use partial with this regex */
-#define PCRE_FIRSTSET 0x0002 /* first_byte is set */
-#define PCRE_REQCHSET 0x0004 /* req_byte is set */
-#define PCRE_STARTLINE 0x0008 /* start after \n for multiline */
-#define PCRE_JCHANGED 0x0010 /* j option used in regex */
-#define PCRE_HASCRORLF 0x0020 /* explicit \r or \n in pattern */
-
-/* Options for the "extra" block produced by pcre_study(). */
-
-#define PCRE_STUDY_MAPPED 0x01 /* a map of starting chars exists */
-
-/* Masks for identifying the public options that are permitted at compile
-time, run time, or study time, respectively. */
-
-#define PCRE_NEWLINE_BITS (PCRE_NEWLINE_CR|PCRE_NEWLINE_LF|PCRE_NEWLINE_ANY| \
- PCRE_NEWLINE_ANYCRLF)
-
-#define PUBLIC_OPTIONS \
- (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \
- PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY|PCRE_UTF8| \
- PCRE_NO_AUTO_CAPTURE|PCRE_NO_UTF8_CHECK|PCRE_AUTO_CALLOUT|PCRE_FIRSTLINE| \
- PCRE_DUPNAMES|PCRE_NEWLINE_BITS|PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE| \
- PCRE_JAVASCRIPT_COMPAT)
-
-#define PUBLIC_EXEC_OPTIONS \
- (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \
- PCRE_PARTIAL|PCRE_NEWLINE_BITS|PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)
-
-#define PUBLIC_DFA_EXEC_OPTIONS \
- (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \
- PCRE_PARTIAL|PCRE_DFA_SHORTEST|PCRE_DFA_RESTART|PCRE_NEWLINE_BITS| \
- PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)
-
-#define PUBLIC_STUDY_OPTIONS 0 /* None defined */
-
-/* Magic number to provide a small check against being handed junk. Also used
-to detect whether a pattern was compiled on a host of different endianness. */
-
-#define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */
-
-/* Negative values for the firstchar and reqchar variables */
-
-#define REQ_UNSET (-2)
-#define REQ_NONE (-1)
-
-/* The maximum remaining length of subject we are prepared to search for a
-req_byte match. */
-
-#define REQ_BYTE_MAX 1000
-
-/* Flags added to firstbyte or reqbyte; a "non-literal" item is either a
-variable-length repeat, or a anything other than literal characters. */
-
-#define REQ_CASELESS 0x0100 /* indicates caselessness */
-#define REQ_VARY 0x0200 /* reqbyte followed non-literal item */
-
-/* Miscellaneous definitions. The #ifndef is to pacify compiler warnings in
-environments where these macros are defined elsewhere. */
-
-#ifndef FALSE
-typedef int BOOL;
-
-#define FALSE 0
-#define TRUE 1
-#endif
-
-/* Escape items that are just an encoding of a particular data value. */
-
-#ifndef ESC_e
-#define ESC_e 27
-#endif
-
-#ifndef ESC_f
-#define ESC_f '\f'
-#endif
-
-#ifndef ESC_n
-#define ESC_n '\n'
-#endif
-
-#ifndef ESC_r
-#define ESC_r '\r'
-#endif
-
-/* We can't officially use ESC_t because it is a POSIX reserved identifier
-(presumably because of all the others like size_t). */
-
-#ifndef ESC_tee
-#define ESC_tee '\t'
-#endif
-
-/* Codes for different types of Unicode property */
-
-#define PT_ANY 0 /* Any property - matches all chars */
-#define PT_LAMP 1 /* L& - the union of Lu, Ll, Lt */
-#define PT_GC 2 /* General characteristic (e.g. L) */
-#define PT_PC 3 /* Particular characteristic (e.g. Lu) */
-#define PT_SC 4 /* Script (e.g. Han) */
-
-/* Flag bits and data types for the extended class (OP_XCLASS) for classes that
-contain UTF-8 characters with values greater than 255. */
-
-#define XCL_NOT 0x01 /* Flag: this is a negative class */
-#define XCL_MAP 0x02 /* Flag: a 32-byte map is present */
-
-#define XCL_END 0 /* Marks end of individual items */
-#define XCL_SINGLE 1 /* Single item (one multibyte char) follows */
-#define XCL_RANGE 2 /* A range (two multibyte chars) follows */
-#define XCL_PROP 3 /* Unicode property (2-byte property code follows) */
-#define XCL_NOTPROP 4 /* Unicode inverted property (ditto) */
-
-/* These are escaped items that aren't just an encoding of a particular data
-value such as \n. They must have non-zero values, as check_escape() returns
-their negation. Also, they must appear in the same order as in the opcode
-definitions below, up to ESC_z. There's a dummy for OP_ANY because it
-corresponds to "." rather than an escape sequence, and another for OP_ALLANY
-(which is used for [^] in JavaScript compatibility mode).
-
-The final escape must be ESC_REF as subsequent values are used for
-backreferences (\1, \2, \3, etc). There are two tests in the code for an escape
-greater than ESC_b and less than ESC_Z to detect the types that may be
-repeated. These are the types that consume characters. If any new escapes are
-put in between that don't consume a character, that code will have to change.
-*/
-
-enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s,
- ESC_W, ESC_w, ESC_dum1, ESC_dum2, ESC_C, ESC_P, ESC_p, ESC_R, ESC_H,
- ESC_h, ESC_V, ESC_v, ESC_X, ESC_Z, ESC_z, ESC_E, ESC_Q, ESC_g, ESC_k,
- ESC_REF };
-
-
-/* Opcode table: Starting from 1 (i.e. after OP_END), the values up to
-OP_EOD must correspond in order to the list of escapes immediately above.
-
-*** NOTE NOTE NOTE *** Whenever this list is updated, the two macro definitions
-that follow must also be updated to match. There is also a table called
-"coptable" in pcre_dfa_exec.c that must be updated. */
-
-enum {
- OP_END, /* 0 End of pattern */
-
- /* Values corresponding to backslashed metacharacters */
-
- OP_SOD, /* 1 Start of data: \A */
- OP_SOM, /* 2 Start of match (subject + offset): \G */
- OP_SET_SOM, /* 3 Set start of match (\K) */
- OP_NOT_WORD_BOUNDARY, /* 4 \B */
- OP_WORD_BOUNDARY, /* 5 \b */
- OP_NOT_DIGIT, /* 6 \D */
- OP_DIGIT, /* 7 \d */
- OP_NOT_WHITESPACE, /* 8 \S */
- OP_WHITESPACE, /* 9 \s */
- OP_NOT_WORDCHAR, /* 10 \W */
- OP_WORDCHAR, /* 11 \w */
- OP_ANY, /* 12 Match any character (subject to DOTALL) */
- OP_ALLANY, /* 13 Match any character (not subject to DOTALL) */
- OP_ANYBYTE, /* 14 Match any byte (\C); different to OP_ANY for UTF-8 */
- OP_NOTPROP, /* 15 \P (not Unicode property) */
- OP_PROP, /* 16 \p (Unicode property) */
- OP_ANYNL, /* 17 \R (any newline sequence) */
- OP_NOT_HSPACE, /* 18 \H (not horizontal whitespace) */
- OP_HSPACE, /* 19 \h (horizontal whitespace) */
- OP_NOT_VSPACE, /* 20 \V (not vertical whitespace) */
- OP_VSPACE, /* 21 \v (vertical whitespace) */
- OP_EXTUNI, /* 22 \X (extended Unicode sequence */
- OP_EODN, /* 23 End of data or \n at end of data: \Z. */
- OP_EOD, /* 24 End of data: \z */
-
- OP_OPT, /* 25 Set runtime options */
- OP_CIRC, /* 26 Start of line - varies with multiline switch */
- OP_DOLL, /* 27 End of line - varies with multiline switch */
- OP_CHAR, /* 28 Match one character, casefully */
- OP_CHARNC, /* 29 Match one character, caselessly */
- OP_NOT, /* 30 Match one character, not the following one */
-
- OP_STAR, /* 31 The maximizing and minimizing versions of */
- OP_MINSTAR, /* 32 these six opcodes must come in pairs, with */
- OP_PLUS, /* 33 the minimizing one second. */
- OP_MINPLUS, /* 34 This first set applies to single characters.*/
- OP_QUERY, /* 35 */
- OP_MINQUERY, /* 36 */
-
- OP_UPTO, /* 37 From 0 to n matches */
- OP_MINUPTO, /* 38 */
- OP_EXACT, /* 39 Exactly n matches */
-
- OP_POSSTAR, /* 40 Possessified star */
- OP_POSPLUS, /* 41 Possessified plus */
- OP_POSQUERY, /* 42 Posesssified query */
- OP_POSUPTO, /* 43 Possessified upto */
-
- OP_NOTSTAR, /* 44 The maximizing and minimizing versions of */
- OP_NOTMINSTAR, /* 45 these six opcodes must come in pairs, with */
- OP_NOTPLUS, /* 46 the minimizing one second. They must be in */
- OP_NOTMINPLUS, /* 47 exactly the same order as those above. */
- OP_NOTQUERY, /* 48 This set applies to "not" single characters. */
- OP_NOTMINQUERY, /* 49 */
-
- OP_NOTUPTO, /* 50 From 0 to n matches */
- OP_NOTMINUPTO, /* 51 */
- OP_NOTEXACT, /* 52 Exactly n matches */
-
- OP_NOTPOSSTAR, /* 53 Possessified versions */
- OP_NOTPOSPLUS, /* 54 */
- OP_NOTPOSQUERY, /* 55 */
- OP_NOTPOSUPTO, /* 56 */
-
- OP_TYPESTAR, /* 57 The maximizing and minimizing versions of */
- OP_TYPEMINSTAR, /* 58 these six opcodes must come in pairs, with */
- OP_TYPEPLUS, /* 59 the minimizing one second. These codes must */
- OP_TYPEMINPLUS, /* 60 be in exactly the same order as those above. */
- OP_TYPEQUERY, /* 61 This set applies to character types such as \d */
- OP_TYPEMINQUERY, /* 62 */
-
- OP_TYPEUPTO, /* 63 From 0 to n matches */
- OP_TYPEMINUPTO, /* 64 */
- OP_TYPEEXACT, /* 65 Exactly n matches */
-
- OP_TYPEPOSSTAR, /* 66 Possessified versions */
- OP_TYPEPOSPLUS, /* 67 */
- OP_TYPEPOSQUERY, /* 68 */
- OP_TYPEPOSUPTO, /* 69 */
-
- OP_CRSTAR, /* 70 The maximizing and minimizing versions of */
- OP_CRMINSTAR, /* 71 all these opcodes must come in pairs, with */
- OP_CRPLUS, /* 72 the minimizing one second. These codes must */
- OP_CRMINPLUS, /* 73 be in exactly the same order as those above. */
- OP_CRQUERY, /* 74 These are for character classes and back refs */
- OP_CRMINQUERY, /* 75 */
- OP_CRRANGE, /* 76 These are different to the three sets above. */
- OP_CRMINRANGE, /* 77 */
-
- OP_CLASS, /* 78 Match a character class, chars < 256 only */
- OP_NCLASS, /* 79 Same, but the bitmap was created from a negative
- class - the difference is relevant only when a UTF-8
- character > 255 is encountered. */
-
- OP_XCLASS, /* 80 Extended class for handling UTF-8 chars within the
- class. This does both positive and negative. */
-
- OP_REF, /* 81 Match a back reference */
- OP_RECURSE, /* 82 Match a numbered subpattern (possibly recursive) */
- OP_CALLOUT, /* 83 Call out to external function if provided */
-
- OP_ALT, /* 84 Start of alternation */
- OP_KET, /* 85 End of group that doesn't have an unbounded repeat */
- OP_KETRMAX, /* 86 These two must remain together and in this */
- OP_KETRMIN, /* 87 order. They are for groups the repeat for ever. */
-
- /* The assertions must come before BRA, CBRA, ONCE, and COND.*/
-
- OP_ASSERT, /* 88 Positive lookahead */
- OP_ASSERT_NOT, /* 89 Negative lookahead */
- OP_ASSERTBACK, /* 90 Positive lookbehind */
- OP_ASSERTBACK_NOT, /* 91 Negative lookbehind */
- OP_REVERSE, /* 92 Move pointer back - used in lookbehind assertions */
-
- /* ONCE, BRA, CBRA, and COND must come after the assertions, with ONCE first,
- as there's a test for >= ONCE for a subpattern that isn't an assertion. */
-
- OP_ONCE, /* 93 Atomic group */
- OP_BRA, /* 94 Start of non-capturing bracket */
- OP_CBRA, /* 95 Start of capturing bracket */
- OP_COND, /* 96 Conditional group */
-
- /* These three must follow the previous three, in the same order. There's a
- check for >= SBRA to distinguish the two sets. */
-
- OP_SBRA, /* 97 Start of non-capturing bracket, check empty */
- OP_SCBRA, /* 98 Start of capturing bracket, check empty */
- OP_SCOND, /* 99 Conditional group, check empty */
-
- OP_CREF, /* 100 Used to hold a capture number as condition */
- OP_RREF, /* 101 Used to hold a recursion number as condition */
- OP_DEF, /* 102 The DEFINE condition */
-
- OP_BRAZERO, /* 103 These two must remain together and in this */
- OP_BRAMINZERO, /* 104 order. */
-
- /* These are backtracking control verbs */
-
- OP_PRUNE, /* 105 */
- OP_SKIP, /* 106 */
- OP_THEN, /* 107 */
- OP_COMMIT, /* 108 */
-
- /* These are forced failure and success verbs */
-
- OP_FAIL, /* 109 */
- OP_ACCEPT, /* 110 */
-
- /* This is used to skip a subpattern with a {0} quantifier */
-
- OP_SKIPZERO /* 111 */
-};
-
-
-/* This macro defines textual names for all the opcodes. These are used only
-for debugging. The macro is referenced only in pcre_printint.c. */
-
-#define OP_NAME_LIST \
- "End", "\\A", "\\G", "\\K", "\\B", "\\b", "\\D", "\\d", \
- "\\S", "\\s", "\\W", "\\w", "Any", "AllAny", "Anybyte", \
- "notprop", "prop", "\\R", "\\H", "\\h", "\\V", "\\v", \
- "extuni", "\\Z", "\\z", \
- "Opt", "^", "$", "char", "charnc", "not", \
- "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \
- "*+","++", "?+", "{", \
- "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \
- "*+","++", "?+", "{", \
- "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \
- "*+","++", "?+", "{", \
- "*", "*?", "+", "+?", "?", "??", "{", "{", \
- "class", "nclass", "xclass", "Ref", "Recurse", "Callout", \
- "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not", \
- "AssertB", "AssertB not", "Reverse", \
- "Once", "Bra", "CBra", "Cond", "SBra", "SCBra", "SCond", \
- "Cond ref", "Cond rec", "Cond def", "Brazero", "Braminzero", \
- "*PRUNE", "*SKIP", "*THEN", "*COMMIT", "*FAIL", "*ACCEPT", \
- "Skip zero"
-
-
-/* This macro defines the length of fixed length operations in the compiled
-regex. The lengths are used when searching for specific things, and also in the
-debugging printing of a compiled regex. We use a macro so that it can be
-defined close to the definitions of the opcodes themselves.
-
-As things have been extended, some of these are no longer fixed lenths, but are
-minima instead. For example, the length of a single-character repeat may vary
-in UTF-8 mode. The code that uses this table must know about such things. */
-
-#define OP_LENGTHS \
- 1, /* End */ \
- 1, 1, 1, 1, 1, /* \A, \G, \K, \B, \b */ \
- 1, 1, 1, 1, 1, 1, /* \D, \d, \S, \s, \W, \w */ \
- 1, 1, 1, /* Any, AllAny, Anybyte */ \
- 3, 3, 1, /* NOTPROP, PROP, EXTUNI */ \
- 1, 1, 1, 1, 1, /* \R, \H, \h, \V, \v */ \
- 1, 1, 2, 1, 1, /* \Z, \z, Opt, ^, $ */ \
- 2, /* Char - the minimum length */ \
- 2, /* Charnc - the minimum length */ \
- 2, /* not */ \
- /* Positive single-char repeats ** These are */ \
- 2, 2, 2, 2, 2, 2, /* *, *?, +, +?, ?, ?? ** minima in */ \
- 4, 4, 4, /* upto, minupto, exact ** UTF-8 mode */ \
- 2, 2, 2, 4, /* *+, ++, ?+, upto+ */ \
- /* Negative single-char repeats - only for chars < 256 */ \
- 2, 2, 2, 2, 2, 2, /* NOT *, *?, +, +?, ?, ?? */ \
- 4, 4, 4, /* NOT upto, minupto, exact */ \
- 2, 2, 2, 4, /* Possessive *, +, ?, upto */ \
- /* Positive type repeats */ \
- 2, 2, 2, 2, 2, 2, /* Type *, *?, +, +?, ?, ?? */ \
- 4, 4, 4, /* Type upto, minupto, exact */ \
- 2, 2, 2, 4, /* Possessive *+, ++, ?+, upto+ */ \
- /* Character class & ref repeats */ \
- 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ \
- 5, 5, /* CRRANGE, CRMINRANGE */ \
- 33, /* CLASS */ \
- 33, /* NCLASS */ \
- 0, /* XCLASS - variable length */ \
- 3, /* REF */ \
- 1+LINK_SIZE, /* RECURSE */ \
- 2+2*LINK_SIZE, /* CALLOUT */ \
- 1+LINK_SIZE, /* Alt */ \
- 1+LINK_SIZE, /* Ket */ \
- 1+LINK_SIZE, /* KetRmax */ \
- 1+LINK_SIZE, /* KetRmin */ \
- 1+LINK_SIZE, /* Assert */ \
- 1+LINK_SIZE, /* Assert not */ \
- 1+LINK_SIZE, /* Assert behind */ \
- 1+LINK_SIZE, /* Assert behind not */ \
- 1+LINK_SIZE, /* Reverse */ \
- 1+LINK_SIZE, /* ONCE */ \
- 1+LINK_SIZE, /* BRA */ \
- 3+LINK_SIZE, /* CBRA */ \
- 1+LINK_SIZE, /* COND */ \
- 1+LINK_SIZE, /* SBRA */ \
- 3+LINK_SIZE, /* SCBRA */ \
- 1+LINK_SIZE, /* SCOND */ \
- 3, /* CREF */ \
- 3, /* RREF */ \
- 1, /* DEF */ \
- 1, 1, /* BRAZERO, BRAMINZERO */ \
- 1, 1, 1, 1, /* PRUNE, SKIP, THEN, COMMIT, */ \
- 1, 1, 1 /* FAIL, ACCEPT, SKIPZERO */
-
-
-/* A magic value for OP_RREF to indicate the "any recursion" condition. */
-
-#define RREF_ANY 0xffff
-
-/* Error code numbers. They are given names so that they can more easily be
-tracked. */
-
-enum { ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9,
- ERR10, ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19,
- ERR20, ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29,
- ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39,
- ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,
- ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
- ERR60, ERR61, ERR62, ERR63, ERR64 };
-
-/* The real format of the start of the pcre block; the index of names and the
-code vector run on as long as necessary after the end. We store an explicit
-offset to the name table so that if a regex is compiled on one host, saved, and
-then run on another where the size of pointers is different, all might still
-be well. For the case of compiled-on-4 and run-on-8, we include an extra
-pointer that is always NULL. For future-proofing, a few dummy fields were
-originally included - even though you can never get this planning right - but
-there is only one left now.
-
-NOTE NOTE NOTE:
-Because people can now save and re-use compiled patterns, any additions to this
-structure should be made at the end, and something earlier (e.g. a new
-flag in the options or one of the dummy fields) should indicate that the new
-fields are present. Currently PCRE always sets the dummy fields to zero.
-NOTE NOTE NOTE:
-*/
-
-typedef struct real_pcre {
- pcre_uint32 magic_number;
- pcre_uint32 size; /* Total that was malloced */
- pcre_uint32 options; /* Public options */
- pcre_uint16 flags; /* Private flags */
- pcre_uint16 dummy1; /* For future use */
- pcre_uint16 top_bracket;
- pcre_uint16 top_backref;
- pcre_uint16 first_byte;
- pcre_uint16 req_byte;
- pcre_uint16 name_table_offset; /* Offset to name table that follows */
- pcre_uint16 name_entry_size; /* Size of any name items */
- pcre_uint16 name_count; /* Number of name items */
- pcre_uint16 ref_count; /* Reference count */
-
- const unsigned char *tables; /* Pointer to tables or NULL for std */
- const unsigned char *nullpad; /* NULL padding */
-} real_pcre;
-
-/* The format of the block used to store data from pcre_study(). The same
-remark (see NOTE above) about extending this structure applies. */
-
-typedef struct pcre_study_data {
- pcre_uint32 size; /* Total that was malloced */
- pcre_uint32 options;
- uschar start_bits[32];
-} pcre_study_data;
-
-/* Structure for passing "static" information around between the functions
-doing the compiling, so that they are thread-safe. */
-
-typedef struct compile_data {
- const uschar *lcc; /* Points to lower casing table */
- const uschar *fcc; /* Points to case-flipping table */
- const uschar *cbits; /* Points to character type table */
- const uschar *ctypes; /* Points to table of type maps */
- const uschar *start_workspace;/* The start of working space */
- const uschar *start_code; /* The start of the compiled code */
- const uschar *start_pattern; /* The start of the pattern */
- const uschar *end_pattern; /* The end of the pattern */
- uschar *hwm; /* High watermark of workspace */
- uschar *name_table; /* The name/number table */
- int names_found; /* Number of entries so far */
- int name_entry_size; /* Size of each entry */
- int bracount; /* Count of capturing parens as we compile */
- int final_bracount; /* Saved value after first pass */
- int top_backref; /* Maximum back reference */
- unsigned int backref_map; /* Bitmap of low back refs */
- int external_options; /* External (initial) options */
- int external_flags; /* External flag bits to be set */
- int req_varyopt; /* "After variable item" flag for reqbyte */
- BOOL had_accept; /* (*ACCEPT) encountered */
- int nltype; /* Newline type */
- int nllen; /* Newline string length */
- uschar nl[4]; /* Newline string when fixed length */
-} compile_data;
-
-/* Structure for maintaining a chain of pointers to the currently incomplete
-branches, for testing for left recursion. */
-
-typedef struct branch_chain {
- struct branch_chain *outer;
- uschar *current;
-} branch_chain;
-
-/* Structure for items in a linked list that represents an explicit recursive
-call within the pattern. */
-
-typedef struct recursion_info {
- struct recursion_info *prevrec; /* Previous recursion record (or NULL) */
- int group_num; /* Number of group that was called */
- const uschar *after_call; /* "Return value": points after the call in the expr */
- USPTR save_start; /* Old value of mstart */
- int *offset_save; /* Pointer to start of saved offsets */
- int saved_max; /* Number of saved offsets */
-} recursion_info;
-
-/* Structure for building a chain of data for holding the values of the subject
-pointer at the start of each subpattern, so as to detect when an empty string
-has been matched by a subpattern - to break infinite loops. */
-
-typedef struct eptrblock {
- struct eptrblock *epb_prev;
- USPTR epb_saved_eptr;
-} eptrblock;
-
-
-/* Structure for passing "static" information around between the functions
-doing traditional NFA matching, so that they are thread-safe. */
-
-typedef struct match_data {
- unsigned long int match_call_count; /* As it says */
- unsigned long int match_limit; /* As it says */
- unsigned long int match_limit_recursion; /* As it says */
- int *offset_vector; /* Offset vector */
- int offset_end; /* One past the end */
- int offset_max; /* The maximum usable for return data */
- int nltype; /* Newline type */
- int nllen; /* Newline string length */
- uschar nl[4]; /* Newline string when fixed */
- const uschar *lcc; /* Points to lower casing table */
- const uschar *ctypes; /* Points to table of type maps */
- BOOL offset_overflow; /* Set if too many extractions */
- BOOL notbol; /* NOTBOL flag */
- BOOL noteol; /* NOTEOL flag */
- BOOL utf8; /* UTF8 flag */
- BOOL jscript_compat; /* JAVASCRIPT_COMPAT flag */
- BOOL endonly; /* Dollar not before final \n */
- BOOL notempty; /* Empty string match not wanted */
- BOOL partial; /* PARTIAL flag */
- BOOL hitend; /* Hit the end of the subject at some point */
- BOOL bsr_anycrlf; /* \R is just any CRLF, not full Unicode */
- const uschar *start_code; /* For use when recursing */
- USPTR start_subject; /* Start of the subject string */
- USPTR end_subject; /* End of the subject string */
- USPTR start_match_ptr; /* Start of matched string */
- USPTR end_match_ptr; /* Subject position at end match */
- int end_offset_top; /* Highwater mark at end of match */
- int capture_last; /* Most recent capture number */
- int start_offset; /* The start offset value */
- eptrblock *eptrchain; /* Chain of eptrblocks for tail recursions */
- int eptrn; /* Next free eptrblock */
- recursion_info *recursive; /* Linked list of recursion data */
- void *callout_data; /* To pass back to callouts */
-} match_data;
-
-/* A similar structure is used for the same purpose by the DFA matching
-functions. */
-
-typedef struct dfa_match_data {
- const uschar *start_code; /* Start of the compiled pattern */
- const uschar *start_subject; /* Start of the subject string */
- const uschar *end_subject; /* End of subject string */
- const uschar *tables; /* Character tables */
- int moptions; /* Match options */
- int poptions; /* Pattern options */
- int nltype; /* Newline type */
- int nllen; /* Newline string length */
- uschar nl[4]; /* Newline string when fixed */
- void *callout_data; /* To pass back to callouts */
-} dfa_match_data;
-
-/* Bit definitions for entries in the pcre_ctypes table. */
-
-#define ctype_space 0x01
-#define ctype_letter 0x02
-#define ctype_digit 0x04
-#define ctype_xdigit 0x08
-#define ctype_word 0x10 /* alphanumeric or '_' */
-#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */
-
-/* Offsets for the bitmap tables in pcre_cbits. Each table contains a set
-of bits for a class map. Some classes are built by combining these tables. */
-
-#define cbit_space 0 /* [:space:] or \s */
-#define cbit_xdigit 32 /* [:xdigit:] */
-#define cbit_digit 64 /* [:digit:] or \d */
-#define cbit_upper 96 /* [:upper:] */
-#define cbit_lower 128 /* [:lower:] */
-#define cbit_word 160 /* [:word:] or \w */
-#define cbit_graph 192 /* [:graph:] */
-#define cbit_print 224 /* [:print:] */
-#define cbit_punct 256 /* [:punct:] */
-#define cbit_cntrl 288 /* [:cntrl:] */
-#define cbit_length 320 /* Length of the cbits table */
-
-/* Offsets of the various tables from the base tables pointer, and
-total length. */
-
-#define lcc_offset 0
-#define fcc_offset 256
-#define cbits_offset 512
-#define ctypes_offset (cbits_offset + cbit_length)
-#define tables_length (ctypes_offset + 256)
-
-/* Layout of the UCP type table that translates property names into types and
-codes. Each entry used to point directly to a name, but to reduce the number of
-relocations in shared libraries, it now has an offset into a single string
-instead. */
-
-typedef struct {
- pcre_uint16 name_offset;
- pcre_uint16 type;
- pcre_uint16 value;
-} ucp_type_table;
-
-
-/* Internal shared data tables. These are tables that are used by more than one
-of the exported public functions. They have to be "external" in the C sense,
-but are not part of the PCRE public API. The data for these tables is in the
-pcre_tables.c module. */
-
-extern const int _pcre_utf8_table1[];
-extern const int _pcre_utf8_table2[];
-extern const int _pcre_utf8_table3[];
-extern const uschar _pcre_utf8_table4[];
-
-extern const int _pcre_utf8_table1_size;
-
-extern const char _pcre_utt_names[];
-extern const ucp_type_table _pcre_utt[];
-extern const int _pcre_utt_size;
-
-extern const uschar _pcre_default_tables[];
-
-extern const uschar _pcre_OP_lengths[];
-
-
-/* Internal shared functions. These are functions that are used by more than
-one of the exported public functions. They have to be "external" in the C
-sense, but are not part of the PCRE public API. */
-
-extern BOOL _pcre_is_newline(const uschar *, int, const uschar *,
- int *, BOOL);
-extern int _pcre_ord2utf8(int, uschar *);
-extern real_pcre *_pcre_try_flipped(const real_pcre *, real_pcre *,
- const pcre_study_data *, pcre_study_data *);
-extern int _pcre_valid_utf8(const uschar *, int);
-extern BOOL _pcre_was_newline(const uschar *, int, const uschar *,
- int *, BOOL);
-extern BOOL _pcre_xclass(int, const uschar *);
-
-
-/* Unicode character database (UCD) */
-
-typedef struct {
- uschar script;
- uschar chartype;
- pcre_int32 other_case;
-} ucd_record;
-
-extern const ucd_record _pcre_ucd_records[];
-extern const uschar _pcre_ucd_stage1[];
-extern const pcre_uint16 _pcre_ucd_stage2[];
-extern const int _pcre_ucp_gentype[];
-
-
-/* UCD access macros */
-
-#define UCD_BLOCK_SIZE 128
-#define GET_UCD(ch) (_pcre_ucd_records + \
- _pcre_ucd_stage2[_pcre_ucd_stage1[(ch) / UCD_BLOCK_SIZE] * \
- UCD_BLOCK_SIZE + ch % UCD_BLOCK_SIZE])
-
-#define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype
-#define UCD_SCRIPT(ch) GET_UCD(ch)->script
-#define UCD_CATEGORY(ch) _pcre_ucp_gentype[UCD_CHARTYPE(ch)]
-#define UCD_OTHERCASE(ch) (ch + GET_UCD(ch)->other_case)
-
-#endif
-
-/* End of pcre_internal.h */
diff --git a/Utilities/Poco/Foundation/src/pcre_maketables.c b/Utilities/Poco/Foundation/src/pcre_maketables.c
deleted file mode 100755
index b06e22c87f..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_maketables.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains the external function pcre_maketables(), which builds
-character tables for PCRE in the current locale. The file is compiled on its
-own as part of the PCRE library. However, it is also included in the
-compilation of dftables.c, in which case the macro DFTABLES is defined. */
-
-
-#ifndef DFTABLES
-# include "pcre_config.h"
-# include "pcre_internal.h"
-#endif
-
-
-/*************************************************
-* Create PCRE character tables *
-*************************************************/
-
-/* This function builds a set of character tables for use by PCRE and returns
-a pointer to them. They are build using the ctype functions, and consequently
-their contents will depend upon the current locale setting. When compiled as
-part of the library, the store is obtained via pcre_malloc(), but when compiled
-inside dftables, use malloc().
-
-Arguments: none
-Returns: pointer to the contiguous block of data
-*/
-
-const unsigned char *
-pcre_maketables(void)
-{
-unsigned char *yield, *p;
-int i;
-
-#ifndef DFTABLES
-yield = (unsigned char*)(pcre_malloc)(tables_length);
-#else
-yield = (unsigned char*)malloc(tables_length);
-#endif
-
-if (yield == NULL) return NULL;
-p = yield;
-
-/* First comes the lower casing table */
-
-for (i = 0; i < 256; i++) *p++ = tolower(i);
-
-/* Next the case-flipping table */
-
-for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i);
-
-/* Then the character class tables. Don't try to be clever and save effort on
-exclusive ones - in some locales things may be different. Note that the table
-for "space" includes everything "isspace" gives, including VT in the default
-locale. This makes it work for the POSIX class [:space:]. Note also that it is
-possible for a character to be alnum or alpha without being lower or upper,
-such as "male and female ordinals" (\xAA and \xBA) in the fr_FR locale (at
-least under Debian Linux's locales as of 12/2005). So we must test for alnum
-specially. */
-
-memset(p, 0, cbit_length);
-for (i = 0; i < 256; i++)
- {
- if (isdigit(i)) p[cbit_digit + i/8] |= 1 << (i&7);
- if (isupper(i)) p[cbit_upper + i/8] |= 1 << (i&7);
- if (islower(i)) p[cbit_lower + i/8] |= 1 << (i&7);
- if (isalnum(i)) p[cbit_word + i/8] |= 1 << (i&7);
- if (i == '_') p[cbit_word + i/8] |= 1 << (i&7);
- if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7);
- if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7);
- if (isgraph(i)) p[cbit_graph + i/8] |= 1 << (i&7);
- if (isprint(i)) p[cbit_print + i/8] |= 1 << (i&7);
- if (ispunct(i)) p[cbit_punct + i/8] |= 1 << (i&7);
- if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1 << (i&7);
- }
-p += cbit_length;
-
-/* Finally, the character type table. In this, we exclude VT from the white
-space chars, because Perl doesn't recognize it as such for \s and for comments
-within regexes. */
-
-for (i = 0; i < 256; i++)
- {
- int x = 0;
- if (i != 0x0b && isspace(i)) x += ctype_space;
- if (isalpha(i)) x += ctype_letter;
- if (isdigit(i)) x += ctype_digit;
- if (isxdigit(i)) x += ctype_xdigit;
- if (isalnum(i) || i == '_') x += ctype_word;
-
- /* Note: strchr includes the terminating zero in the characters it considers.
- In this instance, that is ok because we want binary zero to be flagged as a
- meta-character, which in this sense is any character that terminates a run
- of data characters. */
-
- if (strchr("\\*+?{^.$|()[", i) != 0) x += ctype_meta;
- *p++ = x;
- }
-
-return yield;
-}
-
-/* End of pcre_maketables.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_newline.c b/Utilities/Poco/Foundation/src/pcre_newline.c
deleted file mode 100755
index 95e825f25f..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_newline.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains internal functions for testing newlines when more than
-one kind of newline is to be recognized. When a newline is found, its length is
-returned. In principle, we could implement several newline "types", each
-referring to a different set of newline characters. At present, PCRE supports
-only NLTYPE_FIXED, which gets handled without these functions, NLTYPE_ANYCRLF,
-and NLTYPE_ANY. The full list of Unicode newline characters is taken from
-http://unicode.org/unicode/reports/tr18/. */
-
-
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-
-
-/*************************************************
-* Check for newline at given position *
-*************************************************/
-
-/* It is guaranteed that the initial value of ptr is less than the end of the
-string that is being processed.
-
-Arguments:
- ptr pointer to possible newline
- type the newline type
- endptr pointer to the end of the string
- lenptr where to return the length
- utf8 TRUE if in utf8 mode
-
-Returns: TRUE or FALSE
-*/
-
-BOOL
-_pcre_is_newline(const uschar *ptr, int type, const uschar *endptr,
- int *lenptr, BOOL utf8)
-{
-int c;
-if (utf8) { GETCHAR(c, ptr); } else c = *ptr;
-
-if (type == NLTYPE_ANYCRLF) switch(c)
- {
- case 0x000a: *lenptr = 1; return TRUE; /* LF */
- case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1;
- return TRUE; /* CR */
- default: return FALSE;
- }
-
-/* NLTYPE_ANY */
-
-else switch(c)
- {
- case 0x000a: /* LF */
- case 0x000b: /* VT */
- case 0x000c: *lenptr = 1; return TRUE; /* FF */
- case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1;
- return TRUE; /* CR */
- case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */
- case 0x2028: /* LS */
- case 0x2029: *lenptr = 3; return TRUE; /* PS */
- default: return FALSE;
- }
-}
-
-
-
-/*************************************************
-* Check for newline at previous position *
-*************************************************/
-
-/* It is guaranteed that the initial value of ptr is greater than the start of
-the string that is being processed.
-
-Arguments:
- ptr pointer to possible newline
- type the newline type
- startptr pointer to the start of the string
- lenptr where to return the length
- utf8 TRUE if in utf8 mode
-
-Returns: TRUE or FALSE
-*/
-
-BOOL
-_pcre_was_newline(const uschar *ptr, int type, const uschar *startptr,
- int *lenptr, BOOL utf8)
-{
-int c;
-ptr--;
-#ifdef SUPPORT_UTF8
-if (utf8)
- {
- BACKCHAR(ptr);
- GETCHAR(c, ptr);
- }
-else c = *ptr;
-#else /* no UTF-8 support */
-c = *ptr;
-#endif /* SUPPORT_UTF8 */
-
-if (type == NLTYPE_ANYCRLF) switch(c)
- {
- case 0x000a: *lenptr = (ptr > startptr && ptr[-1] == 0x0d)? 2 : 1;
- return TRUE; /* LF */
- case 0x000d: *lenptr = 1; return TRUE; /* CR */
- default: return FALSE;
- }
-
-else switch(c)
- {
- case 0x000a: *lenptr = (ptr > startptr && ptr[-1] == 0x0d)? 2 : 1;
- return TRUE; /* LF */
- case 0x000b: /* VT */
- case 0x000c: /* FF */
- case 0x000d: *lenptr = 1; return TRUE; /* CR */
- case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */
- case 0x2028: /* LS */
- case 0x2029: *lenptr = 3; return TRUE; /* PS */
- default: return FALSE;
- }
-}
-
-/* End of pcre_newline.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_ord2utf8.c b/Utilities/Poco/Foundation/src/pcre_ord2utf8.c
deleted file mode 100755
index f4f1381a27..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_ord2utf8.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This file contains a private PCRE function that converts an ordinal
-character value into a UTF8 string. */
-
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-
-/*************************************************
-* Convert character value to UTF-8 *
-*************************************************/
-
-/* This function takes an integer value in the range 0 - 0x7fffffff
-and encodes it as a UTF-8 character in 0 to 6 bytes.
-
-Arguments:
- cvalue the character value
- buffer pointer to buffer for result - at least 6 bytes long
-
-Returns: number of characters placed in the buffer
-*/
-
-int
-_pcre_ord2utf8(int cvalue, uschar *buffer)
-{
-#ifdef SUPPORT_UTF8
-register int i, j;
-for (i = 0; i < _pcre_utf8_table1_size; i++)
- if (cvalue <= _pcre_utf8_table1[i]) break;
-buffer += i;
-for (j = i; j > 0; j--)
- {
- *buffer-- = 0x80 | (cvalue & 0x3f);
- cvalue >>= 6;
- }
-*buffer = _pcre_utf8_table2[i] | cvalue;
-return i + 1;
-#else
-(void)(cvalue); /* Keep compiler happy; this function won't ever be */
-(void)(buffer); /* called when SUPPORT_UTF8 is not defined. */
-return 0;
-#endif
-}
-
-/* End of pcre_ord2utf8.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_study.c b/Utilities/Poco/Foundation/src/pcre_study.c
deleted file mode 100755
index 12ffee0ee8..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_study.c
+++ /dev/null
@@ -1,585 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains the external function pcre_study(), along with local
-supporting functions. */
-
-
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-
-/* Returns from set_start_bits() */
-
-enum { SSB_FAIL, SSB_DONE, SSB_CONTINUE };
-
-
-/*************************************************
-* Set a bit and maybe its alternate case *
-*************************************************/
-
-/* Given a character, set its bit in the table, and also the bit for the other
-version of a letter if we are caseless.
-
-Arguments:
- start_bits points to the bit map
- c is the character
- caseless the caseless flag
- cd the block with char table pointers
-
-Returns: nothing
-*/
-
-static void
-set_bit(uschar *start_bits, unsigned int c, BOOL caseless, compile_data *cd)
-{
-start_bits[c/8] |= (1 << (c&7));
-if (caseless && (cd->ctypes[c] & ctype_letter) != 0)
- start_bits[cd->fcc[c]/8] |= (1 << (cd->fcc[c]&7));
-}
-
-
-
-/*************************************************
-* Create bitmap of starting bytes *
-*************************************************/
-
-/* This function scans a compiled unanchored expression recursively and
-attempts to build a bitmap of the set of possible starting bytes. As time goes
-by, we may be able to get more clever at doing this. The SSB_CONTINUE return is
-useful for parenthesized groups in patterns such as (a*)b where the group
-provides some optional starting bytes but scanning must continue at the outer
-level to find at least one mandatory byte. At the outermost level, this
-function fails unless the result is SSB_DONE.
-
-Arguments:
- code points to an expression
- start_bits points to a 32-byte table, initialized to 0
- caseless the current state of the caseless flag
- utf8 TRUE if in UTF-8 mode
- cd the block with char table pointers
-
-Returns: SSB_FAIL => Failed to find any starting bytes
- SSB_DONE => Found mandatory starting bytes
- SSB_CONTINUE => Found optional starting bytes
-*/
-
-static int
-set_start_bits(const uschar *code, uschar *start_bits, BOOL caseless,
- BOOL utf8, compile_data *cd)
-{
-register int c;
-int yield = SSB_DONE;
-
-#if 0
-/* ========================================================================= */
-/* The following comment and code was inserted in January 1999. In May 2006,
-when it was observed to cause compiler warnings about unused values, I took it
-out again. If anybody is still using OS/2, they will have to put it back
-manually. */
-
-/* This next statement and the later reference to dummy are here in order to
-trick the optimizer of the IBM C compiler for OS/2 into generating correct
-code. Apparently IBM isn't going to fix the problem, and we would rather not
-disable optimization (in this module it actually makes a big difference, and
-the pcre module can use all the optimization it can get). */
-
-volatile int dummy;
-/* ========================================================================= */
-#endif
-
-do
- {
- const uschar *tcode = code + (((int)*code == OP_CBRA)? 3:1) + LINK_SIZE;
- BOOL try_next = TRUE;
-
- while (try_next) /* Loop for items in this branch */
- {
- int rc;
- switch(*tcode)
- {
- /* Fail if we reach something we don't understand */
-
- default:
- return SSB_FAIL;
-
- /* If we hit a bracket or a positive lookahead assertion, recurse to set
- bits from within the subpattern. If it can't find anything, we have to
- give up. If it finds some mandatory character(s), we are done for this
- branch. Otherwise, carry on scanning after the subpattern. */
-
- case OP_BRA:
- case OP_SBRA:
- case OP_CBRA:
- case OP_SCBRA:
- case OP_ONCE:
- case OP_ASSERT:
- rc = set_start_bits(tcode, start_bits, caseless, utf8, cd);
- if (rc == SSB_FAIL) return SSB_FAIL;
- if (rc == SSB_DONE) try_next = FALSE; else
- {
- do tcode += GET(tcode, 1); while (*tcode == OP_ALT);
- tcode += 1 + LINK_SIZE;
- }
- break;
-
- /* If we hit ALT or KET, it means we haven't found anything mandatory in
- this branch, though we might have found something optional. For ALT, we
- continue with the next alternative, but we have to arrange that the final
- result from subpattern is SSB_CONTINUE rather than SSB_DONE. For KET,
- return SSB_CONTINUE: if this is the top level, that indicates failure,
- but after a nested subpattern, it causes scanning to continue. */
-
- case OP_ALT:
- yield = SSB_CONTINUE;
- try_next = FALSE;
- break;
-
- case OP_KET:
- case OP_KETRMAX:
- case OP_KETRMIN:
- return SSB_CONTINUE;
-
- /* Skip over callout */
-
- case OP_CALLOUT:
- tcode += 2 + 2*LINK_SIZE;
- break;
-
- /* Skip over lookbehind and negative lookahead assertions */
-
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- do tcode += GET(tcode, 1); while (*tcode == OP_ALT);
- tcode += 1 + LINK_SIZE;
- break;
-
- /* Skip over an option setting, changing the caseless flag */
-
- case OP_OPT:
- caseless = (tcode[1] & PCRE_CASELESS) != 0;
- tcode += 2;
- break;
-
- /* BRAZERO does the bracket, but carries on. */
-
- case OP_BRAZERO:
- case OP_BRAMINZERO:
- if (set_start_bits(++tcode, start_bits, caseless, utf8, cd) == SSB_FAIL)
- return SSB_FAIL;
-/* =========================================================================
- See the comment at the head of this function concerning the next line,
- which was an old fudge for the benefit of OS/2.
- dummy = 1;
- ========================================================================= */
- do tcode += GET(tcode,1); while (*tcode == OP_ALT);
- tcode += 1 + LINK_SIZE;
- break;
-
- /* SKIPZERO skips the bracket. */
-
- case OP_SKIPZERO:
- tcode++;
- do tcode += GET(tcode,1); while (*tcode == OP_ALT);
- tcode += 1 + LINK_SIZE;
- break;
-
- /* Single-char * or ? sets the bit and tries the next item */
-
- case OP_STAR:
- case OP_MINSTAR:
- case OP_POSSTAR:
- case OP_QUERY:
- case OP_MINQUERY:
- case OP_POSQUERY:
- set_bit(start_bits, tcode[1], caseless, cd);
- tcode += 2;
-#ifdef SUPPORT_UTF8
- if (utf8 && tcode[-1] >= 0xc0)
- tcode += _pcre_utf8_table4[tcode[-1] & 0x3f];
-#endif
- break;
-
- /* Single-char upto sets the bit and tries the next */
-
- case OP_UPTO:
- case OP_MINUPTO:
- case OP_POSUPTO:
- set_bit(start_bits, tcode[3], caseless, cd);
- tcode += 4;
-#ifdef SUPPORT_UTF8
- if (utf8 && tcode[-1] >= 0xc0)
- tcode += _pcre_utf8_table4[tcode[-1] & 0x3f];
-#endif
- break;
-
- /* At least one single char sets the bit and stops */
-
- case OP_EXACT: /* Fall through */
- tcode += 2;
-
- case OP_CHAR:
- case OP_CHARNC:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_POSPLUS:
- set_bit(start_bits, tcode[1], caseless, cd);
- try_next = FALSE;
- break;
-
- /* Single character type sets the bits and stops */
-
- case OP_NOT_DIGIT:
- for (c = 0; c < 32; c++)
- start_bits[c] |= ~cd->cbits[c+cbit_digit];
- try_next = FALSE;
- break;
-
- case OP_DIGIT:
- for (c = 0; c < 32; c++)
- start_bits[c] |= cd->cbits[c+cbit_digit];
- try_next = FALSE;
- break;
-
- /* The cbit_space table has vertical tab as whitespace; we have to
- discard it. */
-
- case OP_NOT_WHITESPACE:
- for (c = 0; c < 32; c++)
- {
- int d = cd->cbits[c+cbit_space];
- if (c == 1) d &= ~0x08;
- start_bits[c] |= ~d;
- }
- try_next = FALSE;
- break;
-
- /* The cbit_space table has vertical tab as whitespace; we have to
- discard it. */
-
- case OP_WHITESPACE:
- for (c = 0; c < 32; c++)
- {
- int d = cd->cbits[c+cbit_space];
- if (c == 1) d &= ~0x08;
- start_bits[c] |= d;
- }
- try_next = FALSE;
- break;
-
- case OP_NOT_WORDCHAR:
- for (c = 0; c < 32; c++)
- start_bits[c] |= ~cd->cbits[c+cbit_word];
- try_next = FALSE;
- break;
-
- case OP_WORDCHAR:
- for (c = 0; c < 32; c++)
- start_bits[c] |= cd->cbits[c+cbit_word];
- try_next = FALSE;
- break;
-
- /* One or more character type fudges the pointer and restarts, knowing
- it will hit a single character type and stop there. */
-
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- tcode++;
- break;
-
- case OP_TYPEEXACT:
- tcode += 3;
- break;
-
- /* Zero or more repeats of character types set the bits and then
- try again. */
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEPOSUPTO:
- tcode += 2; /* Fall through */
-
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPOSSTAR:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSQUERY:
- switch(tcode[1])
- {
- case OP_ANY:
- case OP_ALLANY:
- return SSB_FAIL;
-
- case OP_NOT_DIGIT:
- for (c = 0; c < 32; c++)
- start_bits[c] |= ~cd->cbits[c+cbit_digit];
- break;
-
- case OP_DIGIT:
- for (c = 0; c < 32; c++)
- start_bits[c] |= cd->cbits[c+cbit_digit];
- break;
-
- /* The cbit_space table has vertical tab as whitespace; we have to
- discard it. */
-
- case OP_NOT_WHITESPACE:
- for (c = 0; c < 32; c++)
- {
- int d = cd->cbits[c+cbit_space];
- if (c == 1) d &= ~0x08;
- start_bits[c] |= ~d;
- }
- break;
-
- /* The cbit_space table has vertical tab as whitespace; we have to
- discard it. */
-
- case OP_WHITESPACE:
- for (c = 0; c < 32; c++)
- {
- int d = cd->cbits[c+cbit_space];
- if (c == 1) d &= ~0x08;
- start_bits[c] |= d;
- }
- break;
-
- case OP_NOT_WORDCHAR:
- for (c = 0; c < 32; c++)
- start_bits[c] |= ~cd->cbits[c+cbit_word];
- break;
-
- case OP_WORDCHAR:
- for (c = 0; c < 32; c++)
- start_bits[c] |= cd->cbits[c+cbit_word];
- break;
- }
-
- tcode += 2;
- break;
-
- /* Character class where all the information is in a bit map: set the
- bits and either carry on or not, according to the repeat count. If it was
- a negative class, and we are operating with UTF-8 characters, any byte
- with a value >= 0xc4 is a potentially valid starter because it starts a
- character with a value > 255. */
-
- case OP_NCLASS:
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- start_bits[24] |= 0xf0; /* Bits for 0xc4 - 0xc8 */
- memset(start_bits+25, 0xff, 7); /* Bits for 0xc9 - 0xff */
- }
-#endif
- /* Fall through */
-
- case OP_CLASS:
- {
- tcode++;
-
- /* In UTF-8 mode, the bits in a bit map correspond to character
- values, not to byte values. However, the bit map we are constructing is
- for byte values. So we have to do a conversion for characters whose
- value is > 127. In fact, there are only two possible starting bytes for
- characters in the range 128 - 255. */
-
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- for (c = 0; c < 16; c++) start_bits[c] |= tcode[c];
- for (c = 128; c < 256; c++)
- {
- if ((tcode[c/8] && (1 << (c&7))) != 0)
- {
- int d = (c >> 6) | 0xc0; /* Set bit for this starter */
- start_bits[d/8] |= (1 << (d&7)); /* and then skip on to the */
- c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */
- }
- }
- }
-
- /* In non-UTF-8 mode, the two bit maps are completely compatible. */
-
- else
-#endif
- {
- for (c = 0; c < 32; c++) start_bits[c] |= tcode[c];
- }
-
- /* Advance past the bit map, and act on what follows */
-
- tcode += 32;
- switch (*tcode)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- tcode++;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- if (((tcode[1] << 8) + tcode[2]) == 0) tcode += 5;
- else try_next = FALSE;
- break;
-
- default:
- try_next = FALSE;
- break;
- }
- }
- break; /* End of bitmap class handling */
-
- } /* End of switch */
- } /* End of try_next loop */
-
- code += GET(code, 1); /* Advance to next branch */
- }
-while (*code == OP_ALT);
-return yield;
-}
-
-
-
-/*************************************************
-* Study a compiled expression *
-*************************************************/
-
-/* This function is handed a compiled expression that it must study to produce
-information that will speed up the matching. It returns a pcre_extra block
-which then gets handed back to pcre_exec().
-
-Arguments:
- re points to the compiled expression
- options contains option bits
- errorptr points to where to place error messages;
- set NULL unless error
-
-Returns: pointer to a pcre_extra block, with study_data filled in and the
- appropriate flag set;
- NULL on error or if no optimization possible
-*/
-
-PCRE_EXP_DEFN pcre_extra * PCRE_CALL_CONVENTION
-pcre_study(const pcre *external_re, int options, const char **errorptr)
-{
-uschar start_bits[32];
-pcre_extra *extra;
-pcre_study_data *study;
-const uschar *tables;
-uschar *code;
-compile_data compile_block;
-const real_pcre *re = (const real_pcre *)external_re;
-
-*errorptr = NULL;
-
-if (re == NULL || re->magic_number != MAGIC_NUMBER)
- {
- *errorptr = "argument is not a compiled regular expression";
- return NULL;
- }
-
-if ((options & ~PUBLIC_STUDY_OPTIONS) != 0)
- {
- *errorptr = "unknown or incorrect option bit(s) set";
- return NULL;
- }
-
-code = (uschar *)re + re->name_table_offset +
- (re->name_count * re->name_entry_size);
-
-/* For an anchored pattern, or an unanchored pattern that has a first char, or
-a multiline pattern that matches only at "line starts", no further processing
-at present. */
-
-if ((re->options & PCRE_ANCHORED) != 0 ||
- (re->flags & (PCRE_FIRSTSET|PCRE_STARTLINE)) != 0)
- return NULL;
-
-/* Set the character tables in the block that is passed around */
-
-tables = re->tables;
-if (tables == NULL)
- (void)pcre_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES,
- (void *)(&tables));
-
-compile_block.lcc = tables + lcc_offset;
-compile_block.fcc = tables + fcc_offset;
-compile_block.cbits = tables + cbits_offset;
-compile_block.ctypes = tables + ctypes_offset;
-
-/* See if we can find a fixed set of initial characters for the pattern. */
-
-memset(start_bits, 0, 32 * sizeof(uschar));
-if (set_start_bits(code, start_bits, (re->options & PCRE_CASELESS) != 0,
- (re->options & PCRE_UTF8) != 0, &compile_block) != SSB_DONE) return NULL;
-
-/* Get a pcre_extra block and a pcre_study_data block. The study data is put in
-the latter, which is pointed to by the former, which may also get additional
-data set later by the calling program. At the moment, the size of
-pcre_study_data is fixed. We nevertheless save it in a field for returning via
-the pcre_fullinfo() function so that if it becomes variable in the future, we
-don't have to change that code. */
-
-extra = (pcre_extra *)(pcre_malloc)
- (sizeof(pcre_extra) + sizeof(pcre_study_data));
-
-if (extra == NULL)
- {
- *errorptr = "failed to get memory";
- return NULL;
- }
-
-study = (pcre_study_data *)((char *)extra + sizeof(pcre_extra));
-extra->flags = PCRE_EXTRA_STUDY_DATA;
-extra->study_data = study;
-
-study->size = sizeof(pcre_study_data);
-study->options = PCRE_STUDY_MAPPED;
-memcpy(study->start_bits, start_bits, sizeof(start_bits));
-
-return extra;
-}
-
-/* End of pcre_study.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_tables.c b/Utilities/Poco/Foundation/src/pcre_tables.c
deleted file mode 100755
index a21f3760c5..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_tables.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains some fixed tables that are used by more than one of the
-PCRE code modules. The tables are also #included by the pcretest program, which
-uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name
-clashes with the library. */
-
-
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-
-/* Table of sizes for the fixed-length opcodes. It's defined in a macro so that
-the definition is next to the definition of the opcodes in pcre_internal.h. */
-
-const uschar _pcre_OP_lengths[] = { OP_LENGTHS };
-
-
-
-/*************************************************
-* Tables for UTF-8 support *
-*************************************************/
-
-/* These are the breakpoints for different numbers of bytes in a UTF-8
-character. */
-
-#ifdef SUPPORT_UTF8
-
-const int _pcre_utf8_table1[] =
- { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff};
-
-const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int);
-
-/* These are the indicator bits and the mask for the data bits to set in the
-first byte of a character, indexed by the number of additional bytes. */
-
-const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
-const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01};
-
-/* Table of the number of extra bytes, indexed by the first byte masked with
-0x3f. The highest number for a valid UTF-8 first byte is in fact 0x3d. */
-
-const uschar _pcre_utf8_table4[] = {
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 };
-
-/* Table to translate from particular type value to the general value. */
-
-const int _pcre_ucp_gentype[] = {
- ucp_C, ucp_C, ucp_C, ucp_C, ucp_C, /* Cc, Cf, Cn, Co, Cs */
- ucp_L, ucp_L, ucp_L, ucp_L, ucp_L, /* Ll, Lu, Lm, Lo, Lt */
- ucp_M, ucp_M, ucp_M, /* Mc, Me, Mn */
- ucp_N, ucp_N, ucp_N, /* Nd, Nl, No */
- ucp_P, ucp_P, ucp_P, ucp_P, ucp_P, /* Pc, Pd, Pe, Pf, Pi */
- ucp_P, ucp_P, /* Ps, Po */
- ucp_S, ucp_S, ucp_S, ucp_S, /* Sc, Sk, Sm, So */
- ucp_Z, ucp_Z, ucp_Z /* Zl, Zp, Zs */
-};
-
-/* The pcre_utt[] table below translates Unicode property names into type and
-code values. It is searched by binary chop, so must be in collating sequence of
-name. Originally, the table contained pointers to the name strings in the first
-field of each entry. However, that leads to a large number of relocations when
-a shared library is dynamically loaded. A significant reduction is made by
-putting all the names into a single, large string and then using offsets in the
-table itself. Maintenance is more error-prone, but frequent changes to this
-data are unlikely.
-
-July 2008: There is now a script called maint/GenerateUtt.py which can be used
-to generate this data instead of maintaining it entirely by hand. */
-
-const char _pcre_utt_names[] =
- "Any\0"
- "Arabic\0"
- "Armenian\0"
- "Balinese\0"
- "Bengali\0"
- "Bopomofo\0"
- "Braille\0"
- "Buginese\0"
- "Buhid\0"
- "C\0"
- "Canadian_Aboriginal\0"
- "Carian\0"
- "Cc\0"
- "Cf\0"
- "Cham\0"
- "Cherokee\0"
- "Cn\0"
- "Co\0"
- "Common\0"
- "Coptic\0"
- "Cs\0"
- "Cuneiform\0"
- "Cypriot\0"
- "Cyrillic\0"
- "Deseret\0"
- "Devanagari\0"
- "Ethiopic\0"
- "Georgian\0"
- "Glagolitic\0"
- "Gothic\0"
- "Greek\0"
- "Gujarati\0"
- "Gurmukhi\0"
- "Han\0"
- "Hangul\0"
- "Hanunoo\0"
- "Hebrew\0"
- "Hiragana\0"
- "Inherited\0"
- "Kannada\0"
- "Katakana\0"
- "Kayah_Li\0"
- "Kharoshthi\0"
- "Khmer\0"
- "L\0"
- "L&\0"
- "Lao\0"
- "Latin\0"
- "Lepcha\0"
- "Limbu\0"
- "Linear_B\0"
- "Ll\0"
- "Lm\0"
- "Lo\0"
- "Lt\0"
- "Lu\0"
- "Lycian\0"
- "Lydian\0"
- "M\0"
- "Malayalam\0"
- "Mc\0"
- "Me\0"
- "Mn\0"
- "Mongolian\0"
- "Myanmar\0"
- "N\0"
- "Nd\0"
- "New_Tai_Lue\0"
- "Nko\0"
- "Nl\0"
- "No\0"
- "Ogham\0"
- "Ol_Chiki\0"
- "Old_Italic\0"
- "Old_Persian\0"
- "Oriya\0"
- "Osmanya\0"
- "P\0"
- "Pc\0"
- "Pd\0"
- "Pe\0"
- "Pf\0"
- "Phags_Pa\0"
- "Phoenician\0"
- "Pi\0"
- "Po\0"
- "Ps\0"
- "Rejang\0"
- "Runic\0"
- "S\0"
- "Saurashtra\0"
- "Sc\0"
- "Shavian\0"
- "Sinhala\0"
- "Sk\0"
- "Sm\0"
- "So\0"
- "Sundanese\0"
- "Syloti_Nagri\0"
- "Syriac\0"
- "Tagalog\0"
- "Tagbanwa\0"
- "Tai_Le\0"
- "Tamil\0"
- "Telugu\0"
- "Thaana\0"
- "Thai\0"
- "Tibetan\0"
- "Tifinagh\0"
- "Ugaritic\0"
- "Vai\0"
- "Yi\0"
- "Z\0"
- "Zl\0"
- "Zp\0"
- "Zs\0";
-
-const ucp_type_table _pcre_utt[] = {
- { 0, PT_ANY, 0 },
- { 4, PT_SC, ucp_Arabic },
- { 11, PT_SC, ucp_Armenian },
- { 20, PT_SC, ucp_Balinese },
- { 29, PT_SC, ucp_Bengali },
- { 37, PT_SC, ucp_Bopomofo },
- { 46, PT_SC, ucp_Braille },
- { 54, PT_SC, ucp_Buginese },
- { 63, PT_SC, ucp_Buhid },
- { 69, PT_GC, ucp_C },
- { 71, PT_SC, ucp_Canadian_Aboriginal },
- { 91, PT_SC, ucp_Carian },
- { 98, PT_PC, ucp_Cc },
- { 101, PT_PC, ucp_Cf },
- { 104, PT_SC, ucp_Cham },
- { 109, PT_SC, ucp_Cherokee },
- { 118, PT_PC, ucp_Cn },
- { 121, PT_PC, ucp_Co },
- { 124, PT_SC, ucp_Common },
- { 131, PT_SC, ucp_Coptic },
- { 138, PT_PC, ucp_Cs },
- { 141, PT_SC, ucp_Cuneiform },
- { 151, PT_SC, ucp_Cypriot },
- { 159, PT_SC, ucp_Cyrillic },
- { 168, PT_SC, ucp_Deseret },
- { 176, PT_SC, ucp_Devanagari },
- { 187, PT_SC, ucp_Ethiopic },
- { 196, PT_SC, ucp_Georgian },
- { 205, PT_SC, ucp_Glagolitic },
- { 216, PT_SC, ucp_Gothic },
- { 223, PT_SC, ucp_Greek },
- { 229, PT_SC, ucp_Gujarati },
- { 238, PT_SC, ucp_Gurmukhi },
- { 247, PT_SC, ucp_Han },
- { 251, PT_SC, ucp_Hangul },
- { 258, PT_SC, ucp_Hanunoo },
- { 266, PT_SC, ucp_Hebrew },
- { 273, PT_SC, ucp_Hiragana },
- { 282, PT_SC, ucp_Inherited },
- { 292, PT_SC, ucp_Kannada },
- { 300, PT_SC, ucp_Katakana },
- { 309, PT_SC, ucp_Kayah_Li },
- { 318, PT_SC, ucp_Kharoshthi },
- { 329, PT_SC, ucp_Khmer },
- { 335, PT_GC, ucp_L },
- { 337, PT_LAMP, 0 },
- { 340, PT_SC, ucp_Lao },
- { 344, PT_SC, ucp_Latin },
- { 350, PT_SC, ucp_Lepcha },
- { 357, PT_SC, ucp_Limbu },
- { 363, PT_SC, ucp_Linear_B },
- { 372, PT_PC, ucp_Ll },
- { 375, PT_PC, ucp_Lm },
- { 378, PT_PC, ucp_Lo },
- { 381, PT_PC, ucp_Lt },
- { 384, PT_PC, ucp_Lu },
- { 387, PT_SC, ucp_Lycian },
- { 394, PT_SC, ucp_Lydian },
- { 401, PT_GC, ucp_M },
- { 403, PT_SC, ucp_Malayalam },
- { 413, PT_PC, ucp_Mc },
- { 416, PT_PC, ucp_Me },
- { 419, PT_PC, ucp_Mn },
- { 422, PT_SC, ucp_Mongolian },
- { 432, PT_SC, ucp_Myanmar },
- { 440, PT_GC, ucp_N },
- { 442, PT_PC, ucp_Nd },
- { 445, PT_SC, ucp_New_Tai_Lue },
- { 457, PT_SC, ucp_Nko },
- { 461, PT_PC, ucp_Nl },
- { 464, PT_PC, ucp_No },
- { 467, PT_SC, ucp_Ogham },
- { 473, PT_SC, ucp_Ol_Chiki },
- { 482, PT_SC, ucp_Old_Italic },
- { 493, PT_SC, ucp_Old_Persian },
- { 505, PT_SC, ucp_Oriya },
- { 511, PT_SC, ucp_Osmanya },
- { 519, PT_GC, ucp_P },
- { 521, PT_PC, ucp_Pc },
- { 524, PT_PC, ucp_Pd },
- { 527, PT_PC, ucp_Pe },
- { 530, PT_PC, ucp_Pf },
- { 533, PT_SC, ucp_Phags_Pa },
- { 542, PT_SC, ucp_Phoenician },
- { 553, PT_PC, ucp_Pi },
- { 556, PT_PC, ucp_Po },
- { 559, PT_PC, ucp_Ps },
- { 562, PT_SC, ucp_Rejang },
- { 569, PT_SC, ucp_Runic },
- { 575, PT_GC, ucp_S },
- { 577, PT_SC, ucp_Saurashtra },
- { 588, PT_PC, ucp_Sc },
- { 591, PT_SC, ucp_Shavian },
- { 599, PT_SC, ucp_Sinhala },
- { 607, PT_PC, ucp_Sk },
- { 610, PT_PC, ucp_Sm },
- { 613, PT_PC, ucp_So },
- { 616, PT_SC, ucp_Sundanese },
- { 626, PT_SC, ucp_Syloti_Nagri },
- { 639, PT_SC, ucp_Syriac },
- { 646, PT_SC, ucp_Tagalog },
- { 654, PT_SC, ucp_Tagbanwa },
- { 663, PT_SC, ucp_Tai_Le },
- { 670, PT_SC, ucp_Tamil },
- { 676, PT_SC, ucp_Telugu },
- { 683, PT_SC, ucp_Thaana },
- { 690, PT_SC, ucp_Thai },
- { 695, PT_SC, ucp_Tibetan },
- { 703, PT_SC, ucp_Tifinagh },
- { 712, PT_SC, ucp_Ugaritic },
- { 721, PT_SC, ucp_Vai },
- { 725, PT_SC, ucp_Yi },
- { 728, PT_GC, ucp_Z },
- { 730, PT_PC, ucp_Zl },
- { 733, PT_PC, ucp_Zp },
- { 736, PT_PC, ucp_Zs }
-};
-
-const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table);
-
-#endif /* SUPPORT_UTF8 */
-
-/* End of pcre_tables.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_try_flipped.c b/Utilities/Poco/Foundation/src/pcre_try_flipped.c
deleted file mode 100755
index cb6e30ed21..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_try_flipped.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains an internal function that tests a compiled pattern to
-see if it was compiled with the opposite endianness. If so, it uses an
-auxiliary local function to flip the appropriate bytes. */
-
-
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-
-/*************************************************
-* Flip bytes in an integer *
-*************************************************/
-
-/* This function is called when the magic number in a regex doesn't match, in
-order to flip its bytes to see if we are dealing with a pattern that was
-compiled on a host of different endianness. If so, this function is used to
-flip other byte values.
-
-Arguments:
- value the number to flip
- n the number of bytes to flip (assumed to be 2 or 4)
-
-Returns: the flipped value
-*/
-
-static unsigned long int
-byteflip(unsigned long int value, int n)
-{
-if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8);
-return ((value & 0x000000ff) << 24) |
- ((value & 0x0000ff00) << 8) |
- ((value & 0x00ff0000) >> 8) |
- ((value & 0xff000000) >> 24);
-}
-
-
-
-/*************************************************
-* Test for a byte-flipped compiled regex *
-*************************************************/
-
-/* This function is called from pcre_exec(), pcre_dfa_exec(), and also from
-pcre_fullinfo(). Its job is to test whether the regex is byte-flipped - that
-is, it was compiled on a system of opposite endianness. The function is called
-only when the native MAGIC_NUMBER test fails. If the regex is indeed flipped,
-we flip all the relevant values into a different data block, and return it.
-
-Arguments:
- re points to the regex
- study points to study data, or NULL
- internal_re points to a new regex block
- internal_study points to a new study block
-
-Returns: the new block if is is indeed a byte-flipped regex
- NULL if it is not
-*/
-
-real_pcre *
-_pcre_try_flipped(const real_pcre *re, real_pcre *internal_re,
- const pcre_study_data *study, pcre_study_data *internal_study)
-{
-if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER)
- return NULL;
-
-*internal_re = *re; /* To copy other fields */
-internal_re->size = byteflip(re->size, sizeof(re->size));
-internal_re->options = byteflip(re->options, sizeof(re->options));
-internal_re->flags = (pcre_uint16)byteflip(re->flags, sizeof(re->flags));
-internal_re->top_bracket =
- (pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket));
-internal_re->top_backref =
- (pcre_uint16)byteflip(re->top_backref, sizeof(re->top_backref));
-internal_re->first_byte =
- (pcre_uint16)byteflip(re->first_byte, sizeof(re->first_byte));
-internal_re->req_byte =
- (pcre_uint16)byteflip(re->req_byte, sizeof(re->req_byte));
-internal_re->name_table_offset =
- (pcre_uint16)byteflip(re->name_table_offset, sizeof(re->name_table_offset));
-internal_re->name_entry_size =
- (pcre_uint16)byteflip(re->name_entry_size, sizeof(re->name_entry_size));
-internal_re->name_count =
- (pcre_uint16)byteflip(re->name_count, sizeof(re->name_count));
-
-if (study != NULL)
- {
- *internal_study = *study; /* To copy other fields */
- internal_study->size = byteflip(study->size, sizeof(study->size));
- internal_study->options = byteflip(study->options, sizeof(study->options));
- }
-
-return internal_re;
-}
-
-/* End of pcre_tryflipped.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_ucd.c b/Utilities/Poco/Foundation/src/pcre_ucd.c
deleted file mode 100755
index 9bfa4a67b2..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_ucd.c
+++ /dev/null
@@ -1,2608 +0,0 @@
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-/* Unicode character database. */
-/* This file was autogenerated by the MultiStage2.py script. */
-/* Total size: 52808 bytes, block size: 128. */
-/* When recompiling tables with a new Unicode version,
-please check types in the structure definition from pcre_internal.h:
-typedef struct {
-uschar property_0;
-uschar property_1;
-pcre_int32 property_2;
-} ucd_record; */
-
-
-const ucd_record _pcre_ucd_records[] = { /* 3656 bytes, record size 8 */
- { 9, 0, 0, }, /* 0 */
- { 9, 29, 0, }, /* 1 */
- { 9, 21, 0, }, /* 2 */
- { 9, 23, 0, }, /* 3 */
- { 9, 22, 0, }, /* 4 */
- { 9, 18, 0, }, /* 5 */
- { 9, 25, 0, }, /* 6 */
- { 9, 17, 0, }, /* 7 */
- { 9, 13, 0, }, /* 8 */
- { 33, 9, 32, }, /* 9 */
- { 9, 24, 0, }, /* 10 */
- { 9, 16, 0, }, /* 11 */
- { 33, 5, -32, }, /* 12 */
- { 9, 26, 0, }, /* 13 */
- { 33, 5, 0, }, /* 14 */
- { 9, 20, 0, }, /* 15 */
- { 9, 1, 0, }, /* 16 */
- { 9, 15, 0, }, /* 17 */
- { 9, 5, 743, }, /* 18 */
- { 9, 19, 0, }, /* 19 */
- { 33, 5, 121, }, /* 20 */
- { 33, 9, 1, }, /* 21 */
- { 33, 5, -1, }, /* 22 */
- { 33, 9, -199, }, /* 23 */
- { 33, 5, -232, }, /* 24 */
- { 33, 9, -121, }, /* 25 */
- { 33, 5, -300, }, /* 26 */
- { 33, 5, 195, }, /* 27 */
- { 33, 9, 210, }, /* 28 */
- { 33, 9, 206, }, /* 29 */
- { 33, 9, 205, }, /* 30 */
- { 33, 9, 79, }, /* 31 */
- { 33, 9, 202, }, /* 32 */
- { 33, 9, 203, }, /* 33 */
- { 33, 9, 207, }, /* 34 */
- { 33, 5, 97, }, /* 35 */
- { 33, 9, 211, }, /* 36 */
- { 33, 9, 209, }, /* 37 */
- { 33, 5, 163, }, /* 38 */
- { 33, 9, 213, }, /* 39 */
- { 33, 5, 130, }, /* 40 */
- { 33, 9, 214, }, /* 41 */
- { 33, 9, 218, }, /* 42 */
- { 33, 9, 217, }, /* 43 */
- { 33, 9, 219, }, /* 44 */
- { 33, 7, 0, }, /* 45 */
- { 33, 5, 56, }, /* 46 */
- { 33, 9, 2, }, /* 47 */
- { 33, 8, -1, }, /* 48 */
- { 33, 5, -2, }, /* 49 */
- { 33, 5, -79, }, /* 50 */
- { 33, 9, -97, }, /* 51 */
- { 33, 9, -56, }, /* 52 */
- { 33, 9, -130, }, /* 53 */
- { 33, 9, 10795, }, /* 54 */
- { 33, 9, -163, }, /* 55 */
- { 33, 9, 10792, }, /* 56 */
- { 33, 9, -195, }, /* 57 */
- { 33, 9, 69, }, /* 58 */
- { 33, 9, 71, }, /* 59 */
- { 33, 5, 10783, }, /* 60 */
- { 33, 5, 10780, }, /* 61 */
- { 33, 5, -210, }, /* 62 */
- { 33, 5, -206, }, /* 63 */
- { 33, 5, -205, }, /* 64 */
- { 33, 5, -202, }, /* 65 */
- { 33, 5, -203, }, /* 66 */
- { 33, 5, -207, }, /* 67 */
- { 33, 5, -209, }, /* 68 */
- { 33, 5, -211, }, /* 69 */
- { 33, 5, 10743, }, /* 70 */
- { 33, 5, 10749, }, /* 71 */
- { 33, 5, -213, }, /* 72 */
- { 33, 5, -214, }, /* 73 */
- { 33, 5, 10727, }, /* 74 */
- { 33, 5, -218, }, /* 75 */
- { 33, 5, -69, }, /* 76 */
- { 33, 5, -217, }, /* 77 */
- { 33, 5, -71, }, /* 78 */
- { 33, 5, -219, }, /* 79 */
- { 33, 6, 0, }, /* 80 */
- { 9, 6, 0, }, /* 81 */
- { 27, 12, 0, }, /* 82 */
- { 27, 12, 84, }, /* 83 */
- { 19, 9, 1, }, /* 84 */
- { 19, 5, -1, }, /* 85 */
- { 19, 24, 0, }, /* 86 */
- { 9, 2, 0, }, /* 87 */
- { 19, 6, 0, }, /* 88 */
- { 19, 5, 130, }, /* 89 */
- { 19, 9, 38, }, /* 90 */
- { 19, 9, 37, }, /* 91 */
- { 19, 9, 64, }, /* 92 */
- { 19, 9, 63, }, /* 93 */
- { 19, 5, 0, }, /* 94 */
- { 19, 9, 32, }, /* 95 */
- { 19, 5, -38, }, /* 96 */
- { 19, 5, -37, }, /* 97 */
- { 19, 5, -32, }, /* 98 */
- { 19, 5, -31, }, /* 99 */
- { 19, 5, -64, }, /* 100 */
- { 19, 5, -63, }, /* 101 */
- { 19, 9, 8, }, /* 102 */
- { 19, 5, -62, }, /* 103 */
- { 19, 5, -57, }, /* 104 */
- { 19, 9, 0, }, /* 105 */
- { 19, 5, -47, }, /* 106 */
- { 19, 5, -54, }, /* 107 */
- { 19, 5, -8, }, /* 108 */
- { 10, 9, 1, }, /* 109 */
- { 10, 5, -1, }, /* 110 */
- { 19, 5, -86, }, /* 111 */
- { 19, 5, -80, }, /* 112 */
- { 19, 5, 7, }, /* 113 */
- { 19, 9, -60, }, /* 114 */
- { 19, 5, -96, }, /* 115 */
- { 19, 25, 0, }, /* 116 */
- { 19, 9, -7, }, /* 117 */
- { 19, 9, -130, }, /* 118 */
- { 12, 9, 80, }, /* 119 */
- { 12, 9, 32, }, /* 120 */
- { 12, 5, -32, }, /* 121 */
- { 12, 5, -80, }, /* 122 */
- { 12, 9, 1, }, /* 123 */
- { 12, 5, -1, }, /* 124 */
- { 12, 26, 0, }, /* 125 */
- { 12, 12, 0, }, /* 126 */
- { 12, 11, 0, }, /* 127 */
- { 12, 9, 15, }, /* 128 */
- { 12, 5, -15, }, /* 129 */
- { 1, 9, 48, }, /* 130 */
- { 1, 6, 0, }, /* 131 */
- { 1, 21, 0, }, /* 132 */
- { 1, 5, -48, }, /* 133 */
- { 1, 5, 0, }, /* 134 */
- { 1, 17, 0, }, /* 135 */
- { 25, 12, 0, }, /* 136 */
- { 25, 17, 0, }, /* 137 */
- { 25, 21, 0, }, /* 138 */
- { 25, 7, 0, }, /* 139 */
- { 0, 25, 0, }, /* 140 */
- { 0, 21, 0, }, /* 141 */
- { 0, 23, 0, }, /* 142 */
- { 0, 26, 0, }, /* 143 */
- { 0, 12, 0, }, /* 144 */
- { 0, 7, 0, }, /* 145 */
- { 0, 11, 0, }, /* 146 */
- { 0, 6, 0, }, /* 147 */
- { 0, 13, 0, }, /* 148 */
- { 49, 21, 0, }, /* 149 */
- { 49, 1, 0, }, /* 150 */
- { 49, 7, 0, }, /* 151 */
- { 49, 12, 0, }, /* 152 */
- { 55, 7, 0, }, /* 153 */
- { 55, 12, 0, }, /* 154 */
- { 63, 13, 0, }, /* 155 */
- { 63, 7, 0, }, /* 156 */
- { 63, 12, 0, }, /* 157 */
- { 63, 6, 0, }, /* 158 */
- { 63, 26, 0, }, /* 159 */
- { 63, 21, 0, }, /* 160 */
- { 14, 12, 0, }, /* 161 */
- { 14, 10, 0, }, /* 162 */
- { 14, 7, 0, }, /* 163 */
- { 14, 13, 0, }, /* 164 */
- { 14, 6, 0, }, /* 165 */
- { 2, 12, 0, }, /* 166 */
- { 2, 10, 0, }, /* 167 */
- { 2, 7, 0, }, /* 168 */
- { 2, 13, 0, }, /* 169 */
- { 2, 23, 0, }, /* 170 */
- { 2, 15, 0, }, /* 171 */
- { 2, 26, 0, }, /* 172 */
- { 21, 12, 0, }, /* 173 */
- { 21, 10, 0, }, /* 174 */
- { 21, 7, 0, }, /* 175 */
- { 21, 13, 0, }, /* 176 */
- { 20, 12, 0, }, /* 177 */
- { 20, 10, 0, }, /* 178 */
- { 20, 7, 0, }, /* 179 */
- { 20, 13, 0, }, /* 180 */
- { 20, 23, 0, }, /* 181 */
- { 43, 12, 0, }, /* 182 */
- { 43, 10, 0, }, /* 183 */
- { 43, 7, 0, }, /* 184 */
- { 43, 13, 0, }, /* 185 */
- { 43, 26, 0, }, /* 186 */
- { 53, 12, 0, }, /* 187 */
- { 53, 7, 0, }, /* 188 */
- { 53, 10, 0, }, /* 189 */
- { 53, 13, 0, }, /* 190 */
- { 53, 15, 0, }, /* 191 */
- { 53, 26, 0, }, /* 192 */
- { 53, 23, 0, }, /* 193 */
- { 54, 10, 0, }, /* 194 */
- { 54, 7, 0, }, /* 195 */
- { 54, 12, 0, }, /* 196 */
- { 54, 13, 0, }, /* 197 */
- { 54, 15, 0, }, /* 198 */
- { 54, 26, 0, }, /* 199 */
- { 28, 10, 0, }, /* 200 */
- { 28, 7, 0, }, /* 201 */
- { 28, 12, 0, }, /* 202 */
- { 28, 13, 0, }, /* 203 */
- { 36, 10, 0, }, /* 204 */
- { 36, 7, 0, }, /* 205 */
- { 36, 12, 0, }, /* 206 */
- { 36, 13, 0, }, /* 207 */
- { 36, 15, 0, }, /* 208 */
- { 36, 26, 0, }, /* 209 */
- { 47, 10, 0, }, /* 210 */
- { 47, 7, 0, }, /* 211 */
- { 47, 12, 0, }, /* 212 */
- { 47, 21, 0, }, /* 213 */
- { 56, 7, 0, }, /* 214 */
- { 56, 12, 0, }, /* 215 */
- { 56, 6, 0, }, /* 216 */
- { 56, 21, 0, }, /* 217 */
- { 56, 13, 0, }, /* 218 */
- { 32, 7, 0, }, /* 219 */
- { 32, 12, 0, }, /* 220 */
- { 32, 6, 0, }, /* 221 */
- { 32, 13, 0, }, /* 222 */
- { 57, 7, 0, }, /* 223 */
- { 57, 26, 0, }, /* 224 */
- { 57, 21, 0, }, /* 225 */
- { 57, 12, 0, }, /* 226 */
- { 57, 13, 0, }, /* 227 */
- { 57, 15, 0, }, /* 228 */
- { 57, 22, 0, }, /* 229 */
- { 57, 18, 0, }, /* 230 */
- { 57, 10, 0, }, /* 231 */
- { 38, 7, 0, }, /* 232 */
- { 38, 10, 0, }, /* 233 */
- { 38, 12, 0, }, /* 234 */
- { 38, 13, 0, }, /* 235 */
- { 38, 21, 0, }, /* 236 */
- { 38, 26, 0, }, /* 237 */
- { 16, 9, 7264, }, /* 238 */
- { 16, 7, 0, }, /* 239 */
- { 16, 6, 0, }, /* 240 */
- { 23, 7, 0, }, /* 241 */
- { 15, 7, 0, }, /* 242 */
- { 15, 12, 0, }, /* 243 */
- { 15, 26, 0, }, /* 244 */
- { 15, 21, 0, }, /* 245 */
- { 15, 15, 0, }, /* 246 */
- { 8, 7, 0, }, /* 247 */
- { 7, 7, 0, }, /* 248 */
- { 7, 21, 0, }, /* 249 */
- { 40, 29, 0, }, /* 250 */
- { 40, 7, 0, }, /* 251 */
- { 40, 22, 0, }, /* 252 */
- { 40, 18, 0, }, /* 253 */
- { 45, 7, 0, }, /* 254 */
- { 45, 14, 0, }, /* 255 */
- { 50, 7, 0, }, /* 256 */
- { 50, 12, 0, }, /* 257 */
- { 24, 7, 0, }, /* 258 */
- { 24, 12, 0, }, /* 259 */
- { 6, 7, 0, }, /* 260 */
- { 6, 12, 0, }, /* 261 */
- { 51, 7, 0, }, /* 262 */
- { 51, 12, 0, }, /* 263 */
- { 31, 7, 0, }, /* 264 */
- { 31, 1, 0, }, /* 265 */
- { 31, 10, 0, }, /* 266 */
- { 31, 12, 0, }, /* 267 */
- { 31, 21, 0, }, /* 268 */
- { 31, 6, 0, }, /* 269 */
- { 31, 23, 0, }, /* 270 */
- { 31, 13, 0, }, /* 271 */
- { 31, 15, 0, }, /* 272 */
- { 37, 21, 0, }, /* 273 */
- { 37, 17, 0, }, /* 274 */
- { 37, 12, 0, }, /* 275 */
- { 37, 29, 0, }, /* 276 */
- { 37, 13, 0, }, /* 277 */
- { 37, 7, 0, }, /* 278 */
- { 37, 6, 0, }, /* 279 */
- { 34, 7, 0, }, /* 280 */
- { 34, 12, 0, }, /* 281 */
- { 34, 10, 0, }, /* 282 */
- { 34, 26, 0, }, /* 283 */
- { 34, 21, 0, }, /* 284 */
- { 34, 13, 0, }, /* 285 */
- { 52, 7, 0, }, /* 286 */
- { 39, 7, 0, }, /* 287 */
- { 39, 10, 0, }, /* 288 */
- { 39, 13, 0, }, /* 289 */
- { 39, 21, 0, }, /* 290 */
- { 31, 26, 0, }, /* 291 */
- { 5, 7, 0, }, /* 292 */
- { 5, 12, 0, }, /* 293 */
- { 5, 10, 0, }, /* 294 */
- { 5, 21, 0, }, /* 295 */
- { 61, 12, 0, }, /* 296 */
- { 61, 10, 0, }, /* 297 */
- { 61, 7, 0, }, /* 298 */
- { 61, 13, 0, }, /* 299 */
- { 61, 21, 0, }, /* 300 */
- { 61, 26, 0, }, /* 301 */
- { 75, 12, 0, }, /* 302 */
- { 75, 10, 0, }, /* 303 */
- { 75, 7, 0, }, /* 304 */
- { 75, 13, 0, }, /* 305 */
- { 69, 7, 0, }, /* 306 */
- { 69, 10, 0, }, /* 307 */
- { 69, 12, 0, }, /* 308 */
- { 69, 21, 0, }, /* 309 */
- { 69, 13, 0, }, /* 310 */
- { 72, 13, 0, }, /* 311 */
- { 72, 7, 0, }, /* 312 */
- { 72, 6, 0, }, /* 313 */
- { 72, 21, 0, }, /* 314 */
- { 12, 5, 0, }, /* 315 */
- { 12, 6, 0, }, /* 316 */
- { 33, 5, 35332, }, /* 317 */
- { 33, 5, 3814, }, /* 318 */
- { 33, 5, -59, }, /* 319 */
- { 33, 9, -7615, }, /* 320 */
- { 19, 5, 8, }, /* 321 */
- { 19, 9, -8, }, /* 322 */
- { 19, 5, 74, }, /* 323 */
- { 19, 5, 86, }, /* 324 */
- { 19, 5, 100, }, /* 325 */
- { 19, 5, 128, }, /* 326 */
- { 19, 5, 112, }, /* 327 */
- { 19, 5, 126, }, /* 328 */
- { 19, 8, -8, }, /* 329 */
- { 19, 5, 9, }, /* 330 */
- { 19, 9, -74, }, /* 331 */
- { 19, 8, -9, }, /* 332 */
- { 19, 5, -7205, }, /* 333 */
- { 19, 9, -86, }, /* 334 */
- { 19, 9, -100, }, /* 335 */
- { 19, 9, -112, }, /* 336 */
- { 19, 9, -128, }, /* 337 */
- { 19, 9, -126, }, /* 338 */
- { 27, 1, 0, }, /* 339 */
- { 9, 27, 0, }, /* 340 */
- { 9, 28, 0, }, /* 341 */
- { 27, 11, 0, }, /* 342 */
- { 9, 9, 0, }, /* 343 */
- { 9, 5, 0, }, /* 344 */
- { 19, 9, -7517, }, /* 345 */
- { 33, 9, -8383, }, /* 346 */
- { 33, 9, -8262, }, /* 347 */
- { 33, 9, 28, }, /* 348 */
- { 9, 7, 0, }, /* 349 */
- { 33, 5, -28, }, /* 350 */
- { 33, 14, 16, }, /* 351 */
- { 33, 14, -16, }, /* 352 */
- { 33, 14, 0, }, /* 353 */
- { 9, 26, 26, }, /* 354 */
- { 9, 26, -26, }, /* 355 */
- { 4, 26, 0, }, /* 356 */
- { 17, 9, 48, }, /* 357 */
- { 17, 5, -48, }, /* 358 */
- { 33, 9, -10743, }, /* 359 */
- { 33, 9, -3814, }, /* 360 */
- { 33, 9, -10727, }, /* 361 */
- { 33, 5, -10795, }, /* 362 */
- { 33, 5, -10792, }, /* 363 */
- { 33, 9, -10780, }, /* 364 */
- { 33, 9, -10749, }, /* 365 */
- { 33, 9, -10783, }, /* 366 */
- { 10, 5, 0, }, /* 367 */
- { 10, 26, 0, }, /* 368 */
- { 10, 21, 0, }, /* 369 */
- { 10, 15, 0, }, /* 370 */
- { 16, 5, -7264, }, /* 371 */
- { 58, 7, 0, }, /* 372 */
- { 58, 6, 0, }, /* 373 */
- { 22, 26, 0, }, /* 374 */
- { 22, 6, 0, }, /* 375 */
- { 22, 14, 0, }, /* 376 */
- { 26, 7, 0, }, /* 377 */
- { 26, 6, 0, }, /* 378 */
- { 29, 7, 0, }, /* 379 */
- { 29, 6, 0, }, /* 380 */
- { 3, 7, 0, }, /* 381 */
- { 23, 26, 0, }, /* 382 */
- { 29, 26, 0, }, /* 383 */
- { 22, 7, 0, }, /* 384 */
- { 60, 7, 0, }, /* 385 */
- { 60, 6, 0, }, /* 386 */
- { 60, 26, 0, }, /* 387 */
- { 76, 7, 0, }, /* 388 */
- { 76, 6, 0, }, /* 389 */
- { 76, 21, 0, }, /* 390 */
- { 76, 13, 0, }, /* 391 */
- { 12, 7, 0, }, /* 392 */
- { 12, 21, 0, }, /* 393 */
- { 33, 9, -35332, }, /* 394 */
- { 48, 7, 0, }, /* 395 */
- { 48, 12, 0, }, /* 396 */
- { 48, 10, 0, }, /* 397 */
- { 48, 26, 0, }, /* 398 */
- { 64, 7, 0, }, /* 399 */
- { 64, 21, 0, }, /* 400 */
- { 74, 10, 0, }, /* 401 */
- { 74, 7, 0, }, /* 402 */
- { 74, 12, 0, }, /* 403 */
- { 74, 21, 0, }, /* 404 */
- { 74, 13, 0, }, /* 405 */
- { 68, 13, 0, }, /* 406 */
- { 68, 7, 0, }, /* 407 */
- { 68, 12, 0, }, /* 408 */
- { 68, 21, 0, }, /* 409 */
- { 73, 7, 0, }, /* 410 */
- { 73, 12, 0, }, /* 411 */
- { 73, 10, 0, }, /* 412 */
- { 73, 21, 0, }, /* 413 */
- { 67, 7, 0, }, /* 414 */
- { 67, 12, 0, }, /* 415 */
- { 67, 10, 0, }, /* 416 */
- { 67, 13, 0, }, /* 417 */
- { 67, 21, 0, }, /* 418 */
- { 9, 4, 0, }, /* 419 */
- { 9, 3, 0, }, /* 420 */
- { 25, 25, 0, }, /* 421 */
- { 35, 7, 0, }, /* 422 */
- { 19, 14, 0, }, /* 423 */
- { 19, 15, 0, }, /* 424 */
- { 19, 26, 0, }, /* 425 */
- { 70, 7, 0, }, /* 426 */
- { 66, 7, 0, }, /* 427 */
- { 41, 7, 0, }, /* 428 */
- { 41, 15, 0, }, /* 429 */
- { 18, 7, 0, }, /* 430 */
- { 18, 14, 0, }, /* 431 */
- { 59, 7, 0, }, /* 432 */
- { 59, 21, 0, }, /* 433 */
- { 42, 7, 0, }, /* 434 */
- { 42, 21, 0, }, /* 435 */
- { 42, 14, 0, }, /* 436 */
- { 13, 9, 40, }, /* 437 */
- { 13, 5, -40, }, /* 438 */
- { 46, 7, 0, }, /* 439 */
- { 44, 7, 0, }, /* 440 */
- { 44, 13, 0, }, /* 441 */
- { 11, 7, 0, }, /* 442 */
- { 65, 7, 0, }, /* 443 */
- { 65, 15, 0, }, /* 444 */
- { 65, 21, 0, }, /* 445 */
- { 71, 7, 0, }, /* 446 */
- { 71, 21, 0, }, /* 447 */
- { 30, 7, 0, }, /* 448 */
- { 30, 12, 0, }, /* 449 */
- { 30, 15, 0, }, /* 450 */
- { 30, 21, 0, }, /* 451 */
- { 62, 7, 0, }, /* 452 */
- { 62, 14, 0, }, /* 453 */
- { 62, 21, 0, }, /* 454 */
- { 9, 10, 0, }, /* 455 */
- { 19, 12, 0, }, /* 456 */
-};
-
-const uschar _pcre_ucd_stage1[] = { /* 8704 bytes */
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* U+0000 */
- 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, /* U+0800 */
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 40, 40, 41, 42, 43, 44, /* U+1000 */
- 45, 46, 47, 48, 49, 16, 50, 51, 52, 16, 53, 54, 55, 56, 57, 58, /* U+1800 */
- 59, 60, 61, 62, 63, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, /* U+2000 */
- 74, 74, 63, 75, 63, 63, 76, 16, 77, 78, 79, 80, 81, 82, 83, 84, /* U+2800 */
- 85, 86, 87, 88, 89, 90, 91, 68, 92, 92, 92, 92, 92, 92, 92, 92, /* U+3000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+3800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+4000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 92, 92, 92, 92, /* U+4800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+5000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+5800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+6000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+6800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+7000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+7800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+8000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+8800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+9000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 94, /* U+9800 */
- 95, 96, 96, 96, 96, 96, 96, 96, 96, 97, 98, 98, 99,100,101,102, /* U+A000 */
-103,104,105, 16,106, 16, 16, 16,107,107,107,107,107,107,107,107, /* U+A800 */
-107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, /* U+B000 */
-107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, /* U+B800 */
-107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, /* U+C000 */
-107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, /* U+C800 */
-107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,108, /* U+D000 */
-109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109, /* U+D800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+E000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+E800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F000 */
-110,110, 92, 92,111,112,113,114,115,115,116,117,118,119,120,121, /* U+F800 */
-122,123,124,125, 16,126,127,128,129,130, 16, 16, 16, 16, 16, 16, /* U+10000 */
-131, 16,132, 16,133, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+10800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+11000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+11800 */
-134,134,134,134,134,134,135, 16,136, 16, 16, 16, 16, 16, 16, 16, /* U+12000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+12800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+13000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+13800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+14000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+14800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+15000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+15800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+16000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+16800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+17000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+17800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+18000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+18800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+19000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+19800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1A000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1A800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1B000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1B800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1C000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1C800 */
- 68,137,138,139,140, 16,141, 16,142,143,144,145,146,147,148,149, /* U+1D000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1D800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1E000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1E800 */
-150,151, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1F000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+1F800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+20000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+20800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+21000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+21800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+22000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+22800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+23000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+23800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+24000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+24800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+25000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+25800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+26000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+26800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+27000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+27800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+28000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+28800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+29000 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* U+29800 */
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,152, 16, 16, /* U+2A000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2A800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2B000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2B800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2C000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2C800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2D000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2D800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2E000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2E800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2F000 */
- 92, 92, 92, 92,153, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+2F800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+30000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+30800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+31000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+31800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+32000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+32800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+33000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+33800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+34000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+34800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+35000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+35800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+36000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+36800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+37000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+37800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+38000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+38800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+39000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+39800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3A000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3A800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3B000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3B800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3C000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3C800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3D000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3D800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3E000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3E800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3F000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+3F800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+40000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+40800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+41000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+41800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+42000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+42800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+43000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+43800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+44000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+44800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+45000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+45800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+46000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+46800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+47000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+47800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+48000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+48800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+49000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+49800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4A000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4A800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4B000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4B800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4C000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4C800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4D000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4D800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4E000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4E800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4F000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+4F800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+50000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+50800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+51000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+51800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+52000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+52800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+53000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+53800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+54000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+54800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+55000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+55800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+56000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+56800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+57000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+57800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+58000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+58800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+59000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+59800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5A000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5A800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5B000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5B800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5C000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5C800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5D000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5D800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5E000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5E800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5F000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+5F800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+60000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+60800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+61000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+61800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+62000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+62800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+63000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+63800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+64000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+64800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+65000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+65800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+66000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+66800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+67000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+67800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+68000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+68800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+69000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+69800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6A000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6A800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6B000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6B800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6C000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6C800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6D000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6D800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6E000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6E800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6F000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+6F800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+70000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+70800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+71000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+71800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+72000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+72800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+73000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+73800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+74000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+74800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+75000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+75800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+76000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+76800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+77000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+77800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+78000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+78800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+79000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+79800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7A000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7A800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7B000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7B800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7C000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7C800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7D000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7D800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7E000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7E800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7F000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+7F800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+80000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+80800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+81000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+81800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+82000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+82800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+83000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+83800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+84000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+84800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+85000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+85800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+86000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+86800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+87000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+87800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+88000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+88800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+89000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+89800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8A000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8A800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8B000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8B800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8C000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8C800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8D000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8D800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8E000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8E800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8F000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+8F800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+90000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+90800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+91000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+91800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+92000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+92800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+93000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+93800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+94000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+94800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+95000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+95800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+96000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+96800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+97000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+97800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+98000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+98800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+99000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+99800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9A000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9A800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9B000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9B800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9C000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9C800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9D000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9D800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9E000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9E800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9F000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+9F800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A0000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A0800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A1000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A1800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A2000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A2800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A3000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A3800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A4000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A4800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A5000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A5800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A6000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A6800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A7000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A7800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A8000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A8800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A9000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+A9800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AA000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AA800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AB000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AB800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AC000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AC800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AD000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AD800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AE000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AE800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AF000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+AF800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B0000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B0800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B1000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B1800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B2000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B2800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B3000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B3800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B4000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B4800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B5000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B5800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B6000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B6800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B7000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B7800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B8000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B8800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B9000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+B9800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BA000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BA800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BB000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BB800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BC000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BC800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BD000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BD800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BE000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BE800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BF000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+BF800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C0000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C0800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C1000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C1800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C2000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C2800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C3000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C3800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C4000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C4800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C5000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C5800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C6000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C6800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C7000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C7800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C8000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C8800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C9000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+C9800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CA000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CA800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CB000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CB800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CC000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CC800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CD000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CD800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CE000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CE800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CF000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+CF800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D0000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D0800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D1000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D1800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D2000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D2800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D3000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D3800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D4000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D4800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D5000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D5800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D6000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D6800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D7000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D7800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D8000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D8800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D9000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+D9800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DA000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DA800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DB000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DB800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DC000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DC800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DD000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DD800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DE000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DE800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DF000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+DF800 */
-154, 16,155,156, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E0000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E0800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E1000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E1800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E2000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E2800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E3000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E3800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E4000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E4800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E5000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E5800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E6000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E6800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E7000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E7800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E8000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E8800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E9000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+E9800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+EA000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+EA800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+EB000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+EB800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+EC000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+EC800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+ED000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+ED800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+EE000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+EE800 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+EF000 */
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* U+EF800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F0000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F0800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F1000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F1800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F2000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F2800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F3000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F3800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F4000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F4800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F5000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F5800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F6000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F6800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F7000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F7800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F8000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F8800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F9000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+F9800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FA000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FA800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FB000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FB800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FC000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FC800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FD000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FD800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FE000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FE800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+FF000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,157, /* U+FF800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+100000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+100800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+101000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+101800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+102000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+102800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+103000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+103800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+104000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+104800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+105000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+105800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+106000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+106800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+107000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+107800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+108000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+108800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+109000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+109800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10A000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10A800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10B000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10B800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10C000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10C800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10D000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10D800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10E000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10E800 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, /* U+10F000 */
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,157, /* U+10F800 */
-};
-
-const pcre_uint16 _pcre_ucd_stage2[] = { /* 40448 bytes, block = 128 */
-/* block 0 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 2, 2, 2, 3, 2, 2, 2, 4, 5, 2, 6, 2, 7, 2, 2,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2, 2, 6, 6, 6, 2,
- 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 4, 2, 5, 10, 11,
- 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 4, 6, 5, 6, 0,
-
-/* block 1 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 2, 3, 3, 3, 3, 13, 13, 10, 13, 14, 15, 6, 16, 13, 10,
- 13, 6, 17, 17, 10, 18, 13, 2, 10, 17, 14, 19, 17, 17, 17, 2,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 6, 9, 9, 9, 9, 9, 9, 9, 14,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 6, 12, 12, 12, 12, 12, 12, 12, 20,
-
-/* block 2 */
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 23, 24, 21, 22, 21, 22, 21, 22, 14, 21, 22, 21, 22, 21, 22, 21,
- 22, 21, 22, 21, 22, 21, 22, 21, 22, 14, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 25, 21, 22, 21, 22, 21, 22, 26,
-
-/* block 3 */
- 27, 28, 21, 22, 21, 22, 29, 21, 22, 30, 30, 21, 22, 14, 31, 32,
- 33, 21, 22, 30, 34, 35, 36, 37, 21, 22, 38, 14, 36, 39, 40, 41,
- 21, 22, 21, 22, 21, 22, 42, 21, 22, 42, 14, 14, 21, 22, 42, 21,
- 22, 43, 43, 21, 22, 21, 22, 44, 21, 22, 14, 45, 21, 22, 14, 46,
- 45, 45, 45, 45, 47, 48, 49, 47, 48, 49, 47, 48, 49, 21, 22, 21,
- 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 50, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 14, 47, 48, 49, 21, 22, 51, 52, 21, 22, 21, 22, 21, 22, 21, 22,
-
-/* block 4 */
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 53, 14, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 14, 14, 14, 14, 14, 14, 54, 21, 22, 55, 56, 14,
- 14, 21, 22, 57, 58, 59, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 60, 61, 14, 62, 63, 14, 64, 64, 14, 65, 14, 66, 14, 14, 14, 14,
- 64, 14, 14, 67, 14, 14, 14, 14, 68, 69, 14, 70, 14, 14, 14, 69,
- 14, 71, 72, 14, 14, 73, 14, 14, 14, 14, 14, 14, 14, 74, 14, 14,
-
-/* block 5 */
- 75, 14, 14, 75, 14, 14, 14, 14, 75, 76, 77, 77, 78, 14, 14, 14,
- 14, 14, 79, 14, 45, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 10, 10, 10, 10, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 80, 80, 80, 80, 80, 10, 10, 10, 10, 10, 10, 10, 81, 10, 81, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-
-/* block 6 */
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 83, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 84, 85, 84, 85, 81, 86, 84, 85, 87, 87, 88, 89, 89, 89, 2, 87,
-
-/* block 7 */
- 87, 87, 87, 87, 86, 10, 90, 2, 91, 91, 91, 87, 92, 87, 93, 93,
- 94, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
- 95, 95, 87, 95, 95, 95, 95, 95, 95, 95, 95, 95, 96, 97, 97, 97,
- 94, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 99, 98, 98, 98, 98, 98, 98, 98, 98, 98,100,101,101,102,
-103,104,105,105,105,106,107,108, 84, 85, 84, 85, 84, 85, 84, 85,
- 84, 85,109,110,109,110,109,110,109,110,109,110,109,110,109,110,
-111,112,113, 94,114,115,116, 84, 85,117, 84, 85, 94,118,118,118,
-
-/* block 8 */
-119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,
-120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
-120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
-121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,
-121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,
-122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-
-/* block 9 */
-123,124,125,126,126,126,126,126,127,127,123,124,123,124,123,124,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-128,123,124,123,124,123,124,123,124,123,124,123,124,123,124,129,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-
-/* block 10 */
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-123,124,123,124, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,
-130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,
-130,130,130,130,130,130,130, 87, 87,131,132,132,132,132,132,132,
- 87,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,
-133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,
-
-/* block 11 */
-133,133,133,133,133,133,133,134, 87, 2,135, 87, 87, 87, 87, 87,
- 87,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,
-136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,
-136,136,136,136,136,136,136,136,136,136,136,136,136,136,137,136,
-138,136,136,138,136,136,138,136, 87, 87, 87, 87, 87, 87, 87, 87,
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,
-139,139,139,139,139,139,139,139,139,139,139, 87, 87, 87, 87, 87,
-139,139,139,138,138, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 12 */
- 16, 16, 16, 16, 87, 87,140,140,140,141,141,142, 2,141,143,143,
-144,144,144,144,144,144,144,144,144,144,144, 2, 87, 87,141, 2,
- 87,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
- 81,145,145,145,145,145,145,145,145,145,145, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82,144,144,144,144,144,144,144,144,144, 87,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,141,141,141,141,145,145,
- 82,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-
-/* block 13 */
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,141,145,144,144,144,144,144,144,144, 16,146,144,
-144,144,144,144,144,147,147,144,144,143,144,144,144,144,145,145,
-148,148,148,148,148,148,148,148,148,148,145,145,145,143,143,145,
-
-/* block 14 */
-149,149,149,149,149,149,149,149,149,149,149,149,149,149, 87,150,
-151,152,151,151,151,151,151,151,151,151,151,151,151,151,151,151,
-151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,
-152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,
-152,152,152,152,152,152,152,152,152,152,152, 87, 87,151,151,151,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-
-/* block 15 */
-153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,
-153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,
-153,153,153,153,153,153,154,154,154,154,154,154,154,154,154,154,
-154,153, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-155,155,155,155,155,155,155,155,155,155,156,156,156,156,156,156,
-156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,
-156,156,156,156,156,156,156,156,156,156,156,157,157,157,157,157,
-157,157,157,157,158,158,159,160,160,160,158, 87, 87, 87, 87, 87,
-
-/* block 16 */
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 17 */
- 87,161,161,162,163,163,163,163,163,163,163,163,163,163,163,163,
-163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,
-163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,
-163,163,163,163,163,163,163,163,163,163, 87, 87,161,163,162,162,
-162,161,161,161,161,161,161,161,161,162,162,162,162,161, 87, 87,
-163, 82, 82,161,161, 87, 87, 87,163,163,163,163,163,163,163,163,
-163,163,161,161, 2, 2,164,164,164,164,164,164,164,164,164,164,
- 2,165,163, 87, 87, 87, 87, 87, 87, 87, 87,163,163,163,163,163,
-
-/* block 18 */
- 87,166,167,167, 87,168,168,168,168,168,168,168,168, 87, 87,168,
-168, 87, 87,168,168,168,168,168,168,168,168,168,168,168,168,168,
-168,168,168,168,168,168,168,168,168, 87,168,168,168,168,168,168,
-168, 87,168, 87, 87, 87,168,168,168,168, 87, 87,166,168,167,167,
-167,166,166,166,166, 87, 87,167,167, 87, 87,167,167,166,168, 87,
- 87, 87, 87, 87, 87, 87, 87,167, 87, 87, 87, 87,168,168, 87,168,
-168,168,166,166, 87, 87,169,169,169,169,169,169,169,169,169,169,
-168,168,170,170,171,171,171,171,171,171,172, 87, 87, 87, 87, 87,
-
-/* block 19 */
- 87,173,173,174, 87,175,175,175,175,175,175, 87, 87, 87, 87,175,
-175, 87, 87,175,175,175,175,175,175,175,175,175,175,175,175,175,
-175,175,175,175,175,175,175,175,175, 87,175,175,175,175,175,175,
-175, 87,175,175, 87,175,175, 87,175,175, 87, 87,173, 87,174,174,
-174,173,173, 87, 87, 87, 87,173,173, 87, 87,173,173,173, 87, 87,
- 87,173, 87, 87, 87, 87, 87, 87, 87,175,175,175,175, 87,175, 87,
- 87, 87, 87, 87, 87, 87,176,176,176,176,176,176,176,176,176,176,
-173,173,175,175,175,173, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 20 */
- 87,177,177,178, 87,179,179,179,179,179,179,179,179,179, 87,179,
-179,179, 87,179,179,179,179,179,179,179,179,179,179,179,179,179,
-179,179,179,179,179,179,179,179,179, 87,179,179,179,179,179,179,
-179, 87,179,179, 87,179,179,179,179,179, 87, 87,177,179,178,178,
-178,177,177,177,177,177, 87,177,177,178, 87,178,178,177, 87, 87,
-179, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-179,179,177,177, 87, 87,180,180,180,180,180,180,180,180,180,180,
- 87,181, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 21 */
- 87,182,183,183, 87,184,184,184,184,184,184,184,184, 87, 87,184,
-184, 87, 87,184,184,184,184,184,184,184,184,184,184,184,184,184,
-184,184,184,184,184,184,184,184,184, 87,184,184,184,184,184,184,
-184, 87,184,184, 87,184,184,184,184,184, 87, 87,182,184,183,182,
-183,182,182,182,182, 87, 87,183,183, 87, 87,183,183,182, 87, 87,
- 87, 87, 87, 87, 87, 87,182,183, 87, 87, 87, 87,184,184, 87,184,
-184,184,182,182, 87, 87,185,185,185,185,185,185,185,185,185,185,
-186,184, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 22 */
- 87, 87,187,188, 87,188,188,188,188,188,188, 87, 87, 87,188,188,
-188, 87,188,188,188,188, 87, 87, 87,188,188, 87,188, 87,188,188,
- 87, 87, 87,188,188, 87, 87, 87,188,188,188, 87, 87, 87,188,188,
-188,188,188,188,188,188,188,188,188,188, 87, 87, 87, 87,189,189,
-187,189,189, 87, 87, 87,189,189,189, 87,189,189,189,187, 87, 87,
-188, 87, 87, 87, 87, 87, 87,189, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87,190,190,190,190,190,190,190,190,190,190,
-191,191,191,192,192,192,192,192,192,193,192, 87, 87, 87, 87, 87,
-
-/* block 23 */
- 87,194,194,194, 87,195,195,195,195,195,195,195,195, 87,195,195,
-195, 87,195,195,195,195,195,195,195,195,195,195,195,195,195,195,
-195,195,195,195,195,195,195,195,195, 87,195,195,195,195,195,195,
-195,195,195,195, 87,195,195,195,195,195, 87, 87, 87,195,196,196,
-196,194,194,194,194, 87,196,196,196, 87,196,196,196,196, 87, 87,
- 87, 87, 87, 87, 87,196,196, 87,195,195, 87, 87, 87, 87, 87, 87,
-195,195,196,196, 87, 87,197,197,197,197,197,197,197,197,197,197,
- 87, 87, 87, 87, 87, 87, 87, 87,198,198,198,198,198,198,198,199,
-
-/* block 24 */
- 87, 87,200,200, 87,201,201,201,201,201,201,201,201, 87,201,201,
-201, 87,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
-201,201,201,201,201,201,201,201,201, 87,201,201,201,201,201,201,
-201,201,201,201, 87,201,201,201,201,201, 87, 87,202,201,200,202,
-200,200,200,200,200, 87,202,200,200, 87,200,200,202,202, 87, 87,
- 87, 87, 87, 87, 87,200,200, 87, 87, 87, 87, 87, 87, 87,201, 87,
-201,201,202,202, 87, 87,203,203,203,203,203,203,203,203,203,203,
- 87, 13, 13, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 25 */
- 87, 87,204,204, 87,205,205,205,205,205,205,205,205, 87,205,205,
-205, 87,205,205,205,205,205,205,205,205,205,205,205,205,205,205,
-205,205,205,205,205,205,205,205,205, 87,205,205,205,205,205,205,
-205,205,205,205,205,205,205,205,205,205, 87, 87, 87,205,204,204,
-204,206,206,206,206, 87,204,204,204, 87,204,204,204,206, 87, 87,
- 87, 87, 87, 87, 87, 87, 87,204, 87, 87, 87, 87, 87, 87, 87, 87,
-205,205,206,206, 87, 87,207,207,207,207,207,207,207,207,207,207,
-208,208,208,208,208,208, 87, 87, 87,209,205,205,205,205,205,205,
-
-/* block 26 */
- 87, 87,210,210, 87,211,211,211,211,211,211,211,211,211,211,211,
-211,211,211,211,211,211,211, 87, 87, 87,211,211,211,211,211,211,
-211,211,211,211,211,211,211,211,211,211,211,211,211,211,211,211,
-211,211, 87,211,211,211,211,211,211,211,211,211, 87,211, 87, 87,
-211,211,211,211,211,211,211, 87, 87, 87,212, 87, 87, 87, 87,210,
-210,210,212,212,212, 87,212, 87,210,210,210,210,210,210,210,210,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87,210,210,213, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 27 */
- 87,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,
-214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,
-214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,
-214,215,214,214,215,215,215,215,215,215,215, 87, 87, 87, 87, 3,
-214,214,214,214,214,214,216,215,215,215,215,215,215,215,215,217,
-218,218,218,218,218,218,218,218,218,218,217,217, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 28 */
- 87,219,219, 87,219, 87, 87,219,219, 87,219, 87, 87,219, 87, 87,
- 87, 87, 87, 87,219,219,219,219, 87,219,219,219,219,219,219,219,
- 87,219,219,219, 87,219, 87,219, 87, 87,219,219, 87,219,219,219,
-219,220,219,219,220,220,220,220,220,220, 87,220,220,219, 87, 87,
-219,219,219,219,219, 87,221, 87,220,220,220,220,220,220, 87, 87,
-222,222,222,222,222,222,222,222,222,222, 87, 87,219,219, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 29 */
-223,224,224,224,225,225,225,225,225,225,225,225,225,225,225,225,
-225,225,225,224,224,224,224,224,226,226,224,224,224,224,224,224,
-227,227,227,227,227,227,227,227,227,227,228,228,228,228,228,228,
-228,228,228,228,224,226,224,226,224,226,229,230,229,230,231,231,
-223,223,223,223,223,223,223,223, 87,223,223,223,223,223,223,223,
-223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,
-223,223,223,223,223,223,223,223,223,223,223,223,223, 87, 87, 87,
- 87,226,226,226,226,226,226,226,226,226,226,226,226,226,226,231,
-
-/* block 30 */
-226,226,226,226,226,225,226,226,223,223,223,223, 87, 87, 87, 87,
-226,226,226,226,226,226,226,226, 87,226,226,226,226,226,226,226,
-226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,
-226,226,226,226,226,226,226,226,226,226,226,226,226, 87,224,224,
-224,224,224,224,224,224,226,224,224,224,224,224,224, 87,224,224,
-225,225,225,225,225, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 31 */
-232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,
-232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,
-232,232,232,232,232,232,232,232,232,232,232,233,233,234,234,234,
-234,233,234,234,234,234,234,234,233,234,234,233,233,234,234,232,
-235,235,235,235,235,235,235,235,235,235,236,236,236,236,236,236,
-232,232,232,232,232,232,233,233,234,234,232,232,232,232,234,234,
-234,232,233,233,233,232,232,233,233,233,233,233,233,233,232,232,
-232,234,234,234,234,232,232,232,232,232,232,232,232,232,232,232,
-
-/* block 32 */
-232,232,234,233,233,234,234,233,233,233,233,233,233,234,232,233,
-235,235,235,235,235,235,235,235,235,235, 87, 87, 87, 87,237,237,
-238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,
-238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,
-238,238,238,238,238,238, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,
-239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,
-239,239,239,239,239,239,239,239,239,239,239, 2,240, 87, 87, 87,
-
-/* block 33 */
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241, 87, 87, 87, 87, 87,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-
-/* block 34 */
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241, 87, 87, 87, 87, 87,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241, 87, 87, 87, 87, 87, 87,
-
-/* block 35 */
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242, 87,242,242,242,242, 87, 87,
-242,242,242,242,242,242,242, 87,242, 87,242,242,242,242, 87, 87,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-
-/* block 36 */
-242,242,242,242,242,242,242,242,242, 87,242,242,242,242, 87, 87,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242, 87,242,242,242,242, 87, 87,242,242,242,242,242,242,242, 87,
-242, 87,242,242,242,242, 87, 87,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242, 87,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-
-/* block 37 */
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242, 87,242,242,242,242, 87, 87,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242, 87, 87, 87, 87,243,
-244,245,245,245,245,245,245,245,245,246,246,246,246,246,246,246,
-246,246,246,246,246,246,246,246,246,246,246,246,246, 87, 87, 87,
-
-/* block 38 */
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-244,244,244,244,244,244,244,244,244,244, 87, 87, 87, 87, 87, 87,
-247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,
-247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,
-247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,
-247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,
-247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,
-247,247,247,247,247, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 39 */
- 87,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-
-/* block 40 */
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-
-/* block 41 */
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,248,248,248,248,249,249,248,
-248,248,248,248,248,248,248, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 42 */
-250,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,
-251,251,251,251,251,251,251,251,251,251,251,252,253, 87, 87, 87,
-254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,
-254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,
-254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,
-254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,
-254,254,254,254,254,254,254,254,254,254,254, 2, 2, 2,255,255,
-255, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 43 */
-256,256,256,256,256,256,256,256,256,256,256,256,256, 87,256,256,
-256,256,257,257,257, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,
-258,258,259,259,259, 2, 2, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-260,260,260,260,260,260,260,260,260,260,260,260,260,260,260,260,
-260,260,261,261, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-262,262,262,262,262,262,262,262,262,262,262,262,262, 87,262,262,
-262, 87,263,263, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 44 */
-264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,
-264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,
-264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,
-264,264,264,264,265,265,266,267,267,267,267,267,267,267,266,266,
-266,266,266,266,266,266,267,266,266,267,267,267,267,267,267,267,
-267,267,267,267,268,268,268,269,268,268,268,270,264,267, 87, 87,
-271,271,271,271,271,271,271,271,271,271, 87, 87, 87, 87, 87, 87,
-272,272,272,272,272,272,272,272,272,272, 87, 87, 87, 87, 87, 87,
-
-/* block 45 */
-273,273, 2, 2,273, 2,274,273,273,273,273,275,275,275,276, 87,
-277,277,277,277,277,277,277,277,277,277, 87, 87, 87, 87, 87, 87,
-278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,
-278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,
-278,278,278,279,278,278,278,278,278,278,278,278,278,278,278,278,
-278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,
-278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,
-278,278,278,278,278,278,278,278, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 46 */
-278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,
-278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,
-278,278,278,278,278,278,278,278,278,275,278, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 47 */
-280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
-280,280,280,280,280,280,280,280,280,280,280,280,280, 87, 87, 87,
-281,281,281,282,282,282,282,281,281,282,282,282, 87, 87, 87, 87,
-282,282,281,282,282,282,282,282,282,281,281,281, 87, 87, 87, 87,
-283, 87, 87, 87,284,284,285,285,285,285,285,285,285,285,285,285,
-286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
-286,286,286,286,286,286,286,286,286,286,286,286,286,286, 87, 87,
-286,286,286,286,286, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 48 */
-287,287,287,287,287,287,287,287,287,287,287,287,287,287,287,287,
-287,287,287,287,287,287,287,287,287,287,287,287,287,287,287,287,
-287,287,287,287,287,287,287,287,287,287, 87, 87, 87, 87, 87, 87,
-288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,
-288,287,287,287,287,287,287,287,288,288, 87, 87, 87, 87, 87, 87,
-289,289,289,289,289,289,289,289,289,289, 87, 87, 87, 87,290,290,
-291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,
-291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,
-
-/* block 49 */
-292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
-292,292,292,292,292,292,292,293,293,294,294,294, 87, 87,295,295,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 50 */
-296,296,296,296,297,298,298,298,298,298,298,298,298,298,298,298,
-298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,
-298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,
-298,298,298,298,296,297,296,296,296,296,296,297,296,297,297,297,
-297,297,296,297,297,298,298,298,298,298,298,298, 87, 87, 87, 87,
-299,299,299,299,299,299,299,299,299,299,300,300,300,300,300,300,
-300,301,301,301,301,301,301,301,301,301,301,296,296,296,296,296,
-296,296,296,296,301,301,301,301,301,301,301,301,301, 87, 87, 87,
-
-/* block 51 */
-302,302,303,304,304,304,304,304,304,304,304,304,304,304,304,304,
-304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,
-304,303,302,302,302,302,303,303,302,302,303, 87, 87, 87,304,304,
-305,305,305,305,305,305,305,305,305,305, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 52 */
-306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,
-306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,
-306,306,306,306,307,307,307,307,307,307,307,307,308,308,308,308,
-308,308,308,308,307,307,308,308, 87, 87, 87,309,309,309,309,309,
-310,310,310,310,310,310,310,310,310,310, 87, 87, 87,306,306,306,
-311,311,311,311,311,311,311,311,311,311,312,312,312,312,312,312,
-312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,
-312,312,312,312,312,312,312,312,313,313,313,313,313,313,314,314,
-
-/* block 53 */
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 94, 94, 94, 94, 94,315, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 88, 88, 88,
- 88, 88, 14, 14, 14, 14, 94, 94, 94, 94, 94, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,316,317, 14, 14, 14,318, 14, 14,
-
-/* block 54 */
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 88,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 82, 82,
-
-/* block 55 */
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
-
-/* block 56 */
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 14, 14, 14, 14, 14,319, 14, 14,320, 14,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
-
-/* block 57 */
-321,321,321,321,321,321,321,321,322,322,322,322,322,322,322,322,
-321,321,321,321,321,321, 87, 87,322,322,322,322,322,322, 87, 87,
-321,321,321,321,321,321,321,321,322,322,322,322,322,322,322,322,
-321,321,321,321,321,321,321,321,322,322,322,322,322,322,322,322,
-321,321,321,321,321,321, 87, 87,322,322,322,322,322,322, 87, 87,
- 94,321, 94,321, 94,321, 94,321, 87,322, 87,322, 87,322, 87,322,
-321,321,321,321,321,321,321,321,322,322,322,322,322,322,322,322,
-323,323,324,324,324,324,325,325,326,326,327,327,328,328, 87, 87,
-
-/* block 58 */
-321,321,321,321,321,321,321,321,329,329,329,329,329,329,329,329,
-321,321,321,321,321,321,321,321,329,329,329,329,329,329,329,329,
-321,321,321,321,321,321,321,321,329,329,329,329,329,329,329,329,
-321,321, 94,330, 94, 87, 94, 94,322,322,331,331,332, 86,333, 86,
- 86, 86, 94,330, 94, 87, 94, 94,334,334,334,334,332, 86, 86, 86,
-321,321, 94, 94, 87, 87, 94, 94,322,322,335,335, 87, 86, 86, 86,
-321,321, 94, 94, 94,113, 94, 94,322,322,336,336,117, 86, 86, 86,
- 87, 87, 94,330, 94, 87, 94, 94,337,337,338,338,332, 86, 86, 87,
-
-/* block 59 */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16,339,339, 16, 16,
- 7, 7, 7, 7, 7, 7, 2, 2, 15, 19, 4, 15, 15, 19, 4, 15,
- 2, 2, 2, 2, 2, 2, 2, 2,340,341, 16, 16, 16, 16, 16, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 15, 19, 2, 2, 2, 2, 11,
- 11, 2, 2, 2, 6, 4, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 6, 2, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,
- 16, 16, 16, 16, 16, 87, 87, 87, 87, 87, 16, 16, 16, 16, 16, 16,
- 17, 14, 87, 87, 17, 17, 17, 17, 17, 17, 6, 6, 6, 4, 5, 14,
-
-/* block 60 */
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 6, 6, 6, 4, 5, 87,
- 80, 80, 80, 80, 80, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,342,342,342,
-342, 82,342,342,342, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 61 */
- 13, 13,343, 13, 13, 13, 13,343, 13, 13,344,343,343,343,344,344,
-343,343,343,344, 13,343, 13, 13, 13,343,343,343,343,343, 13, 13,
- 13, 13, 13, 13,343, 13,345, 13,343, 13,346,347,343,343, 13,344,
-343,343,348,343,344,349,349,349,349,344, 13, 13,344,344,343,343,
- 6, 6, 6, 6, 6,343,344,344,344,344, 13, 6, 13, 13,350, 13,
- 87, 87, 87, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,
-352,352,352,352,352,352,352,352,352,352,352,352,352,352,352,352,
-
-/* block 62 */
-353,353,353, 21, 22,353,353,353,353, 87, 87, 87, 87, 87, 87, 87,
- 6, 6, 6, 6, 6, 13, 13, 13, 13, 13, 6, 6, 13, 13, 13, 13,
- 6, 13, 13, 6, 13, 13, 6, 13, 13, 13, 13, 13, 13, 13, 6, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 6, 6,
- 13, 13, 6, 13, 6, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-
-/* block 63 */
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-
-/* block 64 */
- 13, 13, 13, 13, 13, 13, 13, 13, 6, 6, 6, 6, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 6, 6, 13, 13, 13, 13, 13, 13, 13, 4, 5, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 6, 13, 13, 13,
-
-/* block 65 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 6, 6, 6, 6,
- 6, 6, 13, 13, 13, 13, 13, 13, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 66 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-
-/* block 67 */
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13,354,354,354,354,354,354,354,354,354,354,
-354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,
-355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,
-355,355,355,355,355,355,355,355,355,355, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-
-/* block 68 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-
-/* block 69 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 6, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 6, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 6, 6, 6, 6, 6, 6, 6, 6,
-
-/* block 70 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 6,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-
-/* block 71 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87, 87,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87, 87, 87,
- 13, 13, 13, 13, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 72 */
- 87, 13, 13, 13, 13, 87, 13, 13, 13, 13, 87, 87, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 87, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87, 13, 87, 13,
- 13, 13, 13, 87, 87, 87, 13, 87, 13, 13, 13, 13, 13, 13, 13, 87,
- 87, 13, 13, 13, 13, 13, 13, 13, 4, 5, 4, 5, 4, 5, 4, 5,
- 4, 5, 4, 5, 4, 5, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-
-/* block 73 */
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 13, 87, 87, 87, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 87, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87,
- 6, 6, 6, 6, 6, 4, 5, 6, 6, 6, 6, 87, 6, 87, 87, 87,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-
-/* block 74 */
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-
-/* block 75 */
- 6, 6, 6, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4,
- 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, 4, 5, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, 6, 6,
-
-/* block 76 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 13, 13, 6, 6, 6, 6, 6, 6, 87, 87, 87,
- 13, 13, 13, 13, 13, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 77 */
-357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,
-357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,
-357,357,357,357,357,357,357,357,357,357,357,357,357,357,357, 87,
-358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,
-358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,
-358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, 87,
- 21, 22,359,360,361,362,363, 21, 22, 21, 22, 21, 22,364,365,366,
- 87, 14, 21, 22, 14, 21, 22, 14, 14, 14, 14, 14, 14, 80, 87, 87,
-
-/* block 78 */
-109,110,109,110,109,110,109,110,109,110,109,110,109,110,109,110,
-109,110,109,110,109,110,109,110,109,110,109,110,109,110,109,110,
-109,110,109,110,109,110,109,110,109,110,109,110,109,110,109,110,
-109,110,109,110,109,110,109,110,109,110,109,110,109,110,109,110,
-109,110,109,110,109,110,109,110,109,110,109,110,109,110,109,110,
-109,110,109,110,109,110,109,110,109,110,109,110,109,110,109,110,
-109,110,109,110,367,368,368,368,368,368,368, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87,369,369,369,369,370,369,369,
-
-/* block 79 */
-371,371,371,371,371,371,371,371,371,371,371,371,371,371,371,371,
-371,371,371,371,371,371,371,371,371,371,371,371,371,371,371,371,
-371,371,371,371,371,371, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,
-372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,
-372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,
-372,372,372,372,372,372, 87, 87, 87, 87, 87, 87, 87, 87, 87,373,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 80 */
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-242,242,242,242,242,242,242, 87,242,242,242,242,242,242,242, 87,
-242,242,242,242,242,242,242, 87,242,242,242,242,242,242,242, 87,
-242,242,242,242,242,242,242, 87,242,242,242,242,242,242,242, 87,
-242,242,242,242,242,242,242, 87,242,242,242,242,242,242,242, 87,
-126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,
-126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,
-
-/* block 81 */
- 2, 2, 15, 19, 15, 19, 2, 2, 2, 15, 19, 2, 15, 19, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 7, 2, 2, 7, 2, 15, 19, 2, 2,
- 15, 19, 4, 5, 4, 5, 4, 5, 4, 5, 2, 2, 2, 2, 2, 81,
- 2, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 82 */
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374, 87,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 83 */
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-
-/* block 84 */
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87, 87, 87, 87,
-
-/* block 85 */
- 1, 2, 2, 2, 13,375,349,376, 4, 5, 4, 5, 4, 5, 4, 5,
- 4, 5, 13, 13, 4, 5, 4, 5, 4, 5, 4, 5, 7, 4, 5, 5,
- 13,376,376,376,376,376,376,376,376,376, 82, 82, 82, 82, 82, 82,
- 7, 81, 81, 81, 81, 81, 13, 13,376,376,376,375,349, 2, 13, 13,
- 87,377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,
-377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,
-377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,
-377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,
-
-/* block 86 */
-377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,
-377,377,377,377,377,377,377, 87, 87, 82, 82, 10, 10,378,378,377,
- 7,379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,
-379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,
-379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,
-379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,
-379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,
-379,379,379,379,379,379,379,379,379,379,379, 2, 81,380,380,379,
-
-/* block 87 */
- 87, 87, 87, 87, 87,381,381,381,381,381,381,381,381,381,381,381,
-381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,
-381,381,381,381,381,381,381,381,381,381,381,381,381,381, 87, 87,
- 87,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-
-/* block 88 */
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241, 87,
- 13, 13, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,
-381,381,381,381,381,381,381,381, 87, 87, 87, 87, 87, 87, 87, 87,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,
-
-/* block 89 */
-382,382,382,382,382,382,382,382,382,382,382,382,382,382,382,382,
-382,382,382,382,382,382,382,382,382,382,382,382,382,382,382, 87,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-382,382,382,382,382,382,382,382,382,382,382,382,382,382,382,382,
-382,382,382,382,382,382,382,382,382,382,382,382,382,382,382, 13,
-
-/* block 90 */
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
-383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
-383,383,383,383,383,383,383,383,383,383,383,383,383,383,383, 87,
-
-/* block 91 */
-383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
-383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
-383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
-383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
-383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
-383,383,383,383,383,383,383,383, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-
-/* block 92 */
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-
-/* block 93 */
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-
-/* block 94 */
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 95 */
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,386,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-
-/* block 96 */
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,
-
-/* block 97 */
-385,385,385,385,385,385,385,385,385,385,385,385,385, 87, 87, 87,
-387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
-387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
-387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
-387,387,387,387,387,387,387, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 98 */
-388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,
-388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,
-388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,
-388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,
-388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,
-388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,
-388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,
-388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,
-
-/* block 99 */
-388,388,388,388,388,388,388,388,388,388,388,388,389,390,390,390,
-388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,
-391,391,391,391,391,391,391,391,391,391,388,388, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
- 87, 87,123,124,123,124,123,124,123,124,123,124,123,124,392,126,
-127,127,127,393, 87, 87, 87, 87, 87, 87, 87, 87,126,126,393,316,
-
-/* block 100 */
-123,124,123,124,123,124,123,124,123,124,123,124,123,124,123,124,
-123,124,123,124,123,124,123,124, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 101 */
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 10, 10, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 14, 14, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
- 80, 14, 14, 14, 14, 14, 14, 14, 14, 21, 22, 21, 22,394, 21, 22,
-
-/* block 102 */
- 21, 22, 21, 22, 21, 22, 21, 22, 81, 10, 10, 21, 22, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 45, 45, 45, 45, 45,
-
-/* block 103 */
-395,395,396,395,395,395,396,395,395,395,395,396,395,395,395,395,
-395,395,395,395,395,395,395,395,395,395,395,395,395,395,395,395,
-395,395,395,397,397,396,396,397,398,398,398,398, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-399,399,399,399,399,399,399,399,399,399,399,399,399,399,399,399,
-399,399,399,399,399,399,399,399,399,399,399,399,399,399,399,399,
-399,399,399,399,399,399,399,399,399,399,399,399,399,399,399,399,
-399,399,399,399,400,400,400,400, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 104 */
-401,401,402,402,402,402,402,402,402,402,402,402,402,402,402,402,
-402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,
-402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,
-402,402,402,402,401,401,401,401,401,401,401,401,401,401,401,401,
-401,401,401,401,403, 87, 87, 87, 87, 87, 87, 87, 87, 87,404,404,
-405,405,405,405,405,405,405,405,405,405, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 105 */
-406,406,406,406,406,406,406,406,406,406,407,407,407,407,407,407,
-407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,
-407,407,407,407,407,407,408,408,408,408,408,408,408,408,409,409,
-410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,
-410,410,410,410,410,410,410,411,411,411,411,411,411,411,411,411,
-411,411,412,412, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,413,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 106 */
-414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,
-414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,
-414,414,414,414,414,414,414,414,414,415,415,415,415,415,415,416,
-416,415,415,416,416,415,415, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-414,414,414,415,414,414,414,414,414,414,414,414,415,416, 87, 87,
-417,417,417,417,417,417,417,417,417,417, 87, 87,418,418,418,418,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 107 */
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-
-/* block 108 */
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 109 */
-419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
-419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
-419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
-419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
-419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
-419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
-419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
-419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
-
-/* block 110 */
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-
-/* block 111 */
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384, 87, 87,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384, 87, 87, 87, 87, 87,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-
-/* block 112 */
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 113 */
- 14, 14, 14, 14, 14, 14, 14, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87,134,134,134,134,134, 87, 87, 87, 87, 87,139,136,139,
-139,139,139,139,139,139,139,139,139,421,139,139,139,139,139,139,
-139,139,139,139,139,139,139, 87,139,139,139,139,139, 87,139, 87,
-139,139, 87,139,139, 87,139,139,139,139,139,139,139,139,139,139,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-
-/* block 114 */
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-
-/* block 115 */
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-
-/* block 116 */
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145, 4, 5,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-
-/* block 117 */
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
- 87, 87,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-145,145,145,145,145,145,145,145,145,145,145,145,142, 13, 87, 87,
-
-/* block 118 */
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 2, 2, 2, 2, 2, 2, 2, 4, 5, 2, 87, 87, 87, 87, 87, 87,
- 82, 82, 82, 82, 82, 82, 82, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 2, 7, 7, 11, 11, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4,
- 5, 4, 5, 4, 5, 2, 2, 4, 5, 2, 2, 2, 2, 11, 11, 11,
- 2, 2, 2, 87, 2, 2, 2, 2, 7, 4, 5, 4, 5, 4, 5, 2,
- 2, 2, 6, 7, 6, 6, 6, 87, 2, 3, 2, 2, 87, 87, 87, 87,
-145,145,145,145,145, 87,145,145,145,145,145,145,145,145,145,145,
-
-/* block 119 */
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
-145,145,145,145,145,145,145,145,145,145,145,145,145, 87, 87, 16,
-
-/* block 120 */
- 87, 2, 2, 2, 3, 2, 2, 2, 4, 5, 2, 6, 2, 7, 2, 2,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2, 2, 6, 6, 6, 2,
- 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 4, 2, 5, 10, 11,
- 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 4, 6, 5, 6, 4,
- 5, 2, 4, 5, 2, 2,379,379,379,379,379,379,379,379,379,379,
- 81,379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,
-
-/* block 121 */
-379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,379,
-379,379,379,379,379,379,379,379,379,379,379,379,379,379, 81, 81,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
-241,241,241,241,241,241,241,241,241,241,241,241,241,241,241, 87,
- 87, 87,241,241,241,241,241,241, 87, 87,241,241,241,241,241,241,
- 87, 87,241,241,241,241,241,241, 87, 87,241,241,241, 87, 87, 87,
- 3, 3, 6, 10, 13, 3, 3, 87, 13, 6, 6, 6, 6, 13, 13, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 16, 16, 16, 13, 13, 87, 87,
-
-/* block 122 */
-422,422,422,422,422,422,422,422,422,422,422,422, 87,422,422,422,
-422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,
-422,422,422,422,422,422,422, 87,422,422,422,422,422,422,422,422,
-422,422,422,422,422,422,422,422,422,422,422, 87,422,422, 87,422,
-422,422,422,422,422,422,422,422,422,422,422,422,422,422, 87, 87,
-422,422,422,422,422,422,422,422,422,422,422,422,422,422, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 123 */
-422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,
-422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,
-422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,
-422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,
-422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,
-422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,
-422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,
-422,422,422,422,422,422,422,422,422,422,422, 87, 87, 87, 87, 87,
-
-/* block 124 */
- 2, 2, 13, 87, 87, 87, 87, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 87, 87, 87, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,
-423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,
-423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,
-423,423,423,423,423,424,424,424,424,425,425,425,425,425,425,425,
-
-/* block 125 */
-425,425,425,425,425,425,425,425,425,425,424, 87, 87, 87, 87, 87,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 82, 87, 87,
-
-/* block 126 */
-426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,
-426,426,426,426,426,426,426,426,426,426,426,426,426, 87, 87, 87,
-427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,
-427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,
-427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,
-427, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 127 */
-428,428,428,428,428,428,428,428,428,428,428,428,428,428,428,428,
-428,428,428,428,428,428,428,428,428,428,428,428,428,428,428, 87,
-429,429,429,429, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-430,430,430,430,430,430,430,430,430,430,430,430,430,430,430,430,
-430,431,430,430,430,430,430,430,430,430,431, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 128 */
-432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,
-432,432,432,432,432,432,432,432,432,432,432,432,432,432, 87,433,
-434,434,434,434,434,434,434,434,434,434,434,434,434,434,434,434,
-434,434,434,434,434,434,434,434,434,434,434,434,434,434,434,434,
-434,434,434,434, 87, 87, 87, 87,434,434,434,434,434,434,434,434,
-435,436,436,436,436,436, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 129 */
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-
-/* block 130 */
-440,440,440,440,440,440,440,440,440,440,440,440,440,440,440,440,
-440,440,440,440,440,440,440,440,440,440,440,440,440,440, 87, 87,
-441,441,441,441,441,441,441,441,441,441, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 131 */
-442,442,442,442,442,442, 87, 87,442, 87,442,442,442,442,442,442,
-442,442,442,442,442,442,442,442,442,442,442,442,442,442,442,442,
-442,442,442,442,442,442,442,442,442,442,442,442,442,442,442,442,
-442,442,442,442,442,442, 87,442,442, 87, 87, 87,442, 87, 87,442,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 132 */
-443,443,443,443,443,443,443,443,443,443,443,443,443,443,443,443,
-443,443,443,443,443,443,444,444,444,444, 87, 87, 87, 87, 87,445,
-446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,
-446,446,446,446,446,446,446,446,446,446, 87, 87, 87, 87, 87,447,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 133 */
-448,449,449,449, 87,449,449, 87, 87, 87, 87, 87,449,449,449,449,
-448,448,448,448, 87,448,448,448, 87,448,448,448,448,448,448,448,
-448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,
-448,448,448,448, 87, 87, 87, 87,449,449,449, 87, 87, 87, 87,449,
-450,450,450,450,450,450,450,450, 87, 87, 87, 87, 87, 87, 87, 87,
-451,451,451,451,451,451,451,451,451, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 134 */
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-
-/* block 135 */
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 136 */
-453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,
-453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,
-453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,
-453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,
-453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,
-453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,
-453,453,453, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-454,454,454,454, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 137 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 138 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 87, 87, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13,455,455, 82, 82, 82, 13, 13, 13,455,455,455,
-455,455,455, 16, 16, 16, 16, 16, 16, 16, 16, 82, 82, 82, 82, 82,
-
-/* block 139 */
- 82, 82, 82, 13, 13, 82, 82, 82, 82, 82, 82, 82, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 82, 82, 82, 82, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 140 */
-425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,
-425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,
-425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,
-425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,425,
-425,425,456,456,456,425, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 141 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 142 */
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,344,344,
-344,344,344,344,344, 87,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-
-/* block 143 */
-343,343,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,343, 87,343,343,
- 87, 87,343, 87, 87,343,343, 87, 87,343,343,343,343, 87,343,343,
-343,343,343,343,343,343,344,344,344,344, 87,344, 87,344,344,344,
-344,344,344,344, 87,344,344,344,344,344,344,344,344,344,344,344,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-
-/* block 144 */
-344,344,344,344,343,343, 87,343,343,343,343, 87, 87,343,343,343,
-343,343,343,343,343, 87,343,343,343,343,343,343,343, 87,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,343,343, 87,343,343,343,343, 87,
-343,343,343,343,343, 87,343, 87, 87, 87,343,343,343,343,343,343,
-343, 87,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-
-/* block 145 */
-343,343,343,343,343,343,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-
-/* block 146 */
-344,344,344,344,344,344,344,344,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-
-/* block 147 */
-343,343,343,343,343,343,343,343,343,343,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344,344, 87, 87,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343, 6,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344, 6,344,344,344,344,
-344,344,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343, 6,344,344,344,344,
-
-/* block 148 */
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344, 6,344,344,344,344,344,344,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343, 6,344,344,344,344,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344, 6,
-344,344,344,344,344,344,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343, 6,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-
-/* block 149 */
-344,344,344,344,344,344,344,344,344, 6,344,344,344,344,344,344,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343, 6,344,344,344,344,344,344,
-344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,
-344,344,344, 6,344,344,344,344,344,344,343,344, 87, 87, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-
-/* block 150 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87, 87, 87, 87,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-
-/* block 151 */
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 152 */
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 153 */
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 154 */
- 87, 16, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-
-/* block 155 */
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
-
-/* block 156 */
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-
-/* block 157 */
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
-420,420,420,420,420,420,420,420,420,420,420,420,420,420, 87, 87,
-
-};
-
-#if UCD_BLOCK_SIZE != 128
-#error Please correct UCD_BLOCK_SIZE in pcre_internal.h
-#endif
diff --git a/Utilities/Poco/Foundation/src/pcre_valid_utf8.c b/Utilities/Poco/Foundation/src/pcre_valid_utf8.c
deleted file mode 100755
index aab69bf94b..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_valid_utf8.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains an internal function for validating UTF-8 character
-strings. */
-
-
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-
-/*************************************************
-* Validate a UTF-8 string *
-*************************************************/
-
-/* This function is called (optionally) at the start of compile or match, to
-validate that a supposed UTF-8 string is actually valid. The early check means
-that subsequent code can assume it is dealing with a valid string. The check
-can be turned off for maximum performance, but the consequences of supplying
-an invalid string are then undefined.
-
-Originally, this function checked according to RFC 2279, allowing for values in
-the range 0 to 0x7fffffff, up to 6 bytes long, but ensuring that they were in
-the canonical format. Once somebody had pointed out RFC 3629 to me (it
-obsoletes 2279), additional restrictions were applied. The values are now
-limited to be between 0 and 0x0010ffff, no more than 4 bytes long, and the
-subrange 0xd000 to 0xdfff is excluded.
-
-Arguments:
- string points to the string
- length length of string, or -1 if the string is zero-terminated
-
-Returns: < 0 if the string is a valid UTF-8 string
- >= 0 otherwise; the value is the offset of the bad byte
-*/
-
-int
-_pcre_valid_utf8(const uschar *string, int length)
-{
-#ifdef SUPPORT_UTF8
-register const uschar *p;
-
-if (length < 0)
- {
- for (p = string; *p != 0; p++);
- length = p - string;
- }
-
-for (p = string; length-- > 0; p++)
- {
- register int ab;
- register int c = *p;
- if (c < 128) continue;
- if (c < 0xc0) return p - string;
- ab = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */
- if (length < ab || ab > 3) return p - string;
- length -= ab;
-
- /* Check top bits in the second byte */
- if ((*(++p) & 0xc0) != 0x80) return p - string;
-
- /* Check for overlong sequences for each different length, and for the
- excluded range 0xd000 to 0xdfff. */
-
- switch (ab)
- {
- /* Check for xx00 000x (overlong sequence) */
-
- case 1:
- if ((c & 0x3e) == 0) return p - string;
- continue; /* We know there aren't any more bytes to check */
-
- /* Check for 1110 0000, xx0x xxxx (overlong sequence) or
- 1110 1101, 1010 xxxx (0xd000 - 0xdfff) */
-
- case 2:
- if ((c == 0xe0 && (*p & 0x20) == 0) ||
- (c == 0xed && *p >= 0xa0))
- return p - string;
- break;
-
- /* Check for 1111 0000, xx00 xxxx (overlong sequence) or
- greater than 0x0010ffff (f4 8f bf bf) */
-
- case 3:
- if ((c == 0xf0 && (*p & 0x30) == 0) ||
- (c > 0xf4 ) ||
- (c == 0xf4 && *p > 0x8f))
- return p - string;
- break;
-
-#if 0
- /* These cases can no longer occur, as we restrict to a maximum of four
- bytes nowadays. Leave the code here in case we ever want to add an option
- for longer sequences. */
-
- /* Check for 1111 1000, xx00 0xxx */
- case 4:
- if (c == 0xf8 && (*p & 0x38) == 0) return p - string;
- break;
-
- /* Check for leading 0xfe or 0xff, and then for 1111 1100, xx00 00xx */
- case 5:
- if (c == 0xfe || c == 0xff ||
- (c == 0xfc && (*p & 0x3c) == 0)) return p - string;
- break;
-#endif
-
- }
-
- /* Check for valid bytes after the 2nd, if any; all must start 10 */
- while (--ab > 0)
- {
- if ((*(++p) & 0xc0) != 0x80) return p - string;
- }
- }
-#else
-(void)(string); /* Keep picky compilers happy */
-(void)(length);
-#endif
-
-return -1;
-}
-
-/* End of pcre_valid_utf8.c */
diff --git a/Utilities/Poco/Foundation/src/pcre_xclass.c b/Utilities/Poco/Foundation/src/pcre_xclass.c
deleted file mode 100755
index 2a602e4b91..0000000000
--- a/Utilities/Poco/Foundation/src/pcre_xclass.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
- Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the University of Cambridge nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains an internal function that is used to match an extended
-class (one that contains characters whose values are > 255). It is used by both
-pcre_exec() and pcre_def_exec(). */
-
-
-#include "pcre_config.h"
-#include "pcre_internal.h"
-
-
-/*************************************************
-* Match character against an XCLASS *
-*************************************************/
-
-/* This function is called to match a character against an extended class that
-might contain values > 255.
-
-Arguments:
- c the character
- data points to the flag byte of the XCLASS data
-
-Returns: TRUE if character matches, else FALSE
-*/
-
-BOOL
-_pcre_xclass(int c, const uschar *data)
-{
-int t;
-BOOL negated = (*data & XCL_NOT) != 0;
-
-/* Character values < 256 are matched against a bitmap, if one is present. If
-not, we still carry on, because there may be ranges that start below 256 in the
-additional data. */
-
-if (c < 256)
- {
- if ((*data & XCL_MAP) != 0 && (data[1 + c/8] & (1 << (c&7))) != 0)
- return !negated; /* char found */
- }
-
-/* First skip the bit map if present. Then match against the list of Unicode
-properties or large chars or ranges that end with a large char. We won't ever
-encounter XCL_PROP or XCL_NOTPROP when UCP support is not compiled. */
-
-if ((*data++ & XCL_MAP) != 0) data += 32;
-
-while ((t = *data++) != XCL_END)
- {
- int x, y;
- if (t == XCL_SINGLE)
- {
- GETCHARINC(x, data);
- if (c == x) return !negated;
- }
- else if (t == XCL_RANGE)
- {
- GETCHARINC(x, data);
- GETCHARINC(y, data);
- if (c >= x && c <= y) return !negated;
- }
-
-#ifdef SUPPORT_UCP
- else /* XCL_PROP & XCL_NOTPROP */
- {
- const ucd_record * prop = GET_UCD(c);
-
- switch(*data)
- {
- case PT_ANY:
- if (t == XCL_PROP) return !negated;
- break;
-
- case PT_LAMP:
- if ((prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt) ==
- (t == XCL_PROP)) return !negated;
- break;
-
- case PT_GC:
- if ((data[1] == _pcre_ucp_gentype[prop->chartype]) == (t == XCL_PROP)) return !negated;
- break;
-
- case PT_PC:
- if ((data[1] == prop->chartype) == (t == XCL_PROP)) return !negated;
- break;
-
- case PT_SC:
- if ((data[1] == prop->script) == (t == XCL_PROP)) return !negated;
- break;
-
- /* This should never occur, but compilers may mutter if there is no
- default. */
-
- default:
- return FALSE;
- }
-
- data += 2;
- }
-#endif /* SUPPORT_UCP */
- }
-
-return negated; /* char did not match */
-}
-
-/* End of pcre_xclass.c */
diff --git a/Utilities/Poco/Foundation/src/pocomsg.h b/Utilities/Poco/Foundation/src/pocomsg.h
deleted file mode 100755
index d3517538fb..0000000000
--- a/Utilities/Poco/Foundation/src/pocomsg.h
+++ /dev/null
@@ -1,158 +0,0 @@
-//
-// pocomsg.mc[.h]
-//
-// $Id$
-//
-// The Poco message source/header file.
-//
-// NOTE: pocomsg.h is automatically generated from pocomsg.mc.
-// Never edit pocomsg.h directly!
-//
-// Copyright (c) 2004-2006, 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.
-//
-//
-// Categories
-//
-//
-// Values are 32 bit values laid out as follows:
-//
-// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
-// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
-// +---+-+-+-----------------------+-------------------------------+
-// |Sev|C|R| Facility | Code |
-// +---+-+-+-----------------------+-------------------------------+
-//
-// where
-//
-// Sev - is the severity code
-//
-// 00 - Success
-// 01 - Informational
-// 10 - Warning
-// 11 - Error
-//
-// C - is the Customer code flag
-//
-// R - is a reserved bit
-//
-// Facility - is the facility code
-//
-// Code - is the facility's status code
-//
-//
-// Define the facility codes
-//
-
-
-//
-// Define the severity codes
-//
-
-
-//
-// MessageId: POCO_CTG_FATAL
-//
-// MessageText:
-//
-// Fatal
-//
-#define POCO_CTG_FATAL 0x00000001L
-
-//
-// MessageId: POCO_CTG_CRITICAL
-//
-// MessageText:
-//
-// Critical
-//
-#define POCO_CTG_CRITICAL 0x00000002L
-
-//
-// MessageId: POCO_CTG_ERROR
-//
-// MessageText:
-//
-// Error
-//
-#define POCO_CTG_ERROR 0x00000003L
-
-//
-// MessageId: POCO_CTG_WARNING
-//
-// MessageText:
-//
-// Warning
-//
-#define POCO_CTG_WARNING 0x00000004L
-
-//
-// MessageId: POCO_CTG_NOTICE
-//
-// MessageText:
-//
-// Notice
-//
-#define POCO_CTG_NOTICE 0x00000005L
-
-//
-// MessageId: POCO_CTG_INFORMATION
-//
-// MessageText:
-//
-// Information
-//
-#define POCO_CTG_INFORMATION 0x00000006L
-
-//
-// MessageId: POCO_CTG_DEBUG
-//
-// MessageText:
-//
-// Debug
-//
-#define POCO_CTG_DEBUG 0x00000007L
-
-//
-// MessageId: POCO_CTG_TRACE
-//
-// MessageText:
-//
-// Trace
-//
-#define POCO_CTG_TRACE 0x00000008L
-
-//
-// Event Identifiers
-//
-//
-// MessageId: POCO_MSG_LOG
-//
-// MessageText:
-//
-// %1
-//
-#define POCO_MSG_LOG 0x00001000L
-
diff --git a/Utilities/Poco/Foundation/src/pocomsg.mc b/Utilities/Poco/Foundation/src/pocomsg.mc
deleted file mode 100755
index 63aebcd06a..0000000000
--- a/Utilities/Poco/Foundation/src/pocomsg.mc
+++ /dev/null
@@ -1,89 +0,0 @@
-;//
-;// pocomsg.mc[.h]
-;//
-;// $Id: //poco/1.3/Foundation/src/pocomsg.mc#1 $
-;//
-;// The Poco message source/header file.
-;//
-;// NOTE: pocomsg.h is automatically generated from pocomsg.mc.
-;// Never edit pocomsg.h directly!
-;//
-;// Copyright (c) 2004-2006, 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.
-;//
-
-
-;//
-;// Categories
-;//
-MessageId=0x1
-SymbolicName=POCO_CTG_FATAL
-Language=English
-Fatal
-.
-MessageId=0x2
-SymbolicName=POCO_CTG_CRITICAL
-Language=English
-Critical
-.
-MessageId=0x3
-SymbolicName=POCO_CTG_ERROR
-Language=English
-Error
-.
-MessageId=0x4
-SymbolicName=POCO_CTG_WARNING
-Language=English
-Warning
-.
-MessageId=0x5
-SymbolicName=POCO_CTG_NOTICE
-Language=English
-Notice
-.
-MessageId=0x6
-SymbolicName=POCO_CTG_INFORMATION
-Language=English
-Information
-.
-MessageId=0x7
-SymbolicName=POCO_CTG_DEBUG
-Language=English
-Debug
-.
-MessageId=0x8
-SymbolicName=POCO_CTG_TRACE
-Language=English
-Trace
-.
-
-;//
-;// Event Identifiers
-;//
-MessageId=0x1000
-SymbolicName=POCO_MSG_LOG
-Language=English
-%1
-.
diff --git a/Utilities/Poco/Foundation/src/pocomsg.rc b/Utilities/Poco/Foundation/src/pocomsg.rc
deleted file mode 100755
index 0abcb0fa2c..0000000000
--- a/Utilities/Poco/Foundation/src/pocomsg.rc
+++ /dev/null
@@ -1,2 +0,0 @@
-LANGUAGE 0x9,0x1
-1 11 "MSG00001.bin"
diff --git a/Utilities/Poco/Foundation/src/trees.c b/Utilities/Poco/Foundation/src/trees.c
deleted file mode 100755
index 6c20582173..0000000000
--- a/Utilities/Poco/Foundation/src/trees.c
+++ /dev/null
@@ -1,1223 +0,0 @@
-/* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2005 Jean-loup Gailly
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
- * ALGORITHM
- *
- * The "deflation" process uses several Huffman trees. The more
- * common source values are represented by shorter bit sequences.
- *
- * Each code tree is stored in a compressed form which is itself
- * a Huffman encoding of the lengths of all the code strings (in
- * ascending order by source values). The actual code strings are
- * reconstructed from the lengths in the inflate process, as described
- * in the deflate specification.
- *
- * REFERENCES
- *
- * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
- * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
- *
- * Storer, James A.
- * Data Compression: Methods and Theory, pp. 49-50.
- * Computer Science Press, 1988. ISBN 0-7167-8156-5.
- *
- * Sedgewick, R.
- * Algorithms, p290.
- * Addison-Wesley, 1983. ISBN 0-201-06672-6.
- */
-
-/* @(#) $Id$ */
-
-/* #define GEN_TREES_H */
-
-#if defined(_MSC_VER)
- #pragma warning(disable:4267) // conversion from ... possble loss of data
-#endif
-
-#include "deflate.h"
-
-#ifdef DEBUG
-# include <ctype.h>
-#endif
-
-/* ===========================================================================
- * Constants
- */
-
-#define MAX_BL_BITS 7
-/* Bit length codes must not exceed MAX_BL_BITS bits */
-
-#define END_BLOCK 256
-/* end of block literal code */
-
-#define REP_3_6 16
-/* repeat previous bit length 3-6 times (2 bits of repeat count) */
-
-#define REPZ_3_10 17
-/* repeat a zero length 3-10 times (3 bits of repeat count) */
-
-#define REPZ_11_138 18
-/* repeat a zero length 11-138 times (7 bits of repeat count) */
-
-local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
- = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
-
-local const int extra_dbits[D_CODES] /* extra bits for each distance code */
- = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
-
-local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
- = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
-
-local const uch bl_order[BL_CODES]
- = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
-/* The lengths of the bit length codes are sent in order of decreasing
- * probability, to avoid transmitting the lengths for unused bit length codes.
- */
-
-#define Buf_size (8 * 2*sizeof(char))
-/* Number of bits used within bi_buf. (bi_buf might be implemented on
- * more than 16 bits on some systems.)
- */
-
-/* ===========================================================================
- * Local data. These are initialized only once.
- */
-
-#define DIST_CODE_LEN 512 /* see definition of array dist_code below */
-
-#if defined(GEN_TREES_H) || !defined(STDC)
-/* non ANSI compilers may not accept trees.h */
-
-local ct_data static_ltree[L_CODES+2];
-/* The static literal tree. Since the bit lengths are imposed, there is no
- * need for the L_CODES extra codes used during heap construction. However
- * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
- * below).
- */
-
-local ct_data static_dtree[D_CODES];
-/* The static distance tree. (Actually a trivial tree since all codes use
- * 5 bits.)
- */
-
-uch _dist_code[DIST_CODE_LEN];
-/* Distance codes. The first 256 values correspond to the distances
- * 3 .. 258, the last 256 values correspond to the top 8 bits of
- * the 15 bit distances.
- */
-
-uch _length_code[MAX_MATCH-MIN_MATCH+1];
-/* length code for each normalized match length (0 == MIN_MATCH) */
-
-local int base_length[LENGTH_CODES];
-/* First normalized length for each code (0 = MIN_MATCH) */
-
-local int base_dist[D_CODES];
-/* First normalized distance for each code (0 = distance of 1) */
-
-#else
-# include "trees.h"
-#endif /* GEN_TREES_H */
-
-struct static_tree_desc_s {
- const ct_data *static_tree; /* static tree or NULL */
- const intf *extra_bits; /* extra bits for each code or NULL */
- int extra_base; /* base index for extra_bits */
- int elems; /* max number of elements in the tree */
- int max_length; /* max bit length for the codes */
-};
-
-local static_tree_desc static_l_desc =
-{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
-
-local static_tree_desc static_d_desc =
-{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
-
-local static_tree_desc static_bl_desc =
-{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
-
-/* ===========================================================================
- * Local (static) routines in this file.
- */
-
-local void tr_static_init OF((void));
-local void init_block OF((deflate_state *s));
-local void pqdownheap OF((deflate_state *s, ct_data *tree, int k));
-local void gen_bitlen OF((deflate_state *s, tree_desc *desc));
-local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count));
-local void build_tree OF((deflate_state *s, tree_desc *desc));
-local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code));
-local void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
-local int build_bl_tree OF((deflate_state *s));
-local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
- int blcodes));
-local void compress_block OF((deflate_state *s, ct_data *ltree,
- ct_data *dtree));
-local void set_data_type OF((deflate_state *s));
-local unsigned bi_reverse OF((unsigned value, int length));
-local void bi_windup OF((deflate_state *s));
-local void bi_flush OF((deflate_state *s));
-local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
- int header));
-
-#ifdef GEN_TREES_H
-local void gen_trees_header OF((void));
-#endif
-
-#ifndef DEBUG
-# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
- /* Send a code of the given tree. c and tree must not have side effects */
-
-#else /* DEBUG */
-# define send_code(s, c, tree) \
- { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
- send_bits(s, tree[c].Code, tree[c].Len); }
-#endif
-
-/* ===========================================================================
- * Output a short LSB first on the stream.
- * IN assertion: there is enough room in pendingBuf.
- */
-#define put_short(s, w) { \
- put_byte(s, (uch)((w) & 0xff)); \
- put_byte(s, (uch)((ush)(w) >> 8)); \
-}
-
-/* ===========================================================================
- * Send a value on a given number of bits.
- * IN assertion: length <= 16 and value fits in length bits.
- */
-#ifdef DEBUG
-local void send_bits OF((deflate_state *s, int value, int length));
-
-local void send_bits(s, value, length)
- deflate_state *s;
- int value; /* value to send */
- int length; /* number of bits */
-{
- Tracevv((stderr," l %2d v %4x ", length, value));
- Assert(length > 0 && length <= 15, "invalid length");
- s->bits_sent += (ulg)length;
-
- /* If not enough room in bi_buf, use (valid) bits from bi_buf and
- * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
- * unused bits in value.
- */
- if (s->bi_valid > (int)Buf_size - length) {
- s->bi_buf |= (value << s->bi_valid);
- put_short(s, s->bi_buf);
- s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
- s->bi_valid += length - Buf_size;
- } else {
- s->bi_buf |= value << s->bi_valid;
- s->bi_valid += length;
- }
-}
-#else /* !DEBUG */
-
-#define send_bits(s, value, length) \
-{ int len = length;\
- if (s->bi_valid > (int)Buf_size - len) {\
- int val = value;\
- s->bi_buf |= (val << s->bi_valid);\
- put_short(s, s->bi_buf);\
- s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
- s->bi_valid += len - Buf_size;\
- } else {\
- s->bi_buf |= (value) << s->bi_valid;\
- s->bi_valid += len;\
- }\
-}
-#endif /* DEBUG */
-
-
-/* the arguments must not have side effects */
-
-/* ===========================================================================
- * Initialize the various 'constant' tables.
- */
-local void tr_static_init()
-{
-#if defined(GEN_TREES_H) || !defined(STDC)
- static int static_init_done = 0;
- int n; /* iterates over tree elements */
- int bits; /* bit counter */
- int length; /* length value */
- int code; /* code value */
- int dist; /* distance index */
- ush bl_count[MAX_BITS+1];
- /* number of codes at each bit length for an optimal tree */
-
- if (static_init_done) return;
-
- /* For some embedded targets, global variables are not initialized: */
- static_l_desc.static_tree = static_ltree;
- static_l_desc.extra_bits = extra_lbits;
- static_d_desc.static_tree = static_dtree;
- static_d_desc.extra_bits = extra_dbits;
- static_bl_desc.extra_bits = extra_blbits;
-
- /* Initialize the mapping length (0..255) -> length code (0..28) */
- length = 0;
- for (code = 0; code < LENGTH_CODES-1; code++) {
- base_length[code] = length;
- for (n = 0; n < (1<<extra_lbits[code]); n++) {
- _length_code[length++] = (uch)code;
- }
- }
- Assert (length == 256, "tr_static_init: length != 256");
- /* Note that the length 255 (match length 258) can be represented
- * in two different ways: code 284 + 5 bits or code 285, so we
- * overwrite length_code[255] to use the best encoding:
- */
- _length_code[length-1] = (uch)code;
-
- /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
- dist = 0;
- for (code = 0 ; code < 16; code++) {
- base_dist[code] = dist;
- for (n = 0; n < (1<<extra_dbits[code]); n++) {
- _dist_code[dist++] = (uch)code;
- }
- }
- Assert (dist == 256, "tr_static_init: dist != 256");
- dist >>= 7; /* from now on, all distances are divided by 128 */
- for ( ; code < D_CODES; code++) {
- base_dist[code] = dist << 7;
- for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
- _dist_code[256 + dist++] = (uch)code;
- }
- }
- Assert (dist == 256, "tr_static_init: 256+dist != 512");
-
- /* Construct the codes of the static literal tree */
- for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
- n = 0;
- while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
- while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
- while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
- while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
- /* Codes 286 and 287 do not exist, but we must include them in the
- * tree construction to get a canonical Huffman tree (longest code
- * all ones)
- */
- gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
-
- /* The static distance tree is trivial: */
- for (n = 0; n < D_CODES; n++) {
- static_dtree[n].Len = 5;
- static_dtree[n].Code = bi_reverse((unsigned)n, 5);
- }
- static_init_done = 1;
-
-# ifdef GEN_TREES_H
- gen_trees_header();
-# endif
-#endif /* defined(GEN_TREES_H) || !defined(STDC) */
-}
-
-/* ===========================================================================
- * Genererate the file trees.h describing the static trees.
- */
-#ifdef GEN_TREES_H
-# ifndef DEBUG
-# include <stdio.h>
-# endif
-
-# define SEPARATOR(i, last, width) \
- ((i) == (last)? "\n};\n\n" : \
- ((i) % (width) == (width)-1 ? ",\n" : ", "))
-
-void gen_trees_header()
-{
- FILE *header = fopen("trees.h", "w");
- int i;
-
- Assert (header != NULL, "Can't open trees.h");
- fprintf(header,
- "/* header created automatically with -DGEN_TREES_H */\n\n");
-
- fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
- for (i = 0; i < L_CODES+2; i++) {
- fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
- static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
- }
-
- fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
- for (i = 0; i < D_CODES; i++) {
- fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
- static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
- }
-
- fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
- for (i = 0; i < DIST_CODE_LEN; i++) {
- fprintf(header, "%2u%s", _dist_code[i],
- SEPARATOR(i, DIST_CODE_LEN-1, 20));
- }
-
- fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
- for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
- fprintf(header, "%2u%s", _length_code[i],
- SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
- }
-
- fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
- for (i = 0; i < LENGTH_CODES; i++) {
- fprintf(header, "%1u%s", base_length[i],
- SEPARATOR(i, LENGTH_CODES-1, 20));
- }
-
- fprintf(header, "local const int base_dist[D_CODES] = {\n");
- for (i = 0; i < D_CODES; i++) {
- fprintf(header, "%5u%s", base_dist[i],
- SEPARATOR(i, D_CODES-1, 10));
- }
-
- fclose(header);
-}
-#endif /* GEN_TREES_H */
-
-/* ===========================================================================
- * Initialize the tree data structures for a new zlib stream.
- */
-void _tr_init(s)
- deflate_state *s;
-{
- tr_static_init();
-
- s->l_desc.dyn_tree = s->dyn_ltree;
- s->l_desc.stat_desc = &static_l_desc;
-
- s->d_desc.dyn_tree = s->dyn_dtree;
- s->d_desc.stat_desc = &static_d_desc;
-
- s->bl_desc.dyn_tree = s->bl_tree;
- s->bl_desc.stat_desc = &static_bl_desc;
-
- s->bi_buf = 0;
- s->bi_valid = 0;
- s->last_eob_len = 8; /* enough lookahead for inflate */
-#ifdef DEBUG
- s->compressed_len = 0L;
- s->bits_sent = 0L;
-#endif
-
- /* Initialize the first block of the first file: */
- init_block(s);
-}
-
-/* ===========================================================================
- * Initialize a new block.
- */
-local void init_block(s)
- deflate_state *s;
-{
- int n; /* iterates over tree elements */
-
- /* Initialize the trees. */
- for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
- for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
- for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
-
- s->dyn_ltree[END_BLOCK].Freq = 1;
- s->opt_len = s->static_len = 0L;
- s->last_lit = s->matches = 0;
-}
-
-#define SMALLEST 1
-/* Index within the heap array of least frequent node in the Huffman tree */
-
-
-/* ===========================================================================
- * Remove the smallest element from the heap and recreate the heap with
- * one less element. Updates heap and heap_len.
- */
-#define pqremove(s, tree, top) \
-{\
- top = s->heap[SMALLEST]; \
- s->heap[SMALLEST] = s->heap[s->heap_len--]; \
- pqdownheap(s, tree, SMALLEST); \
-}
-
-/* ===========================================================================
- * Compares to subtrees, using the tree depth as tie breaker when
- * the subtrees have equal frequency. This minimizes the worst case length.
- */
-#define smaller(tree, n, m, depth) \
- (tree[n].Freq < tree[m].Freq || \
- (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
-
-/* ===========================================================================
- * Restore the heap property by moving down the tree starting at node k,
- * exchanging a node with the smallest of its two sons if necessary, stopping
- * when the heap property is re-established (each father smaller than its
- * two sons).
- */
-local void pqdownheap(s, tree, k)
- deflate_state *s;
- ct_data *tree; /* the tree to restore */
- int k; /* node to move down */
-{
- int v = s->heap[k];
- int j = k << 1; /* left son of k */
- while (j <= s->heap_len) {
- /* Set j to the smallest of the two sons: */
- if (j < s->heap_len &&
- smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
- j++;
- }
- /* Exit if v is smaller than both sons */
- if (smaller(tree, v, s->heap[j], s->depth)) break;
-
- /* Exchange v with the smallest son */
- s->heap[k] = s->heap[j]; k = j;
-
- /* And continue down the tree, setting j to the left son of k */
- j <<= 1;
- }
- s->heap[k] = v;
-}
-
-/* ===========================================================================
- * Compute the optimal bit lengths for a tree and update the total bit length
- * for the current block.
- * IN assertion: the fields freq and dad are set, heap[heap_max] and
- * above are the tree nodes sorted by increasing frequency.
- * OUT assertions: the field len is set to the optimal bit length, the
- * array bl_count contains the frequencies for each bit length.
- * The length opt_len is updated; static_len is also updated if stree is
- * not null.
- */
-local void gen_bitlen(s, desc)
- deflate_state *s;
- tree_desc *desc; /* the tree descriptor */
-{
- ct_data *tree = desc->dyn_tree;
- int max_code = desc->max_code;
- const ct_data *stree = desc->stat_desc->static_tree;
- const intf *extra = desc->stat_desc->extra_bits;
- int base = desc->stat_desc->extra_base;
- int max_length = desc->stat_desc->max_length;
- int h; /* heap index */
- int n, m; /* iterate over the tree elements */
- int bits; /* bit length */
- int xbits; /* extra bits */
- ush f; /* frequency */
- int overflow = 0; /* number of elements with bit length too large */
-
- for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
-
- /* In a first pass, compute the optimal bit lengths (which may
- * overflow in the case of the bit length tree).
- */
- tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
-
- for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
- n = s->heap[h];
- bits = tree[tree[n].Dad].Len + 1;
- if (bits > max_length) bits = max_length, overflow++;
- tree[n].Len = (ush)bits;
- /* We overwrite tree[n].Dad which is no longer needed */
-
- if (n > max_code) continue; /* not a leaf node */
-
- s->bl_count[bits]++;
- xbits = 0;
- if (n >= base) xbits = extra[n-base];
- f = tree[n].Freq;
- s->opt_len += (ulg)f * (bits + xbits);
- if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
- }
- if (overflow == 0) return;
-
- Trace((stderr,"\nbit length overflow\n"));
- /* This happens for example on obj2 and pic of the Calgary corpus */
-
- /* Find the first bit length which could increase: */
- do {
- bits = max_length-1;
- while (s->bl_count[bits] == 0) bits--;
- s->bl_count[bits]--; /* move one leaf down the tree */
- s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
- s->bl_count[max_length]--;
- /* The brother of the overflow item also moves one step up,
- * but this does not affect bl_count[max_length]
- */
- overflow -= 2;
- } while (overflow > 0);
-
- /* Now recompute all bit lengths, scanning in increasing frequency.
- * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
- * lengths instead of fixing only the wrong ones. This idea is taken
- * from 'ar' written by Haruhiko Okumura.)
- */
- for (bits = max_length; bits != 0; bits--) {
- n = s->bl_count[bits];
- while (n != 0) {
- m = s->heap[--h];
- if (m > max_code) continue;
- if ((unsigned) tree[m].Len != (unsigned) bits) {
- Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
- s->opt_len += ((long)bits - (long)tree[m].Len)
- *(long)tree[m].Freq;
- tree[m].Len = (ush)bits;
- }
- n--;
- }
- }
-}
-
-/* ===========================================================================
- * Generate the codes for a given tree and bit counts (which need not be
- * optimal).
- * IN assertion: the array bl_count contains the bit length statistics for
- * the given tree and the field len is set for all tree elements.
- * OUT assertion: the field code is set for all tree elements of non
- * zero code length.
- */
-local void gen_codes (tree, max_code, bl_count)
- ct_data *tree; /* the tree to decorate */
- int max_code; /* largest code with non zero frequency */
- ushf *bl_count; /* number of codes at each bit length */
-{
- ush next_code[MAX_BITS+1]; /* next code value for each bit length */
- ush code = 0; /* running code value */
- int bits; /* bit index */
- int n; /* code index */
-
- /* The distribution counts are first used to generate the code values
- * without bit reversal.
- */
- for (bits = 1; bits <= MAX_BITS; bits++) {
- next_code[bits] = code = (code + bl_count[bits-1]) << 1;
- }
- /* Check that the bit counts in bl_count are consistent. The last code
- * must be all ones.
- */
- Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
- "inconsistent bit counts");
- Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
-
- for (n = 0; n <= max_code; n++) {
- int len = tree[n].Len;
- if (len == 0) continue;
- /* Now reverse the bits */
- tree[n].Code = bi_reverse(next_code[len]++, len);
-
- Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
- n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
- }
-}
-
-/* ===========================================================================
- * Construct one Huffman tree and assigns the code bit strings and lengths.
- * Update the total bit length for the current block.
- * IN assertion: the field freq is set for all tree elements.
- * OUT assertions: the fields len and code are set to the optimal bit length
- * and corresponding code. The length opt_len is updated; static_len is
- * also updated if stree is not null. The field max_code is set.
- */
-local void build_tree(s, desc)
- deflate_state *s;
- tree_desc *desc; /* the tree descriptor */
-{
- ct_data *tree = desc->dyn_tree;
- const ct_data *stree = desc->stat_desc->static_tree;
- int elems = desc->stat_desc->elems;
- int n, m; /* iterate over heap elements */
- int max_code = -1; /* largest code with non zero frequency */
- int node; /* new node being created */
-
- /* Construct the initial heap, with least frequent element in
- * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
- * heap[0] is not used.
- */
- s->heap_len = 0, s->heap_max = HEAP_SIZE;
-
- for (n = 0; n < elems; n++) {
- if (tree[n].Freq != 0) {
- s->heap[++(s->heap_len)] = max_code = n;
- s->depth[n] = 0;
- } else {
- tree[n].Len = 0;
- }
- }
-
- /* The pkzip format requires that at least one distance code exists,
- * and that at least one bit should be sent even if there is only one
- * possible code. So to avoid special checks later on we force at least
- * two codes of non zero frequency.
- */
- while (s->heap_len < 2) {
- node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
- tree[node].Freq = 1;
- s->depth[node] = 0;
- s->opt_len--; if (stree) s->static_len -= stree[node].Len;
- /* node is 0 or 1 so it does not have extra bits */
- }
- desc->max_code = max_code;
-
- /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
- * establish sub-heaps of increasing lengths:
- */
- for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
-
- /* Construct the Huffman tree by repeatedly combining the least two
- * frequent nodes.
- */
- node = elems; /* next internal node of the tree */
- do {
- pqremove(s, tree, n); /* n = node of least frequency */
- m = s->heap[SMALLEST]; /* m = node of next least frequency */
-
- s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
- s->heap[--(s->heap_max)] = m;
-
- /* Create a new node father of n and m */
- tree[node].Freq = tree[n].Freq + tree[m].Freq;
- s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
- s->depth[n] : s->depth[m]) + 1);
- tree[n].Dad = tree[m].Dad = (ush)node;
-#ifdef DUMP_BL_TREE
- if (tree == s->bl_tree) {
- fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
- node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
- }
-#endif
- /* and insert the new node in the heap */
- s->heap[SMALLEST] = node++;
- pqdownheap(s, tree, SMALLEST);
-
- } while (s->heap_len >= 2);
-
- s->heap[--(s->heap_max)] = s->heap[SMALLEST];
-
- /* At this point, the fields freq and dad are set. We can now
- * generate the bit lengths.
- */
- gen_bitlen(s, (tree_desc *)desc);
-
- /* The field len is now set, we can generate the bit codes */
- gen_codes ((ct_data *)tree, max_code, s->bl_count);
-}
-
-/* ===========================================================================
- * Scan a literal or distance tree to determine the frequencies of the codes
- * in the bit length tree.
- */
-local void scan_tree (s, tree, max_code)
- deflate_state *s;
- ct_data *tree; /* the tree to be scanned */
- int max_code; /* and its largest code of non zero frequency */
-{
- int n; /* iterates over all tree elements */
- int prevlen = -1; /* last emitted length */
- int curlen; /* length of current code */
- int nextlen = tree[0].Len; /* length of next code */
- int count = 0; /* repeat count of the current code */
- int max_count = 7; /* max repeat count */
- int min_count = 4; /* min repeat count */
-
- if (nextlen == 0) max_count = 138, min_count = 3;
- tree[max_code+1].Len = (ush)0xffff; /* guard */
-
- for (n = 0; n <= max_code; n++) {
- curlen = nextlen; nextlen = tree[n+1].Len;
- if (++count < max_count && curlen == nextlen) {
- continue;
- } else if (count < min_count) {
- s->bl_tree[curlen].Freq += count;
- } else if (curlen != 0) {
- if (curlen != prevlen) s->bl_tree[curlen].Freq++;
- s->bl_tree[REP_3_6].Freq++;
- } else if (count <= 10) {
- s->bl_tree[REPZ_3_10].Freq++;
- } else {
- s->bl_tree[REPZ_11_138].Freq++;
- }
- count = 0; prevlen = curlen;
- if (nextlen == 0) {
- max_count = 138, min_count = 3;
- } else if (curlen == nextlen) {
- max_count = 6, min_count = 3;
- } else {
- max_count = 7, min_count = 4;
- }
- }
-}
-
-/* ===========================================================================
- * Send a literal or distance tree in compressed form, using the codes in
- * bl_tree.
- */
-local void send_tree (s, tree, max_code)
- deflate_state *s;
- ct_data *tree; /* the tree to be scanned */
- int max_code; /* and its largest code of non zero frequency */
-{
- int n; /* iterates over all tree elements */
- int prevlen = -1; /* last emitted length */
- int curlen; /* length of current code */
- int nextlen = tree[0].Len; /* length of next code */
- int count = 0; /* repeat count of the current code */
- int max_count = 7; /* max repeat count */
- int min_count = 4; /* min repeat count */
-
- /* tree[max_code+1].Len = -1; */ /* guard already set */
- if (nextlen == 0) max_count = 138, min_count = 3;
-
- for (n = 0; n <= max_code; n++) {
- curlen = nextlen; nextlen = tree[n+1].Len;
- if (++count < max_count && curlen == nextlen) {
- continue;
- } else if (count < min_count) {
- do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
-
- } else if (curlen != 0) {
- if (curlen != prevlen) {
- send_code(s, curlen, s->bl_tree); count--;
- }
- Assert(count >= 3 && count <= 6, " 3_6?");
- send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
-
- } else if (count <= 10) {
- send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
-
- } else {
- send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
- }
- count = 0; prevlen = curlen;
- if (nextlen == 0) {
- max_count = 138, min_count = 3;
- } else if (curlen == nextlen) {
- max_count = 6, min_count = 3;
- } else {
- max_count = 7, min_count = 4;
- }
- }
-}
-
-/* ===========================================================================
- * Construct the Huffman tree for the bit lengths and return the index in
- * bl_order of the last bit length code to send.
- */
-local int build_bl_tree(s)
- deflate_state *s;
-{
- int max_blindex; /* index of last bit length code of non zero freq */
-
- /* Determine the bit length frequencies for literal and distance trees */
- scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
- scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
-
- /* Build the bit length tree: */
- build_tree(s, (tree_desc *)(&(s->bl_desc)));
- /* opt_len now includes the length of the tree representations, except
- * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
- */
-
- /* Determine the number of bit length codes to send. The pkzip format
- * requires that at least 4 bit length codes be sent. (appnote.txt says
- * 3 but the actual value used is 4.)
- */
- for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
- if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
- }
- /* Update opt_len to include the bit length tree and counts */
- s->opt_len += 3*(max_blindex+1) + 5+5+4;
- Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
- s->opt_len, s->static_len));
-
- return max_blindex;
-}
-
-/* ===========================================================================
- * Send the header for a block using dynamic Huffman trees: the counts, the
- * lengths of the bit length codes, the literal tree and the distance tree.
- * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
- */
-local void send_all_trees(s, lcodes, dcodes, blcodes)
- deflate_state *s;
- int lcodes, dcodes, blcodes; /* number of codes for each tree */
-{
- int rank; /* index in bl_order */
-
- Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
- Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
- "too many codes");
- Tracev((stderr, "\nbl counts: "));
- send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
- send_bits(s, dcodes-1, 5);
- send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
- for (rank = 0; rank < blcodes; rank++) {
- Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
- send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
- }
- Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
-
- send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
- Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
-
- send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
- Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
-}
-
-/* ===========================================================================
- * Send a stored block
- */
-void _tr_stored_block(s, buf, stored_len, eof)
- deflate_state *s;
- charf *buf; /* input block */
- ulg stored_len; /* length of input block */
- int eof; /* true if this is the last block for a file */
-{
- send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
-#ifdef DEBUG
- s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
- s->compressed_len += (stored_len + 4) << 3;
-#endif
- copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
-}
-
-/* ===========================================================================
- * Send one empty static block to give enough lookahead for inflate.
- * This takes 10 bits, of which 7 may remain in the bit buffer.
- * The current inflate code requires 9 bits of lookahead. If the
- * last two codes for the previous block (real code plus EOB) were coded
- * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
- * the last real code. In this case we send two empty static blocks instead
- * of one. (There are no problems if the previous block is stored or fixed.)
- * To simplify the code, we assume the worst case of last real code encoded
- * on one bit only.
- */
-void _tr_align(s)
- deflate_state *s;
-{
- send_bits(s, STATIC_TREES<<1, 3);
- send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
- s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
-#endif
- bi_flush(s);
- /* Of the 10 bits for the empty block, we have already sent
- * (10 - bi_valid) bits. The lookahead for the last real code (before
- * the EOB of the previous block) was thus at least one plus the length
- * of the EOB plus what we have just sent of the empty static block.
- */
- if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
- send_bits(s, STATIC_TREES<<1, 3);
- send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
- s->compressed_len += 10L;
-#endif
- bi_flush(s);
- }
- s->last_eob_len = 7;
-}
-
-/* ===========================================================================
- * Determine the best encoding for the current block: dynamic trees, static
- * trees or store, and output the encoded block to the zip file.
- */
-void _tr_flush_block(s, buf, stored_len, eof)
- deflate_state *s;
- charf *buf; /* input block, or NULL if too old */
- ulg stored_len; /* length of input block */
- int eof; /* true if this is the last block for a file */
-{
- ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
- int max_blindex = 0; /* index of last bit length code of non zero freq */
-
- /* Build the Huffman trees unless a stored block is forced */
- if (s->level > 0) {
-
- /* Check if the file is binary or text */
- if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN)
- set_data_type(s);
-
- /* Construct the literal and distance trees */
- build_tree(s, (tree_desc *)(&(s->l_desc)));
- Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
- s->static_len));
-
- build_tree(s, (tree_desc *)(&(s->d_desc)));
- Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
- s->static_len));
- /* At this point, opt_len and static_len are the total bit lengths of
- * the compressed block data, excluding the tree representations.
- */
-
- /* Build the bit length tree for the above two trees, and get the index
- * in bl_order of the last bit length code to send.
- */
- max_blindex = build_bl_tree(s);
-
- /* Determine the best encoding. Compute the block lengths in bytes. */
- opt_lenb = (s->opt_len+3+7)>>3;
- static_lenb = (s->static_len+3+7)>>3;
-
- Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
- opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
- s->last_lit));
-
- if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
-
- } else {
- Assert(buf != (char*)0, "lost buf");
- opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
- }
-
-#ifdef FORCE_STORED
- if (buf != (char*)0) { /* force stored block */
-#else
- if (stored_len+4 <= opt_lenb && buf != (char*)0) {
- /* 4: two words for the lengths */
-#endif
- /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
- * Otherwise we can't have processed more than WSIZE input bytes since
- * the last block flush, because compression would have been
- * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
- * transform a block into a stored block.
- */
- _tr_stored_block(s, buf, stored_len, eof);
-
-#ifdef FORCE_STATIC
- } else if (static_lenb >= 0) { /* force static trees */
-#else
- } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
-#endif
- send_bits(s, (STATIC_TREES<<1)+eof, 3);
- compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
-#ifdef DEBUG
- s->compressed_len += 3 + s->static_len;
-#endif
- } else {
- send_bits(s, (DYN_TREES<<1)+eof, 3);
- send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
- max_blindex+1);
- compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
-#ifdef DEBUG
- s->compressed_len += 3 + s->opt_len;
-#endif
- }
- Assert (s->compressed_len == s->bits_sent, "bad compressed size");
- /* The above check is made mod 2^32, for files larger than 512 MB
- * and uLong implemented on 32 bits.
- */
- init_block(s);
-
- if (eof) {
- bi_windup(s);
-#ifdef DEBUG
- s->compressed_len += 7; /* align on byte boundary */
-#endif
- }
- Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
- s->compressed_len-7*eof));
-}
-
-/* ===========================================================================
- * Save the match info and tally the frequency counts. Return true if
- * the current block must be flushed.
- */
-int _tr_tally (s, dist, lc)
- deflate_state *s;
- unsigned dist; /* distance of matched string */
- unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
-{
- s->d_buf[s->last_lit] = (ush)dist;
- s->l_buf[s->last_lit++] = (uch)lc;
- if (dist == 0) {
- /* lc is the unmatched char */
- s->dyn_ltree[lc].Freq++;
- } else {
- s->matches++;
- /* Here, lc is the match length - MIN_MATCH */
- dist--; /* dist = match distance - 1 */
- Assert((ush)dist < (ush)MAX_DIST(s) &&
- (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
- (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
-
- s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
- s->dyn_dtree[d_code(dist)].Freq++;
- }
-
-#ifdef TRUNCATE_BLOCK
- /* Try to guess if it is profitable to stop the current block here */
- if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
- /* Compute an upper bound for the compressed length */
- ulg out_length = (ulg)s->last_lit*8L;
- ulg in_length = (ulg)((long)s->strstart - s->block_start);
- int dcode;
- for (dcode = 0; dcode < D_CODES; dcode++) {
- out_length += (ulg)s->dyn_dtree[dcode].Freq *
- (5L+extra_dbits[dcode]);
- }
- out_length >>= 3;
- Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
- s->last_lit, in_length, out_length,
- 100L - out_length*100L/in_length));
- if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
- }
-#endif
- return (s->last_lit == s->lit_bufsize-1);
- /* We avoid equality with lit_bufsize because of wraparound at 64K
- * on 16 bit machines and because stored blocks are restricted to
- * 64K-1 bytes.
- */
-}
-
-/* ===========================================================================
- * Send the block data compressed using the given Huffman trees
- */
-local void compress_block(s, ltree, dtree)
- deflate_state *s;
- ct_data *ltree; /* literal tree */
- ct_data *dtree; /* distance tree */
-{
- unsigned dist; /* distance of matched string */
- int lc; /* match length or unmatched char (if dist == 0) */
- unsigned lx = 0; /* running index in l_buf */
- unsigned code; /* the code to send */
- int extra; /* number of extra bits to send */
-
- if (s->last_lit != 0) do {
- dist = s->d_buf[lx];
- lc = s->l_buf[lx++];
- if (dist == 0) {
- send_code(s, lc, ltree); /* send a literal byte */
- Tracecv(isgraph(lc), (stderr," '%c' ", lc));
- } else {
- /* Here, lc is the match length - MIN_MATCH */
- code = _length_code[lc];
- send_code(s, code+LITERALS+1, ltree); /* send the length code */
- extra = extra_lbits[code];
- if (extra != 0) {
- lc -= base_length[code];
- send_bits(s, lc, extra); /* send the extra length bits */
- }
- dist--; /* dist is now the match distance - 1 */
- code = d_code(dist);
- Assert (code < D_CODES, "bad d_code");
-
- send_code(s, code, dtree); /* send the distance code */
- extra = extra_dbits[code];
- if (extra != 0) {
- dist -= base_dist[code];
- send_bits(s, dist, extra); /* send the extra distance bits */
- }
- } /* literal or match pair ? */
-
- /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
- Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
- "pendingBuf overflow");
-
- } while (lx < s->last_lit);
-
- send_code(s, END_BLOCK, ltree);
- s->last_eob_len = ltree[END_BLOCK].Len;
-}
-
-/* ===========================================================================
- * Set the data type to BINARY or TEXT, using a crude approximation:
- * set it to Z_TEXT if all symbols are either printable characters (33 to 255)
- * or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise.
- * IN assertion: the fields Freq of dyn_ltree are set.
- */
-local void set_data_type(s)
- deflate_state *s;
-{
- int n;
-
- for (n = 0; n < 9; n++)
- if (s->dyn_ltree[n].Freq != 0)
- break;
- if (n == 9)
- for (n = 14; n < 32; n++)
- if (s->dyn_ltree[n].Freq != 0)
- break;
- s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY;
-}
-
-/* ===========================================================================
- * Reverse the first len bits of a code, using straightforward code (a faster
- * method would use a table)
- * IN assertion: 1 <= len <= 15
- */
-local unsigned bi_reverse(code, len)
- unsigned code; /* the value to invert */
- int len; /* its bit length */
-{
- register unsigned res = 0;
- do {
- res |= code & 1;
- code >>= 1, res <<= 1;
- } while (--len > 0);
- return res >> 1;
-}
-
-/* ===========================================================================
- * Flush the bit buffer, keeping at most 7 bits in it.
- */
-local void bi_flush(s)
- deflate_state *s;
-{
- if (s->bi_valid == 16) {
- put_short(s, s->bi_buf);
- s->bi_buf = 0;
- s->bi_valid = 0;
- } else if (s->bi_valid >= 8) {
- put_byte(s, (Byte)s->bi_buf);
- s->bi_buf >>= 8;
- s->bi_valid -= 8;
- }
-}
-
-/* ===========================================================================
- * Flush the bit buffer and align the output on a byte boundary
- */
-local void bi_windup(s)
- deflate_state *s;
-{
- if (s->bi_valid > 8) {
- put_short(s, s->bi_buf);
- } else if (s->bi_valid > 0) {
- put_byte(s, (Byte)s->bi_buf);
- }
- s->bi_buf = 0;
- s->bi_valid = 0;
-#ifdef DEBUG
- s->bits_sent = (s->bits_sent+7) & ~7;
-#endif
-}
-
-/* ===========================================================================
- * Copy a stored block, storing first the length and its
- * one's complement if requested.
- */
-local void copy_block(s, buf, len, header)
- deflate_state *s;
- charf *buf; /* the input data */
- unsigned len; /* its length */
- int header; /* true if block header must be written */
-{
- bi_windup(s); /* align on byte boundary */
- s->last_eob_len = 8; /* enough lookahead for inflate */
-
- if (header) {
- put_short(s, (ush)len);
- put_short(s, (ush)~len);
-#ifdef DEBUG
- s->bits_sent += 2*16;
-#endif
- }
-#ifdef DEBUG
- s->bits_sent += (ulg)len<<3;
-#endif
- while (len--) {
- put_byte(s, *buf++);
- }
-}
diff --git a/Utilities/Poco/Foundation/src/trees.h b/Utilities/Poco/Foundation/src/trees.h
deleted file mode 100755
index 72facf900f..0000000000
--- a/Utilities/Poco/Foundation/src/trees.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* header created automatically with -DGEN_TREES_H */
-
-local const ct_data static_ltree[L_CODES+2] = {
-{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
-{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
-{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
-{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
-{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
-{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
-{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
-{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
-{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
-{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
-{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
-{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
-{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
-{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
-{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
-{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
-{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
-{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
-{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
-{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
-{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
-{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
-{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
-{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
-{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
-{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
-{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
-{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
-{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
-{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
-{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
-{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
-{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
-{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
-{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
-{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
-{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
-{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
-{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
-{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
-{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
-{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
-{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
-{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
-{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
-{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
-{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
-{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
-{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
-{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
-{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
-{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
-{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
-{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
-{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
-{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
-{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
-{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
-};
-
-local const ct_data static_dtree[D_CODES] = {
-{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
-{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
-{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
-{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
-{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
-{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
-};
-
-const uch _dist_code[DIST_CODE_LEN] = {
- 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
- 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
-10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
-13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
-18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
-23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
-};
-
-const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
-13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
-17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
-19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
-25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
-};
-
-local const int base_length[LENGTH_CODES] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
-64, 80, 96, 112, 128, 160, 192, 224, 0
-};
-
-local const int base_dist[D_CODES] = {
- 0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
- 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
- 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
-};
-
diff --git a/Utilities/Poco/Foundation/src/ucp.h b/Utilities/Poco/Foundation/src/ucp.h
deleted file mode 100755
index 1968e4765c..0000000000
--- a/Utilities/Poco/Foundation/src/ucp.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*************************************************
-* Unicode Property Table handler *
-*************************************************/
-
-#ifndef _UCP_H
-#define _UCP_H
-
-/* This file contains definitions of the property values that are returned by
-the function _pcre_ucp_findprop(). New values that are added for new releases
-of Unicode should always be at the end of each enum, for backwards
-compatibility. */
-
-/* These are the general character categories. */
-
-enum {
- ucp_C, /* Other */
- ucp_L, /* Letter */
- ucp_M, /* Mark */
- ucp_N, /* Number */
- ucp_P, /* Punctuation */
- ucp_S, /* Symbol */
- ucp_Z /* Separator */
-};
-
-/* These are the particular character types. */
-
-enum {
- ucp_Cc, /* Control */
- ucp_Cf, /* Format */
- ucp_Cn, /* Unassigned */
- ucp_Co, /* Private use */
- ucp_Cs, /* Surrogate */
- ucp_Ll, /* Lower case letter */
- ucp_Lm, /* Modifier letter */
- ucp_Lo, /* Other letter */
- ucp_Lt, /* Title case letter */
- ucp_Lu, /* Upper case letter */
- ucp_Mc, /* Spacing mark */
- ucp_Me, /* Enclosing mark */
- ucp_Mn, /* Non-spacing mark */
- ucp_Nd, /* Decimal number */
- ucp_Nl, /* Letter number */
- ucp_No, /* Other number */
- ucp_Pc, /* Connector punctuation */
- ucp_Pd, /* Dash punctuation */
- ucp_Pe, /* Close punctuation */
- ucp_Pf, /* Final punctuation */
- ucp_Pi, /* Initial punctuation */
- ucp_Po, /* Other punctuation */
- ucp_Ps, /* Open punctuation */
- ucp_Sc, /* Currency symbol */
- ucp_Sk, /* Modifier symbol */
- ucp_Sm, /* Mathematical symbol */
- ucp_So, /* Other symbol */
- ucp_Zl, /* Line separator */
- ucp_Zp, /* Paragraph separator */
- ucp_Zs /* Space separator */
-};
-
-/* These are the script identifications. */
-
-enum {
- ucp_Arabic,
- ucp_Armenian,
- ucp_Bengali,
- ucp_Bopomofo,
- ucp_Braille,
- ucp_Buginese,
- ucp_Buhid,
- ucp_Canadian_Aboriginal,
- ucp_Cherokee,
- ucp_Common,
- ucp_Coptic,
- ucp_Cypriot,
- ucp_Cyrillic,
- ucp_Deseret,
- ucp_Devanagari,
- ucp_Ethiopic,
- ucp_Georgian,
- ucp_Glagolitic,
- ucp_Gothic,
- ucp_Greek,
- ucp_Gujarati,
- ucp_Gurmukhi,
- ucp_Han,
- ucp_Hangul,
- ucp_Hanunoo,
- ucp_Hebrew,
- ucp_Hiragana,
- ucp_Inherited,
- ucp_Kannada,
- ucp_Katakana,
- ucp_Kharoshthi,
- ucp_Khmer,
- ucp_Lao,
- ucp_Latin,
- ucp_Limbu,
- ucp_Linear_B,
- ucp_Malayalam,
- ucp_Mongolian,
- ucp_Myanmar,
- ucp_New_Tai_Lue,
- ucp_Ogham,
- ucp_Old_Italic,
- ucp_Old_Persian,
- ucp_Oriya,
- ucp_Osmanya,
- ucp_Runic,
- ucp_Shavian,
- ucp_Sinhala,
- ucp_Syloti_Nagri,
- ucp_Syriac,
- ucp_Tagalog,
- ucp_Tagbanwa,
- ucp_Tai_Le,
- ucp_Tamil,
- ucp_Telugu,
- ucp_Thaana,
- ucp_Thai,
- ucp_Tibetan,
- ucp_Tifinagh,
- ucp_Ugaritic,
- ucp_Yi,
- /* New for Unicode 5.0: */
- ucp_Balinese,
- ucp_Cuneiform,
- ucp_Nko,
- ucp_Phags_Pa,
- ucp_Phoenician,
- /* New for Unicode 5.1: */
- ucp_Carian,
- ucp_Cham,
- ucp_Kayah_Li,
- ucp_Lepcha,
- ucp_Lycian,
- ucp_Lydian,
- ucp_Ol_Chiki,
- ucp_Rejang,
- ucp_Saurashtra,
- ucp_Sundanese,
- ucp_Vai
-};
-
-#endif
-
-/* End of ucp.h */
diff --git a/Utilities/Poco/Foundation/src/zconf.h b/Utilities/Poco/Foundation/src/zconf.h
deleted file mode 100755
index f7855258d2..0000000000
--- a/Utilities/Poco/Foundation/src/zconf.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZCONF_H
-#define ZCONF_H
-
-/*
- * If you *really* need a unique prefix for all types and library functions,
- * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
- */
-#ifdef Z_PREFIX
-# define deflateInit_ z_deflateInit_
-# define deflate z_deflate
-# define deflateEnd z_deflateEnd
-# define inflateInit_ z_inflateInit_
-# define inflate z_inflate
-# define inflateEnd z_inflateEnd
-# define deflateInit2_ z_deflateInit2_
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateCopy z_deflateCopy
-# define deflateReset z_deflateReset
-# define deflateParams z_deflateParams
-# define deflateBound z_deflateBound
-# define deflatePrime z_deflatePrime
-# define inflateInit2_ z_inflateInit2_
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateCopy z_inflateCopy
-# define inflateReset z_inflateReset
-# define inflateBack z_inflateBack
-# define inflateBackEnd z_inflateBackEnd
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
-# define uncompress z_uncompress
-# define adler32 z_adler32
-# define crc32 z_crc32
-# define get_crc_table z_get_crc_table
-# define zError z_zError
-
-# define alloc_func z_alloc_func
-# define free_func z_free_func
-# define in_func z_in_func
-# define out_func z_out_func
-# define Byte z_Byte
-# define uInt z_uInt
-# define uLong z_uLong
-# define Bytef z_Bytef
-# define charf z_charf
-# define intf z_intf
-# define uIntf z_uIntf
-# define uLongf z_uLongf
-# define voidpf z_voidpf
-# define voidp z_voidp
-#endif
-
-#if defined(__MSDOS__) && !defined(MSDOS)
-# define MSDOS
-#endif
-#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
-# define OS2
-#endif
-#if defined(_WINDOWS) && !defined(WINDOWS)
-# define WINDOWS
-#endif
-#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
-# ifndef WIN32
-# define WIN32
-# endif
-#endif
-#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
-# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
-# ifndef SYS16BIT
-# define SYS16BIT
-# endif
-# endif
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#ifdef SYS16BIT
-# define MAXSEG_64K
-#endif
-#ifdef MSDOS
-# define UNALIGNED_OK
-#endif
-
-#ifdef __STDC_VERSION__
-# ifndef STDC
-# define STDC
-# endif
-# if __STDC_VERSION__ >= 199901L
-# ifndef STDC99
-# define STDC99
-# endif
-# endif
-#endif
-#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
-# define STDC
-#endif
-
-#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
-# define STDC
-#endif
-
-#ifndef STDC
-# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-# define const /* note: need a more gentle solution here */
-# endif
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
-# define NO_DUMMY_DECL
-#endif
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-# ifdef MAXSEG_64K
-# define MAX_MEM_LEVEL 8
-# else
-# define MAX_MEM_LEVEL 9
-# endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-# define MAX_WBITS 15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
- (1 << (windowBits+2)) + (1 << (memLevel+9))
- that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
- make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
- The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
- /* Type declarations */
-
-#ifndef OF /* function prototypes */
-# ifdef STDC
-# define OF(args) args
-# else
-# define OF(args) ()
-# endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#ifdef SYS16BIT
-# if defined(M_I86SM) || defined(M_I86MM)
- /* MSC small or medium model */
-# define SMALL_MEDIUM
-# ifdef _MSC_VER
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-# if (defined(__SMALL__) || defined(__MEDIUM__))
- /* Turbo C small or medium model */
-# define SMALL_MEDIUM
-# ifdef __BORLANDC__
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
- /* If building or using zlib as a DLL, define ZLIB_DLL.
- * This is not mandatory, but it offers a little performance increase.
- */
-# ifdef ZLIB_DLL
-# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-# ifdef ZLIB_INTERNAL
-# define ZEXTERN extern __declspec(dllexport)
-# else
-# define ZEXTERN extern __declspec(dllimport)
-# endif
-# endif
-# endif /* ZLIB_DLL */
- /* If building or using zlib with the WINAPI/WINAPIV calling convention,
- * define ZLIB_WINAPI.
- * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
- */
-# ifdef ZLIB_WINAPI
-# ifdef FAR
-# undef FAR
-# endif
-# include "Poco/UnWindows.h"
- /* No need for _export, use ZLIB.DEF instead. */
- /* For complete Windows compatibility, use WINAPI, not __stdcall. */
-# define ZEXPORT WINAPI
-# ifdef WIN32
-# define ZEXPORTVA WINAPIV
-# else
-# define ZEXPORTVA FAR CDECL
-# endif
-# endif
-#endif
-
-#if defined (__BEOS__)
-# ifdef ZLIB_DLL
-# ifdef ZLIB_INTERNAL
-# define ZEXPORT __declspec(dllexport)
-# define ZEXPORTVA __declspec(dllexport)
-# else
-# define ZEXPORT __declspec(dllimport)
-# define ZEXPORTVA __declspec(dllimport)
-# endif
-# endif
-#endif
-
-#ifndef ZEXTERN
-# define ZEXTERN extern
-#endif
-#ifndef ZEXPORT
-# define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-# define ZEXPORTVA
-#endif
-
-#ifndef FAR
-# define FAR
-#endif
-
-#if !defined(__MACTYPES__)
-typedef unsigned char Byte; /* 8 bits */
-#endif
-typedef unsigned int uInt; /* 16 bits or more */
-typedef unsigned long uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
- /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-# define Bytef Byte FAR
-#else
- typedef Byte FAR Bytef;
-#endif
-typedef char FAR charf;
-typedef int FAR intf;
-typedef uInt FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
- typedef void const *voidpc;
- typedef void FAR *voidpf;
- typedef void *voidp;
-#else
- typedef Byte const *voidpc;
- typedef Byte FAR *voidpf;
- typedef Byte *voidp;
-#endif
-
-#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
-# include <sys/types.h> /* for off_t */
-# include <unistd.h> /* for SEEK_* and off_t */
-# ifdef VMS
-# include <unixio.h> /* for off_t */
-# endif
-# define z_off_t off_t
-#endif
-#ifndef SEEK_SET
-# define SEEK_SET 0 /* Seek from beginning of file. */
-# define SEEK_CUR 1 /* Seek from current position. */
-# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
-#endif
-#ifndef z_off_t
-# define z_off_t long
-#endif
-
-#if defined(__OS400__)
-# define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-# define NO_vsnprintf
-# ifdef FAR
-# undef FAR
-# endif
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
-# pragma map(deflateInit_,"DEIN")
-# pragma map(deflateInit2_,"DEIN2")
-# pragma map(deflateEnd,"DEEND")
-# pragma map(deflateBound,"DEBND")
-# pragma map(inflateInit_,"ININ")
-# pragma map(inflateInit2_,"ININ2")
-# pragma map(inflateEnd,"INEND")
-# pragma map(inflateSync,"INSY")
-# pragma map(inflateSetDictionary,"INSEDI")
-# pragma map(compressBound,"CMBND")
-# pragma map(inflate_table,"INTABL")
-# pragma map(inflate_fast,"INFA")
-# pragma map(inflate_copyright,"INCOPY")
-#endif
-
-#endif /* ZCONF_H */
diff --git a/Utilities/Poco/Foundation/src/zlib.h b/Utilities/Poco/Foundation/src/zlib.h
deleted file mode 100755
index 022817927c..0000000000
--- a/Utilities/Poco/Foundation/src/zlib.h
+++ /dev/null
@@ -1,1357 +0,0 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.3, July 18th, 2005
-
- Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly Mark Adler
- jloup@gzip.org madler@alumni.caltech.edu
-
-
- The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
- (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-*/
-
-#ifndef ZLIB_H
-#define ZLIB_H
-
-#include "zconf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.2.3"
-#define ZLIB_VERNUM 0x1230
-
-/*
- The 'zlib' compression library provides in-memory compression and
- decompression functions, including integrity checks of the uncompressed
- data. This version of the library supports only one compression method
- (deflation) but other algorithms will be added later and will have the same
- stream interface.
-
- Compression can be done in a single step if the buffers are large
- enough (for example if an input file is mmap'ed), or can be done by
- repeated calls of the compression function. In the latter case, the
- application must provide more input and/or consume the output
- (providing more output space) before each call.
-
- The compressed data format used by default by the in-memory functions is
- the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
- around a deflate stream, which is itself documented in RFC 1951.
-
- The library also supports reading and writing files in gzip (.gz) format
- with an interface similar to that of stdio using the functions that start
- with "gz". The gzip format is different from the zlib format. gzip is a
- gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
-
- This library can optionally read and write gzip streams in memory as well.
-
- The zlib format was designed to be compact and fast for use in memory
- and on communications channels. The gzip format was designed for single-
- file compression on file systems, has a larger header than zlib to maintain
- directory information, and uses a different, slower check method than zlib.
-
- The library does not install any signal handler. The decoder checks
- the consistency of the compressed data, so the library should never
- crash even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void (*free_func) OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
- Bytef *next_in; /* next input byte */
- uInt avail_in; /* number of bytes available at next_in */
- uLong total_in; /* total nb of input bytes read so far */
-
- Bytef *next_out; /* next output byte should be put there */
- uInt avail_out; /* remaining free space at next_out */
- uLong total_out; /* total nb of bytes output so far */
-
- char *msg; /* last error message, NULL if no error */
- struct internal_state FAR *state; /* not visible by applications */
-
- alloc_func zalloc; /* used to allocate the internal state */
- free_func zfree; /* used to free the internal state */
- voidpf opaque; /* private data object passed to zalloc and zfree */
-
- int data_type; /* best guess about the data type: binary or text */
- uLong adler; /* adler32 value of the uncompressed data */
- uLong reserved; /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
- gzip header information passed to and from zlib routines. See RFC 1952
- for more details on the meanings of these fields.
-*/
-typedef struct gz_header_s {
- int text; /* true if compressed data believed to be text */
- uLong time; /* modification time */
- int xflags; /* extra flags (not used when writing a gzip file) */
- int os; /* operating system */
- Bytef *extra; /* pointer to extra field or Z_NULL if none */
- uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
- uInt extra_max; /* space at extra (only when reading header) */
- Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
- uInt name_max; /* space at name (only when reading header) */
- Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
- uInt comm_max; /* space at comment (only when reading header) */
- int hcrc; /* true if there was or will be a header crc */
- int done; /* true when done reading gzip header (not used
- when writing a gzip file) */
-} gz_header;
-
-typedef gz_header FAR *gz_headerp;
-
-/*
- The application must update next_in and avail_in when avail_in has
- dropped to zero. It must update next_out and avail_out when avail_out
- has dropped to zero. The application must initialize zalloc, zfree and
- opaque before calling the init function. All other fields are set by the
- compression library and must not be updated by the application.
-
- The opaque value provided by the application will be passed as the first
- parameter for calls of zalloc and zfree. This can be useful for custom
- memory management. The compression library attaches no meaning to the
- opaque value.
-
- zalloc must return Z_NULL if there is not enough memory for the object.
- If zlib is used in a multi-threaded application, zalloc and zfree must be
- thread safe.
-
- On 16-bit systems, the functions zalloc and zfree must be able to allocate
- exactly 65536 bytes, but will not be required to allocate more than this
- if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
- pointers returned by zalloc for objects of exactly 65536 bytes *must*
- have their offset normalized to zero. The default allocation function
- provided by this library ensures this (see zutil.c). To reduce memory
- requirements and avoid any allocation of 64K objects, at the expense of
- compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
-
- The fields total_in and total_out can be used for statistics or
- progress reports. After compression, total_in holds the total size of
- the uncompressed data and may be saved for use in the decompressor
- (particularly if the decompressor wants to decompress everything in
- a single step).
-*/
-
- /* constants */
-
-#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
-#define Z_SYNC_FLUSH 2
-#define Z_FULL_FLUSH 3
-#define Z_FINISH 4
-#define Z_BLOCK 5
-/* Allowed flush values; see deflate() and inflate() below for details */
-
-#define Z_OK 0
-#define Z_STREAM_END 1
-#define Z_NEED_DICT 2
-#define Z_ERRNO (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR (-3)
-#define Z_MEM_ERROR (-4)
-#define Z_BUF_ERROR (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative
- * values are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION 0
-#define Z_BEST_SPEED 1
-#define Z_BEST_COMPRESSION 9
-#define Z_DEFAULT_COMPRESSION (-1)
-/* compression levels */
-
-#define Z_FILTERED 1
-#define Z_HUFFMAN_ONLY 2
-#define Z_RLE 3
-#define Z_FIXED 4
-#define Z_DEFAULT_STRATEGY 0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY 0
-#define Z_TEXT 1
-#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
-#define Z_UNKNOWN 2
-/* Possible values of the data_type field (though see inflate()) */
-
-#define Z_DEFLATED 8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
- /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
- If the first character differs, the library code actually used is
- not compatible with the zlib.h header file used by the application.
- This check is automatically made by deflateInit and inflateInit.
- */
-
-/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
- Initializes the internal stream state for compression. The fields
- zalloc, zfree and opaque must be initialized before by the caller.
- If zalloc and zfree are set to Z_NULL, deflateInit updates them to
- use default allocation functions.
-
- The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
- 1 gives best speed, 9 gives best compression, 0 gives no compression at
- all (the input data is simply copied a block at a time).
- Z_DEFAULT_COMPRESSION requests a default compromise between speed and
- compression (currently equivalent to level 6).
-
- deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if level is not a valid compression level,
- Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
- with the version assumed by the caller (ZLIB_VERSION).
- msg is set to null if there is no error message. deflateInit does not
- perform any compression: this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
- deflate compresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce some
- output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. deflate performs one or both of the
- following actions:
-
- - Compress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in and avail_in are updated and
- processing will resume at this point for the next call of deflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. This action is forced if the parameter flush is non zero.
- Forcing flush frequently degrades the compression ratio, so this parameter
- should be set only when necessary (in interactive applications).
- Some output may be provided even if flush is not set.
-
- Before the call of deflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating avail_in or avail_out accordingly; avail_out
- should never be zero before the call. The application can consume the
- compressed output when it wants, for example when the output buffer is full
- (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
- and with zero avail_out, it must be called again after making room in the
- output buffer because there might be more output pending.
-
- Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
- decide how much data to accumualte before producing output, in order to
- maximize compression.
-
- If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
- flushed to the output buffer and the output is aligned on a byte boundary, so
- that the decompressor can get all input data available so far. (In particular
- avail_in is zero after the call if enough output space has been provided
- before the call.) Flushing may degrade compression for some compression
- algorithms and so it should be used only when necessary.
-
- If flush is set to Z_FULL_FLUSH, all output is flushed as with
- Z_SYNC_FLUSH, and the compression state is reset so that decompression can
- restart from this point if previous compressed data has been damaged or if
- random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
- compression.
-
- If deflate returns with avail_out == 0, this function must be called again
- with the same value of the flush parameter and more output space (updated
- avail_out), until the flush is complete (deflate returns with non-zero
- avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
- avail_out is greater than six to avoid repeated flush markers due to
- avail_out == 0 on return.
-
- If the parameter flush is set to Z_FINISH, pending input is processed,
- pending output is flushed and deflate returns with Z_STREAM_END if there
- was enough output space; if deflate returns with Z_OK, this function must be
- called again with Z_FINISH and more output space (updated avail_out) but no
- more input data, until it returns with Z_STREAM_END or an error. After
- deflate has returned Z_STREAM_END, the only possible operations on the
- stream are deflateReset or deflateEnd.
-
- Z_FINISH can be used immediately after deflateInit if all the compression
- is to be done in a single step. In this case, avail_out must be at least
- the value returned by deflateBound (see below). If deflate does not return
- Z_STREAM_END, then it must be called again as described above.
-
- deflate() sets strm->adler to the adler32 checksum of all input read
- so far (that is, total_in bytes).
-
- deflate() may update strm->data_type if it can make a good guess about
- the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
- binary. This field is only for information purposes and does not affect
- the compression algorithm in any manner.
-
- deflate() returns Z_OK if some progress has been made (more input
- processed or more output produced), Z_STREAM_END if all input has been
- consumed and all output has been produced (only when flush is set to
- Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
- (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
- fatal, and deflate() can be called again with more input and more output
- space to continue compressing.
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
-
- deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
- stream state was inconsistent, Z_DATA_ERROR if the stream was freed
- prematurely (some input or output was discarded). In the error case,
- msg may be set but then points to a static string (which must not be
- deallocated).
-*/
-
-
-/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-
- Initializes the internal stream state for decompression. The fields
- next_in, avail_in, zalloc, zfree and opaque must be initialized before by
- the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
- value depends on the compression method), inflateInit determines the
- compression method from the zlib header and allocates all data structures
- accordingly; otherwise the allocation will be deferred to the first call of
- inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
- use default allocation functions.
-
- inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller. msg is set to null if there is no error
- message. inflateInit does not perform any decompression apart from reading
- the zlib header if present: this will be done by inflate(). (So next_in and
- avail_in may be modified, but next_out and avail_out are unchanged.)
-*/
-
-
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
-/*
- inflate decompresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce
- some output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. inflate performs one or both of the
- following actions:
-
- - Decompress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in is updated and processing
- will resume at this point for the next call of inflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. inflate() provides as much output as possible, until there
- is no more input data or no more space in the output buffer (see below
- about the flush parameter).
-
- Before the call of inflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating the next_* and avail_* values accordingly.
- The application can consume the uncompressed output when it wants, for
- example when the output buffer is full (avail_out == 0), or after each
- call of inflate(). If inflate returns Z_OK and with zero avail_out, it
- must be called again after making room in the output buffer because there
- might be more output pending.
-
- The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
- Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
- output as possible to the output buffer. Z_BLOCK requests that inflate() stop
- if and when it gets to the next deflate block boundary. When decoding the
- zlib or gzip format, this will cause inflate() to return immediately after
- the header and before the first block. When doing a raw inflate, inflate()
- will go ahead and process the first block, and will return when it gets to
- the end of that block, or when it runs out of data.
-
- The Z_BLOCK option assists in appending to or combining deflate streams.
- Also to assist in this, on return inflate() will set strm->data_type to the
- number of unused bits in the last byte taken from strm->next_in, plus 64
- if inflate() is currently decoding the last block in the deflate stream,
- plus 128 if inflate() returned immediately after decoding an end-of-block
- code or decoding the complete header up to just before the first byte of the
- deflate stream. The end-of-block will not be indicated until all of the
- uncompressed data from that block has been written to strm->next_out. The
- number of unused bits may in general be greater than seven, except when
- bit 7 of data_type is set, in which case the number of unused bits will be
- less than eight.
-
- inflate() should normally be called until it returns Z_STREAM_END or an
- error. However if all decompression is to be performed in a single step
- (a single call of inflate), the parameter flush should be set to
- Z_FINISH. In this case all pending input is processed and all pending
- output is flushed; avail_out must be large enough to hold all the
- uncompressed data. (The size of the uncompressed data may have been saved
- by the compressor for this purpose.) The next operation on this stream must
- be inflateEnd to deallocate the decompression state. The use of Z_FINISH
- is never required, but can be used to inform inflate that a faster approach
- may be used for the single inflate() call.
-
- In this implementation, inflate() always flushes as much output as
- possible to the output buffer, and always uses the faster approach on the
- first call. So the only effect of the flush parameter in this implementation
- is on the return value of inflate(), as noted below, or when it returns early
- because Z_BLOCK is used.
-
- If a preset dictionary is needed after this call (see inflateSetDictionary
- below), inflate sets strm->adler to the adler32 checksum of the dictionary
- chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
- strm->adler to the adler32 checksum of all output produced so far (that is,
- total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
- below. At the end of the stream, inflate() checks that its computed adler32
- checksum is equal to that saved by the compressor and returns Z_STREAM_END
- only if the checksum is correct.
-
- inflate() will decompress and check either zlib-wrapped or gzip-wrapped
- deflate data. The header type is detected automatically. Any information
- contained in the gzip header is not retained, so applications that need that
- information should instead use raw inflate, see inflateInit2() below, or
- inflateBack() and perform their own processing of the gzip header and
- trailer.
-
- inflate() returns Z_OK if some progress has been made (more input processed
- or more output produced), Z_STREAM_END if the end of the compressed data has
- been reached and all uncompressed output has been produced, Z_NEED_DICT if a
- preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
- corrupted (input stream not conforming to the zlib format or incorrect check
- value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
- if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
- Z_BUF_ERROR if no progress is possible or if there was not enough room in the
- output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
- inflate() can be called again with more input and more output space to
- continue decompressing. If Z_DATA_ERROR is returned, the application may then
- call inflateSync() to look for a good compression block if a partial recovery
- of the data is desired.
-*/
-
-
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
-
- inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
- was inconsistent. In the error case, msg may be set but then points to a
- static string (which must not be deallocated).
-*/
-
- /* Advanced functions */
-
-/*
- The following functions are needed only in some special applications.
-*/
-
-/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
- int level,
- int method,
- int windowBits,
- int memLevel,
- int strategy));
-
- This is another version of deflateInit with more compression options. The
- fields next_in, zalloc, zfree and opaque must be initialized before by
- the caller.
-
- The method parameter is the compression method. It must be Z_DEFLATED in
- this version of the library.
-
- The windowBits parameter is the base two logarithm of the window size
- (the size of the history buffer). It should be in the range 8..15 for this
- version of the library. Larger values of this parameter result in better
- compression at the expense of memory usage. The default value is 15 if
- deflateInit is used instead.
-
- windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
- determines the window size. deflate() will then generate raw deflate data
- with no zlib header or trailer, and will not compute an adler32 check value.
-
- windowBits can also be greater than 15 for optional gzip encoding. Add
- 16 to windowBits to write a simple gzip header and trailer around the
- compressed data instead of a zlib wrapper. The gzip header will have no
- file name, no extra data, no comment, no modification time (set to zero),
- no header crc, and the operating system will be set to 255 (unknown). If a
- gzip stream is being written, strm->adler is a crc32 instead of an adler32.
-
- The memLevel parameter specifies how much memory should be allocated
- for the internal compression state. memLevel=1 uses minimum memory but
- is slow and reduces compression ratio; memLevel=9 uses maximum memory
- for optimal speed. The default value is 8. See zconf.h for total memory
- usage as a function of windowBits and memLevel.
-
- The strategy parameter is used to tune the compression algorithm. Use the
- value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
- filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
- string match), or Z_RLE to limit match distances to one (run-length
- encoding). Filtered data consists mostly of small values with a somewhat
- random distribution. In this case, the compression algorithm is tuned to
- compress them better. The effect of Z_FILTERED is to force more Huffman
- coding and less string matching; it is somewhat intermediate between
- Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
- Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
- parameter only affects the compression ratio but not the correctness of the
- compressed output even if it is not set appropriately. Z_FIXED prevents the
- use of dynamic Huffman codes, allowing for a simpler decoder for special
- applications.
-
- deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
- method). msg is set to null if there is no error message. deflateInit2 does
- not perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the compression dictionary from the given byte sequence
- without producing any compressed output. This function must be called
- immediately after deflateInit, deflateInit2 or deflateReset, before any
- call of deflate. The compressor and decompressor must use exactly the same
- dictionary (see inflateSetDictionary).
-
- The dictionary should consist of strings (byte sequences) that are likely
- to be encountered later in the data to be compressed, with the most commonly
- used strings preferably put towards the end of the dictionary. Using a
- dictionary is most useful when the data to be compressed is short and can be
- predicted with good accuracy; the data can then be compressed better than
- with the default empty dictionary.
-
- Depending on the size of the compression data structures selected by
- deflateInit or deflateInit2, a part of the dictionary may in effect be
- discarded, for example if the dictionary is larger than the window size in
- deflate or deflate2. Thus the strings most likely to be useful should be
- put at the end of the dictionary, not at the front. In addition, the
- current implementation of deflate will use at most the window size minus
- 262 bytes of the provided dictionary.
-
- Upon return of this function, strm->adler is set to the adler32 value
- of the dictionary; the decompressor may later use this value to determine
- which dictionary has been used by the compressor. (The adler32 value
- applies to the whole dictionary even if only a subset of the dictionary is
- actually used by the compressor.) If a raw deflate was requested, then the
- adler32 value is not computed and strm->adler is not set.
-
- deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
- inconsistent (for example if deflate has already been called for this stream
- or if the compression method is bsort). deflateSetDictionary does not
- perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when several compression strategies will be
- tried, for example when there are several ways of pre-processing the input
- data with a filter. The streams that will be discarded should then be freed
- by calling deflateEnd. Note that deflateCopy duplicates the internal
- compression state which can be quite large, so this strategy is slow and
- can consume lots of memory.
-
- deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
- This function is equivalent to deflateEnd followed by deflateInit,
- but does not free and reallocate all the internal compression state.
- The stream will keep the same compression level and any other attributes
- that may have been set by deflateInit2.
-
- deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
- int level,
- int strategy));
-/*
- Dynamically update the compression level and compression strategy. The
- interpretation of level and strategy is as in deflateInit2. This can be
- used to switch between compression and straight copy of the input data, or
- to switch to a different kind of input data requiring a different
- strategy. If the compression level is changed, the input available so far
- is compressed with the old level (and may be flushed); the new level will
- take effect only at the next call of deflate().
-
- Before the call of deflateParams, the stream state must be set as for
- a call of deflate(), since the currently available input may have to
- be compressed and flushed. In particular, strm->avail_out must be non-zero.
-
- deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
- stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
- if strm->avail_out was zero.
-*/
-
-ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
- int good_length,
- int max_lazy,
- int nice_length,
- int max_chain));
-/*
- Fine tune deflate's internal compression parameters. This should only be
- used by someone who understands the algorithm used by zlib's deflate for
- searching for the best matching string, and even then only by the most
- fanatic optimizer trying to squeeze out the last compressed bit for their
- specific input data. Read the deflate.c source code for the meaning of the
- max_lazy, good_length, nice_length, and max_chain parameters.
-
- deflateTune() can be called after deflateInit() or deflateInit2(), and
- returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
- */
-
-ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
- uLong sourceLen));
-/*
- deflateBound() returns an upper bound on the compressed size after
- deflation of sourceLen bytes. It must be called after deflateInit()
- or deflateInit2(). This would be used to allocate an output buffer
- for deflation in a single pass, and so would be called before deflate().
-*/
-
-ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
- int bits,
- int value));
-/*
- deflatePrime() inserts bits in the deflate output stream. The intent
- is that this function is used to start off the deflate output with the
- bits leftover from a previous deflate stream when appending to it. As such,
- this function can only be used for raw deflate, and must be used before the
- first deflate() call after a deflateInit2() or deflateReset(). bits must be
- less than or equal to 16, and that many of the least significant bits of
- value will be inserted in the output.
-
- deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
- gz_headerp head));
-/*
- deflateSetHeader() provides gzip header information for when a gzip
- stream is requested by deflateInit2(). deflateSetHeader() may be called
- after deflateInit2() or deflateReset() and before the first call of
- deflate(). The text, time, os, extra field, name, and comment information
- in the provided gz_header structure are written to the gzip header (xflag is
- ignored -- the extra flags are set according to the compression level). The
- caller must assure that, if not Z_NULL, name and comment are terminated with
- a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
- available there. If hcrc is true, a gzip header crc is included. Note that
- the current versions of the command-line version of gzip (up through version
- 1.3.x) do not support header crc's, and will report that it is a "multi-part
- gzip file" and give up.
-
- If deflateSetHeader is not used, the default gzip header has text false,
- the time set to zero, and os set to 255, with no extra, name, or comment
- fields. The gzip header is returned to the default state by deflateReset().
-
- deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
- int windowBits));
-
- This is another version of inflateInit with an extra parameter. The
- fields next_in, avail_in, zalloc, zfree and opaque must be initialized
- before by the caller.
-
- The windowBits parameter is the base two logarithm of the maximum window
- size (the size of the history buffer). It should be in the range 8..15 for
- this version of the library. The default value is 15 if inflateInit is used
- instead. windowBits must be greater than or equal to the windowBits value
- provided to deflateInit2() while compressing, or it must be equal to 15 if
- deflateInit2() was not used. If a compressed stream with a larger window
- size is given as input, inflate() will return with the error code
- Z_DATA_ERROR instead of trying to allocate a larger window.
-
- windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
- determines the window size. inflate() will then process raw deflate data,
- not looking for a zlib or gzip header, not generating a check value, and not
- looking for any check values for comparison at the end of the stream. This
- is for use with other formats that use the deflate compressed data format
- such as zip. Those formats provide their own check values. If a custom
- format is developed using the raw deflate format for compressed data, it is
- recommended that a check value such as an adler32 or a crc32 be applied to
- the uncompressed data as is done in the zlib, gzip, and zip formats. For
- most applications, the zlib format should be used as is. Note that comments
- above on the use in deflateInit2() applies to the magnitude of windowBits.
-
- windowBits can also be greater than 15 for optional gzip decoding. Add
- 32 to windowBits to enable zlib and gzip decoding with automatic header
- detection, or add 16 to decode only the gzip format (the zlib format will
- return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is
- a crc32 instead of an adler32.
-
- inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
- is set to null if there is no error message. inflateInit2 does not perform
- any decompression apart from reading the zlib header if present: this will
- be done by inflate(). (So next_in and avail_in may be modified, but next_out
- and avail_out are unchanged.)
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the decompression dictionary from the given uncompressed byte
- sequence. This function must be called immediately after a call of inflate,
- if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
- can be determined from the adler32 value returned by that call of inflate.
- The compressor and decompressor must use exactly the same dictionary (see
- deflateSetDictionary). For raw inflate, this function can be called
- immediately after inflateInit2() or inflateReset() and before any call of
- inflate() to set the dictionary. The application must insure that the
- dictionary that was used for compression is provided.
-
- inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
- inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
- expected one (incorrect adler32 value). inflateSetDictionary does not
- perform any decompression: this will be done by subsequent calls of
- inflate().
-*/
-
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
-/*
- Skips invalid compressed data until a full flush point (see above the
- description of deflate with Z_FULL_FLUSH) can be found, or until all
- available input is skipped. No output is provided.
-
- inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
- if no more input was provided, Z_DATA_ERROR if no flush point has been found,
- or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
- case, the application may save the current current value of total_in which
- indicates where valid compressed data was found. In the error case, the
- application may repeatedly call inflateSync, providing more input each time,
- until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when randomly accessing a large stream. The
- first pass through the stream can periodically record the inflate state,
- allowing restarting inflate at those points when randomly accessing the
- stream.
-
- inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
-/*
- This function is equivalent to inflateEnd followed by inflateInit,
- but does not free and reallocate all the internal decompression state.
- The stream will keep attributes that may have been set by inflateInit2.
-
- inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
- int bits,
- int value));
-/*
- This function inserts bits in the inflate input stream. The intent is
- that this function is used to start inflating at a bit position in the
- middle of a byte. The provided bits will be used before any bytes are used
- from next_in. This function should only be used with raw inflate, and
- should be used before the first inflate() call after inflateInit2() or
- inflateReset(). bits must be less than or equal to 16, and that many of the
- least significant bits of value will be inserted in the input.
-
- inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
- gz_headerp head));
-/*
- inflateGetHeader() requests that gzip header information be stored in the
- provided gz_header structure. inflateGetHeader() may be called after
- inflateInit2() or inflateReset(), and before the first call of inflate().
- As inflate() processes the gzip stream, head->done is zero until the header
- is completed, at which time head->done is set to one. If a zlib stream is
- being decoded, then head->done is set to -1 to indicate that there will be
- no gzip header information forthcoming. Note that Z_BLOCK can be used to
- force inflate() to return immediately after header processing is complete
- and before any actual data is decompressed.
-
- The text, time, xflags, and os fields are filled in with the gzip header
- contents. hcrc is set to true if there is a header CRC. (The header CRC
- was valid if done is set to one.) If extra is not Z_NULL, then extra_max
- contains the maximum number of bytes to write to extra. Once done is true,
- extra_len contains the actual extra field length, and extra contains the
- extra field, or that field truncated if extra_max is less than extra_len.
- If name is not Z_NULL, then up to name_max characters are written there,
- terminated with a zero unless the length is greater than name_max. If
- comment is not Z_NULL, then up to comm_max characters are written there,
- terminated with a zero unless the length is greater than comm_max. When
- any of extra, name, or comment are not Z_NULL and the respective field is
- not present in the header, then that field is set to Z_NULL to signal its
- absence. This allows the use of deflateSetHeader() with the returned
- structure to duplicate the header. However if those fields are set to
- allocated memory, then the application will need to save those pointers
- elsewhere so that they can be eventually freed.
-
- If inflateGetHeader is not used, then the header information is simply
- discarded. The header is always checked for validity, including the header
- CRC if present. inflateReset() will reset the process to discard the header
- information. The application would need to call inflateGetHeader() again to
- retrieve the header from the next gzip stream.
-
- inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
- unsigned char FAR *window));
-
- Initialize the internal stream state for decompression using inflateBack()
- calls. The fields zalloc, zfree and opaque in strm must be initialized
- before the call. If zalloc and zfree are Z_NULL, then the default library-
- derived memory allocation routines are used. windowBits is the base two
- logarithm of the window size, in the range 8..15. window is a caller
- supplied buffer of that size. Except for special applications where it is
- assured that deflate was used with small window sizes, windowBits must be 15
- and a 32K byte window must be supplied to be able to decompress general
- deflate streams.
-
- See inflateBack() for the usage of these routines.
-
- inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
- the paramaters are invalid, Z_MEM_ERROR if the internal state could not
- be allocated, or Z_VERSION_ERROR if the version of the library does not
- match the version of the header file.
-*/
-
-typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
-typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
-
-ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
- in_func in, void FAR *in_desc,
- out_func out, void FAR *out_desc));
-/*
- inflateBack() does a raw inflate with a single call using a call-back
- interface for input and output. This is more efficient than inflate() for
- file i/o applications in that it avoids copying between the output and the
- sliding window by simply making the window itself the output buffer. This
- function trusts the application to not change the output buffer passed by
- the output function, at least until inflateBack() returns.
-
- inflateBackInit() must be called first to allocate the internal state
- and to initialize the state with the user-provided window buffer.
- inflateBack() may then be used multiple times to inflate a complete, raw
- deflate stream with each call. inflateBackEnd() is then called to free
- the allocated state.
-
- A raw deflate stream is one with no zlib or gzip header or trailer.
- This routine would normally be used in a utility that reads zip or gzip
- files and writes out uncompressed files. The utility would decode the
- header and process the trailer on its own, hence this routine expects
- only the raw deflate stream to decompress. This is different from the
- normal behavior of inflate(), which expects either a zlib or gzip header and
- trailer around the deflate stream.
-
- inflateBack() uses two subroutines supplied by the caller that are then
- called by inflateBack() for input and output. inflateBack() calls those
- routines until it reads a complete deflate stream and writes out all of the
- uncompressed data, or until it encounters an error. The function's
- parameters and return types are defined above in the in_func and out_func
- typedefs. inflateBack() will call in(in_desc, &buf) which should return the
- number of bytes of provided input, and a pointer to that input in buf. If
- there is no input available, in() must return zero--buf is ignored in that
- case--and inflateBack() will return a buffer error. inflateBack() will call
- out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
- should return zero on success, or non-zero on failure. If out() returns
- non-zero, inflateBack() will return with an error. Neither in() nor out()
- are permitted to change the contents of the window provided to
- inflateBackInit(), which is also the buffer that out() uses to write from.
- The length written by out() will be at most the window size. Any non-zero
- amount of input may be provided by in().
-
- For convenience, inflateBack() can be provided input on the first call by
- setting strm->next_in and strm->avail_in. If that input is exhausted, then
- in() will be called. Therefore strm->next_in must be initialized before
- calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
- immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
- must also be initialized, and then if strm->avail_in is not zero, input will
- initially be taken from strm->next_in[0 .. strm->avail_in - 1].
-
- The in_desc and out_desc parameters of inflateBack() is passed as the
- first parameter of in() and out() respectively when they are called. These
- descriptors can be optionally used to pass any information that the caller-
- supplied in() and out() functions need to do their job.
-
- On return, inflateBack() will set strm->next_in and strm->avail_in to
- pass back any unused input that was provided by the last in() call. The
- return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
- if in() or out() returned an error, Z_DATA_ERROR if there was a format
- error in the deflate stream (in which case strm->msg is set to indicate the
- nature of the error), or Z_STREAM_ERROR if the stream was not properly
- initialized. In the case of Z_BUF_ERROR, an input or output error can be
- distinguished using strm->next_in which will be Z_NULL only if in() returned
- an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
- out() returning non-zero. (in() will always be called before out(), so
- strm->next_in is assured to be defined if out() returns non-zero.) Note
- that inflateBack() cannot return Z_OK.
-*/
-
-ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
-/*
- All memory allocated by inflateBackInit() is freed.
-
- inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
- state was inconsistent.
-*/
-
-ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
-/* Return flags indicating compile-time options.
-
- Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
- 1.0: size of uInt
- 3.2: size of uLong
- 5.4: size of voidpf (pointer)
- 7.6: size of z_off_t
-
- Compiler, assembler, and debug options:
- 8: DEBUG
- 9: ASMV or ASMINF -- use ASM code
- 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
- 11: 0 (reserved)
-
- One-time table building (smaller code, but not thread-safe if true):
- 12: BUILDFIXED -- build static block decoding tables when needed
- 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
- 14,15: 0 (reserved)
-
- Library content (indicates missing functionality):
- 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
- deflate code when not needed)
- 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
- and decode gzip streams (to avoid linking crc code)
- 18-19: 0 (reserved)
-
- Operation variations (changes in library functionality):
- 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
- 21: FASTEST -- deflate algorithm with only one, lowest compression level
- 22,23: 0 (reserved)
-
- The sprintf variant used by gzprintf (zero is best):
- 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
- 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
- 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
-
- Remainder:
- 27-31: 0 (reserved)
- */
-
-
- /* utility functions */
-
-/*
- The following utility functions are implemented on top of the
- basic stream-oriented functions. To simplify the interface, some
- default options are assumed (compression level and memory usage,
- standard memory allocation functions). The source code of these
- utility functions can easily be modified if you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Compresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be at least the value returned
- by compressBound(sourceLen). Upon exit, destLen is the actual size of the
- compressed buffer.
- This function can be used to compress a whole file at once if the
- input file is mmap'ed.
- compress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen,
- int level));
-/*
- Compresses the source buffer into the destination buffer. The level
- parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
- destination buffer, which must be at least the value returned by
- compressBound(sourceLen). Upon exit, destLen is the actual size of the
- compressed buffer.
-
- compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_BUF_ERROR if there was not enough room in the output buffer,
- Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
-/*
- compressBound() returns an upper bound on the compressed size after
- compress() or compress2() on sourceLen bytes. It would be used before
- a compress() or compress2() call to allocate the destination buffer.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Decompresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be large enough to hold the
- entire uncompressed data. (The size of the uncompressed data must have
- been saved previously by the compressor and transmitted to the decompressor
- by some mechanism outside the scope of this compression library.)
- Upon exit, destLen is the actual size of the compressed buffer.
- This function can be used to decompress a whole file at once if the
- input file is mmap'ed.
-
- uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
-*/
-
-
-typedef voidp gzFile;
-
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
-/*
- Opens a gzip (.gz) file for reading or writing. The mode parameter
- is as in fopen ("rb" or "wb") but can also include a compression level
- ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
- Huffman only compression as in "wb1h", or 'R' for run-length encoding
- as in "wb1R". (See the description of deflateInit2 for more information
- about the strategy parameter.)
-
- gzopen can be used to read a file which is not in gzip format; in this
- case gzread will directly read from the file without decompression.
-
- gzopen returns NULL if the file could not be opened or if there was
- insufficient memory to allocate the (de)compression state; errno
- can be checked to distinguish the two cases (if errno is zero, the
- zlib error is Z_MEM_ERROR). */
-
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
-/*
- gzdopen() associates a gzFile with the file descriptor fd. File
- descriptors are obtained from calls like open, dup, creat, pipe or
- fileno (in the file has been previously opened with fopen).
- The mode parameter is as in gzopen.
- The next call of gzclose on the returned gzFile will also close the
- file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
- descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
- gzdopen returns NULL if there was insufficient memory to allocate
- the (de)compression state.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
- Dynamically update the compression level or strategy. See the description
- of deflateInit2 for the meaning of these parameters.
- gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
- opened for writing.
-*/
-
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
-/*
- Reads the given number of uncompressed bytes from the compressed file.
- If the input file was not in gzip format, gzread copies the given number
- of bytes into the buffer.
- gzread returns the number of uncompressed bytes actually read (0 for
- end of file, -1 for error). */
-
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
- voidpc buf, unsigned len));
-/*
- Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of uncompressed bytes actually written
- (0 in case of error).
-*/
-
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
-/*
- Converts, formats, and writes the args to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
- uncompressed bytes actually written (0 in case of error). The number of
- uncompressed bytes written is limited to 4095. The caller should assure that
- this limit is not exceeded. If it is exceeded, then gzprintf() will return
- return an error (0) with nothing written. In this case, there may also be a
- buffer overflow with unpredictable consequences, which is possible only if
- zlib was compiled with the insecure functions sprintf() or vsprintf()
- because the secure snprintf() or vsnprintf() functions were not available.
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
- Writes the given null-terminated string to the compressed file, excluding
- the terminating null character.
- gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
- Reads bytes from the compressed file until len-1 characters are read, or
- a newline character is read and transferred to buf, or an end-of-file
- condition is encountered. The string is then terminated with a null
- character.
- gzgets returns buf, or Z_NULL in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
-/*
- Writes c, converted to an unsigned char, into the compressed file.
- gzputc returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
-/*
- Reads one byte from the compressed file. gzgetc returns this byte
- or -1 in case of end of file or error.
-*/
-
-ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
-/*
- Push one character back onto the stream to be read again later.
- Only one character of push-back is allowed. gzungetc() returns the
- character pushed, or -1 on failure. gzungetc() will fail if a
- character has been pushed but not read yet, or if c is -1. The pushed
- character will be discarded if the stream is repositioned with gzseek()
- or gzrewind().
-*/
-
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
-/*
- Flushes all pending output into the compressed file. The parameter
- flush is as in the deflate() function. The return value is the zlib
- error number (see function gzerror below). gzflush returns Z_OK if
- the flush parameter is Z_FINISH and all output could be flushed.
- gzflush should be called only when strictly necessary because it can
- degrade compression.
-*/
-
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
- z_off_t offset, int whence));
-/*
- Sets the starting position for the next gzread or gzwrite on the
- given compressed file. The offset represents a number of bytes in the
- uncompressed data stream. The whence parameter is defined as in lseek(2);
- the value SEEK_END is not supported.
- If the file is opened for reading, this function is emulated but can be
- extremely slow. If the file is opened for writing, only forward seeks are
- supported; gzseek then compresses a sequence of zeroes up to the new
- starting position.
-
- gzseek returns the resulting offset location as measured in bytes from
- the beginning of the uncompressed stream, or -1 in case of error, in
- particular if the file is opened for writing and the new starting position
- would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
-/*
- Rewinds the given file. This function is supported only for reading.
-
- gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
-/*
- Returns the starting position for the next gzread or gzwrite on the
- given compressed file. This position represents a number of bytes in the
- uncompressed data stream.
-
- gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
- Returns 1 when EOF has previously been detected reading the given
- input stream, otherwise zero.
-*/
-
-ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
-/*
- Returns 1 if file is being read directly without decompression, otherwise
- zero.
-*/
-
-ZEXTERN int ZEXPORT gzclose OF((gzFile file));
-/*
- Flushes all pending output if necessary, closes the compressed file
- and deallocates all the (de)compression state. The return value is the zlib
- error number (see function gzerror below).
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
- Returns the error message for the last error which occurred on the
- given compressed file. errnum is set to zlib error number. If an
- error occurred in the file system and not in the compression library,
- errnum is set to Z_ERRNO and the application may consult errno
- to get the exact error code.
-*/
-
-ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
-/*
- Clears the error and end-of-file flags for file. This is analogous to the
- clearerr() function in stdio. This is useful for continuing to read a gzip
- file that is being written concurrently.
-*/
-
- /* checksum functions */
-
-/*
- These functions are not related to compression but are exported
- anyway because they might be useful in applications using the
- compression library.
-*/
-
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
-/*
- Update a running Adler-32 checksum with the bytes buf[0..len-1] and
- return the updated checksum. If buf is NULL, this function returns
- the required initial value for the checksum.
- An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
- much faster. Usage example:
-
- uLong adler = adler32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- adler = adler32(adler, buffer, length);
- }
- if (adler != original_adler) error();
-*/
-
-ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
- z_off_t len2));
-/*
- Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
- and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
- each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
- seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
-*/
-
-ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
-/*
- Update a running CRC-32 with the bytes buf[0..len-1] and return the
- updated CRC-32. If buf is NULL, this function returns the required initial
- value for the for the crc. Pre- and post-conditioning (one's complement) is
- performed within this function so it shouldn't be done by the application.
- Usage example:
-
- uLong crc = crc32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- crc = crc32(crc, buffer, length);
- }
- if (crc != original_crc) error();
-*/
-
-ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
-
-/*
- Combine two CRC-32 check values into one. For two sequences of bytes,
- seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
- calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
- check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
- len2.
-*/
-
-
- /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
- int windowBits, int memLevel,
- int strategy, const char *version,
- int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
- unsigned char FAR *window,
- const char *version,
- int stream_size));
-#define deflateInit(strm, level) \
- deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit(strm) \
- inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
- deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
- inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
-#define inflateBackInit(strm, windowBits, window) \
- inflateBackInit_((strm), (windowBits), (window), \
- ZLIB_VERSION, sizeof(z_stream))
-
-
-#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
- struct internal_state {int dummy;}; /* hack for buggy compilers */
-#endif
-
-ZEXTERN const char * ZEXPORT zError OF((int));
-ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
-ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ZLIB_H */
diff --git a/Utilities/Poco/Foundation/src/zutil.c b/Utilities/Poco/Foundation/src/zutil.c
deleted file mode 100755
index d55f5948a3..0000000000
--- a/Utilities/Poco/Foundation/src/zutil.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#include "zutil.h"
-
-#ifndef NO_DUMMY_DECL
-struct internal_state {int dummy;}; /* for buggy compilers */
-#endif
-
-const char * const z_errmsg[10] = {
-"need dictionary", /* Z_NEED_DICT 2 */
-"stream end", /* Z_STREAM_END 1 */
-"", /* Z_OK 0 */
-"file error", /* Z_ERRNO (-1) */
-"stream error", /* Z_STREAM_ERROR (-2) */
-"data error", /* Z_DATA_ERROR (-3) */
-"insufficient memory", /* Z_MEM_ERROR (-4) */
-"buffer error", /* Z_BUF_ERROR (-5) */
-"incompatible version",/* Z_VERSION_ERROR (-6) */
-""};
-
-
-const char * ZEXPORT zlibVersion()
-{
- return ZLIB_VERSION;
-}
-
-uLong ZEXPORT zlibCompileFlags()
-{
- uLong flags;
-
- flags = 0;
- switch (sizeof(uInt)) {
- case 2: break;
- case 4: flags += 1; break;
- case 8: flags += 2; break;
- default: flags += 3;
- }
- switch (sizeof(uLong)) {
- case 2: break;
- case 4: flags += 1 << 2; break;
- case 8: flags += 2 << 2; break;
- default: flags += 3 << 2;
- }
- switch (sizeof(voidpf)) {
- case 2: break;
- case 4: flags += 1 << 4; break;
- case 8: flags += 2 << 4; break;
- default: flags += 3 << 4;
- }
- switch (sizeof(z_off_t)) {
- case 2: break;
- case 4: flags += 1 << 6; break;
- case 8: flags += 2 << 6; break;
- default: flags += 3 << 6;
- }
-#ifdef DEBUG
- flags += 1 << 8;
-#endif
-#if defined(ASMV) || defined(ASMINF)
- flags += 1 << 9;
-#endif
-#ifdef ZLIB_WINAPI
- flags += 1 << 10;
-#endif
-#ifdef BUILDFIXED
- flags += 1 << 12;
-#endif
-#ifdef DYNAMIC_CRC_TABLE
- flags += 1 << 13;
-#endif
-#ifdef NO_GZCOMPRESS
- flags += 1L << 16;
-#endif
-#ifdef NO_GZIP
- flags += 1L << 17;
-#endif
-#ifdef PKZIP_BUG_WORKAROUND
- flags += 1L << 20;
-#endif
-#ifdef FASTEST
- flags += 1L << 21;
-#endif
-#ifdef STDC
-# ifdef NO_vsnprintf
- flags += 1L << 25;
-# ifdef HAS_vsprintf_void
- flags += 1L << 26;
-# endif
-# else
-# ifdef HAS_vsnprintf_void
- flags += 1L << 26;
-# endif
-# endif
-#else
- flags += 1L << 24;
-# ifdef NO_snprintf
- flags += 1L << 25;
-# ifdef HAS_sprintf_void
- flags += 1L << 26;
-# endif
-# else
-# ifdef HAS_snprintf_void
- flags += 1L << 26;
-# endif
-# endif
-#endif
- return flags;
-}
-
-#ifdef DEBUG
-
-# ifndef verbose
-# define verbose 0
-# endif
-int z_verbose = verbose;
-
-void z_error (m)
- char *m;
-{
- fprintf(stderr, "%s\n", m);
- exit(1);
-}
-#endif
-
-/* exported to allow conversion of error code to string for compress() and
- * uncompress()
- */
-const char * ZEXPORT zError(err)
- int err;
-{
- return ERR_MSG(err);
-}
-
-#if defined(_WIN32_WCE)
- /* The Microsoft C Run-Time Library for Windows CE doesn't have
- * errno. We define it as a global variable to simplify porting.
- * Its value is always 0 and should not be used.
- */
- int errno = 0;
-#endif
-
-#ifndef HAVE_MEMCPY
-
-void zmemcpy(dest, source, len)
- Bytef* dest;
- const Bytef* source;
- uInt len;
-{
- if (len == 0) return;
- do {
- *dest++ = *source++; /* ??? to be unrolled */
- } while (--len != 0);
-}
-
-int zmemcmp(s1, s2, len)
- const Bytef* s1;
- const Bytef* s2;
- uInt len;
-{
- uInt j;
-
- for (j = 0; j < len; j++) {
- if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
- }
- return 0;
-}
-
-void zmemzero(dest, len)
- Bytef* dest;
- uInt len;
-{
- if (len == 0) return;
- do {
- *dest++ = 0; /* ??? to be unrolled */
- } while (--len != 0);
-}
-#endif
-
-
-#ifdef SYS16BIT
-
-#ifdef __TURBOC__
-/* Turbo C in 16-bit mode */
-
-# define MY_ZCALLOC
-
-/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
- * and farmalloc(64K) returns a pointer with an offset of 8, so we
- * must fix the pointer. Warning: the pointer must be put back to its
- * original form in order to free it, use zcfree().
- */
-
-#define MAX_PTR 10
-/* 10*64K = 640K */
-
-local int next_ptr = 0;
-
-typedef struct ptr_table_s {
- voidpf org_ptr;
- voidpf new_ptr;
-} ptr_table;
-
-local ptr_table table[MAX_PTR];
-/* This table is used to remember the original form of pointers
- * to large buffers (64K). Such pointers are normalized with a zero offset.
- * Since MSDOS is not a preemptive multitasking OS, this table is not
- * protected from concurrent access. This hack doesn't work anyway on
- * a protected system like OS/2. Use Microsoft C instead.
- */
-
-voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
-{
- voidpf buf = opaque; /* just to make some compilers happy */
- ulg bsize = (ulg)items*size;
-
- /* If we allocate less than 65520 bytes, we assume that farmalloc
- * will return a usable pointer which doesn't have to be normalized.
- */
- if (bsize < 65520L) {
- buf = farmalloc(bsize);
- if (*(ush*)&buf != 0) return buf;
- } else {
- buf = farmalloc(bsize + 16L);
- }
- if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
- table[next_ptr].org_ptr = buf;
-
- /* Normalize the pointer to seg:0 */
- *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
- *(ush*)&buf = 0;
- table[next_ptr++].new_ptr = buf;
- return buf;
-}
-
-void zcfree (voidpf opaque, voidpf ptr)
-{
- int n;
- if (*(ush*)&ptr != 0) { /* object < 64K */
- farfree(ptr);
- return;
- }
- /* Find the original pointer */
- for (n = 0; n < next_ptr; n++) {
- if (ptr != table[n].new_ptr) continue;
-
- farfree(table[n].org_ptr);
- while (++n < next_ptr) {
- table[n-1] = table[n];
- }
- next_ptr--;
- return;
- }
- ptr = opaque; /* just to make some compilers happy */
- Assert(0, "zcfree: ptr not found");
-}
-
-#endif /* __TURBOC__ */
-
-
-#ifdef M_I86
-/* Microsoft C in 16-bit mode */
-
-# define MY_ZCALLOC
-
-#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
-# define _halloc halloc
-# define _hfree hfree
-#endif
-
-voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
-{
- if (opaque) opaque = 0; /* to make compiler happy */
- return _halloc((long)items, size);
-}
-
-void zcfree (voidpf opaque, voidpf ptr)
-{
- if (opaque) opaque = 0; /* to make compiler happy */
- _hfree(ptr);
-}
-
-#endif /* M_I86 */
-
-#endif /* SYS16BIT */
-
-
-#ifndef MY_ZCALLOC /* Any system without a special alloc function */
-
-#ifndef STDC
-extern voidp malloc OF((uInt size));
-extern voidp calloc OF((uInt items, uInt size));
-extern void free OF((voidpf ptr));
-#endif
-
-voidpf zcalloc (opaque, items, size)
- voidpf opaque;
- unsigned items;
- unsigned size;
-{
- if (opaque) items += size - size; /* make compiler happy */
- return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
- (voidpf)calloc(items, size);
-}
-
-void zcfree (opaque, ptr)
- voidpf opaque;
- voidpf ptr;
-{
- free(ptr);
- if (opaque) return; /* make compiler happy */
-}
-
-#endif /* MY_ZCALLOC */
diff --git a/Utilities/Poco/Foundation/src/zutil.h b/Utilities/Poco/Foundation/src/zutil.h
deleted file mode 100755
index b7d5eff81b..0000000000
--- a/Utilities/Poco/Foundation/src/zutil.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZUTIL_H
-#define ZUTIL_H
-
-#define ZLIB_INTERNAL
-#include "zlib.h"
-
-#ifdef STDC
-# ifndef _WIN32_WCE
-# include <stddef.h>
-# endif
-# include <string.h>
-# include <stdlib.h>
-#endif
-#ifdef NO_ERRNO_H
-# ifdef _WIN32_WCE
- /* The Microsoft C Run-Time Library for Windows CE doesn't have
- * errno. We define it as a global variable to simplify porting.
- * Its value is always 0 and should not be used. We rename it to
- * avoid conflict with other libraries that use the same workaround.
- */
-# define errno z_errno
-# endif
- extern int errno;
-#else
-# ifndef _WIN32_WCE
-# include <errno.h>
-# endif
-#endif
-
-#ifndef local
-# define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-typedef unsigned char uch;
-typedef uch FAR uchf;
-typedef unsigned short ush;
-typedef ush FAR ushf;
-typedef unsigned long ulg;
-
-extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
-/* (size given to avoid silly warnings with Visual C++) */
-
-#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
-
-#define ERR_RETURN(strm,err) \
- return (strm->msg = (char*)ERR_MSG(err), (err))
-/* To be used only when the state is known to be valid */
-
- /* common constants */
-
-#ifndef DEF_WBITS
-# define DEF_WBITS MAX_WBITS
-#endif
-/* default windowBits for decompression. MAX_WBITS is for compression only */
-
-#if MAX_MEM_LEVEL >= 8
-# define DEF_MEM_LEVEL 8
-#else
-# define DEF_MEM_LEVEL MAX_MEM_LEVEL
-#endif
-/* default memLevel */
-
-#define STORED_BLOCK 0
-#define STATIC_TREES 1
-#define DYN_TREES 2
-/* The three kinds of block type */
-
-#define MIN_MATCH 3
-#define MAX_MATCH 258
-/* The minimum and maximum match lengths */
-
-#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
-
- /* target dependencies */
-
-#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
-# define OS_CODE 0x00
-# if defined(__TURBOC__) || defined(__BORLANDC__)
-# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
- /* Allow compilation with ANSI keywords only enabled */
- void _Cdecl farfree( void *block );
- void *_Cdecl farmalloc( unsigned long nbytes );
-# else
-# include <alloc.h>
-# endif
-# else /* MSC or DJGPP */
-# include <malloc.h>
-# endif
-#endif
-
-#ifdef AMIGA
-# define OS_CODE 0x01
-#endif
-
-#if defined(VAXC) || defined(VMS)
-# define OS_CODE 0x02
-# define F_OPEN(name, mode) \
- fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
-#endif
-
-#if defined(ATARI) || defined(atarist)
-# define OS_CODE 0x05
-#endif
-
-#ifdef OS2
-# define OS_CODE 0x06
-# ifdef M_I86
- #include <malloc.h>
-# endif
-#endif
-
-#if defined(MACOS) || defined(TARGET_OS_MAC)
-# define OS_CODE 0x07
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fdopen */
-# else
-# ifndef fdopen
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# endif
-# endif
-#endif
-
-#ifdef TOPS20
-# define OS_CODE 0x0a
-#endif
-
-#ifdef WIN32
-# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
-# define OS_CODE 0x0b
-# endif
-#endif
-
-#ifdef __50SERIES /* Prime/PRIMOS */
-# define OS_CODE 0x0f
-#endif
-
-#if defined(_BEOS_) || defined(RISCOS)
-# define fdopen(fd,mode) NULL /* No fdopen() */
-#endif
-
-#if (defined(_MSC_VER) && (_MSC_VER > 600))
-# if defined(_WIN32_WCE)
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# ifndef _PTRDIFF_T_DEFINED
- typedef int ptrdiff_t;
-# define _PTRDIFF_T_DEFINED
-# endif
-# else
-# define fdopen(fd,type) _fdopen(fd,type)
-# endif
-#endif
-
- /* common defaults */
-
-#ifndef OS_CODE
-# define OS_CODE 0x03 /* assume Unix */
-#endif
-
-#ifndef F_OPEN
-# define F_OPEN(name, mode) fopen((name), (mode))
-#endif
-
- /* functions */
-
-#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
-# ifndef HAVE_VSNPRINTF
-# define HAVE_VSNPRINTF
-# endif
-#endif
-#if defined(__CYGWIN__)
-# ifndef HAVE_VSNPRINTF
-# define HAVE_VSNPRINTF
-# endif
-#endif
-#ifndef HAVE_VSNPRINTF
-# ifdef MSDOS
- /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
- but for now we just assume it doesn't. */
-# define NO_vsnprintf
-# endif
-# ifdef __TURBOC__
-# define NO_vsnprintf
-# endif
-# ifdef WIN32
- /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
-# if !defined(vsnprintf) && !defined(NO_vsnprintf)
-# define vsnprintf _vsnprintf
-# endif
-# endif
-# ifdef __SASC
-# define NO_vsnprintf
-# endif
-#endif
-#ifdef VMS
-# define NO_vsnprintf
-#endif
-
-#if defined(pyr)
-# define NO_MEMCPY
-#endif
-#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
- /* Use our own functions for small and medium model with MSC <= 5.0.
- * You may have to use the same strategy for Borland C (untested).
- * The __SC__ check is for Symantec.
- */
-# define NO_MEMCPY
-#endif
-#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
-# define HAVE_MEMCPY
-#endif
-#ifdef HAVE_MEMCPY
-# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
-# define zmemcpy _fmemcpy
-# define zmemcmp _fmemcmp
-# define zmemzero(dest, len) _fmemset(dest, 0, len)
-# else
-# define zmemcpy memcpy
-# define zmemcmp memcmp
-# define zmemzero(dest, len) memset(dest, 0, len)
-# endif
-#else
- extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
- extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
- extern void zmemzero OF((Bytef* dest, uInt len));
-#endif
-
-/* Diagnostic functions */
-#ifdef DEBUG
-# include <stdio.h>
- extern int z_verbose;
- extern void z_error OF((char *m));
-# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
-# define Trace(x) {if (z_verbose>=0) fprintf x ;}
-# define Tracev(x) {if (z_verbose>0) fprintf x ;}
-# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
-# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
-# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
-#else
-# define Assert(cond,msg)
-# define Trace(x)
-# define Tracev(x)
-# define Tracevv(x)
-# define Tracec(c,x)
-# define Tracecv(c,x)
-#endif
-
-
-voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
-void zcfree OF((voidpf opaque, voidpf ptr));
-
-#define ZALLOC(strm, items, size) \
- (*((strm)->zalloc))((strm)->opaque, (items), (size))
-#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
-#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
-
-#endif /* ZUTIL_H */
diff --git a/Utilities/Poco/Foundation/testsuite/CMakeLists.txt b/Utilities/Poco/Foundation/testsuite/CMakeLists.txt
deleted file mode 100755
index 19b6e2761c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-include(files.cmake)
-
-# Additional "test data"
-add_library(TestLibrary ${LIB_MODE} src/TestPlugin.cpp src/TestLibrary.cpp)
-set_target_properties(TestLibrary PROPERTIES PREFIX "")
-target_link_libraries(TestLibrary PocoFoundation)
-
-add_executable(TestApp src/TestApp.cpp)
-set_target_properties(TestApp PROPERTIES
- DEBUG_OUTPUT_NAME TestAppd)
-
-
-# The test runner
-add_executable(PocoTestRunnerFoundation ${CPP_FILES})
-target_link_libraries(PocoTestRunnerFoundation PocoFoundation CppUnit)
-add_dependencies(PocoTestRunnerFoundation TestLibrary TestApp)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../Foundation/include
-${CMAKE_CURRENT_SOURCE_DIR}/../../CppUnit/include
-)
-if(WIN32)
- target_link_libraries(PocoTestRunnerFoundation
- WinTestRunner
- )
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../CppUnit/WinTestRunner/include)
- add_definitions(-D_AFXDLL)
-endif(WIN32)
-#set_target_properties(PocoTestRunnerFoundation PROPERTIES COMPILE_FLAGS "${POCO_UNIX_COMPILE_FLAGS}")
-
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/data/testdata.txt" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/data/testdata.txt" COPYONLY)
diff --git a/Utilities/Poco/Foundation/testsuite/data/testdata.txt b/Utilities/Poco/Foundation/testsuite/data/testdata.txt
deleted file mode 100755
index de8fb73cd1..0000000000
--- a/Utilities/Poco/Foundation/testsuite/data/testdata.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
-CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
-DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
-EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
-FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
-HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
-IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
-JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
-KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
-LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
-MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
-NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
-OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
-PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
-QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
-RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
-SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
-TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
-UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
-VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
-WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
-ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
\ No newline at end of file
diff --git a/Utilities/Poco/Foundation/testsuite/files.cmake b/Utilities/Poco/Foundation/testsuite/files.cmake
deleted file mode 100755
index caba4abf95..0000000000
--- a/Utilities/Poco/Foundation/testsuite/files.cmake
+++ /dev/null
@@ -1,44 +0,0 @@
-set(CPP_BASE_FILENAMES
- ActiveMethodTest ActivityTest ActiveDispatcherTest
- AutoPtrTest SharedPtrTest AutoReleasePoolTest Base64Test
- BinaryReaderWriterTest LineEndingConverterTest
- ByteOrderTest ChannelTest ClassLoaderTest CoreTest CoreTestSuite
- CountingStreamTest CryptTestSuite DateTimeFormatterTest
- DateTimeParserTest DateTimeTest LocalDateTimeTest DateTimeTestSuite DigestStreamTest
- Driver DynamicFactoryTest FPETest FileChannelTest FileTest GlobTest FilesystemTestSuite
- FoundationTestSuite HMACEngineTest HexBinaryTest LoggerTest
- LoggingFactoryTest LoggingRegistryTest LoggingTestSuite LogStreamTest
- NamedEventTest NamedMutexTest ProcessesTestSuite ProcessTest
- MemoryPoolTest MD2EngineTest MD4EngineTest MD5EngineTest ManifestTest
- NDCTest NotificationCenterTest NotificationQueueTest
- NotificationsTestSuite NullStreamTest NumberFormatterTest
- NumberParserTest PathTest PatternFormatterTest RWLockTest
- RandomStreamTest RandomTest RegularExpressionTest SHA1EngineTest
- SemaphoreTest ConditionTest SharedLibraryTest SharedLibraryTestSuite
- SimpleFileChannelTest StopwatchTest
- StreamConverterTest StreamCopierTest StreamTokenizerTest
- StreamsTestSuite StringTest StringTokenizerTest TaskTestSuite TaskTest
- TaskManagerTest TestChannel TeeStreamTest UTF8StringTest
- TextConverterTest TextIteratorTest TextTestSuite TextEncodingTest
- ThreadLocalTest ThreadPoolTest ThreadTest ThreadingTestSuite TimerTest
- TimespanTest TimestampTest TimezoneTest URIStreamOpenerTest URITest
- URITestSuite UUIDGeneratorTest UUIDTest UUIDTestSuite ZLibTest
- TestPlugin DummyDelegate BasicEventTest FIFOEventTest PriorityEventTest EventTestSuite
- LRUCacheTest ExpireCacheTest ExpireLRUCacheTest CacheTestSuite AnyTest FormatTest
- HashingTestSuite HashTableTest SimpleHashTableTest LinearHashTableTest
- HashSetTest HashMapTest SharedMemoryTest PriorityNotificationQueueTest
- UniqueExpireCacheTest UniqueExpireLRUCacheTest TimedNotificationQueueTest
- TuplesTest NamedTuplesTest TypeListTest DynamicAnyTest FileStreamTest
-)
-
-if(WIN32)
- set(CPP_BASE_FILENAMES
- WinDriver
- ${CPP_BASE_FILENAMES}
- )
-endif(WIN32)
-
-set(CPP_FILES "")
-foreach(basename ${CPP_BASE_FILENAMES})
- set(CPP_FILES ${CPP_FILES} src/${basename})
-endforeach(basename ${CPP_BASE_FILENAMES})
diff --git a/Utilities/Poco/Foundation/testsuite/src/ActiveDispatcherTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ActiveDispatcherTest.cpp
deleted file mode 100755
index 68ca0ce412..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ActiveDispatcherTest.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-//
-// ActiveDispatcherTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Redistributions in any form must be accompanied by information on
-// how to obtain complete source code for this software and any
-// accompanying software that uses this software. The source code
-// must either be included in the distribution or be available for no
-// more than the cost of distribution plus a nominal fee, and must be
-// freely redistributable under reasonable conditions. For an
-// executable file, complete source code means the source code for all
-// modules it contains. It does not include source code for modules or
-// files that typically accompany the major components of the operating
-// system on which the executable file runs.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#include "ActiveDispatcherTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/ActiveDispatcher.h"
-#include "Poco/ActiveMethod.h"
-#include "Poco/Thread.h"
-#include "Poco/Event.h"
-#include "Poco/Exception.h"
-
-
-using Poco::ActiveDispatcher;
-using Poco::ActiveMethod;
-using Poco::ActiveResult;
-using Poco::ActiveStarter;
-using Poco::Thread;
-using Poco::Event;
-using Poco::Exception;
-
-
-namespace
-{
- class ActiveObject: public ActiveDispatcher
- {
- public:
- ActiveObject():
- testMethod(this, &ActiveObject::testMethodImpl),
- testVoid(this, &ActiveObject::testVoidImpl),
- testVoidInOut(this, &ActiveObject::testVoidInOutImpl),
- testVoidIn(this, &ActiveObject::testVoidInImpl)
- {
- }
-
- ~ActiveObject()
- {
- }
-
- ActiveMethod<int, int, ActiveObject, ActiveStarter<ActiveDispatcher> > testMethod;
-
- ActiveMethod<void, int, ActiveObject, ActiveStarter<ActiveDispatcher> > testVoid;
-
- ActiveMethod<void, void, ActiveObject, ActiveStarter<ActiveDispatcher> > testVoidInOut;
-
- ActiveMethod<int, void, ActiveObject, ActiveStarter<ActiveDispatcher> > testVoidIn;
-
- void cont()
- {
- _continue.set();
- }
-
- protected:
- int testMethodImpl(const int& n)
- {
- if (n == 100) throw Exception("n == 100");
- _continue.wait();
- return n;
- }
-
- void testVoidImpl(const int& n)
- {
- if (n == 100) throw Exception("n == 100");
- _continue.wait();
- }
-
- void testVoidInOutImpl()
- {
- _continue.wait();
- }
-
- int testVoidInImpl()
- {
- _continue.wait();
- return 123;
- }
-
- private:
- Event _continue;
- };
-}
-
-
-ActiveDispatcherTest::ActiveDispatcherTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ActiveDispatcherTest::~ActiveDispatcherTest()
-{
-}
-
-
-void ActiveDispatcherTest::testWait()
-{
- ActiveObject activeObj;
- ActiveResult<int> result = activeObj.testMethod(123);
- assert (!result.available());
- activeObj.cont();
- result.wait();
- assert (result.available());
- assert (result.data() == 123);
- assert (!result.failed());
-}
-
-
-void ActiveDispatcherTest::testWaitInterval()
-{
- ActiveObject activeObj;
- ActiveResult<int> result = activeObj.testMethod(123);
- assert (!result.available());
- try
- {
- result.wait(100);
- fail("wait must fail");
- }
- catch (Exception&)
- {
- }
- activeObj.cont();
- result.wait(10000);
- assert (result.available());
- assert (result.data() == 123);
- assert (!result.failed());
-}
-
-
-void ActiveDispatcherTest::testTryWait()
-{
- ActiveObject activeObj;
- ActiveResult<int> result = activeObj.testMethod(123);
- assert (!result.available());
- assert (!result.tryWait(200));
- activeObj.cont();
- assert (result.tryWait(10000));
- assert (result.available());
- assert (result.data() == 123);
- assert (!result.failed());
-}
-
-
-void ActiveDispatcherTest::testFailure()
-{
- ActiveObject activeObj;
- ActiveResult<int> result = activeObj.testMethod(100);
- result.wait();
- assert (result.available());
- assert (result.failed());
- std::string msg = result.error();
- assert (msg == "n == 100");
-}
-
-
-void ActiveDispatcherTest::testVoid()
-{
- ActiveObject activeObj;
- ActiveResult<void> result = activeObj.testVoid(123);
- assert (!result.available());
- activeObj.cont();
- result.wait();
- assert (result.available());
- assert (!result.failed());
-}
-
-
-void ActiveDispatcherTest::testVoidInOut()
-{
- ActiveObject activeObj;
- ActiveResult<void> result = activeObj.testVoidInOut();
- assert (!result.available());
- activeObj.cont();
- result.wait();
- assert (result.available());
- assert (!result.failed());
-}
-
-
-void ActiveDispatcherTest::testVoidIn()
-{
- ActiveObject activeObj;
- ActiveResult<int> result = activeObj.testVoidIn();
- assert (!result.available());
- activeObj.cont();
- result.wait();
- assert (result.available());
- assert (!result.failed());
- assert (result.data() == 123);
-}
-
-
-void ActiveDispatcherTest::setUp()
-{
-}
-
-
-void ActiveDispatcherTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ActiveDispatcherTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ActiveDispatcherTest");
-
- CppUnit_addTest(pSuite, ActiveDispatcherTest, testWait);
- CppUnit_addTest(pSuite, ActiveDispatcherTest, testWaitInterval);
- CppUnit_addTest(pSuite, ActiveDispatcherTest, testTryWait);
- CppUnit_addTest(pSuite, ActiveDispatcherTest, testFailure);
- CppUnit_addTest(pSuite, ActiveDispatcherTest, testVoid);
- CppUnit_addTest(pSuite, ActiveDispatcherTest, testVoidIn);
- CppUnit_addTest(pSuite, ActiveDispatcherTest, testVoidInOut);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ActiveDispatcherTest.h b/Utilities/Poco/Foundation/testsuite/src/ActiveDispatcherTest.h
deleted file mode 100755
index 46bba2e7d6..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ActiveDispatcherTest.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// ActiveDispatcherTest.h
-//
-// $Id$
-//
-// Definition of the ActiveDispatcherTest class.
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Redistributions in any form must be accompanied by information on
-// how to obtain complete source code for this software and any
-// accompanying software that uses this software. The source code
-// must either be included in the distribution or be available for no
-// more than the cost of distribution plus a nominal fee, and must be
-// freely redistributable under reasonable conditions. For an
-// executable file, complete source code means the source code for all
-// modules it contains. It does not include source code for modules or
-// files that typically accompany the major components of the operating
-// system on which the executable file runs.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#ifndef ActiveDispatcherTest_INCLUDED
-#define ActiveDispatcherTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ActiveDispatcherTest: public CppUnit::TestCase
-{
-public:
- ActiveDispatcherTest(const std::string& name);
- ~ActiveDispatcherTest();
-
- void testWait();
- void testWaitInterval();
- void testTryWait();
- void testFailure();
- void testVoid();
- void testVoidIn();
- void testVoidInOut();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ActiveDispatcherTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ActiveMethodTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ActiveMethodTest.cpp
deleted file mode 100755
index 8ade5bf82b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ActiveMethodTest.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-//
-// ActiveMethodTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ActiveMethodTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/ActiveMethod.h"
-#include "Poco/Thread.h"
-#include "Poco/Event.h"
-#include "Poco/Exception.h"
-
-
-using Poco::ActiveMethod;
-using Poco::ActiveResult;
-using Poco::Thread;
-using Poco::Event;
-using Poco::Exception;
-
-
-namespace
-{
- class ActiveObject
- {
- public:
- typedef ActiveMethod<int, int, ActiveObject> IntIntType;
- typedef ActiveMethod<void, int, ActiveObject> VoidIntType;
- typedef ActiveMethod<void, void, ActiveObject> VoidVoidType;
- typedef ActiveMethod<int, void, ActiveObject> IntVoidType;
-
- ActiveObject():
- testMethod(this, &ActiveObject::testMethodImpl),
- testVoid(this,&ActiveObject::testVoidOutImpl),
- testVoidInOut(this,&ActiveObject::testVoidInOutImpl),
- testVoidIn(this,&ActiveObject::testVoidInImpl)
- {
- }
-
- ~ActiveObject()
- {
- }
-
- IntIntType testMethod;
-
- VoidIntType testVoid;
-
- VoidVoidType testVoidInOut;
-
- IntVoidType testVoidIn;
-
- void cont()
- {
- _continue.set();
- }
-
- protected:
- int testMethodImpl(const int& n)
- {
- if (n == 100) throw Exception("n == 100");
- _continue.wait();
- return n;
- }
-
- void testVoidOutImpl(const int& n)
- {
- if (n == 100) throw Exception("n == 100");
- _continue.wait();
- }
-
- void testVoidInOutImpl()
- {
- _continue.wait();
- }
-
- int testVoidInImpl()
- {
- _continue.wait();
- return 123;
- }
-
- private:
- Event _continue;
- };
-}
-
-
-ActiveMethodTest::ActiveMethodTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ActiveMethodTest::~ActiveMethodTest()
-{
-}
-
-
-void ActiveMethodTest::testWait()
-{
- ActiveObject activeObj;
- ActiveResult<int> result = activeObj.testMethod(123);
- assert (!result.available());
- activeObj.cont();
- result.wait();
- assert (result.available());
- assert (result.data() == 123);
- assert (!result.failed());
-}
-
-
-void ActiveMethodTest::testCopy()
-{
- ActiveObject activeObj;
-
- ActiveObject::IntIntType ii = activeObj.testMethod;
- ActiveResult<int> rii = ii(123);
- assert (!rii.available());
- activeObj.cont();
- rii.wait();
- assert (rii.available());
- assert (rii.data() == 123);
- assert (!rii.failed());
-
- ActiveObject::VoidIntType vi = activeObj.testVoid;
- ActiveResult<void> rvi = vi(123);
- assert (!rvi.available());
- activeObj.cont();
- rvi.wait();
- assert (rvi.available());
- assert (!rvi.failed());
-
- ActiveObject::VoidVoidType vv = activeObj.testVoidInOut;
- ActiveResult<void> rvv = vv();
- assert (!rvv.available());
- activeObj.cont();
- rvv.wait();
- assert (rvv.available());
- assert (!rvv.failed());
-
- ActiveObject::IntVoidType iv = activeObj.testVoidIn;
- ActiveResult<int> riv = iv();
- assert (!riv.available());
- activeObj.cont();
- riv.wait();
- assert (riv.available());
- assert (riv.data() == 123);
- assert (!riv.failed());
-}
-
-
-void ActiveMethodTest::testWaitInterval()
-{
- ActiveObject activeObj;
- ActiveResult<int> result = activeObj.testMethod(123);
- assert (!result.available());
- try
- {
- result.wait(100);
- fail("wait must fail");
- }
- catch (Exception&)
- {
- }
- activeObj.cont();
- result.wait(10000);
- assert (result.available());
- assert (result.data() == 123);
- assert (!result.failed());
-}
-
-
-void ActiveMethodTest::testTryWait()
-{
- ActiveObject activeObj;
- ActiveResult<int> result = activeObj.testMethod(123);
- assert (!result.available());
- assert (!result.tryWait(200));
- activeObj.cont();
- assert (result.tryWait(10000));
- assert (result.available());
- assert (result.data() == 123);
- assert (!result.failed());
-}
-
-
-void ActiveMethodTest::testFailure()
-{
- ActiveObject activeObj;
- ActiveResult<int> result = activeObj.testMethod(100);
- result.wait();
- assert (result.available());
- assert (result.failed());
- std::string msg = result.error();
- assert (msg == "n == 100");
-}
-
-
-void ActiveMethodTest::testVoidOut()
-{
- ActiveObject activeObj;
- ActiveResult<void> result = activeObj.testVoid(101);
- activeObj.cont();
- result.wait();
- assert (result.available());
- assert (!result.failed());
-}
-
-
-void ActiveMethodTest::testVoidInOut()
-{
- ActiveObject activeObj;
- ActiveResult<void> result = activeObj.testVoidInOut();
- activeObj.cont();
- result.wait();
- assert (result.available());
- assert (!result.failed());
-}
-
-
-void ActiveMethodTest::testVoidIn()
-{
- ActiveObject activeObj;
- ActiveResult<int> result = activeObj.testVoidIn();
- activeObj.cont();
- result.wait();
- assert (result.available());
- assert (!result.failed());
- assert (result.data() == 123);
-}
-
-
-void ActiveMethodTest::setUp()
-{
-}
-
-
-void ActiveMethodTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ActiveMethodTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ActiveMethodTest");
-
- CppUnit_addTest(pSuite, ActiveMethodTest, testWait);
- CppUnit_addTest(pSuite, ActiveMethodTest, testCopy);
- CppUnit_addTest(pSuite, ActiveMethodTest, testWaitInterval);
- CppUnit_addTest(pSuite, ActiveMethodTest, testTryWait);
- CppUnit_addTest(pSuite, ActiveMethodTest, testFailure);
- CppUnit_addTest(pSuite, ActiveMethodTest, testVoidOut);
- CppUnit_addTest(pSuite, ActiveMethodTest, testVoidIn);
- CppUnit_addTest(pSuite, ActiveMethodTest, testVoidInOut);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ActiveMethodTest.h b/Utilities/Poco/Foundation/testsuite/src/ActiveMethodTest.h
deleted file mode 100755
index 1010189e19..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ActiveMethodTest.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// ActiveMethodTest.h
-//
-// $Id$
-//
-// Definition of the ActiveMethodTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ActiveMethodTest_INCLUDED
-#define ActiveMethodTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ActiveMethodTest: public CppUnit::TestCase
-{
-public:
- ActiveMethodTest(const std::string& name);
- ~ActiveMethodTest();
-
- void testWait();
- void testCopy();
- void testWaitInterval();
- void testTryWait();
- void testFailure();
- void testVoidOut();
- void testVoidInOut();
- void testVoidIn();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ActiveMethodTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ActivityTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ActivityTest.cpp
deleted file mode 100755
index b8c0d5a99e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ActivityTest.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// ActivityTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ActivityTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Activity.h"
-#include "Poco/Thread.h"
-
-
-using Poco::Activity;
-using Poco::Thread;
-
-
-namespace
-{
- class ActiveObject
- {
- public:
- ActiveObject():
- _activity(this, &ActiveObject::run),
- _count(0)
- {
- }
-
- ~ActiveObject()
- {
- }
-
- Activity<ActiveObject>& activity()
- {
- return _activity;
- }
-
- int count() const
- {
- return _count;
- }
-
- protected:
- void run()
- {
- while (!_activity.isStopped())
- ++_count;
- }
-
- private:
- Activity<ActiveObject> _activity;
- int _count;
- };
-}
-
-
-ActivityTest::ActivityTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ActivityTest::~ActivityTest()
-{
-}
-
-
-void ActivityTest::testActivity()
-{
- ActiveObject activeObj;
- assert (activeObj.activity().isStopped());
- activeObj.activity().start();
- assert (!activeObj.activity().isStopped());
- Thread::sleep(1000);
- assert (activeObj.activity().isRunning());
- activeObj.activity().stop();
- activeObj.activity().wait();
- assert (activeObj.count() > 0);
-}
-
-
-void ActivityTest::setUp()
-{
-}
-
-
-void ActivityTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ActivityTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ActivityTest");
-
- CppUnit_addTest(pSuite, ActivityTest, testActivity);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ActivityTest.h b/Utilities/Poco/Foundation/testsuite/src/ActivityTest.h
deleted file mode 100755
index b1dcbc2c1b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ActivityTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// ActivityTest.h
-//
-// $Id$
-//
-// Definition of the ActivityTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ActivityTest_INCLUDED
-#define ActivityTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ActivityTest: public CppUnit::TestCase
-{
-public:
- ActivityTest(const std::string& name);
- ~ActivityTest();
-
- void testActivity();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ActivityTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/AnyTest.cpp b/Utilities/Poco/Foundation/testsuite/src/AnyTest.cpp
deleted file mode 100755
index d4f85c4d55..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/AnyTest.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-// AnyTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "AnyTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Exception.h"
-#include "Poco/Any.h"
-#include "Poco/Bugcheck.h"
-#include <vector>
-
-
-using namespace Poco;
-
-
-class SomeClass
-{
-public:
- int i;
- std::string str;
- SomeClass(int h, std::string s): i (h), str(s)
- {
- };
- bool operator==(const SomeClass& other) const
- {
- return i == other.i && str == other.str;
- }
-};
-
-
-AnyTest::AnyTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-AnyTest::~AnyTest()
-{
-}
-
-
-void AnyTest::testInt()
-{
- Any a = 13;
- assert (a.type() == typeid(int));
- int* i = AnyCast<int>(&a);
- assert (*i == 13);
- Any b = a;
- assert (b.type() == typeid(int));
- int *cpyI = AnyCast<int>(&b);
- assert (*cpyI == *i);
- *cpyI = 20;
- assert (*cpyI != *i);
- std::string* s = AnyCast<std::string>(&a);
- assert (s == NULL);
-
- int tmp = AnyCast<int>(a);
- const Any c = a;
- tmp = AnyCast<int>(a);
-}
-
-
-void AnyTest::testComplexType()
-{
- SomeClass str(13,std::string("hello"));
- Any a = str;
- Any b = a;
- assert (a.type() == typeid(SomeClass));
- assert (b.type() == typeid(SomeClass));
- SomeClass str2 = AnyCast<SomeClass>(a);
- assert (str == str2);
- const SomeClass& strCRef = RefAnyCast<SomeClass>(a);
- assert (str == strCRef);
- SomeClass& strRef = RefAnyCast<SomeClass>(a);
- assert (str == strRef);
-}
-
-
-void AnyTest::testVector()
-{
- std::vector<int> tmp;
- tmp.push_back(1);
- tmp.push_back(2);
- tmp.push_back(3);
- Any a = tmp;
- assert (a.type() == typeid(std::vector<int>));
- std::vector<int>tmp2 = AnyCast<std::vector<int> >(a);
- const std::vector<int >& vecCRef = RefAnyCast<std::vector<int> >(a);
- std::vector<int >& vecRef = RefAnyCast<std::vector<int> >(a);
- vecRef[0] = 0;
- assert (vecRef[0] == vecCRef[0]);
-}
-
-
-void AnyTest::setUp()
-{
-}
-
-
-void AnyTest::tearDown()
-{
-}
-
-
-CppUnit::Test* AnyTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("AnyTest");
-
- CppUnit_addTest(pSuite, AnyTest, testInt);
- CppUnit_addTest(pSuite, AnyTest, testComplexType);
- CppUnit_addTest(pSuite, AnyTest, testVector);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/AnyTest.h b/Utilities/Poco/Foundation/testsuite/src/AnyTest.h
deleted file mode 100755
index 42406da62e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/AnyTest.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// AnyTest.h
-//
-// $Id$
-//
-// Tests for Any types
-//
-// Copyright (c) 2006, 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.
-//
-
-#ifndef AnyTest_INCLUDED
-#define AnyTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class AnyTest: public CppUnit::TestCase
-{
-public:
- AnyTest(const std::string& name);
- ~AnyTest();
-
- void testInt();
- void testComplexType();
- void testVector();
-
- void setUp();
- void tearDown();
- static CppUnit::Test* suite();
-};
-
-
-#endif // AnyTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/AutoPtrTest.cpp b/Utilities/Poco/Foundation/testsuite/src/AutoPtrTest.cpp
deleted file mode 100755
index be4c4756f8..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/AutoPtrTest.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-// AutoPtrTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "AutoPtrTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-
-
-using Poco::AutoPtr;
-using Poco::NullPointerException;
-
-
-namespace
-{
- class TestObj
- {
- public:
- TestObj(): _rc(1)
- {
- ++_count;
- }
-
- void duplicate()
- {
- ++_rc;
- }
-
- void release()
- {
- if (--_rc == 0)
- delete this;
- }
-
- int rc() const
- {
- return _rc;
- }
-
- static int count()
- {
- return _count;
- }
-
- protected:
- ~TestObj()
- {
- --_count;
- }
-
- private:
- int _rc;
- static int _count;
- };
-
- int TestObj::_count = 0;
-}
-
-
-AutoPtrTest::AutoPtrTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-AutoPtrTest::~AutoPtrTest()
-{
-}
-
-
-void AutoPtrTest::testAutoPtr()
-{
- {
- AutoPtr<TestObj> ptr = new TestObj;
- assert (ptr->rc() == 1);
- AutoPtr<TestObj> ptr2 = ptr;
- assert (ptr->rc() == 2);
- ptr2 = new TestObj;
- assert (ptr->rc() == 1);
- AutoPtr<TestObj> ptr3;
- ptr3 = ptr2;
- assert (ptr2->rc() == 2);
- ptr3 = new TestObj;
- assert (ptr2->rc() == 1);
- ptr3 = ptr2;
- assert (ptr2->rc() == 2);
- assert (TestObj::count() > 0);
- }
- assert (TestObj::count() == 0);
-}
-
-
-void AutoPtrTest::testOps()
-{
- AutoPtr<TestObj> ptr1;
- assertNull(ptr1.get());
- TestObj* pTO1 = new TestObj;
- TestObj* pTO2 = new TestObj;
- if (pTO2 < pTO1)
- {
- TestObj* pTmp = pTO1;
- pTO1 = pTO2;
- pTO2 = pTmp;
- }
- assert (pTO1 < pTO2);
- ptr1 = pTO1;
- AutoPtr<TestObj> ptr2 = pTO2;
- AutoPtr<TestObj> ptr3 = ptr1;
- AutoPtr<TestObj> ptr4;
- assert (ptr1.get() == pTO1);
- assert (ptr1 == pTO1);
- assert (ptr2.get() == pTO2);
- assert (ptr2 == pTO2);
- assert (ptr3.get() == pTO1);
- assert (ptr3 == pTO1);
-
- assert (ptr1 == pTO1);
- assert (ptr1 != pTO2);
- assert (ptr1 < pTO2);
- assert (ptr1 <= pTO2);
- assert (ptr2 > pTO1);
- assert (ptr2 >= pTO1);
-
- assert (ptr1 == ptr3);
- assert (ptr1 != ptr2);
- assert (ptr1 < ptr2);
- assert (ptr1 <= ptr2);
- assert (ptr2 > ptr1);
- assert (ptr2 >= ptr1);
-
- ptr1 = pTO1;
- ptr2 = pTO2;
- ptr1.swap(ptr2);
- assert (ptr2.get() == pTO1);
- assert (ptr1.get() == pTO2);
-
- try
- {
- assert (ptr4->rc() > 0);
- fail ("must throw NullPointerException");
- }
- catch (NullPointerException&)
- {
- }
-
- assert (!(ptr4 == ptr1));
- assert (!(ptr4 == ptr2));
- assert (ptr4 != ptr1);
- assert (ptr4 != ptr2);
-
- ptr4 = ptr2;
- assert (ptr4 == ptr2);
- assert (!(ptr4 != ptr2));
-
- assert (!(!ptr1));
- ptr1 = 0;
- assert (!ptr1);
-}
-
-
-void AutoPtrTest::setUp()
-{
-}
-
-
-void AutoPtrTest::tearDown()
-{
-}
-
-
-CppUnit::Test* AutoPtrTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("AutoPtrTest");
-
- CppUnit_addTest(pSuite, AutoPtrTest, testAutoPtr);
- CppUnit_addTest(pSuite, AutoPtrTest, testOps);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/AutoPtrTest.h b/Utilities/Poco/Foundation/testsuite/src/AutoPtrTest.h
deleted file mode 100755
index cc6453cc5a..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/AutoPtrTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// AutoPtrTest.h
-//
-// $Id$
-//
-// Definition of the AutoPtrTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef AutoPtrTest_INCLUDED
-#define AutoPtrTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class AutoPtrTest: public CppUnit::TestCase
-{
-public:
- AutoPtrTest(const std::string& name);
- ~AutoPtrTest();
-
- void testAutoPtr();
- void testOps();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // AutoPtrTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/AutoReleasePoolTest.cpp b/Utilities/Poco/Foundation/testsuite/src/AutoReleasePoolTest.cpp
deleted file mode 100755
index 695c559b84..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/AutoReleasePoolTest.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// AutoReleasePoolTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "AutoReleasePoolTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/AutoReleasePool.h"
-
-
-using Poco::AutoReleasePool;
-
-
-namespace
-{
- class TestObj
- {
- public:
- TestObj(): _rc(1)
- {
- ++_count;
- }
-
- void duplicate()
- {
- ++_rc;
- }
-
- void release()
- {
- if (--_rc == 0)
- delete this;
- }
-
- int rc() const
- {
- return _rc;
- }
-
- static int count()
- {
- return _count;
- }
-
- protected:
- ~TestObj()
- {
- --_count;
- }
-
- private:
- int _rc;
- static int _count;
- };
-
- int TestObj::_count = 0;
-}
-
-
-AutoReleasePoolTest::AutoReleasePoolTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-AutoReleasePoolTest::~AutoReleasePoolTest()
-{
-}
-
-
-void AutoReleasePoolTest::testAutoReleasePool()
-{
- AutoReleasePool<TestObj> arp;
- arp.add(new TestObj);
- arp.add(new TestObj);
- assert (TestObj::count() == 2);
- arp.release();
- assert (TestObj::count() == 0);
-}
-
-
-void AutoReleasePoolTest::setUp()
-{
-}
-
-
-void AutoReleasePoolTest::tearDown()
-{
-}
-
-
-CppUnit::Test* AutoReleasePoolTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("AutoReleasePoolTest");
-
- CppUnit_addTest(pSuite, AutoReleasePoolTest, testAutoReleasePool);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/AutoReleasePoolTest.h b/Utilities/Poco/Foundation/testsuite/src/AutoReleasePoolTest.h
deleted file mode 100755
index 800b80ef64..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/AutoReleasePoolTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// AutoReleasePoolTest.h
-//
-// $Id$
-//
-// Definition of the AutoReleasePoolTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef AutoReleasePoolTest_INCLUDED
-#define AutoReleasePoolTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class AutoReleasePoolTest: public CppUnit::TestCase
-{
-public:
- AutoReleasePoolTest(const std::string& name);
- ~AutoReleasePoolTest();
-
- void testAutoReleasePool();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // AutoReleasePoolTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/Base64Test.cpp b/Utilities/Poco/Foundation/testsuite/src/Base64Test.cpp
deleted file mode 100755
index 6de317dd85..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/Base64Test.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-//
-// Base64Test.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "Base64Test.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Base64Encoder.h"
-#include "Poco/Base64Decoder.h"
-#include "Poco/Exception.h"
-#include <sstream>
-
-
-using Poco::Base64Encoder;
-using Poco::Base64Decoder;
-using Poco::DataFormatException;
-
-
-Base64Test::Base64Test(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-Base64Test::~Base64Test()
-{
-}
-
-
-void Base64Test::testEncoder()
-{
- {
- std::ostringstream str;
- Base64Encoder encoder(str);
- encoder << std::string("\00\01\02\03\04\05", 6);
- encoder.close();
- assert (str.str() == "AAECAwQF");
- }
- {
- std::ostringstream str;
- Base64Encoder encoder(str);
- encoder << std::string("\00\01\02\03", 4);
- encoder.close();
- assert (str.str() == "AAECAw==");
- }
- {
- std::ostringstream str;
- Base64Encoder encoder(str);
- encoder << "ABCDEF";
- encoder.close();
- assert (str.str() == "QUJDREVG");
- }
-}
-
-
-void Base64Test::testDecoder()
-{
- {
- std::istringstream istr("AAECAwQF");
- Base64Decoder decoder(istr);
- assert (decoder.good() && decoder.get() == 0);
- assert (decoder.good() && decoder.get() == 1);
- assert (decoder.good() && decoder.get() == 2);
- assert (decoder.good() && decoder.get() == 3);
- assert (decoder.good() && decoder.get() == 4);
- assert (decoder.good() && decoder.get() == 5);
- assert (decoder.good() && decoder.get() == -1);
- }
- {
- std::istringstream istr("AAECAwQ=");
- Base64Decoder decoder(istr);
- assert (decoder.good() && decoder.get() == 0);
- assert (decoder.good() && decoder.get() == 1);
- assert (decoder.good() && decoder.get() == 2);
- assert (decoder.good() && decoder.get() == 3);
- assert (decoder.good() && decoder.get() == 4);
- assert (decoder.good() && decoder.get() == -1);
- }
- {
- std::istringstream istr("AAECAw==");
- Base64Decoder decoder(istr);
- assert (decoder.good() && decoder.get() == 0);
- assert (decoder.good() && decoder.get() == 1);
- assert (decoder.good() && decoder.get() == 2);
- assert (decoder.good() && decoder.get() == 3);
- assert (decoder.good() && decoder.get() == -1);
- }
- {
- std::istringstream istr("QUJDREVG");
- Base64Decoder decoder(istr);
- std::string s;
- decoder >> s;
- assert (s == "ABCDEF");
- assert (decoder.eof());
- assert (!decoder.fail());
- }
- {
- std::istringstream istr("QUJ\r\nDRE\r\nVG");
- Base64Decoder decoder(istr);
- std::string s;
- decoder >> s;
- assert (s == "ABCDEF");
- assert (decoder.eof());
- assert (!decoder.fail());
- }
- {
- std::istringstream istr("QUJD#REVG");
- Base64Decoder decoder(istr);
- std::string s;
- try
- {
- decoder >> s;
- assert (decoder.bad());
- }
- catch (DataFormatException&)
- {
- }
- assert (!decoder.eof());
- }
-}
-
-
-void Base64Test::testEncodeDecode()
-{
- {
- std::stringstream str;
- Base64Encoder encoder(str);
- encoder << "The quick brown fox ";
- encoder << "jumped over the lazy dog.";
- encoder.close();
- Base64Decoder decoder(str);
- std::string s;
- int c = decoder.get();
- while (c != -1) { s += char(c); c = decoder.get(); }
- assert (s == "The quick brown fox jumped over the lazy dog.");
- }
- {
- std::string src;
- for (int i = 0; i < 255; ++i) src += char(i);
- std::stringstream str;
- Base64Encoder encoder(str);
- encoder.write(src.data(), (std::streamsize) src.size());
- encoder.close();
- Base64Decoder decoder(str);
- std::string s;
- int c = decoder.get();
- while (c != -1) { s += char(c); c = decoder.get(); }
- assert (s == src);
- }
-}
-
-
-void Base64Test::setUp()
-{
-}
-
-
-void Base64Test::tearDown()
-{
-}
-
-
-CppUnit::Test* Base64Test::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("Base64Test");
-
- CppUnit_addTest(pSuite, Base64Test, testEncoder);
- CppUnit_addTest(pSuite, Base64Test, testDecoder);
- CppUnit_addTest(pSuite, Base64Test, testEncodeDecode);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/Base64Test.h b/Utilities/Poco/Foundation/testsuite/src/Base64Test.h
deleted file mode 100755
index f10e8b5933..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/Base64Test.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// Base64Test.h
-//
-// $Id$
-//
-// Definition of the Base64Test class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Base64Test_INCLUDED
-#define Base64Test_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class Base64Test: public CppUnit::TestCase
-{
-public:
- Base64Test(const std::string& name);
- ~Base64Test();
-
- void testEncoder();
- void testDecoder();
- void testEncodeDecode();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // Base64Test_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/BasicEventTest.cpp b/Utilities/Poco/Foundation/testsuite/src/BasicEventTest.cpp
deleted file mode 100755
index 75efe79947..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/BasicEventTest.cpp
+++ /dev/null
@@ -1,410 +0,0 @@
-//
-// BasicEventTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "BasicEventTest.h"
-#include "DummyDelegate.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Expire.h"
-#include "Poco/Delegate.h"
-#include "Poco/FunctionDelegate.h"
-#include "Poco/Thread.h"
-#include "Poco/Exception.h"
-
-
-using namespace Poco;
-
-
-#define LARGEINC 100
-
-
-BasicEventTest::BasicEventTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-BasicEventTest::~BasicEventTest()
-{
-}
-
-void BasicEventTest::testNoDelegate()
-{
- int tmp = 0;
- EventArgs args;
-
- assert (_count == 0);
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- Simple += delegate(this, &BasicEventTest::onSimple);
- Simple -= delegate(this, &BasicEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- Simple += delegate(this, &BasicEventTest::onSimpleNoSender);
- Simple -= delegate(this, &BasicEventTest::onSimpleNoSender);
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- ConstSimple += delegate(this, &BasicEventTest::onConstSimple);
- ConstSimple -= delegate(this, &BasicEventTest::onConstSimple);
- ConstSimple.notify(this, tmp);
- assert (_count == 0);
-
- //Note: passing &args will not work due to &
- EventArgs* pArgs = &args;
- Complex += delegate(this, &BasicEventTest::onComplex);
- Complex -= delegate(this, &BasicEventTest::onComplex);
- Complex.notify(this, pArgs);
- assert (_count == 0);
-
- Complex2 += delegate(this, &BasicEventTest::onComplex2);
- Complex2 -= delegate(this, &BasicEventTest::onComplex2);
- Complex2.notify(this, args);
- assert (_count == 0);
-
- const EventArgs* pCArgs = &args;
- ConstComplex += delegate(this, &BasicEventTest::onConstComplex);
- ConstComplex -= delegate(this, &BasicEventTest::onConstComplex);
- ConstComplex.notify(this, pCArgs);
- assert (_count == 0);
-
- Const2Complex += delegate(this, &BasicEventTest::onConst2Complex);
- Const2Complex -= delegate(this, &BasicEventTest::onConst2Complex);
- Const2Complex.notify(this, pArgs);
- assert (_count == 0);
-
- Simple += delegate(&BasicEventTest::onStaticSimple);
- Simple += delegate(&BasicEventTest::onStaticSimple);
- Simple += delegate(&BasicEventTest::onStaticSimple2);
- Simple += delegate(&BasicEventTest::onStaticSimple3);
-
- Simple.notify(this, tmp);
- assert (_count == 2);
- Simple -= delegate(BasicEventTest::onStaticSimple);
-}
-
-void BasicEventTest::testSingleDelegate()
-{
- int tmp = 0;
- EventArgs args;
-
- assert (_count == 0);
-
- Simple += delegate(this, &BasicEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- ConstSimple += delegate(this, &BasicEventTest::onConstSimple);
- ConstSimple.notify(this, tmp);
- assert (_count == 2);
-
- EventArgs* pArgs = &args;
- Complex += delegate(this, &BasicEventTest::onComplex);
- Complex.notify(this, pArgs);
- assert (_count == 3);
-
- Complex2 += delegate(this, &BasicEventTest::onComplex2);
- Complex2.notify(this, args);
- assert (_count == 4);
-
- const EventArgs* pCArgs = &args;
- ConstComplex += delegate(this, &BasicEventTest::onConstComplex);
- ConstComplex.notify(this, pCArgs);
- assert (_count == 5);
-
- Const2Complex += delegate(this, &BasicEventTest::onConst2Complex);
- Const2Complex.notify(this, pArgs);
- assert (_count == 6);
- // check if 2nd notify also works
- Const2Complex.notify(this, pArgs);
- assert (_count == 7);
-
-}
-
-void BasicEventTest::testDuplicateRegister()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += delegate(this, &BasicEventTest::onSimple);
- Simple += delegate(this, &BasicEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
- Simple -= delegate(this, &BasicEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
-}
-
-void BasicEventTest::testDuplicateUnregister()
-{
- // duplicate unregister shouldn't give an error,
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple -= delegate(this, &BasicEventTest::onSimple); // should work
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- Simple += delegate(this, &BasicEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- Simple -= delegate(this, &BasicEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- Simple -= delegate(this, &BasicEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
-}
-
-void BasicEventTest::testDisabling()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += delegate(this, &BasicEventTest::onSimple);
- Simple.disable();
- Simple.notify(this, tmp);
- assert (_count == 0);
- Simple.enable();
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- // unregister should also work with disabled event
- Simple.disable();
- Simple -= delegate(this, &BasicEventTest::onSimple);
- Simple.enable();
- Simple.notify(this, tmp);
- assert (_count == 1);
-}
-
-void BasicEventTest::testExpire()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += delegate(this, &BasicEventTest::onSimple, 500);
- Simple.notify(this, tmp);
- assert (_count == 1);
- Poco::Thread::sleep(700);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- Simple += delegate(&BasicEventTest::onStaticSimple, 400);
- Simple += delegate(&BasicEventTest::onStaticSimple, 400);
- Simple += delegate(&BasicEventTest::onStaticSimple2, 400);
- Simple += delegate(&BasicEventTest::onStaticSimple3, 400);
- Simple.notify(this, tmp);
- assert (_count == 3);
- Poco::Thread::sleep(700);
- Simple.notify(this, tmp);
- assert (_count == 3);
-}
-
-void BasicEventTest::testExpireReRegister()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += delegate(this, &BasicEventTest::onSimple, 500);
- Simple.notify(this, tmp);
- assert (_count == 1);
- Poco::Thread::sleep(200);
- Simple.notify(this, tmp);
- assert (_count == 2);
- // renew registration
- Simple += delegate(this, &BasicEventTest::onSimple, 600);
- Poco::Thread::sleep(400);
- Simple.notify(this, tmp);
- assert (_count == 3);
- Poco::Thread::sleep(300);
- Simple.notify(this, tmp);
- assert (_count == 3);
-}
-
-void BasicEventTest::testReturnParams()
-{
- DummyDelegate o1;
- Simple += delegate(&o1, &DummyDelegate::onSimple);
-
- int tmp = 0;
- Simple.notify(this, tmp);
- assert (tmp == 1);
-}
-
-void BasicEventTest::testOverwriteDelegate()
-{
- DummyDelegate o1;
- Simple += delegate(&o1, &DummyDelegate::onSimple2);
- // o1 can only have one entry, thus the next line will replace the entry
- Simple += delegate(&o1, &DummyDelegate::onSimple);
-
- int tmp = 0; // onsimple requires 0 as input
- Simple.notify(this, tmp);
- assert (tmp == 1);
- // now overwrite with onsimple2 with requires as input tmp = 1
- Simple += delegate(&o1, &DummyDelegate::onSimple2, 23000);
- Simple.notify(this, tmp);
- assert (tmp == 2);
-}
-
-void BasicEventTest::testAsyncNotify()
-{
- Poco::BasicEvent<int>* pSimple= new Poco::BasicEvent<int>();
- (*pSimple) += delegate(this, &BasicEventTest::onAsync);
- assert (_count == 0);
- int tmp = 0;
- Poco::ActiveResult<int>retArg = pSimple->notifyAsync(this, tmp);
- delete pSimple; // must work even when the event got deleted!
- pSimple = NULL;
- assert (_count == 0);
- retArg.wait();
- assert (retArg.data() == tmp);
- assert (_count == LARGEINC);
-}
-
-
-void BasicEventTest::onSimpleNoSender(int& i)
-{
- _count++;
-}
-
-
-void BasicEventTest::onSimple(const void* pSender, int& i)
-{
- _count++;
-}
-
-
-void BasicEventTest::onStaticSimple(const void* pSender, int& i)
-{
- BasicEventTest* p = const_cast<BasicEventTest*>(reinterpret_cast<const BasicEventTest*>(pSender));
- p->_count++;
-}
-
-
-void BasicEventTest::onStaticSimple2(void* pSender, int& i)
-{
- BasicEventTest* p = reinterpret_cast<BasicEventTest*>(pSender);
- p->_count++;
-}
-
-
-void BasicEventTest::onStaticSimple3(int& i)
-{
-}
-
-
-void BasicEventTest::onSimpleOther(const void* pSender, int& i)
-{
- _count+=100;
-}
-
-void BasicEventTest::onConstSimple(const void* pSender, const int& i)
-{
- _count++;
-}
-
-void BasicEventTest::onComplex(const void* pSender, Poco::EventArgs* & i)
-{
- _count++;
-}
-
-void BasicEventTest::onComplex2(const void* pSender, Poco::EventArgs & i)
-{
- _count++;
-}
-
-void BasicEventTest::onConstComplex(const void* pSender, const Poco::EventArgs*& i)
-{
- _count++;
-}
-
-void BasicEventTest::onConst2Complex(const void* pSender, const Poco::EventArgs * const & i)
-{
- _count++;
-}
-
-void BasicEventTest::onAsync(const void* pSender, int& i)
-{
- Poco::Thread::sleep(700);
- _count += LARGEINC ;
-}
-
-int BasicEventTest::getCount() const
-{
- return _count;
-}
-
-void BasicEventTest::setUp()
-{
- _count = 0;
- // must clear events, otherwise repeating test executions will fail
- // because tests are only created once, only setup is called before
- // each test run
- Simple.clear();
- ConstSimple.clear();
- Complex.clear();
- Complex2.clear();
- ConstComplex.clear();
- Const2Complex.clear();
-}
-
-
-void BasicEventTest::tearDown()
-{
-}
-
-
-CppUnit::Test* BasicEventTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("BasicEventTest");
-
- CppUnit_addTest(pSuite, BasicEventTest, testNoDelegate);
- CppUnit_addTest(pSuite, BasicEventTest, testSingleDelegate);
- CppUnit_addTest(pSuite, BasicEventTest, testReturnParams);
- CppUnit_addTest(pSuite, BasicEventTest, testDuplicateRegister);
- CppUnit_addTest(pSuite, BasicEventTest, testDuplicateUnregister);
- CppUnit_addTest(pSuite, BasicEventTest, testDisabling);
- CppUnit_addTest(pSuite, BasicEventTest, testExpire);
- CppUnit_addTest(pSuite, BasicEventTest, testExpireReRegister);
- CppUnit_addTest(pSuite, BasicEventTest, testOverwriteDelegate);
- CppUnit_addTest(pSuite, BasicEventTest, testAsyncNotify);
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/BasicEventTest.h b/Utilities/Poco/Foundation/testsuite/src/BasicEventTest.h
deleted file mode 100755
index eed666bd5e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/BasicEventTest.h
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// BasicEventTest.h
-//
-// $Id$
-//
-// Tests for BasicEvent
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef BasicEventTest_INCLUDED
-#define BasicEventTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/BasicEvent.h"
-#include "Poco/EventArgs.h"
-
-
-class BasicEventTest: public CppUnit::TestCase
-{
- Poco::BasicEvent<int> Simple;
- Poco::BasicEvent<const int> ConstSimple;
- Poco::BasicEvent<Poco::EventArgs*> Complex;
- Poco::BasicEvent<Poco::EventArgs> Complex2;
- Poco::BasicEvent<const Poco::EventArgs*> ConstComplex;
- Poco::BasicEvent<const Poco::EventArgs * const> Const2Complex;
-public:
- BasicEventTest(const std::string& name);
- ~BasicEventTest();
-
- void testNoDelegate();
- void testSingleDelegate();
- void testDuplicateRegister();
- void testDuplicateUnregister();
- void testDisabling();
- void testExpire();
- void testExpireReRegister();
- void testReturnParams();
- void testOverwriteDelegate();
- void testAsyncNotify();
-
- void setUp();
- void tearDown();
- static CppUnit::Test* suite();
-
-protected:
-
- static void onStaticSimple(const void* pSender, int& i);
- static void onStaticSimple2(void* pSender, int& i);
- static void onStaticSimple3(int& i);
- void onSimpleNoSender(int& i);
- void onSimple(const void* pSender, int& i);
- void onSimpleOther(const void* pSender, int& i);
- void onConstSimple(const void* pSender, const int& i);
- void onComplex(const void* pSender, Poco::EventArgs* & i);
- void onComplex2(const void* pSender, Poco::EventArgs & i);
- void onConstComplex(const void* pSender, const Poco::EventArgs*& i);
- void onConst2Complex(const void* pSender, const Poco::EventArgs * const & i);
- void onAsync(const void* pSender, int& i);
-
- int getCount() const;
-private:
- int _count;
-};
-
-
-#endif // BasicEventTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/BinaryReaderWriterTest.cpp b/Utilities/Poco/Foundation/testsuite/src/BinaryReaderWriterTest.cpp
deleted file mode 100755
index a1de7b306a..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/BinaryReaderWriterTest.cpp
+++ /dev/null
@@ -1,254 +0,0 @@
-//
-// BinaryReaderWriterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "BinaryReaderWriterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/BinaryWriter.h"
-#include "Poco/BinaryReader.h"
-#include <sstream>
-
-
-using Poco::BinaryWriter;
-using Poco::BinaryReader;
-using Poco::Int32;
-using Poco::UInt32;
-using Poco::Int64;
-using Poco::UInt64;
-
-
-BinaryReaderWriterTest::BinaryReaderWriterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-BinaryReaderWriterTest::~BinaryReaderWriterTest()
-{
-}
-
-
-void BinaryReaderWriterTest::testNative()
-{
- std::stringstream sstream;
- BinaryWriter writer(sstream);
- BinaryReader reader(sstream);
- write(writer);
- read(reader);
-}
-
-
-void BinaryReaderWriterTest::testBigEndian()
-{
- std::stringstream sstream;
- BinaryWriter writer(sstream, BinaryWriter::BIG_ENDIAN_BYTE_ORDER);
- BinaryReader reader(sstream, BinaryReader::UNSPECIFIED_BYTE_ORDER);
- assert (writer.byteOrder() == BinaryWriter::BIG_ENDIAN_BYTE_ORDER);
- writer.writeBOM();
- write(writer);
- reader.readBOM();
- assert (reader.byteOrder() == BinaryReader::BIG_ENDIAN_BYTE_ORDER);
- read(reader);
-}
-
-
-void BinaryReaderWriterTest::testLittleEndian()
-{
- std::stringstream sstream;
- BinaryWriter writer(sstream, BinaryWriter::LITTLE_ENDIAN_BYTE_ORDER);
- BinaryReader reader(sstream, BinaryReader::UNSPECIFIED_BYTE_ORDER);
- assert (writer.byteOrder() == BinaryWriter::LITTLE_ENDIAN_BYTE_ORDER);
- writer.writeBOM();
- write(writer);
- reader.readBOM();
- assert (reader.byteOrder() == BinaryReader::LITTLE_ENDIAN_BYTE_ORDER);
- read(reader);
-}
-
-
-void BinaryReaderWriterTest::write(BinaryWriter& writer)
-{
- writer << true;
- writer << false;
- writer << 'a';
- writer << (short) -100;
- writer << (unsigned short) 50000;
- writer << -123456;
- writer << (unsigned) 123456;
- writer << (long) -1234567890;
- writer << (unsigned long) 1234567890;
-
-#if defined(POCO_HAVE_INT64)
- writer << (Int64) -1234567890;
- writer << (UInt64) 1234567890;
-#endif
-
- writer << (float) 1.5;
- writer << (double) -1.5;
-
- writer << "foo";
- writer << "";
-
- writer << std::string("bar");
- writer << std::string();
-
- writer.write7BitEncoded((UInt32) 100);
- writer.write7BitEncoded((UInt32) 1000);
- writer.write7BitEncoded((UInt32) 10000);
- writer.write7BitEncoded((UInt32) 100000);
- writer.write7BitEncoded((UInt32) 1000000);
-
-#if defined(POCO_HAVE_INT64)
- writer.write7BitEncoded((UInt64) 100);
- writer.write7BitEncoded((UInt64) 1000);
- writer.write7BitEncoded((UInt64) 10000);
- writer.write7BitEncoded((UInt64) 100000);
- writer.write7BitEncoded((UInt64) 1000000);
-#endif
-
- writer.writeRaw("RAW");
-}
-
-
-void BinaryReaderWriterTest::read(BinaryReader& reader)
-{
- bool b;
- reader >> b;
- assert (b);
- reader >> b;
- assert (!b);
-
- char c;
- reader >> c;
- assert (c == 'a');
-
- short shortv;
- reader >> shortv;
- assert (shortv == -100);
-
- unsigned short ushortv;
- reader >> ushortv;
- assert (ushortv == 50000);
-
- int intv;
- reader >> intv;
- assert (intv == -123456);
-
- unsigned uintv;
- reader >> uintv;
- assert (uintv == 123456);
-
- long longv;
- reader >> longv;
- assert (longv == -1234567890);
-
- unsigned long ulongv;
- reader >> ulongv;
- assert (ulongv == 1234567890);
-
-#if defined(POCO_HAVE_INT64)
- Int64 int64v;
- reader >> int64v;
- assert (int64v == -1234567890);
-
- UInt64 uint64v;
- reader >> uint64v;
- assert (uint64v == 1234567890);
-#endif
-
- float floatv;
- reader >> floatv;
- assert (floatv == 1.5);
-
- double doublev;
- reader >> doublev;
- assert (doublev == -1.5);
-
- std::string str;
- reader >> str;
- assert (str == "foo");
- reader >> str;
- assert (str == "");
- reader >> str;
- assert (str == "bar");
- reader >> str;
- assert (str == "");
-
- UInt32 uint32v;
- reader.read7BitEncoded(uint32v);
- assert (uint32v == 100);
- reader.read7BitEncoded(uint32v);
- assert (uint32v == 1000);
- reader.read7BitEncoded(uint32v);
- assert (uint32v == 10000);
- reader.read7BitEncoded(uint32v);
- assert (uint32v == 100000);
- reader.read7BitEncoded(uint32v);
- assert (uint32v == 1000000);
-
-#if defined(POCO_HAVE_INT64)
- reader.read7BitEncoded(uint64v);
- assert (uint64v == 100);
- reader.read7BitEncoded(uint64v);
- assert (uint64v == 1000);
- reader.read7BitEncoded(uint64v);
- assert (uint64v == 10000);
- reader.read7BitEncoded(uint64v);
- assert (uint64v == 100000);
- reader.read7BitEncoded(uint64v);
- assert (uint64v == 1000000);
-#endif
-
- reader.readRaw(3, str);
- assert (str == "RAW");
-}
-
-
-void BinaryReaderWriterTest::setUp()
-{
-}
-
-
-void BinaryReaderWriterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* BinaryReaderWriterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("BinaryReaderWriterTest");
-
- CppUnit_addTest(pSuite, BinaryReaderWriterTest, testNative);
- CppUnit_addTest(pSuite, BinaryReaderWriterTest, testBigEndian);
- CppUnit_addTest(pSuite, BinaryReaderWriterTest, testLittleEndian);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/BinaryReaderWriterTest.h b/Utilities/Poco/Foundation/testsuite/src/BinaryReaderWriterTest.h
deleted file mode 100755
index 1e29c2f458..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/BinaryReaderWriterTest.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// BinaryReaderWriterTest.h
-//
-// $Id$
-//
-// Definition of the BinaryReaderWriterTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef BinaryReaderWriterTest_INCLUDED
-#define BinaryReaderWriterTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/BinaryReader.h"
-#include "Poco/BinaryWriter.h"
-
-
-class BinaryReaderWriterTest: public CppUnit::TestCase
-{
-public:
- BinaryReaderWriterTest(const std::string& name);
- ~BinaryReaderWriterTest();
-
- void testNative();
- void testBigEndian();
- void testLittleEndian();
- void write(Poco::BinaryWriter& writer);
- void read(Poco::BinaryReader& reader);
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // BinaryReaderWriterTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ByteOrderTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ByteOrderTest.cpp
deleted file mode 100755
index 9ce4fd26bf..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ByteOrderTest.cpp
+++ /dev/null
@@ -1,633 +0,0 @@
-//
-// ByteOrderTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ByteOrderTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/ByteOrder.h"
-
-
-using Poco::ByteOrder;
-using Poco::Int16;
-using Poco::UInt16;
-using Poco::Int32;
-using Poco::UInt32;
-#if defined(POCO_HAVE_INT64)
-using Poco::Int64;
-using Poco::UInt64;
-#endif
-
-
-ByteOrderTest::ByteOrderTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ByteOrderTest::~ByteOrderTest()
-{
-}
-
-
-void ByteOrderTest::testByteOrderFlip()
-{
- {
- Int16 norm = (Int16) 0xAABB;
- Int16 flip = ByteOrder::flipBytes(norm);
- assert (UInt16(flip) == 0xBBAA);
- flip = ByteOrder::flipBytes(flip);
- assert (flip == norm);
- }
- {
- UInt16 norm = (UInt16) 0xAABB;
- UInt16 flip = ByteOrder::flipBytes(norm);
- assert (flip == 0xBBAA);
- flip = ByteOrder::flipBytes(flip);
- assert (flip == norm);
- }
- {
- Int32 norm = 0xAABBCCDD;
- Int32 flip = ByteOrder::flipBytes(norm);
- assert (UInt32(flip) == 0xDDCCBBAA);
- flip = ByteOrder::flipBytes(flip);
- assert (flip == norm);
- }
- {
- UInt32 norm = 0xAABBCCDD;
- UInt32 flip = ByteOrder::flipBytes(norm);
- assert (flip == 0xDDCCBBAA);
- flip = ByteOrder::flipBytes(flip);
- assert (flip == norm);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = (Int64(0x8899AABB) << 32) + 0xCCDDEEFF;
- Int64 flip = ByteOrder::flipBytes(norm);
- assert (flip == (Int64(0xFFEEDDCC) << 32) + 0xBBAA9988);
- flip = ByteOrder::flipBytes(flip);
- assert (flip == norm);
- }
- {
- UInt64 norm = (UInt64(0x8899AABB) << 32) + 0xCCDDEEFF;
- UInt64 flip = ByteOrder::flipBytes(norm);
- assert (flip == (UInt64(0xFFEEDDCC) << 32) + 0xBBAA9988);
- flip = ByteOrder::flipBytes(flip);
- assert (flip == norm);
- }
- #endif
-}
-
-
-void ByteOrderTest::testByteOrderBigEndian()
-{
-#if defined(POCO_ARCH_BIG_ENDIAN)
- //
- // big-endian systems
- //
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::toBigEndian(norm);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::toBigEndian(norm);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::toBigEndian(norm);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::toBigEndian(norm);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::toBigEndian(norm);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::toBigEndian(norm);
- assert (norm == flip);
- }
- #endif
-
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::fromBigEndian(norm);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::fromBigEndian(norm);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::fromBigEndian(norm);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::fromBigEndian(norm);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::fromBigEndian(norm);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::fromBigEndian(norm);
- assert (norm == flip);
- }
- #endif
-#else
- //
- // little-endian systems
- //
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::toBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::toBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::toBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::toBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::toBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::toBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #endif
-
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::fromBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::fromBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::fromBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::fromBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::fromBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::fromBigEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #endif
-#endif
-}
-
-
-void ByteOrderTest::testByteOrderLittleEndian()
-{
-#if defined(POCO_ARCH_LITTLE_ENDIAN)
- //
- // big-endian systems
- //
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- #endif
-
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::toLittleEndian(norm);
- assert (norm == flip);
- }
- #endif
-#else
- //
- // little-endian systems
- //
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::toLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::toLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::toLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::toLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::toLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::toLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #endif
-
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::fromLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::fromLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::fromLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::fromLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::fromLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::fromLittleEndian(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #endif
-#endif
-}
-
-
-void ByteOrderTest::testByteOrderNetwork()
-{
-#if defined(POCO_ARCH_BIG_ENDIAN)
- //
- // big-endian systems
- //
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::toNetwork(norm);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::toNetwork(norm);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::toNetwork(norm);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::toNetwork(norm);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::toNetwork(norm);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::toNetwork(norm);
- assert (norm == flip);
- }
- #endif
-
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::fromNetwork(norm);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::fromNetwork(norm);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::fromNetwork(norm);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::fromNetwork(norm);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::fromNetwork(norm);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::fromNetwork(norm);
- assert (norm == flip);
- }
- #endif
-#else
- //
- // little-endian systems
- //
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::toNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::toNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::toNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::toNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::toNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::toNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #endif
-
- {
- Int16 norm = 4;
- Int16 flip = ByteOrder::fromNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt16 norm = 4;
- UInt16 flip = ByteOrder::fromNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- Int32 norm = 4;
- Int32 flip = ByteOrder::fromNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt32 norm = 4;
- UInt32 flip = ByteOrder::fromNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #if defined(POCO_HAVE_INT64)
- {
- Int64 norm = 4;
- Int64 flip = ByteOrder::fromNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- {
- UInt64 norm = 4;
- UInt64 flip = ByteOrder::fromNetwork(norm);
- assert (norm != flip);
- flip = ByteOrder::flipBytes(flip);
- assert (norm == flip);
- }
- #endif
-#endif
-}
-
-
-void ByteOrderTest::setUp()
-{
-}
-
-
-void ByteOrderTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ByteOrderTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ByteOrderTest");
-
- CppUnit_addTest(pSuite, ByteOrderTest, testByteOrderFlip);
- CppUnit_addTest(pSuite, ByteOrderTest, testByteOrderBigEndian);
- CppUnit_addTest(pSuite, ByteOrderTest, testByteOrderLittleEndian);
- CppUnit_addTest(pSuite, ByteOrderTest, testByteOrderNetwork);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ByteOrderTest.h b/Utilities/Poco/Foundation/testsuite/src/ByteOrderTest.h
deleted file mode 100755
index dd949c1716..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ByteOrderTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// ByteOrderTest.h
-//
-// $Id$
-//
-// Definition of the ByteOrderTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ByteOrderTest_INCLUDED
-#define ByteOrderTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ByteOrderTest: public CppUnit::TestCase
-{
-public:
- ByteOrderTest(const std::string& name);
- ~ByteOrderTest();
-
- void testByteOrderFlip();
- void testByteOrderBigEndian();
- void testByteOrderLittleEndian();
- void testByteOrderNetwork();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ByteOrderTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/CacheTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/CacheTestSuite.cpp
deleted file mode 100755
index b5d798bd1d..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/CacheTestSuite.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// CacheTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "CacheTestSuite.h"
-#include "LRUCacheTest.h"
-#include "ExpireCacheTest.h"
-#include "ExpireLRUCacheTest.h"
-#include "UniqueExpireCacheTest.h"
-#include "UniqueExpireLRUCacheTest.h"
-
-CppUnit::Test* CacheTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CacheTestSuite");
-
- pSuite->addTest(LRUCacheTest::suite());
- pSuite->addTest(ExpireCacheTest::suite());
- pSuite->addTest(UniqueExpireCacheTest::suite());
- pSuite->addTest(ExpireLRUCacheTest::suite());
- pSuite->addTest(UniqueExpireLRUCacheTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/CacheTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/CacheTestSuite.h
deleted file mode 100755
index 494c25705e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/CacheTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// CacheTestSuite.h
-//
-// $Id$
-//
-// Definition of the CacheTestSuite class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef CacheTestSuite_INCLUDED
-#define CacheTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class CacheTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // CacheTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ChannelTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ChannelTest.cpp
deleted file mode 100755
index 870b005c6e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ChannelTest.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// ChannelTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ChannelTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/SplitterChannel.h"
-#include "Poco/AsyncChannel.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Message.h"
-#include "Poco/Formatter.h"
-#include "Poco/FormattingChannel.h"
-#include "Poco/ConsoleChannel.h"
-#include "Poco/StreamChannel.h"
-#include "TestChannel.h"
-#include <sstream>
-
-
-using Poco::SplitterChannel;
-using Poco::AsyncChannel;
-using Poco::FormattingChannel;
-using Poco::ConsoleChannel;
-using Poco::StreamChannel;
-using Poco::Formatter;
-using Poco::Message;
-using Poco::AutoPtr;
-
-
-class SimpleFormatter: public Formatter
-{
-public:
- void format(const Message& msg, std::string& text)
- {
- text = msg.getSource();
- text.append(": ");
- text.append(msg.getText());
- }
-};
-
-
-ChannelTest::ChannelTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ChannelTest::~ChannelTest()
-{
-}
-
-
-void ChannelTest::testSplitter()
-{
- AutoPtr<TestChannel> pChannel = new TestChannel;
- AutoPtr<SplitterChannel> pSplitter = new SplitterChannel;
- pSplitter->addChannel(pChannel.get());
- pSplitter->addChannel(pChannel.get());
- Message msg;
- pSplitter->log(msg);
- assert (pChannel->list().size() == 2);
-}
-
-
-void ChannelTest::testAsync()
-{
- AutoPtr<TestChannel> pChannel = new TestChannel;
- AutoPtr<AsyncChannel> pAsync = new AsyncChannel(pChannel.get());
- pAsync->open();
- Message msg;
- pAsync->log(msg);
- pAsync->log(msg);
- pAsync->close();
- assert (pChannel->list().size() == 2);
-}
-
-
-void ChannelTest::testFormatting()
-{
- AutoPtr<TestChannel> pChannel = new TestChannel;
- AutoPtr<Formatter> pFormatter = new SimpleFormatter;
- AutoPtr<FormattingChannel> pFormatterChannel = new FormattingChannel(pFormatter, pChannel.get());
- Message msg("Source", "Text", Message::PRIO_INFORMATION);
- pFormatterChannel->log(msg);
- assert (pChannel->list().size() == 1);
- assert (pChannel->list().begin()->getText() == "Source: Text");
-}
-
-
-void ChannelTest::testConsole()
-{
- AutoPtr<ConsoleChannel> pChannel = new ConsoleChannel;
- AutoPtr<Formatter> pFormatter = new SimpleFormatter;
- AutoPtr<FormattingChannel> pFormatterChannel = new FormattingChannel(pFormatter, pChannel.get());
- Message msg("Source", "Text", Message::PRIO_INFORMATION);
- pFormatterChannel->log(msg);
-}
-
-
-void ChannelTest::testStream()
-{
- std::ostringstream str;
- AutoPtr<StreamChannel> pChannel = new StreamChannel(str);
- AutoPtr<Formatter> pFormatter = new SimpleFormatter;
- AutoPtr<FormattingChannel> pFormatterChannel = new FormattingChannel(pFormatter, pChannel.get());
- Message msg("Source", "Text", Message::PRIO_INFORMATION);
- pFormatterChannel->log(msg);
- assert (str.str().find("Source: Text") == 0);
-}
-
-
-void ChannelTest::setUp()
-{
-}
-
-
-void ChannelTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ChannelTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ChannelTest");
-
- CppUnit_addTest(pSuite, ChannelTest, testSplitter);
- CppUnit_addTest(pSuite, ChannelTest, testAsync);
- CppUnit_addTest(pSuite, ChannelTest, testFormatting);
- CppUnit_addTest(pSuite, ChannelTest, testConsole);
- CppUnit_addTest(pSuite, ChannelTest, testStream);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ChannelTest.h b/Utilities/Poco/Foundation/testsuite/src/ChannelTest.h
deleted file mode 100755
index e925d02bc7..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ChannelTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// ChannelTest.h
-//
-// $Id$
-//
-// Definition of the ChannelTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ChannelTest_INCLUDED
-#define ChannelTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ChannelTest: public CppUnit::TestCase
-{
-public:
- ChannelTest(const std::string& name);
- ~ChannelTest();
-
- void testSplitter();
- void testAsync();
- void testFormatting();
- void testConsole();
- void testStream();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ChannelTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ClassLoaderTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ClassLoaderTest.cpp
deleted file mode 100755
index 9ed654559c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ClassLoaderTest.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// ClassLoaderTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ClassLoaderTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/ClassLoader.h"
-#include "Poco/Manifest.h"
-#include "Poco/Exception.h"
-#include "TestPlugin.h"
-
-
-using Poco::ClassLoader;
-using Poco::Manifest;
-using Poco::SharedLibrary;
-using Poco::AbstractMetaObject;
-using Poco::NotFoundException;
-using Poco::InvalidAccessException;
-
-
-ClassLoaderTest::ClassLoaderTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ClassLoaderTest::~ClassLoaderTest()
-{
-}
-
-
-void ClassLoaderTest::testClassLoader1()
-{
- std::string path = "TestLibrary";
- path.append(SharedLibrary::suffix());
-
- ClassLoader<TestPlugin> cl;
-
- assert (cl.begin() == cl.end());
- assertNullPtr (cl.findClass("PluginA"));
- assertNullPtr (cl.findManifest(path));
-
- assert (!cl.isLibraryLoaded(path));
-
- try
- {
- const ClassLoader<TestPlugin>::Meta& meta = cl.classFor("PluginA");
- fail("not found - must throw exception");
- }
- catch (NotFoundException&)
- {
- }
- catch (...)
- {
- failmsg("wrong exception");
- }
-
- try
- {
- const ClassLoader<TestPlugin>::Manif& manif = cl.manifestFor(path);
- fail("not found - must throw exception");
- }
- catch (NotFoundException&)
- {
- }
- catch (...)
- {
- failmsg("wrong exception");
- }
-}
-
-
-void ClassLoaderTest::testClassLoader2()
-{
- std::string path = "TestLibrary";
- path.append(SharedLibrary::suffix());
-
- ClassLoader<TestPlugin> cl;
- cl.loadLibrary(path);
-
- assert (cl.begin() != cl.end());
- assertNotNullPtr (cl.findClass("PluginA"));
- assertNotNullPtr (cl.findClass("PluginB"));
- assertNotNullPtr (cl.findClass("PluginC"));
- assertNotNullPtr (cl.findManifest(path));
-
- assert (cl.isLibraryLoaded(path));
- assert (cl.manifestFor(path).size() == 3);
-
- ClassLoader<TestPlugin>::Iterator it = cl.begin();
- assert (it != cl.end());
- assert (it->first == path);
- assert (it->second->size() == 3);
- ++it;
- assert (it == cl.end());
-
- TestPlugin* pPluginA = cl.classFor("PluginA").create();
- assert (pPluginA->name() == "PluginA");
- assert (!cl.classFor("PluginA").isAutoDelete(pPluginA));
- delete pPluginA;
-
- TestPlugin* pPluginB = cl.classFor("PluginB").create();
- assert (pPluginB->name() == "PluginB");
- delete pPluginB;
-
- pPluginB = cl.create("PluginB");
- assert (pPluginB->name() == "PluginB");
- delete pPluginB;
-
- assert (cl.canCreate("PluginA"));
- assert (cl.canCreate("PluginB"));
- assert (!cl.canCreate("PluginC"));
-
- TestPlugin& pluginC = cl.instance("PluginC");
- assert (pluginC.name() == "PluginC");
-
- try
- {
- TestPlugin& plgB = cl.instance("PluginB");
- fail("not a singleton - must throw");
- }
- catch (InvalidAccessException&)
- {
- }
-
- try
- {
- TestPlugin* pPluginC = cl.create("PluginC");
- fail("cannot create a singleton - must throw");
- }
- catch (InvalidAccessException&)
- {
- }
-
- try
- {
- const AbstractMetaObject<TestPlugin>& meta = cl.classFor("PluginC");
- meta.autoDelete(&(meta.instance()));
- fail("cannot take ownership of a singleton - must throw");
- }
- catch (InvalidAccessException&)
- {
- }
-
- const AbstractMetaObject<TestPlugin>& meta1 = cl.classFor("PluginC");
- assert (meta1.isAutoDelete(&(meta1.instance())));
-
- // the following must not produce memory leaks
- const AbstractMetaObject<TestPlugin>& meta2 = cl.classFor("PluginA");
- meta2.autoDelete(meta2.create());
- meta2.autoDelete(meta2.create());
-
- TestPlugin* pPlugin = meta2.create();
- meta2.autoDelete(pPlugin);
- assert (meta2.isAutoDelete(pPlugin));
- meta2.destroy(pPlugin);
- assert (!meta2.isAutoDelete(pPlugin));
-
- cl.unloadLibrary(path);
-}
-
-
-void ClassLoaderTest::testClassLoader3()
-{
- std::string path = "TestLibrary";
- path.append(SharedLibrary::suffix());
-
- ClassLoader<TestPlugin> cl;
- cl.loadLibrary(path);
- cl.loadLibrary(path);
- cl.unloadLibrary(path);
-
- assert (cl.manifestFor(path).size() == 3);
-
- ClassLoader<TestPlugin>::Iterator it = cl.begin();
- assert (it != cl.end());
- assert (it->first == path);
- assert (it->second->size() == 3);
- ++it;
- assert (it == cl.end());
-
- cl.unloadLibrary(path);
- assertNullPtr (cl.findManifest(path));
-}
-
-
-void ClassLoaderTest::setUp()
-{
-}
-
-
-void ClassLoaderTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ClassLoaderTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ClassLoaderTest");
-
- CppUnit_addTest(pSuite, ClassLoaderTest, testClassLoader1);
- CppUnit_addTest(pSuite, ClassLoaderTest, testClassLoader2);
- CppUnit_addTest(pSuite, ClassLoaderTest, testClassLoader3);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ClassLoaderTest.h b/Utilities/Poco/Foundation/testsuite/src/ClassLoaderTest.h
deleted file mode 100755
index 3bdb17e3e9..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ClassLoaderTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// ClassLoaderTest.h
-//
-// $Id$
-//
-// Definition of the ClassLoaderTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ClassLoaderTest_INCLUDED
-#define ClassLoaderTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ClassLoaderTest: public CppUnit::TestCase
-{
-public:
- ClassLoaderTest(const std::string& name);
- ~ClassLoaderTest();
-
- void testClassLoader1();
- void testClassLoader2();
- void testClassLoader3();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ClassLoaderTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ConditionTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ConditionTest.cpp
deleted file mode 100755
index a53e31dfb5..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ConditionTest.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-//
-// ConditionTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2007, 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 "ConditionTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-#include "Poco/Condition.h"
-#include "Poco/Mutex.h"
-#include "Poco/Exception.h"
-
-
-using Poco::Thread;
-using Poco::Runnable;
-using Poco::Condition;
-using Poco::Mutex;
-using Poco::TimeoutException;
-
-
-namespace
-{
- class WaitRunnable: public Runnable
- {
- public:
- WaitRunnable(Condition& cond, Mutex& mutex):
- _ran(false),
- _cond(cond),
- _mutex(mutex)
- {
- }
-
- void run()
- {
- _mutex.lock();
- _cond.wait(_mutex);
- _mutex.unlock();
- _ran = true;
- }
-
- bool ran() const
- {
- return _ran;
- }
-
- private:
- bool _ran;
- Condition& _cond;
- Mutex& _mutex;
- };
-
- class TryWaitRunnable: public Runnable
- {
- public:
- TryWaitRunnable(Condition& cond, Mutex& mutex):
- _ran(false),
- _cond(cond),
- _mutex(mutex)
- {
- }
-
- void run()
- {
- _mutex.lock();
- if (_cond.tryWait(_mutex, 10000))
- {
- _ran = true;
- }
- _mutex.unlock();
- }
-
- bool ran() const
- {
- return _ran;
- }
-
- private:
- bool _ran;
- Condition& _cond;
- Mutex& _mutex;
- };
-
-}
-
-
-ConditionTest::ConditionTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ConditionTest::~ConditionTest()
-{
-}
-
-
-void ConditionTest::testSignal()
-{
- Condition cond;
- Mutex mtx;
- WaitRunnable r1(cond, mtx);
- WaitRunnable r2(cond, mtx);
-
- Thread t1;
- Thread t2;
-
- t1.start(r1);
- Thread::sleep(200);
- t2.start(r2);
-
- assert (!r1.ran());
- assert (!r2.ran());
-
- cond.signal();
-
- t1.join();
- assert (r1.ran());
-
- assert (!t2.tryJoin(200));
-
- cond.signal();
-
- t2.join();
-
- assert (r2.ran());
-}
-
-
-void ConditionTest::testBroadcast()
-{
- Condition cond;
- Mutex mtx;
- WaitRunnable r1(cond, mtx);
- WaitRunnable r2(cond, mtx);
- TryWaitRunnable r3(cond, mtx);
-
- Thread t1;
- Thread t2;
- Thread t3;
-
- t1.start(r1);
- Thread::sleep(200);
- t2.start(r2);
- Thread::sleep(200);
- t3.start(r3);
-
- assert (!r1.ran());
- assert (!r2.ran());
- assert (!r3.ran());
-
- cond.signal();
- t1.join();
-
- assert (r1.ran());
- assert (!t2.tryJoin(500));
- assert (!t3.tryJoin(500));
-
- cond.broadcast();
-
- t2.join();
- t3.join();
-
- assert (r2.ran());
- assert (r3.ran());
-}
-
-
-void ConditionTest::setUp()
-{
-}
-
-
-void ConditionTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ConditionTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ConditionTest");
-
- CppUnit_addTest(pSuite, ConditionTest, testSignal);
- CppUnit_addTest(pSuite, ConditionTest, testBroadcast);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ConditionTest.h b/Utilities/Poco/Foundation/testsuite/src/ConditionTest.h
deleted file mode 100755
index 10f3c8bc9e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ConditionTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// ConditionTest.h
-//
-// $Id$
-//
-// Definition of the ConditionTest class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef ConditionTest_INCLUDED
-#define ConditionTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ConditionTest: public CppUnit::TestCase
-{
-public:
- ConditionTest(const std::string& name);
- ~ConditionTest();
-
- void testSignal();
- void testBroadcast();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ConditionTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/CoreTest.cpp b/Utilities/Poco/Foundation/testsuite/src/CoreTest.cpp
deleted file mode 100755
index c362ec2298..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/CoreTest.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-//
-// CoreTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "CoreTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Bugcheck.h"
-#include "Poco/Exception.h"
-#include "Poco/Environment.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-#include "Poco/Buffer.h"
-#include "Poco/AtomicCounter.h"
-#include <iostream>
-#include <vector>
-#include <cstring>
-
-
-using Poco::Bugcheck;
-using Poco::Exception;
-using Poco::Environment;
-using Poco::Thread;
-using Poco::Runnable;
-using Poco::Buffer;
-using Poco::AtomicCounter;
-
-
-namespace
-{
- class ACTRunnable: public Poco::Runnable
- {
- public:
- ACTRunnable(AtomicCounter& counter):
- _counter(counter)
- {
- }
-
- void run()
- {
- for (int i = 0; i < 100000; ++i)
- {
- _counter++;
- _counter--;
- ++_counter;
- --_counter;
- }
- }
-
- private:
- AtomicCounter& _counter;
- };
-}
-
-
-//
-// The bugcheck test is normally disabled, as it
-// causes a break into the debugger.
-//
-#define ENABLE_BUGCHECK_TEST 0
-
-
-CoreTest::CoreTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-CoreTest::~CoreTest()
-{
-}
-
-
-void CoreTest::testPlatform()
-{
- std::cout << "POCO_OS: " << POCO_OS << std::endl;
- std::cout << "POCO_ARCH: " << POCO_ARCH << std::endl;
-}
-
-
-void CoreTest::testFixedLength()
-{
- assert (sizeof(Poco::Int8) == 1);
- assert (sizeof(Poco::UInt8) == 1);
- assert (sizeof(Poco::Int16) == 2);
- assert (sizeof(Poco::UInt16) == 2);
- assert (sizeof(Poco::Int32) == 4);
- assert (sizeof(Poco::UInt32) == 4);
- #if defined(POCO_HAVE_INT64)
- assert (sizeof(Poco::Int64) == 8);
- assert (sizeof(Poco::UInt64) == 8);
- #endif
- assert (sizeof(Poco::IntPtr) == sizeof(void*));
- assert (sizeof(Poco::UIntPtr) == sizeof(void*));
-}
-
-
-void CoreTest::testBugcheck()
-{
-#if ENABLE_BUGCHECK_TEST
- try
- {
- Bugcheck::assertion("test", __FILE__, __LINE__);
- failmsg("must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- Bugcheck::nullPointer("test", __FILE__, __LINE__);
- failmsg("must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- Bugcheck::bugcheck("test", __FILE__, __LINE__);
- failmsg("must throw exception");
- }
- catch (Exception&)
- {
- }
-#endif
-}
-
-
-void CoreTest::testEnvironment()
-{
- Environment::set("FOO", "BAR");
- assert (Environment::has("FOO"));
- assert (Environment::get("FOO") == "BAR");
- assert (!Environment::has("THISONEDOESNOTEXIST123"));
- try
- {
- std::string v = Environment::get("THISONEDOESNOTEXIST123");
- failmsg("Environment variable does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- std::cout << "OS Name: " << Environment::osName() << std::endl;
- std::cout << "OS Version: " << Environment::osVersion() << std::endl;
- std::cout << "OS Architecture: " << Environment::osArchitecture() << std::endl;
- std::cout << "Node Name: " << Environment::nodeName() << std::endl;
- std::cout << "Node ID: " << Environment::nodeId() << std::endl;
-}
-
-
-void CoreTest::testBuffer()
-{
- std::size_t s = 10;
- Buffer<int> b(s);
- std::vector<int> v;
- for (int i = 0; i < s; ++i)
- v.push_back(i);
-
- std::memcpy(b.begin(), &v[0], sizeof(int) * v.size());
-
- assert (s == b.size());
- for (int i = 0; i < s; ++i)
- assert (b[i] == i);
-
-#if ENABLE_BUGCHECK_TEST
- try { int i = b[s]; fail ("must fail"); }
- catch (Exception&) { }
-#endif
-}
-
-
-void CoreTest::testAtomicCounter()
-{
- AtomicCounter ac;
-
- assert (ac.value() == 0);
- assert (ac++ == 0);
- assert (ac-- == 1);
- assert (++ac == 1);
- assert (--ac == 0);
-
- ac = 2;
- assert (ac.value() == 2);
-
- ac = 0;
- assert (ac.value() == 0);
-
- AtomicCounter ac2(2);
- assert (ac2.value() == 2);
-
- ACTRunnable act(ac);
- Thread t1;
- Thread t2;
- Thread t3;
- Thread t4;
- Thread t5;
-
- t1.start(act);
- t2.start(act);
- t3.start(act);
- t4.start(act);
- t5.start(act);
-
- t1.join();
- t2.join();
- t3.join();
- t4.join();
- t5.join();
-
- assert (ac.value() == 0);
-}
-
-
-void CoreTest::setUp()
-{
-}
-
-
-void CoreTest::tearDown()
-{
-}
-
-
-CppUnit::Test* CoreTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CoreTest");
-
- CppUnit_addTest(pSuite, CoreTest, testPlatform);
- CppUnit_addTest(pSuite, CoreTest, testFixedLength);
- CppUnit_addTest(pSuite, CoreTest, testBugcheck);
- CppUnit_addTest(pSuite, CoreTest, testEnvironment);
- CppUnit_addTest(pSuite, CoreTest, testBuffer);
- CppUnit_addTest(pSuite, CoreTest, testAtomicCounter);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/CoreTest.h b/Utilities/Poco/Foundation/testsuite/src/CoreTest.h
deleted file mode 100755
index ca9205d8fe..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/CoreTest.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// CoreTest.h
-//
-// $Id$
-//
-// Definition of the CoreTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef CoreTest_INCLUDED
-#define CoreTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class CoreTest: public CppUnit::TestCase
-{
-public:
- CoreTest(const std::string& name);
- ~CoreTest();
-
- void testPlatform();
- void testFixedLength();
- void testBugcheck();
- void testFPE();
- void testEnvironment();
- void testBuffer();
- void testAtomicCounter();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // CoreTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/CoreTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/CoreTestSuite.cpp
deleted file mode 100755
index 4d2d6ee67c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/CoreTestSuite.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// CoreTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "CoreTestSuite.h"
-#include "CoreTest.h"
-#include "AutoPtrTest.h"
-#include "SharedPtrTest.h"
-#include "AutoReleasePoolTest.h"
-#include "ByteOrderTest.h"
-#include "StringTest.h"
-#include "StringTokenizerTest.h"
-#include "FPETest.h"
-#include "RegularExpressionTest.h"
-#include "NDCTest.h"
-#include "NumberFormatterTest.h"
-#include "NumberParserTest.h"
-#include "DynamicFactoryTest.h"
-#include "MemoryPoolTest.h"
-#include "AnyTest.h"
-#include "DynamicAnyTest.h"
-#include "FormatTest.h"
-#include "TuplesTest.h"
-#include "NamedTuplesTest.h"
-#include "TypeListTest.h"
-
-
-CppUnit::Test* CoreTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CoreTestSuite");
-
- pSuite->addTest(CoreTest::suite());
- pSuite->addTest(AutoPtrTest::suite());
- pSuite->addTest(SharedPtrTest::suite());
- pSuite->addTest(AutoReleasePoolTest::suite());
- pSuite->addTest(ByteOrderTest::suite());
- pSuite->addTest(StringTest::suite());
- pSuite->addTest(StringTokenizerTest::suite());
- pSuite->addTest(FPETest::suite());
- pSuite->addTest(RegularExpressionTest::suite());
- pSuite->addTest(NDCTest::suite());
- pSuite->addTest(NumberFormatterTest::suite());
- pSuite->addTest(NumberParserTest::suite());
- pSuite->addTest(DynamicFactoryTest::suite());
- pSuite->addTest(MemoryPoolTest::suite());
- pSuite->addTest(AnyTest::suite());
- pSuite->addTest(DynamicAnyTest::suite());
- pSuite->addTest(FormatTest::suite());
- pSuite->addTest(TuplesTest::suite());
- pSuite->addTest(NamedTuplesTest::suite());
- pSuite->addTest(TypeListTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/CoreTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/CoreTestSuite.h
deleted file mode 100755
index 0c5c403348..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/CoreTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// CoreTestSuite.h
-//
-// $Id$
-//
-// Definition of the CoreTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef CoreTestSuite_INCLUDED
-#define CoreTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class CoreTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // CoreTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/CountingStreamTest.cpp b/Utilities/Poco/Foundation/testsuite/src/CountingStreamTest.cpp
deleted file mode 100755
index c999e42b80..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/CountingStreamTest.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// CountingStreamTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "CountingStreamTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/CountingStream.h"
-#include <sstream>
-
-
-using Poco::CountingInputStream;
-using Poco::CountingOutputStream;
-
-
-CountingStreamTest::CountingStreamTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-CountingStreamTest::~CountingStreamTest()
-{
-}
-
-
-void CountingStreamTest::testInput()
-{
- char c;
- std::istringstream istr1("foo");
- CountingInputStream ci1(istr1);
- while (ci1.good()) ci1.get(c);
- assert (ci1.lines() == 1);
- assert (ci1.chars() == 3);
- assert (ci1.pos() == 3);
-
- std::istringstream istr2("foo\nbar");
- CountingInputStream ci2(istr2);
- while (ci2.good()) ci2.get(c);
- assert (ci2.lines() == 2);
- assert (ci2.chars() == 7);
- assert (ci2.pos() == 3);
-
- std::istringstream istr3("foo\nbar\n");
- CountingInputStream ci3(istr3);
- while (ci3.good()) ci3.get(c);
- assert (ci3.lines() == 2);
- assert (ci3.chars() == 8);
- assert (ci3.pos() == 0);
-}
-
-
-void CountingStreamTest::testOutput()
-{
- std::ostringstream ostr1;
- CountingOutputStream co1(ostr1);
- co1 << "foo";
- assert (ostr1.str() == "foo");
- assert (co1.lines() == 1);
- assert (co1.chars() == 3);
- assert (co1.pos() == 3);
-
- std::ostringstream ostr2;
- CountingOutputStream co2(ostr2);
- co2 << "foo\nbar";
- assert (ostr2.str() == "foo\nbar");
- assert (co2.lines() == 2);
- assert (co2.chars() == 7);
- assert (co2.pos() == 3);
-
- CountingOutputStream co3;
- co3 << "foo\nbar\n";
- assert (co3.lines() == 2);
- assert (co3.chars() == 8);
- assert (co3.pos() == 0);
-}
-
-
-void CountingStreamTest::setUp()
-{
-}
-
-
-void CountingStreamTest::tearDown()
-{
-}
-
-
-CppUnit::Test* CountingStreamTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CountingStreamTest");
-
- CppUnit_addTest(pSuite, CountingStreamTest, testInput);
- CppUnit_addTest(pSuite, CountingStreamTest, testOutput);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/CountingStreamTest.h b/Utilities/Poco/Foundation/testsuite/src/CountingStreamTest.h
deleted file mode 100755
index 4f25f3f2d4..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/CountingStreamTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// CountingStreamTest.h
-//
-// $Id$
-//
-// Definition of the CountingStreamTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef CountingStreamTest_INCLUDED
-#define CountingStreamTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class CountingStreamTest: public CppUnit::TestCase
-{
-public:
- CountingStreamTest(const std::string& name);
- ~CountingStreamTest();
-
- void testInput();
- void testOutput();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // CountingStreamTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/CryptTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/CryptTestSuite.cpp
deleted file mode 100755
index 4111a1ec5b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/CryptTestSuite.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// CryptTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "CryptTestSuite.h"
-#include "MD2EngineTest.h"
-#include "MD4EngineTest.h"
-#include "MD5EngineTest.h"
-#include "SHA1EngineTest.h"
-#include "HMACEngineTest.h"
-#include "DigestStreamTest.h"
-#include "RandomTest.h"
-#include "RandomStreamTest.h"
-
-
-CppUnit::Test* CryptTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CryptTestTestSuite");
-
- pSuite->addTest(MD2EngineTest::suite());
- pSuite->addTest(MD4EngineTest::suite());
- pSuite->addTest(MD5EngineTest::suite());
- pSuite->addTest(SHA1EngineTest::suite());
- pSuite->addTest(HMACEngineTest::suite());
- pSuite->addTest(DigestStreamTest::suite());
- pSuite->addTest(RandomTest::suite());
- pSuite->addTest(RandomStreamTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/CryptTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/CryptTestSuite.h
deleted file mode 100755
index fd79c975ce..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/CryptTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// CryptTestSuite.h
-//
-// $Id$
-//
-// Definition of the CryptTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef CryptTestSuite_INCLUDED
-#define CryptTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class CryptTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // CryptTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/DateTimeFormatterTest.cpp b/Utilities/Poco/Foundation/testsuite/src/DateTimeFormatterTest.cpp
deleted file mode 100755
index b8a92f72b0..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DateTimeFormatterTest.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-//
-// DateTimeFormatterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "DateTimeFormatterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DateTimeFormatter.h"
-#include "Poco/DateTimeFormat.h"
-#include "Poco/DateTime.h"
-#include "Poco/Timespan.h"
-
-
-using Poco::DateTime;
-using Poco::Timespan;
-using Poco::DateTimeFormat;
-using Poco::DateTimeFormatter;
-
-
-DateTimeFormatterTest::DateTimeFormatterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-DateTimeFormatterTest::~DateTimeFormatterTest()
-{
-}
-
-
-void DateTimeFormatterTest::testISO8601()
-{
- DateTime dt(2005, 1, 8, 12, 30, 00);
-
- std::string str = DateTimeFormatter::format(dt, DateTimeFormat::ISO8601_FORMAT);
- assert (str == "2005-01-08T12:30:00Z");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::ISO8601_FORMAT, 3600);
- assert (str == "2005-01-08T12:30:00+01:00");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::ISO8601_FORMAT, -3600);
- assert (str == "2005-01-08T12:30:00-01:00");
-}
-
-
-void DateTimeFormatterTest::testRFC822()
-{
- DateTime dt(2005, 1, 8, 12, 30, 00);
-
- std::string str = DateTimeFormatter::format(dt, DateTimeFormat::RFC822_FORMAT);
- assert (str == "Sat, 8 Jan 05 12:30:00 GMT");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::RFC822_FORMAT, 3600);
- assert (str == "Sat, 8 Jan 05 12:30:00 +0100");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::RFC822_FORMAT, -3600);
- assert (str == "Sat, 8 Jan 05 12:30:00 -0100");
-}
-
-
-void DateTimeFormatterTest::testRFC1123()
-{
- DateTime dt(2005, 1, 8, 12, 30, 00);
-
- std::string str = DateTimeFormatter::format(dt, DateTimeFormat::RFC1123_FORMAT);
- assert (str == "Sat, 8 Jan 2005 12:30:00 GMT");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::RFC1123_FORMAT, 3600);
- assert (str == "Sat, 8 Jan 2005 12:30:00 +0100");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::RFC1123_FORMAT, -3600);
- assert (str == "Sat, 8 Jan 2005 12:30:00 -0100");
-}
-
-
-void DateTimeFormatterTest::testHTTP()
-{
- DateTime dt(2005, 1, 8, 12, 30, 00);
-
- std::string str = DateTimeFormatter::format(dt, DateTimeFormat::HTTP_FORMAT);
- assert (str == "Sat, 08 Jan 2005 12:30:00 GMT");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::HTTP_FORMAT, 3600);
- assert (str == "Sat, 08 Jan 2005 12:30:00 +0100");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::HTTP_FORMAT, -3600);
- assert (str == "Sat, 08 Jan 2005 12:30:00 -0100");
-}
-
-
-void DateTimeFormatterTest::testRFC850()
-{
- DateTime dt(2005, 1, 8, 12, 30, 00);
-
- std::string str = DateTimeFormatter::format(dt, DateTimeFormat::RFC850_FORMAT);
- assert (str == "Saturday, 8-Jan-05 12:30:00 GMT");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::RFC850_FORMAT, 3600);
- assert (str == "Saturday, 8-Jan-05 12:30:00 +0100");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::RFC850_FORMAT, -3600);
- assert (str == "Saturday, 8-Jan-05 12:30:00 -0100");
-}
-
-
-void DateTimeFormatterTest::testRFC1036()
-{
- DateTime dt(2005, 1, 8, 12, 30, 00);
-
- std::string str = DateTimeFormatter::format(dt, DateTimeFormat::RFC1036_FORMAT);
- assert (str == "Saturday, 8 Jan 05 12:30:00 GMT");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::RFC1036_FORMAT, 3600);
- assert (str == "Saturday, 8 Jan 05 12:30:00 +0100");
-
- str = DateTimeFormatter::format(dt, DateTimeFormat::RFC1036_FORMAT, -3600);
- assert (str == "Saturday, 8 Jan 05 12:30:00 -0100");
-}
-
-
-void DateTimeFormatterTest::testASCTIME()
-{
- DateTime dt(2005, 1, 8, 12, 30, 00);
-
- std::string str = DateTimeFormatter::format(dt, DateTimeFormat::ASCTIME_FORMAT);
- assert (str == "Sat Jan 8 12:30:00 2005");
-}
-
-
-void DateTimeFormatterTest::testSORTABLE()
-{
- DateTime dt(2005, 1, 8, 12, 30, 00);
-
- std::string str = DateTimeFormatter::format(dt, DateTimeFormat::SORTABLE_FORMAT);
- assert (str == "2005-01-08 12:30:00");
-}
-
-
-void DateTimeFormatterTest::testCustom()
-{
- DateTime dt(2005, 1, 8, 12, 30, 00, 250);
-
- std::string str = DateTimeFormatter::format(dt, "%w/%W/%b/%B/%d/%e/%f/%m/%n/%o/%y/%Y/%H/%h/%a/%A/%M/%S/%i/%c/%z/%Z/%%");
- assert (str == "Sat/Saturday/Jan/January/08/8/ 8/01/1/ 1/05/2005/12/12/pm/PM/30/00/250/2/Z/GMT/%");
-}
-
-
-void DateTimeFormatterTest::testTimespan()
-{
- Timespan ts(1, 1, 1, 1, 1000);
- std::string str = DateTimeFormatter::format(ts);
- assert (str == "1d 01:01:01.001");
-
- Timespan ts1(1, 24, 1, 1, 1000);
- str = DateTimeFormatter::format(ts1);
- assert (str == "2d 00:01:01.001");
-
- Timespan ts2(1, 25, 1, 1, 1000);
- str = DateTimeFormatter::format(ts2);
- assert (str == "2d 01:01:01.001");
-
- Timespan ts3(5, 4, 3, 2, 1000);
- str = DateTimeFormatter::format(ts3, "%i.%S:%M:%H d%d %%");
- assert (str == "001.02:03:04 d5 %");
-
- Timespan ts4(0, 24, 60, 60, 1001000);
- str = DateTimeFormatter::format(ts4);
- assert (str == "1d 01:01:01.001");
-
- Timespan ts5(2, 11, 30, 20, 0);
- str = DateTimeFormatter::format(ts5, "%h %m %s");
- assert (str == "59 3570 214220");
-}
-
-
-void DateTimeFormatterTest::setUp()
-{
-}
-
-
-void DateTimeFormatterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* DateTimeFormatterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DateTimeFormatterTest");
-
- CppUnit_addTest(pSuite, DateTimeFormatterTest, testISO8601);
- CppUnit_addTest(pSuite, DateTimeFormatterTest, testRFC822);
- CppUnit_addTest(pSuite, DateTimeFormatterTest, testRFC1123);
- CppUnit_addTest(pSuite, DateTimeFormatterTest, testHTTP);
- CppUnit_addTest(pSuite, DateTimeFormatterTest, testRFC850);
- CppUnit_addTest(pSuite, DateTimeFormatterTest, testRFC1036);
- CppUnit_addTest(pSuite, DateTimeFormatterTest, testASCTIME);
- CppUnit_addTest(pSuite, DateTimeFormatterTest, testSORTABLE);
- CppUnit_addTest(pSuite, DateTimeFormatterTest, testCustom);
- CppUnit_addTest(pSuite, DateTimeFormatterTest, testTimespan);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/DateTimeFormatterTest.h b/Utilities/Poco/Foundation/testsuite/src/DateTimeFormatterTest.h
deleted file mode 100755
index 4bcfe2e3b7..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DateTimeFormatterTest.h
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// DateTimeFormatterTest.h
-//
-// $Id$
-//
-// Definition of the DateTimeFormatterTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DateTimeFormatterTest_INCLUDED
-#define DateTimeFormatterTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class DateTimeFormatterTest: public CppUnit::TestCase
-{
-public:
- DateTimeFormatterTest(const std::string& name);
- ~DateTimeFormatterTest();
-
- void testISO8601();
- void testRFC822();
- void testRFC1123();
- void testHTTP();
- void testRFC850();
- void testRFC1036();
- void testASCTIME();
- void testSORTABLE();
- void testCustom();
- void testTimespan();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // DateTimeFormatterTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/DateTimeParserTest.cpp b/Utilities/Poco/Foundation/testsuite/src/DateTimeParserTest.cpp
deleted file mode 100755
index 715cde9a42..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DateTimeParserTest.cpp
+++ /dev/null
@@ -1,551 +0,0 @@
-//
-// DateTimeParserTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "DateTimeParserTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DateTimeParser.h"
-#include "Poco/DateTimeFormat.h"
-#include "Poco/DateTime.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Exception.h"
-
-
-using Poco::DateTime;
-using Poco::DateTimeFormat;
-using Poco::DateTimeParser;
-using Poco::Timestamp;
-using Poco::SyntaxException;
-
-
-DateTimeParserTest::DateTimeParserTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-DateTimeParserTest::~DateTimeParserTest()
-{
-}
-
-
-void DateTimeParserTest::testISO8601()
-{
- int tzd;
- DateTime dt = DateTimeParser::parse(DateTimeFormat::ISO8601_FORMAT, "2005-01-08T12:30:00Z", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse(DateTimeFormat::ISO8601_FORMAT, "2005-01-08T12:30:00+01:00", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::ISO8601_FORMAT, "2005-01-08T12:30:00-01:00", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == -3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::ISO8601_FORMAT, "2005-01-08T12:30:00", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse(DateTimeFormat::ISO8601_FORMAT, "2005-01-08", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (tzd == 0);
-}
-
-
-void DateTimeParserTest::testRFC822()
-{
- int tzd;
- DateTime dt = DateTimeParser::parse(DateTimeFormat::RFC822_FORMAT, "Sat, 8 Jan 05 12:30:00 GMT", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC822_FORMAT, "Sat, 8 Jan 05 12:30:00 +0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC822_FORMAT, "Sat, 8 Jan 05 12:30:00 -0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == -3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC822_FORMAT, "Tue, 18 Jan 05 12:30:00 CET", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 18);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC822_FORMAT, "Wed, 12 Sep 73 02:01:12 CEST", tzd);
- assert (dt.year() == 1973);
- assert (dt.month() == 9);
- assert (dt.day() == 12);
- assert (dt.hour() == 2);
- assert (dt.minute() == 1);
- assert (dt.second() == 12);
- assert (tzd == 7200);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC822_FORMAT, "12 Sep 73 02:01:12 CEST", tzd);
- assert (dt.year() == 1973);
- assert (dt.month() == 9);
- assert (dt.day() == 12);
- assert (dt.hour() == 2);
- assert (dt.minute() == 1);
- assert (dt.second() == 12);
- assert (tzd == 7200);
-}
-
-
-void DateTimeParserTest::testRFC1123()
-{
- int tzd;
- DateTime dt = DateTimeParser::parse(DateTimeFormat::RFC1123_FORMAT, "Sat, 8 Jan 2005 12:30:00 GMT", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC1123_FORMAT, "Sat, 8 Jan 2005 12:30:00 +0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC1123_FORMAT, "Sat, 8 Jan 2005 12:30:00 -0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == -3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC1123_FORMAT, "Sun, 20 Jul 1969 16:17:30 EDT", tzd);
- assert (dt.year() == 1969);
- assert (dt.month() == 7);
- assert (dt.day() == 20);
- assert (dt.hour() == 16);
- assert (dt.minute() == 17);
- assert (dt.second() == 30);
- assert (tzd == -14400);
-}
-
-
-void DateTimeParserTest::testHTTP()
-{
- int tzd;
- DateTime dt = DateTimeParser::parse(DateTimeFormat::HTTP_FORMAT, "Sat, 08 Jan 2005 12:30:00 GMT", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse(DateTimeFormat::HTTP_FORMAT, "Sat, 08 Jan 2005 12:30:00 +0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::HTTP_FORMAT, "Sat, 08 Jan 2005 12:30:00 -0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == -3600);
-}
-
-
-void DateTimeParserTest::testRFC850()
-{
- int tzd;
- DateTime dt = DateTimeParser::parse(DateTimeFormat::RFC850_FORMAT, "Saturday, 8-Jan-05 12:30:00 GMT", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC850_FORMAT, "Saturday, 8-Jan-05 12:30:00 +0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC850_FORMAT, "Saturday, 8-Jan-05 12:30:00 -0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == -3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC850_FORMAT, "Wed, 12-Sep-73 02:01:12 CEST", tzd);
- assert (dt.year() == 1973);
- assert (dt.month() == 9);
- assert (dt.day() == 12);
- assert (dt.hour() == 2);
- assert (dt.minute() == 1);
- assert (dt.second() == 12);
- assert (tzd == 7200);
-}
-
-
-void DateTimeParserTest::testRFC1036()
-{
- int tzd;
- DateTime dt = DateTimeParser::parse(DateTimeFormat::RFC1036_FORMAT, "Saturday, 8 Jan 05 12:30:00 GMT", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC1036_FORMAT, "Saturday, 8 Jan 05 12:30:00 +0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 3600);
-
- dt = DateTimeParser::parse(DateTimeFormat::RFC1036_FORMAT, "Saturday, 8 Jan 05 12:30:00 -0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == -3600);
-}
-
-
-void DateTimeParserTest::testASCTIME()
-{
- int tzd;
- DateTime dt = DateTimeParser::parse(DateTimeFormat::ASCTIME_FORMAT, "Sat Jan 8 12:30:00 2005", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-}
-
-
-void DateTimeParserTest::testSORTABLE()
-{
- int tzd;
- DateTime dt = DateTimeParser::parse(DateTimeFormat::SORTABLE_FORMAT, "2005-01-08 12:30:00", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse(DateTimeFormat::SORTABLE_FORMAT, "2005-01-08", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (tzd == 0);
-}
-
-
-void DateTimeParserTest::testCustom()
-{
- int tzd;
- DateTime dt = DateTimeParser::parse("%d-%b-%Y", "18-Jan-2005", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 18);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse("%m/%d/%y", "01/18/05", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 18);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse("%h:%M %a", "12:30 am", tzd);
- assert (dt.hour() == 0);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
-
- dt = DateTimeParser::parse("%h:%M %a", "12:30 PM", tzd);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
-}
-
-
-void DateTimeParserTest::testGuess()
-{
- int tzd;
- DateTime dt = DateTimeParser::parse("2005-01-08T12:30:00Z", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse("Sat, 8 Jan 05 12:30:00 +0100", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 3600);
-
- dt = DateTimeParser::parse("Sat Jan 8 12:30:00 2005", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse("2005-01-08 12:30:00", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 12);
- assert (dt.minute() == 30);
- assert (dt.second() == 0);
- assert (tzd == 0);
-
- dt = DateTimeParser::parse("2005-01-08", tzd);
- assert (dt.year() == 2005);
- assert (dt.month() == 1);
- assert (dt.day() == 8);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (tzd == 0);
-}
-
-
-void DateTimeParserTest::testParseMonth()
-{
- std::string str = "January";
- std::string::const_iterator it = str.begin();
- int month = DateTimeParser::parseMonth(it, str.end());
- assert (month == 1);
- str = "February";
- it = str.begin();
- month = DateTimeParser::parseMonth(it, str.end());
- assert (month == 2);
- str = "December";
- it = str.begin();
- month = DateTimeParser::parseMonth(it, str.end());
- assert (month == 12);
- str = "Jan";
- it = str.begin();
- month = DateTimeParser::parseMonth(it, str.end());
- assert (month == 1);
- str = "Feb";
- it = str.begin();
- month = DateTimeParser::parseMonth(it, str.end());
- assert (month == 2);
- str = "jan";
- it = str.begin();
- month = DateTimeParser::parseMonth(it, str.end());
- assert (month == 1);
- str = "feb";
- it = str.begin();
- month = DateTimeParser::parseMonth(it, str.end());
- assert (month == 2);
-
- try
- {
- str = "ja";
- it = str.begin();
- month = DateTimeParser::parseMonth(it, str.end());
- fail("Not a valid month name - must throw");
- }
- catch (SyntaxException&)
- {
- }
-}
-
-
-void DateTimeParserTest::testParseDayOfWeek()
-{
- std::string str = "Sunday";
- std::string::const_iterator it = str.begin();
- int dow = DateTimeParser::parseDayOfWeek(it, str.end());
- assert (dow == 0);
- str = "Monday";
- it = str.begin();
- dow = DateTimeParser::parseDayOfWeek(it, str.end());
- assert (dow == 1);
- str = "Saturday";
- it = str.begin();
- dow = DateTimeParser::parseDayOfWeek(it, str.end());
- assert (dow == 6);
- str = "Sun";
- it = str.begin();
- dow = DateTimeParser::parseDayOfWeek(it, str.end());
- assert (dow == 0);
- str = "Mon";
- it = str.begin();
- dow = DateTimeParser::parseDayOfWeek(it, str.end());
- assert (dow == 1);
- str = "sun";
- it = str.begin();
- dow = DateTimeParser::parseDayOfWeek(it, str.end());
- assert (dow == 0);
- str = "mon";
- it = str.begin();
- dow = DateTimeParser::parseDayOfWeek(it, str.end());
- assert (dow == 1);
-
- try
- {
- str = "su";
- it = str.begin();
- dow = DateTimeParser::parseDayOfWeek(it, str.end());
- fail("Not a valid weekday name - must throw");
- }
- catch (SyntaxException&)
- {
- }
-}
-
-
-void DateTimeParserTest::setUp()
-{
-}
-
-
-void DateTimeParserTest::tearDown()
-{
-}
-
-
-CppUnit::Test* DateTimeParserTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DateTimeParserTest");
-
- CppUnit_addTest(pSuite, DateTimeParserTest, testISO8601);
- CppUnit_addTest(pSuite, DateTimeParserTest, testRFC822);
- CppUnit_addTest(pSuite, DateTimeParserTest, testRFC1123);
- CppUnit_addTest(pSuite, DateTimeParserTest, testHTTP);
- CppUnit_addTest(pSuite, DateTimeParserTest, testRFC850);
- CppUnit_addTest(pSuite, DateTimeParserTest, testRFC1036);
- CppUnit_addTest(pSuite, DateTimeParserTest, testASCTIME);
- CppUnit_addTest(pSuite, DateTimeParserTest, testSORTABLE);
- CppUnit_addTest(pSuite, DateTimeParserTest, testCustom);
- CppUnit_addTest(pSuite, DateTimeParserTest, testGuess);
- CppUnit_addTest(pSuite, DateTimeParserTest, testParseMonth);
- CppUnit_addTest(pSuite, DateTimeParserTest, testParseDayOfWeek);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/DateTimeParserTest.h b/Utilities/Poco/Foundation/testsuite/src/DateTimeParserTest.h
deleted file mode 100755
index 29049f481a..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DateTimeParserTest.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// DateTimeParserTest.h
-//
-// $Id$
-//
-// Definition of the DateTimeParserTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DateTimeParserTest_INCLUDED
-#define DateTimeParserTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class DateTimeParserTest: public CppUnit::TestCase
-{
-public:
- DateTimeParserTest(const std::string& name);
- ~DateTimeParserTest();
-
- void testISO8601();
- void testRFC822();
- void testRFC1123();
- void testHTTP();
- void testRFC850();
- void testRFC1036();
- void testASCTIME();
- void testSORTABLE();
- void testCustom();
- void testGuess();
- void testParseMonth();
- void testParseDayOfWeek();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // DateTimeParserTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/DateTimeTest.cpp b/Utilities/Poco/Foundation/testsuite/src/DateTimeTest.cpp
deleted file mode 100755
index 19d606021e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DateTimeTest.cpp
+++ /dev/null
@@ -1,881 +0,0 @@
-//
-// DateTimeTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "DateTimeTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DateTime.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Timespan.h"
-#include "Poco/Exception.h"
-
-
-using Poco::Timestamp;
-using Poco::DateTime;
-using Poco::Timespan;
-using Poco::AssertionViolationException;
-
-
-DateTimeTest::DateTimeTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-DateTimeTest::~DateTimeTest()
-{
-}
-
-
-void DateTimeTest::testTimestamp()
-{
- Timestamp ts(0); // Unix epoch 1970-01-01 00:00:00 Thursday
- DateTime dt(ts);
- assert (dt.year() == 1970);
- assert (dt.month() == 1);
- assert (dt.day() == 1);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 4);
- assert (dt.julianDay() == 2440587.5);
- assert (dt.timestamp() == 0);
-
- ts = Timestamp::fromEpochTime(1000000000);
- dt = ts; // 2001-09-09 01:46:40 Sunday
- assert (dt.year() == 2001);
- assert (dt.month() == 9);
- assert (dt.day() == 9);
- assert (dt.hour() == 1);
- assert (dt.minute() == 46);
- assert (dt.second() == 40);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 0);
- assert (dt.timestamp().epochTime() == 1000000000);
- assertEqualDelta (dt.julianDay(), 2452161.574074, 0.000001);
-}
-
-
-void DateTimeTest::testJulian()
-{
- DateTime dt(2440587.5); // unix epoch as Julian day
- assert (dt.year() == 1970);
- assert (dt.month() == 1);
- assert (dt.day() == 1);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 4);
- assert (dt.julianDay() == 2440587.5);
- assert (dt.timestamp() == 0);
-
- dt = 2299160.5; // 1582-10-15 00:00:00 (first day of Gregorian reform, UTC base)
- assert (dt.year() == 1582);
- assert (dt.month() == 10);
- assert (dt.day() == 15);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 5);
- assert (dt.julianDay() == 2299160.5);
-
- dt = 0.0; // -4713-11-24 12:00:00 (Gregorian date of Julian day reference)
- assert (dt.year() == -4713);
- assert (dt.month() == 11);
- assert (dt.day() == 24);
- assert (dt.hour() == 12);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 1);
- assert (dt.julianDay() == 0);
-
- // Test that we can represent down to the microsecond.
- dt = DateTime(2010, 1, 31, 17, 30, 15, 800, 3);
-
- assert (dt.year() == 2010);
- assert (dt.month() == 1);
- assert (dt.day() == 31);
- assert (dt.hour() == 17);
- assert (dt.minute() == 30);
- assert (dt.second() == 15);
- assert (dt.millisecond() == 800);
- assert (dt.microsecond() == 3);
-}
-
-
-void DateTimeTest::testGregorian()
-{
- DateTime dt(1970, 1, 1);
- assert (dt.year() == 1970);
- assert (dt.month() == 1);
- assert (dt.day() == 1);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 4);
- assert (dt.julianDay() == 2440587.5);
- assert (dt.timestamp() == 0);
-
- dt.assign(2001, 9, 9, 1, 46, 40);
- assert (dt.year() == 2001);
- assert (dt.month() == 9);
- assert (dt.day() == 9);
- assert (dt.hour() == 1);
- assert (dt.minute() == 46);
- assert (dt.second() == 40);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 0);
- assert (dt.timestamp().epochTime() == 1000000000);
- assertEqualDelta (dt.julianDay(), 2452161.574074, 0.000001);
-}
-
-
-void DateTimeTest::testConversions()
-{
- DateTime dt1(2005, 1, 28, 14, 24, 44, 234);
- Timestamp ts1 = dt1.timestamp();
- DateTime dt2(ts1);
- Timestamp ts2 = dt2.timestamp();
- DateTime dt3;
- dt3 = dt1;
- Timestamp ts3 = dt3.timestamp();
- DateTime dt4(dt2);
- Timestamp ts4 = dt4.timestamp();
-
- assert (ts1 == ts2);
- assert (ts2 == ts3);
- assert (ts3 == ts4);
-
- assert (dt2.year() == 2005);
- assert (dt2.month() == 1);
- assert (dt2.day() == 28);
- assert (dt2.hour() == 14);
- assert (dt2.minute() == 24);
- assert (dt2.second() == 44);
- assert (dt2.millisecond() == 234);
- assert (dt2.dayOfWeek() == 5);
-}
-
-
-void DateTimeTest::testStatics()
-{
- assert (DateTime::isLeapYear(1984));
- assert (DateTime::isLeapYear(1988));
- assert (DateTime::isLeapYear(1992));
- assert (DateTime::isLeapYear(1996));
- assert (DateTime::isLeapYear(2000));
- assert (DateTime::isLeapYear(2400));
- assert (!DateTime::isLeapYear(1995));
- assert (!DateTime::isLeapYear(1998));
- assert (!DateTime::isLeapYear(2001));
- assert (!DateTime::isLeapYear(1800));
- assert (!DateTime::isLeapYear(1900));
-
- assert (DateTime::daysOfMonth(2000, 1) == 31);
- assert (DateTime::daysOfMonth(2000, 2) == 29);
- assert (DateTime::daysOfMonth(1999, 2) == 28);
-}
-
-
-void DateTimeTest::testCalcs()
-{
- DateTime dt1(2005, 1, 1);
- assert (dt1.dayOfYear() == 1);
- assert (dt1.week(DateTime::MONDAY) == 0);
- dt1.assign(2005, 1, 3);
- assert (dt1.dayOfYear() == 3);
- assert (dt1.week(DateTime::MONDAY) == 1);
- dt1.assign(2005, 1, 9);
- assert (dt1.dayOfYear() == 9);
- assert (dt1.week(DateTime::MONDAY) == 1);
- dt1.assign(2005, 1, 10);
- assert (dt1.dayOfYear() == 10);
- assert (dt1.week(DateTime::MONDAY) == 2);
- dt1.assign(2005, 2, 1);
- assert (dt1.dayOfYear() == 32);
- assert (dt1.week(DateTime::MONDAY) == 5);
- dt1.assign(2005, 12, 31);
- assert (dt1.week(DateTime::MONDAY) == 52);
- dt1.assign(2007, 1, 1);
- assert (dt1.week(DateTime::MONDAY) == 1);
- dt1.assign(2007, 12, 31);
- assert (dt1.week(DateTime::MONDAY) == 53);
-
- // Jan 1 is Mon
- dt1.assign(2001, 1, 1);
- assert (dt1.week() == 1);
- dt1.assign(2001, 1, 7);
- assert (dt1.week() == 1);
- dt1.assign(2001, 1, 8);
- assert (dt1.week() == 2);
- dt1.assign(2001, 1, 21);
- assert (dt1.week() == 3);
- dt1.assign(2001, 1, 22);
- assert (dt1.week() == 4);
-
- // Jan 1 is Tue
- dt1.assign(2002, 1, 1);
- assert (dt1.week() == 1);
- dt1.assign(2002, 1, 6);
- assert (dt1.week() == 1);
- dt1.assign(2002, 1, 7);
- assert (dt1.week() == 2);
- dt1.assign(2002, 1, 20);
- assert (dt1.week() == 3);
- dt1.assign(2002, 1, 21);
- assert (dt1.week() == 4);
-
- // Jan 1 is Wed
- dt1.assign(2003, 1, 1);
- assert (dt1.week() == 1);
- dt1.assign(2003, 1, 5);
- assert (dt1.week() == 1);
- dt1.assign(2003, 1, 6);
- assert (dt1.week() == 2);
- dt1.assign(2003, 1, 19);
- assert (dt1.week() == 3);
- dt1.assign(2003, 1, 20);
- assert (dt1.week() == 4);
-
- // Jan 1 is Thu
- dt1.assign(2004, 1, 1);
- assert (dt1.week() == 1);
- dt1.assign(2004, 1, 4);
- assert (dt1.week() == 1);
- dt1.assign(2004, 1, 5);
- assert (dt1.week() == 2);
- dt1.assign(2004, 1, 18);
- assert (dt1.week() == 3);
- dt1.assign(2004, 1, 19);
- assert (dt1.week() == 4);
-
- // Jan 1 is Fri
- dt1.assign(1999, 1, 1);
- assert (dt1.week() == 0);
- dt1.assign(1999, 1, 3);
- assert (dt1.week() == 0);
- dt1.assign(1999, 1, 4);
- assert (dt1.week() == 1);
- dt1.assign(1999, 1, 17);
- assert (dt1.week() == 2);
- dt1.assign(1999, 1, 18);
- assert (dt1.week() == 3);
-
- // Jan 1 is Sat
- dt1.assign(2000, 1, 1);
- assert (dt1.week() == 0);
- dt1.assign(2000, 1, 2);
- assert (dt1.week() == 0);
- dt1.assign(2000, 1, 3);
- assert (dt1.week() == 1);
- dt1.assign(2000, 1, 16);
- assert (dt1.week() == 2);
- dt1.assign(2000, 1, 17);
- assert (dt1.week() == 3);
-
- // Jan 1 is Sun
- dt1.assign(1995, 1, 1);
- assert (dt1.week() == 0);
- dt1.assign(1995, 1, 2);
- assert (dt1.week() == 1);
- dt1.assign(1995, 1, 3);
- assert (dt1.week() == 1);
- dt1.assign(1995, 1, 15);
- assert (dt1.week() == 2);
- dt1.assign(1995, 1, 16);
- assert (dt1.week() == 3);
-}
-
-
-void DateTimeTest::testAMPM()
-{
- DateTime dt1(2005, 1, 1, 0, 15, 30);
- assert (dt1.isAM());
- assert (!dt1.isPM());
- assert (dt1.hourAMPM() == 12);
-
- dt1.assign(2005, 1, 1, 12, 15, 30);
- assert (!dt1.isAM());
- assert (dt1.isPM());
- assert (dt1.hourAMPM() == 12);
-
- dt1.assign(2005, 1, 1, 13, 15, 30);
- assert (!dt1.isAM());
- assert (dt1.isPM());
- assert (dt1.hourAMPM() == 1);
-}
-
-
-void DateTimeTest::testRelational()
-{
- DateTime dt1(2005, 1, 1, 0, 15, 30);
- DateTime dt2(2005, 1, 2, 0, 15, 30);
- DateTime dt3(dt1);
-
- assert (dt1 < dt2);
- assert (dt1 <= dt2);
- assert (dt2 > dt1);
- assert (dt2 >= dt1);
- assert (dt1 != dt2);
- assert (!(dt1 == dt2));
-
- assert (dt1 == dt3);
- assert (!(dt1 != dt3));
- assert (dt1 >= dt3);
- assert (dt1 <= dt3);
- assert (!(dt1 > dt3));
- assert (!(dt1 < dt3));
-
- static const struct
- {
- int year;
- int month;
- int day;
- } values[] =
- {
- { 1, 1, 1 },
- { 10, 4, 5 },
- { 100, 6, 7 },
- { 1000, 8, 9 },
- { 2000, 1, 31 },
- { 2002, 7, 4 },
- { 2002, 12, 31 },
- { 2003, 1, 1 },
- { 2003, 1, 2 },
- { 2003, 8, 5 },
- { 2003, 8, 6 },
- { 2003, 8, 7 },
- { 2004, 9, 3 },
- { 2004, 9, 4 },
- };
-
- const int num_values = sizeof values / sizeof *values;
- for (int i = 0; i < num_values; ++i)
- {
- DateTime v;
- const DateTime& V = v;
- v.assign(values[i].year, values[i].month, values[i].day);
- for (int j = 0; j < num_values; ++j)
- {
- DateTime u;
- const DateTime& U = u;
- u.assign(values[j].year, values[j].month, values[j].day);
-
- loop_2_assert(i, j, (j < i) == (U < V));
- loop_2_assert(i, j, (j <= i) == (U <= V));
- loop_2_assert(i, j, (j >= i) == (U >= V));
- loop_2_assert(i, j, (j > i) == (U > V));
- }
- }
-}
-
-
-void DateTimeTest::testArithmetics()
-{
- DateTime dt1(2005, 1, 1, 0, 15, 30);
- DateTime dt2(2005, 1, 2, 0, 15, 30);
-
- Timespan s = dt2 - dt1;
- assert (s.days() == 1);
-
- DateTime dt3 = dt1 + s;
- assert (dt3 == dt2);
-
- dt3 -= s;
- assert (dt3 == dt1);
- dt1 += s;
- assert (dt1 == dt2);
-
- static const struct
- {
- int lineNum; // source line number
- int year1; // operand/result date1 year
- int month1; // operand/result date1 month
- unsigned int day1; // operand/result date1 day
- int numDays; // operand/result 'int' number of days
- int year2; // operand/result date2 year
- int month2; // operand/result date2 month
- unsigned int day2; // operand/result date2 day
- } data[] =
- {
- // - - - -first- - - - - - - second - - -
- //line no. year month day numDays year month day
- //------- ----- ----- ----- ------- ----- ----- -----
- { __LINE__, 1, 1, 1, 1, 1, 1, 2 },
- { __LINE__, 10, 2, 28, 1, 10, 3, 1 },
- { __LINE__, 100, 3, 31, 2, 100, 4, 2 },
- { __LINE__, 1000, 4, 30, 4, 1000, 5, 4 },
- { __LINE__, 1000, 6, 1, -31, 1000, 5, 1 },
- { __LINE__, 1001, 1, 1, -365, 1000, 1, 1 },
- { __LINE__, 1100, 5, 31, 30, 1100, 6, 30 },
- { __LINE__, 1200, 6, 30, 32, 1200, 8, 1 },
- { __LINE__, 1996, 2, 28, 367, 1997, 3, 1 },
- { __LINE__, 1997, 2, 28, 366, 1998, 3, 1 },
- { __LINE__, 1998, 2, 28, 365, 1999, 2, 28 },
- { __LINE__, 1999, 2, 28, 364, 2000, 2, 27 },
- { __LINE__, 1999, 2, 28, 1096, 2002, 2, 28 },
- { __LINE__, 2002, 2, 28, -1096, 1999, 2, 28 },
- };
-
- const int num_data = sizeof data / sizeof *data;
- for (int di = 0; di < num_data; ++di)
- {
- const int line = data[di].lineNum;
- const int num_days = data[di].numDays;
- DateTime x = DateTime(data[di].year1, data[di].month1, data[di].day1);
- const DateTime& X = x;
- x += Timespan(num_days, 0, 0, 0, 0);
- loop_1_assert(line, data[di].year2 == X.year());
- loop_1_assert(line, data[di].month2 == X.month());
- loop_1_assert(line, data[di].day2 == X.day());
- }
-}
-
-void DateTimeTest::testIncrementDecrement()
-{
- static const struct
- {
- int lineNum; // source line number
- int year1; // (first) date year
- int month1; // (first) date month
- unsigned int day1; // (first) date day
- int year2; // (second) date year
- int month2; // (second) date month
- unsigned int day2; // (second) date day
- } data[] =
- {
- // - - - -first- - - - - - - second - - -
- //line no. year month day year month day
- //------- ----- ----- ----- ----- ----- -----
- { __LINE__, 1, 1, 1, 1, 1, 2 },
- { __LINE__, 10, 2, 28, 10, 3, 1 },
- { __LINE__, 100, 3, 31, 100, 4, 1 },
- { __LINE__, 1000, 4, 30, 1000, 5, 1 },
- { __LINE__, 1100, 5, 31, 1100, 6, 1 },
- { __LINE__, 1200, 6, 30, 1200, 7, 1 },
- { __LINE__, 1300, 7, 31, 1300, 8, 1 },
- { __LINE__, 1400, 8, 31, 1400, 9, 1 },
- { __LINE__, 1500, 9, 30, 1500, 10, 1 },
- { __LINE__, 1600, 10, 31, 1600, 11, 1 },
- { __LINE__, 1700, 11, 30, 1700, 12, 1 },
- { __LINE__, 1800, 12, 31, 1801, 1, 1 },
- { __LINE__, 1996, 2, 28, 1996, 2, 29 },
- { __LINE__, 1997, 2, 28, 1997, 3, 1 },
- { __LINE__, 1998, 2, 28, 1998, 3, 1 },
- { __LINE__, 1999, 2, 28, 1999, 3, 1 },
- { __LINE__, 2000, 2, 28, 2000, 2, 29 },
- { __LINE__, 2001, 2, 28, 2001, 3, 1 },
- { __LINE__, 2004, 2, 28, 2004, 2, 29 },
- { __LINE__, 2100, 2, 28, 2100, 3, 1 },
- { __LINE__, 2400, 2, 28, 2400, 2, 29 },
- };
-
- const int num_data = sizeof data / sizeof *data;
- int di;
-
- for (di = 0; di < num_data; ++di)
- {
- const int line = data[di].lineNum;
- DateTime x = DateTime(data[di].year1, data[di].month1,
- data[di].day1);
- // Would do pre-increment of x here.
- const DateTime& X = x;
- x = x + Timespan(1,0,0,0,0);
- DateTime y = x; const DateTime& Y = y;
-
- loop_1_assert(line, data[di].year2 == X.year());
- loop_1_assert(line, data[di].month2 == X.month());
- loop_1_assert(line, data[di].day2 == X.day());
-
- loop_1_assert(line, data[di].year2 == Y.year());
- loop_1_assert(line, data[di].month2 == Y.month());
- loop_1_assert(line, data[di].day2 == Y.day());
- }
-
- for (di = 0; di < num_data; ++di)
- {
- const int line = data[di].lineNum;
- DateTime x = DateTime(data[di].year1, data[di].month1, data[di].day1);
- DateTime x1 = DateTime(data[di].year1, data[di].month1, data[di].day1);
- DateTime x2 = DateTime(data[di].year2, data[di].month2, data[di].day2);
- DateTime y = x; const DateTime& Y = y;
-
- // Would do post increment of x here.
- const DateTime& X = x;
- x = x + Timespan(1,0,0,0,0);
-
- loop_1_assert(line, data[di].year2 == X.year());
- loop_1_assert(line, data[di].month2 == X.month());
- loop_1_assert(line, data[di].day2 == X.day());
- loop_1_assert(line, data[di].year1 == Y.year());
- loop_1_assert(line, data[di].month1 == Y.month());
- loop_1_assert(line, data[di].day1 == Y.day());
- }
-
- for (di = 0; di < num_data; ++di)
- {
- const int line = data[di].lineNum;
- DateTime x = DateTime(data[di].year2, data[di].month2, data[di].day2);
- const DateTime& X = x;
- x = x - Timespan(1,0,0,0,0);
- DateTime y = x; DateTime Y = y;
-
- loop_1_assert(line, data[di].year1 == X.year());
- loop_1_assert(line, data[di].month1 == X.month());
- loop_1_assert(line, data[di].day1 == X.day());
-
- loop_1_assert(line, data[di].year1 == Y.year());
- loop_1_assert(line, data[di].month1 == Y.month());
- loop_1_assert(line, data[di].day1 == Y.day());
- }
-
- for (di = 0; di < num_data; ++di)
- {
- const int line = data[di].lineNum;
- DateTime x1 = DateTime(data[di].year1, data[di].month1, data[di].day1);
- DateTime x = DateTime(data[di].year2, data[di].month2, data[di].day2);
- DateTime y = x; DateTime Y = y;
- const DateTime& X = x;
- // would post-decrement x here.
- x = x - Timespan(1,0,0,0,0);
-
- loop_1_assert(line, data[di].year1 == X.year());
- loop_1_assert(line, data[di].month1 == X.month());
- loop_1_assert(line, data[di].day1 == X.day());
-
- loop_1_assert(line, data[di].year2 == Y.year());
- loop_1_assert(line, data[di].month2 == Y.month());
- loop_1_assert(line, data[di].day2 == Y.day());
- }
-}
-
-
-void DateTimeTest::testSwap()
-{
- DateTime dt1(2005, 1, 1, 0, 15, 30);
- DateTime dt2(2005, 1, 2, 0, 15, 30);
- DateTime dt3(2005, 1, 1, 0, 15, 30);
- DateTime dt4(2005, 1, 2, 0, 15, 30);
-
- dt1.swap(dt2);
- assert (dt2 == dt3);
- assert (dt1 == dt4);
-}
-
-
-void DateTimeTest::testUsage()
-{
- DateTime dt1(1776, 7, 4);
- assert (dt1.year() == 1776);
- assert (dt1.month() == 7);
- assert (dt1.day() == 4);
-
- DateTime dt2(dt1);
- dt2 += Timespan(6, 0, 0, 0, 0);
- assert (dt2.year() == 1776);
- assert (dt2.month() == 7);
- assert (dt2.day() == 10);
-
- Timespan span = dt2 - dt1;
- assert (span.days() == 6);
-
- // TODO - When adding months and years we need to be
- // able to specify the end-end convention.
- // We cannot do this in POCO at the moment.
-}
-
-
-void DateTimeTest::testSetYearDay()
-{
- static const struct
- {
- int d_lineNum; // source line number
- int d_year; // year under test
- unsigned int d_day; // day-of-year under test
- int d_expMonth; // expected month
- unsigned int d_expDay; // expected day
- } data[] =
- {
- //line no. year dayOfYr exp. month exp. day
- //------- ----- ------- ---------- --------
- { __LINE__, 1, 1, 1, 1 },
- { __LINE__, 1, 2, 1, 2 },
- { __LINE__, 1, 365, 12, 31 },
- { __LINE__, 1996, 1, 1, 1 },
- { __LINE__, 1996, 2, 1, 2 },
- { __LINE__, 1996, 365, 12, 30 },
- { __LINE__, 1996, 366, 12, 31 }
- };
-
- const int num_data = sizeof data / sizeof *data;
- for (int di = 0; di < num_data; ++di)
- {
- const int line = data[di].d_lineNum;
- const int year = data[di].d_year;
- const unsigned int day = data[di].d_day;
-
- const int exp_month = data[di].d_expMonth;
- const unsigned int exp_day = data[di].d_expDay;
- const DateTime r(year, exp_month, exp_day);
- DateTime x;
- const DateTime& X = x;
-
-#if 0
- // TODO - need to be able to assign a day number in the year
- // but POCO is not able to do this.
-
- x.assign(year, day);
-
- // TODO - need to be able to assert with the loop counter
- // but cppUnit is not able to do this.
-
- assert (r == x);
- assert (day == X.dayOfYear());
-#endif
- }
-
- static const struct
- {
- int d_lineNum; // source line number
- int d_year; // year under test
- int d_day; // day-of-year under test
- int d_exp; // expected status
- } data2[] =
- {
- //line no. year dayOfYr expected value
- //------- ----- ------- --------------
- { __LINE__, 1, 1, 1 },
- { __LINE__, 1, -1, 0 },
- { __LINE__, 1, 0, 0 },
- { __LINE__, 1, 365, 1 },
- { __LINE__, 1, 366, 0 },
- { __LINE__, 1, 367, 0 },
- { __LINE__, 0, 0, 0 },
- { __LINE__, -1, -1, 0 },
- { __LINE__, 1996, 1, 1 },
- { __LINE__, 1996, 2, 1 },
- { __LINE__, 1996, 32, 1 },
- { __LINE__, 1996, 365, 1 },
- { __LINE__, 1996, 366, 1 },
- { __LINE__, 1996, 367, 0 },
- };
-
- const int num_data2 = sizeof data2 / sizeof *data2;
- for (int di = 0; di < num_data2; ++di)
- {
- const int line = data2[di].d_lineNum;
- const int year = data2[di].d_year;
- const int day = data2[di].d_day;
- const int exp = data2[di].d_exp;
- DateTime x;
- const DateTime& X = x;
- if (1 == exp)
- {
- DateTime r;
- const DateTime& r2 = r;
-#if 0
- r.set(year, day);
-#endif
- }
- }
-}
-
-
-void DateTimeTest::testIsValid()
-{
- static const struct
- {
- int d_lineNum; // source line number
- int d_year; // year under test
- int d_month; // month under test
- int d_day; // day under test
- bool d_exp; // expected value
- } data[] =
- {
- //line no. year month day expected value
- //------- ----- ----- ----- --------------
- { __LINE__, 0, 0, 0, false },
- { __LINE__, 1, 1, 0, false },
- { __LINE__, 1, 0, 1, false },
- { __LINE__, 0, 1, 1, true },
- { __LINE__, 1, 1, -1, false },
- { __LINE__, 1, -1, 1, false },
- { __LINE__, 2004, 1, 32, false },
- { __LINE__, 2004, 2, 30, false },
- { __LINE__, 2004, 3, 32, false },
- { __LINE__, 2004, 4, 31, false },
- { __LINE__, 2004, 5, 32, false },
- { __LINE__, 2004, 6, 31, false },
- { __LINE__, 2004, 7, 32, false },
- { __LINE__, 2004, 8, 32, false },
- { __LINE__, 2004, 9, 31, false },
- { __LINE__, 2004, 10, 32, false },
- { __LINE__, 2004, 11, 31, false },
- { __LINE__, 2004, 12, 32, false },
- { __LINE__, 0, 12, 31, true },
- { __LINE__, 0, 2, 29, true },
- { __LINE__, 1, 1, 1, true },
- { __LINE__, 2010, 1, 2, true },
- { __LINE__, 2011, 2, 5, true },
- { __LINE__, 2012, 3, 10, true },
- { __LINE__, 2013, 4, 17, true },
- { __LINE__, 2014, 5, 23, true },
- { __LINE__, 1600, 2, 29, true },
- { __LINE__, 1700, 2, 29, false },
- { __LINE__, 1800, 2, 29, false },
- { __LINE__, 1900, 2, 29, false },
- { __LINE__, 2000, 2, 29, true },
- { __LINE__, 2100, 2, 29, false },
- };
-
- const int num_data = sizeof data / sizeof *data;
- for (int di = 0; di < num_data; ++di)
- {
- const int line = data[di].d_lineNum;
- const int year = data[di].d_year;
- const int month = data[di].d_month;
- const int day = data[di].d_day;
- const bool exp = data[di].d_exp;
-
- bool isValid = DateTime::isValid(year, month, day);
- loop_1_assert(line, exp == isValid);
- }
-}
-
-
-void DateTimeTest::testDayOfWeek()
-{
- typedef DateTime::DaysOfWeek DOW;
-
- static const struct
- {
- int d_lineNum; // source line number
- int d_year; // year under test
- int d_month; // month under test
- int d_day; // day under test
- DOW d_expDay; // number of days to be added
- } data[] =
- {
- //Line no. year month day expDay
- //------- ----- ----- ----- -------
- { __LINE__, 1600, 1, 1, DateTime::SATURDAY },
- { __LINE__, 1600, 1, 2, DateTime::SUNDAY },
- { __LINE__, 1600, 1, 3, DateTime::MONDAY },
- { __LINE__, 1600, 1, 4, DateTime::TUESDAY },
- { __LINE__, 1600, 1, 5, DateTime::WEDNESDAY },
- { __LINE__, 1600, 1, 6, DateTime::THURSDAY },
- { __LINE__, 1600, 1, 7, DateTime::FRIDAY },
- { __LINE__, 1600, 1, 8, DateTime::SATURDAY },
- { __LINE__, 1752, 8, 27, DateTime::SUNDAY },
- { __LINE__, 1752, 8, 28, DateTime::MONDAY },
- { __LINE__, 1752, 8, 29, DateTime::TUESDAY },
- { __LINE__, 1752, 8, 30, DateTime::WEDNESDAY },
- { __LINE__, 1752, 8, 31, DateTime::THURSDAY },
- { __LINE__, 1752, 9, 1, DateTime::FRIDAY },
- { __LINE__, 1752, 9, 2, DateTime::SATURDAY },
- { __LINE__, 1752, 9, 14, DateTime::THURSDAY },
- { __LINE__, 1752, 9, 15, DateTime::FRIDAY },
- { __LINE__, 1752, 9, 16, DateTime::SATURDAY },
- { __LINE__, 1752, 9, 17, DateTime::SUNDAY },
- { __LINE__, 1752, 9, 18, DateTime::MONDAY },
- { __LINE__, 1752, 9, 19, DateTime::TUESDAY },
- { __LINE__, 1999, 12, 28, DateTime::TUESDAY },
- { __LINE__, 1999, 12, 29, DateTime::WEDNESDAY },
- { __LINE__, 1999, 12, 30, DateTime::THURSDAY },
- { __LINE__, 1999, 12, 31, DateTime::FRIDAY },
- { __LINE__, 2000, 1, 1, DateTime::SATURDAY },
- { __LINE__, 2000, 1, 2, DateTime::SUNDAY },
- { __LINE__, 2000, 1, 3, DateTime::MONDAY },
- { __LINE__, 2000, 1, 4, DateTime::TUESDAY },
- };
-
- const int num_data = sizeof data / sizeof *data;
- for (int di = 0; di < num_data ; ++di)
- {
- const int line = data[di].d_lineNum;
- DateTime x = DateTime(data[di].d_year, data[di].d_month, data[di].d_day);
- const DateTime& X = x;
- loop_1_assert(line, data[di].d_expDay == X.dayOfWeek());
- }
-}
-
-
-void DateTimeTest::testUTC()
-{
- DateTime dt(2007, 3, 5, 12, 30, 00);
-
- assert (dt.hour() == 12);
- dt.makeUTC(3600);
- assert (dt.hour() == 11);
- dt.makeLocal(3600);
- assert (dt.hour() == 12);
-}
-
-
-void DateTimeTest::setUp()
-{
-}
-
-
-void DateTimeTest::tearDown()
-{
-}
-
-
-CppUnit::Test* DateTimeTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DateTimeTest");
-
- CppUnit_addTest(pSuite, DateTimeTest, testTimestamp);
- CppUnit_addTest(pSuite, DateTimeTest, testJulian);
- CppUnit_addTest(pSuite, DateTimeTest, testGregorian);
- CppUnit_addTest(pSuite, DateTimeTest, testConversions);
- CppUnit_addTest(pSuite, DateTimeTest, testStatics);
- CppUnit_addTest(pSuite, DateTimeTest, testCalcs);
- CppUnit_addTest(pSuite, DateTimeTest, testAMPM);
- CppUnit_addTest(pSuite, DateTimeTest, testRelational);
- CppUnit_addTest(pSuite, DateTimeTest, testArithmetics);
- CppUnit_addTest(pSuite, DateTimeTest, testSwap);
-
- CppUnit_addTest(pSuite, DateTimeTest, testUsage);
- CppUnit_addTest(pSuite, DateTimeTest, testSetYearDay);
- CppUnit_addTest(pSuite, DateTimeTest, testIsValid);
- CppUnit_addTest(pSuite, DateTimeTest, testDayOfWeek);
- CppUnit_addTest(pSuite, DateTimeTest, testIncrementDecrement);
- CppUnit_addTest(pSuite, DateTimeTest, testUTC);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/DateTimeTest.h b/Utilities/Poco/Foundation/testsuite/src/DateTimeTest.h
deleted file mode 100755
index 65581fec00..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DateTimeTest.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// DateTimeTest.h
-//
-// $Id$
-//
-// Definition of the DateTimeTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DateTimeTest_INCLUDED
-#define DateTimeTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class DateTimeTest: public CppUnit::TestCase
-{
-public:
- DateTimeTest(const std::string& name);
- ~DateTimeTest();
-
- void testTimestamp();
- void testJulian();
- void testGregorian();
- void testConversions();
- void testStatics();
- void testCalcs();
- void testAMPM();
- void testRelational();
- void testArithmetics();
- void testSwap();
- void testUsage();
- void testSetYearDay();
- void testIsValid();
- void testDayOfWeek();
- void testIncrementDecrement();
- void testUTC();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // DateTimeTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/DateTimeTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/DateTimeTestSuite.cpp
deleted file mode 100755
index e2ea252467..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DateTimeTestSuite.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// DateTimeTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "DateTimeTestSuite.h"
-#include "TimestampTest.h"
-#include "TimespanTest.h"
-#include "TimezoneTest.h"
-#include "DateTimeTest.h"
-#include "LocalDateTimeTest.h"
-#include "DateTimeFormatterTest.h"
-#include "DateTimeParserTest.h"
-
-
-CppUnit::Test* DateTimeTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DateTimeTestSuite");
-
- pSuite->addTest(TimestampTest::suite());
- pSuite->addTest(TimespanTest::suite());
- pSuite->addTest(TimezoneTest::suite());
- pSuite->addTest(DateTimeTest::suite());
- pSuite->addTest(LocalDateTimeTest::suite());
- pSuite->addTest(DateTimeFormatterTest::suite());
- pSuite->addTest(DateTimeParserTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/DateTimeTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/DateTimeTestSuite.h
deleted file mode 100755
index 5d7604f686..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DateTimeTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// DateTimeTestSuite.h
-//
-// $Id$
-//
-// Definition of the DateTimeTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DateTimeTestSuite_INCLUDED
-#define DateTimeTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class DateTimeTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // DateTimeTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/DigestStreamTest.cpp b/Utilities/Poco/Foundation/testsuite/src/DigestStreamTest.cpp
deleted file mode 100755
index cf6d7155fc..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DigestStreamTest.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// DigestStreamTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "DigestStreamTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DigestStream.h"
-#include "Poco/MD5Engine.h"
-#include <sstream>
-
-
-using Poco::DigestInputStream;
-using Poco::DigestOutputStream;
-using Poco::DigestEngine;
-using Poco::MD5Engine;
-
-
-DigestStreamTest::DigestStreamTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-DigestStreamTest::~DigestStreamTest()
-{
-}
-
-
-void DigestStreamTest::testInputStream()
-{
- std::istringstream istr("abcdefghijklmnopqrstuvwxyz");
- MD5Engine md5;
- DigestInputStream ds(md5, istr);
- std::string s;
- ds >> s;
- assert (DigestEngine::digestToHex(md5.digest()) == "c3fcd3d76192e4007dfb496cca67e13b");
- assert (s == "abcdefghijklmnopqrstuvwxyz");
-}
-
-
-void DigestStreamTest::testOutputStream1()
-{
- MD5Engine md5;
- DigestOutputStream ds(md5);
- ds << "abcdefghijklmnopqrstuvwxyz";
- ds.close();
- assert (DigestEngine::digestToHex(md5.digest()) == "c3fcd3d76192e4007dfb496cca67e13b");
-
- ds << "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- ds << "abcdefghijklmnopqrstuvwxyz0123456789";
- ds.close();
- assert (DigestEngine::digestToHex(md5.digest()) == "d174ab98d277d9f5a5611c2c9f419d9f");
-}
-
-
-void DigestStreamTest::testOutputStream2()
-{
- MD5Engine md5;
- std::ostringstream ostr;
- DigestOutputStream ds(md5, ostr);
- ds << "abcdefghijklmnopqrstuvwxyz";
- ds.close();
- assert (DigestEngine::digestToHex(md5.digest()) == "c3fcd3d76192e4007dfb496cca67e13b");
- assert (ostr.str() == "abcdefghijklmnopqrstuvwxyz");
-}
-
-
-void DigestStreamTest::setUp()
-{
-}
-
-
-void DigestStreamTest::tearDown()
-{
-}
-
-
-CppUnit::Test* DigestStreamTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DigestStreamTest");
-
- CppUnit_addTest(pSuite, DigestStreamTest, testInputStream);
- CppUnit_addTest(pSuite, DigestStreamTest, testOutputStream1);
- CppUnit_addTest(pSuite, DigestStreamTest, testOutputStream2);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/DigestStreamTest.h b/Utilities/Poco/Foundation/testsuite/src/DigestStreamTest.h
deleted file mode 100755
index a822db1ddc..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DigestStreamTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// DigestStreamTest.h
-//
-// $Id$
-//
-// Definition of the DigestStreamTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DigestStreamTest_INCLUDED
-#define DigestStreamTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class DigestStreamTest: public CppUnit::TestCase
-{
-public:
- DigestStreamTest(const std::string& name);
- ~DigestStreamTest();
-
- void testInputStream();
- void testOutputStream1();
- void testOutputStream2();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // DigestStreamTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/Driver.cpp b/Utilities/Poco/Foundation/testsuite/src/Driver.cpp
deleted file mode 100755
index 79e979b01f..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/Driver.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Driver.cpp
-//
-// $Id$
-//
-// Console-based test driver.
-//
-// Copyright (c) 2004-2006, 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 "CppUnit/TestRunner.h"
-#include "FoundationTestSuite.h"
-
-
-CppUnitMain(FoundationTestSuite)
diff --git a/Utilities/Poco/Foundation/testsuite/src/DummyDelegate.cpp b/Utilities/Poco/Foundation/testsuite/src/DummyDelegate.cpp
deleted file mode 100755
index 4560ebe393..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DummyDelegate.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// DummyDelegate.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "DummyDelegate.h"
-#include "Poco/Exception.h"
-
-DummyDelegate::DummyDelegate() {}
-DummyDelegate::~DummyDelegate() {}
-
-void DummyDelegate::onSimple(const void* pSender, int& i)
-{
- if (i != 0)
- {
- throw Poco::InvalidArgumentException();
- }
- i++;
-}
-void DummyDelegate::onSimple2(const void* pSender, int& i)
-{
- if (i != 1)
- {
- throw Poco::InvalidArgumentException();
- }
- i++;
-}
-
diff --git a/Utilities/Poco/Foundation/testsuite/src/DummyDelegate.h b/Utilities/Poco/Foundation/testsuite/src/DummyDelegate.h
deleted file mode 100755
index 44c20b2eac..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DummyDelegate.h
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// DummyDelegate.h
-//
-// $Id$
-//
-// Definition of DummyDelegate class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef DummyDelegate_INCLUDED
-#define DummyDelegate_INCLUDED
-
-
-class DummyDelegate
-{
-public:
- DummyDelegate();
- virtual ~DummyDelegate();
-
- void onSimple(const void* pSender, int& i);
- void onSimple2(const void* pSender, int& i);
-};
-
-
-#endif // DummyDelegate_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/DynamicAnyTest.cpp b/Utilities/Poco/Foundation/testsuite/src/DynamicAnyTest.cpp
deleted file mode 100755
index 69f760a8dd..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DynamicAnyTest.cpp
+++ /dev/null
@@ -1,1262 +0,0 @@
-//
-// DynamicAnyTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "DynamicAnyTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Exception.h"
-#include "Poco/DynamicAny.h"
-#include "Poco/Bugcheck.h"
-
-#if defined(_MSC_VER) && _MSC_VER < 1400
-#pragma warning(disable:4800)//forcing value to bool 'true' or 'false'
-#endif
-
-using namespace Poco;
-
-
-DynamicAnyTest::DynamicAnyTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-DynamicAnyTest::~DynamicAnyTest()
-{
-}
-
-
-void DynamicAnyTest::testInt8()
-{
- Poco::Int8 src = 32;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(Poco::Int8));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- Int8 value = a1.extract<Int8>();
- assert (value == 32);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testInt16()
-{
- Poco::Int16 src = 32;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(Poco::Int16));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- Int16 value = a1.extract<Int16>();
- assert (value == 32);
-
- try
- {
- Int32 value2; value2 = a1.extract<Int32>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testInt32()
-{
- Poco::Int32 src = 32;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(Poco::Int32));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- Int32 value = a1.extract<Int32>();
- assert (value == 32);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testInt64()
-{
- Poco::Int64 src = 32;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(Poco::Int64));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- Int64 value = a1.extract<Int64>();
- assert (value == 32);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testUInt8()
-{
- Poco::UInt8 src = 32;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(Poco::UInt8));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- UInt8 value = a1.extract<UInt8>();
- assert (value == 32);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testUInt16()
-{
- Poco::UInt16 src = 32;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(Poco::UInt16));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- UInt16 value = a1.extract<UInt16>();
- assert (value == 32);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testUInt32()
-{
- Poco::UInt32 src = 32;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(Poco::UInt32));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- UInt32 value = a1.extract<UInt32>();
- assert (value == 32);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testUInt64()
-{
- Poco::UInt64 src = 32;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(Poco::UInt64));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- UInt64 value = a1.extract<UInt64>();
- assert (value == 32);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testBool()
-{
- bool src = true;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(bool));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 1);
- assert (s15 == 1);
- assert (s1 == "true");
- assert (s2 == 1);
- assert (s3 == 1);
- assert (s4 == 1);
- assert (s5 == 1);
- assert (s6 == 1);
- assert (s7 == 1);
- assert (s8 == 1);
- assert (s9 == 1);
- assert (s10 == 1.0f);
- assert (s11 == 1.0);
- assert (s12);
- assert (s13 == '\x1');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- bool value = a1.extract<bool>();
- assert (value);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testChar()
-{
- char src = ' ';
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(char));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == " ");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- char value = a1.extract<char>();
- assert (value == ' ');
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testFloat()
-{
- float src = 32.0f;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(float));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- float value = a1.extract<float>();
- assert (value == 32.0f);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testDouble()
-{
- double src = 32.0;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(double));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- double value = a1.extract<double>();
- assert (value == 32.0);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testString()
-{
- DynamicAny a1("32");
-
- assert (a1.type() == typeid(std::string));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == '3');
-
- const std::string& value = a1.extract<std::string>();
- assert (value == "32");
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testLong()
-{
- long src = 32;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(long));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- long value = a1.extract<long>();
- assert (value == 32);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testULong()
-{
- unsigned long src = 32;
- DynamicAny a1 = src;
-
- assert (a1.type() == typeid(unsigned long));
-
- std::string s1;
- Poco::Int8 s2;
- Poco::Int16 s3;
- Poco::Int32 s4;
- Poco::Int64 s5;
- Poco::UInt8 s6;
- Poco::UInt16 s7;
- Poco::UInt32 s8;
- Poco::UInt64 s9;
- float s10;
- double s11;
- bool s12;
- char s13;
- a1.convert(s1);
- a1.convert(s2);
- a1.convert(s3);
- a1.convert(s4);
- a1.convert(s5);
- a1.convert(s6);
- a1.convert(s7);
- a1.convert(s8);
- a1.convert(s9);
- a1.convert(s10);
- a1.convert(s11);
- a1.convert(s12);
- a1.convert(s13);
- long s14;
- unsigned long s15;
- a1.convert(s14);
- a1.convert(s15);
- assert (s14 == 32);
- assert (s15 == 32);
- assert (s1 == "32");
- assert (s2 == 32);
- assert (s3 == 32);
- assert (s4 == 32);
- assert (s5 == 32);
- assert (s6 == 32);
- assert (s7 == 32);
- assert (s8 == 32);
- assert (s9 == 32);
- assert (s10 == 32.0f);
- assert (s11 == 32.0);
- assert (s12);
- assert (s13 == ' ');
- DynamicAny a2(a1);
- std::string t2;
- a2.convert(t2);
- assert (s1 == t2);
-
- unsigned long value = a1.extract<unsigned long>();
- assert (value == 32);
-
- try
- {
- Int16 value2; value2 = a1.extract<Int16>();
- fail("bad cast - must throw");
- }
- catch (Poco::BadCastException&)
- {
- }
-}
-
-
-void DynamicAnyTest::testConversionOperator()
-{
- DynamicAny any("42");
- int i = any;
- assert (i == 42);
-
- any = 123;
- std::string s = any;//'s(any)' bombs on gcc 3.4.4
- assert (s == "123");
-
- any = 321;
- //fails on gcc 3.4.4.
- //s = (std::string) any;//must cast to disambiguate char/string
- //assert (s == "321");
-
- any = "456";
- assert (any == "456");
-}
-
-
-void DynamicAnyTest::testLimitsInt()
-{
- testLimitsSigned<Int16, Int8>();
- testLimitsSigned<Int32, Int8>();
- testLimitsSigned<Int64, Int8>();
- testLimitsFloatToInt<float, Int8>();
- testLimitsFloatToInt<double, Int8>();
-
- testLimitsSigned<Int32, Int16>();
- testLimitsSigned<Int64, Int16>();
- testLimitsFloatToInt<float, Int16>();
- testLimitsFloatToInt<double, Int16>();
-
- testLimitsSigned<Int64, Int32>();
- testLimitsFloatToInt<float, Int32>();
- testLimitsFloatToInt<double, Int32>();
-
- testLimitsSignedUnsigned<Int8, UInt8>();
- testLimitsSignedUnsigned<Int16, UInt8>();
- testLimitsSignedUnsigned<Int32, UInt8>();
- testLimitsSignedUnsigned<Int64, UInt8>();
- testLimitsFloatToInt<float, UInt8>();
- testLimitsFloatToInt<double, UInt8>();
-
- testLimitsSignedUnsigned<Int8, UInt16>();
- testLimitsSignedUnsigned<Int16, UInt16>();
- testLimitsSignedUnsigned<Int32, UInt16>();
- testLimitsSignedUnsigned<Int64, UInt16>();
- testLimitsFloatToInt<float, UInt16>();
- testLimitsFloatToInt<double, UInt16>();
-
- testLimitsSignedUnsigned<Int8, UInt32>();
- testLimitsSignedUnsigned<Int16, UInt32>();
- testLimitsSignedUnsigned<Int32, UInt32>();
- testLimitsSignedUnsigned<Int64, UInt32>();
- testLimitsFloatToInt<float, UInt32>();
- testLimitsFloatToInt<double, UInt32>();
-
- testLimitsSignedUnsigned<Int8, UInt64>();
- testLimitsSignedUnsigned<Int16, UInt64>();
- testLimitsSignedUnsigned<Int32, UInt64>();
- testLimitsSignedUnsigned<Int64, UInt64>();
- testLimitsFloatToInt<float, UInt64>();
- testLimitsFloatToInt<double, UInt64>();
-
-
- testLimitsUnsigned<UInt16, UInt8>();
- testLimitsUnsigned<UInt32, UInt8>();
- testLimitsUnsigned<UInt64, UInt8>();
-
- testLimitsUnsigned<UInt32, UInt16>();
- testLimitsUnsigned<UInt64, UInt16>();
-
- testLimitsUnsigned<UInt64, UInt32>();
-}
-
-
-void DynamicAnyTest::testLimitsFloat()
-{
- if (std::numeric_limits<double>::max() != std::numeric_limits<float>::max())
- {
- double iMin = -1 * std::numeric_limits<float>::max();
- DynamicAny da = iMin * 10;
- try { float f; f = da; fail("must fail"); }
- catch (RangeException&) {}
-
- double iMax = std::numeric_limits<float>::max();
- da = iMax * 10;
- try { float f; f = da; fail("must fail"); }
- catch (RangeException&) {}
- }
-}
-
-
-void DynamicAnyTest::testCtor()
-{
- // this is mainly to test a reported compiler error with assignment on HP aCC.
- // (SF# 1733964)
-
- DynamicAny a1(42);
- DynamicAny a2(a1);
- DynamicAny a3;
-
- a3 = a1;
-
- assert (a2 == 42);
- assert (a3 == 42);
-}
-
-
-void DynamicAnyTest::setUp()
-{
-}
-
-
-void DynamicAnyTest::tearDown()
-{
-}
-
-
-CppUnit::Test* DynamicAnyTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DynamicAnyTest");
-
- CppUnit_addTest(pSuite, DynamicAnyTest, testInt8);
- CppUnit_addTest(pSuite, DynamicAnyTest, testInt16);
- CppUnit_addTest(pSuite, DynamicAnyTest, testInt32);
- CppUnit_addTest(pSuite, DynamicAnyTest, testInt64);
- CppUnit_addTest(pSuite, DynamicAnyTest, testUInt8);
- CppUnit_addTest(pSuite, DynamicAnyTest, testUInt16);
- CppUnit_addTest(pSuite, DynamicAnyTest, testUInt32);
- CppUnit_addTest(pSuite, DynamicAnyTest, testUInt64);
- CppUnit_addTest(pSuite, DynamicAnyTest, testBool);
- CppUnit_addTest(pSuite, DynamicAnyTest, testChar);
- CppUnit_addTest(pSuite, DynamicAnyTest, testFloat);
- CppUnit_addTest(pSuite, DynamicAnyTest, testDouble);
- CppUnit_addTest(pSuite, DynamicAnyTest, testString);
- CppUnit_addTest(pSuite, DynamicAnyTest, testLong);
- CppUnit_addTest(pSuite, DynamicAnyTest, testULong);
- CppUnit_addTest(pSuite, DynamicAnyTest, testConversionOperator);
- CppUnit_addTest(pSuite, DynamicAnyTest, testLimitsInt);
- CppUnit_addTest(pSuite, DynamicAnyTest, testLimitsFloat);
- CppUnit_addTest(pSuite, DynamicAnyTest, testCtor);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/DynamicAnyTest.h b/Utilities/Poco/Foundation/testsuite/src/DynamicAnyTest.h
deleted file mode 100755
index 692c470310..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DynamicAnyTest.h
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// DynamicAnyTest.h
-//
-// $Id$
-//
-// Tests for Any types
-//
-// Copyright (c) 2006, 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.
-//
-
-#ifndef DynamicAnyTest_INCLUDED
-#define DynamicAnyTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/DynamicAny.h"
-#include "Poco/Exception.h"
-#include "CppUnit/TestCase.h"
-
-
-class DynamicAnyTest: public CppUnit::TestCase
-{
-public:
- DynamicAnyTest(const std::string& name);
- ~DynamicAnyTest();
-
- void testInt8();
- void testInt16();
- void testInt32();
- void testInt64();
- void testUInt8();
- void testUInt16();
- void testUInt32();
- void testUInt64();
- void testBool();
- void testChar();
- void testFloat();
- void testDouble();
- void testLong();
- void testULong();
- void testString();
- void testConversionOperator();
- void testLimitsInt();
- void testLimitsFloat();
- void testCtor();
-
- void setUp();
- void tearDown();
- static CppUnit::Test* suite();
-
-private:
- template<typename TL, typename TS>
- void testLimitsSigned()
- {
- TL iMin = std::numeric_limits<TS>::min();
- Poco::DynamicAny da = iMin - 1;
-
-#if defined(_MSC_VER) && _MSC_VER < 1400 // workaround for vc7.1
- try { TS i; i = da.convert<TS>(); fail("must fail"); }
-#else
- try { TS i; i = da; fail("must fail"); }
-#endif
-
- catch (Poco::RangeException&) {}
-
- TL iMax = std::numeric_limits<TS>::max();
- da = iMax + 1;
-
-#if defined(_MSC_VER) && _MSC_VER < 1400 // workaround for vc7.1
- try { TS i; i = da.convert<TS>(); fail("must fail"); }
-#else
- try { TS i; i = da; fail("must fail"); }
-#endif
-
- catch (Poco::RangeException&) {}
- }
-
- template<typename TL, typename TS>
- void testLimitsFloatToInt()
- {
- Poco::DynamicAny da;
-
- if (std::numeric_limits<TS>::is_signed)
- {
- TL iMin = static_cast<TL>(std::numeric_limits<TS>::min());
- da = iMin * 10;
-
-#if defined(_MSC_VER) && _MSC_VER < 1400 // workaround for vc7.1
- try { TS i; i = da.convert<TS>(); fail("must fail"); }
-#else
- try { TS i; i = da; fail("must fail"); }
-#endif
-
- catch (Poco::RangeException&) {}
- }
-
- TL iMax = static_cast<TL>(std::numeric_limits<TS>::max());
- da = iMax * 10;
-
-#if defined(_MSC_VER) && _MSC_VER < 1400 // workaround for vc7.1
- try { TS i; i = da.convert<TS>(); fail("must fail"); }
-#else
- try { TS i; i = da; fail("must fail"); }
-#endif
-
- catch (Poco::RangeException&) {}
- }
-
- template<typename TS, typename TU>
- void testLimitsSignedUnsigned()
- {
- assert (std::numeric_limits<TS>::is_signed);
- assert (!std::numeric_limits<TU>::is_signed);
-
- TS iMin = std::numeric_limits<TS>::min();
- Poco::DynamicAny da = iMin;
-
-#if defined(_MSC_VER) && _MSC_VER < 1400 // workaround for vc7.1
- try { TU i; i = da.convert<TU>(); fail("must fail"); }
-#else
- try { TU i; i = da; fail("must fail"); }
-#endif
-
- catch (Poco::RangeException&) {}
- }
-
- template<typename TL, typename TS>
- void testLimitsUnsigned()
- {
- TL iMax = std::numeric_limits<TS>::max();
- Poco::DynamicAny da = iMax + 1;
-
-#if defined(_MSC_VER) && _MSC_VER < 1400 // workaround for vc7.1
- try { TS i; i = da.convert<TS>(); fail("must fail"); }
-#else
- try { TS i; i = da; fail("must fail"); }
-#endif
-
- catch (Poco::RangeException&) {}
- }
-};
-
-
-#endif // DynamicAnyTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/DynamicFactoryTest.cpp b/Utilities/Poco/Foundation/testsuite/src/DynamicFactoryTest.cpp
deleted file mode 100755
index f29f97c5ac..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DynamicFactoryTest.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// DynamicFactoryTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "DynamicFactoryTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DynamicFactory.h"
-#include "Poco/Exception.h"
-#include <memory>
-
-
-using Poco::DynamicFactory;
-using Poco::Instantiator;
-
-
-namespace
-{
- class Base
- {
- public:
- Base()
- {
- }
-
- virtual ~Base()
- {
- }
- };
-
- class A: public Base
- {
- };
-
- class B: public Base
- {
- };
-}
-
-
-DynamicFactoryTest::DynamicFactoryTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-DynamicFactoryTest::~DynamicFactoryTest()
-{
-}
-
-
-void DynamicFactoryTest::testDynamicFactory()
-{
- DynamicFactory<Base> dynFactory;
-
- dynFactory.registerClass<A>("A");
- dynFactory.registerClass<B>("B");
-
- assert (dynFactory.isClass("A"));
- assert (dynFactory.isClass("B"));
-
- assert (!dynFactory.isClass("C"));
-
- std::auto_ptr<A> a(dynamic_cast<A*>(dynFactory.createInstance("A")));
- std::auto_ptr<B> b(dynamic_cast<B*>(dynFactory.createInstance("B")));
-
- assertNotNull(a.get());
- assertNotNull(b.get());
-
- try
- {
- dynFactory.registerClass<A>("A");
- fail("already registered - must throw");
- }
- catch (Poco::ExistsException&)
- {
- }
-
- dynFactory.unregisterClass("B");
- assert (dynFactory.isClass("A"));
- assert (!dynFactory.isClass("B"));
-
- try
- {
- std::auto_ptr<B> b(dynamic_cast<B*>(dynFactory.createInstance("B")));
- fail("unregistered - must throw");
- }
- catch (Poco::NotFoundException&)
- {
- }
-}
-
-
-void DynamicFactoryTest::setUp()
-{
-}
-
-
-void DynamicFactoryTest::tearDown()
-{
-}
-
-
-CppUnit::Test* DynamicFactoryTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DynamicFactoryTest");
-
- CppUnit_addTest(pSuite, DynamicFactoryTest, testDynamicFactory);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/DynamicFactoryTest.h b/Utilities/Poco/Foundation/testsuite/src/DynamicFactoryTest.h
deleted file mode 100755
index 1d80f15422..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/DynamicFactoryTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// DynamicFactoryTest.h
-//
-// $Id$
-//
-// Definition of the DynamicFactoryTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DynamicFactoryTest_INCLUDED
-#define DynamicFactoryTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class DynamicFactoryTest: public CppUnit::TestCase
-{
-public:
- DynamicFactoryTest(const std::string& name);
- ~DynamicFactoryTest();
-
- void testDynamicFactory();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // DynamicFactoryTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/EventTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/EventTestSuite.cpp
deleted file mode 100755
index 563df8250d..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/EventTestSuite.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// EventTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "EventTestSuite.h"
-#include "FIFOEventTest.h"
-#include "BasicEventTest.h"
-#include "PriorityEventTest.h"
-
-CppUnit::Test* EventTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("EventTestSuite");
-
- pSuite->addTest(BasicEventTest::suite());
- pSuite->addTest(PriorityEventTest::suite());
- pSuite->addTest(FIFOEventTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/EventTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/EventTestSuite.h
deleted file mode 100755
index 0159386285..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/EventTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// EventTestSuite.h
-//
-// $Id$
-//
-// Definition of the EventTestSuite class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef EventTestSuite_INCLUDED
-#define EventTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class EventTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // EventTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ExpireCacheTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ExpireCacheTest.cpp
deleted file mode 100755
index eb0d85b7c7..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ExpireCacheTest.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// ExpireCacheTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "ExpireCacheTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Exception.h"
-#include "Poco/ExpireCache.h"
-#include "Poco/AccessExpireCache.h"
-#include "Poco/Bugcheck.h"
-#include "Poco/Thread.h"
-
-
-using namespace Poco;
-
-
-#define DURSLEEP 250
-#define DURHALFSLEEP DURSLEEP / 2
-#define DURWAIT 300
-
-
-ExpireCacheTest::ExpireCacheTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ExpireCacheTest::~ExpireCacheTest()
-{
-}
-
-
-void ExpireCacheTest::testClear()
-{
- ExpireCache<int, int> aCache(DURSLEEP);
- aCache.add(1, 2);
- aCache.add(3, 4);
- aCache.add(5, 6);
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(1) == 2);
- assert (*aCache.get(3) == 4);
- assert (*aCache.get(5) == 6);
- aCache.clear();
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (!aCache.has(5));
-}
-
-
-void ExpireCacheTest::testExpire0()
-{
- try
- {
- ExpireCache<int, int> aCache(24);
- failmsg("cache expire lower than 25 is illegal, test should fail");
- }
- catch (Poco::InvalidArgumentException&)
- {
- }
-}
-
-
-void ExpireCacheTest::testExpireN()
-{
- // 3-1 represents the cache sorted by age, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- ExpireCache<int, int> aCache(DURSLEEP);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- SharedPtr<int> tmp = aCache.get(1);
- assert (!tmp.isNull());
- assert (*tmp == 2);
- assert (aCache.size() == 1);
- Thread::sleep(DURWAIT);
- assert (aCache.size() == 0);
- assert (!aCache.has(1));
-
- // tmp must still be valid, access it
- assert (*tmp == 2);
- tmp = aCache.get(1);
- assert (!tmp);
-
- aCache.add(1, 2); // 1
- Thread::sleep(DURHALFSLEEP);
- aCache.add(3, 4); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- tmp = aCache.get(1);
- SharedPtr<int> tmp2 = aCache.get(3);
- assert (*tmp == 2);
- assert (*tmp2 == 4);
-
- Thread::sleep(DURHALFSLEEP+25); //3|1
- assert (!aCache.has(1));
- assert (aCache.has(3));
- assert (*tmp == 2); // 1-3
- assert (*tmp2 == 4); // 3-1
- tmp2 = aCache.get(3);
- assert (*tmp2 == 4);
- Thread::sleep(DURHALFSLEEP+25); //3|1
- assert (!aCache.has(3));
- assert (*tmp2 == 4);
- tmp = aCache.get(1);
- tmp2 = aCache.get(3);
- assert (!tmp);
- assert (!tmp2);
-
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
- assert (!aCache.has(3));
-}
-
-
-void ExpireCacheTest::testDuplicateAdd()
-{
- ExpireCache<int, int> aCache(DURSLEEP);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- assert (*aCache.get(1) == 2);
- aCache.add(1, 3);
- assert (aCache.has(1));
- assert (*aCache.get(1) == 3);
-}
-
-
-
-void ExpireCacheTest::testAccessExpireN()
-{
- // 3-1 represents the cache sorted by age, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- AccessExpireCache<int, int> aCache(DURSLEEP);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- SharedPtr<int> tmp = aCache.get(1);
- assert (!tmp.isNull());
- assert (*tmp == 2);
- assert (aCache.size() == 1);
- Thread::sleep(DURWAIT);
- assert (aCache.size() == 0);
- assert (!aCache.has(1));
-
- // tmp must still be valid, access it
- assert (*tmp == 2);
- tmp = aCache.get(1);
- assert (!tmp);
-
- aCache.add(1, 2); // 1
- Thread::sleep(DURHALFSLEEP);
- aCache.add(3, 4); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
-
- Thread::sleep(DURHALFSLEEP+50); //3|1
- assert (!aCache.has(1));
- assert (*aCache.get(3) == 4);
- Thread::sleep(DURHALFSLEEP+25); //3|1
- assert (*aCache.get(3) == 4);
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
- assert (!aCache.has(3));
-}
-
-
-void ExpireCacheTest::testExpireWithHas()
-{
- // 3-1 represents the cache sorted by age, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- ExpireCache<int, int> aCache(DURSLEEP);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- Thread::sleep(DURWAIT);
- assert (!aCache.has(1));
-}
-
-
-void ExpireCacheTest::setUp()
-{
-}
-
-
-void ExpireCacheTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ExpireCacheTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ExpireCacheTest");
-
- CppUnit_addTest(pSuite, ExpireCacheTest, testClear);
- CppUnit_addTest(pSuite, ExpireCacheTest, testExpire0);
- CppUnit_addTest(pSuite, ExpireCacheTest, testExpireN);
- CppUnit_addTest(pSuite, ExpireCacheTest, testDuplicateAdd);
- CppUnit_addTest(pSuite, ExpireCacheTest, testAccessExpireN);
- CppUnit_addTest(pSuite, ExpireCacheTest, testExpireWithHas);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ExpireCacheTest.h b/Utilities/Poco/Foundation/testsuite/src/ExpireCacheTest.h
deleted file mode 100755
index 803f31fbb5..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ExpireCacheTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// ExpireCacheTest.h
-//
-// $Id$
-//
-// Tests for ExpireCache
-//
-// Copyright (c) 2006, 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.
-//
-
-#ifndef ExpireCacheTest_INCLUDED
-#define ExpireCacheTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ExpireCacheTest: public CppUnit::TestCase
-{
-public:
- ExpireCacheTest(const std::string& name);
- ~ExpireCacheTest();
-
- void testClear();
- void testDuplicateAdd();
- void testExpire0();
- void testExpireN();
- void testAccessExpireN();
- void testExpireWithHas();
-
-
- void setUp();
- void tearDown();
- static CppUnit::Test* suite();
-};
-
-
-#endif // ExpireCacheTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ExpireLRUCacheTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ExpireLRUCacheTest.cpp
deleted file mode 100755
index 2afcf9ea52..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ExpireLRUCacheTest.cpp
+++ /dev/null
@@ -1,353 +0,0 @@
-//
-// ExpireLRUCacheTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "ExpireLRUCacheTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Exception.h"
-#include "Poco/ExpireLRUCache.h"
-#include "Poco/AccessExpireLRUCache.h"
-#include "Poco/Bugcheck.h"
-#include "Poco/Thread.h"
-
-
-using namespace Poco;
-
-
-#define DURSLEEP 250
-#define DURHALFSLEEP DURSLEEP / 2
-#define DURWAIT 300
-
-
-ExpireLRUCacheTest::ExpireLRUCacheTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ExpireLRUCacheTest::~ExpireLRUCacheTest()
-{
-}
-
-
-void ExpireLRUCacheTest::testClear()
-{
- ExpireLRUCache<int, int> aCache(DURSLEEP);
- aCache.add(1, 2);
- aCache.add(3, 4);
- aCache.add(5, 6);
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(1) == 2);
- assert (*aCache.get(3) == 4);
- assert (*aCache.get(5) == 6);
- aCache.clear();
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (!aCache.has(5));
-}
-
-
-void ExpireLRUCacheTest::testExpire0()
-{
- try
- {
- ExpireLRUCache<int, int> aCache(1024, 24);
- failmsg("cache expire lower than 25 is illegal, test should fail");
- }
- catch (Poco::InvalidArgumentException&)
- {
- }
-}
-
-
-void ExpireLRUCacheTest::testExpireN()
-{
- // 3-1 represents the cache sorted by age, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- ExpireLRUCache<int, int> aCache(3, DURSLEEP);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- SharedPtr<int> tmp = aCache.get(1);
- assert (!tmp.isNull());
- assert (*tmp == 2);
- Thread::sleep(DURWAIT);
- assert (!aCache.has(1));
-
- // tmp must still be valid, access it
- assert (*tmp == 2);
- tmp = aCache.get(1);
- assert (!tmp);
-
- aCache.add(1, 2); // 1
- Thread::sleep(DURHALFSLEEP);
- aCache.add(3, 4); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- tmp = aCache.get(1);
- SharedPtr<int> tmp2 = aCache.get(3);
- assert (*tmp == 2);
- assert (*tmp2 == 4);
-
- Thread::sleep(DURHALFSLEEP+25); //3|1
- assert (!aCache.has(1));
- assert (aCache.has(3));
- assert (*tmp == 2); // 1-3
- assert (*tmp2 == 4); // 3-1
- tmp2 = aCache.get(3);
- assert (*tmp2 == 4);
- Thread::sleep(DURHALFSLEEP+25); //3|1
- assert (!aCache.has(3));
- assert (*tmp2 == 4);
- tmp = aCache.get(1);
- tmp2 = aCache.get(3);
- assert (!tmp);
- assert (!tmp2);
-
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
- assert (!aCache.has(3));
-}
-
-
-void ExpireLRUCacheTest::testAccessExpireN()
-{
- // 3-1 represents the cache sorted by age, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- AccessExpireLRUCache<int, int> aCache(3, DURSLEEP);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- SharedPtr<int> tmp = aCache.get(1);
- assert (!tmp.isNull());
- assert (*tmp == 2);
- assert (aCache.size() == 1);
- Thread::sleep(DURWAIT);
- assert (aCache.size() == 0);
- assert (!aCache.has(1));
-
- // tmp must still be valid, access it
- assert (*tmp == 2);
- tmp = aCache.get(1);
- assert (!tmp);
-
- aCache.add(1, 2); // 1
- Thread::sleep(DURHALFSLEEP);
- aCache.add(3, 4); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
-
- Thread::sleep(DURHALFSLEEP+50); //3|1
- assert (!aCache.has(1));
- assert (*aCache.get(3) == 4);
- Thread::sleep(DURHALFSLEEP+25); //3|1
- assert (*aCache.get(3) == 4);
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
- assert (!aCache.has(3));
-}
-
-
-void ExpireLRUCacheTest::testCacheSize0()
-{
- // cache size 0 is illegal
- try
- {
- ExpireLRUCache<int, int> aCache(0);
- failmsg ("cache size of 0 is illegal, test should fail");
- }
- catch (Poco::InvalidArgumentException&)
- {
- }
-}
-
-
-void ExpireLRUCacheTest::testCacheSize1()
-{
- ExpireLRUCache<int, int> aCache(1);
- aCache.add(1, 2);
- assert (aCache.has(1));
- assert (*aCache.get(1) == 2);
-
- aCache.add(3, 4); // replaces 1
- assert (!aCache.has(1));
- assert (aCache.has(3));
- assert (*aCache.get(3) == 4);
-
- aCache.add(5, 6);
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(5) == 6);
-
- aCache.remove(5);
- assert (!aCache.has(5));
-
- // removing illegal entries should work too
- aCache.remove(666);
-}
-
-
-void ExpireLRUCacheTest::testCacheSize2()
-{
- // 3-1 represents the cache sorted by pos, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- ExpireLRUCache<int, int> aCache(2);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- assert (*aCache.get(1) == 2);
-
- aCache.add(3, 4); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (*aCache.get(1) == 2); // 1-3
- assert (*aCache.get(3) == 4); // 3-1
-
- aCache.add(5, 6); // 5-3|1
- assert (!aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(5) == 6); // 5-3
- assert (*aCache.get(3) == 4); // 3-5
-
- // test remove from the end and the beginning of the list
- aCache.remove(5); // 3
- assert (!aCache.has(5));
- assert (*aCache.get(3) == 4); // 3
- aCache.add(5, 6); // 5-3
- assert (*aCache.get(3) == 4); // 3-5
- aCache.remove(3); // 5
- assert (!aCache.has(3));
- assert (*aCache.get(5) == 6); // 5
-
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
-}
-
-
-void ExpireLRUCacheTest::testCacheSizeN()
-{
- // 3-1 represents the cache sorted by pos, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- ExpireLRUCache<int, int> aCache(3);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- assert (*aCache.get(1) == 2);
-
- aCache.add(3, 4); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (*aCache.get(1) == 2); // 1-3
- assert (*aCache.get(3) == 4); // 3-1
-
- aCache.add(5, 6); // 5-3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(5) == 6); // 5-3-1
- assert (*aCache.get(3) == 4); // 3-5-1
-
- aCache.add(7, 8); // 7-5-3|1
- assert (!aCache.has(1));
- assert (aCache.has(7));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(5) == 6); // 5-7-3
- assert (*aCache.get(3) == 4); // 3-5-7
- assert (*aCache.get(7) == 8); // 7-3-5
-
- // test remove from the end and the beginning of the list
- aCache.remove(5); // 7-3
- assert (!aCache.has(5));
- assert (*aCache.get(3) == 4); // 3-7
- aCache.add(5, 6); // 5-3-7
- assert (*aCache.get(7) == 8); // 7-5-3
- aCache.remove(7); // 5-3
- assert (!aCache.has(7));
- assert (aCache.has(3));
- assert (*aCache.get(5) == 6); // 5-3
-
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
- assert (!aCache.has(3));
-}
-
-
-void ExpireLRUCacheTest::testDuplicateAdd()
-{
- ExpireLRUCache<int, int> aCache(3);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- assert (*aCache.get(1) == 2);
- aCache.add(1, 3);
- assert (aCache.has(1));
- assert (*aCache.get(1) == 3);
-}
-
-
-void ExpireLRUCacheTest::setUp()
-{
-}
-
-
-void ExpireLRUCacheTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ExpireLRUCacheTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ExpireLRUCacheTest");
-
- CppUnit_addTest(pSuite, ExpireLRUCacheTest, testClear);
- CppUnit_addTest(pSuite, ExpireLRUCacheTest, testExpire0);
- CppUnit_addTest(pSuite, ExpireLRUCacheTest, testExpireN);
- CppUnit_addTest(pSuite, ExpireLRUCacheTest, testAccessExpireN);
- CppUnit_addTest(pSuite, ExpireLRUCacheTest, testCacheSize0);
- CppUnit_addTest(pSuite, ExpireLRUCacheTest, testCacheSize1);
- CppUnit_addTest(pSuite, ExpireLRUCacheTest, testCacheSize2);
- CppUnit_addTest(pSuite, ExpireLRUCacheTest, testCacheSizeN);
- CppUnit_addTest(pSuite, ExpireLRUCacheTest, testDuplicateAdd);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ExpireLRUCacheTest.h b/Utilities/Poco/Foundation/testsuite/src/ExpireLRUCacheTest.h
deleted file mode 100755
index b644c68aca..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ExpireLRUCacheTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// ExpireLRUCacheTest.h
-//
-// $Id$
-//
-// Tests for ExpireLRUCache
-//
-// Copyright (c) 2006, 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.
-//
-
-#ifndef ExpireLRUCacheTest_INCLUDED
-#define ExpireLRUCacheTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ExpireLRUCacheTest: public CppUnit::TestCase
-{
-public:
- ExpireLRUCacheTest(const std::string& name);
- ~ExpireLRUCacheTest();
-
- void testClear();
- void testExpire0();
- void testExpireN();
- void testAccessExpireN();
- void testCacheSize0();
- void testCacheSize1();
- void testCacheSize2();
- void testCacheSizeN();
- void testDuplicateAdd();
-
- void setUp();
- void tearDown();
- static CppUnit::Test* suite();
-};
-
-
-#endif // ExpireLRUCacheTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/FIFOEventTest.cpp b/Utilities/Poco/Foundation/testsuite/src/FIFOEventTest.cpp
deleted file mode 100755
index 59a750c364..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FIFOEventTest.cpp
+++ /dev/null
@@ -1,444 +0,0 @@
-//
-// FIFOEventTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "FIFOEventTest.h"
-#include "DummyDelegate.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Delegate.h"
-#include "Poco/Expire.h"
-#include "Poco/Thread.h"
-#include "Poco/Exception.h"
-
-
-using namespace Poco;
-
-
-#define LARGEINC 100
-
-
-FIFOEventTest::FIFOEventTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-FIFOEventTest::~FIFOEventTest()
-{
-}
-
-void FIFOEventTest::testNoDelegate()
-{
- int tmp = 0;
- EventArgs args;
-
- assert (_count == 0);
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- Simple += delegate(this, &FIFOEventTest::onSimple);
- Simple -= delegate(this, &FIFOEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- ConstSimple += delegate(this, &FIFOEventTest::onConstSimple);
- ConstSimple -= delegate(this, &FIFOEventTest::onConstSimple);
- ConstSimple.notify(this, tmp);
- assert (_count == 0);
-
- //Note: passing &args will not work due to &
- EventArgs* pArgs = &args;
- Complex += delegate(this, &FIFOEventTest::onComplex);
- Complex -= delegate(this, &FIFOEventTest::onComplex);
- Complex.notify(this, pArgs);
- assert (_count == 0);
-
- Complex2 += delegate(this, &FIFOEventTest::onComplex2);
- Complex2 -= delegate(this, &FIFOEventTest::onComplex2);
- Complex2.notify(this, args);
- assert (_count == 0);
-
- const EventArgs* pCArgs = &args;
- ConstComplex += delegate(this, &FIFOEventTest::onConstComplex);
- ConstComplex -= delegate(this, &FIFOEventTest::onConstComplex);
- ConstComplex.notify(this, pCArgs);
- assert (_count == 0);
-
- Const2Complex += delegate(this, &FIFOEventTest::onConst2Complex);
- Const2Complex -= delegate(this, &FIFOEventTest::onConst2Complex);
- Const2Complex.notify(this, pArgs);
- assert (_count == 0);
-}
-
-void FIFOEventTest::testSingleDelegate()
-{
- int tmp = 0;
- EventArgs args;
-
- assert (_count == 0);
-
- Simple += delegate(this, &FIFOEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- ConstSimple += delegate(this, &FIFOEventTest::onConstSimple);
- ConstSimple.notify(this, tmp);
- assert (_count == 2);
-
- EventArgs* pArgs = &args;
- Complex += delegate(this, &FIFOEventTest::onComplex);
- Complex.notify(this, pArgs);
- assert (_count == 3);
-
- Complex2 += delegate(this, &FIFOEventTest::onComplex2);
- Complex2.notify(this, args);
- assert (_count == 4);
-
- const EventArgs* pCArgs = &args;
- ConstComplex += delegate(this, &FIFOEventTest::onConstComplex);
- ConstComplex.notify(this, pCArgs);
- assert (_count == 5);
-
- Const2Complex += delegate(this, &FIFOEventTest::onConst2Complex);
- Const2Complex.notify(this, pArgs);
- assert (_count == 6);
- // check if 2nd notify also works
- Const2Complex.notify(this, pArgs);
- assert (_count == 7);
-
-}
-
-void FIFOEventTest::testDuplicateRegister()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += delegate(this, &FIFOEventTest::onSimple);
- Simple += delegate(this, &FIFOEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
- Simple -= delegate(this, &FIFOEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
-}
-
-void FIFOEventTest::testDuplicateUnregister()
-{
- // duplicate unregister shouldn't give an error,
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple -= delegate(this, &FIFOEventTest::onSimple); // should work
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- Simple += delegate(this, &FIFOEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- Simple -= delegate(this, &FIFOEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- Simple -= delegate(this, &FIFOEventTest::onSimple);
- Simple.notify(this, tmp);
- assert (_count == 1);
-}
-
-
-void FIFOEventTest::testDisabling()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += delegate(this, &FIFOEventTest::onSimple);
- Simple.disable();
- Simple.notify(this, tmp);
- assert (_count == 0);
- Simple.enable();
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- // unregister should also work with disabled event
- Simple.disable();
- Simple -= delegate(this, &FIFOEventTest::onSimple);
- Simple.enable();
- Simple.notify(this, tmp);
- assert (_count == 1);
-}
-
-void FIFOEventTest::testFIFOOrder()
-{
- DummyDelegate o1;
- DummyDelegate o2;
-
- assert (_count == 0);
-
- Simple += delegate(&o1, &DummyDelegate::onSimple);
- Simple += delegate(&o2, &DummyDelegate::onSimple2);
- int tmp = 0;
- Simple.notify(this, tmp);
- assert (tmp == 2);
-
- Simple -= delegate(&o1, &DummyDelegate::onSimple);
- Simple -= delegate(&o2, &DummyDelegate::onSimple2);
-
- // now try with the wrong order
- Simple += delegate(&o2, &DummyDelegate::onSimple2);
- Simple += delegate(&o1, &DummyDelegate::onSimple);
-
- try
- {
- tmp = 0;
- Simple.notify(this, tmp);
- failmsg ("Notify should not work");
- }
- catch (Poco::InvalidArgumentException&)
- {
- }
-}
-
-void FIFOEventTest::testFIFOOrderExpire()
-{
- // expire must not break order!
- DummyDelegate o1;
- DummyDelegate o2;
-
- assert (_count == 0);
-
- Simple += delegate(&o1, &DummyDelegate::onSimple, 5000);
- Simple += delegate(&o2, &DummyDelegate::onSimple2, 5000);
- int tmp = 0;
- Simple.notify(this, tmp);
- assert (tmp == 2);
-
- // both ways of unregistering should work
- Simple -= delegate(&o1, &DummyDelegate::onSimple, 6000);
- Simple -= delegate(&o2, &DummyDelegate::onSimple2);
- Simple.notify(this, tmp);
- assert (tmp == 2);
-
- // now start mixing of expire and non expire
- tmp = 0;
- Simple += delegate(&o1, &DummyDelegate::onSimple);
- Simple += delegate(&o2, &DummyDelegate::onSimple2, 5000);
- Simple.notify(this, tmp);
- assert (tmp == 2);
-
- Simple -= delegate(&o2, &DummyDelegate::onSimple2);
- // it is not forbidden to unregister a non expiring event with an expire decorator (it is just stupid ;-))
- Simple -= delegate(&o1, &DummyDelegate::onSimple, 6000);
- Simple.notify(this, tmp);
- assert (tmp == 2);
-
- // now try with the wrong order
- Simple += delegate(&o2, &DummyDelegate::onSimple2, 5000);
- Simple += delegate(&o1, &DummyDelegate::onSimple);
-
- try
- {
- tmp = 0;
- Simple.notify(this, tmp);
- failmsg ("Notify should not work");
- }
- catch (Poco::InvalidArgumentException&)
- {
-
- }
-
-}
-
-void FIFOEventTest::testExpire()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += delegate(this, &FIFOEventTest::onSimple, 500);
- Simple.notify(this, tmp);
- assert (_count == 1);
- Poco::Thread::sleep(700);
- Simple.notify(this, tmp);
- assert (_count == 1);
-}
-
-
-void FIFOEventTest::testExpireReRegister()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += delegate(this, &FIFOEventTest::onSimple, 500);
- Simple.notify(this, tmp);
- assert (_count == 1);
- Poco::Thread::sleep(200);
- Simple.notify(this, tmp);
- assert (_count == 2);
- // renew registration
- Simple += delegate(this, &FIFOEventTest::onSimple, 600);
- Poco::Thread::sleep(400);
- Simple.notify(this, tmp);
- assert (_count == 3);
- Poco::Thread::sleep(300);
- Simple.notify(this, tmp);
- assert (_count == 3);
-}
-
-
-void FIFOEventTest::testReturnParams()
-{
- DummyDelegate o1;
- Simple += delegate(&o1, &DummyDelegate::onSimple);
-
- int tmp = 0;
- Simple.notify(this, tmp);
- assert (tmp == 1);
-}
-
-void FIFOEventTest::testOverwriteDelegate()
-{
- DummyDelegate o1;
- Simple += delegate(&o1, &DummyDelegate::onSimple2);
- // o1 can only have one entry, thus the next line will replace the entry
- Simple += delegate(&o1, &DummyDelegate::onSimple);
-
- int tmp = 0; // onsimple requires 0 as input
- Simple.notify(this, tmp);
- assert (tmp == 1);
- // now overwrite with onsimple2 with requires as input tmp = 1
- Simple += delegate(&o1, &DummyDelegate::onSimple2, 23000);
- Simple.notify(this, tmp);
- assert (tmp == 2);
-}
-
-void FIFOEventTest::testAsyncNotify()
-{
- Poco::FIFOEvent<int >* pSimple= new Poco::FIFOEvent<int>();
- (*pSimple) += delegate(this, &FIFOEventTest::onAsync);
- assert (_count == 0);
- int tmp = 0;
- Poco::ActiveResult<int>retArg = pSimple->notifyAsync(this, tmp);
- delete pSimple; // must work even when the event got deleted!
- pSimple = NULL;
- assert (_count == 0);
- retArg.wait();
- assert (retArg.data() == tmp);
- assert (_count == LARGEINC);
-}
-
-void FIFOEventTest::onSimple(const void* pSender, int& i)
-{
- _count++;
-}
-
-void FIFOEventTest::onSimpleOther(const void* pSender, int& i)
-{
- _count+=100;
-}
-
-void FIFOEventTest::onConstSimple(const void* pSender, const int& i)
-{
- _count++;
-}
-
-void FIFOEventTest::onComplex(const void* pSender, Poco::EventArgs* & i)
-{
- _count++;
-}
-
-void FIFOEventTest::onComplex2(const void* pSender, Poco::EventArgs & i)
-{
- _count++;
-}
-
-void FIFOEventTest::onConstComplex(const void* pSender, const Poco::EventArgs*& i)
-{
- _count++;
-}
-
-void FIFOEventTest::onConst2Complex(const void* pSender, const Poco::EventArgs * const & i)
-{
- _count++;
-}
-
-void FIFOEventTest::onAsync(const void* pSender, int& i)
-{
- Poco::Thread::sleep(700);
- _count += LARGEINC ;
-}
-
-int FIFOEventTest::getCount() const
-{
- return _count;
-}
-
-void FIFOEventTest::setUp()
-{
- _count = 0;
- // must clear events, otherwise repeating test executions will fail
- // because tests are only created once, only setup is called before
- // each test run
- Simple.clear();
- ConstSimple.clear();
- Complex.clear();
- Complex2.clear();
- ConstComplex.clear();
- Const2Complex.clear();
-}
-
-
-void FIFOEventTest::tearDown()
-{
-}
-
-
-CppUnit::Test* FIFOEventTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FIFOEventTest");
-
- CppUnit_addTest(pSuite, FIFOEventTest, testNoDelegate);
- CppUnit_addTest(pSuite, FIFOEventTest, testSingleDelegate);
- CppUnit_addTest(pSuite, FIFOEventTest, testReturnParams);
- CppUnit_addTest(pSuite, FIFOEventTest, testDuplicateRegister);
- CppUnit_addTest(pSuite, FIFOEventTest, testDuplicateUnregister);
- CppUnit_addTest(pSuite, FIFOEventTest, testDisabling);
- CppUnit_addTest(pSuite, FIFOEventTest, testFIFOOrder);
- CppUnit_addTest(pSuite, FIFOEventTest, testFIFOOrderExpire);
- CppUnit_addTest(pSuite, FIFOEventTest, testExpire);
- CppUnit_addTest(pSuite, FIFOEventTest, testExpireReRegister);
- CppUnit_addTest(pSuite, FIFOEventTest, testOverwriteDelegate);
- CppUnit_addTest(pSuite, FIFOEventTest, testAsyncNotify);
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/FIFOEventTest.h b/Utilities/Poco/Foundation/testsuite/src/FIFOEventTest.h
deleted file mode 100755
index 302080833b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FIFOEventTest.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// FIFOEventTest.h
-//
-// $Id$
-//
-// Definition of the FIFOEventTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef FIFOEventTest_INCLUDED
-#define FIFOEventTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/FIFOEvent.h"
-#include "Poco/EventArgs.h"
-
-
-class FIFOEventTest: public CppUnit::TestCase
-{
- Poco::FIFOEvent<int> Simple;
- Poco::FIFOEvent<const int> ConstSimple;
- Poco::FIFOEvent<Poco::EventArgs*> Complex;
- Poco::FIFOEvent<Poco::EventArgs> Complex2;
- Poco::FIFOEvent<const Poco::EventArgs*> ConstComplex;
- Poco::FIFOEvent<const Poco::EventArgs * const> Const2Complex;
-public:
- FIFOEventTest(const std::string& name);
- ~FIFOEventTest();
-
- void testNoDelegate();
- void testSingleDelegate();
- void testDuplicateRegister();
- void testDuplicateUnregister();
- void testDisabling();
- void testFIFOOrder();
- void testFIFOOrderExpire();
- void testExpire();
- void testExpireReRegister();
- void testReturnParams();
- void testOverwriteDelegate();
- void testAsyncNotify();
-
- void setUp();
- void tearDown();
- static CppUnit::Test* suite();
-
-protected:
-
- void onSimple(const void* pSender, int& i);
- void onSimpleOther(const void* pSender, int& i);
- void onConstSimple(const void* pSender, const int& i);
- void onComplex(const void* pSender, Poco::EventArgs* & i);
- void onComplex2(const void* pSender, Poco::EventArgs & i);
- void onConstComplex(const void* pSender, const Poco::EventArgs*& i);
- void onConst2Complex(const void* pSender, const Poco::EventArgs * const & i);
- void onAsync(const void* pSender, int& i);
-
- int getCount() const;
-private:
- int _count;
-};
-
-
-#endif // FIFOEventTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/FPETest.cpp b/Utilities/Poco/Foundation/testsuite/src/FPETest.cpp
deleted file mode 100755
index 363c846e12..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FPETest.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// FPETest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "FPETest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/FPEnvironment.h"
-
-
-using Poco::FPE;
-
-
-FPETest::FPETest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-FPETest::~FPETest()
-{
-}
-
-
-void FPETest::testClassify()
-{
- {
- float a = 0.0f;
- float b = 0.0f;
- float nan = a/b;
- float inf = 1.0f/b;
-
- assert (FPE::isNaN(nan));
- assert (!FPE::isNaN(a));
- assert (FPE::isInfinite(inf));
- assert (!FPE::isInfinite(a));
- }
- {
- double a = 0;
- double b = 0;
- double nan = a/b;
- double inf = 1.0/b;
-
- assert (FPE::isNaN(nan));
- assert (!FPE::isNaN(a));
- assert (FPE::isInfinite(inf));
- assert (!FPE::isInfinite(a));
- }
-}
-
-
-#if defined(__HP_aCC)
-#pragma OPTIMIZE OFF
-#elif defined(_MSC_VER)
-#pragma optimize("", off)
-#endif
-
-
-double mult(double a, double b)
-{
- return a*b;
-}
-
-
-double div(double a, double b)
-{
- return a/b;
-}
-
-
-void FPETest::testFlags()
-{
- FPE::clearFlags();
-
- // some compilers are intelligent enough to optimize the calculations below away.
- // unfortunately this leads to a failing test, so we have to trick out the
- // compiler's optimizer a little bit by doing something with the results.
- double a = 10;
- double b = 0;
- double c = div(a, b);
-
- assert (FPE::isFlag(FPE::FP_DIVIDE_BY_ZERO));
- assert (FPE::isInfinite(c));
-
- FPE::clearFlags();
- a = 1.23456789e210;
- b = 9.87654321e210;
- c = mult(a, b);
- assert (FPE::isFlag(FPE::FP_OVERFLOW));
- assertEqualDelta(c, c, 0);
-
- FPE::clearFlags();
- a = 1.23456789e-99;
- b = 9.87654321e210;
- c = div(a, b);
- assert (FPE::isFlag(FPE::FP_UNDERFLOW));
- assertEqualDelta(c, c, 0);
-}
-
-
-#if defined(__HP_aCC)
-#pragma OPTIMIZE ON
-#elif defined(_MSC_VER)
-#pragma optimize("", on)
-#endif
-
-
-void FPETest::testRound()
-{
- #if !defined(__osf__) && !defined(__VMS)
- FPE::setRoundingMode(FPE::FP_ROUND_TONEAREST);
- assert (FPE::getRoundingMode() == FPE::FP_ROUND_TONEAREST);
- {
- FPE env(FPE::FP_ROUND_TOWARDZERO);
- assert (FPE::getRoundingMode() == FPE::FP_ROUND_TOWARDZERO);
- }
- assert (FPE::getRoundingMode() == FPE::FP_ROUND_TONEAREST);
- #endif
-}
-
-
-void FPETest::setUp()
-{
-}
-
-
-void FPETest::tearDown()
-{
-}
-
-
-CppUnit::Test* FPETest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FPETest");
-
- CppUnit_addTest(pSuite, FPETest, testClassify);
- CppUnit_addTest(pSuite, FPETest, testFlags);
- CppUnit_addTest(pSuite, FPETest, testRound);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/FPETest.h b/Utilities/Poco/Foundation/testsuite/src/FPETest.h
deleted file mode 100755
index c5acb56b1c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FPETest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// FPETest.h
-//
-// $Id$
-//
-// Definition of the FPETest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef FPETest_INCLUDED
-#define FPETest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class FPETest: public CppUnit::TestCase
-{
-public:
- FPETest(const std::string& name);
- ~FPETest();
-
- void testClassify();
- void testFlags();
- void testRound();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // FPETest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/FileChannelTest.cpp b/Utilities/Poco/Foundation/testsuite/src/FileChannelTest.cpp
deleted file mode 100755
index 5d493cac35..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FileChannelTest.cpp
+++ /dev/null
@@ -1,541 +0,0 @@
-//
-// FileChannelTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "FileChannelTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/FileChannel.h"
-#include "Poco/Message.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/TemporaryFile.h"
-#include "Poco/Thread.h"
-#include "Poco/File.h"
-#include "Poco/Path.h"
-#include "Poco/Timestamp.h"
-#include "Poco/DateTime.h"
-#include "Poco/LocalDateTime.h"
-#include "Poco/DateTimeFormatter.h"
-#include "Poco/DateTimeFormat.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/DirectoryIterator.h"
-#include <vector>
-
-
-using Poco::FileChannel;
-using Poco::Message;
-using Poco::AutoPtr;
-using Poco::TemporaryFile;
-using Poco::Thread;
-using Poco::File;
-using Poco::Path;
-using Poco::Timestamp;
-using Poco::NumberFormatter;
-using Poco::DateTime;
-using Poco::LocalDateTime;
-using Poco::DateTimeFormatter;
-using Poco::DateTimeFormat;
-using Poco::DirectoryIterator;
-
-
-FileChannelTest::FileChannelTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-FileChannelTest::~FileChannelTest()
-{
-}
-
-
-void FileChannelTest::testRotateBySize()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_ROTATION, "2 K");
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- for (int i = 0; i < 200; ++i)
- {
- pChannel->log(msg);
- }
- File f(name + ".0");
- assert (f.exists());
- f = name + ".1";
- assert (f.exists());
- f = name + ".2";
- assert (!f.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testRotateByAge()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_ROTATION, "2 seconds");
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- for (int i = 0; i < 15; ++i)
- {
- pChannel->log(msg);
- Thread::sleep(300);
- }
- File f(name + ".0");
- assert (f.exists());
- f = name + ".1";
- assert (f.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testRotateAtTimeDayUTC()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_TIMES, "utc");
- pChannel->setProperty(FileChannel::PROP_ROTATION, rotation<DateTime>(DAY_HOUR_MIN));
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- int min = DateTime().minute();
- while (DateTime().minute() == min)
- {
- pChannel->log(msg);
- Thread::sleep(1000);
- }
- pChannel->log(msg);
- File f(name + ".0");
- assert (f.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testRotateAtTimeDayLocal()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_TIMES, "local");
- pChannel->setProperty(FileChannel::PROP_ROTATION, rotation<LocalDateTime>(DAY_HOUR_MIN));
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- int min = DateTime().minute();
- while (DateTime().minute() == min)
- {
- pChannel->log(msg);
- Thread::sleep(1000);
- }
- pChannel->log(msg);
- File f(name + ".0");
- assert (f.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testRotateAtTimeHourUTC()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_TIMES, "utc");
- pChannel->setProperty(FileChannel::PROP_ROTATION, rotation<DateTime>(HOUR_MIN));
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- int min = DateTime().minute();
- while (DateTime().minute() == min)
- {
- pChannel->log(msg);
- Thread::sleep(1000);
- }
- pChannel->log(msg);
- File f(name + ".0");
- assert (f.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testRotateAtTimeHourLocal()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_TIMES, "local");
- pChannel->setProperty(FileChannel::PROP_ROTATION, rotation<LocalDateTime>(HOUR_MIN));
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- int min = DateTime().minute();
- while (DateTime().minute() == min)
- {
- pChannel->log(msg);
- Thread::sleep(1000);
- }
- pChannel->log(msg);
- File f(name + ".0");
- assert (f.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testRotateAtTimeMinUTC()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_TIMES, "utc");
- pChannel->setProperty(FileChannel::PROP_ROTATION, rotation<DateTime>(MIN));
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- int min = DateTime().minute();
- while (DateTime().minute() == min)
- {
- pChannel->log(msg);
- Thread::sleep(1000);
- }
- pChannel->log(msg);
- File f(name + ".0");
- assert (f.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testRotateAtTimeMinLocal()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_TIMES, "local");
- pChannel->setProperty(FileChannel::PROP_ROTATION, rotation<LocalDateTime>(MIN));
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- int min = DateTime().minute();
- while (DateTime().minute() == min)
- {
- pChannel->log(msg);
- Thread::sleep(1000);
- }
- pChannel->log(msg);
- File f(name + ".0");
- assert (f.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testArchive()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_ROTATION, "2 K");
- pChannel->setProperty(FileChannel::PROP_ARCHIVE, "number");
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- for (int i = 0; i < 200; ++i)
- {
- pChannel->log(msg);
- }
- File f(name + ".0");
- assert (f.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testCompress()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_ROTATION, "1 K");
- pChannel->setProperty(FileChannel::PROP_ARCHIVE, "number");
- pChannel->setProperty(FileChannel::PROP_COMPRESS, "true");
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- for (int i = 0; i < 200; ++i)
- {
- pChannel->log(msg);
- }
- Thread::sleep(3000); // allow time for background compression
- File f0(name + ".0.gz");
- assert (f0.exists());
- File f1(name + ".1.gz");
- assert (f1.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testPurgeAge()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_ROTATION, "1 K");
- pChannel->setProperty(FileChannel::PROP_ARCHIVE, "number");
- pChannel->setProperty(FileChannel::PROP_PURGEAGE, "5 seconds");
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- for (int i = 0; i < 200; ++i)
- {
- pChannel->log(msg);
- }
- File f0(name + ".0");
- assert (f0.exists());
- File f1(name + ".1");
- assert (f1.exists());
- File f2(name + ".2");
- assert (f2.exists());
-
- Thread::sleep(5000);
- for (int i = 0; i < 50; ++i)
- {
- pChannel->log(msg);
- }
-
- assert (!f2.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::testPurgeCount()
-{
- std::string name = filename();
- try
- {
- AutoPtr<FileChannel> pChannel = new FileChannel(name);
- pChannel->setProperty(FileChannel::PROP_ROTATION, "1 K");
- pChannel->setProperty(FileChannel::PROP_ARCHIVE, "number");
- pChannel->setProperty(FileChannel::PROP_PURGECOUNT, "2");
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- for (int i = 0; i < 200; ++i)
- {
- pChannel->log(msg);
- Thread::sleep(50);
- }
- File f0(name + ".0");
- assert (f0.exists());
- File f1(name + ".1");
- assert (f1.exists());
- File f2(name + ".2");
- assert (!f2.exists());
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void FileChannelTest::setUp()
-{
-}
-
-
-void FileChannelTest::tearDown()
-{
-}
-
-
-void FileChannelTest::remove(const std::string& baseName)
-{
- DirectoryIterator it(Path::current());
- DirectoryIterator end;
- std::vector<std::string> files;
- while (it != end)
- {
- if (it.name().find(baseName) == 0)
- {
- files.push_back(it.name());
- }
- ++it;
- }
- for (std::vector<std::string>::iterator it = files.begin(); it != files.end(); ++it)
- {
- try
- {
- File f(*it);
- f.remove();
- }
- catch (...)
- {
- }
- }
-}
-
-
-std::string FileChannelTest::filename() const
-{
- std::string name = "log_";
- name.append(DateTimeFormatter::format(Timestamp(), "%Y%m%d%H%M%S"));
- name.append(".log");
- return name;
-}
-
-
-template <class DT>
-std::string FileChannelTest::rotation(TimeRotation rtype) const
-{
- DT now;
- std::string rotation;
-
- int day = now.dayOfWeek();
- int min = now.minute();
- int hour = now.hour();
- if (++min == 60)
- {
- ++hour;
- min = 0;
- }
- if (hour == 24)
- {
- hour = 0;
- ++day;
- day %= 7;
- }
-
- switch (rtype)
- {
- case DAY_HOUR_MIN: // day,hh:m,
- rotation = DateTimeFormat::WEEKDAY_NAMES[day];
- rotation += ',' + NumberFormatter::format0(hour, 2) + ':' + NumberFormatter::format0(min, 2);
- break;
- case HOUR_MIN: // hh:mm
- rotation = NumberFormatter::format0(hour, 2) + ':' + NumberFormatter::format0(min, 2);
- break;
- case MIN: // mm
- rotation = ':' + NumberFormatter::format0(min, 2);
- break;
- default:
- rotation = "";
- }
- return rotation;
-}
-
-
-CppUnit::Test* FileChannelTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FileChannelTest");
-
- CppUnit_addTest(pSuite, FileChannelTest, testRotateBySize);
- CppUnit_addTest(pSuite, FileChannelTest, testRotateByAge);
- CppUnit_addTest(pSuite, FileChannelTest, testRotateAtTimeDayUTC);
- CppUnit_addTest(pSuite, FileChannelTest, testRotateAtTimeDayLocal);
- CppUnit_addTest(pSuite, FileChannelTest, testRotateAtTimeHourUTC);
- CppUnit_addTest(pSuite, FileChannelTest, testRotateAtTimeHourLocal);
- CppUnit_addTest(pSuite, FileChannelTest, testRotateAtTimeMinUTC);
- CppUnit_addTest(pSuite, FileChannelTest, testRotateAtTimeMinLocal);
- CppUnit_addTest(pSuite, FileChannelTest, testArchive);
- CppUnit_addTest(pSuite, FileChannelTest, testCompress);
- CppUnit_addTest(pSuite, FileChannelTest, testPurgeAge);
- CppUnit_addTest(pSuite, FileChannelTest, testPurgeCount);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/FileChannelTest.h b/Utilities/Poco/Foundation/testsuite/src/FileChannelTest.h
deleted file mode 100755
index 77a932fa74..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FileChannelTest.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// FileChannelTest.h
-//
-// $Id$
-//
-// Definition of the FileChannelTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef FileChannelTest_INCLUDED
-#define FileChannelTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class FileChannelTest: public CppUnit::TestCase
-{
-public:
- enum TimeRotation
- {
- DAY_HOUR_MIN = 0,
- HOUR_MIN,
- MIN
- };
-
- FileChannelTest(const std::string& name);
- ~FileChannelTest();
-
- void testRotateBySize();
- void testRotateByAge();
- void testRotateAtTimeDayUTC();
- void testRotateAtTimeDayLocal();
- void testRotateAtTimeHourUTC();
- void testRotateAtTimeHourLocal();
- void testRotateAtTimeMinUTC();
- void testRotateAtTimeMinLocal();
- void testArchive();
- void testCompress();
- void testPurgeAge();
- void testPurgeCount();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
- template <class D> std::string rotation(TimeRotation rtype) const;
- void remove(const std::string& baseName);
- std::string filename() const;
-};
-
-
-#endif // FileChannelTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/FileStreamTest.cpp b/Utilities/Poco/Foundation/testsuite/src/FileStreamTest.cpp
deleted file mode 100755
index 1a74f4ebbc..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FileStreamTest.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-//
-// FileStreamTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2007, 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 "FileStreamTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/FileStream.h"
-#include "Poco/File.h"
-#include "Poco/TemporaryFile.h"
-#include "Poco/Exception.h"
-
-
-FileStreamTest::FileStreamTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-FileStreamTest::~FileStreamTest()
-{
-}
-
-
-void FileStreamTest::testRead()
-{
-#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_WIN32_UTF8)
- char tmp[]={'\xc4', '\xd6', '\xdc', '\xe4', '\xf6', '\xfc', '\0'};
- std::string file(tmp);
- file.append(".txt");
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- char tmp[]={'\xc3', '\x84', '\xc3', '\x96', '\xc3', '\x9c', '\xc3', '\xa4', '\xc3', '\xb6', '\xc3', '\xbc', '\0'};
- std::string file(tmp);
- file.append(".txt");
-#else
- std::string file("testfile.txt");
-#endif
-
- Poco::TemporaryFile::registerForDeletion(file);
-
- Poco::FileOutputStream fos(file, std::ios::binary);
- fos << "sometestdata";
- fos.close();
-
- Poco::FileInputStream fis(file);
- assert (fis.good());
- std::string read;
- fis >> read;
- assert (!read.empty());
-}
-
-
-void FileStreamTest::testWrite()
-{
-#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_WIN32_UTF8)
- char tmp[]={'\xdf', '\xc4', '\xd6', '\xdc', '\xe4', '\xf6', '\xfc', '\0'};
- std::string file(tmp);
- file = "dummy_" + file + (".txt");
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- char tmp[]={'\xc3', '\x9f', '\xc3', '\x84', '\xc3', '\x96', '\xc3', '\x9c', '\xc3', '\xa4', '\xc3', '\xb6', '\xc3', '\xbc', '\0'};
- std::string file(tmp);
- file = "dummy_" + file + ".txt";
-#else
- std::string file("dummy_file.txt");
-#endif
-
- Poco::TemporaryFile::registerForDeletion(file);
-
- Poco::FileOutputStream fos(file);
- assert (fos.good());
- fos << "hiho";
- fos.close();
-
- Poco::FileInputStream fis(file);
- assert (fis.good());
- std::string read;
- fis >> read;
- assert (read == "hiho");
-}
-
-
-void FileStreamTest::testReadWrite()
-{
-#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_WIN32_UTF8)
- char tmp[]={'\xdf', '\xc4', '\xd6', '\xdc', '\xe4', '\xf6', '\xfc', '\0'};
- std::string file(tmp);
- file = "dummy_" + file + (".txt");
-#else
- char tmp[]={'\xc3', '\x9f', '\xc3', '\x84', '\xc3', '\x96', '\xc3', '\x9c', '\xc3', '\xa4', '\xc3', '\xb6', '\xc3', '\xbc', '\0'};
- std::string file(tmp);
- file = "dummy_" + file + ".txt";
-#endif
-
- Poco::TemporaryFile::registerForDeletion(file);
-
- Poco::FileStream fos(file);
- assert (fos.good());
- fos << "hiho";
- fos.seekg(0, std::ios::beg);
- std::string read;
- fos >> read;
- assert (read == "hiho");
-}
-
-
-void FileStreamTest::testOpen()
-{
- Poco::FileOutputStream ostr;
- ostr.open("test.txt", std::ios::out);
- assert (ostr.good());
- ostr.close();
-}
-
-
-void FileStreamTest::testOpenModeIn()
-{
- Poco::File f("nonexistent.txt");
- if (f.exists())
- f.remove();
-
- try
- {
- Poco::FileInputStream istr("nonexistent.txt");
- fail("nonexistent file - must throw");
- }
- catch (Poco::Exception&)
- {
- }
-
- f.createFile();
- Poco::FileInputStream istr("nonexistent.txt");
- assert (istr.good());
-}
-
-
-void FileStreamTest::testOpenModeOut()
-{
- Poco::File f("test.txt");
- if (f.exists())
- f.remove();
-
- Poco::FileOutputStream ostr1("test.txt");
- ostr1 << "Hello, world!";
- ostr1.close();
-
- assert (f.exists());
- assert (f.getSize() != 0);
-
- Poco::FileStream str1("test.txt");
- str1.close();
-
- assert (f.exists());
- assert (f.getSize() != 0);
-
- Poco::FileOutputStream ostr2("test.txt");
- ostr2.close();
-
- assert (f.exists());
- assert (f.getSize() == 0);
-
- f.remove();
-}
-
-
-void FileStreamTest::testOpenModeTrunc()
-{
- Poco::File f("test.txt");
- if (f.exists())
- f.remove();
-
- Poco::FileOutputStream ostr1("test.txt");
- ostr1 << "Hello, world!";
- ostr1.close();
-
- assert (f.exists());
- assert (f.getSize() != 0);
-
- Poco::FileStream str1("test.txt", std::ios::trunc);
- str1.close();
-
- assert (f.exists());
- assert (f.getSize() == 0);
-
- f.remove();
-}
-
-
-void FileStreamTest::testOpenModeAte()
-{
- Poco::FileOutputStream ostr("test.txt");
- ostr << "0123456789";
- ostr.close();
-
- Poco::FileStream str1("test.txt", std::ios::ate);
- int c = str1.get();
- assert (str1.eof());
-
- str1.clear();
- str1.seekg(0);
- c = str1.get();
- assert (c == '0');
-
- str1.close();
-
- Poco::FileStream str2("test.txt", std::ios::ate);
- str2 << "abcdef";
- str2.seekg(0);
- std::string s;
- str2 >> s;
- assert (s == "0123456789abcdef");
- str2.close();
-}
-
-
-void FileStreamTest::testOpenModeApp()
-{
- Poco::FileOutputStream ostr("test.txt");
- ostr << "0123456789";
- ostr.close();
-
- Poco::FileStream str1("test.txt", std::ios::app);
-
- str1 << "abc";
-
- str1.seekp(0);
-
- str1 << "def";
-
- str1.close();
-
- Poco::FileInputStream istr("test.txt");
- std::string s;
- istr >> s;
- assert (s == "0123456789abcdef");
- istr.close();
-}
-
-
-void FileStreamTest::testSeek()
-{
- Poco::FileStream str("test.txt", std::ios::trunc);
- str << "0123456789abcdef";
-
- str.seekg(0);
- int c = str.get();
- assert (c == '0');
-
- str.seekg(10);
- assert (str.tellg() == std::streampos(10));
- c = str.get();
- assert (c == 'a');
- assert (str.tellg() == std::streampos(11));
-
- str.seekg(-1, std::ios::end);
- assert (str.tellg() == std::streampos(15));
- c = str.get();
- assert (c == 'f');
- assert (str.tellg() == std::streampos(16));
-
- str.seekg(-1, std::ios::cur);
- assert (str.tellg() == std::streampos(15));
- c = str.get();
- assert (c == 'f');
- assert (str.tellg() == std::streampos(16));
-
- str.seekg(-4, std::ios::cur);
- assert (str.tellg() == std::streampos(12));
- c = str.get();
- assert (c == 'c');
- assert (str.tellg() == std::streampos(13));
-
- str.seekg(1, std::ios::cur);
- assert (str.tellg() == std::streampos(14));
- c = str.get();
- assert (c == 'e');
- assert (str.tellg() == std::streampos(15));
-}
-
-
-void FileStreamTest::setUp()
-{
-}
-
-
-void FileStreamTest::tearDown()
-{
-}
-
-
-CppUnit::Test* FileStreamTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FileStreamTest");
-
- CppUnit_addTest(pSuite, FileStreamTest, testRead);
- CppUnit_addTest(pSuite, FileStreamTest, testWrite);
- CppUnit_addTest(pSuite, FileStreamTest, testReadWrite);
- CppUnit_addTest(pSuite, FileStreamTest, testOpen);
- CppUnit_addTest(pSuite, FileStreamTest, testOpenModeIn);
- CppUnit_addTest(pSuite, FileStreamTest, testOpenModeOut);
- CppUnit_addTest(pSuite, FileStreamTest, testOpenModeTrunc);
- CppUnit_addTest(pSuite, FileStreamTest, testOpenModeAte);
- CppUnit_addTest(pSuite, FileStreamTest, testOpenModeApp);
- CppUnit_addTest(pSuite, FileStreamTest, testSeek);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/FileStreamTest.h b/Utilities/Poco/Foundation/testsuite/src/FileStreamTest.h
deleted file mode 100755
index a2f9c28e5b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FileStreamTest.h
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// FileStreamTest.h
-//
-// $Id$
-//
-// Definition of the FileStreamTest class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef FileStreamTest_INCLUDED
-#define FileStreamTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class FileStreamTest: public CppUnit::TestCase
-{
-public:
- FileStreamTest(const std::string& name);
- ~FileStreamTest();
-
- void testRead();
- void testWrite();
- void testReadWrite();
- void testOpen();
- void testOpenModeIn();
- void testOpenModeOut();
- void testOpenModeTrunc();
- void testOpenModeAte();
- void testOpenModeApp();
- void testSeek();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // FileStreamTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/FileTest.cpp b/Utilities/Poco/Foundation/testsuite/src/FileTest.cpp
deleted file mode 100755
index 76b68e8a1e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FileTest.cpp
+++ /dev/null
@@ -1,541 +0,0 @@
-//
-// FileTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "FileTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/File.h"
-#include "Poco/TemporaryFile.h"
-#include "Poco/Path.h"
-#include "Poco/Exception.h"
-#include "Poco/Thread.h"
-#include <fstream>
-#include <set>
-
-
-using Poco::File;
-using Poco::TemporaryFile;
-using Poco::Path;
-using Poco::Exception;
-using Poco::Timestamp;
-using Poco::Thread;
-
-
-FileTest::FileTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-FileTest::~FileTest()
-{
-}
-
-
-void FileTest::testFileAttributes1()
-{
- File f("testfile.dat");
- assert (!f.exists());
-
- try
- {
- bool flag = f.canRead();
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- bool flag = f.canWrite();
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- bool flag = f.isFile();
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- bool flag = f.isDirectory();
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- Timestamp ts = f.created();
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- Timestamp ts = f.getLastModified();
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- Timestamp ts;
- f.setLastModified(ts);
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- File::FileSize fs = f.getSize();
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- f.setSize(0);
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- f.setWriteable();
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- f.setReadOnly();
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- f.copyTo("copy.dat");
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- f.moveTo("copy.dat");
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- f.renameTo("copy.dat");
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-
- try
- {
- f.remove();
- failmsg("file does not exist - must throw exception");
- }
- catch (Exception&)
- {
- }
-}
-
-
-void FileTest::testCreateFile()
-{
- File f("testfile.dat");
- bool created = f.createFile();
- assert (created);
- assert (!f.isHidden());
- created = f.createFile();
- assert (!created);
-}
-
-
-void FileTest::testFileAttributes2()
-{
- TemporaryFile f;
- bool created = f.createFile();
- Timestamp ts;
- assert (created);
-
- assert (f.exists());
- assert (f.canRead());
- assert (f.canWrite());
- assert (f.isFile());
- assert (!f.isDirectory());
- Timestamp tsc = f.created();
- Timestamp tsm = f.getLastModified();
- assert (tsc - ts >= -2000000 && tsc - ts <= 2000000);
- assert (tsm - ts >= -2000000 && tsm - ts <= 2000000);
-
- f.setWriteable(false);
- assert (!f.canWrite());
- assert (f.canRead());
-
- f.setReadOnly(false);
- assert (f.canWrite());
- assert (f.canRead());
-
- ts = Timestamp::fromEpochTime(1000000);
- f.setLastModified(ts);
- assert (f.getLastModified() == ts);
-}
-
-
-void FileTest::testFileAttributes3()
-{
-#if defined(POCO_OS_FAMILY_UNIX)
- File f("/dev/console");
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- File f("CON");
-#endif
-
- assert (f.isDevice());
- assert (!f.isFile());
- assert (!f.isDirectory());
- assert (!f.isLink());
-}
-
-
-void FileTest::testCompare()
-{
- File f1("abc.txt");
- File f2("def.txt");
- File f3("abc.txt");
-
- assert (f1 == f3);
- assert (!(f1 == f2));
- assert (f1 != f2);
- assert (!(f1 != f3));
- assert (!(f1 == f2));
- assert (f1 < f2);
- assert (f1 <= f2);
- assert (!(f2 < f1));
- assert (!(f2 <= f1));
- assert (f2 > f1);
- assert (f2 >= f1);
- assert (!(f1 > f2));
- assert (!(f1 >= f2));
-
- assert (f1 <= f3);
- assert (f1 >= f3);
-}
-
-
-void FileTest::testRootDir()
-{
-#if defined(POCO_OS_FAMILY_WINDOWS)
- File f1("/");
- File f2("c:/");
- File f3("c:\\");
- File f4("\\");
- assert (f1.exists());
- assert (f2.exists());
- assert (f3.exists());
- assert (f4.exists());
-#else
- File f1("/");
- assert (f1.exists());
-#endif
-}
-
-
-void FileTest::testSwap()
-{
- File f1("abc.txt");
- File f2("def.txt");
- f1.swap(f2);
- assert (f1.path() == "def.txt");
- assert (f2.path() == "abc.txt");
-}
-
-
-void FileTest::testSize()
-{
- std::ofstream ostr("testfile.dat");
- ostr << "Hello, world!" << std::endl;
- ostr.close();
- File f("testfile.dat");
- assert (f.getSize() > 0);
- f.setSize(0);
- assert (f.getSize() == 0);
-}
-
-
-void FileTest::testDirectory()
-{
- File d("testdir");
- try
- {
- d.remove(true);
- }
- catch (...)
- {
- }
- TemporaryFile::registerForDeletion("testdir");
-
- bool created = d.createDirectory();
- assert (created);
- assert (d.isDirectory());
- assert (!d.isFile());
- std::vector<std::string> files;
- d.list(files);
- assert (files.empty());
-
- File f = Path("testdir/file1", Path::PATH_UNIX);
- f.createFile();
- f = Path("testdir/file2", Path::PATH_UNIX);
- f.createFile();
- f = Path("testdir/file3", Path::PATH_UNIX);
- f.createFile();
-
- d.list(files);
- assert (files.size() == 3);
-
- std::set<std::string> fs;
- fs.insert(files.begin(), files.end());
- assert (fs.find("file1") != fs.end());
- assert (fs.find("file2") != fs.end());
- assert (fs.find("file3") != fs.end());
-
- File dd(Path("testdir/testdir2/testdir3", Path::PATH_UNIX));
- dd.createDirectories();
- assert (dd.exists());
- assert (dd.isDirectory());
-
- File ddd(Path("testdir/testdirB/testdirC/testdirD", Path::PATH_UNIX));
- ddd.createDirectories();
- assert (ddd.exists());
- assert (ddd.isDirectory());
-
- d.remove(true);
-}
-
-
-void FileTest::testCopy()
-{
- std::ofstream ostr("testfile.dat");
- ostr << "Hello, world!" << std::endl;
- ostr.close();
-
- File f1("testfile.dat");
- TemporaryFile f2;
- f1.copyTo(f2.path());
- assert (f2.exists());
- assert (f1.getSize() == f2.getSize());
-}
-
-
-void FileTest::testMove()
-{
- std::ofstream ostr("testfile.dat");
- ostr << "Hello, world!" << std::endl;
- ostr.close();
-
- File f1("testfile.dat");
- File::FileSize sz = f1.getSize();
- TemporaryFile f2;
- f1.moveTo(f2.path());
- assert (f2.exists());
- assert (f2.getSize() == sz);
- assert (f1.exists());
- assert (f1 == f2);
-}
-
-
-void FileTest::testCopyDirectory()
-{
- Path pd1("testdir");
- File fd1(pd1);
- try
- {
- fd1.remove(true);
- }
- catch (...)
- {
- }
- fd1.createDirectories();
- Path pd2(pd1, "subdir");
- File fd2(pd2);
- fd2.createDirectories();
- Path pf1(pd1, "testfile1.dat");
- std::ofstream ostr1(pf1.toString().c_str());
- ostr1 << "Hello, world!" << std::endl;
- ostr1.close();
- Path pf2(pd1, "testfile2.dat");
- std::ofstream ostr2(pf2.toString().c_str());
- ostr2 << "Hello, world!" << std::endl;
- ostr2.close();
- Path pf3(pd2, "testfile3.dat");
- std::ofstream ostr3(pf3.toString().c_str());
- ostr3 << "Hello, world!" << std::endl;
- ostr3.close();
-
- File fd3("testdir2");
-
- try
- {
- fd3.remove(true);
- }
- catch (...)
- {
- }
-
- fd1.copyTo("testdir2");
-
- Path pd1t("testdir2");
- File fd1t(pd1t);
- assert (fd1t.exists());
- assert (fd1t.isDirectory());
-
- Path pd2t(pd1t, "subdir");
- File fd2t(pd2t);
- assert (fd2t.exists());
- assert (fd2t.isDirectory());
-
- Path pf1t(pd1t, "testfile1.dat");
- File ff1t(pf1t);
- assert (ff1t.exists());
- assert (ff1t.isFile());
-
- Path pf2t(pd1t, "testfile2.dat");
- File ff2t(pf2t);
- assert (ff2t.exists());
- assert (ff2t.isFile());
-
- Path pf3t(pd2t, "testfile3.dat");
- File ff3t(pf3t);
- assert (ff3t.exists());
- assert (ff3t.isFile());
-
- fd1.remove(true);
- fd3.remove(true);
-}
-
-
-void FileTest::testRename()
-{
- std::ofstream ostr("testfile.dat");
- ostr << "Hello, world!" << std::endl;
- ostr.close();
-
- File f1("testfile.dat");
- File f2("testfile2.dat");
- f1.renameTo(f2.path());
-
- assert (f2.exists());
- assert (f1.exists());
- assert (f1 == f2);
-
- f2.remove();
-}
-
-
-void FileTest::setUp()
-{
- File f("testfile.dat");
- try
- {
- f.remove();
- }
- catch (...)
- {
- }
-}
-
-
-void FileTest::tearDown()
-{
- File f("testfile.dat");
- try
- {
- f.remove();
- }
- catch (...)
- {
- }
-}
-
-
-CppUnit::Test* FileTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FileTest");
-
- CppUnit_addTest(pSuite, FileTest, testFileAttributes1);
- CppUnit_addTest(pSuite, FileTest, testFileAttributes2);
- CppUnit_addTest(pSuite, FileTest, testFileAttributes3);
- CppUnit_addTest(pSuite, FileTest, testCompare);
- CppUnit_addTest(pSuite, FileTest, testSwap);
- CppUnit_addTest(pSuite, FileTest, testSize);
- CppUnit_addTest(pSuite, FileTest, testDirectory);
- CppUnit_addTest(pSuite, FileTest, testCopy);
- CppUnit_addTest(pSuite, FileTest, testMove);
- CppUnit_addTest(pSuite, FileTest, testCopyDirectory);
- CppUnit_addTest(pSuite, FileTest, testRename);
- CppUnit_addTest(pSuite, FileTest, testRootDir);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/FileTest.h b/Utilities/Poco/Foundation/testsuite/src/FileTest.h
deleted file mode 100755
index 950193268f..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FileTest.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// FileTest.h
-//
-// $Id$
-//
-// Definition of the FileTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef FileTest_INCLUDED
-#define FileTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class FileTest: public CppUnit::TestCase
-{
-public:
- FileTest(const std::string& name);
- ~FileTest();
-
- void testFileAttributes1();
- void testCreateFile();
- void testFileAttributes2();
- void testFileAttributes3();
- void testCompare();
- void testSwap();
- void testSize();
- void testDirectory();
- void testCopy();
- void testMove();
- void testCopyDirectory();
- void testRename();
- void testRootDir();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // FileTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/FilesystemTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/FilesystemTestSuite.cpp
deleted file mode 100755
index a52a9ca2d8..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FilesystemTestSuite.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// FilesystemTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "FilesystemTestSuite.h"
-#include "PathTest.h"
-#include "FileTest.h"
-#include "GlobTest.h"
-
-
-CppUnit::Test* FilesystemTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FilesystemTestSuite");
-
- pSuite->addTest(PathTest::suite());
- pSuite->addTest(FileTest::suite());
- pSuite->addTest(GlobTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/FilesystemTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/FilesystemTestSuite.h
deleted file mode 100755
index 64cf0e05af..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FilesystemTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// FilesystemTestSuite.h
-//
-// $Id$
-//
-// Definition of the FilesystemTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef FilesystemTestSuite_INCLUDED
-#define FilesystemTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class FilesystemTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // FilesystemTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/FormatTest.cpp b/Utilities/Poco/Foundation/testsuite/src/FormatTest.cpp
deleted file mode 100755
index e975cf80e6..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FormatTest.cpp
+++ /dev/null
@@ -1,406 +0,0 @@
-//
-// FormatTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Redistributions in any form must be accompanied by information on
-// how to obtain complete source code for this software and any
-// accompanying software that uses this software. The source code
-// must either be included in the distribution or be available for no
-// more than the cost of distribution plus a nominal fee, and must be
-// freely redistributable under reasonable conditions. For an
-// executable file, complete source code means the source code for all
-// modules it contains. It does not include source code for modules or
-// files that typically accompany the major components of the operating
-// system on which the executable file runs.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#include "FormatTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Any.h"
-#include "Poco/Format.h"
-#include "Poco/Exception.h"
-
-
-using Poco::format;
-using Poco::BadCastException;
-using Poco::Int64;
-using Poco::UInt64;
-
-
-FormatTest::FormatTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-FormatTest::~FormatTest()
-{
-}
-
-
-void FormatTest::testChar()
-{
- char c = 'a';
- std::string s(format("%c", c));
- assert (s == "a");
- s = format("%2c", c);
- assert (s == " a");
- s = format("%-2c", c);
- assert (s == "a ");
-
- try
- {
- s = format("%c", std::string("foo"));
- fail("bad argument - must throw");
- }
- catch (BadCastException&)
- {
- }
-}
-
-
-void FormatTest::testInt()
-{
- int i = 42;
- std::string s(format("%d", i));
- assert (s == "42");
- s = format("%4d", i);
- assert (s == " 42");
- s = format("%04d", i);
- assert (s == "0042");
-
- short h = 42;
- s = format("%hd", h);
- assert (s == "42");
- s = format("%4hd", h);
- assert (s == " 42");
- s = format("%04hd", h);
- assert (s == "0042");
-
- unsigned short hu = 42;
- s = format("%hu", hu);
- assert (s == "42");
- s = format("%4hu", hu);
- assert (s == " 42");
- s = format("%04hu", hu);
- assert (s == "0042");
-
- unsigned x = 0x42;
- s = format("%x", x);
- assert (s == "42");
- s = format("%4x", x);
- assert (s == " 42");
- s = format("%04x", x);
- assert (s == "0042");
-
- unsigned o = 042;
- s = format("%o", o);
- assert (s == "42");
- s = format("%4o", o);
- assert (s == " 42");
- s = format("%04o", o);
- assert (s == "0042");
-
- unsigned u = 42;
- s = format("%u", u);
- assert (s == "42");
- s = format("%4u", u);
- assert (s == " 42");
- s = format("%04u", u);
- assert (s == "0042");
-
- long l = 42;
- s = format("%ld", l);
- assert (s == "42");
- s = format("%4ld", l);
- assert (s == " 42");
- s = format("%04ld", l);
- assert (s == "0042");
-
- unsigned long ul = 42;
- s = format("%lu", ul);
- assert (s == "42");
- s = format("%4lu", ul);
- assert (s == " 42");
- s = format("%04lu", ul);
- assert (s == "0042");
-
- unsigned long xl = 0x42;
- s = format("%lx", xl);
- assert (s == "42");
- s = format("%4lx", xl);
- assert (s == " 42");
- s = format("%04lx", xl);
- assert (s == "0042");
-
- Int64 i64 = 42;
- s = format("%Ld", i64);
- assert (s == "42");
- s = format("%4Ld", i64);
- assert (s == " 42");
- s = format("%04Ld", i64);
- assert (s == "0042");
-
- UInt64 ui64 = 42;
- s = format("%Lu", ui64);
- assert (s == "42");
- s = format("%4Lu", ui64);
- assert (s == " 42");
- s = format("%04Lu", ui64);
- assert (s == "0042");
-
- x = 0xaa;
- s = format("%x", x);
- assert (s == "aa");
- s = format("%X", x);
- assert (s == "AA");
-
- i = 42;
- s = format("%+d", i);
- assert (s == "+42");
-
- i = -42;
- s = format("%+d", i);
- assert (s == "-42");
- s = format("%d", i);
- assert (s == "-42");
-
- s = format("%d", i);
- assert (s == "-42");
-
- x = 0x42;
- s = format("%#x", x);
- assert (s == "0x42");
-
- try
- {
- s = format("%d", l);
- fail("bad argument - must throw");
- }
- catch (BadCastException&)
- {
- }
-}
-
-
-void FormatTest::testBool()
-{
- bool b = true;
- std::string s = format("%b", b);
- assert (s == "1");
-
- b = false;
- s = format("%b", b);
- assert (s == "0");
-
- std::vector<Poco::Any> bv;
- bv.push_back(false);
- bv.push_back(true);
- bv.push_back(false);
- bv.push_back(true);
- bv.push_back(false);
- bv.push_back(true);
- bv.push_back(false);
- bv.push_back(true);
- bv.push_back(false);
- bv.push_back(true);
-
- s.clear();
- format(s, "%b%b%b%b%b%b%b%b%b%b", bv);
- assert (s == "0101010101");
-}
-
-
-void FormatTest::testAnyInt()
-{
- char c = 42;
- std::string s(format("%?i", c));
- assert (s == "42");
-
- bool b = true;
- s = format("%?i", b);
- assert (s == "1");
-
- signed char sc = -42;
- s = format("%?i", sc);
- assert (s == "-42");
-
- unsigned char uc = 65;
- s = format("%?i", uc);
- assert (s == "65");
-
- short ss = -134;
- s = format("%?i", ss);
- assert (s == "-134");
-
- unsigned short us = 200;
- s = format("%?i", us);
- assert (s == "200");
-
- int i = -12345;
- s = format("%?i", i);
- assert (s == "-12345");
-
- unsigned ui = 12345;
- s = format("%?i", ui);
- assert (s == "12345");
-
- long l = -54321;
- s = format("%?i", l);
- assert (s == "-54321");
-
- unsigned long ul = 54321;
- s = format("%?i", ul);
- assert (s == "54321");
-
- Int64 i64 = -12345678;
- s = format("%?i", i64);
- assert (s == "-12345678");
-
- UInt64 ui64 = 12345678;
- s = format("%?i", ui64);
- assert (s == "12345678");
-
- ss = 0x42;
- s = format("%?x", ss);
- assert (s == "42");
-
- ss = 042;
- s = format("%?o", ss);
- assert (s == "42");
-}
-
-
-void FormatTest::testFloatFix()
-{
- double d = 1.5;
- std::string s(format("%f", d));
- assert (s.find("1.50") == 0);
-
- s = format("%10f", d);
- assert (s.find(" 1.50") != std::string::npos);
-
- s = format("%6.2f", d);
- assert (s == " 1.50");
- s = format("%-6.2f", d);
- assert (s == "1.50 ");
-
- float f = 1.5;
- s = format("%hf", f);
- assert (s.find("1.50") == 0);
-}
-
-
-void FormatTest::testFloatSci()
-{
- double d = 1.5;
- std::string s(format("%e", d));
- assert (s.find("1.50") == 0);
- assert (s.find("0e+0") != std::string::npos);
-
- s = format("%20e", d);
- assert (s.find(" 1.50") != std::string::npos);
- assert (s.find("0e+0") != std::string::npos);
-
- s = format("%10.2e", d);
- assert (s == " 1.50e+000" || s == " 1.50e+00");
- s = format("%-10.2e", d);
- assert (s == "1.50e+000 " || s == "1.50e+00 ");
- s = format("%-10.2E", d);
- assert (s == "1.50E+000 " || s == "1.50E+00 ");
-}
-
-
-void FormatTest::testString()
-{
- std::string foo("foo");
- std::string s(format("%s", foo));
- assert (s == "foo");
-
- s = format("%5s", foo);
- assert (s == " foo");
-
- s = format("%-5s", foo);
- assert (s == "foo ");
-
- s = format("%s%%a", foo);
- assert (s == "foo%a");
-
- s = format("'%s%%''%s%%'", foo, foo);
- assert (s == "'foo%''foo%'");
-}
-
-
-void FormatTest::testMultiple()
-{
- std::string s(format("aaa%dbbb%4dccc", 1, 2));
- assert (s == "aaa1bbb 2ccc");
-
- s = format("%%%d%%%d%%%d", 1, 2, 3);
- assert (s == "%1%2%3");
-
- s = format("%d%d%d%d", 1, 2, 3, 4);
- assert (s == "1234");
-
- s = format("%d%d%d%d%d", 1, 2, 3, 4, 5);
- assert (s == "12345");
-
- s = format("%d%d%d%d%d%d", 1, 2, 3, 4, 5, 6);
- assert (s == "123456");
-}
-
-
-void FormatTest::setUp()
-{
-}
-
-
-void FormatTest::tearDown()
-{
-}
-
-
-CppUnit::Test* FormatTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FormatTest");
-
- CppUnit_addTest(pSuite, FormatTest, testChar);
- CppUnit_addTest(pSuite, FormatTest, testBool);
- CppUnit_addTest(pSuite, FormatTest, testInt);
- CppUnit_addTest(pSuite, FormatTest, testAnyInt);
- CppUnit_addTest(pSuite, FormatTest, testFloatFix);
- CppUnit_addTest(pSuite, FormatTest, testFloatSci);
- CppUnit_addTest(pSuite, FormatTest, testString);
- CppUnit_addTest(pSuite, FormatTest, testMultiple);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/FormatTest.h b/Utilities/Poco/Foundation/testsuite/src/FormatTest.h
deleted file mode 100755
index 21a429051d..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FormatTest.h
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// FormatTest.h
-//
-// $Id$
-//
-// Definition of the FormatTest class.
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Redistributions in any form must be accompanied by information on
-// how to obtain complete source code for this software and any
-// accompanying software that uses this software. The source code
-// must either be included in the distribution or be available for no
-// more than the cost of distribution plus a nominal fee, and must be
-// freely redistributable under reasonable conditions. For an
-// executable file, complete source code means the source code for all
-// modules it contains. It does not include source code for modules or
-// files that typically accompany the major components of the operating
-// system on which the executable file runs.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#ifndef FormatTest_INCLUDED
-#define FormatTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class FormatTest: public CppUnit::TestCase
-{
-public:
- FormatTest(const std::string& name);
- ~FormatTest();
-
- void testChar();
- void testInt();
- void testBool();
- void testAnyInt();
- void testFloatFix();
- void testFloatSci();
- void testString();
- void testMultiple();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // FormatTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/FoundationTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/FoundationTestSuite.cpp
deleted file mode 100755
index d3df8efa71..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FoundationTestSuite.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// FoundationTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "FoundationTestSuite.h"
-#include "CoreTestSuite.h"
-#include "DateTimeTestSuite.h"
-#include "StreamsTestSuite.h"
-#include "CryptTestSuite.h"
-#include "NotificationsTestSuite.h"
-#include "ThreadingTestSuite.h"
-#include "SharedLibraryTestSuite.h"
-#include "LoggingTestSuite.h"
-#include "FilesystemTestSuite.h"
-#include "UUIDTestSuite.h"
-#include "TextTestSuite.h"
-#include "URITestSuite.h"
-#include "ProcessesTestSuite.h"
-#include "TaskTestSuite.h"
-#include "EventTestSuite.h"
-#include "CacheTestSuite.h"
-#include "HashingTestSuite.h"
-
-
-CppUnit::Test* FoundationTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FoundationTestSuite");
-
- pSuite->addTest(CoreTestSuite::suite());
- pSuite->addTest(DateTimeTestSuite::suite());
- pSuite->addTest(StreamsTestSuite::suite());
- pSuite->addTest(CryptTestSuite::suite());
- pSuite->addTest(NotificationsTestSuite::suite());
- pSuite->addTest(ThreadingTestSuite::suite());
- pSuite->addTest(SharedLibraryTestSuite::suite());
- pSuite->addTest(LoggingTestSuite::suite());
- pSuite->addTest(FilesystemTestSuite::suite());
- pSuite->addTest(UUIDTestSuite::suite());
- pSuite->addTest(TextTestSuite::suite());
- pSuite->addTest(URITestSuite::suite());
- pSuite->addTest(ProcessesTestSuite::suite());
- pSuite->addTest(TaskTestSuite::suite());
- pSuite->addTest(EventTestSuite::suite());
- pSuite->addTest(CacheTestSuite::suite());
- pSuite->addTest(HashingTestSuite::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/FoundationTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/FoundationTestSuite.h
deleted file mode 100755
index 7f699c7749..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/FoundationTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// FoundationTestSuite.h
-//
-// $Id$
-//
-// Definition of the FoundationTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef FoundationTestSuite_INCLUDED
-#define FoundationTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class FoundationTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // FoundationTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/GlobTest.cpp b/Utilities/Poco/Foundation/testsuite/src/GlobTest.cpp
deleted file mode 100755
index 66470e968c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/GlobTest.cpp
+++ /dev/null
@@ -1,529 +0,0 @@
-//
-// GlobTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "GlobTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Glob.h"
-#include "Poco/File.h"
-#include "Poco/Path.h"
-#include <fstream>
-
-
-using Poco::Glob;
-using Poco::File;
-using Poco::Path;
-
-
-GlobTest::GlobTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-GlobTest::~GlobTest()
-{
-}
-
-
-void GlobTest::testMatchChars()
-{
- Glob g1("a");
- assert (g1.match("a"));
- assert (!g1.match("b"));
- assert (!g1.match("aa"));
- assert (!g1.match(""));
-
- Glob g2("ab");
- assert (g2.match("ab"));
- assert (!g2.match("aab"));
- assert (!g2.match("abab"));
-}
-
-
-void GlobTest::testMatchQM()
-{
- Glob g1("?");
- assert (g1.match("a"));
- assert (g1.match("b"));
- assert (!g1.match("aa"));
- assert (g1.match("."));
-
- Glob g2("\\?");
- assert (g2.match("?"));
- assert (!g2.match("a"));
- assert (!g2.match("ab"));
-
- Glob g3("a?");
- assert (g3.match("aa"));
- assert (g3.match("az"));
- assert (!g3.match("a"));
- assert (!g3.match("aaa"));
-
- Glob g4("??");
- assert (g4.match("aa"));
- assert (g4.match("ab"));
- assert (!g4.match("a"));
- assert (!g4.match("abc"));
-
- Glob g5("?a?");
- assert (g5.match("aaa"));
- assert (g5.match("bac"));
- assert (!g5.match("bbc"));
- assert (!g5.match("ba"));
- assert (!g5.match("ab"));
-
- Glob g6("a\\?");
- assert (g6.match("a?"));
- assert (!g6.match("az"));
- assert (!g6.match("a"));
-
- Glob g7("?", Glob::GLOB_DOT_SPECIAL);
- assert (g7.match("a"));
- assert (g7.match("b"));
- assert (!g7.match("aa"));
- assert (!g7.match("."));
-}
-
-
-void GlobTest::testMatchAsterisk()
-{
- Glob g1("*");
- assert (g1.match(""));
- assert (g1.match("a"));
- assert (g1.match("ab"));
- assert (g1.match("abc"));
- assert (g1.match("."));
-
- Glob g2("a*");
- assert (g2.match("a"));
- assert (g2.match("aa"));
- assert (g2.match("abc"));
- assert (!g2.match("b"));
- assert (!g2.match("ba"));
-
- Glob g3("ab*");
- assert (g3.match("ab"));
- assert (g3.match("abc"));
- assert (g3.match("abab"));
- assert (!g3.match("ac"));
- assert (!g3.match("baab"));
-
- Glob g4("*a");
- assert (g4.match("a"));
- assert (g4.match("ba"));
- assert (g4.match("aa"));
- assert (g4.match("aaaaaa"));
- assert (g4.match("bbbbba"));
- assert (!g4.match("b"));
- assert (!g4.match("ab"));
- assert (!g4.match("aaab"));
-
- Glob g5("a*a");
- assert (g5.match("aa"));
- assert (g5.match("aba"));
- assert (g5.match("abba"));
- assert (!g5.match("aab"));
- assert (!g5.match("aaab"));
- assert (!g5.match("baaaa"));
-
- Glob g6("a*b*c");
- assert (g6.match("abc"));
- assert (g6.match("aabbcc"));
- assert (g6.match("abcbbc"));
- assert (g6.match("aaaabbbbcccc"));
- assert (!g6.match("aaaabbbcb"));
-
- Glob g7("a*b*");
- assert (g7.match("aaabbb"));
- assert (g7.match("abababab"));
- assert (g7.match("ab"));
- assert (g7.match("aaaaab"));
- assert (!g7.match("a"));
- assert (!g7.match("aa"));
- assert (!g7.match("aaa"));
-
- Glob g8("**");
- assert (g1.match(""));
- assert (g1.match("a"));
- assert (g1.match("ab"));
- assert (g1.match("abc"));
-
- Glob g9("a\\*");
- assert (g9.match("a*"));
- assert (!g9.match("aa"));
- assert (!g9.match("a"));
-
- Glob g10("a*\\*");
- assert (g10.match("a*"));
- assert (g10.match("aaa*"));
- assert (!g10.match("a"));
- assert (!g10.match("aa"));
-
- Glob g11("*", Glob::GLOB_DOT_SPECIAL);
- assert (g11.match(""));
- assert (g11.match("a"));
- assert (g11.match("ab"));
- assert (g11.match("abc"));
- assert (!g11.match("."));
-}
-
-
-void GlobTest::testMatchRange()
-{
- Glob g1("[a]");
- assert (g1.match("a"));
- assert (!g1.match("b"));
- assert (!g1.match("aa"));
-
- Glob g2("[ab]");
- assert (g2.match("a"));
- assert (g2.match("b"));
- assert (!g2.match("c"));
- assert (!g2.match("ab"));
-
- Glob g3("[abc]");
- assert (g3.match("a"));
- assert (g3.match("b"));
- assert (g3.match("c"));
- assert (!g3.match("ab"));
-
- Glob g4("[a-z]");
- assert (g4.match("a"));
- assert (g4.match("z"));
- assert (!g4.match("A"));
-
- Glob g5("[!a]");
- assert (g5.match("b"));
- assert (g5.match("c"));
- assert (!g5.match("a"));
- assert (!g5.match("bb"));
-
- Glob g6("[!a-z]");
- assert (g6.match("A"));
- assert (!g6.match("a"));
- assert (!g6.match("z"));
-
- Glob g7("[0-9a-zA-Z_]");
- assert (g7.match("0"));
- assert (g7.match("1"));
- assert (g7.match("8"));
- assert (g7.match("9"));
- assert (g7.match("a"));
- assert (g7.match("b"));
- assert (g7.match("z"));
- assert (g7.match("A"));
- assert (g7.match("Z"));
- assert (g7.match("_"));
- assert (!g7.match("-"));
-
- Glob g8("[1-3]");
- assert (g8.match("1"));
- assert (g8.match("2"));
- assert (g8.match("3"));
- assert (!g8.match("0"));
- assert (!g8.match("4"));
-
- Glob g9("[!1-3]");
- assert (g9.match("0"));
- assert (g9.match("4"));
- assert (!g9.match("1"));
- assert (!g9.match("2"));
- assert (!g9.match("3"));
-
- Glob g10("[\\!a]");
- assert (g10.match("!"));
- assert (g10.match("a"));
- assert (!g10.match("x"));
-
- Glob g11("[a\\-c]");
- assert (g11.match("a"));
- assert (g11.match("c"));
- assert (g11.match("-"));
- assert (!g11.match("b"));
-
- Glob g12("[\\]]");
- assert (g12.match("]"));
- assert (!g12.match("["));
-
- Glob g13("[[\\]]");
- assert (g13.match("["));
- assert (g13.match("]"));
- assert (!g13.match("x"));
-
- Glob g14("\\[]");
- assert (g14.match("[]"));
- assert (!g14.match("[["));
-
- Glob g15("a[bc]");
- assert (g15.match("ab"));
- assert (g15.match("ac"));
- assert (!g15.match("a"));
- assert (!g15.match("aa"));
-
- Glob g16("[ab]c");
- assert (g16.match("ac"));
- assert (g16.match("bc"));
- assert (!g16.match("a"));
- assert (!g16.match("b"));
- assert (!g16.match("c"));
- assert (!g16.match("aa"));
-}
-
-
-void GlobTest::testMisc()
-{
- Glob g1("*.cpp");
- assert (g1.match("Glob.cpp"));
- assert (!g1.match("Glob.h"));
-
- Glob g2("*.[hc]");
- assert (g2.match("foo.c"));
- assert (g2.match("foo.h"));
- assert (!g2.match("foo.i"));
-
- Glob g3("*.*");
- assert (g3.match("foo.cpp"));
- assert (g3.match("foo.h"));
- assert (g3.match("foo."));
- assert (!g3.match("foo"));
-
- Glob g4("File*.?pp");
- assert (g4.match("File.hpp"));
- assert (g4.match("File.cpp"));
- assert (g4.match("Filesystem.hpp"));
- assert (!g4.match("File.h"));
-
- Glob g5("File*.[ch]*");
- assert (g5.match("File.hpp"));
- assert (g5.match("File.cpp"));
- assert (g5.match("Filesystem.hpp"));
- assert (g5.match("File.h"));
- assert (g5.match("Filesystem.cp"));
-}
-
-
-void GlobTest::testCaseless()
-{
- Glob g1("*.cpp", Glob::GLOB_CASELESS);
- assert (g1.match("Glob.cpp"));
- assert (!g1.match("Glob.h"));
- assert (g1.match("Glob.CPP"));
- assert (!g1.match("Glob.H"));
-
- Glob g2("*.[hc]", Glob::GLOB_CASELESS);
- assert (g2.match("foo.c"));
- assert (g2.match("foo.h"));
- assert (!g2.match("foo.i"));
- assert (g2.match("foo.C"));
- assert (g2.match("foo.H"));
- assert (!g2.match("foo.I"));
-
- Glob g4("File*.?pp", Glob::GLOB_CASELESS);
- assert (g4.match("file.hpp"));
- assert (g4.match("FILE.CPP"));
- assert (g4.match("filesystem.hpp"));
- assert (g4.match("FILESYSTEM.HPP"));
- assert (!g4.match("FILE.H"));
- assert (!g4.match("file.h"));
-
- Glob g5("File*.[ch]*", Glob::GLOB_CASELESS);
- assert (g5.match("file.hpp"));
- assert (g5.match("FILE.HPP"));
- assert (g5.match("file.cpp"));
- assert (g5.match("FILE.CPP"));
- assert (g5.match("filesystem.hpp"));
- assert (g5.match("FILESYSTEM.HPP"));
- assert (g5.match("file.h"));
- assert (g5.match("FILE.H"));
- assert (g5.match("filesystem.cp"));
- assert (g5.match("FILESYSTEM.CP"));
-
- Glob g6("[abc]", Glob::GLOB_CASELESS);
- assert (g6.match("a"));
- assert (g6.match("b"));
- assert (g6.match("c"));
- assert (g6.match("A"));
- assert (g6.match("B"));
- assert (g6.match("C"));
-
- Glob g7("[a-f]", Glob::GLOB_CASELESS);
- assert (g7.match("a"));
- assert (g7.match("b"));
- assert (g7.match("f"));
- assert (!g7.match("g"));
- assert (g7.match("A"));
- assert (g7.match("B"));
- assert (g7.match("F"));
- assert (!g7.match("G"));
-
- Glob g8("[A-F]", Glob::GLOB_CASELESS);
- assert (g8.match("a"));
- assert (g8.match("b"));
- assert (g8.match("f"));
- assert (!g8.match("g"));
- assert (g8.match("A"));
- assert (g8.match("B"));
- assert (g8.match("F"));
- assert (!g8.match("G"));
-}
-
-
-void GlobTest::testGlob()
-{
- createFile("globtest/Makefile");
- createFile("globtest/.hidden");
- createFile("globtest/include/one.h");
- createFile("globtest/include/two.h");
- createFile("globtest/src/one.c");
- createFile("globtest/src/two.c");
- createFile("globtest/src/main.c");
- createFile("globtest/testsuite/src/test.h");
- createFile("globtest/testsuite/src/test.c");
- createFile("globtest/testsuite/src/main.c");
-
- std::set<std::string> files;
- Glob::glob("globtest/*", files);
- translatePaths(files);
- assert (files.size() == 5);
- assert (files.find("globtest/Makefile") != files.end());
- assert (files.find("globtest/.hidden") != files.end());
- assert (files.find("globtest/include/") != files.end());
- assert (files.find("globtest/src/") != files.end());
- assert (files.find("globtest/testsuite/") != files.end());
-
- files.clear();
- Glob::glob("GlobTest/*", files, Glob::GLOB_CASELESS);
- translatePaths(files);
- assert (files.size() == 5);
- assert (files.find("globtest/Makefile") != files.end());
- assert (files.find("globtest/.hidden") != files.end());
- assert (files.find("globtest/include/") != files.end());
- assert (files.find("globtest/src/") != files.end());
- assert (files.find("globtest/testsuite/") != files.end());
-
- files.clear();
- Glob::glob("globtest/*/*.[hc]", files);
- translatePaths(files);
- assert (files.size() == 5);
- assert (files.find("globtest/include/one.h") != files.end());
- assert (files.find("globtest/include/two.h") != files.end());
- assert (files.find("globtest/src/one.c") != files.end());
- assert (files.find("globtest/src/one.c") != files.end());
- assert (files.find("globtest/src/main.c") != files.end());
-
- files.clear();
- Glob::glob("gl?bt?st/*/*/*.c", files);
- translatePaths(files);
- assert (files.size() == 2);
- assert (files.find("globtest/testsuite/src/test.c") != files.end());
- assert (files.find("globtest/testsuite/src/main.c") != files.end());
-
- files.clear();
- Glob::glob("Gl?bT?st/*/*/*.C", files, Glob::GLOB_CASELESS);
- translatePaths(files);
- assert (files.size() == 2);
- assert (files.find("globtest/testsuite/src/test.c") != files.end());
- assert (files.find("globtest/testsuite/src/main.c") != files.end());
-
- files.clear();
- Glob::glob("globtest/*/src/*", files);
- translatePaths(files);
- assert (files.size() == 3);
- assert (files.find("globtest/testsuite/src/test.h") != files.end());
- assert (files.find("globtest/testsuite/src/test.c") != files.end());
- assert (files.find("globtest/testsuite/src/main.c") != files.end());
-
- files.clear();
- Glob::glob("globtest/*/", files);
- translatePaths(files);
- assert (files.size() == 3);
- assert (files.find("globtest/include/") != files.end());
- assert (files.find("globtest/src/") != files.end());
- assert (files.find("globtest/testsuite/") != files.end());
-
- files.clear();
- Glob::glob("../*/globtest/*/", files);
- translatePaths(files);
- assert (files.size() == 3);
-
- File dir("globtest");
- dir.remove(true);
-}
-
-
-void GlobTest::createFile(const std::string& path)
-{
- Path p(path, Path::PATH_UNIX);
- File dir(p.parent());
- dir.createDirectories();
- std::ofstream ostr(path.c_str());
- ostr << path << std::endl;
-}
-
-
-void GlobTest::translatePaths(std::set<std::string>& paths)
-{
- std::set<std::string> translated;
- for (std::set<std::string>::const_iterator it = paths.begin(); it != paths.end(); ++it)
- {
- Path p(*it);
- std::string tp(p.toString(Path::PATH_UNIX));
- translated.insert(tp);
- }
- paths = translated;
-}
-
-
-void GlobTest::setUp()
-{
-}
-
-
-void GlobTest::tearDown()
-{
-}
-
-
-CppUnit::Test* GlobTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("GlobTest");
-
- CppUnit_addTest(pSuite, GlobTest, testMatchChars);
- CppUnit_addTest(pSuite, GlobTest, testMatchQM);
- CppUnit_addTest(pSuite, GlobTest, testMatchAsterisk);
- CppUnit_addTest(pSuite, GlobTest, testMatchRange);
- CppUnit_addTest(pSuite, GlobTest, testMisc);
- CppUnit_addTest(pSuite, GlobTest, testCaseless);
- CppUnit_addTest(pSuite, GlobTest, testGlob);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/GlobTest.h b/Utilities/Poco/Foundation/testsuite/src/GlobTest.h
deleted file mode 100755
index a03ef1b1c9..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/GlobTest.h
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// GlobTest.h
-//
-// $Id$
-//
-// Definition of the GlobTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef GlobTest_INCLUDED
-#define GlobTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include <set>
-
-
-class GlobTest: public CppUnit::TestCase
-{
-public:
- GlobTest(const std::string& name);
- ~GlobTest();
-
- void testMatchChars();
- void testMatchQM();
- void testMatchAsterisk();
- void testMatchRange();
- void testMisc();
- void testGlob();
- void testCaseless();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
- void createFile(const std::string& path);
- void translatePaths(std::set<std::string>& paths);
-};
-
-
-#endif // GlobTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/HMACEngineTest.cpp b/Utilities/Poco/Foundation/testsuite/src/HMACEngineTest.cpp
deleted file mode 100755
index 8a996a693b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HMACEngineTest.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// HMACEngineTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "HMACEngineTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/HMACEngine.h"
-#include "Poco/MD5Engine.h"
-
-
-using Poco::HMACEngine;
-using Poco::MD5Engine;
-using Poco::DigestEngine;
-
-
-HMACEngineTest::HMACEngineTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-HMACEngineTest::~HMACEngineTest()
-{
-}
-
-
-void HMACEngineTest::testHMAC()
-{
- // test vectors from RFC 2104
-
- std::string key(16, 0x0b);
- std::string data("Hi There");
- HMACEngine<MD5Engine> hmac1(key);
- hmac1.update(data);
- std::string digest = DigestEngine::digestToHex(hmac1.digest());
- assert (digest == "9294727a3638bb1c13f48ef8158bfc9d");
-
- key = "Jefe";
- data = "what do ya want for nothing?";
- HMACEngine<MD5Engine> hmac2(key);
- hmac2.update(data);
- digest = DigestEngine::digestToHex(hmac2.digest());
- assert (digest == "750c783e6ab0b503eaa86e310a5db738");
-
- key = std::string(16, 0xaa);
- data = std::string(50, 0xdd);
- HMACEngine<MD5Engine> hmac3(key);
- hmac3.update(data);
- digest = DigestEngine::digestToHex(hmac3.digest());
- assert (digest == "56be34521d144c88dbb8c733f0e8b3f6");
-}
-
-
-void HMACEngineTest::setUp()
-{
-}
-
-
-void HMACEngineTest::tearDown()
-{
-}
-
-
-CppUnit::Test* HMACEngineTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HMACEngineTest");
-
- CppUnit_addTest(pSuite, HMACEngineTest, testHMAC);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/HMACEngineTest.h b/Utilities/Poco/Foundation/testsuite/src/HMACEngineTest.h
deleted file mode 100755
index e0ad07c3fb..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HMACEngineTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// HMACEngineTest.h
-//
-// $Id$
-//
-// Definition of the HMACEngineTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef HMACEngineTest_INCLUDED
-#define HMACEngineTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class HMACEngineTest: public CppUnit::TestCase
-{
-public:
- HMACEngineTest(const std::string& name);
- ~HMACEngineTest();
-
- void testHMAC();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // HMACEngineTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/HashMapTest.cpp b/Utilities/Poco/Foundation/testsuite/src/HashMapTest.cpp
deleted file mode 100755
index aa9b083a53..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HashMapTest.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
-//
-// HashMapTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "HashMapTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/HashMap.h"
-#include "Poco/Exception.h"
-#include <map>
-
-
-using Poco::HashMap;
-
-
-HashMapTest::HashMapTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-HashMapTest::~HashMapTest()
-{
-}
-
-
-void HashMapTest::testInsert()
-{
- const int N = 1000;
-
- typedef HashMap<int, int> IntMap;
- IntMap hm;
-
- assert (hm.empty());
-
- for (int i = 0; i < N; ++i)
- {
- std::pair<IntMap::Iterator, bool> res = hm.insert(IntMap::ValueType(i, i*2));
- assert (res.first->first == i);
- assert (res.first->second == i*2);
- assert (res.second);
- IntMap::Iterator it = hm.find(i);
- assert (it != hm.end());
- assert (it->first == i);
- assert (it->second == i*2);
- assert (hm.size() == i + 1);
- }
-
- assert (!hm.empty());
-
- for (int i = 0; i < N; ++i)
- {
- IntMap::Iterator it = hm.find(i);
- assert (it != hm.end());
- assert (it->first == i);
- assert (it->second == i*2);
- }
-
- for (int i = 0; i < N; ++i)
- {
- std::pair<IntMap::Iterator, bool> res = hm.insert(IntMap::ValueType(i, 0));
- assert (res.first->first == i);
- assert (res.first->second == i*2);
- assert (!res.second);
- }
-}
-
-
-void HashMapTest::testErase()
-{
- const int N = 1000;
-
- typedef HashMap<int, int> IntMap;
- IntMap hm;
-
- for (int i = 0; i < N; ++i)
- {
- hm.insert(IntMap::ValueType(i, i*2));
- }
- assert (hm.size() == N);
-
- for (int i = 0; i < N; i += 2)
- {
- hm.erase(i);
- IntMap::Iterator it = hm.find(i);
- assert (it == hm.end());
- }
- assert (hm.size() == N/2);
-
- for (int i = 0; i < N; i += 2)
- {
- IntMap::Iterator it = hm.find(i);
- assert (it == hm.end());
- }
-
- for (int i = 1; i < N; i += 2)
- {
- IntMap::Iterator it = hm.find(i);
- assert (it != hm.end());
- assert (*it == i);
- }
-
- for (int i = 0; i < N; i += 2)
- {
- hm.insert(IntMap::ValueType(i, i*2));
- }
-
- for (int i = 0; i < N; ++i)
- {
- IntMap::Iterator it = hm.find(i);
- assert (it != hm.end());
- assert (it->first == i);
- assert (it->second == i*2);
- }
-}
-
-
-void HashMapTest::testIterator()
-{
- const int N = 1000;
-
- typedef HashMap<int, int> IntMap;
- IntMap hm;
-
- for (int i = 0; i < N; ++i)
- {
- hm.insert(IntMap::ValueType(i, i*2));
- }
-
- std::map<int, int> values;
- IntMap::Iterator it = hm.begin();
- while (it != hm.end())
- {
- assert (values.find(it->first) == values.end());
- values[it->first] = it->second;
- ++it;
- }
-
- assert (values.size() == N);
-}
-
-
-void HashMapTest::testConstIterator()
-{
- const int N = 1000;
-
- typedef HashMap<int, int> IntMap;
- IntMap hm;
-
- for (int i = 0; i < N; ++i)
- {
- hm.insert(IntMap::ValueType(i, i*2));
- }
-
- std::map<int, int> values;
- IntMap::ConstIterator it = hm.begin();
- while (it != hm.end())
- {
- assert (values.find(it->first) == values.end());
- values[it->first] = it->second;
- ++it;
- }
-
- assert (values.size() == N);
-}
-
-
-void HashMapTest::testIndex()
-{
- typedef HashMap<int, int> IntMap;
- IntMap hm;
-
- hm[1] = 2;
- hm[2] = 4;
- hm[3] = 6;
-
- assert (hm.size() == 3);
- assert (hm[1] == 2);
- assert (hm[2] == 4);
- assert (hm[3] == 6);
-
- try
- {
- const IntMap& im = hm;
- int x = im[4];
- fail("no such key - must throw");
- }
- catch (Poco::NotFoundException&)
- {
- }
-}
-
-
-void HashMapTest::setUp()
-{
-}
-
-
-void HashMapTest::tearDown()
-{
-}
-
-
-CppUnit::Test* HashMapTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HashMapTest");
-
- CppUnit_addTest(pSuite, HashMapTest, testInsert);
- CppUnit_addTest(pSuite, HashMapTest, testErase);
- CppUnit_addTest(pSuite, HashMapTest, testIterator);
- CppUnit_addTest(pSuite, HashMapTest, testConstIterator);
- CppUnit_addTest(pSuite, HashMapTest, testIndex);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/HashMapTest.h b/Utilities/Poco/Foundation/testsuite/src/HashMapTest.h
deleted file mode 100755
index 2cd4e39174..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HashMapTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// HashMapTest.h
-//
-// $Id$
-//
-// Definition of the HashMapTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef HashMapTest_INCLUDED
-#define HashMapTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class HashMapTest: public CppUnit::TestCase
-{
-public:
- HashMapTest(const std::string& name);
- ~HashMapTest();
-
- void testInsert();
- void testErase();
- void testIterator();
- void testConstIterator();
- void testIndex();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // HashMapTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/HashSetTest.cpp b/Utilities/Poco/Foundation/testsuite/src/HashSetTest.cpp
deleted file mode 100755
index 234a97087a..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HashSetTest.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-//
-// HashSetTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "HashSetTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/HashSet.h"
-#include <set>
-
-
-using Poco::Hash;
-using Poco::HashSet;
-
-
-HashSetTest::HashSetTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-HashSetTest::~HashSetTest()
-{
-}
-
-
-void HashSetTest::testInsert()
-{
- const int N = 1000;
-
- HashSet<int, Hash<int> > hs;
-
- assert (hs.empty());
-
- for (int i = 0; i < N; ++i)
- {
- std::pair<HashSet<int, Hash<int> >::Iterator, bool> res = hs.insert(i);
- assert (*res.first == i);
- assert (res.second);
- HashSet<int, Hash<int> >::Iterator it = hs.find(i);
- assert (it != hs.end());
- assert (*it == i);
- assert (hs.size() == i + 1);
- }
-
- assert (!hs.empty());
-
- for (int i = 0; i < N; ++i)
- {
- HashSet<int, Hash<int> >::Iterator it = hs.find(i);
- assert (it != hs.end());
- assert (*it == i);
- }
-
- for (int i = 0; i < N; ++i)
- {
- std::pair<HashSet<int, Hash<int> >::Iterator, bool> res = hs.insert(i);
- assert (*res.first == i);
- assert (!res.second);
- }
-}
-
-
-void HashSetTest::testErase()
-{
- const int N = 1000;
-
- HashSet<int, Hash<int> > hs;
-
- for (int i = 0; i < N; ++i)
- {
- hs.insert(i);
- }
- assert (hs.size() == N);
-
- for (int i = 0; i < N; i += 2)
- {
- hs.erase(i);
- HashSet<int, Hash<int> >::Iterator it = hs.find(i);
- assert (it == hs.end());
- }
- assert (hs.size() == N/2);
-
- for (int i = 0; i < N; i += 2)
- {
- HashSet<int, Hash<int> >::Iterator it = hs.find(i);
- assert (it == hs.end());
- }
-
- for (int i = 1; i < N; i += 2)
- {
- HashSet<int, Hash<int> >::Iterator it = hs.find(i);
- assert (it != hs.end());
- assert (*it == i);
- }
-
- for (int i = 0; i < N; i += 2)
- {
- hs.insert(i);
- }
-
- for (int i = 0; i < N; ++i)
- {
- HashSet<int, Hash<int> >::Iterator it = hs.find(i);
- assert (it != hs.end());
- assert (*it == i);
- }
-}
-
-
-void HashSetTest::testIterator()
-{
- const int N = 1000;
-
- HashSet<int, Hash<int> > hs;
-
- for (int i = 0; i < N; ++i)
- {
- hs.insert(i);
- }
-
- std::set<int> values;
- HashSet<int, Hash<int> >::Iterator it = hs.begin();
- while (it != hs.end())
- {
- assert (values.find(*it) == values.end());
- values.insert(*it);
- ++it;
- }
-
- assert (values.size() == N);
-}
-
-
-void HashSetTest::testConstIterator()
-{
- const int N = 1000;
-
- HashSet<int, Hash<int> > hs;
-
- for (int i = 0; i < N; ++i)
- {
- hs.insert(i);
- }
-
- std::set<int> values;
- HashSet<int, Hash<int> >::ConstIterator it = hs.begin();
- while (it != hs.end())
- {
- assert (values.find(*it) == values.end());
- values.insert(*it);
- ++it;
- }
-
- assert (values.size() == N);
-}
-
-
-void HashSetTest::setUp()
-{
-}
-
-
-void HashSetTest::tearDown()
-{
-}
-
-
-CppUnit::Test* HashSetTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HashSetTest");
-
- CppUnit_addTest(pSuite, HashSetTest, testInsert);
- CppUnit_addTest(pSuite, HashSetTest, testErase);
- CppUnit_addTest(pSuite, HashSetTest, testIterator);
- CppUnit_addTest(pSuite, HashSetTest, testConstIterator);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/HashSetTest.h b/Utilities/Poco/Foundation/testsuite/src/HashSetTest.h
deleted file mode 100755
index 43f33a5de5..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HashSetTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// HashSetTest.h
-//
-// $Id$
-//
-// Definition of the HashSetTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef HashSetTest_INCLUDED
-#define HashSetTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class HashSetTest: public CppUnit::TestCase
-{
-public:
- HashSetTest(const std::string& name);
- ~HashSetTest();
-
- void testInsert();
- void testErase();
- void testIterator();
- void testConstIterator();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // HashSetTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/HashTableTest.cpp b/Utilities/Poco/Foundation/testsuite/src/HashTableTest.cpp
deleted file mode 100755
index 3941047598..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HashTableTest.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-//
-// HashTableTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "HashTableTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/HashTable.h"
-#include "Poco/NumberFormatter.h"
-
-
-using namespace Poco;
-
-
-HashTableTest::HashTableTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-HashTableTest::~HashTableTest()
-{
-}
-
-
-void HashTableTest::testInsert()
-{
- std::string s1("str1");
- std::string s2("str2");
- HashTable<std::string, int> hashTable;
- assert (!hashTable.exists(s1));
- hashTable.insert(s1, 13);
- assert (hashTable.exists(s1));
- assert (hashTable.get(s1) == 13);
- int retVal = 0;
-
- assert (hashTable.get(s1, retVal));
- assert (retVal == 13);
- try
- {
- hashTable.insert(s1, 22);
- failmsg ("duplicate insert must fail");
- }
- catch (Exception&){}
- try
- {
- hashTable.get(s2);
- failmsg ("getting a non inserted item must fail");
- }
- catch (Exception&){}
-
- assert (!hashTable.exists(s2));
- hashTable.insert(s2, 13);
- assert (hashTable.exists(s2));
-}
-
-
-void HashTableTest::testUpdate()
-{
- // add code for second test here
- std::string s1("str1");
- std::string s2("str2");
- HashTable<std::string, int> hashTable;
- hashTable.insert(s1, 13);
- hashTable.update(s1, 14);
- assert (hashTable.exists(s1));
- assert (hashTable.get(s1) == 14);
- int retVal = 0;
-
- assert (hashTable.get(s1, retVal));
- assert (retVal == 14);
-
- // updating a non existing item must work too
- hashTable.update(s2, 15);
- assert (hashTable.get(s2) == 15);
-}
-
-
-void HashTableTest::testOverflow()
-{
- HashTable<std::string, int> hashTable(13);
- for (int i = 0; i < 1024; ++i)
- {
- hashTable.insert(Poco::NumberFormatter::format(i), i*i);
- }
-
- for (int i = 0; i < 1024; ++i)
- {
- std::string tmp = Poco::NumberFormatter::format(i);
- assert (hashTable.exists(tmp));
- assert (hashTable.get(tmp) == i*i);
- }
-}
-
-
-void HashTableTest::testSize()
-{
- HashTable<std::string, int> hashTable(13);
- assert (hashTable.size() == 0);
- Poco::UInt32 h1 = hashTable.insert("1", 1);
- assert (hashTable.size() == 1);
- Poco::UInt32 h2 = hashTable.update("2", 2);
- assert (hashTable.size() == 2);
- hashTable.remove("1");
- assert (hashTable.size() == 1);
- hashTable.remove("3");
- assert (hashTable.size() == 1);
- hashTable.removeRaw("2", h2);
- assert (hashTable.size() == 0);
- hashTable.insert("1", 1);
- hashTable.insert("2", 2);
- assert (hashTable.size() == 2);
- hashTable.clear();
- assert (hashTable.size() == 0);
-}
-
-
-void HashTableTest::testResize()
-{
- HashTable<std::string, int> hashTable(13);
- assert (hashTable.size() == 0);
- hashTable.resize(19);
- for (int i = 0; i < 1024; ++i)
- {
- hashTable.insert(Poco::NumberFormatter::format(i), i*i);
- }
- hashTable.resize(1009);
-
- for (int i = 0; i < 1024; ++i)
- {
- std::string tmp = Poco::NumberFormatter::format(i);
- assert (hashTable.exists(tmp));
- assert (hashTable.get(tmp) == i*i);
- }
-}
-
-
-void HashTableTest::testStatistic()
-{
- double relax = 0.001;
- HashTable<std::string, int> hashTable(13);
- assert (hashTable.size() == 0);
- HashStatistic stat1(hashTable.currentState());
- assert (stat1.avgEntriesPerHash() < relax && stat1.avgEntriesPerHash() > -relax);
- assert (stat1.maxPositionsOfTable() == 13);
- assert (stat1.maxEntriesPerHash() == 0);
-
- hashTable.resize(19);
- stat1 = hashTable.currentState(true);
- assert (stat1.avgEntriesPerHash() < relax && stat1.avgEntriesPerHash() > -relax);
- assert (stat1.maxPositionsOfTable() == 19);
- assert (stat1.maxEntriesPerHash() == 0);
- assert (stat1.detailedEntriesPerHash().size() == 19);
-
- for (int i = 0; i < 1024; ++i)
- {
- hashTable.insert(Poco::NumberFormatter::format(i), i*i);
- }
- stat1 = hashTable.currentState(true);
- double expAvg = 1024.0/ 19;
- assert (stat1.avgEntriesPerHash() < (expAvg + relax) && stat1.avgEntriesPerHash() > (expAvg - relax));
- assert (stat1.maxPositionsOfTable() == 19);
- assert (stat1.maxEntriesPerHash() > expAvg);
- hashTable.resize(1009);
- stat1 = hashTable.currentState(true);
-
- expAvg = 1024.0/ 1009;
-
- assert (stat1.avgEntriesPerHash() < (expAvg + relax) && stat1.avgEntriesPerHash() > (expAvg - relax));
- assert (stat1.maxPositionsOfTable() == 1009);
- assert (stat1.maxEntriesPerHash() > expAvg);
-}
-
-
-void HashTableTest::setUp()
-{
-}
-
-
-void HashTableTest::tearDown()
-{
-}
-
-
-CppUnit::Test* HashTableTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HashTableTest");
-
- CppUnit_addTest(pSuite, HashTableTest, testInsert);
- CppUnit_addTest(pSuite, HashTableTest, testUpdate);
- CppUnit_addTest(pSuite, HashTableTest, testOverflow);
- CppUnit_addTest(pSuite, HashTableTest, testSize);
- CppUnit_addTest(pSuite, HashTableTest, testResize);
- CppUnit_addTest(pSuite, HashTableTest, testStatistic);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/HashTableTest.h b/Utilities/Poco/Foundation/testsuite/src/HashTableTest.h
deleted file mode 100755
index b4a968ee63..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HashTableTest.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// HashTableTest.h
-//
-// $Id$
-//
-// Definition of the HashTableTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef HashTableTest_INCLUDED
-#define HashTableTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class HashTableTest: public CppUnit::TestCase
-{
-public:
- HashTableTest(const std::string& name);
- ~HashTableTest();
-
- void testInsert();
- void testOverflow();
- void testUpdate();
- void testSize();
- void testResize();
- void testStatistic();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // HashTableTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/HashingTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/HashingTestSuite.cpp
deleted file mode 100755
index 59a0c8a51f..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HashingTestSuite.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// HashingTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "HashingTestSuite.h"
-#include "HashTableTest.h"
-#include "SimpleHashTableTest.h"
-#include "LinearHashTableTest.h"
-#include "HashSetTest.h"
-#include "HashMapTest.h"
-
-
-CppUnit::Test* HashingTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HashingTestSuite");
-
- pSuite->addTest(HashTableTest::suite());
- pSuite->addTest(SimpleHashTableTest::suite());
- pSuite->addTest(LinearHashTableTest::suite());
- pSuite->addTest(HashSetTest::suite());
- pSuite->addTest(HashMapTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/HashingTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/HashingTestSuite.h
deleted file mode 100755
index 1a3c4aed98..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HashingTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// HashingTestSuite.h
-//
-// $Id$
-//
-// Definition of the HashingTestSuite class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef HashingTestSuite_INCLUDED
-#define HashingTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class HashingTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // HashingTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/HexBinaryTest.cpp b/Utilities/Poco/Foundation/testsuite/src/HexBinaryTest.cpp
deleted file mode 100755
index 97005f50a4..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HexBinaryTest.cpp
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// HexBinaryTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "HexBinaryTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/HexBinaryEncoder.h"
-#include "Poco/HexBinaryDecoder.h"
-#include "Poco/Exception.h"
-#include <sstream>
-
-
-using Poco::HexBinaryEncoder;
-using Poco::HexBinaryDecoder;
-using Poco::DataFormatException;
-
-
-HexBinaryTest::HexBinaryTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-HexBinaryTest::~HexBinaryTest()
-{
-}
-
-
-void HexBinaryTest::testEncoder()
-{
- {
- std::ostringstream str;
- HexBinaryEncoder encoder(str);
- encoder << std::string("\00\01\02\03\04\05", 6);
- encoder.close();
- assert (str.str() == "000102030405");
- }
- {
- std::ostringstream str;
- HexBinaryEncoder encoder(str);
- encoder << std::string("\00\01\02\03", 4);
- encoder.close();
- assert (str.str() == "00010203");
- }
- {
- std::ostringstream str;
- HexBinaryEncoder encoder(str);
- encoder << "ABCDEF";
- encoder << char(0xaa) << char(0xbb);
- encoder.close();
- assert (str.str() == "414243444546aabb");
- }
- {
- std::ostringstream str;
- HexBinaryEncoder encoder(str);
- encoder.rdbuf()->setUppercase();
- encoder << "ABCDEF";
- encoder << char(0xaa) << char(0xbb);
- encoder.close();
- assert (str.str() == "414243444546AABB");
- }
-}
-
-
-void HexBinaryTest::testDecoder()
-{
- {
- std::istringstream istr("000102030405");
- HexBinaryDecoder decoder(istr);
- assert (decoder.good() && decoder.get() == 0);
- assert (decoder.good() && decoder.get() == 1);
- assert (decoder.good() && decoder.get() == 2);
- assert (decoder.good() && decoder.get() == 3);
- assert (decoder.good() && decoder.get() == 4);
- assert (decoder.good() && decoder.get() == 5);
- assert (decoder.good() && decoder.get() == -1);
- }
- {
- std::istringstream istr("0001020304");
- HexBinaryDecoder decoder(istr);
- assert (decoder.good() && decoder.get() == 0);
- assert (decoder.good() && decoder.get() == 1);
- assert (decoder.good() && decoder.get() == 2);
- assert (decoder.good() && decoder.get() == 3);
- assert (decoder.good() && decoder.get() == 4);
- assert (decoder.good() && decoder.get() == -1);
- }
- {
- std::istringstream istr("0a0bcdef");
- HexBinaryDecoder decoder(istr);
- assert (decoder.good() && decoder.get() == 0x0a);
- assert (decoder.good() && decoder.get() == 0x0b);
- assert (decoder.good() && decoder.get() == 0xcd);
- assert (decoder.good() && decoder.get() == 0xef);
- assert (decoder.good() && decoder.get() == -1);
- }
- {
- std::istringstream istr("0A0BCDEF");
- HexBinaryDecoder decoder(istr);
- assert (decoder.good() && decoder.get() == 0x0a);
- assert (decoder.good() && decoder.get() == 0x0b);
- assert (decoder.good() && decoder.get() == 0xcd);
- assert (decoder.good() && decoder.get() == 0xef);
- assert (decoder.good() && decoder.get() == -1);
- }
- {
- std::istringstream istr("00 01 02 03");
- HexBinaryDecoder decoder(istr);
- assert (decoder.good() && decoder.get() == 0);
- assert (decoder.good() && decoder.get() == 1);
- assert (decoder.good() && decoder.get() == 2);
- assert (decoder.good() && decoder.get() == 3);
- assert (decoder.good() && decoder.get() == -1);
- }
- {
- std::istringstream istr("414243444546");
- HexBinaryDecoder decoder(istr);
- std::string s;
- decoder >> s;
- assert (s == "ABCDEF");
- assert (decoder.eof());
- assert (!decoder.fail());
- }
- {
- std::istringstream istr("4041\r\n4243\r\n4445");
- HexBinaryDecoder decoder(istr);
- std::string s;
- decoder >> s;
- assert (s == "@ABCDE");
- assert (decoder.eof());
- assert (!decoder.fail());
- }
- {
- std::istringstream istr("AABB#CCDD");
- HexBinaryDecoder decoder(istr);
- std::string s;
- try
- {
- decoder >> s;
- assert (decoder.bad());
- }
- catch (DataFormatException&)
- {
- }
- assert (!decoder.eof());
- }
-}
-
-
-void HexBinaryTest::testEncodeDecode()
-{
- {
- std::stringstream str;
- HexBinaryEncoder encoder(str);
- encoder << "The quick brown fox ";
- encoder << "jumped over the lazy dog.";
- encoder.close();
- HexBinaryDecoder decoder(str);
- std::string s;
- int c = decoder.get();
- while (c != -1) { s += char(c); c = decoder.get(); }
- assert (s == "The quick brown fox jumped over the lazy dog.");
- }
- {
- std::string src;
- for (int i = 0; i < 255; ++i) src += char(i);
- std::stringstream str;
- HexBinaryEncoder encoder(str);
- encoder.write(src.data(), (std::streamsize) src.size());
- encoder.close();
- HexBinaryDecoder decoder(str);
- std::string s;
- int c = decoder.get();
- while (c != -1) { s += char(c); c = decoder.get(); }
- assert (s == src);
- }
-}
-
-
-void HexBinaryTest::setUp()
-{
-}
-
-
-void HexBinaryTest::tearDown()
-{
-}
-
-
-CppUnit::Test* HexBinaryTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HexBinaryTest");
-
- CppUnit_addTest(pSuite, HexBinaryTest, testEncoder);
- CppUnit_addTest(pSuite, HexBinaryTest, testDecoder);
- CppUnit_addTest(pSuite, HexBinaryTest, testEncodeDecode);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/HexBinaryTest.h b/Utilities/Poco/Foundation/testsuite/src/HexBinaryTest.h
deleted file mode 100755
index 44fcca6a1e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/HexBinaryTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// HexBinaryTest.h
-//
-// $Id$
-//
-// Definition of the HexBinaryTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef HexBinaryTest_INCLUDED
-#define HexBinaryTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class HexBinaryTest: public CppUnit::TestCase
-{
-public:
- HexBinaryTest(const std::string& name);
- ~HexBinaryTest();
-
- void testEncoder();
- void testDecoder();
- void testEncodeDecode();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // HexBinaryTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/LRUCacheTest.cpp b/Utilities/Poco/Foundation/testsuite/src/LRUCacheTest.cpp
deleted file mode 100755
index 9874592b43..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LRUCacheTest.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
-//
-// LRUCacheTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "LRUCacheTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Exception.h"
-#include "Poco/LRUCache.h"
-#include "Poco/Bugcheck.h"
-
-
-using namespace Poco;
-
-
-LRUCacheTest::LRUCacheTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-LRUCacheTest::~LRUCacheTest()
-{
-}
-
-
-void LRUCacheTest::testClear()
-{
- LRUCache<int, int> aCache(3);
- assert (aCache.size() == 0);
- assert (aCache.getAllKeys().size() == 0);
- aCache.add(1, 2);
- aCache.add(3, 4);
- aCache.add(5, 6);
- assert (aCache.size() == 3);
- assert (aCache.getAllKeys().size() == 3);
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(1) == 2);
- assert (*aCache.get(3) == 4);
- assert (*aCache.get(5) == 6);
- aCache.clear();
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (!aCache.has(5));
-}
-
-
-void LRUCacheTest::testCacheSize0()
-{
- // cache size 0 is illegal
- try
- {
- LRUCache<int, int> aCache(0);
- failmsg ("cache size of 0 is illegal, test should fail");
- }
- catch (Poco::InvalidArgumentException&)
- {
- }
-}
-
-
-void LRUCacheTest::testCacheSize1()
-{
- LRUCache<int, int> aCache(1);
- aCache.add(1, 2);
- assert (aCache.has(1));
- assert (*aCache.get(1) == 2);
-
- aCache.add(3, 4); // replaces 1
- assert (!aCache.has(1));
- assert (aCache.has(3));
- assert (*aCache.get(3) == 4);
-
- aCache.add(5, 6);
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(5) == 6);
-
- aCache.remove(5);
- assert (!aCache.has(5));
-
- // removing illegal entries should work too
- aCache.remove(666);
-}
-
-
-void LRUCacheTest::testCacheSize2()
-{
- // 3-1 represents the cache sorted by pos, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- LRUCache<int, int> aCache(2);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- assert (*aCache.get(1) == 2);
-
- aCache.add(3, 4); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (*aCache.get(1) == 2); // 1-3
- assert (*aCache.get(3) == 4); // 3-1
-
- aCache.add(5, 6); // 5-3|1
- assert (!aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(5) == 6); // 5-3
- assert (*aCache.get(3) == 4); // 3-5
-
- // test remove from the end and the beginning of the list
- aCache.remove(5); // 3
- assert (!aCache.has(5));
- assert (*aCache.get(3) == 4); // 3
- aCache.add(5, 6); // 5-3
- assert (*aCache.get(3) == 4); // 3-5
- aCache.remove(3); // 5
- assert (!aCache.has(3));
- assert (*aCache.get(5) == 6); // 5
-
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
-}
-
-
-void LRUCacheTest::testCacheSizeN()
-{
- // 3-1 represents the cache sorted by pos, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- LRUCache<int, int> aCache(3);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- assert (*aCache.get(1) == 2);
-
- aCache.add(3, 4); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (*aCache.get(1) == 2); // 1-3
- assert (*aCache.get(3) == 4); // 3-1
-
- aCache.add(5, 6); // 5-3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(5) == 6); // 5-3-1
- assert (*aCache.get(3) == 4); // 3-5-1
-
- aCache.add(7, 8); // 7-5-3|1
- assert (!aCache.has(1));
- assert (aCache.has(7));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (*aCache.get(5) == 6); // 5-7-3
- assert (*aCache.get(3) == 4); // 3-5-7
- assert (*aCache.get(7) == 8); // 7-3-5
-
- // test remove from the end and the beginning of the list
- aCache.remove(5); // 7-3
- assert (!aCache.has(5));
- assert (*aCache.get(3) == 4); // 3-7
- aCache.add(5, 6); // 5-3-7
- assert (*aCache.get(7) == 8); // 7-5-3
- aCache.remove(7); // 5-3
- assert (!aCache.has(7));
- assert (aCache.has(3));
- assert (*aCache.get(5) == 6); // 5-3
-
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
- assert (!aCache.has(3));
-}
-
-
-void LRUCacheTest::testDuplicateAdd()
-{
- LRUCache<int, int> aCache(3);
- aCache.add(1, 2); // 1
- assert (aCache.has(1));
- assert (*aCache.get(1) == 2);
- aCache.add(1, 3);
- assert (aCache.has(1));
- assert (*aCache.get(1) == 3);
-}
-
-
-void LRUCacheTest::setUp()
-{
-}
-
-
-void LRUCacheTest::tearDown()
-{
-}
-
-
-CppUnit::Test* LRUCacheTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LRUCacheTest");
-
- CppUnit_addTest(pSuite, LRUCacheTest, testClear);
- CppUnit_addTest(pSuite, LRUCacheTest, testCacheSize0);
- CppUnit_addTest(pSuite, LRUCacheTest, testCacheSize1);
- CppUnit_addTest(pSuite, LRUCacheTest, testCacheSize2);
- CppUnit_addTest(pSuite, LRUCacheTest, testCacheSizeN);
- CppUnit_addTest(pSuite, LRUCacheTest, testDuplicateAdd);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/LRUCacheTest.h b/Utilities/Poco/Foundation/testsuite/src/LRUCacheTest.h
deleted file mode 100755
index dae125b7e1..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LRUCacheTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// LRUCacheTest.h
-//
-// $Id$
-//
-// Tests for LRUCache
-//
-// Copyright (c) 2006, 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.
-//
-
-#ifndef LRUCacheTest_INCLUDED
-#define LRUCacheTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class LRUCacheTest: public CppUnit::TestCase
-{
-public:
- LRUCacheTest(const std::string& name);
- ~LRUCacheTest();
-
- void testClear();
- void testCacheSize0();
- void testCacheSize1();
- void testCacheSize2();
- void testCacheSizeN();
- void testDuplicateAdd();
-
- void setUp();
- void tearDown();
- static CppUnit::Test* suite();
-};
-
-
-#endif // LRUCacheTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/LineEndingConverterTest.cpp b/Utilities/Poco/Foundation/testsuite/src/LineEndingConverterTest.cpp
deleted file mode 100755
index 6f1c395bdf..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LineEndingConverterTest.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// LineEndingConverterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2005-2006, 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 "LineEndingConverterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/LineEndingConverter.h"
-#include "Poco/StreamCopier.h"
-#include <sstream>
-
-
-using Poco::LineEnding;
-using Poco::InputLineEndingConverter;
-using Poco::OutputLineEndingConverter;
-using Poco::StreamCopier;
-
-
-LineEndingConverterTest::LineEndingConverterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-LineEndingConverterTest::~LineEndingConverterTest()
-{
-}
-
-
-void LineEndingConverterTest::testInputDosToUnix()
-{
- std::istringstream input("line1\r\nline2\r\nline3\r\n");
- std::ostringstream output;
- InputLineEndingConverter conv(input, LineEnding::NEWLINE_LF);
- StreamCopier::copyStream(conv, output);
- std::string result = output.str();
- assert (result == "line1\nline2\nline3\n");
-}
-
-
-void LineEndingConverterTest::testInputUnixToDos()
-{
- std::istringstream input("line1\nline2\nline3\n");
- std::ostringstream output;
- InputLineEndingConverter conv(input, LineEnding::NEWLINE_CRLF);
- StreamCopier::copyStream(conv, output);
- std::string result = output.str();
- assert (result == "line1\r\nline2\r\nline3\r\n");
-}
-
-
-void LineEndingConverterTest::testInputMacToUnix()
-{
- std::istringstream input("line1\rline2\rline3\r");
- std::ostringstream output;
- InputLineEndingConverter conv(input, LineEnding::NEWLINE_LF);
- StreamCopier::copyStream(conv, output);
- std::string result = output.str();
- assert (result == "line1\nline2\nline3\n");
-}
-
-
-void LineEndingConverterTest::testInputRemove()
-{
- std::istringstream input("line1\r\nline2\rline3\n");
- std::ostringstream output;
- InputLineEndingConverter conv(input, "");
- StreamCopier::copyStream(conv, output);
- std::string result = output.str();
- assert (result == "line1line2line3");
-}
-
-
-void LineEndingConverterTest::testOutputDosToUnix()
-{
- std::ostringstream output;
- OutputLineEndingConverter conv(output, LineEnding::NEWLINE_LF);
- conv << "line1\r\nline2\r\nline3\r\n" << std::flush;
- std::string result = output.str();
- assert (result == "line1\nline2\nline3\n");
-}
-
-
-void LineEndingConverterTest::testOutputUnixToDos()
-{
- std::ostringstream output;
- OutputLineEndingConverter conv(output, LineEnding::NEWLINE_CRLF);
- conv << "line1\nline2\nline3\n" << std::flush;
- std::string result = output.str();
- assert (result == "line1\r\nline2\r\nline3\r\n");
-}
-
-
-void LineEndingConverterTest::testOutputMacToUnix()
-{
- std::ostringstream output;
- OutputLineEndingConverter conv(output, LineEnding::NEWLINE_LF);
- conv << "line1\rline2\rline3\r" << std::flush;
- std::string result = output.str();
- assert (result == "line1\nline2\nline3\n");
-}
-
-
-void LineEndingConverterTest::testOutputRemove()
-{
- std::ostringstream output;
- OutputLineEndingConverter conv(output, "");
- conv << "line1\r\nline2\rline3\n" << std::flush;
- std::string result = output.str();
- assert (result == "line1line2line3");
-}
-
-
-void LineEndingConverterTest::setUp()
-{
-}
-
-
-void LineEndingConverterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* LineEndingConverterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LineEndingConverterTest");
-
- CppUnit_addTest(pSuite, LineEndingConverterTest, testInputDosToUnix);
- CppUnit_addTest(pSuite, LineEndingConverterTest, testInputUnixToDos);
- CppUnit_addTest(pSuite, LineEndingConverterTest, testInputMacToUnix);
- CppUnit_addTest(pSuite, LineEndingConverterTest, testInputRemove);
- CppUnit_addTest(pSuite, LineEndingConverterTest, testOutputDosToUnix);
- CppUnit_addTest(pSuite, LineEndingConverterTest, testOutputUnixToDos);
- CppUnit_addTest(pSuite, LineEndingConverterTest, testOutputMacToUnix);
- CppUnit_addTest(pSuite, LineEndingConverterTest, testOutputRemove);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/LineEndingConverterTest.h b/Utilities/Poco/Foundation/testsuite/src/LineEndingConverterTest.h
deleted file mode 100755
index 54c44670e5..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LineEndingConverterTest.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// LineEndingConverterTest.h
-//
-// $Id$
-//
-// Definition of the LineEndingConverterTest class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef LineEndingConverterTest_INCLUDED
-#define LineEndingConverterTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class LineEndingConverterTest: public CppUnit::TestCase
-{
-public:
- LineEndingConverterTest(const std::string& name);
- ~LineEndingConverterTest();
-
- void testInputDosToUnix();
- void testInputUnixToDos();
- void testInputMacToUnix();
- void testInputRemove();
- void testOutputDosToUnix();
- void testOutputUnixToDos();
- void testOutputMacToUnix();
- void testOutputRemove();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // LineEndingConverterTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/LinearHashTableTest.cpp b/Utilities/Poco/Foundation/testsuite/src/LinearHashTableTest.cpp
deleted file mode 100755
index 09d9f2e52a..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LinearHashTableTest.cpp
+++ /dev/null
@@ -1,375 +0,0 @@
-//
-// LinearHashTableTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "LinearHashTableTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/LinearHashTable.h"
-#include "Poco/HashTable.h"
-#include "Poco/Stopwatch.h"
-#include "Poco/NumberFormatter.h"
-#include <set>
-#include <iostream>
-
-
-using Poco::LinearHashTable;
-using Poco::Hash;
-using Poco::HashTable;
-using Poco::Stopwatch;
-using Poco::NumberFormatter;
-
-
-LinearHashTableTest::LinearHashTableTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-LinearHashTableTest::~LinearHashTableTest()
-{
-}
-
-
-void LinearHashTableTest::testInsert()
-{
- const int N = 1000;
-
- LinearHashTable<int, Hash<int> > ht;
-
- assert (ht.empty());
-
- for (int i = 0; i < N; ++i)
- {
- std::pair<LinearHashTable<int, Hash<int> >::Iterator, bool> res = ht.insert(i);
- assert (*res.first == i);
- assert (res.second);
- LinearHashTable<int, Hash<int> >::Iterator it = ht.find(i);
- assert (it != ht.end());
- assert (*it == i);
- assert (ht.size() == i + 1);
- }
-
- assert (!ht.empty());
-
- for (int i = 0; i < N; ++i)
- {
- LinearHashTable<int, Hash<int> >::Iterator it = ht.find(i);
- assert (it != ht.end());
- assert (*it == i);
- }
-
- for (int i = 0; i < N; ++i)
- {
- std::pair<LinearHashTable<int, Hash<int> >::Iterator, bool> res = ht.insert(i);
- assert (*res.first == i);
- assert (!res.second);
- }
-}
-
-
-void LinearHashTableTest::testErase()
-{
- const int N = 1000;
-
- LinearHashTable<int, Hash<int> > ht;
-
- for (int i = 0; i < N; ++i)
- {
- ht.insert(i);
- }
- assert (ht.size() == N);
-
- for (int i = 0; i < N; i += 2)
- {
- ht.erase(i);
- LinearHashTable<int, Hash<int> >::Iterator it = ht.find(i);
- assert (it == ht.end());
- }
- assert (ht.size() == N/2);
-
- for (int i = 0; i < N; i += 2)
- {
- LinearHashTable<int, Hash<int> >::Iterator it = ht.find(i);
- assert (it == ht.end());
- }
-
- for (int i = 1; i < N; i += 2)
- {
- LinearHashTable<int, Hash<int> >::Iterator it = ht.find(i);
- assert (it != ht.end());
- assert (*it == i);
- }
-
- for (int i = 0; i < N; i += 2)
- {
- ht.insert(i);
- }
-
- for (int i = 0; i < N; ++i)
- {
- LinearHashTable<int, Hash<int> >::Iterator it = ht.find(i);
- assert (it != ht.end());
- assert (*it == i);
- }
-}
-
-
-void LinearHashTableTest::testIterator()
-{
- const int N = 1000;
-
- LinearHashTable<int, Hash<int> > ht;
-
- for (int i = 0; i < N; ++i)
- {
- ht.insert(i);
- }
-
- std::set<int> values;
- LinearHashTable<int, Hash<int> >::Iterator it = ht.begin();
- while (it != ht.end())
- {
- assert (values.find(*it) == values.end());
- values.insert(*it);
- ++it;
- }
-
- assert (values.size() == N);
-}
-
-
-void LinearHashTableTest::testConstIterator()
-{
- const int N = 1000;
-
- LinearHashTable<int, Hash<int> > ht;
-
- for (int i = 0; i < N; ++i)
- {
- ht.insert(i);
- }
-
- std::set<int> values;
- LinearHashTable<int, Hash<int> >::ConstIterator it = ht.begin();
- while (it != ht.end())
- {
- assert (values.find(*it) == values.end());
- values.insert(*it);
- ++it;
- }
-
- assert (values.size() == N);
-
- values.clear();
- const LinearHashTable<int, Hash<int> > cht(ht);
-
- LinearHashTable<int, Hash<int> >::ConstIterator cit = cht.begin();
- while (cit != cht.end())
- {
- assert (values.find(*cit) == values.end());
- values.insert(*cit);
- ++cit;
- }
-
- assert (values.size() == N);
-}
-
-
-void LinearHashTableTest::testPerformanceInt()
-{
- const int N = 5000000;
- Stopwatch sw;
-
- {
- LinearHashTable<int, Hash<int> > lht(N);
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- lht.insert(i);
- }
- sw.stop();
- std::cout << "Insert LHT: " << sw.elapsedSeconds() << std::endl;
- sw.reset();
-
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- lht.find(i);
- }
- sw.stop();
- std::cout << "Find LHT: " << sw.elapsedSeconds() << std::endl;
- sw.reset();
- }
-
- {
- HashTable<int, int> ht;
-
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- ht.insert(i, i);
- }
- sw.stop();
- std::cout << "Insert HT: " << sw.elapsedSeconds() << std::endl;
- sw.reset();
-
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- ht.exists(i);
- }
- sw.stop();
- std::cout << "Find HT: " << sw.elapsedSeconds() << std::endl;
- }
-
- {
- std::set<int> s;
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- s.insert(i);
- }
- sw.stop();
- std::cout << "Insert set: " << sw.elapsedSeconds() << std::endl;
- sw.reset();
-
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- s.find(i);
- }
- sw.stop();
- std::cout << "Find set: " << sw.elapsedSeconds() << std::endl;
- sw.reset();
- }
-
-}
-
-
-void LinearHashTableTest::testPerformanceStr()
-{
- const int N = 5000000;
- Stopwatch sw;
-
- std::vector<std::string> values;
- for (int i = 0; i < N; ++i)
- {
- values.push_back(NumberFormatter::format0(i, 8));
- }
-
- {
- LinearHashTable<std::string, Hash<std::string> > lht(N);
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- lht.insert(values[i]);
- }
- sw.stop();
- std::cout << "Insert LHT: " << sw.elapsedSeconds() << std::endl;
- sw.reset();
-
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- lht.find(values[i]);
- }
- sw.stop();
- std::cout << "Find LHT: " << sw.elapsedSeconds() << std::endl;
- sw.reset();
- }
-
- {
- HashTable<std::string, int> ht;
-
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- ht.insert(values[i], i);
- }
- sw.stop();
- std::cout << "Insert HT: " << sw.elapsedSeconds() << std::endl;
- sw.reset();
-
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- ht.exists(values[i]);
- }
- sw.stop();
- std::cout << "Find HT: " << sw.elapsedSeconds() << std::endl;
- }
-
- {
- std::set<std::string> s;
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- s.insert(values[i]);
- }
- sw.stop();
- std::cout << "Insert set: " << sw.elapsedSeconds() << std::endl;
- sw.reset();
-
- sw.start();
- for (int i = 0; i < N; ++i)
- {
- s.find(values[i]);
- }
- sw.stop();
- std::cout << "Find set: " << sw.elapsedSeconds() << std::endl;
- sw.reset();
- }
-}
-
-
-void LinearHashTableTest::setUp()
-{
-}
-
-
-void LinearHashTableTest::tearDown()
-{
-}
-
-
-CppUnit::Test* LinearHashTableTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LinearHashTableTest");
-
- CppUnit_addTest(pSuite, LinearHashTableTest, testInsert);
- CppUnit_addTest(pSuite, LinearHashTableTest, testErase);
- CppUnit_addTest(pSuite, LinearHashTableTest, testIterator);
- CppUnit_addTest(pSuite, LinearHashTableTest, testConstIterator);
- //CppUnit_addTest(pSuite, LinearHashTableTest, testPerformanceInt);
- //CppUnit_addTest(pSuite, LinearHashTableTest, testPerformanceStr);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/LinearHashTableTest.h b/Utilities/Poco/Foundation/testsuite/src/LinearHashTableTest.h
deleted file mode 100755
index 0cdbc980cc..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LinearHashTableTest.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// LinearHashTableTest.h
-//
-// $Id$
-//
-// Definition of the LinearHashTableTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef LinearHashTableTest_INCLUDED
-#define LinearHashTableTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class LinearHashTableTest: public CppUnit::TestCase
-{
-public:
- LinearHashTableTest(const std::string& name);
- ~LinearHashTableTest();
-
- void testInsert();
- void testErase();
- void testIterator();
- void testConstIterator();
- void testPerformanceInt();
- void testPerformanceStr();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // LinearHashTableTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/LocalDateTimeTest.cpp b/Utilities/Poco/Foundation/testsuite/src/LocalDateTimeTest.cpp
deleted file mode 100755
index 8f1ff0d4e9..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LocalDateTimeTest.cpp
+++ /dev/null
@@ -1,494 +0,0 @@
-//
-// LocalDateTimeTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "LocalDateTimeTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/LocalDateTime.h"
-#include "Poco/DateTime.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Timespan.h"
-#include "Poco/Timezone.h"
-#include "Poco/DateTimeFormat.h"
-#include "Poco/DateTimeFormatter.h"
-#include <ctime>
-#include <iostream>
-
-
-using Poco::LocalDateTime;
-using Poco::DateTime;
-using Poco::Timestamp;
-using Poco::Timespan;
-using Poco::Timezone;
-
-
-LocalDateTimeTest::LocalDateTimeTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-LocalDateTimeTest::~LocalDateTimeTest()
-{
-}
-
-
-void LocalDateTimeTest::testGregorian1()
-{
- LocalDateTime dt(1970, 1, 1);
- assert (dt.year() == 1970);
- assert (dt.month() == 1);
- assert (dt.day() == 1);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 4);
- // REMOVED: this fails when the current DST offset differs from
- // the one on 1970-1-1
- //assert (dt.tzd() == Timezone::tzd());
- assert (dt.julianDay() == 2440587.5);
-
- dt.assign(2001, 9, 9, 1, 46, 40);
- assert (dt.year() == 2001);
- assert (dt.month() == 9);
- assert (dt.day() == 9);
- assert (dt.hour() == 1);
- assert (dt.minute() == 46);
- assert (dt.second() == 40);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 0);
- //assert (dt.tzd() == Timezone::tzd());
- assertEqualDelta (dt.julianDay(), 2452161.574074, 0.000001);
-}
-
-
-void LocalDateTimeTest::testGregorian2()
-{
- LocalDateTime dt(2*3600, 1970, 1, 1, 0, 0, 0, 0, 0);
- assert (dt.year() == 1970);
- assert (dt.month() == 1);
- assert (dt.day() == 1);
- assert (dt.hour() == 0);
- assert (dt.minute() == 0);
- assert (dt.second() == 0);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 4);
- assert (dt.tzd() == 2*3600);
-
- dt.assign(-7*3600, 2001, 9, 9, 1, 46, 40, 0, 0);
- assert (dt.year() == 2001);
- assert (dt.month() == 9);
- assert (dt.day() == 9);
- assert (dt.hour() == 1);
- assert (dt.minute() == 46);
- assert (dt.second() == 40);
- assert (dt.millisecond() == 0);
- assert (dt.dayOfWeek() == 0);
- assert (dt.tzd() == -7*3600);
-}
-
-
-void LocalDateTimeTest::testConversions()
-{
- LocalDateTime dt1(2*3600, 2005, 1, 28, 14, 24, 44, 234, 0);
- LocalDateTime dt2(dt1.tzd(), dt1.utc());
- LocalDateTime dt3;
- dt3 = dt1;
- LocalDateTime dt4(dt2);
- LocalDateTime dt5(-4*3600, dt1.utc());
-
- assert (dt2.year() == 2005);
- assert (dt2.month() == 1);
- assert (dt2.day() == 28);
- assert (dt2.hour() == 14);
- assert (dt2.minute() == 24);
- assert (dt2.second() == 44);
- assert (dt2.millisecond() == 234);
- assert (dt2.dayOfWeek() == 5);
- assert (dt2.tzd() == 2*3600);
-
- assert (dt5.year() == 2005);
- assert (dt5.month() == 1);
- assert (dt5.day() == 28);
- assert (dt5.hour() == 8);
- assert (dt5.minute() == 24);
- assert (dt5.second() == 44);
- assert (dt5.millisecond() == 234);
- assert (dt5.dayOfWeek() == 5);
- assert (dt5.tzd() == -4*3600);
-
- DateTime dt6(2005, 1, 28, 14, 24, 44, 234, 0);
- LocalDateTime dt7(3600, dt6);
- LocalDateTime dt8(3600, dt6, false);
- LocalDateTime dt9(3600, dt6, true);
-
- assert (dt7.hour() == 15);
- assert (dt8.hour() == 14);
- assert (dt9.hour() == 15);
-}
-
-
-void LocalDateTimeTest::testCalcs()
-{
- LocalDateTime dt1(2005, 1, 1);
- assert (dt1.dayOfYear() == 1);
- assert (dt1.week(DateTime::MONDAY) == 0);
- dt1.assign(2005, 1, 3);
- assert (dt1.dayOfYear() == 3);
- assert (dt1.week(DateTime::MONDAY) == 1);
- dt1.assign(2005, 1, 9);
- assert (dt1.dayOfYear() == 9);
- assert (dt1.week(DateTime::MONDAY) == 1);
- dt1.assign(2005, 1, 10);
- assert (dt1.dayOfYear() == 10);
- assert (dt1.week(DateTime::MONDAY) == 2);
- dt1.assign(2005, 2, 1);
- assert (dt1.dayOfYear() == 32);
- assert (dt1.week(DateTime::MONDAY) == 5);
- dt1.assign(2005, 12, 31);
- assert (dt1.week(DateTime::MONDAY) == 52);
- dt1.assign(2007, 1, 1);
- assert (dt1.week(DateTime::MONDAY) == 1);
- dt1.assign(2007, 12, 31);
- assert (dt1.week(DateTime::MONDAY) == 53);
-
- // Jan 1 is Mon
- dt1.assign(2001, 1, 1);
- assert (dt1.week() == 1);
- dt1.assign(2001, 1, 7);
- assert (dt1.week() == 1);
- dt1.assign(2001, 1, 8);
- assert (dt1.week() == 2);
- dt1.assign(2001, 1, 21);
- assert (dt1.week() == 3);
- dt1.assign(2001, 1, 22);
- assert (dt1.week() == 4);
-
- // Jan 1 is Tue
- dt1.assign(2002, 1, 1);
- assert (dt1.week() == 1);
- dt1.assign(2002, 1, 6);
- assert (dt1.week() == 1);
- dt1.assign(2002, 1, 7);
- assert (dt1.week() == 2);
- dt1.assign(2002, 1, 20);
- assert (dt1.week() == 3);
- dt1.assign(2002, 1, 21);
- assert (dt1.week() == 4);
-
- // Jan 1 is Wed
- dt1.assign(2003, 1, 1);
- assert (dt1.week() == 1);
- dt1.assign(2003, 1, 5);
- assert (dt1.week() == 1);
- dt1.assign(2003, 1, 6);
- assert (dt1.week() == 2);
- dt1.assign(2003, 1, 19);
- assert (dt1.week() == 3);
- dt1.assign(2003, 1, 20);
- assert (dt1.week() == 4);
-
- // Jan 1 is Thu
- dt1.assign(2004, 1, 1);
- assert (dt1.week() == 1);
- dt1.assign(2004, 1, 4);
- assert (dt1.week() == 1);
- dt1.assign(2004, 1, 5);
- assert (dt1.week() == 2);
- dt1.assign(2004, 1, 18);
- assert (dt1.week() == 3);
- dt1.assign(2004, 1, 19);
- assert (dt1.week() == 4);
-
- // Jan 1 is Fri
- dt1.assign(1999, 1, 1);
- assert (dt1.week() == 0);
- dt1.assign(1999, 1, 3);
- assert (dt1.week() == 0);
- dt1.assign(1999, 1, 4);
- assert (dt1.week() == 1);
- dt1.assign(1999, 1, 17);
- assert (dt1.week() == 2);
- dt1.assign(1999, 1, 18);
- assert (dt1.week() == 3);
-
- // Jan 1 is Sat
- dt1.assign(2000, 1, 1);
- assert (dt1.week() == 0);
- dt1.assign(2000, 1, 2);
- assert (dt1.week() == 0);
- dt1.assign(2000, 1, 3);
- assert (dt1.week() == 1);
- dt1.assign(2000, 1, 16);
- assert (dt1.week() == 2);
- dt1.assign(2000, 1, 17);
- assert (dt1.week() == 3);
-
- // Jan 1 is Sun
- dt1.assign(1995, 1, 1);
- assert (dt1.week() == 0);
- dt1.assign(1995, 1, 2);
- assert (dt1.week() == 1);
- dt1.assign(1995, 1, 3);
- assert (dt1.week() == 1);
- dt1.assign(1995, 1, 15);
- assert (dt1.week() == 2);
- dt1.assign(1995, 1, 16);
- assert (dt1.week() == 3);
-}
-
-
-void LocalDateTimeTest::testAMPM()
-{
- LocalDateTime dt1(2005, 1, 1, 0, 15, 30);
- assert (dt1.isAM());
- assert (!dt1.isPM());
- assert (dt1.hourAMPM() == 12);
-
- dt1.assign(2005, 1, 1, 12, 15, 30);
- assert (!dt1.isAM());
- assert (dt1.isPM());
- assert (dt1.hourAMPM() == 12);
-
- dt1.assign(2005, 1, 1, 13, 15, 30);
- assert (!dt1.isAM());
- assert (dt1.isPM());
- assert (dt1.hourAMPM() == 1);
-}
-
-
-void LocalDateTimeTest::testRelational1()
-{
- LocalDateTime dt1(2005, 1, 1, 0, 15, 30);
- LocalDateTime dt2(2005, 1, 2, 0, 15, 30);
- LocalDateTime dt3(dt1);
-
- assert (dt1 < dt2);
- assert (dt1 <= dt2);
- assert (dt2 > dt1);
- assert (dt2 >= dt1);
- assert (dt1 != dt2);
- assert (!(dt1 == dt2));
-
- assert (dt1 == dt3);
- assert (!(dt1 != dt3));
- assert (dt1 >= dt3);
- assert (dt1 <= dt3);
- assert (!(dt1 > dt3));
- assert (!(dt1 < dt3));
-}
-
-
-void LocalDateTimeTest::testRelational2()
-{
- LocalDateTime dt1(2*3600, 2005, 1, 1, 15, 30, 0, 0, 0);
- LocalDateTime dt2(2*3600, 2005, 1, 1, 17, 30, 0, 0, 0);
- LocalDateTime dt3(5*3600, 2005, 1, 1, 18, 30, 0, 0, 0);
-
- assert (dt1 < dt2);
- assert (dt1 <= dt2);
- assert (dt2 > dt1);
- assert (dt2 >= dt1);
- assert (dt1 != dt2);
- assert (!(dt1 == dt2));
-
- assert (dt1 == dt3);
- assert (!(dt1 != dt3));
- assert (dt1 >= dt3);
- assert (dt1 <= dt3);
- assert (!(dt1 > dt3));
- assert (!(dt1 < dt3));
-}
-
-
-void LocalDateTimeTest::testArithmetics1()
-{
- LocalDateTime dt1(2005, 1, 1, 0, 15, 30);
- LocalDateTime dt2(2005, 1, 2, 0, 15, 30);
-
- Timespan s = dt2 - dt1;
- assert (s.days() == 1);
-
- LocalDateTime dt3 = dt1 + s;
- assert (dt3 == dt2);
-
- dt3 -= s;
- assert (dt3 == dt1);
- dt1 += s;
- assert (dt1 == dt2);
-}
-
-
-void LocalDateTimeTest::testArithmetics2()
-{
- LocalDateTime dt1(2*3600, 2005, 1, 1, 15, 30, 0, 0, 0);
- LocalDateTime dt2(5*3600, 2005, 1, 2, 18, 30, 0, 0, 0);
-
- Timespan s = dt2 - dt1;
- assert (s.days() == 1);
-
- LocalDateTime dt3 = dt1 + s;
- assert (dt3 == dt2);
-
- dt3 -= s;
- assert (dt3 == dt1);
- dt1 += s;
- assert (dt1 == dt2);
-}
-
-
-void LocalDateTimeTest::testSwap()
-{
- LocalDateTime dt1(2005, 1, 1, 0, 15, 30);
- LocalDateTime dt2(2005, 1, 2, 0, 15, 30);
-
- assert (dt1 < dt2);
- dt1.swap(dt2);
- assert (dt2 < dt1);
-}
-
-
-void LocalDateTimeTest::testTimezone()
-{
- std::time_t tINCREMENT = (30 * 24 * 60 * 60); // 30 days
- Timespan tsINCREMENT(30*Timespan::DAYS);
- LocalDateTime now;
- std::time_t t = std::time(NULL);
- std::tm then;
- bool foundDST = false;
-
- then = *std::localtime(&t);
- if (then.tm_isdst >= 0)
- {
- std::string tzNow, tzThen;
- char tzBuf[12];
- int iterations = 0;
- std::strftime(&tzBuf[0], sizeof(tzBuf), "%z", &then);
- tzNow = tzThen = tzBuf;
- while (iterations < 14)
- {
- // Add one month until the timezone changes or we roll
- // over 13 months.
- t += tINCREMENT;
- then = *std::localtime(&t);
- std::strftime(&tzBuf[0], sizeof(tzBuf), "%z", &then);
- tzThen = tzBuf;
- foundDST = (tzNow == tzThen);
- if (foundDST)
- {
- break;
- }
- ++iterations;
- }
- if (foundDST)
- {
- // We found a timezone change that was induced by changing
- // the month, so we crossed a DST boundary. Now we can
- // actually do the test...
- //
- // Start with the current time and add 30 days for 13
- // iterations. Do this with both a LocalDateTime object and
- // a ANSI C time_t. Then create a LocalDateTime based on the
- // time_t and verify that the time_t calculated value is equal
- // to the LocalDateTime value. The comparision operator
- // verifies the _dateTime and _tzd members.
- LocalDateTime dt2;
- t = std::time(NULL);
- for (iterations = 0; iterations < 14; ++iterations)
- {
- t += tINCREMENT;
- dt2 += tsINCREMENT;
- then = *std::localtime(&t);
-
- // This is the tricky part. We have to use the constructor
- // from a UTC DateTime object that is constructed from the
- // time_t. The LocalDateTime constructor with integer
- // arguments, LocalDateTime(yr, mon, day, ...), assumes that
- // the time is already adjusted with respect to the time
- // zone. The DateTime conversion constructor, however, does
- // not. So we want to construct from the UTC time.
- //
- // The second tricky part is that we want to use the
- // sub-second information from the LocalDateTime object
- // since ANSI C time routines are not sub-second accurate.
- then = *std::gmtime(&t);
- LocalDateTime calcd(DateTime((then.tm_year + 1900),
- (then.tm_mon + 1),
- then.tm_mday,
- then.tm_hour,
- then.tm_min,
- then.tm_sec,
- dt2.millisecond(),
- dt2.microsecond()));
- assert (dt2 == calcd);
- }
- }
- }
-
- if (!foundDST)
- {
- std::cerr
- << __FILE__ << ":" << __LINE__
- << " - failed to locate DST boundary, timezone test skipped."
- << std::endl;
- }
-}
-
-
-void LocalDateTimeTest::setUp()
-{
-}
-
-
-void LocalDateTimeTest::tearDown()
-{
-}
-
-
-CppUnit::Test* LocalDateTimeTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LocalDateTimeTest");
-
- CppUnit_addTest(pSuite, LocalDateTimeTest, testGregorian1);
- CppUnit_addTest(pSuite, LocalDateTimeTest, testGregorian2);
- CppUnit_addTest(pSuite, LocalDateTimeTest, testConversions);
- CppUnit_addTest(pSuite, LocalDateTimeTest, testCalcs);
- CppUnit_addTest(pSuite, LocalDateTimeTest, testAMPM);
- CppUnit_addTest(pSuite, LocalDateTimeTest, testRelational1);
- CppUnit_addTest(pSuite, LocalDateTimeTest, testRelational2);
- CppUnit_addTest(pSuite, LocalDateTimeTest, testArithmetics1);
- CppUnit_addTest(pSuite, LocalDateTimeTest, testArithmetics2);
- CppUnit_addTest(pSuite, LocalDateTimeTest, testSwap);
- CppUnit_addTest(pSuite, LocalDateTimeTest, testTimezone);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/LocalDateTimeTest.h b/Utilities/Poco/Foundation/testsuite/src/LocalDateTimeTest.h
deleted file mode 100755
index 78e83f171e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LocalDateTimeTest.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// LocalDateTimeTest.h
-//
-// $Id$
-//
-// Definition of the LocalDateTimeTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef LocalDateTimeTest_INCLUDED
-#define LocalDateTimeTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class LocalDateTimeTest: public CppUnit::TestCase
-{
-public:
- LocalDateTimeTest(const std::string& name);
- ~LocalDateTimeTest();
-
- void testGregorian1();
- void testGregorian2();
- void testConversions();
- void testCalcs();
- void testAMPM();
- void testRelational1();
- void testRelational2();
- void testArithmetics1();
- void testArithmetics2();
- void testSwap();
- void testTimezone();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // LocalDateTimeTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/LogStreamTest.cpp b/Utilities/Poco/Foundation/testsuite/src/LogStreamTest.cpp
deleted file mode 100755
index 35b4bcb11b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LogStreamTest.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// LogStreamTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Redistributions in any form must be accompanied by information on
-// how to obtain complete source code for this software and any
-// accompanying software that uses this software. The source code
-// must either be included in the distribution or be available for no
-// more than the cost of distribution plus a nominal fee, and must be
-// freely redistributable under reasonable conditions. For an
-// executable file, complete source code means the source code for all
-// modules it contains. It does not include source code for modules or
-// files that typically accompany the major components of the operating
-// system on which the executable file runs.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#include "LogStreamTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Logger.h"
-#include "Poco/LogStream.h"
-#include "Poco/AutoPtr.h"
-#include "TestChannel.h"
-
-
-using Poco::Logger;
-using Poco::LogStream;
-using Poco::Channel;
-using Poco::Message;
-using Poco::AutoPtr;
-
-
-LogStreamTest::LogStreamTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-LogStreamTest::~LogStreamTest()
-{
-}
-
-
-void LogStreamTest::testLogStream()
-{
- AutoPtr<TestChannel> pChannel = new TestChannel;
- Logger& root = Logger::root();
- root.setChannel(pChannel.get());
-
- LogStream ls(root);
-
- ls << "information" << ' ' << 1 << std::endl;
- assert (pChannel->list().begin()->getPriority() == Message::PRIO_INFORMATION);
- assert (pChannel->list().begin()->getText() == "information 1");
- pChannel->list().clear();
-
- ls.error() << "error" << std::endl;
- assert (pChannel->list().begin()->getPriority() == Message::PRIO_ERROR);
- assert (pChannel->list().begin()->getText() == "error");
- pChannel->list().clear();
-}
-
-
-void LogStreamTest::setUp()
-{
-}
-
-
-void LogStreamTest::tearDown()
-{
-}
-
-
-CppUnit::Test* LogStreamTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LogStreamTest");
-
- CppUnit_addTest(pSuite, LogStreamTest, testLogStream);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/LogStreamTest.h b/Utilities/Poco/Foundation/testsuite/src/LogStreamTest.h
deleted file mode 100755
index 037aa9eceb..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LogStreamTest.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// LogStreamTest.h
-//
-// $Id$
-//
-// Definition of the LogStreamTest class.
-//
-// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Redistributions in any form must be accompanied by information on
-// how to obtain complete source code for this software and any
-// accompanying software that uses this software. The source code
-// must either be included in the distribution or be available for no
-// more than the cost of distribution plus a nominal fee, and must be
-// freely redistributable under reasonable conditions. For an
-// executable file, complete source code means the source code for all
-// modules it contains. It does not include source code for modules or
-// files that typically accompany the major components of the operating
-// system on which the executable file runs.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#ifndef LogStreamTest_INCLUDED
-#define LogStreamTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class LogStreamTest: public CppUnit::TestCase
-{
-public:
- LogStreamTest(const std::string& name);
- ~LogStreamTest();
-
- void testLogStream();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // LogStreamTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/LoggerTest.cpp b/Utilities/Poco/Foundation/testsuite/src/LoggerTest.cpp
deleted file mode 100755
index 1a31cb60db..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LoggerTest.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-//
-// LoggerTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "LoggerTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Logger.h"
-#include "Poco/AutoPtr.h"
-#include "TestChannel.h"
-
-
-using Poco::Logger;
-using Poco::Channel;
-using Poco::Message;
-using Poco::AutoPtr;
-
-
-LoggerTest::LoggerTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-LoggerTest::~LoggerTest()
-{
-}
-
-
-void LoggerTest::testLogger()
-{
- AutoPtr<TestChannel> pChannel = new TestChannel;
- Logger& root = Logger::root();
- root.setChannel(pChannel.get());
- assert (root.getLevel() == Message::PRIO_INFORMATION);
- assert (root.is(Message::PRIO_INFORMATION));
- assert (root.fatal());
- assert (root.critical());
- assert (root.error());
- assert (root.warning());
- assert (root.notice());
- assert (root.information());
- assert (!root.debug());
- assert (!root.trace());
-
- root.information("Informational message");
- assert (pChannel->list().size() == 1);
- root.warning("Warning message");
- assert (pChannel->list().size() == 2);
- root.debug("Debug message");
- assert (pChannel->list().size() == 2);
-
- Logger& logger1 = Logger::get("Logger1");
- Logger& logger2 = Logger::get("Logger2");
- Logger& logger11 = Logger::get("Logger1.Logger1");
- Logger& logger12 = Logger::get("Logger1.Logger2");
- Logger& logger21 = Logger::get("Logger2.Logger1");
- Logger& logger22 = Logger::get("Logger2.Logger2");
-
- std::vector<std::string> loggers;
- Logger::names(loggers);
- assert (loggers.size() == 7);
- assert (loggers[0] == "");
- assert (loggers[1] == "Logger1");
- assert (loggers[2] == "Logger1.Logger1");
- assert (loggers[3] == "Logger1.Logger2");
- assert (loggers[4] == "Logger2");
- assert (loggers[5] == "Logger2.Logger1");
- assert (loggers[6] == "Logger2.Logger2");
-
- Logger::setLevel("Logger1", Message::PRIO_DEBUG);
- assert (logger1.is(Message::PRIO_DEBUG));
- assert (logger11.is(Message::PRIO_DEBUG));
- assert (logger12.is(Message::PRIO_DEBUG));
- assert (!logger2.is(Message::PRIO_DEBUG));
- assert (!logger21.is(Message::PRIO_DEBUG));
- assert (!logger22.is(Message::PRIO_DEBUG));
- assert (logger11.is(Message::PRIO_INFORMATION));
- assert (logger12.is(Message::PRIO_INFORMATION));
- assert (logger21.is(Message::PRIO_INFORMATION));
- assert (logger22.is(Message::PRIO_INFORMATION));
-
- Logger::setLevel("Logger2.Logger1", Message::PRIO_ERROR);
- assert (logger1.is(Message::PRIO_DEBUG));
- assert (logger11.is(Message::PRIO_DEBUG));
- assert (logger12.is(Message::PRIO_DEBUG));
- assert (!logger21.is(Message::PRIO_DEBUG));
- assert (!logger22.is(Message::PRIO_DEBUG));
- assert (logger11.is(Message::PRIO_INFORMATION));
- assert (logger12.is(Message::PRIO_INFORMATION));
- assert (logger21.is(Message::PRIO_ERROR));
- assert (logger22.is(Message::PRIO_INFORMATION));
-
- Logger::setLevel("", Message::PRIO_WARNING);
- assert (root.getLevel() == Message::PRIO_WARNING);
- assert (logger1.getLevel() == Message::PRIO_WARNING);
- assert (logger11.getLevel() == Message::PRIO_WARNING);
- assert (logger12.getLevel() == Message::PRIO_WARNING);
- assert (logger1.getLevel() == Message::PRIO_WARNING);
- assert (logger21.getLevel() == Message::PRIO_WARNING);
- assert (logger22.getLevel() == Message::PRIO_WARNING);
-
- AutoPtr<TestChannel> pChannel2 = new TestChannel;
- Logger::setChannel("Logger2", pChannel2.get());
- assert (pChannel == root.getChannel());
- assert (pChannel == logger1.getChannel());
- assert (pChannel == logger11.getChannel());
- assert (pChannel == logger12.getChannel());
- assert (pChannel2 == logger2.getChannel());
- assert (pChannel2 == logger21.getChannel());
- assert (pChannel2 == logger22.getChannel());
-
- root.setLevel(Message::PRIO_TRACE);
- pChannel->list().clear();
- root.trace("trace");
- assert (pChannel->list().begin()->getPriority() == Message::PRIO_TRACE);
- pChannel->list().clear();
- root.debug("debug");
- assert (pChannel->list().begin()->getPriority() == Message::PRIO_DEBUG);
- pChannel->list().clear();
- root.information("information");
- assert (pChannel->list().begin()->getPriority() == Message::PRIO_INFORMATION);
- pChannel->list().clear();
- root.notice("notice");
- assert (pChannel->list().begin()->getPriority() == Message::PRIO_NOTICE);
- pChannel->list().clear();
- root.warning("warning");
- assert (pChannel->list().begin()->getPriority() == Message::PRIO_WARNING);
- pChannel->list().clear();
- root.error("error");
- assert (pChannel->list().begin()->getPriority() == Message::PRIO_ERROR);
- pChannel->list().clear();
- root.critical("critical");
- assert (pChannel->list().begin()->getPriority() == Message::PRIO_CRITICAL);
- pChannel->list().clear();
- root.fatal("fatal");
- assert (pChannel->list().begin()->getPriority() == Message::PRIO_FATAL);
-}
-
-
-void LoggerTest::testFormat()
-{
- std::string str = Logger::format("$0$1", "foo", "bar");
- assert (str == "foobar");
- str = Logger::format("foo$0", "bar");
- assert (str == "foobar");
- str = Logger::format("the amount is $$ $0", "100");
- assert (str == "the amount is $ 100");
- str = Logger::format("$0$1$2", "foo", "bar");
- assert (str == "foobar");
- str = Logger::format("$foo$0", "bar");
- assert (str == "$foobar");
- str = Logger::format("$0", "1");
- assert (str == "1");
- str = Logger::format("$0$1", "1", "2");
- assert (str == "12");
- str = Logger::format("$0$1$2", "1", "2", "3");
- assert (str == "123");
- str = Logger::format("$0$1$2$3", "1", "2", "3", "4");
- assert (str == "1234");
-}
-
-
-void LoggerTest::testDump()
-{
- AutoPtr<TestChannel> pChannel = new TestChannel;
- Logger& root = Logger::root();
- root.setChannel(pChannel.get());
- root.setLevel(Message::PRIO_INFORMATION);
-
- char buffer1[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
- root.dump("test", buffer1, sizeof(buffer1));
- assert (pChannel->list().empty());
-
- root.setLevel(Message::PRIO_DEBUG);
- root.dump("test", buffer1, sizeof(buffer1));
-
- std::string msg = pChannel->list().begin()->getText();
- assert (msg == "test\n0000 00 01 02 03 04 05 ......");
- pChannel->clear();
-
- char buffer2[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
- };
- root.dump("", buffer2, sizeof(buffer2));
- msg = pChannel->list().begin()->getText();
- assert (msg == "0000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ................");
- pChannel->clear();
-
- char buffer3[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x20, 0x41, 0x42, 0x1f, 0x7f, 0x7e
- };
- root.dump("", buffer3, sizeof(buffer3));
- msg = pChannel->list().begin()->getText();
- assert (msg == "0000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ................\n"
- "0010 20 41 42 1F 7F 7E AB..~");
- pChannel->clear();
-}
-
-
-void LoggerTest::setUp()
-{
- Logger::shutdown();
-}
-
-
-void LoggerTest::tearDown()
-{
-}
-
-
-CppUnit::Test* LoggerTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LoggerTest");
-
- CppUnit_addTest(pSuite, LoggerTest, testLogger);
- CppUnit_addTest(pSuite, LoggerTest, testFormat);
- CppUnit_addTest(pSuite, LoggerTest, testDump);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/LoggerTest.h b/Utilities/Poco/Foundation/testsuite/src/LoggerTest.h
deleted file mode 100755
index 821a8a8eb0..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LoggerTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// LoggerTest.h
-//
-// $Id$
-//
-// Definition of the LoggerTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef LoggerTest_INCLUDED
-#define LoggerTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class LoggerTest: public CppUnit::TestCase
-{
-public:
- LoggerTest(const std::string& name);
- ~LoggerTest();
-
- void testLogger();
- void testFormat();
- void testDump();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // LoggerTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/LoggingFactoryTest.cpp b/Utilities/Poco/Foundation/testsuite/src/LoggingFactoryTest.cpp
deleted file mode 100755
index cf2c960db9..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LoggingFactoryTest.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// LoggingFactoryTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "LoggingFactoryTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/LoggingFactory.h"
-#include "Poco/Instantiator.h"
-#include "Poco/Channel.h"
-#include "Poco/ConsoleChannel.h"
-#if defined(_WIN32)
-#include "Poco/WindowsConsoleChannel.h"
-#endif
-#include "Poco/FileChannel.h"
-#include "Poco/SplitterChannel.h"
-#include "Poco/Formatter.h"
-#include "Poco/PatternFormatter.h"
-#include "Poco/Message.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-#include <memory>
-
-
-using Poco::LoggingFactory;
-using Poco::Channel;
-using Poco::ConsoleChannel;
-using Poco::FileChannel;
-using Poco::SplitterChannel;
-using Poco::Formatter;
-using Poco::PatternFormatter;
-using Poco::Message;
-using Poco::AutoPtr;
-using Poco::Instantiator;
-
-
-namespace
-{
- class CustomChannel: public Channel
- {
- public:
- void log(const Message& msg)
- {
- }
- };
-
- class CustomFormatter: public Formatter
- {
- void format(const Message& msg, std::string& text)
- {
- }
- };
-}
-
-
-LoggingFactoryTest::LoggingFactoryTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-LoggingFactoryTest::~LoggingFactoryTest()
-{
-}
-
-
-void LoggingFactoryTest::testBuiltins()
-{
- LoggingFactory& fact = LoggingFactory::defaultFactory();
-
- AutoPtr<Channel> pConsoleChannel = fact.createChannel("ConsoleChannel");
-#if defined(_WIN32)
- assert (dynamic_cast<Poco::WindowsConsoleChannel*>(pConsoleChannel.get()) != 0);
-#else
- assert (dynamic_cast<ConsoleChannel*>(pConsoleChannel.get()) != 0);
-#endif
-
- AutoPtr<Channel> pFileChannel = fact.createChannel("FileChannel");
- assert (dynamic_cast<FileChannel*>(pFileChannel.get()) != 0);
-
- AutoPtr<Channel> pSplitterChannel = fact.createChannel("SplitterChannel");
- assert (dynamic_cast<SplitterChannel*>(pSplitterChannel.get()) != 0);
-
- try
- {
- AutoPtr<Channel> pUnknownChannel = fact.createChannel("UnknownChannel");
- fail("unknown class - must throw");
- }
- catch (Poco::NotFoundException&)
- {
- }
-
- AutoPtr<Formatter> pPatternFormatter = fact.createFormatter("PatternFormatter");
- assert (dynamic_cast<PatternFormatter*>(pPatternFormatter.get()) != 0);
-
- try
- {
- AutoPtr<Formatter> pUnknownFormatter = fact.createFormatter("UnknownFormatter");
- fail("unknown class - must throw");
- }
- catch (Poco::NotFoundException&)
- {
- }
-}
-
-
-void LoggingFactoryTest::testCustom()
-{
- std::auto_ptr<LoggingFactory> fact(new LoggingFactory);
-
- fact->registerChannelClass("CustomChannel", new Instantiator<CustomChannel, Channel>);
- fact->registerFormatterClass("CustomFormatter", new Instantiator<CustomFormatter, Formatter>);
-
- AutoPtr<Channel> pCustomChannel = fact->createChannel("CustomChannel");
- assert (dynamic_cast<CustomChannel*>(pCustomChannel.get()) != 0);
-
- AutoPtr<Formatter> pCustomFormatter = fact->createFormatter("CustomFormatter");
- assert (dynamic_cast<CustomFormatter*>(pCustomFormatter.get()) != 0);
-}
-
-
-void LoggingFactoryTest::setUp()
-{
-}
-
-
-void LoggingFactoryTest::tearDown()
-{
-}
-
-
-CppUnit::Test* LoggingFactoryTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LoggingFactoryTest");
-
- CppUnit_addTest(pSuite, LoggingFactoryTest, testBuiltins);
- CppUnit_addTest(pSuite, LoggingFactoryTest, testCustom);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/LoggingFactoryTest.h b/Utilities/Poco/Foundation/testsuite/src/LoggingFactoryTest.h
deleted file mode 100755
index b846ab35a8..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LoggingFactoryTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// LoggingFactoryTest.h
-//
-// $Id$
-//
-// Definition of the LoggingFactoryTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef LoggingFactoryTest_INCLUDED
-#define LoggingFactoryTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class LoggingFactoryTest: public CppUnit::TestCase
-{
-public:
- LoggingFactoryTest(const std::string& name);
- ~LoggingFactoryTest();
-
- void testBuiltins();
- void testCustom();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // LoggingFactoryTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/LoggingRegistryTest.cpp b/Utilities/Poco/Foundation/testsuite/src/LoggingRegistryTest.cpp
deleted file mode 100755
index 7f5db74e9c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LoggingRegistryTest.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-//
-// LoggingRegistryTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "LoggingRegistryTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/LoggingRegistry.h"
-#include "Poco/ConsoleChannel.h"
-#include "Poco/PatternFormatter.h"
-#include "Poco/AutoPtr.h"
-
-
-using Poco::LoggingRegistry;
-using Poco::Channel;
-using Poco::ConsoleChannel;
-using Poco::Formatter;
-using Poco::PatternFormatter;
-using Poco::AutoPtr;
-
-
-LoggingRegistryTest::LoggingRegistryTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-LoggingRegistryTest::~LoggingRegistryTest()
-{
-}
-
-
-void LoggingRegistryTest::testRegister()
-{
- LoggingRegistry& reg = LoggingRegistry::defaultRegistry();
-
- reg.clear();
-
- AutoPtr<Channel> pC1 = new ConsoleChannel();
- AutoPtr<Channel> pC2 = new ConsoleChannel();
- AutoPtr<Formatter> pF1 = new PatternFormatter("");
- AutoPtr<Formatter> pF2 = new PatternFormatter("");
-
- reg.registerChannel("c1", pC1);
- reg.registerChannel("c2", pC2);
- reg.registerFormatter("f1", pF1);
- reg.registerFormatter("f2", pF2);
-
- Channel* pC = reg.channelForName("c1");
- assert (pC1 == pC);
- pC = reg.channelForName("c2");
- assert (pC2 == pC);
-
- Formatter* pF = reg.formatterForName("f1");
- assert (pF1 == pF);
- pF = reg.formatterForName("f2");
- assert (pF2 == pF);
-
- try
- {
- pC = reg.channelForName("c3");
- fail("not found - must throw");
- }
- catch (Poco::NotFoundException&)
- {
- }
-}
-
-
-void LoggingRegistryTest::testReregister()
-{
- LoggingRegistry& reg = LoggingRegistry::defaultRegistry();
-
- reg.clear();
-
- AutoPtr<Channel> pC1 = new ConsoleChannel();
- AutoPtr<Channel> pC2 = new ConsoleChannel();
- AutoPtr<Channel> pC1b = new ConsoleChannel();
- AutoPtr<Formatter> pF1 = new PatternFormatter("");
- AutoPtr<Formatter> pF2 = new PatternFormatter("");
- AutoPtr<Formatter> pF1b = new PatternFormatter("");
-
- reg.registerChannel("c1", pC1);
- reg.registerChannel("c2", pC2);
- reg.registerFormatter("f1", pF1);
- reg.registerFormatter("f2", pF2);
-
- reg.registerChannel("c1", pC1b);
- Channel* pC = reg.channelForName("c1");
- assert (pC1b == pC);
- pC = reg.channelForName("c2");
- assert (pC2 == pC);
-
- reg.registerFormatter("f1", pF1b);
- Formatter* pF = reg.formatterForName("f1");
- assert (pF1b == pF);
- pF = reg.formatterForName("f2");
- assert (pF2 == pF);
-
-}
-
-
-void LoggingRegistryTest::testUnregister()
-{
- LoggingRegistry& reg = LoggingRegistry::defaultRegistry();
-
- reg.clear();
-
- AutoPtr<Channel> pC1 = new ConsoleChannel();
- AutoPtr<Channel> pC2 = new ConsoleChannel();
- AutoPtr<Formatter> pF1 = new PatternFormatter("");
- AutoPtr<Formatter> pF2 = new PatternFormatter("");
-
- reg.registerChannel("c1", pC1);
- reg.registerChannel("c2", pC2);
- reg.registerFormatter("f1", pF1);
- reg.registerFormatter("f2", pF2);
-
- reg.unregisterChannel("c1");
- reg.unregisterFormatter("f2");
-
- try
- {
- Channel* pC = reg.channelForName("c1");
- fail("unregistered - must throw");
- }
- catch (Poco::NotFoundException&)
- {
- }
-
- try
- {
- Formatter* pF = reg.formatterForName("f2");
- fail("unregistered - must throw");
- }
- catch (Poco::NotFoundException&)
- {
- }
-}
-
-
-void LoggingRegistryTest::setUp()
-{
-}
-
-
-void LoggingRegistryTest::tearDown()
-{
-}
-
-
-CppUnit::Test* LoggingRegistryTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LoggingRegistryTest");
-
- CppUnit_addTest(pSuite, LoggingRegistryTest, testRegister);
- CppUnit_addTest(pSuite, LoggingRegistryTest, testReregister);
- CppUnit_addTest(pSuite, LoggingRegistryTest, testUnregister);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/LoggingRegistryTest.h b/Utilities/Poco/Foundation/testsuite/src/LoggingRegistryTest.h
deleted file mode 100755
index 5ae60d8e63..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LoggingRegistryTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// LoggingRegistryTest.h
-//
-// $Id$
-//
-// Definition of the LoggingRegistryTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef LoggingRegistryTest_INCLUDED
-#define LoggingRegistryTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class LoggingRegistryTest: public CppUnit::TestCase
-{
-public:
- LoggingRegistryTest(const std::string& name);
- ~LoggingRegistryTest();
-
- void testRegister();
- void testReregister();
- void testUnregister();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // LoggingRegistryTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/LoggingTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/LoggingTestSuite.cpp
deleted file mode 100755
index 9f6ea94ce9..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LoggingTestSuite.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// LoggingTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "LoggingTestSuite.h"
-#include "LoggerTest.h"
-#include "ChannelTest.h"
-#include "PatternFormatterTest.h"
-#include "FileChannelTest.h"
-#include "SimpleFileChannelTest.h"
-#include "LoggingFactoryTest.h"
-#include "LoggingRegistryTest.h"
-#include "LogStreamTest.h"
-
-
-CppUnit::Test* LoggingTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LoggingTestSuite");
-
- pSuite->addTest(LoggerTest::suite());
- pSuite->addTest(ChannelTest::suite());
- pSuite->addTest(PatternFormatterTest::suite());
- pSuite->addTest(FileChannelTest::suite());
- pSuite->addTest(SimpleFileChannelTest::suite());
- pSuite->addTest(LoggingFactoryTest::suite());
- pSuite->addTest(LoggingRegistryTest::suite());
- pSuite->addTest(LogStreamTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/LoggingTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/LoggingTestSuite.h
deleted file mode 100755
index c208dd704c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/LoggingTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// LoggingTestSuite.h
-//
-// $Id$
-//
-// Definition of the LoggingTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef LoggingTestSuite_INCLUDED
-#define LoggingTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class LoggingTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // LoggingTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/MD2EngineTest.cpp b/Utilities/Poco/Foundation/testsuite/src/MD2EngineTest.cpp
deleted file mode 100755
index bf2261c816..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/MD2EngineTest.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// MD2EngineTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "MD2EngineTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/MD2Engine.h"
-
-
-using Poco::MD2Engine;
-using Poco::DigestEngine;
-
-
-MD2EngineTest::MD2EngineTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-MD2EngineTest::~MD2EngineTest()
-{
-}
-
-
-void MD2EngineTest::testMD2()
-{
- MD2Engine engine;
-
- // test vectors from RFC 1319
-
- engine.update("");
- assert (DigestEngine::digestToHex(engine.digest()) == "8350e5a3e24c153df2275c9f80692773");
-
- engine.update("a");
- assert (DigestEngine::digestToHex(engine.digest()) == "32ec01ec4a6dac72c0ab96fb34c0b5d1");
-
- engine.update("abc");
- assert (DigestEngine::digestToHex(engine.digest()) == "da853b0d3f88d99b30283a69e6ded6bb");
-
- engine.update("message digest");
- assert (DigestEngine::digestToHex(engine.digest()) == "ab4f496bfb2a530b219ff33031fe06b0");
-
- engine.update("abcdefghijklmnopqrstuvwxyz");
- assert (DigestEngine::digestToHex(engine.digest()) == "4e8ddff3650292ab5a4108c3aa47940b");
-
- engine.update("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
- engine.update("abcdefghijklmnopqrstuvwxyz0123456789");
- assert (DigestEngine::digestToHex(engine.digest()) == "da33def2a42df13975352846c30338cd");
-
- engine.update("12345678901234567890123456789012345678901234567890123456789012345678901234567890");
- assert (DigestEngine::digestToHex(engine.digest()) == "d5976f79d83d3a0dc9806c3c66f3efd8");
-}
-
-
-void MD2EngineTest::setUp()
-{
-}
-
-
-void MD2EngineTest::tearDown()
-{
-}
-
-
-CppUnit::Test* MD2EngineTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("MD2EngineTest");
-
- CppUnit_addTest(pSuite, MD2EngineTest, testMD2);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/MD2EngineTest.h b/Utilities/Poco/Foundation/testsuite/src/MD2EngineTest.h
deleted file mode 100755
index ed4ae137c1..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/MD2EngineTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// MD2EngineTest.h
-//
-// $Id$
-//
-// Definition of the MD2EngineTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef MD2EngineTest_INCLUDED
-#define MD2EngineTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class MD2EngineTest: public CppUnit::TestCase
-{
-public:
- MD2EngineTest(const std::string& name);
- ~MD2EngineTest();
-
- void testMD2();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // MD2EngineTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/MD4EngineTest.cpp b/Utilities/Poco/Foundation/testsuite/src/MD4EngineTest.cpp
deleted file mode 100755
index ba37a0a386..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/MD4EngineTest.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// MD4EngineTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "MD4EngineTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/MD4Engine.h"
-
-
-using Poco::MD4Engine;
-using Poco::DigestEngine;
-
-
-MD4EngineTest::MD4EngineTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-MD4EngineTest::~MD4EngineTest()
-{
-}
-
-
-void MD4EngineTest::testMD4()
-{
- MD4Engine engine;
-
- // test vectors from RFC 1320
-
- engine.update("");
- assert (DigestEngine::digestToHex(engine.digest()) == "31d6cfe0d16ae931b73c59d7e0c089c0");
-
- engine.update("a");
- assert (DigestEngine::digestToHex(engine.digest()) == "bde52cb31de33e46245e05fbdbd6fb24");
-
- engine.update("abc");
- assert (DigestEngine::digestToHex(engine.digest()) == "a448017aaf21d8525fc10ae87aa6729d");
-
- engine.update("message digest");
- assert (DigestEngine::digestToHex(engine.digest()) == "d9130a8164549fe818874806e1c7014b");
-
- engine.update("abcdefghijklmnopqrstuvwxyz");
- assert (DigestEngine::digestToHex(engine.digest()) == "d79e1c308aa5bbcdeea8ed63df412da9");
-
- engine.update("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
- engine.update("abcdefghijklmnopqrstuvwxyz0123456789");
- assert (DigestEngine::digestToHex(engine.digest()) == "043f8582f241db351ce627e153e7f0e4");
-
- engine.update("12345678901234567890123456789012345678901234567890123456789012345678901234567890");
- assert (DigestEngine::digestToHex(engine.digest()) == "e33b4ddc9c38f2199c3e7b164fcc0536");
-}
-
-
-void MD4EngineTest::setUp()
-{
-}
-
-
-void MD4EngineTest::tearDown()
-{
-}
-
-
-CppUnit::Test* MD4EngineTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("MD4EngineTest");
-
- CppUnit_addTest(pSuite, MD4EngineTest, testMD4);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/MD4EngineTest.h b/Utilities/Poco/Foundation/testsuite/src/MD4EngineTest.h
deleted file mode 100755
index 89efbe1eeb..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/MD4EngineTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// MD4EngineTest.h
-//
-// $Id$
-//
-// Definition of the MD4EngineTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef MD4EngineTest_INCLUDED
-#define MD4EngineTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class MD4EngineTest: public CppUnit::TestCase
-{
-public:
- MD4EngineTest(const std::string& name);
- ~MD4EngineTest();
-
- void testMD4();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // MD4EngineTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/MD5EngineTest.cpp b/Utilities/Poco/Foundation/testsuite/src/MD5EngineTest.cpp
deleted file mode 100755
index 2e62f54ab5..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/MD5EngineTest.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// MD5EngineTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "MD5EngineTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/MD5Engine.h"
-
-
-using Poco::MD5Engine;
-using Poco::DigestEngine;
-
-
-MD5EngineTest::MD5EngineTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-MD5EngineTest::~MD5EngineTest()
-{
-}
-
-
-void MD5EngineTest::testMD5()
-{
- MD5Engine engine;
-
- // test vectors from RFC 1321
-
- engine.update("");
- assert (DigestEngine::digestToHex(engine.digest()) == "d41d8cd98f00b204e9800998ecf8427e");
-
- engine.update("a");
- assert (DigestEngine::digestToHex(engine.digest()) == "0cc175b9c0f1b6a831c399e269772661");
-
- engine.update("abc");
- assert (DigestEngine::digestToHex(engine.digest()) == "900150983cd24fb0d6963f7d28e17f72");
-
- engine.update("message digest");
- assert (DigestEngine::digestToHex(engine.digest()) == "f96b697d7cb7938d525a2f31aaf161d0");
-
- engine.update("abcdefghijklmnopqrstuvwxyz");
- assert (DigestEngine::digestToHex(engine.digest()) == "c3fcd3d76192e4007dfb496cca67e13b");
-
- engine.update("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
- engine.update("abcdefghijklmnopqrstuvwxyz0123456789");
- assert (DigestEngine::digestToHex(engine.digest()) == "d174ab98d277d9f5a5611c2c9f419d9f");
-
- engine.update("12345678901234567890123456789012345678901234567890123456789012345678901234567890");
- assert (DigestEngine::digestToHex(engine.digest()) == "57edf4a22be3c955ac49da2e2107b67a");
-}
-
-
-void MD5EngineTest::setUp()
-{
-}
-
-
-void MD5EngineTest::tearDown()
-{
-}
-
-
-CppUnit::Test* MD5EngineTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("MD5EngineTest");
-
- CppUnit_addTest(pSuite, MD5EngineTest, testMD5);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/MD5EngineTest.h b/Utilities/Poco/Foundation/testsuite/src/MD5EngineTest.h
deleted file mode 100755
index d82f4d33ea..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/MD5EngineTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// MD5EngineTest.h
-//
-// $Id$
-//
-// Definition of the MD5EngineTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef MD5EngineTest_INCLUDED
-#define MD5EngineTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class MD5EngineTest: public CppUnit::TestCase
-{
-public:
- MD5EngineTest(const std::string& name);
- ~MD5EngineTest();
-
- void testMD5();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // MD5EngineTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ManifestTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ManifestTest.cpp
deleted file mode 100755
index 246951de82..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ManifestTest.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// ManifestTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ManifestTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Manifest.h"
-#include "Poco/MetaObject.h"
-#include <set>
-
-
-using Poco::Manifest;
-using Poco::MetaObject;
-
-
-class MfTestBase
-{
-};
-
-
-class MfTestObject: public MfTestBase
-{
-};
-
-
-ManifestTest::ManifestTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ManifestTest::~ManifestTest()
-{
-}
-
-
-void ManifestTest::testManifest()
-{
- Manifest<MfTestBase> manifest;
- assert (manifest.empty());
- assert (manifest.size() == 0);
- assert (manifest.insert(new MetaObject<MfTestObject, MfTestBase>("MfTestObject1")));
- assert (!manifest.empty());
- assert (manifest.size() == 1);
- assert (manifest.insert(new MetaObject<MfTestObject, MfTestBase>("MfTestObject2")));
- MetaObject<MfTestObject, MfTestBase>* pMeta = new MetaObject<MfTestObject, MfTestBase>("MfTestObject2");
- assert (!manifest.insert(pMeta));
- delete pMeta;
- assert (!manifest.empty());
- assert (manifest.size() == 2);
- assert (manifest.insert(new MetaObject<MfTestObject, MfTestBase>("MfTestObject3")));
- assert (manifest.size() == 3);
-
- assert (manifest.find("MfTestObject1") != manifest.end());
- assert (manifest.find("MfTestObject2") != manifest.end());
- assert (manifest.find("MfTestObject3") != manifest.end());
- assert (manifest.find("MfTestObject4") == manifest.end());
-
- std::set<std::string> classes;
-
- Manifest<MfTestBase>::Iterator it = manifest.begin();
- assert (it != manifest.end());
- classes.insert(it->name());
- ++it;
- assert (it != manifest.end());
- classes.insert(it->name());
- ++it;
- assert (it != manifest.end());
- classes.insert(it->name());
- it++;
- assert (it == manifest.end());
-
- assert (classes.find("MfTestObject1") != classes.end());
- assert (classes.find("MfTestObject2") != classes.end());
- assert (classes.find("MfTestObject3") != classes.end());
-
- manifest.clear();
- assert (manifest.empty());
- assert (manifest.size() == 0);
- assert (manifest.insert(new MetaObject<MfTestObject, MfTestBase>("MfTestObject4")));
- assert (!manifest.empty());
- assert (manifest.size() == 1);
- it = manifest.begin();
- assert (it != manifest.end());
- assert (std::string(it->name()) == "MfTestObject4");
- ++it;
- assert (it == manifest.end());
-}
-
-
-void ManifestTest::setUp()
-{
-}
-
-
-void ManifestTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ManifestTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ManifestTest");
-
- CppUnit_addTest(pSuite, ManifestTest, testManifest);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ManifestTest.h b/Utilities/Poco/Foundation/testsuite/src/ManifestTest.h
deleted file mode 100755
index c6fd13b2fa..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ManifestTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// ManifestTest.h
-//
-// $Id$
-//
-// Definition of the ManifestTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ManifestTest_INCLUDED
-#define ManifestTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ManifestTest: public CppUnit::TestCase
-{
-public:
- ManifestTest(const std::string& name);
- ~ManifestTest();
-
- void testManifest();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ManifestTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/MemoryPoolTest.cpp b/Utilities/Poco/Foundation/testsuite/src/MemoryPoolTest.cpp
deleted file mode 100755
index 3da02caa5b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/MemoryPoolTest.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// MemoryPoolTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2005-2006, 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 "MemoryPoolTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/MemoryPool.h"
-#include <vector>
-
-
-using Poco::MemoryPool;
-
-
-MemoryPoolTest::MemoryPoolTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-MemoryPoolTest::~MemoryPoolTest()
-{
-}
-
-
-void MemoryPoolTest::testMemoryPool()
-{
- MemoryPool pool1(100, 0, 10);
-
- assert (pool1.blockSize() == 100);
- assert (pool1.allocated() == 0);
- assert (pool1.available() == 0);
-
- std::vector<void*> ptrs;
- for (int i = 0; i < 10; ++i)
- {
- ptrs.push_back(pool1.get());
- assert (pool1.allocated() == i + 1);
- assert (pool1.available() == 0);
- }
-
- try
- {
- pool1.get();
- fail("pool exhausted - must throw exception");
- }
- catch (Poco::OutOfMemoryException&)
- {
- }
-
- int av = 0;
- for (std::vector<void*>::iterator it = ptrs.begin(); it != ptrs.end(); ++it)
- {
- pool1.release(*it);
- ++av;
- assert (pool1.available() == av);
- }
-
- MemoryPool pool2(32, 5, 10);
- assert (pool2.available() == 5);
- assert (pool2.blockSize() == 32);
- assert (pool2.allocated() == 5);
-}
-
-
-void MemoryPoolTest::setUp()
-{
-}
-
-
-void MemoryPoolTest::tearDown()
-{
-}
-
-
-CppUnit::Test* MemoryPoolTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("MemoryPoolTest");
-
- CppUnit_addTest(pSuite, MemoryPoolTest, testMemoryPool);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/MemoryPoolTest.h b/Utilities/Poco/Foundation/testsuite/src/MemoryPoolTest.h
deleted file mode 100755
index 6b35b0eb9c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/MemoryPoolTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// MemoryPoolTest.h
-//
-// $Id$
-//
-// Definition of the MemoryPoolTest class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef MemoryPoolTest_INCLUDED
-#define MemoryPoolTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class MemoryPoolTest: public CppUnit::TestCase
-{
-public:
- MemoryPoolTest(const std::string& name);
- ~MemoryPoolTest();
-
- void testMemoryPool();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // MemoryPoolTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/NDCTest.cpp b/Utilities/Poco/Foundation/testsuite/src/NDCTest.cpp
deleted file mode 100755
index c53ded13a3..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NDCTest.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// NDCTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NDCTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/NestedDiagnosticContext.h"
-#include <iostream>
-
-
-using Poco::NDC;
-
-
-NDCTest::NDCTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NDCTest::~NDCTest()
-{
-}
-
-
-void NDCTest::testNDC()
-{
- NDC ndc;
- assert (ndc.depth() == 0);
- ndc.push("item1");
- assert (ndc.toString() == "item1");
- assert (ndc.depth() == 1);
- ndc.push("item2");
- assert (ndc.toString() == "item1:item2");
- assert (ndc.depth() == 2);
- ndc.pop();
- assert (ndc.depth() == 1);
- assert (ndc.toString() == "item1");
- ndc.pop();
- assert (ndc.depth() == 0);
-}
-
-
-void NDCTest::testNDCScope()
-{
- poco_ndc("item1");
- assert (NDC::current().depth() == 1);
- {
- poco_ndc("item2");
- assert (NDC::current().depth() == 2);
- {
- poco_ndc("item3");
- assert (NDC::current().depth() == 3);
- NDC::current().dump(std::cout);
- }
- assert (NDC::current().depth() == 2);
- }
- assert (NDC::current().depth() == 1);
-}
-
-
-void NDCTest::setUp()
-{
-}
-
-
-void NDCTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NDCTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NDCTest");
-
- CppUnit_addTest(pSuite, NDCTest, testNDC);
- CppUnit_addTest(pSuite, NDCTest, testNDCScope);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/NDCTest.h b/Utilities/Poco/Foundation/testsuite/src/NDCTest.h
deleted file mode 100755
index a058666d4a..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NDCTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// NDCTest.h
-//
-// $Id$
-//
-// Definition of the NDCTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NDCTest_INCLUDED
-#define NDCTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class NDCTest: public CppUnit::TestCase
-{
-public:
- NDCTest(const std::string& name);
- ~NDCTest();
-
- void testNDC();
- void testNDCScope();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NDCTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/NamedEventTest.cpp b/Utilities/Poco/Foundation/testsuite/src/NamedEventTest.cpp
deleted file mode 100755
index 74a93599e9..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NamedEventTest.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// NamedEventTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NamedEventTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/NamedEvent.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-#include "Poco/Timestamp.h"
-
-
-using Poco::NamedEvent;
-using Poco::Thread;
-using Poco::Runnable;
-using Poco::Timestamp;
-
-
-static NamedEvent testEvent("TestEvent");
-
-
-namespace
-{
- class TestEvent: public Runnable
- {
- public:
- void run()
- {
-
- testEvent.wait();
- _timestamp.update();
- }
-
- const Timestamp& timestamp() const
- {
- return _timestamp;
- }
-
- private:
- Timestamp _timestamp;
- };
-}
-
-
-NamedEventTest::NamedEventTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NamedEventTest::~NamedEventTest()
-{
-}
-
-
-void NamedEventTest::testNamedEvent()
-{
- Thread thr1;
- TestEvent te;
- thr1.start(te);
- Timestamp now;
- Thread::sleep(2000);
- testEvent.set();
- thr1.join();
- assert (te.timestamp() > now);
-
- Thread thr2;
- thr2.start(te);
- now.update();
- Thread::sleep(2000);
- testEvent.set();
- thr2.join();
- assert (te.timestamp() > now);
-}
-
-
-void NamedEventTest::setUp()
-{
-}
-
-
-void NamedEventTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NamedEventTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NamedEventTest");
-
- CppUnit_addTest(pSuite, NamedEventTest, testNamedEvent);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/NamedEventTest.h b/Utilities/Poco/Foundation/testsuite/src/NamedEventTest.h
deleted file mode 100755
index 5082955983..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NamedEventTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// NamedEventTest.h
-//
-// $Id$
-//
-// Definition of the NamedEventTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NamedEventTest_INCLUDED
-#define NamedEventTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class NamedEventTest: public CppUnit::TestCase
-{
-public:
- NamedEventTest(const std::string& name);
- ~NamedEventTest();
-
- void testNamedEvent();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NamedEventTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/NamedMutexTest.cpp b/Utilities/Poco/Foundation/testsuite/src/NamedMutexTest.cpp
deleted file mode 100755
index 0c075357a3..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NamedMutexTest.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// NamedMutexTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NamedMutexTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/NamedMutex.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-#include "Poco/Timestamp.h"
-
-
-using Poco::NamedMutex;
-using Poco::Thread;
-using Poco::Runnable;
-using Poco::Timestamp;
-
-
-static NamedMutex testMutex("TestMutex");
-
-
-namespace
-{
- class TestLock: public Runnable
- {
- public:
- void run()
- {
-
- testMutex.lock();
- _timestamp.update();
- testMutex.unlock();
- }
-
- const Timestamp& timestamp() const
- {
- return _timestamp;
- }
-
- private:
- Timestamp _timestamp;
- };
-
- class TestTryLock: public Runnable
- {
- public:
- TestTryLock(): _locked(false)
- {
- }
-
- void run()
- {
- if (testMutex.tryLock())
- {
- _locked = true;
- testMutex.unlock();
- }
- }
-
- bool locked() const
- {
- return _locked;
- }
-
- private:
- bool _locked;
- };
-}
-
-
-NamedMutexTest::NamedMutexTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NamedMutexTest::~NamedMutexTest()
-{
-}
-
-
-void NamedMutexTest::testLock()
-{
- testMutex.lock();
- Thread thr;
- TestLock tl;
- thr.start(tl);
- Timestamp now;
- Thread::sleep(2000);
- testMutex.unlock();
- thr.join();
- assert (tl.timestamp() > now);
-}
-
-
-void NamedMutexTest::testTryLock()
-{
- Thread thr1;
- TestTryLock ttl1;
- thr1.start(ttl1);
- thr1.join();
- assert (ttl1.locked());
-
- testMutex.lock();
- Thread thr2;
- TestTryLock ttl2;
- thr2.start(ttl2);
- thr2.join();
- testMutex.unlock();
- assert (!ttl2.locked());
-}
-
-
-void NamedMutexTest::setUp()
-{
-}
-
-
-void NamedMutexTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NamedMutexTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NamedMutexTest");
-
- CppUnit_addTest(pSuite, NamedMutexTest, testLock);
- CppUnit_addTest(pSuite, NamedMutexTest, testTryLock);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/NamedMutexTest.h b/Utilities/Poco/Foundation/testsuite/src/NamedMutexTest.h
deleted file mode 100755
index 3279d69e23..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NamedMutexTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// NamedMutexTest.h
-//
-// $Id$
-//
-// Definition of the NamedMutexTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NamedMutexTest_INCLUDED
-#define NamedMutexTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class NamedMutexTest: public CppUnit::TestCase
-{
-public:
- NamedMutexTest(const std::string& name);
- ~NamedMutexTest();
-
- void testLock();
- void testTryLock();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NamedMutexTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/NamedTuplesTest.cpp b/Utilities/Poco/Foundation/testsuite/src/NamedTuplesTest.cpp
deleted file mode 100755
index 7baafadfd0..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NamedTuplesTest.cpp
+++ /dev/null
@@ -1,1663 +0,0 @@
-//
-// NamedTuplesTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "NamedTuplesTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/NamedTuple.h"
-#include "Poco/Exception.h"
-
-using Poco::NamedTuple;
-using Poco::Int8;
-using Poco::UInt8;
-using Poco::Int16;
-using Poco::UInt16;
-using Poco::Int32;
-using Poco::UInt32;
-using Poco::Int8;
-using Poco::UInt8;
-using Poco::Int16;
-using Poco::UInt16;
-using Poco::Int32;
-using Poco::UInt32;
-using Poco::NotFoundException;
-using Poco::InvalidArgumentException;
-
-NamedTuplesTest::NamedTuplesTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NamedTuplesTest::~NamedTuplesTest()
-{
-}
-
-
-void NamedTuplesTest::testNamedTuple1()
-{
- typedef NamedTuple<std::string> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 1);
-
- TupleType aTuple2("string1", "1");
- assert (aTuple2["string1"] == "1");
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.set<0>("2");
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3.length == 1);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple2()
-{
- typedef NamedTuple<std::string, int> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 2);
-
- TupleType aTuple2("string1", "1",
- "int1", 1);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3.length == 2);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple3()
-{
- typedef NamedTuple<std::string,
- int,
- bool> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 3);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3.length == 3);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple4()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 4);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3.length == 4);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple5()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 5);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c');
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3.length == 5);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple6()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 6);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3.length == 6);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple7()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 7);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3.length == 7);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple8()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 8);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3.length == 8);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-
-void NamedTuplesTest::testNamedTuple9()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 9);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2");
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3.length == 9);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple10()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 10);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2 );
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3.length == 10);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple11()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int,
- std::string> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
- assert (aTuple["K"] == "");
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 11);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2,
- "string3", "3");
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
- assert (aTuple2["string3"] == "3");
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3["string3"] == "");
- assert (aTuple3.length == 11);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple12()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int,
- std::string,
- int> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
- assert (aTuple["K"] == "");
- assert (aTuple["L"] == 0);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 12);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2,
- "string3", "3",
- "int3", 3);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
- assert (aTuple2["string3"] == "3");
- assert (aTuple2["int3"] == 3);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3["string3"] == "");
- assert (aTuple3.length == 12);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple13()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int,
- std::string,
- int,
- bool> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
- assert (aTuple["K"] == "");
- assert (aTuple["L"] == 0);
- assert (aTuple["M"] == false);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 13);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2,
- "string3", "3",
- "int3", 3,
- "bool2", true);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
- assert (aTuple2["string3"] == "3");
- assert (aTuple2["int3"] == 3);
- assert (aTuple2["bool2"] == true);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3["string3"] == "");
- assert (aTuple3.length == 13);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple14()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int,
- std::string,
- int,
- bool,
- float> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
- assert (aTuple["K"] == "");
- assert (aTuple["L"] == 0);
- assert (aTuple["M"] == false);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 14);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2,
- "string3", "3",
- "int3", 3,
- "bool2", true,
- "float2", 2.5);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
- assert (aTuple2["string3"] == "3");
- assert (aTuple2["int3"] == 3);
- assert (aTuple2["bool2"] == true);
- assert (aTuple2["float2"] == 2.5);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3["string3"] == "");
- assert (aTuple3["int3"] == 0);
- assert (aTuple3.length == 14);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple15()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int,
- std::string,
- int,
- bool,
- float,
- char> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
- assert (aTuple["K"] == "");
- assert (aTuple["L"] == 0);
- assert (aTuple["M"] == false);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 15);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2,
- "string3", "3",
- "int3", 3,
- "bool2", true,
- "float2", 2.5,
- "char2", 'c');
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
- assert (aTuple2["string3"] == "3");
- assert (aTuple2["int3"] == 3);
- assert (aTuple2["bool2"] == true);
- assert (aTuple2["float2"] == 2.5);
- assert (aTuple2["char2"] == 'c');
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3["string3"] == "");
- assert (aTuple3["int3"] == 0);
- assert (aTuple3["bool2"] == false);
- assert (aTuple3.length == 15);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple16()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int,
- std::string,
- int,
- bool,
- float,
- char,
- long> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
- assert (aTuple["K"] == "");
- assert (aTuple["L"] == 0);
- assert (aTuple["M"] == false);
- assert (aTuple["O"] == 0);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 16);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2,
- "string3", "3",
- "int3", 3,
- "bool2", true,
- "float2", 2.5,
- "char2", 'c',
- "long2", 999);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
- assert (aTuple2["string3"] == "3");
- assert (aTuple2["int3"] == 3);
- assert (aTuple2["bool2"] == true);
- assert (aTuple2["float2"] == 2.5);
- assert (aTuple2["char2"] == 'c');
- assert (aTuple2["long2"] == 999);
- assert (aTuple2.length == 16);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3["string3"] == "");
- assert (aTuple3["int3"] == 0);
- assert (aTuple3["bool2"] == false);
- assert (aTuple3["char2"] == 0);
- assert (aTuple3.length == 16);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple17()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int,
- std::string,
- int,
- bool,
- float,
- char,
- long,
- double> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
- assert (aTuple["K"] == "");
- assert (aTuple["L"] == 0);
- assert (aTuple["M"] == false);
- assert (aTuple["O"] == 0);
- assert (aTuple["P"] == 0);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 17);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2,
- "string3", "3",
- "int3", 3,
- "bool2", true,
- "float2", 2.5,
- "char2", 'c',
- "long2", 999,
- "double2", 2.5);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
- assert (aTuple2["string3"] == "3");
- assert (aTuple2["int3"] == 3);
- assert (aTuple2["bool2"] == true);
- assert (aTuple2["float2"] == 2.5);
- assert (aTuple2["char2"] == 'c');
- assert (aTuple2["long2"] == 999);
- assert (aTuple2["float2"] == 2.5);
- assert (aTuple2.length == 17);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3["string3"] == "");
- assert (aTuple3["int3"] == 0);
- assert (aTuple3["bool2"] == false);
- assert (aTuple3["char2"] == 0);
- assert (aTuple3["long2"] == 0);
- assert (aTuple3.length == 17);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple18()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int,
- std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
- assert (aTuple["K"] == "");
- assert (aTuple["L"] == 0);
- assert (aTuple["M"] == false);
- assert (aTuple["O"] == 0);
- assert (aTuple["P"] == 0);
- assert (aTuple["R"] == 0);
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 18);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2,
- "string3", "3",
- "int3", 3,
- "bool2", true,
- "float2", 2.5,
- "char2", 'c',
- "long2", 999,
- "double2", 2.5,
- "short2", 32700);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
- assert (aTuple2["string3"] == "3");
- assert (aTuple2["int3"] == 3);
- assert (aTuple2["bool2"] == true);
- assert (aTuple2["float2"] == 2.5);
- assert (aTuple2["char2"] == 'c');
- assert (aTuple2["long2"] == 999);
- assert (aTuple2["float2"] == 2.5);
- assert (aTuple2["short2"] == 32700);
- assert (aTuple2.length == 18);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3["string3"] == "");
- assert (aTuple3["int3"] == 0);
- assert (aTuple3["bool2"] == false);
- assert (aTuple3["char2"] == 0);
- assert (aTuple3["long2"] == 0);
- assert (aTuple3["short2"] == 0);
- assert (aTuple3.length == 18);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple19()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int,
- std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
- assert (aTuple["K"] == "");
- assert (aTuple["L"] == 0);
- assert (aTuple["M"] == false);
- assert (aTuple["O"] == 0);
- assert (aTuple["P"] == 0);
- assert (aTuple["R"] == 0);
- assert (aTuple["S"] == "");
-
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 19);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2,
- "string3", "3",
- "int3", 3,
- "bool2", true,
- "float2", 2.5,
- "char2", 'c',
- "long2", 999,
- "double2", 2.5,
- "short2", 32700,
- "string4", "4");
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
- assert (aTuple2["string3"] == "3");
- assert (aTuple2["int3"] == 3);
- assert (aTuple2["bool2"] == true);
- assert (aTuple2["float2"] == 2.5);
- assert (aTuple2["char2"] == 'c');
- assert (aTuple2["long2"] == 999);
- assert (aTuple2["float2"] == 2.5);
- assert (aTuple2["short2"] == 32700);
- assert (aTuple2["string4"] == "4");
- assert (aTuple2.length == 19);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3["string3"] == "");
- assert (aTuple3["int3"] == 0);
- assert (aTuple3["bool2"] == false);
- assert (aTuple3["char2"] == 0);
- assert (aTuple3["long2"] == 0);
- assert (aTuple3["short2"] == 0);
- assert (aTuple3["string4"] == "");
- assert (aTuple3.length == 19);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::testNamedTuple20()
-{
- typedef NamedTuple<std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int,
- std::string,
- int,
- bool,
- float,
- char,
- long,
- double,
- short,
- std::string,
- int> TupleType;
-
- TupleType aTuple;
-
- assert (aTuple["A"] == "");
- assert (aTuple["B"] == 0);
- assert (aTuple["C"] == false);
- assert (aTuple["E"] == 0);
- assert (aTuple["F"] == 0);
- assert (aTuple["H"] == 0);
- assert (aTuple["I"] == "");
- assert (aTuple["J"] == 0);
- assert (aTuple["K"] == "");
- assert (aTuple["L"] == 0);
- assert (aTuple["M"] == false);
- assert (aTuple["O"] == 0);
- assert (aTuple["P"] == 0);
- assert (aTuple["R"] == 0);
- assert (aTuple["S"] == "");
- assert (aTuple["T"] == 0);
- try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
- catch (NotFoundException&) { }
- assert (aTuple.length == 20);
-
- TupleType aTuple2("string1", "1",
- "int1", 1,
- "bool1", true,
- "float1", 1.5f,
- "char1", 'c',
- "long1", 999,
- "double1", 1.5,
- "short1", 32700,
- "string2", "2",
- "int2", 2,
- "string3", "3",
- "int3", 3,
- "bool2", true,
- "float2", 2.5,
- "char2", 'c',
- "long2", 999,
- "double2", 2.5,
- "short2", 32700,
- "string4", "4",
- "int4", 4);
- assert (aTuple2["string1"] == "1");
- assert (aTuple2["int1"] == 1);
- assert (aTuple2["bool1"] == true);
- assert (aTuple2["float1"] == 1.5);
- assert (aTuple2["char1"] == 'c');
- assert (aTuple2["long1"] == 999);
- assert (aTuple2["double1"] == 1.5);
- assert (aTuple2["short1"] == 32700);
- assert (aTuple2["string2"] == "2");
- assert (aTuple2["int2"] == 2);
- assert (aTuple2["string3"] == "3");
- assert (aTuple2["int3"] == 3);
- assert (aTuple2["bool2"] == true);
- assert (aTuple2["float2"] == 2.5);
- assert (aTuple2["char2"] == 'c');
- assert (aTuple2["long2"] == 999);
- assert (aTuple2["float2"] == 2.5);
- assert (aTuple2["short2"] == 32700);
- assert (aTuple2["string4"] == "4");
- assert (aTuple2["int4"] == 4);
- assert (aTuple2.length == 20);
-
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3(aTuple2.names());
- assert (aTuple3.names() == aTuple2.names());
- assert (aTuple3["string1"] == "");
- assert (aTuple3["int1"] == 0);
- assert (aTuple3["bool1"] == false);
- assert (aTuple3["char1"] == 0);
- assert (aTuple3["long1"] == 0);
- assert (aTuple3["short1"] == 0);
- assert (aTuple3["string2"] == "");
- assert (aTuple3["int2"] == 0);
- assert (aTuple3["string3"] == "");
- assert (aTuple3["int3"] == 0);
- assert (aTuple3["bool2"] == false);
- assert (aTuple3["char2"] == 0);
- assert (aTuple3["long2"] == 0);
- assert (aTuple3["short2"] == 0);
- assert (aTuple3["string4"] == "");
- assert (aTuple3["int4"] == 0);
- assert (aTuple3.length == 20);
-
- assert (aTuple.getName(0) == "string1");
- aTuple.setName(0, "New Name");
- assert (aTuple.getName(0) == "New Name");
-
- try { aTuple.setName(20, ""); fail("must fail"); }
- catch (InvalidArgumentException&) { }
-}
-
-
-void NamedTuplesTest::setUp()
-{
-}
-
-
-void NamedTuplesTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NamedTuplesTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NamedTuplesTest");
-
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple1);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple2);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple3);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple4);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple5);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple6);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple7);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple8);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple9);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple10);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple11);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple12);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple13);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple14);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple15);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple16);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple17);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple18);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple19);
- CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple20);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/NamedTuplesTest.h b/Utilities/Poco/Foundation/testsuite/src/NamedTuplesTest.h
deleted file mode 100755
index c293f739d9..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NamedTuplesTest.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// NamedTuplesTest.h
-//
-// $Id$
-//
-// Definition of the NamedTuplesTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef NamedTuplesTest_INCLUDED
-#define NamedTuplesTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class NamedTuplesTest: public CppUnit::TestCase
-{
-public:
- NamedTuplesTest(const std::string& name);
- ~NamedTuplesTest();
-
- void testNamedTuple1();
- void testNamedTuple2();
- void testNamedTuple3();
- void testNamedTuple4();
- void testNamedTuple5();
- void testNamedTuple6();
- void testNamedTuple7();
- void testNamedTuple8();
- void testNamedTuple9();
- void testNamedTuple10();
- void testNamedTuple11();
- void testNamedTuple12();
- void testNamedTuple13();
- void testNamedTuple14();
- void testNamedTuple15();
- void testNamedTuple16();
- void testNamedTuple17();
- void testNamedTuple18();
- void testNamedTuple19();
- void testNamedTuple20();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NamedTuplesTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/NotificationCenterTest.cpp b/Utilities/Poco/Foundation/testsuite/src/NotificationCenterTest.cpp
deleted file mode 100755
index b5d1606574..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NotificationCenterTest.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-//
-// NotificationCenterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NotificationCenterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/NotificationCenter.h"
-#include "Poco/Observer.h"
-#include "Poco/NObserver.h"
-#include "Poco/AutoPtr.h"
-
-
-using Poco::NotificationCenter;
-using Poco::Observer;
-using Poco::NObserver;
-using Poco::Notification;
-using Poco::AutoPtr;
-
-
-class TestNotification: public Notification
-{
-};
-
-
-NotificationCenterTest::NotificationCenterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NotificationCenterTest::~NotificationCenterTest()
-{
-}
-
-
-void NotificationCenterTest::test1()
-{
- NotificationCenter nc;
- nc.postNotification(new Notification);
-}
-
-
-void NotificationCenterTest::test2()
-{
- NotificationCenter nc;
- nc.addObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
- nc.postNotification(new Notification);
- assert (_set.size() == 1);
- assert (_set.find("handle1") != _set.end());
- nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
-}
-
-
-void NotificationCenterTest::test3()
-{
- NotificationCenter nc;
- nc.addObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
- nc.addObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle2));
- nc.postNotification(new Notification);
- assert (_set.size() == 2);
- assert (_set.find("handle1") != _set.end());
- assert (_set.find("handle2") != _set.end());
- nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
- nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle2));
-}
-
-
-void NotificationCenterTest::test4()
-{
- NotificationCenter nc;
- nc.addObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
- nc.addObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle2));
- nc.postNotification(new Notification);
- assert (_set.size() == 2);
- assert (_set.find("handle1") != _set.end());
- assert (_set.find("handle2") != _set.end());
- nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
- nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle2));
- _set.clear();
- nc.postNotification(new Notification);
- assert (_set.empty());
- nc.addObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle3));
- nc.postNotification(new Notification);
- assert (_set.size() == 1);
- assert (_set.find("handle3") != _set.end());
- nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle3));
-}
-
-
-void NotificationCenterTest::test5()
-{
- NotificationCenter nc;
- nc.addObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
- nc.addObserver(Observer<NotificationCenterTest, TestNotification>(*this, &NotificationCenterTest::handleTest));
- nc.postNotification(new Notification);
- assert (_set.size() == 1);
- assert (_set.find("handle1") != _set.end());
- _set.clear();
- nc.postNotification(new TestNotification);
- assert (_set.size() == 2);
- assert (_set.find("handle1") != _set.end());
- assert (_set.find("handleTest") != _set.end());
- nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
- nc.removeObserver(Observer<NotificationCenterTest, TestNotification>(*this, &NotificationCenterTest::handleTest));
-}
-
-
-void NotificationCenterTest::testAuto()
-{
- NotificationCenter nc;
- nc.addObserver(NObserver<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handleAuto));
- nc.postNotification(new Notification);
- assert (_set.size() == 1);
- assert (_set.find("handleAuto") != _set.end());
- nc.removeObserver(NObserver<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handleAuto));
-}
-
-
-void NotificationCenterTest::testDefaultCenter()
-{
- NotificationCenter& nc = NotificationCenter::defaultCenter();
- nc.addObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
- nc.postNotification(new Notification);
- assert (_set.size() == 1);
- assert (_set.find("handle1") != _set.end());
- nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
-}
-
-
-void NotificationCenterTest::handle1(Poco::Notification* pNf)
-{
- poco_check_ptr (pNf);
- AutoPtr<Notification> nf = pNf;
- _set.insert("handle1");
-}
-
-
-void NotificationCenterTest::handle2(Poco::Notification* pNf)
-{
- poco_check_ptr (pNf);
- AutoPtr<Notification> nf = pNf;
- _set.insert("handle2");
-}
-
-
-void NotificationCenterTest::handle3(Poco::Notification* pNf)
-{
- poco_check_ptr (pNf);
- AutoPtr<Notification> nf = pNf;
- _set.insert("handle3");
-}
-
-
-void NotificationCenterTest::handleTest(TestNotification* pNf)
-{
- poco_check_ptr (pNf);
- AutoPtr<TestNotification> nf = pNf;
- _set.insert("handleTest");
-}
-
-
-void NotificationCenterTest::handleAuto(const AutoPtr<Notification>& pNf)
-{
- _set.insert("handleAuto");
-}
-
-
-void NotificationCenterTest::setUp()
-{
- _set.clear();
-}
-
-
-void NotificationCenterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NotificationCenterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NotificationCenterTest");
-
- CppUnit_addTest(pSuite, NotificationCenterTest, test1);
- CppUnit_addTest(pSuite, NotificationCenterTest, test2);
- CppUnit_addTest(pSuite, NotificationCenterTest, test3);
- CppUnit_addTest(pSuite, NotificationCenterTest, test4);
- CppUnit_addTest(pSuite, NotificationCenterTest, test5);
- CppUnit_addTest(pSuite, NotificationCenterTest, testAuto);
- CppUnit_addTest(pSuite, NotificationCenterTest, testDefaultCenter);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/NotificationCenterTest.h b/Utilities/Poco/Foundation/testsuite/src/NotificationCenterTest.h
deleted file mode 100755
index b1dd4ddedc..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NotificationCenterTest.h
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// NotificationCenterTest.h
-//
-// $Id$
-//
-// Definition of the NotificationCenterTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NotificationCenterTest_INCLUDED
-#define NotificationCenterTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/Notification.h"
-#include "Poco/AutoPtr.h"
-#include <set>
-
-
-class TestNotification;
-
-
-class NotificationCenterTest: public CppUnit::TestCase
-{
-public:
- NotificationCenterTest(const std::string& name);
- ~NotificationCenterTest();
-
- void test1();
- void test2();
- void test3();
- void test4();
- void test5();
- void testAuto();
- void testDefaultCenter();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-protected:
- void handle1(Poco::Notification* pNf);
- void handle2(Poco::Notification* pNf);
- void handle3(Poco::Notification* pNf);
- void handleTest(TestNotification* pNf);
- void handleAuto(const Poco::AutoPtr<Poco::Notification>& pNf);
-
-private:
- std::set<std::string> _set;
-};
-
-
-#endif // NotificationCenterTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/NotificationQueueTest.cpp b/Utilities/Poco/Foundation/testsuite/src/NotificationQueueTest.cpp
deleted file mode 100755
index 49de26823f..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NotificationQueueTest.cpp
+++ /dev/null
@@ -1,252 +0,0 @@
-//
-// NotificationQueueTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NotificationQueueTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/NotificationQueue.h"
-#include "Poco/Notification.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-#include "Poco/RunnableAdapter.h"
-#include "Poco/Random.h"
-
-
-using Poco::NotificationQueue;
-using Poco::Notification;
-using Poco::Thread;
-using Poco::RunnableAdapter;
-
-
-namespace
-{
- class QTestNotification: public Notification
- {
- public:
- QTestNotification(const std::string& data): _data(data)
- {
- }
- ~QTestNotification()
- {
- }
- const std::string& data() const
- {
- return _data;
- }
-
- private:
- std::string _data;
- };
-}
-
-
-NotificationQueueTest::NotificationQueueTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NotificationQueueTest::~NotificationQueueTest()
-{
-}
-
-
-void NotificationQueueTest::testQueueDequeue()
-{
- NotificationQueue queue;
- assert (queue.empty());
- assert (queue.size() == 0);
- Notification* pNf = queue.dequeueNotification();
- assertNullPtr(pNf);
- queue.enqueueNotification(new Notification);
- assert (!queue.empty());
- assert (queue.size() == 1);
- pNf = queue.dequeueNotification();
- assertNotNullPtr(pNf);
- assert (queue.empty());
- assert (queue.size() == 0);
- pNf->release();
-
- queue.enqueueNotification(new QTestNotification("first"));
- queue.enqueueNotification(new QTestNotification("second"));
- assert (!queue.empty());
- assert (queue.size() == 2);
- QTestNotification* pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "first");
- pTNf->release();
- assert (!queue.empty());
- assert (queue.size() == 1);
- pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "second");
- pTNf->release();
- assert (queue.empty());
- assert (queue.size() == 0);
-
- pNf = queue.dequeueNotification();
- assertNullPtr(pNf);
-}
-
-
-void NotificationQueueTest::testQueueDequeueUrgent()
-{
- NotificationQueue queue;
- queue.enqueueNotification(new QTestNotification("first"));
- queue.enqueueNotification(new QTestNotification("second"));
- queue.enqueueUrgentNotification(new QTestNotification("third"));
- assert (!queue.empty());
- assert (queue.size() == 3);
- QTestNotification* pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "third");
- pTNf->release();
- assert (!queue.empty());
- assert (queue.size() == 2);
- pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- assert (pTNf->data() == "first");
- pTNf->release();
- assert (!queue.empty());
- assert (queue.size() == 1);
- pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "second");
- pTNf->release();
- assert (queue.empty());
- assert (queue.size() == 0);
-
- Notification* pNf = queue.dequeueNotification();
- assertNullPtr(pNf);
-}
-
-
-void NotificationQueueTest::testWaitDequeue()
-{
- NotificationQueue queue;
- queue.enqueueNotification(new QTestNotification("third"));
- queue.enqueueNotification(new QTestNotification("fourth"));
- assert (!queue.empty());
- assert (queue.size() == 2);
- QTestNotification* pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification(10));
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "third");
- pTNf->release();
- assert (!queue.empty());
- assert (queue.size() == 1);
- pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification(10));
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "fourth");
- pTNf->release();
- assert (queue.empty());
- assert (queue.size() == 0);
-
- Notification* pNf = queue.waitDequeueNotification(10);
- assertNullPtr(pNf);
-}
-
-
-void NotificationQueueTest::testThreads()
-{
- const int NOTIFICATION_COUNT = 5000;
-
- Thread t1("thread1");
- Thread t2("thread2");
- Thread t3("thread3");
-
- RunnableAdapter<NotificationQueueTest> ra(*this, &NotificationQueueTest::work);
- t1.start(ra);
- t2.start(ra);
- t3.start(ra);
- for (int i = 0; i < NOTIFICATION_COUNT; ++i)
- {
- _queue.enqueueNotification(new Notification);
- }
- while (!_queue.empty()) Thread::sleep(50);
- Thread::sleep(20);
- _queue.wakeUpAll();
- t1.join();
- t2.join();
- t3.join();
- assert (_handled.size() == NOTIFICATION_COUNT);
- assert (_handled.count("thread1") > 0);
- assert (_handled.count("thread2") > 0);
- assert (_handled.count("thread3") > 0);
-}
-
-
-void NotificationQueueTest::testDefaultQueue()
-{
- NotificationQueue& queue = NotificationQueue::defaultQueue();
- assert (queue.empty());
- assert (queue.size() == 0);
-}
-
-
-void NotificationQueueTest::setUp()
-{
- _handled.clear();
-}
-
-
-void NotificationQueueTest::tearDown()
-{
-}
-
-
-void NotificationQueueTest::work()
-{
- Poco::Random rnd;
- Thread::sleep(50);
- Notification* pNf = _queue.waitDequeueNotification();
- while (pNf)
- {
- pNf->release();
- _mutex.lock();
- _handled.insert(Thread::current()->name());
- _mutex.unlock();
- Thread::sleep(rnd.next(5));
- pNf = _queue.waitDequeueNotification();
- }
-}
-
-
-CppUnit::Test* NotificationQueueTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NotificationQueueTest");
-
- CppUnit_addTest(pSuite, NotificationQueueTest, testQueueDequeue);
- CppUnit_addTest(pSuite, NotificationQueueTest, testQueueDequeueUrgent);
- CppUnit_addTest(pSuite, NotificationQueueTest, testWaitDequeue);
- CppUnit_addTest(pSuite, NotificationQueueTest, testThreads);
- CppUnit_addTest(pSuite, NotificationQueueTest, testDefaultQueue);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/NotificationQueueTest.h b/Utilities/Poco/Foundation/testsuite/src/NotificationQueueTest.h
deleted file mode 100755
index c9823bb0ff..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NotificationQueueTest.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// NotificationQueueTest.h
-//
-// $Id$
-//
-// Definition of the NotificationQueueTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NotificationQueueTest_INCLUDED
-#define NotificationQueueTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/NotificationQueue.h"
-#include "Poco/Mutex.h"
-#include <set>
-
-
-class NotificationQueueTest: public CppUnit::TestCase
-{
-public:
- NotificationQueueTest(const std::string& name);
- ~NotificationQueueTest();
-
- void testQueueDequeue();
- void testQueueDequeueUrgent();
- void testWaitDequeue();
- void testThreads();
- void testDefaultQueue();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-protected:
- void work();
-
-private:
- Poco::NotificationQueue _queue;
- std::multiset<std::string> _handled;
- Poco::FastMutex _mutex;
-};
-
-
-#endif // NotificationQueueTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/NotificationsTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/NotificationsTestSuite.cpp
deleted file mode 100755
index 0903001f49..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NotificationsTestSuite.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// NotificationsTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NotificationsTestSuite.h"
-#include "NotificationCenterTest.h"
-#include "NotificationQueueTest.h"
-#include "PriorityNotificationQueueTest.h"
-#include "TimedNotificationQueueTest.h"
-
-
-CppUnit::Test* NotificationsTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NotificationsTestSuite");
-
- pSuite->addTest(NotificationCenterTest::suite());
- pSuite->addTest(NotificationQueueTest::suite());
- pSuite->addTest(PriorityNotificationQueueTest::suite());
- pSuite->addTest(TimedNotificationQueueTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/NotificationsTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/NotificationsTestSuite.h
deleted file mode 100755
index 5f30d4e761..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NotificationsTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// NotificationsTestSuite.h
-//
-// $Id$
-//
-// Definition of the NotificationsTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NotificationsTestSuite_INCLUDED
-#define NotificationsTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class NotificationsTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // NotificationsTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/NullStreamTest.cpp b/Utilities/Poco/Foundation/testsuite/src/NullStreamTest.cpp
deleted file mode 100755
index fc4820ba5f..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NullStreamTest.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// NullStreamTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NullStreamTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/NullStream.h"
-
-
-using Poco::NullInputStream;
-using Poco::NullOutputStream;
-
-
-NullStreamTest::NullStreamTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NullStreamTest::~NullStreamTest()
-{
-}
-
-
-void NullStreamTest::testInput()
-{
- NullInputStream istr;
- assert (istr.good());
- assert (!istr.eof());
- int c = istr.get();
- assert (c == -1);
- assert (istr.eof());
-}
-
-
-void NullStreamTest::testOutput()
-{
- NullOutputStream ostr;
- assert (ostr.good());
- ostr << "Hello, world!";
- assert (ostr.good());
-}
-
-
-void NullStreamTest::setUp()
-{
-}
-
-
-void NullStreamTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NullStreamTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NullStreamTest");
-
- CppUnit_addTest(pSuite, NullStreamTest, testInput);
- CppUnit_addTest(pSuite, NullStreamTest, testOutput);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/NullStreamTest.h b/Utilities/Poco/Foundation/testsuite/src/NullStreamTest.h
deleted file mode 100755
index 8c213cf4d3..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NullStreamTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// NullStreamTest.h
-//
-// $Id$
-//
-// Definition of the NullStreamTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NullStreamTest_INCLUDED
-#define NullStreamTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class NullStreamTest: public CppUnit::TestCase
-{
-public:
- NullStreamTest(const std::string& name);
- ~NullStreamTest();
-
- void testInput();
- void testOutput();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NullStreamTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/NumberFormatterTest.cpp b/Utilities/Poco/Foundation/testsuite/src/NumberFormatterTest.cpp
deleted file mode 100755
index d469fae26a..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NumberFormatterTest.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// NumberFormatterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NumberFormatterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/NumberFormatter.h"
-
-
-using Poco::NumberFormatter;
-using Poco::Int64;
-using Poco::UInt64;
-
-
-NumberFormatterTest::NumberFormatterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NumberFormatterTest::~NumberFormatterTest()
-{
-}
-
-
-void NumberFormatterTest::testFormat()
-{
- assert (NumberFormatter::format(123) == "123");
- assert (NumberFormatter::format(-123) == "-123");
- assert (NumberFormatter::format(-123, 5) == " -123");
-
- assert (NumberFormatter::format((unsigned) 123) == "123");
- assert (NumberFormatter::format((unsigned) 123, 5) == " 123");
- assert (NumberFormatter::format0((unsigned) 123, 5) == "00123");
-
- assert (NumberFormatter::format((long) 123) == "123");
- assert (NumberFormatter::format((long) -123) == "-123");
- assert (NumberFormatter::format((long) -123, 5) == " -123");
-
- assert (NumberFormatter::format((unsigned long) 123) == "123");
- assert (NumberFormatter::format((unsigned long) 123, 5) == " 123");
-
-#if defined(POCO_HAVE_INT64)
- assert (NumberFormatter::format((Int64) 123) == "123");
- assert (NumberFormatter::format((Int64) -123) == "-123");
- assert (NumberFormatter::format((Int64) -123, 5) == " -123");
-
- assert (NumberFormatter::format((UInt64) 123) == "123");
- assert (NumberFormatter::format((UInt64) 123, 5) == " 123");
-#endif
-
- if (sizeof(void*) == 4)
- {
- assert (NumberFormatter::format((void*) 0x12345678) == "12345678");
- }
- else
- {
- assert (NumberFormatter::format((void*) 0x12345678) == "0000000012345678");
- }
-
- assert (NumberFormatter::format(12.25) == "12.25");
- assert (NumberFormatter::format(12.25, 4) == "12.2500");
- assert (NumberFormatter::format(12.25, 8, 4) == " 12.2500");
-}
-
-
-void NumberFormatterTest::testFormat0()
-{
- assert (NumberFormatter::format0(123, 5) == "00123");
- assert (NumberFormatter::format0(-123, 5) == "-0123");
- assert (NumberFormatter::format0((long) 123, 5) == "00123");
- assert (NumberFormatter::format0((long) -123, 5) == "-0123");
- assert (NumberFormatter::format0((unsigned long) 123, 5) == "00123");
-
-#if defined(POCO_HAVE_INT64)
- assert (NumberFormatter::format0((Int64) 123, 5) == "00123");
- assert (NumberFormatter::format0((Int64) -123, 5) == "-0123");
- assert (NumberFormatter::format0((UInt64) 123, 5) == "00123");
-#endif
-}
-
-
-void NumberFormatterTest::testFormatHex()
-{
- assert (NumberFormatter::formatHex(0x12) == "12");
- assert (NumberFormatter::formatHex(0xab) == "AB");
- assert (NumberFormatter::formatHex(0x12, 4) == "0012");
- assert (NumberFormatter::formatHex(0xab, 4) == "00AB");
-
- assert (NumberFormatter::formatHex((unsigned) 0x12) == "12");
- assert (NumberFormatter::formatHex((unsigned) 0xab) == "AB");
- assert (NumberFormatter::formatHex((unsigned) 0x12, 4) == "0012");
- assert (NumberFormatter::formatHex((unsigned) 0xab, 4) == "00AB");
-
- assert (NumberFormatter::formatHex((long) 0x12) == "12");
- assert (NumberFormatter::formatHex((long) 0xab) == "AB");
- assert (NumberFormatter::formatHex((long) 0x12, 4) == "0012");
- assert (NumberFormatter::formatHex((long) 0xab, 4) == "00AB");
-
- assert (NumberFormatter::formatHex((unsigned long) 0x12) == "12");
- assert (NumberFormatter::formatHex((unsigned long) 0xab) == "AB");
- assert (NumberFormatter::formatHex((unsigned long) 0x12, 4) == "0012");
- assert (NumberFormatter::formatHex((unsigned long) 0xab, 4) == "00AB");
-
-#if defined(POCO_HAVE_INT64)
- assert (NumberFormatter::formatHex((Int64) 0x12) == "12");
- assert (NumberFormatter::formatHex((Int64) 0xab) == "AB");
- assert (NumberFormatter::formatHex((Int64) 0x12, 4) == "0012");
- assert (NumberFormatter::formatHex((Int64) 0xab, 4) == "00AB");
-
- assert (NumberFormatter::formatHex((UInt64) 0x12) == "12");
- assert (NumberFormatter::formatHex((UInt64) 0xab) == "AB");
- assert (NumberFormatter::formatHex((UInt64) 0x12, 4) == "0012");
- assert (NumberFormatter::formatHex((UInt64) 0xab, 4) == "00AB");
-#endif
-}
-
-
-void NumberFormatterTest::testFormatFloat()
-{
- std::string s(NumberFormatter::format(1.0f));
- assert (s == "1");
- s = NumberFormatter::format(0.1f);
- assert (s == "0.1");
-
- s = NumberFormatter::format(1.0);
- assert (s == "1");
- s = NumberFormatter::format(0.1);
- assert (s == "0.1");
-}
-
-
-void NumberFormatterTest::setUp()
-{
-}
-
-
-void NumberFormatterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NumberFormatterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NumberFormatterTest");
-
- CppUnit_addTest(pSuite, NumberFormatterTest, testFormat);
- CppUnit_addTest(pSuite, NumberFormatterTest, testFormat0);
- CppUnit_addTest(pSuite, NumberFormatterTest, testFormatHex);
- CppUnit_addTest(pSuite, NumberFormatterTest, testFormatFloat);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/NumberFormatterTest.h b/Utilities/Poco/Foundation/testsuite/src/NumberFormatterTest.h
deleted file mode 100755
index 283c1cf394..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NumberFormatterTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// NumberFormatterTest.h
-//
-// $Id$
-//
-// Definition of the NumberFormatterTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NumberFormatterTest_INCLUDED
-#define NumberFormatterTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class NumberFormatterTest: public CppUnit::TestCase
-{
-public:
- NumberFormatterTest(const std::string& name);
- ~NumberFormatterTest();
-
- void testFormat();
- void testFormat0();
- void testFormatHex();
- void testFormatFloat();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NumberFormatterTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/NumberParserTest.cpp b/Utilities/Poco/Foundation/testsuite/src/NumberParserTest.cpp
deleted file mode 100755
index 84208960ce..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NumberParserTest.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-//
-// NumberParserTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NumberParserTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/NumberParser.h"
-#include "Poco/Exception.h"
-
-
-using Poco::NumberParser;
-using Poco::SyntaxException;
-
-
-NumberParserTest::NumberParserTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NumberParserTest::~NumberParserTest()
-{
-}
-
-
-void NumberParserTest::testParse()
-{
- assert (NumberParser::parse("123") == 123);
- assert (NumberParser::parse("-123") == -123);
- assert (NumberParser::parseUnsigned("123") == 123);
- assert (NumberParser::parseHex("12AB") == 0x12ab);
-
-#if defined(POCO_HAVE_INT64)
- assert (NumberParser::parse64("123") == 123);
- assert (NumberParser::parse64("-123") == -123);
- assert (NumberParser::parseUnsigned64("123") == 123);
- assert (NumberParser::parseHex64("12AB") == 0x12ab);
-#endif
-
- assertEqualDelta (12.34, NumberParser::parseFloat("12.34"), 0.01);
-}
-
-void NumberParserTest::testParseError()
-{
- try
- {
- NumberParser::parse("");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-
- try
- {
- NumberParser::parse("asd");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-
- try
- {
- NumberParser::parseUnsigned("a123");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-
- try
- {
- NumberParser::parseHex("z23");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-
- try
- {
- NumberParser::parseHex("23z");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-
-#if defined(POCO_HAVE_INT64)
-
- try
- {
- NumberParser::parse64("asd");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-
- try
- {
- NumberParser::parseUnsigned64("");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-
- try
- {
- NumberParser::parseHex64("zaz");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-
- try
- {
- NumberParser::parseHex64("12345z");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-
-#endif
-
- try
- {
- NumberParser::parseFloat("a12.3");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-
- try
- {
- NumberParser::parseFloat("12.3aa");
- failmsg("must throw SyntaxException");
- }
- catch (SyntaxException&)
- {
- }
-}
-
-
-void NumberParserTest::setUp()
-{
-}
-
-
-void NumberParserTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NumberParserTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NumberParserTest");
-
- CppUnit_addTest(pSuite, NumberParserTest, testParse);
- CppUnit_addTest(pSuite, NumberParserTest, testParseError);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/NumberParserTest.h b/Utilities/Poco/Foundation/testsuite/src/NumberParserTest.h
deleted file mode 100755
index a5087cb3f9..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/NumberParserTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// NumberParserTest.h
-//
-// $Id$
-//
-// Definition of the NumberParserTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NumberParserTest_INCLUDED
-#define NumberParserTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class NumberParserTest: public CppUnit::TestCase
-{
-public:
- NumberParserTest(const std::string& name);
- ~NumberParserTest();
-
- void testParse();
- void testParseError();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NumberParserTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/PathTest.cpp b/Utilities/Poco/Foundation/testsuite/src/PathTest.cpp
deleted file mode 100755
index ca5dfa2a3c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/PathTest.cpp
+++ /dev/null
@@ -1,1652 +0,0 @@
-//
-// PathTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "PathTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Path.h"
-#include "Poco/Exception.h"
-#include "Poco/Random.h"
-#include "Poco/Environment.h"
-#include <iostream>
-
-
-using Poco::Path;
-using Poco::PathSyntaxException;
-using Poco::Random;
-using Poco::Environment;
-
-
-PathTest::PathTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-PathTest::~PathTest()
-{
-}
-
-
-void PathTest::testParseUnix1()
-{
- Path p;
- p.parse("", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "");
-
- p.parse("/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/");
-
- p.parse("/usr", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr");
-
- p.parse("/usr/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/");
-
- p.parse("usr/", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "usr/");
-
- p.parse("usr", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 0);
- assert (p[0] == "usr");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "usr");
-
- p.parse("/usr/local", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local");
-}
-
-
-void PathTest::testParseUnix2()
-{
- Path p;
- p.parse("/usr/local/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/");
-
- p.parse("usr/local/", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "usr/local/");
-
- p.parse("usr/local", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "usr/local");
-
- p.parse("/usr/local/bin", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/bin");
-
- p.parse("/usr/local/bin/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/bin/");
-}
-
-
-void PathTest::testParseUnix3()
-{
- Path p;
- p.parse("//usr/local/bin/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/bin/");
-
- p.parse("/usr//local/bin/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/bin/");
-
- p.parse("/usr/local//bin/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/bin/");
-
- p.parse("/usr/local/bin//", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/bin/");
-
- p.parse("/usr/local/./bin/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/bin/");
-
- p.parse("./usr/local/bin/", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "usr/local/bin/");
-
- p.parse("./usr/local/bin/./", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "usr/local/bin/");
-
- p.parse("./usr/local/bin/.", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "usr/local/bin/.");
-}
-
-
-void PathTest::testParseUnix4()
-{
- Path p;
- p.parse("/usr/local/lib/../bin/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/bin/");
-
- p.parse("/usr/local/lib/../bin/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/bin/");
-
- p.parse("/usr/local/lib/../../", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/");
-
- p.parse("/usr/local/lib/..", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "lib");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/lib/..");
-
- p.parse("../usr/local/lib/", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 4);
- assert (p[0] == "..");
- assert (p[1] == "usr");
- assert (p[2] == "local");
- assert (p[3] == "lib");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "../usr/local/lib/");
-
- p.parse("/usr/../lib/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "lib");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/lib/");
-
- p.parse("/usr/../../lib/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "lib");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/lib/");
-
- p.parse("local/../../lib/", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "..");
- assert (p[1] == "lib");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "../lib/");
-
- p.parse("a/b/c/d", Path::PATH_UNIX);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "a");
- assert (p[1] == "b");
- assert (p[2] == "c");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "a/b/c/d");
-}
-
-
-void PathTest::testParseUnix5()
-{
- Path p;
- p.parse("/c:/windows/system32/", Path::PATH_UNIX);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.getDevice() == "c");
- assert (p.depth() == 2);
- assert (p[0] == "windows");
- assert (p[1] == "system32");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/c:/windows/system32/");
-}
-
-
-void PathTest::testParseWindows1()
-{
- Path p;
- p.parse("", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "");
-
- p.parse("/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\");
-
- p.parse("\\", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\");
-
- p.parse("/usr", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr");
-
- p.parse("\\usr", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr");
-
- p.parse("/usr/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\");
-
- p.parse("\\usr\\", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\");
-}
-
-
-void PathTest::testParseWindows2()
-{
- Path p;
- p.parse("usr/", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "usr\\");
-
- p.parse("usr", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 0);
- assert (p[0] == "usr");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "usr");
-
- p.parse("usr\\", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "usr\\");
-
- p.parse("/usr/local", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local");
-
- p.parse("\\usr\\local", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local");
-
- p.parse("/usr/local/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\");
-
- p.parse("usr/local/", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "usr\\local\\");
-
- p.parse("usr/local", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "usr\\local");
-
- p.parse("/usr/local/bin", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\bin");
-
- p.parse("/usr/local/bin/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\bin\\");
-
- p.parse("/usr//local/bin/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\bin\\");
-
- p.parse("/usr/local//bin/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\bin\\");
-
- p.parse("/usr/local/bin//", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\bin\\");
-}
-
-
-void PathTest::testParseWindows3()
-{
- Path p;
- p.parse("/usr/local/./bin/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\bin\\");
-
- p.parse("./usr/local/bin/", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "usr\\local\\bin\\");
-
- p.parse("./usr/local/bin/./", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "usr\\local\\bin\\");
-
- p.parse("./usr/local/bin/.", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "usr\\local\\bin\\.");
-
- p.parse("/usr/local/lib/../bin/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\bin\\");
-
- p.parse("/usr/local/lib/../bin/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\bin\\");
-
- p.parse("\\usr\\local\\lib\\..\\bin\\", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\bin\\");
-
- p.parse("/usr/local/lib/../../", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "usr");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\");
-
- p.parse("/usr/local/lib/..", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "lib");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\lib\\..");
-
- p.parse("../usr/local/lib/", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 4);
- assert (p[0] == "..");
- assert (p[1] == "usr");
- assert (p[2] == "local");
- assert (p[3] == "lib");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "..\\usr\\local\\lib\\");
-
- p.parse("/usr/../lib/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "lib");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\lib\\");
-
- p.parse("/usr/../../lib/", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "lib");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\lib\\");
-
- p.parse("local/../../lib/", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "..");
- assert (p[1] == "lib");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "..\\lib\\");
-}
-
-
-void PathTest::testParseWindows4()
-{
- Path p;
- p.parse("\\\\server\\files", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "files");
- assert (p.getNode() == "server");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\\\server\\files\\");
-
- p.parse("\\\\server\\files\\", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "files");
- assert (p.getNode() == "server");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\\\server\\files\\");
-
- p.parse("\\\\server\\files\\file", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "files");
- assert (p.getNode() == "server");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\\\server\\files\\file");
-
- p.parse("\\\\server\\files\\dir\\file", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "files");
- assert (p[1] == "dir");
- assert (p.getNode() == "server");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\\\server\\files\\dir\\file");
-
- p.parse("\\\\server\\files\\dir\\file", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "files");
- assert (p[1] == "dir");
- assert (p.getNode() == "server");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\\\server\\files\\dir\\file");
-
- p.parse("\\\\server", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.getNode() == "server");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\\\server\\");
-
- p.parse("c:\\", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.getDevice() == "c");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "c:\\");
-
- p.parse("c:\\WinNT", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.getDevice() == "c");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "c:\\WinNT");
-
- p.parse("c:\\WinNT\\", Path::PATH_WINDOWS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "WinNT");
- assert (p.getDevice() == "c");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "c:\\WinNT\\");
-
- try
- {
- p.parse("~:\\", Path::PATH_WINDOWS);
- fail("bad path - must throw exception");
- }
- catch (PathSyntaxException&)
- {
- }
-
- try
- {
- p.parse("c:file.txt", Path::PATH_WINDOWS);
- fail("bad path - must throw exception");
- }
- catch (PathSyntaxException&)
- {
- }
-
- p.parse("a\\b\\c\\d", Path::PATH_WINDOWS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "a");
- assert (p[1] == "b");
- assert (p[2] == "c");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "a\\b\\c\\d");
-}
-
-
-void PathTest::testParseVMS1()
-{
- Path p;
- p.parse("", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "");
-
- p.parse("[]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "");
-
- p.parse("[foo]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]");
-
- p.parse("[.foo]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[.foo]");
-
- p.parse("[foo.bar]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "foo");
- assert (p[1] == "bar");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo.bar]");
-
- p.parse("[.foo.bar]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "foo");
- assert (p[1] == "bar");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[.foo.bar]");
-
- p.parse("[foo.bar.foobar]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "foo");
- assert (p[1] == "bar");
- assert (p[2] == "foobar");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo.bar.foobar]");
-
- p.parse("[.foo.bar.foobar]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "foo");
- assert (p[1] == "bar");
- assert (p[2] == "foobar");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[.foo.bar.foobar]");
-}
-
-
-void PathTest::testParseVMS2()
-{
- Path p;
- p.parse("[foo][bar]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "foo");
- assert (p[1] == "bar");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo.bar]");
-
- p.parse("[foo.][bar]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "foo");
- assert (p[1] == "bar");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo.bar]");
-
- p.parse("[foo.bar][foo]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "foo");
- assert (p[1] == "bar");
- assert (p[2] == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo.bar.foo]");
-
- try
- {
- p.parse("[foo.bar][.foo]", Path::PATH_VMS);
- failmsg("bad path - must throw exception");
- }
- catch (PathSyntaxException&)
- {
- }
-
- try
- {
- p.parse("[.foo.bar][foo]", Path::PATH_VMS);
- failmsg("bad path - must throw exception");
- }
- catch (PathSyntaxException&)
- {
- }
-
- p.parse("[-]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "..");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[-]");
-
- p.parse("[--]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "..");
- assert (p[1] == "..");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[--]");
-
- p.parse("[---]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "..");
- assert (p[1] == "..");
- assert (p[2] == "..");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[---]");
-
- p.parse("[-.-]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "..");
- assert (p[1] == "..");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[--]");
-
- p.parse("[.-.-]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "..");
- assert (p[1] == "..");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[--]");
-
- p.parse("[-.-.-]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "..");
- assert (p[1] == "..");
- assert (p[2] == "..");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[---]");
-
- p.parse("[.-.-.-]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "..");
- assert (p[1] == "..");
- assert (p[2] == "..");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[---]");
-
- p.parse("[.--.-]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "..");
- assert (p[1] == "..");
- assert (p[2] == "..");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[---]");
-
- p.parse("[--.-]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "..");
- assert (p[1] == "..");
- assert (p[2] == "..");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[---]");
-}
-
-
-void PathTest::testParseVMS3()
-{
- Path p;
- p.parse("[foo][-]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]");
-
- p.parse("[foo][--]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]");
-
- p.parse("[foo][-.-]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]");
-
- p.parse("[foo][bar.-]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]");
-
- p.parse("[foo][bar.foo.-]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "foo");
- assert (p[1] == "bar");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo.bar]");
-
- p.parse("[foo][bar.foo.--]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]");
-
- p.parse("[foo][bar.foo.---]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]");
-
- p.parse("[foo][bar.foo.-.-.-]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]");
-}
-
-
-void PathTest::testParseVMS4()
-{
- Path p;
- p.parse("device:[foo]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.getDevice() == "device");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "device:[foo]");
-
- p.parse("device:[.foo]", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.getDevice() == "device");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "device:[.foo]");
-
- p.parse("node::device:[foo]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (p.getNode() == "node");
- assert (p.getDevice() == "device");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "node::device:[foo]");
-
- p.parse("node::device:[foo.bar]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "foo");
- assert (p[1] == "bar");
- assert (p.getNode() == "node");
- assert (p.getDevice() == "device");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "node::device:[foo.bar]");
-
- p.parse("node::device:[foo.bar.][goo]", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 3);
- assert (p[0] == "foo");
- assert (p[1] == "bar");
- assert (p[2] == "goo");
- assert (p.getNode() == "node");
- assert (p.getDevice() == "device");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "node::device:[foo.bar.goo]");
-
- p.parse("[]foo.txt", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 0);
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "foo.txt");
-
- p.parse("[foo]bar.txt", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]bar.txt");
-
- p.parse("[foo]bar.txt;", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]bar.txt");
-
- p.parse("[foo]bar.txt;5", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]bar.txt;5");
- assert (p.version() == "5");
-
- p.parse("foo:bar.txt", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.getDevice() == "foo");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "foo:bar.txt");
-
- p.parse("foo:bar.txt;5", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.getDevice() == "foo");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "foo:bar.txt;5");
- assert (p.version() == "5");
-
- p.parse("foo:", Path::PATH_VMS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.getDevice() == "foo");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_VMS) == "foo:");
-
- p.parse("bar.txt", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 0);
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "bar.txt");
-
- p.parse("bar.txt;5", Path::PATH_VMS);
- assert (p.isRelative());
- assert (!p.isAbsolute());
- assert (p.depth() == 0);
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "bar.txt;5");
- assert (p.version() == "5");
-}
-
-
-void PathTest::testParseGuess()
-{
- Path p;
-
- p.parse("foo:bar.txt;5", Path::PATH_GUESS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.getDevice() == "foo");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "foo:bar.txt;5");
- assert (p.version() == "5");
-
- p.parse("/usr/local/bin", Path::PATH_GUESS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 2);
- assert (p[0] == "usr");
- assert (p[1] == "local");
- assert (p[2] == "bin");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/bin");
-
- p.parse("\\\\server\\files", Path::PATH_GUESS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "files");
- assert (p.getNode() == "server");
- assert (p.isDirectory());
- assert (!p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "\\\\server\\files\\");
-
- p.parse("c:\\WinNT", Path::PATH_GUESS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.getDevice() == "c");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_WINDOWS) == "c:\\WinNT");
-
- p.parse("foo:bar.txt;5", Path::PATH_GUESS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 0);
- assert (p.getDevice() == "foo");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "foo:bar.txt;5");
- assert (p.version() == "5");
-
- p.parse("[foo]bar.txt", Path::PATH_GUESS);
- assert (!p.isRelative());
- assert (p.isAbsolute());
- assert (p.depth() == 1);
- assert (p[0] == "foo");
- assert (!p.isDirectory());
- assert (p.isFile());
- assert (p.toString(Path::PATH_VMS) == "[foo]bar.txt");
-}
-
-
-void PathTest::testTryParse()
-{
- Path p;
-#if defined(POCO_OS_FAMILY_UNIX)
- assert (p.tryParse("/etc/passwd"));
- assert (p.toString() == "/etc/passwd");
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- assert (p.tryParse("c:\\windows\\system32"));
- assert (p.toString() == "c:\\windows\\system32");
- assert (!p.tryParse("c:foo.bar"));
- assert (p.toString() == "c:\\windows\\system32");
-#endif
-
- assert (p.tryParse("c:\\windows\\system", Path::PATH_WINDOWS));
- assert (p.toString(Path::PATH_WINDOWS) == "c:\\windows\\system");
- assert (!p.tryParse("c:foo.bar", Path::PATH_WINDOWS));
- assert (p.toString(Path::PATH_WINDOWS) == "c:\\windows\\system");
-}
-
-
-void PathTest::testStatics()
-{
- std::string s = Path::current();
- assert (!s.empty());
- Path p(s);
- assert (p.isDirectory() && p.isAbsolute());
-
- s = Path::home();
- assert (!s.empty());
- p = s;
- assert (p.isDirectory() && p.isAbsolute());
-
- s = Path::temp();
- assert (!s.empty());
- p = s;
- assert (p.isDirectory() && p.isAbsolute());
-
- s = Path::null();
- assert (!s.empty());
- p = s;
-}
-
-
-void PathTest::testBaseNameExt()
-{
- Path p("foo.bar");
- assert (p.getFileName() == "foo.bar");
- assert (p.getBaseName() == "foo");
- assert (p.getExtension() == "bar");
-
- p.setBaseName("readme");
- assert (p.getFileName() == "readme.bar");
- assert (p.getBaseName() == "readme");
- assert (p.getExtension() == "bar");
-
- p.setExtension("txt");
- assert (p.getFileName() == "readme.txt");
- assert (p.getBaseName() == "readme");
- assert (p.getExtension() == "txt");
-
- p.setExtension("html");
- assert (p.getFileName() == "readme.html");
- assert (p.getBaseName() == "readme");
- assert (p.getExtension() == "html");
-
- p.setBaseName("index");
- assert (p.getFileName() == "index.html");
- assert (p.getBaseName() == "index");
- assert (p.getExtension() == "html");
-}
-
-
-void PathTest::testAbsolute()
-{
- Path base("C:\\Program Files\\", Path::PATH_WINDOWS);
- Path rel("Poco");
- Path abs = rel.absolute(base);
- assert (abs.toString(Path::PATH_WINDOWS) == "C:\\Program Files\\Poco");
-
- base.parse("/usr/local", Path::PATH_UNIX);
- rel.parse("Poco/include", Path::PATH_UNIX);
- abs = rel.absolute(base);
- assert (abs.toString(Path::PATH_UNIX) == "/usr/local/Poco/include");
-
- base.parse("/usr/local/bin", Path::PATH_UNIX);
- rel.parse("../Poco/include", Path::PATH_UNIX);
- abs = rel.absolute(base);
- assert (abs.toString(Path::PATH_UNIX) == "/usr/local/Poco/include");
-}
-
-
-void PathTest::testRobustness()
-{
- Random r;
- for (int i = 0; i < 256; ++i)
- {
- int len = r.next(1024);
- std::string s;
- for (int i = 0; i < len; ++i) s += r.nextChar();
- try
- {
- Path p(s, Path::PATH_WINDOWS);
- }
- catch (PathSyntaxException&)
- {
- }
- try
- {
- Path p(s, Path::PATH_UNIX);
- }
- catch (PathSyntaxException&)
- {
- }
- try
- {
- Path p(s, Path::PATH_VMS);
- }
- catch (PathSyntaxException&)
- {
- }
- try
- {
- Path p(s, Path::PATH_GUESS);
- }
- catch (PathSyntaxException&)
- {
- }
- }
-}
-
-
-void PathTest::testParent()
-{
- Path p("/usr/local/include", Path::PATH_UNIX);
- p.makeParent();
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/");
- p.makeParent();
- assert (p.toString(Path::PATH_UNIX) == "/usr/");
- p.makeParent();
- assert (p.toString(Path::PATH_UNIX) == "/");
- p.makeParent();
- assert (p.toString(Path::PATH_UNIX) == "/");
-}
-
-
-void PathTest::testForDirectory()
-{
- Path p = Path::forDirectory("/usr/local/include", Path::PATH_UNIX);
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/include/");
-
- p = Path::forDirectory("/usr/local/include/", Path::PATH_UNIX);
- assert (p.toString(Path::PATH_UNIX) == "/usr/local/include/");
-}
-
-
-void PathTest::testExpand()
-{
-#if defined(POCO_OS_FAMILY_UNIX)
- std::string s = Path::expand("~/.bashrc");
- assert (s == Path::expand("$HOME/.bashrc"));
- assert (s == Environment::get("HOME") + "/.bashrc" ||
- s == Environment::get("HOME") + "//.bashrc");
- Path p(s);
- s = Path::expand("$HOME/.bashrc");
- assert (s == Path::expand("~/.bashrc"));
- s = Path::expand("${HOME}/.bashrc");
- assert (s == Path::expand("~/.bashrc"));
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- std::string s = Path::expand("%TMP%\\foo");
- assert (s == Environment::get("TMP") + "\\foo");
- Path p(s);
-#else
- std::string s = Path::expand("SYS$LOGIN:[projects]");
- assert (s.find(":[projects]") != std::string::npos);
- Path p(s);
-#endif
-}
-
-
-void PathTest::testListRoots()
-{
- std::vector<std::string> devs;
- Path::listRoots(devs);
- assert (devs.size() > 0);
- for (std::vector<std::string>::iterator it = devs.begin(); it != devs.end(); ++it)
- {
- std::cout << *it << std::endl;
- }
-}
-
-
-void PathTest::testFind()
-{
- Path p;
-#if defined(POCO_OS_FAMILY_UNIX)
- bool found = Path::find(Environment::get("PATH"), "ls", p);
- bool notfound = Path::find(Environment::get("PATH"), "xxxyyy123", p);
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- bool found = Path::find(Environment::get("PATH"), "cmd.exe", p);
- bool notfound = Path::find(Environment::get("PATH"), "xxxyyy123.zzz", p);
-#else
- bool found = true;
- bool notfound = false;
-#endif
- assert (found);
- assert (!notfound);
-
- std::string fn = p.toString();
- assert (fn.size() > 0);
-}
-
-
-void PathTest::testSwap()
-{
- Path p1("c:\\temp\\foo.bar");
- Path p2("\\\\server\\files\\foo.bar");
- p1.swap(p2);
- assert (p1.toString() == "\\\\server\\files\\foo.bar");
- assert (p2.toString() == "c:\\temp\\foo.bar");
-}
-
-
-void PathTest::testResolve()
-{
- Path p("c:\\foo\\", Path::PATH_WINDOWS);
- p.resolve("test.dat");
- assert (p.toString(Path::PATH_WINDOWS) == "c:\\foo\\test.dat");
-
- p.assign("c:\\foo\\", Path::PATH_WINDOWS);
- p.resolve(Path("d:\\bar.txt", Path::PATH_WINDOWS));
- assert (p.toString(Path::PATH_WINDOWS) == "d:\\bar.txt");
-
- p.assign("c:\\foo\\bar.txt", Path::PATH_WINDOWS);
- p.resolve("foo.txt");
- assert (p.toString(Path::PATH_WINDOWS) == "c:\\foo\\foo.txt");
-
- p.assign("c:\\foo\\bar\\", Path::PATH_WINDOWS);
- p.resolve(Path("..\\baz\\test.dat", Path::PATH_WINDOWS));
- assert (p.toString(Path::PATH_WINDOWS) == "c:\\foo\\baz\\test.dat");
-}
-
-
-void PathTest::setUp()
-{
-}
-
-
-void PathTest::tearDown()
-{
-}
-
-
-CppUnit::Test* PathTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("PathTest");
-
- CppUnit_addTest(pSuite, PathTest, testParseUnix1);
- CppUnit_addTest(pSuite, PathTest, testParseUnix2);
- CppUnit_addTest(pSuite, PathTest, testParseUnix3);
- CppUnit_addTest(pSuite, PathTest, testParseUnix4);
- CppUnit_addTest(pSuite, PathTest, testParseUnix5);
- CppUnit_addTest(pSuite, PathTest, testParseWindows1);
- CppUnit_addTest(pSuite, PathTest, testParseWindows2);
- CppUnit_addTest(pSuite, PathTest, testParseWindows3);
- CppUnit_addTest(pSuite, PathTest, testParseWindows4);
- CppUnit_addTest(pSuite, PathTest, testParseVMS1);
- CppUnit_addTest(pSuite, PathTest, testParseVMS2);
- CppUnit_addTest(pSuite, PathTest, testParseVMS3);
- CppUnit_addTest(pSuite, PathTest, testParseVMS4);
- CppUnit_addTest(pSuite, PathTest, testParseGuess);
- CppUnit_addTest(pSuite, PathTest, testTryParse);
- CppUnit_addTest(pSuite, PathTest, testStatics);
- CppUnit_addTest(pSuite, PathTest, testBaseNameExt);
- CppUnit_addTest(pSuite, PathTest, testAbsolute);
- CppUnit_addTest(pSuite, PathTest, testRobustness);
- CppUnit_addTest(pSuite, PathTest, testParent);
- CppUnit_addTest(pSuite, PathTest, testForDirectory);
- CppUnit_addTest(pSuite, PathTest, testExpand);
- CppUnit_addTest(pSuite, PathTest, testListRoots);
- CppUnit_addTest(pSuite, PathTest, testFind);
- CppUnit_addTest(pSuite, PathTest, testSwap);
- CppUnit_addTest(pSuite, PathTest, testResolve);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/PathTest.h b/Utilities/Poco/Foundation/testsuite/src/PathTest.h
deleted file mode 100755
index 3dc13c4e24..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/PathTest.h
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// PathTest.h
-//
-// $Id$
-//
-// Definition of the PathTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef PathTest_INCLUDED
-#define PathTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class PathTest: public CppUnit::TestCase
-{
-public:
- PathTest(const std::string& name);
- ~PathTest();
-
- void testParseUnix1();
- void testParseUnix2();
- void testParseUnix3();
- void testParseUnix4();
- void testParseUnix5();
- void testParseWindows1();
- void testParseWindows2();
- void testParseWindows3();
- void testParseWindows4();
- void testParseVMS1();
- void testParseVMS2();
- void testParseVMS3();
- void testParseVMS4();
- void testParseGuess();
- void testTryParse();
- void testStatics();
- void testBaseNameExt();
- void testAbsolute();
- void testRobustness();
- void testParent();
- void testForDirectory();
- void testExpand();
- void testListRoots();
- void testFind();
- void testSwap();
- void testResolve();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // PathTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/PatternFormatterTest.cpp b/Utilities/Poco/Foundation/testsuite/src/PatternFormatterTest.cpp
deleted file mode 100755
index cfb96166ed..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/PatternFormatterTest.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// PatternFormatterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "PatternFormatterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/PatternFormatter.h"
-#include "Poco/Message.h"
-#include "Poco/DateTime.h"
-
-
-using Poco::PatternFormatter;
-using Poco::Message;
-using Poco::DateTime;
-
-
-PatternFormatterTest::PatternFormatterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-PatternFormatterTest::~PatternFormatterTest()
-{
-}
-
-
-void PatternFormatterTest::testPatternFormatter()
-{
- Message msg;
- PatternFormatter fmt;
- msg.setSource("TestSource");
- msg.setText("Test message text");
- msg.setPid(1234);
- msg.setTid(1);
- msg.setThread("TestThread");
- msg.setPriority(Message::PRIO_ERROR);
- msg.setTime(DateTime(2005, 1, 1, 14, 30, 15, 500).timestamp());
- msg["testParam"] = "Test Parameter";
-
- std::string result;
- fmt.setProperty("pattern", "%Y-%m-%dT%H:%M:%S [%s] %p: %t");
- fmt.format(msg, result);
- assert (result == "2005-01-01T14:30:15 [TestSource] Error: Test message text");
-
- result.clear();
- fmt.setProperty("pattern", "%w, %e %b %y %H:%M:%S.%i [%s:%I:%T] %q: %t");
- fmt.format(msg, result);
- assert (result == "Sat, 1 Jan 05 14:30:15.500 [TestSource:1:TestThread] E: Test message text");
-
- result.clear();
- fmt.setProperty("pattern", "%Y-%m-%d %H:%M:%S [%N:%P:%s]%l-%t");
- fmt.format(msg, result);
- assert (result.find("2005-01-01 14:30:15 [") == 0);
- assert (result.find(":TestSource]3-Test message text") != std::string::npos);
-
- result.clear();
- assert (fmt.getProperty("times") == "UTC");
- fmt.setProperty("times", "local");
- fmt.format(msg, result);
- assert (result.find("2005-01-01 ") == 0);
- assert (result.find(":TestSource]3-Test message text") != std::string::npos);
-
- result.clear();
- fmt.setProperty("pattern", "%[testParam]");
- fmt.format(msg, result);
- assert (result == "Test Parameter");
-
- result.clear();
- fmt.setProperty("pattern", "%[testParam] %p");
- fmt.format(msg, result);
- assert (result == "Test Parameter Error");
-}
-
-
-void PatternFormatterTest::setUp()
-{
-}
-
-
-void PatternFormatterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* PatternFormatterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("PatternFormatterTest");
-
- CppUnit_addTest(pSuite, PatternFormatterTest, testPatternFormatter);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/PatternFormatterTest.h b/Utilities/Poco/Foundation/testsuite/src/PatternFormatterTest.h
deleted file mode 100755
index 943a85c968..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/PatternFormatterTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// PatternFormatterTest.h
-//
-// $Id$
-//
-// Definition of the PatternFormatterTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef PatternFormatterTest_INCLUDED
-#define PatternFormatterTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class PatternFormatterTest: public CppUnit::TestCase
-{
-public:
- PatternFormatterTest(const std::string& name);
- ~PatternFormatterTest();
-
- void testPatternFormatter();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // PatternFormatterTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/PriorityEventTest.cpp b/Utilities/Poco/Foundation/testsuite/src/PriorityEventTest.cpp
deleted file mode 100755
index 0f898ade89..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/PriorityEventTest.cpp
+++ /dev/null
@@ -1,519 +0,0 @@
-//
-// PriorityEventTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "PriorityEventTest.h"
-#include "DummyDelegate.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/PriorityDelegate.h"
-#include "Poco/PriorityExpire.h"
-#include "Poco/Thread.h"
-#include "Poco/Exception.h"
-
-
-using namespace Poco;
-
-
-#define LARGEINC 100
-
-
-PriorityEventTest::PriorityEventTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-PriorityEventTest::~PriorityEventTest()
-{
-}
-
-void PriorityEventTest::testNoDelegate()
-{
- int tmp = 0;
- EventArgs args;
-
- assert (_count == 0);
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- Simple += priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple -= priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- Simple += priorityDelegate(this, &PriorityEventTest::onSimpleNoSender, 0);
- Simple -= priorityDelegate(this, &PriorityEventTest::onSimpleNoSender, 0);
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- ConstSimple += priorityDelegate(this, &PriorityEventTest::onConstSimple, 0);
- ConstSimple -= priorityDelegate(this, &PriorityEventTest::onConstSimple, 0);
- ConstSimple.notify(this, tmp);
- assert (_count == 0);
-
- //Note: passing &args will not work due to &
- EventArgs* pArgs = &args;
- Complex += priorityDelegate(this, &PriorityEventTest::onComplex, 0);
- Complex -= priorityDelegate(this, &PriorityEventTest::onComplex, 0);
- Complex.notify(this, pArgs);
- assert (_count == 0);
-
- Complex2 += priorityDelegate(this, &PriorityEventTest::onComplex2, 0);
- Complex2 -= priorityDelegate(this, &PriorityEventTest::onComplex2, 0);
- Complex2.notify(this, args);
- assert (_count == 0);
-
- const EventArgs* pCArgs = &args;
- ConstComplex += priorityDelegate(this, &PriorityEventTest::onConstComplex, 0);
- ConstComplex -= priorityDelegate(this, &PriorityEventTest::onConstComplex, 0);
- ConstComplex.notify(this, pCArgs);
- assert (_count == 0);
-
- Const2Complex += priorityDelegate(this, &PriorityEventTest::onConst2Complex, 0);
- Const2Complex -= priorityDelegate(this, &PriorityEventTest::onConst2Complex, 0);
- Const2Complex.notify(this, pArgs);
- assert (_count == 0);
-
- Simple += priorityDelegate(&PriorityEventTest::onStaticSimple, 0);
- Simple += priorityDelegate(&PriorityEventTest::onStaticSimple, 0);
- Simple += priorityDelegate(&PriorityEventTest::onStaticSimple, 1);
- Simple += priorityDelegate(&PriorityEventTest::onStaticSimple2, 2);
- Simple += priorityDelegate(&PriorityEventTest::onStaticSimple3, 3);
-
- Simple.notify(this, tmp);
- assert (_count == 3);
- Simple -= priorityDelegate(PriorityEventTest::onStaticSimple, 0);
-}
-
-void PriorityEventTest::testSingleDelegate()
-{
- int tmp = 0;
- EventArgs args;
-
- assert (_count == 0);
-
- Simple += priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- // unregistering with a different priority --> different observer, is ignored
- Simple -= priorityDelegate(this, &PriorityEventTest::onSimple, 3);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- ConstSimple += priorityDelegate(this, &PriorityEventTest::onConstSimple, 0);
- ConstSimple -= priorityDelegate(this, &PriorityEventTest::onConstSimple, 3);
- ConstSimple.notify(this, tmp);
- assert (_count == 2);
-
- EventArgs* pArgs = &args;
- Complex += priorityDelegate(this, &PriorityEventTest::onComplex, 0);
- Complex -= priorityDelegate(this, &PriorityEventTest::onComplex, 3);
- Complex.notify(this, pArgs);
- assert (_count == 3);
-
- Complex2 += priorityDelegate(this, &PriorityEventTest::onComplex2, 0);
- Complex2 -= priorityDelegate(this, &PriorityEventTest::onComplex2, 3);
- Complex2.notify(this, args);
- assert (_count == 4);
-
- const EventArgs* pCArgs = &args;
- ConstComplex += priorityDelegate(this, &PriorityEventTest::onConstComplex, 0);
- ConstComplex -= priorityDelegate(this, &PriorityEventTest::onConstComplex, 3);
- ConstComplex.notify(this, pCArgs);
- assert (_count == 5);
-
- Const2Complex += priorityDelegate(this, &PriorityEventTest::onConst2Complex, 0);
- Const2Complex -= priorityDelegate(this, &PriorityEventTest::onConst2Complex, 3);
- Const2Complex.notify(this, pArgs);
- assert (_count == 6);
- // check if 2nd notify also works
- Const2Complex.notify(this, pArgs);
- assert (_count == 7);
-
-}
-
-void PriorityEventTest::testDuplicateRegister()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple += priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple.notify(this, tmp);
- assert (_count == 1);
- Simple -= priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- Simple += priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple += priorityDelegate(this, &PriorityEventTest::onSimpleOther, 1);
- Simple.notify(this, tmp);
- assert (_count == 2 + LARGEINC);
- Simple -= priorityDelegate(this, &PriorityEventTest::onSimpleOther, 1);
- Simple.notify(this, tmp);
- assert (_count == 3 + LARGEINC);
-}
-
-void PriorityEventTest::testDuplicateUnregister()
-{
- // duplicate unregister shouldn't give an error,
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple -= priorityDelegate(this, &PriorityEventTest::onSimple, 0); // should work
- Simple.notify(this, tmp);
- assert (_count == 0);
-
- Simple += priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- Simple -= priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- Simple -= priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple.notify(this, tmp);
- assert (_count == 1);
-}
-
-
-void PriorityEventTest::testDisabling()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple.disable();
- Simple.notify(this, tmp);
- assert (_count == 0);
- Simple.enable();
- Simple.notify(this, tmp);
- assert (_count == 1);
-
- // unregister should also work with disabled event
- Simple.disable();
- Simple -= priorityDelegate(this, &PriorityEventTest::onSimple, 0);
- Simple.enable();
- Simple.notify(this, tmp);
- assert (_count == 1);
-}
-
-void PriorityEventTest::testPriorityOrder()
-{
- DummyDelegate o1;
- DummyDelegate o2;
-
- assert (_count == 0);
-
- Simple += PriorityDelegate<DummyDelegate, int>(&o2, &DummyDelegate::onSimple2, 1);
- Simple += PriorityDelegate<DummyDelegate, int>(&o1, &DummyDelegate::onSimple, 0);
-
- int tmp = 0;
- Simple.notify(this, tmp);
- assert (tmp == 2);
-
- Simple -= PriorityDelegate<DummyDelegate, int>(&o1, &DummyDelegate::onSimple, 0);
- Simple -= PriorityDelegate<DummyDelegate, int>(&o2, &DummyDelegate::onSimple2, 1);
-
- // now try with the wrong order
- Simple += PriorityDelegate<DummyDelegate, int>(&o2, &DummyDelegate::onSimple2, 0);
- Simple += PriorityDelegate<DummyDelegate, int>(&o1, &DummyDelegate::onSimple, 1);
-
- try
- {
- tmp = 0;
- Simple.notify(this, tmp);
- failmsg ("Notify should not work");
- }
- catch (Poco::InvalidArgumentException&)
- {
- }
-
- Simple -= PriorityDelegate<DummyDelegate, int>(&o2, &DummyDelegate::onSimple2, 0);
- Simple -= PriorityDelegate<DummyDelegate, int>(&o1, &DummyDelegate::onSimple, 1);
-}
-
-void PriorityEventTest::testPriorityOrderExpire()
-{
- // expire must not break order!
- DummyDelegate o1;
- DummyDelegate o2;
-
- assert (_count == 0);
-
- Simple += priorityDelegate(&o2, &DummyDelegate::onSimple2, 1, 500000);
- Simple += priorityDelegate(&o1, &DummyDelegate::onSimple, 0, 500000);
- int tmp = 0;
- Simple.notify(this, tmp);
- assert (tmp == 2);
-
- // both ways of unregistering should work
- Simple -= priorityDelegate(&o1, &DummyDelegate::onSimple, 0, 600000);
- Simple -= priorityDelegate(&o2, &DummyDelegate::onSimple2, 1);
- Simple.notify(this, tmp);
- assert (tmp == 2);
-
- // now start mixing of expire and non expire
- tmp = 0;
- Simple += priorityDelegate(&o2, &DummyDelegate::onSimple2, 1, 500000);
- Simple += priorityDelegate(&o1, &DummyDelegate::onSimple, 0);
-
- Simple.notify(this, tmp);
- assert (tmp == 2);
-
- Simple -= priorityDelegate(&o2, &DummyDelegate::onSimple2, 1);
- // it is not forbidden to unregister a non expiring event with an expire decorator (it is just stupid ;-))
- Simple -= priorityDelegate(&o1, &DummyDelegate::onSimple, 0, 600000);
- Simple.notify(this, tmp);
- assert (tmp == 2);
-
- // now try with the wrong order
- Simple += priorityDelegate(&o2, &DummyDelegate::onSimple2, 0, 500000);
- Simple += priorityDelegate(&o1, &DummyDelegate::onSimple, 1);
-
- try
- {
- tmp = 0;
- Simple.notify(this, tmp);
- failmsg ("Notify should not work");
- }
- catch (Poco::InvalidArgumentException&)
- {
- }
-
- Simple -= priorityDelegate(&o2, &DummyDelegate::onSimple2, 0, 500000);
- Simple -= priorityDelegate(&o1, &DummyDelegate::onSimple, 1);
-
-}
-
-void PriorityEventTest::testExpire()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += priorityDelegate(this, &PriorityEventTest::onSimple, 1, 500);
- Simple.notify(this, tmp);
- assert (_count == 1);
- Poco::Thread::sleep(700);
- Simple.notify(this, tmp);
- assert (_count == 1);
- Simple -= priorityDelegate(this, &PriorityEventTest::onSimple, 1, 500);
-
- Simple += priorityDelegate(&PriorityEventTest::onStaticSimple, 1, 500);
- Simple += priorityDelegate(&PriorityEventTest::onStaticSimple2, 1, 500);
- Simple += priorityDelegate(&PriorityEventTest::onStaticSimple3, 1, 500);
- Simple.notify(this, tmp);
- assert (_count == 3);
- Poco::Thread::sleep(700);
- Simple.notify(this, tmp);
- assert (_count == 3);
-}
-
-
-void PriorityEventTest::testExpireReRegister()
-{
- int tmp = 0;
-
- assert (_count == 0);
-
- Simple += priorityDelegate(this, &PriorityEventTest::onSimple, 1, 500);
- Simple.notify(this, tmp);
- assert (_count == 1);
- Poco::Thread::sleep(200);
- Simple.notify(this, tmp);
- assert (_count == 2);
- // renew registration
- Simple += priorityDelegate(this, &PriorityEventTest::onSimple, 1, 600);
- Poco::Thread::sleep(400);
- Simple.notify(this, tmp);
- assert (_count == 3);
- Poco::Thread::sleep(300);
- Simple.notify(this, tmp);
- assert (_count == 3);
-}
-
-
-void PriorityEventTest::testReturnParams()
-{
- DummyDelegate o1;
- Simple += priorityDelegate(&o1, &DummyDelegate::onSimple, 0);
-
- int tmp = 0;
- Simple.notify(this, tmp);
- assert (tmp == 1);
-}
-
-void PriorityEventTest::testOverwriteDelegate()
-{
- DummyDelegate o1;
- Simple += priorityDelegate(&o1, &DummyDelegate::onSimple2, 0);
- // o1 can only have one entry per priority, thus the next line will replace the entry
- Simple += priorityDelegate(&o1, &DummyDelegate::onSimple, 0);
-
- int tmp = 0; // onsimple requires 0 as input
- Simple.notify(this, tmp);
- assert (tmp == 1);
- // now overwrite with onsimple2 with requires as input tmp = 1
- Simple += priorityDelegate(&o1, &DummyDelegate::onSimple2, 0, 23000);
- Simple.notify(this, tmp);
- assert (tmp == 2);
- Simple -= priorityDelegate(&o1, &DummyDelegate::onSimple2, 0, 23000);
-}
-
-void PriorityEventTest::testAsyncNotify()
-{
- Poco::PriorityEvent<int >* pSimple= new Poco::PriorityEvent<int>();
- (*pSimple) += priorityDelegate(this, &PriorityEventTest::onAsync, 0);
- assert (_count == 0);
- int tmp = 0;
- Poco::ActiveResult<int>retArg = pSimple->notifyAsync(this, tmp);
- delete pSimple; // must work even when the event got deleted!
- pSimple = NULL;
- assert (_count == 0);
- retArg.wait();
- assert (retArg.data() == tmp);
- assert (_count == LARGEINC);
-
-}
-
-
-void PriorityEventTest::onStaticSimple(const void* pSender, int& i)
-{
- PriorityEventTest* p = const_cast<PriorityEventTest*>(reinterpret_cast<const PriorityEventTest*>(pSender));
- p->_count++;
-}
-
-
-void PriorityEventTest::onStaticSimple2(void* pSender, int& i)
-{
- PriorityEventTest* p = reinterpret_cast<PriorityEventTest*>(pSender);
- p->_count++;
-}
-
-
-void PriorityEventTest::onStaticSimple3(int& i)
-{
-}
-
-
-void PriorityEventTest::onSimpleNoSender(int& i)
-{
- _count++;
-}
-
-
-void PriorityEventTest::onSimple(const void* pSender, int& i)
-{
- _count++;
-}
-
-void PriorityEventTest::onSimpleOther(const void* pSender, int& i)
-{
- _count += LARGEINC ;
-}
-
-void PriorityEventTest::onConstSimple(const void* pSender, const int& i)
-{
- _count++;
-}
-
-void PriorityEventTest::onComplex(const void* pSender, Poco::EventArgs* & i)
-{
- _count++;
-}
-
-void PriorityEventTest::onComplex2(const void* pSender, Poco::EventArgs & i)
-{
- _count++;
-}
-
-void PriorityEventTest::onConstComplex(const void* pSender, const Poco::EventArgs*& i)
-{
- _count++;
-}
-
-void PriorityEventTest::onConst2Complex(const void* pSender, const Poco::EventArgs * const & i)
-{
- _count++;
-}
-
-void PriorityEventTest::onAsync(const void* pSender, int& i)
-{
- Poco::Thread::sleep(700);
- _count += LARGEINC ;
-}
-
-int PriorityEventTest::getCount() const
-{
- return _count;
-}
-
-void PriorityEventTest::setUp()
-{
- _count = 0;
- // must clear events, otherwise repeating test executions will fail
- // because tests are only created once, only setup is called before
- // each test run
- Simple.clear();
- ConstSimple.clear();
- Complex.clear();
- Complex2.clear();
- ConstComplex.clear();
- Const2Complex.clear();
-}
-
-
-void PriorityEventTest::tearDown()
-{
-}
-
-
-CppUnit::Test* PriorityEventTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("PriorityEventTest");
-
- CppUnit_addTest(pSuite, PriorityEventTest, testNoDelegate);
- CppUnit_addTest(pSuite, PriorityEventTest, testSingleDelegate);
- CppUnit_addTest(pSuite, PriorityEventTest, testReturnParams);
- CppUnit_addTest(pSuite, PriorityEventTest, testDuplicateRegister);
- CppUnit_addTest(pSuite, PriorityEventTest, testDuplicateUnregister);
- CppUnit_addTest(pSuite, PriorityEventTest, testDisabling);
- CppUnit_addTest(pSuite, PriorityEventTest, testPriorityOrder);
- CppUnit_addTest(pSuite, PriorityEventTest, testPriorityOrderExpire);
- CppUnit_addTest(pSuite, PriorityEventTest, testExpire);
- CppUnit_addTest(pSuite, PriorityEventTest, testExpireReRegister);
- CppUnit_addTest(pSuite, PriorityEventTest, testOverwriteDelegate);
- CppUnit_addTest(pSuite, PriorityEventTest, testAsyncNotify);
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/PriorityEventTest.h b/Utilities/Poco/Foundation/testsuite/src/PriorityEventTest.h
deleted file mode 100755
index e95e867045..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/PriorityEventTest.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// PriorityEventTest.h
-//
-// $Id$
-//
-// Definition of the PriorityEventTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef PriorityEventTest_INCLUDED
-#define PriorityEventTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/PriorityEvent.h"
-#include "Poco/EventArgs.h"
-
-
-class PriorityEventTest: public CppUnit::TestCase
-{
- Poco::PriorityEvent<int> Simple;
- Poco::PriorityEvent<const int> ConstSimple;
- Poco::PriorityEvent<Poco::EventArgs*> Complex;
- Poco::PriorityEvent<Poco::EventArgs> Complex2;
- Poco::PriorityEvent<const Poco::EventArgs*> ConstComplex;
- Poco::PriorityEvent<const Poco::EventArgs * const> Const2Complex;
-public:
- PriorityEventTest(const std::string& name);
- ~PriorityEventTest();
-
- void testNoDelegate();
- void testSingleDelegate();
- void testDuplicateRegister();
- void testDuplicateUnregister();
- void testDisabling();
- void testPriorityOrder();
- void testPriorityOrderExpire();
- void testExpire();
- void testExpireReRegister();
- void testReturnParams();
- void testOverwriteDelegate();
- void testAsyncNotify();
-
- void setUp();
- void tearDown();
- static CppUnit::Test* suite();
-
-protected:
- static void onStaticSimple(const void* pSender, int& i);
- static void onStaticSimple2(void* pSender, int& i);
- static void onStaticSimple3(int& i);
-
- void onSimpleNoSender(int& i);
- void onSimple(const void* pSender, int& i);
- void onSimpleOther(const void* pSender, int& i);
- void onConstSimple(const void* pSender, const int& i);
- void onComplex(const void* pSender, Poco::EventArgs* & i);
- void onComplex2(const void* pSender, Poco::EventArgs & i);
- void onConstComplex(const void* pSender, const Poco::EventArgs*& i);
- void onConst2Complex(const void* pSender, const Poco::EventArgs * const & i);
- void onAsync(const void* pSender, int& i);
-
- int getCount() const;
-private:
- int _count;
-};
-
-
-#endif // PriorityEventTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/PriorityNotificationQueueTest.cpp b/Utilities/Poco/Foundation/testsuite/src/PriorityNotificationQueueTest.cpp
deleted file mode 100644
index cb4ec7366e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/PriorityNotificationQueueTest.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// PriorityNotificationQueueTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2009, 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 "PriorityNotificationQueueTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/PriorityNotificationQueue.h"
-#include "Poco/Notification.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-#include "Poco/RunnableAdapter.h"
-#include "Poco/Random.h"
-
-
-using Poco::PriorityNotificationQueue;
-using Poco::Notification;
-using Poco::Thread;
-using Poco::RunnableAdapter;
-
-
-namespace
-{
- class QTestNotification: public Notification
- {
- public:
- QTestNotification(const std::string& data): _data(data)
- {
- }
- ~QTestNotification()
- {
- }
- const std::string& data() const
- {
- return _data;
- }
-
- private:
- std::string _data;
- };
-}
-
-
-PriorityNotificationQueueTest::PriorityNotificationQueueTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-PriorityNotificationQueueTest::~PriorityNotificationQueueTest()
-{
-}
-
-
-void PriorityNotificationQueueTest::testQueueDequeue()
-{
- PriorityNotificationQueue queue;
- assert (queue.empty());
- assert (queue.size() == 0);
- Notification* pNf = queue.dequeueNotification();
- assertNullPtr(pNf);
- queue.enqueueNotification(new Notification, 1);
- assert (!queue.empty());
- assert (queue.size() == 1);
- pNf = queue.dequeueNotification();
- assertNotNullPtr(pNf);
- assert (queue.empty());
- assert (queue.size() == 0);
- pNf->release();
-
- queue.enqueueNotification(new QTestNotification("first"), 1);
- queue.enqueueNotification(new QTestNotification("fourth"), 4);
- queue.enqueueNotification(new QTestNotification("third"), 3);
- queue.enqueueNotification(new QTestNotification("second"), 2);
- assert (!queue.empty());
- assert (queue.size() == 4);
- QTestNotification* pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "first");
- pTNf->release();
- assert (!queue.empty());
- assert (queue.size() == 3);
- pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "second");
- pTNf->release();
- assert (!queue.empty());
- assert (queue.size() == 2);
- pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "third");
- pTNf->release();
- assert (!queue.empty());
- assert (queue.size() == 1);
- pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "fourth");
- pTNf->release();
- assert (queue.empty());
- assert (queue.size() == 0);
-
- pNf = queue.dequeueNotification();
- assertNullPtr(pNf);
-}
-
-
-void PriorityNotificationQueueTest::testWaitDequeue()
-{
- PriorityNotificationQueue queue;
- queue.enqueueNotification(new QTestNotification("third"), 3);
- queue.enqueueNotification(new QTestNotification("fourth"), 4);
- assert (!queue.empty());
- assert (queue.size() == 2);
- QTestNotification* pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification(10));
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "third");
- pTNf->release();
- assert (!queue.empty());
- assert (queue.size() == 1);
- pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification(10));
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "fourth");
- pTNf->release();
- assert (queue.empty());
- assert (queue.size() == 0);
-
- Notification* pNf = queue.waitDequeueNotification(10);
- assertNullPtr(pNf);
-}
-
-
-void PriorityNotificationQueueTest::testThreads()
-{
- const int NOTIFICATION_COUNT = 5000;
-
- Thread t1("thread1");
- Thread t2("thread2");
- Thread t3("thread3");
-
- RunnableAdapter<PriorityNotificationQueueTest> ra(*this, &PriorityNotificationQueueTest::work);
- t1.start(ra);
- t2.start(ra);
- t3.start(ra);
- for (int i = 0; i < NOTIFICATION_COUNT; ++i)
- {
- _queue.enqueueNotification(new Notification, 1);
- }
- while (!_queue.empty()) Thread::sleep(50);
- Thread::sleep(20);
- _queue.wakeUpAll();
- t1.join();
- t2.join();
- t3.join();
- assert (_handled.size() == NOTIFICATION_COUNT);
- assert (_handled.count("thread1") > 0);
- assert (_handled.count("thread2") > 0);
- assert (_handled.count("thread3") > 0);
-}
-
-
-void PriorityNotificationQueueTest::testDefaultQueue()
-{
- PriorityNotificationQueue& queue = PriorityNotificationQueue::defaultQueue();
- assert (queue.empty());
- assert (queue.size() == 0);
-}
-
-
-void PriorityNotificationQueueTest::setUp()
-{
- _handled.clear();
-}
-
-
-void PriorityNotificationQueueTest::tearDown()
-{
-}
-
-
-void PriorityNotificationQueueTest::work()
-{
- Poco::Random rnd;
- Thread::sleep(50);
- Notification* pNf = _queue.waitDequeueNotification();
- while (pNf)
- {
- pNf->release();
- _mutex.lock();
- _handled.insert(Thread::current()->name());
- _mutex.unlock();
- Thread::sleep(rnd.next(5));
- pNf = _queue.waitDequeueNotification();
- }
-}
-
-
-CppUnit::Test* PriorityNotificationQueueTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("PriorityNotificationQueueTest");
-
- CppUnit_addTest(pSuite, PriorityNotificationQueueTest, testQueueDequeue);
- CppUnit_addTest(pSuite, PriorityNotificationQueueTest, testWaitDequeue);
- CppUnit_addTest(pSuite, PriorityNotificationQueueTest, testThreads);
- CppUnit_addTest(pSuite, PriorityNotificationQueueTest, testDefaultQueue);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/PriorityNotificationQueueTest.h b/Utilities/Poco/Foundation/testsuite/src/PriorityNotificationQueueTest.h
deleted file mode 100644
index 8107d62388..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/PriorityNotificationQueueTest.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// PriorityNotificationQueueTest.h
-//
-// $Id$
-//
-// Definition of the PriorityNotificationQueueTest class.
-//
-// Copyright (c) 2009, 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.
-//
-
-
-#ifndef PriorityNotificationQueueTest_INCLUDED
-#define PriorityNotificationQueueTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/PriorityNotificationQueue.h"
-#include "Poco/Mutex.h"
-#include <set>
-
-
-class PriorityNotificationQueueTest: public CppUnit::TestCase
-{
-public:
- PriorityNotificationQueueTest(const std::string& name);
- ~PriorityNotificationQueueTest();
-
- void testQueueDequeue();
- void testWaitDequeue();
- void testThreads();
- void testDefaultQueue();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-protected:
- void work();
-
-private:
- Poco::PriorityNotificationQueue _queue;
- std::multiset<std::string> _handled;
- Poco::FastMutex _mutex;
-};
-
-
-#endif // PriorityNotificationQueueTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ProcessTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ProcessTest.cpp
deleted file mode 100755
index 65b11d0254..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ProcessTest.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-//
-// ProcessTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2005-2006, 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 "ProcessTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Process.h"
-#include "Poco/Pipe.h"
-#include "Poco/PipeStream.h"
-
-
-using Poco::Process;
-using Poco::ProcessHandle;
-using Poco::Pipe;
-using Poco::PipeInputStream;
-using Poco::PipeOutputStream;
-
-
-ProcessTest::ProcessTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ProcessTest::~ProcessTest()
-{
-}
-
-
-void ProcessTest::testLaunch()
-{
- std::string name("TestApp");
- std::string cmd;
-#if defined(_DEBUG)
- name += "d";
-#endif
-
-#if defined(POCO_OS_FAMILY_UNIX)
- cmd = "./";
- cmd += name;
-#else
- cmd = name;
-#endif
-
- std::vector<std::string> args;
- args.push_back("arg1");
- args.push_back("arg2");
- args.push_back("arg3");
- ProcessHandle ph = Process::launch(cmd, args);
- int rc = ph.wait();
- assert (rc == 3);
-}
-
-
-void ProcessTest::testLaunchRedirectIn()
-{
- std::string name("TestApp");
- std::string cmd;
-#if defined(_DEBUG)
- name += "d";
-#endif
-
-#if defined(POCO_OS_FAMILY_UNIX)
- cmd = "./";
- cmd += name;
-#else
- cmd = name;
-#endif
-
- std::vector<std::string> args;
- args.push_back("-count");
- Pipe inPipe;
- ProcessHandle ph = Process::launch(cmd, args, &inPipe, 0, 0);
- PipeOutputStream ostr(inPipe);
- ostr << std::string(100, 'x');
- ostr.close();
- int rc = ph.wait();
- assert (rc == 100);
-}
-
-
-void ProcessTest::testLaunchRedirectOut()
-{
- std::string name("TestApp");
- std::string cmd;
-#if defined(_DEBUG)
- name += "d";
-#endif
-
-#if defined(POCO_OS_FAMILY_UNIX)
- cmd = "./";
- cmd += name;
-#else
- cmd = name;
-#endif
-
- std::vector<std::string> args;
- args.push_back("-hello");
- Pipe outPipe;
- ProcessHandle ph = Process::launch(cmd, args, 0, &outPipe, 0);
- PipeInputStream istr(outPipe);
- std::string s;
- int c = istr.get();
- while (c != -1) { s += (char) c; c = istr.get(); }
- assert (s == "Hello, world!");
- int rc = ph.wait();
- assert (rc == 1);
-}
-
-
-void ProcessTest::setUp()
-{
-}
-
-
-void ProcessTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ProcessTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ProcessTest");
-
- CppUnit_addTest(pSuite, ProcessTest, testLaunch);
- CppUnit_addTest(pSuite, ProcessTest, testLaunchRedirectIn);
- CppUnit_addTest(pSuite, ProcessTest, testLaunchRedirectOut);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ProcessTest.h b/Utilities/Poco/Foundation/testsuite/src/ProcessTest.h
deleted file mode 100755
index 4afa85119f..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ProcessTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// ProcessTest.h
-//
-// $Id$
-//
-// Definition of the ProcessTest class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef ProcessTest_INCLUDED
-#define ProcessTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ProcessTest: public CppUnit::TestCase
-{
-public:
- ProcessTest(const std::string& name);
- ~ProcessTest();
-
- void testLaunch();
- void testLaunchRedirectIn();
- void testLaunchRedirectOut();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ProcessTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ProcessesTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/ProcessesTestSuite.cpp
deleted file mode 100755
index 1aa2faae17..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ProcessesTestSuite.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// ProcessesTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ProcessesTestSuite.h"
-#include "ProcessTest.h"
-#include "NamedMutexTest.h"
-#include "NamedEventTest.h"
-#include "SharedMemoryTest.h"
-
-
-CppUnit::Test* ProcessesTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ProcessesTestSuite");
-
- pSuite->addTest(ProcessTest::suite());
- pSuite->addTest(NamedMutexTest::suite());
- pSuite->addTest(NamedEventTest::suite());
- pSuite->addTest(SharedMemoryTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ProcessesTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/ProcessesTestSuite.h
deleted file mode 100755
index ae300ae4b4..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ProcessesTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// ProcessesTestSuite.h
-//
-// $Id$
-//
-// Definition of the ProcessesTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ProcessesTestSuite_INCLUDED
-#define ProcessesTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class ProcessesTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // ProcessesTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/RWLockTest.cpp b/Utilities/Poco/Foundation/testsuite/src/RWLockTest.cpp
deleted file mode 100755
index 83e6e5daaa..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/RWLockTest.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// RWLockTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "RWLockTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/RWLock.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-
-
-using Poco::RWLock;
-using Poco::Thread;
-using Poco::Runnable;
-
-
-class RWLockRunnable: public Runnable
-{
-public:
- RWLockRunnable(RWLock& lock, volatile int& counter): _lock(lock), _counter(counter), _ok(true)
- {
- }
-
- void run()
- {
- int lastCount = 0;
- for (int i = 0; i < 10000; ++i)
- {
- _lock.readLock();
- lastCount = _counter;
- for (int k = 0; k < 100; ++k)
- {
- if (_counter != lastCount) _ok = false;
- Thread::yield();
- }
- _lock.unlock();
- _lock.writeLock();
- for (int k = 0; k < 100; ++k)
- {
- --_counter;
- Thread::yield();
- }
- for (int k = 0; k < 100; ++k)
- {
- ++_counter;
- Thread::yield();
- }
- ++_counter;
- if (_counter <= lastCount) _ok = false;
- _lock.unlock();
- }
- }
-
- bool ok() const
- {
- return _ok;
- }
-
-private:
- RWLock& _lock;
- volatile int& _counter;
- bool _ok;
-};
-
-
-class RWTryLockRunnable: public Runnable
-{
-public:
- RWTryLockRunnable(RWLock& lock, volatile int& counter): _lock(lock), _counter(counter), _ok(true)
- {
- }
-
- void run()
- {
- int lastCount = 0;
- for (int i = 0; i < 10000; ++i)
- {
- while (!_lock.tryReadLock()) Thread::yield();
- lastCount = _counter;
- for (int k = 0; k < 100; ++k)
- {
- if (_counter != lastCount) _ok = false;
- Thread::yield();
- }
- _lock.unlock();
- while (!_lock.tryWriteLock()) Thread::yield();
- for (int k = 0; k < 100; ++k)
- {
- --_counter;
- Thread::yield();
- }
- for (int k = 0; k < 100; ++k)
- {
- ++_counter;
- Thread::yield();
- }
- ++_counter;
- if (_counter <= lastCount) _ok = false;
- _lock.unlock();
- }
- }
-
- bool ok() const
- {
- return _ok;
- }
-
-private:
- RWLock& _lock;
- volatile int& _counter;
- bool _ok;
-};
-
-
-RWLockTest::RWLockTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-RWLockTest::~RWLockTest()
-{
-}
-
-
-void RWLockTest::testLock()
-{
- RWLock lock;
- int counter = 0;
- RWLockRunnable r1(lock, counter);
- RWLockRunnable r2(lock, counter);
- RWLockRunnable r3(lock, counter);
- RWLockRunnable r4(lock, counter);
- RWLockRunnable r5(lock, counter);
- Thread t1;
- Thread t2;
- Thread t3;
- Thread t4;
- Thread t5;
- t1.start(r1);
- t2.start(r2);
- t3.start(r3);
- t4.start(r4);
- t5.start(r5);
- t1.join();
- t2.join();
- t3.join();
- t4.join();
- t5.join();
- assert (counter == 50000);
- assert (r1.ok());
- assert (r2.ok());
- assert (r3.ok());
- assert (r4.ok());
- assert (r5.ok());
-}
-
-
-void RWLockTest::testTryLock()
-{
- RWLock lock;
- int counter = 0;
- RWTryLockRunnable r1(lock, counter);
- RWTryLockRunnable r2(lock, counter);
- RWTryLockRunnable r3(lock, counter);
- RWTryLockRunnable r4(lock, counter);
- RWTryLockRunnable r5(lock, counter);
- Thread t1;
- Thread t2;
- Thread t3;
- Thread t4;
- Thread t5;
- t1.start(r1);
- t2.start(r2);
- t3.start(r3);
- t4.start(r4);
- t5.start(r5);
- t1.join();
- t2.join();
- t3.join();
- t4.join();
- t5.join();
- assert (counter == 50000);
- assert (r1.ok());
- assert (r2.ok());
- assert (r3.ok());
- assert (r4.ok());
- assert (r5.ok());
-}
-
-
-void RWLockTest::setUp()
-{
-}
-
-
-void RWLockTest::tearDown()
-{
-}
-
-
-CppUnit::Test* RWLockTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RWLockTest");
-
- CppUnit_addTest(pSuite, RWLockTest, testLock);
- CppUnit_addTest(pSuite, RWLockTest, testTryLock);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/RWLockTest.h b/Utilities/Poco/Foundation/testsuite/src/RWLockTest.h
deleted file mode 100755
index ceaad876af..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/RWLockTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// RWLockTest.h
-//
-// $Id$
-//
-// Definition of the RWLockTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef RWLockTest_INCLUDED
-#define RWLockTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class RWLockTest: public CppUnit::TestCase
-{
-public:
- RWLockTest(const std::string& name);
- ~RWLockTest();
-
- void testLock();
- void testTryLock();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // RWLockTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/RandomStreamTest.cpp b/Utilities/Poco/Foundation/testsuite/src/RandomStreamTest.cpp
deleted file mode 100755
index 0a69518794..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/RandomStreamTest.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// RandomStreamTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "RandomStreamTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/RandomStream.h"
-#include <vector>
-#include <cmath>
-
-
-using Poco::RandomInputStream;
-
-
-RandomStreamTest::RandomStreamTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-RandomStreamTest::~RandomStreamTest()
-{
-}
-
-
-void RandomStreamTest::testStream()
-{
- RandomInputStream rnd;
-
- const int n = 16;
- std::vector<int> d(n, 0);
- for (int i = 0; i < 1000; ++i)
- {
- unsigned char c;
- rnd >> c;
- d[c & 0x0F]++;
- d[(c >> 4) & 0x0F]++;
- }
- int sum = 0;
- for (int k = 0; k < n; ++k) sum += d[k];
- int avg = sum/n;
- int var = 0;
- for (int k = 0; k < n; ++k) var += (d[k] - avg)*(d[k] - avg);
- var /= n;
- int sd = int(std::sqrt((double) var));
-
- assert (110 < avg && avg < 140);
- assert (sd < 20);
-}
-
-
-void RandomStreamTest::setUp()
-{
-}
-
-
-void RandomStreamTest::tearDown()
-{
-}
-
-
-CppUnit::Test* RandomStreamTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RandomStreamTest");
-
- CppUnit_addTest(pSuite, RandomStreamTest, testStream);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/RandomStreamTest.h b/Utilities/Poco/Foundation/testsuite/src/RandomStreamTest.h
deleted file mode 100755
index b401032475..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/RandomStreamTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// RandomStreamTest.h
-//
-// $Id$
-//
-// Definition of the RandomStreamTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef RandomStreamTest_INCLUDED
-#define RandomStreamTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class RandomStreamTest: public CppUnit::TestCase
-{
-public:
- RandomStreamTest(const std::string& name);
- ~RandomStreamTest();
-
- void testStream();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // RandomStreamTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/RandomTest.cpp b/Utilities/Poco/Foundation/testsuite/src/RandomTest.cpp
deleted file mode 100755
index cc178276dc..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/RandomTest.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-// RandomTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "RandomTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Random.h"
-#include <vector>
-#include <cmath>
-
-
-using Poco::Random;
-using Poco::UInt32;
-
-
-RandomTest::RandomTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-RandomTest::~RandomTest()
-{
-}
-
-
-void RandomTest::testSequence1()
-{
- Random rnd1;
- Random rnd2;
- rnd1.seed(12345);
- rnd2.seed(12345);
- for (int i = 0; i < 100; ++i)
- {
- assert (rnd1.next() == rnd2.next());
- }
-}
-
-
-void RandomTest::testSequence2()
-{
- Random rnd1;
- Random rnd2;
- rnd1.seed(12345);
- rnd2.seed(54321);
-
- bool equals = true;
- for (int i = 0; i < 20; ++i)
- {
- if (rnd1.next() != rnd2.next())
- {
- equals = false;
- break;
- }
- }
- assert (!equals);
-}
-
-
-void RandomTest::testDistribution1()
-{
- Random rnd;
- rnd.seed(123456);
- const int n = 11;
- int d[n] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- for (int i = 0; i < 100; ++i)
- {
- d[rnd.next() % n] = 1;
- }
- int sum = 0;
- for (int k = 0; k < n; ++k) sum += d[k];
-
- assert (sum == n);
-}
-
-
-void RandomTest::testDistribution2()
-{
- Random rnd;
- rnd.seed();
- const int n = 101;
- std::vector<int> d(n, 0);
- for (int i = 0; i < 10000; ++i)
- {
- d[rnd.next(n)]++;
- }
- int sum = 0;
- for (int k = 0; k < n; ++k) sum += d[k];
- int avg = sum/n;
- int var = 0;
- for (int k = 0; k < n; ++k) var += (d[k] - avg)*(d[k] - avg);
- var /= n;
- int sd = int(std::sqrt((double) var));
-
- assert (95 < avg && avg < 105);
- assert (sd < 15);
-}
-
-
-void RandomTest::testDistribution3()
-{
- Random rnd;
- rnd.seed();
- const int n = 101;
- std::vector<int> d(n, 0);
- for (int i = 0; i < 10000; ++i)
- {
- d[int(rnd.nextFloat()*n)]++;
- }
- int sum = 0;
- for (int k = 0; k < n; ++k) sum += d[k];
- int avg = sum/n;
- int var = 0;
- for (int k = 0; k < n; ++k) var += (d[k] - avg)*(d[k] - avg);
- var /= n;
- int sd = int(std::sqrt((double) var));
-
- assert (95 < avg && avg < 105);
- assert (sd < 15);
-}
-
-
-void RandomTest::setUp()
-{
-}
-
-
-void RandomTest::tearDown()
-{
-}
-
-
-CppUnit::Test* RandomTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RandomTest");
-
- CppUnit_addTest(pSuite, RandomTest, testSequence1);
- CppUnit_addTest(pSuite, RandomTest, testSequence2);
- CppUnit_addTest(pSuite, RandomTest, testDistribution1);
- CppUnit_addTest(pSuite, RandomTest, testDistribution2);
- CppUnit_addTest(pSuite, RandomTest, testDistribution3);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/RandomTest.h b/Utilities/Poco/Foundation/testsuite/src/RandomTest.h
deleted file mode 100755
index 56037c0cce..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/RandomTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// RandomTest.h
-//
-// $Id$
-//
-// Definition of the RandomTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef RandomTest_INCLUDED
-#define RandomTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class RandomTest: public CppUnit::TestCase
-{
-public:
- RandomTest(const std::string& name);
- ~RandomTest();
-
- void testSequence1();
- void testSequence2();
- void testDistribution1();
- void testDistribution2();
- void testDistribution3();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // RandomTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/RegularExpressionTest.cpp b/Utilities/Poco/Foundation/testsuite/src/RegularExpressionTest.cpp
deleted file mode 100755
index 33ec40d58e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/RegularExpressionTest.cpp
+++ /dev/null
@@ -1,319 +0,0 @@
-//
-// RegularExpressionTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "RegularExpressionTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/RegularExpression.h"
-#include "Poco/Exception.h"
-
-
-using Poco::RegularExpression;
-using Poco::RegularExpressionException;
-
-
-RegularExpressionTest::RegularExpressionTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-RegularExpressionTest::~RegularExpressionTest()
-{
-}
-
-
-void RegularExpressionTest::testIndex()
-{
- RegularExpression re("[0-9]+");
- RegularExpression::Match match;
- assert (re.match("", 0, match) == 0);
- assert (re.match("123", 3, match) == 0);
-}
-
-
-void RegularExpressionTest::testMatch1()
-{
- RegularExpression re("[0-9]+");
- assert (re.match("123"));
- assert (!re.match("123cd"));
- assert (!re.match("abcde"));
- assert (re.match("ab123", 2));
-}
-
-
-void RegularExpressionTest::testMatch2()
-{
- RegularExpression re("[0-9]+");
- RegularExpression::Match match;
- assert (re.match("123", 0, match) == 1);
- assert (match.offset == 0);
- assert (match.length == 3);
-
- assert (re.match("abc123def", 0, match) == 1);
- assert (match.offset == 3);
- assert (match.length == 3);
-
- assert (re.match("abcdef", 0, match) == 0);
- assert (match.offset == std::string::npos);
- assert (match.length == 0);
-
- assert (re.match("abc123def", 3, match) == 1);
- assert (match.offset == 3);
- assert (match.length == 3);
-}
-
-
-void RegularExpressionTest::testMatch3()
-{
- RegularExpression re("[0-9]+");
- RegularExpression::MatchVec match;
- assert (re.match("123", 0, match) == 1);
- assert (match.size() == 1);
- assert (match[0].offset == 0);
- assert (match[0].length == 3);
-
- assert (re.match("abc123def", 0, match) == 1);
- assert (match.size() == 1);
- assert (match[0].offset == 3);
- assert (match[0].length == 3);
-
- assert (re.match("abcdef", 0, match) == 0);
- assert (match.size() == 0);
-
- assert (re.match("abc123def", 3, match) == 1);
- assert (match.size() == 1);
- assert (match[0].offset == 3);
- assert (match[0].length == 3);
-}
-
-
-void RegularExpressionTest::testMatch4()
-{
- RegularExpression re("([0-9]+) ([0-9]+)");
- RegularExpression::MatchVec matches;
- assert (re.match("123 456", 0, matches) == 3);
- assert (matches.size() == 3);
- assert (matches[0].offset == 0);
- assert (matches[0].length == 7);
- assert (matches[1].offset == 0);
- assert (matches[1].length == 3);
- assert (matches[2].offset == 4);
- assert (matches[2].length == 3);
-
- assert (re.match("abc123 456def", 0, matches) == 3);
- assert (matches.size() == 3);
- assert (matches[0].offset == 3);
- assert (matches[0].length == 7);
- assert (matches[1].offset == 3);
- assert (matches[1].length == 3);
- assert (matches[2].offset == 7);
- assert (matches[2].length == 3);
-}
-
-
-void RegularExpressionTest::testMatch5()
-{
- std::string digits = "0123";
- assert (RegularExpression::match(digits, "[0-9]+"));
- std::string alphas = "abcd";
- assert (!RegularExpression::match(alphas, "[0-9]+"));
-}
-
-
-void RegularExpressionTest::testMatch6()
-{
- RegularExpression expr("^([a-z]*)?$");
- assert (expr.match("", 0, 0));
- assert (expr.match("abcde", 0, 0));
- assert (!expr.match("123", 0, 0));
-}
-
-
-void RegularExpressionTest::testExtract()
-{
- RegularExpression re("[0-9]+");
- std::string str;
- assert (re.extract("123", str) == 1);
- assert (str == "123");
-
- assert (re.extract("abc123def", 0, str) == 1);
- assert (str == "123");
-
- assert (re.extract("abcdef", 0, str) == 0);
- assert (str == "");
-
- assert (re.extract("abc123def", 3, str) == 1);
- assert (str == "123");
-}
-
-
-void RegularExpressionTest::testSplit1()
-{
- RegularExpression re("[0-9]+");
- std::vector<std::string> strings;
- assert (re.split("123", 0, strings) == 1);
- assert (strings.size() == 1);
- assert (strings[0] == "123");
-
- assert (re.split("abc123def", 0, strings) == 1);
- assert (strings.size() == 1);
- assert (strings[0] == "123");
-
- assert (re.split("abcdef", 0, strings) == 0);
- assert (strings.empty());
-
- assert (re.split("abc123def", 3, strings) == 1);
- assert (strings.size() == 1);
- assert (strings[0] == "123");
-}
-
-
-void RegularExpressionTest::testSplit2()
-{
- RegularExpression re("([0-9]+) ([0-9]+)");
- std::vector<std::string> strings;
- assert (re.split("123 456", 0, strings) == 3);
- assert (strings.size() == 3);
- assert (strings[0] == "123 456");
- assert (strings[1] == "123");
- assert (strings[2] == "456");
-
- assert (re.split("abc123 456def", 0, strings) == 3);
- assert (strings.size() == 3);
- assert (strings[0] == "123 456");
- assert (strings[1] == "123");
- assert (strings[2] == "456");
-}
-
-
-void RegularExpressionTest::testSubst1()
-{
- RegularExpression re("[0-9]+");
- std::string s = "123";
- assert (re.subst(s, "ABC") == 1);
- assert (s == "ABC");
- assert (re.subst(s, "123") == 0);
-
- s = "123";
- assert (re.subst(s, "AB$0CD") == 1);
- assert (s == "AB123CD");
-
- s = "123";
- assert (re.subst(s, "AB$1CD") == 1);
- assert (s == "ABCD");
-
- s = "123";
- assert (re.subst(s, "AB$2CD") == 1);
- assert (s == "ABCD");
-
- s = "123";
- assert (re.subst(s, "AB$$CD") == 1);
- assert (s == "AB$$CD");
-
- s = "123";
- assert (re.subst(s, "AB$0CD", RegularExpression::RE_NO_VARS) == 1);
- assert (s == "AB$0CD");
-}
-
-
-void RegularExpressionTest::testSubst2()
-{
- RegularExpression re("([0-9]+) ([0-9]+)");
- std::string s = "123 456";
- assert (re.subst(s, "$2-$1") == 1);
- assert (s == "456-123");
-}
-
-
-void RegularExpressionTest::testSubst3()
-{
- RegularExpression re("[0-9]+");
- std::string s = "123 456 789";
- assert (re.subst(s, "n", RegularExpression::RE_GLOBAL) == 3);
- assert (s == "n n n");
-}
-
-
-void RegularExpressionTest::testSubst4()
-{
- RegularExpression re("[0-9]+");
- std::string s = "ABC 123 456 789 DEF";
- assert (re.subst(s, "n", RegularExpression::RE_GLOBAL) == 3);
- assert (s == "ABC n n n DEF");
-}
-
-
-void RegularExpressionTest::testError()
-{
- try
- {
- RegularExpression re("(0-9]");
- failmsg("bad regexp - must throw exception");
- }
- catch (RegularExpressionException&)
- {
- }
-}
-
-
-void RegularExpressionTest::setUp()
-{
-}
-
-
-void RegularExpressionTest::tearDown()
-{
-}
-
-
-CppUnit::Test* RegularExpressionTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RegularExpressionTest");
-
- CppUnit_addTest(pSuite, RegularExpressionTest, testIndex);
- CppUnit_addTest(pSuite, RegularExpressionTest, testMatch1);
- CppUnit_addTest(pSuite, RegularExpressionTest, testMatch2);
- CppUnit_addTest(pSuite, RegularExpressionTest, testMatch3);
- CppUnit_addTest(pSuite, RegularExpressionTest, testMatch4);
- CppUnit_addTest(pSuite, RegularExpressionTest, testMatch5);
- CppUnit_addTest(pSuite, RegularExpressionTest, testMatch6);
- CppUnit_addTest(pSuite, RegularExpressionTest, testExtract);
- CppUnit_addTest(pSuite, RegularExpressionTest, testSplit1);
- CppUnit_addTest(pSuite, RegularExpressionTest, testSplit2);
- CppUnit_addTest(pSuite, RegularExpressionTest, testSubst1);
- CppUnit_addTest(pSuite, RegularExpressionTest, testSubst2);
- CppUnit_addTest(pSuite, RegularExpressionTest, testSubst3);
- CppUnit_addTest(pSuite, RegularExpressionTest, testSubst4);
- CppUnit_addTest(pSuite, RegularExpressionTest, testError);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/RegularExpressionTest.h b/Utilities/Poco/Foundation/testsuite/src/RegularExpressionTest.h
deleted file mode 100755
index 165ff8adc8..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/RegularExpressionTest.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// RegularExpressionTest.h
-//
-// $Id$
-//
-// Definition of the RegularExpressionTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef RegularExpressionTest_INCLUDED
-#define RegularExpressionTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class RegularExpressionTest: public CppUnit::TestCase
-{
-public:
- RegularExpressionTest(const std::string& name);
- ~RegularExpressionTest();
-
- void testIndex();
- void testMatch1();
- void testMatch2();
- void testMatch3();
- void testMatch4();
- void testMatch5();
- void testMatch6();
- void testExtract();
- void testSplit1();
- void testSplit2();
- void testSubst1();
- void testSubst2();
- void testSubst3();
- void testSubst4();
- void testError();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // RegularExpressionTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/SHA1EngineTest.cpp b/Utilities/Poco/Foundation/testsuite/src/SHA1EngineTest.cpp
deleted file mode 100755
index 7427b50589..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SHA1EngineTest.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// SHA1EngineTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "SHA1EngineTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/SHA1Engine.h"
-
-
-using Poco::SHA1Engine;
-using Poco::DigestEngine;
-
-
-SHA1EngineTest::SHA1EngineTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-SHA1EngineTest::~SHA1EngineTest()
-{
-}
-
-
-void SHA1EngineTest::testSHA1()
-{
- SHA1Engine engine;
-
- // test vectors from FIPS 180-1
-
- engine.update("abc");
- assert (DigestEngine::digestToHex(engine.digest()) == "a9993e364706816aba3e25717850c26c9cd0d89d");
-
- engine.update("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");
- assert (DigestEngine::digestToHex(engine.digest()) == "84983e441c3bd26ebaae4aa1f95129e5e54670f1");
-
- for (int i = 0; i < 1000000; ++i)
- engine.update('a');
- assert (DigestEngine::digestToHex(engine.digest()) == "34aa973cd4c4daa4f61eeb2bdbad27316534016f");
-}
-
-
-void SHA1EngineTest::setUp()
-{
-}
-
-
-void SHA1EngineTest::tearDown()
-{
-}
-
-
-CppUnit::Test* SHA1EngineTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SHA1EngineTest");
-
- CppUnit_addTest(pSuite, SHA1EngineTest, testSHA1);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/SHA1EngineTest.h b/Utilities/Poco/Foundation/testsuite/src/SHA1EngineTest.h
deleted file mode 100755
index 1cee710ec2..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SHA1EngineTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// SHA1EngineTest.h
-//
-// $Id$
-//
-// Definition of the SHA1EngineTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SHA1EngineTest_INCLUDED
-#define SHA1EngineTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class SHA1EngineTest: public CppUnit::TestCase
-{
-public:
- SHA1EngineTest(const std::string& name);
- ~SHA1EngineTest();
-
- void testSHA1();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // SHA1EngineTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/SemaphoreTest.cpp b/Utilities/Poco/Foundation/testsuite/src/SemaphoreTest.cpp
deleted file mode 100755
index a5828efb84..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SemaphoreTest.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// SemaphoreTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "SemaphoreTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-#include "Poco/Semaphore.h"
-#include "Poco/Exception.h"
-
-
-using Poco::Thread;
-using Poco::Runnable;
-using Poco::Semaphore;
-using Poco::TimeoutException;
-
-
-class SemaRunnable: public Runnable
-{
-public:
- SemaRunnable(int n, int max): _ran(false), _sema(n, max)
- {
- }
-
- void run()
- {
- _sema.wait();
- _ran = true;
- }
-
- bool ran() const
- {
- return _ran;
- }
-
- void set()
- {
- _sema.set();
- }
-
- void wait()
- {
- _sema.wait();
- }
-
- void wait(long milliseconds)
- {
- _sema.wait(milliseconds);
- }
-
- bool tryWait(long milliseconds)
- {
- return _sema.tryWait(milliseconds);
- }
-
-private:
- bool _ran;
- Semaphore _sema;
-};
-
-
-SemaphoreTest::SemaphoreTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-SemaphoreTest::~SemaphoreTest()
-{
-}
-
-
-void SemaphoreTest::testInitZero()
-{
- SemaRunnable r(0, 3);
- assert (!r.tryWait(10));
- r.set();
- r.wait();
- try
- {
- r.wait(100);
- failmsg("must timeout");
- }
- catch (TimeoutException&)
- {
- }
- catch (...)
- {
- failmsg("wrong exception");
- }
- r.set();
- r.set();
- assert (r.tryWait(0));
- r.wait();
- assert (!r.tryWait(10));
-
- Thread t;
- t.start(r);
- Thread::sleep(100);
- assert (!r.ran());
- r.set();
- t.join();
- assert (r.ran());
- assert (!r.tryWait(10));
-}
-
-
-void SemaphoreTest::testInitNonZero()
-{
- SemaRunnable r(2, 2);
- r.wait();
- assert (r.tryWait(10));
- assert (!r.tryWait(10));
- r.set();
- assert (r.tryWait(10));
- assert (!r.tryWait(10));
-}
-
-
-void SemaphoreTest::setUp()
-{
-}
-
-
-void SemaphoreTest::tearDown()
-{
-}
-
-
-CppUnit::Test* SemaphoreTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SemaphoreTest");
-
- CppUnit_addTest(pSuite, SemaphoreTest, testInitZero);
- CppUnit_addTest(pSuite, SemaphoreTest, testInitNonZero);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/SemaphoreTest.h b/Utilities/Poco/Foundation/testsuite/src/SemaphoreTest.h
deleted file mode 100755
index 78ede79ccc..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SemaphoreTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// SemaphoreTest.h
-//
-// $Id$
-//
-// Definition of the SemaphoreTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SemaphoreTest_INCLUDED
-#define SemaphoreTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class SemaphoreTest: public CppUnit::TestCase
-{
-public:
- SemaphoreTest(const std::string& name);
- ~SemaphoreTest();
-
- void testInitZero();
- void testInitNonZero();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // SemaphoreTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTest.cpp b/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTest.cpp
deleted file mode 100755
index 7c992a197a..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTest.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-// SharedLibraryTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "SharedLibraryTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/SharedLibrary.h"
-#include "Poco/Exception.h"
-
-
-using Poco::SharedLibrary;
-using Poco::NotFoundException;
-using Poco::LibraryLoadException;
-using Poco::LibraryAlreadyLoadedException;
-
-
-typedef int (*GimmeFiveFunc)();
-
-
-SharedLibraryTest::SharedLibraryTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-SharedLibraryTest::~SharedLibraryTest()
-{
-}
-
-
-void SharedLibraryTest::testSharedLibrary1()
-{
- std::string path = "TestLibrary";
- path.append(SharedLibrary::suffix());
-
- SharedLibrary sl;
- assert (!sl.isLoaded());
- sl.load(path);
- assert (sl.getPath() == path);
- assert (sl.isLoaded());
- assert (sl.hasSymbol("pocoBuildManifest"));
- assert (sl.hasSymbol("pocoInitializeLibrary"));
- assert (sl.hasSymbol("pocoUninitializeLibrary"));
- assert (sl.hasSymbol("gimmeFive"));
- assert (!sl.hasSymbol("fooBar123"));
-
- void* p1 = sl.getSymbol("pocoBuildManifest");
- assertNotNullPtr(p1);
- try
- {
- p1 = sl.getSymbol("fooBar123");
- failmsg("no such symbol - must throw exception");
- }
- catch (NotFoundException&)
- {
- }
- catch (...)
- {
- failmsg("wrong exception");
- }
- sl.unload();
- assert (!sl.isLoaded());
-}
-
-
-void SharedLibraryTest::testSharedLibrary2()
-{
- std::string path = "TestLibrary";
- path.append(SharedLibrary::suffix());
- SharedLibrary sl(path);
- assert (sl.getPath() == path);
- assert (sl.isLoaded());
-
- GimmeFiveFunc gimmeFive = (GimmeFiveFunc) sl.getSymbol("gimmeFive");
- assert (gimmeFive() == 5);
-
- sl.unload();
- assert (!sl.isLoaded());
-}
-
-
-void SharedLibraryTest::testSharedLibrary3()
-{
- std::string path = "NonexistentLibrary";
- path.append(SharedLibrary::suffix());
- SharedLibrary sl;
- try
- {
- sl.load(path);
- failmsg("no such library - must throw exception");
- }
- catch (LibraryLoadException&)
- {
- }
- catch (...)
- {
- failmsg("wrong exception");
- }
- assert (!sl.isLoaded());
-
- path = "TestLibrary";
- path.append(SharedLibrary::suffix());
- sl.load(path);
- assert (sl.isLoaded());
-
- try
- {
- sl.load(path);
- failmsg("library already loaded - must throw exception");
- }
- catch (LibraryAlreadyLoadedException&)
- {
- }
- catch (...)
- {
- failmsg("wrong exception");
- }
- assert (sl.isLoaded());
-
- sl.unload();
- assert (!sl.isLoaded());
-}
-
-
-void SharedLibraryTest::setUp()
-{
-}
-
-
-void SharedLibraryTest::tearDown()
-{
-}
-
-
-CppUnit::Test* SharedLibraryTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SharedLibraryTest");
-
- CppUnit_addTest(pSuite, SharedLibraryTest, testSharedLibrary1);
- CppUnit_addTest(pSuite, SharedLibraryTest, testSharedLibrary2);
- CppUnit_addTest(pSuite, SharedLibraryTest, testSharedLibrary3);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTest.h b/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTest.h
deleted file mode 100755
index 0f267f73bb..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// SharedLibraryTest.h
-//
-// $Id$
-//
-// Definition of the SharedLibraryTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SharedLibraryTest_INCLUDED
-#define SharedLibraryTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class SharedLibraryTest: public CppUnit::TestCase
-{
-public:
- SharedLibraryTest(const std::string& name);
- ~SharedLibraryTest();
-
- void testSharedLibrary1();
- void testSharedLibrary2();
- void testSharedLibrary3();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // SharedLibraryTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTestSuite.cpp
deleted file mode 100755
index 7a7761eba3..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTestSuite.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// SharedLibraryTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "SharedLibraryTestSuite.h"
-#include "ClassLoaderTest.h"
-#include "ManifestTest.h"
-#include "SharedLibraryTest.h"
-
-
-CppUnit::Test* SharedLibraryTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SharedLibraryTestSuite");
-
- pSuite->addTest(SharedLibraryTest::suite());
- pSuite->addTest(ManifestTest::suite());
- pSuite->addTest(ClassLoaderTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTestSuite.h
deleted file mode 100755
index 2f7a6b8bce..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SharedLibraryTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// SharedLibraryTestSuite.h
-//
-// $Id$
-//
-// Definition of the SharedLibraryTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SharedLibraryTestSuite_INCLUDED
-#define SharedLibraryTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class SharedLibraryTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // SharedLibraryTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/SharedMemoryTest.cpp b/Utilities/Poco/Foundation/testsuite/src/SharedMemoryTest.cpp
deleted file mode 100755
index d2fcbc5500..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SharedMemoryTest.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// SharedMemoryTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2007, 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 "SharedMemoryTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/SharedMemory.h"
-#include "Poco/Path.h"
-#include "Poco/File.h"
-#include "Poco/Exception.h"
-
-
-using Poco::SharedMemory;
-
-
-SharedMemoryTest::SharedMemoryTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-SharedMemoryTest::~SharedMemoryTest()
-{
-}
-
-
-void SharedMemoryTest::testCreate()
-{
- SharedMemory mem("hi", 4096, SharedMemory::AM_WRITE);
- assert (mem.end()-mem.begin() == 4096);
- mem.begin()[0] = 'A';
- mem.end()[-1] = 'Z';
-}
-
-
-void SharedMemoryTest::testCreateFromFile()
-{
- Poco::Path p = findDataFile("testdata.txt");
- Poco::File f(p);
- assert (f.exists() && f.isFile());
- SharedMemory mem(f, SharedMemory::AM_READ);
- assert (mem.end() > mem.begin()); // valid?
- assert (mem.end() - mem.begin() == f.getSize());
- assert (mem.begin()[0] == 'A');
- assert (mem.end()[-5] == 'Z');
-}
-
-
-Poco::Path SharedMemoryTest::findDataFile(const std::string& afile)
-{
- Poco::Path root;
- root.makeAbsolute();
- Poco::Path result;
- while (!Poco::Path::find(root.toString(), "data", result))
- {
- root.makeParent();
- if (root.toString().empty() || root.toString() == "/")
- throw Poco::FileNotFoundException("Didn't find data subdir");
- }
- result.makeDirectory();
- result.setFileName(afile);
- Poco::File aFile(result.toString());
- if (!aFile.exists() || (aFile.exists() && !aFile.isFile()))
- throw Poco::FileNotFoundException("Didn't find file " + afile);
-
- return result;
-}
-
-
-void SharedMemoryTest::setUp()
-{
-}
-
-
-void SharedMemoryTest::tearDown()
-{
-}
-
-
-CppUnit::Test* SharedMemoryTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SharedMemoryTest");
-
- CppUnit_addTest(pSuite, SharedMemoryTest, testCreate);
- CppUnit_addTest(pSuite, SharedMemoryTest, testCreateFromFile);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/SharedMemoryTest.h b/Utilities/Poco/Foundation/testsuite/src/SharedMemoryTest.h
deleted file mode 100755
index f844f344f1..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SharedMemoryTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// SharedMemoryTest.h
-//
-// $Id$
-//
-// Definition of the SharedMemoryTest class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef SharedMemoryTest_INCLUDED
-#define SharedMemoryTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "Poco/Path.h"
-#include "CppUnit/TestCase.h"
-
-
-class SharedMemoryTest: public CppUnit::TestCase
-{
-public:
- SharedMemoryTest(const std::string& name);
- ~SharedMemoryTest();
-
- void testCreate();
- void testCreateFromFile();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
- static Poco::Path findDataFile(const std::string& afile);
-
-private:
-};
-
-
-#endif // SharedMemoryTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/SharedPtrTest.cpp b/Utilities/Poco/Foundation/testsuite/src/SharedPtrTest.cpp
deleted file mode 100755
index 07a769a6ea..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SharedPtrTest.cpp
+++ /dev/null
@@ -1,239 +0,0 @@
-//
-// SharedPtrTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "SharedPtrTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/SharedPtr.h"
-#include "Poco/Exception.h"
-
-
-using Poco::SharedPtr;
-using Poco::NullPointerException;
-
-
-namespace
-{
- class TestObject
- {
- public:
- TestObject(const std::string& data): _data(data)
- {
- ++_count;
- }
-
- virtual ~TestObject()
- {
- --_count;
- }
-
- const std::string& data()
- {
- return _data;
- }
-
- static int count()
- {
- return _count;
- }
-
- private:
- std::string _data;
- static int _count;
- };
-
- int TestObject::_count = 0;
-
- class DerivedObject: public TestObject
- {
- public:
- DerivedObject(const std::string& s, int i): TestObject(s), _number(i)
- {
- }
-
- int number() const
- {
- return _number;
- }
-
- private:
- int _number;
- };
-}
-
-
-SharedPtrTest::SharedPtrTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-SharedPtrTest::~SharedPtrTest()
-{
-}
-
-
-void SharedPtrTest::testSharedPtr()
-{
- SharedPtr<TestObject> ptr1;
- assertNull(ptr1.get());
- TestObject* pTO1 = new TestObject("one");
- TestObject* pTO2 = new TestObject("two");
- if (pTO2 < pTO1)
- {
- TestObject* pTmp = pTO1;
- pTO1 = pTO2;
- pTO2 = pTmp;
- }
- assert (pTO1 < pTO2);
- ptr1 = pTO1;
- assert (ptr1.referenceCount() == 1);
- SharedPtr<TestObject> ptr2 = pTO2;
- SharedPtr<TestObject> ptr3 = ptr1;
- assert (ptr1.referenceCount() == 2);
- SharedPtr<TestObject> ptr4;
- assert (ptr1.get() == pTO1);
- assert (ptr1 == pTO1);
- assert (ptr2.get() == pTO2);
- assert (ptr2 == pTO2);
- assert (ptr3.get() == pTO1);
- assert (ptr3 == pTO1);
-
- assert (ptr1 == pTO1);
- assert (ptr1 != pTO2);
- assert (ptr1 < pTO2);
- assert (ptr1 <= pTO2);
- assert (ptr2 > pTO1);
- assert (ptr2 >= pTO1);
-
- assert (ptr1 == ptr3);
- assert (ptr1 != ptr2);
- assert (ptr1 < ptr2);
- assert (ptr1 <= ptr2);
- assert (ptr2 > ptr1);
- assert (ptr2 >= ptr1);
-
- ptr1.swap(ptr2);
- assert (ptr2 < ptr1);
- ptr2.swap(ptr1);
-
- assert (ptr1->data() == "one" && ptr2->data() == "two" || ptr1->data() == "two" && ptr2->data() == "one");
-
- try
- {
- assert (ptr4->data() == "four");
- fail ("must throw NullPointerException");
- }
- catch (NullPointerException&)
- {
- }
-
- assert (!(ptr4 == ptr1));
- assert (!(ptr4 == ptr2));
- assert (ptr4 != ptr1);
- assert (ptr4 != ptr2);
-
- ptr4 = ptr2;
- assert (ptr4 == ptr2);
- assert (!(ptr4 != ptr2));
-
- assert (TestObject::count() == 2);
- ptr1 = 0;
- ptr2 = 0;
- ptr3 = 0;
- ptr4 = 0;
- assert (TestObject::count() == 0);
-
- {
- SharedPtr<TestObject> ptr = new TestObject("");
- assert (TestObject::count() == 1);
- }
- assert (TestObject::count() == 0);
-}
-
-
-void SharedPtrTest::testImplicitCast()
-{
- {
- // null assign test
- SharedPtr<DerivedObject> ptr2;
- assertNull(ptr2.get());
- SharedPtr<TestObject> ptr1 = ptr2;
- }
- {
- SharedPtr<DerivedObject> ptr2(new DerivedObject("test", 666));
- assert (TestObject::count() == 1);
- SharedPtr<TestObject> ptr1 = ptr2;
- assert (TestObject::count() == 1);
- }
- assert (TestObject::count() == 0);
- SharedPtr<TestObject> ptr1 = new DerivedObject("test", 666);
- assert (TestObject::count() == 1);
- ptr1 = 0;
- assert (TestObject::count() == 0);
-}
-
-
-void SharedPtrTest::testExplicitCast()
-{
- SharedPtr<TestObject> ptr1 = new DerivedObject("test", 666);
- SharedPtr<DerivedObject> ptr2 = ptr1.cast<DerivedObject>();
- assert (ptr2.get() != 0);
-
- // cast the other way round must fail
- ptr1 = new TestObject("test");
- assert (TestObject::count() == 2);
- ptr2 = ptr1.cast<DerivedObject>();
- assert (TestObject::count() == 1);
- assert (ptr2.get() == 0);
-}
-
-
-void SharedPtrTest::setUp()
-{
-}
-
-
-void SharedPtrTest::tearDown()
-{
-}
-
-
-CppUnit::Test* SharedPtrTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SharedPtrTest");
-
- CppUnit_addTest(pSuite, SharedPtrTest, testSharedPtr);
- CppUnit_addTest(pSuite, SharedPtrTest, testImplicitCast);
- CppUnit_addTest(pSuite, SharedPtrTest, testExplicitCast);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/SharedPtrTest.h b/Utilities/Poco/Foundation/testsuite/src/SharedPtrTest.h
deleted file mode 100755
index 7d7a30a83b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SharedPtrTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// SharedPtrTest.h
-//
-// $Id$
-//
-// Definition of the SharedPtrTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SharedPtrTest_INCLUDED
-#define SharedPtrTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class SharedPtrTest: public CppUnit::TestCase
-{
-public:
- SharedPtrTest(const std::string& name);
- ~SharedPtrTest();
-
- void testSharedPtr();
-
- void testImplicitCast();
- void testExplicitCast();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // SharedPtrTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/SimpleFileChannelTest.cpp b/Utilities/Poco/Foundation/testsuite/src/SimpleFileChannelTest.cpp
deleted file mode 100755
index 5791d672f6..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SimpleFileChannelTest.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// SimpleFileChannelTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2005-2006, 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/SimpleFileChannel.h"
-#include "Poco/Message.h"
-#include "Poco/Path.h"
-#include "Poco/File.h"
-#include "Poco/DirectoryIterator.h"
-#include "Poco/Timestamp.h"
-#include "Poco/DateTimeFormatter.h"
-#include "Poco/AutoPtr.h"
-#include "SimpleFileChannelTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-
-
-using Poco::SimpleFileChannel;
-using Poco::Message;
-using Poco::Path;
-using Poco::File;
-using Poco::DirectoryIterator;
-using Poco::Timestamp;
-using Poco::DateTimeFormatter;
-using Poco::AutoPtr;
-
-
-SimpleFileChannelTest::SimpleFileChannelTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-SimpleFileChannelTest::~SimpleFileChannelTest()
-{
-}
-
-
-void SimpleFileChannelTest::testRotate()
-{
- std::string name = filename();
- try
- {
- AutoPtr<SimpleFileChannel> pChannel = new SimpleFileChannel(name);
- pChannel->setProperty(SimpleFileChannel::PROP_ROTATION, "2 K");
- pChannel->open();
- Message msg("source", "This is a log file entry", Message::PRIO_INFORMATION);
- for (int i = 0; i < 200; ++i)
- {
- pChannel->log(msg);
- }
- File f(name);
- assert (f.exists());
- f = name + ".0";
- assert (f.exists());
- assert (f.getSize() >= 2048);
- }
- catch (...)
- {
- remove(name);
- throw;
- }
- remove(name);
-}
-
-
-void SimpleFileChannelTest::setUp()
-{
-}
-
-
-void SimpleFileChannelTest::tearDown()
-{
-}
-
-
-void SimpleFileChannelTest::remove(const std::string& baseName)
-{
- DirectoryIterator it(Path::current());
- DirectoryIterator end;
- std::vector<std::string> files;
- while (it != end)
- {
- if (it.name().find(baseName) == 0)
- {
- files.push_back(it.name());
- }
- ++it;
- }
- for (std::vector<std::string>::iterator it = files.begin(); it != files.end(); ++it)
- {
- try
- {
- File f(*it);
- f.remove();
- }
- catch (...)
- {
- }
- }
-}
-
-
-std::string SimpleFileChannelTest::filename() const
-{
- std::string name = "log_";
- name.append(DateTimeFormatter::format(Timestamp(), "%Y%m%d%H%M%S"));
- name.append(".log");
- return name;
-}
-
-
-CppUnit::Test* SimpleFileChannelTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SimpleFileChannelTest");
-
- CppUnit_addTest(pSuite, SimpleFileChannelTest, testRotate);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/SimpleFileChannelTest.h b/Utilities/Poco/Foundation/testsuite/src/SimpleFileChannelTest.h
deleted file mode 100755
index b57c640330..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SimpleFileChannelTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// SimpleFileChannelTest.h
-//
-// $Id$
-//
-// Definition of the SimpleFileChannelTest class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef SimpleFileChannelTest_INCLUDED
-#define SimpleFileChannelTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class SimpleFileChannelTest: public CppUnit::TestCase
-{
-public:
- SimpleFileChannelTest(const std::string& name);
- ~SimpleFileChannelTest();
-
- void testRotate();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
- void remove(const std::string& baseName);
- std::string filename() const;
-};
-
-
-#endif // SimpleFileChannelTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/SimpleHashTableTest.cpp b/Utilities/Poco/Foundation/testsuite/src/SimpleHashTableTest.cpp
deleted file mode 100755
index 23a47ea4bc..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SimpleHashTableTest.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-//
-// SimpleHashTableTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "SimpleHashTableTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/SimpleHashTable.h"
-#include "Poco/NumberFormatter.h"
-
-
-using namespace Poco;
-
-
-SimpleHashTableTest::SimpleHashTableTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-SimpleHashTableTest::~SimpleHashTableTest()
-{
-}
-
-
-void SimpleHashTableTest::testInsert()
-{
- std::string s1("str1");
- std::string s2("str2");
- SimpleHashTable<std::string, int> hashTable;
- assert (!hashTable.exists(s1));
- hashTable.insert(s1, 13);
- assert (hashTable.exists(s1));
- assert (hashTable.get(s1) == 13);
- int retVal = 0;
-
- assert (hashTable.get(s1, retVal));
- assert (retVal == 13);
- try
- {
- hashTable.insert(s1, 22);
- failmsg ("duplicate insert must fail");
- }
- catch (Exception&){}
- try
- {
- hashTable.get(s2);
- failmsg ("getting a non inserted item must fail");
- }
- catch (Exception&){}
-
- assert (!hashTable.exists(s2));
- hashTable.insert(s2, 13);
- assert (hashTable.exists(s2));
-}
-
-
-void SimpleHashTableTest::testUpdate()
-{
- // add code for second test here
- std::string s1("str1");
- std::string s2("str2");
- SimpleHashTable<std::string, int> hashTable;
- hashTable.insert(s1, 13);
- hashTable.update(s1, 14);
- assert (hashTable.exists(s1));
- assert (hashTable.get(s1) == 14);
- int retVal = 0;
-
- assert (hashTable.get(s1, retVal));
- assert (retVal == 14);
-
- // updating a non existing item must work too
- hashTable.update(s2, 15);
- assert (hashTable.get(s2) == 15);
-}
-
-
-void SimpleHashTableTest::testOverflow()
-{
- SimpleHashTable<std::string, int> hashTable(31);
- for (int i = 0; i < 31; ++i)
- {
- hashTable.insert(Poco::NumberFormatter::format(i), i*i);
- }
-
- for (int i = 0; i < 31; ++i)
- {
- std::string tmp = Poco::NumberFormatter::format(i);
- assert (hashTable.exists(tmp));
- assert (hashTable.get(tmp) == i*i);
- }
-}
-
-
-void SimpleHashTableTest::testSize()
-{
- SimpleHashTable<std::string, int> hashTable(13);
- assert (hashTable.size() == 0);
- Poco::UInt32 h1 = hashTable.insert("1", 1);
- assert (hashTable.size() == 1);
- Poco::UInt32 h2 = hashTable.update("2", 2);
- assert (hashTable.size() == 2);
- hashTable.clear();
- assert (hashTable.size() == 0);
-}
-
-
-void SimpleHashTableTest::testResize()
-{
- SimpleHashTable<std::string, int> hashTable(13);
- assert (hashTable.size() == 0);
- hashTable.resize(2467);
- for (int i = 0; i < 1024; ++i)
- {
- hashTable.insert(Poco::NumberFormatter::format(i), i*i);
- }
- hashTable.resize(3037);
-
- for (int i = 0; i < 1024; ++i)
- {
- std::string tmp = Poco::NumberFormatter::format(i);
- assert (hashTable.exists(tmp));
- assert (hashTable.get(tmp) == i*i);
- }
-}
-
-
-void SimpleHashTableTest::setUp()
-{
-}
-
-
-void SimpleHashTableTest::tearDown()
-{
-}
-
-
-CppUnit::Test* SimpleHashTableTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SimpleHashTableTest");
-
- CppUnit_addTest(pSuite, SimpleHashTableTest, testInsert);
- CppUnit_addTest(pSuite, SimpleHashTableTest, testUpdate);
- CppUnit_addTest(pSuite, SimpleHashTableTest, testOverflow);
- CppUnit_addTest(pSuite, SimpleHashTableTest, testSize);
- CppUnit_addTest(pSuite, SimpleHashTableTest, testResize);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/SimpleHashTableTest.h b/Utilities/Poco/Foundation/testsuite/src/SimpleHashTableTest.h
deleted file mode 100755
index 2658356689..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/SimpleHashTableTest.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// SimpleHashTableTest.h
-//
-// $Id$
-//
-// Definition of the SimpleHashTableTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef SimpleHashTableTest_INCLUDED
-#define SimpleHashTableTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class SimpleHashTableTest: public CppUnit::TestCase
-{
-public:
- SimpleHashTableTest(const std::string& name);
- ~SimpleHashTableTest();
-
- void testInsert();
- void testOverflow();
- void testUpdate();
- void testSize();
- void testResize();
- void testStatistic();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // SimpleHashTableTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/StopwatchTest.cpp b/Utilities/Poco/Foundation/testsuite/src/StopwatchTest.cpp
deleted file mode 100755
index 08d77de9ad..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StopwatchTest.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// StopwatchTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "StopwatchTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Stopwatch.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Thread.h"
-
-
-using Poco::Stopwatch;
-using Poco::Timestamp;
-using Poco::Thread;
-
-
-StopwatchTest::StopwatchTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-StopwatchTest::~StopwatchTest()
-{
-}
-
-
-void StopwatchTest::testStopwatch()
-{
- Stopwatch sw;
- sw.start();
- Thread::sleep(200);
- sw.stop();
- Timestamp::TimeDiff d = sw.elapsed();
- assert (d >= 180000 && d <= 300000);
- sw.start();
- Thread::sleep(100);
- d = sw.elapsed();
- assert (d >= 280000 && d <= 400000);
- Thread::sleep(100);
- sw.stop();
- d = sw.elapsed();
- assert (d >= 380000 && d <= 500000);
- sw.reset();
- sw.start();
- Thread::sleep(200);
- sw.stop();
- d = sw.elapsed();
- assert (d >= 180000 && d <= 300000);
-}
-
-
-void StopwatchTest::setUp()
-{
-}
-
-
-void StopwatchTest::tearDown()
-{
-}
-
-
-CppUnit::Test* StopwatchTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("StopwatchTest");
-
- CppUnit_addTest(pSuite, StopwatchTest, testStopwatch);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/StopwatchTest.h b/Utilities/Poco/Foundation/testsuite/src/StopwatchTest.h
deleted file mode 100755
index e9703af035..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StopwatchTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// StopwatchTest.h
-//
-// $Id$
-//
-// Definition of the StopwatchTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef StopwatchTest_INCLUDED
-#define StopwatchTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class StopwatchTest: public CppUnit::TestCase
-{
-public:
- StopwatchTest(const std::string& name);
- ~StopwatchTest();
-
- void testStopwatch();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // StopwatchTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/StreamConverterTest.cpp b/Utilities/Poco/Foundation/testsuite/src/StreamConverterTest.cpp
deleted file mode 100755
index 7c544464ae..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StreamConverterTest.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-//
-// StreamConverterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "StreamConverterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/StreamConverter.h"
-#include "Poco/ASCIIEncoding.h"
-#include "Poco/Latin1Encoding.h"
-#include "Poco/UTF8Encoding.h"
-#include "Poco/StreamCopier.h"
-#include <sstream>
-
-
-using Poco::InputStreamConverter;
-using Poco::OutputStreamConverter;
-using Poco::Latin1Encoding;
-using Poco::UTF8Encoding;
-using Poco::ASCIIEncoding;
-using Poco::StreamCopier;
-
-
-StreamConverterTest::StreamConverterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-StreamConverterTest::~StreamConverterTest()
-{
-}
-
-
-void StreamConverterTest::testIdentityASCIIIn()
-{
- ASCIIEncoding encoding;
-
- std::istringstream istr1("");
- std::ostringstream ostr1;
- InputStreamConverter converter1(istr1, encoding, encoding);
- StreamCopier::copyStream(converter1, ostr1);
- assert (ostr1.str() == "");
- assert (converter1.errors() == 0);
-
- std::istringstream istr2("foo bar");
- std::ostringstream ostr2;
- InputStreamConverter converter2(istr2, encoding, encoding);
- StreamCopier::copyStream(converter2, ostr2);
- assert (ostr2.str() == "foo bar");
- assert (converter2.errors() == 0);
-
- std::istringstream istr3("x");
- std::ostringstream ostr3;
- InputStreamConverter converter3(istr3, encoding, encoding);
- StreamCopier::copyStream(converter3, ostr3);
- assert (ostr3.str() == "x");
- assert (converter3.errors() == 0);
-}
-
-
-void StreamConverterTest::testIdentityASCIIOut()
-{
- ASCIIEncoding encoding;
-
- std::ostringstream ostr1;
- OutputStreamConverter converter1(ostr1, encoding, encoding);
- converter1 << "";
- assert (ostr1.str() == "");
- assert (converter1.errors() == 0);
-
- std::ostringstream ostr2;
- OutputStreamConverter converter2(ostr2, encoding, encoding);
- converter2 << "foo bar";
- assert (ostr2.str() == "foo bar");
- assert (converter2.errors() == 0);
-
- std::ostringstream ostr3;
- OutputStreamConverter converter3(ostr3, encoding, encoding);
- converter3 << "x";
- assert (ostr3.str() == "x");
- assert (converter3.errors() == 0);
-}
-
-
-void StreamConverterTest::testIdentityUTF8In()
-{
- UTF8Encoding encoding;
-
- std::istringstream istr1("");
- std::ostringstream ostr1;
- InputStreamConverter converter1(istr1, encoding, encoding);
- StreamCopier::copyStream(converter1, ostr1);
- assert (ostr1.str() == "");
- assert (converter1.errors() == 0);
-
- std::istringstream istr2("foo bar");
- std::ostringstream ostr2;
- InputStreamConverter converter2(istr2, encoding, encoding);
- StreamCopier::copyStream(converter2, ostr2);
- assert (ostr2.str() == "foo bar");
- assert (converter2.errors() == 0);
-
- std::istringstream istr3("x");
- std::ostringstream ostr3;
- InputStreamConverter converter3(istr3, encoding, encoding);
- StreamCopier::copyStream(converter3, ostr3);
- assert (ostr3.str() == "x");
- assert (converter3.errors() == 0);
-
- const unsigned char greek[] = {0x20, 0xce, 0xba, 0xe1, 0xbd, 0xb9, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5, 0x20, 0x00};
- std::string text((const char*) greek);
-
- std::istringstream istr4(text);
- std::ostringstream ostr4;
- InputStreamConverter converter4(istr4, encoding, encoding);
- StreamCopier::copyStream(converter4, ostr4);
- assert (ostr4.str() == text);
- assert (converter4.errors() == 0);
-}
-
-
-void StreamConverterTest::testIdentityUTF8Out()
-{
- UTF8Encoding encoding;
-
- std::ostringstream ostr1;
- OutputStreamConverter converter1(ostr1, encoding, encoding);
- converter1 << "";
- assert (ostr1.str() == "");
- assert (converter1.errors() == 0);
-
- std::ostringstream ostr2;
- OutputStreamConverter converter2(ostr2, encoding, encoding);
- converter2 << "foo bar";
- assert (ostr2.str() == "foo bar");
- assert (converter2.errors() == 0);
-
- std::ostringstream ostr3;
- OutputStreamConverter converter3(ostr3, encoding, encoding);
- converter3 << "x";
- assert (ostr3.str() == "x");
- assert (converter3.errors() == 0);
-
- const unsigned char greek[] = {0x20, 0xce, 0xba, 0xe1, 0xbd, 0xb9, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5, 0x20, 0x00};
- std::string text((const char*) greek);
-
- std::ostringstream ostr4;
- OutputStreamConverter converter4(ostr4, encoding, encoding);
- converter4 << text;
- assert (ostr4.str() == text);
- assert (converter4.errors() == 0);
-}
-
-
-void StreamConverterTest::testUTF8toASCIIIn()
-{
- UTF8Encoding utf8Encoding;
- ASCIIEncoding asciiEncoding;
-
- const unsigned char greek[] = {0x20, 0xce, 0xba, 0xe1, 0xbd, 0xb9, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5, 0x20, 0x41, 0x42, 0x00};
- std::string text((const char*) greek);
-
- std::istringstream istr1(text);
- std::ostringstream ostr1;
- InputStreamConverter converter1(istr1, utf8Encoding, asciiEncoding);
- StreamCopier::copyStream(converter1, ostr1);
- assert (ostr1.str() == " ????? AB");
- assert (converter1.errors() == 0);
-
- std::istringstream istr2("abcde");
- std::ostringstream ostr2;
- InputStreamConverter converter2(istr2, utf8Encoding, asciiEncoding);
- StreamCopier::copyStream(converter2, ostr2);
- assert (ostr2.str() == "abcde");
- assert (converter2.errors() == 0);
-}
-
-
-void StreamConverterTest::testUTF8toASCIIOut()
-{
- UTF8Encoding utf8Encoding;
- ASCIIEncoding asciiEncoding;
-
- const unsigned char greek[] = {0x20, 0xce, 0xba, 0xe1, 0xbd, 0xb9, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5, 0x20, 0x41, 0x42, 0x00};
- std::string text((const char*) greek);
-
- std::ostringstream ostr1;
- OutputStreamConverter converter1(ostr1, utf8Encoding, asciiEncoding);
- converter1 << text;
- assert (ostr1.str() == " ????? AB");
- assert (converter1.errors() == 0);
-
- std::ostringstream ostr2;
- OutputStreamConverter converter2(ostr2, utf8Encoding, asciiEncoding);
- converter2 << "abcde";
- assert (ostr2.str() == "abcde");
- assert (converter2.errors() == 0);
-}
-
-
-void StreamConverterTest::testLatin1toUTF8In()
-{
- UTF8Encoding utf8Encoding;
- Latin1Encoding latin1Encoding;
-
- const unsigned char latin1Chars[] = {'g', 252, 'n', 't', 'e', 'r', 0};
- const unsigned char utf8Chars[] = {'g', 195, 188, 'n', 't', 'e', 'r', 0};
- std::string latin1Text((const char*) latin1Chars);
- std::string utf8Text((const char*) utf8Chars);
-
- std::istringstream istr1(latin1Text);
- std::ostringstream ostr1;
- InputStreamConverter converter1(istr1, latin1Encoding, utf8Encoding);
- StreamCopier::copyStream(converter1, ostr1);
- assert (ostr1.str() == utf8Text);
- assert (converter1.errors() == 0);
-}
-
-
-void StreamConverterTest::testLatin1toUTF8Out()
-{
- UTF8Encoding utf8Encoding;
- Latin1Encoding latin1Encoding;
-
- const unsigned char latin1Chars[] = {'g', 252, 'n', 't', 'e', 'r', 0};
- const unsigned char utf8Chars[] = {'g', 195, 188, 'n', 't', 'e', 'r', 0};
- std::string latin1Text((const char*) latin1Chars);
- std::string utf8Text((const char*) utf8Chars);
-
- std::ostringstream ostr1;
- OutputStreamConverter converter1(ostr1, latin1Encoding, utf8Encoding);
- converter1 << latin1Text;
- assert (ostr1.str() == utf8Text);
- assert (converter1.errors() == 0);
-}
-
-
-void StreamConverterTest::testErrorsIn()
-{
- UTF8Encoding utf8Encoding;
- Latin1Encoding latin1Encoding;
-
- const unsigned char badChars[] = {'a', 'b', 255, 'c', 254, 0};
- std::string badText((const char*) badChars);
-
- std::istringstream istr1(badText);
- std::ostringstream ostr1;
- InputStreamConverter converter1(istr1, utf8Encoding, latin1Encoding);
- StreamCopier::copyStream(converter1, ostr1);
- assert (converter1.errors() == 2);
-}
-
-
-void StreamConverterTest::testErrorsOut()
-{
- UTF8Encoding utf8Encoding;
- Latin1Encoding latin1Encoding;
-
- const unsigned char badChars[] = {'a', 'b', 255, 'c', 254, 0};
- std::string badText((const char*) badChars);
-
- std::ostringstream ostr1;
- OutputStreamConverter converter1(ostr1, utf8Encoding, latin1Encoding);
- converter1 << badText;
- assert (converter1.errors() == 1);
-}
-
-
-void StreamConverterTest::setUp()
-{
-}
-
-
-void StreamConverterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* StreamConverterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("StreamConverterTest");
-
- CppUnit_addTest(pSuite, StreamConverterTest, testIdentityASCIIIn);
- CppUnit_addTest(pSuite, StreamConverterTest, testIdentityASCIIOut);
- CppUnit_addTest(pSuite, StreamConverterTest, testIdentityUTF8In);
- CppUnit_addTest(pSuite, StreamConverterTest, testIdentityUTF8Out);
- CppUnit_addTest(pSuite, StreamConverterTest, testUTF8toASCIIIn);
- CppUnit_addTest(pSuite, StreamConverterTest, testUTF8toASCIIOut);
- CppUnit_addTest(pSuite, StreamConverterTest, testLatin1toUTF8In);
- CppUnit_addTest(pSuite, StreamConverterTest, testLatin1toUTF8Out);
- CppUnit_addTest(pSuite, StreamConverterTest, testErrorsIn);
- CppUnit_addTest(pSuite, StreamConverterTest, testErrorsOut);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/StreamConverterTest.h b/Utilities/Poco/Foundation/testsuite/src/StreamConverterTest.h
deleted file mode 100755
index fd094bdf55..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StreamConverterTest.h
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// StreamConverterTest.h
-//
-// $Id$
-//
-// Definition of the StreamConverterTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef StreamConverterTest_INCLUDED
-#define StreamConverterTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class StreamConverterTest: public CppUnit::TestCase
-{
-public:
- StreamConverterTest(const std::string& name);
- ~StreamConverterTest();
-
- void testIdentityASCIIIn();
- void testIdentityASCIIOut();
- void testIdentityUTF8In();
- void testIdentityUTF8Out();
- void testUTF8toASCIIIn();
- void testUTF8toASCIIOut();
- void testLatin1toUTF8In();
- void testLatin1toUTF8Out();
- void testErrorsIn();
- void testErrorsOut();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // StreamConverterTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/StreamCopierTest.cpp b/Utilities/Poco/Foundation/testsuite/src/StreamCopierTest.cpp
deleted file mode 100755
index d30fa08428..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StreamCopierTest.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-//
-// StreamCopierTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "StreamCopierTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/StreamCopier.h"
-#include <sstream>
-
-
-using Poco::StreamCopier;
-
-
-StreamCopierTest::StreamCopierTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-StreamCopierTest::~StreamCopierTest()
-{
-}
-
-
-void StreamCopierTest::testBufferedCopy()
-{
- {
- std::string src;
- for (int i = 0; i < 255; ++i) src += char(i);
- std::istringstream istr(src);
- std::ostringstream ostr;
- StreamCopier::copyStream(istr, ostr);
- assert (ostr.str() == src);
- }
- {
- std::string src;
- for (int i = 0; i < 512; ++i) src += char(i % 256);
- std::istringstream istr(src);
- std::ostringstream ostr;
- StreamCopier::copyStream(istr, ostr, 100);
- assert (ostr.str() == src);
- }
- {
- std::string src;
- for (int i = 0; i < 512; ++i) src += char(i % 256);
- std::istringstream istr(src);
- std::ostringstream ostr;
- StreamCopier::copyStream(istr, ostr, 128);
- assert (ostr.str() == src);
- }
- {
- std::string src;
- for (int i = 0; i < 512; ++i) src += char(i % 256);
- std::istringstream istr(src);
- std::ostringstream ostr;
- StreamCopier::copyStream(istr, ostr, 512);
- assert (ostr.str() == src);
- }
-}
-
-
-void StreamCopierTest::testUnbufferedCopy()
-{
- std::string src;
- for (int i = 0; i < 255; ++i) src += char(i);
- std::istringstream istr(src);
- std::ostringstream ostr;
- StreamCopier::copyStreamUnbuffered(istr, ostr);
- assert (ostr.str() == src);
-}
-
-
-void StreamCopierTest::testCopyToString()
-{
- std::string src;
- for (int i = 0; i < 512; ++i) src += char(i % 256);
- std::istringstream istr(src);
- std::string dest;
- StreamCopier::copyToString(istr, dest, 100);
- assert (src == dest);
-}
-
-
-void StreamCopierTest::setUp()
-{
-}
-
-
-void StreamCopierTest::tearDown()
-{
-}
-
-
-CppUnit::Test* StreamCopierTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("StreamCopierTest");
-
- CppUnit_addTest(pSuite, StreamCopierTest, testBufferedCopy);
- CppUnit_addTest(pSuite, StreamCopierTest, testUnbufferedCopy);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/StreamCopierTest.h b/Utilities/Poco/Foundation/testsuite/src/StreamCopierTest.h
deleted file mode 100755
index d03c396763..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StreamCopierTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// StreamCopierTest.h
-//
-// $Id$
-//
-// Definition of the StreamCopierTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef StreamCopierTest_INCLUDED
-#define StreamCopierTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class StreamCopierTest: public CppUnit::TestCase
-{
-public:
- StreamCopierTest(const std::string& name);
- ~StreamCopierTest();
-
- void testBufferedCopy();
- void testUnbufferedCopy();
- void testCopyToString();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // StreamCopierTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/StreamTokenizerTest.cpp b/Utilities/Poco/Foundation/testsuite/src/StreamTokenizerTest.cpp
deleted file mode 100755
index fce1361473..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StreamTokenizerTest.cpp
+++ /dev/null
@@ -1,310 +0,0 @@
-//
-// StreamTokenizerTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "StreamTokenizerTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/StreamTokenizer.h"
-#include "Poco/Token.h"
-#include <cctype>
-#include <sstream>
-
-
-using Poco::StreamTokenizer;
-using Poco::Token;
-using Poco::InvalidToken;
-using Poco::EOFToken;
-using Poco::WhitespaceToken;
-
-
-class IdentifierToken: public Token
-{
-public:
- IdentifierToken()
- {
- }
-
- ~IdentifierToken()
- {
- }
-
- Class tokenClass() const
- {
- return Token::IDENTIFIER_TOKEN;
- }
-
- bool start(char c, std::istream& istr)
- {
- if (std::isalpha(c))
- {
- _value = c;
- return true;
- }
- else return false;
- }
-
- void finish(std::istream& istr)
- {
- int c = istr.peek();
- while (std::isalnum(c))
- {
- istr.get();
- _value += c;
- c = istr.peek();
- }
- }
-};
-
-
-class IntLiteralToken: public Token
-{
-public:
- IntLiteralToken()
- {
- }
-
- ~IntLiteralToken()
- {
- }
-
- Class tokenClass() const
- {
- return Token::INTEGER_LITERAL_TOKEN;
- }
-
- bool start(char c, std::istream& istr)
- {
- if (std::isdigit(c))
- {
- _value = c;
- return true;
- }
- else return false;
- }
-
- void finish(std::istream& istr)
- {
- int c = istr.peek();
- while (std::isdigit(c))
- {
- istr.get();
- _value += c;
- c = istr.peek();
- }
- }
-};
-
-
-StreamTokenizerTest::StreamTokenizerTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-StreamTokenizerTest::~StreamTokenizerTest()
-{
-}
-
-
-void StreamTokenizerTest::testTokenizer1()
-{
- std::string data = "";
- std::istringstream istr(data);
- StreamTokenizer tokenizer(istr);
- tokenizer.addToken(new WhitespaceToken());
- tokenizer.addToken(new IdentifierToken());
- tokenizer.addToken(new IntLiteralToken());
-
- const Token* next = tokenizer.next();
- assert (next->tokenClass() == Token::EOF_TOKEN);
-}
-
-
-void StreamTokenizerTest::testTokenizer2()
-{
- std::string data = "foo";
- std::istringstream istr(data);
- StreamTokenizer tokenizer(istr);
- tokenizer.addToken(new WhitespaceToken());
- tokenizer.addToken(new IdentifierToken());
- tokenizer.addToken(new IntLiteralToken());
-
- const Token* next = tokenizer.next();
- assert (next->tokenClass() == Token::IDENTIFIER_TOKEN);
- assert (next->tokenString() == "foo");
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::EOF_TOKEN);
-}
-
-
-void StreamTokenizerTest::testTokenizer3()
-{
- std::string data = "foo bar";
- std::istringstream istr(data);
- StreamTokenizer tokenizer(istr);
- tokenizer.addToken(new WhitespaceToken());
- tokenizer.addToken(new IdentifierToken());
- tokenizer.addToken(new IntLiteralToken());
-
- const Token* next = tokenizer.next();
- assert (next->tokenClass() == Token::IDENTIFIER_TOKEN);
- assert (next->tokenString() == "foo");
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::IDENTIFIER_TOKEN);
- assert (next->tokenString() == "bar");
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::EOF_TOKEN);
-}
-
-
-void StreamTokenizerTest::testTokenizer4()
-{
- std::string data = "foo 123";
- std::istringstream istr(data);
- StreamTokenizer tokenizer(istr);
- tokenizer.addToken(new WhitespaceToken());
- tokenizer.addToken(new IdentifierToken());
- tokenizer.addToken(new IntLiteralToken());
-
- const Token* next = tokenizer.next();
- assert (next->tokenClass() == Token::IDENTIFIER_TOKEN);
- assert (next->tokenString() == "foo");
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::INTEGER_LITERAL_TOKEN);
- assert (next->asInteger() == 123);
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::EOF_TOKEN);
-}
-
-
-void StreamTokenizerTest::testTokenizer5()
-{
- std::string data = "foo # 123";
- std::istringstream istr(data);
- StreamTokenizer tokenizer(istr);
- tokenizer.addToken(new WhitespaceToken());
- tokenizer.addToken(new IdentifierToken());
- tokenizer.addToken(new IntLiteralToken());
-
- const Token* next = tokenizer.next();
- assert (next->tokenClass() == Token::IDENTIFIER_TOKEN);
- assert (next->tokenString() == "foo");
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::INVALID_TOKEN);
- assert (next->tokenString() == "#");
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::INTEGER_LITERAL_TOKEN);
- assert (next->asInteger() == 123);
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::EOF_TOKEN);
-}
-
-
-void StreamTokenizerTest::testTokenizer6()
-{
- std::string data = "foo 123 #";
- std::istringstream istr(data);
- StreamTokenizer tokenizer(istr);
- tokenizer.addToken(new WhitespaceToken());
- tokenizer.addToken(new IdentifierToken());
- tokenizer.addToken(new IntLiteralToken());
-
- const Token* next = tokenizer.next();
- assert (next->tokenClass() == Token::IDENTIFIER_TOKEN);
- assert (next->tokenString() == "foo");
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::INTEGER_LITERAL_TOKEN);
- assert (next->asInteger() == 123);
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::INVALID_TOKEN);
- assert (next->tokenString() == "#");
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::EOF_TOKEN);
-}
-
-
-void StreamTokenizerTest::testTokenizer7()
-{
- std::string data = " foo 123 ";
- std::istringstream istr(data);
- StreamTokenizer tokenizer(istr);
- tokenizer.addToken(new WhitespaceToken());
- tokenizer.addToken(new IdentifierToken());
- tokenizer.addToken(new IntLiteralToken());
-
- const Token* next = tokenizer.next();
- assert (next->tokenClass() == Token::IDENTIFIER_TOKEN);
- assert (next->tokenString() == "foo");
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::INTEGER_LITERAL_TOKEN);
- assert (next->asInteger() == 123);
-
- next = tokenizer.next();
- assert (next->tokenClass() == Token::EOF_TOKEN);
-}
-
-
-void StreamTokenizerTest::setUp()
-{
-}
-
-
-void StreamTokenizerTest::tearDown()
-{
-}
-
-
-CppUnit::Test* StreamTokenizerTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("StreamTokenizerTest");
-
- CppUnit_addTest(pSuite, StreamTokenizerTest, testTokenizer1);
- CppUnit_addTest(pSuite, StreamTokenizerTest, testTokenizer2);
- CppUnit_addTest(pSuite, StreamTokenizerTest, testTokenizer3);
- CppUnit_addTest(pSuite, StreamTokenizerTest, testTokenizer4);
- CppUnit_addTest(pSuite, StreamTokenizerTest, testTokenizer5);
- CppUnit_addTest(pSuite, StreamTokenizerTest, testTokenizer6);
- CppUnit_addTest(pSuite, StreamTokenizerTest, testTokenizer7);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/StreamTokenizerTest.h b/Utilities/Poco/Foundation/testsuite/src/StreamTokenizerTest.h
deleted file mode 100755
index a866bb5cc3..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StreamTokenizerTest.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// StreamTokenizerTest.h
-//
-// $Id$
-//
-// Definition of the StreamTokenizerTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef StreamTokenizerTest_INCLUDED
-#define StreamTokenizerTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class StreamTokenizerTest: public CppUnit::TestCase
-{
-public:
- StreamTokenizerTest(const std::string& name);
- ~StreamTokenizerTest();
-
- void testTokenizer1();
- void testTokenizer2();
- void testTokenizer3();
- void testTokenizer4();
- void testTokenizer5();
- void testTokenizer6();
- void testTokenizer7();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // StreamTokenizerTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/StreamsTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/StreamsTestSuite.cpp
deleted file mode 100755
index a06f99f5f0..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StreamsTestSuite.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// StreamsTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "StreamsTestSuite.h"
-#include "Base64Test.h"
-#include "HexBinaryTest.h"
-#include "StreamCopierTest.h"
-#include "CountingStreamTest.h"
-#include "NullStreamTest.h"
-#include "ZLibTest.h"
-#include "StreamTokenizerTest.h"
-#include "BinaryReaderWriterTest.h"
-#include "LineEndingConverterTest.h"
-#include "TeeStreamTest.h"
-#include "FileStreamTest.h"
-
-
-CppUnit::Test* StreamsTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("StreamsTestSuite");
-
- pSuite->addTest(Base64Test::suite());
- pSuite->addTest(HexBinaryTest::suite());
- pSuite->addTest(StreamCopierTest::suite());
- pSuite->addTest(CountingStreamTest::suite());
- pSuite->addTest(NullStreamTest::suite());
- pSuite->addTest(ZLibTest::suite());
- pSuite->addTest(StreamTokenizerTest::suite());
- pSuite->addTest(BinaryReaderWriterTest::suite());
- pSuite->addTest(LineEndingConverterTest::suite());
- pSuite->addTest(TeeStreamTest::suite());
- pSuite->addTest(FileStreamTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/StreamsTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/StreamsTestSuite.h
deleted file mode 100755
index 551a8af13d..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StreamsTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// StreamsTestSuite.h
-//
-// $Id$
-//
-// Definition of the StreamsTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef StreamsTestSuite_INCLUDED
-#define StreamsTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class StreamsTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // StreamsTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/StringTest.cpp b/Utilities/Poco/Foundation/testsuite/src/StringTest.cpp
deleted file mode 100755
index d07ff4c877..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StringTest.cpp
+++ /dev/null
@@ -1,380 +0,0 @@
-//
-// StringTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "StringTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/String.h"
-
-
-using Poco::trimLeft;
-using Poco::trimLeftInPlace;
-using Poco::trimRight;
-using Poco::trimRightInPlace;
-using Poco::trim;
-using Poco::trimInPlace;
-using Poco::toUpper;
-using Poco::toUpperInPlace;
-using Poco::toLower;
-using Poco::toLowerInPlace;
-using Poco::icompare;
-using Poco::translate;
-using Poco::translateInPlace;
-using Poco::replace;
-using Poco::replaceInPlace;
-using Poco::cat;
-
-
-StringTest::StringTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-StringTest::~StringTest()
-{
-}
-
-
-void StringTest::testTrimLeft()
-{
- {
- std::string s = "abc";
- assert (trimLeft(s) == "abc");
- }
- std::string s = " abc ";
- assert (trimLeft(s) == "abc ");
- {
- std::string s = " ab c ";
- assert (trimLeft(s) == "ab c ");
- }
-}
-
-
-void StringTest::testTrimLeftInPlace()
-{
- {
- std::string s = "abc";
- assert (trimLeftInPlace(s) == "abc");
- }
- {
- std::string s = " abc ";
- assert (trimLeftInPlace(s) == "abc ");
- }
- {
- std::string s = " ab c ";
- assert (trimLeftInPlace(s) == "ab c ");
- }
-}
-
-
-void StringTest::testTrimRight()
-{
- {
- std::string s = "abc";
- assert (trimRight(s) == "abc");
- }
- {
- std::string s = " abc ";
- assert (trimRight(s) == " abc");
- }
- {
- std::string s = " ab c ";
- assert (trimRight(s) == " ab c");
- }
-}
-
-
-void StringTest::testTrimRightInPlace()
-{
- {
- std::string s = "abc";
- assert (trimRightInPlace(s) == "abc");
- }
- {
- std::string s = " abc ";
- assert (trimRightInPlace(s) == " abc");
- }
- {
- std::string s = " ab c ";
- assert (trimRightInPlace(s) == " ab c");
- }
-}
-
-
-void StringTest::testTrim()
-{
- {
- std::string s = "abc";
- assert (trim(s) == "abc");
- }
- {
- std::string s = "abc ";
- assert (trim(s) == "abc");
- }
- {
- std::string s = " ab c ";
- assert (trim(s) == "ab c");
- }
-}
-
-
-void StringTest::testTrimInPlace()
-{
- {
- std::string s = "abc";
- assert (trimInPlace(s) == "abc");
- }
- {
- std::string s = " abc ";
- assert (trimInPlace(s) == "abc");
- }
- {
- std::string s = " ab c ";
- assert (trimInPlace(s) == "ab c");
- }
-}
-
-
-void StringTest::testToUpper()
-{
- {
- std::string s = "abc";
- assert (toUpper(s) == "ABC");
- }
- {
- std::string s = "Abc";
- assert (toUpper(s) == "ABC");
- }
- {
- std::string s = "abc";
- assert (toUpperInPlace(s) == "ABC");
- }
- {
- std::string s = "Abc";
- assert (toUpperInPlace(s) == "ABC");
- }
-}
-
-
-void StringTest::testToLower()
-{
- {
- std::string s = "ABC";
- assert (toLower(s) == "abc");
- }
- {
- std::string s = "aBC";
- assert (toLower(s) == "abc");
- }
- {
- std::string s = "ABC";
- assert (toLowerInPlace(s) == "abc");
- }
- {
- std::string s = "aBC";
- assert (toLowerInPlace(s) == "abc");
- }
-}
-
-
-void StringTest::testIcompare()
-{
- std::string s1 = "AAA";
- std::string s2 = "aaa";
- std::string s3 = "bbb";
- std::string s4 = "cCcCc";
- std::string s5;
- assert (icompare(s1, s2) == 0);
- assert (icompare(s1, s3) < 0);
- assert (icompare(s1, s4) < 0);
- assert (icompare(s3, s1) > 0);
- assert (icompare(s4, s2) > 0);
- assert (icompare(s2, s4) < 0);
- assert (icompare(s1, s5) > 0);
- assert (icompare(s5, s4) < 0);
-
- std::string ss1 = "xxAAAzz";
- std::string ss2 = "YaaaX";
- std::string ss3 = "YbbbX";
- assert (icompare(ss1, 2, 3, ss2, 1, 3) == 0);
- assert (icompare(ss1, 2, 3, ss3, 1, 3) < 0);
- assert (icompare(ss1, 2, 3, ss2, 1) == 0);
- assert (icompare(ss1, 2, 3, ss3, 1) < 0);
- assert (icompare(ss1, 2, 2, ss2, 1, 3) < 0);
- assert (icompare(ss1, 2, 2, ss2, 1, 2) == 0);
- assert (icompare(ss3, 1, 3, ss1, 2, 3) > 0);
-
- assert (icompare(s1, s2.c_str()) == 0);
- assert (icompare(s1, s3.c_str()) < 0);
- assert (icompare(s1, s4.c_str()) < 0);
- assert (icompare(s3, s1.c_str()) > 0);
- assert (icompare(s4, s2.c_str()) > 0);
- assert (icompare(s2, s4.c_str()) < 0);
- assert (icompare(s1, s5.c_str()) > 0);
- assert (icompare(s5, s4.c_str()) < 0);
-
- assert (icompare(ss1, 2, 3, "aaa") == 0);
- assert (icompare(ss1, 2, 2, "aaa") < 0);
- assert (icompare(ss1, 2, 3, "AAA") == 0);
- assert (icompare(ss1, 2, 2, "bb") < 0);
-
- assert (icompare(ss1, 2, "aaa") > 0);
-}
-
-
-void StringTest::testTranslate()
-{
- std::string s = "aabbccdd";
- assert (translate(s, "abc", "ABC") == "AABBCCdd");
- assert (translate(s, "abc", "AB") == "AABBdd");
- assert (translate(s, "abc", "") == "dd");
- assert (translate(s, "cba", "CB") == "BBCCdd");
- assert (translate(s, "", "CB") == "aabbccdd");
-}
-
-
-void StringTest::testTranslateInPlace()
-{
- std::string s = "aabbccdd";
- translateInPlace(s, "abc", "ABC");
- assert (s == "AABBCCdd");
-}
-
-
-void StringTest::testReplace()
-{
- std::string s("aabbccdd");
-
- assert (replace(s, std::string("aa"), std::string("xx")) == "xxbbccdd");
- assert (replace(s, std::string("bb"), std::string("xx")) == "aaxxccdd");
- assert (replace(s, std::string("dd"), std::string("xx")) == "aabbccxx");
- assert (replace(s, std::string("bbcc"), std::string("xx")) == "aaxxdd");
- assert (replace(s, std::string("b"), std::string("xx")) == "aaxxxxccdd");
- assert (replace(s, std::string("bb"), std::string("")) == "aaccdd");
- assert (replace(s, std::string("b"), std::string("")) == "aaccdd");
- assert (replace(s, std::string("ee"), std::string("xx")) == "aabbccdd");
- assert (replace(s, std::string("dd"), std::string("")) == "aabbcc");
-
- assert (replace(s, "aa", "xx") == "xxbbccdd");
- assert (replace(s, "bb", "xx") == "aaxxccdd");
- assert (replace(s, "dd", "xx") == "aabbccxx");
- assert (replace(s, "bbcc", "xx") == "aaxxdd");
- assert (replace(s, "bb", "") == "aaccdd");
- assert (replace(s, "b", "") == "aaccdd");
- assert (replace(s, "ee", "xx") == "aabbccdd");
- assert (replace(s, "dd", "") == "aabbcc");
-
- s = "aabbaabb";
- assert (replace(s, std::string("aa"), std::string("")) == "bbbb");
- assert (replace(s, std::string("a"), std::string("")) == "bbbb");
- assert (replace(s, std::string("a"), std::string("x")) == "xxbbxxbb");
- assert (replace(s, std::string("a"), std::string("xx")) == "xxxxbbxxxxbb");
- assert (replace(s, std::string("aa"), std::string("xxx")) == "xxxbbxxxbb");
-
- assert (replace(s, std::string("aa"), std::string("xx"), 2) == "aabbxxbb");
-
- assert (replace(s, "aa", "") == "bbbb");
- assert (replace(s, "a", "") == "bbbb");
- assert (replace(s, "a", "x") == "xxbbxxbb");
- assert (replace(s, "a", "xx") == "xxxxbbxxxxbb");
- assert (replace(s, "aa", "xxx") == "xxxbbxxxbb");
-
- assert (replace(s, "aa", "xx", 2) == "aabbxxbb");
-}
-
-
-void StringTest::testReplaceInPlace()
-{
- std::string s("aabbccdd");
-
- assert (replaceInPlace(s, std::string("aa"), std::string("xx")) == "xxbbccdd");
-}
-
-
-void StringTest::testCat()
-{
- std::string s1("one");
- std::string s2("two");
- std::string s3("three");
- std::string s4("four");
- std::string s5("five");
- std::string s6("six");
-
- assert (cat(s1, s2) == "onetwo");
- assert (cat(s1, s2, s3) == "onetwothree");
- assert (cat(s1, s2, s3, s4) == "onetwothreefour");
- assert (cat(s1, s2, s3, s4, s5) == "onetwothreefourfive");
- assert (cat(s1, s2, s3, s4, s5, s6) == "onetwothreefourfivesix");
-
- std::vector<std::string> vec;
- assert (cat(std::string(), vec.begin(), vec.end()) == "");
- assert (cat(std::string(","), vec.begin(), vec.end()) == "");
- vec.push_back(s1);
- assert (cat(std::string(","), vec.begin(), vec.end()) == "one");
- vec.push_back(s2);
- assert (cat(std::string(","), vec.begin(), vec.end()) == "one,two");
- vec.push_back(s3);
- assert (cat(std::string(","), vec.begin(), vec.end()) == "one,two,three");
-}
-
-
-void StringTest::setUp()
-{
-}
-
-
-void StringTest::tearDown()
-{
-}
-
-
-CppUnit::Test* StringTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("StringTest");
-
- CppUnit_addTest(pSuite, StringTest, testTrimLeft);
- CppUnit_addTest(pSuite, StringTest, testTrimLeftInPlace);
- CppUnit_addTest(pSuite, StringTest, testTrimRight);
- CppUnit_addTest(pSuite, StringTest, testTrimInPlace);
- CppUnit_addTest(pSuite, StringTest, testTrim);
- CppUnit_addTest(pSuite, StringTest, testTrimRightInPlace);
- CppUnit_addTest(pSuite, StringTest, testToUpper);
- CppUnit_addTest(pSuite, StringTest, testToLower);
- CppUnit_addTest(pSuite, StringTest, testIcompare);
- CppUnit_addTest(pSuite, StringTest, testTranslate);
- CppUnit_addTest(pSuite, StringTest, testTranslateInPlace);
- CppUnit_addTest(pSuite, StringTest, testReplace);
- CppUnit_addTest(pSuite, StringTest, testReplaceInPlace);
- CppUnit_addTest(pSuite, StringTest, testCat);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/StringTest.h b/Utilities/Poco/Foundation/testsuite/src/StringTest.h
deleted file mode 100755
index a31b9f1166..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StringTest.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// StringTest.h
-//
-// $Id$
-//
-// Definition of the StringTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef StringTest_INCLUDED
-#define StringTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class StringTest: public CppUnit::TestCase
-{
-public:
- StringTest(const std::string& name);
- ~StringTest();
-
- void testTrimLeft();
- void testTrimLeftInPlace();
- void testTrimRight();
- void testTrimRightInPlace();
- void testTrim();
- void testTrimInPlace();
- void testToUpper();
- void testToLower();
- void testIcompare();
- void testTranslate();
- void testTranslateInPlace();
- void testReplace();
- void testReplaceInPlace();
- void testCat();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // StringTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/StringTokenizerTest.cpp b/Utilities/Poco/Foundation/testsuite/src/StringTokenizerTest.cpp
deleted file mode 100755
index e6a5ead076..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StringTokenizerTest.cpp
+++ /dev/null
@@ -1,307 +0,0 @@
-//
-// StringTokenizerTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "StringTokenizerTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/StringTokenizer.h"
-
-
-using Poco::StringTokenizer;
-
-
-StringTokenizerTest::StringTokenizerTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-StringTokenizerTest::~StringTokenizerTest()
-{
-}
-
-
-void StringTokenizerTest::testStringTokenizer()
-{
- {
- StringTokenizer st("", "");
- assert (st.begin() == st.end());
- }
- {
- StringTokenizer st("", "", StringTokenizer::TOK_IGNORE_EMPTY);
- assert (st.begin() == st.end());
- }
- {
- StringTokenizer st("", "", StringTokenizer::TOK_TRIM);
- assert (st.begin() == st.end());
- }
- {
- StringTokenizer st("", "", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- assert (st.begin() == st.end());
- }
- {
- StringTokenizer st("abc", "");
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "abc");
- assert (it == st.end());
- }
- {
- StringTokenizer st("abc ", "", StringTokenizer::TOK_TRIM);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "abc");
- assert (it == st.end());
- }
- {
- StringTokenizer st(" abc ", "", StringTokenizer::TOK_TRIM);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "abc");
- assert (it == st.end());
- }
- {
- StringTokenizer st(" abc", "", StringTokenizer::TOK_TRIM);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "abc");
- assert (it == st.end());
- }
- {
- StringTokenizer st("abc", "b");
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a");
- assert (it != st.end());
- assert (*it++ == "c");
- assert (it == st.end());
- }
- {
- StringTokenizer st("abc", "b", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a");
- assert (it != st.end());
- assert (*it++ == "c");
- assert (it == st.end());
- }
- {
- StringTokenizer st("abc", "bc");
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a");
- assert (it != st.end());
- assert (*it++ == "");
- assert (it == st.end());
- }
- {
- StringTokenizer st("abc", "bc", StringTokenizer::TOK_TRIM);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a");
- assert (it != st.end());
- assert (*it++ == "");
- assert (it == st.end());
- }
- {
- StringTokenizer st("abc", "bc", StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a");
- assert (it == st.end());
- }
- {
- StringTokenizer st("abc", "bc", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a");
- assert (it == st.end());
- }
- {
- StringTokenizer st("abc", "bc", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a");
- assert (it == st.end());
- }
- {
- StringTokenizer st("a a,c c", ",");
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a a");
- assert (it != st.end());
- assert (*it++ == "c c");
- assert (it == st.end());
- }
- {
- StringTokenizer st("a a,c c", ",", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a a");
- assert (it != st.end());
- assert (*it++ == "c c");
- assert (it == st.end());
- }
- {
- StringTokenizer st(" a a , , c c ", ",");
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == " a a ");
- assert (it != st.end());
- assert (*it++ == " ");
- assert (it != st.end());
- assert (*it++ == " c c ");
- assert (it == st.end());
- }
- {
- StringTokenizer st(" a a , , c c ", ",", StringTokenizer::TOK_TRIM);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a a");
- assert (it != st.end());
- assert (*it++ == "");
- assert (it != st.end());
- assert (*it++ == "c c");
- assert (it == st.end());
- }
- {
- StringTokenizer st(" a a , , c c ", ",", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a a");
- assert (it != st.end());
- assert (*it++ == "c c");
- assert (it == st.end());
- }
- {
- StringTokenizer st("abc,def,,ghi , jk, l ", ",", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "abc");
- assert (it != st.end());
- assert (*it++ == "def");
- assert (it != st.end());
- assert (*it++ == "ghi");
- assert (it != st.end());
- assert (*it++ == "jk");
- assert (it != st.end());
- assert (*it++ == "l");
- assert (it == st.end());
- }
- {
- StringTokenizer st("abc,def,,ghi // jk, l ", ",/", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "abc");
- assert (it != st.end());
- assert (*it++ == "def");
- assert (it != st.end());
- assert (*it++ == "ghi");
- assert (it != st.end());
- assert (*it++ == "jk");
- assert (it != st.end());
- assert (*it++ == "l");
- assert (it == st.end());
- }
- {
- StringTokenizer st("a/bc,def,,ghi // jk, l ", ",/", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "a");
- assert (it != st.end());
- assert (*it++ == "bc");
- assert (it != st.end());
- assert (*it++ == "def");
- assert (it != st.end());
- assert (*it++ == "ghi");
- assert (it != st.end());
- assert (*it++ == "jk");
- assert (it != st.end());
- assert (*it++ == "l");
- assert (it == st.end());
- }
- {
- StringTokenizer st(",ab,cd,", ",");
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "");
- assert (it != st.end());
- assert (*it++ == "ab");
- assert (it != st.end());
- assert (*it++ == "cd");
- assert (it == st.end());
- }
- {
- StringTokenizer st(",ab,cd,", ",", StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "ab");
- assert (it != st.end());
- assert (*it++ == "cd");
- assert (it == st.end());
- }
- {
- StringTokenizer st(" , ab , cd , ", ",", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- StringTokenizer::Iterator it = st.begin();
- assert (it != st.end());
- assert (*it++ == "ab");
- assert (it != st.end());
- assert (*it++ == "cd");
- assert (it == st.end());
- }
- {
- StringTokenizer st("1 : 2 , : 3 ", ":,", StringTokenizer::TOK_TRIM | StringTokenizer::TOK_IGNORE_EMPTY);
- assert (st.count() == 3);
- assert (st[0] == "1");
- assert (st[1] == "2");
- assert (st[2] == "3");
- }
-}
-
-
-void StringTokenizerTest::setUp()
-{
-}
-
-
-void StringTokenizerTest::tearDown()
-{
-}
-
-
-CppUnit::Test* StringTokenizerTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("StringTokenizerTest");
-
- CppUnit_addTest(pSuite, StringTokenizerTest, testStringTokenizer);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/StringTokenizerTest.h b/Utilities/Poco/Foundation/testsuite/src/StringTokenizerTest.h
deleted file mode 100755
index fab49738c8..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/StringTokenizerTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// StringTokenizerTest.h
-//
-// $Id$
-//
-// Definition of the StringTokenizerTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef StringTokenizerTest_INCLUDED
-#define StringTokenizerTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class StringTokenizerTest: public CppUnit::TestCase
-{
-public:
- StringTokenizerTest(const std::string& name);
- ~StringTokenizerTest();
-
- void testStringTokenizer();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // StringTokenizerTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TaskManagerTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TaskManagerTest.cpp
deleted file mode 100755
index f2176663a2..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TaskManagerTest.cpp
+++ /dev/null
@@ -1,521 +0,0 @@
-//
-// TaskManagerTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TaskManagerTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Exception.h"
-#include "Poco/TaskManager.h"
-#include "Poco/Task.h"
-#include "Poco/TaskNotification.h"
-#include "Poco/NotificationCenter.h"
-#include "Poco/Thread.h"
-#include "Poco/ThreadPool.h"
-#include "Poco/Event.h"
-#include "Poco/Observer.h"
-#include "Poco/Exception.h"
-#include "Poco/AutoPtr.h"
-
-
-using Poco::TaskManager;
-using Poco::Task;
-using Poco::NotificationCenter;
-using Poco::TaskStartedNotification;
-using Poco::TaskCancelledNotification;
-using Poco::TaskFinishedNotification;
-using Poco::TaskFailedNotification;
-using Poco::TaskProgressNotification;
-using Poco::TaskCustomNotification;
-using Poco::Thread;
-using Poco::ThreadPool;
-using Poco::Event;
-using Poco::Observer;
-using Poco::Exception;
-using Poco::NoThreadAvailableException;
-using Poco::SystemException;
-using Poco::NullPointerException;
-using Poco::AutoPtr;
-
-
-namespace
-{
- class TestTask: public Task
- {
- public:
- TestTask():
- Task("TestTask"),
- _fail(false)
- {
- }
-
- void runTask()
- {
- _event.wait();
- setProgress(0.5);
- _event.wait();
- if (isCancelled())
- return;
- if (_fail)
- throw SystemException("warp core breach detected");
- setProgress(1.0);
- _event.wait();
- }
-
- void fail()
- {
- _fail = true;
- }
-
- void cont()
- {
- _event.set();
- }
-
- private:
- Event _event;
- bool _fail;
- };
-
- class SimpleTask: public Task
- {
- public:
- SimpleTask(): Task("SimpleTask")
- {
- }
-
- void runTask()
- {
- sleep(10000);
- }
- };
-
- class TaskObserver
- {
- public:
- TaskObserver():
- _started(false),
- _cancelled(false),
- _finished(false),
- _pException(0),
- _progress(0.0)
- {
- }
-
- ~TaskObserver()
- {
- delete _pException;
- }
-
- void taskStarted(TaskStartedNotification* pNf)
- {
- _started = true;
- pNf->release();
- }
-
- void taskCancelled(TaskCancelledNotification* pNf)
- {
- _cancelled = true;
- pNf->release();
- }
-
- void taskFinished(TaskFinishedNotification* pNf)
- {
- _finished = true;
- pNf->release();
- }
-
- void taskFailed(TaskFailedNotification* pNf)
- {
- _pException = pNf->reason().clone();
- pNf->release();
- }
-
- void taskProgress(TaskProgressNotification* pNf)
- {
- _progress = pNf->progress();
- pNf->release();
- }
-
- bool started() const
- {
- return _started;
- }
-
- bool cancelled() const
- {
- return _cancelled;
- }
-
- bool finished() const
- {
- return _finished;
- }
-
- float progress() const
- {
- return _progress;
- }
-
- Exception* error() const
- {
- return _pException;
- }
-
- private:
- bool _started;
- bool _cancelled;
- bool _finished;
- Exception* _pException;
- float _progress;
- };
-
-
- template <typename T>
- class CustomNotificationTask: public Task
- {
- public:
- CustomNotificationTask(const T& t):
- Task("CustomNotificationTask"),
- _custom(t)
- {
- }
-
- void runTask()
- {
- sleep(10000);
- }
-
- void setCustom(const T& custom)
- {
- _custom = custom;
- postNotification(new TaskCustomNotification<T>(this, _custom));
- }
-
- private:
- T _custom;
- };
-
-
- template <class C>
- class CustomTaskObserver
- {
- public:
- CustomTaskObserver(const C& custom): _custom(custom)
- {
- }
-
- ~CustomTaskObserver()
- {
- }
-
- void taskCustom(TaskCustomNotification<C>* pNf)
- {
- _custom = pNf->custom();
- pNf->release();
- }
-
- const C& custom() const
- {
- return _custom;
- }
-
- private:
- C _custom;
- };
-}
-
-
-TaskManagerTest::TaskManagerTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TaskManagerTest::~TaskManagerTest()
-{
-}
-
-
-void TaskManagerTest::testFinish()
-{
- TaskManager tm;
- TaskObserver to;
- tm.addObserver(Observer<TaskObserver, TaskStartedNotification>(to, &TaskObserver::taskStarted));
- tm.addObserver(Observer<TaskObserver, TaskCancelledNotification>(to, &TaskObserver::taskCancelled));
- tm.addObserver(Observer<TaskObserver, TaskFailedNotification>(to, &TaskObserver::taskFailed));
- tm.addObserver(Observer<TaskObserver, TaskFinishedNotification>(to, &TaskObserver::taskFinished));
- tm.addObserver(Observer<TaskObserver, TaskProgressNotification>(to, &TaskObserver::taskProgress));
- AutoPtr<TestTask> pTT = new TestTask;
- tm.start(pTT.duplicate());
- assert (pTT->progress() == 0);
- Thread::sleep(200);
- pTT->cont();
- while (pTT->progress() != 0.5) Thread::sleep(50);
- assert (to.progress() == 0.5);
- assert (to.started());
- assert (pTT->state() == Task::TASK_RUNNING);
- TaskManager::TaskList list = tm.taskList();
- assert (list.size() == 1);
- assert (tm.count() == 1);
- pTT->cont();
- while (pTT->progress() != 1.0) Thread::sleep(50);
- pTT->cont();
- while (pTT->state() != Task::TASK_FINISHED) Thread::sleep(50);
- assert (pTT->state() == Task::TASK_FINISHED);
- assert (to.finished());
- while (tm.count() == 1) Thread::sleep(50);
- list = tm.taskList();
- assert (list.empty());
- assert (!to.error());
-}
-
-
-void TaskManagerTest::testCancel()
-{
- TaskManager tm;
- TaskObserver to;
- tm.addObserver(Observer<TaskObserver, TaskStartedNotification>(to, &TaskObserver::taskStarted));
- tm.addObserver(Observer<TaskObserver, TaskCancelledNotification>(to, &TaskObserver::taskCancelled));
- tm.addObserver(Observer<TaskObserver, TaskFailedNotification>(to, &TaskObserver::taskFailed));
- tm.addObserver(Observer<TaskObserver, TaskFinishedNotification>(to, &TaskObserver::taskFinished));
- tm.addObserver(Observer<TaskObserver, TaskProgressNotification>(to, &TaskObserver::taskProgress));
- AutoPtr<TestTask> pTT = new TestTask;
- tm.start(pTT.duplicate());
- assert (pTT->progress() == 0);
- Thread::sleep(200);
- pTT->cont();
- while (pTT->progress() != 0.5) Thread::sleep(50);
- assert (to.progress() == 0.5);
- assert (to.started());
- assert (pTT->state() == Task::TASK_RUNNING);
- TaskManager::TaskList list = tm.taskList();
- assert (list.size() == 1);
- assert (tm.count() == 1);
- tm.cancelAll();
- assert (to.cancelled());
- pTT->cont();
- while (pTT->state() != Task::TASK_FINISHED) Thread::sleep(50);
- assert (pTT->state() == Task::TASK_FINISHED);
- assert (to.finished());
- while (tm.count() == 1) Thread::sleep(50);
- list = tm.taskList();
- assert (list.empty());
- assert (!to.error());
-}
-
-
-void TaskManagerTest::testError()
-{
- TaskManager tm;
- TaskObserver to;
- tm.addObserver(Observer<TaskObserver, TaskStartedNotification>(to, &TaskObserver::taskStarted));
- tm.addObserver(Observer<TaskObserver, TaskCancelledNotification>(to, &TaskObserver::taskCancelled));
- tm.addObserver(Observer<TaskObserver, TaskFailedNotification>(to, &TaskObserver::taskFailed));
- tm.addObserver(Observer<TaskObserver, TaskFinishedNotification>(to, &TaskObserver::taskFinished));
- tm.addObserver(Observer<TaskObserver, TaskProgressNotification>(to, &TaskObserver::taskProgress));
- AutoPtr<TestTask> pTT = new TestTask;
- tm.start(pTT.duplicate());
- assert (pTT->progress() == 0);
- Thread::sleep(200);
- pTT->cont();
- while (pTT->progress() != 0.5) Thread::sleep(50);
- assert (to.progress() == 0.5);
- assert (to.started());
- assert (pTT->state() == Task::TASK_RUNNING);
- TaskManager::TaskList list = tm.taskList();
- assert (list.size() == 1);
- assert (tm.count() == 1);
- pTT->fail();
- pTT->cont();
- while (pTT->state() != Task::TASK_FINISHED) Thread::sleep(50);
- assert (pTT->state() == Task::TASK_FINISHED);
- assert (to.finished());
- assert (to.error() != 0);
- while (tm.count() == 1) Thread::sleep(50);
- list = tm.taskList();
- assert (list.empty());
-}
-
-
-void TaskManagerTest::testCustom()
-{
- TaskManager tm;
-
- CustomTaskObserver<int> ti(0);
- tm.addObserver(
- Observer<CustomTaskObserver<int>, TaskCustomNotification<int> >
- (ti, &CustomTaskObserver<int>::taskCustom));
-
- AutoPtr<CustomNotificationTask<int> > pCNT1 = new CustomNotificationTask<int>(0);
- tm.start(pCNT1.duplicate());
- assert (ti.custom() == 0);
-
- for (int i = 1; i < 10; ++i)
- {
- pCNT1->setCustom(i);
- assert (ti.custom() == i);
- }
-
- CustomTaskObserver<std::string> ts("");
- tm.addObserver(
- Observer<CustomTaskObserver<std::string>, TaskCustomNotification<std::string> >
- (ts, &CustomTaskObserver<std::string>::taskCustom));
-
- AutoPtr<CustomNotificationTask<std::string> > pCNT2 = new CustomNotificationTask<std::string>("");
- tm.start(pCNT2.duplicate());
- assert (tm.taskList().size() == 2);
- assert (ts.custom() == "");
- std::string str("notify me");
- pCNT2->setCustom(str);
- assert (ts.custom() == str);
-
- S s;
- s.i = 0;
- s.str = "";
-
- CustomTaskObserver<S*> ptst(&s);
-
- tm.addObserver(
- Observer<CustomTaskObserver<S*>, TaskCustomNotification<S*> >
- (ptst, &CustomTaskObserver<S*>::taskCustom));
-
- AutoPtr<CustomNotificationTask<S*> > pCNT3 = new CustomNotificationTask<S*>(&s);
- tm.start(pCNT3.duplicate());
- assert (tm.taskList().size() == 3);
- assert (ptst.custom()->i == 0);
- assert (ptst.custom()->str == "");
- s.i = 123;
- s.str = "123";
- pCNT3->setCustom(&s);
- assert (ptst.custom()->i == 123);
- assert (ptst.custom()->str == "123");
-
- s.i = 0;
- s.str = "";
-
- CustomTaskObserver<S> tst(s);
-
- tm.addObserver(
- Observer<CustomTaskObserver<S>, TaskCustomNotification<S> >
- (tst, &CustomTaskObserver<S>::taskCustom));
-
- AutoPtr<CustomNotificationTask<S> > pCNT4 = new CustomNotificationTask<S>(s);
- tm.start(pCNT4.duplicate());
- assert (tm.taskList().size() == 4);
- assert (tst.custom().i == 0);
- assert (tst.custom().str == "");
- s.i = 123;
- s.str = "123";
- pCNT4->setCustom(s);
- assert (tst.custom().i == 123);
- assert (tst.custom().str == "123");
-
- AutoPtr<SimpleTask> pST = new SimpleTask;
- tm.start(pST.duplicate());
- assert (tm.taskList().size() == 5);
-
- tm.cancelAll();
- while (tm.count() > 0) Thread::sleep(50);
- assert (tm.count() == 0);
-}
-
-
-void TaskManagerTest::testMultiTasks()
-{
- TaskManager tm;
- tm.start(new SimpleTask);
- tm.start(new SimpleTask);
- tm.start(new SimpleTask);
-
- TaskManager::TaskList list = tm.taskList();
- assert (list.size() == 3);
-
- tm.cancelAll();
- while (tm.count() > 0) Thread::sleep(100);
- assert (tm.count() == 0);
-}
-
-
-void TaskManagerTest::testCustomThreadPool()
-{
- ThreadPool tp(2, 5, 120);
- TaskManager tm(tp);
-
- // fill up the thread pool
- for (int i=0; i < tp.capacity(); ++i)
- {
- tm.start(new SimpleTask);
- }
- assert (tp.allocated() == tp.capacity());
- assert (tm.count() == tp.allocated());
-
- // the next one should fail
- try
- {
- tm.start(new SimpleTask);
- failmsg("thread pool exhausted - must throw exception");
- }
- catch (NoThreadAvailableException const&)
- {
- }
- catch (...)
- {
- failmsg("wrong exception thrown");
- }
-
- assert (tm.count() == tp.allocated());
-
- tp.joinAll();
-}
-
-void TaskManagerTest::setUp()
-{
-}
-
-
-void TaskManagerTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TaskManagerTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TaskManagerTest");
-
- CppUnit_addTest(pSuite, TaskManagerTest, testFinish);
- CppUnit_addTest(pSuite, TaskManagerTest, testCancel);
- CppUnit_addTest(pSuite, TaskManagerTest, testError);
- CppUnit_addTest(pSuite, TaskManagerTest, testMultiTasks);
- CppUnit_addTest(pSuite, TaskManagerTest, testCustom);
- CppUnit_addTest(pSuite, TaskManagerTest, testCustomThreadPool);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TaskManagerTest.h b/Utilities/Poco/Foundation/testsuite/src/TaskManagerTest.h
deleted file mode 100755
index f69291e8e2..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TaskManagerTest.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// TaskManagerTest.h
-//
-// $Id$
-//
-// Definition of the TaskManagerTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TaskManagerTest_INCLUDED
-#define TaskManagerTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TaskManagerTest: public CppUnit::TestCase
-{
-public:
- struct S
- {
- int i;
- std::string str;
- };
-
- TaskManagerTest(const std::string& name);
- ~TaskManagerTest();
-
- void testFinish();
- void testCancel();
- void testError();
- void testCustom();
- void testMultiTasks();
- void testCustomThreadPool();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TaskManagerTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TaskTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TaskTest.cpp
deleted file mode 100755
index b1ea15aa66..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TaskTest.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// TaskTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TaskTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Task.h"
-#include "Poco/Thread.h"
-#include "Poco/Event.h"
-#include "Poco/AutoPtr.h"
-
-
-using Poco::Task;
-using Poco::Thread;
-using Poco::Event;
-using Poco::AutoPtr;
-
-
-namespace
-{
- class TestTask: public Task
- {
- public:
- TestTask(): Task("TestTask")
- {
- }
-
- void runTask()
- {
- _event.wait();
- if (sleep(10))
- return;
- setProgress(0.5);
- _event.wait();
- if (isCancelled())
- return;
- setProgress(1.0);
- _event.wait();
- }
-
- void cont()
- {
- _event.set();
- }
-
- private:
- Event _event;
- };
-}
-
-
-TaskTest::TaskTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TaskTest::~TaskTest()
-{
-}
-
-
-void TaskTest::testFinish()
-{
- AutoPtr<TestTask> pTT = new TestTask;
- assert (pTT->state() == Task::TASK_IDLE);
- Thread thr;
- thr.start(*pTT);
- assert (pTT->progress() == 0);
- pTT->cont();
- while (pTT->progress() != 0.5) Thread::sleep(50);
- assert (pTT->state() == Task::TASK_RUNNING);
- pTT->cont();
- while (pTT->progress() != 1.0) Thread::sleep(50);
- pTT->cont();
- thr.join();
- assert (pTT->state() == Task::TASK_FINISHED);
-}
-
-
-void TaskTest::testCancel1()
-{
- AutoPtr<TestTask> pTT = new TestTask;
- assert (pTT->state() == Task::TASK_IDLE);
- Thread thr;
- thr.start(*pTT);
- assert (pTT->progress() == 0);
- pTT->cont();
- while (pTT->progress() != 0.5) Thread::sleep(50);
- assert (pTT->state() == Task::TASK_RUNNING);
- pTT->cancel();
- assert (pTT->state() == Task::TASK_CANCELLING);
- pTT->cont();
- thr.join();
- assert (pTT->state() == Task::TASK_FINISHED);
-}
-
-
-void TaskTest::testCancel2()
-{
- AutoPtr<TestTask> pTT = new TestTask;
- assert (pTT->state() == Task::TASK_IDLE);
- Thread thr;
- thr.start(*pTT);
- assert (pTT->progress() == 0);
- pTT->cancel();
- assert (pTT->state() == Task::TASK_CANCELLING);
- pTT->cont();
- thr.join();
- assert (pTT->state() == Task::TASK_FINISHED);
-}
-
-
-void TaskTest::setUp()
-{
-}
-
-
-void TaskTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TaskTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TaskTest");
-
- CppUnit_addTest(pSuite, TaskTest, testFinish);
- CppUnit_addTest(pSuite, TaskTest, testCancel1);
- CppUnit_addTest(pSuite, TaskTest, testCancel2);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TaskTest.h b/Utilities/Poco/Foundation/testsuite/src/TaskTest.h
deleted file mode 100755
index cc134cdb7b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TaskTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// TaskTest.h
-//
-// $Id$
-//
-// Definition of the TaskTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TaskTest_INCLUDED
-#define TaskTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TaskTest: public CppUnit::TestCase
-{
-public:
- TaskTest(const std::string& name);
- ~TaskTest();
-
- void testFinish();
- void testCancel1();
- void testCancel2();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TaskTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TaskTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/TaskTestSuite.cpp
deleted file mode 100755
index 222ad83aa8..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TaskTestSuite.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// TaskTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TaskTestSuite.h"
-#include "TaskTest.h"
-#include "TaskManagerTest.h"
-
-
-CppUnit::Test* TaskTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TaskTestSuite");
-
- pSuite->addTest(TaskTest::suite());
- pSuite->addTest(TaskManagerTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TaskTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/TaskTestSuite.h
deleted file mode 100755
index 415b3e244c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TaskTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// TaskTestSuite.h
-//
-// $Id$
-//
-// Definition of the TaskTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TaskTestSuite_INCLUDED
-#define TaskTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class TaskTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // TaskTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TeeStreamTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TeeStreamTest.cpp
deleted file mode 100755
index 6988b876be..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TeeStreamTest.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// TeeStreamTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2005-2006, 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 "TeeStreamTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/TeeStream.h"
-#include <sstream>
-
-
-using Poco::TeeInputStream;
-using Poco::TeeOutputStream;
-
-
-TeeStreamTest::TeeStreamTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TeeStreamTest::~TeeStreamTest()
-{
-}
-
-
-void TeeStreamTest::testTeeInputStream()
-{
- std::istringstream istr("foo");
- std::ostringstream ostr;
- TeeInputStream tis(istr);
- tis.addStream(ostr);
- std::string s;
- tis >> s;
- assert (ostr.str() == "foo");
-}
-
-
-void TeeStreamTest::testTeeOutputStream()
-{
- std::ostringstream ostr1;
- std::ostringstream ostr2;
- TeeOutputStream tos(ostr1);
- tos.addStream(ostr2);
- tos << "bar" << std::flush;
- assert (ostr1.str() == "bar");
- assert (ostr2.str() == "bar");
-}
-
-
-void TeeStreamTest::setUp()
-{
-}
-
-
-void TeeStreamTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TeeStreamTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TeeStreamTest");
-
- CppUnit_addTest(pSuite, TeeStreamTest, testTeeInputStream);
- CppUnit_addTest(pSuite, TeeStreamTest, testTeeOutputStream);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TeeStreamTest.h b/Utilities/Poco/Foundation/testsuite/src/TeeStreamTest.h
deleted file mode 100755
index ce4c518ecf..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TeeStreamTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// TeeStreamTest.h
-//
-// $Id$
-//
-// Definition of the TeeStreamTest class.
-//
-// Copyright (c) 2005-2006, 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.
-//
-
-
-#ifndef TeeStreamTest_INCLUDED
-#define TeeStreamTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TeeStreamTest: public CppUnit::TestCase
-{
-public:
- TeeStreamTest(const std::string& name);
- ~TeeStreamTest();
-
- void testTeeInputStream();
- void testTeeOutputStream();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TeeStreamTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TestApp.cpp b/Utilities/Poco/Foundation/testsuite/src/TestApp.cpp
deleted file mode 100755
index ecc0cc672b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TestApp.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// TestApp.cpp
-//
-// $Id$
-//
-// Copyright (c) 2005-2006, 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 <string>
-#include <iostream>
-
-
-int main(int argc, char** argv)
-{
- if (argc > 1)
- {
- std::string arg(argv[1]);
- if (arg == "-hello")
- {
- std::cout << "Hello, world!";
- }
- else if (arg == "-count")
- {
- int n = 0;
- int c = std::cin.get();
- while (c != -1) { ++n; c = std::cin.get(); }
- return n;
- }
- }
- return argc - 1;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TestChannel.cpp b/Utilities/Poco/Foundation/testsuite/src/TestChannel.cpp
deleted file mode 100755
index e44d0e2659..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TestChannel.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// TestChannel.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TestChannel.h"
-
-
-TestChannel::TestChannel()
-{
-}
-
-
-TestChannel::~TestChannel()
-{
-}
-
-
-void TestChannel::log(const Poco::Message& msg)
-{
- _msgList.push_back(msg);
-}
-
-
-TestChannel::MsgList& TestChannel::list()
-{
- return _msgList;
-}
-
-
-void TestChannel::clear()
-{
- _msgList.clear();
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TestChannel.h b/Utilities/Poco/Foundation/testsuite/src/TestChannel.h
deleted file mode 100755
index f858b0346e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TestChannel.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// TestChannel.h
-//
-// $Id$
-//
-// Definition of the TestChannel class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TestChannel_INCLUDED
-#define TestChannel_INCLUDED
-
-
-#include "Poco/Channel.h"
-#include "Poco/Message.h"
-#include <list>
-
-
-class TestChannel: public Poco::Channel
-{
-public:
- typedef std::list<Poco::Message> MsgList;
-
- TestChannel();
- ~TestChannel();
-
- void log(const Poco::Message& msg);
- MsgList& list();
- void clear();
-
-private:
- MsgList _msgList;
-};
-
-
-#endif // TestChannel_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TestLibrary.cpp b/Utilities/Poco/Foundation/testsuite/src/TestLibrary.cpp
deleted file mode 100755
index 095dd629b8..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TestLibrary.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// TestLibrary.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TestPlugin.h"
-#include "Poco/ClassLibrary.h"
-#include <iostream>
-
-
-extern "C" int POCO_LIBRARY_API gimmeFive();
-
-
-class PluginA: public TestPlugin
-{
-public:
- PluginA()
- {
- }
-
- ~PluginA()
- {
- }
-
- std::string name() const
- {
- return "PluginA";
- }
-};
-
-
-class PluginB: public TestPlugin
-{
-public:
- PluginB()
- {
- }
-
- ~PluginB()
- {
- }
-
- std::string name() const
- {
- return "PluginB";
- }
-};
-
-
-class PluginC: public TestPlugin
-{
-public:
- PluginC()
- {
- }
-
- ~PluginC()
- {
- }
-
- std::string name() const
- {
- return "PluginC";
- }
-};
-
-
-POCO_BEGIN_MANIFEST(TestPlugin)
- POCO_EXPORT_CLASS(PluginA)
- POCO_EXPORT_CLASS(PluginB)
- POCO_EXPORT_SINGLETON(PluginC)
-POCO_END_MANIFEST
-
-
-void pocoInitializeLibrary()
-{
- std::cout << "TestLibrary initializing" << std::endl;
-}
-
-
-void pocoUninitializeLibrary()
-{
- std::cout << "TestLibrary uninitialzing" << std::endl;
-}
-
-
-int gimmeFive()
-{
- return 5;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TestPlugin.cpp b/Utilities/Poco/Foundation/testsuite/src/TestPlugin.cpp
deleted file mode 100755
index ca852e1c28..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TestPlugin.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// TestPlugin.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TestPlugin.h"
-
-
-TestPlugin::TestPlugin()
-{
-}
-
-
-TestPlugin::~TestPlugin()
-{
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TestPlugin.h b/Utilities/Poco/Foundation/testsuite/src/TestPlugin.h
deleted file mode 100755
index 3e624d141e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TestPlugin.h
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// TestPlugin.h
-//
-// $Id$
-//
-// Definition of the TestPlugin class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TestPlugin_INCLUDED
-#define TestPlugin_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-class TestPlugin
-{
-public:
- TestPlugin();
- virtual ~TestPlugin();
- virtual std::string name() const = 0;
-};
-
-
-#endif // TestPlugin_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TextConverterTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TextConverterTest.cpp
deleted file mode 100755
index f8f2feb342..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TextConverterTest.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-//
-// TextConverterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TextConverterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/TextConverter.h"
-#include "Poco/ASCIIEncoding.h"
-#include "Poco/Latin1Encoding.h"
-#include "Poco/UTF8Encoding.h"
-
-
-using Poco::TextConverter;
-using Poco::Latin1Encoding;
-using Poco::UTF8Encoding;
-using Poco::ASCIIEncoding;
-
-
-TextConverterTest::TextConverterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TextConverterTest::~TextConverterTest()
-{
-}
-
-
-void TextConverterTest::testIdentityASCII()
-{
- ASCIIEncoding encoding;
- TextConverter converter(encoding, encoding);
-
- std::string empty;
- std::string result0;
- int errors = converter.convert(empty, result0);
- assert (result0 == empty);
- assert (errors == 0);
-
- std::string fooBar = "foo bar";
- std::string result1;
- errors = converter.convert(fooBar, result1);
- assert (result1 == fooBar);
- assert (errors == 0);
-
- std::string result2;
- errors = converter.convert(fooBar.data(), (int) fooBar.length(), result2);
- assert (result2 == fooBar);
- assert (errors == 0);
-
- std::string result3;
- errors = converter.convert("", 0, result3);
- assert (result3.empty());
- assert (errors == 0);
-
- std::string x = "x";
- std::string result4;
- errors = converter.convert(x, result4);
- assert (result4 == x);
- assert (errors == 0);
-
- std::string result5;
- errors = converter.convert("x", 1, result5);
- assert (result5 == x);
- assert (errors == 0);
-}
-
-
-void TextConverterTest::testIdentityUTF8()
-{
- UTF8Encoding encoding;
- TextConverter converter(encoding, encoding);
-
- std::string empty;
- std::string result0;
- int errors = converter.convert(empty, result0);
- assert (result0 == empty);
- assert (errors == 0);
-
- std::string fooBar = "foo bar";
- std::string result1;
- errors = converter.convert(fooBar, result1);
- assert (result1 == fooBar);
- assert (errors == 0);
-
- std::string result2;
- errors = converter.convert(fooBar.data(), (int) fooBar.length(), result2);
- assert (result2 == fooBar);
- assert (errors == 0);
-
- std::string result3;
- errors = converter.convert("", 0, result3);
- assert (result3.empty());
- assert (errors == 0);
-
- const unsigned char greek[] = {0x20, 0xce, 0xba, 0xe1, 0xbd, 0xb9, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5, 0x20, 0x00};
- std::string text((const char*) greek);
-
- std::string result4;
- errors = converter.convert(text, result4);
- assert (result4 == text);
- assert (errors == 0);
-
- std::string result5;
- errors = converter.convert((char*) greek, 13, result5);
- assert (result5 == text);
- assert (errors == 0);
-
- std::string x = "x";
- std::string result6;
- errors = converter.convert(x, result6);
- assert (result6 == x);
- assert (errors == 0);
-
- std::string result7;
- errors = converter.convert("x", 1, result7);
- assert (result7 == x);
- assert (errors == 0);
-
- std::string utfChar((char*) greek + 1, 2);
- std::string result8;
- errors = converter.convert(utfChar, result8);
- assert (result8 == utfChar);
- assert (errors == 0);
-
- std::string result9;
- errors = converter.convert((char*) greek + 1, 2, result9);
- assert (result9 == utfChar);
- assert (errors == 0);
-}
-
-
-void TextConverterTest::testUTF8toASCII()
-{
- UTF8Encoding utf8Encoding;
- ASCIIEncoding asciiEncoding;
- TextConverter converter(utf8Encoding, asciiEncoding);
-
- const unsigned char greek[] = {0x20, 0xce, 0xba, 0xe1, 0xbd, 0xb9, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5, 0x20, 0x41, 0x42, 0x00};
- std::string text((const char*) greek);
- std::string result0;
- int errors = converter.convert(text, result0);
- assert (result0 == " ????? AB");
- assert (errors == 0);
-
- std::string result1;
- errors = converter.convert("abcde", 5, result1);
- assert (result1 == "abcde");
-}
-
-
-void TextConverterTest::testLatin1toUTF8()
-{
- Latin1Encoding latin1Encoding;
- UTF8Encoding utf8Encoding;
- TextConverter converter(latin1Encoding, utf8Encoding);
-
- const unsigned char latin1Chars[] = {'g', 252, 'n', 't', 'e', 'r', 0};
- const unsigned char utf8Chars[] = {'g', 195, 188, 'n', 't', 'e', 'r', 0};
- std::string latin1Text((const char*) latin1Chars);
- std::string utf8Text((const char*) utf8Chars);
-
- std::string result0;
- int errors = converter.convert(latin1Text, result0);
- assert (result0 == utf8Text);
- assert (errors == 0);
-
- std::string result1;
- errors = converter.convert(latin1Chars, 6, result1);
- assert (result0 == utf8Text);
- assert (errors == 0);
-}
-
-
-void TextConverterTest::testErrors()
-{
- UTF8Encoding utf8Encoding;
- Latin1Encoding latin1Encoding;
- TextConverter converter(utf8Encoding, latin1Encoding);
-
- const unsigned char badChars[] = {'a', 'b', 255, 'c', 254, 0};
- std::string badText((const char*) badChars);
-
- std::string result;
- int errors = converter.convert(badText, result);
- assert (errors == 2);
-}
-
-
-void TextConverterTest::setUp()
-{
-}
-
-
-void TextConverterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TextConverterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TextConverterTest");
-
- CppUnit_addTest(pSuite, TextConverterTest, testIdentityASCII);
- CppUnit_addTest(pSuite, TextConverterTest, testIdentityUTF8);
- CppUnit_addTest(pSuite, TextConverterTest, testUTF8toASCII);
- CppUnit_addTest(pSuite, TextConverterTest, testLatin1toUTF8);
- CppUnit_addTest(pSuite, TextConverterTest, testErrors);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TextConverterTest.h b/Utilities/Poco/Foundation/testsuite/src/TextConverterTest.h
deleted file mode 100755
index f70243619e..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TextConverterTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// TextConverterTest.h
-//
-// $Id$
-//
-// Definition of the TextConverterTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TextConverterTest_INCLUDED
-#define TextConverterTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TextConverterTest: public CppUnit::TestCase
-{
-public:
- TextConverterTest(const std::string& name);
- ~TextConverterTest();
-
- void testIdentityASCII();
- void testIdentityUTF8();
- void testUTF8toASCII();
- void testLatin1toUTF8();
- void testErrors();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TextConverterTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TextEncodingTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TextEncodingTest.cpp
deleted file mode 100755
index 62af83192d..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TextEncodingTest.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// TextEncodingTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TextEncodingTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/TextEncoding.h"
-#include "Poco/Latin1Encoding.h"
-
-
-using Poco::TextEncoding;
-using Poco::Latin1Encoding;
-
-
-TextEncodingTest::TextEncodingTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TextEncodingTest::~TextEncodingTest()
-{
-}
-
-
-void TextEncodingTest::testTextEncoding()
-{
- TextEncoding& utf8 = TextEncoding::byName("utf8");
- assert (std::string("UTF-8") == utf8.canonicalName());
-
- TextEncoding& latin1 = TextEncoding::byName("latin1");
- assert (std::string("ISO-8859-1") == latin1.canonicalName());
-
- TextEncoding& glob = TextEncoding::global();
- assert (std::string("UTF-8") == glob.canonicalName());
-
- TextEncoding::global(new Latin1Encoding);
-
- TextEncoding& glob2 = TextEncoding::global();
- assert (std::string("ISO-8859-1") == glob2.canonicalName());
-}
-
-
-void TextEncodingTest::setUp()
-{
-}
-
-
-void TextEncodingTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TextEncodingTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TextEncodingTest");
-
- CppUnit_addTest(pSuite, TextEncodingTest, testTextEncoding);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TextEncodingTest.h b/Utilities/Poco/Foundation/testsuite/src/TextEncodingTest.h
deleted file mode 100755
index fbc8b6be74..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TextEncodingTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// TextEncodingTest.h
-//
-// $Id$
-//
-// Definition of the TextEncodingTest class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef TextEncodingTest_INCLUDED
-#define TextEncodingTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TextEncodingTest: public CppUnit::TestCase
-{
-public:
- TextEncodingTest(const std::string& name);
- ~TextEncodingTest();
-
- void testTextEncoding();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TextEncodingTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TextIteratorTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TextIteratorTest.cpp
deleted file mode 100755
index 88616745f9..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TextIteratorTest.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-//
-// TextIteratorTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TextIteratorTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/TextIterator.h"
-#include "Poco/Latin1Encoding.h"
-#include "Poco/UTF8Encoding.h"
-
-
-using Poco::TextIterator;
-using Poco::Latin1Encoding;
-using Poco::UTF8Encoding;
-
-
-TextIteratorTest::TextIteratorTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TextIteratorTest::~TextIteratorTest()
-{
-}
-
-
-void TextIteratorTest::testEmptyLatin1()
-{
- Latin1Encoding encoding;
- std::string text;
- TextIterator it(text, encoding);
- TextIterator end(text);
-
- assert (it == end);
-}
-
-
-void TextIteratorTest::testOneLatin1()
-{
- Latin1Encoding encoding;
- std::string text("x");
- TextIterator it(text, encoding);
- TextIterator end(text);
-
- assert (it != end);
- assert (*it == 'x');
- ++it;
- assert (it == end);
-}
-
-
-void TextIteratorTest::testLatin1()
-{
- Latin1Encoding encoding;
- std::string text("Latin1");
- TextIterator it(text, encoding);
- TextIterator end(text);
-
- assert (it != end);
- assert (*it++ == 'L');
- assert (it != end);
- assert (*it++ == 'a');
- assert (it != end);
- assert (*it++ == 't');
- assert (it != end);
- assert (*it++ == 'i');
- assert (it != end);
- assert (*it++ == 'n');
- assert (it != end);
- assert (*it++ == '1');
- assert (it == end);
-
- std::string empty;
- it = TextIterator(empty, encoding);
- end = TextIterator(empty);
- assert (it == end);
-}
-
-
-void TextIteratorTest::testEmptyUTF8()
-{
- UTF8Encoding encoding;
- std::string text;
- TextIterator it(text, encoding);
- TextIterator end(text);
-
- assert (it == end);
-}
-
-
-void TextIteratorTest::testOneUTF8()
-{
- UTF8Encoding encoding;
-
- // 1 byte sequence
- std::string text("x");
- TextIterator it(text, encoding);
- TextIterator end(text);
-
- assert (it != end);
- assert (*it == 'x');
- ++it;
- assert (it == end);
-
- unsigned char data[Poco::TextEncoding::MAX_SEQUENCE_LENGTH];
-
- // 2 byte sequence
- int n = encoding.convert(0xab, data, sizeof(data));
- assert (n == 2);
- text.assign((char*) data, n);
- it = TextIterator(text, encoding);
- end = TextIterator(text);
-
- assert (it != end);
- assert (*it++ == 0xab);
- assert (it == end);
-
- // 3 byte sequence
- n = encoding.convert(0xabcd, data, sizeof(data));
- assert (n == 3);
- text.assign((char*) data, n);
- it = TextIterator(text, encoding);
- end = TextIterator(text);
-
- assert (it != end);
- assert (*it++ == 0xabcd);
- assert (it == end);
-
- // 4 byte sequence
- n = encoding.convert(0xabcde, data, sizeof(data));
- assert (n == 4);
- text.assign((char*) data, n);
- it = TextIterator(text, encoding);
- end = TextIterator(text);
-
- assert (it != end);
- assert (*it++ == 0xabcde);
- assert (it == end);
-
- // 5 byte sequence - not supported
- n = encoding.convert(0xabcdef, data, sizeof(data));
- assert (n == 0);
-
- // 6 byte sequence - not supported
- n = encoding.convert(0xfabcdef, data, sizeof(data));
- assert (n == 0);
-}
-
-
-void TextIteratorTest::testUTF8()
-{
- UTF8Encoding encoding;
- const unsigned char greek[] = {0x20, 0xce, 0xba, 0xe1, 0xbd, 0xb9, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5, 0x20, 0x00};
- std::string text((const char*) greek);
- TextIterator it(text, encoding);
- TextIterator end(text);
-
- assert (it != end);
- assert (*it++ == 0x0020);
- assert (it != end);
- assert (*it++ == 0x03ba);
- assert (it != end);
- assert (*it++ == 0x1f79);
- assert (it != end);
- assert (*it++ == 0x03c3);
- assert (it != end);
- assert (*it++ == 0x03bc);
- assert (it != end);
- assert (*it++ == 0x03b5);
- assert (it != end);
- assert (*it++ == 0x0020);
- assert (it == end);
-}
-
-
-void TextIteratorTest::testSwap()
-{
- Latin1Encoding encoding;
- std::string text("x");
- TextIterator it1(text, encoding);
- TextIterator it2(text, encoding);
- TextIterator end(text);
-
- assert (it1 == it2);
- it2.swap(end);
- assert (it1 != it2);
- it2.swap(end);
- assert (it1 == it2);
-}
-
-
-void TextIteratorTest::setUp()
-{
-}
-
-
-void TextIteratorTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TextIteratorTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TextIteratorTest");
-
- CppUnit_addTest(pSuite, TextIteratorTest, testEmptyLatin1);
- CppUnit_addTest(pSuite, TextIteratorTest, testOneLatin1);
- CppUnit_addTest(pSuite, TextIteratorTest, testLatin1);
- CppUnit_addTest(pSuite, TextIteratorTest, testEmptyUTF8);
- CppUnit_addTest(pSuite, TextIteratorTest, testOneUTF8);
- CppUnit_addTest(pSuite, TextIteratorTest, testUTF8);
- CppUnit_addTest(pSuite, TextIteratorTest, testSwap);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TextIteratorTest.h b/Utilities/Poco/Foundation/testsuite/src/TextIteratorTest.h
deleted file mode 100755
index 75de14c6af..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TextIteratorTest.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// TextIteratorTest.h
-//
-// $Id$
-//
-// Definition of the TextIteratorTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TextIteratorTest_INCLUDED
-#define TextIteratorTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TextIteratorTest: public CppUnit::TestCase
-{
-public:
- TextIteratorTest(const std::string& name);
- ~TextIteratorTest();
-
- void testEmptyLatin1();
- void testOneLatin1();
- void testLatin1();
- void testEmptyUTF8();
- void testOneUTF8();
- void testUTF8();
- void testSwap();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TextIteratorTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TextTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/TextTestSuite.cpp
deleted file mode 100755
index da744b78a3..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TextTestSuite.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// TextTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TextTestSuite.h"
-#include "TextIteratorTest.h"
-#include "TextConverterTest.h"
-#include "StreamConverterTest.h"
-#include "TextEncodingTest.h"
-#include "UTF8StringTest.h"
-
-
-CppUnit::Test* TextTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TextTestSuite");
-
- pSuite->addTest(TextIteratorTest::suite());
- pSuite->addTest(TextConverterTest::suite());
- pSuite->addTest(StreamConverterTest::suite());
- pSuite->addTest(TextEncodingTest::suite());
- pSuite->addTest(UTF8StringTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TextTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/TextTestSuite.h
deleted file mode 100755
index 0f6829a979..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TextTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// TextTestSuite.h
-//
-// $Id$
-//
-// Definition of the TextTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TextTestSuite_INCLUDED
-#define TextTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class TextTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // TextTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ThreadLocalTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ThreadLocalTest.cpp
deleted file mode 100755
index da3ae6e372..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ThreadLocalTest.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// ThreadLocalTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ThreadLocalTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/ThreadLocal.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-
-
-using Poco::ThreadLocal;
-using Poco::Thread;
-using Poco::Runnable;
-
-
-class TLTestRunnable: public Runnable
-{
-public:
- TLTestRunnable(int n): _n(n)
- {
- }
-
- void run()
- {
- *_count = 0;
- for (int i = 0; i < _n; ++i)
- ++(*_count);
- _result = *_count;
- }
-
- int result()
- {
- return _result;
- }
-
-private:
- int _n;
- int _result;
- static ThreadLocal<int> _count;
-};
-
-
-struct TLTestStruct
-{
- int i;
- std::string s;
-};
-
-
-ThreadLocal<int> TLTestRunnable::_count;
-
-
-ThreadLocalTest::ThreadLocalTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ThreadLocalTest::~ThreadLocalTest()
-{
-}
-
-
-void ThreadLocalTest::testLocality()
-{
- TLTestRunnable r1(5000);
- TLTestRunnable r2(7500);
- TLTestRunnable r3(6000);
- Thread t1;
- Thread t2;
- Thread t3;
- t1.start(r1);
- t2.start(r2);
- t3.start(r3);
- t1.join();
- t2.join();
- t3.join();
-
- assert (r1.result() == 5000);
- assert (r2.result() == 7500);
- assert (r3.result() == 6000);
-}
-
-
-void ThreadLocalTest::testAccessors()
-{
- ThreadLocal<TLTestStruct> ts;
- ts->i = 100;
- ts->s = "foo";
- assert ((*ts).i == 100);
- assert ((*ts).s == "foo");
- assert (ts.get().i == 100);
- assert (ts.get().s == "foo");
-}
-
-
-void ThreadLocalTest::setUp()
-{
-}
-
-
-void ThreadLocalTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ThreadLocalTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ThreadLocalTest");
-
- CppUnit_addTest(pSuite, ThreadLocalTest, testLocality);
- CppUnit_addTest(pSuite, ThreadLocalTest, testAccessors);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ThreadLocalTest.h b/Utilities/Poco/Foundation/testsuite/src/ThreadLocalTest.h
deleted file mode 100755
index 31380c27df..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ThreadLocalTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// ThreadLocalTest.h
-//
-// $Id$
-//
-// Definition of the ThreadLocalTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ThreadLocalTest_INCLUDED
-#define ThreadLocalTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ThreadLocalTest: public CppUnit::TestCase
-{
-public:
- ThreadLocalTest(const std::string& name);
- ~ThreadLocalTest();
-
- void testLocality();
- void testAccessors();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ThreadLocalTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ThreadPoolTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ThreadPoolTest.cpp
deleted file mode 100755
index 1a37914de3..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ThreadPoolTest.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-//
-// ThreadPoolTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ThreadPoolTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/ThreadPool.h"
-#include "Poco/RunnableAdapter.h"
-#include "Poco/Exception.h"
-#include "Poco/Thread.h"
-
-
-using Poco::ThreadPool;
-using Poco::RunnableAdapter;
-using Poco::Thread;
-
-
-ThreadPoolTest::ThreadPoolTest(const std::string& name): CppUnit::TestCase(name), _event(false)
-{
-}
-
-
-ThreadPoolTest::~ThreadPoolTest()
-{
-}
-
-
-void ThreadPoolTest::testThreadPool()
-{
- ThreadPool pool(2, 3, 3);
- pool.setStackSize(1);
-
- assert (pool.allocated() == 2);
- assert (pool.used() == 0);
- assert (pool.capacity() == 3);
- assert (pool.available() == 3);
- pool.addCapacity(1);
- assert (pool.allocated() == 2);
- assert (pool.used() == 0);
- assert (pool.capacity() == 4);
- assert (pool.available() == 4);
-
- RunnableAdapter<ThreadPoolTest> ra(*this, &ThreadPoolTest::count);
- pool.start(ra);
- assert (pool.allocated() == 2);
- assert (pool.used() == 1);
- assert (pool.capacity() == 4);
- assert (pool.available() == 3);
-
- pool.start(ra);
- assert (pool.allocated() == 2);
- assert (pool.used() == 2);
- assert (pool.capacity() == 4);
- assert (pool.available() == 2);
-
- pool.start(ra);
- assert (pool.allocated() == 3);
- assert (pool.used() == 3);
- assert (pool.capacity() == 4);
- assert (pool.available() == 1);
-
- pool.start(ra);
- assert (pool.allocated() == 4);
- assert (pool.used() == 4);
- assert (pool.capacity() == 4);
- assert (pool.available() == 0);
-
- try
- {
- pool.start(ra);
- failmsg("thread pool exhausted - must throw exception");
- }
- catch (Poco::NoThreadAvailableException&)
- {
- }
- catch (...)
- {
- failmsg("wrong exception thrown");
- }
-
- _event.set(); // go!!!
- pool.joinAll();
-
- assert (_count == 40000);
-
- assert (pool.allocated() == 4);
- assert (pool.used() == 0);
- assert (pool.capacity() == 4);
- assert (pool.available() == 4);
-
- Thread::sleep(4000);
-
- pool.collect();
- assert (pool.allocated() == 2);
- assert (pool.used() == 0);
- assert (pool.capacity() == 4);
- assert (pool.available() == 4);
-
- _count = 0;
- _event.reset();
- pool.start(ra);
- assert (pool.allocated() == 2);
- assert (pool.used() == 1);
- assert (pool.capacity() == 4);
- assert (pool.available() == 3);
-
- pool.start(ra);
- assert (pool.allocated() == 2);
- assert (pool.used() == 2);
- assert (pool.capacity() == 4);
- assert (pool.available() == 2);
- _event.set(); // go!!!
- pool.joinAll();
-
- assert (_count == 20000);
-
- assert (pool.allocated() == 2);
- assert (pool.used() == 0);
- assert (pool.capacity() == 4);
- assert (pool.available() == 4);
-}
-
-
-void ThreadPoolTest::setUp()
-{
- _event.reset();
- _count = 0;
-}
-
-
-void ThreadPoolTest::tearDown()
-{
-}
-
-
-void ThreadPoolTest::count()
-{
- _event.wait();
- for (int i = 0; i < 10000; ++i)
- {
- _mutex.lock();
- ++_count;
- _mutex.unlock();
- }
-}
-
-
-CppUnit::Test* ThreadPoolTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ThreadPoolTest");
-
- CppUnit_addTest(pSuite, ThreadPoolTest, testThreadPool);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ThreadPoolTest.h b/Utilities/Poco/Foundation/testsuite/src/ThreadPoolTest.h
deleted file mode 100755
index e5abefde37..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ThreadPoolTest.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// ThreadPoolTest.h
-//
-// $Id$
-//
-// Definition of the ThreadPoolTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ThreadPoolTest_INCLUDED
-#define ThreadPoolTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/Event.h"
-#include "Poco/Mutex.h"
-
-
-class ThreadPoolTest: public CppUnit::TestCase
-{
-public:
- ThreadPoolTest(const std::string& name);
- ~ThreadPoolTest();
-
- void testThreadPool();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-protected:
- void count();
-
-private:
- Poco::FastMutex _mutex;
- Poco::Event _event;
- int _count;
-};
-
-
-#endif // ThreadPoolTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ThreadTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ThreadTest.cpp
deleted file mode 100755
index 5f2b54c03b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ThreadTest.cpp
+++ /dev/null
@@ -1,339 +0,0 @@
-//
-// ThreadTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ThreadTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-#include "Poco/ThreadTarget.h"
-#include "Poco/Event.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Timespan.h"
-#include <iostream>
-#if defined(__sun) && defined(__SVR4)
-#define __EXTENSIONS__
-#endif
-#include <climits>
-
-
-using Poco::Thread;
-using Poco::Runnable;
-using Poco::ThreadTarget;
-using Poco::Event;
-
-
-class MyRunnable: public Runnable
-{
-public:
- MyRunnable(): _ran(false)
- {
- }
-
- void run()
- {
- Thread* pThread = Thread::current();
- if (pThread)
- _threadName = pThread->name();
- _ran = true;
- _event.wait();
- }
-
- bool ran() const
- {
- return _ran;
- }
-
- const std::string& threadName() const
- {
- return _threadName;
- }
-
- void notify()
- {
- _event.set();
- }
-
- static void staticFunc()
- {
- ++_staticVar;
- }
-
- static int _staticVar;
-
-private:
- bool _ran;
- std::string _threadName;
- Event _event;
-};
-
-
-int MyRunnable::_staticVar = 0;
-
-
-void freeFunc()
-{
- ++MyRunnable::_staticVar;
-}
-
-
-void freeFunc(void* pData)
-{
- MyRunnable::_staticVar += *reinterpret_cast<int*>(pData);
-}
-
-
-ThreadTest::ThreadTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ThreadTest::~ThreadTest()
-{
-}
-
-
-void ThreadTest::testThread()
-{
- Thread thread;
- MyRunnable r;
- assert (!thread.isRunning());
- thread.start(r);
- Thread::sleep(200);
- assert (thread.isRunning());
- r.notify();
- thread.join();
- assert (!thread.isRunning());
- assert (r.ran());
- assert (!r.threadName().empty());
-}
-
-
-void ThreadTest::testNamedThread()
-{
- Thread thread("MyThread");
- MyRunnable r;
- thread.start(r);
- r.notify();
- thread.join();
- assert (r.ran());
- assert (r.threadName() == "MyThread");
-}
-
-
-void ThreadTest::testCurrent()
-{
- assertNullPtr (Thread::current());
-}
-
-
-void ThreadTest::testThreads()
-{
- Thread thread1("Thread1");
- Thread thread2("Thread2");
- Thread thread3("Thread3");
- Thread thread4("Thread4");
-
- MyRunnable r1;
- MyRunnable r2;
- MyRunnable r3;
- MyRunnable r4;
- assert (!thread1.isRunning());
- assert (!thread2.isRunning());
- assert (!thread3.isRunning());
- assert (!thread4.isRunning());
- thread1.start(r1);
- Thread::sleep(200);
- assert (thread1.isRunning());
- assert (!thread2.isRunning());
- assert (!thread3.isRunning());
- assert (!thread4.isRunning());
- thread2.start(r2);
- thread3.start(r3);
- thread4.start(r4);
- Thread::sleep(200);
- assert (thread1.isRunning());
- assert (thread2.isRunning());
- assert (thread3.isRunning());
- assert (thread4.isRunning());
- r4.notify();
- thread4.join();
- assert (!thread4.isRunning());
- assert (thread1.isRunning());
- assert (thread2.isRunning());
- assert (thread3.isRunning());
- r3.notify();
- thread3.join();
- assert (!thread3.isRunning());
- r2.notify();
- thread2.join();
- assert (!thread2.isRunning());
- r1.notify();
- thread1.join();
- assert (!thread1.isRunning());
- assert (r1.ran());
- assert (r1.threadName() == "Thread1");
- assert (r2.ran());
- assert (r2.threadName() == "Thread2");
- assert (r3.ran());
- assert (r3.threadName() == "Thread3");
- assert (r4.ran());
- assert (r4.threadName() == "Thread4");
-}
-
-
-void ThreadTest::testJoin()
-{
- Thread thread;
- MyRunnable r;
- assert (!thread.isRunning());
- thread.start(r);
- Thread::sleep(200);
- assert (thread.isRunning());
- assert (!thread.tryJoin(100));
- r.notify();
- assert (thread.tryJoin(500));
- assert (!thread.isRunning());
-}
-
-
-void ThreadTest::testThreadTarget()
-{
- ThreadTarget te(&MyRunnable::staticFunc);
- Thread thread;
-
- assert (!thread.isRunning());
-
- int tmp = MyRunnable::_staticVar;
- thread.start(te);
- thread.join();
- assert (tmp + 1 == MyRunnable::_staticVar);
-
- ThreadTarget te1(freeFunc);
- assert (!thread.isRunning());
-
- tmp = MyRunnable::_staticVar;
- thread.start(te1);
- thread.join();
- assert (tmp + 1 == MyRunnable::_staticVar);
-}
-
-
-void ThreadTest::testThreadFunction()
-{
- Thread thread;
-
- assert (!thread.isRunning());
-
- int tmp = MyRunnable::_staticVar;
- thread.start(freeFunc, &tmp);
- thread.join();
- assert (tmp * 2 == MyRunnable::_staticVar);
-
- assert (!thread.isRunning());
-
- tmp = MyRunnable::_staticVar = 0;
- thread.start(freeFunc, &tmp);
- thread.join();
- assert (0 == MyRunnable::_staticVar);
-}
-
-
-void ThreadTest::testThreadStackSize()
-{
- int stackSize = 50000000;
-
- Thread thread;
- assert (0 == thread.getStackSize());
- thread.setStackSize(stackSize);
- assert (stackSize <= thread.getStackSize());
- int tmp = MyRunnable::_staticVar;
- thread.start(freeFunc, &tmp);
- thread.join();
- assert (tmp * 2 == MyRunnable::_staticVar);
-
- stackSize = 1;
- thread.setStackSize(stackSize);
-#ifdef PTHREAD_STACK_MIN
- assert (PTHREAD_STACK_MIN == thread.getStackSize());
-#else
- assert (stackSize >= thread.getStackSize());
-#endif
- tmp = MyRunnable::_staticVar;
- thread.start(freeFunc, &tmp);
- thread.join();
- assert (tmp * 2 == MyRunnable::_staticVar);
-
- thread.setStackSize(0);
- assert (0 == thread.getStackSize());
- tmp = MyRunnable::_staticVar;
- thread.start(freeFunc, &tmp);
- thread.join();
- assert (tmp * 2 == MyRunnable::_staticVar);
-}
-
-
-void ThreadTest::testSleep()
-{
- Poco::Timestamp start;
- Thread::sleep(200);
- Poco::Timespan elapsed = start.elapsed();
- assert (elapsed.totalMilliseconds() >= 190 && elapsed.totalMilliseconds() < 250);
-}
-
-
-void ThreadTest::setUp()
-{
-}
-
-
-void ThreadTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ThreadTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ThreadTest");
-
- CppUnit_addTest(pSuite, ThreadTest, testThread);
- CppUnit_addTest(pSuite, ThreadTest, testNamedThread);
- CppUnit_addTest(pSuite, ThreadTest, testCurrent);
- CppUnit_addTest(pSuite, ThreadTest, testThreads);
- CppUnit_addTest(pSuite, ThreadTest, testJoin);
- CppUnit_addTest(pSuite, ThreadTest, testThreadTarget);
- CppUnit_addTest(pSuite, ThreadTest, testThreadFunction);
- CppUnit_addTest(pSuite, ThreadTest, testThreadStackSize);
- CppUnit_addTest(pSuite, ThreadTest, testSleep);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ThreadTest.h b/Utilities/Poco/Foundation/testsuite/src/ThreadTest.h
deleted file mode 100755
index 728a4aa691..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ThreadTest.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// ThreadTest.h
-//
-// $Id$
-//
-// Definition of the ThreadTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ThreadTest_INCLUDED
-#define ThreadTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ThreadTest: public CppUnit::TestCase
-{
-public:
- ThreadTest(const std::string& name);
- ~ThreadTest();
-
- void testThread();
- void testNamedThread();
- void testCurrent();
- void testThreads();
- void testJoin();
- void testThreadTarget();
- void testThreadFunction();
- void testThreadStackSize();
- void testSleep();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ThreadTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/ThreadingTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/ThreadingTestSuite.cpp
deleted file mode 100755
index 989edc939f..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ThreadingTestSuite.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// ThreadingTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ThreadingTestSuite.h"
-#include "ThreadTest.h"
-#include "SemaphoreTest.h"
-#include "RWLockTest.h"
-#include "ThreadPoolTest.h"
-#include "TimerTest.h"
-#include "ThreadLocalTest.h"
-#include "ActivityTest.h"
-#include "ActiveMethodTest.h"
-#include "ActiveDispatcherTest.h"
-#include "ConditionTest.h"
-
-
-CppUnit::Test* ThreadingTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ThreadingTestSuite");
-
- pSuite->addTest(ThreadTest::suite());
- pSuite->addTest(SemaphoreTest::suite());
- pSuite->addTest(RWLockTest::suite());
- pSuite->addTest(ThreadPoolTest::suite());
- pSuite->addTest(TimerTest::suite());
- pSuite->addTest(ThreadLocalTest::suite());
- pSuite->addTest(ActivityTest::suite());
- pSuite->addTest(ActiveMethodTest::suite());
- pSuite->addTest(ActiveDispatcherTest::suite());
- pSuite->addTest(ConditionTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ThreadingTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/ThreadingTestSuite.h
deleted file mode 100755
index 2d7c9a27b6..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ThreadingTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// ThreadingTestSuite.h
-//
-// $Id$
-//
-// Definition of the ThreadingTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ThreadingTestSuite_INCLUDED
-#define ThreadingTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class ThreadingTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // ThreadingTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TimedNotificationQueueTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TimedNotificationQueueTest.cpp
deleted file mode 100644
index 0f8983e6ce..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TimedNotificationQueueTest.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-//
-// TimedNotificationQueueTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2009, 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 "TimedNotificationQueueTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/TimedNotificationQueue.h"
-#include "Poco/Notification.h"
-#include "Poco/Timestamp.h"
-
-
-using Poco::TimedNotificationQueue;
-using Poco::Notification;
-using Poco::Timestamp;
-
-
-namespace
-{
- class QTestNotification: public Notification
- {
- public:
- QTestNotification(const std::string& data): _data(data)
- {
- }
- ~QTestNotification()
- {
- }
- const std::string& data() const
- {
- return _data;
- }
-
- private:
- std::string _data;
- };
-}
-
-
-TimedNotificationQueueTest::TimedNotificationQueueTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TimedNotificationQueueTest::~TimedNotificationQueueTest()
-{
-}
-
-
-void TimedNotificationQueueTest::testDequeue()
-{
- TimedNotificationQueue queue;
- assert (queue.empty());
- assert (queue.size() == 0);
- Notification* pNf = queue.dequeueNotification();
- assertNullPtr(pNf);
- queue.enqueueNotification(new Notification, Timestamp());
- assert (!queue.empty());
- assert (queue.size() == 1);
- pNf = queue.dequeueNotification();
- assertNotNullPtr(pNf);
- assert (queue.empty());
- assert (queue.size() == 0);
- pNf->release();
-
- Poco::Timestamp ts1;
- ts1 += 100000;
- Poco::Timestamp ts2;
- ts2 += 200000;
- Poco::Timestamp ts3;
- ts3 += 300000;
- Poco::Timestamp ts4;
- ts4 += 400000;
-
- queue.enqueueNotification(new QTestNotification("first"), ts1);
- queue.enqueueNotification(new QTestNotification("fourth"), ts4);
- queue.enqueueNotification(new QTestNotification("third"), ts3);
- queue.enqueueNotification(new QTestNotification("second"), ts2);
- assert (!queue.empty());
- assert (queue.size() == 4);
- QTestNotification* pTNf = 0;
- while (!pTNf)
- {
- pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- }
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "first");
- pTNf->release();
- assert (ts1.elapsed() >= 0);
- assert (!queue.empty());
- assert (queue.size() == 3);
-
- pTNf = 0;
- while (!pTNf)
- {
- pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- }
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "second");
- pTNf->release();
- assert (ts2.elapsed() >= 0);
- assert (!queue.empty());
- assert (queue.size() == 2);
-
- pTNf = 0;
- while (!pTNf)
- {
- pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- }
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "third");
- pTNf->release();
- assert (ts3.elapsed() >= 0);
- assert (!queue.empty());
- assert (queue.size() == 1);
-
- pTNf = 0;
- while (!pTNf)
- {
- pTNf = dynamic_cast<QTestNotification*>(queue.dequeueNotification());
- }
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "fourth");
- pTNf->release();
- assert (ts4.elapsed() >= 0);
- assert (queue.empty());
- assert (queue.size() == 0);
-
- pNf = queue.dequeueNotification();
- assertNullPtr(pNf);
-}
-
-
-void TimedNotificationQueueTest::testWaitDequeue()
-{
- TimedNotificationQueue queue;
-
- Poco::Timestamp ts1;
- ts1 += 100000;
- Poco::Timestamp ts2;
- ts2 += 200000;
- Poco::Timestamp ts3;
- ts3 += 300000;
- Poco::Timestamp ts4;
- ts4 += 400000;
-
- queue.enqueueNotification(new QTestNotification("first"), ts1);
- queue.enqueueNotification(new QTestNotification("fourth"), ts4);
- queue.enqueueNotification(new QTestNotification("third"), ts3);
- queue.enqueueNotification(new QTestNotification("second"), ts2);
- assert (!queue.empty());
- assert (queue.size() == 4);
- QTestNotification* pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "first");
- pTNf->release();
- assert (ts1.elapsed() >= 0);
- assert (!queue.empty());
- assert (queue.size() == 3);
-
- pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "second");
- pTNf->release();
- assert (ts2.elapsed() >= 0);
- assert (!queue.empty());
- assert (queue.size() == 2);
-
- pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "third");
- pTNf->release();
- assert (ts3.elapsed() >= 0);
- assert (!queue.empty());
- assert (queue.size() == 1);
-
- pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification());
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "fourth");
- pTNf->release();
- assert (ts4.elapsed() >= 0);
- assert (queue.empty());
- assert (queue.size() == 0);
-}
-
-
-void TimedNotificationQueueTest::testWaitDequeueTimeout()
-{
- TimedNotificationQueue queue;
-
- Poco::Timestamp ts1;
- ts1 += 200000;
- Poco::Timestamp ts2;
- ts2 += 400000;
- Poco::Timestamp ts3;
- ts3 += 600000;
- Poco::Timestamp ts4;
- ts4 += 800000;
-
- queue.enqueueNotification(new QTestNotification("first"), ts1);
- queue.enqueueNotification(new QTestNotification("fourth"), ts4);
- queue.enqueueNotification(new QTestNotification("third"), ts3);
- queue.enqueueNotification(new QTestNotification("second"), ts2);
- assert (!queue.empty());
- assert (queue.size() == 4);
- QTestNotification* pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification(10));
- assertNullPtr(pTNf);
- pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification(20));
- assertNullPtr(pTNf);
- pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification(200));
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "first");
- pTNf->release();
- assert (ts1.elapsed() >= 0);
- assert (!queue.empty());
- assert (queue.size() == 3);
-
- pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification(220));
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "second");
- pTNf->release();
- assert (ts2.elapsed() >= 0);
- assert (!queue.empty());
- assert (queue.size() == 2);
-
- pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification(220));
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "third");
- pTNf->release();
- assert (ts3.elapsed() >= 0);
- assert (!queue.empty());
- assert (queue.size() == 1);
-
- pTNf = dynamic_cast<QTestNotification*>(queue.waitDequeueNotification(220));
- assertNotNullPtr(pTNf);
- assert (pTNf->data() == "fourth");
- pTNf->release();
- assert (ts1.elapsed() >= 0);
- assert (queue.empty());
- assert (queue.size() == 0);
-}
-
-
-void TimedNotificationQueueTest::setUp()
-{
-}
-
-
-void TimedNotificationQueueTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TimedNotificationQueueTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TimedNotificationQueueTest");
-
- CppUnit_addTest(pSuite, TimedNotificationQueueTest, testDequeue);
- CppUnit_addTest(pSuite, TimedNotificationQueueTest, testWaitDequeue);
- CppUnit_addTest(pSuite, TimedNotificationQueueTest, testWaitDequeueTimeout);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TimedNotificationQueueTest.h b/Utilities/Poco/Foundation/testsuite/src/TimedNotificationQueueTest.h
deleted file mode 100644
index f6df50c548..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TimedNotificationQueueTest.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// TimedNotificationQueueTest.h
-//
-// $Id$
-//
-// Definition of the TimedNotificationQueueTest class.
-//
-// Copyright (c) 2009, 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.
-//
-
-
-#ifndef TimedNotificationQueueTest_INCLUDED
-#define TimedNotificationQueueTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/TimedNotificationQueue.h"
-#include "Poco/Mutex.h"
-#include <set>
-
-
-class TimedNotificationQueueTest: public CppUnit::TestCase
-{
-public:
- TimedNotificationQueueTest(const std::string& name);
- ~TimedNotificationQueueTest();
-
- void testDequeue();
- void testWaitDequeue();
- void testWaitDequeueTimeout();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-protected:
- void work();
-
-private:
-};
-
-
-#endif // TimedNotificationQueueTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TimerTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TimerTest.cpp
deleted file mode 100755
index 00955af768..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TimerTest.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// TimerTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TimerTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Thread.h"
-#include "Poco/Stopwatch.h"
-
-
-using Poco::Timer;
-using Poco::TimerCallback;
-using Poco::Thread;
-using Poco::Stopwatch;
-
-
-TimerTest::TimerTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TimerTest::~TimerTest()
-{
-}
-
-
-void TimerTest::testTimer()
-{
- Timer t(100, 200);
- assert (t.getStartInterval() == 100);
- assert (t.getPeriodicInterval() == 200);
-
- Stopwatch sw;
- TimerCallback<TimerTest> tc(*this, &TimerTest::onTimer);
- sw.start();
- t.start(tc);
- _event.wait();
- sw.stop();
- assert (sw.elapsed() >= 90000 && sw.elapsed() < 150000);
- sw.restart();
- _event.wait();
- sw.stop();
- assert (sw.elapsed() >= 190000 && sw.elapsed() < 250000);
- sw.restart();
- _event.wait();
- sw.stop();
- assert (sw.elapsed() >= 190000 && sw.elapsed() < 250000);
- t.stop();
-}
-
-
-void TimerTest::testDuplicateStop()
-{
- Timer t(100, 200);
- t.stop();
- t.stop();
-
- TimerCallback<TimerTest> tc(*this, &TimerTest::onTimer);
- t.start(tc);
- _event.wait();
- t.stop();
- t.stop();
-}
-
-void TimerTest::setUp()
-{
-}
-
-
-void TimerTest::tearDown()
-{
-}
-
-
-void TimerTest::onTimer(Timer& timer)
-{
- _event.set();
-}
-
-
-CppUnit::Test* TimerTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TimerTest");
-
- CppUnit_addTest(pSuite, TimerTest, testTimer);
- CppUnit_addTest(pSuite, TimerTest, testDuplicateStop);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TimerTest.h b/Utilities/Poco/Foundation/testsuite/src/TimerTest.h
deleted file mode 100755
index 632dc1c001..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TimerTest.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// TimerTest.h
-//
-// $Id$
-//
-// Definition of the TimerTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TimerTest_INCLUDED
-#define TimerTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/Timer.h"
-#include "Poco/Event.h"
-
-
-class TimerTest: public CppUnit::TestCase
-{
-public:
- TimerTest(const std::string& name);
- ~TimerTest();
-
- void testTimer();
- void testDuplicateStop();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-protected:
- void onTimer(Poco::Timer& t);
-
-private:
- Poco::Event _event;
-};
-
-
-#endif // TimerTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TimespanTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TimespanTest.cpp
deleted file mode 100755
index 0d818b712c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TimespanTest.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-//
-// TimespanTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TimespanTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Timespan.h"
-
-
-using Poco::Timespan;
-
-
-TimespanTest::TimespanTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TimespanTest::~TimespanTest()
-{
-}
-
-
-void TimespanTest::testConversions()
-{
- Timespan ts;
- assert (ts.totalMicroseconds() == 0);
- ts = Timespan::DAYS;
- assert (ts.totalMicroseconds() == Timespan::DAYS);
- assert (ts.totalMilliseconds() == 86400000);
- assert (ts.totalSeconds() == 86400);
- assert (ts.totalMinutes() == 60*24);
- assert (ts.totalHours() == 24);
- assert (ts.days() == 1);
-
- assert (ts.microseconds() == 0);
- assert (ts.milliseconds() == 0);
- assert (ts.seconds() == 0);
- assert (ts.minutes() == 0);
- assert (ts.hours() == 0);
-
- ts.assign(2, 12, 30, 10, 123456);
- assert (ts.microseconds() == 456);
- assert (ts.milliseconds() == 123);
- assert (ts.seconds() == 10);
- assert (ts.minutes() == 30);
- assert (ts.hours() == 12);
- assert (ts.days() == 2);
-
- ts.assign(0, 36, 30, 10, 123456);
- assert (ts.microseconds() == 456);
- assert (ts.milliseconds() == 123);
- assert (ts.useconds() == 123456);
- assert (ts.seconds() == 10);
- assert (ts.minutes() == 30);
- assert (ts.hours() == 12);
- assert (ts.days() == 1);
-
- ts.assign(0, 0, 2190, 10, 123456);
- assert (ts.microseconds() == 456);
- assert (ts.milliseconds() == 123);
- assert (ts.useconds() == 123456);
- assert (ts.seconds() == 10);
- assert (ts.minutes() == 30);
- assert (ts.hours() == 12);
- assert (ts.days() == 1);
-}
-
-
-void TimespanTest::testComparisons()
-{
- Timespan ts1(10000000);
- Timespan ts2(20000000);
- Timespan ts3(20000000);
-
- assert (ts1 != ts2);
- assert (!(ts1 == ts2));
- assert (ts1 <= ts2);
- assert (ts1 < ts2);
- assert (ts2 > ts1);
- assert (ts2 >= ts1);
-
- assert (ts2 == ts3);
- assert (!(ts2 != ts3));
- assert (ts2 >= ts3);
- assert (ts2 <= ts3);
- assert (!(ts2 > ts3));
- assert (!(ts2 < ts3));
-
- assert (ts1 == 10000000);
- assert (ts1 != 20000000);
- assert (ts1 <= 10000000);
- assert (ts1 <= 20000000);
- assert (ts1 >= 10000000);
- assert (ts1 >= 5000000);
- assert (ts1 < 20000000);
- assert (ts1 > 5000000);
-}
-
-
-void TimespanTest::testArithmetics()
-{
- Timespan ts1(100000000);
- Timespan ts2(50000000);
- Timespan ts3;
- ts3 = ts1 + ts2;
- assert (ts3 == 150000000);
- ts3 = ts1 + 30000000;
- assert (ts3 == 130000000);
- ts3 = ts1 - ts2;
- assert (ts3 == 50000000);
- ts3 = ts1 - 20000000;
- assert (ts3 == 80000000);
- ts3 += 20000000;
- assert (ts3 == ts1);
- ts3 -= ts2;
- assert (ts3 == ts2);
-}
-
-
-void TimespanTest::testSwap()
-{
- Timespan ts1(10000000);
- Timespan ts2(50000000);
-
- assert (ts1 < ts2);
- ts1.swap(ts2);
- assert (ts2 < ts1);
-}
-
-
-void TimespanTest::setUp()
-{
-}
-
-
-void TimespanTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TimespanTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TimespanTest");
-
- CppUnit_addTest(pSuite, TimespanTest, testConversions);
- CppUnit_addTest(pSuite, TimespanTest, testComparisons);
- CppUnit_addTest(pSuite, TimespanTest, testArithmetics);
- CppUnit_addTest(pSuite, TimespanTest, testSwap);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TimespanTest.h b/Utilities/Poco/Foundation/testsuite/src/TimespanTest.h
deleted file mode 100755
index 9faba6716c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TimespanTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// TimespanTest.h
-//
-// $Id$
-//
-// Definition of the TimespanTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TimespanTest_INCLUDED
-#define TimespanTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TimespanTest: public CppUnit::TestCase
-{
-public:
- TimespanTest(const std::string& name);
- ~TimespanTest();
-
- void testConversions();
- void testComparisons();
- void testArithmetics();
- void testSwap();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TimespanTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TimestampTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TimestampTest.cpp
deleted file mode 100755
index f27d6da96f..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TimestampTest.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// TimestampTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TimestampTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Thread.h"
-
-
-using Poco::Timestamp;
-using Poco::Thread;
-
-
-TimestampTest::TimestampTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TimestampTest::~TimestampTest()
-{
-}
-
-
-void TimestampTest::testTimestamp()
-{
- Timestamp t1;
- Thread::sleep(200);
- Timestamp t2;
- Timestamp t3 = t2;
- assert (t1 != t2);
- assert (!(t1 == t2));
- assert (t2 > t1);
- assert (t2 >= t1);
- assert (!(t1 > t2));
- assert (!(t1 >= t2));
- assert (t2 == t3);
- assert (!(t2 != t3));
- assert (t2 >= t3);
- assert (t2 <= t3);
- Timestamp::TimeDiff d = (t2 - t1);
- assert (d >= 180000 && d <= 300000);
-
- t1.swap(t2);
- assert (t1 > t2);
- t2.swap(t1);
-
- Timestamp::UtcTimeVal tv = t1.utcTime();
- Timestamp t4 = Timestamp::fromUtcTime(tv);
- assert (t1 == t4);
-
- Timestamp epoch(0);
- tv = epoch.utcTime();
- assert (tv >> 32 == 0x01B21DD2);
- assert ((tv & 0xFFFFFFFF) == 0x13814000);
-
- Timestamp now;
- Thread::sleep(201);
- assert (now.elapsed() >= 200000);
- assert (now.isElapsed(200000));
- assert (!now.isElapsed(2000000));
-
-#if defined(_WIN32)
- {
- Timestamp now;
- Poco::UInt32 low;
- Poco::UInt32 high;
- now.toFileTimeNP(low, high);
- Timestamp ts = Timestamp::fromFileTimeNP(low, high);
- assert (now == ts);
- }
-#endif
-}
-
-
-void TimestampTest::setUp()
-{
-}
-
-
-void TimestampTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TimestampTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TimestampTest");
-
- CppUnit_addTest(pSuite, TimestampTest, testTimestamp);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TimestampTest.h b/Utilities/Poco/Foundation/testsuite/src/TimestampTest.h
deleted file mode 100755
index ab6c816ab1..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TimestampTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// TimestampTest.h
-//
-// $Id$
-//
-// Definition of the TimestampTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TimestampTest_INCLUDED
-#define TimestampTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TimestampTest: public CppUnit::TestCase
-{
-public:
- TimestampTest(const std::string& name);
- ~TimestampTest();
-
- void testTimestamp();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TimestampTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TimezoneTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TimezoneTest.cpp
deleted file mode 100755
index 08042d2cd0..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TimezoneTest.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// TimezoneTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TimezoneTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Timezone.h"
-#include <iostream>
-
-
-using Poco::Timezone;
-
-
-TimezoneTest::TimezoneTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TimezoneTest::~TimezoneTest()
-{
-}
-
-
-void TimezoneTest::testTimezone()
-{
- std::string name = Timezone::name();
- std::string stdName = Timezone::standardName();
- std::string dstName = Timezone::dstName();
- std::cout << "Timezone Names: " << name << ", " << stdName << ", " << dstName << std::endl;
- int utcOffset = Timezone::utcOffset();
- std::cout << "UTC Offset: " << utcOffset << std::endl;
- int dst = Timezone::dst();
- std::cout << "DST Offset: " << dst << std::endl;
-}
-
-
-void TimezoneTest::setUp()
-{
-}
-
-
-void TimezoneTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TimezoneTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TimezoneTest");
-
- CppUnit_addTest(pSuite, TimezoneTest, testTimezone);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TimezoneTest.h b/Utilities/Poco/Foundation/testsuite/src/TimezoneTest.h
deleted file mode 100755
index 25a247277f..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TimezoneTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// TimezoneTest.h
-//
-// $Id$
-//
-// Definition of the TimezoneTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TimezoneTest_INCLUDED
-#define TimezoneTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TimezoneTest: public CppUnit::TestCase
-{
-public:
- TimezoneTest(const std::string& name);
- ~TimezoneTest();
-
- void testTimezone();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TimezoneTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TuplesTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TuplesTest.cpp
deleted file mode 100755
index b6d8c821ba..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TuplesTest.cpp
+++ /dev/null
@@ -1,607 +0,0 @@
-//
-// TuplesTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "TuplesTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Tuple.h"
-#include "Poco/Void.h"
-#include <algorithm>
-#include <map>
-
-
-using Poco::TypeList;
-using Poco::NullTypeList;
-using Poco::TypeListType;
-using Poco::TypeGetter;
-using Poco::TypeLocator;
-using Poco::TypeAppender;
-using Poco::TypeOneEraser;
-using Poco::TypeAllEraser;
-using Poco::TypeDuplicateEraser;
-using Poco::TypeOneReplacer;
-using Poco::TypeAllReplacer;
-using Poco::Tuple;
-using Poco::Void;
-using Poco::Int8;
-using Poco::UInt8;
-using Poco::Int16;
-using Poco::UInt16;
-using Poco::Int32;
-using Poco::UInt32;
-using Poco::Int8;
-using Poco::UInt8;
-using Poco::Int16;
-using Poco::UInt16;
-using Poco::Int32;
-using Poco::UInt32;
-
-
-TuplesTest::TuplesTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TuplesTest::~TuplesTest()
-{
-}
-
-
-void TuplesTest::testTuple1()
-{
- Tuple<int> t;
- assert (t.length == 1);
- t.set<0>(-1);
- assert (t.get<0>() == -1);
-
- Tuple<int> t2(-1);
- assert (t2.get<0>() == -1);
-
- Tuple<int> tCpy (t2);
- assert (t2.get<0>() == tCpy.get<0>());
- assert (t2 == tCpy);
-
- Tuple<int> tCpy2 = t2;
- assert (t2.get<0>() == tCpy2.get<0>());
- assert (t2 == tCpy2);
- tCpy2.set<0>(888);
- assert (t2 != tCpy2);
- assert (t < tCpy2);
-
- Tuple<int, std::string> t3(0);
- assert (t3.get<1>().empty());
-
- Tuple<int, std::string, std::vector<std::string> > t4(0);
- assert (t4.get<1>().empty());
- assert (t4.get<2>().empty());
-}
-
-
-void TuplesTest::testTuple2()
-{
- Tuple<int, Void> dummy1;
- assert (dummy1.length == 2);
- dummy1.set<0>(-1);
- assert (dummy1.get<0>() == -1);
- //test partial init
- Tuple<int, Void> dummy11(0);
-
- Tuple<Void, int> dummy2;
- dummy2.set<1>(-1);
- assert (dummy2.get<1>() == -1);
-
- Tuple<Void, int> dummy3;
- dummy3.set<1>(-1);
- assert (dummy3.get<1>() == -1);
-
- Tuple<std::string, int> aTuple;
- aTuple.set<0>("str");
- aTuple.set<1>(1);
- assert (aTuple.get<0>() == "str");
- assert (aTuple.get<1>() == 1);
-
- Tuple<std::string, int> aTuple2(aTuple);
- assert (aTuple == aTuple2);
- aTuple2.set<1>(99);
- assert (aTuple != aTuple2);
- aTuple2.set<1>(100000);
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple3()
-{
- Tuple<int, Void, Void> dummy1;
- assert (dummy1.length == 3);
- dummy1.set<0>(-1);
- assert (dummy1.get<0>() == -1);
- //test partial init
- Tuple<int, Void, Void> dummy11(0);
-
- Tuple<Void, int, Void> dummy2;
- dummy2.set<1>(-1);
- assert (dummy2.get<1>() == -1);
-
- Tuple<Void, Void, int> dummy3;
- dummy3.set<2>(-1);
- assert (dummy3.get<2>() == -1);
-
- Tuple<std::string, int, bool> aTuple;
- aTuple.set<0>("str");
- aTuple.set<1>(1);
- aTuple.set<2>(true);
- assert (aTuple.get<0>() == "str");
- assert (aTuple.get<1>() == 1);
- assert (aTuple.get<2>());
-
- Tuple<std::string, int, bool> aTuple2(aTuple);
- assert (aTuple == aTuple2);
- aTuple2.set<2>(false);
- assert (aTuple != aTuple2);
- aTuple2.set<1>(100000);
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple4()
-{
- Tuple<int, Void, Void, Void> dummy1;
- assert (dummy1.length == 4);
- dummy1.set<0>(-1);
- assert (dummy1.get<0>() == -1);
- //test partial init
- Tuple<int, Void, Void, Void> dummy11(0);
-
- Tuple<Void, int, Void, Void> dummy2;
- dummy2.set<1>(-1);
- assert (dummy2.get<1>() == -1);
-
- Tuple<Void, Void, Void, int> dummy3;
- dummy3.set<3>(-1);
- assert (dummy3.get<3>() == -1);
-
- Tuple<std::string, int, bool, float> aTuple;
- aTuple.set<0>("str");
- aTuple.set<1>(1);
- aTuple.set<2>(true);
- aTuple.set<3>(3.14f);
- assert (aTuple.get<0>() == "str");
- assert (aTuple.get<1>() == 1);
- assert (aTuple.get<2>());
- assert (aTuple.get<3>() >= 3.13f && aTuple.get<3>() <= 3.15f);
-
- Tuple<std::string, int, bool, float> aTuple2(aTuple);
- assert (aTuple == aTuple2);
- aTuple2.set<2>(false);
- assert (aTuple != aTuple2);
- aTuple2.set<1>(100000);
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple5()
-{
- Tuple<int, Void, Void, Void, Void> dummy1;
- assert (dummy1.length == 5);
- dummy1.set<0>(-1);
- assert (dummy1.get<0>() == -1);
- //test partial init
- Tuple<int, Void, Void, Void, Void> dummy11(0);
-
- Tuple<Void, int, Void, Void, Void> dummy2;
- dummy2.set<1>(-1);
- assert (dummy2.get<1>() == -1);
-
- Tuple<Void, Void, Void, Void, int> dummy3;
- dummy3.set<4>(-1);
- assert (dummy3.get<4>() == -1);
-
- Tuple<std::string, int, bool, float, char> aTuple;
- aTuple.set<0>("str");
- aTuple.set<1>(1);
- aTuple.set<2>(true);
- aTuple.set<3>(3.14f);
- aTuple.set<4>(' ');
- assert (aTuple.get<0>() == "str");
- assert (aTuple.get<1>() == 1);
- assert (aTuple.get<2>());
- assert (aTuple.get<3>() >= 3.13f && aTuple.get<3>() <= 3.15f);
- assert (aTuple.get<4>() == ' ');
-
- Tuple<std::string, int, bool, float, char> aTuple2(aTuple);
- assert (aTuple == aTuple2);
- aTuple2.set<2>(false);
- assert (aTuple != aTuple2);
- aTuple2.set<1>(100000);
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple6()
-{
- Tuple<std::string, int, bool, float, char, long> aTuple;
- assert (aTuple.length == 6);
- Tuple<std::string, int, bool, float, char, long>
- aTuple2("1", 1, true, 3.14f, 'c', 999);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple7()
-{
- Tuple<std::string, int, bool, float, char, long, double> aTuple;
- assert (aTuple.length == 7);
- Tuple<std::string, int, bool, float, char, long, double>
- aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple8()
-{
- Tuple<std::string, int, bool, float, char, long, double, short> aTuple;
- assert (aTuple.length == 8);
- Tuple<std::string, int, bool, float, char, long, double, short>
- aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-void TuplesTest::testTuple9()
-{
- Tuple<std::string, int, bool, float, char, long, double, short, std::string> aTuple;
- assert (aTuple.length == 9);
- Tuple<std::string, int, bool, float, char, long, double, short, std::string>
- aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2");
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple10()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 10);
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple11()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 11);
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1");
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple12()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string, int> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 12);
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1", 1);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple13()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string, int, bool> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 13);
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1", 1, true);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple14()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string, int, bool, float> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 14);
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1", 1, true, 3.14f);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple15()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string, int, bool, float, char> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 15);
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1", 1, true, 3.14f, 'c');
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple16()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string, int, bool, float, char, long> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 16);
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1", 1, true, 3.14f, 'c', 999);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple17()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string, int, bool, float, char, long, double> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 17);
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1", 1, true, 3.14f, 'c', 999, 33.14);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple18()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string, int, bool, float, char, long, double, short> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 18);
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1", 1, true, 3.14f, 'c', 999, 33.14, 32700);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple19()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string, int, bool, float, char, long, double, short, std::string> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 19);
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2");
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTuple20()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string, int, bool, float, char, long, double, short, std::string, int> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 20);
-
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-}
-
-
-void TuplesTest::testTupleOrder()
-{
- typedef Tuple<std::string, int, bool, float, char, long, double, short, std::string, int,
- std::string, int, bool, float, char, long, double, short, std::string, int> TupleType;
-
- TupleType aTuple;
- assert (aTuple.length == 20);
-
- TupleType aTuple2("1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2, "1", 1, true, 3.14f, 'c', 999, 33.14, 32700, "2", 2);
- assert (aTuple != aTuple2);
- aTuple = aTuple2;
- assert (aTuple == aTuple2);
- aTuple2.get<1>()++;
- assert (aTuple < aTuple2);
-
- TupleType aTuple3;
- aTuple3 = aTuple2;
- aTuple3.get<1>()++;
- assert (aTuple2 < aTuple3);
-
- testTupleStrictWeak(aTuple, aTuple2, aTuple3);
-
- std::vector<TupleType> tv;
- tv.push_back(aTuple3);
- tv.push_back(aTuple);
- tv.push_back(aTuple2);
-
- assert (tv[0] == aTuple3);
- assert (tv[1] == aTuple);
- assert (tv[2] == aTuple2);
-
- std::sort(tv.begin(), tv.end());
-
- assert (tv[0] == aTuple);
- assert (tv[1] == aTuple2);
- assert (tv[2] == aTuple3);
-
- std::map<TupleType, int> tm;
- std::pair<std::map<TupleType, int>::iterator, bool> mIt = tm.insert(std::map<TupleType, int>::value_type(aTuple2, 2));
- assert (mIt.second);
- mIt = tm.insert(std::map<TupleType, int>::value_type(aTuple, 1));
- assert (mIt.second);
- mIt = tm.insert(std::map<TupleType, int>::value_type(aTuple3, 3));
- assert (mIt.second);
-
- std::map<TupleType, int>::iterator fIt = tm.find(aTuple2);
- assert (2 == fIt->second);
-
- typedef Tuple<std::string, std::string, std::string, std::string> StrTup;
- typedef std::map<StrTup, int> StrTupMap;
-
- StrTup st1("123", "456", "789", "101112");
- StrTup st2("123", "456", "101112", "789");
- StrTup st3("123", "789", "789", "101112");
- StrTup st4("123", "101112", "456", "789");
-
- testTupleStrictWeak(st2, st1, st3);
-
- StrTupMap strMap;
- strMap.insert(StrTupMap::value_type(st1, 1));
- strMap.insert(StrTupMap::value_type(st2, 2));
- strMap.insert(StrTupMap::value_type(st3, 3));
- strMap.insert(StrTupMap::value_type(st4, 4));
-
- assert (1 == strMap[st1]);
- assert (2 == strMap[st2]);
- assert (3 == strMap[st3]);
- assert (4 == strMap[st4]);
-
- StrTupMap::iterator it = strMap.begin();
- assert (st4 == it->first); ++it;
- assert (st2 == it->first); ++it;
- assert (st1 == it->first); ++it;
- assert (st3 == it->first); ++it;
- assert (it == strMap.end());
-}
-
-
-void TuplesTest::testMemOverhead()
-{
- Tuple<short> small(0);
- int sz = sizeof(small);
- assert (sz == 4 || sz == 8); //depending on architecture and alignment
- Tuple<long> notSoSmall(0);
- sz = sizeof(notSoSmall);
- assert (sz == 8 || sz == 16); //depending on architecture and alignment
-}
-
-
-void TuplesTest::setUp()
-{
-}
-
-
-void TuplesTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TuplesTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TuplesTest");
-
- CppUnit_addTest(pSuite, TuplesTest, testTuple1);
- CppUnit_addTest(pSuite, TuplesTest, testTuple2);
- CppUnit_addTest(pSuite, TuplesTest, testTuple3);
- CppUnit_addTest(pSuite, TuplesTest, testTuple4);
- CppUnit_addTest(pSuite, TuplesTest, testTuple5);
- CppUnit_addTest(pSuite, TuplesTest, testTuple6);
- CppUnit_addTest(pSuite, TuplesTest, testTuple7);
- CppUnit_addTest(pSuite, TuplesTest, testTuple8);
- CppUnit_addTest(pSuite, TuplesTest, testTuple9);
- CppUnit_addTest(pSuite, TuplesTest, testTuple10);
- CppUnit_addTest(pSuite, TuplesTest, testTuple11);
- CppUnit_addTest(pSuite, TuplesTest, testTuple12);
- CppUnit_addTest(pSuite, TuplesTest, testTuple13);
- CppUnit_addTest(pSuite, TuplesTest, testTuple14);
- CppUnit_addTest(pSuite, TuplesTest, testTuple15);
- CppUnit_addTest(pSuite, TuplesTest, testTuple16);
- CppUnit_addTest(pSuite, TuplesTest, testTuple17);
- CppUnit_addTest(pSuite, TuplesTest, testTuple18);
- CppUnit_addTest(pSuite, TuplesTest, testTuple19);
- CppUnit_addTest(pSuite, TuplesTest, testTuple20);
- CppUnit_addTest(pSuite, TuplesTest, testTupleOrder);
- CppUnit_addTest(pSuite, TuplesTest, testMemOverhead);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TuplesTest.h b/Utilities/Poco/Foundation/testsuite/src/TuplesTest.h
deleted file mode 100755
index 5b719fd194..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TuplesTest.h
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// TuplesTest.h
-//
-// $Id$
-//
-// Definition of the TuplesTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef TuplesTest_INCLUDED
-#define TuplesTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TuplesTest: public CppUnit::TestCase
-{
-public:
- TuplesTest(const std::string& name);
- ~TuplesTest();
-
- void testTuple1();
- void testTuple2();
- void testTuple3();
- void testTuple4();
- void testTuple5();
- void testTuple6();
- void testTuple7();
- void testTuple8();
- void testTuple9();
- void testTuple10();
- void testTuple11();
- void testTuple12();
- void testTuple13();
- void testTuple14();
- void testTuple15();
- void testTuple16();
- void testTuple17();
- void testTuple18();
- void testTuple19();
- void testTuple20();
- void testTupleOrder();
- void testMemOverhead();
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-
- template <class T>
- void testTupleStrictWeak(const T& t1, const T& t2, const T& t3)
- {
- assert (t1 < t2 && !(t2 < t1)); // antisymmetric
- assert (t1 < t2 && t2 < t3 && t1 < t3); // transitive
- assert (!(t1 < t1)); // irreflexive
- }
-};
-
-
-#endif // TuplesTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/TypeListTest.cpp b/Utilities/Poco/Foundation/testsuite/src/TypeListTest.cpp
deleted file mode 100755
index 5d2ce70db1..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TypeListTest.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-//
-// TypeListTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "TypeListTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Tuple.h"
-#include "Poco/TypeList.h"
-#include "Poco/Void.h"
-#include <iostream>
-#if defined(_MSC_VER)
-# pragma warning(disable:4800) // forcing value to bool 'true' or 'false' on MSVC 71
-#endif
-
-using Poco::TypeList;
-using Poco::Tuple;
-using Poco::NullTypeList;
-using Poco::TypeListType;
-using Poco::TypeGetter;
-using Poco::TypeLocator;
-using Poco::TypeAppender;
-using Poco::TypeOneEraser;
-using Poco::TypeAllEraser;
-using Poco::TypeDuplicateEraser;
-using Poco::TypeOneReplacer;
-using Poco::TypeAllReplacer;
-using Poco::Int8;
-using Poco::UInt8;
-using Poco::Int16;
-using Poco::UInt16;
-using Poco::Int32;
-using Poco::UInt32;
-using Poco::Int8;
-using Poco::UInt8;
-using Poco::Int16;
-using Poco::UInt16;
-using Poco::Int32;
-using Poco::UInt32;
-using Poco::Void;
-
-
-TypeListTest::TypeListTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TypeListTest::~TypeListTest()
-{
-}
-
-
-void TypeListTest::testTypeList()
-{
- typedef TypeListType<Int8,
- UInt8,
- Int16,
- UInt16,
- Int32,
- UInt32,
- float,
- double,
- Int8,
- UInt8,
- Int16,
- UInt16,
- Int32,
- UInt32,
- float>::HeadType Type15;
-
- Tuple<TypeGetter<0, Type15>::HeadType,
- TypeGetter<1, Type15>::HeadType,
- TypeGetter<2, Type15>::HeadType,
- TypeGetter<3, Type15>::HeadType,
- TypeGetter<4, Type15>::HeadType,
- TypeGetter<5, Type15>::HeadType,
- TypeGetter<6, Type15>::HeadType,
- TypeGetter<7, Type15>::HeadType,
- TypeGetter<8, Type15>::HeadType,
- TypeGetter<9, Type15>::HeadType> tuple;
-
- static TypeLocator<Type15, Int8> pos0;
- static TypeLocator<Type15, UInt8> pos1;
- static TypeLocator<Type15, Int16> pos2;
- static TypeLocator<Type15, UInt16> pos3;
- static TypeLocator<Type15, Int32> pos4;
- static TypeLocator<Type15, UInt32> pos5;
- static TypeLocator<Type15, float> pos6;
- static TypeLocator<Type15, double> pos7;
- static TypeLocator<Type15, Int8> pos8;
- static TypeLocator<Type15, std::string> posUnknown;
-
- assert (pos0.value == 0);
- assert (pos1.value == 1);
- assert (pos2.value == 2);
- assert (pos3.value == 3);
- assert (pos4.value == 4);
- assert (pos5.value == 5);
- assert (pos6.value == 6);
- assert (pos7.value == 7);
- assert (pos8.value == 0);
- assert (posUnknown.value == -1);
-
- tuple.set<TypeLocator<Type15, Int32>::value >(-123);
- assert (-123 == tuple.get<4>());
-
- assert (typeid(TypeGetter<0, Type15>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<0, Type15>::ConstHeadType) == typeid(const Int8));
- assert (typeid(TypeGetter<1, Type15>::HeadType) == typeid(UInt8));
- assert (typeid(TypeGetter<1, Type15>::ConstHeadType) == typeid(const UInt8));
- assert (typeid(TypeGetter<2, Type15>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<2, Type15>::ConstHeadType) == typeid(const Int16));
- assert (typeid(TypeGetter<3, Type15>::HeadType) == typeid(UInt16));
- assert (typeid(TypeGetter<3, Type15>::ConstHeadType) == typeid(const UInt16));
- assert (typeid(TypeGetter<4, Type15>::HeadType) == typeid(Int32));
- assert (typeid(TypeGetter<4, Type15>::ConstHeadType) == typeid(const Int32));
- assert (typeid(TypeGetter<5, Type15>::HeadType) == typeid(UInt32));
- assert (typeid(TypeGetter<5, Type15>::ConstHeadType) == typeid(const UInt32));
- assert (typeid(TypeGetter<6, Type15>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<6, Type15>::ConstHeadType) == typeid(const float));
- assert (typeid(TypeGetter<7, Type15>::HeadType) == typeid(double));
- assert (typeid(TypeGetter<7, Type15>::ConstHeadType) == typeid(const double));
- assert (typeid(TypeGetter<8, Type15>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<8, Type15>::ConstHeadType) == typeid(const Int8));
- assert (typeid(TypeGetter<9, Type15>::HeadType) == typeid(UInt8));
- assert (typeid(TypeGetter<9, Type15>::ConstHeadType) == typeid(const UInt8));
- assert (typeid(TypeGetter<10, Type15>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<10, Type15>::ConstHeadType) == typeid(const Int16));
- assert (typeid(TypeGetter<11, Type15>::HeadType) == typeid(UInt16));
- assert (typeid(TypeGetter<11, Type15>::ConstHeadType) == typeid(const UInt16));
- assert (typeid(TypeGetter<12, Type15>::HeadType) == typeid(Int32));
- assert (typeid(TypeGetter<12, Type15>::ConstHeadType) == typeid(const Int32));
- assert (typeid(TypeGetter<13, Type15>::HeadType) == typeid(UInt32));
- assert (typeid(TypeGetter<13, Type15>::ConstHeadType) == typeid(const UInt32));
- assert (typeid(TypeGetter<14, Type15>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<14, Type15>::ConstHeadType) == typeid(const float));
-
- typedef TypeListType<Int8>::HeadType Type1;
- assert (1 == Type1::length);
- typedef TypeListType<Int16, Int32>::HeadType Type2;
- assert (2 == Type2::length);
- typedef TypeAppender<Type1, Type2>::HeadType Type3;
- assert (3 == Type3::length);
-
- assert (typeid(TypeGetter<0, Type3>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<1, Type3>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<2, Type3>::HeadType) == typeid(Int32));
-
- static TypeLocator<Type3, Int8> posNo1;
- static TypeLocator<Type3, Int16> posNo2;
- static TypeLocator<Type3, Int32> posNo3;
-
- assert (posNo1.value == 0);
- assert (posNo2.value == 1);
- assert (posNo3.value == 2);
-
- typedef TypeOneEraser<Type3, Int8>::HeadType TypeEraser1;
- assert (2 == TypeEraser1::length);
- assert (typeid(TypeGetter<0, TypeEraser1>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<1, TypeEraser1>::HeadType) == typeid(Int32));
-
- typedef TypeOneEraser<Type3, Int16>::HeadType TypeEraser2;
- assert (2 == TypeEraser2::length);
- assert (typeid(TypeGetter<0, TypeEraser2>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<1, TypeEraser2>::HeadType) == typeid(Int32));
-
- typedef TypeOneEraser<Type3, Int32>::HeadType TypeEraser3;
- assert (2 == TypeEraser3::length);
- assert (typeid(TypeGetter<0, TypeEraser3>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<1, TypeEraser3>::HeadType) == typeid(Int16));
-
- typedef TypeListType<Int8,Int16,Int8,Int16,Int8>::HeadType Type5;
- typedef TypeAllEraser<Type5, Int8>::HeadType TypeAllEraser3;
- assert (2 == TypeAllEraser3::length);
- assert (typeid(TypeGetter<0, TypeAllEraser3>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<1, TypeAllEraser3>::HeadType) == typeid(Int16));
-
- typedef TypeDuplicateEraser<Type5>::HeadType TypeDuplicateEraser1;
- assert (2 == TypeDuplicateEraser1::length);
- assert (typeid(TypeGetter<0, TypeDuplicateEraser1>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<1, TypeDuplicateEraser1>::HeadType) == typeid(Int16));
-
- typedef TypeOneReplacer<Type5, Int8, Int32>::HeadType TypeOneReplacer1;
- assert (5 == TypeOneReplacer1::length);
- assert (typeid(TypeGetter<0, TypeOneReplacer1>::HeadType) == typeid(Int32));
- assert (typeid(TypeGetter<1, TypeOneReplacer1>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<2, TypeOneReplacer1>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<3, TypeOneReplacer1>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<4, TypeOneReplacer1>::HeadType) == typeid(Int8));
-
- typedef TypeAllReplacer<Type5, Int8, Int32>::HeadType TypeAllReplacer1;
- assert (5 == TypeAllReplacer1::length);
- assert (typeid(TypeGetter<0, TypeAllReplacer1>::HeadType) == typeid(Int32));
- assert (typeid(TypeGetter<1, TypeAllReplacer1>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<2, TypeAllReplacer1>::HeadType) == typeid(Int32));
- assert (typeid(TypeGetter<3, TypeAllReplacer1>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<4, TypeAllReplacer1>::HeadType) == typeid(Int32));
-
- typedef TypeListType<Void,Void,Void,Void,Void,Void,Void,Void,Void,Void,Void,Void,Void,Void,Void,Void,Void,Void,Void,Void>::HeadType TypeVoid;
- assert (typeid(TypeGetter<0, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<1, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<2, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<3, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<4, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<5, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<6, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<7, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<8, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<9, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<10, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<11, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<12, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<13, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<14, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<15, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<16, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<17, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<18, TypeVoid>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<19, TypeVoid>::HeadType) == typeid(Void));
-
-
- typedef TypeOneReplacer<TypeVoid, Void, Int8>::HeadType TypeFirstReplacer;
- assert (typeid(TypeGetter<0, TypeFirstReplacer>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<1, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<2, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<3, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<4, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<5, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<6, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<7, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<8, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<9, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<10, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<11, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<12, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<13, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<14, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<15, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<16, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<17, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<18, TypeFirstReplacer>::HeadType) == typeid(Void));
- assert (typeid(TypeGetter<19, TypeFirstReplacer>::HeadType) == typeid(Void));
-
- typedef TypeOneReplacer<TypeFirstReplacer, Void, Int16>::HeadType TypeSecondReplacer;
- assert (typeid(TypeGetter<0, TypeSecondReplacer>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<1, TypeSecondReplacer>::HeadType) == typeid(Int16));
-
- typedef TypeOneReplacer<TypeSecondReplacer, Void, Int32>::HeadType TypeThirdReplacer;
- assert (typeid(TypeGetter<0, TypeThirdReplacer>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<1, TypeThirdReplacer>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<2, TypeThirdReplacer>::HeadType) == typeid(Int32));
-
-
- typedef TypeAllReplacer<TypeThirdReplacer, Void, float>::HeadType TypeFourthReplacer;
- assert (typeid(TypeGetter<0, TypeFourthReplacer>::HeadType) == typeid(Int8));
- assert (typeid(TypeGetter<1, TypeFourthReplacer>::HeadType) == typeid(Int16));
- assert (typeid(TypeGetter<2, TypeFourthReplacer>::HeadType) == typeid(Int32));
- assert (typeid(TypeGetter<3, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<4, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<5, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<6, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<7, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<8, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<9, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<10, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<11, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<12, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<13, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<14, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<15, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<16, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<17, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<18, TypeFourthReplacer>::HeadType) == typeid(float));
- assert (typeid(TypeGetter<19, TypeFourthReplacer>::HeadType) == typeid(float));
-}
-
-
-void TypeListTest::setUp()
-{
-}
-
-
-void TypeListTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TypeListTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TypeListTest");
-
- CppUnit_addTest(pSuite, TypeListTest, testTypeList);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/TypeListTest.h b/Utilities/Poco/Foundation/testsuite/src/TypeListTest.h
deleted file mode 100755
index 22d69ab287..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/TypeListTest.h
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// TypeListTest.h
-//
-// $Id$
-//
-// Definition of the TypeListTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef TypeListTest_INCLUDED
-#define TypeListTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class TypeListTest: public CppUnit::TestCase
-{
-public:
- TypeListTest(const std::string& name);
- ~TypeListTest();
-
- void testTypeList();
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TypeListTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/URIStreamOpenerTest.cpp b/Utilities/Poco/Foundation/testsuite/src/URIStreamOpenerTest.cpp
deleted file mode 100755
index c6c6448f75..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/URIStreamOpenerTest.cpp
+++ /dev/null
@@ -1,246 +0,0 @@
-//
-// URIStreamOpenerTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "URIStreamOpenerTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/URIStreamOpener.h"
-#include "Poco/URIStreamFactory.h"
-#include "Poco/URI.h"
-#include "Poco/TemporaryFile.h"
-#include "Poco/Path.h"
-#include <fstream>
-#include <sstream>
-
-
-using Poco::URIStreamOpener;
-using Poco::URIStreamFactory;
-using Poco::URI;
-using Poco::TemporaryFile;
-using Poco::Path;
-
-
-namespace
-{
- class StringStreamFactory: public URIStreamFactory
- {
- public:
- StringStreamFactory()
- {
- }
-
- std::istream* open(const URI& uri)
- {
- return new std::istringstream(uri.toString());
- }
- };
-}
-
-
-URIStreamOpenerTest::URIStreamOpenerTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-URIStreamOpenerTest::~URIStreamOpenerTest()
-{
-}
-
-
-void URIStreamOpenerTest::testStreamOpenerFile()
-{
- TemporaryFile tempFile;
- std::string path = tempFile.path();
- std::ofstream ostr(path.c_str());
- assert (ostr.good());
- ostr << "Hello, world!" << std::endl;
- ostr.close();
-
- URI uri;
- uri.setScheme("file");
- uri.setPath(Path(path).toString(Path::PATH_UNIX));
- std::string uriString = uri.toString();
-
- URIStreamOpener opener;
- std::istream* istr = opener.open(uri);
- assert (istr != 0);
- assert (istr->good());
- delete istr;
-}
-
-
-void URIStreamOpenerTest::testStreamOpenerRelative()
-{
- TemporaryFile tempFile;
- std::string path = tempFile.path();
- std::ofstream ostr(path.c_str());
- assert (ostr.good());
- ostr << "Hello, world!" << std::endl;
- ostr.close();
-
- URI uri(Path(path).toString(Path::PATH_UNIX));
- std::string uriString = uri.toString();
-
- URIStreamOpener opener;
- std::istream* istr = opener.open(uri);
- assert (istr != 0);
- assert (istr->good());
- delete istr;
-}
-
-
-void URIStreamOpenerTest::testStreamOpenerURI()
-{
- TemporaryFile tempFile;
- std::string path = tempFile.path();
- std::ofstream ostr(path.c_str());
- assert (ostr.good());
- ostr << "Hello, world!" << std::endl;
- ostr.close();
-
- URI uri;
- uri.setScheme("file");
- uri.setPath(Path(path).toString(Path::PATH_UNIX));
- std::string uriString = uri.toString();
-
- URIStreamOpener opener;
- std::istream* istr = opener.open(uriString);
- assert (istr != 0);
- assert (istr->good());
- delete istr;
-}
-
-
-void URIStreamOpenerTest::testStreamOpenerURIResolve()
-{
- TemporaryFile tempFile;
- std::string path = tempFile.path();
- std::ofstream ostr(path.c_str());
- assert (ostr.good());
- ostr << "Hello, world!" << std::endl;
- ostr.close();
-
- Path p(path);
- p.makeAbsolute();
- Path parent(p.parent());
-
- URI uri;
- uri.setScheme("file");
- uri.setPath(parent.toString(Path::PATH_UNIX));
- std::string uriString = uri.toString();
-
- URIStreamOpener opener;
- std::istream* istr = opener.open(uriString, p.getFileName());
- assert (istr != 0);
- assert (istr->good());
- delete istr;
-}
-
-
-void URIStreamOpenerTest::testStreamOpenerPath()
-{
- TemporaryFile tempFile;
- std::string path = tempFile.path();
- std::ofstream ostr(path.c_str());
- assert (ostr.good());
- ostr << "Hello, world!" << std::endl;
- ostr.close();
-
- URIStreamOpener opener;
- std::istream* istr = opener.open(path);
- assert (istr != 0);
- assert (istr->good());
- delete istr;
-}
-
-
-void URIStreamOpenerTest::testStreamOpenerPathResolve()
-{
- TemporaryFile tempFile;
- std::string path = tempFile.path();
- std::ofstream ostr(path.c_str());
- assert (ostr.good());
- ostr << "Hello, world!" << std::endl;
- ostr.close();
-
- Path p(path);
- Path parent(p.parent());
- std::string base = parent.toString();
-
- URIStreamOpener opener;
- std::istream* istr = opener.open(base, p.getFileName());
- assert (istr != 0);
- assert (istr->good());
- delete istr;
-}
-
-
-void URIStreamOpenerTest::testRegisterUnregister()
-{
- URIStreamOpener opener;
- assert (!opener.supportsScheme("string"));
- opener.registerStreamFactory("string", new StringStreamFactory);
- assert (opener.supportsScheme("string"));
- URI uri("string:foobar");
- std::istream* istr = opener.open(uri);
- assert (istr != 0);
- assert (istr->good());
- delete istr;
- opener.unregisterStreamFactory("string");
- assert (!opener.supportsScheme("string"));
-}
-
-
-void URIStreamOpenerTest::setUp()
-{
-}
-
-
-void URIStreamOpenerTest::tearDown()
-{
-}
-
-
-CppUnit::Test* URIStreamOpenerTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("URIStreamOpenerTest");
-
- CppUnit_addTest(pSuite, URIStreamOpenerTest, testStreamOpenerFile);
- CppUnit_addTest(pSuite, URIStreamOpenerTest, testStreamOpenerRelative);
- CppUnit_addTest(pSuite, URIStreamOpenerTest, testStreamOpenerURI);
- CppUnit_addTest(pSuite, URIStreamOpenerTest, testStreamOpenerURIResolve);
- CppUnit_addTest(pSuite, URIStreamOpenerTest, testStreamOpenerPath);
- CppUnit_addTest(pSuite, URIStreamOpenerTest, testStreamOpenerPathResolve);
- CppUnit_addTest(pSuite, URIStreamOpenerTest, testRegisterUnregister);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/URIStreamOpenerTest.h b/Utilities/Poco/Foundation/testsuite/src/URIStreamOpenerTest.h
deleted file mode 100755
index e6380c1d96..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/URIStreamOpenerTest.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// URIStreamOpenerTest.h
-//
-// $Id$
-//
-// Definition of the URIStreamOpenerTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef URIStreamOpenerTest_INCLUDED
-#define URIStreamOpenerTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class URIStreamOpenerTest: public CppUnit::TestCase
-{
-public:
- URIStreamOpenerTest(const std::string& name);
- ~URIStreamOpenerTest();
-
- void testStreamOpenerFile();
- void testStreamOpenerRelative();
- void testStreamOpenerURI();
- void testStreamOpenerURIResolve();
- void testStreamOpenerPath();
- void testStreamOpenerPathResolve();
- void testRegisterUnregister();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // URIStreamOpenerTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/URITest.cpp b/Utilities/Poco/Foundation/testsuite/src/URITest.cpp
deleted file mode 100755
index c6de85fff6..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/URITest.cpp
+++ /dev/null
@@ -1,762 +0,0 @@
-//
-// URITest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "URITest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/URI.h"
-
-
-using Poco::URI;
-
-
-URITest::URITest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-URITest::~URITest()
-{
-}
-
-
-void URITest::testConstruction()
-{
- URI uri;
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath().empty());
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
-
- uri.setScheme("ftp");
- assert (uri.getScheme() == "ftp");
- assert (uri.getPort() == 21);
-
- uri.setScheme("HTTP");
- assert (uri.getScheme() == "http");
-
- uri.setAuthority("www.appinf.com");
- assert (uri.getAuthority() == "www.appinf.com");
- assert (uri.getPort() == 80);
-
- uri.setAuthority("user@services.appinf.com:8000");
- assert (uri.getUserInfo() == "user");
- assert (uri.getHost() == "services.appinf.com");
- assert (uri.getPort() == 8000);
-
- uri.setPath("/index.html");
- assert (uri.getPath() == "/index.html");
-
- uri.setPath("/file%20with%20spaces.html");
- assert (uri.getPath() == "/file with spaces.html");
-
- uri.setPathEtc("/query.cgi?query=foo");
- assert (uri.getPath() == "/query.cgi");
- assert (uri.getQuery() == "query=foo");
- assert (uri.getFragment().empty());
- assert (uri.getPathEtc() == "/query.cgi?query=foo");
- assert (uri.getPathAndQuery() == "/query.cgi?query=foo");
-
- uri.setPathEtc("/query.cgi?query=bar#frag");
- assert (uri.getPath() == "/query.cgi");
- assert (uri.getQuery() == "query=bar");
- assert (uri.getFragment() == "frag");
- assert (uri.getPathEtc() == "/query.cgi?query=bar#frag");
- assert (uri.getPathAndQuery() == "/query.cgi?query=bar");
-
- uri.setQuery("query=test");
- assert (uri.getQuery() == "query=test");
-
- uri.setFragment("result");
- assert (uri.getFragment() == "result");
-
- URI uri2("file", "/home/guenter/foo.bar");
- assert (uri2.getScheme() == "file");
- assert (uri2.getPath() == "/home/guenter/foo.bar");
-
- URI uri3("http", "www.appinf.com", "/index.html");
- assert (uri3.getScheme() == "http");
- assert (uri3.getAuthority() == "www.appinf.com");
- assert (uri3.getPath() == "/index.html");
-
- URI uri4("http", "www.appinf.com:8000", "/index.html");
- assert (uri4.getScheme() == "http");
- assert (uri4.getAuthority() == "www.appinf.com:8000");
- assert (uri4.getPath() == "/index.html");
-
- URI uri5("http", "user@www.appinf.com:8000", "/index.html");
- assert (uri5.getScheme() == "http");
- assert (uri5.getUserInfo() == "user");
- assert (uri5.getHost() == "www.appinf.com");
- assert (uri5.getPort() == 8000);
- assert (uri5.getAuthority() == "user@www.appinf.com:8000");
- assert (uri5.getPath() == "/index.html");
-
- URI uri6("http", "user@www.appinf.com:80", "/index.html");
- assert (uri6.getScheme() == "http");
- assert (uri6.getUserInfo() == "user");
- assert (uri6.getHost() == "www.appinf.com");
- assert (uri6.getPort() == 80);
- assert (uri6.getAuthority() == "user@www.appinf.com");
- assert (uri6.getPath() == "/index.html");
-
- URI uri7("http", "user@www.appinf.com:", "/index.html");
- assert (uri7.getScheme() == "http");
- assert (uri7.getUserInfo() == "user");
- assert (uri7.getHost() == "www.appinf.com");
- assert (uri7.getPort() == 80);
- assert (uri7.getAuthority() == "user@www.appinf.com");
- assert (uri7.getPath() == "/index.html");
-
- URI uri8("http", "www.appinf.com", "/index.html", "query=test");
- assert (uri8.getScheme() == "http");
- assert (uri8.getAuthority() == "www.appinf.com");
- assert (uri8.getPath() == "/index.html");
- assert (uri8.getQuery() == "query=test");
-
- URI uri9("http", "www.appinf.com", "/index.html", "query=test", "fragment");
- assert (uri9.getScheme() == "http");
- assert (uri9.getAuthority() == "www.appinf.com");
- assert (uri9.getPath() == "/index.html");
- assert (uri9.getPathEtc() == "/index.html?query=test#fragment");
- assert (uri9.getQuery() == "query=test");
- assert (uri9.getFragment() == "fragment");
-
- uri9.clear();
- assert (uri9.getScheme().empty());
- assert (uri9.getAuthority().empty());
- assert (uri9.getUserInfo().empty());
- assert (uri9.getHost().empty());
- assert (uri9.getPort() == 0);
- assert (uri9.getPath().empty());
- assert (uri9.getQuery().empty());
- assert (uri9.getFragment().empty());
-
- URI uri10("ldap", "[2001:db8::7]", "/c=GB?objectClass?one");
- assert (uri10.getScheme() == "ldap");
- assert (uri10.getUserInfo().empty());
- assert (uri10.getHost() == "[2001:db8::7]");
- assert (uri10.getPort() == 389);
- assert (uri10.getAuthority() == "[2001:db8::7]");
- assert (uri10.getPathEtc() == "/c=GB?objectClass?one");
-
- URI uri11("http", "www.appinf.com", "/index.html?query=test#fragment");
- assert (uri11.getScheme() == "http");
- assert (uri11.getAuthority() == "www.appinf.com");
- assert (uri11.getPath() == "/index.html");
- assert (uri11.getPathEtc() == "/index.html?query=test#fragment");
- assert (uri11.getQuery() == "query=test");
- assert (uri11.getFragment() == "fragment");
-
-}
-
-
-void URITest::testParse()
-{
- URI uri("http://www.appinf.com");
- assert (uri.getScheme() == "http");
- assert (uri.getAuthority() == "www.appinf.com");
- assert (uri.getPath().empty());
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (!uri.isRelative());
-
- uri = "http://www.appinf.com/";
- assert (uri.getScheme() == "http");
- assert (uri.getAuthority() == "www.appinf.com");
- assert (uri.getPath() == "/");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (!uri.isRelative());
-
- uri = "ftp://anonymous@ftp.appinf.com/pub/";
- assert (uri.getScheme() == "ftp");
- assert (uri.getUserInfo() == "anonymous");
- assert (uri.getHost() == "ftp.appinf.com");
- assert (uri.getPort() == 21);
- assert (uri.getAuthority() == "anonymous@ftp.appinf.com");
- assert (uri.getPath() == "/pub/");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (!uri.isRelative());
- assert (!uri.isRelative());
-
- uri = "https://www.appinf.com/index.html#top";
- assert (uri.getScheme() == "https");
- assert (uri.getHost() == "www.appinf.com");
- assert (uri.getPort() == 443);
- assert (uri.getPath() == "/index.html");
- assert (uri.getQuery().empty());
- assert (uri.getFragment() == "top");
- assert (!uri.isRelative());
-
- uri = "http://www.appinf.com/search.cgi?keyword=test&scope=all";
- assert (uri.getScheme() == "http");
- assert (uri.getHost() == "www.appinf.com");
- assert (uri.getPort() == 80);
- assert (uri.getPath() == "/search.cgi");
- assert (uri.getQuery() == "keyword=test&scope=all");
- assert (uri.getFragment().empty());
- assert (!uri.isRelative());
-
- uri = "http://www.appinf.com/search.cgi?keyword=test&scope=all#result";
- assert (uri.getScheme() == "http");
- assert (uri.getHost() == "www.appinf.com");
- assert (uri.getPort() == 80);
- assert (uri.getPath() == "/search.cgi");
- assert (uri.getQuery() == "keyword=test&scope=all");
- assert (uri.getFragment() == "result");
- assert (!uri.isRelative());
-
- uri = "http://www.appinf.com/search.cgi?keyword=test%20encoded&scope=all#result";
- assert (uri.getScheme() == "http");
- assert (uri.getHost() == "www.appinf.com");
- assert (uri.getPort() == 80);
- assert (uri.getPath() == "/search.cgi");
- assert (uri.getQuery() == "keyword=test encoded&scope=all");
- assert (uri.getFragment() == "result");
- assert (!uri.isRelative());
-
- uri = "ldap://[2001:db8::7]/c=GB?objectClass?one";
- assert (uri.getScheme() == "ldap");
- assert (uri.getUserInfo().empty());
- assert (uri.getHost() == "[2001:db8::7]");
- assert (uri.getPort() == 389);
- assert (uri.getAuthority() == "[2001:db8::7]");
- assert (uri.getPath() == "/c=GB");
- assert (uri.getQuery() == "objectClass?one");
- assert (uri.getFragment().empty());
-
- uri = "mailto:John.Doe@example.com";
- assert (uri.getScheme() == "mailto");
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getAuthority().empty());
- assert (uri.getPath() == "John.Doe@example.com");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
-
- uri = "tel:+1-816-555-1212";
- assert (uri.getScheme() == "tel");
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getAuthority().empty());
- assert (uri.getPath() == "+1-816-555-1212");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
-
- uri = "telnet://192.0.2.16:80";
- assert (uri.getScheme() == "telnet");
- assert (uri.getUserInfo().empty());
- assert (uri.getHost() == "192.0.2.16");
- assert (uri.getPort() == 80);
- assert (uri.getAuthority() == "192.0.2.16:80");
- assert (uri.getPath().empty());
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
-
- uri = "urn:oasis:names:specification:docbook:dtd:xml:4.1.2";
- assert (uri.getScheme() == "urn");
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getAuthority().empty());
- assert (uri.getPath() == "oasis:names:specification:docbook:dtd:xml:4.1.2");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
-
- uri = "";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath().empty());
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (uri.empty());
-
- // relative references
-
- uri = "/foo/bar";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath() == "/foo/bar");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (uri.isRelative());
-
- uri = "./foo/bar";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath() == "./foo/bar");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (uri.isRelative());
-
- uri = "../foo/bar";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath() == "../foo/bar");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (uri.isRelative());
-
- uri = "index.html";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath() == "index.html");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (uri.isRelative());
-
- uri = "index.html#frag";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath() == "index.html");
- assert (uri.getQuery().empty());
- assert (uri.getFragment() == "frag");
- assert (uri.isRelative());
-
- uri = "?query=test";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath().empty());
- assert (uri.getQuery() == "query=test");
- assert (uri.getFragment().empty());
- assert (uri.isRelative());
-
- uri = "?query=test#frag";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath().empty());
- assert (uri.getQuery() == "query=test");
- assert (uri.getFragment() == "frag");
- assert (uri.isRelative());
-
- uri = "#frag";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath().empty());
- assert (uri.getQuery().empty());
- assert (uri.getFragment() == "frag");
- assert (uri.isRelative());
-
- uri = "#";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath().empty());
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (uri.isRelative());
-
- uri = "file:///a/b/c";
- assert (uri.getScheme() == "file");
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath() == "/a/b/c");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (!uri.isRelative());
-
- uri = "file://localhost/a/b/c";
- assert (uri.getScheme() == "file");
- assert (uri.getAuthority() == "localhost");
- assert (uri.getUserInfo().empty());
- assert (uri.getHost() == "localhost");
- assert (uri.getPort() == 0);
- assert (uri.getPath() == "/a/b/c");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (!uri.isRelative());
-
- uri = "file:///c:/Windows/system32/";
- assert (uri.getScheme() == "file");
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath() == "/c:/Windows/system32/");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (!uri.isRelative());
-
- uri = "./c:/Windows/system32/";
- assert (uri.getScheme().empty());
- assert (uri.getAuthority().empty());
- assert (uri.getUserInfo().empty());
- assert (uri.getHost().empty());
- assert (uri.getPort() == 0);
- assert (uri.getPath() == "./c:/Windows/system32/");
- assert (uri.getQuery().empty());
- assert (uri.getFragment().empty());
- assert (uri.isRelative());
-
-}
-
-
-void URITest::testToString()
-{
- URI uri("http://www.appinf.com");
- assert (uri.toString() == "http://www.appinf.com");
-
- uri = "http://www.appinf.com/";
- assert (uri.toString() == "http://www.appinf.com/");
-
- uri = "ftp://anonymous@ftp.appinf.com/pub/";
- assert (uri.toString() == "ftp://anonymous@ftp.appinf.com/pub/");
-
- uri = "https://www.appinf.com/index.html#top";
- assert (uri.toString() == "https://www.appinf.com/index.html#top");
-
- uri = "http://www.appinf.com/search.cgi?keyword=test&scope=all";
- assert (uri.toString() == "http://www.appinf.com/search.cgi?keyword=test&scope=all");
-
- uri = "http://www.appinf.com/search.cgi?keyword=test&scope=all#result";
- assert (uri.toString() == "http://www.appinf.com/search.cgi?keyword=test&scope=all#result");
-
- uri = "http://www.appinf.com/search.cgi?keyword=test%20encoded&scope=all#result";
- assert (uri.toString() == "http://www.appinf.com/search.cgi?keyword=test%20encoded&scope=all#result");
-
- uri = "ldap://[2001:db8::7]/c=GB?objectClass?one";
- assert (uri.toString() == "ldap://[2001:db8::7]/c=GB?objectClass?one");
-
- uri = "mailto:John.Doe@example.com";
- assert (uri.toString() == "mailto:John.Doe@example.com");
-
- uri = "tel:+1-816-555-1212";
- assert (uri.toString() == "tel:+1-816-555-1212");
-
- uri = "telnet://192.0.2.16:80";
- assert (uri.toString() == "telnet://192.0.2.16:80");
-
- uri = "urn:oasis:names:specification:docbook:dtd:xml:4.1.2";
- assert (uri.toString() == "urn:oasis:names:specification:docbook:dtd:xml:4.1.2");
-
- uri = "";
- assert (uri.toString() == "");
-
- // relative references
-
- uri = "/foo/bar";
- assert (uri.toString() == "/foo/bar");
-
- uri = "./foo/bar";
- assert (uri.toString() == "./foo/bar");
-
- uri = "../foo/bar";
- assert (uri.toString() == "../foo/bar");
-
- uri = "//foo/bar";
- assert (uri.toString() == "//foo/bar");
-
- uri = "index.html";
- assert (uri.toString() == "index.html");
-
- uri = "index.html#frag";
- assert (uri.toString() == "index.html#frag");
-
- uri = "?query=test";
- assert (uri.toString() == "?query=test");
-
- uri = "?query=test#frag";
- assert (uri.toString() == "?query=test#frag");
-
- uri = "#frag";
- assert (uri.toString() == "#frag");
-
- uri = "#";
- assert (uri.toString() == "");
-
- uri = "file:///a/b/c";
- assert (uri.toString() == "file:///a/b/c");
-
- uri = "file://localhost/a/b/c";
- assert (uri.toString() == "file://localhost/a/b/c");
-
- uri = "file:///c:/Windows/system32/";
- assert (uri.toString() == "file:///c:/Windows/system32/");
-
- uri = "./c:/Windows/system32/";
- assert (uri.toString() == "./c:/Windows/system32/");
-}
-
-
-void URITest::testCompare()
-{
- URI uri1("http://www.appinf.com");
- URI uri2("HTTP://www.appinf.com:80");
- assert (uri1 == uri2);
- assert (uri1 == "http://www.appinf.com:");
- assert (uri1 != "http://www.google.com");
-
- uri1 = "/foo/bar";
- assert (uri1 == "/foo/bar");
- assert (uri1 != "/foo/baz");
-
- uri1 = "?query";
- assert (uri1 == "?query");
- assert (uri1 != "?query2");
-
- uri1 = "#frag";
- assert (uri1 == "#frag");
- assert (uri1 != "#frag2");
-
- uri1 = "/index.html#frag";
- assert (uri1 == "/index.html#frag");
- assert (uri1 != "/index.html");
-}
-
-
-void URITest::testNormalize()
-{
- URI uri("http://www.appinf.com");
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com");
-
- uri = "http://www.appinf.com/";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/");
-
- uri = "http://www.appinf.com/foo/bar/./index.html";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/foo/bar/index.html");
-
- uri = "http://www.appinf.com/foo/bar/../index.html";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/foo/index.html");
-
- uri = "http://www.appinf.com/foo/./bar/../index.html";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/foo/index.html");
-
- uri = "http://www.appinf.com/foo/./bar/../index.html";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/foo/index.html");
-
- uri = "http://www.appinf.com/foo/bar/../../index.html";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/index.html");
-
- uri = "http://www.appinf.com/foo/bar/../../../index.html";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/index.html");
-
- uri = "http://www.appinf.com/foo/bar/.././../index.html";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/index.html");
-
- uri = "http://www.appinf.com/./foo/bar/index.html";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/foo/bar/index.html");
-
- uri = "http://www.appinf.com/../foo/bar/index.html";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/foo/bar/index.html");
-
- uri = "http://www.appinf.com/../foo/bar/";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/foo/bar/");
-
- uri = "http://www.appinf.com/../foo/../";
- uri.normalize();
- assert (uri.toString() == "http://www.appinf.com/");
-
- uri = "file:///c:/Windows/system32/";
- uri.normalize();
- assert (uri.toString() == "file:///c:/Windows/system32/");
-
- uri.clear();
- uri.setPath("c:/windows/system32/");
- uri.normalize();
- assert (uri.toString() == "./c:/windows/system32/");
-}
-
-
-void URITest::testResolve()
-{
- URI uri("http://www.appinf.com");
-
- uri.resolve("/index.html");
- assert (uri.toString() == "http://www.appinf.com/index.html");
-
- uri.resolve("#frag");
- assert (uri.toString() == "http://www.appinf.com/index.html#frag");
-
- uri = "http://www.appinf.com/html";
- uri.resolve("../images/foo.gif");
- assert (uri.toString() == "http://www.appinf.com/images/foo.gif");
-
- uri = "http://www.appinf.com/html/";
- uri.resolve(".");
- assert (uri.toString() == "http://www.appinf.com/html/");
-
- uri = "http://www.appinf.com/html/";
- uri.resolve(".");
- assert (uri.toString() == "http://www.appinf.com/html/");
-
- uri = "http://www.appinf.com/html/";
- uri.resolve("..");
- assert (uri.toString() == "http://www.appinf.com/");
-
- uri = "http://www.appinf.com/html/";
- uri.resolve("index.html");
- assert (uri.toString() == "http://www.appinf.com/html/index.html");
-
- uri = "http://www.appinf.com/html/";
- uri.resolve("/index.html");
- assert (uri.toString() == "http://www.appinf.com/index.html");
-
- uri = "/a/b/c/d/e";
- uri.resolve("./../../f/./g");
- assert (uri.toString() == "/a/b/f/g");
-
- uri = "/a/b/../c/";
- uri.resolve("../d");
- assert (uri.toString() == "/a/d");
-
- uri = "/a/b/../c/";
- uri.resolve("../d/");
- assert (uri.toString() == "/a/d/");
-
- uri = "/a/b/c/";
- uri.resolve("../../../../d/");
- assert (uri.toString() == "/d/");
-
- uri = "/a/b/c/";
- uri.resolve("%2e%2e/%2e%2e/%2e%2e/../d/");
- assert (uri.toString() == "/d/");
-
- uri = "/a/b/c/";
- uri.resolve("");
- assert (uri.toString() == "/a/b/c/");
-
- uri = "/a/b/c/";
- uri.resolve("/d/");
- assert (uri.toString() == "/d/");
-
- uri = "/a/b/c";
- uri.resolve("");
- assert (uri.toString() == "/a/b/c");
-
- uri = "/a/b/c";
- uri.resolve("?query=test");
- assert (uri.toString() == "/a/b/c?query=test");
-
- uri = "/a/b/c";
- uri.resolve("#frag");
- assert (uri.toString() == "/a/b/c#frag");
-
- uri = "http://www.appinf.com/html/";
- uri.resolve("http://www.google.com/");
- assert (uri.toString() == "http://www.google.com/");
-
- uri = "http://www.appinf.com/";
- URI uri2(uri, "index.html");
- assert (uri2.toString() == "http://www.appinf.com/index.html");
-
- uri = "index.html";
- URI uri3(uri, "search.html");
- assert (uri3.toString() == "search.html");
-}
-
-
-void URITest::testSwap()
-{
- URI uri1("http://www.appinf.com/search.cgi?keyword=test%20encoded&scope=all#result");
- URI uri2("mailto:John.Doe@example.com");
-
- uri1.swap(uri2);
- assert (uri1.toString() == "mailto:John.Doe@example.com");
- assert (uri2.toString() == "http://www.appinf.com/search.cgi?keyword=test%20encoded&scope=all#result");
-}
-
-
-void URITest::setUp()
-{
-}
-
-
-void URITest::tearDown()
-{
-}
-
-
-CppUnit::Test* URITest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("URITest");
-
- CppUnit_addTest(pSuite, URITest, testConstruction);
- CppUnit_addTest(pSuite, URITest, testParse);
- CppUnit_addTest(pSuite, URITest, testToString);
- CppUnit_addTest(pSuite, URITest, testCompare);
- CppUnit_addTest(pSuite, URITest, testNormalize);
- CppUnit_addTest(pSuite, URITest, testResolve);
- CppUnit_addTest(pSuite, URITest, testSwap);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/URITest.h b/Utilities/Poco/Foundation/testsuite/src/URITest.h
deleted file mode 100755
index 56e58382a7..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/URITest.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// URITest.h
-//
-// $Id$
-//
-// Definition of the URITest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef URITest_INCLUDED
-#define URITest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class URITest: public CppUnit::TestCase
-{
-public:
- URITest(const std::string& name);
- ~URITest();
-
- void testConstruction();
- void testParse();
- void testToString();
- void testCompare();
- void testNormalize();
- void testResolve();
- void testSwap();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // URITest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/URITestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/URITestSuite.cpp
deleted file mode 100755
index 931c001d11..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/URITestSuite.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// URITestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "URITestSuite.h"
-#include "URITest.h"
-#include "URIStreamOpenerTest.h"
-
-
-CppUnit::Test* URITestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("URITestSuite");
-
- pSuite->addTest(URITest::suite());
- pSuite->addTest(URIStreamOpenerTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/URITestSuite.h b/Utilities/Poco/Foundation/testsuite/src/URITestSuite.h
deleted file mode 100755
index 61a7c4bbe0..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/URITestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// URITestSuite.h
-//
-// $Id$
-//
-// Definition of the URITestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef URITestSuite_INCLUDED
-#define URITestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class URITestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // URITestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/UTF8StringTest.cpp b/Utilities/Poco/Foundation/testsuite/src/UTF8StringTest.cpp
deleted file mode 100755
index c31d30a63a..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UTF8StringTest.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// UTF8StringTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "UTF8StringTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/UTF8String.h"
-
-
-using Poco::UTF8;
-
-
-UTF8StringTest::UTF8StringTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-UTF8StringTest::~UTF8StringTest()
-{
-}
-
-
-void UTF8StringTest::testCompare()
-{
- std::string a1("aaaaa");
- std::string b1("bbbbb");
-
- assert (UTF8::icompare(a1, b1) < 0);
-
- std::string a2("aaaaa");
- std::string b2("BBBBB");
-
- assert (UTF8::icompare(a2, b2) < 0);
-
- std::string a3("AAAAA");
- std::string b3("bbbbb");
-
- assert (UTF8::icompare(a3, b3) < 0);
-
- std::string a4("aaaaa");
- std::string b4("AAAAA");
-
- assert (UTF8::icompare(a4, b4) == 0);
-
- std::string a5("AAAAA");
- std::string b5("bbbbb");
-
- assert (UTF8::icompare(a5, b5) < 0);
-
- std::string a6("\303\274\303\266\303\244"); // "u"o"a
- std::string b6("\303\234\303\226\303\204"); // "U"O"A
-
- assert (UTF8::icompare(a6, b6) == 0);
-}
-
-
-void UTF8StringTest::testTransform()
-{
- std::string s1("abcde");
- UTF8::toUpperInPlace(s1);
- assert (s1 == "ABCDE");
-
- std::string s2("aBcDe123");
- UTF8::toUpperInPlace(s2);
- assert (s2 == "ABCDE123");
-
- std::string s3("\303\274\303\266\303\244"); // "u"o"a
- UTF8::toUpperInPlace(s3);
- assert (s3 == "\303\234\303\226\303\204"); // "U"O"A
- UTF8::toLowerInPlace(s3);
- assert (s3 == "\303\274\303\266\303\244"); // "u"o"a
-
- // a mix of invalid sequences
- std::string str = "\xC2\xE5\xF0\xF8\xE8\xED\xFB+-++";
- assert ("???" == UTF8::toLower(str));
-}
-
-
-void UTF8StringTest::setUp()
-{
-}
-
-
-void UTF8StringTest::tearDown()
-{
-}
-
-
-CppUnit::Test* UTF8StringTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("UTF8StringTest");
-
- CppUnit_addTest(pSuite, UTF8StringTest, testCompare);
- CppUnit_addTest(pSuite, UTF8StringTest, testTransform);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/UTF8StringTest.h b/Utilities/Poco/Foundation/testsuite/src/UTF8StringTest.h
deleted file mode 100755
index 6560eb2368..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UTF8StringTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// UTF8StringTest.h
-//
-// $Id$
-//
-// Definition of the UTF8StringTest class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef UTF8StringTest_INCLUDED
-#define UTF8StringTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class UTF8StringTest: public CppUnit::TestCase
-{
-public:
- UTF8StringTest(const std::string& name);
- ~UTF8StringTest();
-
- void testCompare();
- void testTransform();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // UTF8StringTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/UUIDGeneratorTest.cpp b/Utilities/Poco/Foundation/testsuite/src/UUIDGeneratorTest.cpp
deleted file mode 100755
index 0b3636e3c8..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UUIDGeneratorTest.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// UUIDGeneratorTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "UUIDGeneratorTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/UUIDGenerator.h"
-#include "Poco/UUID.h"
-#include <set>
-
-
-using Poco::UUIDGenerator;
-using Poco::UUID;
-
-
-UUIDGeneratorTest::UUIDGeneratorTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-UUIDGeneratorTest::~UUIDGeneratorTest()
-{
-}
-
-
-void UUIDGeneratorTest::testTimeBased()
-{
- UUIDGenerator& gen = UUIDGenerator::defaultGenerator();
-
- std::set<UUID> uuids;
- for (int i = 0; i < 1000; ++i)
- {
- UUID uuid = gen.create();
- assert (uuid.version() == UUID::UUID_TIME_BASED);
- assert (uuids.find(uuid) == uuids.end());
- uuids.insert(uuid);
- }
-}
-
-
-void UUIDGeneratorTest::testRandom()
-{
- UUIDGenerator& gen = UUIDGenerator::defaultGenerator();
-
- std::set<UUID> uuids;
- for (int i = 0; i < 1000; ++i)
- {
- UUID uuid = gen.createRandom();
- assert (uuid.version() == UUID::UUID_RANDOM);
- assert (uuids.find(uuid) == uuids.end());
- uuids.insert(uuid);
- }
-}
-
-
-void UUIDGeneratorTest::testNameBased()
-{
- UUIDGenerator& gen = UUIDGenerator::defaultGenerator();
-
- UUID uuid1 = gen.createFromName(UUID::uri(), "http://www.appinf.com/uuid");
- assert (uuid1.version() == UUID::UUID_NAME_BASED);
- assert (uuid1.variant() == 2);
-
- UUID uuid2 = gen.createFromName(UUID::uri(), "http://www.appinf.com/uuid2");
- assert (uuid2 != uuid1);
-
- UUID uuid3 = gen.createFromName(UUID::dns(), "www.appinf.com");
- assert (uuid3 != uuid1);
-
- UUID uuid4 = gen.createFromName(UUID::oid(), "1.3.6.1.4.1");
- assert (uuid4 != uuid1);
-
- UUID uuid5 = gen.createFromName(UUID::x500(), "cn=Guenter Obiltschnig, ou=People, o=Applied Informatics, c=at");
- assert (uuid5 != uuid1);
-
- UUID uuid6 = gen.createFromName(UUID::uri(), "http://www.appinf.com/uuid");
- assert (uuid6 == uuid1);
-}
-
-
-void UUIDGeneratorTest::setUp()
-{
-}
-
-
-void UUIDGeneratorTest::tearDown()
-{
-}
-
-
-CppUnit::Test* UUIDGeneratorTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("UUIDGeneratorTest");
-
- CppUnit_addTest(pSuite, UUIDGeneratorTest, testTimeBased);
- CppUnit_addTest(pSuite, UUIDGeneratorTest, testRandom);
- CppUnit_addTest(pSuite, UUIDGeneratorTest, testNameBased);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/UUIDGeneratorTest.h b/Utilities/Poco/Foundation/testsuite/src/UUIDGeneratorTest.h
deleted file mode 100755
index 587359f737..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UUIDGeneratorTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// UUIDGeneratorTest.h
-//
-// $Id$
-//
-// Definition of the UUIDGeneratorTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef UUIDGeneratorTest_INCLUDED
-#define UUIDGeneratorTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class UUIDGeneratorTest: public CppUnit::TestCase
-{
-public:
- UUIDGeneratorTest(const std::string& name);
- ~UUIDGeneratorTest();
-
- void testTimeBased();
- void testRandom();
- void testNameBased();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // UUIDGeneratorTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/UUIDTest.cpp b/Utilities/Poco/Foundation/testsuite/src/UUIDTest.cpp
deleted file mode 100755
index 348d21e6fe..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UUIDTest.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-//
-// UUIDTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "UUIDTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/UUID.h"
-
-
-using Poco::UUID;
-
-
-UUIDTest::UUIDTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-UUIDTest::~UUIDTest()
-{
-}
-
-
-void UUIDTest::testParse()
-{
- UUID uuid("6ba7b810-9dad-11d1-80b4-00c04fd430c8");
- assert (uuid.toString() == "6ba7b810-9dad-11d1-80b4-00c04fd430c8");
-
- uuid.parse("6BA7B810-9DAD-11D1-80B4-00C04FD430C8");
- assert (uuid.toString() == "6ba7b810-9dad-11d1-80b4-00c04fd430c8");
-}
-
-
-void UUIDTest::testBuffer()
-{
- UUID uuid("6ba7b810-9dad-11d1-80b4-00c04fd430c8");
- char buffer[16];
- uuid.copyTo(buffer);
- UUID uuid2;
- uuid2.copyFrom(buffer);
- assert (uuid2.toString() == "6ba7b810-9dad-11d1-80b4-00c04fd430c8");
-}
-
-
-void UUIDTest::testCompare()
-{
- UUID nil;
- assert (nil.isNil());
- assert (UUID::nil().isNil());
-
- UUID uuid1 = nil;
- UUID uuid2;
- assert (uuid1.isNil());
- assert (uuid1 == nil);
- assert (!(uuid1 != nil));
- assert (uuid1 >= nil);
- assert (uuid1 <= nil);
- assert (!(uuid1 > nil));
- assert (!(uuid1 < nil));
- assert (uuid1.toString() == "00000000-0000-0000-0000-000000000000");
-
- uuid1 = UUID::dns();
- assert (!uuid1.isNil());
- assert (uuid1 != nil);
- assert (!(uuid1 == nil));
- assert (uuid1 >= nil);
- assert (!(uuid1 <= nil));
- assert (uuid1 > nil);
- assert (!(uuid1 < nil));
- assert (uuid1.toString() == "6ba7b810-9dad-11d1-80b4-00c04fd430c8");
-
- assert (nil != uuid1);
- assert (!(nil == uuid1));
- assert (!(nil >= uuid1));
- assert (nil <= uuid1);
- assert (!(nil > uuid1));
- assert (nil < uuid1);
-
- uuid2 = uuid1;
- assert (uuid2 == uuid1);
- assert (!(uuid2 != uuid1));
- assert (uuid2 >= uuid1);
- assert (uuid2 <= uuid1);
- assert (!(uuid2 > uuid1));
- assert (!(uuid2 < uuid1));
-}
-
-
-void UUIDTest::testVersion()
-{
- UUID uuid("db4fa7e9-9e62-4597-99e0-b1ec0b59800e");
- UUID::Version v = uuid.version();
- assert (v == UUID::UUID_RANDOM);
-
- uuid.parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8");
- v = uuid.version();
- assert (v == UUID::UUID_TIME_BASED);
-
- uuid.parse("d2ee4220-3625-11d9-9669-0800200c9a66");
- v = uuid.version();
- assert (v == UUID::UUID_TIME_BASED);
-
- uuid.parse("360d3652-4411-4786-bbe6-b9675b548559");
- v = uuid.version();
- assert (v == UUID::UUID_RANDOM);
-}
-
-
-void UUIDTest::testVariant()
-{
- UUID uuid("db4fa7e9-9e62-4597-99e0-b1ec0b59800e");
- int v = uuid.variant();
- assert (v == 2);
-
- uuid.parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8");
- v = uuid.variant();
- assert (v == 2);
-
- uuid.parse("d2ee4220-3625-11d9-9669-0800200c9a66");
- v = uuid.variant();
- assert (v == 2);
-
- uuid.parse("360d3652-4411-4786-bbe6-b9675b548559");
- v = uuid.variant();
- assert (v == 2);
-}
-
-
-void UUIDTest::testSwap()
-{
- UUID uuid1("db4fa7e9-9e62-4597-99e0-b1ec0b59800e");
- UUID uuid2("d2ee4220-3625-11d9-9669-0800200c9a66");
- uuid1.swap(uuid2);
- assert (uuid1.toString() == "d2ee4220-3625-11d9-9669-0800200c9a66");
- assert (uuid2.toString() == "db4fa7e9-9e62-4597-99e0-b1ec0b59800e");
-}
-
-
-void UUIDTest::setUp()
-{
-}
-
-
-void UUIDTest::tearDown()
-{
-}
-
-
-CppUnit::Test* UUIDTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("UUIDTest");
-
- CppUnit_addTest(pSuite, UUIDTest, testParse);
- CppUnit_addTest(pSuite, UUIDTest, testBuffer);
- CppUnit_addTest(pSuite, UUIDTest, testCompare);
- CppUnit_addTest(pSuite, UUIDTest, testVersion);
- CppUnit_addTest(pSuite, UUIDTest, testVariant);
- CppUnit_addTest(pSuite, UUIDTest, testSwap);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/UUIDTest.h b/Utilities/Poco/Foundation/testsuite/src/UUIDTest.h
deleted file mode 100755
index 84efa57e37..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UUIDTest.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// UUIDTest.h
-//
-// $Id$
-//
-// Definition of the UUIDTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef UUIDTest_INCLUDED
-#define UUIDTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class UUIDTest: public CppUnit::TestCase
-{
-public:
- UUIDTest(const std::string& name);
- ~UUIDTest();
-
- void testParse();
- void testBuffer();
- void testCompare();
- void testVersion();
- void testVariant();
- void testSwap();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // UUIDTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/UUIDTestSuite.cpp b/Utilities/Poco/Foundation/testsuite/src/UUIDTestSuite.cpp
deleted file mode 100755
index c18dd5ffc7..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UUIDTestSuite.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// UUIDTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "UUIDTestSuite.h"
-#include "UUIDTest.h"
-#include "UUIDGeneratorTest.h"
-
-
-CppUnit::Test* UUIDTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("UUIDTestSuite");
-
- pSuite->addTest(UUIDTest::suite());
- pSuite->addTest(UUIDGeneratorTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/UUIDTestSuite.h b/Utilities/Poco/Foundation/testsuite/src/UUIDTestSuite.h
deleted file mode 100755
index e1679b48b2..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UUIDTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// UUIDTestSuite.h
-//
-// $Id$
-//
-// Definition of the UUIDTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef UUIDTestSuite_INCLUDED
-#define UUIDTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class UUIDTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // UUIDTestSuite_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/UniqueExpireCacheTest.cpp b/Utilities/Poco/Foundation/testsuite/src/UniqueExpireCacheTest.cpp
deleted file mode 100755
index ae85c40f72..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UniqueExpireCacheTest.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-//
-// UniqueExpireCacheTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "UniqueExpireCacheTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Exception.h"
-#include "Poco/UniqueExpireCache.h"
-#include "Poco/UniqueAccessExpireCache.h"
-#include "Poco/ExpirationDecorator.h"
-#include "Poco/AccessExpirationDecorator.h"
-#include "Poco/Bugcheck.h"
-#include "Poco/Thread.h"
-
-
-using namespace Poco;
-
-
-struct IntVal
-{
- int value;
- Poco::Timestamp validUntil;
- IntVal(int val, Poco::Timestamp::TimeDiff v):value(val), validUntil()
- {
- validUntil += (v*1000);
- }
-
- const Poco::Timestamp& getExpiration() const
- {
- return validUntil;
- }
-};
-
-typedef AccessExpirationDecorator<int> DIntVal;
-
-#define DURSLEEP 250
-#define DURHALFSLEEP DURSLEEP / 2
-#define DURWAIT 300
-
-
-UniqueExpireCacheTest::UniqueExpireCacheTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-UniqueExpireCacheTest::~UniqueExpireCacheTest()
-{
-}
-
-
-void UniqueExpireCacheTest::testClear()
-{
- UniqueExpireCache<int, IntVal> aCache;
- aCache.add(1, IntVal(2, DURSLEEP));
- aCache.add(3, IntVal(4, DURSLEEP));
- aCache.add(5, IntVal(6, DURSLEEP));
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (aCache.get(1)->value == 2);
- assert (aCache.get(3)->value == 4);
- assert (aCache.get(5)->value == 6);
- aCache.clear();
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (!aCache.has(5));
-}
-
-
-void UniqueExpireCacheTest::testAccessClear()
-{
- UniqueAccessExpireCache<int, DIntVal> aCache;
- aCache.add(1, DIntVal(2, DURSLEEP));
- aCache.add(3, DIntVal(4, DURSLEEP));
- aCache.add(5, DIntVal(6, DURSLEEP));
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (aCache.get(1)->value() == 2);
- assert (aCache.get(3)->value() == 4);
- assert (aCache.get(5)->value() == 6);
- aCache.clear();
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (!aCache.has(5));
-}
-
-
-void UniqueExpireCacheTest::testAccessUpdate()
-{
- UniqueAccessExpireCache<int, DIntVal> aCache;
- aCache.add(1, DIntVal(2, DURSLEEP));
- aCache.add(3, DIntVal(4, DURSLEEP));
- aCache.add(5, DIntVal(6, DURSLEEP));
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (aCache.get(1)->value() == 2);
- Thread::sleep(DURSLEEP/2);
- assert (aCache.get(1)->value() == 2);
- Thread::sleep(DURSLEEP/2);
- assert (aCache.get(1)->value() == 2);
- Thread::sleep(DURSLEEP/2);
- assert (aCache.get(1)->value() == 2);
- assert (!aCache.has(3));
- assert (!aCache.has(5));
- Thread::sleep(DURSLEEP*2);
-
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (!aCache.has(5));
- aCache.remove(666); //must work too
-}
-
-
-void UniqueExpireCacheTest::testExpire0()
-{
- UniqueExpireCache<int, IntVal> aCache;
- aCache.add(1, IntVal(2, 0));
- assert (!aCache.has(1));
-}
-
-
-
-void UniqueExpireCacheTest::testAccessExpire0()
-{
- UniqueAccessExpireCache<int, DIntVal> aCache;
- aCache.add(1, DIntVal(2, Timespan(0, 0)));
- assert (!aCache.has(1));
-}
-
-
-void UniqueExpireCacheTest::testExpireN()
-{
- // 3-1 represents the cache sorted by age, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- UniqueExpireCache<int, IntVal> aCache;
- aCache.add(1, IntVal(2, DURSLEEP)); // 1
- assert (aCache.has(1));
- SharedPtr<IntVal> tmp = aCache.get(1);
- assert (!tmp.isNull());
- assert (tmp->value == 2);
- Thread::sleep(DURWAIT);
- assert (!aCache.has(1));
-
- // tmp must still be valid, access it
- assert (tmp->value == 2);
- tmp = aCache.get(1);
- assert (tmp.isNull());
-
- aCache.add(1, IntVal(2, DURSLEEP)); // 1
- Thread::sleep(DURHALFSLEEP);
- aCache.add(3, IntVal(4, DURSLEEP)); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- tmp = aCache.get(1);
- SharedPtr<IntVal> tmp2 = aCache.get(3);
- assert (tmp->value == 2);
- assert (tmp2->value == 4);
-
- Thread::sleep(DURHALFSLEEP+25); //3|1
- assert (!aCache.has(1));
- assert (aCache.has(3));
- assert (tmp->value == 2); // 1-3
- assert (tmp2->value == 4); // 3-1
- tmp2 = aCache.get(3);
- assert (tmp2->value == 4);
- Thread::sleep(DURHALFSLEEP+25); //3|1
- assert (!aCache.has(3));
- assert (tmp2->value == 4);
- tmp = aCache.get(1);
- tmp2 = aCache.get(3);
- assert (!tmp);
- assert (!tmp2);
-
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
- assert (!aCache.has(3));
-}
-
-
-void UniqueExpireCacheTest::testDuplicateAdd()
-{
- UniqueExpireCache<int, IntVal> aCache;
- aCache.add(1, IntVal(2, DURSLEEP)); // 1
- assert (aCache.has(1));
- assert (aCache.get(1)->value == 2);
- aCache.add(1, IntVal(3, DURSLEEP));
- assert (aCache.has(1));
- assert (aCache.get(1)->value == 3);
-}
-
-
-void UniqueExpireCacheTest::testAccessDuplicateAdd()
-{
- UniqueAccessExpireCache<int, DIntVal> aCache;
- aCache.add(1, DIntVal(2, DURSLEEP)); // 1
- assert (aCache.has(1));
- assert (aCache.get(1)->value() == 2);
- aCache.add(1, DIntVal(3, DURSLEEP));
- assert (aCache.has(1));
- assert (aCache.get(1)->value() == 3);
-}
-
-
-void UniqueExpireCacheTest::testExpirationDecorator()
-{
- typedef ExpirationDecorator<int> ExpireInt;
- UniqueExpireCache<int, ExpireInt> aCache;
- aCache.add(1, ExpireInt(2, DURSLEEP)); // 1
- assert (aCache.has(1));
- assert (aCache.get(1)->value() == 2);
- aCache.add(1, ExpireInt(3, DURSLEEP));
- assert (aCache.has(1));
- assert (aCache.get(1)->value() == 3);
-}
-
-
-void UniqueExpireCacheTest::setUp()
-{
-}
-
-
-void UniqueExpireCacheTest::tearDown()
-{
-}
-
-
-CppUnit::Test* UniqueExpireCacheTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("UniqueExpireCacheTest");
-
- CppUnit_addTest(pSuite, UniqueExpireCacheTest, testClear);
- CppUnit_addTest(pSuite, UniqueExpireCacheTest, testAccessClear);
- CppUnit_addTest(pSuite, UniqueExpireCacheTest, testAccessUpdate);
- CppUnit_addTest(pSuite, UniqueExpireCacheTest, testExpire0);
- CppUnit_addTest(pSuite, UniqueExpireCacheTest, testAccessExpire0);
- CppUnit_addTest(pSuite, UniqueExpireCacheTest, testExpireN);
- CppUnit_addTest(pSuite, UniqueExpireCacheTest, testDuplicateAdd);
- CppUnit_addTest(pSuite, UniqueExpireCacheTest, testAccessDuplicateAdd);
- CppUnit_addTest(pSuite, UniqueExpireCacheTest, testExpirationDecorator);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/UniqueExpireCacheTest.h b/Utilities/Poco/Foundation/testsuite/src/UniqueExpireCacheTest.h
deleted file mode 100755
index 4488c0de83..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UniqueExpireCacheTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// UniqueExpireCacheTest.h
-//
-// $Id$
-//
-// Tests for ExpireCache
-//
-// Copyright (c) 2006, 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.
-//
-
-#ifndef UniqueExpireCacheTest_INCLUDED
-#define UniqueExpireCacheTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class UniqueExpireCacheTest: public CppUnit::TestCase
-{
-public:
- UniqueExpireCacheTest(const std::string& name);
- ~UniqueExpireCacheTest();
-
- void testClear();
- void testAccessClear();
- void testDuplicateAdd();
- void testAccessDuplicateAdd();
- void testExpire0();
- void testAccessExpire0();
- void testExpireN();
- void testExpirationDecorator();
- void testAccessUpdate();
-
- void setUp();
- void tearDown();
- static CppUnit::Test* suite();
-};
-
-
-#endif // UniqueExpireCacheTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/UniqueExpireLRUCacheTest.cpp b/Utilities/Poco/Foundation/testsuite/src/UniqueExpireLRUCacheTest.cpp
deleted file mode 100755
index e96e5926c5..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UniqueExpireLRUCacheTest.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-//
-// UniqueExpireLRUCacheTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "UniqueExpireLRUCacheTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Exception.h"
-#include "Poco/UniqueExpireLRUCache.h"
-#include "Poco/UniqueAccessExpireLRUCache.h"
-#include "Poco/AccessExpirationDecorator.h"
-#include "Poco/Bugcheck.h"
-#include "Poco/Thread.h"
-
-
-using namespace Poco;
-
-
-struct IntVal
-{
- int value;
- Poco::Timestamp validUntil;
- IntVal(int val, Poco::Timestamp::TimeDiff v):value(val), validUntil()
- {
- validUntil += (v*1000);
- }
-
- const Poco::Timestamp& getExpiration() const
- {
- return validUntil;
- }
-};
-
-
-typedef AccessExpirationDecorator<int> DIntVal;
-
-
-#define DURSLEEP 250
-#define DURHALFSLEEP DURSLEEP / 2
-#define DURWAIT 300
-
-
-UniqueExpireLRUCacheTest::UniqueExpireLRUCacheTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-UniqueExpireLRUCacheTest::~UniqueExpireLRUCacheTest()
-{
-}
-
-
-void UniqueExpireLRUCacheTest::testClear()
-{
- UniqueExpireLRUCache<int, IntVal> aCache;
- aCache.add(1, IntVal(2, DURSLEEP));
- aCache.add(3, IntVal(4, DURSLEEP));
- aCache.add(5, IntVal(6, DURSLEEP));
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (aCache.get(1)->value == 2);
- assert (aCache.get(3)->value == 4);
- assert (aCache.get(5)->value == 6);
- aCache.clear();
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (!aCache.has(5));
-}
-
-
-
-void UniqueExpireLRUCacheTest::testAccessClear()
-{
- UniqueAccessExpireLRUCache<int, DIntVal> aCache;
- aCache.add(1, DIntVal(2, DURSLEEP));
- aCache.add(3, DIntVal(4, DURSLEEP));
- aCache.add(5, DIntVal(6, DURSLEEP));
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (aCache.get(1)->value() == 2);
- assert (aCache.get(3)->value() == 4);
- assert (aCache.get(5)->value() == 6);
- aCache.clear();
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (!aCache.has(5));
-}
-
-void UniqueExpireLRUCacheTest::testExpire0()
-{
- UniqueExpireLRUCache<int, IntVal> aCache;
- aCache.add(1, IntVal(2, 0));
- assert (!aCache.has(1));
-}
-
-
-void UniqueExpireLRUCacheTest::testExpireN()
-{
- // 3-1 represents the cache sorted by age, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- UniqueExpireLRUCache<int, IntVal> aCache(3);
- aCache.add(1, IntVal(2, DURSLEEP)); // 1
- assert (aCache.has(1));
- SharedPtr<IntVal> tmp = aCache.get(1);
- assert (!tmp.isNull());
- assert (tmp->value == 2);
- Thread::sleep(DURWAIT);
- assert (!aCache.has(1));
-
- // tmp must still be valid, access it
- assert (tmp->value == 2);
- tmp = aCache.get(1);
- assert (!tmp);
-
- aCache.add(1, IntVal(2, DURSLEEP)); // 1
- Thread::sleep(DURHALFSLEEP);
- aCache.add(3, IntVal(4, DURSLEEP)); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- tmp = aCache.get(1);
- SharedPtr<IntVal> tmp2 = aCache.get(3);
- assert (tmp->value == 2);
- assert (tmp2->value == 4);
-
- Thread::sleep(DURHALFSLEEP+25); //3|1
- assert (!aCache.has(1));
- assert (aCache.has(3));
- assert (tmp->value == 2); // 1-3
- assert (tmp2->value == 4); // 3-1
- tmp2 = aCache.get(3);
- assert (tmp2->value == 4);
- Thread::sleep(DURHALFSLEEP+25); //3|1
- assert (!aCache.has(3));
- assert (tmp2->value == 4);
- tmp = aCache.get(1);
- tmp2 = aCache.get(3);
- assert (!tmp);
- assert (!tmp2);
-
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
- assert (!aCache.has(3));
-}
-
-
-void UniqueExpireLRUCacheTest::testCacheSize0()
-{
- // cache size 0 is illegal
- try
- {
- UniqueExpireLRUCache<int, IntVal> aCache(0);
- failmsg ("cache size of 0 is illegal, test should fail");
- }
- catch (Poco::InvalidArgumentException&)
- {
- }
-}
-
-
-void UniqueExpireLRUCacheTest::testCacheSize1()
-{
- UniqueExpireLRUCache<int, IntVal> aCache(1);
- aCache.add(1, IntVal(2, DURSLEEP));
- assert (aCache.has(1));
- assert (aCache.get(1)->value == 2);
-
- aCache.add(3, IntVal(4, DURSLEEP)); // replaces 1
- assert (!aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.get(3)->value == 4);
-
- aCache.add(5, IntVal(6, DURSLEEP));
- assert (!aCache.has(1));
- assert (!aCache.has(3));
- assert (aCache.has(5));
- assert (aCache.get(5)->value == 6);
-
- aCache.remove(5);
- assert (!aCache.has(5));
-
- // removing illegal entries should work too
- aCache.remove(666);
-}
-
-
-void UniqueExpireLRUCacheTest::testCacheSize2()
-{
- // 3-1 represents the cache sorted by pos, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- UniqueExpireLRUCache<int, IntVal> aCache(2);
- aCache.add(1, IntVal(2, DURSLEEP)); // 1
- assert (aCache.has(1));
- assert (aCache.get(1)->value == 2);
-
- aCache.add(3, IntVal(4, DURSLEEP)); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.get(1)->value == 2); // 1-3
- assert (aCache.get(3)->value == 4); // 3-1
-
- aCache.add(5, IntVal(6, DURSLEEP)); // 5-3|1
- assert (!aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (aCache.get(5)->value == 6); // 5-3
- assert (aCache.get(3)->value == 4); // 3-5
-
- // test remove from the end and the beginning of the list
- aCache.remove(5); // 3
- assert (!aCache.has(5));
- assert (aCache.get(3)->value == 4); // 3
- aCache.add(5, IntVal(6, DURSLEEP)); // 5-3
- assert (aCache.get(3)->value == 4); // 3-5
- aCache.remove(3); // 5
- assert (!aCache.has(3));
- assert (aCache.get(5)->value == 6); // 5
-
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
-}
-
-
-void UniqueExpireLRUCacheTest::testCacheSizeN()
-{
- // 3-1 represents the cache sorted by pos, elements get replaced at the end of the list
- // 3-1|5 -> 5 gets removed
- UniqueExpireLRUCache<int, IntVal> aCache(3);
- aCache.add(1, IntVal(2, DURSLEEP)); // 1
- assert (aCache.has(1));
- assert (aCache.get(1)->value == 2);
-
- aCache.add(3, IntVal(4, DURSLEEP)); // 3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.get(1)->value == 2); // 1-3
- assert (aCache.get(3)->value == 4); // 3-1
-
- aCache.add(5, IntVal(6, DURSLEEP)); // 5-3-1
- assert (aCache.has(1));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (aCache.get(5)->value == 6); // 5-3-1
- assert (aCache.get(3)->value == 4); // 3-5-1
-
- aCache.add(7, IntVal(8, DURSLEEP)); // 7-5-3|1
- assert (!aCache.has(1));
- assert (aCache.has(7));
- assert (aCache.has(3));
- assert (aCache.has(5));
- assert (aCache.get(5)->value == 6); // 5-7-3
- assert (aCache.get(3)->value == 4); // 3-5-7
- assert (aCache.get(7)->value == 8); // 7-3-5
-
- // test remove from the end and the beginning of the list
- aCache.remove(5); // 7-3
- assert (!aCache.has(5));
- assert (aCache.get(3)->value == 4); // 3-7
- aCache.add(5, IntVal(6, DURSLEEP)); // 5-3-7
- assert (aCache.get(7)->value == 8); // 7-5-3
- aCache.remove(7); // 5-3
- assert (!aCache.has(7));
- assert (aCache.has(3));
- assert (aCache.get(5)->value == 6); // 5-3
-
- // removing illegal entries should work too
- aCache.remove(666);
-
- aCache.clear();
- assert (!aCache.has(5));
- assert (!aCache.has(3));
-}
-
-
-void UniqueExpireLRUCacheTest::testDuplicateAdd()
-{
- UniqueExpireLRUCache<int, IntVal> aCache(3);
- aCache.add(1, IntVal(2, DURSLEEP)); // 1
- assert (aCache.has(1));
- assert (aCache.get(1)->value == 2);
- aCache.add(1, IntVal(3, DURSLEEP));
- assert (aCache.has(1));
- assert (aCache.get(1)->value == 3);
-}
-
-
-void UniqueExpireLRUCacheTest::setUp()
-{
-}
-
-
-void UniqueExpireLRUCacheTest::tearDown()
-{
-}
-
-
-CppUnit::Test* UniqueExpireLRUCacheTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("UniqueExpireLRUCacheTest");
-
- CppUnit_addTest(pSuite, UniqueExpireLRUCacheTest, testClear);
- CppUnit_addTest(pSuite, UniqueExpireLRUCacheTest, testAccessClear);
- CppUnit_addTest(pSuite, UniqueExpireLRUCacheTest, testExpire0);
- CppUnit_addTest(pSuite, UniqueExpireLRUCacheTest, testExpireN);
- CppUnit_addTest(pSuite, UniqueExpireLRUCacheTest, testCacheSize0);
- CppUnit_addTest(pSuite, UniqueExpireLRUCacheTest, testCacheSize1);
- CppUnit_addTest(pSuite, UniqueExpireLRUCacheTest, testCacheSize2);
- CppUnit_addTest(pSuite, UniqueExpireLRUCacheTest, testCacheSizeN);
- CppUnit_addTest(pSuite, UniqueExpireLRUCacheTest, testDuplicateAdd);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/UniqueExpireLRUCacheTest.h b/Utilities/Poco/Foundation/testsuite/src/UniqueExpireLRUCacheTest.h
deleted file mode 100755
index 74bafa091b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/UniqueExpireLRUCacheTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// UniqueExpireLRUCacheTest.h
-//
-// $Id$
-//
-// Tests for UniqueExpireLRUCache
-//
-// Copyright (c) 2006, 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.
-//
-
-#ifndef UniqueExpireLRUCacheTest_INCLUDED
-#define UniqueExpireLRUCacheTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class UniqueExpireLRUCacheTest: public CppUnit::TestCase
-{
-public:
- UniqueExpireLRUCacheTest(const std::string& name);
- ~UniqueExpireLRUCacheTest();
-
- void testClear();
- void testAccessClear();
- void testExpire0();
- void testExpireN();
- void testCacheSize0();
- void testCacheSize1();
- void testCacheSize2();
- void testCacheSizeN();
- void testDuplicateAdd();
-
- void setUp();
- void tearDown();
- static CppUnit::Test* suite();
-};
-
-
-#endif // UniqueExpireLRUCacheTest_INCLUDED
diff --git a/Utilities/Poco/Foundation/testsuite/src/WinDriver.cpp b/Utilities/Poco/Foundation/testsuite/src/WinDriver.cpp
deleted file mode 100755
index b5d3b3fb2b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/WinDriver.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// WinDriver.cpp
-//
-// $Id$
-//
-// Test driver for Windows.
-//
-// Copyright (c) 2004-2006, 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 "WinTestRunner/WinTestRunner.h"
-#include "FoundationTestSuite.h"
-
-
-class TestDriver: public CppUnit::WinTestRunnerApp
-{
- void TestMain()
- {
- CppUnit::WinTestRunner runner;
- runner.addTest(FoundationTestSuite::suite());
- runner.run();
- }
-};
-
-
-TestDriver theDriver;
diff --git a/Utilities/Poco/Foundation/testsuite/src/ZLibTest.cpp b/Utilities/Poco/Foundation/testsuite/src/ZLibTest.cpp
deleted file mode 100755
index f3b09f967b..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ZLibTest.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-//
-// ZLibTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ZLibTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/InflatingStream.h"
-#include "Poco/DeflatingStream.h"
-#include "Poco/StreamCopier.h"
-#include <sstream>
-
-
-using Poco::InflatingInputStream;
-using Poco::InflatingOutputStream;
-using Poco::DeflatingOutputStream;
-using Poco::DeflatingInputStream;
-using Poco::InflatingStreamBuf;
-using Poco::DeflatingStreamBuf;
-using Poco::StreamCopier;
-
-
-ZLibTest::ZLibTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ZLibTest::~ZLibTest()
-{
-}
-
-
-void ZLibTest::testDeflate1()
-{
- std::stringstream buffer;
- DeflatingOutputStream deflater(buffer);
- deflater << "abcdefabcdefabcdefabcdefabcdefabcdef" << std::endl;
- deflater << "abcdefabcdefabcdefabcdefabcdefabcdef" << std::endl;
- deflater.close();
- InflatingInputStream inflater(buffer);
- std::string data;
- inflater >> data;
- assert (data == "abcdefabcdefabcdefabcdefabcdefabcdef");
- inflater >> data;
- assert (data == "abcdefabcdefabcdefabcdefabcdefabcdef");
-}
-
-
-void ZLibTest::testDeflate2()
-{
- std::stringstream buffer;
- DeflatingOutputStream deflater(buffer);
- deflater << "abcdefabcdefabcdefabcdefabcdefabcdef" << std::endl;
- deflater << "abcdefabcdefabcdefabcdefabcdefabcdef" << std::endl;
- deflater.close();
- std::stringstream buffer2;
- InflatingOutputStream inflater(buffer2);
- StreamCopier::copyStream(buffer, inflater);
- inflater.close();
- std::string data;
- buffer2 >> data;
- assert (data == "abcdefabcdefabcdefabcdefabcdefabcdef");
- buffer2 >> data;
- assert (data == "abcdefabcdefabcdefabcdefabcdefabcdef");
-}
-
-
-void ZLibTest::testDeflate3()
-{
- std::stringstream buffer;
- buffer << "abcdefabcdefabcdefabcdefabcdefabcdef" << std::endl;
- buffer << "abcdefabcdefabcdefabcdefabcdefabcdef" << std::endl;
- DeflatingInputStream deflater(buffer);
- std::stringstream buffer2;
- StreamCopier::copyStream(deflater, buffer2);
- std::stringstream buffer3;
- InflatingOutputStream inflater(buffer3);
- StreamCopier::copyStream(buffer2, inflater);
- inflater.close();
- std::string data;
- buffer3 >> data;
- assert (data == "abcdefabcdefabcdefabcdefabcdefabcdef");
- buffer3 >> data;
- assert (data == "abcdefabcdefabcdefabcdefabcdefabcdef");
-}
-
-
-void ZLibTest::testGzip1()
-{
- std::stringstream buffer;
- DeflatingOutputStream deflater(buffer, DeflatingStreamBuf::STREAM_GZIP);
- deflater << "abcdefabcdefabcdefabcdefabcdefabcdef" << std::endl;
- deflater << "abcdefabcdefabcdefabcdefabcdefabcdef" << std::endl;
- deflater.close();
- InflatingInputStream inflater(buffer, InflatingStreamBuf::STREAM_GZIP);
- std::string data;
- inflater >> data;
- assert (data == "abcdefabcdefabcdefabcdefabcdefabcdef");
- inflater >> data;
- assert (data == "abcdefabcdefabcdefabcdefabcdefabcdef");
-}
-
-
-void ZLibTest::testGzip2()
-{
- // created with gzip ("Hello, world!"):
- const unsigned char gzdata[] =
- {
- 0x1f, 0x8b, 0x08, 0x08, 0xb0, 0x73, 0xd0, 0x41, 0x00, 0x03, 0x68, 0x77, 0x00, 0xf3, 0x48, 0xcd,
- 0xc9, 0xc9, 0xd7, 0x51, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0x51, 0xe4, 0x02, 0x00, 0x18, 0xa7, 0x55,
- 0x7b, 0x0e, 0x00, 0x00, 0x00, 0x00
- };
-
- std::string gzstr((char*) gzdata, sizeof(gzdata));
- std::istringstream istr(gzstr);
- InflatingInputStream inflater(istr, InflatingStreamBuf::STREAM_GZIP);
- std::string data;
- inflater >> data;
- assert (data == "Hello,");
- inflater >> data;
- assert (data == "world!");
-}
-
-
-void ZLibTest::setUp()
-{
-}
-
-
-void ZLibTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ZLibTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ZLibTest");
-
- CppUnit_addTest(pSuite, ZLibTest, testDeflate1);
- CppUnit_addTest(pSuite, ZLibTest, testDeflate2);
- CppUnit_addTest(pSuite, ZLibTest, testDeflate3);
- CppUnit_addTest(pSuite, ZLibTest, testGzip1);
- CppUnit_addTest(pSuite, ZLibTest, testGzip2);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Foundation/testsuite/src/ZLibTest.h b/Utilities/Poco/Foundation/testsuite/src/ZLibTest.h
deleted file mode 100755
index 52e9f2a84c..0000000000
--- a/Utilities/Poco/Foundation/testsuite/src/ZLibTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// ZLibTest.h
-//
-// $Id$
-//
-// Definition of the ZLibTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ZLibTest_INCLUDED
-#define ZLibTest_INCLUDED
-
-
-#include "Poco/Foundation.h"
-#include "CppUnit/TestCase.h"
-
-
-class ZLibTest: public CppUnit::TestCase
-{
-public:
- ZLibTest(const std::string& name);
- ~ZLibTest();
-
- void testDeflate1();
- void testDeflate2();
- void testDeflate3();
- void testGzip1();
- void testGzip2();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ZLibTest_INCLUDED
diff --git a/Utilities/Poco/LICENSE b/Utilities/Poco/LICENSE
deleted file mode 100644
index 36b7cd93cd..0000000000
--- a/Utilities/Poco/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Boost Software License - Version 1.0 - August 17th, 2003
-
-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.
diff --git a/Utilities/Poco/Util/CMakeLists.txt b/Utilities/Poco/Util/CMakeLists.txt
deleted file mode 100755
index b2a74aff48..0000000000
--- a/Utilities/Poco/Util/CMakeLists.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-set(LIBNAME "PocoUtil")
-#set(LIBNAMED "${LIBNAME}d")
-
-set( BASE_SRCS
-src/AbstractConfiguration.cpp
-src/Application.cpp
-src/ConfigurationMapper.cpp
-src/ConfigurationView.cpp
-src/FilesystemConfiguration.cpp
-src/HelpFormatter.cpp
-src/IniFileConfiguration.cpp
-src/IntValidator.cpp
-src/LayeredConfiguration.cpp
-src/LoggingConfigurator.cpp
-src/LoggingSubsystem.cpp
-src/MapConfiguration.cpp
-src/Option.cpp
-src/OptionCallback.cpp
-src/OptionException.cpp
-src/OptionProcessor.cpp
-src/OptionSet.cpp
-src/PropertyFileConfiguration.cpp
-src/RegExpValidator.cpp
-src/ServerApplication.cpp
-src/Subsystem.cpp
-src/SystemConfiguration.cpp
-src/Validator.cpp
-src/XMLConfiguration.cpp
-src/Timer.cpp
-src/TimerTask.cpp
-)
-
-set( WIN_SRCS
-src/WinRegistryConfiguration.cpp
-src/WinRegistryKey.cpp
-src/WinService.cpp
-)
-
-if(CMAKE_SYSTEM MATCHES "Windows")
- set(SRCS ${BASE_SRCS} ${WIN_SRCS})
- add_definitions( -DUtil_EXPORTS )
-else(CMAKE_SYSTEM MATCHES "Windows")
- set(SRCS ${BASE_SRCS})
-endif(CMAKE_SYSTEM MATCHES "Windows")
-
-add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
-set_target_properties( ${LIBNAME} PROPERTIES
- #COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
- VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
- SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-target_link_libraries( ${LIBNAME} PocoXML PocoFoundation)
-
-#add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
-#set_target_properties( ${LIBNAMED}
-# PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
-# DEFINE_SYMBOL Util_EXPORTS
-# VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
-# SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-#target_link_libraries( ${LIBNAMED} PocoXMLd PocoFoundationd )
-
-
diff --git a/Utilities/Poco/Util/include/Poco/Util/AbstractConfiguration.h b/Utilities/Poco/Util/include/Poco/Util/AbstractConfiguration.h
deleted file mode 100755
index a107daf869..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/AbstractConfiguration.h
+++ /dev/null
@@ -1,235 +0,0 @@
-//
-// AbstractConfiguration.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: AbstractConfiguration
-//
-// Definition of the AbstractConfiguration class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_AbstractConfiguration_INCLUDED
-#define Util_AbstractConfiguration_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Mutex.h"
-#include "Poco/RefCountedObject.h"
-#include <vector>
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API AbstractConfiguration: public Poco::RefCountedObject
- /// AbstractConfiguration is an abstract base class for different
- /// kinds of configuration data, such as INI files, property files,
- /// XML configuration files or the Windows Registry.
- ///
- /// Configuration property keys have a hierarchical format, consisting
- /// of names separated by periods. The exact interpretation of key names
- /// is up to the actual subclass implementation of AbstractConfiguration.
- /// Keys are case sensitive.
- ///
- /// All public methods are synchronized, so the class is safe for multithreaded use.
- /// AbstractConfiguration implements reference counting based garbage collection.
- ///
- /// Subclasses must override the getRaw(), setRaw() and enumerate() methods.
-{
-public:
- typedef std::vector<std::string> Keys;
-
- AbstractConfiguration();
- /// Creates the AbstractConfiguration.
-
- bool hasProperty(const std::string& key) const;
- /// Returns true iff the property with the given key exists.
-
- bool hasOption(const std::string& key) const;
- /// Returns true iff the property with the given key exists.
- /// Same as hasProperty().
-
- std::string getString(const std::string& key) const;
- /// Returns the string value of the property with the given name.
- /// Throws a NotFoundException if the key does not exist.
- /// If the value contains references to other properties (${<property>}), these
- /// are expanded.
-
- std::string getString(const std::string& key, const std::string& defaultValue) const;
- /// If a property with the given key exists, returns the property's string value,
- /// otherwise returns the given default value.
- /// If the value contains references to other properties (${<property>}), these
- /// are expanded.
-
- std::string getRawString(const std::string& key) const;
- /// Returns the raw string value of the property with the given name.
- /// Throws a NotFoundException if the key does not exist.
- /// References to other properties are not expanded.
-
- std::string getRawString(const std::string& key, const std::string& defaultValue) const;
- /// If a property with the given key exists, returns the property's raw string value,
- /// otherwise returns the given default value.
- /// References to other properties are not expanded.
-
- int getInt(const std::string& key) const;
- /// Returns the int value of the property with the given name.
- /// Throws a NotFoundException if the key does not exist.
- /// Throws a SyntaxException if the property can not be converted
- /// to an int.
- /// Numbers starting with 0x are treated as hexadecimal.
- /// If the value contains references to other properties (${<property>}), these
- /// are expanded.
-
- int getInt(const std::string& key, int defaultValue) const;
- /// If a property with the given key exists, returns the property's int value,
- /// otherwise returns the given default value.
- /// Throws a SyntaxException if the property can not be converted
- /// to an int.
- /// Numbers starting with 0x are treated as hexadecimal.
- /// If the value contains references to other properties (${<property>}), these
- /// are expanded.
-
- double getDouble(const std::string& key) const;
- /// Returns the double value of the property with the given name.
- /// Throws a NotFoundException if the key does not exist.
- /// Throws a SyntaxException if the property can not be converted
- /// to a double.
- /// If the value contains references to other properties (${<property>}), these
- /// are expanded.
-
- double getDouble(const std::string& key, double defaultValue) const;
- /// If a property with the given key exists, returns the property's double value,
- /// otherwise returns the given default value.
- /// Throws a SyntaxException if the property can not be converted
- /// to an double.
- /// If the value contains references to other properties (${<property>}), these
- /// are expanded.
-
- bool getBool(const std::string& key) const;
- /// Returns the double value of the property with the given name.
- /// Throws a NotFoundException if the key does not exist.
- /// Throws a SyntaxException if the property can not be converted
- /// to a double.
- /// If the value contains references to other properties (${<property>}), these
- /// are expanded.
-
- bool getBool(const std::string& key, bool defaultValue) const;
- /// If a property with the given key exists, returns the property's bool value,
- /// otherwise returns the given default value.
- /// Throws a SyntaxException if the property can not be converted
- /// to a boolean.
- /// The following string values can be converted into a boolean:
- /// - numerical values: non zero becomes true, zero becomes false
- /// - strings: true, yes, on become true, false, no, off become false
- /// Case does not matter.
- /// If the value contains references to other properties (${<property>}), these
- /// are expanded.
-
- void setString(const std::string& key, const std::string& value);
- /// Sets the property with the given key to the given value.
- /// An already existing value for the key is overwritten.
-
- void setInt(const std::string& key, int value);
- /// Sets the property with the given key to the given value.
- /// An already existing value for the key is overwritten.
-
- void setDouble(const std::string& key, double value);
- /// Sets the property with the given key to the given value.
- /// An already existing value for the key is overwritten.
-
- void setBool(const std::string& key, bool value);
- /// Sets the property with the given key to the given value.
- /// An already existing value for the key is overwritten.
-
- void keys(Keys& range) const;
- /// Returns in range the names of all keys at root level.
-
- void keys(const std::string& key, Keys& range) const;
- /// Returns in range the names of all subkeys under the given key.
- /// If an empty key is passed, all root level keys are returned.
-
- const AbstractConfiguration* createView(const std::string& prefix) const;
- /// Creates a non-mutable view (see ConfigurationView) into the configuration.
-
- AbstractConfiguration* createView(const std::string& prefix);
- /// Creates a view (see ConfigurationView) into the configuration.
-
- std::string expand(const std::string& value) const;
- /// Replaces all occurences of ${<property>} in value with the
- /// value of the <property>. If <property> does not exist,
- /// nothing is changed.
- ///
- /// If a circular property reference is detected, a
- /// CircularReferenceException will be thrown.
-
-protected:
- virtual bool getRaw(const std::string& key, std::string& value) const = 0;
- /// If the property with the given key exists, stores the property's value
- /// in value and returns true. Otherwise, returns false.
- ///
- /// Must be overridden by subclasses.
-
- virtual void setRaw(const std::string& key, const std::string& value) = 0;
- /// Sets the property with the given key to the given value.
- /// An already existing value for the key is overwritten.
- ///
- /// Must be overridden by subclasses.
-
- virtual void enumerate(const std::string& key, Keys& range) const = 0;
- /// Returns in range the names of all subkeys under the given key.
- /// If an empty key is passed, all root level keys are returned.
-
- static int parseInt(const std::string& value);
- static bool parseBool(const std::string& value);
-
- virtual ~AbstractConfiguration();
-
-private:
- std::string internalExpand(const std::string& value) const;
- std::string uncheckedExpand(const std::string& value) const;
-
- AbstractConfiguration(const AbstractConfiguration&);
- AbstractConfiguration& operator = (const AbstractConfiguration&);
-
- mutable int _depth;
- mutable Poco::FastMutex _mutex;
-
- friend class LayeredConfiguration;
- friend class ConfigurationView;
- friend class ConfigurationMapper;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_AbstractConfiguration_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/Application.h b/Utilities/Poco/Util/include/Poco/Util/Application.h
deleted file mode 100755
index 9bef3a3b2f..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/Application.h
+++ /dev/null
@@ -1,483 +0,0 @@
-//
-// Application.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Application
-// Module: Application
-//
-// Definition of the Application class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_Application_INCLUDED
-#define Util_Application_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/Subsystem.h"
-#include "Poco/Util/LayeredConfiguration.h"
-#include "Poco/Util/OptionSet.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Logger.h"
-#include "Poco/Path.h"
-#include "Poco/Timestamp.h"
-#include "Poco/Timespan.h"
-#include "Poco/AutoPtr.h"
-#include <vector>
-#include <typeinfo>
-
-
-namespace Poco {
-namespace Util {
-
-
-class OptionSet;
-
-
-class Util_API Application: public Subsystem
- /// The Application class implements the main subsystem
- /// in a process. The application class is responsible for
- /// initializing all its subsystems.
- ///
- /// Subclasses can and should override the following virtual methods:
- /// - initialize() (the one-argument, protected variant)
- /// - uninitialize()
- /// - reinitialize()
- /// - defineOptions()
- /// - handleOption()
- /// - main()
- ///
- /// The application's main logic should be implemented in
- /// the main() method.
- ///
- /// There may be at most one instance of the Application class
- /// in a process.
- ///
- /// The Application class maintains a LayeredConfiguration (available
- /// via the config() member function) consisting of:
- /// - a MapConfiguration (priority -100) storing application-specific
- /// properties, as well as properties from bound command line arguments.
- /// - a SystemConfiguration (priority 100)
- /// - the configurations loaded with loadConfiguration().
- ///
- /// The Application class sets a few default properties in
- /// its configuration. These are:
- /// - application.path: the absolute path to application executable
- /// - application.name: the file name of the application executable
- /// - application.baseName: the file name (excluding extension) of the application executable
- /// - application.dir: the path to the directory where the application executable resides
- /// - application.configDir: the path to the directory where the last configuration file loaded with loadConfiguration() was found.
- ///
- /// If loadConfiguration() has never been called, application.configDir will be equal to application.dir.
- ///
- /// The POCO_APP_MAIN macro can be used to implement main(argc, argv).
- /// If POCO has been built with POCO_WIN32_UTF8, POCO_APP_MAIN supports
- /// Unicode command line arguments.
-{
-public:
- enum ExitCode
- /// Commonly used exit status codes.
- /// Based on the definitions in the 4.3BSD <sysexits.h> header file.
- {
- EXIT_OK = 0, /// successful termination
- EXIT_USAGE = 64, /// command line usage error
- EXIT_DATAERR = 65, /// data format error
- EXIT_NOINPUT = 66, /// cannot open input
- EXIT_NOUSER = 67, /// addressee unknown
- EXIT_NOHOST = 68, /// host name unknown
- EXIT_UNAVAILABLE = 69, /// service unavailable
- EXIT_SOFTWARE = 70, /// internal software error
- EXIT_OSERR = 71, /// system error (e.g., can't fork)
- EXIT_OSFILE = 72, /// critical OS file missing
- EXIT_CANTCREAT = 73, /// can't create (user) output file
- EXIT_IOERR = 74, /// input/output error
- EXIT_TEMPFAIL = 75, /// temp failure; user is invited to retry
- EXIT_PROTOCOL = 76, /// remote error in protocol
- EXIT_NOPERM = 77, /// permission denied
- EXIT_CONFIG = 78 /// configuration error
- };
-
- enum ConfigPriority
- {
- PRIO_APPLICATION = -100,
- PRIO_DEFAULT = 0,
- PRIO_SYSTEM = 100
- };
-
- Application();
- /// Creates the Application.
-
- Application(int argc, char* argv[]);
- /// Creates the Application and calls init(argc, argv).
-
- void addSubsystem(Subsystem* pSubsystem);
- /// Adds a new subsystem to the application. The
- /// application immediately takes ownership of it, so that a
- /// call in the form
- /// Application::instance().addSubsystem(new MySubsystem);
- /// is okay.
-
- void init(int argc, char* argv[]);
- /// Initializes the application and all registered subsystems,
- /// using the given command line arguments.
-
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
- void init(int argc, wchar_t* argv[]);
- /// Initializes the application and all registered subsystems,
- /// using the given command line arguments.
- ///
- /// This Windows-specific version of init is used for passing
- /// Unicode command line arguments from wmain().
-#endif
-
- void init(const std::vector<std::string>& args);
- /// Initializes the application and all registered subsystems,
- /// using the given command line arguments.
-
- bool initialized() const;
- /// Returns true iff the application is in initialized state
- /// (that means, has been initialized but not yet uninitialized).
-
- void setUnixOptions(bool flag);
- /// Specify whether command line option handling is Unix-style
- /// (flag == true; default) or Windows/OpenVMS-style (flag == false).
- ///
- /// This member function should be called from the constructor of
- /// a subclass to be effective.
-
- int loadConfiguration(int priority = PRIO_DEFAULT);
- /// Loads configuration information from a default location.
- ///
- /// The configuration(s) will be added to the application's
- /// LayeredConfiguration with the given priority.
- ///
- /// The configuration file(s) must be located in the same directory
- /// as the executable or a parent directory of it, and must have the
- /// same base name as the executable, with one of the following extensions:
- /// .properties, .ini or .xml.
- ///
- /// The .properties file, if it exists, is loaded first, followed
- /// by the .ini file and the .xml file.
- ///
- /// If the application is built in debug mode (the _DEBUG preprocessor
- /// macro is defined) and the base name of the appication executable
- /// ends with a 'd', a config file without the 'd' ending its base name is
- /// also found.
- ///
- /// Example: Given the application "SampleAppd.exe", built in debug mode.
- /// Then loadConfiguration() will automatically find a configuration file
- /// named "SampleApp.properties" if it exists and if "SampleAppd.properties"
- /// cannot be found.
- ///
- /// Returns the number of configuration files loaded, which may be zero.
- ///
- /// This method must not be called before initialize(argc, argv)
- /// has been called.
-
- void loadConfiguration(const std::string& path, int priority = PRIO_DEFAULT);
- /// Loads configuration information from the file specified by
- /// the given path. The file type is determined by the file
- /// extension. The following extensions are supported:
- /// - .properties - properties file (PropertyFileConfiguration)
- /// - .ini - initialization file (IniFileConfiguration)
- /// - .xml - XML file (XMLConfiguration)
- ///
- /// Extensions are not case sensitive.
- ///
- /// The configuration will be added to the application's
- /// LayeredConfiguration with the given priority.
- ///
-
- template <class C> C& getSubsystem() const;
- /// Returns a reference to the subsystem of the class
- /// given as template argument.
- ///
- /// Throws a NotFoundException if such a subsystem has
- /// not been registered.
-
- virtual int run();
- /// Runs the application by performing additional initializations
- /// and calling the main() method.
-
- std::string commandName() const;
- /// Returns the command name used to invoke the application.
-
- LayeredConfiguration& config() const;
- /// Returns the application's configuration.
-
- Poco::Logger& logger() const;
- /// Returns the application's logger.
- ///
- /// Before the logging subsystem has been initialized, the
- /// application's logger is "ApplicationStartup", which is
- /// connected to a ConsoleChannel.
- ///
- /// After the logging subsystem has been initialized, which
- /// usually happens as the first action in Application::initialize(),
- /// the application's logger is the one specified by the
- /// "application.logger" configuration property. If that property
- /// is not specified, the logger is "Application".
-
- const OptionSet& options() const;
- /// Returns the application's option set.
-
- static Application& instance();
- /// Returns a reference to the Application singleton.
- ///
- /// Throws a NullPointerException if no Application instance exists.
-
- const Poco::Timestamp& startTime() const;
- /// Returns the application start time (UTC).
-
- Poco::Timespan uptime() const;
- /// Returns the application uptime.
-
- void stopOptionsProcessing();
- /// If called from an option callback, stops all further
- /// options processing.
- ///
- /// If called, the following options on the command line
- /// will not be processed, and required options will not
- /// be checked.
- ///
- /// This is useful, for example, if an option for displaying
- /// help information has been encountered and no other things
- /// besides displaying help shall be done.
-
- const char* name() const;
-
-protected:
- void initialize(Application& self);
- /// Initializes the application and all registered subsystems.
- /// Subsystems are always initialized in the exact same order
- /// in which they have been registered.
- ///
- /// Overriding implementations must call the base class implementation.
-
- void uninitialize();
- /// Uninitializes the application and all registered subsystems.
- /// Subsystems are always uninitialized in reverse order in which
- /// they have been initialized.
- ///
- /// Overriding implementations must call the base class implementation.
-
- void reinitialize(Application& self);
- /// Re-nitializes the application and all registered subsystems.
- /// Subsystems are always reinitialized in the exact same order
- /// in which they have been registered.
- ///
- /// Overriding implementations must call the base class implementation.
-
- virtual void defineOptions(OptionSet& options);
- /// Called before command line processing begins.
- /// If a subclass wants to support command line arguments,
- /// it must override this method.
- /// The default implementation does not define any options itself,
- /// but calls defineOptions() on all registered subsystems.
- ///
- /// Overriding implementations should call the base class implementation.
-
- virtual void handleOption(const std::string& name, const std::string& value);
- /// Called when the option with the given name is encountered
- /// during command line arguments processing.
- ///
- /// The default implementation does option validation, bindings
- /// and callback handling.
- ///
- /// Overriding implementations must call the base class implementation.
-
- void setLogger(Poco::Logger& logger);
- /// Sets the logger used by the application.
-
- virtual int main(const std::vector<std::string>& args);
- /// The application's main logic.
- ///
- /// Unprocessed command line arguments are passed in args.
- /// Note that all original command line arguments are available
- /// via the properties application.argc and application.argv[<n>].
- ///
- /// Returns an exit code which should be one of the values
- /// from the ExitCode enumeration.
-
- bool findFile(Poco::Path& path) const;
- /// Searches for the file in path in the application directory.
- ///
- /// If path is absolute, the method immediately returns true and
- /// leaves path unchanged.
- ///
- /// If path is relative, searches for the file in the application
- /// directory and in all subsequent parent directories.
- /// Returns true and stores the absolute path to the file in
- /// path if the file could be found. Returns false and leaves path
- /// unchanged otherwise.
-
- void init();
- /// Common initialization code.
-
- ~Application();
- /// Destroys the Application and deletes all registered subsystems.
-
-private:
- void setup();
- void setArgs(int argc, char* argv[]);
- void setArgs(const std::vector<std::string>& args);
- void getApplicationPath(Poco::Path& path) const;
- void processOptions();
- bool findAppConfigFile(const std::string& appName, const std::string& extension, Poco::Path& path) const;
-
- typedef Poco::AutoPtr<Subsystem> SubsystemPtr;
- typedef std::vector<SubsystemPtr> SubsystemVec;
- typedef Poco::AutoPtr<LayeredConfiguration> ConfigPtr;
- typedef std::vector<std::string> ArgVec;
-
- ConfigPtr _pConfig;
- SubsystemVec _subsystems;
- bool _initialized;
- std::string _command;
- ArgVec _args;
- OptionSet _options;
- bool _unixOptions;
- Poco::Logger* _pLogger;
- Poco::Timestamp _startTime;
- bool _stopOptionsProcessing;
-
- static Application* _pInstance;
-
- friend class LoggingSubsystem;
-
- Application(const Application&);
- Application& operator = (const Application&);
-};
-
-
-//
-// inlines
-//
-template <class C> C& Application::getSubsystem() const
-{
- for (SubsystemVec::const_iterator it = _subsystems.begin(); it != _subsystems.end(); ++it)
- {
- const Subsystem* pSS(it->get());
- const C* pC = dynamic_cast<const C*>(pSS);
- if (pC) return *const_cast<C*>(pC);
- }
- throw Poco::NotFoundException("The subsystem has not been registered", typeid(C).name());
-}
-
-
-inline bool Application::initialized() const
-{
- return _initialized;
-}
-
-
-inline LayeredConfiguration& Application::config() const
-{
- return *const_cast<LayeredConfiguration*>(_pConfig.get());
-}
-
-
-inline Poco::Logger& Application::logger() const
-{
- poco_check_ptr (_pLogger);
- return *_pLogger;
-}
-
-
-inline const OptionSet& Application::options() const
-{
- return _options;
-}
-
-
-inline Application& Application::instance()
-{
- poco_check_ptr (_pInstance);
- return *_pInstance;
-}
-
-
-inline const Poco::Timestamp& Application::startTime() const
-{
- return _startTime;
-}
-
-
-inline Poco::Timespan Application::uptime() const
-{
- Poco::Timestamp now;
- Poco::Timespan uptime = now - _startTime;
-
- return uptime;
-}
-
-
-} } // namespace Poco::Util
-
-
-//
-// Macro to implement main()
-//
-#if defined(_WIN32) && defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
- #define POCO_APP_MAIN(App) \
- int wmain(int argc, wchar_t** argv) \
- { \
- Poco::AutoPtr<App> pApp = new App; \
- try \
- { \
- pApp->init(argc, argv); \
- } \
- catch (Poco::Exception& exc) \
- { \
- pApp->logger().log(exc); \
- return Poco::Util::Application::EXIT_CONFIG;\
- } \
- return pApp->run(); \
- }
-#else
- #define POCO_APP_MAIN(App) \
- int main(int argc, char** argv) \
- { \
- Poco::AutoPtr<App> pApp = new App; \
- try \
- { \
- pApp->init(argc, argv); \
- } \
- catch (Poco::Exception& exc) \
- { \
- pApp->logger().log(exc); \
- return Poco::Util::Application::EXIT_CONFIG;\
- } \
- return pApp->run(); \
- }
-#endif
-
-
-#endif // Util_Application_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/ConfigurationMapper.h b/Utilities/Poco/Util/include/Poco/Util/ConfigurationMapper.h
deleted file mode 100755
index 88aa51e381..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/ConfigurationMapper.h
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// ConfigurationMapper.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: ConfigurationMapper
-//
-// Definition of the ConfigurationMapper class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_ConfigurationMapper_INCLUDED
-#define Util_ConfigurationMapper_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/AbstractConfiguration.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API ConfigurationMapper: public AbstractConfiguration
- /// This configuration maps a property hierarchy into another
- /// hierarchy.
- ///
- /// For example, given a configuration with the following properties:
- /// config.value1
- /// config.value2
- /// config.sub.value1
- /// config.sub.value2
- /// and a ConfigurationView with fromPrefix == "config" and toPrefix == "root.conf", then
- /// the above properties will be available via the mapper as
- /// root.conf.value1
- /// root.conf.value2
- /// root.conf.sub.value1
- /// root.conf.sub.value2
- ///
- /// FromPrefix can be empty, in which case, and given toPrefix == "root",
- /// the properties will be available as
- /// root.config.value1
- /// root.config.value2
- /// root.config.sub.value1
- /// root.config.sub.value2
- ///
- /// This is equivalent to the functionality of the ConfigurationView class.
- ///
- /// Similarly, toPrefix can also be empty. Given fromPrefix == "config" and
- /// toPrefix == "", the properties will be available as
- /// value1
- /// value2
- /// sub.value1
- /// sub.value2
- ///
- /// If both fromPrefix and toPrefix are empty, no mapping is performed.
- ///
- /// A ConfigurationMapper is most useful in combination with a
- /// LayeredConfiguration.
-{
-public:
- ConfigurationMapper(const std::string& fromPrefix, const std::string& toPrefix, AbstractConfiguration* pConfig);
- /// Creates the ConfigurationMapper. The ConfigurationMapper does not take
- /// ownership of the passed configuration.
-
-protected:
- bool getRaw(const std::string& key, std::string& value) const;
- void setRaw(const std::string& key, const std::string& value);
- void enumerate(const std::string& key, Keys& range) const;
-
- std::string translateKey(const std::string& key) const;
-
- ~ConfigurationMapper();
-
-private:
- ConfigurationMapper(const ConfigurationMapper&);
- ConfigurationMapper& operator = (const ConfigurationMapper&);
-
- std::string _fromPrefix;
- std::string _toPrefix;
- AbstractConfiguration* _pConfig;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_ConfigurationMapper_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/ConfigurationView.h b/Utilities/Poco/Util/include/Poco/Util/ConfigurationView.h
deleted file mode 100755
index 7b78087f34..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/ConfigurationView.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// ConfigurationView.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: ConfigurationView
-//
-// Definition of the ConfigurationView class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_ConfigurationView_INCLUDED
-#define Util_ConfigurationView_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/AbstractConfiguration.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API ConfigurationView: public AbstractConfiguration
- /// This configuration implements a "view" into a sub-hierarchy
- /// of another configuration.
- ///
- /// For example, given a configuration with the following properties:
- /// config.value1
- /// config.value2
- /// config.sub.value1
- /// config.sub.value2
- /// and a ConfigurationView with the prefix "config", then
- /// the above properties will be available via the view as
- /// value1
- /// value2
- /// sub.value1
- /// sub.value2
- ///
- /// A ConfigurationView is most useful in combination with a
- /// LayeredConfiguration.
- ///
- /// If a property is not found in the view, it is searched in
- /// the original configuration. Given the above example configuration,
- /// the property named "config.value1" will still be found in the view.
- ///
- /// The main reason for this is that placeholder expansion (${property})
- /// still works as expected given a ConfigurationView.
-{
-public:
- ConfigurationView(const std::string& prefix, AbstractConfiguration* pConfig);
- /// Creates the ConfigurationView. The ConfigurationView does not take
- /// ownership of the passed configuration.
-
-protected:
- bool getRaw(const std::string& key, std::string& value) const;
- void setRaw(const std::string& key, const std::string& value);
- void enumerate(const std::string& key, Keys& range) const;
-
- std::string translateKey(const std::string& key) const;
-
- ~ConfigurationView();
-
-private:
- ConfigurationView(const ConfigurationView&);
- ConfigurationView& operator = (const ConfigurationView&);
-
- std::string _prefix;
- AbstractConfiguration* _pConfig;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_ConfigurationView_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/FilesystemConfiguration.h b/Utilities/Poco/Util/include/Poco/Util/FilesystemConfiguration.h
deleted file mode 100755
index 02e10094a7..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/FilesystemConfiguration.h
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// FilesystemConfiguration.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: FilesystemConfiguration
-//
-// Definition of the FilesystemConfiguration class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_FilesystemConfiguration_INCLUDED
-#define Util_FilesystemConfiguration_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/AbstractConfiguration.h"
-#include "Poco/Path.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API FilesystemConfiguration: public AbstractConfiguration
- /// An implementation of AbstractConfiguration that stores configuration data
- /// in a directory hierarchy in the filesystem.
- ///
- /// Every period-separated part of a property name is represented
- /// as a directory in the filesystem, relative to the base directory.
- /// Values are stored in files named "data".
- ///
- /// All changes to properties are immediately persisted in the filesystem.
- ///
- /// For example, a configuration consisting of the properties
- ///
- /// logging.loggers.root.channel.class = ConsoleChannel
- /// logging.loggers.app.name = Application
- /// logging.loggers.app.channel = c1
- /// logging.formatters.f1.class = PatternFormatter
- /// logging.formatters.f1.pattern = [%p] %t
- ///
- /// is stored in the filesystem as follows:
- ///
- /// logging/
- /// loggers/
- /// root/
- /// channel/
- /// class/
- /// data ("ConsoleChannel")
- /// app/
- /// name/
- /// data ("Application")
- /// channel/
- /// data ("c1")
- /// formatters/
- /// f1/
- /// class/
- /// data ("PatternFormatter")
- /// pattern/
- /// data ("[%p] %t")
-{
-public:
- FilesystemConfiguration(const std::string& path);
- /// Creates a FilesystemConfiguration using the given path.
- /// All directories are created as necessary.
-
- void clear();
- /// Clears the configuration by erasing the configuration
- /// directory and all its subdirectories and files.
-
-protected:
- bool getRaw(const std::string& key, std::string& value) const;
- void setRaw(const std::string& key, const std::string& value);
- void enumerate(const std::string& key, Keys& range) const;
- Poco::Path keyToPath(const std::string& key) const;
- ~FilesystemConfiguration();
-
-private:
- Poco::Path _path;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_FilesystemConfiguration_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/HelpFormatter.h b/Utilities/Poco/Util/include/Poco/Util/HelpFormatter.h
deleted file mode 100755
index 8d7cf0b378..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/HelpFormatter.h
+++ /dev/null
@@ -1,224 +0,0 @@
-//
-// HelpFormatter.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: HelpFormatter
-//
-// Definition of the HelpFormatter class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_HelpFormatter_INCLUDED
-#define Util_HelpFormatter_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include <ostream>
-
-
-namespace Poco {
-namespace Util {
-
-
-class OptionSet;
-class Option;
-
-
-class Util_API HelpFormatter
- /// This class formats a help message from an OptionSet.
-{
-public:
- HelpFormatter(const OptionSet& options);
- /// Creates the HelpFormatter, using the given
- /// options.
- ///
- /// The HelpFormatter just stores a reference
- /// to the given OptionSet, so the OptionSet must not
- /// be destroyed during the lifetime of the HelpFormatter.
-
- ~HelpFormatter();
- /// Destroys the HelpFormatter.
-
- void setCommand(const std::string& command);
- /// Sets the command name.
-
- const std::string& getCommand() const;
- /// Returns the command name.
-
- void setUsage(const std::string& usage);
- /// Sets the usage string.
-
- const std::string& getUsage() const;
- /// Returns the usage string.
-
- void setHeader(const std::string& header);
- /// Sets the header string.
-
- const std::string& getHeader() const;
- /// Returns the header string.
-
- void setFooter(const std::string& footer);
- /// Sets the footer string.
-
- const std::string& getFooter() const;
- /// Returns the footer string.
-
- void format(std::ostream& ostr) const;
- /// Writes the formatted help text to the given stream.
-
- void setWidth(int width);
- /// Sets the line width for the formatted help text.
-
- int getWidth() const;
- /// Returns the line width for the formatted help text.
- ///
- /// The default width is 72.
-
- void setIndent(int indent);
- /// Sets the indentation for description continuation lines.
-
- int getIndent() const;
- /// Returns the indentation for description continuation lines.
-
- void setAutoIndent();
- /// Sets the indentation for description continuation lines so that
- /// the description text is left-aligned.
-
- void setUnixStyle(bool flag);
- /// Enables Unix-style options. Both short and long option names
- /// are printed if Unix-style is set. Otherwise, only long option
- /// names are printed.
- ///
- /// After calling setUnixStyle(), setAutoIndent() should be called
- /// as well to ensure proper help text formatting.
-
- bool isUnixStyle() const;
- /// Returns if Unix-style options are set.
-
- std::string shortPrefix() const;
- /// Returns the platform-specific prefix for short options.
- /// "-" on Unix, "/" on Windows and OpenVMS.
-
- std::string longPrefix() const;
- /// Returns the platform-specific prefix for long options.
- /// "--" on Unix, "/" on Windows and OpenVMS.
-
-protected:
- int calcIndent() const;
- /// Calculates the indentation for the option descriptions
- /// from the given options.
-
- void formatOptions(std::ostream& ostr) const;
- /// Formats all options.
-
- void formatOption(std::ostream& ostr, const Option& option, int width) const;
- /// Formats an option, using the platform-specific
- /// prefixes.
-
- void formatText(std::ostream& ostr, const std::string& text, int indent) const;
- /// Formats the given text.
-
- void formatText(std::ostream& ostr, const std::string& text, int indent, int firstIndent) const;
- /// Formats the given text.
-
- void formatWord(std::ostream& ostr, int& pos, const std::string& word, int indent) const;
- /// Formats the given word.
-
- void clearWord(std::ostream& ostr, int& pos, std::string& word, int indent) const;
- /// Formats and then clears the given word.
-
-private:
- HelpFormatter(const HelpFormatter&);
- HelpFormatter& operator = (const HelpFormatter&);
-
- const OptionSet& _options;
- int _width;
- int _indent;
- std::string _command;
- std::string _usage;
- std::string _header;
- std::string _footer;
- bool _unixStyle;
-
- static const int TAB_WIDTH;
- static const int LINE_WIDTH;
-};
-
-
-//
-// inlines
-//
-inline int HelpFormatter::getWidth() const
-{
- return _width;
-}
-
-
-inline int HelpFormatter::getIndent() const
-{
- return _indent;
-}
-
-
-inline const std::string& HelpFormatter::getCommand() const
-{
- return _command;
-}
-
-
-inline const std::string& HelpFormatter::getUsage() const
-{
- return _usage;
-}
-
-
-inline const std::string& HelpFormatter::getHeader() const
-{
- return _header;
-}
-
-
-inline const std::string& HelpFormatter::getFooter() const
-{
- return _footer;
-}
-
-
-inline bool HelpFormatter::isUnixStyle() const
-{
- return _unixStyle;
-}
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_HelpFormatter_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/IniFileConfiguration.h b/Utilities/Poco/Util/include/Poco/Util/IniFileConfiguration.h
deleted file mode 100755
index d9172f1cfb..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/IniFileConfiguration.h
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// IniFileConfiguration.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: IniFileConfiguration
-//
-// Definition of the IniFileConfiguration class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_IniFileConfiguration_INCLUDED
-#define Util_IniFileConfiguration_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/AbstractConfiguration.h"
-#include <map>
-#include <istream>
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API IniFileConfiguration: public AbstractConfiguration
- /// This implementation of a Configuration reads properties
- /// from a legacy Windows initialization (.ini) file.
- ///
- /// The file syntax is implemented as follows.
- /// - a line starting with a semicolon is treated as a comment and ignored
- /// - a line starting with a square bracket denotes a section key [<key>]
- /// - every other line denotes a property assignment in the form
- /// <value key> = <value>
- ///
- /// The name of a property is composed of the section key and the value key,
- /// separated by a period (<section key>.<value key>).
- ///
- /// Property names are not case sensitive. Leading and trailing whitespace is
- /// removed from both keys and values.
- ///
- /// Setting properties is not supported. An attempt to set a property results
- /// in a NotImplementedException being thrown.
-{
-public:
- IniFileConfiguration();
- /// Creates an empty IniFileConfiguration.
-
- IniFileConfiguration(std::istream& istr);
- /// Creates an IniFileConfiguration and loads the configuration data
- /// from the given stream, which must be in initialization file format.
-
- IniFileConfiguration(const std::string& path);
- /// Creates an IniFileConfiguration and loads the configuration data
- /// from the given file, which must be in initialization file format.
-
- void load(std::istream& istr);
- /// Loads the configuration data from the given stream, which
- /// must be in initialization file format.
-
- void load(const std::string& path);
- /// Loads the configuration data from the given file, which
- /// must be in initialization file format.
-
-protected:
- bool getRaw(const std::string& key, std::string& value) const;
- void setRaw(const std::string& key, const std::string& value);
- void enumerate(const std::string& key, Keys& range) const;
- ~IniFileConfiguration();
-
-private:
- void parseLine(std::istream& istr);
-
- struct ICompare
- {
- bool operator () (const std::string& s1, const std::string& s2) const;
- };
- typedef std::map<std::string, std::string, ICompare> IStringMap;
-
- IStringMap _map;
- std::string _sectionKey;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_IniFileConfiguration_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/IntValidator.h b/Utilities/Poco/Util/include/Poco/Util/IntValidator.h
deleted file mode 100755
index 25575bd65d..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/IntValidator.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// IntValidator.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: IntValidator
-//
-// Definition of the IntValidator class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Util_IntValidator_INCLUDED
-#define Util_IntValidator_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/Validator.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API IntValidator: public Validator
- /// The IntValidator tests whether the option argument,
- /// which must be an integer, lies within a given range.
-{
-public:
- IntValidator(int min, int max);
- /// Creates the IntValidator.
-
- ~IntValidator();
- /// Destroys the IntValidator.
-
- void validate(const Option& option, const std::string& value);
- /// Validates the value for the given option by
- /// testing whether it's an integer that lies within
- /// a given range.
-
-private:
- IntValidator();
-
- int _min;
- int _max;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_IntValidator_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/LayeredConfiguration.h b/Utilities/Poco/Util/include/Poco/Util/LayeredConfiguration.h
deleted file mode 100755
index 56cbd6395c..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/LayeredConfiguration.h
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// LayeredConfiguration.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: LayeredConfiguration
-//
-// Definition of the LayeredConfiguration class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_LayeredConfiguration_INCLUDED
-#define Util_LayeredConfiguration_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/AbstractConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include <list>
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API LayeredConfiguration: public AbstractConfiguration
- /// A LayeredConfiguration consists of a number of AbstractConfigurations.
- ///
- /// When reading a configuration property in a LayeredConfiguration,
- /// all added configurations are searched, in order of their priority.
- /// Configurations with lower priority values have precedence.
- ///
- /// When setting a property, the property is always written to the first writeable
- /// configuration (see addWriteable()).
- /// If no writeable configuration has been added to the LayeredConfiguration, and an
- /// attempt is made to set a property, a RuntimeException is thrown.
- ///
- /// Every configuration added to the LayeredConfiguration has a priority value.
- /// The priority determines the position where the configuration is inserted,
- /// with lower priority values coming before higher priority values.
- ///
- /// If no priority is specified, a priority of 0 is assumed.
-{
-public:
- LayeredConfiguration();
- /// Creates the LayeredConfiguration.
-
- void add(AbstractConfiguration* pConfig);
- /// Adds a read-only configuration to the back of the LayeredConfiguration.
- /// The LayeredConfiguration does not take ownership of the given
- /// configuration. In other words, the configuration's reference
- /// count is incremented.
-
- void add(AbstractConfiguration* pConfig, bool shared);
- /// Adds a read-only configuration to the back of the LayeredConfiguration.
- /// If shared is false, the LayeredConfiguration takes ownership
- /// of the given configuration (and the configuration's reference
- /// count remains unchanged).
-
- void add(AbstractConfiguration* pConfig, int priority);
- /// Adds a read-only configuration to the LayeredConfiguration.
- /// The LayeredConfiguration does not take ownership of the given
- /// configuration. In other words, the configuration's reference
- /// count is incremented.
-
- void add(AbstractConfiguration* pConfig, int priority, bool shared);
- /// Adds a read-only configuration the LayeredConfiguration.
- /// If shared is false, the LayeredConfiguration takes ownership
- /// of the given configuration (and the configuration's reference
- /// count remains unchanged).
-
- void add(AbstractConfiguration* pConfig, int priority, bool writeable, bool shared);
- /// Adds a configuration to the LayeredConfiguration.
- /// If shared is false, the LayeredConfiguration takes ownership
- /// of the given configuration (and the configuration's reference
- /// count remains unchanged).
-
- void addWriteable(AbstractConfiguration* pConfig, int priority);
- /// Adds a writeable configuration to the LayeredConfiguration.
- /// The LayeredConfiguration does not take ownership of the given
- /// configuration. In other words, the configuration's reference
- /// count is incremented.
-
- void addWriteable(AbstractConfiguration* pConfig, int priority, bool shared);
- /// Adds a writeable configuration to the LayeredConfiguration.
- /// If shared is false, the LayeredConfiguration takes ownership
- /// of the given configuration (and the configuration's reference
- /// count remains unchanged).
-
- //@ deprecated
- void addFront(AbstractConfiguration* pConfig);
- /// Adds a read-only configuration to the front of the LayeredConfiguration.
- /// The LayeredConfiguration does not take ownership of the given
- /// configuration. In other words, the configuration's reference
- /// count is incremented.
-
- //@ deprecated
- void addFront(AbstractConfiguration* pConfig, bool shared);
- /// Adds a read-only configuration to the front of the LayeredConfiguration.
- /// If shared is true, the LayeredConfiguration takes ownership
- /// of the given configuration.
-
-protected:
- typedef Poco::AutoPtr<AbstractConfiguration> ConfigPtr;
-
- struct ConfigItem
- {
- ConfigPtr pConfig;
- int priority;
- bool writeable;
- };
-
- bool getRaw(const std::string& key, std::string& value) const;
- void setRaw(const std::string& key, const std::string& value);
- void enumerate(const std::string& key, Keys& range) const;
-
- int lowest() const;
- int highest() const;
- void insert(const ConfigItem& item);
-
- ~LayeredConfiguration();
-
-private:
- LayeredConfiguration(const LayeredConfiguration&);
- LayeredConfiguration& operator = (const LayeredConfiguration&);
-
- typedef std::list<ConfigItem> ConfigList;
-
- ConfigList _configs;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_LayeredConfiguration_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/LoggingConfigurator.h b/Utilities/Poco/Util/include/Poco/Util/LoggingConfigurator.h
deleted file mode 100755
index e57d1f69d4..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/LoggingConfigurator.h
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// LoggingConfigurator.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: LoggingConfigurator
-//
-// Definition of the LoggingConfigurator class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_LoggingConfigurator_INCLUDED
-#define Util_LoggingConfigurator_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Formatter.h"
-#include "Poco/Channel.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class AbstractConfiguration;
-
-
-class Util_API LoggingConfigurator
- /// This utility class uses a configuration object to configure the
- /// logging subsystem of an application.
- ///
- /// The LoggingConfigurator sets up and connects formatters, channels
- /// and loggers. To accomplish its work, the LoggingConfigurator relies on the
- /// functionality provided by the LoggingFactory und LoggingRegistry classes.
- ///
- /// The LoggingConfigurator expects all configuration data to be under a root
- /// property named "logging".
- ///
- /// Configuring Formatters
- ///
- /// A formatter is configured using the "logging.formatters" property. Every
- /// formatter has an internal name, which is only used for referring to it
- /// during configuration time. This name becomes part of the property name.
- /// Every formatter has a mandatory "class" property, which specifies the actual
- /// class implementing the formatter. Any other properties are passed on to
- /// the formatter by calling its setProperty() method.
- ///
- /// A typical formatter definition looks as follows:
- /// logging.formatters.f1.class = PatternFormatter
- /// logging.formatters.f1.pattern = %s: [%p] %t
- /// logging.formatters.f1.times = UTC
- ///
- /// Configuring Channels
- ///
- /// A channel is configured using the "logging.channels" property. Like with
- /// Formatters, every channel has an internal name, which is used during
- /// configuration only. The name becomes part of the property name.
- /// Every channel has a mandatory "class" property, which specifies the actual
- /// class implementing the channel. Any other properties are passed on to
- /// the formatter by calling its setProperty() method.
- ///
- /// For convenience, the "formatter" property of a channel is treated
- /// specifically. The "formatter" property can either be used to refer to
- /// an already defined formatter, or it can be used to specify an "inline"
- /// formatter definition. In either case, when a "formatter" property is
- /// present, the channel is automatically "wrapped" in a FormattingChannel
- /// object.
- ///
- /// Similarly, a channel supports also a "pattern" property, which results
- /// in the automatic instantiation of a FormattingChannel object with a
- /// connected PatternFormatter.
- ///
- /// Examples:
- /// logging.channels.c1.class = ConsoleChannel
- /// logging.channels.c1.formatter = f1
- /// logging.channels.c2.class = FileChannel
- /// logging.channels.c2.path = ${system.tempDir}/sample.log
- /// logging.channels.c2.formatter.class = PatternFormatter
- /// logging.channels.c2.formatter.pattern = %s: [%p] %t
- /// logging.channels.c3.class = ConsoleChannel
- /// logging.channels.c3.pattern = %s: [%p] %t
- ///
- /// Configuring Loggers
- ///
- /// A logger is configured using the "logging.loggers" property. Like with
- /// channels and formatters, every logger has an internal name, which, however,
- /// is only used to ensure the uniqueness of the property names. Note that this
- /// name is different from the logger's full name, which is used to access
- /// the logger at runtime.
- /// Every logger except the root logger has a mandatory "name" property which
- /// is used to specify the logger's full name.
- /// Furthermore, a "channel" property is supported, which can either refer
- /// to a named channel, or which can contain an inline channel definition.
- ///
- /// Examples:
- /// logging.loggers.root.channel = c1
- /// logging.loggers.root.level = warning
- /// logging.loggers.l1.name = logger1
- /// logging.loggers.l1.channel.class = ConsoleChannel
- /// logging.loggers.l1.channel.pattern = %s: [%p] %t
- /// logging.loggers.l1.level = information
-{
-public:
- LoggingConfigurator();
- /// Creates the LoggingConfigurator.
-
- ~LoggingConfigurator();
- /// Destroys the LoggingConfigurator.
-
- void configure(AbstractConfiguration* pConfig);
- /// Configures the logging subsystem based on
- /// the given configuration.
- ///
- /// A ConfigurationView can be used to pass only
- /// a part of a larger configuration.
-
-private:
- void configureFormatters(AbstractConfiguration* pConfig);
- void configureChannels(AbstractConfiguration* pConfig);
- void configureLoggers(AbstractConfiguration* pConfig);
- Poco::Formatter* createFormatter(AbstractConfiguration* pConfig);
- Poco::Channel* createChannel(AbstractConfiguration* pConfig);
- void configureChannel(Channel* pChannel, AbstractConfiguration* pConfig);
- void configureLogger(AbstractConfiguration* pConfig);
-
- LoggingConfigurator(const LoggingConfigurator&);
- LoggingConfigurator& operator = (const LoggingConfigurator&);
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_LoggingConfigurator_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/LoggingSubsystem.h b/Utilities/Poco/Util/include/Poco/Util/LoggingSubsystem.h
deleted file mode 100755
index 4209a46473..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/LoggingSubsystem.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// LoggingSubsystem.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Application
-// Module: LoggingSubsystem
-//
-// Definition of the LoggingSubsystem class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_LoggingSubsystem_INCLUDED
-#define Util_LoggingSubsystem_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/Subsystem.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API LoggingSubsystem: public Subsystem
- /// The LoggingSubsystem class initializes the logging
- /// framework using the LoggingConfigurator.
- ///
- /// It also sets the Application's logger to
- /// the logger specified by the "application.logger"
- /// property, or to "Application" if the property
- /// is not specified.
-{
-public:
- LoggingSubsystem();
- const char* name() const;
-
-protected:
- void initialize(Application& self);
- void uninitialize();
- ~LoggingSubsystem();
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_LoggingSubsystem_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/MapConfiguration.h b/Utilities/Poco/Util/include/Poco/Util/MapConfiguration.h
deleted file mode 100755
index f9810eb9d3..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/MapConfiguration.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// MapConfiguration.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: MapConfiguration
-//
-// Definition of the MapConfiguration class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_MapConfiguration_INCLUDED
-#define Util_MapConfiguration_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/AbstractConfiguration.h"
-#include <map>
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API MapConfiguration: public AbstractConfiguration
- /// An implementation of AbstractConfiguration that stores configuration data in a map.
-{
-public:
- MapConfiguration();
- /// Creates an empty MapConfiguration.
-
- void clear();
- /// Clears the configuration.
-
-protected:
- typedef std::map<std::string, std::string> StringMap;
- typedef StringMap::const_iterator iterator;
-
- bool getRaw(const std::string& key, std::string& value) const;
- void setRaw(const std::string& key, const std::string& value);
- void enumerate(const std::string& key, Keys& range) const;
- ~MapConfiguration();
-
- iterator begin() const;
- iterator end() const;
-
-private:
- StringMap _map;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_MapConfiguration_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/Option.h b/Utilities/Poco/Util/include/Poco/Util/Option.h
deleted file mode 100755
index 5f0786f979..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/Option.h
+++ /dev/null
@@ -1,354 +0,0 @@
-//
-// Option.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: Option
-//
-// Definition of the Option class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_Option_INCLUDED
-#define Util_Option_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/OptionCallback.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Application;
-class Validator;
-class AbstractConfiguration;
-
-
-class Util_API Option
- /// This class represents and stores the properties
- /// of a command line option.
- ///
- /// An option has a full name, an optional short name,
- /// a description (used for printing a usage statement),
- /// and an optional argument name.
- /// An option can be optional or required.
- /// An option can be repeatable, which means that it can
- /// be given more than once on the command line.
- ///
- /// An option can be part of an option group. At most one
- /// option of each group may be specified on the command
- /// line.
- ///
- /// An option can be bound to a configuration property.
- /// In this case, a configuration property will automatically
- /// receive the option's argument value.
- ///
- /// A callback method can be specified for options. This method
- /// is called whenever an option is specified on the command line.
- ///
- /// Option argument values can be automatically validated using a
- /// Validator.
- ///
- /// Option instances are value objects.
- ///
- /// Typcally, after construction, an Option object is immediately
- /// passed to an Options object.
- ///
- /// An Option object can be created by chaining the constructor
- /// with any of the setter methods, as in the following example:
- ///
- /// Option versionOpt("include", "I", "specify an include directory")
- /// .required(false)
- /// .repeatable(true)
- /// .argument("directory");
-{
-public:
- Option();
- /// Creates an empty Option.
-
- Option(const Option& option);
- /// Creates an option from another one.
-
- Option(const std::string& fullName, const std::string& shortName);
- /// Creates an option with the given properties.
-
- Option(const std::string& fullName, const std::string& shortName, const std::string& description, bool required = false);
- /// Creates an option with the given properties.
-
- Option(const std::string& fullName, const std::string& shortName, const std::string& description, bool required, const std::string& argName, bool argRequired = false);
- /// Creates an option with the given properties.
-
- ~Option();
- /// Destroys the Option.
-
- Option& operator = (const Option& option);
- /// Assignment operator.
-
- void swap(Option& option);
- /// Swaps the option with another one.
-
- Option& shortName(const std::string& name);
- /// Sets the short name of the option.
-
- Option& fullName(const std::string& name);
- /// Sets the full name of the option.
-
- Option& description(const std::string& text);
- /// Sets the description of the option.
-
- Option& required(bool flag);
- /// Sets whether the option is required (flag == true)
- /// or optional (flag == false).
-
- Option& repeatable(bool flag);
- /// Sets whether the option can be specified more than once
- /// (flag == true) or at most once (flag == false).
-
- Option& argument(const std::string& name, bool required = true);
- /// Specifies that the option takes an (optional or required)
- /// argument.
-
- Option& noArgument();
- /// Specifies that the option does not take an argument (default).
-
- Option& group(const std::string& group);
- /// Specifies the option group the option is part of.
-
- Option& binding(const std::string& propertyName);
- /// Binds the option to the configuration property with the given name.
- ///
- /// The configuration will automatically receive the option's argument.
-
- Option& binding(const std::string& propertyName, AbstractConfiguration* pConfig);
- /// Binds the option to the configuration property with the given name,
- /// using the given AbstractConfiguration.
- ///
- /// The configuration will automatically receive the option's argument.
-
- Option& callback(const AbstractOptionCallback& cb);
- /// Binds the option to the given method.
- ///
- /// The callback method will be called when the option
- /// has been specified on the command line.
- ///
- /// Usage:
- /// callback(OptionCallback<MyApplication>(this, &MyApplication::myCallback));
-
- Option& validator(Validator* pValidator);
- /// Sets the validator for the given option.
- ///
- /// The Option takes ownership of the Validator and
- /// deletes it when it's no longer needed.
-
- const std::string& shortName() const;
- /// Returns the short name of the option.
-
- const std::string& fullName() const;
- /// Returns the full name of the option.
-
- const std::string& description() const;
- /// Returns the description of the option.
-
- bool required() const;
- /// Returns true if the option is required, false if not.
-
- bool repeatable() const;
- /// Returns true if the option can be specified more than
- /// once, or false if at most once.
-
- bool takesArgument() const;
- /// Returns true if the options takes an (optional) argument.
-
- bool argumentRequired() const;
- /// Returns true if the argument is required.
-
- const std::string& argumentName() const;
- /// Returns the argument name, if specified.
-
- const std::string& group() const;
- /// Returns the option group the option is part of,
- /// or an empty string, if the option is not part of
- /// a group.
-
- const std::string& binding() const;
- /// Returns the property name the option is bound to,
- /// or an empty string in case it is not bound.
-
- AbstractOptionCallback* callback() const;
- /// Returns a pointer to the callback method for the option,
- /// or NULL if no callback has been specified.
-
- Validator* validator() const;
- /// Returns the option's Validator, if one has been specified,
- /// or NULL otherwise.
-
- AbstractConfiguration* config() const;
- /// Returns the configuration, if specified, or NULL otherwise.
-
- bool matchesShort(const std::string& option) const;
- /// Returns true if the given option string matches the
- /// short name.
- ///
- /// The first characters of the option string must match
- /// the short name of the option (case sensitive),
- /// or the option string must partially match the full
- /// name (case insensitive).
-
- bool matchesFull(const std::string& option) const;
- /// Returns true if the given option string matches the
- /// full name.
- ///
- /// The option string must match the full
- /// name (case insensitive).
-
- bool matchesPartial(const std::string& option) const;
- /// Returns true if the given option string partially matches the
- /// full name.
- ///
- /// The option string must partially match the full
- /// name (case insensitive).
-
- void process(const std::string& option, std::string& arg) const;
- /// Verifies that the given option string matches the
- /// requirements of the option, and extracts the option argument,
- /// if present.
- ///
- /// If the option string is okay and carries an argument,
- /// the argument is returned in arg.
- ///
- /// Throws a MissingArgumentException if a required argument
- /// is missing. Throws an UnexpectedArgumentException if an
- /// argument has been found, but none is expected.
-
-private:
- std::string _shortName;
- std::string _fullName;
- std::string _description;
- bool _required;
- bool _repeatable;
- std::string _argName;
- bool _argRequired;
- std::string _group;
- std::string _binding;
- Validator* _pValidator;
- AbstractOptionCallback* _pCallback;
- AbstractConfiguration* _pConfig;
-};
-
-
-//
-// inlines
-//
-
-
-inline const std::string& Option::shortName() const
-{
- return _shortName;
-}
-
-
-inline const std::string& Option::fullName() const
-{
- return _fullName;
-}
-
-
-inline const std::string& Option::description() const
-{
- return _description;
-}
-
-
-inline bool Option::required() const
-{
- return _required;
-}
-
-
-inline bool Option::repeatable() const
-{
- return _repeatable;
-}
-
-
-inline bool Option::takesArgument() const
-{
- return !_argName.empty();
-}
-
-
-inline bool Option::argumentRequired() const
-{
- return _argRequired;
-}
-
-
-inline const std::string& Option::argumentName() const
-{
- return _argName;
-}
-
-
-inline const std::string& Option::group() const
-{
- return _group;
-}
-
-
-inline const std::string& Option::binding() const
-{
- return _binding;
-}
-
-
-inline AbstractOptionCallback* Option::callback() const
-{
- return _pCallback;
-}
-
-
-inline Validator* Option::validator() const
-{
- return _pValidator;
-}
-
-
-inline AbstractConfiguration* Option::config() const
-{
- return _pConfig;
-}
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_Option_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/OptionCallback.h b/Utilities/Poco/Util/include/Poco/Util/OptionCallback.h
deleted file mode 100755
index 862a325e33..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/OptionCallback.h
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// OptionCallback.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: OptionCallback
-//
-// Definition of the OptionCallback class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Util_OptionCallback_INCLUDED
-#define Util_OptionCallback_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API AbstractOptionCallback
- /// Base class for OptionCallback.
-{
-public:
- virtual void invoke(const std::string& name, const std::string& value) const = 0;
- /// Invokes the callback member function.
-
- virtual AbstractOptionCallback* clone() const = 0;
- /// Creates and returns a copy of the object.
-
- virtual ~AbstractOptionCallback();
- /// Destroys the AbstractOptionCallback.
-
-protected:
- AbstractOptionCallback();
- AbstractOptionCallback(const AbstractOptionCallback&);
-};
-
-
-template <class C>
-class OptionCallback: public AbstractOptionCallback
- /// This class is used as an argument to Option::callback().
- ///
- /// It stores a pointer to an object and a pointer to a member
- /// function of the object's class.
-{
-public:
- typedef void (C::*Callback)(const std::string& name, const std::string& value);
-
- OptionCallback(C* pObject, Callback method):
- _pObject(pObject),
- _method(method)
- /// Creates the OptionCallback for the given object and member function.
- {
- poco_check_ptr (pObject);
- }
-
- OptionCallback(const OptionCallback& cb):
- AbstractOptionCallback(cb),
- _pObject(cb._pObject),
- _method(cb._method)
- /// Creates an OptionCallback from another one.
- {
- }
-
- ~OptionCallback()
- /// Destroys the OptionCallback.
- {
- }
-
- OptionCallback& operator = (const OptionCallback& cb)
- {
- if (&cb != this)
- {
- this->_pObject = cb._pObject;
- this->_method = cb._method;
- }
- return *this;
- }
-
- void invoke(const std::string& name, const std::string& value) const
- {
- (_pObject->*_method)(name, value);
- }
-
- AbstractOptionCallback* clone() const
- {
- return new OptionCallback(_pObject, _method);
- }
-
-private:
- OptionCallback();
-
- C* _pObject;
- Callback _method;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_OptionCallback_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/OptionException.h b/Utilities/Poco/Util/include/Poco/Util/OptionException.h
deleted file mode 100755
index 530deefb2e..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/OptionException.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// OptionException.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: OptionException
-//
-// Definition of the OptionException class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_OptionException_INCLUDED
-#define Util_OptionException_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-POCO_DECLARE_EXCEPTION(Util_API, OptionException, Poco::DataException)
-POCO_DECLARE_EXCEPTION(Util_API, UnknownOptionException, OptionException)
-POCO_DECLARE_EXCEPTION(Util_API, AmbiguousOptionException, OptionException)
-POCO_DECLARE_EXCEPTION(Util_API, MissingOptionException, OptionException)
-POCO_DECLARE_EXCEPTION(Util_API, MissingArgumentException, OptionException)
-POCO_DECLARE_EXCEPTION(Util_API, InvalidArgumentException, OptionException)
-POCO_DECLARE_EXCEPTION(Util_API, UnexpectedArgumentException, OptionException)
-POCO_DECLARE_EXCEPTION(Util_API, IncompatibleOptionsException, OptionException)
-POCO_DECLARE_EXCEPTION(Util_API, DuplicateOptionException, OptionException)
-POCO_DECLARE_EXCEPTION(Util_API, EmptyOptionException, OptionException)
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_OptionException_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/OptionProcessor.h b/Utilities/Poco/Util/include/Poco/Util/OptionProcessor.h
deleted file mode 100755
index 70000326fa..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/OptionProcessor.h
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// OptionProcessor.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: OptionProcessor
-//
-// Definition of the OptionProcessor class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_OptionProcessor_INCLUDED
-#define Util_OptionProcessor_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include <set>
-
-
-namespace Poco {
-namespace Util {
-
-
-class OptionSet;
-
-
-class Util_API OptionProcessor
- /// An OptionProcessor is used to process the command line
- /// arguments of an application.
- ///
- /// The process() method takes an argument from the command line.
- /// If that argument starts with an option prefix, the argument
- /// is further processed. Otherwise, the argument is ignored and
- /// false is ignored. The argument must match one of the options
- /// given in the OptionSet that is passed to the OptionProcessor
- /// with the constructor. If an option is part of a group, at most
- /// one option of the group can be passed to the OptionProcessor.
- /// Otherwise an IncompatibleOptionsException is thrown.
- /// If the same option is given multiple times, but the option
- /// is not repeatable, a DuplicateOptionException is thrown.
- /// If the option is not recognized, a UnexpectedArgumentException
- /// is thrown.
- /// If the option requires an argument, but none is given, an
- /// MissingArgumentException is thrown.
- /// If no argument is expected, but one is present, a
- /// UnexpectedArgumentException is thrown.
- /// If a partial option name is ambiguous, an AmbiguousOptionException
- /// is thrown.
- ///
- /// The OptionProcessor supports two modes: Unix mode and default mode.
- /// In Unix mode, the option prefix is a dash '-'. A dash must be followed
- /// by a short option name, or another dash, followed by a (partial)
- /// long option name.
- /// In default mode, the option prefix is a slash '/', followed by
- /// a (partial) long option name.
- /// If the special option '--' is encountered in Unix mode, all following
- /// options are ignored.
-{
-public:
- OptionProcessor(const OptionSet& options);
- /// Creates the OptionProcessor, using the given OptionSet.
-
- ~OptionProcessor();
- /// Destroys the OptionProcessor.
-
- void setUnixStyle(bool flag);
- /// Enables (flag == true) or disables (flag == false) Unix-style
- /// option processing.
- ///
- /// If Unix-style processing is enabled, options are expected to
- /// begin with a single or a double dash ('-' or '--', respectively).
- /// A single dash must be followed by a short option name. A double
- /// dash must be followed by a (partial) full option name.
- ///
- /// If Unix-style processing is disabled, options are expected to
- /// begin with a slash ('/'), followed by a (partial) full option name.
-
- bool isUnixStyle() const;
- /// Returns true iff Unix-style option processing is enabled.
-
- bool process(const std::string& argument, std::string& optionName, std::string& optionArg);
- /// Examines and processes the given command line argument.
- ///
- /// If the argument begins with an option prefix, the option is processed
- /// and true is returned. The full option name is stored in optionName and the
- /// option argument, if present, is stored in optionArg.
- ///
- /// If the option does not begin with an option prefix, false is returned.
-
- void checkRequired() const;
- /// Checks if all required options have been processed.
- ///
- /// Does nothing if all required options have been processed.
- /// Throws a MissingOptionException otherwise.
-
-private:
- bool processUnix(const std::string& argument, std::string& optionName, std::string& optionArg);
- bool processDefault(const std::string& argument, std::string& optionName, std::string& optionArg);
- bool processCommon(const std::string& option, bool isShort, std::string& optionName, std::string& optionArg);
-
- const OptionSet& _options;
- bool _unixStyle;
- bool _ignore;
- std::set<std::string> _groups;
- std::set<std::string> _specifiedOptions;
-};
-
-
-//
-// inlines
-//
-inline bool OptionProcessor::isUnixStyle() const
-{
- return _unixStyle;
-}
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_OptionProcessor_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/OptionSet.h b/Utilities/Poco/Util/include/Poco/Util/OptionSet.h
deleted file mode 100755
index 2dda9a5772..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/OptionSet.h
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// OptionSet.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: OptionSet
-//
-// Definition of the OptionSet class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_OptionSet_INCLUDED
-#define Util_OptionSet_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/Option.h"
-#include <vector>
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API OptionSet
- /// A collection of Option objects.
-{
-public:
- typedef std::vector<Option> OptionVec;
- typedef OptionVec::const_iterator Iterator;
-
- OptionSet();
- /// Creates the OptionSet.
-
- OptionSet(const OptionSet& options);
- /// Creates an option set from another one.
-
- ~OptionSet();
- /// Destroys the OptionSet.
-
- OptionSet& operator = (const OptionSet& options);
- /// Assignment operator.
-
- void addOption(const Option& option);
- /// Adds an option to the collection.
-
- bool hasOption(const std::string& name, bool matchShort = false) const;
- /// Returns a true iff an option with the given name exists.
- ///
- /// The given name can either be a fully specified short name,
- /// or a partially specified full name. If a partial name
- /// matches more than one full name, false is returned.
- /// The name must either match the short or full name of an
- /// option. Comparison case sensitive for the short name and
- /// not case sensitive for the full name.
-
- const Option& getOption(const std::string& name, bool matchShort = false) const;
- /// Returns a reference to the option with the given name.
- ///
- /// The given name can either be a fully specified short name,
- /// or a partially specified full name.
- /// The name must either match the short or full name of an
- /// option. Comparison case sensitive for the short name and
- /// not case sensitive for the full name.
- /// Throws a NotFoundException if no matching option has been found.
- /// Throws an UnknownOptionException if a partial full name matches
- /// more than one option.
-
- Iterator begin() const;
- /// Supports iterating over all options.
-
- Iterator end() const;
- /// Supports iterating over all options.
-
-private:
- OptionVec _options;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_OptionSet_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/PropertyFileConfiguration.h b/Utilities/Poco/Util/include/Poco/Util/PropertyFileConfiguration.h
deleted file mode 100755
index 8204ffb7c4..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/PropertyFileConfiguration.h
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// PropertyFileConfiguration.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: PropertyFileConfiguration
-//
-// Definition of the PropertyFileConfiguration class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_PropertyFileConfiguration_INCLUDED
-#define Util_PropertyFileConfiguration_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/MapConfiguration.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API PropertyFileConfiguration: public MapConfiguration
- /// This implementation of a Configuration reads properties
- /// from a Java-style properties file.
- ///
- /// The file syntax is implemented as follows.
- /// - a line starting with a hash '#' or exclamation mark '!' is treated as a comment and ignored
- /// - every other line denotes a property assignment in the form
- /// <key> = <value> or
- /// <key> : <value>
- ///
- /// Keys and values may contain special characters represented by the following escape sequences:
- /// - \t: tab (0x09)
- /// - \n: line feed (0x0a)
- /// - \r: carriage return (0x0d)
- /// - \f: form feed (0x0c)
- ///
- /// For every other sequence that starts with a backslash, the backslash is removed.
- /// Therefore, the sequence \a would just yield an 'a'.
- ///
- /// A value can spread across multiple lines if the last character in a line (the character
- /// immediately before the carriage return or line feed character) is a single backslash.
- ///
- /// Property names are case sensitive. Leading and trailing whitespace is
- /// removed from both keys and values. A property name can neither contain
- /// a colon ':' nor an equal sign '=' character.
-{
-public:
- PropertyFileConfiguration();
- /// Creates an empty PropertyFileConfiguration.
-
- PropertyFileConfiguration(std::istream& istr);
- /// Creates an PropertyFileConfiguration and loads the configuration data
- /// from the given stream, which must be in properties file format.
-
- PropertyFileConfiguration(const std::string& path);
- /// Creates an PropertyFileConfiguration and loads the configuration data
- /// from the given file, which must be in properties file format.
-
- void load(std::istream& istr);
- /// Loads the configuration data from the given stream, which
- /// must be in properties file format.
-
- void load(const std::string& path);
- /// Loads the configuration data from the given file, which
- /// must be in properties file format.
-
- void save(std::ostream& ostr) const;
- /// Writes the configuration data to the given stream.
- ///
- /// The data is written as a sequence of statements in the form
- /// <key>: <value>
- /// separated by a newline character.
-
- void save(const std::string& path) const;
- /// Writes the configuration data to the given file.
-
-protected:
- ~PropertyFileConfiguration();
-
-private:
- void parseLine(std::istream& istr);
- static int readChar(std::istream& istr);
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_PropertyFileConfiguration_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/RegExpValidator.h b/Utilities/Poco/Util/include/Poco/Util/RegExpValidator.h
deleted file mode 100755
index 426e1531d7..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/RegExpValidator.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// RegExpValidator.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: RegExpValidator
-//
-// Definition of the RegExpValidator class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Util_RegExpValidator_INCLUDED
-#define Util_RegExpValidator_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/Validator.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API RegExpValidator: public Validator
- /// This validator matches the option value against
- /// a regular expression.
-{
-public:
- RegExpValidator(const std::string& regexp);
- /// Creates the RegExpValidator, using the given regular expression.
-
- ~RegExpValidator();
- /// Destroys the RegExpValidator.
-
- void validate(const Option& option, const std::string& value);
- /// Validates the value for the given option by
- /// matching it with the regular expression.
-
-private:
- RegExpValidator();
-
- std::string _regexp;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_RegExpValidator_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/ServerApplication.h b/Utilities/Poco/Util/include/Poco/Util/ServerApplication.h
deleted file mode 100755
index 1cc194b88f..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/ServerApplication.h
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// ServerApplication.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Application
-// Module: ServerApplication
-//
-// Definition of the ServerApplication class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_ServerApplication_INCLUDED
-#define Util_ServerApplication_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/Application.h"
-#include "Poco/Event.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API ServerApplication: public Application
- /// A subclass of the Application class that is used
- /// for implementing server applications.
- ///
- /// A ServerApplication allows for the application
- /// to run as a Windows service or as a Unix daemon
- /// without the need to add extra code.
- ///
- /// For a ServerApplication to work both from the command line
- /// and as a daemon or service, a few rules must be met:
- /// - Subsystems must be registered in the constructor.
- /// - All non-trivial initializations must be made in the
- /// initialize() method.
- /// - At the end of the main() method, waitForTerminationRequest()
- /// should be called.
- /// - The main(argc, argv) function must look as follows:
- ///
- /// int main(int argc, char** argv)
- /// {
- /// MyServerApplication app;
- /// return app.run(argc, argv);
- /// }
- ///
- /// The POCO_SERVER_MAIN macro can be used to implement main(argc, argv).
- /// If POCO has been built with POCO_WIN32_UTF8, POCO_SERVER_MAIN supports
- /// Unicode command line arguments.
- ///
- /// On Windows platforms, an application built on top of the
- /// ServerApplication class can be run both from the command line
- /// or as a service.
- ///
- /// To run an application as a Windows service, it must be registered
- /// with the Windows Service Control Manager (SCM). To do this, the application
- /// can be started from the command line, with the /registerService option
- /// specified. This causes the application to register itself with the
- /// SCM, and then exit. Similarly, an application registered as a service can
- /// be unregistered, by specifying the /unregisterService option.
- /// The file name of the application executable (excluding the .exe suffix)
- /// is used as the service name. Additionally, a more user-friendly name can be
- /// specified, using the /displayName option (e.g., /displayName="Demo Service").
- ///
- /// An application can determine whether it is running as a service by checking
- /// for the "application.runAsService" configuration property.
- ///
- /// if (config().getBool("application.runAsService", false))
- /// {
- /// // do service specific things
- /// }
- ///
- /// Note that the working directory for an application running as a service
- /// is the Windows system directory (e.g., C:\Windows\system32). Take this
- /// into account when working with relative filesystem paths. Also, services
- /// run under a different user account, so an application that works when
- /// started from the command line may fail to run as a service if it depends
- /// on a certain environment (e.g., the PATH environment variable).
- ///
- /// An application registered as a Windows service can be started
- /// with the NET START <name> command and stopped with the NET STOP <name>
- /// command. Alternatively, the Services MMC applet can be used.
- ///
- /// On Unix platforms, an application built on top of the ServerApplication
- /// class can be optionally run as a daemon by giving the --daemon
- /// command line option. A daemon, when launched, immediately
- /// forks off a background process that does the actual work. After launching
- /// the background process, the foreground process exits.
- ///
- /// After the initialization is complete, but before entering the main() method,
- /// the current working directory for the daemon process is changed to the root
- /// directory ("/"), as it is common practice for daemon processes. Therefore, be
- /// careful when working with files, as relative paths may not point to where
- /// you expect them point to.
- ///
- /// An application can determine whether it is running as a daemon by checking
- /// for the "application.runAsDaemon" configuration property.
- ///
- /// if (config().getBool("application.runAsDaemon", false))
- /// {
- /// // do daemon specific things
- /// }
- ///
- /// When running as a daemon, specifying the --pidfile option (e.g.,
- /// --pidfile=/var/run/sample.pid) may be useful to record the process ID of
- /// the daemon in a file. The PID file will be removed when the daemon process
- /// terminates (but not, if it crashes).
-{
-public:
- ServerApplication();
- /// Creates the ServerApplication.
-
- ~ServerApplication();
- /// Destroys the ServerApplication.
-
- bool isInteractive() const;
- /// Returns true if the application runs from the command line.
- /// Returns false if the application runs as a Unix daemon
- /// or Windows service.
-
- int run(int argc, char** argv);
- /// Runs the application by performing additional initializations
- /// and calling the main() method.
-
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
- int run(int argc, wchar_t** argv);
- /// Runs the application by performing additional initializations
- /// and calling the main() method.
- ///
- /// This Windows-specific version of init is used for passing
- /// Unicode command line arguments from wmain().
-#endif
-
-protected:
- int run();
- void waitForTerminationRequest();
- void defineOptions(OptionSet& options);
- void handleOption(const std::string& name, const std::string& value);
- static void terminate();
-
-private:
-#if defined(POCO_OS_FAMILY_UNIX)
- bool isDaemon(int argc, char** argv);
- void beDaemon();
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- enum Action
- {
- SRV_RUN,
- SRV_REGISTER,
- SRV_UNREGISTER
- };
- static BOOL __stdcall ConsoleCtrlHandler(DWORD ctrlType);
- static void __stdcall ServiceControlHandler(DWORD control);
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
- static void __stdcall ServiceMain(DWORD argc, LPWSTR* argv);
-#else
- static void __stdcall ServiceMain(DWORD argc, LPTSTR* argv);
-#endif
-
- bool hasConsole();
- bool isService();
- void beService();
- void registerService();
- void unregisterService();
-
- Action _action;
- std::string _displayName;
-
- static Poco::Event _terminated;
- static SERVICE_STATUS _serviceStatus;
- static SERVICE_STATUS_HANDLE _serviceStatusHandle;
-#endif
-};
-
-
-} } // namespace Poco::Util
-
-
-//
-// Macro to implement main()
-//
-#if defined(_WIN32) && defined(POCO_WIN32_UTF8)
- #define POCO_SERVER_MAIN(App) \
- int wmain(int argc, wchar_t** argv) \
- { \
- App app; \
- return app.run(argc, argv); \
- }
-#else
- #define POCO_SERVER_MAIN(App) \
- int main(int argc, char** argv) \
- { \
- App app; \
- return app.run(argc, argv); \
- }
-#endif
-
-
-#endif // Util_ServerApplication_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/Subsystem.h b/Utilities/Poco/Util/include/Poco/Util/Subsystem.h
deleted file mode 100755
index ac4642f264..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/Subsystem.h
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// Subsystem.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Application
-// Module: Subsystem
-//
-// Definition of the Subsystem class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_Subsystem_INCLUDED
-#define Util_Subsystem_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/RefCountedObject.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Application;
-class OptionSet;
-
-
-class Util_API Subsystem: public Poco::RefCountedObject
- /// Subsystems extend an application in a modular way.
- ///
- /// The Subsystem class provides a common interface
- /// for subsystems so that subsystems can be automatically
- /// initialized at startup and uninitialized at shutdown.
- ///
- /// Subsystems should also support dynamic reconfiguration,
- /// so that they can be reconfigured anytime during the
- /// life of a running application.
- ///
- /// The degree to which dynamic reconfiguration is supported
- /// is up to the actual subsystem implementation. It can
- /// range from ignoring the reconfiguration request (not
- /// recommended), to changing certain settings that affect
- /// the performance, to a complete reinitialization.
-{
-public:
- Subsystem();
- /// Creates the Subsystem.
-
-protected:
- virtual const char* name() const = 0;
- /// Returns the name of the subsystem.
- /// Must be implemented by subclasses.
-
- virtual void initialize(Application& app) = 0;
- /// Initializes the subsystem.
-
- virtual void uninitialize() = 0;
- /// Uninitializes the subsystem.
-
- virtual void reinitialize(Application& app);
- /// Re-initializes the subsystem.
- ///
- /// The default implementation just calls
- /// uninitialize() followed by initialize().
- /// Actual implementations might want to use a
- /// less radical and possibly more performant
- /// approach.
-
- virtual void defineOptions(OptionSet& options);
- /// Called before the Application's command line processing begins.
- /// If a subsystem wants to support command line arguments,
- /// it must override this method.
- /// The default implementation does not define any options.
- ///
- /// To effectively handle options, a subsystem should either bind
- /// the option to a configuration property or specify a callback
- /// to handle the option.
-
- virtual ~Subsystem();
- /// Destroys the Subsystem.
-
- friend class Application;
-
-private:
- Subsystem(const Subsystem&);
- Subsystem& operator = (const Subsystem&);
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_Subsystem_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/SystemConfiguration.h b/Utilities/Poco/Util/include/Poco/Util/SystemConfiguration.h
deleted file mode 100755
index b2b5347af9..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/SystemConfiguration.h
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// SystemConfiguration.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: SystemConfiguration
-//
-// Definition of the SystemConfiguration class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_SystemConfiguration_INCLUDED
-#define Util_SystemConfiguration_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/AbstractConfiguration.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API SystemConfiguration: public AbstractConfiguration
- /// This class implements a Configuration interface to
- /// various system properties and environment variables.
- ///
- /// The following properties are supported:
- /// - system.osName: the operating system name
- /// - system.osVersion: the operating system version
- /// - system.osArchitecture: the operating system architecture
- /// - system.nodeName: the node (or host) name
- /// - system.currentDir: the current working directory
- /// - system.homeDir: the user's home directory
- /// - system.tempDir: the system's temporary directory
- /// - system.dateTime: the current UTC date and time, formatted in ISO 8601 format.
- /// - system.pid: the current process ID.
- /// - system.env.<NAME>: the environment variable with the given <NAME>.
- ///
- /// An attempt to set a system variable will result in an
- /// InvalidAccessException being thrown.
- ///
- /// Enumerating environment variables is not supported.
- /// An attempt to call keys("system.env") will return an empty range.
-{
-public:
- SystemConfiguration();
- /// Creates the SystemConfiguration.
-
-protected:
- bool getRaw(const std::string& key, std::string& value) const;
- void setRaw(const std::string& key, const std::string& value);
- void enumerate(const std::string& key, Keys& range) const;
- ~SystemConfiguration();
-
-private:
- static bool getEnv(const std::string& name, std::string& value);
-
- static const std::string OSNAME;
- static const std::string OSVERSION;
- static const std::string OSARCHITECTURE;
- static const std::string NODENAME;
- static const std::string CURRENTDIR;
- static const std::string HOMEDIR;
- static const std::string TEMPDIR;
- static const std::string DATETIME;
- static const std::string PID;
- static const std::string ENV;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_SystemConfiguration_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/Timer.h b/Utilities/Poco/Util/include/Poco/Util/Timer.h
deleted file mode 100644
index 1d12c6c70d..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/Timer.h
+++ /dev/null
@@ -1,140 +0,0 @@
-//
-// Timer.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Timer
-// Module: Timer
-//
-// Definition of the Timer class.
-//
-// Copyright (c) 2009, 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.
-//
-
-
-#ifndef Util_Timer_INCLUDED
-#define Util_Timer_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/TimerTask.h"
-#include "Poco/TimedNotificationQueue.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API Timer: protected Poco::Runnable
- /// A Timer allows to schedule tasks (TimerTask objects) for future execution
- /// in a background thread. Tasks may be scheduled for one-time execution,
- /// or for repeated execution at regular intervals.
- ///
- /// The Timer object creates a thread that executes all scheduled tasks
- /// sequentially. Therefore, tasks should complete their work as quickly
- /// as possible, otherwise subsequent tasks may be delayed.
- ///
- /// Timer is save for multithreaded use - multiple threads can schedule
- /// new tasks simultaneously.
- ///
- /// Acknowledgement: The interface of this class has been inspired by
- /// the java.util.Timer class from Java 1.3.
-{
-public:
- Timer();
- /// Creates the Timer.
-
- explicit Timer(Poco::Thread::Priority priority);
- /// Creates the Timer, using a timer thread with
- /// the given priority.
-
- ~Timer();
- /// Destroys the Timer, cancelling all pending tasks.
-
- void cancel();
- /// Cancels all pending tasks.
- ///
- /// If a task is currently running, it is allowed to finish.
-
- void schedule(TimerTask::Ptr pTask, Poco::Timestamp time);
- /// Schedules a task for execution at the specified time.
- ///
- /// If the time lies in the past, the task is executed
- /// immediately.
-
- void schedule(TimerTask::Ptr pTask, long delay, long interval);
- /// Schedules a task for periodic execution.
- ///
- /// The task is first executed after the given delay.
- /// Subsequently, the task is executed periodically with
- /// the given interval in milliseconds between invocations.
-
- void schedule(TimerTask::Ptr pTask, Poco::Timestamp time, long interval);
- /// Schedules a task for periodic execution.
- ///
- /// The task is first executed at the given time.
- /// Subsequently, the task is executed periodically with
- /// the given interval in milliseconds between invocations.
-
- void scheduleAtFixedRate(TimerTask::Ptr pTask, long delay, long interval);
- /// Schedules a task for periodic execution at a fixed rate.
- ///
- /// The task is first executed after the given delay.
- /// Subsequently, the task is executed periodically
- /// every number of milliseconds specified by interval.
- ///
- /// If task execution takes longer than the given interval,
- /// further executions are delayed.
-
- void scheduleAtFixedRate(TimerTask::Ptr pTask, Poco::Timestamp time, long interval);
- /// Schedules a task for periodic execution at a fixed rate.
- ///
- /// The task is first executed at the given time.
- /// Subsequently, the task is executed periodically
- /// every number of milliseconds specified by interval.
- ///
- /// If task execution takes longer than the given interval,
- /// further executions are delayed.
-
-protected:
- void run();
-
-private:
- Timer(const Timer&);
- Timer& operator = (const Timer&);
-
- Poco::TimedNotificationQueue _queue;
- Poco::Thread _thread;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_Timer_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/TimerTask.h b/Utilities/Poco/Util/include/Poco/Util/TimerTask.h
deleted file mode 100644
index 16dbc0292e..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/TimerTask.h
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// TimerTask.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Timer
-// Module: TimerTask
-//
-// Definition of the TimerTask class.
-//
-// Copyright (c) 2009, 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.
-//
-
-
-#ifndef Util_TimerTask_INCLUDED
-#define Util_TimerTask_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Runnable.h"
-#include "Poco/RefCountedObject.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API TimerTask: public Poco::RefCountedObject, public Poco::Runnable
- /// A task that can be scheduled for one-time or
- /// repeated execution by a Timer.
- ///
- /// This is an abstract class. Subclasses must override the run() member
- /// function to implement the actual task logic.
-{
-public:
- typedef Poco::AutoPtr<TimerTask> Ptr;
-
- TimerTask();
- /// Creates the TimerTask.
-
- void cancel();
- /// Cancels the execution of the timer.
- /// If the task has been scheduled for one-time execution and has
- /// not yet run, or has not yet been scheduled, it will never run.
- /// If the task has been scheduled for repeated execution, it will never
- /// run again. If the task is running when this call occurs, the task
- /// will run to completion, but will never run again.
-
- bool isCancelled() const;
- /// Returns true iff the TimerTask has been cancelled by a call
- /// to cancel().
-
- Poco::Timestamp lastExecution() const;
- /// Returns the time of the last execution of the timer task.
- ///
- /// Returns 0 if the timer has never been executed.
-
-protected:
- ~TimerTask();
- /// Destroys the TimerTask.
-
-private:
- TimerTask(const TimerTask&);
- TimerTask& operator = (const TimerTask&);
-
- Poco::Timestamp _lastExecution;
- bool _isCancelled;
-
- friend class TaskNotification;
-};
-
-
-//
-// inlines
-//
-inline bool TimerTask::isCancelled() const
-{
- return _isCancelled;
-}
-
-
-inline Poco::Timestamp TimerTask::lastExecution() const
-{
- return _lastExecution;
-}
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_TimerTask_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/TimerTaskAdapter.h b/Utilities/Poco/Util/include/Poco/Util/TimerTaskAdapter.h
deleted file mode 100644
index b647576704..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/TimerTaskAdapter.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// TimerTaskAdapter.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Timer
-// Module: TimerTaskAdapter
-//
-// Definition of the TimerTaskAdapter class template.
-//
-// Copyright (c) 2009, 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.
-//
-
-
-#ifndef Util_TimerTaskAdapter_INCLUDED
-#define Util_TimerTaskAdapter_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/TimerTask.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-template <class C>
-class TimerTaskAdapter: public TimerTask
- /// This class template simplifies the implementation
- /// of TimerTask objects by allowing a member function
- /// of an object to be called as task.
-{
-public:
- typedef void (C::*Callback)(TimerTask&);
-
- TimerTaskAdapter(C& object, Callback method): _pObject(&object), _method(method)
- /// Creates the TimerTaskAdapter, using the given
- /// object and its member function as task target.
- ///
- /// The member function must accept one argument,
- /// a reference to a TimerTask object.
- {
- }
-
- void run()
- {
- (_pObject->*_method)(*this);
- }
-
-protected:
- ~TimerTaskAdapter()
- /// Destroys the TimerTaskAdapter.
- {
- }
-
-private:
- TimerTaskAdapter();
-
- C* _pObject;
- Callback _method;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_TimerTaskAdapter_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/Util.h b/Utilities/Poco/Util/include/Poco/Util/Util.h
deleted file mode 100755
index df7262fa10..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/Util.h
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// Util.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Util
-// Module: Util
-//
-// Basic definitions for the Poco Util library.
-// This file must be the first file included by every other Util
-// header file.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_Util_INCLUDED
-#define Util_Util_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-//
-// Ensure that POCO_DLL is default unless POCO_STATIC is defined
-//
-#if defined(_WIN32) && defined(_DLL)
- #if !defined(POCO_DLL) && !defined(POCO_STATIC)
- #define POCO_DLL
- #endif
-#endif
-
-//
-// The following block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the Util_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// Util_API functions as being imported from a DLL, wheras this DLL sees symbols
-// defined with this macro as being exported.
-//
-#if defined(_WIN32) && defined(POCO_DLL)
- #if defined(Util_EXPORTS)
- #define Util_API __declspec(dllexport)
- #else
- #define Util_API __declspec(dllimport)
- #endif
-#endif
-
-
-#if !defined(Util_API)
- #define Util_API
-#endif
-
-
-//
-// Automatically link Util library.
-//
-#if defined(_MSC_VER)
- #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Util_EXPORTS)
- #if defined(POCO_DLL)
- #if defined(_DEBUG)
- #pragma comment(lib, "PocoUtild.lib")
- #else
- #pragma comment(lib, "PocoUtil.lib")
- #endif
- #else
- #if defined(_DEBUG)
- #pragma comment(lib, "PocoUtilmtd.lib")
- #else
- #pragma comment(lib, "PocoUtilmt.lib")
- #endif
- #endif
- #endif
-#endif
-
-
-#endif // Util_Util_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/Validator.h b/Utilities/Poco/Util/include/Poco/Util/Validator.h
deleted file mode 100755
index f197e1da99..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/Validator.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// Validator.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: Validator
-//
-// Definition of the Validator class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Util_Validator_INCLUDED
-#define Util_Validator_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/RefCountedObject.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Option;
-
-
-class Util_API Validator: public Poco::RefCountedObject
- /// Validator specifies the interface for option validators.
- ///
- /// Option validators provide a simple way for the automatic
- /// validation of command line argument values.
-{
-public:
- virtual void validate(const Option& option, const std::string& value) = 0;
- /// Validates the value for the given option.
- /// Does nothing if the value is valid.
- ///
- /// Throws an InvalidOptionException otherwise.
-
-protected:
- Validator();
- /// Creates the Validator.
-
- virtual ~Validator();
- /// Destroys the Validator.
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_Validator_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/WinRegistryConfiguration.h b/Utilities/Poco/Util/include/Poco/Util/WinRegistryConfiguration.h
deleted file mode 100755
index e05a2ac733..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/WinRegistryConfiguration.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// WinRegistryConfiguration.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Windows
-// Module: WinRegistryConfiguration
-//
-// Definition of the WinRegistryConfiguration class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef Util_WinRegistryConfiguration_INCLUDED
-#define Util_WinRegistryConfiguration_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/AbstractConfiguration.h"
-#include "Poco/String.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API WinRegistryConfiguration: public AbstractConfiguration
- /// An implementation of AbstractConfiguration that stores configuration data
- /// in the Windows registry.
-{
-public:
- WinRegistryConfiguration(const std::string& rootPath);
- /// Creates the WinRegistryConfiguration.
- /// The rootPath must start with one of the root key names
- /// like HKEY_CLASSES_ROOT, e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.
- /// All further keys are relativ to the root path and can be
- /// dot seperated, e.g. the path MyService.ServiceName will be converted to
- /// HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService\ServiceName.
-
- bool getRaw(const std::string& key, std::string& value) const;
- /// If the property with the given key exists, stores the property's value
- /// in value and returns true. Otherwise, returns false.
- ///
- /// Must be overridden by subclasses.
-
- void setRaw(const std::string& key, const std::string& value);
- /// Sets the property with the given key to the given value.
- /// An already existing value for the key is overwritten.
- ///
- /// Must be overridden by subclasses.
-
- void enumerate(const std::string& key, Keys& range) const;
- /// Returns in range the names of all subkeys under the given key.
- /// If an empty key is passed, all root level keys are returned.
-
-protected:
- ~WinRegistryConfiguration();
- /// Destroys the WinRegistryConfiguration.
-
- std::string ConvertToRegFormat(const std::string& key, std::string& keyName) const;
- /// takes a key in the format of A.B.C and converts it to
- /// registry format A\B\C, the last entry is the keyName, the rest is returned as path
-
-private:
- std::string _rootPath;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_WinRegistryConfiguration_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/WinRegistryKey.h b/Utilities/Poco/Util/include/Poco/Util/WinRegistryKey.h
deleted file mode 100755
index ea9fe6f092..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/WinRegistryKey.h
+++ /dev/null
@@ -1,180 +0,0 @@
-//
-// WinRegistryKey.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Windows
-// Module: WinRegistryKey
-//
-// Definition of the WinRegistryKey class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_WinRegistryKey_INCLUDED
-#define Util_WinRegistryKey_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/UnWindows.h"
-#include <vector>
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API WinRegistryKey
- /// This class implements a convenient interface to the
- /// Windows Registry.
- ///
- /// This class is only available on Windows platforms.
-{
-public:
- typedef std::vector<std::string> Keys;
- typedef std::vector<std::string> Values;
-
- enum Type
- {
- REGT_NONE = 0,
- REGT_STRING = 1,
- REGT_STRING_EXPAND = 2,
- REGT_DWORD = 4
- };
-
- WinRegistryKey(const std::string& key, bool readOnly = false);
- /// Creates the WinRegistryKey.
- ///
- /// The key must start with one of the root key names
- /// like HKEY_CLASSES_ROOT, e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.
- ///
- /// If readOnly is true, then only read access to the registry
- /// is available and any attempt to write to the registry will
- /// result in an exception.
-
- WinRegistryKey(HKEY hRootKey, const std::string& subKey, bool readOnly = false);
- /// Creates the WinRegistryKey.
- ///
- /// If readOnly is true, then only read access to the registry
- /// is available and any attempt to write to the registry will
- /// result in an exception.
-
- ~WinRegistryKey();
- /// Destroys the WinRegistryKey.
-
- void setString(const std::string& name, const std::string& value);
- /// Sets the string value (REG_SZ) with the given name.
- /// An empty name denotes the default value.
-
- std::string getString(const std::string& name);
- /// Returns the string value (REG_SZ) with the given name.
- /// An empty name denotes the default value.
- ///
- /// Throws a NotFoundException if the value does not exist.
-
- void setStringExpand(const std::string& name, const std::string& value);
- /// Sets the expandable string value (REG_EXPAND_SZ) with the given name.
- /// An empty name denotes the default value.
-
- std::string getStringExpand(const std::string& name);
- /// Returns the string value (REG_EXPAND_SZ) with the given name.
- /// An empty name denotes the default value.
- /// All references to environment variables (%VAR%) in the string
- /// are expanded.
- ///
- /// Throws a NotFoundException if the value does not exist.
-
- void setInt(const std::string& name, int value);
- /// Sets the numeric (REG_DWORD) value with the given name.
- /// An empty name denotes the default value.
-
- int getInt(const std::string& name);
- /// Returns the numeric value (REG_DWORD) with the given name.
- /// An empty name denotes the default value.
- ///
- /// Throws a NotFoundException if the value does not exist.
-
- void deleteValue(const std::string& name);
- /// Deletes the value with the given name.
- ///
- /// Throws a NotFoundException if the value does not exist.
-
- void deleteKey();
- /// Recursively deletes the key and all subkeys.
-
- bool exists();
- /// Returns true iff the key exists.
-
- Type type(const std::string& name);
- /// Returns the type of the key value.
-
- bool exists(const std::string& name);
- /// Returns true iff the given value exists under that key.
-
- void subKeys(Keys& keys);
- /// Appends all subKey names to keys.
-
- void values(Values& vals);
- /// Appends all value names to vals;
-
- bool isReadOnly() const;
- /// Returns true iff the key has been opened for read-only access only.
-
-protected:
- void open();
- void close();
- std::string key() const;
- std::string key(const std::string& valueName) const;
- void handleSetError(const std::string& name);
- static HKEY handleFor(const std::string& rootKey);
-
-private:
- WinRegistryKey();
- WinRegistryKey(const WinRegistryKey&);
- WinRegistryKey& operator = (const WinRegistryKey&);
-
- HKEY _hRootKey;
- std::string _subKey;
- HKEY _hKey;
- bool _readOnly;
-};
-
-
-//
-// inlines
-//
-inline bool WinRegistryKey::isReadOnly() const
-{
- return _readOnly;
-}
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_WinRegistryKey_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/WinService.h b/Utilities/Poco/Util/include/Poco/Util/WinService.h
deleted file mode 100755
index ca3340cd06..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/WinService.h
+++ /dev/null
@@ -1,153 +0,0 @@
-//
-// WinService.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Windows
-// Module: WinService
-//
-// Definition of the WinService class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_WinService_INCLUDED
-#define Util_WinService_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/UnWindows.h"
-
-
-#if defined(POCO_WIN32_UTF8)
-#define POCO_LPQUERY_SERVICE_CONFIG LPQUERY_SERVICE_CONFIGW
-#else
-#define POCO_LPQUERY_SERVICE_CONFIG LPQUERY_SERVICE_CONFIGA
-#endif
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API WinService
- /// This class provides an object-oriented interface to
- /// the Windows Service Control Manager for registering,
- /// unregistering, configuring, starting and stopping
- /// services.
- ///
- /// This class is only available on Windows platforms.
-{
-public:
- enum Startup
- {
- SVC_AUTO_START,
- SVC_MANUAL_START,
- SVC_DISABLED
- };
-
- WinService(const std::string& name);
- /// Creates the WinService, using the given service name.
-
- ~WinService();
- /// Destroys the WinService.
-
- const std::string& name() const;
- /// Returns the service name.
-
- std::string displayName() const;
- /// Returns the service's display name.
-
- std::string path() const;
- /// Returns the path to the service executable.
- ///
- /// Throws a NotFoundException if the service has not been registered.
-
- void registerService(const std::string& path, const std::string& displayName);
- /// Creates a Windows service with the executable specified by path
- /// and the given displayName.
- ///
- /// Throws a ExistsException if the service has already been registered.
-
- void registerService(const std::string& path);
- /// Creates a Windows service with the executable specified by path
- /// and the given displayName. The service name is used as display name.
- ///
- /// Throws a ExistsException if the service has already been registered.
-
- void unregisterService();
- /// Deletes the Windows service.
- ///
- /// Throws a NotFoundException if the service has not been registered.
-
- bool isRegistered() const;
- /// Returns true if the service has been registered with the Service Control Manager.
-
- bool isRunning() const;
- /// Returns true if the service is currently running.
-
- void start();
- /// Starts the service.
- /// Does nothing if the service is already running.
- ///
- /// Throws a NotFoundException if the service has not been registered.
-
- void stop();
- /// Stops the service.
- /// Does nothing if the service is not running.
- ///
- /// Throws a NotFoundException if the service has not been registered.
-
- void setStartup(Startup startup);
- /// Sets the startup mode for the service.
-
- Startup getStartup() const;
- /// Returns the startup mode for the service.
-
- static const int STARTUP_TIMEOUT;
-
-private:
- void open() const;
- bool tryOpen() const;
- void close() const;
- POCO_LPQUERY_SERVICE_CONFIG config() const;
-
- WinService();
- WinService(const WinService&);
- WinService& operator = (const WinService&);
-
- std::string _name;
- SC_HANDLE _scmHandle;
- mutable SC_HANDLE _svcHandle;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_WinService_INCLUDED
diff --git a/Utilities/Poco/Util/include/Poco/Util/XMLConfiguration.h b/Utilities/Poco/Util/include/Poco/Util/XMLConfiguration.h
deleted file mode 100755
index a540b1eba8..0000000000
--- a/Utilities/Poco/Util/include/Poco/Util/XMLConfiguration.h
+++ /dev/null
@@ -1,178 +0,0 @@
-//
-// XMLConfiguration.h
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: XMLConfiguration
-//
-// Definition of the XMLConfiguration class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef Util_XMLConfiguration_INCLUDED
-#define Util_XMLConfiguration_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/MapConfiguration.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/AutoPtr.h"
-#include "Poco/DOM/DOMWriter.h"
-#include "Poco/SAX/InputSource.h"
-#include <istream>
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API XMLConfiguration: public AbstractConfiguration
- /// This configuration class extracts configuration properties
- /// from an XML document. An XPath-like syntax for property
- /// names is supported to allow full access to the XML document.
- /// XML namespaces are not supported. The name of the root element
- /// of an XML document is not significant. Periods in tag names
- /// are not supported.
- ///
- /// Given the following XML document as an example:
- ///
- /// <config>
- /// <prop1>value1</prop1>
- /// <prop2>value2</prop2>
- /// <prop3>
- /// <prop4 attr="value3"/>
- /// <prop4 attr="value4"/>
- /// </prop3>
- /// <prop5>value5</prop5>
- /// <prop5>value6</prop5>
- /// </config>
- ///
- /// The following property names would be valid and would
- /// yield the shown values:
- ///
- /// prop1 -> value1
- /// prop2 -> value2
- /// prop3.prop4 -> (empty string)
- /// prop3.prop4[@attr] -> value3
- /// prop3.prop4[1][@attr] -> value4
- /// prop5[0] -> value5
- /// prop5[1] -> value6
- ///
- /// Enumerating attributes is not supported.
- /// Calling keys("prop3.prop4") will return an empty range.
-{
-public:
- XMLConfiguration();
- /// Creates an empty XMLConfiguration.
-
- XMLConfiguration(Poco::XML::InputSource* pInputSource);
- /// Creates an XMLConfiguration and loads the XML document from
- /// the given InputSource.
-
- XMLConfiguration(std::istream& istr);
- /// Creates an XMLConfiguration and loads the XML document from
- /// the given stream.
-
- XMLConfiguration(const std::string& path);
- /// Creates an XMLConfiguration and loads the XML document from
- /// the given path.
-
- XMLConfiguration(const Poco::XML::Document* pDocument);
- /// Creates the XMLConfiguration using the given XML document.
-
- XMLConfiguration(const Poco::XML::Node* pNode);
- /// Creates the XMLConfiguration using the given XML node.
-
- void load(Poco::XML::InputSource* pInputSource);
- /// Loads the XML document containing the configuration data
- /// from the given InputSource.
-
- void load(std::istream& istr);
- /// Loads the XML document containing the configuration data
- /// from the given stream.
-
- void load(const std::string& path);
- /// Loads the XML document containing the configuration data
- /// from the given file.
-
- void load(const Poco::XML::Document* pDocument);
- /// Loads the XML document containing the configuration data
- /// from the given XML document.
-
- void load(const Poco::XML::Node* pNode);
- /// Loads the XML document containing the configuration data
- /// from the given XML node.
-
- void loadEmpty(const std::string& rootElementName);
- /// Loads an empty XML document containing only the
- /// root element with the given name.
-
- void save(const std::string& path) const;
- /// Writes the XML document containing the configuration data
- /// to the file given by path.
-
- void save(std::ostream& str) const;
- /// Writes the XML document containing the configuration data
- /// to the given stream.
-
- void save(Poco::XML::DOMWriter& writer, const std::string& path) const;
- /// Writes the XML document containing the configuration data
- /// to the file given by path, using the given DOMWriter.
- ///
- /// This can be used to use a DOMWriter with custom options.
-
- void save(Poco::XML::DOMWriter& writer, std::ostream& str) const;
- /// Writes the XML document containing the configuration data
- /// to the given stream.
- ///
- /// This can be used to use a DOMWriter with custom options.
-
-protected:
- bool getRaw(const std::string& key, std::string& value) const;
- void setRaw(const std::string& key, const std::string& value);
- void enumerate(const std::string& key, Keys& range) const;
- ~XMLConfiguration();
-
-private:
- const Poco::XML::Node* findNode(const std::string& key) const;
- static Poco::XML::Node* findNode(std::string::const_iterator& it, const std::string::const_iterator& end, Poco::XML::Node* pNode, bool create = false);
- static Poco::XML::Node* findElement(const std::string& name, Poco::XML::Node* pNode, bool create);
- static Poco::XML::Node* findElement(int index, Poco::XML::Node* pNode, bool create);
- static Poco::XML::Node* findAttribute(const std::string& name, Poco::XML::Node* pNode, bool create);
-
- Poco::XML::AutoPtr<Poco::XML::Node> _pRoot;
- Poco::XML::AutoPtr<Poco::XML::Document> _pDocument;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_XMLConfiguration_INCLUDED
diff --git a/Utilities/Poco/Util/src/AbstractConfiguration.cpp b/Utilities/Poco/Util/src/AbstractConfiguration.cpp
deleted file mode 100755
index a9502bfbb4..0000000000
--- a/Utilities/Poco/Util/src/AbstractConfiguration.cpp
+++ /dev/null
@@ -1,370 +0,0 @@
-//
-// AbstractConfiguration.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: AbstractConfiguration
-//
-// Copyright (c) 2004-2006, 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/AbstractConfiguration.h"
-#include "Poco/Util/ConfigurationView.h"
-#include "Poco/Exception.h"
-#include "Poco/NumberParser.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/String.h"
-
-
-using Poco::FastMutex;
-using Poco::NotFoundException;
-using Poco::SyntaxException;
-using Poco::CircularReferenceException;
-using Poco::NumberParser;
-using Poco::NumberFormatter;
-using Poco::icompare;
-
-
-namespace Poco {
-namespace Util {
-
-
-AbstractConfiguration::AbstractConfiguration(): _depth(0)
-{
-}
-
-
-AbstractConfiguration::~AbstractConfiguration()
-{
-}
-
-
-bool AbstractConfiguration::hasProperty(const std::string& key) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- return getRaw(key, value);
-}
-
-
-bool AbstractConfiguration::hasOption(const std::string& key) const
-{
- return hasProperty(key);
-}
-
-
-std::string AbstractConfiguration::getString(const std::string& key) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- if (getRaw(key, value))
- return internalExpand(value);
- else
- throw NotFoundException(key);
-}
-
-
-std::string AbstractConfiguration::getString(const std::string& key, const std::string& defaultValue) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- if (getRaw(key, value))
- return internalExpand(value);
- else
- return defaultValue;
-}
-
-
-std::string AbstractConfiguration::getRawString(const std::string& key) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- if (getRaw(key, value))
- return value;
- else
- throw NotFoundException(key);
-}
-
-
-std::string AbstractConfiguration::getRawString(const std::string& key, const std::string& defaultValue) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- if (getRaw(key, value))
- return value;
- else
- return defaultValue;
-}
-
-
-int AbstractConfiguration::getInt(const std::string& key) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- if (getRaw(key, value))
- return parseInt(internalExpand(value));
- else
- throw NotFoundException(key);
-}
-
-
-int AbstractConfiguration::getInt(const std::string& key, int defaultValue) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- if (getRaw(key, value))
- return parseInt(internalExpand(value));
- else
- return defaultValue;
-}
-
-
-double AbstractConfiguration::getDouble(const std::string& key) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- if (getRaw(key, value))
- return NumberParser::parseFloat(internalExpand(value));
- else
- throw NotFoundException(key);
-}
-
-
-double AbstractConfiguration::getDouble(const std::string& key, double defaultValue) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- if (getRaw(key, value))
- return NumberParser::parseFloat(internalExpand(value));
- else
- return defaultValue;
-}
-
-
-bool AbstractConfiguration::getBool(const std::string& key) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- if (getRaw(key, value))
- return parseBool(internalExpand(value));
- else
- throw NotFoundException(key);
-}
-
-
-bool AbstractConfiguration::getBool(const std::string& key, bool defaultValue) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string value;
- if (getRaw(key, value))
- return parseBool(internalExpand(value));
- else
- return defaultValue;
-}
-
-
-void AbstractConfiguration::setString(const std::string& key, const std::string& value)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- setRaw(key, value);
-}
-
-
-void AbstractConfiguration::setInt(const std::string& key, int value)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- setRaw(key, NumberFormatter::format(value));
-}
-
-
-void AbstractConfiguration::setDouble(const std::string& key, double value)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- setRaw(key, NumberFormatter::format(value));
-}
-
-
-void AbstractConfiguration::setBool(const std::string& key, bool value)
-{
- FastMutex::ScopedLock lock(_mutex);
-
- setRaw(key, value ? "true" : "false");
-}
-
-
-void AbstractConfiguration::keys(Keys& range) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- std::string key;
- range.clear();
- enumerate(key, range);
-}
-
-
-void AbstractConfiguration::keys(const std::string& key, Keys& range) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- range.clear();
- enumerate(key, range);
-}
-
-
-const AbstractConfiguration* AbstractConfiguration::createView(const std::string& prefix) const
-{
- return new ConfigurationView(prefix, const_cast<AbstractConfiguration*>(this));
-}
-
-
-AbstractConfiguration* AbstractConfiguration::createView(const std::string& prefix)
-{
- return new ConfigurationView(prefix, this);
-}
-
-
-namespace
-{
- class AutoCounter
- {
- public:
- AutoCounter(int& count): _count(count)
- {
- ++_count;
- }
-
- ~AutoCounter()
- {
- --_count;
- }
-
- private:
- int& _count;
- };
-}
-
-
-std::string AbstractConfiguration::expand(const std::string& value) const
-{
- FastMutex::ScopedLock lock(_mutex);
-
- return internalExpand(value);
-}
-
-
-std::string AbstractConfiguration::internalExpand(const std::string& value) const
-{
- AutoCounter counter(_depth);
- if (_depth > 10) throw CircularReferenceException("Too many property references encountered");
- return uncheckedExpand(value);
-}
-
-
-std::string AbstractConfiguration::uncheckedExpand(const std::string& value) const
-{
- std::string result;
- std::string::const_iterator it = value.begin();
- std::string::const_iterator end = value.end();
- while (it != end)
- {
- if (*it == '$')
- {
- ++it;
- if (it != end && *it == '{')
- {
- ++it;
- std::string prop;
- while (it != end && *it != '}') prop += *it++;
- if (it != end) ++it;
- std::string value;
- if (getRaw(prop, value))
- {
- result.append(internalExpand(value));
- }
- else
- {
- result.append("${");
- result.append(prop);
- result.append("}");
- }
- }
- else result += '$';
- }
- else result += *it++;
- }
- return result;
-}
-
-
-int AbstractConfiguration::parseInt(const std::string& value)
-{
- if (value.compare(0, 2, "0x") == 0)
- return NumberParser::parseHex(value.substr(2));
- else
- return NumberParser::parse(value);
-}
-
-
-bool AbstractConfiguration::parseBool(const std::string& value)
-{
- int n;
- if (NumberParser::tryParse(value, n))
- return n != 0;
- else if (icompare(value, "true") == 0)
- return true;
- else if (icompare(value, "yes") == 0)
- return true;
- else if (icompare(value, "on") == 0)
- return true;
- else if (icompare(value, "false") == 0)
- return false;
- else if (icompare(value, "no") == 0)
- return false;
- else if (icompare(value, "off") == 0)
- return false;
- else
- throw SyntaxException("Cannot convert to boolean", value);
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/Application.cpp b/Utilities/Poco/Util/src/Application.cpp
deleted file mode 100755
index 1212d0fea0..0000000000
--- a/Utilities/Poco/Util/src/Application.cpp
+++ /dev/null
@@ -1,518 +0,0 @@
-//
-// Application.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Application
-// Module: Application
-//
-// Copyright (c) 2004-2006, 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/SystemConfiguration.h"
-#include "Poco/Util/MapConfiguration.h"
-#include "Poco/Util/PropertyFileConfiguration.h"
-#include "Poco/Util/IniFileConfiguration.h"
-#include "Poco/Util/XMLConfiguration.h"
-#include "Poco/Util/LoggingSubsystem.h"
-#include "Poco/Util/Option.h"
-#include "Poco/Util/OptionProcessor.h"
-#include "Poco/Util/Validator.h"
-#include "Poco/Environment.h"
-#include "Poco/Exception.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/File.h"
-#include "Poco/Path.h"
-#include "Poco/String.h"
-#include "Poco/ConsoleChannel.h"
-#include "Poco/AutoPtr.h"
-#if defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/UnWindows.h"
-#endif
-#if defined(POCO_OS_FAMILY_UNIX)
-#include "Poco/SignalHandler.h"
-#endif
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
-#include "Poco/UnicodeConverter.h"
-#endif
-
-
-using Poco::Logger;
-using Poco::Path;
-using Poco::File;
-using Poco::Environment;
-using Poco::SystemException;
-using Poco::ConsoleChannel;
-using Poco::NumberFormatter;
-using Poco::AutoPtr;
-using Poco::icompare;
-
-
-namespace Poco {
-namespace Util {
-
-
-Application* Application::_pInstance = 0;
-
-
-Application::Application():
- _pConfig(new LayeredConfiguration),
- _initialized(false),
- _unixOptions(true),
- _pLogger(&Logger::get("ApplicationStartup")),
- _stopOptionsProcessing(false)
-{
- setup();
-}
-
-
-Application::Application(int argc, char* argv[]):
- _pConfig(new LayeredConfiguration),
- _initialized(false),
- _unixOptions(true),
- _pLogger(&Logger::get("ApplicationStartup")),
- _stopOptionsProcessing(false)
-{
- setup();
- init(argc, argv);
-}
-
-
-Application::~Application()
-{
- try
- {
- uninitialize();
- }
- catch (...)
- {
- }
- _pInstance = 0;
-}
-
-
-void Application::setup()
-{
- poco_assert (_pInstance == 0);
-
- _pConfig->add(new SystemConfiguration, PRIO_SYSTEM, false, false);
- _pConfig->add(new MapConfiguration, PRIO_APPLICATION, true, false);
-
- addSubsystem(new LoggingSubsystem);
-
-#if defined(POCO_OS_FAMILY_UNIX)
- #if !defined(_DEBUG)
- Poco::SignalHandler::install();
- #endif
-#else
- setUnixOptions(false);
-#endif
-
- _pInstance = this;
-
- AutoPtr<ConsoleChannel> pCC = new ConsoleChannel;
- Logger::setChannel("", pCC);
-}
-
-
-void Application::addSubsystem(Subsystem* pSubsystem)
-{
- poco_check_ptr (pSubsystem);
-
- _subsystems.push_back(pSubsystem);
-}
-
-
-void Application::init(int argc, char* argv[])
-{
- setArgs(argc, argv);
- init();
-}
-
-
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
-void Application::init(int argc, wchar_t* argv[])
-{
- std::vector<std::string> args;
- for (int i = 0; i < argc; ++i)
- {
- std::string arg;
- Poco::UnicodeConverter::toUTF8(argv[i], arg);
- args.push_back(arg);
- }
- init(args);
-}
-#endif
-
-
-void Application::init(const std::vector<std::string>& args)
-{
- setArgs(args);
- init();
-}
-
-
-void Application::init()
-{
- Path appPath;
- getApplicationPath(appPath);
- _pConfig->setString("application.path", appPath.toString());
- _pConfig->setString("application.name", appPath.getFileName());
- _pConfig->setString("application.baseName", appPath.getBaseName());
- _pConfig->setString("application.dir", appPath.parent().toString());
- _pConfig->setString("application.configDir", appPath.parent().toString());
- processOptions();
- initialize(*this);
-}
-
-
-const char* Application::name() const
-{
- return "Application";
-}
-
-
-void Application::initialize(Application& self)
-{
- for (SubsystemVec::iterator it = _subsystems.begin(); it != _subsystems.end(); ++it)
- {
- _pLogger->debug(std::string("Initializing subsystem: ") + (*it)->name());
- (*it)->initialize(self);
- }
- _initialized = true;
-}
-
-
-void Application::uninitialize()
-{
- if (_initialized)
- {
- for (SubsystemVec::reverse_iterator it = _subsystems.rbegin(); it != _subsystems.rend(); ++it)
- {
- _pLogger->debug(std::string("Uninitializing subsystem: ") + (*it)->name());
- (*it)->uninitialize();
- }
- _initialized = false;
- }
-}
-
-
-void Application::reinitialize(Application& self)
-{
- for (SubsystemVec::iterator it = _subsystems.begin(); it != _subsystems.end(); ++it)
- {
- _pLogger->debug(std::string("Re-initializing subsystem: ") + (*it)->name());
- (*it)->reinitialize(self);
- }
-}
-
-
-void Application::setUnixOptions(bool flag)
-{
- _unixOptions = flag;
-}
-
-
-int Application::loadConfiguration(int priority)
-{
- int n = 0;
- Path appPath;
- getApplicationPath(appPath);
- Path cfgPath;
- if (findAppConfigFile(appPath.getBaseName(), "properties", cfgPath))
- {
- _pConfig->add(new PropertyFileConfiguration(cfgPath.toString()), priority, false, false);
- ++n;
- }
-#ifndef POCO_UTIL_NO_INIFILECONFIGURATION
- if (findAppConfigFile(appPath.getBaseName(), "ini", cfgPath))
- {
- _pConfig->add(new IniFileConfiguration(cfgPath.toString()), priority, false, false);
- ++n;
- }
-#endif
-#ifndef POCO_UTIL_NO_XMLCONFIGURATION
- if (findAppConfigFile(appPath.getBaseName(), "xml", cfgPath))
- {
- _pConfig->add(new XMLConfiguration(cfgPath.toString()), priority, false, false);
- ++n;
- }
-#endif
- if (n > 0)
- {
- _pConfig->setString("application.configDir", cfgPath.parent().toString());
- }
- return n;
-}
-
-
-void Application::loadConfiguration(const std::string& path, int priority)
-{
- Path confPath(path);
- std::string ext = confPath.getExtension();
- if (icompare(ext, "properties") == 0)
- _pConfig->add(new PropertyFileConfiguration(confPath.toString()), priority, false, false);
-#ifndef POCO_UTIL_NO_INIFILECONFIGURATION
- else if (icompare(ext, "ini") == 0)
- _pConfig->add(new IniFileConfiguration(confPath.toString()), priority, false, false);
-#endif
-#ifndef POCO_UTIL_NO_XMLCONFIGURATION
- else if (icompare(ext, "xml") == 0)
- _pConfig->add(new XMLConfiguration(confPath.toString()), priority, false, false);
-#endif
- else
- throw Poco::InvalidArgumentException("Unsupported configuration file type", ext);
-}
-
-
-std::string Application::commandName() const
-{
- return _pConfig->getString("application.baseName");
-}
-
-
-void Application::stopOptionsProcessing()
-{
- _stopOptionsProcessing = true;
-}
-
-
-int Application::run()
-{
- try
- {
- return main(_args);
- }
- catch (Poco::Exception& exc)
- {
- logger().log(exc);
- }
- catch (std::exception& exc)
- {
- logger().error(exc.what());
- }
- catch (...)
- {
- logger().fatal("system exception");
- }
- return EXIT_SOFTWARE;
-}
-
-
-int Application::main(const std::vector<std::string>& args)
-{
- return EXIT_OK;
-}
-
-
-void Application::setArgs(int argc, char* argv[])
-{
- _command = argv[0];
- _pConfig->setInt("application.argc", argc);
- _args.reserve(argc);
- std::string argvKey = "application.argv[";
- for (int i = 0; i < argc; ++i)
- {
- std::string arg(argv[i]);
- _pConfig->setString(argvKey + NumberFormatter::format(i) + "]", arg);
- _args.push_back(arg);
- }
-}
-
-
-void Application::setArgs(const std::vector<std::string>& args)
-{
- poco_assert (!args.empty());
-
- _command = args[0];
- _pConfig->setInt("application.argc", (int) args.size());
- _args = args;
- std::string argvKey = "application.argv[";
- for (int i = 0; i < args.size(); ++i)
- {
- _pConfig->setString(argvKey + NumberFormatter::format(i) + "]", args[i]);
- }
-}
-
-
-void Application::processOptions()
-{
- defineOptions(_options);
- OptionProcessor processor(_options);
- processor.setUnixStyle(_unixOptions);
- _args.erase(_args.begin());
- ArgVec::iterator it = _args.begin();
- while (it != _args.end() && !_stopOptionsProcessing)
- {
- std::string name;
- std::string value;
- if (processor.process(*it, name, value))
- {
- if (!name.empty()) // "--" option to end options processing
- {
- handleOption(name, value);
- }
- it = _args.erase(it);
- }
- else ++it;
- }
- if (!_stopOptionsProcessing)
- processor.checkRequired();
-}
-
-
-void Application::getApplicationPath(Poco::Path& appPath) const
-{
-#if defined(POCO_OS_FAMILY_UNIX)
- if (_command.find('/') != std::string::npos)
- {
- Path path(_command);
- if (path.isAbsolute())
- {
- appPath = path;
- }
- else
- {
- appPath = Path::current();
- appPath.append(path);
- }
- }
- else
- {
- if (!Path::find(Environment::get("PATH"), _command, appPath))
- appPath = Path(Path::current(), _command);
- appPath.makeAbsolute();
- }
-#elif defined(POCO_OS_FAMILY_WINDOWS)
- #if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
- wchar_t path[1024];
- int n = GetModuleFileNameW(0, path, sizeof(path)/sizeof(wchar_t));
- if (n > 0)
- {
- std::string p;
- Poco::UnicodeConverter::toUTF8(path, p);
- appPath = p;
- }
- else throw SystemException("Cannot get application file name.");
- #else
- char path[1024];
- int n = GetModuleFileNameA(0, path, sizeof(path));
- if (n > 0)
- appPath = path;
- else
- throw SystemException("Cannot get application file name.");
- #endif
-#else
- appPath = _command;
-#endif
-}
-
-
-bool Application::findFile(Poco::Path& path) const
-{
- if (path.isAbsolute()) return true;
-
- Path appPath;
- getApplicationPath(appPath);
- Path base = appPath.parent();
- do
- {
- Path p(base, path);
- File f(p);
- if (f.exists())
- {
- path = p;
- return true;
- }
- if (base.depth() > 0) base.popDirectory();
- }
- while (base.depth() > 0);
- return false;
-}
-
-
-bool Application::findAppConfigFile(const std::string& appName, const std::string& extension, Path& path) const
-{
- poco_assert (!appName.empty());
-
- Path p(appName);
- p.setExtension(extension);
- bool found = findFile(p);
- if (!found)
- {
-#if defined(_DEBUG)
- if (appName[appName.length() - 1] == 'd')
- {
- p.setBaseName(appName.substr(0, appName.length() - 1));
- found = findFile(p);
- }
-#endif
- }
- if (found)
- path = p;
- return found;
-}
-
-
-void Application::defineOptions(OptionSet& options)
-{
- for (SubsystemVec::iterator it = _subsystems.begin(); it != _subsystems.end(); ++it)
- {
- (*it)->defineOptions(options);
- }
-}
-
-
-void Application::handleOption(const std::string& name, const std::string& value)
-{
- const Option& option = _options.getOption(name);
- if (option.validator())
- {
- option.validator()->validate(option, value);
- }
- if (!option.binding().empty())
- {
- AbstractConfiguration* pConfig = option.config();
- if (!pConfig) pConfig = &config();
- pConfig->setString(option.binding(), value);
- }
- if (option.callback())
- {
- option.callback()->invoke(name, value);
- }
-}
-
-
-void Application::setLogger(Logger& logger)
-{
- _pLogger = &logger;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/ConfigurationMapper.cpp b/Utilities/Poco/Util/src/ConfigurationMapper.cpp
deleted file mode 100755
index 5e06a0f4c7..0000000000
--- a/Utilities/Poco/Util/src/ConfigurationMapper.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// ConfigurationMapper.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: ConfigurationMapper
-//
-// Copyright (c) 2004-2006, 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/ConfigurationMapper.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-ConfigurationMapper::ConfigurationMapper(const std::string& fromPrefix, const std::string& toPrefix, AbstractConfiguration* pConfig):
- _fromPrefix(fromPrefix),
- _toPrefix(toPrefix),
- _pConfig(pConfig)
-{
- poco_check_ptr (pConfig);
-
- if (!_fromPrefix.empty()) _fromPrefix += '.';
- if (!_toPrefix.empty()) _toPrefix += '.';
-
- _pConfig->duplicate();
-}
-
-
-ConfigurationMapper::~ConfigurationMapper()
-{
- _pConfig->release();
-}
-
-
-bool ConfigurationMapper::getRaw(const std::string& key, std::string& value) const
-{
- std::string translatedKey = translateKey(key);
- return _pConfig->getRaw(translatedKey, value);
-}
-
-
-void ConfigurationMapper::setRaw(const std::string& key, const std::string& value)
-{
- std::string translatedKey = translateKey(key);
- _pConfig->setRaw(translatedKey, value);
-}
-
-
-void ConfigurationMapper::enumerate(const std::string& key, Keys& range) const
-{
- std::string cKey(key);
- if (!cKey.empty()) cKey += '.';
- std::string::size_type keyLen = cKey.length();
- if (keyLen < _toPrefix.length())
- {
- if (_toPrefix.compare(0, keyLen, cKey) == 0)
- {
- std::string::size_type pos = _toPrefix.find_first_of('.', keyLen);
- poco_assert_dbg(pos != std::string::npos);
- range.push_back(_toPrefix.substr(keyLen, pos - keyLen));
- }
- }
- else
- {
- std::string translatedKey;
- if (cKey == _toPrefix)
- {
- translatedKey = _fromPrefix;
- if (!translatedKey.empty())
- translatedKey.resize(translatedKey.length() - 1);
- }
- else translatedKey = translateKey(key);
- _pConfig->enumerate(translatedKey, range);
- }
-}
-
-
-std::string ConfigurationMapper::translateKey(const std::string& key) const
-{
- std::string result(key);
- if (result.compare(0, _toPrefix.size(), _toPrefix) == 0)
- result.replace(0, _toPrefix.size(), _fromPrefix);
- return result;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/ConfigurationView.cpp b/Utilities/Poco/Util/src/ConfigurationView.cpp
deleted file mode 100755
index 523c82d598..0000000000
--- a/Utilities/Poco/Util/src/ConfigurationView.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// ConfigurationView.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: ConfigurationView
-//
-// Copyright (c) 2004-2006, 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/ConfigurationView.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-ConfigurationView::ConfigurationView(const std::string& prefix, AbstractConfiguration* pConfig):
- _prefix(prefix),
- _pConfig(pConfig)
-{
- poco_check_ptr (pConfig);
-
- _pConfig->duplicate();
-}
-
-
-ConfigurationView::~ConfigurationView()
-{
- _pConfig->release();
-}
-
-
-bool ConfigurationView::getRaw(const std::string& key, std::string& value) const
-{
- std::string translatedKey = translateKey(key);
- return _pConfig->getRaw(translatedKey, value) || _pConfig->getRaw(key, value);
-}
-
-
-void ConfigurationView::setRaw(const std::string& key, const std::string& value)
-{
- std::string translatedKey = translateKey(key);
- _pConfig->setRaw(translatedKey, value);
-}
-
-
-void ConfigurationView::enumerate(const std::string& key, Keys& range) const
-{
- std::string translatedKey = translateKey(key);
- _pConfig->enumerate(translatedKey, range);
-}
-
-
-std::string ConfigurationView::translateKey(const std::string& key) const
-{
- std::string result = _prefix;
- if (!result.empty() && !key.empty()) result += '.';
- result += key;
- return result;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/FilesystemConfiguration.cpp b/Utilities/Poco/Util/src/FilesystemConfiguration.cpp
deleted file mode 100755
index b6bebf5199..0000000000
--- a/Utilities/Poco/Util/src/FilesystemConfiguration.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// FilesystemConfiguration.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: FilesystemConfiguration
-//
-// Copyright (c) 2004-2006, 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/FilesystemConfiguration.h"
-#include "Poco/File.h"
-#include "Poco/Path.h"
-#include "Poco/DirectoryIterator.h"
-#include "Poco/StringTokenizer.h"
-#include "Poco/Exception.h"
-#include "Poco/FileStream.h"
-
-
-using Poco::Path;
-using Poco::File;
-using Poco::DirectoryIterator;
-using Poco::StringTokenizer;
-using Poco::NotFoundException;
-
-
-namespace Poco {
-namespace Util {
-
-
-FilesystemConfiguration::FilesystemConfiguration(const std::string& path):
- _path(path)
-{
- _path.makeDirectory();
-}
-
-
-FilesystemConfiguration::~FilesystemConfiguration()
-{
-}
-
-
-void FilesystemConfiguration::clear()
-{
- File regDir(_path);
- regDir.remove(true);
-}
-
-
-bool FilesystemConfiguration::getRaw(const std::string& key, std::string& value) const
-{
- Path p(keyToPath(key));
- p.setFileName("data");
- File f(p);
- if (f.exists())
- {
- value.reserve((std::string::size_type) f.getSize());
- Poco::FileInputStream istr(p.toString());
- int c = istr.get();
- while (c != std::char_traits<char>::eof())
- {
- value += (char) c;
- c = istr.get();
- }
- return true;
- }
- else return false;
-}
-
-
-void FilesystemConfiguration::setRaw(const std::string& key, const std::string& value)
-{
- Path p(keyToPath(key));
- File dir(p);
- dir.createDirectories();
- p.setFileName("data");
- Poco::FileOutputStream ostr(p.toString());
- ostr.write(value.data(), (std::streamsize) value.length());
-}
-
-
-void FilesystemConfiguration::enumerate(const std::string& key, Keys& range) const
-{
- DirectoryIterator it(keyToPath(key));
- DirectoryIterator end;
- while (it != end)
- {
- if (it->isDirectory())
- range.push_back(it.name());
- ++it;
- }
-}
-
-
-Path FilesystemConfiguration::keyToPath(const std::string& key) const
-{
- Path result(_path);
- StringTokenizer tokenizer(key, ".", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
- for (StringTokenizer::Iterator it = tokenizer.begin(); it != tokenizer.end(); ++it)
- {
- result.pushDirectory(*it);
- }
- return result;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/HelpFormatter.cpp b/Utilities/Poco/Util/src/HelpFormatter.cpp
deleted file mode 100755
index 40f3bc9e3d..0000000000
--- a/Utilities/Poco/Util/src/HelpFormatter.cpp
+++ /dev/null
@@ -1,310 +0,0 @@
-//
-// HelpFormatter.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: HelpFormatter
-//
-// Copyright (c) 2004-2006, 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/HelpFormatter.h"
-#include "Poco/Util/OptionSet.h"
-#include "Poco/Util/Option.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-const int HelpFormatter::TAB_WIDTH = 4;
-const int HelpFormatter::LINE_WIDTH = 78;
-
-
-HelpFormatter::HelpFormatter(const OptionSet& options):
- _options(options),
- _width(LINE_WIDTH),
- _indent(0),
- _unixStyle(true)
-{
-#if !defined(POCO_OS_FAMILY_UNIX)
- _unixStyle = false;
-#endif
- _indent = calcIndent();
-}
-
-
-HelpFormatter::~HelpFormatter()
-{
-}
-
-
-void HelpFormatter::setCommand(const std::string& command)
-{
- _command = command;
-}
-
-
-void HelpFormatter::setUsage(const std::string& usage)
-{
- _usage = usage;
-}
-
-
-void HelpFormatter::setHeader(const std::string& header)
-{
- _header = header;
-}
-
-
-void HelpFormatter::setFooter(const std::string& footer)
-{
- _footer = footer;
-}
-
-
-void HelpFormatter::format(std::ostream& ostr) const
-{
- ostr << "usage: " << _command;
- if (!_usage.empty())
- {
- ostr << ' ';
- formatText(ostr, _usage, (int) _command.length() + 1);
- }
- ostr << '\n';
- if (!_header.empty())
- {
- formatText(ostr, _header, 0);
- ostr << "\n\n";
- }
- formatOptions(ostr);
- if (!_footer.empty())
- {
- ostr << '\n';
- formatText(ostr, _footer, 0);
- ostr << '\n';
- }
-}
-
-
-void HelpFormatter::setWidth(int width)
-{
- poco_assert (width > 0);
-
- _width = width;
-}
-
-
-void HelpFormatter::setIndent(int indent)
-{
- poco_assert (indent >= 0 && indent < _width);
-
- _indent = indent;
-}
-
-
-void HelpFormatter::setAutoIndent()
-{
- _indent = calcIndent();
-}
-
-
-void HelpFormatter::setUnixStyle(bool flag)
-{
- _unixStyle = flag;
-}
-
-
-int HelpFormatter::calcIndent() const
-{
- int indent = 0;
- for (OptionSet::Iterator it = _options.begin(); it != _options.end(); ++it)
- {
- int shortLen = (int) it->shortName().length();
- int fullLen = (int) it->fullName().length();
- int n = 0;
- if (_unixStyle && shortLen > 0)
- {
- n += shortLen + (int) shortPrefix().length();
- if (it->takesArgument())
- n += (int) it->argumentName().length() + (it->argumentRequired() ? 0 : 2);
- if (fullLen > 0) n += 2;
- }
- if (fullLen > 0)
- {
- n += fullLen + (int) longPrefix().length();
- if (it->takesArgument())
- n += 1 + (int) it->argumentName().length() + (it->argumentRequired() ? 0 : 2);
- }
- n += 2;
- if (n > indent)
- indent = n;
- }
- return indent;
-}
-
-
-void HelpFormatter::formatOptions(std::ostream& ostr) const
-{
- int optWidth = calcIndent();
- for (OptionSet::Iterator it = _options.begin(); it != _options.end(); ++it)
- {
- formatOption(ostr, *it, optWidth);
- formatText(ostr, it->description(), _indent, optWidth);
- ostr << '\n';
- }
-}
-
-
-void HelpFormatter::formatOption(std::ostream& ostr, const Option& option, int width) const
-{
- int shortLen = (int) option.shortName().length();
- int fullLen = (int) option.fullName().length();
-
- int n = 0;
- if (_unixStyle && shortLen > 0)
- {
- ostr << shortPrefix() << option.shortName();
- n += (int) shortPrefix().length() + (int) option.shortName().length();
- if (option.takesArgument())
- {
- if (!option.argumentRequired()) { ostr << '['; ++n; }
- ostr << option.argumentName();
- n += (int) option.argumentName().length();
- if (!option.argumentRequired()) { ostr << ']'; ++n; }
- }
- if (fullLen > 0) { ostr << ", "; n += 2; }
- }
- if (fullLen > 0)
- {
- ostr << longPrefix() << option.fullName();
- n += (int) longPrefix().length() + (int) option.fullName().length();
- if (option.takesArgument())
- {
- if (!option.argumentRequired()) { ostr << '['; ++n; }
- ostr << '=';
- ++n;
- ostr << option.argumentName();
- n += (int) option.argumentName().length();
- if (!option.argumentRequired()) { ostr << ']'; ++n; }
- }
- }
- while (n < width) { ostr << ' '; ++n; }
-}
-
-
-void HelpFormatter::formatText(std::ostream& ostr, const std::string& text, int indent) const
-{
- formatText(ostr, text, indent, indent);
-}
-
-
-void HelpFormatter::formatText(std::ostream& ostr, const std::string& text, int indent, int firstIndent) const
-{
- int pos = firstIndent;
- int maxWordLen = _width - indent;
- std::string word;
- for (std::string::const_iterator it = text.begin(); it != text.end(); ++it)
- {
- if (*it == '\n')
- {
- clearWord(ostr, pos, word, indent);
- ostr << '\n';
- pos = 0;
- while (pos < indent) { ostr << ' '; ++pos; }
- }
- else if (*it == '\t')
- {
- clearWord(ostr, pos, word, indent);
- if (pos < _width) ++pos;
- while (pos < _width && pos % TAB_WIDTH != 0)
- {
- ostr << ' ';
- ++pos;
- }
- }
- else if (*it == ' ')
- {
- clearWord(ostr, pos, word, indent);
- if (pos < _width) { ostr << ' '; ++pos; }
- }
- else
- {
- if (word.length() == maxWordLen)
- {
- clearWord(ostr, pos, word, indent);
- }
- else word += *it;
- }
- }
- clearWord(ostr, pos, word, indent);
-}
-
-
-void HelpFormatter::formatWord(std::ostream& ostr, int& pos, const std::string& word, int indent) const
-{
- if (pos + word.length() > _width)
- {
- ostr << '\n';
- pos = 0;
- while (pos < indent) { ostr << ' '; ++pos; }
- }
- ostr << word;
- pos += (int) word.length();
-}
-
-
-void HelpFormatter::clearWord(std::ostream& ostr, int& pos, std::string& word, int indent) const
-{
- formatWord(ostr, pos, word, indent);
- word.clear();
-}
-
-
-std::string HelpFormatter::shortPrefix() const
-{
-#if defined(POCO_OS_FAMILY_UNIX)
- return "-";
-#else
- return _unixStyle ? "-" : "/";
-#endif
-}
-
-
-std::string HelpFormatter::longPrefix() const
-{
-#if defined(POCO_OS_FAMILY_UNIX)
- return "--";
-#else
- return _unixStyle ? "--" : "/";
-#endif
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/IniFileConfiguration.cpp b/Utilities/Poco/Util/src/IniFileConfiguration.cpp
deleted file mode 100755
index 3438002126..0000000000
--- a/Utilities/Poco/Util/src/IniFileConfiguration.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// IniFileConfiguration.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: IniFileConfiguration
-//
-// Copyright (c) 2004-2006, 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/IniFileConfiguration.h"
-#include "Poco/Exception.h"
-#include "Poco/String.h"
-#include "Poco/Path.h"
-#include "Poco/FileStream.h"
-#include <cctype>
-#include <set>
-
-
-using Poco::icompare;
-using Poco::trim;
-using Poco::Path;
-
-
-namespace Poco {
-namespace Util {
-
-
-IniFileConfiguration::IniFileConfiguration()
-{
-}
-
-
-IniFileConfiguration::IniFileConfiguration(std::istream& istr)
-{
- load(istr);
-}
-
-
-IniFileConfiguration::IniFileConfiguration(const std::string& path)
-{
- load(path);
-}
-
-
-IniFileConfiguration::~IniFileConfiguration()
-{
-}
-
-
-void IniFileConfiguration::load(std::istream& istr)
-{
- _map.clear();
- _sectionKey.clear();
- while (!istr.eof())
- {
- parseLine(istr);
- }
-}
-
-
-void IniFileConfiguration::load(const std::string& path)
-{
- Poco::FileInputStream istr(path);
- if (istr.good())
- load(istr);
- else
- throw Poco::OpenFileException(path);
-}
-
-
-bool IniFileConfiguration::getRaw(const std::string& key, std::string& value) const
-{
- IStringMap::const_iterator it = _map.find(key);
- if (it != _map.end())
- {
- value = it->second;
- return true;
- }
- else return false;
-}
-
-
-void IniFileConfiguration::setRaw(const std::string& key, const std::string& value)
-{
- throw Poco::NotImplementedException("Setting a property in an IniFileConfiguration");
-}
-
-
-void IniFileConfiguration::enumerate(const std::string& key, Keys& range) const
-{
- std::set<std::string> keys;
- std::string prefix = key;
- if (!prefix.empty()) prefix += '.';
- std::string::size_type psize = prefix.size();
- for (IStringMap::const_iterator it = _map.begin(); it != _map.end(); ++it)
- {
- if (icompare(it->first, psize, prefix) == 0)
- {
- std::string subKey;
- std::string::size_type end = it->first.find('.', psize);
- if (end == std::string::npos)
- subKey = it->first.substr(psize);
- else
- subKey = it->first.substr(psize, end - psize);
- if (keys.find(subKey) == keys.end())
- {
- range.push_back(subKey);
- keys.insert(subKey);
- }
- }
- }
-}
-
-
-bool IniFileConfiguration::ICompare::operator () (const std::string& s1, const std::string& s2) const
-{
- return icompare(s1, s2) < 0;
-}
-
-
-void IniFileConfiguration::parseLine(std::istream& istr)
-{
- static const int eof = std::char_traits<char>::eof();
-
- int c = istr.get();
- while (c != eof && std::isspace((char) c)) c = istr.get();
- if (c != eof)
- {
- if (c == ';')
- {
- while (c != eof && c != '\n') c = istr.get();
- }
- else if (c == '[')
- {
- std::string key;
- c = istr.get();
- while (c != eof && c != ']' && c != '\n') { key += (char) c; c = istr.get(); }
- _sectionKey = trim(key);
- }
- else
- {
- std::string key;
- while (c != eof && c != '=' && c != '\n') { key += (char) c; c = istr.get(); }
- std::string value;
- if (c == '=')
- {
- c = istr.get();
- while (c != eof && c != '\n') { value += (char) c; c = istr.get(); }
- }
- std::string fullKey = _sectionKey;
- if (!fullKey.empty()) fullKey += '.';
- fullKey.append(trim(key));
- _map[fullKey] = trim(value);
- }
- }
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/IntValidator.cpp b/Utilities/Poco/Util/src/IntValidator.cpp
deleted file mode 100755
index 27b46d7e27..0000000000
--- a/Utilities/Poco/Util/src/IntValidator.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// IntValidator.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: IntValidator
-//
-// Copyright (c) 2006, 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/IntValidator.h"
-#include "Poco/Util/Option.h"
-#include "Poco/Util/OptionException.h"
-#include "Poco/NumberParser.h"
-#include "Poco/Format.h"
-
-
-using Poco::NumberParser;
-using Poco::format;
-
-
-namespace Poco {
-namespace Util {
-
-
-IntValidator::IntValidator(int min, int max):
- _min(min),
- _max(max)
-{
-}
-
-
-IntValidator::~IntValidator()
-{
-}
-
-
-void IntValidator::validate(const Option& option, const std::string& value)
-{
- int n;
- if (NumberParser::tryParse(value, n))
- {
- if (n < _min || n > _max)
- throw InvalidArgumentException(format("argument for %s must be in range %d to %d", option.fullName(), _min, _max));
- }
- else throw InvalidArgumentException(format("argument for %s must be an integer", option.fullName()));
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/LayeredConfiguration.cpp b/Utilities/Poco/Util/src/LayeredConfiguration.cpp
deleted file mode 100755
index 6cb6c219d3..0000000000
--- a/Utilities/Poco/Util/src/LayeredConfiguration.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-//
-// LayeredConfiguration.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: LayeredConfiguration
-//
-// Copyright (c) 2004-2006, 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/LayeredConfiguration.h"
-#include "Poco/Exception.h"
-#include <set>
-
-
-using Poco::AutoPtr;
-using Poco::RuntimeException;
-
-
-namespace Poco {
-namespace Util {
-
-
-LayeredConfiguration::LayeredConfiguration()
-{
-}
-
-
-LayeredConfiguration::~LayeredConfiguration()
-{
-}
-
-
-void LayeredConfiguration::add(AbstractConfiguration* pConfig)
-{
- add(pConfig, highest(), false, true);
-}
-
-
-void LayeredConfiguration::add(AbstractConfiguration* pConfig, bool shared)
-{
- add(pConfig, highest(), false, shared);
-}
-
-
-void LayeredConfiguration::add(AbstractConfiguration* pConfig, int priority)
-{
- add(pConfig, priority, false, true);
-}
-
-
-void LayeredConfiguration::add(AbstractConfiguration* pConfig, int priority, bool shared)
-{
- add(pConfig, priority, false, shared);
-}
-
-
-void LayeredConfiguration::addFront(AbstractConfiguration* pConfig)
-{
- add(pConfig, lowest(), false, true);
-}
-
-
-void LayeredConfiguration::addFront(AbstractConfiguration* pConfig, bool shared)
-{
- add(pConfig, lowest(), false, shared);
-}
-
-
-void LayeredConfiguration::addWriteable(AbstractConfiguration* pConfig, int priority)
-{
- add(pConfig, priority, true, true);
-}
-
-
-void LayeredConfiguration::addWriteable(AbstractConfiguration* pConfig, int priority, bool shared)
-{
- add(pConfig, priority, true, shared);
-}
-
-
-void LayeredConfiguration::add(AbstractConfiguration* pConfig, int priority, bool writeable, bool shared)
-{
- ConfigItem item;
- item.pConfig = ConfigPtr(pConfig, shared);
- item.priority = priority;
- item.writeable = writeable;
-
- ConfigList::iterator it = _configs.begin();
- while (it != _configs.end() && it->priority < priority)
- ++it;
-
- _configs.insert(it, item);
-}
-
-
-bool LayeredConfiguration::getRaw(const std::string& key, std::string& value) const
-{
- for (ConfigList::const_iterator it = _configs.begin(); it != _configs.end(); ++it)
- {
- if (it->pConfig->getRaw(key, value))
- return true;
- }
- return false;
-}
-
-
-void LayeredConfiguration::setRaw(const std::string& key, const std::string& value)
-{
- for (ConfigList::iterator it = _configs.begin(); it != _configs.end(); ++it)
- {
- if (it->writeable)
- {
- it->pConfig->setRaw(key, value);
- return;
- }
- }
- throw RuntimeException("No writeable configuration object to store the property", key);
-}
-
-
-void LayeredConfiguration::enumerate(const std::string& key, Keys& range) const
-{
- std::set<std::string> keys;
- for (ConfigList::const_iterator itc = _configs.begin(); itc != _configs.end(); ++itc)
- {
- Keys partRange;
- itc->pConfig->enumerate(key, partRange);
- for (Keys::const_iterator itr = partRange.begin(); itr != partRange.end(); ++itr)
- {
- if (keys.find(*itr) == keys.end())
- {
- range.push_back(*itr);
- keys.insert(*itr);
- }
- }
- }
-}
-
-
-int LayeredConfiguration::lowest() const
-{
- if (_configs.empty())
- return 0;
- else
- return _configs.front().priority - 1;
-}
-
-
-int LayeredConfiguration::highest() const
-{
- if (_configs.empty())
- return 0;
- else
- return _configs.back().priority + 1;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/LoggingConfigurator.cpp b/Utilities/Poco/Util/src/LoggingConfigurator.cpp
deleted file mode 100755
index 6ae734c8d7..0000000000
--- a/Utilities/Poco/Util/src/LoggingConfigurator.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
-//
-// LoggingConfigurator.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: LoggingConfigurator
-//
-// Copyright (c) 2004-2006, 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/LoggingConfigurator.h"
-#include "Poco/Util/AbstractConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Channel.h"
-#include "Poco/FormattingChannel.h"
-#include "Poco/Formatter.h"
-#include "Poco/PatternFormatter.h"
-#include "Poco/Logger.h"
-#include "Poco/LoggingRegistry.h"
-#include "Poco/LoggingFactory.h"
-#include <map>
-
-
-using Poco::AutoPtr;
-using Poco::Formatter;
-using Poco::PatternFormatter;
-using Poco::Channel;
-using Poco::FormattingChannel;
-using Poco::Logger;
-using Poco::LoggingRegistry;
-using Poco::LoggingFactory;
-
-
-namespace Poco {
-namespace Util {
-
-
-LoggingConfigurator::LoggingConfigurator()
-{
-}
-
-
-LoggingConfigurator::~LoggingConfigurator()
-{
-}
-
-
-void LoggingConfigurator::configure(AbstractConfiguration* pConfig)
-{
- poco_check_ptr (pConfig);
-
- AutoPtr<AbstractConfiguration> pFormattersConfig(pConfig->createView("logging.formatters"));
- configureFormatters(pFormattersConfig);
-
- AutoPtr<AbstractConfiguration> pChannelsConfig(pConfig->createView("logging.channels"));
- configureChannels(pChannelsConfig);
-
- AutoPtr<AbstractConfiguration> pLoggersConfig(pConfig->createView("logging.loggers"));
- configureLoggers(pLoggersConfig);
-}
-
-
-void LoggingConfigurator::configureFormatters(AbstractConfiguration* pConfig)
-{
- AbstractConfiguration::Keys formatters;
- pConfig->keys(formatters);
- for (AbstractConfiguration::Keys::const_iterator it = formatters.begin(); it != formatters.end(); ++it)
- {
- AutoPtr<AbstractConfiguration> pFormatterConfig(pConfig->createView(*it));
- AutoPtr<Formatter> pFormatter(createFormatter(pFormatterConfig));
- LoggingRegistry::defaultRegistry().registerFormatter(*it, pFormatter);
- }
-}
-
-
-void LoggingConfigurator::configureChannels(AbstractConfiguration* pConfig)
-{
- AbstractConfiguration::Keys channels;
- pConfig->keys(channels);
- for (AbstractConfiguration::Keys::const_iterator it = channels.begin(); it != channels.end(); ++it)
- {
- AutoPtr<AbstractConfiguration> pChannelConfig(pConfig->createView(*it));
- AutoPtr<Channel> pChannel = createChannel(pChannelConfig);
- LoggingRegistry::defaultRegistry().registerChannel(*it, pChannel);
- }
- for (AbstractConfiguration::Keys::const_iterator it = channels.begin(); it != channels.end(); ++it)
- {
- AutoPtr<AbstractConfiguration> pChannelConfig(pConfig->createView(*it));
- Channel* pChannel = LoggingRegistry::defaultRegistry().channelForName(*it);
- configureChannel(pChannel, pChannelConfig);
- }
-}
-
-
-void LoggingConfigurator::configureLoggers(AbstractConfiguration* pConfig)
-{
- typedef std::map<std::string, AutoPtr<AbstractConfiguration> > LoggerMap;
-
- AbstractConfiguration::Keys loggers;
- pConfig->keys(loggers);
- // use a map to sort loggers by their name, ensuring initialization in correct order (parents before children)
- LoggerMap loggerMap;
- for (AbstractConfiguration::Keys::const_iterator it = loggers.begin(); it != loggers.end(); ++it)
- {
- AutoPtr<AbstractConfiguration> pLoggerConfig(pConfig->createView(*it));
- loggerMap[pLoggerConfig->getString("name", "")] = pLoggerConfig;
- }
- for (LoggerMap::iterator it = loggerMap.begin(); it != loggerMap.end(); ++it)
- {
- configureLogger(it->second);
- }
-}
-
-
-Formatter* LoggingConfigurator::createFormatter(AbstractConfiguration* pConfig)
-{
- AutoPtr<Formatter> pFormatter(LoggingFactory::defaultFactory().createFormatter(pConfig->getString("class")));
- AbstractConfiguration::Keys props;
- pConfig->keys(props);
- for (AbstractConfiguration::Keys::const_iterator it = props.begin(); it != props.end(); ++it)
- {
- if (*it != "class")
- pFormatter->setProperty(*it, pConfig->getString(*it));
- }
- return pFormatter.duplicate();
-}
-
-
-Channel* LoggingConfigurator::createChannel(AbstractConfiguration* pConfig)
-{
- AutoPtr<Channel> pChannel(LoggingFactory::defaultFactory().createChannel(pConfig->getString("class")));
- AutoPtr<Channel> pWrapper(pChannel);
- AbstractConfiguration::Keys props;
- pConfig->keys(props);
- for (AbstractConfiguration::Keys::const_iterator it = props.begin(); it != props.end(); ++it)
- {
- if (*it == "pattern")
- {
- AutoPtr<Formatter> pPatternFormatter(new PatternFormatter(pConfig->getString(*it)));
- pWrapper = new FormattingChannel(pPatternFormatter, pChannel);
- }
- else if (*it == "formatter")
- {
- AutoPtr<FormattingChannel> pFormattingChannel(new FormattingChannel(0, pChannel));
- if (pConfig->hasProperty("formatter.class"))
- {
- AutoPtr<AbstractConfiguration> pFormatterConfig(pConfig->createView(*it));
- AutoPtr<Formatter> pFormatter(createFormatter(pFormatterConfig));
- pFormattingChannel->setFormatter(pFormatter);
- }
- else pFormattingChannel->setProperty(*it, pConfig->getString(*it));
-#if defined(__GNUC__) && __GNUC__ < 3
- pWrapper = pFormattingChannel.duplicate();
-#else
- pWrapper = pFormattingChannel;
-#endif
- }
- }
- return pWrapper.duplicate();
-}
-
-
-void LoggingConfigurator::configureChannel(Channel* pChannel, AbstractConfiguration* pConfig)
-{
- AbstractConfiguration::Keys props;
- pConfig->keys(props);
- for (AbstractConfiguration::Keys::const_iterator it = props.begin(); it != props.end(); ++it)
- {
- if (*it != "pattern" && *it != "formatter" && *it != "class")
- {
- pChannel->setProperty(*it, pConfig->getString(*it));
- }
- }
-}
-
-
-void LoggingConfigurator::configureLogger(AbstractConfiguration* pConfig)
-{
- Logger& logger = Logger::get(pConfig->getString("name", ""));
- AbstractConfiguration::Keys props;
- pConfig->keys(props);
- for (AbstractConfiguration::Keys::const_iterator it = props.begin(); it != props.end(); ++it)
- {
- if (*it == "channel" && pConfig->hasProperty("channel.class"))
- {
- AutoPtr<AbstractConfiguration> pChannelConfig(pConfig->createView(*it));
- AutoPtr<Channel> pChannel(createChannel(pChannelConfig));
- configureChannel(pChannel, pChannelConfig);
- Logger::setChannel(logger.name(), pChannel);
- }
- else if (*it != "name")
- {
- Logger::setProperty(logger.name(), *it, pConfig->getString(*it));
- }
- }
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/LoggingSubsystem.cpp b/Utilities/Poco/Util/src/LoggingSubsystem.cpp
deleted file mode 100755
index c74a0b2e8d..0000000000
--- a/Utilities/Poco/Util/src/LoggingSubsystem.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// LoggingSubsystem.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Application
-// Module: LoggingSubsystem
-//
-// Copyright (c) 2004-2006, 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/LoggingSubsystem.h"
-#include "Poco/Util/LoggingConfigurator.h"
-#include "Poco/Util/Application.h"
-#include "Poco/Logger.h"
-
-
-using Poco::Logger;
-
-
-namespace Poco {
-namespace Util {
-
-
-LoggingSubsystem::LoggingSubsystem()
-{
-}
-
-
-LoggingSubsystem::~LoggingSubsystem()
-{
-}
-
-
-const char* LoggingSubsystem::name() const
-{
- return "Logging Subsystem";
-}
-
-
-void LoggingSubsystem::initialize(Application& app)
-{
- LoggingConfigurator configurator;
- configurator.configure(&app.config());
- std::string logger = app.config().getString("application.logger", "Application");
- app.setLogger(Logger::get(logger));
-}
-
-
-void LoggingSubsystem::uninitialize()
-{
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/MapConfiguration.cpp b/Utilities/Poco/Util/src/MapConfiguration.cpp
deleted file mode 100755
index 8af7a33725..0000000000
--- a/Utilities/Poco/Util/src/MapConfiguration.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// MapConfiguration.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: MapConfiguration
-//
-// Copyright (c) 2004-2006, 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/MapConfiguration.h"
-#include <set>
-
-
-namespace Poco {
-namespace Util {
-
-
-MapConfiguration::MapConfiguration()
-{
-}
-
-
-MapConfiguration::~MapConfiguration()
-{
-}
-
-
-void MapConfiguration::clear()
-{
- _map.clear();
-}
-
-
-bool MapConfiguration::getRaw(const std::string& key, std::string& value) const
-{
- StringMap::const_iterator it = _map.find(key);
- if (it != _map.end())
- {
- value = it->second;
- return true;
- }
- else return false;
-}
-
-
-void MapConfiguration::setRaw(const std::string& key, const std::string& value)
-{
- _map[key] = value;
-}
-
-
-void MapConfiguration::enumerate(const std::string& key, Keys& range) const
-{
- std::set<std::string> keys;
- std::string prefix = key;
- if (!prefix.empty()) prefix += '.';
- std::string::size_type psize = prefix.size();
- for (StringMap::const_iterator it = _map.begin(); it != _map.end(); ++it)
- {
- if (it->first.compare(0, psize, prefix) == 0)
- {
- std::string subKey;
- std::string::size_type end = it->first.find('.', psize);
- if (end == std::string::npos)
- subKey = it->first.substr(psize);
- else
- subKey = it->first.substr(psize, end - psize);
- if (keys.find(subKey) == keys.end())
- {
- range.push_back(subKey);
- keys.insert(subKey);
- }
- }
- }
-}
-
-
-MapConfiguration::iterator MapConfiguration::begin() const
-{
- return _map.begin();
-}
-
-
-MapConfiguration::iterator MapConfiguration::end() const
-{
- return _map.end();
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/Option.cpp b/Utilities/Poco/Util/src/Option.cpp
deleted file mode 100755
index 109a51b6b0..0000000000
--- a/Utilities/Poco/Util/src/Option.cpp
+++ /dev/null
@@ -1,314 +0,0 @@
-//
-// Option.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: Option
-//
-// Copyright (c) 2004-2006, 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/Option.h"
-#include "Poco/Util/OptionException.h"
-#include "Poco/Util/Validator.h"
-#include "Poco/Util/AbstractConfiguration.h"
-#include "Poco/String.h"
-#include <algorithm>
-
-
-using Poco::icompare;
-
-
-namespace Poco {
-namespace Util {
-
-
-Option::Option():
- _required(false),
- _repeatable(false),
- _argRequired(false),
- _pValidator(0),
- _pCallback(0),
- _pConfig(0)
-{
-}
-
-
-Option::Option(const Option& option):
- _shortName(option._shortName),
- _fullName(option._fullName),
- _description(option._description),
- _required(option._required),
- _repeatable(option._repeatable),
- _argName(option._argName),
- _argRequired(option._argRequired),
- _group(option._group),
- _binding(option._binding),
- _pValidator(option._pValidator),
- _pCallback(option._pCallback),
- _pConfig(option._pConfig)
-{
- if (_pValidator) _pValidator->duplicate();
- if (_pCallback) _pCallback = _pCallback->clone();
- if (_pConfig) _pConfig->duplicate();
-}
-
-
-Option::Option(const std::string& fullName, const std::string& shortName):
- _shortName(shortName),
- _fullName(fullName),
- _required(false),
- _repeatable(false),
- _argRequired(false),
- _pValidator(0),
- _pCallback(0),
- _pConfig(0)
-{
-}
-
-
-Option::Option(const std::string& fullName, const std::string& shortName, const std::string& description, bool required):
- _shortName(shortName),
- _fullName(fullName),
- _description(description),
- _required(required),
- _repeatable(false),
- _argRequired(false),
- _pValidator(0),
- _pCallback(0),
- _pConfig(0)
-{
-}
-
-
-Option::Option(const std::string& fullName, const std::string& shortName, const std::string& description, bool required, const std::string& argName, bool argRequired):
- _shortName(shortName),
- _fullName(fullName),
- _description(description),
- _required(required),
- _repeatable(false),
- _argName(argName),
- _argRequired(argRequired),
- _pValidator(0),
- _pCallback(0),
- _pConfig(0)
-{
-}
-
-
-Option::~Option()
-{
- if (_pValidator) _pValidator->release();
- if (_pConfig) _pConfig->release();
- delete _pCallback;
-}
-
-
-Option& Option::operator = (const Option& option)
-{
- if (&option != this)
- {
- Option tmp(option);
- swap(tmp);
- }
- return *this;
-}
-
-
-void Option::swap(Option& option)
-{
- std::swap(_shortName, option._shortName);
- std::swap(_fullName, option._fullName);
- std::swap(_description, option._description);
- std::swap(_required, option._required);
- std::swap(_repeatable, option._repeatable);
- std::swap(_argName, option._argName);
- std::swap(_argRequired, option._argRequired);
- std::swap(_group, option._group);
- std::swap(_binding, option._binding);
- std::swap(_pValidator, option._pValidator);
- std::swap(_pCallback, option._pCallback);
- std::swap(_pConfig, option._pConfig);
-}
-
-
-Option& Option::shortName(const std::string& name)
-{
- _shortName = name;
- return *this;
-}
-
-
-Option& Option::fullName(const std::string& name)
-{
- _fullName = name;
- return *this;
-}
-
-
-Option& Option::description(const std::string& text)
-{
- _description = text;
- return *this;
-}
-
-
-Option& Option::required(bool flag)
-{
- _required = flag;
- return *this;
-}
-
-
-Option& Option::repeatable(bool flag)
-{
- _repeatable = flag;
- return *this;
-}
-
-
-Option& Option::argument(const std::string& name, bool required)
-{
- _argName = name;
- _argRequired = required;
- return *this;
-}
-
-
-Option& Option::noArgument()
-{
- _argName.clear();
- _argRequired = false;
- return *this;
-}
-
-
-Option& Option::group(const std::string& group)
-{
- _group = group;
- return *this;
-}
-
-
-Option& Option::binding(const std::string& propertyName)
-{
- return binding(propertyName, 0);
-}
-
-
-Option& Option::binding(const std::string& propertyName, AbstractConfiguration* pConfig)
-{
- _binding = propertyName;
- if (_pConfig) _pConfig->release();
- _pConfig = pConfig;
- if (_pConfig) _pConfig->duplicate();
- return *this;
-}
-
-
-Option& Option::callback(const AbstractOptionCallback& cb)
-{
- _pCallback = cb.clone();
- return *this;
-}
-
-
-Option& Option::validator(Validator* pValidator)
-{
- if (_pValidator) _pValidator->release();
- _pValidator = pValidator;
- return *this;
-}
-
-
-bool Option::matchesShort(const std::string& option) const
-{
- return option.length() > 0
- && !_shortName.empty() && option.compare(0, _shortName.length(), _shortName) == 0;
-}
-
-
-bool Option::matchesFull(const std::string& option) const
-{
- std::string::size_type pos = option.find_first_of(":=");
- std::string::size_type len = pos == std::string::npos ? option.length() : pos;
- return len == _fullName.length()
- && icompare(option, 0, len, _fullName, 0, len) == 0;
-}
-
-
-bool Option::matchesPartial(const std::string& option) const
-{
- std::string::size_type pos = option.find_first_of(":=");
- std::string::size_type len = pos == std::string::npos ? option.length() : pos;
- return option.length() > 0
- && icompare(option, 0, len, _fullName, 0, len) == 0;
-}
-
-
-void Option::process(const std::string& option, std::string& arg) const
-{
- std::string::size_type pos = option.find_first_of(":=");
- std::string::size_type len = pos == std::string::npos ? option.length() : pos;
- if (icompare(option, 0, len, _fullName, 0, len) == 0)
- {
- if (takesArgument())
- {
- if (argumentRequired() && pos == std::string::npos)
- throw MissingArgumentException(_fullName + " requires " + argumentName());
- if (pos != std::string::npos)
- arg.assign(option, pos + 1, option.length() - pos - 1);
- else
- arg.clear();
- }
- else if (pos != std::string::npos)
- {
- throw UnexpectedArgumentException(option);
- }
- else arg.clear();
- }
- else if (!_shortName.empty() && option.compare(0, _shortName.length(), _shortName) == 0)
- {
- if (takesArgument())
- {
- if (argumentRequired() && option.length() == _shortName.length())
- throw MissingArgumentException(_shortName + " requires " + argumentName());
- arg.assign(option, _shortName.length(), option.length() - _shortName.length());
- }
- else if (option.length() != _shortName.length())
- {
- throw UnexpectedArgumentException(option);
- }
- else arg.clear();
- }
- else throw UnknownOptionException(option);
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/OptionCallback.cpp b/Utilities/Poco/Util/src/OptionCallback.cpp
deleted file mode 100755
index 01f23374ae..0000000000
--- a/Utilities/Poco/Util/src/OptionCallback.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// OptionCallback.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: OptionCallback
-//
-// Copyright (c) 2006, 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/OptionCallback.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-AbstractOptionCallback::AbstractOptionCallback()
-{
-}
-
-
-AbstractOptionCallback::AbstractOptionCallback(const AbstractOptionCallback&)
-{
-}
-
-
-AbstractOptionCallback::~AbstractOptionCallback()
-{
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/OptionException.cpp b/Utilities/Poco/Util/src/OptionException.cpp
deleted file mode 100755
index bf7799a9a8..0000000000
--- a/Utilities/Poco/Util/src/OptionException.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// OptionException.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: OptionException
-//
-// Copyright (c) 2004-2006, 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/OptionException.h"
-#include <typeinfo>
-
-
-namespace Poco {
-namespace Util {
-
-
-POCO_IMPLEMENT_EXCEPTION(OptionException, Poco::DataException, "Option exception")
-POCO_IMPLEMENT_EXCEPTION(UnknownOptionException, OptionException, "Unknown option specified")
-POCO_IMPLEMENT_EXCEPTION(AmbiguousOptionException, OptionException, "Ambiguous option specified")
-POCO_IMPLEMENT_EXCEPTION(MissingOptionException, OptionException, "Required option not specified")
-POCO_IMPLEMENT_EXCEPTION(MissingArgumentException, OptionException, "Missing option argument")
-POCO_IMPLEMENT_EXCEPTION(InvalidArgumentException, OptionException, "Invalid option argument")
-POCO_IMPLEMENT_EXCEPTION(UnexpectedArgumentException, OptionException, "Unexpected option argument")
-POCO_IMPLEMENT_EXCEPTION(IncompatibleOptionsException, OptionException, "Incompatible options")
-POCO_IMPLEMENT_EXCEPTION(DuplicateOptionException, OptionException, "Option must not be given more than once")
-POCO_IMPLEMENT_EXCEPTION(EmptyOptionException, OptionException, "Empty option specified")
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/OptionProcessor.cpp b/Utilities/Poco/Util/src/OptionProcessor.cpp
deleted file mode 100755
index a389342c66..0000000000
--- a/Utilities/Poco/Util/src/OptionProcessor.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// OptionProcessor.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: OptionProcessor
-//
-// Copyright (c) 2004-2006, 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/OptionProcessor.h"
-#include "Poco/Util/OptionSet.h"
-#include "Poco/Util/Option.h"
-#include "Poco/Util/OptionException.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-OptionProcessor::OptionProcessor(const OptionSet& options):
- _options(options),
- _unixStyle(true),
- _ignore(false)
-{
-}
-
-
-OptionProcessor::~OptionProcessor()
-{
-}
-
-
-void OptionProcessor::setUnixStyle(bool flag)
-{
- _unixStyle = flag;
-}
-
-
-bool OptionProcessor::process(const std::string& argument, std::string& optionName, std::string& optionArg)
-{
- if (!_ignore)
- {
- if (_unixStyle)
- return processUnix(argument, optionName, optionArg);
- else
- return processDefault(argument, optionName, optionArg);
- }
- return false;
-}
-
-
-void OptionProcessor::checkRequired() const
-{
- for (OptionSet::Iterator it = _options.begin(); it != _options.end(); ++it)
- {
- if (it->required() && _specifiedOptions.find(it->fullName()) == _specifiedOptions.end())
- throw MissingOptionException(it->fullName());
- }
-}
-
-
-bool OptionProcessor::processUnix(const std::string& argument, std::string& optionName, std::string& optionArg)
-{
- std::string::const_iterator it = argument.begin();
- std::string::const_iterator end = argument.end();
- if (it != end)
- {
- if (*it == '-')
- {
- ++it;
- if (it != end)
- {
- if (*it == '-')
- {
- ++it;
- if (it == end)
- {
- _ignore = true;
- return true;
- }
- else return processCommon(std::string(it, end), false, optionName, optionArg);
- }
- else return processCommon(std::string(it, end), true, optionName, optionArg);
- }
- }
- }
- return false;
-}
-
-
-bool OptionProcessor::processDefault(const std::string& argument, std::string& optionName, std::string& optionArg)
-{
- std::string::const_iterator it = argument.begin();
- std::string::const_iterator end = argument.end();
- if (it != end)
- {
- if (*it == '/')
- {
- ++it;
- return processCommon(std::string(it, end), false, optionName, optionArg);
- }
- }
- return false;
-}
-
-
-bool OptionProcessor::processCommon(const std::string& optionStr, bool isShort, std::string& optionName, std::string& optionArg)
-{
- if (optionStr.empty()) throw EmptyOptionException();
- const Option& option = _options.getOption(optionStr, isShort);
- const std::string& group = option.group();
- if (!group.empty())
- {
- if (_groups.find(group) != _groups.end())
- throw IncompatibleOptionsException(option.fullName());
- else
- _groups.insert(group);
- }
- if (_specifiedOptions.find(option.fullName()) != _specifiedOptions.end() && !option.repeatable())
- throw DuplicateOptionException(option.fullName());
- _specifiedOptions.insert(option.fullName());
- option.process(optionStr, optionArg);
- optionName = option.fullName();
- return true;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/OptionSet.cpp b/Utilities/Poco/Util/src/OptionSet.cpp
deleted file mode 100755
index e8c0a12b7a..0000000000
--- a/Utilities/Poco/Util/src/OptionSet.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// OptionSet.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: OptionSet
-//
-// Copyright (c) 2004-2006, 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/OptionSet.h"
-#include "Poco/Util/OptionException.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-OptionSet::OptionSet()
-{
-}
-
-
-OptionSet::OptionSet(const OptionSet& options):
- _options(options._options)
-{
-}
-
-
-OptionSet::~OptionSet()
-{
-}
-
-
-OptionSet& OptionSet::operator = (const OptionSet& options)
-{
- if (&options != this)
- _options = options._options;
- return *this;
-}
-
-
-void OptionSet::addOption(const Option& option)
-{
- poco_assert (!option.fullName().empty());
- OptionVec::const_iterator it = _options.begin();
- OptionVec::const_iterator itEnd = _options.end();
- for (; it != itEnd; ++it)
- {
- if (it->fullName() == option.fullName())
- {
- throw DuplicateOptionException(it->fullName());
- }
- }
-
- _options.push_back(option);
-}
-
-
-bool OptionSet::hasOption(const std::string& name, bool matchShort) const
-{
- bool found = false;
- for (Iterator it = _options.begin(); it != _options.end(); ++it)
- {
- if ((matchShort && it->matchesShort(name)) || (!matchShort && it->matchesFull(name)))
- {
- if (!found)
- found = true;
- else
- return false;
- }
- }
- return found;
-}
-
-
-const Option& OptionSet::getOption(const std::string& name, bool matchShort) const
-{
- const Option* pOption = 0;
- for (Iterator it = _options.begin(); it != _options.end(); ++it)
- {
- if ((matchShort && it->matchesShort(name)) || (!matchShort && it->matchesPartial(name)))
- {
- if (!pOption)
- {
- pOption = &*it;
- if (!matchShort && it->matchesFull(name))
- break;
- }
- else if (!matchShort && it->matchesFull(name))
- {
- pOption = &*it;
- break;
- }
- else throw AmbiguousOptionException(name);
- }
- }
- if (pOption)
- return *pOption;
- else
- throw UnknownOptionException(name);
-}
-
-
-OptionSet::Iterator OptionSet::begin() const
-{
- return _options.begin();
-}
-
-
-OptionSet::Iterator OptionSet::end() const
-{
- return _options.end();
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/PropertyFileConfiguration.cpp b/Utilities/Poco/Util/src/PropertyFileConfiguration.cpp
deleted file mode 100755
index 97f936077f..0000000000
--- a/Utilities/Poco/Util/src/PropertyFileConfiguration.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-//
-// PropertyFileConfiguration.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: PropertyFileConfiguration
-//
-// Copyright (c) 2004-2009, 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/PropertyFileConfiguration.h"
-#include "Poco/Exception.h"
-#include "Poco/String.h"
-#include "Poco/Path.h"
-#include "Poco/FileStream.h"
-#include "Poco/LineEndingConverter.h"
-#include <cctype>
-
-
-using Poco::trim;
-using Poco::Path;
-
-
-namespace Poco {
-namespace Util {
-
-
-PropertyFileConfiguration::PropertyFileConfiguration()
-{
-}
-
-
-PropertyFileConfiguration::PropertyFileConfiguration(std::istream& istr)
-{
- load(istr);
-}
-
-
-PropertyFileConfiguration::PropertyFileConfiguration(const std::string& path)
-{
- load(path);
-}
-
-
-PropertyFileConfiguration::~PropertyFileConfiguration()
-{
-}
-
-
-void PropertyFileConfiguration::load(std::istream& istr)
-{
- clear();
- while (!istr.eof())
- {
- parseLine(istr);
- }
-}
-
-
-void PropertyFileConfiguration::load(const std::string& path)
-{
- Poco::FileInputStream istr(path);
- if (istr.good())
- load(istr);
- else
- throw Poco::OpenFileException(path);
-}
-
-
-void PropertyFileConfiguration::save(std::ostream& ostr) const
-{
- MapConfiguration::iterator it = begin();
- MapConfiguration::iterator ed = end();
- while (it != ed)
- {
- ostr << it->first << ": " << it->second << "\n";
- ++it;
- }
-}
-
-
-void PropertyFileConfiguration::save(const std::string& path) const
-{
- Poco::FileOutputStream ostr(path);
- if (ostr.good())
- {
- Poco::OutputLineEndingConverter lec(ostr);
- save(lec);
- lec.flush();
- ostr.flush();
- if (!ostr.good()) throw Poco::WriteFileException(path);
- }
- else throw Poco::CreateFileException(path);
-}
-
-
-void PropertyFileConfiguration::parseLine(std::istream& istr)
-{
- static const int eof = std::char_traits<char>::eof();
-
- int c = istr.get();
- while (c != eof && std::isspace((char) c)) c = istr.get();
- if (c != eof)
- {
- if (c == '#' || c == '!')
- {
- while (c != eof && c != '\n' && c != '\r') c = istr.get();
- }
- else
- {
- std::string key;
- while (c != eof && c != '=' && c != ':' && c != '\r' && c != '\n') { key += (char) c; c = istr.get(); }
- std::string value;
- if (c == '=' || c == ':')
- {
- c = readChar(istr);
- while (c != eof && c) { value += (char) c; c = readChar(istr); }
- }
- setRaw(trim(key), trim(value));
- }
- }
-}
-
-
-int PropertyFileConfiguration::readChar(std::istream& istr)
-{
- for (;;)
- {
- int c = istr.get();
- if (c == '\\')
- {
- c = istr.get();
- switch (c)
- {
- case 't':
- return '\t';
- case 'r':
- return '\r';
- case 'n':
- return '\n';
- case 'f':
- return '\f';
- case '\r':
- if (istr.peek() == '\n')
- istr.get();
- continue;
- case '\n':
- continue;
- default:
- return c;
- }
- }
- else if (c == '\n' || c == '\r')
- return 0;
- else
- return c;
- }
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/RegExpValidator.cpp b/Utilities/Poco/Util/src/RegExpValidator.cpp
deleted file mode 100755
index 5a50fc7702..0000000000
--- a/Utilities/Poco/Util/src/RegExpValidator.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// RegExpValidator.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: RegExpValidator
-//
-// Copyright (c) 2006, 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/RegExpValidator.h"
-#include "Poco/Util/Option.h"
-#include "Poco/Util/OptionException.h"
-#include "Poco/RegularExpression.h"
-#include "Poco/Format.h"
-
-
-using Poco::format;
-
-
-namespace Poco {
-namespace Util {
-
-
-RegExpValidator::RegExpValidator(const std::string& regexp):
- _regexp(regexp)
-{
-}
-
-
-RegExpValidator::~RegExpValidator()
-{
-}
-
-
-void RegExpValidator::validate(const Option& option, const std::string& value)
-{
- if (!RegularExpression::match(value, _regexp, RegularExpression::RE_ANCHORED | RegularExpression::RE_UTF8))
- throw InvalidArgumentException(format("argument for %s does not match regular expression %s", option.fullName(), _regexp));
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/ServerApplication.cpp b/Utilities/Poco/Util/src/ServerApplication.cpp
deleted file mode 100755
index 3a0b69a686..0000000000
--- a/Utilities/Poco/Util/src/ServerApplication.cpp
+++ /dev/null
@@ -1,610 +0,0 @@
-//
-// ServerApplication.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Application
-// Module: ServerApplication
-//
-// Copyright (c) 2004-2006, 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/ServerApplication.h"
-#include "Poco/Util/Option.h"
-#include "Poco/Util/OptionSet.h"
-#include "Poco/Exception.h"
-#include "Poco/Process.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/NamedEvent.h"
-#include "Poco/Logger.h"
-#if defined(POCO_OS_FAMILY_UNIX)
-#include "Poco/TemporaryFile.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <fstream>
-#elif defined(POCO_OS_FAMILY_WINDOWS)
-#include "Poco/Util/WinService.h"
-#include "Poco/UnWindows.h"
-#include <cstring>
-#endif
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
-#include "Poco/UnicodeConverter.h"
-#endif
-
-
-using Poco::NamedEvent;
-using Poco::Process;
-using Poco::NumberFormatter;
-using Poco::Exception;
-using Poco::SystemException;
-
-
-namespace Poco {
-namespace Util {
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-Poco::Event ServerApplication::_terminated;
-SERVICE_STATUS ServerApplication::_serviceStatus;
-SERVICE_STATUS_HANDLE ServerApplication::_serviceStatusHandle = 0;
-#endif
-
-
-ServerApplication::ServerApplication()
-{
-#if defined(POCO_OS_FAMILY_WINDOWS)
- _action = SRV_RUN;
- std::memset(&_serviceStatus, 0, sizeof(_serviceStatus));
-#endif
-}
-
-
-ServerApplication::~ServerApplication()
-{
-}
-
-
-bool ServerApplication::isInteractive() const
-{
- bool runsInBackground = config().getBool("application.runAsDaemon", false) || config().getBool("application.runAsService", false);
- return !runsInBackground;
-}
-
-
-int ServerApplication::run()
-{
- return Application::run();
-}
-
-
-void ServerApplication::terminate()
-{
- Process::requestTermination(Process::id());
-}
-
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
-
-
-//
-// Windows specific code
-//
-BOOL ServerApplication::ConsoleCtrlHandler(DWORD ctrlType)
-{
- switch (ctrlType)
- {
- case CTRL_C_EVENT:
- case CTRL_CLOSE_EVENT:
- case CTRL_BREAK_EVENT:
- terminate();
- return _terminated.tryWait(10000) ? TRUE : FALSE;
- default:
- return FALSE;
- }
-}
-
-
-void ServerApplication::ServiceControlHandler(DWORD control)
-{
- switch (control)
- {
- case SERVICE_CONTROL_STOP:
- case SERVICE_CONTROL_SHUTDOWN:
- terminate();
- _serviceStatus.dwCurrentState = SERVICE_STOP_PENDING;
- break;
- case SERVICE_CONTROL_INTERROGATE:
- break;
- }
- SetServiceStatus(_serviceStatusHandle, &_serviceStatus);
-}
-
-
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
-void ServerApplication::ServiceMain(DWORD argc, LPWSTR* argv)
-#else
-void ServerApplication::ServiceMain(DWORD argc, LPTSTR* argv)
-#endif
-{
- ServerApplication& app = static_cast<ServerApplication&>(Application::instance());
-
- app.config().setBool("application.runAsService", true);
-
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
- _serviceStatusHandle = RegisterServiceCtrlHandlerW(L"", ServiceControlHandler);
-#else
- _serviceStatusHandle = RegisterServiceCtrlHandler("", ServiceControlHandler);
-#endif
- if (!_serviceStatusHandle)
- throw SystemException("cannot register service control handler");
-
- _serviceStatus.dwServiceType = SERVICE_WIN32;
- _serviceStatus.dwCurrentState = SERVICE_START_PENDING;
- _serviceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
- _serviceStatus.dwWin32ExitCode = 0;
- _serviceStatus.dwServiceSpecificExitCode = 0;
- _serviceStatus.dwCheckPoint = 0;
- _serviceStatus.dwWaitHint = 0;
- SetServiceStatus(_serviceStatusHandle, &_serviceStatus);
-
- try
- {
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
- std::vector<std::string> args;
- for (DWORD i = 0; i < argc; ++i)
- {
- std::string arg;
- Poco::UnicodeConverter::toUTF8(argv[i], arg);
- args.push_back(arg);
- }
- app.init(args);
-#else
- app.init(argc, argv);
-#endif
- _serviceStatus.dwCurrentState = SERVICE_RUNNING;
- SetServiceStatus(_serviceStatusHandle, &_serviceStatus);
- int rc = app.run();
- _serviceStatus.dwWin32ExitCode = rc ? ERROR_SERVICE_SPECIFIC_ERROR : 0;
- _serviceStatus.dwServiceSpecificExitCode = rc;
- }
- catch (Exception& exc)
- {
- app.logger().log(exc);
- _serviceStatus.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR;
- _serviceStatus.dwServiceSpecificExitCode = EXIT_CONFIG;
- }
- catch (...)
- {
- app.logger().error("fatal error - aborting");
- _serviceStatus.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR;
- _serviceStatus.dwServiceSpecificExitCode = EXIT_SOFTWARE;
- }
- try
- {
- app.uninitialize();
- }
- catch (...)
- {
- }
- _serviceStatus.dwCurrentState = SERVICE_STOPPED;
- SetServiceStatus(_serviceStatusHandle, &_serviceStatus);
-}
-
-
-void ServerApplication::waitForTerminationRequest()
-{
- SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE);
- std::string evName("POCOTRM");
- NumberFormatter::appendHex(evName, Process::id(), 8);
- NamedEvent ev(evName);
- ev.wait();
- _terminated.set();
-}
-
-
-int ServerApplication::run(int argc, char** argv)
-{
- if (!hasConsole() && isService())
- {
- return 0;
- }
- else
- {
- int rc = EXIT_OK;
- try
- {
- init(argc, argv);
- switch (_action)
- {
- case SRV_REGISTER:
- registerService();
- rc = EXIT_OK;
- break;
- case SRV_UNREGISTER:
- unregisterService();
- rc = EXIT_OK;
- break;
- default:
- rc = run();
- uninitialize();
- }
- }
- catch (Exception& exc)
- {
- logger().log(exc);
- rc = EXIT_SOFTWARE;
- }
- return rc;
- }
-}
-
-
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
-int ServerApplication::run(int argc, wchar_t** argv)
-{
- if (!hasConsole() && isService())
- {
- return 0;
- }
- else
- {
- int rc = EXIT_OK;
- try
- {
- init(argc, argv);
- switch (_action)
- {
- case SRV_REGISTER:
- registerService();
- rc = EXIT_OK;
- break;
- case SRV_UNREGISTER:
- unregisterService();
- rc = EXIT_OK;
- break;
- default:
- rc = run();
- uninitialize();
- }
- }
- catch (Exception& exc)
- {
- logger().log(exc);
- rc = EXIT_SOFTWARE;
- }
- return rc;
- }
-}
-#endif
-
-
-bool ServerApplication::isService()
-{
-#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
- SERVICE_TABLE_ENTRYW svcDispatchTable[2];
- svcDispatchTable[0].lpServiceName = L"";
- svcDispatchTable[0].lpServiceProc = ServiceMain;
- svcDispatchTable[1].lpServiceName = NULL;
- svcDispatchTable[1].lpServiceProc = NULL;
- return StartServiceCtrlDispatcherW(svcDispatchTable) != 0;
-#else
- SERVICE_TABLE_ENTRY svcDispatchTable[2];
- svcDispatchTable[0].lpServiceName = "";
- svcDispatchTable[0].lpServiceProc = ServiceMain;
- svcDispatchTable[1].lpServiceName = NULL;
- svcDispatchTable[1].lpServiceProc = NULL;
- return StartServiceCtrlDispatcher(svcDispatchTable) != 0;
-#endif
-}
-
-
-bool ServerApplication::hasConsole()
-{
- HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
- return hStdOut != INVALID_HANDLE_VALUE && hStdOut != NULL;
-}
-
-
-void ServerApplication::registerService()
-{
- std::string name = config().getString("application.baseName");
- std::string path = config().getString("application.path");
-
- WinService service(name);
- if (_displayName.empty())
- service.registerService(path);
- else
- service.registerService(path, _displayName);
- logger().information("The application has been successfully registered as a service");
-}
-
-
-void ServerApplication::unregisterService()
-{
- std::string name = config().getString("application.baseName");
-
- WinService service(name);
- service.unregisterService();
- logger().information("The service has been successfully unregistered");
-}
-
-
-void ServerApplication::defineOptions(OptionSet& options)
-{
- Application::defineOptions(options);
-
- options.addOption(
- Option("registerService", "", "register application as a service")
- .required(false)
- .repeatable(false));
-
- options.addOption(
- Option("unregisterService", "", "unregister application as a service")
- .required(false)
- .repeatable(false));
-
- options.addOption(
- Option("displayName", "", "specify a display name for the service (only with /registerService)")
- .required(false)
- .repeatable(false)
- .argument("name"));
-}
-
-
-void ServerApplication::handleOption(const std::string& name, const std::string& value)
-{
- if (name == "registerService")
- _action = SRV_REGISTER;
- else if (name == "unregisterService")
- _action = SRV_UNREGISTER;
- else if (name == "displayName")
- _displayName = value;
- else
- Application::handleOption(name, value);
-}
-
-
-#elif defined(POCO_OS_FAMILY_UNIX)
-
-
-//
-// Unix specific code
-//
-void ServerApplication::waitForTerminationRequest()
-{
- sigset_t sset;
- sigemptyset(&sset);
- sigaddset(&sset, SIGINT);
- sigaddset(&sset, SIGQUIT);
- sigaddset(&sset, SIGTERM);
- sigprocmask(SIG_BLOCK, &sset, NULL);
- int sig;
- sigwait(&sset, &sig);
-}
-
-
-int ServerApplication::run(int argc, char** argv)
-{
- bool runAsDaemon = isDaemon(argc, argv);
- if (runAsDaemon)
- {
- beDaemon();
- }
- try
- {
- init(argc, argv);
- if (runAsDaemon)
- {
- int rc = chdir("/");
- if (rc != 0) return EXIT_OSERR;
- }
- }
- catch (Exception& exc)
- {
- logger().log(exc);
- return EXIT_CONFIG;
- }
- int rc = run();
- try
- {
- uninitialize();
- }
- catch (Exception& exc)
- {
- logger().log(exc);
- rc = EXIT_CONFIG;
- }
- return rc;
-}
-
-
-bool ServerApplication::isDaemon(int argc, char** argv)
-{
- std::string option("--daemon");
- for (int i = 1; i < argc; ++i)
- {
- if (option == argv[i])
- return true;
- }
- return false;
-}
-
-
-void ServerApplication::beDaemon()
-{
- pid_t pid;
- if ((pid = fork()) < 0)
- throw SystemException("cannot fork daemon process");
- else if (pid != 0)
- exit(0);
-
- setsid();
- umask(0);
-
- // attach stdin, stdout, stderr to /dev/null
- // instead of just closing them. This avoids
- // issues with third party/legacy code writing
- // stuff to stdout/stderr.
- FILE* fin = freopen("/dev/null", "r+", stdin);
- if (!fin) throw Poco::OpenFileException("Cannot attach stdin to /dev/null");
- FILE* fout = freopen("/dev/null", "r+", stdout);
- if (!fout) throw Poco::OpenFileException("Cannot attach stdout to /dev/null");
- FILE* ferr = freopen("/dev/null", "r+", stderr);
- if (!ferr) throw Poco::OpenFileException("Cannot attach stderr to /dev/null");
-}
-
-
-void ServerApplication::defineOptions(OptionSet& options)
-{
- Application::defineOptions(options);
-
- options.addOption(
- Option("daemon", "", "run application as a daemon")
- .required(false)
- .repeatable(false));
-
- options.addOption(
- Option("pidfile", "", "write PID to given file")
- .required(false)
- .repeatable(false)
- .argument("path"));
-}
-
-
-void ServerApplication::handleOption(const std::string& name, const std::string& value)
-{
- if (name == "daemon")
- {
- config().setBool("application.runAsDaemon", true);
- }
- else if (name == "pidfile")
- {
- std::ofstream ostr(value.c_str());
- if (ostr.good())
- ostr << Poco::Process::id() << std::endl;
- else
- throw Poco::CreateFileException("Cannot write PID to file", value);
- Poco::TemporaryFile::registerForDeletion(value);
- }
- else Application::handleOption(name, value);
-}
-
-
-#elif defined(POCO_OS_FAMILY_VMS)
-
-
-//
-// VMS specific code
-//
-namespace
-{
- static void handleSignal(int sig)
- {
- ServerApplication::terminate();
- }
-}
-
-
-void ServerApplication::waitForTerminationRequest()
-{
- struct sigaction handler;
- handler.sa_handler = handleSignal;
- handler.sa_flags = 0;
- sigemptyset(&handler.sa_mask);
- sigaction(SIGINT, &handler, NULL);
- sigaction(SIGQUIT, &handler, NULL);
-
- long ctrlY = LIB$M_CLI_CTRLY;
- unsigned short ioChan;
- $DESCRIPTOR(ttDsc, "TT:");
-
- lib$disable_ctrl(&ctrlY);
- sys$assign(&ttDsc, &ioChan, 0, 0);
- sys$qiow(0, ioChan, IO$_SETMODE | IO$M_CTRLYAST, 0, 0, 0, terminate, 0, 0, 0, 0, 0);
- sys$qiow(0, ioChan, IO$_SETMODE | IO$M_CTRLCAST, 0, 0, 0, terminate, 0, 0, 0, 0, 0);
-
- std::string evName("POCOTRM");
- NumberFormatter::appendHex(evName, Process::id(), 8);
- NamedEvent ev(evName);
- try
- {
- ev.wait();
- }
- catch (...)
- {
- // CTRL-C will cause an exception to be raised
- }
- sys$dassgn(ioChan);
- lib$enable_ctrl(&ctrlY);
-}
-
-
-int ServerApplication::run(int argc, char** argv)
-{
- try
- {
- init(argc, argv);
- }
- catch (Exception& exc)
- {
- logger().log(exc);
- return EXIT_CONFIG;
- }
- int rc = run();
- try
- {
- uninitialize();
- }
- catch (Exception& exc)
- {
- logger().log(exc);
- rc = EXIT_CONFIG;
- }
- return rc;
-}
-
-
-void ServerApplication::defineOptions(OptionSet& options)
-{
- Application::defineOptions(options);
-}
-
-
-void ServerApplication::handleOption(const std::string& name, const std::string& value)
-{
- Application::handleOption(name, value);
-}
-
-
-#endif
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/Subsystem.cpp b/Utilities/Poco/Util/src/Subsystem.cpp
deleted file mode 100755
index 62dd335fa4..0000000000
--- a/Utilities/Poco/Util/src/Subsystem.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// Subsystem.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Application
-// Module: Subsystem
-//
-// Copyright (c) 2004-2006, 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/Subsystem.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-Subsystem::Subsystem()
-{
-}
-
-
-Subsystem::~Subsystem()
-{
-}
-
-
-void Subsystem::reinitialize(Application& app)
-{
- uninitialize();
- initialize(app);
-}
-
-
-void Subsystem::defineOptions(OptionSet& options)
-{
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/SystemConfiguration.cpp b/Utilities/Poco/Util/src/SystemConfiguration.cpp
deleted file mode 100755
index fb89471c47..0000000000
--- a/Utilities/Poco/Util/src/SystemConfiguration.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// SystemConfiguration.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: SystemConfiguration
-//
-// Copyright (c) 2004-2006, 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/SystemConfiguration.h"
-#include "Poco/Environment.h"
-#include "Poco/Path.h"
-#include "Poco/DateTime.h"
-#include "Poco/DateTimeFormatter.h"
-#include "Poco/DateTimeFormat.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/Process.h"
-#include "Poco/Exception.h"
-
-
-using Poco::Environment;
-using Poco::Path;
-
-
-namespace Poco {
-namespace Util {
-
-
-const std::string SystemConfiguration::OSNAME = "system.osName";
-const std::string SystemConfiguration::OSVERSION = "system.osVersion";
-const std::string SystemConfiguration::OSARCHITECTURE = "system.osArchitecture";
-const std::string SystemConfiguration::NODENAME = "system.nodeName";
-const std::string SystemConfiguration::CURRENTDIR = "system.currentDir";
-const std::string SystemConfiguration::HOMEDIR = "system.homeDir";
-const std::string SystemConfiguration::TEMPDIR = "system.tempDir";
-const std::string SystemConfiguration::DATETIME = "system.dateTime";
-const std::string SystemConfiguration::PID = "system.pid";
-const std::string SystemConfiguration::ENV = "system.env.";
-
-
-SystemConfiguration::SystemConfiguration()
-{
-}
-
-
-SystemConfiguration::~SystemConfiguration()
-{
-}
-
-
-bool SystemConfiguration::getRaw(const std::string& key, std::string& value) const
-{
- if (key == OSNAME)
- value = Environment::osName();
- else if (key == OSVERSION)
- value = Environment::osVersion();
- else if (key == OSARCHITECTURE)
- value = Environment::osArchitecture();
- else if (key == NODENAME)
- value = Environment::nodeName();
- else if (key == CURRENTDIR)
- value = Path::current();
- else if (key == HOMEDIR)
- value = Path::home();
- else if (key == TEMPDIR)
- value = Path::temp();
- else if (key == DATETIME)
- value = Poco::DateTimeFormatter::format(Poco::DateTime(), Poco::DateTimeFormat::ISO8601_FORMAT);
- else if (key == PID)
- value = Poco::NumberFormatter::format(Poco::Process::id());
- else if (key.compare(0, ENV.size(), ENV) == 0)
- return getEnv(key.substr(ENV.size()), value);
- else
- return false;
- return true;
-}
-
-
-void SystemConfiguration::setRaw(const std::string& key, const std::string& value)
-{
- throw Poco::InvalidAccessException("Attempt to modify a system property", key);
-}
-
-
-void SystemConfiguration::enumerate(const std::string& key, Keys& range) const
-{
- if (key.empty())
- {
- range.push_back("system");
- }
- else if (key == "system")
- {
- range.push_back("osName");
- range.push_back("osVersion");
- range.push_back("osArchitecture");
- range.push_back("nodeName");
- range.push_back("currentDir");
- range.push_back("homeDir");
- range.push_back("tempDir");
- range.push_back("dateTime");
- range.push_back("pid");
- range.push_back("env");
- }
-}
-
-
-bool SystemConfiguration::getEnv(const std::string& name, std::string& value)
-{
- if (Environment::has(name))
- {
- value = Environment::get(name);
- return true;
- }
- return false;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/Timer.cpp b/Utilities/Poco/Util/src/Timer.cpp
deleted file mode 100644
index 017108be60..0000000000
--- a/Utilities/Poco/Util/src/Timer.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-//
-// Timer.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Timer
-// Module: Timer
-//
-// Copyright (c) 2009, 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/Timer.h"
-#include "Poco/Notification.h"
-#include "Poco/ErrorHandler.h"
-
-
-using Poco::ErrorHandler;
-
-
-namespace Poco {
-namespace Util {
-
-
-class TimerNotification: public Poco::Notification
-{
-public:
- TimerNotification(Poco::TimedNotificationQueue& queue):
- _queue(queue)
- {
- }
-
- ~TimerNotification()
- {
- }
-
- virtual bool execute() = 0;
-
- Poco::TimedNotificationQueue& queue()
- {
- return _queue;
- }
-
-private:
- Poco::TimedNotificationQueue& _queue;
-};
-
-
-class StopNotification: public TimerNotification
-{
-public:
- StopNotification(Poco::TimedNotificationQueue& queue):
- TimerNotification(queue)
- {
- }
-
- ~StopNotification()
- {
- }
-
- bool execute()
- {
- queue().clear();
- return false;
- }
-};
-
-
-class CancelNotification: public TimerNotification
-{
-public:
- CancelNotification(Poco::TimedNotificationQueue& queue):
- TimerNotification(queue)
- {
- }
-
- ~CancelNotification()
- {
- }
-
- bool execute()
- {
- queue().clear();
- return true;
- }
-};
-
-
-class TaskNotification: public TimerNotification
-{
-public:
- TaskNotification(Poco::TimedNotificationQueue& queue, TimerTask::Ptr pTask):
- TimerNotification(queue),
- _pTask(pTask)
- {
- }
-
- ~TaskNotification()
- {
- }
-
- TimerTask::Ptr task()
- {
- return _pTask;
- }
-
- bool execute()
- {
- if (!_pTask->isCancelled())
- {
- try
- {
- _pTask->_lastExecution.update();
- _pTask->run();
- }
- catch (Exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (std::exception& exc)
- {
- ErrorHandler::handle(exc);
- }
- catch (...)
- {
- ErrorHandler::handle();
- }
- }
- return true;
- }
-
-private:
- TimerTask::Ptr _pTask;
-};
-
-
-class PeriodicTaskNotification: public TaskNotification
-{
-public:
- PeriodicTaskNotification(Poco::TimedNotificationQueue& queue, TimerTask::Ptr pTask, long interval):
- TaskNotification(queue, pTask),
- _interval(interval)
- {
- }
-
- ~PeriodicTaskNotification()
- {
- }
-
- bool execute()
- {
- TaskNotification::execute();
-
- if (!task()->isCancelled())
- {
- Poco::Timestamp nextExecution;
- nextExecution += _interval*1000;
- queue().enqueueNotification(this, nextExecution);
- duplicate();
- }
- return true;
- }
-
-private:
- long _interval;
-};
-
-
-class FixedRateTaskNotification: public TaskNotification
-{
-public:
- FixedRateTaskNotification(Poco::TimedNotificationQueue& queue, TimerTask::Ptr pTask, long interval):
- TaskNotification(queue, pTask),
- _interval(interval)
- {
- }
-
- ~FixedRateTaskNotification()
- {
- }
-
- bool execute()
- {
- TaskNotification::execute();
-
- if (!task()->isCancelled())
- {
- Poco::Timestamp nextExecution(task()->lastExecution());
- nextExecution += _interval*1000;
- queue().enqueueNotification(this, nextExecution);
- duplicate();
- }
- return true;
- }
-
-private:
- long _interval;
-};
-
-
-Timer::Timer()
-{
- _thread.start(*this);
-}
-
-
-Timer::Timer(Poco::Thread::Priority priority)
-{
- _thread.setPriority(priority);
- _thread.start(*this);
-}
-
-
-Timer::~Timer()
-{
- Poco::Timestamp now;
- _queue.enqueueNotification(new StopNotification(_queue), now);
- _thread.join();
-}
-
-
-void Timer::cancel()
-{
- Poco::Timestamp now;
- _queue.enqueueNotification(new CancelNotification(_queue), now);
-}
-
-
-void Timer::schedule(TimerTask::Ptr pTask, Poco::Timestamp time)
-{
- _queue.enqueueNotification(new TaskNotification(_queue, pTask), time);
-}
-
-
-void Timer::schedule(TimerTask::Ptr pTask, long delay, long interval)
-{
- Poco::Timestamp time;
- time += delay*1000;
- schedule(pTask, time, interval);
-}
-
-
-void Timer::schedule(TimerTask::Ptr pTask, Poco::Timestamp time, long interval)
-{
- _queue.enqueueNotification(new PeriodicTaskNotification(_queue, pTask, interval), time);
-}
-
-
-void Timer::scheduleAtFixedRate(TimerTask::Ptr pTask, long delay, long interval)
-{
- Poco::Timestamp time;
- time += delay*1000;
- scheduleAtFixedRate(pTask, time, interval);
-}
-
-
-void Timer::scheduleAtFixedRate(TimerTask::Ptr pTask, Poco::Timestamp time, long interval)
-{
- _queue.enqueueNotification(new FixedRateTaskNotification(_queue, pTask, interval), time);
-}
-
-
-void Timer::run()
-{
- bool cont = true;
- while (cont)
- {
- Poco::AutoPtr<TimerNotification> pNf = static_cast<TimerNotification*>(_queue.waitDequeueNotification());
- cont = pNf->execute();
- }
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/TimerTask.cpp b/Utilities/Poco/Util/src/TimerTask.cpp
deleted file mode 100644
index f7c70596b2..0000000000
--- a/Utilities/Poco/Util/src/TimerTask.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// TimerTask.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Timer
-// Module: TimerTask
-//
-// Copyright (c) 2009, 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/TimerTask.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-TimerTask::TimerTask():
- _lastExecution(0),
- _isCancelled(false)
-{
-}
-
-
-TimerTask::~TimerTask()
-{
-}
-
-
-void TimerTask::cancel()
-{
- _isCancelled = true;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/Validator.cpp b/Utilities/Poco/Util/src/Validator.cpp
deleted file mode 100755
index 98efef373e..0000000000
--- a/Utilities/Poco/Util/src/Validator.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// Validator.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Options
-// Module: Validator
-//
-// Copyright (c) 2006, 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/Validator.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-Validator::Validator()
-{
-}
-
-
-Validator::~Validator()
-{
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/WinRegistryConfiguration.cpp b/Utilities/Poco/Util/src/WinRegistryConfiguration.cpp
deleted file mode 100755
index 259226a8e2..0000000000
--- a/Utilities/Poco/Util/src/WinRegistryConfiguration.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// WinRegistryConfiguration.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Windows
-// Module: WinRegistryConfiguration
-//
-// Copyright (c) 2006, 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/WinRegistryConfiguration.h"
-#include "Poco/Util/WinRegistryKey.h"
-#include "Poco/NumberFormatter.h"
-#include "Poco/NumberParser.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-WinRegistryConfiguration::WinRegistryConfiguration(const std::string& rootPath): _rootPath(rootPath)
-{
- // rootPath must end with backslash
- std::string::iterator it = _rootPath.end();
- if (*(--it) != '\\')
- _rootPath.append("\\");
-}
-
-
-WinRegistryConfiguration::~WinRegistryConfiguration()
-{
-}
-
-
-bool WinRegistryConfiguration::getRaw(const std::string& key, std::string& value) const
-{
- std::string keyName;
- std::string fullPath = _rootPath + ConvertToRegFormat(key, keyName);
- WinRegistryKey aKey(fullPath, true);
- bool exists = aKey.exists(keyName);
- if (exists)
- {
- WinRegistryKey::Type type = aKey.type(keyName);
-
- switch (type)
- {
- case WinRegistryKey::REGT_STRING:
- value = aKey.getString(keyName);
- break;
- case WinRegistryKey::REGT_STRING_EXPAND:
- value = aKey.getStringExpand(keyName);
- break;
- case WinRegistryKey::REGT_DWORD:
- value = Poco::NumberFormatter::format(aKey.getInt(keyName));
- break;
- default:
- exists = false;
- }
- }
- return exists;
-}
-
-
-void WinRegistryConfiguration::setRaw(const std::string& key, const std::string& value)
-{
- std::string keyName;
- std::string fullPath = _rootPath+ConvertToRegFormat(key, keyName);
- WinRegistryKey aKey(fullPath);
- aKey.setString(keyName, value);
-}
-
-
-void WinRegistryConfiguration::enumerate(const std::string& key, Keys& range) const
-{
- if (key.empty())
- {
- // return all root level keys
- range.push_back("HKEY_CLASSES_ROOT");
- range.push_back("HKEY_CURRENT_CONFIG");
- range.push_back("HKEY_CURRENT_USER");
- range.push_back("HKEY_LOCAL_MACHINE");
- range.push_back("HKEY_PERFORMANCE_DATA");
- range.push_back("HKEY_USERS");
- }
- else
- {
- std::string keyName;
- std::string fullPath = _rootPath+ConvertToRegFormat(key, keyName);
- WinRegistryKey aKey(fullPath, true);
- aKey.values(range);
- aKey.subKeys(range);
- }
-}
-
-
-std::string WinRegistryConfiguration::ConvertToRegFormat(const std::string& key, std::string& value) const
-{
- std::size_t pos = key.rfind('.');
- if (pos == std::string::npos)
- {
- value = key;
- return std::string();
- }
- std::string prefix(key.substr(0,pos));
- value = key.substr(pos+1);
- Poco::translateInPlace(prefix, ".", "\\");
- return prefix;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/WinRegistryKey.cpp b/Utilities/Poco/Util/src/WinRegistryKey.cpp
deleted file mode 100755
index 3b34c3a63d..0000000000
--- a/Utilities/Poco/Util/src/WinRegistryKey.cpp
+++ /dev/null
@@ -1,531 +0,0 @@
-//
-// WinRegistryKey.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Windows
-// Module: WinRegistryKey
-//
-// Copyright (c) 2004-2006, 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/WinRegistryKey.h"
-#include "Poco/Exception.h"
-#if defined(POCO_WIN32_UTF8)
-#include "Poco/UnicodeConverter.h"
-#endif
-
-
-using Poco::SystemException;
-using Poco::NotFoundException;
-using Poco::InvalidArgumentException;
-
-
-namespace Poco {
-namespace Util {
-
-
-WinRegistryKey::WinRegistryKey(const std::string& key, bool readOnly):
- _hKey(0),
- _readOnly(readOnly)
-{
- std::string::size_type pos = key.find('\\');
- if (pos != std::string::npos)
- {
- std::string rootKey = key.substr(0, pos);
- _hRootKey = handleFor(rootKey);
- _subKey = key.substr(pos + 1);
- }
- else throw InvalidArgumentException("Not a valid registry key", key);
-}
-
-
-WinRegistryKey::WinRegistryKey(HKEY hRootKey, const std::string& subKey, bool readOnly):
- _hRootKey(hRootKey),
- _subKey(subKey),
- _hKey(0),
- _readOnly(readOnly)
-{
-}
-
-
-WinRegistryKey::~WinRegistryKey()
-{
- close();
-}
-
-
-void WinRegistryKey::setString(const std::string& name, const std::string& value)
-{
- open();
-#if defined(POCO_WIN32_UTF8)
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(name, uname);
- std::wstring uvalue;
- Poco::UnicodeConverter::toUTF16(value, uvalue);
- if (RegSetValueExW(_hKey, uname.c_str(), 0, REG_SZ, (CONST BYTE*) uvalue.c_str(), (DWORD) (uvalue.size() + 1)*sizeof(wchar_t)) != ERROR_SUCCESS)
- handleSetError(name);
-#else
- if (RegSetValueEx(_hKey, name.c_str(), 0, REG_SZ, (CONST BYTE*) value.c_str(), (DWORD) value.size() + 1) != ERROR_SUCCESS)
- handleSetError(name);
-#endif
-}
-
-
-std::string WinRegistryKey::getString(const std::string& name)
-{
- open();
- DWORD type;
- DWORD size;
-#if defined(POCO_WIN32_UTF8)
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(name, uname);
- if (RegQueryValueExW(_hKey, uname.c_str(), NULL, &type, NULL, &size) != ERROR_SUCCESS || type != REG_SZ && type != REG_EXPAND_SZ)
- throw NotFoundException(key(name));
- if (size > 0)
- {
- DWORD len = size/2;
- wchar_t* buffer = new wchar_t[len + 1];
- RegQueryValueExW(_hKey, uname.c_str(), NULL, NULL, (BYTE*) buffer, &size);
- buffer[len] = 0;
- std::wstring uresult(buffer);
- delete [] buffer;
- std::string result;
- Poco::UnicodeConverter::toUTF8(uresult, result);
- return result;
- }
-#else
- if (RegQueryValueEx(_hKey, name.c_str(), NULL, &type, NULL, &size) != ERROR_SUCCESS || type != REG_SZ && type != REG_EXPAND_SZ)
- throw NotFoundException(key(name));
- if (size > 0)
- {
- char* buffer = new char[size + 1];
- RegQueryValueEx(_hKey, name.c_str(), NULL, NULL, (BYTE*) buffer, &size);
- buffer[size] = 0;
- std::string result(buffer);
- delete [] buffer;
- return result;
- }
-#endif
- return std::string();
-}
-
-
-void WinRegistryKey::setStringExpand(const std::string& name, const std::string& value)
-{
- open();
-#if defined(POCO_WIN32_UTF8)
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(name, uname);
- std::wstring uvalue;
- Poco::UnicodeConverter::toUTF16(value, uvalue);
- if (RegSetValueExW(_hKey, uname.c_str(), 0, REG_EXPAND_SZ, (CONST BYTE*) uvalue.c_str(), (DWORD) (uvalue.size() + 1)*sizeof(wchar_t)) != ERROR_SUCCESS)
- handleSetError(name);
-#else
- if (RegSetValueEx(_hKey, name.c_str(), 0, REG_EXPAND_SZ, (CONST BYTE*) value.c_str(), (DWORD) value.size() + 1) != ERROR_SUCCESS)
- handleSetError(name);
-#endif
-}
-
-
-std::string WinRegistryKey::getStringExpand(const std::string& name)
-{
- open();
- DWORD type;
- DWORD size;
-#if defined(POCO_WIN32_UTF8)
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(name, uname);
- if (RegQueryValueExW(_hKey, uname.c_str(), NULL, &type, NULL, &size) != ERROR_SUCCESS || type != REG_SZ && type != REG_EXPAND_SZ)
- throw NotFoundException(key(name));
- if (size > 0)
- {
- DWORD len = size/2;
- wchar_t* buffer = new wchar_t[len + 1];
- RegQueryValueExW(_hKey, uname.c_str(), NULL, NULL, (BYTE*) buffer, &size);
- buffer[len] = 0;
- wchar_t temp;
- DWORD expSize = ExpandEnvironmentStringsW(buffer, &temp, 1);
- wchar_t* expBuffer = new wchar_t[expSize];
- ExpandEnvironmentStringsW(buffer, expBuffer, expSize);
- std::string result;
- UnicodeConverter::toUTF8(expBuffer, result);
- delete [] buffer;
- delete [] expBuffer;
- return result;
- }
-#else
- if (RegQueryValueEx(_hKey, name.c_str(), NULL, &type, NULL, &size) != ERROR_SUCCESS || type != REG_SZ && type != REG_EXPAND_SZ)
- throw NotFoundException(key(name));
- if (size > 0)
- {
- char* buffer = new char[size + 1];
- RegQueryValueEx(_hKey, name.c_str(), NULL, NULL, (BYTE*) buffer, &size);
- buffer[size] = 0;
- char temp;
- DWORD expSize = ExpandEnvironmentStringsA(buffer, &temp, 1);
- char* expBuffer = new char[expSize];
- ExpandEnvironmentStringsA(buffer, expBuffer, expSize);
- std::string result(expBuffer);
- delete [] buffer;
- delete [] expBuffer;
- return result;
- }
-#endif
- return std::string();
-}
-
-
-void WinRegistryKey::setInt(const std::string& name, int value)
-{
- open();
- DWORD data = value;
-#if defined(POCO_WIN32_UTF8)
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(name, uname);
- if (RegSetValueExW(_hKey, uname.c_str(), 0, REG_DWORD, (CONST BYTE*) &data, sizeof(data)) != ERROR_SUCCESS)
- handleSetError(name);
-#else
- if (RegSetValueEx(_hKey, name.c_str(), 0, REG_DWORD, (CONST BYTE*) &data, sizeof(data)) != ERROR_SUCCESS)
- handleSetError(name);
-#endif
-}
-
-
-int WinRegistryKey::getInt(const std::string& name)
-{
- open();
- DWORD type;
- DWORD data;
- DWORD size;
-#if defined(POCO_WIN32_UTF8)
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(name, uname);
- if (RegQueryValueExW(_hKey, uname.c_str(), NULL, &type, (BYTE*) &data, &size) != ERROR_SUCCESS || type != REG_DWORD)
- throw NotFoundException(key(name));
-#else
- if (RegQueryValueEx(_hKey, name.c_str(), NULL, &type, (BYTE*) &data, &size) != ERROR_SUCCESS || type != REG_DWORD)
- throw NotFoundException(key(name));
-#endif
- return data;
-}
-
-
-void WinRegistryKey::deleteValue(const std::string& name)
-{
- open();
-#if defined(POCO_WIN32_UTF8)
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(name, uname);
- if (RegDeleteValueW(_hKey, uname.c_str()) != ERROR_SUCCESS)
- throw NotFoundException(key(name));
-#else
- if (RegDeleteValue(_hKey, name.c_str()) != ERROR_SUCCESS)
- throw NotFoundException(key(name));
-#endif
-}
-
-
-void WinRegistryKey::deleteKey()
-{
- Keys keys;
- subKeys(keys);
- close();
- for (Keys::iterator it = keys.begin(); it != keys.end(); ++it)
- {
- std::string subKey(_subKey);
- subKey += "\\";
- subKey += *it;
- WinRegistryKey subRegKey(_hRootKey, subKey);
- subRegKey.deleteKey();
- }
-#if defined(POCO_WIN32_UTF8)
- std::wstring usubKey;
- Poco::UnicodeConverter::toUTF16(_subKey, usubKey);
- if (RegDeleteKeyW(_hRootKey, usubKey.c_str()) != ERROR_SUCCESS)
- throw NotFoundException(key());
-#else
- if (RegDeleteKey(_hRootKey, _subKey.c_str()) != ERROR_SUCCESS)
- throw NotFoundException(key());
-#endif
-}
-
-
-bool WinRegistryKey::exists()
-{
- HKEY hKey;
-#if defined(POCO_WIN32_UTF8)
- std::wstring usubKey;
- Poco::UnicodeConverter::toUTF16(_subKey, usubKey);
- if (RegOpenKeyExW(_hRootKey, usubKey.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
- {
- RegCloseKey(hKey);
- return true;
- }
-#else
- if (RegOpenKeyEx(_hRootKey, _subKey.c_str(), 0, KEY_READ, &hKey) != ERROR_SUCCESS)
- {
- RegCloseKey(hKey);
- return true;
- }
-#endif
- return false;
-}
-
-
-WinRegistryKey::Type WinRegistryKey::type(const std::string& name)
-{
- open();
- DWORD type = REG_NONE;
- DWORD size;
-#if defined(POCO_WIN32_UTF8)
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(name, uname);
- if (RegQueryValueExW(_hKey, uname.c_str(), NULL, &type, NULL, &size) != ERROR_SUCCESS)
- throw NotFoundException(key(name));
-#else
- if (RegQueryValueEx(_hKey, name.c_str(), NULL, &type, NULL, &size) != ERROR_SUCCESS)
- throw NotFoundException(key(name));
-#endif
- if (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_DWORD)
- throw NotFoundException(key(name)+": type not supported");
-
- Type aType = (Type)type;
- return aType;
-}
-
-
-bool WinRegistryKey::exists(const std::string& name)
-{
- bool exists = false;
- HKEY hKey;
-#if defined(POCO_WIN32_UTF8)
- std::wstring usubKey;
- Poco::UnicodeConverter::toUTF16(_subKey, usubKey);
- if (RegOpenKeyExW(_hRootKey, usubKey.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
- {
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(name, uname);
- exists = RegQueryValueExW(hKey, uname.c_str(), NULL, NULL, NULL, NULL) == ERROR_SUCCESS;
- RegCloseKey(hKey);
- }
-#else
- if (RegOpenKeyEx(_hRootKey, _subKey.c_str(), 0, KEY_READ, &hKey) != ERROR_SUCCESS)
- {
- exists = RegQueryValueEx(hKey, name.c_str(), NULL, NULL, NULL, NULL) == ERROR_SUCCESS;
- RegCloseKey(hKey);
- }
-#endif
- return exists;
-}
-
-
-void WinRegistryKey::open()
-{
- if (!_hKey)
- {
-#if defined(POCO_WIN32_UTF8)
- std::wstring usubKey;
- Poco::UnicodeConverter::toUTF16(_subKey, usubKey);
- if (_readOnly)
- {
- if (RegOpenKeyExW(_hRootKey, usubKey.c_str(), 0, KEY_READ, &_hKey) != ERROR_SUCCESS)
- throw NotFoundException("Cannot open registry key: ", key());
- }
- else
- {
- if (RegCreateKeyExW(_hRootKey, usubKey.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, NULL, &_hKey, NULL) != ERROR_SUCCESS)
- throw SystemException("Cannot open registry key: ", key());
- }
-#else
- if (_readOnly)
- {
- if (RegOpenKeyEx(_hRootKey, _subKey.c_str(), 0, KEY_READ, &_hKey) != ERROR_SUCCESS)
- throw NotFoundException("Cannot open registry key: ", key());
- }
- else
- {
- if (RegCreateKeyEx(_hRootKey, _subKey.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, NULL, &_hKey, NULL) != ERROR_SUCCESS)
- throw SystemException("Cannot open registry key: ", key());
- }
-#endif
- }
-}
-
-
-void WinRegistryKey::close()
-{
- if (_hKey)
- {
- RegCloseKey(_hKey);
- _hKey = 0;
- }
-}
-
-
-std::string WinRegistryKey::key() const
-{
- std::string result;
- if (_hRootKey == HKEY_CLASSES_ROOT)
- result = "HKEY_CLASSES_ROOT";
- else if (_hRootKey == HKEY_CURRENT_CONFIG)
- result = "HKEY_CURRENT_CONFIG";
- else if (_hRootKey == HKEY_CURRENT_USER)
- result = "HKEY_CURRENT_USER";
- else if (_hRootKey == HKEY_LOCAL_MACHINE)
- result = "HKEY_LOCAL_MACHINE";
- else if (_hRootKey == HKEY_USERS)
- result = "HKEY_USERS";
- else if (_hRootKey == HKEY_PERFORMANCE_DATA)
- result = "HKEY_PERFORMANCE_DATA";
- else
- result = "(UNKNOWN)";
- result += '\\';
- result += _subKey;
- return result;
-}
-
-
-std::string WinRegistryKey::key(const std::string& valueName) const
-{
- std::string result = key();
- if (!valueName.empty())
- {
- result += '\\';
- result += valueName;
- }
- return result;
-}
-
-
-HKEY WinRegistryKey::handleFor(const std::string& rootKey)
-{
- if (rootKey == "HKEY_CLASSES_ROOT")
- return HKEY_CLASSES_ROOT;
- else if (rootKey == "HKEY_CURRENT_CONFIG")
- return HKEY_CURRENT_CONFIG;
- else if (rootKey == "HKEY_CURRENT_USER")
- return HKEY_CURRENT_USER;
- else if (rootKey == "HKEY_LOCAL_MACHINE")
- return HKEY_LOCAL_MACHINE;
- else if (rootKey == "HKEY_USERS")
- return HKEY_USERS;
- else if (rootKey == "HKEY_PERFORMANCE_DATA")
- return HKEY_PERFORMANCE_DATA;
- else
- throw InvalidArgumentException("Not a valid root key", rootKey);
-}
-
-
-void WinRegistryKey::handleSetError(const std::string& name)
-{
- std::string msg = "Failed to set registry value";
- throw SystemException(msg, key(name));
-}
-
-
-void WinRegistryKey::subKeys(WinRegistryKey::Keys& keys)
-{
- open();
-
- DWORD subKeyCount = 0;
- DWORD valueCount = 0;
-
- if (RegQueryInfoKey(_hKey, NULL, NULL, NULL, &subKeyCount, NULL, NULL, &valueCount, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
- return;
-
-#if defined(POCO_WIN32_UTF8)
- wchar_t buf[256];
- DWORD bufSize = sizeof(buf)/sizeof(wchar_t);
- for (DWORD i = 0; i< subKeyCount; ++i)
- {
- if (RegEnumKeyExW(_hKey, i, buf, &bufSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
- {
- std::wstring uname(buf);
- std::string name;
- Poco::UnicodeConverter::toUTF8(uname, name);
- keys.push_back(name);
- }
- bufSize = sizeof(buf)/sizeof(wchar_t);
- }
-#else
- char buf[256];
- DWORD bufSize = sizeof(buf);
- for (DWORD i = 0; i< subKeyCount; ++i)
- {
- if (RegEnumKeyEx(_hKey, i, buf, &bufSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
- {
- std::string name(buf);
- keys.push_back(name);
- }
- bufSize = sizeof(buf);
- }
-#endif
-}
-
-
-void WinRegistryKey::values(WinRegistryKey::Values& vals)
-{
- open();
-
- DWORD valueCount = 0;
-
- if (RegQueryInfoKey(_hKey, NULL, NULL, NULL, NULL, NULL, NULL, &valueCount, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
- return ;
-
-#if defined(POCO_WIN32_UTF8)
- wchar_t buf[256];
- DWORD bufSize = sizeof(buf)/sizeof(wchar_t);
- for (DWORD i = 0; i< valueCount; ++i)
- {
- if (RegEnumValueW(_hKey, i, buf, &bufSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
- {
- std::wstring uname(buf);
- std::string name;
- Poco::UnicodeConverter::toUTF8(uname, name);
- vals.push_back(name);
- }
- bufSize = sizeof(buf)/sizeof(wchar_t);
- }
-#else
- char buf[256];
- DWORD bufSize = sizeof(buf);
- for (DWORD i = 0; i< valueCount; ++i)
- {
- if (RegEnumValue(_hKey, i, buf, &bufSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
- {
- std::string name(buf);
- vals.push_back(name);
- }
- bufSize = sizeof(buf);
- }
-#endif
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/WinService.cpp b/Utilities/Poco/Util/src/WinService.cpp
deleted file mode 100755
index 332e8e49cd..0000000000
--- a/Utilities/Poco/Util/src/WinService.cpp
+++ /dev/null
@@ -1,321 +0,0 @@
-//
-// WinService.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Windows
-// Module: WinService
-//
-// Copyright (c) 2004-2006, 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/WinService.h"
-#include "Poco/Thread.h"
-#include "Poco/Exception.h"
-#if defined(POCO_WIN32_UTF8)
-#include "Poco/UnicodeConverter.h"
-#endif
-
-
-using Poco::Thread;
-using Poco::SystemException;
-using Poco::NotFoundException;
-using Poco::OutOfMemoryException;
-
-
-namespace Poco {
-namespace Util {
-
-
-const int WinService::STARTUP_TIMEOUT = 30000;
-
-
-WinService::WinService(const std::string& name):
- _name(name),
- _svcHandle(0)
-{
- _scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
- if (!_scmHandle) throw SystemException("cannot open Service Control Manager");
-}
-
-
-WinService::~WinService()
-{
- close();
- CloseServiceHandle(_scmHandle);
-}
-
-
-const std::string& WinService::name() const
-{
- return _name;
-}
-
-
-std::string WinService::displayName() const
-{
- POCO_LPQUERY_SERVICE_CONFIG pSvcConfig = config();
-#if defined(POCO_WIN32_UTF8)
- std::wstring udispName(pSvcConfig->lpDisplayName);
- std::string dispName;
- Poco::UnicodeConverter::toUTF8(udispName, dispName);
-#else
- std::string dispName(pSvcConfig->lpDisplayName);
-#endif
- LocalFree(pSvcConfig);
- return dispName;
-}
-
-
-std::string WinService::path() const
-{
- POCO_LPQUERY_SERVICE_CONFIG pSvcConfig = config();
-#if defined(POCO_WIN32_UTF8)
- std::wstring upath(pSvcConfig->lpBinaryPathName);
- std::string path;
- UnicodeConverter::toUTF8(upath, path);
-#else
- std::string path(pSvcConfig->lpBinaryPathName);
-#endif
- LocalFree(pSvcConfig);
- return path;
-}
-
-
-void WinService::registerService(const std::string& path, const std::string& displayName)
-{
- close();
-#if defined(POCO_WIN32_UTF8)
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(_name, uname);
- std::wstring udisplayName;
- Poco::UnicodeConverter::toUTF16(displayName, udisplayName);
- std::wstring upath;
- Poco::UnicodeConverter::toUTF16(path, upath);
- _svcHandle = CreateServiceW(
- _scmHandle,
- uname.c_str(),
- udisplayName.c_str(),
- SERVICE_ALL_ACCESS,
- SERVICE_WIN32_OWN_PROCESS,
- SERVICE_DEMAND_START,
- SERVICE_ERROR_NORMAL,
- upath.c_str(),
- NULL, NULL, NULL, NULL, NULL);
-#else
- _svcHandle = CreateService(
- _scmHandle,
- _name.c_str(),
- displayName.c_str(),
- SERVICE_ALL_ACCESS,
- SERVICE_WIN32_OWN_PROCESS,
- SERVICE_DEMAND_START,
- SERVICE_ERROR_NORMAL,
- path.c_str(),
- NULL, NULL, NULL, NULL, NULL);
-#endif
- if (!_svcHandle)
- throw SystemException("cannot register service", _name);
-}
-
-
-void WinService::registerService(const std::string& path)
-{
- registerService(path, _name);
-}
-
-
-void WinService::unregisterService()
-{
- open();
- if (!DeleteService(_svcHandle))
- throw SystemException("cannot unregister service", _name);
-}
-
-
-bool WinService::isRegistered() const
-{
- return tryOpen();
-}
-
-
-bool WinService::isRunning() const
-{
- open();
- SERVICE_STATUS ss;
- if (!QueryServiceStatus(_svcHandle, &ss))
- throw SystemException("cannot query service status", _name);
- return ss.dwCurrentState == SERVICE_RUNNING;
-}
-
-
-void WinService::start()
-{
- open();
- if (!StartService(_svcHandle, 0, NULL))
- throw SystemException("cannot start service", _name);
-
- SERVICE_STATUS svcStatus;
- long msecs = 0;
- while (msecs < STARTUP_TIMEOUT)
- {
- if (!QueryServiceStatus(_svcHandle, &svcStatus)) break;
- if (svcStatus.dwCurrentState != SERVICE_START_PENDING) break;
- Thread::sleep(250);
- msecs += 250;
- }
- if (!QueryServiceStatus(_svcHandle, &svcStatus))
- throw SystemException("cannot query status of starting service", _name);
- else if (svcStatus.dwCurrentState != SERVICE_RUNNING)
- throw SystemException("service failed to start within a reasonable time", _name);
- }
-
-
-void WinService::stop()
-{
- open();
- SERVICE_STATUS svcStatus;
- if (!ControlService(_svcHandle, SERVICE_CONTROL_STOP, &svcStatus))
- throw SystemException("cannot stop service", _name);
-}
-
-
-void WinService::setStartup(WinService::Startup startup)
-{
- open();
- DWORD startType;
- switch (startup)
- {
- case SVC_AUTO_START:
- startType = SERVICE_AUTO_START;
- break;
- case SVC_MANUAL_START:
- startType = SERVICE_DEMAND_START;
- break;
- case SVC_DISABLED:
- startType = SERVICE_DISABLED;
- break;
- default:
- startType = SERVICE_NO_CHANGE;
- }
- if (!ChangeServiceConfig(_svcHandle, SERVICE_NO_CHANGE, startType, SERVICE_NO_CHANGE, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
- {
- throw SystemException("cannot change service startup mode");
- }
-}
-
-
-WinService::Startup WinService::getStartup() const
-{
- POCO_LPQUERY_SERVICE_CONFIG pSvcConfig = config();
- Startup result;
- switch (pSvcConfig->dwStartType)
- {
- case SERVICE_AUTO_START:
- case SERVICE_BOOT_START:
- case SERVICE_SYSTEM_START:
- result = SVC_AUTO_START;
- break;
- case SERVICE_DEMAND_START:
- result = SVC_MANUAL_START;
- break;
- case SERVICE_DISABLED:
- result = SVC_DISABLED;
- break;
- default:
- poco_debugger();
- result = SVC_MANUAL_START;
- }
- LocalFree(pSvcConfig);
- return result;
-}
-
-
-void WinService::open() const
-{
- if (!tryOpen())
- throw NotFoundException("service does not exist", _name);
-}
-
-
-bool WinService::tryOpen() const
-{
-#if defined(POCO_WIN32_UTF8)
- std::wstring uname;
- Poco::UnicodeConverter::toUTF16(_name, uname);
- _svcHandle = OpenServiceW(_scmHandle, uname.c_str(), SERVICE_ALL_ACCESS);
-#else
- _svcHandle = OpenService(_scmHandle, _name.c_str(), SERVICE_ALL_ACCESS);
-#endif
- return _svcHandle != 0;
-}
-
-
-void WinService::close() const
-{
- if (_svcHandle)
- {
- CloseServiceHandle(_svcHandle);
- }
-}
-
-
-POCO_LPQUERY_SERVICE_CONFIG WinService::config() const
-{
- open();
- int size = 4096;
- DWORD bytesNeeded;
- POCO_LPQUERY_SERVICE_CONFIG pSvcConfig = (POCO_LPQUERY_SERVICE_CONFIG) LocalAlloc(LPTR, size);
- if (!pSvcConfig) throw OutOfMemoryException("cannot allocate service config buffer");
- try
- {
-#if defined(POCO_WIN32_UTF8)
- while (!QueryServiceConfigW(_svcHandle, pSvcConfig, size, &bytesNeeded))
-#else
- while (!QueryServiceConfig(_svcHandle, pSvcConfig, size, &bytesNeeded))
-#endif
- {
- if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
- {
- LocalFree(pSvcConfig);
- size = bytesNeeded;
- pSvcConfig = (POCO_LPQUERY_SERVICE_CONFIG) LocalAlloc(LPTR, size);
- }
- else throw SystemException("cannot query service configuration", _name);
- }
- }
- catch (...)
- {
- LocalFree(pSvcConfig);
- throw;
- }
- return pSvcConfig;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/src/XMLConfiguration.cpp b/Utilities/Poco/Util/src/XMLConfiguration.cpp
deleted file mode 100755
index 950e9d0b38..0000000000
--- a/Utilities/Poco/Util/src/XMLConfiguration.cpp
+++ /dev/null
@@ -1,363 +0,0 @@
-//
-// XMLConfiguration.cpp
-//
-// $Id$
-//
-// Library: Util
-// Package: Configuration
-// Module: XMLConfiguration
-//
-// Copyright (c) 2004-2006, 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/XMLConfiguration.h"
-#include "Poco/SAX/InputSource.h"
-#include "Poco/DOM/DOMParser.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Attr.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/XML/XMLWriter.h"
-#include "Poco/Exception.h"
-#include "Poco/NumberParser.h"
-#include "Poco/NumberFormatter.h"
-#include <set>
-
-
-namespace Poco {
-namespace Util {
-
-
-XMLConfiguration::XMLConfiguration()
-{
-}
-
-
-XMLConfiguration::XMLConfiguration(Poco::XML::InputSource* pInputSource)
-{
- load(pInputSource);
-}
-
-
-XMLConfiguration::XMLConfiguration(std::istream& istr)
-{
- load(istr);
-}
-
-
-XMLConfiguration::XMLConfiguration(const std::string& path)
-{
- load(path);
-}
-
-
-XMLConfiguration::XMLConfiguration(const Poco::XML::Document* pDocument)
-{
- load(pDocument);
-}
-
-
-XMLConfiguration::XMLConfiguration(const Poco::XML::Node* pNode)
-{
- load(pNode);
-}
-
-
-XMLConfiguration::~XMLConfiguration()
-{
-}
-
-
-void XMLConfiguration::load(Poco::XML::InputSource* pInputSource)
-{
- poco_check_ptr (pInputSource);
-
- Poco::XML::DOMParser parser;
- parser.setFeature(Poco::XML::XMLReader::FEATURE_NAMESPACES, false);
- parser.setFeature(Poco::XML::DOMParser::FEATURE_WHITESPACE, true);
- Poco::XML::AutoPtr<Poco::XML::Document> pDoc = parser.parse(pInputSource);
- load(pDoc);
-}
-
-
-void XMLConfiguration::load(std::istream& istr)
-{
- Poco::XML::InputSource src(istr);
- load(&src);
-}
-
-
-void XMLConfiguration::load(const std::string& path)
-{
- Poco::XML::InputSource src(path);
- load(&src);
-}
-
-
-void XMLConfiguration::load(const Poco::XML::Document* pDocument)
-{
- poco_check_ptr (pDocument);
-
- _pDocument = Poco::XML::AutoPtr<Poco::XML::Document>(const_cast<Poco::XML::Document*>(pDocument), true);
- _pRoot = Poco::XML::AutoPtr<Poco::XML::Node>(pDocument->documentElement(), true);
-}
-
-
-void XMLConfiguration::load(const Poco::XML::Node* pNode)
-{
- poco_check_ptr (pNode);
-
- if (pNode->nodeType() == Poco::XML::Node::DOCUMENT_NODE)
- {
- load(static_cast<const Poco::XML::Document*>(pNode));
- }
- else
- {
- _pDocument = Poco::XML::AutoPtr<Poco::XML::Document>(pNode->ownerDocument(), true);
- _pRoot = Poco::XML::AutoPtr<Poco::XML::Node>(const_cast<Poco::XML::Node*>(pNode), true);
- }
-}
-
-
-void XMLConfiguration::loadEmpty(const std::string& rootElementName)
-{
- _pDocument = new Poco::XML::Document;
- _pRoot = _pDocument->createElement(rootElementName);
- _pDocument->appendChild(_pRoot);
-}
-
-
-void XMLConfiguration::save(const std::string& path) const
-{
- Poco::XML::DOMWriter writer;
- writer.setNewLine("\n");
- writer.setOptions(Poco::XML::XMLWriter::PRETTY_PRINT);
- writer.writeNode(path, _pDocument);
-}
-
-
-void XMLConfiguration::save(std::ostream& ostr) const
-{
- Poco::XML::DOMWriter writer;
- writer.setNewLine("\n");
- writer.setOptions(Poco::XML::XMLWriter::PRETTY_PRINT);
- writer.writeNode(ostr, _pDocument);
-}
-
-
-void XMLConfiguration::save(Poco::XML::DOMWriter& writer, const std::string& path) const
-{
- writer.writeNode(path, _pDocument);
-}
-
-
-void XMLConfiguration::save(Poco::XML::DOMWriter& writer, std::ostream& ostr) const
-{
- writer.writeNode(ostr, _pDocument);
-}
-
-
-bool XMLConfiguration::getRaw(const std::string& key, std::string& value) const
-{
- const Poco::XML::Node* pNode = findNode(key);
- if (pNode)
- {
- value = pNode->innerText();
- return true;
- }
- else return false;
-}
-
-
-void XMLConfiguration::setRaw(const std::string& key, const std::string& value)
-{
- std::string::const_iterator it = key.begin();
- Poco::XML::Node* pNode = findNode(it, key.end(), _pRoot, true);
- if (pNode)
- {
- unsigned short nodeType = pNode->nodeType();
- if (Poco::XML::Node::ATTRIBUTE_NODE == nodeType)
- {
- pNode->setNodeValue(value);
- }
- else if (Poco::XML::Node::ELEMENT_NODE == nodeType)
- {
- Poco::XML::Node* pChildNode = pNode->firstChild();
- if (pChildNode)
- {
- if (Poco::XML::Node::TEXT_NODE == pChildNode->nodeType())
- {
- pChildNode->setNodeValue(value);
- }
- }
- else
- {
- Poco::AutoPtr<Poco::XML::Node> pText = _pDocument->createTextNode(value);
- pNode->appendChild(pText);
- }
- }
- }
- else throw NotFoundException("Node not found in XMLConfiguration", key);
-}
-
-
-void XMLConfiguration::enumerate(const std::string& key, Keys& range) const
-{
- using Poco::NumberFormatter;
-
- std::multiset<std::string> keys;
- const Poco::XML::Node* pNode = findNode(key);
- if (pNode)
- {
- const Poco::XML::Node* pChild = pNode->firstChild();
- while (pChild)
- {
- if (pChild->nodeType() == Poco::XML::Node::ELEMENT_NODE)
- {
- const std::string& nodeName = pChild->nodeName();
- int n = (int) keys.count(nodeName);
- if (n)
- range.push_back(nodeName + "[" + NumberFormatter::format(n) + "]");
- else
- range.push_back(nodeName);
- keys.insert(nodeName);
- }
- pChild = pChild->nextSibling();
- }
- }
-}
-
-
-const Poco::XML::Node* XMLConfiguration::findNode(const std::string& key) const
-{
- std::string::const_iterator it = key.begin();
- Poco::XML::Node* pRoot = const_cast<Poco::XML::Node*>(_pRoot.get());
- return findNode(it, key.end(), pRoot);
-}
-
-
-Poco::XML::Node* XMLConfiguration::findNode(std::string::const_iterator& it, const std::string::const_iterator& end, Poco::XML::Node* pNode, bool create)
-{
- if (pNode && it != end)
- {
- if (*it == '[')
- {
- ++it;
- if (it != end && *it == '@')
- {
- ++it;
- std::string attr;
- while (it != end && *it != ']') attr += *it++;
- if (it != end) ++it;
- return findAttribute(attr, pNode, create);
- }
- else
- {
- std::string index;
- while (it != end && *it != ']') index += *it++;
- if (it != end) ++it;
- return findNode(it, end, findElement(Poco::NumberParser::parse(index), pNode, create), create);
- }
- }
- else
- {
- while (it != end && *it == '.') ++it;
- std::string key;
- while (it != end && *it != '.' && *it != '[') key += *it++;
- return findNode(it, end, findElement(key, pNode, create), create);
- }
- }
- else return pNode;
-}
-
-
-Poco::XML::Node* XMLConfiguration::findElement(const std::string& name, Poco::XML::Node* pNode, bool create)
-{
- Poco::XML::Node* pChild = pNode->firstChild();
- while (pChild)
- {
- if (pChild->nodeType() == Poco::XML::Node::ELEMENT_NODE && pChild->nodeName() == name)
- return pChild;
- pChild = pChild->nextSibling();
- }
- if (create)
- {
- Poco::AutoPtr<Poco::XML::Element> pElem = pNode->ownerDocument()->createElement(name);
- pNode->appendChild(pElem);
- return pElem;
- }
- else return 0;
-}
-
-
-Poco::XML::Node* XMLConfiguration::findElement(int index, Poco::XML::Node* pNode, bool create)
-{
- Poco::XML::Node* pRefNode = pNode;
- if (index > 0)
- {
- pNode = pNode->nextSibling();
- while (pNode)
- {
- if (pNode->nodeName() == pRefNode->nodeName())
- {
- if (--index == 0) break;
- }
- pNode = pNode->nextSibling();
- }
- }
- if (!pNode && create)
- {
- if (index == 1)
- {
- Poco::AutoPtr<Poco::XML::Element> pElem = pRefNode->ownerDocument()->createElement(pRefNode->nodeName());
- pRefNode->parentNode()->appendChild(pElem);
- return pElem;
- }
- else throw Poco::InvalidArgumentException("Element index out of range.");
- }
- return pNode;
-}
-
-
-Poco::XML::Node* XMLConfiguration::findAttribute(const std::string& name, Poco::XML::Node* pNode, bool create)
-{
- Poco::XML::Node* pResult(0);
- Poco::XML::Element* pElem = dynamic_cast<Poco::XML::Element*>(pNode);
- if (pElem)
- {
- pResult = pElem->getAttributeNode(name);
- if (!pResult && create)
- {
- Poco::AutoPtr<Poco::XML::Attr> pAttr = pNode->ownerDocument()->createAttribute(name);
- pElem->setAttributeNode(pAttr);
- return pAttr;
- }
- }
- return pResult;
-}
-
-
-} } // namespace Poco::Util
diff --git a/Utilities/Poco/Util/testsuite/CMakeLists.txt b/Utilities/Poco/Util/testsuite/CMakeLists.txt
deleted file mode 100755
index 14460013ed..0000000000
--- a/Utilities/Poco/Util/testsuite/CMakeLists.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-include(files.cmake)
-
-add_executable(PocoTestRunnerUtil ${CPP_FILES})
-target_link_libraries(PocoTestRunnerUtil
- PocoUtil
- PocoXML
- PocoFoundation
- CppUnit)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../Foundation/include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../XML/include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../CppUnit/include
-)
-
-if(WIN32)
- target_link_libraries(PocoTestRunnerUtil
- WinTestRunner
- )
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../CppUnit/WinTestRunner/include)
- add_definitions(-D_AFXDLL)
-endif(WIN32)
-
-#set_target_properties(PocoTestRunnerUtil PROPERTIES COMPILE_FLAGS "${POCO_UNIX_COMPILE_FLAGS}")
diff --git a/Utilities/Poco/Util/testsuite/files.cmake b/Utilities/Poco/Util/testsuite/files.cmake
deleted file mode 100755
index 3f40e07d8f..0000000000
--- a/Utilities/Poco/Util/testsuite/files.cmake
+++ /dev/null
@@ -1,24 +0,0 @@
-set(CPP_BASE_FILENAMES
- AbstractConfigurationTest ConfigurationTestSuite
- ConfigurationMapperTest ConfigurationViewTest Driver
- HelpFormatterTest IniFileConfigurationTest LayeredConfigurationTest
- LoggingConfiguratorTest MapConfigurationTest
- OptionProcessorTest OptionSetTest OptionTest
- OptionsTestSuite PropertyFileConfigurationTest
- SystemConfigurationTest UtilTestSuite XMLConfigurationTest
- FilesystemConfigurationTest ValidatorTest
- TimerTestSuite TimerTest
-)
-
-if(WIN32)
-set(CPP_BASE_FILENAMES
- WinDriver WindowsTestSuite WinConfigurationTest WinRegistryTest
- ${CPP_BASE_FILENAMES}
-)
-endif(WIN32)
-
-
-set(CPP_FILES "")
-foreach(basename ${CPP_BASE_FILENAMES})
- set(CPP_FILES ${CPP_FILES} src/${basename})
-endforeach(basename ${CPP_BASE_FILENAMES})
diff --git a/Utilities/Poco/Util/testsuite/src/AbstractConfigurationTest.cpp b/Utilities/Poco/Util/testsuite/src/AbstractConfigurationTest.cpp
deleted file mode 100755
index 9d417118f4..0000000000
--- a/Utilities/Poco/Util/testsuite/src/AbstractConfigurationTest.cpp
+++ /dev/null
@@ -1,337 +0,0 @@
-//
-// AbstractConfigurationTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "AbstractConfigurationTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/MapConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-#include <algorithm>
-
-
-using Poco::Util::AbstractConfiguration;
-using Poco::Util::MapConfiguration;
-using Poco::AutoPtr;
-
-
-AbstractConfigurationTest::AbstractConfigurationTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-AbstractConfigurationTest::~AbstractConfigurationTest()
-{
-}
-
-
-void AbstractConfigurationTest::testHasProperty()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- assert (pConf->hasProperty("prop1"));
- assert (pConf->hasProperty("prop2"));
- assert (pConf->hasProperty("prop3.string1"));
- assert (!pConf->hasProperty("prop3.string3"));
- assert (!pConf->hasProperty("foobar"));
-}
-
-
-void AbstractConfigurationTest::testGetString()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- assert (pConf->getString("prop1") == "foo");
- assert (pConf->getString("prop2") == "bar");
- assert (pConf->getString("prop3.string1") == "foo");
- assert (pConf->getString("prop3.string2") == "bar");
- assert (pConf->getString("ref1") == "foobar");
- assert (pConf->getRawString("ref1") == "${prop3.string1}${prop3.string2}");
-
- try
- {
- std::string res = pConf->getString("foo");
- fail("nonexistent property - must throw");
- }
- catch (Poco::NotFoundException&)
- {
- }
-
- assert (pConf->getString("prop1", "FOO") == "foo");
- assert (pConf->getString("prop2", "BAR") == "bar");
- assert (pConf->getString("prop3.string1", "FOO") == "foo");
- assert (pConf->getString("prop3.string2", "BAR") == "bar");
- assert (pConf->getString("prop3.string3", "FOOBAR") == "FOOBAR");
-}
-
-
-void AbstractConfigurationTest::testGetInt()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- assert (pConf->getInt("prop4.int1") == 42);
- assert (pConf->getInt("prop4.int2") == -42);
- assert (pConf->getInt("prop4.hex") == 0x1f);
- assert (pConf->getInt("ref2") == 42);
-
- try
- {
- int x = pConf->getInt("prop1");
- fail("not a number - must throw");
- }
- catch (Poco::SyntaxException&)
- {
- }
-
- assert (pConf->getInt("prop4.int1", 100) == 42);
- assert (pConf->getInt("prop4.int2", 100) == -42);
- assert (pConf->getInt("prop4.int3", 100) == 100);
-}
-
-
-void AbstractConfigurationTest::testGetDouble()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- assert (pConf->getDouble("prop4.double1") == 1);
- assert (pConf->getDouble("prop4.double2") == -1.5);
-
- try
- {
- double x = pConf->getDouble("prop1");
- fail("not a number - must throw");
- }
- catch (Poco::SyntaxException&)
- {
- }
-
- assert (pConf->getDouble("prop4.double1", 123.5) == 1);
- assert (pConf->getDouble("prop4.double2", 123.5) == -1.5);
- assert (pConf->getDouble("prop4.double3", 123.5) == 123.5);
-}
-
-
-void AbstractConfigurationTest::testGetBool()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- assert (pConf->getBool("prop4.bool1"));
- assert (!pConf->getBool("prop4.bool2"));
- assert (pConf->getBool("prop4.bool3"));
- assert (!pConf->getBool("prop4.bool4"));
- assert (pConf->getBool("prop4.bool5"));
- assert (!pConf->getBool("prop4.bool6"));
- assert (pConf->getBool("prop4.bool7"));
- assert (!pConf->getBool("prop4.bool8"));
-
- try
- {
- bool x = pConf->getBool("prop1");
- fail("not a boolean - must throw");
- }
- catch (Poco::SyntaxException&)
- {
- }
-
- assert (pConf->getBool("prop4.bool1", false));
- assert (!pConf->getBool("prop4.bool2", true));
- assert (pConf->getBool("prop4.boolx", true));
- assert (!pConf->getBool("prop4.booly", false));
-}
-
-
-void AbstractConfigurationTest::testExpand()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- assert (pConf->getString("ref1") == "foobar");
- assert (pConf->getInt("ref2") == 42);
-
- try
- {
- std::string s = pConf->getString("ref3");
- fail("circular reference - must throw");
- }
- catch (Poco::CircularReferenceException&)
- {
- }
-
- assert (pConf->getString("ref5") == "${refx}");
- assert (pConf->getString("ref6") == "${refx}");
-
- assert (pConf->expand("answer=${prop4.int1}") == "answer=42");
- assert (pConf->expand("bool5='${prop4.bool5}'") == "bool5='Yes'");
- assert (pConf->expand("undef='${undef}'") == "undef='${undef}'");
- assert (pConf->expand("deep='${ref1}'") == "deep='foobar'");
- assert (pConf->expand("deep='${ref7}'") == "deep='foobar'");
-
- assert (pConf->getString("dollar.atend") == "foo$");
- assert (pConf->getString("dollar.middle") == "foo$bar");
-}
-
-
-void AbstractConfigurationTest::testSetString()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- pConf->setString("set.string1", "foobar");
- pConf->setString("set.string2", "");
- assert (pConf->getString("set.string1") == "foobar");
- assert (pConf->getString("set.string2") == "");
-}
-
-void AbstractConfigurationTest::testSetInt()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- pConf->setInt("set.int1", 42);
- pConf->setInt("set.int2", -100);
- assert (pConf->getInt("set.int1") == 42);
- assert (pConf->getInt("set.int2") == -100);
-}
-
-
-void AbstractConfigurationTest::testSetDouble()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- pConf->setDouble("set.double1", 1.5);
- pConf->setDouble("set.double2", -1.5);
- assert (pConf->getDouble("set.double1") == 1.5);
- assert (pConf->getDouble("set.double2") == -1.5);
-}
-
-
-void AbstractConfigurationTest::testSetBool()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- pConf->setBool("set.bool1", true);
- pConf->setBool("set.bool2", false);
- assert (pConf->getBool("set.bool1"));
- assert (!pConf->getBool("set.bool2"));
-}
-
-
-void AbstractConfigurationTest::testKeys()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
-
- AbstractConfiguration::Keys keys;
- pConf->keys(keys);
- assert (keys.size() == 12);
- assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop3") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop4") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "ref1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "ref2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "ref3") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "ref4") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "ref5") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "ref6") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "ref7") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "dollar") != keys.end());
-
- pConf->keys("prop1", keys);
- assert (keys.empty());
-
- pConf->keys("prop3", keys);
- assert (keys.size() == 2);
- assert (std::find(keys.begin(), keys.end(), "string1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "string2") != keys.end());
-}
-
-
-AbstractConfiguration* AbstractConfigurationTest::createConfiguration() const
-{
- AbstractConfiguration* pConfig = new MapConfiguration;
-
- pConfig->setString("prop1", "foo");
- pConfig->setString("prop2", "bar");
- pConfig->setString("prop3.string1", "foo");
- pConfig->setString("prop3.string2", "bar");
- pConfig->setString("prop4.int1", "42");
- pConfig->setString("prop4.int2", "-42");
- pConfig->setString("prop4.hex", "0x1f");
- pConfig->setString("prop4.double1", "1");
- pConfig->setString("prop4.double2", "-1.5");
- pConfig->setString("prop4.bool1", "1");
- pConfig->setString("prop4.bool2", "0");
- pConfig->setString("prop4.bool3", "True");
- pConfig->setString("prop4.bool4", "FALSE");
- pConfig->setString("prop4.bool5", "Yes");
- pConfig->setString("prop4.bool6", "no");
- pConfig->setString("prop4.bool7", "ON");
- pConfig->setString("prop4.bool8", "Off");
- pConfig->setString("ref1", "${prop3.string1}${prop3.string2}");
- pConfig->setString("ref2", "${prop4.int1}");
- pConfig->setString("ref3", "${ref4}");
- pConfig->setString("ref4", "${ref3}");
- pConfig->setString("ref5", "${refx}");
- pConfig->setString("ref6", "${refx");
- pConfig->setString("ref7", "${ref1}");
- pConfig->setString("dollar.atend", "foo$");
- pConfig->setString("dollar.middle", "foo$bar");
-
- return pConfig;
-}
-
-
-void AbstractConfigurationTest::setUp()
-{
-}
-
-
-void AbstractConfigurationTest::tearDown()
-{
-}
-
-
-CppUnit::Test* AbstractConfigurationTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("AbstractConfigurationTest");
-
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testHasProperty);
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testGetString);
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testGetInt);
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testGetDouble);
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testGetBool);
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testExpand);
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testSetString);
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testSetInt);
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testSetDouble);
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testSetBool);
- CppUnit_addTest(pSuite, AbstractConfigurationTest, testKeys);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/AbstractConfigurationTest.h b/Utilities/Poco/Util/testsuite/src/AbstractConfigurationTest.h
deleted file mode 100755
index 2b25d5331e..0000000000
--- a/Utilities/Poco/Util/testsuite/src/AbstractConfigurationTest.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// AbstractConfigurationTest.h
-//
-// $Id$
-//
-// Definition of the AbstractConfigurationTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef AbstractConfigurationTest_INCLUDED
-#define AbstractConfigurationTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/Util/AbstractConfiguration.h"
-
-
-class AbstractConfigurationTest: public CppUnit::TestCase
-{
-public:
- AbstractConfigurationTest(const std::string& name);
- ~AbstractConfigurationTest();
-
- void testHasProperty();
- void testGetString();
- void testGetInt();
- void testGetDouble();
- void testGetBool();
- void testExpand();
- void testSetString();
- void testSetInt();
- void testSetDouble();
- void testSetBool();
- void testKeys();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
- Poco::Util::AbstractConfiguration* createConfiguration() const;
-};
-
-
-#endif // AbstractConfigurationTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/ConfigurationMapperTest.cpp b/Utilities/Poco/Util/testsuite/src/ConfigurationMapperTest.cpp
deleted file mode 100755
index a27603b6d2..0000000000
--- a/Utilities/Poco/Util/testsuite/src/ConfigurationMapperTest.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-//
-// ConfigurationMapperTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ConfigurationMapperTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/ConfigurationMapper.h"
-#include "Poco/Util/MapConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-#include <algorithm>
-
-
-using Poco::Util::AbstractConfiguration;
-using Poco::Util::ConfigurationMapper;
-using Poco::Util::MapConfiguration;
-using Poco::AutoPtr;
-
-
-ConfigurationMapperTest::ConfigurationMapperTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ConfigurationMapperTest::~ConfigurationMapperTest()
-{
-}
-
-
-void ConfigurationMapperTest::testMapper1()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
- AutoPtr<AbstractConfiguration> pMapper = new ConfigurationMapper("", "", pConf);
- assert (pMapper->hasProperty("config.value1"));
- assert (pMapper->hasProperty("config.value2"));
-
- AbstractConfiguration::Keys keys;
- pMapper->keys(keys);
- assert (keys.size() == 1);
- assert (std::find(keys.begin(), keys.end(), "config") != keys.end());
-
- pMapper->keys("config", keys);
- assert (keys.size() == 3);
- assert (std::find(keys.begin(), keys.end(), "value1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "value2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "sub") != keys.end());
-
- assert (pMapper->getString("config.value1") == "v1");
- assert (pMapper->getString("config.sub.value2") == "v4");
-
- pMapper->setString("config.value3", "v5");
- assert (pMapper->getString("config.value3") == "v5");
- assert (pConf->getString("config.value3") == "v5");
-}
-
-
-void ConfigurationMapperTest::testMapper2()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
- AutoPtr<AbstractConfiguration> pMapper = new ConfigurationMapper("config", "root.conf", pConf);
-
- assert (pMapper->hasProperty("root.conf.value1"));
- assert (pMapper->hasProperty("root.conf.value2"));
-
- AbstractConfiguration::Keys keys;
- pMapper->keys(keys);
- assert (keys.size() == 1);
- assert (std::find(keys.begin(), keys.end(), "root") != keys.end());
-
- pMapper->keys("root", keys);
- assert (keys.size() == 1);
- assert (std::find(keys.begin(), keys.end(), "conf") != keys.end());
-
- pMapper->keys("root.conf", keys);
- assert (keys.size() == 3);
- assert (std::find(keys.begin(), keys.end(), "value1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "value2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "sub") != keys.end());
-
- assert (pMapper->getString("root.conf.value1") == "v1");
- assert (pMapper->getString("root.conf.sub.value2") == "v4");
-
- pMapper->setString("root.conf.value3", "v5");
- assert (pMapper->getString("root.conf.value3") == "v5");
- assert (pConf->getString("config.value3") == "v5");
-}
-
-
-void ConfigurationMapperTest::testMapper3()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
- AutoPtr<AbstractConfiguration> pMapper = new ConfigurationMapper("", "root", pConf);
-
- assert (pMapper->hasProperty("root.config.value1"));
- assert (pMapper->hasProperty("root.config.value2"));
-
- AbstractConfiguration::Keys keys;
- pMapper->keys(keys);
- assert (keys.size() == 1);
- assert (std::find(keys.begin(), keys.end(), "root") != keys.end());
-
- pMapper->keys("root", keys);
- assert (keys.size() == 1);
- assert (std::find(keys.begin(), keys.end(), "config") != keys.end());
-
- pMapper->keys("root.config", keys);
- assert (keys.size() == 3);
- assert (std::find(keys.begin(), keys.end(), "value1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "value2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "sub") != keys.end());
-
- assert (pMapper->getString("root.config.value1") == "v1");
- assert (pMapper->getString("root.config.sub.value2") == "v4");
-
- pMapper->setString("root.config.value3", "v5");
- assert (pMapper->getString("root.config.value3") == "v5");
- assert (pConf->getString("config.value3") == "v5");
-}
-
-
-void ConfigurationMapperTest::testMapper4()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
- AutoPtr<AbstractConfiguration> pMapper = new ConfigurationMapper("config", "", pConf);
-
- assert (pMapper->hasProperty("value1"));
- assert (pMapper->hasProperty("value2"));
-
- AbstractConfiguration::Keys keys;
- pMapper->keys(keys);
- assert (keys.size() == 3);
- assert (std::find(keys.begin(), keys.end(), "value1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "value2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "sub") != keys.end());
-
- assert (pMapper->getString("value1") == "v1");
- assert (pMapper->getString("sub.value2") == "v4");
-
- pMapper->setString("value3", "v5");
- assert (pMapper->getString("value3") == "v5");
- assert (pConf->getString("config.value3") == "v5");
-}
-
-
-AbstractConfiguration* ConfigurationMapperTest::createConfiguration() const
-{
- AbstractConfiguration* pConfig = new MapConfiguration;
-
- pConfig->setString("config.value1", "v1");
- pConfig->setString("config.value2", "v2");
- pConfig->setString("config.sub.value1", "v3");
- pConfig->setString("config.sub.value2", "v4");
-
- return pConfig;
-}
-
-
-void ConfigurationMapperTest::setUp()
-{
-}
-
-
-void ConfigurationMapperTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ConfigurationMapperTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ConfigurationMapperTest");
-
- CppUnit_addTest(pSuite, ConfigurationMapperTest, testMapper1);
- CppUnit_addTest(pSuite, ConfigurationMapperTest, testMapper2);
- CppUnit_addTest(pSuite, ConfigurationMapperTest, testMapper3);
- CppUnit_addTest(pSuite, ConfigurationMapperTest, testMapper4);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/ConfigurationMapperTest.h b/Utilities/Poco/Util/testsuite/src/ConfigurationMapperTest.h
deleted file mode 100755
index 7a5dcf1e89..0000000000
--- a/Utilities/Poco/Util/testsuite/src/ConfigurationMapperTest.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// ConfigurationMapperTest.h
-//
-// $Id$
-//
-// Definition of the ConfigurationMapperTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ConfigurationMapperTest_INCLUDED
-#define ConfigurationMapperTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/Util/AbstractConfiguration.h"
-
-
-class ConfigurationMapperTest: public CppUnit::TestCase
-{
-public:
- ConfigurationMapperTest(const std::string& name);
- ~ConfigurationMapperTest();
-
- void testMapper1();
- void testMapper2();
- void testMapper3();
- void testMapper4();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
- Poco::Util::AbstractConfiguration* createConfiguration() const;
-};
-
-
-#endif // ConfigurationMapperTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/ConfigurationTestSuite.cpp b/Utilities/Poco/Util/testsuite/src/ConfigurationTestSuite.cpp
deleted file mode 100755
index 47d344e54b..0000000000
--- a/Utilities/Poco/Util/testsuite/src/ConfigurationTestSuite.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// ConfigurationTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ConfigurationTestSuite.h"
-#include "AbstractConfigurationTest.h"
-#include "ConfigurationViewTest.h"
-#include "ConfigurationMapperTest.h"
-#include "MapConfigurationTest.h"
-#include "LayeredConfigurationTest.h"
-#include "SystemConfigurationTest.h"
-#include "IniFileConfigurationTest.h"
-#include "PropertyFileConfigurationTest.h"
-#include "XMLConfigurationTest.h"
-#include "FilesystemConfigurationTest.h"
-#include "LoggingConfiguratorTest.h"
-
-
-CppUnit::Test* ConfigurationTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ConfigurationTestSuite");
-
- pSuite->addTest(AbstractConfigurationTest::suite());
- pSuite->addTest(ConfigurationViewTest::suite());
- pSuite->addTest(ConfigurationMapperTest::suite());
- pSuite->addTest(MapConfigurationTest::suite());
- pSuite->addTest(LayeredConfigurationTest::suite());
- pSuite->addTest(SystemConfigurationTest::suite());
- pSuite->addTest(IniFileConfigurationTest::suite());
- pSuite->addTest(PropertyFileConfigurationTest::suite());
- pSuite->addTest(XMLConfigurationTest::suite());
- pSuite->addTest(FilesystemConfigurationTest::suite());
- pSuite->addTest(LoggingConfiguratorTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/ConfigurationTestSuite.h b/Utilities/Poco/Util/testsuite/src/ConfigurationTestSuite.h
deleted file mode 100755
index f03fe7a009..0000000000
--- a/Utilities/Poco/Util/testsuite/src/ConfigurationTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// ConfigurationTestSuite.h
-//
-// $Id$
-//
-// Definition of the ConfigurationTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ConfigurationTestSuite_INCLUDED
-#define ConfigurationTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class ConfigurationTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // ConfigurationTestSuite_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/ConfigurationViewTest.cpp b/Utilities/Poco/Util/testsuite/src/ConfigurationViewTest.cpp
deleted file mode 100755
index 3bbed6261c..0000000000
--- a/Utilities/Poco/Util/testsuite/src/ConfigurationViewTest.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// ConfigurationViewTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ConfigurationViewTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/MapConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-#include <algorithm>
-
-
-using Poco::Util::AbstractConfiguration;
-using Poco::Util::MapConfiguration;
-using Poco::AutoPtr;
-
-
-ConfigurationViewTest::ConfigurationViewTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ConfigurationViewTest::~ConfigurationViewTest()
-{
-}
-
-
-void ConfigurationViewTest::testView()
-{
- AutoPtr<AbstractConfiguration> pConf = createConfiguration();
- AutoPtr<AbstractConfiguration> pView = pConf->createView("");
- assert (pView->hasProperty("prop1"));
- assert (pView->hasProperty("prop2"));
-
- AbstractConfiguration::Keys keys;
- pView->keys(keys);
- assert (keys.size() == 4);
- assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop3") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop4") != keys.end());
-
- assert (pView->getString("prop1") == "foo");
- assert (pView->getString("prop3.string1") == "foo");
-
- pView->setString("prop5", "foobar");
- assert (pConf->getString("prop5") == "foobar");
-
- pView = pConf->createView("prop1");
- pView->keys(keys);
- assert (keys.empty());
- assert (pView->hasProperty("prop1"));
-
- pView->setString("prop11", "foobar");
- assert (pConf->getString("prop1.prop11") == "foobar");
-
- pView = pConf->createView("prop3");
- pView->keys(keys);
- assert (keys.size() == 2);
- assert (std::find(keys.begin(), keys.end(), "string1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "string2") != keys.end());
-
- assert (pView->getString("string1") == "foo");
- assert (pView->getString("string2") == "bar");
-
- pView->setString("string3", "foobar");
- assert (pConf->getString("prop3.string3") == "foobar");
-
- pView = pConf->createView("prop4");
- pView->keys(keys);
- assert (keys.size() == 2);
- assert (std::find(keys.begin(), keys.end(), "prop41") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop42") != keys.end());
-
- assert (pView->getString("prop41.string1") == "FOO");
- assert (pView->getString("prop42.string2") == "Bar");
-
- pView = pConf->createView("prop4.prop41");
- pView->keys(keys);
- assert (keys.size() == 2);
- assert (std::find(keys.begin(), keys.end(), "string1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "string2") != keys.end());
-
- assert (pView->getString("string1") == "FOO");
- assert (pView->getString("string2") == "BAR");
-
- pView->setString("string3", "foobar");
- assert (pConf->getString("prop4.prop41.string3") == "foobar");
-}
-
-
-AbstractConfiguration* ConfigurationViewTest::createConfiguration() const
-{
- AbstractConfiguration* pConfig = new MapConfiguration;
-
- pConfig->setString("prop1", "foo");
- pConfig->setString("prop2", "bar");
- pConfig->setString("prop3.string1", "foo");
- pConfig->setString("prop3.string2", "bar");
- pConfig->setString("prop4.prop41.string1", "FOO");
- pConfig->setString("prop4.prop41.string2", "BAR");
- pConfig->setString("prop4.prop42.string1", "Foo");
- pConfig->setString("prop4.prop42.string2", "Bar");
-
- return pConfig;
-}
-
-
-void ConfigurationViewTest::setUp()
-{
-}
-
-
-void ConfigurationViewTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ConfigurationViewTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ConfigurationViewTest");
-
- CppUnit_addTest(pSuite, ConfigurationViewTest, testView);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/ConfigurationViewTest.h b/Utilities/Poco/Util/testsuite/src/ConfigurationViewTest.h
deleted file mode 100755
index ad65894712..0000000000
--- a/Utilities/Poco/Util/testsuite/src/ConfigurationViewTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// ConfigurationViewTest.h
-//
-// $Id$
-//
-// Definition of the ConfigurationViewTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ConfigurationViewTest_INCLUDED
-#define ConfigurationViewTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/Util/AbstractConfiguration.h"
-
-
-class ConfigurationViewTest: public CppUnit::TestCase
-{
-public:
- ConfigurationViewTest(const std::string& name);
- ~ConfigurationViewTest();
-
- void testView();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
- Poco::Util::AbstractConfiguration* createConfiguration() const;
-};
-
-
-#endif // ConfigurationViewTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/Driver.cpp b/Utilities/Poco/Util/testsuite/src/Driver.cpp
deleted file mode 100755
index 7f40594a4a..0000000000
--- a/Utilities/Poco/Util/testsuite/src/Driver.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Driver.cpp
-//
-// $Id$
-//
-// Console-based test driver for Poco Util.
-//
-// Copyright (c) 2004-2006, 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 "CppUnit/TestRunner.h"
-#include "UtilTestSuite.h"
-
-
-CppUnitMain(UtilTestSuite)
diff --git a/Utilities/Poco/Util/testsuite/src/FilesystemConfigurationTest.cpp b/Utilities/Poco/Util/testsuite/src/FilesystemConfigurationTest.cpp
deleted file mode 100755
index b36aec461e..0000000000
--- a/Utilities/Poco/Util/testsuite/src/FilesystemConfigurationTest.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// FilesystemConfigurationTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "FilesystemConfigurationTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/FilesystemConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include <algorithm>
-
-
-using Poco::Util::FilesystemConfiguration;
-using Poco::Util::AbstractConfiguration;
-using Poco::AutoPtr;
-
-
-FilesystemConfigurationTest::FilesystemConfigurationTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-FilesystemConfigurationTest::~FilesystemConfigurationTest()
-{
-}
-
-
-void FilesystemConfigurationTest::testFilesystemConfiguration()
-{
- AutoPtr<FilesystemConfiguration> config = new FilesystemConfiguration("TestConfiguration");
-
- config->setString("logging.loggers.root.channel.class", "ConsoleChannel");
- config->setString("logging.loggers.app.name", "Application");
- config->setString("logging.loggers.app.channel", "c1");
- config->setString("logging.formatters.f1.class", "PatternFormatter");
- config->setString("logging.formatters.f1.pattern", "[%p] %t");
- config->setString("logging.channels.c1.class", "ConsoleChannel");
-
- assert (config->getString("logging.loggers.root.channel.class") == "ConsoleChannel");
- assert (config->getString("logging.loggers.app.name") == "Application");
- assert (config->getString("logging.loggers.app.channel") == "c1");
- assert (config->getString("logging.formatters.f1.class") == "PatternFormatter");
- assert (config->getString("logging.formatters.f1.pattern") == "[%p] %t");
-
- config->setString("logging.loggers.app.channel", "c2");
- assert (config->getString("logging.loggers.app.channel") == "c2");
-
- AbstractConfiguration::Keys keys;
- config->keys(keys);
- assert (keys.size() == 1);
- assert (std::find(keys.begin(), keys.end(), "logging") != keys.end());
-
- config->keys("logging", keys);
- assert (keys.size() == 3);
- assert (std::find(keys.begin(), keys.end(), "loggers") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "formatters") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "channels") != keys.end());
-
- config->keys("logging.formatters", keys);
- assert (keys.size() == 1);
- assert (std::find(keys.begin(), keys.end(), "f1") != keys.end());
-
- config->keys("logging.formatters.f1", keys);
- assert (keys.size() == 2);
- assert (std::find(keys.begin(), keys.end(), "class") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "pattern") != keys.end());
-
- assert (config->hasProperty("logging.loggers.root.channel.class"));
- config->clear();
- assert (!config->hasProperty("logging.loggers.root.channel.class"));
-}
-
-
-void FilesystemConfigurationTest::setUp()
-{
-}
-
-
-void FilesystemConfigurationTest::tearDown()
-{
-}
-
-
-CppUnit::Test* FilesystemConfigurationTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FilesystemConfigurationTest");
-
- CppUnit_addTest(pSuite, FilesystemConfigurationTest, testFilesystemConfiguration);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/FilesystemConfigurationTest.h b/Utilities/Poco/Util/testsuite/src/FilesystemConfigurationTest.h
deleted file mode 100755
index 383a8d02c1..0000000000
--- a/Utilities/Poco/Util/testsuite/src/FilesystemConfigurationTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// FilesystemConfigurationTest.h
-//
-// $Id$
-//
-// Definition of the FilesystemConfigurationTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef FilesystemConfigurationTest_INCLUDED
-#define FilesystemConfigurationTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class FilesystemConfigurationTest: public CppUnit::TestCase
-{
-public:
- FilesystemConfigurationTest(const std::string& name);
- ~FilesystemConfigurationTest();
-
- void testFilesystemConfiguration();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // FilesystemConfigurationTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/HelpFormatterTest.cpp b/Utilities/Poco/Util/testsuite/src/HelpFormatterTest.cpp
deleted file mode 100755
index c7db9f2320..0000000000
--- a/Utilities/Poco/Util/testsuite/src/HelpFormatterTest.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// HelpFormatterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "HelpFormatterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/Option.h"
-#include "Poco/Util/OptionSet.h"
-#include "Poco/Util/HelpFormatter.h"
-#include <iostream>
-
-
-using Poco::Util::Option;
-using Poco::Util::OptionSet;
-using Poco::Util::HelpFormatter;
-
-
-HelpFormatterTest::HelpFormatterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-HelpFormatterTest::~HelpFormatterTest()
-{
-}
-
-
-void HelpFormatterTest::testHelpFormatter()
-{
- OptionSet set;
- set.addOption(
- Option("include-dir", "I", "specify a search path for locating header files")
- .required(false)
- .repeatable(true)
- .argument("path"));
-
- set.addOption(
- Option("library-dir", "L", "specify a search path for locating library files (this option has a very long description)")
- .required(false)
- .repeatable(true)
- .argument("path"));
-
- set.addOption(
- Option("output", "o", "specify the output file", true)
- .argument("file", true));
-
- set.addOption(
- Option("verbose", "v")
- .description("enable verbose mode")
- .required(false)
- .repeatable(false));
-
- set.addOption(
- Option("optimize", "O")
- .description("enable optimization")
- .required(false)
- .repeatable(false)
- .argument("level", false));
-
- HelpFormatter formatter(set);
- formatter.format(std::cout);
-
- formatter.setCommand("cc");
- formatter.format(std::cout);
-
- formatter.setUsage("OPTIONS FILES");
- formatter.setHeader("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "
- "Vivamus volutpat imperdiet massa. Nulla at ipsum vitae risus facilisis posuere. "
- "Cras convallis, lacus ac vulputate convallis, metus nisl euismod ligula, "
- "ac euismod diam wisi in dolor.\nMauris vitae leo.");
- formatter.setFooter("Cras semper mollis tellus. Mauris eleifend mauris et lorem. "
- "Etiam odio dolor, fermentum quis, mollis nec, sodales sed, tellus. "
- "Quisque consequat orci eu augue. Aliquam ac nibh ac neque hendrerit iaculis.");
- formatter.format(std::cout);
-
- formatter.setUnixStyle(false);
- formatter.format(std::cout);
-
- formatter.setHeader("");
- formatter.setFooter("tab: a\tb\tcde\tf\n\ta\n\t\tb");
- formatter.format(std::cout);
-}
-
-
-void HelpFormatterTest::setUp()
-{
-}
-
-
-void HelpFormatterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* HelpFormatterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HelpFormatterTest");
-
- CppUnit_addTest(pSuite, HelpFormatterTest, testHelpFormatter);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/HelpFormatterTest.h b/Utilities/Poco/Util/testsuite/src/HelpFormatterTest.h
deleted file mode 100755
index 908dc07c98..0000000000
--- a/Utilities/Poco/Util/testsuite/src/HelpFormatterTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// HelpFormatterTest.h
-//
-// $Id$
-//
-// Definition of the HelpFormatterTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef HelpFormatterTest_INCLUDED
-#define HelpFormatterTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class HelpFormatterTest: public CppUnit::TestCase
-{
-public:
- HelpFormatterTest(const std::string& name);
- ~HelpFormatterTest();
-
- void testHelpFormatter();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // HelpFormatterTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/IniFileConfigurationTest.cpp b/Utilities/Poco/Util/testsuite/src/IniFileConfigurationTest.cpp
deleted file mode 100755
index ca426aa30c..0000000000
--- a/Utilities/Poco/Util/testsuite/src/IniFileConfigurationTest.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// IniFileConfigurationTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "IniFileConfigurationTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/IniFileConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-#include <sstream>
-#include <algorithm>
-
-
-using Poco::Util::IniFileConfiguration;
-using Poco::Util::AbstractConfiguration;
-using Poco::AutoPtr;
-using Poco::NotImplementedException;
-using Poco::NotFoundException;
-
-
-IniFileConfigurationTest::IniFileConfigurationTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-IniFileConfigurationTest::~IniFileConfigurationTest()
-{
-}
-
-
-void IniFileConfigurationTest::testLoad()
-{
- static const std::string iniFile =
- "; comment\n"
- " ; comment \n"
- "prop1=value1\n"
- " prop2 = value2 \n"
- "[section1]\n"
- "prop1 = value3\r\n"
- "\tprop2=value4\r\n"
- ";prop3=value7\r\n"
- "\n"
- " [ section 2 ]\n"
- "prop1 = value 5\n"
- "\t \n"
- "Prop2 = value6";
-
- std::istringstream istr(iniFile);
- AutoPtr<IniFileConfiguration> pConf = new IniFileConfiguration(istr);
-
- assert (pConf->getString("prop1") == "value1");
- assert (pConf->getString("prop2") == "value2");
- assert (pConf->getString("section1.prop1") == "value3");
- assert (pConf->getString("Section1.Prop2") == "value4");
- assert (pConf->getString("section 2.prop1") == "value 5");
- assert (pConf->getString("section 2.prop2") == "value6");
- assert (pConf->getString("SECTION 2.PROP2") == "value6");
-
- AbstractConfiguration::Keys keys;
- pConf->keys(keys);
- assert (keys.size() == 4);
- assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "section1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "section 2") != keys.end());
-
- pConf->keys("Section1", keys);
- assert (keys.size() == 2);
- assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end());
-
- try
- {
- pConf->setString("foo", "bar");
- fail("Not supported - must throw");
- }
- catch (NotImplementedException&)
- {
- }
-
- try
- {
- std::string s = pConf->getString("foo");
- fail("No property - must throw");
- }
- catch (NotFoundException&)
- {
- }
-}
-
-
-void IniFileConfigurationTest::setUp()
-{
-}
-
-
-void IniFileConfigurationTest::tearDown()
-{
-}
-
-
-CppUnit::Test* IniFileConfigurationTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("IniFileConfigurationTest");
-
- CppUnit_addTest(pSuite, IniFileConfigurationTest, testLoad);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/IniFileConfigurationTest.h b/Utilities/Poco/Util/testsuite/src/IniFileConfigurationTest.h
deleted file mode 100755
index 0679451923..0000000000
--- a/Utilities/Poco/Util/testsuite/src/IniFileConfigurationTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// IniFileConfigurationTest.h
-//
-// $Id$
-//
-// Definition of the IniFileConfigurationTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef IniFileConfigurationTest_INCLUDED
-#define IniFileConfigurationTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class IniFileConfigurationTest: public CppUnit::TestCase
-{
-public:
- IniFileConfigurationTest(const std::string& name);
- ~IniFileConfigurationTest();
-
- void testLoad();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // IniFileConfigurationTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/LayeredConfigurationTest.cpp b/Utilities/Poco/Util/testsuite/src/LayeredConfigurationTest.cpp
deleted file mode 100755
index 50367d8edd..0000000000
--- a/Utilities/Poco/Util/testsuite/src/LayeredConfigurationTest.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// LayeredConfigurationTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "LayeredConfigurationTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/LayeredConfiguration.h"
-#include "Poco/Util/MapConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-#include <algorithm>
-
-
-using Poco::Util::AbstractConfiguration;
-using Poco::Util::LayeredConfiguration;
-using Poco::Util::MapConfiguration;
-using Poco::AutoPtr;
-using Poco::NotFoundException;
-using Poco::RuntimeException;
-
-
-LayeredConfigurationTest::LayeredConfigurationTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-LayeredConfigurationTest::~LayeredConfigurationTest()
-{
-}
-
-
-void LayeredConfigurationTest::testEmpty()
-{
- AutoPtr<LayeredConfiguration> pLC = new LayeredConfiguration;
-
- AbstractConfiguration::Keys keys;
- pLC->keys(keys);
- assert (keys.empty());
-
- assert (!pLC->hasProperty("foo"));
- try
- {
- pLC->setString("foo", "bar");
- fail("empty LayeredConfiguration - must throw");
- }
- catch (RuntimeException&)
- {
- }
-
- try
- {
- std::string s = pLC->getString("foo");
- fail("empty LayeredConfiguration - must throw");
- }
- catch (NotFoundException&)
- {
- }
-}
-
-
-void LayeredConfigurationTest::testOneLayer()
-{
- AutoPtr<LayeredConfiguration> pLC = new LayeredConfiguration;
- AutoPtr<MapConfiguration> pMC = new MapConfiguration;
-
- pMC->setString("prop1", "value1");
- pMC->setString("prop2", "value2");
-
- pLC->addWriteable(pMC, 0);
-
- AbstractConfiguration::Keys keys;
- pLC->keys(keys);
- assert (keys.size() == 2);
- assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end());
-
- assert (pLC->getString("prop1") == "value1");
- assert (pLC->getString("prop2") == "value2");
-
- pLC->setString("prop3", "value3");
- assert (pLC->getString("prop3") == "value3");
-}
-
-
-void LayeredConfigurationTest::testTwoLayers()
-{
- AutoPtr<LayeredConfiguration> pLC = new LayeredConfiguration;
- AutoPtr<MapConfiguration> pMC1 = new MapConfiguration;
- AutoPtr<MapConfiguration> pMC2 = new MapConfiguration;
-
- pMC1->setString("prop1", "value1");
- pMC1->setString("prop2", "value2");
- pMC2->setString("prop2", "value3");
- pMC2->setString("prop3", "value4");
-
- pLC->add(pMC1, 0);
- pLC->addWriteable(pMC2, 1);
-
- AbstractConfiguration::Keys keys;
- pLC->keys(keys);
- assert (keys.size() == 3);
- assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop3") != keys.end());
-
- assert (pLC->getString("prop1") == "value1");
- assert (pLC->getString("prop2") == "value2");
- assert (pLC->getString("prop3") == "value4");
-
- pLC->setString("prop4", "value4");
- assert (pLC->getString("prop4") == "value4");
-
- assert (!pMC1->hasProperty("prop4"));
- assert (pMC2->hasProperty("prop4"));
-
- pLC->setString("prop1", "value11");
- assert (pLC->getString("prop1") == "value1");
- assert (pMC2->getString("prop1") == "value11");
-}
-
-
-void LayeredConfigurationTest::testThreeLayers()
-{
- AutoPtr<LayeredConfiguration> pLC = new LayeredConfiguration;
- AutoPtr<MapConfiguration> pMC1 = new MapConfiguration;
- AutoPtr<MapConfiguration> pMC2 = new MapConfiguration;
- AutoPtr<MapConfiguration> pMC3 = new MapConfiguration;
-
- pMC1->setString("prop1", "value1");
- pMC1->setString("prop2", "value2");
- pMC1->setString("prop3", "value3");
- pMC2->setString("prop2", "value4");
- pMC2->setString("prop4", "value5");
- pMC3->setString("prop5", "value6");
- pMC3->setString("prop1", "value7");
-
- pLC->add(pMC1, 0);
- pLC->add(pMC2, 1);
- pLC->add(pMC3, -1);
-
- assert (pLC->getString("prop1") == "value7");
- assert (pLC->getString("prop2") == "value2");
- assert (pLC->getString("prop3") == "value3");
- assert (pLC->getString("prop4") == "value5");
- assert (pLC->getString("prop5") == "value6");
-}
-
-
-void LayeredConfigurationTest::setUp()
-{
-}
-
-
-void LayeredConfigurationTest::tearDown()
-{
-}
-
-
-CppUnit::Test* LayeredConfigurationTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LayeredConfigurationTest");
-
- CppUnit_addTest(pSuite, LayeredConfigurationTest, testEmpty);
- CppUnit_addTest(pSuite, LayeredConfigurationTest, testOneLayer);
- CppUnit_addTest(pSuite, LayeredConfigurationTest, testTwoLayers);
- CppUnit_addTest(pSuite, LayeredConfigurationTest, testThreeLayers);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/LayeredConfigurationTest.h b/Utilities/Poco/Util/testsuite/src/LayeredConfigurationTest.h
deleted file mode 100755
index a516119c19..0000000000
--- a/Utilities/Poco/Util/testsuite/src/LayeredConfigurationTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// LayeredConfigurationTest.h
-//
-// $Id$
-//
-// Definition of the LayeredConfigurationTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef LayeredConfigurationTest_INCLUDED
-#define LayeredConfigurationTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class LayeredConfigurationTest: public CppUnit::TestCase
-{
-public:
- LayeredConfigurationTest(const std::string& name);
- ~LayeredConfigurationTest();
-
- void testEmpty();
- void testOneLayer();
- void testTwoLayers();
- void testThreeLayers();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // LayeredConfigurationTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/LoggingConfiguratorTest.cpp b/Utilities/Poco/Util/testsuite/src/LoggingConfiguratorTest.cpp
deleted file mode 100755
index 2218546fdc..0000000000
--- a/Utilities/Poco/Util/testsuite/src/LoggingConfiguratorTest.cpp
+++ /dev/null
@@ -1,331 +0,0 @@
-//
-// LoggingConfiguratorTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "LoggingConfiguratorTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/LoggingConfigurator.h"
-#include "Poco/Util/PropertyFileConfiguration.h"
-#include "Poco/LoggingRegistry.h"
-#include "Poco/ConsoleChannel.h"
-#if defined(_WIN32)
-#include "Poco/WindowsConsoleChannel.h"
-#endif
-#include "Poco/FileChannel.h"
-#include "Poco/SplitterChannel.h"
-#include "Poco/FormattingChannel.h"
-#include "Poco/PatternFormatter.h"
-#include "Poco/Logger.h"
-#include "Poco/Message.h"
-#include "Poco/AutoPtr.h"
-#include <sstream>
-
-
-using Poco::Util::LoggingConfigurator;
-using Poco::Util::PropertyFileConfiguration;
-using Poco::LoggingRegistry;
-using Poco::Channel;
-using Poco::ConsoleChannel;
-using Poco::FileChannel;
-using Poco::SplitterChannel;
-using Poco::FormattingChannel;
-using Poco::PatternFormatter;
-using Poco::Logger;
-using Poco::Message;
-using Poco::AutoPtr;
-
-
-LoggingConfiguratorTest::LoggingConfiguratorTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-LoggingConfiguratorTest::~LoggingConfiguratorTest()
-{
-}
-
-
-void LoggingConfiguratorTest::testConfigurator()
-{
- static const std::string config =
- "logging.loggers.root.channel = c1\n"
- "logging.loggers.root.level = warning\n"
- "logging.loggers.l1.name = logger1\n"
- "logging.loggers.l1.channel.class = FileChannel\n"
- "logging.loggers.l1.channel.pattern = %s: [%p] %t\n"
- "logging.loggers.l1.channel.path = logfile.log\n"
- "logging.loggers.l1.level = information\n"
- "logging.loggers.l2.name = logger2\n"
- "logging.loggers.l2.channel.class = SplitterChannel\n"
- "logging.loggers.l2.channel.channel1 = c2\n"
- "logging.loggers.l2.channel.channel2 = c3\n"
- "logging.loggers.l2.level = debug\n"
- "logging.channels.c1.class = ConsoleChannel\n"
- "logging.channels.c1.formatter = f1\n"
- "logging.channels.c2.class = FileChannel\n"
- "logging.channels.c2.path = ${system.tempDir}/sample.log\n"
- "logging.channels.c2.formatter.class = PatternFormatter\n"
- "logging.channels.c2.formatter.pattern = %s: {%p} %t\n"
- "logging.channels.c3.class = ConsoleChannel\n"
- "logging.channels.c3.pattern = %s: [%p] %t\n"
- "logging.formatters.f1.class = PatternFormatter\n"
- "logging.formatters.f1.pattern = %s-[%p] %t\n"
- "logging.formatters.f1.times = UTC\n";
-
- std::istringstream istr(config);
- AutoPtr<PropertyFileConfiguration> pConfig = new PropertyFileConfiguration(istr);
-
- LoggingConfigurator configurator;
- configurator.configure(pConfig);
-
- Logger& root = Logger::get("");
- assert (root.getLevel() == Message::PRIO_WARNING);
- FormattingChannel* pFC = dynamic_cast<FormattingChannel*>(root.getChannel());
- assertNotNull (pFC);
-#if defined(_WIN32)
- assertNotNull (dynamic_cast<Poco::WindowsConsoleChannel*>(pFC->getChannel()));
-#else
- assertNotNull (dynamic_cast<ConsoleChannel*>(pFC->getChannel()));
-#endif
- assertNotNull (dynamic_cast<PatternFormatter*>(pFC->getFormatter()));
- assert (static_cast<PatternFormatter*>(pFC->getFormatter())->getProperty("pattern") == "%s-[%p] %t");
-
- Logger& logger1 = Logger::get("logger1");
- assert (logger1.getLevel() == Message::PRIO_INFORMATION);
- pFC = dynamic_cast<FormattingChannel*>(logger1.getChannel());
- assertNotNull (pFC);
- assertNotNull (dynamic_cast<FileChannel*>(pFC->getChannel()));
- assertNotNull (dynamic_cast<PatternFormatter*>(pFC->getFormatter()));
- assert (static_cast<PatternFormatter*>(pFC->getFormatter())->getProperty("pattern") == "%s: [%p] %t");
-
- Logger& logger2 = Logger::get("logger2");
- assert (logger2.getLevel() == Message::PRIO_DEBUG);
- assertNotNull (dynamic_cast<SplitterChannel*>(logger2.getChannel()));
-}
-
-
-void LoggingConfiguratorTest::testBadConfiguration1()
-{
- // this is mainly testing for memory leaks in case of
- // a bad configuration.
-
- static const std::string config =
- "logging.loggers.root.channel = c1\n"
- "logging.loggers.root.level = warning\n"
- "logging.loggers.l1.name = logger1\n"
- "logging.loggers.l1.channel.class = FileChannel\n"
- "logging.loggers.l1.channel.pattern = %s: [%p] %t\n"
- "logging.loggers.l1.channel.path = logfile.log\n"
- "logging.loggers.l1.level = information\n"
- "logging.loggers.l2.name = logger2\n"
- "logging.loggers.l2.channel.class = UnknownChannel\n"
- "logging.loggers.l2.level = debug\n"
- "logging.channels.c1.class = ConsoleChannel\n"
- "logging.channels.c1.formatter = f1\n"
- "logging.channels.c2.class = FileChannel\n"
- "logging.channels.c2.path = ${system.tempDir}/sample.log\n"
- "logging.channels.c2.formatter.class = PatternFormatter\n"
- "logging.channels.c2.formatter.pattern = %s: {%p} %t\n"
- "logging.channels.c3.class = ConsoleChannel\n"
- "logging.channels.c3.pattern = %s: [%p] %t\n"
- "logging.formatters.f1.class = PatternFormatter\n"
- "logging.formatters.f1.pattern = %s-[%p] %t\n"
- "logging.formatters.f1.times = UTC\n";
-
- std::istringstream istr(config);
- AutoPtr<PropertyFileConfiguration> pConfig = new PropertyFileConfiguration(istr);
-
- LoggingConfigurator configurator;
- try
- {
- configurator.configure(pConfig);
- fail("bad configuration - must throw");
- }
- catch (Poco::Exception&)
- {
- }
-}
-
-
-void LoggingConfiguratorTest::testBadConfiguration2()
-{
- // this is mainly testing for memory leaks in case of
- // a bad configuration.
-
- static const std::string config =
- "logging.loggers.root.channel = c1\n"
- "logging.loggers.root.level = unknown\n"
- "logging.loggers.l1.name = logger1\n"
- "logging.loggers.l1.channel.class = FileChannel\n"
- "logging.loggers.l1.channel.pattern = %s: [%p] %t\n"
- "logging.loggers.l1.channel.path = logfile.log\n"
- "logging.loggers.l1.level = information\n"
- "logging.loggers.l2.name = logger2\n"
- "logging.loggers.l2.channel.class = SplitterChannel\n"
- "logging.loggers.l2.level = debug\n"
- "logging.channels.c1.class = ConsoleChannel\n"
- "logging.channels.c1.formatter = f1\n"
- "logging.channels.c2.class = FileChannel\n"
- "logging.channels.c2.path = ${system.tempDir}/sample.log\n"
- "logging.channels.c2.formatter.class = PatternFormatter\n"
- "logging.channels.c2.formatter.pattern = %s: {%p} %t\n"
- "logging.channels.c3.class = ConsoleChannel\n"
- "logging.channels.c3.pattern = %s: [%p] %t\n"
- "logging.formatters.f1.class = PatternFormatter\n"
- "logging.formatters.f1.pattern = %s-[%p] %t\n"
- "logging.formatters.f1.times = UTC\n";
-
- std::istringstream istr(config);
- AutoPtr<PropertyFileConfiguration> pConfig = new PropertyFileConfiguration(istr);
-
- LoggingConfigurator configurator;
- try
- {
- configurator.configure(pConfig);
- fail("bad configuration - must throw");
- }
- catch (Poco::Exception&)
- {
- }
-}
-
-
-void LoggingConfiguratorTest::testBadConfiguration3()
-{
- // this is mainly testing for memory leaks in case of
- // a bad configuration.
-
- static const std::string config =
- "logging.loggers.root.channel = c1\n"
- "logging.loggers.root.level = warning\n"
- "logging.loggers.l1.name = logger1\n"
- "logging.loggers.l1.channel.class = FileChannel\n"
- "logging.loggers.l1.channel.pattern = %s: [%p] %t\n"
- "logging.loggers.l1.channel.path = logfile.log\n"
- "logging.loggers.l1.level = information\n"
- "logging.loggers.l2.name = logger2\n"
- "logging.loggers.l2.channel.class = UnknownChannel\n"
- "logging.loggers.l2.level = debug\n"
- "logging.channels.c1.class = ConsoleChannel\n"
- "logging.channels.c1.formatter = f1\n"
- "logging.channels.c2.class = FileChannel\n"
- "logging.channels.c2.path = ${system.tempDir}/sample.log\n"
- "logging.channels.c2.formatter.class = UnknownFormatter\n"
- "logging.channels.c2.formatter.pattern = %s: {%p} %t\n"
- "logging.channels.c3.class = ConsoleChannel\n"
- "logging.channels.c3.pattern = %s: [%p] %t\n"
- "logging.formatters.f1.class = PatternFormatter\n"
- "logging.formatters.f1.pattern = %s-[%p] %t\n"
- "logging.formatters.f1.times = UTC\n";
-
- std::istringstream istr(config);
- AutoPtr<PropertyFileConfiguration> pConfig = new PropertyFileConfiguration(istr);
-
- LoggingConfigurator configurator;
- try
- {
- configurator.configure(pConfig);
- fail("bad configuration - must throw");
- }
- catch (Poco::Exception&)
- {
- }
-}
-
-
-void LoggingConfiguratorTest::testBadConfiguration4()
-{
- // this is mainly testing for memory leaks in case of
- // a bad configuration.
-
- static const std::string config =
- "logging.loggers.root.channel = c1\n"
- "logging.loggers.root.level = warning\n"
- "logging.loggers.l1.name = logger1\n"
- "logging.loggers.l1.channel.class = FileChannel\n"
- "logging.loggers.l1.channel.pattern = %s: [%p] %t\n"
- "logging.loggers.l1.channel.path = logfile.log\n"
- "logging.loggers.l1.level = information\n"
- "logging.loggers.l2.name = logger2\n"
- "logging.loggers.l2.channel.class = UnknownChannel\n"
- "logging.loggers.l2.level = debug\n"
- "logging.channels.c1.class = ConsoleChannel\n"
- "logging.channels.c1.formatter = f1\n"
- "logging.channels.c2.class = FileChannel\n"
- "logging.channels.c2.path = ${system.tempDir}/sample.log\n"
- "logging.channels.c2.formatter.class = PatternFormatter\n"
- "logging.channels.c2.formatter.pattern = %s: {%p} %t\n"
- "logging.channels.c2.formatter.unknown = FOO\n"
- "logging.channels.c3.class = ConsoleChannel\n"
- "logging.channels.c3.pattern = %s: [%p] %t\n"
- "logging.formatters.f1.class = PatternFormatter\n"
- "logging.formatters.f1.pattern = %s-[%p] %t\n"
- "logging.formatters.f1.times = UTC\n";
-
- std::istringstream istr(config);
- AutoPtr<PropertyFileConfiguration> pConfig = new PropertyFileConfiguration(istr);
-
- LoggingConfigurator configurator;
- try
- {
- configurator.configure(pConfig);
- fail("bad configuration - must throw");
- }
- catch (Poco::Exception&)
- {
- }
-}
-
-
-void LoggingConfiguratorTest::setUp()
-{
- LoggingRegistry::defaultRegistry().clear();
-}
-
-
-void LoggingConfiguratorTest::tearDown()
-{
-}
-
-
-CppUnit::Test* LoggingConfiguratorTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LoggingConfiguratorTest");
-
- CppUnit_addTest(pSuite, LoggingConfiguratorTest, testConfigurator);
- CppUnit_addTest(pSuite, LoggingConfiguratorTest, testBadConfiguration1);
- CppUnit_addTest(pSuite, LoggingConfiguratorTest, testBadConfiguration2);
- CppUnit_addTest(pSuite, LoggingConfiguratorTest, testBadConfiguration3);
- CppUnit_addTest(pSuite, LoggingConfiguratorTest, testBadConfiguration4);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/LoggingConfiguratorTest.h b/Utilities/Poco/Util/testsuite/src/LoggingConfiguratorTest.h
deleted file mode 100755
index f9b0c4589b..0000000000
--- a/Utilities/Poco/Util/testsuite/src/LoggingConfiguratorTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// LoggingConfiguratorTest.h
-//
-// $Id$
-//
-// Definition of the LoggingConfiguratorTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef LoggingConfiguratorTest_INCLUDED
-#define LoggingConfiguratorTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class LoggingConfiguratorTest: public CppUnit::TestCase
-{
-public:
- LoggingConfiguratorTest(const std::string& name);
- ~LoggingConfiguratorTest();
-
- void testConfigurator();
- void testBadConfiguration1();
- void testBadConfiguration2();
- void testBadConfiguration3();
- void testBadConfiguration4();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // LoggingConfiguratorTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/MapConfigurationTest.cpp b/Utilities/Poco/Util/testsuite/src/MapConfigurationTest.cpp
deleted file mode 100755
index 9b1749598d..0000000000
--- a/Utilities/Poco/Util/testsuite/src/MapConfigurationTest.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// MapConfigurationTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "MapConfigurationTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/MapConfiguration.h"
-#include "Poco/AutoPtr.h"
-
-
-using Poco::Util::MapConfiguration;
-using Poco::AutoPtr;
-
-
-MapConfigurationTest::MapConfigurationTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-MapConfigurationTest::~MapConfigurationTest()
-{
-}
-
-
-void MapConfigurationTest::testClear()
-{
- AutoPtr<MapConfiguration> pConf = new MapConfiguration;
-
- pConf->setString("foo", "bar");
- assert (pConf->hasProperty("foo"));
-
- pConf->clear();
- assert (!pConf->hasProperty("foo"));
-}
-
-
-void MapConfigurationTest::setUp()
-{
-}
-
-
-void MapConfigurationTest::tearDown()
-{
-}
-
-
-CppUnit::Test* MapConfigurationTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("MapConfigurationTest");
-
- CppUnit_addTest(pSuite, MapConfigurationTest, testClear);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/MapConfigurationTest.h b/Utilities/Poco/Util/testsuite/src/MapConfigurationTest.h
deleted file mode 100755
index e7b5bf6f65..0000000000
--- a/Utilities/Poco/Util/testsuite/src/MapConfigurationTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// MapConfigurationTest.h
-//
-// $Id$
-//
-// Definition of the MapConfigurationTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef MapConfigurationTest_INCLUDED
-#define MapConfigurationTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class MapConfigurationTest: public CppUnit::TestCase
-{
-public:
- MapConfigurationTest(const std::string& name);
- ~MapConfigurationTest();
-
- void testClear();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // MapConfigurationTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/OptionProcessorTest.cpp b/Utilities/Poco/Util/testsuite/src/OptionProcessorTest.cpp
deleted file mode 100755
index 2f4874e8b8..0000000000
--- a/Utilities/Poco/Util/testsuite/src/OptionProcessorTest.cpp
+++ /dev/null
@@ -1,325 +0,0 @@
-//
-// OptionProcessorTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "OptionProcessorTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/Option.h"
-#include "Poco/Util/OptionSet.h"
-#include "Poco/Util/OptionProcessor.h"
-#include "Poco/Util/OptionException.h"
-
-
-using Poco::Util::Option;
-using Poco::Util::OptionSet;
-using Poco::Util::OptionProcessor;
-
-
-OptionProcessorTest::OptionProcessorTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-OptionProcessorTest::~OptionProcessorTest()
-{
-}
-
-
-void OptionProcessorTest::testUnix()
-{
- OptionSet set;
- set.addOption(
- Option("include-dir", "I", "specify a search path for locating header files")
- .required(false)
- .repeatable(true)
- .argument("path"));
-
- set.addOption(
- Option("library-dir", "L", "specify a search path for locating library files")
- .required(false)
- .repeatable(true)
- .argument("path"));
-
- set.addOption(
- Option("output", "o", "specify the output file", true)
- .argument("file", true));
-
- set.addOption(
- Option("verbose", "v")
- .description("enable verbose mode")
- .required(false)
- .repeatable(false));
-
- set.addOption(
- Option("optimize", "O")
- .description("enable optimization")
- .required(false)
- .repeatable(false)
- .argument("level", false)
- .group("mode"));
-
- set.addOption(
- Option("debug", "g")
- .description("generate debug information")
- .required(false)
- .repeatable(false)
- .group("mode"));
-
- set.addOption(
- Option("info", "i")
- .description("print information")
- .required(false)
- .repeatable(false));
-
- OptionProcessor p1(set);
- std::string name;
- std::string value;
-
- assert (p1.process("-I/usr/include", name, value));
- assert (name == "include-dir");
- assert (value == "/usr/include");
-
- assert (p1.process("--include:/usr/local/include", name, value));
- assert (name == "include-dir");
- assert (value == "/usr/local/include");
-
- assert (p1.process("--lib=/usr/local/lib", name, value));
- assert (name == "library-dir");
- assert (value == "/usr/local/lib");
-
- assert (p1.process("-ofile", name, value));
- assert (name == "output");
- assert (value == "file");
-
- assert (!p1.process("src/file.cpp", name, value));
- assert (!p1.process("/src/file.cpp", name, value));
-
- try
- {
- p1.process("--output:file", name, value);
- fail("duplicate - must throw");
- }
- catch (Poco::Util::DuplicateOptionException&)
- {
- }
-
- assert (p1.process("-g", name, value));
- assert (name == "debug");
- assert (value == "");
-
- try
- {
- p1.process("--optimize", name, value);
- fail("incompatible - must throw");
- }
- catch (Poco::Util::IncompatibleOptionsException&)
- {
- }
-
- try
- {
- p1.process("-x", name, value);
- fail("unknown option - must throw");
- }
- catch (Poco::Util::UnknownOptionException&)
- {
- }
-
- try
- {
- p1.process("--in", name, value);
- fail("ambiguous option - must throw");
- }
- catch (Poco::Util::AmbiguousOptionException&)
- {
- }
-}
-
-
-void OptionProcessorTest::testDefault()
-{
- OptionSet set;
- set.addOption(
- Option("include-dir", "I", "specify a search path for locating header files")
- .required(false)
- .repeatable(true)
- .argument("path"));
-
- set.addOption(
- Option("library-dir", "L", "specify a search path for locating library files")
- .required(false)
- .repeatable(true)
- .argument("path"));
-
- set.addOption(
- Option("output", "o", "specify the output file", true)
- .argument("file", true));
-
- set.addOption(
- Option("verbose", "v")
- .description("enable verbose mode")
- .required(false)
- .repeatable(false));
-
- set.addOption(
- Option("optimize", "O")
- .description("enable optimization")
- .required(false)
- .repeatable(false)
- .argument("level", false)
- .group("mode"));
-
- set.addOption(
- Option("debug", "g")
- .description("generate debug information")
- .required(false)
- .repeatable(false)
- .group("mode"));
-
- set.addOption(
- Option("info", "i")
- .description("print information")
- .required(false)
- .repeatable(false));
-
- OptionProcessor p1(set);
- p1.setUnixStyle(false);
- std::string name;
- std::string value;
-
- assert (p1.process("/Inc:/usr/include", name, value));
- assert (name == "include-dir");
- assert (value == "/usr/include");
-
- assert (p1.process("/include:/usr/local/include", name, value));
- assert (name == "include-dir");
- assert (value == "/usr/local/include");
-
- assert (p1.process("/lib=/usr/local/lib", name, value));
- assert (name == "library-dir");
- assert (value == "/usr/local/lib");
-
- assert (p1.process("/out:file", name, value));
- assert (name == "output");
- assert (value == "file");
-
- assert (!p1.process("src/file.cpp", name, value));
- assert (!p1.process("\\src\\file.cpp", name, value));
-
- try
- {
- p1.process("/output:file", name, value);
- fail("duplicate - must throw");
- }
- catch (Poco::Util::DuplicateOptionException&)
- {
- }
-
- assert (p1.process("/debug", name, value));
- assert (name == "debug");
- assert (value == "");
-
- try
- {
- p1.process("/OPT", name, value);
- fail("incompatible - must throw");
- }
- catch (Poco::Util::IncompatibleOptionsException&)
- {
- }
-
- try
- {
- p1.process("/x", name, value);
- fail("unknown option - must throw");
- }
- catch (Poco::Util::UnknownOptionException&)
- {
- }
-
- try
- {
- p1.process("/in", name, value);
- fail("ambiguous option - must throw");
- }
- catch (Poco::Util::AmbiguousOptionException&)
- {
- }
-}
-
-
-void OptionProcessorTest::testRequired()
-{
- OptionSet set;
- set.addOption(
- Option("option", "o")
- .required(true)
- .repeatable(true));
-
- OptionProcessor p1(set);
- std::string name;
- std::string value;
-
- try
- {
- p1.checkRequired();
- fail("no options specified - must throw");
- }
- catch (Poco::Util::MissingOptionException&)
- {
- }
-
- assert (p1.process("-o", name, value));
- p1.checkRequired();
-}
-
-
-void OptionProcessorTest::setUp()
-{
-}
-
-
-void OptionProcessorTest::tearDown()
-{
-}
-
-
-CppUnit::Test* OptionProcessorTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("OptionProcessorTest");
-
- CppUnit_addTest(pSuite, OptionProcessorTest, testUnix);
- CppUnit_addTest(pSuite, OptionProcessorTest, testDefault);
- CppUnit_addTest(pSuite, OptionProcessorTest, testRequired);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/OptionProcessorTest.h b/Utilities/Poco/Util/testsuite/src/OptionProcessorTest.h
deleted file mode 100755
index 55e99c9e88..0000000000
--- a/Utilities/Poco/Util/testsuite/src/OptionProcessorTest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// OptionProcessorTest.h
-//
-// $Id$
-//
-// Definition of the OptionProcessorTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef OptionProcessorTest_INCLUDED
-#define OptionProcessorTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class OptionProcessorTest: public CppUnit::TestCase
-{
-public:
- OptionProcessorTest(const std::string& name);
- ~OptionProcessorTest();
-
- void testUnix();
- void testDefault();
- void testRequired();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // OptionProcessorTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/OptionSetTest.cpp b/Utilities/Poco/Util/testsuite/src/OptionSetTest.cpp
deleted file mode 100755
index dbd3611a6a..0000000000
--- a/Utilities/Poco/Util/testsuite/src/OptionSetTest.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// OptionSetTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "OptionSetTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/OptionSet.h"
-#include "Poco/Util/Option.h"
-#include "Poco/Util/OptionException.h"
-
-
-using Poco::Util::OptionSet;
-using Poco::Util::Option;
-
-
-OptionSetTest::OptionSetTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-OptionSetTest::~OptionSetTest()
-{
-}
-
-
-void OptionSetTest::testOptionSet()
-{
- OptionSet set;
- set.addOption(
- Option("helper", "H", "start helper")
- .required(false)
- .repeatable(false));
- set.addOption(
- Option("help", "h", "print help text")
- .required(false)
- .repeatable(false));
- set.addOption(
- Option("include-dir", "I", "specify a search path for locating header files")
- .required(false)
- .repeatable(true)
- .argument("path"));
- set.addOption(
- Option("library-dir", "L", "specify a search path for locating library files")
- .required(false)
- .repeatable(true)
- .argument("path"));
- set.addOption(
- Option("insert", "it", "insert something")
- .required(false)
- .repeatable(true)
- .argument("path"));
- set.addOption(
- Option("item", "", "insert something")
- .required(false)
- .repeatable(true)
- .argument("path"));
- set.addOption(
- Option("include", "J", "specify a search path for locating header files")
- .required(false)
- .repeatable(true)
- .argument("path"));
-
- assert (set.hasOption("include", false));
- assert (set.hasOption("I", true));
- assert (set.hasOption("Include", true));
- assert (set.hasOption("insert", false));
- assert (set.hasOption("it", true));
- assert (set.hasOption("Insert", false));
- assert (set.hasOption("item", false));
- assert (!set.hasOption("i", false));
- assert (!set.hasOption("in", false));
-
- assert (set.hasOption("help"));
- assert (set.hasOption("h", true));
- assert (set.hasOption("helper"));
- assert (set.hasOption("H", true));
-
- const Option& opt1 = set.getOption("include");
- assert (opt1.fullName() == "include");
-
- const Option& opt2 = set.getOption("item");
- assert (opt2.fullName() == "item");
-
- const Option& opt3 = set.getOption("I", true);
- assert (opt3.fullName() == "include-dir");
-
- const Option& opt4 = set.getOption("include-d");
- assert (opt4.fullName() == "include-dir");
-
- const Option& opt5 = set.getOption("help");
- assert (opt5.fullName() == "help");
-
- const Option& opt6 = set.getOption("helpe");
- assert (opt6.fullName() == "helper");
-
- try
- {
- set.getOption("in");
- fail("ambiguous - must throw");
- }
- catch (Poco::Util::AmbiguousOptionException&)
- {
- }
-
- try
- {
- set.getOption("he");
- fail("ambiguous - must throw");
- }
- catch (Poco::Util::AmbiguousOptionException&)
- {
- }
-
- try
- {
- set.getOption("i");
- fail("ambiguous - must throw");
- }
- catch (Poco::Util::AmbiguousOptionException&)
- {
- }
-}
-
-
-void OptionSetTest::setUp()
-{
-}
-
-
-void OptionSetTest::tearDown()
-{
-}
-
-
-CppUnit::Test* OptionSetTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("OptionSetTest");
-
- CppUnit_addTest(pSuite, OptionSetTest, testOptionSet);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/OptionSetTest.h b/Utilities/Poco/Util/testsuite/src/OptionSetTest.h
deleted file mode 100755
index 598b635758..0000000000
--- a/Utilities/Poco/Util/testsuite/src/OptionSetTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// OptionSetTest.h
-//
-// $Id$
-//
-// Definition of the OptionSetTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef OptionSetTest_INCLUDED
-#define OptionSetTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class OptionSetTest: public CppUnit::TestCase
-{
-public:
- OptionSetTest(const std::string& name);
- ~OptionSetTest();
-
- void testOptionSet();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // OptionSetTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/OptionTest.cpp b/Utilities/Poco/Util/testsuite/src/OptionTest.cpp
deleted file mode 100755
index 617b4f17c6..0000000000
--- a/Utilities/Poco/Util/testsuite/src/OptionTest.cpp
+++ /dev/null
@@ -1,371 +0,0 @@
-//
-// OptionTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "OptionTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/Option.h"
-#include "Poco/Util/OptionException.h"
-
-
-using Poco::Util::Option;
-
-
-OptionTest::OptionTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-OptionTest::~OptionTest()
-{
-}
-
-
-void OptionTest::testOption()
-{
- Option incOpt = Option("include-dir", "I", "specify an include search path")
- .required(false)
- .repeatable(true)
- .argument("path");
-
- Option libOpt = Option("library-dir", "L", "specify a library search path", false)
- .repeatable(true)
- .argument("path");
-
- Option outOpt = Option("output", "o", "specify the output file", true)
- .argument("file", true);
-
- Option vrbOpt = Option("verbose", "v")
- .description("enable verbose mode")
- .required(false)
- .repeatable(false);
-
- Option optOpt = Option("optimize", "O")
- .description("enable optimization")
- .required(false)
- .repeatable(false)
- .argument("level", false);
-
- assert (incOpt.shortName() == "I");
- assert (incOpt.fullName() == "include-dir");
- assert (incOpt.repeatable());
- assert (!incOpt.required());
- assert (incOpt.argumentName() == "path");
- assert (incOpt.argumentRequired());
- assert (incOpt.takesArgument());
-
- assert (libOpt.shortName() == "L");
- assert (libOpt.fullName() == "library-dir");
- assert (libOpt.repeatable());
- assert (!libOpt.required());
- assert (libOpt.argumentName() == "path");
- assert (libOpt.argumentRequired());
- assert (incOpt.takesArgument());
-
- assert (outOpt.shortName() == "o");
- assert (outOpt.fullName() == "output");
- assert (!outOpt.repeatable());
- assert (outOpt.required());
- assert (outOpt.argumentName() == "file");
- assert (outOpt.argumentRequired());
- assert (incOpt.takesArgument());
-
- assert (vrbOpt.shortName() == "v");
- assert (vrbOpt.fullName() == "verbose");
- assert (!vrbOpt.repeatable());
- assert (!vrbOpt.required());
- assert (!vrbOpt.argumentRequired());
- assert (!vrbOpt.takesArgument());
-
- assert (optOpt.shortName() == "O");
- assert (optOpt.fullName() == "optimize");
- assert (!optOpt.repeatable());
- assert (!optOpt.required());
- assert (optOpt.argumentName() == "level");
- assert (optOpt.takesArgument());
- assert (!optOpt.argumentRequired());
-}
-
-
-void OptionTest::testMatches1()
-{
- Option incOpt = Option("include-dir", "I", "specify an include search path")
- .required(false)
- .repeatable(true)
- .argument("path");
-
- assert (incOpt.matchesShort("Iinclude"));
- assert (incOpt.matchesPartial("include:include"));
- assert (incOpt.matchesPartial("include-dir:include"));
- assert (incOpt.matchesPartial("inc=include"));
- assert (incOpt.matchesPartial("INCLUDE=include"));
- assert (incOpt.matchesPartial("include"));
- assert (incOpt.matchesShort("I"));
- assert (incOpt.matchesPartial("i"));
-
- assert (incOpt.matchesFull("include-dir:include"));
- assert (incOpt.matchesFull("INClude-dir:include"));
- assert (!incOpt.matchesFull("include:include"));
- assert (!incOpt.matchesFull("include-dir2:include"));
-
- assert (!incOpt.matchesPartial("include-dir2=include"));
- assert (!incOpt.matchesShort("linclude"));
-}
-
-
-void OptionTest::testMatches2()
-{
- Option incOpt = Option("include-dir", "", "specify an include search path")
- .required(false)
- .repeatable(true)
- .argument("path");
-
- assert (!incOpt.matchesShort("Iinclude"));
- assert (incOpt.matchesPartial("include:include"));
- assert (incOpt.matchesPartial("include-dir:include"));
- assert (incOpt.matchesPartial("inc=include"));
- assert (incOpt.matchesPartial("INCLUDE=include"));
- assert (incOpt.matchesPartial("I"));
- assert (incOpt.matchesPartial("i"));
-
- assert (incOpt.matchesFull("include-dir:include"));
- assert (incOpt.matchesFull("INClude-dir:include"));
- assert (!incOpt.matchesFull("include:include"));
- assert (!incOpt.matchesFull("include-dir2:include"));
-
- assert (!incOpt.matchesFull("include-dir2=include"));
- assert (!incOpt.matchesShort("linclude"));
-}
-
-
-void OptionTest::testProcess1()
-{
- Option incOpt = Option("include-dir", "I", "specify an include search path")
- .required(false)
- .repeatable(true)
- .argument("path");
-
- std::string arg;
- incOpt.process("Iinclude", arg);
- assert (arg == "include");
- incOpt.process("I/usr/include", arg);
- assert (arg == "/usr/include");
- incOpt.process("include:/usr/local/include", arg);
- assert (arg == "/usr/local/include");
- incOpt.process("include=/proj/include", arg);
- assert (arg == "/proj/include");
- incOpt.process("include-dir=/usr/include", arg);
- assert (arg == "/usr/include");
- incOpt.process("Include-dir:/proj/include", arg);
- assert (arg == "/proj/include");
-
- try
- {
- incOpt.process("I", arg);
- fail("argument required - must throw");
- }
- catch (Poco::Util::MissingArgumentException&)
- {
- }
-
- try
- {
- incOpt.process("Include", arg);
- fail("argument required - must throw");
- }
- catch (Poco::Util::MissingArgumentException&)
- {
- }
-
- try
- {
- incOpt.process("Llib", arg);
- fail("wrong option - must throw");
- }
- catch (Poco::Util::UnknownOptionException&)
- {
- }
-
- Option vrbOpt = Option("verbose", "v")
- .description("enable verbose mode")
- .required(false)
- .repeatable(false);
-
- vrbOpt.process("v", arg);
- assert (arg.empty());
- vrbOpt.process("verbose", arg);
- assert (arg.empty());
-
- try
- {
- vrbOpt.process("v2", arg);
- fail("no argument expected - must throw");
- }
- catch (Poco::Util::UnexpectedArgumentException&)
- {
- }
-
- try
- {
- vrbOpt.process("verbose:2", arg);
- fail("no argument expected - must throw");
- }
- catch (Poco::Util::UnexpectedArgumentException&)
- {
- }
-
- Option optOpt = Option("optimize", "O")
- .description("enable optimization")
- .required(false)
- .repeatable(false)
- .argument("level", false);
-
- optOpt.process("O", arg);
- assert (arg.empty());
- optOpt.process("O2", arg);
- assert (arg == "2");
- optOpt.process("optimize:1", arg);
- assert (arg == "1");
- optOpt.process("opt", arg);
- assert (arg.empty());
- optOpt.process("opt=3", arg);
- assert (arg == "3");
- optOpt.process("opt=", arg);
- assert (arg.empty());
-}
-
-
-void OptionTest::testProcess2()
-{
- Option incOpt = Option("include-dir", "", "specify an include search path")
- .required(false)
- .repeatable(true)
- .argument("path");
-
- std::string arg;
- incOpt.process("include:/usr/local/include", arg);
- assert (arg == "/usr/local/include");
- incOpt.process("include=/proj/include", arg);
- assert (arg == "/proj/include");
- incOpt.process("include-dir=/usr/include", arg);
- assert (arg == "/usr/include");
- incOpt.process("Include-dir:/proj/include", arg);
- assert (arg == "/proj/include");
-
- try
- {
- incOpt.process("Iinclude", arg);
- fail("unknown option - must throw");
- }
- catch (Poco::Util::UnknownOptionException&)
- {
- }
-
- try
- {
- incOpt.process("I", arg);
- fail("argument required - must throw");
- }
- catch (Poco::Util::MissingArgumentException&)
- {
- }
-
- try
- {
- incOpt.process("Include", arg);
- fail("argument required - must throw");
- }
- catch (Poco::Util::MissingArgumentException&)
- {
- }
-
- try
- {
- incOpt.process("Llib", arg);
- fail("wrong option - must throw");
- }
- catch (Poco::Util::UnknownOptionException&)
- {
- }
-
- Option vrbOpt = Option("verbose", "")
- .description("enable verbose mode")
- .required(false)
- .repeatable(false);
-
- vrbOpt.process("v", arg);
- assert (arg.empty());
- vrbOpt.process("verbose", arg);
- assert (arg.empty());
-
- try
- {
- vrbOpt.process("v2", arg);
- fail("no argument expected - must throw");
- }
- catch (Poco::Util::UnknownOptionException&)
- {
- }
-
- try
- {
- vrbOpt.process("verbose:2", arg);
- fail("no argument expected - must throw");
- }
- catch (Poco::Util::UnexpectedArgumentException&)
- {
- }
-}
-
-
-void OptionTest::setUp()
-{
-}
-
-
-void OptionTest::tearDown()
-{
-}
-
-
-CppUnit::Test* OptionTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("OptionTest");
-
- CppUnit_addTest(pSuite, OptionTest, testOption);
- CppUnit_addTest(pSuite, OptionTest, testMatches1);
- CppUnit_addTest(pSuite, OptionTest, testMatches2);
- CppUnit_addTest(pSuite, OptionTest, testProcess1);
- CppUnit_addTest(pSuite, OptionTest, testProcess2);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/OptionTest.h b/Utilities/Poco/Util/testsuite/src/OptionTest.h
deleted file mode 100755
index d447714921..0000000000
--- a/Utilities/Poco/Util/testsuite/src/OptionTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// OptionTest.h
-//
-// $Id$
-//
-// Definition of the OptionTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef OptionTest_INCLUDED
-#define OptionTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class OptionTest: public CppUnit::TestCase
-{
-public:
- OptionTest(const std::string& name);
- ~OptionTest();
-
- void testOption();
- void testMatches1();
- void testMatches2();
- void testProcess1();
- void testProcess2();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // OptionTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/OptionsTestSuite.cpp b/Utilities/Poco/Util/testsuite/src/OptionsTestSuite.cpp
deleted file mode 100755
index e029d4f5e3..0000000000
--- a/Utilities/Poco/Util/testsuite/src/OptionsTestSuite.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// OptionsTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "OptionsTestSuite.h"
-#include "OptionTest.h"
-#include "OptionSetTest.h"
-#include "HelpFormatterTest.h"
-#include "OptionProcessorTest.h"
-#include "ValidatorTest.h"
-
-
-CppUnit::Test* OptionsTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("OptionsTestSuite");
-
- pSuite->addTest(OptionTest::suite());
- pSuite->addTest(OptionSetTest::suite());
- pSuite->addTest(HelpFormatterTest::suite());
- pSuite->addTest(OptionProcessorTest::suite());
- pSuite->addTest(ValidatorTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/OptionsTestSuite.h b/Utilities/Poco/Util/testsuite/src/OptionsTestSuite.h
deleted file mode 100755
index eeb7f4753f..0000000000
--- a/Utilities/Poco/Util/testsuite/src/OptionsTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// OptionsTestSuite.h
-//
-// $Id$
-//
-// Definition of the OptionsTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef OptionsTestSuite_INCLUDED
-#define OptionsTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class OptionsTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // OptionsTestSuite_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/PropertyFileConfigurationTest.cpp b/Utilities/Poco/Util/testsuite/src/PropertyFileConfigurationTest.cpp
deleted file mode 100755
index bf46c2f2fa..0000000000
--- a/Utilities/Poco/Util/testsuite/src/PropertyFileConfigurationTest.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-//
-// PropertyFileConfigurationTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "PropertyFileConfigurationTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/PropertyFileConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-#include <sstream>
-#include <algorithm>
-
-
-using Poco::Util::PropertyFileConfiguration;
-using Poco::Util::AbstractConfiguration;
-using Poco::AutoPtr;
-using Poco::NotFoundException;
-
-
-PropertyFileConfigurationTest::PropertyFileConfigurationTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-PropertyFileConfigurationTest::~PropertyFileConfigurationTest()
-{
-}
-
-
-void PropertyFileConfigurationTest::testLoad()
-{
- static const std::string propFile =
- "! comment\n"
- "! comment\n"
- "prop1=value1\n"
- "prop2 = value2 \n"
- "prop3.prop31: value3\n"
- "# comment\n"
- " prop3.prop32: value 4\n"
- "prop3.prop33: value5, value6, \\\n"
- "value7, value8, \\\r\n"
- "value9\n"
- "prop4 = escaped[\\t\\r\\n\\f]\n"
- "#prop4 = foo\n"
- "prop5:foo";
-
- std::istringstream istr(propFile);
- AutoPtr<PropertyFileConfiguration> pConf = new PropertyFileConfiguration(istr);
-
- assert (pConf->getString("prop1") == "value1");
- assert (pConf->getString("prop2") == "value2");
- assert (pConf->getString("prop3.prop31") == "value3");
- assert (pConf->getString("prop3.prop32") == "value 4");
- assert (pConf->getString("prop3.prop33") == "value5, value6, value7, value8, value9");
- assert (pConf->getString("prop4") == "escaped[\t\r\n\f]");
- assert (pConf->getString("prop5") == "foo");
-
- AbstractConfiguration::Keys keys;
- pConf->keys(keys);
- assert (keys.size() == 5);
- assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop3") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop4") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop5") != keys.end());
-
- pConf->keys("prop3", keys);
- assert (keys.size() == 3);
- assert (std::find(keys.begin(), keys.end(), "prop31") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop32") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop33") != keys.end());
-
- try
- {
- std::string s = pConf->getString("foo");
- fail("No property - must throw");
- }
- catch (NotFoundException&)
- {
- }
-}
-
-
-void PropertyFileConfigurationTest::testSave()
-{
- AutoPtr<PropertyFileConfiguration> pConf = new PropertyFileConfiguration;
-
- pConf->setString("prop1", "value1");
- pConf->setInt("prop2", 42);
-
- std::ostringstream ostr;
- pConf->save(ostr);
- std::string propFile = ostr.str();
- assert (propFile == "prop1: value1\n"
- "prop2: 42\n");
-}
-
-
-void PropertyFileConfigurationTest::setUp()
-{
-}
-
-
-void PropertyFileConfigurationTest::tearDown()
-{
-}
-
-
-CppUnit::Test* PropertyFileConfigurationTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("PropertyFileConfigurationTest");
-
- CppUnit_addTest(pSuite, PropertyFileConfigurationTest, testLoad);
- CppUnit_addTest(pSuite, PropertyFileConfigurationTest, testSave);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/PropertyFileConfigurationTest.h b/Utilities/Poco/Util/testsuite/src/PropertyFileConfigurationTest.h
deleted file mode 100755
index cfce0edc5c..0000000000
--- a/Utilities/Poco/Util/testsuite/src/PropertyFileConfigurationTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// PropertyFileConfigurationTest.h
-//
-// $Id$
-//
-// Definition of the PropertyFileConfigurationTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef PropertyFileConfigurationTest_INCLUDED
-#define PropertyFileConfigurationTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class PropertyFileConfigurationTest: public CppUnit::TestCase
-{
-public:
- PropertyFileConfigurationTest(const std::string& name);
- ~PropertyFileConfigurationTest();
-
- void testLoad();
- void testSave();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // PropertyFileConfigurationTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/SystemConfigurationTest.cpp b/Utilities/Poco/Util/testsuite/src/SystemConfigurationTest.cpp
deleted file mode 100755
index 582aa70045..0000000000
--- a/Utilities/Poco/Util/testsuite/src/SystemConfigurationTest.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// SystemConfigurationTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "SystemConfigurationTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/SystemConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-#include "Poco/Environment.h"
-#include "Poco/Path.h"
-#include "Poco/Process.h"
-#include "Poco/NumberParser.h"
-#include <algorithm>
-
-
-using Poco::Util::SystemConfiguration;
-using Poco::Util::AbstractConfiguration;
-using Poco::AutoPtr;
-using Poco::Environment;
-using Poco::Path;
-using Poco::InvalidAccessException;
-using Poco::NotFoundException;
-
-
-SystemConfigurationTest::SystemConfigurationTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-SystemConfigurationTest::~SystemConfigurationTest()
-{
-}
-
-
-void SystemConfigurationTest::testProperties()
-{
- AutoPtr<SystemConfiguration> pConf = new SystemConfiguration;
-
- assert (pConf->getString("system.osName") == Environment::osName());
- assert (pConf->getString("system.osVersion") == Environment::osVersion());
- assert (pConf->getString("system.osArchitecture") == Environment::osArchitecture());
- assert (pConf->getString("system.nodeName") == Environment::nodeName());
- assert (pConf->getString("system.currentDir") == Path::current());
- assert (pConf->getString("system.homeDir") == Path::home());
- assert (pConf->getString("system.tempDir") == Path::temp());
-
- std::string dateTime = pConf->getString("system.dateTime");
- assert (dateTime.size() == 20);
-
- std::string pid = pConf->getString("system.pid");
- assert (Poco::NumberParser::parse64(pid) == Poco::Process::id());
-
-#if defined(POCO_OS_FAMILY_WINDOWS)
- std::string home = pConf->getString("system.env.HOMEPATH");
-#else
- std::string home = pConf->getString("system.env.HOME");
-#endif
- assert (!home.empty());
-}
-
-
-void SystemConfigurationTest::testKeys()
-{
- AutoPtr<SystemConfiguration> pConf = new SystemConfiguration;
-
- AbstractConfiguration::Keys keys;
- pConf->keys(keys);
- assert (keys.size() == 1);
- assert (std::find(keys.begin(), keys.end(), "system") != keys.end());
-
- pConf->keys("system", keys);
- assert (keys.size() == 10);
- assert (std::find(keys.begin(), keys.end(), "osName") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "osVersion") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "osArchitecture") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "nodeName") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "currentDir") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "homeDir") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "tempDir") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "dateTime") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "pid") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "env") != keys.end());
-}
-
-
-void SystemConfigurationTest::setUp()
-{
-}
-
-
-void SystemConfigurationTest::tearDown()
-{
-}
-
-
-CppUnit::Test* SystemConfigurationTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SystemConfigurationTest");
-
- CppUnit_addTest(pSuite, SystemConfigurationTest, testProperties);
- CppUnit_addTest(pSuite, SystemConfigurationTest, testKeys);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/SystemConfigurationTest.h b/Utilities/Poco/Util/testsuite/src/SystemConfigurationTest.h
deleted file mode 100755
index 9aa2fb161e..0000000000
--- a/Utilities/Poco/Util/testsuite/src/SystemConfigurationTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// SystemConfigurationTest.h
-//
-// $Id$
-//
-// Definition of the SystemConfigurationTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SystemConfigurationTest_INCLUDED
-#define SystemConfigurationTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class SystemConfigurationTest: public CppUnit::TestCase
-{
-public:
- SystemConfigurationTest(const std::string& name);
- ~SystemConfigurationTest();
-
- void testProperties();
- void testKeys();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // SystemConfigurationTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/TimerTest.cpp b/Utilities/Poco/Util/testsuite/src/TimerTest.cpp
deleted file mode 100644
index 1c4ecab594..0000000000
--- a/Utilities/Poco/Util/testsuite/src/TimerTest.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-//
-// TimerTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2009, 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 "TimerTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/Timer.h"
-#include "Poco/Util/TimerTaskAdapter.h"
-
-
-using Poco::Util::Timer;
-using Poco::Util::TimerTask;
-using Poco::Util::TimerTaskAdapter;
-using Poco::Timestamp;
-
-
-TimerTest::TimerTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TimerTest::~TimerTest()
-{
-}
-
-
-void TimerTest::testSchedule()
-{
- Timer timer;
-
- Timestamp time;
- time += 1000000;
-
- TimerTask::Ptr pTask = new TimerTaskAdapter<TimerTest>(*this, &TimerTest::onTimer);
-
- assert (pTask->lastExecution() == 0);
-
- timer.schedule(pTask, time);
-
- _event.wait();
- assert (pTask->lastExecution() >= time);
-}
-
-
-void TimerTest::testScheduleInterval()
-{
- Timer timer;
-
- Timestamp time;
-
- TimerTask::Ptr pTask = new TimerTaskAdapter<TimerTest>(*this, &TimerTest::onTimer);
-
- assert (pTask->lastExecution() == 0);
-
- timer.schedule(pTask, 500, 500);
-
- _event.wait();
- assert (time.elapsed() >= 590000);
- assert (pTask->lastExecution().elapsed() < 130000);
-
- _event.wait();
- assert (time.elapsed() >= 1190000);
- assert (pTask->lastExecution().elapsed() < 130000);
-
- _event.wait();
- assert (time.elapsed() >= 1790000);
- assert (pTask->lastExecution().elapsed() < 130000);
-
- pTask->cancel();
- assert (pTask->isCancelled());
-}
-
-
-void TimerTest::testScheduleAtFixedRate()
-{
- Timer timer;
-
- Timestamp time;
-
- TimerTask::Ptr pTask = new TimerTaskAdapter<TimerTest>(*this, &TimerTest::onTimer);
-
- assert (pTask->lastExecution() == 0);
-
- timer.scheduleAtFixedRate(pTask, 500, 500);
-
- _event.wait();
- assert (time.elapsed() >= 500000);
- assert (pTask->lastExecution().elapsed() < 130000);
-
- _event.wait();
- assert (time.elapsed() >= 1000000);
- assert (pTask->lastExecution().elapsed() < 130000);
-
- _event.wait();
- assert (time.elapsed() >= 1500000);
- assert (pTask->lastExecution().elapsed() < 130000);
-
- pTask->cancel();
- assert (pTask->isCancelled());
-}
-
-
-void TimerTest::setUp()
-{
-}
-
-
-void TimerTest::tearDown()
-{
-}
-
-
-void TimerTest::onTimer(TimerTask& task)
-{
- Poco::Thread::sleep(100);
- _event.set();
-}
-
-
-CppUnit::Test* TimerTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TimerTest");
-
- CppUnit_addTest(pSuite, TimerTest, testSchedule);
- CppUnit_addTest(pSuite, TimerTest, testScheduleInterval);
- CppUnit_addTest(pSuite, TimerTest, testScheduleAtFixedRate);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/TimerTest.h b/Utilities/Poco/Util/testsuite/src/TimerTest.h
deleted file mode 100644
index 24ce7920cf..0000000000
--- a/Utilities/Poco/Util/testsuite/src/TimerTest.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// TimerTest.h
-//
-// $Id$
-//
-// Definition of the TimerTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TimerTest_INCLUDED
-#define TimerTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/Util/TimerTask.h"
-#include "Poco/Event.h"
-
-
-class TimerTest: public CppUnit::TestCase
-{
-public:
- TimerTest(const std::string& name);
- ~TimerTest();
-
- void testSchedule();
- void testScheduleInterval();
- void testScheduleAtFixedRate();
-
- void setUp();
- void tearDown();
-
- void onTimer(Poco::Util::TimerTask& task);
-
- static CppUnit::Test* suite();
-
-private:
- Poco::Event _event;
-};
-
-
-#endif // TimerTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/TimerTestSuite.cpp b/Utilities/Poco/Util/testsuite/src/TimerTestSuite.cpp
deleted file mode 100644
index 6f72fd8b0f..0000000000
--- a/Utilities/Poco/Util/testsuite/src/TimerTestSuite.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// TimerTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2009, 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 "TimerTestSuite.h"
-#include "TimerTest.h"
-
-
-CppUnit::Test* TimerTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TimerTestSuite");
-
- pSuite->addTest(TimerTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/TimerTestSuite.h b/Utilities/Poco/Util/testsuite/src/TimerTestSuite.h
deleted file mode 100644
index 70eb16e6c6..0000000000
--- a/Utilities/Poco/Util/testsuite/src/TimerTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// TimerTestSuite.h
-//
-// $Id$
-//
-// Definition of the TimerTestSuite class.
-//
-// Copyright (c) 2009, 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.
-//
-
-
-#ifndef TimerTestSuite_INCLUDED
-#define TimerTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class TimerTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // TimerTestSuite_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/UtilTestSuite.cpp b/Utilities/Poco/Util/testsuite/src/UtilTestSuite.cpp
deleted file mode 100755
index dac5590f88..0000000000
--- a/Utilities/Poco/Util/testsuite/src/UtilTestSuite.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// UtilTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "UtilTestSuite.h"
-#include "ConfigurationTestSuite.h"
-#include "OptionsTestSuite.h"
-#include "TimerTestSuite.h"
-#if defined(_MSC_VER)
-#include "WindowsTestSuite.h"
-#endif
-
-
-CppUnit::Test* UtilTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("UtilTestSuite");
-
- pSuite->addTest(ConfigurationTestSuite::suite());
- pSuite->addTest(OptionsTestSuite::suite());
- pSuite->addTest(TimerTestSuite::suite());
-#if defined(_MSC_VER)
- pSuite->addTest(WindowsTestSuite::suite());
-#endif
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/UtilTestSuite.h b/Utilities/Poco/Util/testsuite/src/UtilTestSuite.h
deleted file mode 100755
index 87883175da..0000000000
--- a/Utilities/Poco/Util/testsuite/src/UtilTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// UtilTestSuite.h
-//
-// $Id$
-//
-// Definition of the UtilTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef UtilTestSuite_INCLUDED
-#define UtilTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class UtilTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // UtilTestSuite_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/ValidatorTest.cpp b/Utilities/Poco/Util/testsuite/src/ValidatorTest.cpp
deleted file mode 100755
index f8a21056a2..0000000000
--- a/Utilities/Poco/Util/testsuite/src/ValidatorTest.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-//
-// ValidatorTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "ValidatorTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/RegExpValidator.h"
-#include "Poco/Util/IntValidator.h"
-#include "Poco/Util/Option.h"
-#include "Poco/Util/OptionException.h"
-#include "Poco/AutoPtr.h"
-
-
-using Poco::Util::Validator;
-using Poco::Util::RegExpValidator;
-using Poco::Util::IntValidator;
-using Poco::Util::Option;
-using Poco::Util::InvalidArgumentException;
-using Poco::AutoPtr;
-
-
-ValidatorTest::ValidatorTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ValidatorTest::~ValidatorTest()
-{
-}
-
-
-void ValidatorTest::testRegExpValidator()
-{
- Option option("option", "o");
- AutoPtr<Validator> pVal(new RegExpValidator("[0-9]+"));
-
- pVal->validate(option, "0");
- pVal->validate(option, "12345");
-
- try
- {
- pVal->validate(option, " 234");
- fail("does not match - must throw");
- }
- catch (InvalidArgumentException& exc)
- {
- std::string s(exc.message());
- assert (s == "argument for option does not match regular expression [0-9]+");
- }
-
- try
- {
- pVal->validate(option, "234asdf");
- fail("does not match - must throw");
- }
- catch (InvalidArgumentException& exc)
- {
- std::string s(exc.message());
- assert (s == "argument for option does not match regular expression [0-9]+");
- }
-
- try
- {
- pVal->validate(option, "abc");
- fail("does not match - must throw");
- }
- catch (InvalidArgumentException& exc)
- {
- std::string s(exc.message());
- assert (s == "argument for option does not match regular expression [0-9]+");
- }
-
- try
- {
- pVal->validate(option, "");
- fail("does not match - must throw");
- }
- catch (InvalidArgumentException& exc)
- {
- std::string s(exc.message());
- assert (s == "argument for option does not match regular expression [0-9]+");
- }
-}
-
-
-void ValidatorTest::testIntValidator()
-{
- Option option("option", "o");
- AutoPtr<Validator> pVal(new IntValidator(0, 100));
-
- pVal->validate(option, "0");
- pVal->validate(option, "100");
- pVal->validate(option, "55");
-
- try
- {
- pVal->validate(option, "-1");
- fail("out of range - must throw");
- }
- catch (InvalidArgumentException& exc)
- {
- std::string s(exc.message());
- assert (s == "argument for option must be in range 0 to 100");
- }
-
- try
- {
- pVal->validate(option, "101");
- fail("out of range - must throw");
- }
- catch (InvalidArgumentException& exc)
- {
- std::string s(exc.message());
- assert (s == "argument for option must be in range 0 to 100");
- }
-
- try
- {
- pVal->validate(option, "asdf");
- fail("not a number - must throw");
- }
- catch (InvalidArgumentException& exc)
- {
- std::string s(exc.message());
- assert (s == "argument for option must be an integer");
- }
-}
-
-
-void ValidatorTest::setUp()
-{
-}
-
-
-void ValidatorTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ValidatorTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ValidatorTest");
-
- CppUnit_addTest(pSuite, ValidatorTest, testRegExpValidator);
- CppUnit_addTest(pSuite, ValidatorTest, testIntValidator);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/ValidatorTest.h b/Utilities/Poco/Util/testsuite/src/ValidatorTest.h
deleted file mode 100755
index 353ad7ab64..0000000000
--- a/Utilities/Poco/Util/testsuite/src/ValidatorTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// ValidatorTest.h
-//
-// $Id$
-//
-// Definition of the ValidatorTest class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef ValidatorTest_INCLUDED
-#define ValidatorTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class ValidatorTest: public CppUnit::TestCase
-{
-public:
- ValidatorTest(const std::string& name);
- ~ValidatorTest();
-
- void testRegExpValidator();
- void testIntValidator();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ValidatorTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/WinConfigurationTest.cpp b/Utilities/Poco/Util/testsuite/src/WinConfigurationTest.cpp
deleted file mode 100755
index 25d149f3cb..0000000000
--- a/Utilities/Poco/Util/testsuite/src/WinConfigurationTest.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// WinConfigurationTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "WinConfigurationTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/WinRegistryConfiguration.h"
-#include "Poco/Environment.h"
-#include "Poco/AutoPtr.h"
-
-
-using Poco::Util::WinRegistryConfiguration;
-using Poco::Environment;
-using Poco::AutoPtr;
-
-
-WinConfigurationTest::WinConfigurationTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-WinConfigurationTest::~WinConfigurationTest()
-{
-}
-
-
-void WinConfigurationTest::testConfiguration()
-{
- AutoPtr<WinRegistryConfiguration> pReg = new WinRegistryConfiguration("HKEY_CURRENT_USER\\Software\\Applied Informatics\\Test");
- pReg->setString("name1", "value1");
- assert (pReg->getString("name1") == "value1");
- pReg->setInt("name1", 1); // overwrite should also change type
- assert (pReg->getInt("name1") == 1);
- pReg->setString("name2", "value2");
- assert (pReg->getString("name2") == "value2");
- assert (pReg->hasProperty("name1"));
- assert (pReg->hasProperty("name2"));
-
- std::string dfl = pReg->getString("nonexistent", "default");
- assert (dfl == "default");
-
- AutoPtr<Poco::Util::AbstractConfiguration> pView = pReg->createView("config");
- dfl = pView->getString("sub.foo", "default");
- assert (dfl == "default");
-
- pView->setString("sub.foo", "bar");
- assert (pView->getString("sub.foo", "default") == "bar");
-}
-
-
-void WinConfigurationTest::setUp()
-{
-}
-
-
-void WinConfigurationTest::tearDown()
-{
-}
-
-
-CppUnit::Test* WinConfigurationTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("WinConfigurationTest");
-
- CppUnit_addTest(pSuite, WinConfigurationTest, testConfiguration);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/WinConfigurationTest.h b/Utilities/Poco/Util/testsuite/src/WinConfigurationTest.h
deleted file mode 100755
index a82e09fde4..0000000000
--- a/Utilities/Poco/Util/testsuite/src/WinConfigurationTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// WinConfigurationTest.h
-//
-// $Id$
-//
-// Definition of the WinConfigurationTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef WinConfigurationTest_INCLUDED
-#define WinConfigurationTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class WinConfigurationTest: public CppUnit::TestCase
-{
-public:
- WinConfigurationTest(const std::string& name);
- ~WinConfigurationTest();
-
- void testConfiguration();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // WinConfigurationTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/WinDriver.cpp b/Utilities/Poco/Util/testsuite/src/WinDriver.cpp
deleted file mode 100755
index 649f94ac64..0000000000
--- a/Utilities/Poco/Util/testsuite/src/WinDriver.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// WinDriver.cpp
-//
-// $Id$
-//
-// Windows test driver for Poco Util.
-//
-// Copyright (c) 2004-2006, 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 "WinTestRunner/WinTestRunner.h"
-#include "UtilTestSuite.h"
-
-
-class TestDriver: public CppUnit::WinTestRunnerApp
-{
- void TestMain()
- {
- CppUnit::WinTestRunner runner;
- runner.addTest(UtilTestSuite::suite());
- runner.run();
- }
-};
-
-
-TestDriver theDriver;
diff --git a/Utilities/Poco/Util/testsuite/src/WinRegistryTest.cpp b/Utilities/Poco/Util/testsuite/src/WinRegistryTest.cpp
deleted file mode 100755
index a1328a0601..0000000000
--- a/Utilities/Poco/Util/testsuite/src/WinRegistryTest.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// WinRegistryTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "WinRegistryTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/WinRegistryKey.h"
-#include "Poco/Environment.h"
-#include "Poco/Exception.h"
-
-
-using Poco::Util::WinRegistryKey;
-using Poco::Environment;
-
-
-WinRegistryTest::WinRegistryTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-WinRegistryTest::~WinRegistryTest()
-{
-}
-
-
-void WinRegistryTest::testRegistry()
-{
- WinRegistryKey regKey("HKEY_CURRENT_USER\\Software\\Applied Informatics\\Test");
- if (regKey.exists())
- {
- regKey.deleteKey();
- }
- assert (!regKey.exists());
- regKey.setString("name1", "value1");
- assert (regKey.getString("name1") == "value1");
- regKey.setString("name1", "Value1");
- assert (regKey.getString("name1") == "Value1");
- regKey.setString("name2", "value2");
- assert (regKey.getString("name2") == "value2");
- assert (regKey.exists("name1"));
- assert (regKey.exists("name2"));
- assert (regKey.exists());
-
- WinRegistryKey regKeyRO("HKEY_CURRENT_USER\\Software\\Applied Informatics\\Test", true);
- assert (regKeyRO.getString("name1") == "Value1");
- try
- {
- regKeyRO.setString("name1", "newValue1");
- }
- catch (Poco::Exception& exc)
- {
- std::string msg = exc.displayText();
- }
- assert (regKey.getString("name1") == "Value1");
-
- WinRegistryKey::Values vals;
- regKey.values(vals);
- assert (vals.size() == 2);
- assert (vals[0] == "name1" || vals[0] == "name2");
- assert (vals[1] == "name1" || vals[1] == "name2");
- assert (vals[0] != vals[1]);
-
- Environment::set("FOO", "bar");
- regKey.setStringExpand("name3", "%FOO%");
- assert (regKey.getStringExpand("name3") == "bar");
-
- regKey.setInt("name4", 42);
- assert (regKey.getInt("name4") == 42);
-
- assert (regKey.exists("name4"));
- regKey.deleteValue("name4");
- assert (!regKey.exists("name4"));
-
- regKey.deleteKey();
- assert (!regKey.exists());
-}
-
-
-void WinRegistryTest::setUp()
-{
-}
-
-
-void WinRegistryTest::tearDown()
-{
-}
-
-
-CppUnit::Test* WinRegistryTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("WinRegistryTest");
-
- CppUnit_addTest(pSuite, WinRegistryTest, testRegistry);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/WinRegistryTest.h b/Utilities/Poco/Util/testsuite/src/WinRegistryTest.h
deleted file mode 100755
index f08bf2ccbb..0000000000
--- a/Utilities/Poco/Util/testsuite/src/WinRegistryTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// WinRegistryTest.h
-//
-// $Id$
-//
-// Definition of the WinRegistryTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef WinRegistryTest_INCLUDED
-#define WinRegistryTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class WinRegistryTest: public CppUnit::TestCase
-{
-public:
- WinRegistryTest(const std::string& name);
- ~WinRegistryTest();
-
- void testRegistry();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // WinRegistryTest_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/WindowsTestSuite.cpp b/Utilities/Poco/Util/testsuite/src/WindowsTestSuite.cpp
deleted file mode 100755
index a39e1d846a..0000000000
--- a/Utilities/Poco/Util/testsuite/src/WindowsTestSuite.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// WindowsTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "WindowsTestSuite.h"
-#include "WinRegistryTest.h"
-#include "WinConfigurationTest.h"
-
-
-CppUnit::Test* WindowsTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("WindowsTestSuite");
-
- pSuite->addTest(WinRegistryTest::suite());
- pSuite->addTest(WinConfigurationTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/WindowsTestSuite.h b/Utilities/Poco/Util/testsuite/src/WindowsTestSuite.h
deleted file mode 100755
index e1903eb8aa..0000000000
--- a/Utilities/Poco/Util/testsuite/src/WindowsTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// WindowsTestSuite.h
-//
-// $Id$
-//
-// Definition of the WindowsTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef WindowsTestSuite_INCLUDED
-#define WindowsTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class WindowsTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // WindowsTestSuite_INCLUDED
diff --git a/Utilities/Poco/Util/testsuite/src/XMLConfigurationTest.cpp b/Utilities/Poco/Util/testsuite/src/XMLConfigurationTest.cpp
deleted file mode 100755
index 27514845ec..0000000000
--- a/Utilities/Poco/Util/testsuite/src/XMLConfigurationTest.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-//
-// XMLConfigurationTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "XMLConfigurationTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Util/XMLConfiguration.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Exception.h"
-#include <sstream>
-#include <algorithm>
-
-
-using Poco::Util::XMLConfiguration;
-using Poco::Util::AbstractConfiguration;
-using Poco::AutoPtr;
-using Poco::NotImplementedException;
-using Poco::NotFoundException;
-
-
-XMLConfigurationTest::XMLConfigurationTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-XMLConfigurationTest::~XMLConfigurationTest()
-{
-}
-
-
-void XMLConfigurationTest::testLoad()
-{
- static const std::string xmlFile =
- "<config>"
- " <prop1>value1</prop1>"
- " <prop2>value2</prop2>"
- " <prop3>"
- " <prop4 attr='value3'/>"
- " <prop4 attr='value4'/>"
- " </prop3>"
- " <prop5>value5</prop5>"
- " <prop5>value6</prop5>"
- "</config>";
-
- std::istringstream istr(xmlFile);
- AutoPtr<XMLConfiguration> pConf = new XMLConfiguration(istr);
-
- assert (pConf->getString("prop1") == "value1");
- assert (pConf->getString("prop2") == "value2");
- assert (pConf->getString("prop3.prop4[@attr]") == "value3");
- assert (pConf->getString("prop3.prop4[1][@attr]") == "value4");
- assert (pConf->getString("prop5") == "value5");
- assert (pConf->getString("prop5[0]") == "value5");
- assert (pConf->getString("prop5[1]") == "value6");
-
- AbstractConfiguration::Keys keys;
- pConf->keys(keys);
- assert (keys.size() == 5);
- assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop3") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop5") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop5[1]") != keys.end());
-
- pConf->keys("prop3", keys);
- assert (keys.size() == 2);
- assert (std::find(keys.begin(), keys.end(), "prop4") != keys.end());
- assert (std::find(keys.begin(), keys.end(), "prop4[1]") != keys.end());
-
- try
- {
- std::string s = pConf->getString("foo");
- fail("No property - must throw");
- }
- catch (NotFoundException&)
- {
- }
-}
-
-
-void XMLConfigurationTest::testSave()
-{
- AutoPtr<XMLConfiguration> pConf = new XMLConfiguration;
- pConf->loadEmpty("config");
-
- std::ostringstream ostr;
- pConf->save(ostr);
- std::string s(ostr.str());
- assert (s == "<config/>\n");
-
- pConf->setString("prop1", "value1");
- assert (pConf->getString("prop1") == "value1");
-
- pConf->setString("prop2", "value2");
- assert (pConf->getString("prop2") == "value2");
-
- pConf->setString("prop3.prop4[@attr]", "value3");
- assert (pConf->getString("prop3.prop4[@attr]") == "value3");
-
- pConf->setString("prop3.prop4[1][@attr]", "value4");
- assert (pConf->getString("prop3.prop4[1][@attr]") == "value4");
-
- pConf->setString("prop5", "value5a");
- assert (pConf->getString("prop5") == "value5a");
-
- pConf->setString("prop5[0]", "value5");
- assert (pConf->getString("prop5[0]") == "value5");
- assert (pConf->getString("prop5") == "value5");
-
- pConf->setString("prop5[1]", "value6");
- assert (pConf->getString("prop5[1]") == "value6");
-
- try
- {
- pConf->setString("prop5[3]", "value7");
- fail("bad index - must throw");
- }
- catch (Poco::InvalidArgumentException&)
- {
- }
-
- std::ostringstream ostr2;
- pConf->save(ostr2);
- s = ostr2.str();
-
- assert (s ==
- "<config>\n"
- "\t<prop1>value1</prop1>\n"
- "\t<prop2>value2</prop2>\n"
- "\t<prop3>\n"
- "\t\t<prop4 attr=\"value3\"/>\n"
- "\t\t<prop4 attr=\"value4\"/>\n"
- "\t</prop3>\n"
- "\t<prop5>value5</prop5>\n"
- "\t<prop5>value6</prop5>\n"
- "</config>\n");
-
- pConf->setString("prop1", "value11");
- assert (pConf->getString("prop1") == "value11");
-
- pConf->setString("prop2", "value21");
- assert (pConf->getString("prop2") == "value21");
-
- pConf->setString("prop3.prop4[1][@attr]", "value41");
- assert (pConf->getString("prop3.prop4[1][@attr]") == "value41");
-
- std::ostringstream ostr3;
- pConf->save(ostr3);
- s = ostr3.str();
- assert (s ==
- "<config>\n"
- "\t<prop1>value11</prop1>\n"
- "\t<prop2>value21</prop2>\n"
- "\t<prop3>\n"
- "\t\t<prop4 attr=\"value3\"/>\n"
- "\t\t<prop4 attr=\"value41\"/>\n"
- "\t</prop3>\n"
- "\t<prop5>value5</prop5>\n"
- "\t<prop5>value6</prop5>\n"
- "</config>\n");
-}
-
-
-void XMLConfigurationTest::setUp()
-{
-}
-
-
-void XMLConfigurationTest::tearDown()
-{
-}
-
-
-CppUnit::Test* XMLConfigurationTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("XMLConfigurationTest");
-
- CppUnit_addTest(pSuite, XMLConfigurationTest, testLoad);
- CppUnit_addTest(pSuite, XMLConfigurationTest, testSave);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Util/testsuite/src/XMLConfigurationTest.h b/Utilities/Poco/Util/testsuite/src/XMLConfigurationTest.h
deleted file mode 100755
index cddd5bc8c7..0000000000
--- a/Utilities/Poco/Util/testsuite/src/XMLConfigurationTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// XMLConfigurationTest.h
-//
-// $Id$
-//
-// Definition of the XMLConfigurationTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XMLConfigurationTest_INCLUDED
-#define XMLConfigurationTest_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "CppUnit/TestCase.h"
-
-
-class XMLConfigurationTest: public CppUnit::TestCase
-{
-public:
- XMLConfigurationTest(const std::string& name);
- ~XMLConfigurationTest();
-
- void testLoad();
- void testSave();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // XMLConfigurationTest_INCLUDED
diff --git a/Utilities/Poco/XML/CMakeLists.txt b/Utilities/Poco/XML/CMakeLists.txt
deleted file mode 100755
index 2f63a91847..0000000000
--- a/Utilities/Poco/XML/CMakeLists.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-set(LIBNAME "PocoXML")
-#set(LIBNAMED "${LIBNAME}d")
-
-aux_source_directory(src SRCS)
-
-add_definitions(-DXML_NS -DXML_DTD -DXML_STATIC -DHAVE_EXPAT_CONFIG_H)
-
-add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
-set_target_properties( ${LIBNAME} PROPERTIES
- #COMPILE_FLAGS ${RELEASE_CXX_FLAGS}
- DEFINE_SYMBOL XML_EXPORTS
- VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
- SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-target_link_libraries( ${LIBNAME} PocoFoundation)
-
-#add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
-#set_target_properties( ${LIBNAMED}
-# PROPERTIES COMPILE_FLAGS "${DEBUG_CXX_FLAGS}"
-# DEFINE_SYMBOL XML_EXPORTS
-# VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
-# SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-#target_link_libraries( ${LIBNAMED} PocoFoundationd)
-
diff --git a/Utilities/Poco/XML/include/Poco/DOM/AbstractContainerNode.h b/Utilities/Poco/XML/include/Poco/DOM/AbstractContainerNode.h
deleted file mode 100755
index c156491ed0..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/AbstractContainerNode.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// AbstractContainerNode.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the AbstractContainerNode class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_AbstractContainerNode_INCLUDED
-#define DOM_AbstractContainerNode_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractNode.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API AbstractContainerNode: public AbstractNode
- /// AbstractContainerNode is an implementation of Node
- /// that stores and manages child nodes.
- ///
- /// Child nodes are organized in a single linked list.
-{
-public:
- // Node
- Node* firstChild() const;
- Node* lastChild() const;
- Node* insertBefore(Node* newChild, Node* refChild);
- Node* replaceChild(Node* newChild, Node* oldChild);
- Node* removeChild(Node* oldChild);
- Node* appendChild(Node* newChild);
- bool hasChildNodes() const;
- bool hasAttributes() const;
-
-protected:
- AbstractContainerNode(Document* pOwnerDocument);
- AbstractContainerNode(Document* pOwnerDocument, const AbstractContainerNode& node);
- ~AbstractContainerNode();
-
- void dispatchNodeRemovedFromDocument();
- void dispatchNodeInsertedIntoDocument();
-
-private:
- AbstractNode* _pFirstChild;
-
- friend class AbstractNode;
- friend class NodeAppender;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_AbstractContainerNode_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/AbstractNode.h b/Utilities/Poco/XML/include/Poco/DOM/AbstractNode.h
deleted file mode 100755
index a5e7813adb..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/AbstractNode.h
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// AbstractNode.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the AbstractNode class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_AbstractNode_INCLUDED
-#define DOM_AbstractNode_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/Node.h"
-#include "Poco/DOM/MutationEvent.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class AbstractContainerNode;
-class Attr;
-class EventDispatcher;
-
-
-class XML_API AbstractNode: public Node
- /// AbstractNode provides a basic implementation
- /// of the Node interface for all types of nodes
- /// that do not contain other nodes.
-{
-public:
- // Node
- const XMLString& nodeName() const;
- const XMLString& getNodeValue() const;
- void setNodeValue(const XMLString& value);
- Node* parentNode() const;
- NodeList* childNodes() const;
- Node* firstChild() const;
- Node* lastChild() const;
- Node* previousSibling() const;
- Node* nextSibling() const;
- NamedNodeMap* attributes() const;
- Document* ownerDocument() const;
- Node* insertBefore(Node* newChild, Node* refChild);
- Node* replaceChild(Node* newChild, Node* oldChild);
- Node* removeChild(Node* oldChild);
- Node* appendChild(Node* newChild);
- bool hasChildNodes() const;
- Node* cloneNode(bool deep) const;
- void normalize();
- bool isSupported(const XMLString& feature, const XMLString& version) const;
- const XMLString& namespaceURI() const;
- XMLString prefix() const;
- const XMLString& localName() const;
- bool hasAttributes() const;
-
- // EventTarget
- void addEventListener(const XMLString& type, EventListener* listener, bool useCapture);
- void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture);
- bool dispatchEvent(Event* evt);
-
- // Extensions
- XMLString innerText() const;
-
- virtual void autoRelease();
-
-protected:
- AbstractNode(Document* pOwnerDocument);
- AbstractNode(Document* pOwnerDocument, const AbstractNode& node);
- ~AbstractNode();
-
- virtual Node* copyNode(bool deep, Document* pOwnerDocument) const = 0;
-
- virtual bool events() const;
- virtual bool eventsSuspended() const;
- void captureEvent(Event* evt);
- void bubbleEvent(Event* evt);
- void dispatchSubtreeModified();
- void dispatchNodeInserted();
- void dispatchNodeRemoved();
- virtual void dispatchNodeRemovedFromDocument();
- virtual void dispatchNodeInsertedIntoDocument();
- void dispatchAttrModified(Attr* pAttr, MutationEvent::AttrChangeType changeType, const XMLString& prevValue, const XMLString& newValue);
- void dispatchCharacterDataModified(const XMLString& prevValue, const XMLString& newValue);
- void setOwnerDocument(Document* pOwnerDocument);
-
- static const XMLString EMPTY_STRING;
-
-private:
- AbstractNode();
-
- AbstractContainerNode* _pParent;
- AbstractNode* _pNext;
- Document* _pOwner;
- EventDispatcher* _pEventDispatcher;
-
- static const XMLString NODE_NAME;
-
- friend class AbstractContainerNode;
- friend class Document;
- friend class DocumentFragment;
- friend class Element;
- friend class Attr;
- friend class CharacterData;
- friend class DOMBuilder;
- friend class NodeAppender;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_AbstractNode_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/Attr.h b/Utilities/Poco/XML/include/Poco/DOM/Attr.h
deleted file mode 100755
index daae39f21c..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/Attr.h
+++ /dev/null
@@ -1,202 +0,0 @@
-//
-// Attr.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM Attr class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_Attr_INCLUDED
-#define DOM_Attr_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractNode.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/XML/Name.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API Attr: public AbstractNode
- /// The Attr interface represents an attribute in an Element object. Typically
- /// the allowable values for the attribute are defined in a document type definition.
- ///
- /// Attr objects inherit the Node interface, but since they are not actually
- /// child nodes of the element they describe, the DOM does not consider them
- /// part of the document tree. Thus, the Node attributes parentNode, previousSibling,
- /// and nextSibling have a null value for Attr objects. The DOM takes the view
- /// that attributes are properties of elements rather than having a separate
- /// identity from the elements they are associated with; this should make it
- /// more efficient to implement such features as default attributes associated
- /// with all elements of a given type. Furthermore, Attr nodes may not be immediate
- /// children of a DocumentFragment. However, they can be associated with Element
- /// nodes contained within a DocumentFragment. In short, users and implementors
- /// of the DOM need to be aware that Attr nodes have some things in common with
- /// other objects inheriting the Node interface, but they also are quite distinct.
- ///
- /// The attribute's effective value is determined as follows: if this attribute
- /// has been explicitly assigned any value, that value is the attribute's effective
- /// value; otherwise, if there is a declaration for this attribute, and that
- /// declaration includes a default value, then that default value is the attribute's
- /// effective value; otherwise, the attribute does not exist on this element
- /// in the structure model until it has been explicitly added. Note that the
- /// nodeValue attribute on the Attr instance can also be used to retrieve the
- /// string version of the attribute's value(s).
- ///
- /// In XML, where the value of an attribute can contain entity references, the
- /// child nodes of the Attr node provide a representation in which entity references
- /// are not expanded. These child nodes may be either Text or EntityReference
- /// nodes. Because the attribute type may be unknown, there are no tokenized
- /// attribute values.
-{
-public:
- const XMLString& name() const;
- /// Returns the name of this attribute.
-
- bool specified() const;
- /// If this attribute was explicitly given a value in the original document,
- /// this is true; otherwise, it is false. Note that the implementation is in
- /// charge of this attribute, not the user. If the user changes the value of
- /// the attribute (even if it ends up having the same value as the default value)
- /// then the specified flag is automatically flipped to true. To re-specify
- /// the attribute as the default value from the DTD, the user must delete the
- /// attribute. The implementation will then make a new attribute available with
- /// specified set to false and the default value (if one exists).
- /// In summary:
- ///
- /// * If the attribute has an assigned value in the document then specified
- /// is true, and the value is the assigned value.
- /// * If the attribute has no assigned value in the document and has a default
- /// value in the DTD, then specified is false, and the value is the default
- /// value in the DTD.
- /// * If the attribute has no assigned value in the document and has a value
- /// of #IMPLIED in the DTD, then the attribute does not appear in the structure
- /// model of the document.
- /// * If the attribute is not associated to any element (i.e. because it
- /// was just created or was obtained from some removal or cloning operation)
- /// specified is true.
-
- const XMLString& value() const;
- /// Returns the value of the attribute as a string. Character
- /// and general entity references are replaced with their values. See also the
- /// method getAttribute on the Element interface.
-
- const XMLString& getValue() const;
- /// Returns the value of the attribute as a string. Character
- /// and general entity references are replaced with their values. See also the
- /// method getAttribute on the Element interface.
-
- void setValue(const XMLString& value);
- /// Sets the value of the attribute as a string.
- /// This creates a Text node with the unparsed contents of the string.
- /// I.e. any characters that an XML processor would recognize as markup are
- /// instead treated as literal text. See also the method setAttribute on the
- /// Element interface.
-
- // DOM Level 2
- Element* ownerElement() const;
- /// The Element node this attribute is attached to or null
- /// if this attribute is not in use.
-
- // Node
- Node* parentNode() const;
- const XMLString& nodeName() const;
- const XMLString& getNodeValue() const;
- void setNodeValue(const XMLString& value);
- unsigned short nodeType() const;
- Node* previousSibling() const;
- const XMLString& namespaceURI() const;
- XMLString prefix() const;
- const XMLString& localName() const;
-
- // Non-standard extensions
- XMLString innerText() const;
-
-protected:
- Attr(Document* pOwnerDocument, Element* pOwnerElement, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& value, bool specified = true);
- Attr(Document* pOwnerDocument, const Attr& attr);
- ~Attr();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
-private:
- const Name& _name;
- XMLString _value;
- bool _specified;
-
- friend class Document;
- friend class Element;
- friend class DOMBuilder;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& Attr::name() const
-{
- return _name.qname();
-}
-
-
-inline const XMLString& Attr::value() const
-{
- return _value;
-}
-
-
-inline const XMLString& Attr::getValue() const
-{
- return _value;
-}
-
-
-inline bool Attr::specified() const
-{
- return _specified;
-}
-
-
-inline Element* Attr::ownerElement() const
-{
- return static_cast<Element*>(_pParent);
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_Attr_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/AttrMap.h b/Utilities/Poco/XML/include/Poco/DOM/AttrMap.h
deleted file mode 100755
index 0fa4fc7955..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/AttrMap.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// AttrMap.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the AttrMap class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_AttrMap_INCLUDED
-#define DOM_AttrMap_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/NamedNodeMap.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Element;
-
-
-class XML_API AttrMap: public NamedNodeMap
- // This implementation of NamedNodeMap is
- // returned by Element::attributes()
-{
-public:
- Node* getNamedItem(const XMLString& name) const;
- Node* setNamedItem(Node* arg);
- Node* removeNamedItem(const XMLString& name);
- Node* item(unsigned long index) const;
- unsigned long length() const;
-
- Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const;
- Node* setNamedItemNS(Node* arg);
- Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName);
-
- void autoRelease();
-
-protected:
- AttrMap(Element* pElement);
- ~AttrMap();
-
-private:
- AttrMap();
-
- Element* _pElement;
-
- friend class Element;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_AttrMap_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/AutoPtr.h b/Utilities/Poco/XML/include/Poco/DOM/AutoPtr.h
deleted file mode 100755
index 07c72ef358..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/AutoPtr.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// AutoPtr.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Import Poco::AutoPtr into the XML namespace.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DOMAutoPtr_INCLUDED
-#define DOM_DOMAutoPtr_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/AutoPtr.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-using Poco::AutoPtr;
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DOMAutoPtr_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/CDATASection.h b/Utilities/Poco/XML/include/Poco/DOM/CDATASection.h
deleted file mode 100755
index 04d022e7ab..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/CDATASection.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// CDATASection.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM CDATASection class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_CDATASection_INCLUDED
-#define DOM_CDATASection_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/Text.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API CDATASection: public Text
- /// CDATA sections are used to escape blocks of text containing characters that
- /// would otherwise be regarded as markup. The only delimiter that is recognized
- /// in a CDATA section is the "]]>" string that ends the CDATA section. CDATA
- /// sections cannot be nested. Their primary purpose is for including material
- /// such as XML fragments, without needing to escape all the delimiters.
- ///
- /// The DOMString attribute of the Text node holds the text that is contained
- /// by the CDATA section. Note that this may contain characters that need to
- /// be escaped outside of CDATA sections and that, depending on the character
- /// encoding ("charset") chosen for serialization, it may be impossible to write
- /// out some characters as part of a CDATA section.
- ///
- /// The CDATASection interface inherits from the CharacterData interface through
- /// the Text interface. Adjacent CDATASection nodes are not merged by use of
- /// the normalize method on the Element interface.
- ///
- /// Note: Because no markup is recognized within a CDATASection, character numeric
- /// references cannot be used as an escape mechanism when serializing. Therefore,
- /// action needs to be taken when serializing a CDATASection with a character
- /// encoding where some of the contained characters cannot be represented. Failure
- /// to do so would not produce well-formed XML.
- /// One potential solution in the serialization process is to end the CDATA
- /// section before the character, output the character using a character reference
- /// or entity reference, and open a new CDATA section for any further characters
- /// in the text node. Note, however, that some code conversion libraries at
- /// the time of writing do not return an error or exception when a character
- /// is missing from the encoding, making the task of ensuring that data is not
- /// corrupted on serialization more difficult.
-{
-public:
- // Text
- Text* splitText(unsigned long offset);
-
- // Node
- const XMLString& nodeName() const;
- unsigned short nodeType() const;
-
-protected:
- CDATASection(Document* pOwnerDocument, const XMLString& data);
- CDATASection(Document* pOwnerDocument, const CDATASection& sec);
- ~CDATASection();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
-private:
- static const XMLString NODE_NAME;
-
- friend class Document;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_CDATASection_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/CharacterData.h b/Utilities/Poco/XML/include/Poco/DOM/CharacterData.h
deleted file mode 100755
index 99aef16e20..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/CharacterData.h
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// CharacterData.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM CharacterData class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_CharacterData_INCLUDED
-#define DOM_CharacterData_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractNode.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API CharacterData: public AbstractNode
- /// The CharacterData interface extends Node with a set of attributes and methods
- /// for accessing character data in the DOM. For clarity this set is defined
- /// here rather than on each object that uses these attributes and methods.
- /// No DOM objects correspond directly to CharacterData, though Text and others
- /// do inherit the interface from it. All offsets in this interface start from 0.
- ///
- /// Text strings in the DOM are represented in either UTF-8 (if XML_UNICODE_WCHAR_T is
- /// not defined) or in UTF-16 (if XML_UNICODE_WCHAR_T is defined).
- /// Indexing on character data is done in XMLChar units.
-{
-public:
- const XMLString& data() const;
- /// Returns the character data of the node that
- /// implements the interface.
-
- const XMLString& getData() const;
- /// Returns the character data of the node that
- /// implements the interface.
-
- void setData(const XMLString& data);
- /// Sets the character data of the node that
- /// implements the interface.
-
- unsigned long length() const;
- /// Returns the number of XMLChars that are available
- /// through getData and substringData. This may have the
- /// value zero.
-
- XMLString substringData(unsigned long offset, unsigned long count) const;
- /// Extracts a range of data from the node.
- /// If offset and count exceeds the length, then all
- /// the characters to the end of the data are returned.
-
- void appendData(const XMLString& arg);
- /// Append the string to the end of the character data
- /// of the node.
-
- void insertData(unsigned long offset, const XMLString& arg);
- /// Insert a string at the specified character offset.
-
- void deleteData(unsigned long offset, unsigned long count);
- /// Remove a range of characters from the node.
-
- void replaceData(unsigned long offset, unsigned long count, const XMLString& arg);
- /// Replace the characters starting at the specified character
- /// offset with the specified string.
-
- // Non-standard extensions
- XMLString trimmedData() const;
- /// Returns the character data of that node with
- /// all surrounding whitespace removed.
- ///
- /// This method is an extension to the W3C Document Object Model.
-
- // Node
- const XMLString& getNodeValue() const;
- void setNodeValue(const XMLString& value);
-
-protected:
- CharacterData(Document* pOwnerDocument, const XMLString& data);
- CharacterData(Document* pOwnerDocument, const CharacterData& data);
- ~CharacterData();
-
-private:
- XMLString _data;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& CharacterData::data() const
-{
- return _data;
-}
-
-
-inline const XMLString& CharacterData::getData() const
-{
- return _data;
-}
-
-
-inline unsigned long CharacterData::length() const
-{
- return (unsigned long) _data.length();
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_CharacterData_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/ChildNodesList.h b/Utilities/Poco/XML/include/Poco/DOM/ChildNodesList.h
deleted file mode 100755
index bb8e5e4dda..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/ChildNodesList.h
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// ChildNodesList.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the ChildNodesList class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_ChildNodesList_INCLUDED
-#define DOM_ChildNodesList_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/NodeList.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API ChildNodesList: public NodeList
- // This implementation of NodeList is returned
- // by Node::getChildNodes().
-{
-public:
- Node* item(unsigned long index) const;
- unsigned long length() const;
-
- void autoRelease();
-
-protected:
- ChildNodesList(const Node* pParent);
- ~ChildNodesList();
-
-private:
- ChildNodesList();
-
- const Node* _pParent;
-
- friend class AbstractNode;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_ChildNodesList_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/Comment.h b/Utilities/Poco/XML/include/Poco/DOM/Comment.h
deleted file mode 100755
index f132872efe..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/Comment.h
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// Comment.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM Comment class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_Comment_INCLUDED
-#define DOM_Comment_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/CharacterData.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API Comment: public CharacterData
- /// This interface inherits from CharacterData and represents the content of
- /// a comment, i.e., all the characters between the starting '<!--' and ending
- /// '-->'. Note that this is the definition of a comment in XML, and, in practice,
- /// HTML, although some HTML tools may implement the full SGML comment structure.
-{
-public:
- // Node
- const XMLString& nodeName() const;
- unsigned short nodeType() const;
-
-protected:
- Comment(Document* pOwnerDocument, const XMLString& data);
- Comment(Document* pOwnerDocument, const Comment& comment);
- ~Comment();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
-private:
- static const XMLString NODE_NAME;
-
- friend class Document;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_Comment_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DOMBuilder.h b/Utilities/Poco/XML/include/Poco/DOM/DOMBuilder.h
deleted file mode 100755
index 0abee31c4d..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DOMBuilder.h
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// DOMBuilder.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMBuilder
-//
-// Definition of the DOMBuilder class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DOMBuilder_INCLUDED
-#define DOM_DOMBuilder_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/ContentHandler.h"
-#include "Poco/SAX/LexicalHandler.h"
-#include "Poco/SAX/DTDHandler.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XMLReader;
-class Document;
-class InputSource;
-class AbstractNode;
-class AbstractContainerNode;
-class NamePool;
-
-
-class XML_API DOMBuilder: protected DTDHandler, protected ContentHandler, protected LexicalHandler
- /// This class builds a tree representation of an
- /// XML document, according to the W3C Document Object Model, Level 1 and 2
- /// specifications.
- ///
- /// The actual XML parsing is done by an XMLReader, which
- /// must be supplied to the DOMBuilder.
-{
-public:
- DOMBuilder(XMLReader& xmlReader, NamePool* pNamePool = 0);
- /// Creates a DOMBuilder using the given XMLReader.
- /// If a NamePool is given, it becomes the Document's NamePool.
-
- virtual ~DOMBuilder();
- /// Destroys the DOMBuilder.
-
- virtual Document* parse(const XMLString& uri);
- /// Parse an XML document from a location identified by an URI.
-
- virtual Document* parse(InputSource* pInputSource);
- /// Parse an XML document from a location identified by an InputSource.
-
- virtual Document* parseMemoryNP(const char* xml, std::size_t size);
- /// Parses an XML document from memory.
-
-protected:
- // DTDHandler
- void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId);
- void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName);
-
- // ContentHandler
- void setDocumentLocator(const Locator* loc);
- void startDocument();
- void endDocument();
- void startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attributes);
- void endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname);
- void characters(const XMLChar ch[], int start, int length);
- void ignorableWhitespace(const XMLChar ch[], int start, int length);
- void processingInstruction(const XMLString& target, const XMLString& data);
- void startPrefixMapping(const XMLString& prefix, const XMLString& uri);
- void endPrefixMapping(const XMLString& prefix);
- void skippedEntity(const XMLString& name);
-
- // LexicalHandler
- void startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId);
- void endDTD();
- void startEntity(const XMLString& name);
- void endEntity(const XMLString& name);
- void startCDATA();
- void endCDATA();
- void comment(const XMLChar ch[], int start, int length);
-
- void appendNode(AbstractNode* pNode);
-
- void setupParse();
-
-private:
- static const XMLString EMPTY_STRING;
-
- XMLReader& _xmlReader;
- NamePool* _pNamePool;
- Document* _pDocument;
- AbstractContainerNode* _pParent;
- AbstractNode* _pPrevious;
- bool _inCDATA;
- bool _namespaces;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DOMBuilder_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DOMException.h b/Utilities/Poco/XML/include/Poco/DOM/DOMException.h
deleted file mode 100755
index 8fb205f4f9..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DOMException.h
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// DOMException.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM DOMException class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DOMException_INCLUDED
-#define DOM_DOMException_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API DOMException: public XMLException
- /// DOM operations only raise exceptions in "exceptional" circumstances, i.e.,
- /// when an operation is impossible to perform (either for logical reasons,
- /// because data is lost, or because the implementation has become unstable).
- /// In general, DOM methods return specific error values in ordinary processing
- /// situations, such as out-of-bound errors when using NodeList.
- ///
- /// Implementations should raise other exceptions under other circumstances.
- /// For example, implementations should raise an implementation-dependent exception
- /// if a null argument is passed when null was not expected.
-{
-public:
- enum
- {
- INDEX_SIZE_ERR = 1, /// index or size is negative or greater than allowed value
- DOMSTRING_SIZE_ERR, /// the specified range of text does not fit into a DOMString (not used)
- HIERARCHY_REQUEST_ERR, /// a node is inserted somewhere it doesn't belong
- WRONG_DOCUMENT_ERR, /// a node is used in a different document than the one that created it
- INVALID_CHARACTER_ERR, /// an invalid character is specified (not used)
- NO_DATA_ALLOWED_ERR, /// data is specified for a node which does not support data
- NO_MODIFICATION_ALLOWED_ERR, /// an attempt is made to modify an object where modifications are not allowed
- NOT_FOUND_ERR, /// an attempt was made to reference a node in a context where it does not exist
- NOT_SUPPORTED_ERR, /// the implementation does not support the type of object requested
- INUSE_ATTRIBUTE_ERR, /// an attempt is made to add an attribute that is already in use elsewhere
- INVALID_STATE_ERR, /// a parameter or an operation is not supported by the underlying object
- SYNTAX_ERR, /// an invalid or illegal string is specified
- INVALID_MODIFICATION_ERR, /// an attempt is made to modify the type of the underlying object
- NAMESPACE_ERR, /// an attempt is made to create or change an object in a way which is incorrect with regard to namespaces
- INVALID_ACCESS_ERR, /// an attempt is made to use an object that is not, or is no longer, usable
-
- _NUMBER_OF_MESSAGES
- };
-
- DOMException(unsigned short code);
- /// Creates a DOMException with the given error code.
-
- DOMException(const DOMException& exc);
- /// Creates a DOMException by copying another one.
-
- ~DOMException() throw();
- /// Destroys the DOMException.
-
- DOMException& operator = (const DOMException& exc);
-
- const char* name() const throw();
- /// Returns a static string describing the exception.
-
- const char* className() const throw();
- /// Returns the name of the exception class.
-
- Poco::Exception* clone() const;
- /// Creates an exact copy of the exception.
-
- void rethrow() const;
- /// (Re)Throws the exception.
-
- unsigned short code() const;
- /// Returns the DOM exception code.
-
-protected:
- static const std::string& message(unsigned short code);
-
-private:
- DOMException();
-
- unsigned short _code;
-
- static const std::string MESSAGES[_NUMBER_OF_MESSAGES];
-};
-
-
-//
-// inlines
-//
-inline unsigned short DOMException::code() const
-{
- return _code;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DOMException_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DOMImplementation.h b/Utilities/Poco/XML/include/Poco/DOM/DOMImplementation.h
deleted file mode 100755
index 63bd0ad935..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DOMImplementation.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// DOMImplementation.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM DOMImplementation class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DOMImplementation_INCLUDED
-#define DOM_DOMImplementation_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class DocumentType;
-class Document;
-class NamePool;
-
-
-class XML_API DOMImplementation
- /// The DOMImplementation interface provides a number of methods for
- /// performing operations that are independent of any particular instance
- /// of the document object model.
- /// In this implementation, DOMImplementation is implemented as a singleton.
-{
-public:
- DOMImplementation();
- /// Creates the DOMImplementation.
-
- ~DOMImplementation();
- /// Destroys the DOMImplementation.
-
- bool hasFeature(const XMLString& feature, const XMLString& version) const;
- /// Tests if the DOM implementation implements a specific feature.
- ///
- /// The only supported features are "XML", version "1.0" and "Core",
- /// "Events", "MutationEvents" and "Traversal", version "2.0".
-
- // DOM Level 2
- DocumentType* createDocumentType(const XMLString& name, const XMLString& publicId, const XMLString& systemId) const;
- /// Creates an empty DocumentType node. Entity declarations and notations
- /// are not made available. Entity reference expansions and default attribute
- /// additions do not occur.
-
- Document* createDocument(const XMLString& namespaceURI, const XMLString& qualifiedName, DocumentType* doctype) const;
- /// Creates an XML Document object of the specified type with its document element.
- ///
- /// Note: You can also create a Document directly using the new operator.
-
- static const DOMImplementation& instance();
- /// Returns a reference to the default DOMImplementation
- /// object.
-
-private:
- static const XMLString FEATURE_XML;
- static const XMLString FEATURE_CORE;
- static const XMLString FEATURE_EVENTS;
- static const XMLString FEATURE_MUTATIONEVENTS;
- static const XMLString FEATURE_TRAVERSAL;
- static const XMLString VERSION_1_0;
- static const XMLString VERSION_2_0;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DOMImplementation_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DOMObject.h b/Utilities/Poco/XML/include/Poco/DOM/DOMObject.h
deleted file mode 100755
index 5d1efdfaf9..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DOMObject.h
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// DOMObject.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOMObject class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DOMObject_INCLUDED
-#define DOM_DOMObject_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API DOMObject
- /// The base class for all objects in the Document Object Model.
- ///
- /// DOMObject defines the rules for memory management
- /// in this implementation of the DOM. Violation of these
- /// rules, which are outlined in the following, results
- /// in memory leaks or dangling pointers.
- ///
- /// Every object created by new or by a factory
- /// method (for example, Document::create*) must be released
- /// with a call to release() or autoRelease() when it
- /// is no longer needed.
- ///
- /// Every object created by cloning or importing another
- /// object must be released.
- /// For every call to duplicate() there must be a matching
- /// call to release().
- /// An object obtained via any other way must not be
- /// released, except ownership of it has been explicitely
- /// taken with a call to duplicate().
- ///
- /// While DOMObjects are safe for use in multithreaded programs,
- /// a DOMObject or one of its subclasses must not be accessed
- /// from multiple threads simultaneously.
-{
-public:
- DOMObject();
- /// Creates the DOMObject.
- /// The object's reference count is initialized to one.
-
- void duplicate() const;
- /// Increases the object's reference count.
-
- void release() const;
- /// Decreases the object's reference count.
- /// If the reference count reaches zero,
- /// the object is deleted.
-
- virtual void autoRelease() = 0;
- /// Adds the object to an appropriate
- /// AutoReleasePool, which is usually the
- /// AutoReleasePool managed by the Document
- /// to which this object belongs.
-
-protected:
- virtual ~DOMObject();
- /// Destroys the DOMObject.
-
-private:
- DOMObject(const DOMObject&);
- DOMObject& operator = (const DOMObject&);
-
- mutable int _rc;
-};
-
-
-//
-// inlines
-//
-inline void DOMObject::duplicate() const
-{
- ++_rc;
-}
-
-
-inline void DOMObject::release() const
-{
- if (--_rc == 0)
- delete this;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DOMObject_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DOMParser.h b/Utilities/Poco/XML/include/Poco/DOM/DOMParser.h
deleted file mode 100755
index 047ad22ac5..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DOMParser.h
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// DOMParser.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMParser
-//
-// Definition of the DOMParser class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DOMParser_INCLUDED
-#define DOM_DOMParser_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/SAXParser.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class NamePool;
-class Document;
-class InputSource;
-class EntityResolver;
-
-
-class XML_API DOMParser
- /// This is a convenience class that combines a
- /// DOMBuilder with a SAXParser, with the optional
- /// support of a WhitespaceFilter.
-{
-public:
- DOMParser(NamePool* pNamePool = 0);
- /// Creates a new DOMParser.
- /// If a NamePool is given, it becomes the Document's NamePool.
-
- ~DOMParser();
- /// Destroys the DOMParser.
-
- void setEncoding(const XMLString& encoding);
- /// Sets the encoding used by the parser if no
- /// encoding is specified in the XML document.
-
- const XMLString& getEncoding() const;
- /// Returns the name of the encoding used by
- /// the parser if no encoding is specified in
- /// the XML document.
-
- void addEncoding(const XMLString& name, Poco::TextEncoding* pEncoding);
- /// Adds an encoding to the parser.
-
- void setFeature(const XMLString& name, bool state);
- /// Set the state of a feature.
- ///
- /// If a feature is not recognized by the DOMParser, it is
- /// passed on to the underlying XMLReader.
- ///
- /// The only currently supported feature is
- /// http://www.appinf.com/features/no-whitespace-in-element-content
- /// which, when activated, causes the WhitespaceFilter to
- /// be used.
-
- bool getFeature(const XMLString& name) const;
- /// Look up the value of a feature.
- ///
- /// If a feature is not recognized by the DOMParser, the
- /// DOMParser queries the underlying SAXParser for the feature.
-
- Document* parse(const XMLString& uri);
- /// Parse an XML document from a location identified by an URI.
-
- Document* parse(InputSource* pInputSource);
- /// Parse an XML document from a location identified by an InputSource.
-
- Document* parseString(const std::string& xml);
- /// Parse an XML document from a string.
-
- Document* parseMemory(const char* xml, std::size_t size);
- /// Parse an XML document from memory.
-
- EntityResolver* getEntityResolver() const;
- /// Returns the entity resolver used by the underlying SAXParser.
-
- void setEntityResolver(EntityResolver* pEntityResolver);
- /// Sets the entity resolver on the underlying SAXParser.
-
- static const XMLString FEATURE_WHITESPACE;
-
-private:
- SAXParser _saxParser;
- NamePool* _pNamePool;
- bool _whitespace;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DOMParser_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DOMSerializer.h b/Utilities/Poco/XML/include/Poco/DOM/DOMSerializer.h
deleted file mode 100755
index 026f6379f9..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DOMSerializer.h
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// DOMSerializer.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMSerializer
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DOMSerializer_INCLUDED
-#define DOM_DOMSerializer_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/XMLReader.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Node;
-class Element;
-class Text;
-class Comment;
-class ProcessingInstruction;
-class Entity;
-class CDATASection;
-class Notation;
-class Document;
-class DocumentType;
-class DocumentFragment;
-class DeclHandler;
-class LexicalHandler;
-
-
-class XML_API DOMSerializer: public XMLReader
- /// The DOMSerializer serializes a DOM document
- /// into a sequence of SAX events which are
- /// reported to the registered SAX event
- /// handlers.
- ///
- /// The DOMWriter uses a DOMSerializer with an
- /// XMLWriter to serialize a DOM document into
- /// textual XML.
-{
-public:
- DOMSerializer();
- /// Creates the DOMSerializer.
-
- ~DOMSerializer();
- /// Destroys the DOMSerializer.
-
- void serialize(const Node* pNode);
- /// Serializes a DOM node and its children
- /// into a sequence of SAX events, which are
- /// reported to the registered SAX event
- /// handlers.
-
- // XMLReader
- void setEntityResolver(EntityResolver* pResolver);
- EntityResolver* getEntityResolver() const;
- void setDTDHandler(DTDHandler* pDTDHandler);
- DTDHandler* getDTDHandler() const;
- void setContentHandler(ContentHandler* pContentHandler);
- ContentHandler* getContentHandler() const;
- void setErrorHandler(ErrorHandler* pErrorHandler);
- ErrorHandler* getErrorHandler() const;
-
- void setFeature(const XMLString& featureId, bool state);
- bool getFeature(const XMLString& featureId) const;
- void setProperty(const XMLString& propertyId, const XMLString& value);
- void setProperty(const XMLString& propertyId, void* value);
- void* getProperty(const XMLString& propertyId) const;
-
-protected:
- void parse(InputSource* pSource);
- /// The DOMSerializer cannot parse an InputSource,
- /// so this method simply throws an XMLException when invoked.
-
- void parse(const XMLString& systemId);
- /// The DOMSerializer cannot parse from a system identifier,
- /// so this method simply throws an XMLException when invoked.
-
- void parseMemoryNP(const char* xml, std::size_t size);
- /// The DOMSerializer cannot parse from a system identifier,
- /// so this method simply throws an XMLException when invoked.
-
- void iterate(const Node* pNode) const;
- void handleNode(const Node* pNode) const;
- void handleElement(const Element* pElement) const;
- void handleCharacterData(const Text* pText) const;
- void handleComment(const Comment* pComment) const;
- void handlePI(const ProcessingInstruction* pPI) const;
- void handleCDATASection(const CDATASection* pCDATA) const;
- void handleDocument(const Document* pDocument) const;
- void handleDocumentType(const DocumentType* pDocumentType) const;
- void handleFragment(const DocumentFragment* pFragment) const;
- void handleNotation(const Notation* pNotation) const;
- void handleEntity(const Entity* pEntity) const;
-
-private:
- EntityResolver* _pEntityResolver;
- DTDHandler* _pDTDHandler;
- ContentHandler* _pContentHandler;
- ErrorHandler* _pErrorHandler;
- DeclHandler* _pDeclHandler;
- LexicalHandler* _pLexicalHandler;
-
- static const XMLString CDATA;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DOMSerializer_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DOMWriter.h b/Utilities/Poco/XML/include/Poco/DOM/DOMWriter.h
deleted file mode 100755
index de57fa3cfe..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DOMWriter.h
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// DOMWriter.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMWriter
-//
-// Definition of class DOMWriter.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DOMWriter_INCLUDED
-#define DOM_DOMWriter_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/XML/XMLStream.h"
-#include "Poco/TextEncoding.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Node;
-class Document;
-
-
-class XML_API DOMWriter
- /// The DOMWriter uses a DOMSerializer with an
- /// XMLWriter to serialize a DOM document into
- /// textual XML.
-{
-public:
- DOMWriter();
- /// Creates a DOMWriter.
-
- ~DOMWriter();
- /// Destroys a DOMWriter.
-
- void setEncoding(const std::string& encodingName, Poco::TextEncoding& textEncoding);
- /// Sets the encoding, which will be reflected in the written XML declaration.
-
- const std::string& getEncoding() const;
- /// Returns the encoding name set with setEncoding.
-
- void setOptions(int options);
- /// Sets options for the internal XMLWriter.
- ///
- /// See class XMLWriter for available options.
-
- int getOptions() const;
- /// Returns the options for the internal XMLWriter.
-
- void setNewLine(const std::string& newLine);
- /// Sets the line ending characters for the internal
- /// XMLWriter. See XMLWriter::setNewLine() for a list
- /// of supported values.
-
- const std::string& getNewLine() const;
- /// Returns the line ending characters used by the
- /// internal XMLWriter.
-
- void writeNode(XMLByteOutputStream& ostr, const Node* pNode);
- /// Writes the XML for the given node to the specified stream.
-
- void writeNode(const std::string& systemId, const Node* pNode);
- /// Writes the XML for the given node to the file specified in systemId,
- /// using a standard file output stream (Poco::FileOutputStream).
-
-private:
- std::string _encodingName;
- Poco::TextEncoding* _pTextEncoding;
- int _options;
- std::string _newLine;
-};
-
-
-//
-// inlines
-//
-inline const std::string& DOMWriter::getEncoding() const
-{
- return _encodingName;
-}
-
-
-inline int DOMWriter::getOptions() const
-{
- return _options;
-}
-
-
-inline const std::string& DOMWriter::getNewLine() const
-{
- return _newLine;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DOMWriter_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DTDMap.h b/Utilities/Poco/XML/include/Poco/DOM/DTDMap.h
deleted file mode 100755
index a2e44c944e..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DTDMap.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// DTDMap.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DTDMap class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DTDMap_INCLUDED
-#define DOM_DTDMap_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/NamedNodeMap.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class DocumentType;
-
-
-class XML_API DTDMap: public NamedNodeMap
- /// This implementation of NamedNodeMap
- /// is returned by DocumentType::entities()
- /// and DocumentType::notations().
-{
-public:
- Node* getNamedItem(const XMLString& name) const;
- Node* setNamedItem(Node* arg);
- Node* removeNamedItem(const XMLString& name);
- Node* item(unsigned long index) const;
- unsigned long length() const;
-
- Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const;
- Node* setNamedItemNS(Node* arg);
- Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName);
-
- void autoRelease();
-
-protected:
- DTDMap(const DocumentType* pDocumentType, unsigned short type);
- ~DTDMap();
-
-private:
- DTDMap();
-
- const DocumentType* _pDocumentType;
- unsigned short _type;
-
- friend class DocumentType;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DTDMap_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/Document.h b/Utilities/Poco/XML/include/Poco/DOM/Document.h
deleted file mode 100755
index 81b32d4b58..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/Document.h
+++ /dev/null
@@ -1,299 +0,0 @@
-//
-// Document.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM Document class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_Document_INCLUDED
-#define DOM_Document_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractContainerNode.h"
-#include "Poco/DOM/DocumentEvent.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/XML/NamePool.h"
-#include "Poco/AutoReleasePool.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class NamePool;
-class DocumentType;
-class DOMImplementation;
-class Element;
-class DocumentFragment;
-class Text;
-class Comment;
-class CDATASection;
-class ProcessingInstruction;
-class Attr;
-class EntityReference;
-class NodeList;
-class Entity;
-class Notation;
-
-
-class XML_API Document: public AbstractContainerNode, public DocumentEvent
- /// The Document interface represents the entire HTML or XML document. Conceptually,
- /// it is the root of the document tree, and provides the primary access to the
- /// document's data.
- ///
- /// Since elements, text nodes, comments, processing instructions, etc. cannot exist
- /// outside the context of a Document, the Document interface also contains the
- /// factory methods needed to create these objects. The Node objects created have a
- /// ownerDocument attribute which associates them with the Document within whose
- /// context they were created.
-{
-public:
- typedef Poco::AutoReleasePool<DOMObject> AutoReleasePool;
-
- Document(NamePool* pNamePool = 0);
- /// Creates a new document. If pNamePool == 0, the document
- /// creates its own name pool, otherwise it uses the given name pool.
- /// Sharing a name pool makes sense for documents containing instances
- /// of the same schema, thus reducing memory usage.
-
- Document(DocumentType* pDocumentType, NamePool* pNamePool = 0);
- /// Creates a new document. If pNamePool == 0, the document
- /// creates its own name pool, otherwise it uses the given name pool.
- /// Sharing a name pool makes sense for documents containing instances
- /// of the same schema, thus reducing memory usage.
-
- NamePool& namePool();
- /// Returns a pointer to the documents Name Pool.
-
- AutoReleasePool& autoReleasePool();
- /// Returns a pointer to the documents Auto Release Pool.
-
- void collectGarbage();
- /// Releases all objects in the Auto Release Pool.
-
- void suspendEvents();
- /// Suspends all events until resumeEvents() is called.
-
- void resumeEvents();
- /// Resumes all events suspended with suspendEvent();
-
- bool eventsSuspended() const;
- /// Returns true if events are suspeded.
-
- bool events() const;
- /// Returns true if events are not suspeded.
-
- const DocumentType* doctype() const;
- /// The Document Type Declaration (see DocumentType) associated with this document.
- /// For HTML documents as well as XML documents without a document type declaration
- /// this returns null. The DOM Level 1 does not support editing the Document
- /// Type Declaration. docType cannot be altered in any way, including through
- /// the use of methods inherited from the Node interface, such as insertNode
- /// or removeNode.
-
- const DOMImplementation& implementation() const;
- /// The DOMImplementation object that handles this document. A DOM application
- /// may use objects from multiple implementations.
-
- Element* documentElement() const;
- /// This is a convenience attribute that allows direct access to the child node
- /// that is the root element of the document. For HTML documents, this is the
- /// element with the tagName "HTML".
-
- Element* createElement(const XMLString& tagName) const;
- /// Creates an element of the type specified. Note that the instance returned
- /// implements the Element interface, so attributes can be specified directly
- /// on the returned object.
- ///
- /// In addition, if there are known attributes with default values, Attr nodes
- /// representing them are automatically created and attached to the element.
-
- DocumentFragment* createDocumentFragment() const;
- /// Creates an empty DocumentFragment object.
-
- Text* createTextNode(const XMLString& data) const;
- /// Creates a text node given the specified string.
-
- Comment* createComment(const XMLString& data) const;
- /// Creates a comment node given the specified string.
-
- CDATASection* createCDATASection(const XMLString& data) const;
- /// Creates a CDATASection node whose value is the specified string.
-
- ProcessingInstruction* createProcessingInstruction(const XMLString& target, const XMLString& data) const;
- /// Creates a ProcessingInstruction node given the specified target and data strings.
-
- Attr* createAttribute(const XMLString& name) const;
- /// Creates an Attr of the given name. Note that the Attr instance can then
- /// be set on an Element using the setAttributeNode method.
-
- EntityReference* createEntityReference(const XMLString& name) const;
- /// Creates an EntityReference object. In addition, if the referenced entity
- /// is known, the child list of the EntityReference node is made the same as
- /// that of the corresponding Entity node.
-
- NodeList* getElementsByTagName(const XMLString& name) const;
- /// Returns a NodeList of all Elements with a given tag name in the order
- /// in which they would be encountered in a preorder traversal of the
- /// document tree.
- ///
- /// The returned NodeList must be released with a call to release()
- /// when no longer needed.
-
- // DOM Level 2
- Node* importNode(Node* importedNode, bool deep);
- /// Imports a node from another document to this document. The returned node
- /// has no parent; (parentNode is null). The source node is not altered or removed
- /// from the original document; this method creates a new copy of the source
- /// node.
- /// For all nodes, importing a node creates a node object owned by the importing
- /// document, with attribute values identical to the source node's nodeName
- /// and nodeType, plus the attributes related to namespaces (prefix, localName,
- /// and namespaceURI). As in the cloneNode operation on a Node, the source node
- /// is not altered.
- /// Additional information is copied as appropriate to the nodeType, attempting
- /// to mirror the behavior expected if a fragment of XML or HTML source was
- /// copied from one document to another, recognizing that the two documents
- /// may have different DTDs in the XML case.
-
- Element* createElementNS(const XMLString& namespaceURI, const XMLString& qualifiedName) const;
- /// Creates an element of the given qualified name and namespace URI.
-
- Attr* createAttributeNS(const XMLString& namespaceURI, const XMLString& qualifiedName) const;
- /// Creates an attribute of the given qualified name and namespace URI.
-
- NodeList* getElementsByTagNameNS(const XMLString& namespaceURI, const XMLString& localName) const;
- /// Returns a NodeList of all the Elements with a given local name and
- /// namespace URI in the order in which they are encountered in a
- /// preorder traversal of the Document tree.
-
- Element* getElementById(const XMLString& elementId) const;
- /// Returns the Element whose ID is given by elementId. If no such
- /// element exists, returns null. Behavior is not defined if more
- /// than one element has this ID.
- ///
- /// Note: The DOM implementation must have information that says
- /// which attributes are of type ID. Attributes with the name "ID"
- /// are not of type ID unless so defined. Implementations that do
- /// not know whether attributes are of type ID or not are expected to
- /// return null. This implementation therefore returns null.
- ///
- /// See also the non-standard two argument variant of getElementById()
- /// and getElementByIdNS().
-
- // DocumentEvent
- Event* createEvent(const XMLString& eventType) const;
-
- // Node
- const XMLString& nodeName() const;
- unsigned short nodeType() const;
-
- // EventTarget
- bool dispatchEvent(Event* evt);
-
- // Extensions
- Entity* createEntity(const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName) const;
- /// Creates an Entity with the given name, publicId, systemId and notationName.
- ///
- /// This method is not part of the W3C Document Object Model.
-
- Notation* createNotation(const XMLString& name, const XMLString& publicId, const XMLString& systemId) const;
- /// Creates a Notation with the given name, publicId and systemId.
- ///
- /// This method is not part of the W3C Document Object Model.
-
- Element* getElementById(const XMLString& elementId, const XMLString& idAttribute) const;
- /// Returns the first Element whose ID attribute (given in idAttribute)
- /// has the given elementId. If no such element exists, returns null.
- ///
- /// This method is an extension to the W3C Document Object Model.
-
- Element* getElementByIdNS(const XMLString& elementId, const XMLString& idAttributeURI, const XMLString& idAttributeLocalName) const;
- /// Returns the first Element whose ID attribute (given in idAttributeURI and idAttributeLocalName)
- /// has the given elementId. If no such element exists, returns null.
- ///
- /// This method is an extension to the W3C Document Object Model.
-
-protected:
- ~Document();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
- DocumentType* getDoctype();
- void setDoctype(DocumentType* pDoctype);
-
-private:
- DocumentType* _pDocumentType;
- NamePool* _pNamePool;
- AutoReleasePool _autoReleasePool;
- int _eventSuspendLevel;
-
- static const XMLString NODE_NAME;
-
- friend class DOMBuilder;
-};
-
-
-//
-// inlines
-//
-inline NamePool& Document::namePool()
-{
- return *_pNamePool;
-}
-
-
-inline Document::AutoReleasePool& Document::autoReleasePool()
-{
- return _autoReleasePool;
-}
-
-
-inline const DocumentType* Document::doctype() const
-{
- return _pDocumentType;
-}
-
-
-inline DocumentType* Document::getDoctype()
-{
- return _pDocumentType;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_Document_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DocumentEvent.h b/Utilities/Poco/XML/include/Poco/DOM/DocumentEvent.h
deleted file mode 100755
index 852a78894c..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DocumentEvent.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// DocumentEvent.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM DocumentEvent interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DocumentEvent_INCLUDED
-#define DOM_DocumentEvent_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Event;
-
-
-class XML_API DocumentEvent
- /// The DocumentEvent interface provides a mechanism by which the user can create
- /// an Event of a type supported by the implementation. It is expected that
- /// the DocumentEvent interface will be implemented on the same object which
- /// implements the Document interface in an implementation which supports the
- /// Event model.
-{
-public:
- virtual Event* createEvent(const XMLString& eventType) const = 0;
- /// Creates an event of the specified type.
- ///
- /// The eventType parameter specifies the type of Event interface to be created.
- /// If the Event interface specified is supported by the implementation this
- /// method will return a new Event of the interface type requested. If the Event
- /// is to be dispatched via the dispatchEvent method the appropriate event init
- /// method must be called after creation in order to initialize the Event's
- /// values. As an example, a user wishing to synthesize some kind of UIEvent
- /// would call createEvent with the parameter "UIEvents". The initUIEvent method
- /// could then be called on the newly created UIEvent to set the specific type
- /// of UIEvent to be dispatched and set its context information.
- /// The createEvent method is used in creating Events when it is either inconvenient
- /// or unnecessary for the user to create an Event themselves. In cases where
- /// the implementation provided Event is insufficient, users may supply their
- /// own Event implementations for use with the dispatchEvent method.
-
-protected:
- virtual ~DocumentEvent();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DocumentEvent_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DocumentFragment.h b/Utilities/Poco/XML/include/Poco/DOM/DocumentFragment.h
deleted file mode 100755
index e3eb180eb2..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DocumentFragment.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// DocumentFragment.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM DocumentFragment class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DocumentFragment_INCLUDED
-#define DOM_DocumentFragment_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractContainerNode.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API DocumentFragment: public AbstractContainerNode
- /// DocumentFragment is a "lightweight" or "minimal" Document object. It is
- /// very common to want to be able to extract a portion of a document's tree
- /// or to create a new fragment of a document. Imagine implementing a user command
- /// like cut or rearranging a document by moving fragments around. It is desirable
- /// to have an object which can hold such fragments and it is quite natural
- /// to use a Node for this purpose. While it is true that a Document object
- /// could fulfill this role, a Document object can potentially be a heavyweight
- /// object, depending on the underlying implementation. What is really needed
- /// for this is a very lightweight object. DocumentFragment is such an object.
- ///
- /// Furthermore, various operations -- such as inserting nodes as children of
- /// another Node -- may take DocumentFragment objects as arguments; this results
- /// in all the child nodes of the DocumentFragment being moved to the child
- /// list of this node.
- ///
- /// The children of a DocumentFragment node are zero or more nodes representing
- /// the tops of any sub-trees defining the structure of the document. DocumentFragment
- /// nodes do not need to be well-formed XML documents (although they do need
- /// to follow the rules imposed upon well-formed XML parsed entities, which
- /// can have multiple top nodes). For example, a DocumentFragment might have
- /// only one child and that child node could be a Text node. Such a structure
- /// model represents neither an HTML document nor a well-formed XML document.
- ///
- /// When a DocumentFragment is inserted into a Document (or indeed any other
- /// Node that may take children) the children of the DocumentFragment and not
- /// the DocumentFragment itself are inserted into the Node. This makes the DocumentFragment
- /// very useful when the user wishes to create nodes that are siblings; the
- /// DocumentFragment acts as the parent of these nodes so that the user can
- /// use the standard methods from the Node interface, such as insertBefore and
- /// appendChild.
-{
-public:
- // Node
- const XMLString& nodeName() const;
- unsigned short nodeType() const;
-
-protected:
- DocumentFragment(Document* pOwnerDocument);
- DocumentFragment(Document* pOwnerDocument, const DocumentFragment& fragment);
- ~DocumentFragment();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
-private:
- static const XMLString NODE_NAME;
-
- friend class Document;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DocumentFragment_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/DocumentType.h b/Utilities/Poco/XML/include/Poco/DOM/DocumentType.h
deleted file mode 100755
index d9cbbf28eb..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/DocumentType.h
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// DocumentType.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM DocumentType class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_DocumentType_INCLUDED
-#define DOM_DocumentType_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractContainerNode.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class NamedNodeMap;
-
-
-class XML_API DocumentType: public AbstractContainerNode
- /// Each Document has a doctype attribute whose value is either null or a DocumentType
- /// object. The DocumentType interface in the DOM Level 1 Core provides an
- /// interface to the list of entities that are defined for the document, and
- /// little else because the effect of namespaces and the various XML scheme
- /// efforts on DTD representation are not clearly understood as of this writing.
- ///
- /// The DOM Level 1 doesn't support editing DocumentType nodes.
-{
-public:
- const XMLString& name() const;
- /// The name of the DTD; i.e., the name immediately following the
- /// DOCTYPE keyword.
-
- NamedNodeMap* entities() const;
- /// A NamedNodeMap containing the general entities,
- /// both external and internal, declared in the DTD.
- /// Duplicates are discarded.
- ///
- /// Note: In this implementation, only the
- /// external entities are reported.
- /// Every node in this map also implements the
- /// Entity interface.
- ///
- /// The returned NamedNodeMap must be released with a call
- /// to release() when no longer needed.
-
- NamedNodeMap* notations() const;
- /// A NamedNodeMap containing the notations declared in the DTD. Duplicates
- /// are discarded. Every node in this map also implements the Notation interface.
- /// The DOM Level 1 does not support editing notations, therefore notations
- /// cannot be altered in any way.
- ///
- /// The returned NamedNodeMap must be released with a call
- /// to release() when no longer needed.
-
- // DOM Level 2
- const XMLString& publicId() const;
- /// Returns the public identifier of the external DTD subset.
-
- const XMLString& systemId() const;
- /// Returns the system identifier of the external DTD subset.
-
- const XMLString& internalSubset() const;
- /// Returns the internal DTD subset. This implementation
- /// returns an empty string.
-
- // Node
- const XMLString& nodeName() const;
- unsigned short nodeType() const;
-
-protected:
- DocumentType(Document* pOwner, const XMLString& name, const XMLString& publicId, const XMLString& systemId);
- DocumentType(Document* pOwner, const DocumentType& dt);
- ~DocumentType();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
-private:
- XMLString _name;
- XMLString _publicId;
- XMLString _systemId;
-
- friend class DOMImplementation;
- friend class Document;
- friend class DOMBuilder;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& DocumentType::name() const
-{
- return _name;
-}
-
-
-inline const XMLString& DocumentType::publicId() const
-{
- return _publicId;
-}
-
-
-inline const XMLString& DocumentType::systemId() const
-{
- return _systemId;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_DocumentType_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/Element.h b/Utilities/Poco/XML/include/Poco/DOM/Element.h
deleted file mode 100755
index 21c6b1cb22..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/Element.h
+++ /dev/null
@@ -1,243 +0,0 @@
-//
-// Element.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM Element class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_Element_INCLUDED
-#define DOM_Element_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractContainerNode.h"
-#include "Poco/XML/Name.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Attr;
-class NodeList;
-class Document;
-
-
-class XML_API Element: public AbstractContainerNode
- /// The Element interface represents an element in an XML document.
- /// Elements may have attributes associated with them; since the Element interface
- /// inherits from Node, the generic Node interface attribute attributes may
- /// be used to retrieve the set of all attributes for an element. There are
- /// methods on the Element interface to retrieve either an Attr object by name
- /// or an attribute value by name. In XML, where an attribute value may contain
- /// entity references, an Attr object should be retrieved to examine the possibly
- /// fairly complex sub-tree representing the attribute value.
-{
-public:
- const XMLString& tagName() const;
- /// Returns the name of the element.
- ///
- /// For example, in
- ///
- /// <elementExample id="demo">
- /// ...
- /// </elementExample>
- ///
- /// tagName has the value "elementExample". Note that this is case-preserving in XML,
- /// as are all of the operations of the DOM.
-
- const XMLString& getAttribute(const XMLString& name) const;
- /// Retrieves an attribute value by name.
- ///
- /// Returns the attribute's value, if the attribute
- /// exists, or an empty string otherwise.
-
- void setAttribute(const XMLString& name, const XMLString& value);
- /// Adds a new attribute. If an attribute with that name is already present
- /// in the element, its value is changed to be that of the value parameter.
- /// This value is a simple string; it is not parsed as it is being set. So any
- /// markup (such as syntax to be recognized as an entity reference) is treated
- /// as literal text, and needs to be appropriately escaped by the implementation
- /// when it is written out.
-
- void removeAttribute(const XMLString& name);
- /// Removes an attribute by name.
-
- Attr* getAttributeNode(const XMLString& name) const;
- /// Retrieves an Attr node by name.
-
- Attr* setAttributeNode(Attr* newAttr);
- /// Adds a new attribute. If an attribute with that name is already
- /// present in the element, it is replaced by the new one.
-
- Attr* addAttributeNodeNP(Attr* oldAttr, Attr* newAttr);
- /// For internal use only.
- /// Adds a new attribute after oldAttr.
- /// If oldAttr is 0, newAttr is set as first attribute.
- /// Returns newAttr.
- /// Does not fire any events.
-
- Attr* removeAttributeNode(Attr* oldAttr);
- /// Removes the specified attribute.
-
- NodeList* getElementsByTagName(const XMLString& name) const;
- /// Returns a NodeList of all descendant elements with a given tag
- /// name, in the order in which they would be encountered in a
- /// preorder traversal of the Element tree.
- ///
- /// The special name "*" matches all tags.
- ///
- /// The returned NodeList must be released with a call
- /// to release() when no longer needed.
-
- void normalize();
- /// Puts all Text nodes in the full depth of the sub-tree underneath this Element,
- /// including attribute nodes, into a "normal" form where only markup (e.g.,
- /// tags, comments, processing instructions, CDATA sections, and entity references)
- /// separates Text nodes, i.e., there are no adjacent Text nodes. This can be
- /// used to ensure that the DOM view of a document is the same as if it were
- /// saved and re-loaded, and is useful when operations (such as XPointer
- /// lookups) that depend on a particular document tree structure are to be used.
- ///
- /// Note: In cases where the document contains CDATASections, the normalize
- /// operation alone may not be sufficient, since XPointers do not differentiate
- /// between Text nodes and CDATASection nodes.
-
- // DOM Level 2
- const XMLString& getAttributeNS(const XMLString& namespaceURI, const XMLString& localName) const;
- /// Retrieves an attribute value by name.
- ///
- /// Returns the attribute's value, if the attribute
- /// exists, or an empty string otherwise.
-
- void setAttributeNS(const XMLString& namespaceURI, const XMLString& qualifiedName, const XMLString& value);
- /// Adds a new attribute. If an attribute with that name
- /// is already present in the element, its value is changed
- /// to be that of the value parameter.
-
- void removeAttributeNS(const XMLString& namespaceURI, const XMLString& localName);
- /// Removes an attribute by name.
-
- Attr* getAttributeNodeNS(const XMLString& namespaceURI, const XMLString& localName) const;
- /// Retrieves an Attr node by name.
-
- Attr* setAttributeNodeNS(Attr* newAttr);
- /// Adds a new attribute. If an attribute with that name is already
- /// present in the element, it is replaced by the new one.
-
- bool hasAttribute(const XMLString& name) const;
- /// Returns true if and only if the element has the specified attribute.
-
- bool hasAttributeNS(const XMLString& namespaceURI, const XMLString& localName) const;
- /// Returns true if and only if the element has the specified attribute.
-
- NodeList* getElementsByTagNameNS(const XMLString& namespaceURI, const XMLString& localName) const;
- /// Returns a NodeList of all the descendant Elements with a given local name and namespace URI
- /// in the order in which they are encountered in a preorder traversal of this Element tree.
- ///
- /// The special value "*" matches all namespaces, or local names respectively.
- ///
- /// The returned NodeList must be released with a call
- /// to release() when no longer needed.
-
- const XMLString& namespaceURI() const;
- XMLString prefix() const;
- const XMLString& localName() const;
- bool hasAttributes() const;
-
- // Non-standard extensions
- XMLString innerText() const;
-
- Element* getChildElement(const XMLString& name) const;
- /// Returns the first child element with the given name, or null
- /// if such an element does not exist.
- ///
- /// This method is an extension to the W3C Document Object Model.
-
- Element* getChildElementNS(const XMLString& namespaceURI, const XMLString& localName) const;
- /// Returns the first child element with the given namespaceURI and localName,
- /// or null if such an element does not exist.
- ///
- /// This method is an extension to the W3C Document Object Model.
-
- Element* getElementById(const XMLString& elementId, const XMLString& idAttribute) const;
- /// Returns the first Element whose ID attribute (given in idAttribute)
- /// has the given elementId. If no such element exists, returns null.
- ///
- /// This method is an extension to the W3C Document Object Model.
-
- Element* getElementByIdNS(const XMLString& elementId, const XMLString& idAttributeURI, const XMLString& idAttributeLocalName) const;
- /// Returns the first Element whose ID attribute (given in idAttributeURI and idAttributeLocalName)
- /// has the given elementId. If no such element exists, returns null.
- ///
- /// This method is an extension to the W3C Document Object Model.
-
- // Node
- const XMLString& nodeName() const;
- NamedNodeMap* attributes() const;
- unsigned short nodeType() const;
-
-protected:
- Element(Document* pOwnerDocument, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname);
- Element(Document* pOwnerDocument, const Element& elem);
- ~Element();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
- void dispatchNodeRemovedFromDocument();
- void dispatchNodeInsertedIntoDocument();
-
-private:
- const Name& _name;
- Attr* _pFirstAttr;
-
- friend class Attr;
- friend class Document;
- friend class AttrMap;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& Element::tagName() const
-{
- return _name.qname();
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_Element_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/ElementsByTagNameList.h b/Utilities/Poco/XML/include/Poco/DOM/ElementsByTagNameList.h
deleted file mode 100755
index dc919a0f77..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/ElementsByTagNameList.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// ElementsByTagNameList.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the ElementsByTagNameList and ElementsByTagNameListNS classes.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_ElementsByTagNameList_INCLUDED
-#define DOM_ElementsByTagNameList_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/NodeList.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API ElementsByTagNameList: public NodeList
- // This implementation of NodeList is returned
- // by Document::getElementsByTagName() and
- // Element::getElementsByTagName().
-{
-public:
- Node* item(unsigned long index) const;
- unsigned long length() const;
- void autoRelease();
-
-protected:
- ElementsByTagNameList(const Node* pParent, const XMLString& name);
- ~ElementsByTagNameList();
-
- Node* find(const Node* pParent, unsigned long index) const;
-
- const Node* _pParent;
- XMLString _name;
- mutable unsigned long _count;
-
- friend class Element;
- friend class Document;
-};
-
-
-class XML_API ElementsByTagNameListNS: public NodeList
- // This implementation of NodeList is returned
- // by Document::getElementsByTagNameNS() and
- // Element::getElementsByTagNameNS().
-{
-public:
- virtual Node* item(unsigned long index) const;
- virtual unsigned long length() const;
- virtual void autoRelease();
-
-protected:
- ElementsByTagNameListNS(const Node* pParent, const XMLString& namespaceURI, const XMLString& localName);
- ~ElementsByTagNameListNS();
-
- Node* find(const Node* pParent, unsigned long index) const;
-
- const Node* _pParent;
- XMLString _localName;
- XMLString _namespaceURI;
- mutable unsigned long _count;
-
- friend class Element;
- friend class Document;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_ElementsByTagNameList_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/Entity.h b/Utilities/Poco/XML/include/Poco/DOM/Entity.h
deleted file mode 100755
index 2b2c728a3b..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/Entity.h
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// Entity.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM Entity class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_Entity_INCLUDED
-#define DOM_Entity_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractContainerNode.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API Entity: public AbstractContainerNode
- /// This interface represents an entity, either parsed or unparsed, in an XML
- /// document. Note that this models the entity itself not the entity declaration.
- /// Entity declaration modeling has been left for a later Level of the DOM
- /// specification.
- ///
- /// The nodeName attribute that is inherited from Node contains the name of
- /// the entity.
- ///
- /// An XML processor may choose to completely expand entities before the structure
- /// model is passed to the DOM; in this case there will be no EntityReference
- /// nodes in the document tree.
- ///
- /// XML does not mandate that a non-validating XML processor read and process
- /// entity declarations made in the external subset or declared in external
- /// parameter entities. This means that parsed entities declared in the external
- /// subset need not be expanded by some classes of applications, and that the
- /// replacement value of the entity may not be available. When the replacement
- /// value is available, the corresponding Entity node's child list represents
- /// the structure of that replacement text. Otherwise, the child list is empty.
- ///
- /// The resolution of the children of the Entity (the replacement value) may
- /// be lazily evaluated; actions by the user (such as calling the childNodes
- /// method on the Entity Node) are assumed to trigger the evaluation.
- ///
- /// The DOM Level 1 does not support editing Entity nodes; if a user wants to
- /// make changes to the contents of an Entity, every related EntityReference
- /// node has to be replaced in the structure model by a clone of the Entity's
- /// contents, and then the desired changes must be made to each of those clones
- /// instead. Entity nodes and all their descendants are readonly.
- ///
- /// An Entity node does not have any parent.
-{
-public:
- const XMLString& publicId() const;
- /// Returns the public identifier associated with
- /// the entity, if specified. If the public identifier
- /// was not specified, this is the empty string.
-
- const XMLString& systemId() const;
- /// Returns the system identifier associated with
- /// the entity, if specified. If the system identifier
- /// was not specified, this is the empty string.
-
- const XMLString& notationName() const;
- /// Returns, for unparsed entities, the name of the
- /// notation for the entity. For parsed entities, this
- /// is the empty string.
-
- // Node
- const XMLString& nodeName() const;
- unsigned short nodeType() const;
-
-protected:
- Entity(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName);
- Entity(Document* pOwnerDocument, const Entity& entity);
- ~Entity();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
-private:
- static const XMLString NODE_NAME;
-
- XMLString _name;
- XMLString _publicId;
- XMLString _systemId;
- XMLString _notationName;
-
- friend class Document;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& Entity::publicId() const
-{
- return _publicId;
-}
-
-
-inline const XMLString& Entity::systemId() const
-{
- return _systemId;
-}
-
-
-inline const XMLString& Entity::notationName() const
-{
- return _notationName;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_Entity_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/EntityReference.h b/Utilities/Poco/XML/include/Poco/DOM/EntityReference.h
deleted file mode 100755
index fd3a3fd380..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/EntityReference.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// EntityReference.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM EntityReference class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_EntityReference_INCLUDED
-#define DOM_EntityReference_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractNode.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API EntityReference: public AbstractNode
- /// EntityReference objects may be inserted into the structure model when an
- /// entity reference is in the source document, or when the user wishes to insert
- /// an entity reference. Note that character references and references to predefined
- /// entities are considered to be expanded by the HTML or XML processor so that
- /// characters are represented by their Unicode equivalent rather than by an
- /// entity reference. Moreover, the XML processor may completely expand references
- /// to entities while building the structure model, instead of providing EntityReference
- /// objects. If it does provide such objects, then for a given EntityReference
- /// node, it may be that there is no Entity node representing the referenced
- /// entity. If such an Entity exists, then the child list of the EntityReference
- /// node is the same as that of the Entity node.
- ///
- /// As for Entity nodes, EntityReference nodes and all their descendants are
- /// readonly.
- ///
- /// The resolution of the children of the EntityReference (the replacement value
- /// of the referenced Entity) may be lazily evaluated; actions by the user (such
- /// as calling the childNodes method on the EntityReference node) are assumed
- /// to trigger the evaluation.
-{
-public:
- // Node
- const XMLString& nodeName() const;
- unsigned short nodeType() const;
-
-protected:
- EntityReference(Document* pOwnerDocument, const XMLString& name);
- EntityReference(Document* pOwnerDocument, const EntityReference& ref);
- ~EntityReference();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
-private:
- XMLString _name;
-
- friend class Document;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_EntityReference_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/Event.h b/Utilities/Poco/XML/include/Poco/DOM/Event.h
deleted file mode 100755
index 68cc00daf0..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/Event.h
+++ /dev/null
@@ -1,231 +0,0 @@
-//
-// Event.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Definition of the DOM Event class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_Event_INCLUDED
-#define DOM_Event_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/DOM/DOMObject.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class EventTarget;
-class Document;
-
-
-class XML_API Event: public DOMObject
- /// The Event interface is used to provide contextual information about an event
- /// to the handler processing the event. An object which implements the Event
- /// interface is generally passed as the first parameter to an event handler.
- /// More specific context information is passed to event handlers by deriving
- /// additional interfaces from Event which contain information directly relating
- /// to the type of event they accompany. These derived interfaces are also implemented
- /// by the object passed to the event listener.
-{
-public:
- enum PhaseType
- {
- CAPTURING_PHASE = 1, /// The event is currently being evaluated at the target EventTarget.
- AT_TARGET = 2, /// The current event phase is the bubbling phase.
- BUBBLING_PHASE = 3 /// The current event phase is the capturing phase.
- };
-
- const XMLString& type() const;
- /// The name of the event (case-insensitive). The name must be an XML name.
-
- EventTarget* target() const;
- /// Used to indicate the EventTarget to which the event was originally dispatched.
-
- EventTarget* currentTarget() const;
- /// Used to indicate the EventTarget whose EventListeners are currently being
- /// processed. This is particularly useful during capturing and bubbling.
-
- PhaseType eventPhase() const;
- /// Used to indicate which phase of event flow is currently being evaluated.
-
- bool bubbles() const;
- /// Used to indicate whether or not an event is a bubbling event.
- /// If the event can bubble the value is true, else the value is false.
-
- bool cancelable() const;
- /// Used to indicate whether or not an event can have its default action
- /// prevented. If the default action can be prevented the value is
- /// true, else the value is false.
-
- Poco::UInt64 timeStamp() const;
- /// Used to specify the time (in milliseconds relative to the epoch) at
- /// which the event was created. Due to the fact that some
- /// systems may not provide this information the value of timeStamp may
- /// be not available for all events. When not available, a
- /// value of 0 will be returned. Examples of epoch time are the time of the
- /// system start or 0:0:0 UTC 1st January 1970.
- /// This implementation always returns 0.
-
- void stopPropagation();
- /// The stopPropagation method is used prevent further propagation of an
- /// event during event flow. If this method is called by
- /// any EventListener the event will cease propagating through the tree.
- /// The event will complete dispatch to all listeners on the
- /// current EventTarget before event flow stops. This method may be used
- /// during any stage of event flow.
-
- void preventDefault();
- /// If an event is cancelable, the preventDefault method is used to signify
- /// that the event is to be canceled, meaning any default
- /// action normally taken by the implementation as a result of
- /// the event will not occur. If, during any stage of event flow, the
- /// preventDefault method is called the event is canceled. Any default
- /// action associated with the event will not occur. Calling
- /// this method for a non-cancelable event has no effect. Once
- /// preventDefault has been called it will remain in effect throughout
- /// the remainder of the event's propagation. This method may be
- /// used during any stage of event flow.
-
- void initEvent(const XMLString& eventType, bool canBubble, bool isCancelable);
- /// The initEvent method is used to initialize the value of an
- /// Event created through the DocumentEvent interface. This method
- /// may only be called before the Event has been dispatched via the
- /// dispatchEvent method, though it may be called multiple
- /// times during that phase if necessary. If called multiple
- /// times the final invocation takes precedence. If called from
- /// a subclass of Event interface only the values specified in the
- /// initEvent method are modified, all other attributes are left unchanged.
-
- void autoRelease();
-
-protected:
- Event(Document* pOwnerDocument, const XMLString& type);
- Event(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool isCancelable);
- ~Event();
-
- bool isCanceled() const;
- /// returns true if and only if the event has been cancelled.
-
- bool isStopped() const;
- /// returns true if and only if propagation of the event has been stopped.
-
- void setTarget(EventTarget* pTarget);
- /// sets the target
-
- void setCurrentPhase(PhaseType phase);
- /// sets the current phase
-
- void setCurrentTarget(EventTarget* pTarget);
- /// sets the current target
-
-private:
- Document* _pOwner;
- XMLString _type;
- EventTarget* _pTarget;
- EventTarget* _pCurrentTarget;
- PhaseType _currentPhase;
- bool _bubbles;
- bool _cancelable;
- bool _canceled;
- bool _stopped;
-
- friend class AbstractNode;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& Event::type() const
-{
- return _type;
-}
-
-
-inline EventTarget* Event::target() const
-{
- return _pTarget;
-}
-
-
-inline EventTarget* Event::currentTarget() const
-{
- return _pCurrentTarget;
-}
-
-
-inline Event::PhaseType Event::eventPhase() const
-{
- return _currentPhase;
-}
-
-
-inline bool Event::bubbles() const
-{
- return _bubbles;
-}
-
-
-inline bool Event::cancelable() const
-{
- return _cancelable;
-}
-
-
-inline Poco::UInt64 Event::timeStamp() const
-{
- return 0;
-}
-
-
-inline bool Event::isCanceled() const
-{
- return _canceled;
-}
-
-
-inline bool Event::isStopped() const
-{
- return _stopped;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_Event_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/EventDispatcher.h b/Utilities/Poco/XML/include/Poco/DOM/EventDispatcher.h
deleted file mode 100755
index 78237d8cd6..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/EventDispatcher.h
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// EventDispatcher.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Definition of the EventDispatcher class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_EventDispatcher_INCLUDED
-#define DOM_EventDispatcher_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-#include <list>
-
-
-namespace Poco {
-namespace XML {
-
-
-class Event;
-class EventListener;
-
-
-class XML_API EventDispatcher
- /// This helper class manages event listener subscriptions
- /// and event dispatching for AbstractNode.
- ///
- /// The EventListener list is managed in such a way that
- /// event listeners can be added and removed even
- /// from within an EventListener, while events are being
- /// dispatched.
-{
-public:
- EventDispatcher();
- /// Creates the EventDispatcher.
-
- ~EventDispatcher();
- /// Destroys the EventDispatcher.
-
- void addEventListener(const XMLString& type, EventListener* listener, bool useCapture);
- /// Adds an EventListener to the internal list.
-
- void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture);
- /// Removes an EventListener from the internal list.
- ///
- /// If a dispatch is currently in progress, the list
- /// entry is only marked for deletion.
- /// If no dispatch is currently in progress, all EventListeners
- /// marked for deletion are removed from the list.
-
- void dispatchEvent(Event* evt);
- /// Dispatches the event.
- ///
- /// Also removes all EventListeners marked for deletion from the
- /// event dispatcher list.
-
- void captureEvent(Event* evt);
- /// Dispatches the event in its capturing phase.
- ///
- /// Also removes all EventListeners marked for deletion from the
- /// event dispatcher list.
-
- void bubbleEvent(Event* evt);
- /// Dispatches the event in its bubbling phase.
- ///
- /// Also removes all EventListeners marked for deletion from the
- /// event dispatcher list.
-
-private:
- struct EventListenerItem
- {
- XMLString type;
- EventListener* pListener;
- bool useCapture;
- };
-
- typedef std::list<EventListenerItem> EventListenerList;
-
- int _inDispatch;
- EventListenerList _listeners;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_EventDispatcher_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/EventException.h b/Utilities/Poco/XML/include/Poco/DOM/EventException.h
deleted file mode 100755
index ccd6438d71..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/EventException.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// EventException.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Definition of the DOM EventException class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_EventException_INCLUDED
-#define DOM_EventException_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API EventException: public XMLException
- /// Event operations may throw an EventException as
- /// specified in their method descriptions.
-{
-public:
- enum
- {
- UNSPECIFIED_EVENT_TYPE_ERR = 0 /// If the Event's type was not specified by initializing the
- /// event before the method was called. Specification of the Event's
- /// type as null or an empty string will also trigger this exception.
- };
-
- EventException(int code);
- /// Creates an EventException with the given error code.
-
- EventException(const EventException& exc);
- /// Creates an EventException by copying another one.
-
- ~EventException() throw();
- /// Destroys the EventException.
-
- EventException& operator = (const EventException& exc);
-
- const char* name() const throw();
- /// Returns a static string describing the exception.
-
- const char* className() const throw();
- /// Returns the name of the exception class.
-
- unsigned short code() const;
- /// Returns the Event exception code.
-
-protected:
- Poco::Exception* clone() const;
-
-private:
- EventException();
-};
-
-
-//
-// inlines
-//
-inline unsigned short EventException::code() const
-{
- return UNSPECIFIED_EVENT_TYPE_ERR;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_EventException_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/EventListener.h b/Utilities/Poco/XML/include/Poco/DOM/EventListener.h
deleted file mode 100755
index ae3b177c01..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/EventListener.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// EventListener.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Definition of the DOM EventListener interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_EventListener_INCLUDED
-#define DOM_EventListener_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Event;
-
-
-class XML_API EventListener
- /// The EventListener interface is the primary method for handling events. Users
- /// implement the EventListener interface and register their listener on an
- /// EventTarget using the AddEventListener method. The users should also remove
- /// their EventListener from its EventTarget after they have completed using
- /// the listener.
- ///
- /// When a Node is copied using the cloneNode method the EventListeners attached
- /// to the source Node are not attached to the copied Node. If the user wishes
- /// the same EventListeners to be added to the newly created copy the user must
- /// add them manually.
-{
-public:
- virtual void handleEvent(Event* evt) = 0;
- /// This method is called whenever an event occurs of the
- /// type for which the EventListener interface was registered.
-
-protected:
- virtual ~EventListener();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_EventListener_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/EventTarget.h b/Utilities/Poco/XML/include/Poco/DOM/EventTarget.h
deleted file mode 100755
index 6c33e80672..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/EventTarget.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// EventTarget.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Definition of the DOM EventTarget interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_EventTarget_INCLUDED
-#define DOM_EventTarget_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/DOMObject.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class EventListener;
-class Event;
-
-
-class XML_API EventTarget: public DOMObject
- /// The EventTarget interface is implemented by all Nodes in an implementation
- /// which supports the DOM Event Model. Therefore, this interface can be obtained
- /// by using binding-specific casting methods on an instance of the Node interface.
- /// The interface allows registration and removal of EventListeners on an EventTarget
- /// and dispatch of events to that EventTarget.
-{
-public:
- virtual void addEventListener(const XMLString& type, EventListener* listener, bool useCapture) = 0;
- /// This method allows the registration of event listeners on
- /// the event target. If an EventListener is added to an
- /// EventTarget while it is processing an event, it will not
- /// be triggered by the current actions but may be triggered
- /// during a later stage of event flow, such as the bubbling phase.
- /// If multiple identical EventListeners are registered on the same
- /// EventTarget with the same parameters the duplicate instances are
- /// discarded. They do not cause the EventListener to be called twice and since they are
- /// discarded they do not need to be removed with the removeEventListener method.
-
- virtual void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture) = 0;
- /// This method allows the removal of event listeners from the event
- /// target. If an EventListener is removed from an EventTarget while it is
- /// processing an event, it will not be triggered by the current actions.
- /// EventListeners can never be invoked after being removed.
- /// Calling removeEventListener with arguments which do not identify
- /// any currently registered EventListener on the EventTarget has no effect.
-
- virtual bool dispatchEvent(Event* evt) = 0;
- /// This method allows the dispatch of events into the implementations
- /// event model. Events dispatched in this manner will have the same capturing and
- /// bubbling behavior as events dispatched directly by the
- /// implementation. The target of the event is the EventTarget on
- /// which dispatchEvent is called.
-
-protected:
- virtual ~EventTarget();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_EventTarget_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/MutationEvent.h b/Utilities/Poco/XML/include/Poco/DOM/MutationEvent.h
deleted file mode 100755
index ebb5e14bc9..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/MutationEvent.h
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// MutationEvent.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Definition of the DOM MutationEvent class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_MutationEvent_INCLUDED
-#define DOM_MutationEvent_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/Event.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Node;
-
-
-class XML_API MutationEvent: public Event
- /// The MutationEvent interface provides specific contextual
- /// information associated with Mutation events.
-{
-public:
- enum AttrChangeType
- {
- MODIFICATION = 1, /// The Attr was modified in place.
- ADDITION = 2, /// The Attr was just added.
- REMOVAL = 3 /// The Attr was just removed.
- };
-
- Node* relatedNode() const;
- /// relatedNode is used to identify a secondary node related to a mutation
- /// event. For example, if a mutation event is dispatched
- /// to a node indicating that its parent has changed, the relatedNode is the
- /// changed parent. If an event is instead dispatched to a
- /// subtree indicating a node was changed within it, the relatedNode is
- /// the changed node. In the case of the DOMAttrModified
- /// event it indicates the Attr node which was modified, added, or removed.
-
- const XMLString& prevValue() const;
- /// prevValue indicates the previous value of the Attr node in DOMAttrModified
- /// events, and of the CharacterData node in DOMCharDataModified events.
-
- const XMLString& newValue() const;
- /// newValue indicates the new value of the Attr node in DOMAttrModified
- /// events, and of the CharacterData node in DOMCharDataModified events.
-
- const XMLString& attrName() const;
- /// attrName indicates the name of the changed Attr node in a DOMAttrModified event.
-
- AttrChangeType attrChange() const;
- /// attrChange indicates the type of change which triggered the
- /// DOMAttrModified event. The values can be MODIFICATION,
- /// ADDITION, or REMOVAL.
-
- void initMutationEvent(const XMLString& type, bool canBubble, bool cancelable, Node* relatedNode,
- const XMLString& prevValue, const XMLString& newValue, const XMLString& attrName, AttrChangeType change);
- /// The initMutationEvent method is used to initialize the value of a
- /// MutationEvent created through the DocumentEvent
- /// interface. This method may only be called before the MutationEvent
- /// has been dispatched via the dispatchEvent method,
- /// though it may be called multiple times during that phase if
- /// necessary. If called multiple times, the final invocation takes
- /// precedence.
-
- // Event Types
- static const XMLString DOMSubtreeModified;
- static const XMLString DOMNodeInserted;
- static const XMLString DOMNodeRemoved;
- static const XMLString DOMNodeRemovedFromDocument;
- static const XMLString DOMNodeInsertedIntoDocument;
- static const XMLString DOMAttrModified;
- static const XMLString DOMCharacterDataModified;
-
-protected:
- MutationEvent(Document* pOwnerDocument, const XMLString& type);
- MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode);
- MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode,
- const XMLString& prevValue, const XMLString& newValue, const XMLString& attrName, AttrChangeType change);
- ~MutationEvent();
-
-private:
- XMLString _prevValue;
- XMLString _newValue;
- XMLString _attrName;
- AttrChangeType _change;
- Node* _pRelatedNode;
-
- friend class AbstractNode;
- friend class Document;
-};
-
-
-//
-// inlines
-//
-inline Node* MutationEvent::relatedNode() const
-{
- return _pRelatedNode;
-}
-
-
-inline const XMLString& MutationEvent::prevValue() const
-{
- return _prevValue;
-}
-
-
-inline const XMLString& MutationEvent::newValue() const
-{
- return _newValue;
-}
-
-
-inline const XMLString& MutationEvent::attrName() const
-{
- return _attrName;
-}
-
-
-inline MutationEvent::AttrChangeType MutationEvent::attrChange() const
-{
- return _change;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_MutationEvent_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/NamedNodeMap.h b/Utilities/Poco/XML/include/Poco/DOM/NamedNodeMap.h
deleted file mode 100755
index 657798726e..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/NamedNodeMap.h
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// NamedNodeMap.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM NamedNodeMap interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_NamedNodeMap_INCLUDED
-#define DOM_NamedNodeMap_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/DOMObject.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Node;
-
-
-class XML_API NamedNodeMap: public DOMObject
- /// Objects implementing the NamedNodeMap interface are used to represent collections
- /// of nodes that can be accessed by name. Note that NamedNodeMap does not inherit
- /// from NodeList; NamedNodeMaps are not maintained in any particular order.
- /// Objects contained in an object implementing NamedNodeMap may also be accessed
- /// by an ordinal index, but this is simply to allow convenient enumeration
- /// of the contents of a NamedNodeMap, and does not imply that the DOM specifies
- /// an order to these Nodes.
- ///
- /// NamedNodeMap objects in the DOM are live.
- ///
- /// A NamedNodeMap returned from a method must be released with a call to
- /// release() when no longer needed.
-{
-public:
- virtual Node* getNamedItem(const XMLString& name) const = 0;
- /// Retrieves a node specified by name.
-
- virtual Node* setNamedItem(Node* arg) = 0;
- /// Adds a node using its nodeName attribute. If a node with that name is already
- /// present in this map, it is replaced by the new one.
- /// As the nodeName attribute is used to derive the name which the node must
- /// be stored under, multiple nodes of certain types (those that have a "special"
- /// string value) cannot be stored as the names would clash. This is seen as
- /// preferable to allowing nodes to be aliased.
-
- virtual Node* removeNamedItem(const XMLString& name) = 0;
- /// Removes a node specified by name. When this map contains the attributes
- /// attached to an element, if the removed attribute is known to have a default
- /// value, an attribute immediately appears containing the default value.
-
- virtual Node* item(unsigned long index) const = 0;
- /// Returns the index'th item in the map. If index is greater
- /// than or equal to the number of nodes in the map, this
- /// returns null.
-
- virtual unsigned long length() const = 0;
- /// Returns the number of nodes in the map. The range of valid
- /// child node indices is 0 to length - 1 inclusive.
-
- // DOM Level 2
- virtual Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const = 0;
- /// Retrieves a node specified by name.
-
- virtual Node* setNamedItemNS(Node* arg) = 0;
- /// Adds a node using its nodeName attribute.
- /// If a node with that namespace URI and that local name is already
- /// present in this map, it is replaced by the new one.
-
- virtual Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) = 0;
- /// Removes a node specified by name.
-
-protected:
- virtual ~NamedNodeMap();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_NamedNodeMap_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/Node.h b/Utilities/Poco/XML/include/Poco/DOM/Node.h
deleted file mode 100755
index 731a7f9c44..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/Node.h
+++ /dev/null
@@ -1,255 +0,0 @@
-//
-// Node.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM Node interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_Node_INCLUDED
-#define DOM_Node_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/EventTarget.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class NamedNodeMap;
-class Document;
-class NodeList;
-
-
-class XML_API Node: public EventTarget
- /// The Node interface is the primary datatype for the entire Document Object
- /// Model. It represents a single node in the document tree. While all objects
- /// implementing the Node interface expose methods for dealing with children,
- /// not all objects implementing the Node interface may have children. For
- /// example, Text nodes may not have children, and adding children to such
- /// nodes results in a DOMException being raised.
- ///
- /// The attributes nodeName, nodeValue and attributes are included as a mechanism
- /// to get at node information without casting down to the specific derived
- /// interface. In cases where there is no obvious mapping of these attributes
- /// for a specific nodeType (e.g., nodeValue for an Element or attributes for
- /// a Comment), this returns null. Note that the specialized interfaces may
- /// contain additional and more convenient mechanisms to get and set the relevant
- /// information.
- ///
- /// This implementation differs in some ways from the W3C DOM recommendations.
- /// For example, the DOM specifies that some methods can return null strings.
- /// Instead of null strings, this implementation always returns empty strings.
-{
-public:
- enum
- {
- ELEMENT_NODE = 1, /// The node is an Element.
- ATTRIBUTE_NODE, /// The node is an Attr.
- TEXT_NODE, /// The node is a Text node.
- CDATA_SECTION_NODE, /// The node is a CDATASection.
- ENTITY_REFERENCE_NODE, /// The node is an EntityReference.
- ENTITY_NODE, /// The node is an Entity.
- PROCESSING_INSTRUCTION_NODE, /// The node is a ProcessingInstruction.
- COMMENT_NODE, /// The node is a Comment.
- DOCUMENT_NODE, /// The node is a Document.
- DOCUMENT_TYPE_NODE, /// The node is a DocumentType.
- DOCUMENT_FRAGMENT_NODE, /// The node is a DocumentFragment.
- NOTATION_NODE /// The node is a Notation.
- };
-
- virtual const XMLString& nodeName() const = 0;
- /// Returns the name of this node, depending on its type.
-
- const XMLString& nodeValue() const;
- /// Returns the value of this node, depending on its type.
-
- virtual const XMLString& getNodeValue() const = 0;
- /// Returns the value of this node, depending on its type.
-
- virtual void setNodeValue(const XMLString& value) = 0;
- /// Sets the value of this node. Throws an exception
- /// if the node is read-only.
-
- virtual unsigned short nodeType() const = 0;
- /// Returns a code representing the type of the underlying object.
-
- virtual Node* parentNode() const = 0;
- /// The parent of this node. All nodes, except Attr, Document, DocumentFragment,
- /// Entity, and Notation may have a parent. However, if a node has just been
- /// created and not yet added to the tree, or if it has been removed from the
- /// tree, this is null.
-
- virtual NodeList* childNodes() const = 0;
- /// Returns a NodeList containing all children of this node.
- ///
- /// The returned NodeList must be released with a call
- /// to release() when no longer needed.
-
- virtual Node* firstChild() const = 0;
- /// Returns the first child of this node. If there is no such
- /// node, this returns null.
-
- virtual Node* lastChild() const = 0;
- /// Returns the last child of this node. If there is no such
- /// node, this returns null.
-
- virtual Node* previousSibling() const = 0;
- /// Returns the node immediately preceding this node. If there
- /// is no such node, this returns null.
-
- virtual Node* nextSibling() const = 0;
- /// Returns the node immediately following this node. If there
- /// is no such node, this returns null.
-
- virtual NamedNodeMap* attributes() const = 0;
- /// Returns a NamedNodeMap containing the attributes of this
- /// node (if it is an Element) or null otherwise.
- ///
- /// The returned NamedNodeMap must be released with a call
- /// to release() when no longer needed.
-
- virtual Document* ownerDocument() const = 0;
- /// Returns the Document object associated with this node.
- /// This is also the Document object used to create new nodes.
- /// When this node is a Document, this is null.
-
- virtual Node* insertBefore(Node* newChild, Node* refChild) = 0;
- /// Inserts the node newChild before the existing child node refChild.
- ///
- /// If refChild is null, insert newChild at the end of the list of children.
- /// If newChild is a DocumentFragment object, all of its children are
- /// inserted in the same order, before refChild. If the newChild is already
- /// in the tree, it is first removed.
-
- virtual Node* replaceChild(Node* newChild, Node* oldChild) = 0;
- /// Replaces the child node oldChild with newChild in the list of children,
- /// and returns the oldChild node.
- /// If newChild is a DocumentFragment object, oldChild is replaced by all of
- /// the DocumentFragment children, which are inserted in the same order. If
- /// the newChild is already in the tree, it is first removed.
-
- virtual Node* removeChild(Node* oldChild) = 0;
- /// Removes the child node indicated by oldChild from the list of children
- /// and returns it.
-
- virtual Node* appendChild(Node* newChild) = 0;
- /// Appends the node newChild to the end of the list of children of this node.
- /// If newChild is already in the tree, it is first removed.
-
- virtual bool hasChildNodes() const = 0;
- /// This is a convenience method to allow easy determination of whether a
- /// node has any children.
- /// Returns true if the node has any children, false otherwise.
-
- virtual Node* cloneNode(bool deep) const = 0;
- /// Returns a duplicate of this node, i.e., serves as a generic copy constructor
- /// for nodes. The duplicate node has no parent; (parentNode is null.).
- /// Cloning an Element copies all attributes and their values, including those
- /// generated by the XML processor to represent defaulted attributes, but this
- /// method does not copy any text it contains unless it is a deep clone, since
- /// the text is contained in a child Text node. Cloning an Attribute directly,
- /// as opposed to be cloned as part of an Element cloning operation, returns
- /// a specified attribute (specified is true). Cloning any other type of node
- /// simply returns a copy of this node.
- /// Note that cloning an immutable subtree results in a mutable copy, but the
- /// children of an EntityReference clone are readonly. In addition, clones of
- /// unspecified Attr nodes are specified. And, cloning Document, DocumentType,
- /// Entity, and Notation nodes is implementation dependent.
-
- // DOM Level 2
- virtual void normalize() = 0;
- /// Puts all Text nodes in the full depth of the sub-tree underneath this Node,
- /// including attribute nodes, into a "normal" form where only structure (e.g.,
- /// elements, comments, processing instructions, CDATA sections, and entity
- /// references) separates Text nodes, i.e., there are neither adjacent Text
- /// nodes nor empty Text nodes. This can be used to ensure that the DOM view
- /// of a document is the same as if it were saved and re-loaded, and is useful
- /// when operations (such as XPointer lookups) that depend on a particular
- /// document tree structure are to be used.
- ///
- /// Note: In cases where the document contains CDATASections, the normalize
- /// operation alone may not be sufficient, since XPointers do not differentiate
- /// between Text nodes and CDATASection nodes.
-
- virtual bool isSupported(const XMLString& feature, const XMLString& version) const = 0;
- /// Tests whether the DOM implementation implements a specific
- /// feature and that feature is supported by this node.
-
- virtual const XMLString& namespaceURI() const = 0;
- /// Returns the namespace URI of the node.
- /// This is not a computed value that is the result of a namespace lookup based on an
- /// examination of the namespace declarations in scope. It is merely the namespace URI
- /// given at creation time.
- ///
- /// For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a
- /// DOM Level 1 method, such as createElement from the Document interface, this is always the
- /// empty string.
-
- virtual XMLString prefix() const = 0;
- /// Returns the namespace prefix from the qualified name of the node.
-
- virtual const XMLString& localName() const = 0;
- /// Returns the local name of the node.
-
- virtual bool hasAttributes() const = 0;
- /// Returns whether this node (if it is an element) has any attributes.
-
- // Extensions
- virtual XMLString innerText() const = 0;
- /// Returns a string containing the concatenated values of the node
- /// and all its child nodes.
- ///
- /// This method is not part of the W3C Document Object Model.
-
-protected:
- virtual ~Node();
-};
-
-
-//
-// inlines
-//
-inline const XMLString& Node::nodeValue() const
-{
- return getNodeValue();
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_Node_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/NodeAppender.h b/Utilities/Poco/XML/include/Poco/DOM/NodeAppender.h
deleted file mode 100755
index 62c1b1a13c..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/NodeAppender.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// NodeAppender.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: NodeAppender
-//
-// Definition of the NodeAppender class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef DOM_NodeAppender_INCLUDED
-#define DOM_NodeAppender_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/Node.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class AbstractNode;
-class Element;
-
-
-class XML_API NodeAppender
- /// The NodeAppender class provides a very fast way to
- /// build larger DOM documents.
- ///
- /// In the DOM, child nodes are usually appended to a parent
- /// node using the appendChild() method. For nodes containing
- /// more than a few children, this method can be quite slow,
- /// due to the way it's implemented, and because of the
- /// requirements of the DOM specification.
- ///
- /// While the NodeAppender is being used on an Element, no
- /// children-modifying methods of that Element must be used.
- ///
- /// This class is not part of the DOM specification.
-{
-public:
- NodeAppender(Element* parent);
- /// Creates the NodeAppender for the given parent node,
- /// which must be an Element.
-
- ~NodeAppender();
- /// Destroys the NodeAppender.
-
- void appendChild(Node* newChild);
- /// Appends the node newChild to the end of the list of children of
- /// the parent node specified in the constructor.
- /// If the newChild is already in the tree, it is first removed.
- ///
- /// NewChild can be a DocumentFragment. In this case, all children
- /// of the fragment become children of the parent element.
- ///
- /// In order to speed up the function, no DOM events
- /// are fired.
-
-private:
- NodeAppender();
- NodeAppender(const NodeAppender&);
- NodeAppender& operator = (const NodeAppender&);
-
- Element* _pParent;
- AbstractNode* _pLast;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // #include "Poco/XML/XML.h"
-
diff --git a/Utilities/Poco/XML/include/Poco/DOM/NodeFilter.h b/Utilities/Poco/XML/include/Poco/DOM/NodeFilter.h
deleted file mode 100755
index a1bf2ec216..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/NodeFilter.h
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// NodeFilter.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: NodeFilter
-//
-// Definition of the DOM NodeFilter interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_NodeFilter_INCLUDED
-#define DOM_NodeFilter_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Node;
-
-
-class XML_API NodeFilter
- /// Filters are objects that know how to "filter out" nodes. If a NodeIterator
- /// or TreeWalker is given a NodeFilter, it applies the filter before it returns
- /// the next node. If the filter says to accept the node, the traversal logic
- /// returns it; otherwise, traversal looks for the next node and pretends that
- /// the node that was rejected was not there.
- ///
- /// The DOM does not provide any filters. NodeFilter is just an interface that
- /// users can implement to provide their own filters.
- ///
- /// NodeFilters do not need to know how to traverse from node to node, nor do
- /// they need to know anything about the data structure that is being traversed.
- /// This makes it very easy to write filters, since the only thing they have
- /// to know how to do is evaluate a single node. One filter may be used with
- /// a number of different kinds of traversals, encouraging code reuse.
-{
-public:
- enum
- {
- FILTER_ACCEPT = 1,
- /// Accept the node. Navigation methods defined for NodeIterator or TreeWalker will return this node.
-
- FILTER_REJECT = 2,
- /// Reject the node. Navigation methods defined for NodeIterator or TreeWalker
- /// will not return this node. For TreeWalker, the children of this node will
- /// also be rejected. NodeIterators treat this as a synonym for FILTER_SKIP.
-
- FILTER_SKIP = 3
- /// Skip this single node. Navigation methods defined for NodeIterator or TreeWalker
- /// will not return this node. For both NodeIterator and TreeWalker, the children
- /// of this node will still be considered.
- };
-
- enum WhatToShow
- /// These are the available values for the whatToShow parameter used in TreeWalkers
- /// and NodeIterators. They are the same as the set of possible types for Node,
- /// and their values are derived by using a bit position corresponding to the
- /// value of nodeType for the equivalent node type. If a bit in whatToShow is
- /// set false, that will be taken as a request to skip over this type of node;
- /// the behavior in that case is similar to that of FILTER_SKIP.
- ///
- /// Note that if node types greater than 32 are ever introduced, they may not
- /// be individually testable via whatToShow. If that need should arise, it can
- /// be handled by selecting SHOW_ALL together with an appropriate NodeFilter.
- {
- SHOW_ALL = 0xFFFFFFFF,
- /// Show all Nodes.
-
- SHOW_ELEMENT = 0x00000001,
- /// Show Element nodes.
-
- SHOW_ATTRIBUTE = 0x00000002,
- /// Show Attr nodes. This is meaningful only when creating an iterator or tree-walker
- /// with an attribute node as its root; in this case, it means that the attribute
- /// node will appear in the first position of the iteration or traversal. Since
- /// attributes are never children of other nodes, they do not appear when traversing
- /// over the document tree.
-
- SHOW_TEXT = 0x00000004,
- /// Show Text nodes.
-
- SHOW_CDATA_SECTION = 0x00000008,
- /// Show CDATASection nodes.
-
- SHOW_ENTITY_REFERENCE = 0x00000010,
- /// Show EntityReference nodes.
-
- SHOW_ENTITY = 0x00000020,
- /// Show Entity nodes. This is meaningful only when creating an iterator or
- /// tree-walker with an Entity node as its root; in this case, it means that
- /// the Entity node will appear in the first position of the traversal. Since
- /// entities are not part of the document tree, they do not appear when traversing
- /// over the document tree.
-
- SHOW_PROCESSING_INSTRUCTION = 0x00000040,
- /// Show ProcessingInstruction nodes.
-
- SHOW_COMMENT = 0x00000080,
- /// Show Comment nodes.
-
- SHOW_DOCUMENT = 0x00000100,
- /// Show Document nodes.
-
- SHOW_DOCUMENT_TYPE = 0x00000200,
- /// Show DocumentType nodes.
-
- SHOW_DOCUMENT_FRAGMENT = 0x00000400,
- /// Show DocumentFragment nodes.
-
- SHOW_NOTATION = 0x00000800
- /// Show Notation nodes. This is meaningful only when creating an iterator or
- /// tree-walker with a Notation node as its root; in this case, it means that
- /// the Notation node will appear in the first position of the traversal. Since
- /// notations are not part of the document tree, they do not appear when traversing
- /// over the document tree.
- };
-
- virtual short acceptNode(Node* node) = 0;
- /// Test whether a specified node is visible in the logical view of a TreeWalker
- /// or NodeIterator. This function will be called by the implementation of TreeWalker
- /// and NodeIterator; it is not normally called directly from user code. (Though
- /// you could do so if you wanted to use the same filter to guide your own application
- /// logic.)
- ///
- /// Returns FILTER_ACCEPT, FILTER_REJECT or FILTER_SKIP.
-
-protected:
- virtual ~NodeFilter();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_NodeFilter_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/NodeIterator.h b/Utilities/Poco/XML/include/Poco/DOM/NodeIterator.h
deleted file mode 100755
index dfe33da407..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/NodeIterator.h
+++ /dev/null
@@ -1,189 +0,0 @@
-//
-// NodeIterator.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: NodeIterator
-//
-// Definition of the DOM NodeIterator class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_NodeIterator_INCLUDED
-#define DOM_NodeIterator_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Node;
-class NodeFilter;
-
-
-class XML_API NodeIterator
- /// Iterators are used to step through a set of nodes, e.g. the set of nodes
- /// in a NodeList, the document subtree governed by a particular Node, the results
- /// of a query, or any other set of nodes. The set of nodes to be iterated is
- /// determined by the implementation of the NodeIterator. DOM Level 2 specifies
- /// a single NodeIterator implementation for document-order traversal of a document
- /// subtree.
- ///
- /// A NodeIterator can be directly instantiated using one of its constructors -
- /// the DocumentTraversal interface is not needed and therefore not implemented.
- /// Unlike most other DOM classes, NodeIterator supports value semantics.
- ///
- /// If the NodeIterator's current node is removed from the document, the
- /// result of calling any of the movement methods is undefined. This behavior does
- /// not conform to the DOM Level 2 Traversal specification.
-{
-public:
- NodeIterator(Node* root, unsigned long whatToShow, NodeFilter* pFilter = 0);
- /// Creates a NodeIterator over the subtree rooted at the specified node.
-
- NodeIterator(const NodeIterator& iterator);
- /// Creates a NodeIterator by copying another NodeIterator.
-
- NodeIterator& operator = (const NodeIterator& iterator);
- /// Assignment operator.
-
- ~NodeIterator();
- /// Destroys the NodeIterator.
-
- Node* root() const;
- /// The root node of the NodeIterator, as specified when it was created.
-
- unsigned long whatToShow() const;
- /// This attribute determines which node types are presented via the iterator.
- /// The available set of constants is defined in the NodeFilter interface.
- /// Nodes not accepted by whatToShow will be skipped, but their children may
- /// still be considered. Note that this skip takes precedence over the filter,
- /// if any.
-
- NodeFilter* filter() const;
- /// The NodeFilter used to screen nodes.
-
- bool expandEntityReferences() const;
- /// The value of this flag determines whether the children of entity reference
- /// nodes are visible to the iterator. If false, they and their descendants
- /// will be rejected. Note that this rejection takes precedence over whatToShow
- /// and the filter. Also note that this is currently the only situation where
- /// NodeIterators may reject a complete subtree rather than skipping individual
- /// nodes.
- ///
- /// To produce a view of the document that has entity references expanded and
- /// does not expose the entity reference node itself, use the whatToShow flags
- /// to hide the entity reference node and set expandEntityReferences to true
- /// when creating the iterator. To produce a view of the document that has entity
- /// reference nodes but no entity expansion, use the whatToShow flags to show
- /// the entity reference node and set expandEntityReferences to false.
- ///
- /// This implementation does not support entity reference expansion and
- /// thus always returns false.
-
- Node* nextNode();
- /// Returns the next node in the set and advances the position of the iterator
- /// in the set. After a NodeIterator is created, the first call to nextNode()
- /// returns the first node in the set.
-
- Node* previousNode();
- /// Returns the previous node in the set and moves the position of the NodeIterator
- /// backwards in the set.
-
- Node* currentNodeNP() const;
- /// Returns the current node in the set.
- ///
- /// Leaves the NodeIterator unchanged.
- ///
- /// Warning: This is a proprietary extension to the DOM Level 2 NodeIterator
- /// interface.
-
- void detach();
- /// Detaches the NodeIterator from the set which it iterated over, releasing
- /// any computational resources and placing the iterator in the INVALID state.
- /// After detach has been invoked, calls to nextNode or previousNode will raise
- /// the exception INVALID_STATE_ERR.
-
-protected:
- bool accept(Node* pNode) const;
- Node* next() const;
- Node* previous() const;
- Node* last();
-
-private:
- NodeIterator();
-
- Node* _pRoot;
- unsigned long _whatToShow;
- NodeFilter* _pFilter;
- Node* _pCurrent;
-};
-
-
-//
-// inlines
-//
-inline Node* NodeIterator::root() const
-{
- return _pRoot;
-}
-
-
-inline Node* NodeIterator::currentNodeNP() const
-{
- return _pCurrent;
-}
-
-
-inline unsigned long NodeIterator::whatToShow() const
-{
- return _whatToShow;
-}
-
-
-inline NodeFilter* NodeIterator::filter() const
-{
- return _pFilter;
-}
-
-
-inline bool NodeIterator::expandEntityReferences() const
-{
- return false;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_NodeIterator_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/NodeList.h b/Utilities/Poco/XML/include/Poco/DOM/NodeList.h
deleted file mode 100755
index 719a518589..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/NodeList.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// NodeList.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM NodeList interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_NodeList_INCLUDED
-#define DOM_NodeList_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/DOMObject.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Node;
-
-
-class XML_API NodeList: public DOMObject
- /// The NodeList interface provides the abstraction of an ordered
- /// collection of nodes, without defining or constraining how this
- /// collection is implemented.
- ///
- /// The items in the NodeList are accessible via an integral index,
- /// starting from 0.
- ///
- /// A NodeList returned from a method must be released with a call to
- /// release() when no longer needed.
-{
-public:
- virtual Node* item(unsigned long index) const = 0;
- /// Returns the index'th item in the collection. If index is
- /// greater than or equal to the number of nodes in the list,
- /// this returns null.
-
- virtual unsigned long length() const = 0;
- /// Returns the number of nodes in the list. The range of valid
- /// node indices is 0 to length - 1 inclusive.
-
-protected:
- virtual ~NodeList();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_NodeList_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/Notation.h b/Utilities/Poco/XML/include/Poco/DOM/Notation.h
deleted file mode 100755
index c278d49156..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/Notation.h
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// Notation.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM Notation class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_Notation_INCLUDED
-#define DOM_Notation_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractNode.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API Notation: public AbstractNode
- /// This interface represents a notation declared in the DTD. A notation either
- /// declares, by name, the format of an unparsed entity (see section 4.7 of
- /// the XML 1.0 specification <http://www.w3.org/TR/2004/REC-xml-20040204/>),
- /// or is used for formal declaration of processing
- /// instruction targets (see section 2.6 of the XML 1.0 specification).
- /// The nodeName attribute inherited from Node is set to the declared name of
- /// the notation.
- ///
- /// The DOM Level 1 does not support editing Notation nodes; they are therefore
- /// readonly.
- ///
- /// A Notation node does not have any parent.
-{
-public:
- const XMLString& publicId() const;
- /// Returns the public identifier of this notation.
- /// If not specified, this is an empty string (and not null,
- /// as in the DOM specification).
-
- const XMLString& systemId() const;
- /// Returns the system identifier of this notation.
- /// If not specified, this is an empty string (and not null,
- /// as in the DOM specification).
-
- // Node
- const XMLString& nodeName() const;
- unsigned short nodeType() const;
-
-protected:
- Notation(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId);
- Notation(Document* pOwnerDocument, const Notation& notation);
- ~Notation();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
-private:
- XMLString _name;
- XMLString _publicId;
- XMLString _systemId;
-
- friend class Document;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& Notation::publicId() const
-{
- return _publicId;
-}
-
-
-inline const XMLString& Notation::systemId() const
-{
- return _systemId;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_Notation_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/ProcessingInstruction.h b/Utilities/Poco/XML/include/Poco/DOM/ProcessingInstruction.h
deleted file mode 100755
index a52f4f7248..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/ProcessingInstruction.h
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// ProcessingInstruction.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM ProcessingInstruction class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_ProcessingInstruction_INCLUDED
-#define DOM_ProcessingInstruction_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/AbstractNode.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API ProcessingInstruction: public AbstractNode
- /// The ProcessingInstruction interface represents a "processing instruction",
- /// used in XML as a way to keep processor-specific information in the text
- /// of the document.
-{
-public:
- const XMLString& target() const;
- /// Returns the target of this processing instruction.
- /// XML defines this as being the first token following
- /// the markup that begins the processing instruction.
-
- const XMLString& data() const;
- /// Returns the content of this processing instruction. This is from the first non
- /// white space character after the target to the character immediately preceding
- /// the ?>.
-
- const XMLString& getData() const;
- /// Returns the content of this processing instruction. This is from the first non
- /// white space character after the target to the character immediately preceding
- /// the ?>.
-
- void setData(const XMLString& data);
- /// Sets the content of this processing instruction.
-
- // Node
- const XMLString& nodeName() const;
- const XMLString& getNodeValue() const;
- void setNodeValue(const XMLString& data);
- unsigned short nodeType() const;
-
-protected:
- ProcessingInstruction(Document* pOwnerDocument, const XMLString& target, const XMLString& data);
- ProcessingInstruction(Document* pOwnerDocument, const ProcessingInstruction& processingInstruction);
- ~ProcessingInstruction();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
-private:
- XMLString _target;
- XMLString _data;
-
- friend class Document;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& ProcessingInstruction::target() const
-{
- return _target;
-}
-
-
-inline const XMLString& ProcessingInstruction::data() const
-{
- return _data;
-}
-
-
-inline const XMLString& ProcessingInstruction::getData() const
-{
- return _data;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_ProcessingInstruction_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/Text.h b/Utilities/Poco/XML/include/Poco/DOM/Text.h
deleted file mode 100755
index 8337a520e9..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/Text.h
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// Text.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Definition of the DOM Text class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_Text_INCLUDED
-#define DOM_Text_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/DOM/CharacterData.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API Text: public CharacterData
- /// The Text interface inherits from CharacterData and represents the textual
- /// content (termed character data in XML) of an Element or Attr. If there is
- /// no markup inside an element's content, the text is contained in a single
- /// object implementing the Text interface that is the only child of the element.
- /// If there is markup, it is parsed into the information items (elements, comments,
- /// etc.) and Text nodes that form the list of children of the element.
- ///
- /// When a document is first made available via the DOM, there is only one Text
- /// node for each block of text. Users may create adjacent Text nodes that represent
- /// the contents of a given element without any intervening markup, but should
- /// be aware that there is no way to represent the separations between these
- /// nodes in XML or HTML, so they will not (in general) persist between DOM
- /// editing sessions. The normalize() method on Element merges any such adjacent
- /// Text objects into a single node for each block of text.
-{
-public:
- Text* splitText(unsigned long offset);
- /// Breaks this node into two nodes at the specified offset, keeping both in
- /// the tree as siblings. This node then only contains all the content up to
- /// the offset point. A new node of the same type, which is inserted as the
- /// next sibling of this node, contains all the content at and after the offset
- /// point. When the offset is equal to the length of this node, the new node
- /// has no data.
-
- // Node
- const XMLString& nodeName() const;
- unsigned short nodeType() const;
-
- // Non-standard extensions
- XMLString innerText() const;
-
-protected:
- Text(Document* pOwnerDocument, const XMLString& data);
- Text(Document* pOwnerDocument, const Text& text);
- ~Text();
-
- Node* copyNode(bool deep, Document* pOwnerDocument) const;
-
-private:
- static const XMLString NODE_NAME;
-
- friend class Document;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_Text_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/DOM/TreeWalker.h b/Utilities/Poco/XML/include/Poco/DOM/TreeWalker.h
deleted file mode 100755
index 9dcb4b31c4..0000000000
--- a/Utilities/Poco/XML/include/Poco/DOM/TreeWalker.h
+++ /dev/null
@@ -1,233 +0,0 @@
-//
-// TreeWalker.h
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: TreeWalker
-//
-// Definition of the DOM TreeWalker class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOM_TreeWalker_INCLUDED
-#define DOM_TreeWalker_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Node;
-class NodeFilter;
-
-
-class XML_API TreeWalker
- /// TreeWalker objects are used to navigate a document tree or subtree using
- /// the view of the document defined by their whatToShow flags and filter (if
- /// any). Any function which performs navigation using a TreeWalker will automatically
- /// support any view defined by a TreeWalker.
- ///
- /// Omitting nodes from the logical view of a subtree can result in a structure
- /// that is substantially different from the same subtree in the complete, unfiltered
- /// document. Nodes that are siblings in the TreeWalker view may be children
- /// of different, widely separated nodes in the original view. For instance,
- /// consider a NodeFilter that skips all nodes except for Text nodes and the
- /// root node of a document. In the logical view that results, all text nodes
- /// will be siblings and appear as direct children of the root node, no matter
- /// how deeply nested the structure of the original document.
- ///
- /// A TreeWalker can be directly instantiated using one of its constructors -
- /// the DocumentTraversal interface is not needed and therefore not implemented.
- /// Unlike most other DOM classes, TreeWalker supports value semantics.
- ///
- /// If the TreeWalker's current node is removed from the document, the
- /// result of calling any of the movement methods is undefined. This behavior
- /// does not conform to the DOM Level 2 Traversal specification.
-{
-public:
- TreeWalker(Node* root, unsigned long whatToShow, NodeFilter* pFilter = 0);
- /// Creates a TreeWalker over the subtree rooted at the specified node.
-
- TreeWalker(const TreeWalker& walker);
- /// Creates a TreeWalker by copying another NodeIterator.
-
- TreeWalker& operator = (const TreeWalker& walker);
- /// Assignment operator.
-
- ~TreeWalker();
- /// Destroys the TreeWalker.
-
- Node* root() const;
- /// The root node of the TreeWalker, as specified when it was created.
-
- unsigned long whatToShow() const;
- /// This attribute determines which node types are presented via the TreeWalker.
- /// The available set of constants is defined in the NodeFilter interface. Nodes
- /// not accepted by whatToShow will be skipped, but their children may still
- /// be considered. Note that this skip takes precedence over the filter, if
- /// any.
-
- NodeFilter* filter() const;
- /// The NodeFilter used to screen nodes.
-
- bool expandEntityReferences() const;
- /// The value of this flag determines whether the children of entity reference
- /// nodes are visible to the iterator. If false, they and their descendants
- /// will be rejected. Note that this rejection takes precedence over whatToShow
- /// and the filter. Also note that this is currently the only situation where
- /// NodeIterators may reject a complete subtree rather than skipping individual
- /// nodes.
- ///
- /// To produce a view of the document that has entity references expanded and
- /// does not expose the entity reference node itself, use the whatToShow flags
- /// to hide the entity reference node and set expandEntityReferences to true
- /// when creating the iterator. To produce a view of the document that has entity
- /// reference nodes but no entity expansion, use the whatToShow flags to show
- /// the entity reference node and set expandEntityReferences to false.
- ///
- /// This implementation does not support entity reference expansion and
- /// thus always returns false.
-
- Node* currentNode() const;
- /// The node at which the TreeWalker is currently positioned.
- /// Alterations to the DOM tree may cause the current node to no longer be accepted
- /// by the TreeWalker's associated filter. currentNode may also be explicitly
- /// set to any node, whether or not it is within the subtree specified by the
- /// root node or would be accepted by the filter and whatToShow flags. Further
- /// traversal occurs relative to currentNode even if it is not part of the current
- /// view, by applying the filters in the requested direction; if no traversal
- /// is possible, currentNode is not changed.
-
- Node* getCurrentNode() const;
- /// See currentNode().
-
- void setCurrentNode(Node* pNode);
- /// Sets the current node.
-
- Node* parentNode();
- /// Moves to and returns the closest visible ancestor node of the current node.
- /// If the search for parentNode attempts to step upward from the TreeWalker's
- /// root node, or if it fails to find a visible ancestor node, this method retains
- /// the current position and returns null.
-
- Node* firstChild();
- /// Moves the TreeWalker to the first visible child of the current node, and
- /// returns the new node. If the current node has no visible children, returns
- /// null, and retains the current node.
-
- Node* lastChild();
- /// Moves the TreeWalker to the last visible child of the current node, and
- /// returns the new node. If the current node has no visible children, returns
- /// null, and retains the current node.
-
- Node* previousSibling();
- /// Moves the TreeWalker to the previous sibling of the current node, and returns
- /// the new node. If the current node has no visible previous sibling, returns
- /// null, and retains the current node.
-
- Node* nextSibling();
- /// Moves the TreeWalker to the next sibling of the current node, and returns
- /// the new node. If the current node has no visible next sibling, returns null,
- /// and retains the current node.
-
- Node* previousNode();
- /// Moves the TreeWalker to the previous visible node in document order relative
- /// to the current node, and returns the new node. If the current node has no
- /// previous node, or if the search for previousNode attempts to step upward
- /// from the TreeWalker's root node, returns null, and retains the current node.
-
- Node* nextNode();
- /// Moves the TreeWalker to the next visible node in document order relative
- /// to the current node, and returns the new node. If the current node has no
- /// next node, or if the search for nextNode attempts to step upward from the
- /// TreeWalker's root node, returns null, and retains the current node.
-
-protected:
- int accept(Node* pNode) const;
- Node* next(Node* pNode) const;
- Node* previous(Node* pNode) const;
-
-private:
- TreeWalker();
-
- Node* _pRoot;
- unsigned long _whatToShow;
- NodeFilter* _pFilter;
- Node* _pCurrent;
-};
-
-
-//
-// inlines
-//
-inline Node* TreeWalker::root() const
-{
- return _pRoot;
-}
-
-
-inline unsigned long TreeWalker::whatToShow() const
-{
- return _whatToShow;
-}
-
-
-inline NodeFilter* TreeWalker::filter() const
-{
- return _pFilter;
-}
-
-
-inline bool TreeWalker::expandEntityReferences() const
-{
- return false;
-}
-
-
-inline Node* TreeWalker::currentNode() const
-{
- return _pCurrent;
-}
-
-
-inline Node* TreeWalker::getCurrentNode() const
-{
- return _pCurrent;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // DOM_TreeWalker_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/Attributes.h b/Utilities/Poco/XML/include/Poco/SAX/Attributes.h
deleted file mode 100755
index 26ddb9472b..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/Attributes.h
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-// Attributes.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX2 Attributes Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_Attributes_INCLUDED
-#define SAX_Attributes_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API Attributes
- /// Interface for a list of XML attributes.
- /// This interface allows access to a list of attributes in three different ways:
- /// 1.by attribute index;
- /// 2.by Namespace-qualified name; or
- /// 3.by qualified (prefixed) name.
- ///
- /// The list will not contain attributes that were declared #IMPLIED but not
- /// specified in the start tag. It will also not contain
- /// attributes used as Namespace declarations (xmlns*) unless the
- /// http://xml.org/sax/features/namespace-prefixes
- /// feature is set to true (it is false by default).
- ///
- /// If the namespace-prefixes feature (see above) is false, access by
- /// qualified name may not be available; if the
- /// http://xml.org/sax/features/namespaces feature is false, access by
- /// Namespace-qualified names may not be available.
- /// This interface replaces the now-deprecated SAX1 AttributeList interface,
- /// which does not contain Namespace support. In
- /// addition to Namespace support, it adds the getIndex methods (below).
- /// The order of attributes in the list is unspecified, and will vary from
- /// implementation to implementation.
-{
-public:
- virtual int getIndex(const XMLString& name) const = 0;
- /// Look up the index of an attribute by a qualified name.
-
- virtual int getIndex(const XMLString& namespaceURI, const XMLString& localName) const = 0;
- /// Look up the index of an attribute by a namspace name.
-
- virtual int getLength() const = 0;
- /// Return the number of attributes in the list.
- ///
- /// Once you know the number of attributes, you can iterate through the list.
-
- virtual const XMLString& getLocalName(int i) const = 0;
- /// Look up a local attribute name by index.
-
- virtual const XMLString& getQName(int i) const = 0;
- /// Look up a qualified attribute name by index.
-
- virtual const XMLString& getType(int i) const = 0;
- /// Look up an attribute type by index.
- ///
- /// The attribute type is one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN",
- /// "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION" (always in upper case).
- ///
- /// If the parser has not read a declaration for the attribute, or if the parser does not
- /// report attribute types, then it must return the value "CDATA" as stated in the XML 1.0
- /// Recommendation (clause 3.3.3, "Attribute-Value Normalization").
- ///
- /// For an enumerated attribute that is not a notation, the parser will report the type
- /// as "NMTOKEN".
-
- virtual const XMLString& getType(const XMLString& qname) const = 0;
- /// Look up an attribute type by a qualified name.
- ///
- /// See getType(int) for a description of the possible types.
-
- virtual const XMLString& getType(const XMLString& namespaceURI, const XMLString& localName) const = 0;
- /// Look up an attribute type by a namespace name.
- ///
- /// See getType(int) for a description of the possible types.
-
- virtual const XMLString& getValue(int i) const = 0;
- /// Look up an attribute value by index.
- ///
- /// If the attribute value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens
- /// will be concatenated into a single string with each token separated by a single space.
-
- virtual const XMLString& getValue(const XMLString& qname) const = 0;
- /// Look up an attribute value by a qualified name.
- ///
- /// See getValue(int) for a description of the possible values.
-
- virtual const XMLString& getValue(const XMLString& uri, const XMLString& localName) const = 0;
- /// Look up an attribute value by a namespace name.
- ///
- /// See getValue(int) for a description of the possible values.
-
- virtual const XMLString& getURI(int i) const = 0;
- /// Look up a namespace URI by index.
-
-protected:
- virtual ~Attributes();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_Attributes_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/AttributesImpl.h b/Utilities/Poco/XML/include/Poco/SAX/AttributesImpl.h
deleted file mode 100755
index 1191c4ff28..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/AttributesImpl.h
+++ /dev/null
@@ -1,318 +0,0 @@
-//
-// AttributesImpl.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Implementation of the SAX2 Attributes Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_AttributesImpl_INCLUDED
-#define SAX_AttributesImpl_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/Attributes.h"
-#include <vector>
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API AttributesImpl: public Attributes
- /// This class provides a default implementation of the SAX2 Attributes interface,
- /// with the addition of manipulators so that the list can be modified or reused.
- ///
- /// There are two typical uses of this class:
- /// 1. to take a persistent snapshot of an Attributes object in a startElement event; or
- /// 2. to construct or modify an Attributes object in a SAX2 driver or filter.
-{
-public:
- struct Attribute
- {
- XMLString localName;
- XMLString namespaceURI;
- XMLString qname;
- XMLString value;
- XMLString type;
- bool specified;
- };
- typedef std::vector<Attribute> AttributeVec;
- typedef AttributeVec::const_iterator iterator;
-
- AttributesImpl();
- /// Creates the AttributesImpl.
-
- AttributesImpl(const Attributes& attributes);
- /// Creates the AttributesImpl by copying another one.
-
- AttributesImpl(const AttributesImpl& attributes);
- /// Creates the AttributesImpl by copying another one.
-
- ~AttributesImpl();
- /// Destroys the AttributesImpl.
-
- AttributesImpl& operator = (const AttributesImpl& attributes);
- /// Assignment operator.
-
- int getIndex(const XMLString& name) const;
- int getIndex(const XMLString& namespaceURI, const XMLString& localName) const;
- int getLength() const;
- const XMLString& getLocalName(int i) const;
- const XMLString& getQName(int i) const;
- const XMLString& getType(int i) const;
- const XMLString& getType(const XMLString& qname) const;
- const XMLString& getType(const XMLString& namespaceURI, const XMLString& localName) const;
- const XMLString& getValue(int i) const;
- const XMLString& getValue(const XMLString& qname) const;
- const XMLString& getValue(const XMLString& namespaceURI, const XMLString& localName) const;
- const XMLString& getURI(int i) const;
-
- bool isSpecified(int i) const;
- /// Returns true unless the attribute value was provided by DTD defaulting.
- /// Extension from Attributes2 interface.
-
- bool isSpecified(const XMLString& qname) const;
- /// Returns true unless the attribute value was provided by DTD defaulting.
- /// Extension from Attributes2 interface.
-
- bool isSpecified(const XMLString& namespaceURI, const XMLString& localName) const;
- /// Returns true unless the attribute value was provided by DTD defaulting.
- /// Extension from Attributes2 interface.
-
- void setValue(int i, const XMLString& value);
- /// Sets the value of an attribute.
-
- void setValue(const XMLString& qname, const XMLString& value);
- /// Sets the value of an attribute.
-
- void setValue(const XMLString& namespaceURI, const XMLString& localName, const XMLString& value);
- /// Sets the value of an attribute.
-
- void setAttributes(const Attributes& attributes);
- /// Copies the attributes from another Attributes object.
-
- void setAttribute(int i, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& type, const XMLString& value);
- /// Sets an attribute.
-
- void addAttribute(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& type, const XMLString& value);
- /// Adds an attribute to the end of the list.
-
- void addAttribute(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& type, const XMLString& value, bool specified);
- /// Adds an attribute to the end of the list.
-
- void addAttribute(const XMLChar* namespaceURI, const XMLChar* localName, const XMLChar* qname, const XMLChar* type, const XMLChar* value, bool specified);
- /// Adds an attribute to the end of the list.
-
- Attribute& addAttribute();
- /// Add an (empty) attribute to the end of the list.
- /// For internal use only.
- /// The returned Attribute element must be filled by the caller.
-
- void removeAttribute(int i);
- /// Removes an attribute.
-
- void removeAttribute(const XMLString& qname);
- /// Removes an attribute.
-
- void removeAttribute(const XMLString& namespaceURI, const XMLString& localName);
- /// Removes an attribute.
-
- void clear();
- /// Removes all attributes.
-
- void reserve(std::size_t capacity);
- /// Reserves capacity in the internal vector.
-
- void setLocalName(int i, const XMLString& localName);
- /// Sets the local name of an attribute.
-
- void setQName(int i, const XMLString& qname);
- /// Sets the qualified name of an attribute.
-
- void setType(int i, const XMLString& type);
- /// Sets the type of an attribute.
-
- void setURI(int i, const XMLString& namespaceURI);
- /// Sets the namespace URI of an attribute.
-
- iterator begin() const;
- /// Iterator support.
-
- iterator end() const;
- /// Iterator support.
-
-protected:
- Attribute* find(const XMLString& qname) const;
- Attribute* find(const XMLString& namespaceURI, const XMLString& localName) const;
-
-private:
- AttributeVec _attributes;
- Attribute _empty;
-};
-
-
-//
-// inlines
-//
-inline AttributesImpl::iterator AttributesImpl::begin() const
-{
- return _attributes.begin();
-}
-
-
-inline AttributesImpl::iterator AttributesImpl::end() const
-{
- return _attributes.end();
-}
-
-
-inline AttributesImpl::Attribute& AttributesImpl::addAttribute()
-{
- _attributes.push_back(_empty);
- return _attributes.back();
-}
-
-
-inline int AttributesImpl::getLength() const
-{
- return (int) _attributes.size();
-}
-
-
-inline const XMLString& AttributesImpl::getLocalName(int i) const
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- return _attributes[i].localName;
-}
-
-
-inline const XMLString& AttributesImpl::getQName(int i) const
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- return _attributes[i].qname;
-}
-
-
-inline const XMLString& AttributesImpl::getType(int i) const
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- return _attributes[i].type;
-}
-
-
-inline const XMLString& AttributesImpl::getType(const XMLString& qname) const
-{
- Attribute* pAttr = find(qname);
- if (pAttr)
- return pAttr->type;
- else
- return _empty.type;
-}
-
-
-inline const XMLString& AttributesImpl::getType(const XMLString& namespaceURI, const XMLString& localName) const
-{
- Attribute* pAttr = find(namespaceURI, localName);
- if (pAttr)
- return pAttr->type;
- else
- return _empty.type;
-}
-
-
-inline const XMLString& AttributesImpl::getValue(int i) const
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- return _attributes[i].value;
-}
-
-
-inline const XMLString& AttributesImpl::getValue(const XMLString& qname) const
-{
- Attribute* pAttr = find(qname);
- if (pAttr)
- return pAttr->value;
- else
- return _empty.value;
-}
-
-
-inline const XMLString& AttributesImpl::getValue(const XMLString& namespaceURI, const XMLString& localName) const
-{
- Attribute* pAttr = find(namespaceURI, localName);
- if (pAttr)
- return pAttr->value;
- else
- return _empty.value;
-}
-
-
-inline const XMLString& AttributesImpl::getURI(int i) const
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- return _attributes[i].namespaceURI;
-}
-
-
-inline bool AttributesImpl::isSpecified(int i) const
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- return _attributes[i].specified;
-}
-
-
-inline bool AttributesImpl::isSpecified(const XMLString& qname) const
-{
- Attribute* pAttr = find(qname);
- if (pAttr)
- return pAttr->specified;
- else
- return false;
-}
-
-
-inline bool AttributesImpl::isSpecified(const XMLString& namespaceURI, const XMLString& localName) const
-{
- Attribute* pAttr = find(namespaceURI, localName);
- if (pAttr)
- return pAttr->specified;
- else
- return false;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_AttributesImpl_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/ContentHandler.h b/Utilities/Poco/XML/include/Poco/SAX/ContentHandler.h
deleted file mode 100755
index b6d6602647..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/ContentHandler.h
+++ /dev/null
@@ -1,262 +0,0 @@
-//
-// ContentHandler.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX2 ContentHandler Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_ContentHandler_INCLUDED
-#define SAX_ContentHandler_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class Locator;
-class Attributes;
-
-
-class XML_API ContentHandler
- /// Receive notification of the logical content of a document.
- ///
- /// This is the main interface that most SAX applications implement: if the
- /// application needs to be informed of basic parsing events, it implements
- /// this interface and registers an instance with the SAX parser using the setContentHandler
- /// method. The parser uses the instance to report basic document-related events
- /// like the start and end of elements and character data.
- ///
- /// The order of events in this interface is very important, and mirrors the
- /// order of information in the document itself. For example, all of an element's
- /// content (character data, processing instructions, and/or subelements) will
- /// appear, in order, between the startElement event and the corresponding endElement
- /// event.
- ///
- /// This interface is similar to the now-deprecated SAX 1.0 DocumentHandler
- /// interface, but it adds support for Namespaces and for reporting skipped
- /// entities (in non-validating XML processors).
- /// Receive notification of the logical content of a document.
-{
-public:
- virtual void setDocumentLocator(const Locator* loc) = 0;
- /// Receive an object for locating the origin of SAX document events.
- ///
- /// SAX parsers are strongly encouraged (though not absolutely required) to
- /// supply a locator: if it does so, it must supply the locator to the application
- /// by invoking this method before invoking any of the other methods in the
- /// ContentHandler interface.
- ///
- /// The locator allows the application to determine the end position of any
- /// document-related event, even if the parser is not reporting an error. Typically,
- /// the application will use this information for reporting its own errors (such
- /// as character content that does not match an application's business rules).
- /// The information returned by the locator is probably not sufficient for use
- /// with a search engine.
- ///
- /// Note that the locator will return correct information only during the invocation
- /// SAX event callbacks after startDocument returns and before endDocument is
- /// called. The application should not attempt to use it at any other time.
-
- virtual void startDocument() = 0;
- /// Receive notification of the beginning of a document.
- ///
- /// The SAX parser calls this function one time before calling all other
- /// functions of this class (except SetDocumentLocator).
-
- virtual void endDocument() = 0;
- /// Receive notification of the end of a document.
- ///
- /// The SAX parser will invoke this method only once, and it will be the last
- /// method invoked during the parse. The parser shall not invoke this method
- /// until it has either abandoned parsing (because of an unrecoverable error)
- /// or reached the end of input.
-
- virtual void startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attrList) = 0;
- /// Receive notification of the beginning of an element.
- ///
- /// The Parser will invoke this method at the beginning of every element in
- /// the XML document; there will be a corresponding endElement event for every
- /// startElement event (even when the element is empty). All of the element's
- /// content will be reported, in order, before the corresponding endElement
- /// event.
- ///
- /// This event allows up to three name components for each element:
- /// 1. the Namespace URI;
- /// 2. the local name; and
- /// 3. the qualified (prefixed) name.
- ///
- /// Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces
- /// and the http://xml.org/sax/features/namespace-prefixes properties:
- /// * the Namespace URI and local name are required when the namespaces
- /// property is true (the default), and are optional when the namespaces property
- /// is false (if one is specified, both must be);
- /// * the qualified name is required when the namespace-prefixes property
- /// is true, and is optional when the namespace-prefixes property is false (the
- /// default).
- ///
- /// Note that the attribute list provided will contain only attributes with
- /// explicit values (specified or defaulted): #IMPLIED attributes will be omitted.
- /// The attribute list will contain attributes used for Namespace declarations
- /// (xmlns* attributes) only if the http://xml.org/sax/features/namespace-prefixes
- /// property is true (it is false by default, and support for a true value is
- /// optional).
- ///
- /// Like characters(), attribute values may have characters that need more than
- /// one char value.
-
- virtual void endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname) = 0;
- /// Receive notification of the end of an element.
- ///
- /// The SAX parser will invoke this method at the end of every element in the
- /// XML document; there will be a corresponding startElement event for every
- /// endElement event (even when the element is empty).
- ///
- /// For information on the names, see startElement.
-
- virtual void characters(const XMLChar ch[], int start, int length) = 0;
- /// Receive notification of character data.
- ///
- /// The Parser will call this method to report each chunk of character data.
- /// SAX parsers may return all contiguous character data in a single chunk,
- /// or they may split it into several chunks; however, all of the characters
- /// in any single event must come from the same external entity so that the
- /// Locator provides useful information.
- ///
- /// The application must not attempt to read from the array outside of the specified
- /// range.
- ///
- /// Individual characters may consist of more than one XMLChar value. There
- /// are three important cases where this happens, because characters can't be
- /// represented in just sixteen bits. In one case, characters are represented
- /// in a Surrogate Pair, using two special Unicode values. Such characters are
- /// in the so-called "Astral Planes", with a code point above U+FFFF. A second
- /// case involves composite characters, such as a base character combining with
- /// one or more accent characters. And most important, if XMLChar is a plain
- /// char, characters are encoded in UTF-8.
- ///
- /// Your code should not assume that algorithms using char-at-a-time idioms
- /// will be working in character units; in some cases they will split characters.
- /// This is relevant wherever XML permits arbitrary characters, such as attribute
- /// values, processing instruction data, and comments as well as in data reported
- /// from this method. It's also generally relevant whenever C++ code manipulates
- /// internationalized text; the issue isn't unique to XML.
- ///
- /// Note that some parsers will report whitespace in element content using the
- /// ignorableWhitespace method rather than this one (validating parsers must
- /// do so).
-
- virtual void ignorableWhitespace(const XMLChar ch[], int start, int length) = 0;
- /// Receive notification of ignorable whitespace in element content.
- ///
- /// Validating Parsers must use this method to report each chunk of whitespace
- /// in element content (see the W3C XML 1.0 recommendation, section 2.10): non-validating
- /// parsers may also use this method if they are capable of parsing and using
- /// content models.
- ///
- /// SAX parsers may return all contiguous whitespace in a single chunk, or they
- /// may split it into several chunks; however, all of the characters in any
- /// single event must come from the same external entity, so that the Locator
- /// provides useful information.
- ///
- /// The application must not attempt to read from the array outside of the specified
- /// range.
-
- virtual void processingInstruction(const XMLString& target, const XMLString& data) = 0;
- /// Receive notification of a processing instruction.
- ///
- /// The Parser will invoke this method once for each processing instruction
- /// found: note that processing instructions may occur before or after the main
- /// document element.
- ///
- /// A SAX parser must never report an XML declaration (XML 1.0, section 2.8)
- /// or a text declaration (XML 1.0, section 4.3.1) using this method.
- ///
- /// Like characters(), processing instruction data may have characters that
- /// need more than one char value.
-
- virtual void startPrefixMapping(const XMLString& prefix, const XMLString& uri) = 0;
- /// Begin the scope of a prefix-URI Namespace mapping.
- ///
- /// The information from this event is not necessary for normal Namespace processing:
- /// the SAX XML reader will automatically replace prefixes for element and attribute
- /// names when the http://xml.org/sax/features/namespaces feature is true (the
- /// default).
- ///
- /// There are cases, however, when applications need to use prefixes in character
- /// data or in attribute values, where they cannot safely be expanded automatically;
- /// the start/endPrefixMapping event supplies the information to the application
- /// to expand prefixes in those contexts itself, if necessary.
- ///
- /// Note that start/endPrefixMapping events are not guaranteed to be properly
- /// nested relative to each other: all startPrefixMapping events will occur
- /// immediately before the corresponding startElement event, and all endPrefixMapping
- /// events will occur immediately after the corresponding endElement event,
- /// but their order is not otherwise guaranteed.
- ///
- /// There should never be start/endPrefixMapping events for the "xml" prefix,
- /// since it is predeclared and immutable.
-
- virtual void endPrefixMapping(const XMLString& prefix) = 0;
- /// End the scope of a prefix-URI mapping.
- ///
- /// See startPrefixMapping for details. These events will always occur immediately
- /// after the corresponding endElement event, but the order of endPrefixMapping
- /// events is not otherwise guaranteed.
-
- virtual void skippedEntity(const XMLString& name) = 0;
- /// Receive notification of a skipped entity. This is not called for entity
- /// references within markup constructs such as element start tags or markup
- /// declarations. (The XML recommendation requires reporting skipped external
- /// entities. SAX also reports internal entity expansion/non-expansion, except
- /// within markup constructs.)
- ///
- /// The Parser will invoke this method each time the entity is skipped. Non-validating
- /// processors may skip entities if they have not seen the declarations (because,
- /// for example, the entity was declared in an external DTD subset). All processors
- /// may skip external entities, depending on the values of the http://xml.org/sax/features/external-general-entities
- /// and the http://xml.org/sax/features/external-parameter-entities properties.
-
-protected:
- virtual ~ContentHandler();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_ContentHandler_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/DTDHandler.h b/Utilities/Poco/XML/include/Poco/SAX/DTDHandler.h
deleted file mode 100755
index 9d5613cf58..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/DTDHandler.h
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// DTDHandler.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX DTDHandler Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_DTDHandler_INCLUDED
-#define SAX_DTDHandler_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API DTDHandler
- /// If a SAX application needs information about notations and unparsed entities,
- /// then the application implements this interface and registers an instance with the
- /// SAX parser using the parser's setDTDHandler method. The parser uses the instance
- /// to report notation and unparsed entity declarations to the application.
- ///
- /// Note that this interface includes only those DTD events that the XML recommendation
- /// requires processors to report: notation and unparsed entity declarations.
- ///
- /// The SAX parser may report these events in any order, regardless of the order in
- /// which the notations and unparsed entities were declared; however, all DTD events
- /// must be reported after the document handler's startDocument event, and before the first
- /// startElement event. (If the LexicalHandler is used, these events must also be reported before the endDTD event.)
- ///
- /// It is up to the application to store the information for future use (perhaps in a hash table or
- /// object tree). If the application encounters attributes of type "NOTATION", "ENTITY", or "ENTITIES",
- /// it can use the information that it obtained through this interface to find the entity and/or notation
- /// corresponding with the attribute value.
-{
-public:
- virtual void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId) = 0;
- /// Receive notification of a notation declaration event.
- ///
- /// It is up to the application to record the notation for later reference,
- /// if necessary; notations may appear as attribute values and in unparsed
- /// entity declarations, and are sometime used with processing instruction
- /// target names.
- ///
- /// At least one of publicId and systemId must be non-null. If a system identifier
- /// is present, and it is a URL, the SAX parser must resolve it fully before passing
- /// it to the application through this event.
- ///
- /// There is no guarantee that the notation declaration will be reported before any
- /// unparsed entities that use it.
- ///
- /// Note that publicId and systemId maybe null, therefore we pass a pointer rather than a reference.
-
- virtual void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName) = 0;
- /// Receive notification of an unparsed entity declaration event.
- ///
- /// Note that the notation name corresponds to a notation reported by the
- /// notationDecl event. It is up to the application to record the entity for
- /// later reference, if necessary; unparsed entities may appear as attribute values.
- ///
- /// If the system identifier is a URL, the parser must resolve it fully before
- /// passing it to the application.
- ///
- /// Note that publicId maybe null, therefore we pass a pointer rather than a reference.
-
-protected:
- virtual ~DTDHandler();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_DTDHandler_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/DeclHandler.h b/Utilities/Poco/XML/include/Poco/SAX/DeclHandler.h
deleted file mode 100755
index c192943ca9..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/DeclHandler.h
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// DeclHandler.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX2-ext DeclHandler Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_DeclHandler_INCLUDED
-#define SAX_DeclHandler_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API DeclHandler
- /// This is an optional extension handler for SAX2 to provide information
- /// about DTD declarations in an XML document. XML
- /// readers are not required to support this handler, and this handler is
- /// not included in the core SAX2 distribution.
- ///
- /// Note that data-related DTD declarations (unparsed entities and notations)
- /// are already reported through the DTDHandler interface.
- /// If you are using the declaration handler together with a lexical handler,
- /// all of the events will occur between the startDTD and the endDTD events.
- /// To set the DeclHandler for an XML reader, use the setProperty method
- /// with the propertyId "http://xml.org/sax/properties/declaration-handler".
- /// If the reader does not support declaration events, it will throw a
- /// SAXNotRecognizedException or a SAXNotSupportedException when you attempt to
- /// register the handler.
-{
-public:
- virtual void attributeDecl(const XMLString& eName, const XMLString& aName, const XMLString* valueDefault, const XMLString* value) = 0;
- /// Report an attribute type declaration.
- ///
- /// Only the effective (first) declaration for an attribute will be reported.
- /// The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS",
- /// "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", a parenthesized token group
- /// with the separator "|" and all whitespace removed, or the word "NOTATION"
- /// followed by a space followed by a parenthesized token group with all whitespace
- /// removed.
- ///
- /// The value will be the value as reported to applications, appropriately normalized
- /// and with entity and character references expanded.
-
- virtual void elementDecl(const XMLString& name, const XMLString& model) = 0;
- /// Report an element type declaration.
- ///
- /// The content model will consist of the string "EMPTY", the string "ANY", or a
- /// parenthesised group, optionally followed by an occurrence indicator. The model
- /// will be normalized so that all parameter entities are fully resolved and all
- /// whitespace is removed,and will include the enclosing parentheses. Other
- /// normalization (such as removing redundant parentheses or simplifying occurrence
- /// indicators) is at the discretion of the parser.
-
- virtual void externalEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId) = 0;
- /// Report an external entity declaration.
- ///
- /// Only the effective (first) declaration for each entity will be reported.
- ///
- /// If the system identifier is a URL, the parser must resolve it fully before
- /// passing it to the application.
-
- virtual void internalEntityDecl(const XMLString& name, const XMLString& value) = 0;
- /// Report an internal entity declaration.
- ///
- /// Only the effective (first) declaration for each entity will be reported. All
- /// parameter entities in the value will be expanded, but general entities will not.
-
-protected:
- virtual ~DeclHandler();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_DeclHandler_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/DefaultHandler.h b/Utilities/Poco/XML/include/Poco/SAX/DefaultHandler.h
deleted file mode 100755
index 7fb6f0573c..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/DefaultHandler.h
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// DefaultHandler.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX-2 DefaultHandler class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_DefaultHandler_INCLUDED
-#define SAX_DefaultHandler_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/EntityResolver.h"
-#include "Poco/SAX/DTDHandler.h"
-#include "Poco/SAX/ContentHandler.h"
-#include "Poco/SAX/ErrorHandler.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API DefaultHandler: public EntityResolver, public DTDHandler, public ContentHandler, public ErrorHandler
- /// Default base class for SAX2 event handlers.
- /// This class is available as a convenience base class for SAX2 applications:
- /// it provides default implementations for all of the
- /// callbacks in the four core SAX2 handler classes:
- /// * EntityResolver
- /// * DTDHandler
- /// * ContentHandler
- /// * ErrorHandler
- /// Application writers can extend this class when they need to implement only
- /// part of an interface; parser writers can instantiate this
- /// class to provide default handlers when the application has not supplied its own.
-{
-public:
- DefaultHandler();
- /// Creates the DefaultHandler.
-
- ~DefaultHandler();
- /// Destroys the DefaultHandler.
-
- // EntityResolver
- InputSource* resolveEntity(const XMLString* publicId, const XMLString& systemId);
- void releaseInputSource(InputSource* pSource);
-
- // DTDHandler
- void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId);
- void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName);
-
- // ContentHandler
- void setDocumentLocator(const Locator* loc);
- void startDocument();
- void endDocument();
- void startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attributes);
- void endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname);
- void characters(const XMLChar ch[], int start, int length);
- void ignorableWhitespace(const XMLChar ch[], int start, int length);
- void processingInstruction(const XMLString& target, const XMLString& data);
- void startPrefixMapping(const XMLString& prefix, const XMLString& uri);
- void endPrefixMapping(const XMLString& prefix);
- void skippedEntity(const XMLString& name);
-
- // ErrorHandler
- void warning(const SAXException& exc);
- void error(const SAXException& exc);
- void fatalError(const SAXException& exc);
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_DefaultHandler_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/EntityResolver.h b/Utilities/Poco/XML/include/Poco/SAX/EntityResolver.h
deleted file mode 100755
index b7f5e6d9f1..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/EntityResolver.h
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// EntityResolver.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX EntityResolver Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_EntityResolver_INCLUDED
-#define SAX_EntityResolver_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class InputSource;
-
-
-class XML_API EntityResolver
- /// If a SAX application needs to implement customized handling for external entities,
- /// it must implement this interface and register an instance with the SAX driver using
- /// the setEntityResolver method.
- ///
- /// The XML reader will then allow the application to intercept any external entities
- /// (including the external DTD subset and external parameter entities, if any) before
- /// including them.
- ///
- /// Many SAX applications will not need to implement this interface, but it will be
- /// especially useful for applications that build XML documents from databases or other
- /// specialised input sources, or for applications that use URI types other than URLs.
- ///
- /// The application can also use this interface to redirect system identifiers to local
- /// URIs or to look up replacements in a catalog (possibly by using the public identifier).
-{
-public:
- virtual InputSource* resolveEntity(const XMLString* publicId, const XMLString& systemId) = 0;
- /// Allow the application to resolve external entities.
- ///
- /// The parser will call this method before opening any external entity except the
- /// top-level document entity. Such entities include the external DTD subset and
- /// external parameter entities referenced within the DTD (in either case, only
- /// if the parser reads external parameter entities), and external general entities
- /// referenced within the document element (if the parser reads external general entities).
- /// The application may request that the parser locate the entity itself, that it use an
- /// alternative URI, or that it use data provided by the application (as a character or
- /// byte input stream).
- ///
- /// Application writers can use this method to redirect external system identifiers to
- /// secure and/or local URIs, to look up public identifiers in a catalogue, or to read an
- /// entity from a database or other input source (including, for example, a dialog box).
- /// Neither XML nor SAX specifies a preferred policy for using public or system IDs to resolve
- /// resources. However, SAX specifies how to interpret any InputSource returned by this method,
- /// and that if none is returned, then the system ID will be dereferenced as a URL.
- ///
- /// If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to
- /// the application.
- ///
- /// Note that publicId maybe null, therefore we pass a pointer rather than a reference.
-
- virtual void releaseInputSource(InputSource* pSource) = 0;
- /// This is a non-standard extension to SAX!
- /// Called by the parser when the input source returned by ResolveEntity is
- /// no longer needed. Should free any resources used by the input source.
-
-protected:
- virtual ~EntityResolver();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_EntityResolver_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/EntityResolverImpl.h b/Utilities/Poco/XML/include/Poco/SAX/EntityResolverImpl.h
deleted file mode 100755
index caf5d9181e..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/EntityResolverImpl.h
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// EntityResolverImpl.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// An implementation of EntityResolver.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_EntityResolverImpl_INCLUDED
-#define SAX_EntityResolverImpl_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/SAX/EntityResolver.h"
-#include "Poco/URIStreamOpener.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API EntityResolverImpl: public EntityResolver
- /// A default implementation of the EntityResolver interface.
- ///
- /// The system ID is first interpreted as an URI and the
- /// URIStreamOpener is used to create and open an istream
- /// for an InputSource.
- ///
- /// If the system ID is not a valid URI, it is
- /// interpreted as a filesystem path and a Poco::FileInputStream
- /// is opened for it.
-{
-public:
- EntityResolverImpl();
- /// Creates an EntityResolverImpl that uses the default
- /// URIStreamOpener.
-
- EntityResolverImpl(const Poco::URIStreamOpener& opener);
- /// Creates an EntityResolverImpl that uses the given
- /// URIStreamOpener.
-
- ~EntityResolverImpl();
- /// Destroys the EntityResolverImpl.
-
- InputSource* resolveEntity(const XMLString* publicId, const XMLString& systemId);
- /// Tries to use the URIStreamOpener to create and open an istream
- /// for the given systemId, which is interpreted as an URI.
- ///
- /// If the systemId is not a valid URI, it is interpreted as
- /// a local filesystem path and a Poco::FileInputStream is opened for it.
-
- void releaseInputSource(InputSource* pSource);
- /// Deletes the InputSource's stream.
-
-protected:
- std::istream* resolveSystemId(const XMLString& systemId);
-
-private:
- EntityResolverImpl(const EntityResolverImpl&);
- EntityResolverImpl& operator = (const EntityResolverImpl&);
-
- const Poco::URIStreamOpener& _opener;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_EntityResolverImpl_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/ErrorHandler.h b/Utilities/Poco/XML/include/Poco/SAX/ErrorHandler.h
deleted file mode 100755
index 5b96d2aefb..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/ErrorHandler.h
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// ErrorHandler.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX ErrorHandler Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_ErrorHandler_INCLUDED
-#define SAX_ErrorHandler_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class SAXException;
-
-
-class XML_API ErrorHandler
- /// If a SAX application needs to implement customized error handling, it must
- /// implement this interface and then register an instance with the XML reader
- /// using the setErrorHandler method. The parser will then report all errors and
- /// warnings through this interface.
- ///
- /// WARNING: If an application does not register an ErrorHandler, XML parsing errors
- /// will go unreported, except that SAXParseExceptions will be thrown for fatal errors.
- /// In order to detect validity errors, an ErrorHandler that does something with error()
- /// calls must be registered.
- ///
- /// For XML processing errors, a SAX driver must use this interface in preference to
- /// throwing an exception: it is up to the application to decide whether to throw an
- /// exception for different types of errors and warnings. Note, however, that there is no
- /// requirement that the parser continue to report additional errors after a call to
- /// fatalError. In other words, a SAX driver class may throw an exception after reporting
- /// any fatalError. Also parsers may throw appropriate exceptions for non-XML errors. For
- /// example, XMLReader::parse() would throw an IOException for errors accessing entities or
- /// the document.
-{
-public:
- virtual void warning(const SAXException& exc) = 0;
- /// Receive notification of a warning.
- ///
- /// SAX parsers will use this method to report conditions that are not errors or fatal
- /// errors as defined by the XML recommendation. The default behaviour is to take no action.
- ///
- /// The SAX parser must continue to provide normal parsing events after invoking this method:
- /// it should still be possible for the application to process the document through to the end.
- ///
- /// Filters may use this method to report other, non-XML warnings as well.
-
- virtual void error(const SAXException& exc) = 0;
- /// Receive notification of a recoverable error.
- ///
- /// This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0
- /// Recommendation. For example, a validating parser would use this callback to report
- /// the violation of a validity constraint. The default behaviour is to take no action.
- ///
- /// The SAX parser must continue to provide normal parsing events after invoking this
- /// method: it should still be possible for the application to process the document through
- /// to the end. If the application cannot do so, then the parser should report a fatal error
- /// even if the XML recommendation does not require it to do so.
- ///
- /// Filters may use this method to report other, non-XML errors as well.
-
- virtual void fatalError(const SAXException& exc) = 0;
- /// Receive notification of a non-recoverable error.
- /// The application must assume that the document is unusable after the parser has
- /// invoked this method, and should continue (if at all) only for the sake of collecting
- /// additional error messages: in fact, SAX parsers are free to stop reporting any other
- /// events once this method has been invoked.
-
-protected:
- virtual ~ErrorHandler();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_ErrorHandler_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/InputSource.h b/Utilities/Poco/XML/include/Poco/SAX/InputSource.h
deleted file mode 100755
index e2bfc94a38..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/InputSource.h
+++ /dev/null
@@ -1,191 +0,0 @@
-//
-// InputSource.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX InputSource - A single input source for an XML entity.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_InputSource_INCLUDED
-#define SAX_InputSource_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/XML/XMLStream.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API InputSource
- /// This class allows a SAX application to encapsulate information about an input
- /// source in a single object, which may include a public identifier, a system
- /// identifier, a byte stream (possibly with a specified encoding), and/or a character
- /// stream.
- ///
- /// There are two places that the application can deliver an input source to the
- /// parser: as the argument to the Parser.parse method, or as the return value of the
- /// EntityResolver::resolveEntity() method.
- ///
- /// The SAX parser will use the InputSource object to determine how to read XML input.
- /// If there is a character stream available, the parser will read that stream directly,
- /// disregarding any text encoding declaration found in that stream. If there is no character
- /// stream, but there is a byte stream, the parser will use that byte stream, using the
- /// encoding specified in the InputSource or else (if no encoding is specified) autodetecting
- /// the character encoding using an algorithm such as the one in the XML specification.
- /// If neither a character stream nor a byte stream is available, the parser will attempt
- /// to open a URI connection to the resource identified by the system identifier.
- ///
- /// An InputSource object belongs to the application: the SAX parser shall never modify it in
- /// any way (it may modify a copy if necessary). However, standard processing of both byte and
- /// character streams is to close them on as part of end-of-parse cleanup, so applications should
- /// not attempt to re-use such streams after they have been handed to a parser.
-{
-public:
- InputSource();
- /// Zero-argument default constructor.
-
- InputSource(const XMLString& systemId);
- /// Creates a new input source with a system identifier.
- /// Applications may use setPublicId to include a public identifier as well,
- /// or setEncoding to specify the character encoding, if known.
- ///
- /// If the system identifier is a URL, it must be fully resolved (it may not
- /// be a relative URL).
-
- InputSource(XMLByteInputStream& istr);
- /// Creates a new input source with a byte stream.
- ///
- /// Application writers should use setSystemId() to provide a base for resolving
- /// relative URIs, may use setPublicId to include a public identifier, and may use
- /// setEncoding to specify the object's character encoding.
-
- ~InputSource();
- /// Destroys the InputSource.
-
- void setPublicId(const XMLString& publicId);
- /// Set the public identifier for this input source.
- ///
- /// The public identifier is always optional: if the application writer includes one,
- /// it will be provided as part of the location information.
-
- void setSystemId(const XMLString& systemId);
- /// Set the system identifier for this input source.
- ///
- /// The system identifier is optional if there is a byte stream or a character stream,
- /// but it is still useful to provide one, since the application can use it to resolve
- /// relative URIs and can include it in error messages and warnings (the parser will
- /// attempt to open a connection to the URI only if there is no byte stream or character
- /// stream specified).
- ///
- /// If the application knows the character encoding of the object pointed to by the system
- /// identifier, it can register the encoding using the setEncoding method.
- ///
- /// If the system identifier is a URL, it must be fully resolved (it may not be a relative URL).
-
- const XMLString& getPublicId() const;
- /// Get the public identifier for this input source.
-
- const XMLString& getSystemId() const;
- /// Get the system identifier for this input source.
-
- void setByteStream(XMLByteInputStream& istr);
- /// Set the byte stream for this input source.
- /// The SAX parser will ignore this if there is also a character stream specified, but it
- /// will use a byte stream in preference to opening a URI connection itself.
-
- XMLByteInputStream* getByteStream() const;
- /// Get the byte stream for this input source.
-
- void setCharacterStream(XMLCharInputStream& istr);
- /// Set the character stream for this input source.
-
- XMLCharInputStream* getCharacterStream() const;
- /// Get the character stream for this input source.
-
- void setEncoding(const XMLString& encoding);
- /// Set the character encoding, if known.
- /// The encoding must be a string acceptable for an XML encoding declaration
- /// (see section 4.3.3 of the XML 1.0 recommendation).
-
- const XMLString& getEncoding() const;
- /// Get the character encoding for a byte stream or URI.
-
-private:
- XMLString _publicId;
- XMLString _systemId;
- XMLString _encoding;
- XMLByteInputStream* _bistr;
- XMLCharInputStream* _cistr;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& InputSource::getPublicId() const
-{
- return _publicId;
-}
-
-
-inline const XMLString& InputSource::getSystemId() const
-{
- return _systemId;
-}
-
-
-inline const XMLString& InputSource::getEncoding() const
-{
- return _encoding;
-}
-
-
-inline XMLByteInputStream* InputSource::getByteStream() const
-{
- return _bistr;
-}
-
-
-inline XMLCharInputStream* InputSource::getCharacterStream() const
-{
- return _cistr;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_InputSource_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/LexicalHandler.h b/Utilities/Poco/XML/include/Poco/SAX/LexicalHandler.h
deleted file mode 100755
index 7b1248a885..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/LexicalHandler.h
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// LexicalHandler.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX2-ext LexicalHandler Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_LexicalHandler_INCLUDED
-#define SAX_LexicalHandler_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API LexicalHandler
- /// This is an optional extension handler for SAX2 to provide lexical information
- /// about an XML document, such as comments and CDATA section boundaries.
- /// XML readers are not required to recognize this handler, and it is not part of
- /// core-only SAX2 distributions.
- ///
- /// The events in the lexical handler apply to the entire document, not just to the
- /// document element, and all lexical handler events must appear between the content
- /// handler's startDocument and endDocument events.
- ///
- /// To set the LexicalHandler for an XML reader, use the setProperty method with the
- /// property name http://xml.org/sax/properties/lexical-handler and an object implementing
- /// this interface (or null) as the value. If the reader does not report lexical events,
- /// it will throw a SAXNotRecognizedException when you attempt to register the handler.
-{
-public:
- virtual void startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId) = 0;
- /// Report the start of DTD declarations, if any.
- ///
- /// This method is intended to report the beginning of the DOCTYPE declaration;
- /// if the document has no DOCTYPE declaration, this method will not be invoked.
- ///
- /// All declarations reported through DTDHandler or DeclHandler events must appear
- /// between the startDTD and endDTD events. Declarations are assumed to belong to
- /// the internal DTD subset unless they appear between startEntity and endEntity
- /// events. Comments and processing instructions from the DTD should also be reported
- /// between the startDTD and endDTD events, in their original order of (logical) occurrence;
- /// they are not required to appear in their correct locations relative to DTDHandler or
- /// DeclHandler events, however.
- ///
- /// Note that the start/endDTD events will appear within the start/endDocument events from
- /// ContentHandler and before the first startElement event.
-
- virtual void endDTD() = 0;
- /// Report the end of DTD declarations.
- ///
- /// This method is intended to report the end of the DOCTYPE declaration; if the document
- /// has no DOCTYPE declaration, this method will not be invoked.
-
- virtual void startEntity(const XMLString& name) = 0;
- /// Report the beginning of some internal and external XML entities.
- ///
- /// The reporting of parameter entities (including the external DTD subset) is optional,
- /// and SAX2 drivers that report LexicalHandler events may not implement it; you can use the
- /// http://xml.org/sax/features/lexical-handler/parameter-entities feature to query or control
- /// the reporting of parameter entities.
- ///
- /// General entities are reported with their regular names, parameter entities have '%'
- /// prepended to their names, and the external DTD subset has the pseudo-entity name "[dtd]".
- ///
- /// When a SAX2 driver is providing these events, all other events must be properly nested
- /// within start/end entity events. There is no additional requirement that events from
- /// DeclHandler or DTDHandler be properly ordered.
- ///
- /// Note that skipped entities will be reported through the skippedEntity event, which is part of
- /// the ContentHandler interface.
- ///
- /// Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under
- /// any circumstances:
- ///
- /// * general entities within attribute values
- /// * parameter entities within declarations
- ///
- /// These will be silently expanded, with no indication of where the original entity boundaries were.
- ///
- /// Note also that the boundaries of character references (which are not really entities anyway) are not reported.
- ///
- /// All start/endEntity events must be properly nested.
-
- virtual void endEntity(const XMLString& name) = 0;
- /// Report the end of an entity.
-
- virtual void startCDATA() = 0;
- /// Report the start of a CDATA section.
- ///
- /// The contents of the CDATA section will be reported through the regular characters event;
- /// this event is intended only to report the boundary.
-
- virtual void endCDATA() = 0;
- /// Report the end of a CDATA section.
-
- virtual void comment(const XMLChar ch[], int start, int length) = 0;
- /// Report an XML comment anywhere in the document.
- ///
- /// This callback will be used for comments inside or outside the document element,
- /// including comments in the external DTD subset (if read). Comments in the DTD must
- /// be properly nested inside start/endDTD and start/endEntity events (if used).
-
-protected:
- virtual ~LexicalHandler();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_LexicalHandler_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/Locator.h b/Utilities/Poco/XML/include/Poco/SAX/Locator.h
deleted file mode 100755
index 58baf95f71..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/Locator.h
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// Locator.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX Locator Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_Locator_INCLUDED
-#define SAX_Locator_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API Locator
- /// Interface for associating a SAX event with a document location.
- ///
- /// If a SAX parser provides location information to the SAX application, it does so by
- /// implementing this interface and then passing an instance to the application using the
- /// content handler's setDocumentLocator method. The application can use the object to obtain
- /// the location of any other SAX event in the XML source document.
- ///
- /// Note that the results returned by the object will be valid only during the scope of each
- /// callback method: the application will receive unpredictable results if it attempts to use
- /// the locator at any other time, or after parsing completes.
- ///
- /// SAX parsers are not required to supply a locator, but they are very strongly encouraged to
- /// do so. If the parser supplies a locator, it must do so before reporting any other document
- /// events. If no locator has been set by the time the application receives the startDocument event,
- /// the application should assume that a locator is not available.
-{
-public:
- virtual XMLString getPublicId() const = 0;
- /// Return the public identifier for the current document event.
- ///
- /// The return value is the public identifier of the document entity or of the external
- /// parsed entity in which the markup triggering the event appears.
-
- virtual XMLString getSystemId() const = 0;
- /// Return the system identifier for the current document event.
- ///
- /// The return value is the system identifier of the document entity or of the external
- /// parsed entity in which the markup triggering the event appears.
- ///
- /// If the system identifier is a URL, the parser must resolve it fully before passing
- /// it to the application. For example, a file name must always be provided as a
- /// file:... URL, and other kinds of relative URI are also resolved against their bases.
-
- virtual int getLineNumber() const = 0;
- /// Return the line number where the current document event ends.
- /// Lines are delimited by line ends, which are defined in the XML specification.
- ///
- /// Warning: The return value from the method is intended only as an approximation for
- /// the sake of diagnostics; it is not intended to provide sufficient information to
- /// edit the character content of the original XML document. In some cases, these "line"
- /// numbers match what would be displayed as columns, and in others they may not match the
- /// source text due to internal entity expansion.
- ///
- /// The return value is an approximation of the line number in the document entity or external
- /// parsed entity where the markup triggering the event appears.
- ///
- /// If possible, the SAX driver should provide the line position of the first character after
- /// the text associated with the document event. The first line is line 1.
-
- virtual int getColumnNumber() const = 0;
- /// Return the column number where the current document event ends.
- /// This is one-based number of characters since the last line end.
- ///
- /// Warning: The return value from the method is intended only as an approximation
- /// for the sake of diagnostics; it is not intended to provide sufficient information
- /// to edit the character content of the original XML document. For example, when lines
- /// contain combining character sequences, wide characters, surrogate pairs, or bi-directional
- /// text, the value may not correspond to the column in a text editor's display.
- ///
- /// The return value is an approximation of the column number in the document entity or external
- /// parsed entity where the markup triggering the event appears.
- ///
- /// If possible, the SAX driver should provide the line position of the first character after
- /// the text associated with the document event. The first column in each line is column 1.
-
-protected:
- virtual ~Locator();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_Locator_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/LocatorImpl.h b/Utilities/Poco/XML/include/Poco/SAX/LocatorImpl.h
deleted file mode 100755
index 28a2352431..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/LocatorImpl.h
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// LocatorImpl.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// An implementation of the SAX Locator interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_LocatorImpl_INCLUDED
-#define SAX_LocatorImpl_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/Locator.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API LocatorImpl: public Locator
- /// Provide an optional convenience implementation of Locator.
-{
-public:
- LocatorImpl();
- /// Zero-argument constructor.
- ///
- /// This will not normally be useful, since the main purpose of this class is
- /// to make a snapshot of an existing Locator.
-
- LocatorImpl(const Locator& loc);
- /// Copy constructor.
- ///
- /// Create a persistent copy of the current state of a locator. When the original
- /// locator changes, this copy will still keep the original values (and it can be
- /// used outside the scope of DocumentHandler methods).
-
- ~LocatorImpl();
- /// Destroys the Locator.
-
- LocatorImpl& operator = (const Locator& loc);
- /// Assignment operator.
-
- XMLString getPublicId() const;
- /// Return the saved public identifier.
-
- XMLString getSystemId() const;
- /// Return the saved system identifier.
-
- int getLineNumber() const;
- /// Return the saved line number (1-based).
-
- int getColumnNumber() const;
- /// Return the saved column number (1-based).
-
- void setPublicId(const XMLString& publicId);
- /// Set the public identifier for this locator.
-
- void setSystemId(const XMLString& systemId);
- /// Set the system identifier for this locator.
-
- void setLineNumber(int lineNumber);
- /// Set the line number for this locator (1-based).
-
- void setColumnNumber(int columnNumber);
- /// Set the column number for this locator (1-based).
-
-private:
- XMLString _publicId;
- XMLString _systemId;
- int _lineNumber;
- int _columnNumber;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_LocatorImpl_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/NamespaceSupport.h b/Utilities/Poco/XML/include/Poco/SAX/NamespaceSupport.h
deleted file mode 100755
index e90b50a0d8..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/NamespaceSupport.h
+++ /dev/null
@@ -1,217 +0,0 @@
-//
-// NamespaceSupport.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Namespace support for SAX2.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_NamespaceSupport_INCLUDED
-#define SAX_NamespaceSupport_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-#include <set>
-#include <map>
-#include <vector>
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API NamespaceSupport
- /// Encapsulate Namespace logic for use by SAX drivers.
- /// This class encapsulates the logic of Namespace processing:
- /// it tracks the declarations currently in force for each context and
- /// automatically processes qualified XML 1.0 names into their Namespace
- /// parts; it can also be used in reverse for generating
- /// XML 1.0 from Namespaces.
- /// Namespace support objects are reusable, but the reset method
- /// must be invoked between each session.
-{
-public:
- typedef std::set<XMLString> PrefixSet;
-
- NamespaceSupport();
- /// Creates a NamespaceSupport object.
-
- ~NamespaceSupport();
- /// Destroys a NamespaceSupport object.
-
- bool declarePrefix(const XMLString& prefix, const XMLString& namespaceURI);
- /// Declare a Namespace prefix. All prefixes must be declared before they are
- /// referenced. For example, a SAX driver (parser) would scan an element's attributes
- /// in two passes: first for namespace declarations, then a second pass using
- /// processName() to interpret prefixes against (potentially redefined) prefixes.
- ///
- /// This method declares a prefix in the current Namespace context; the prefix
- /// will remain in force until this context is popped, unless it is shadowed
- /// in a descendant context.
- ///
- /// To declare the default element Namespace, use the empty string as the prefix.
- ///
- /// Note that you must not declare a prefix after you've pushed and popped another
- /// Namespace context, or treated the declarations phase as complete by processing
- /// a prefixed name.
- ///
- /// Returns true if the prefix was legal, false otherwise.
-
- bool undeclarePrefix(const XMLString& prefix);
- /// Remove the given namespace prefix.
-
- void getDeclaredPrefixes(PrefixSet& prefixes) const;
- /// Return an enumeration of all prefixes declared in this context.
- ///
- /// The empty (default) prefix will be included in this enumeration; note that
- /// this behaviour differs from that of getPrefix(java.lang.String) and getPrefixes().
-
- const XMLString& getPrefix(const XMLString& namespaceURI) const;
- /// Return one of the prefixes mapped to a Namespace URI.
- ///
- /// If more than one prefix is currently mapped to the same URI, this method
- /// will make an arbitrary selection; if you want all of the prefixes, use the
- /// getPrefixes() method instead.
-
- bool isMapped(const XMLString& namespaceURI) const;
- /// Returns true if the given namespaceURI has been mapped to a prefix,
- /// false otherwise.
-
- void getPrefixes(PrefixSet& prefixes) const;
- /// Return an enumeration of all prefixes whose declarations are active in the
- /// current context. This includes declarations from parent contexts that have
- /// not been overridden.
- ///
- /// Note: if there is a default prefix, it will not be returned in this enumeration;
- /// check for the default prefix using the getURI with an argument of "".
-
- void getPrefixes(const XMLString& namespaceURI, PrefixSet& prefixes) const;
- /// Return an enumeration of all prefixes for a given URI whose declarations
- /// are active in the current context. This includes declarations from parent
- /// contexts that have not been overridden.
- ///
- /// This method returns prefixes mapped to a specific Namespace URI. The xml:
- /// prefix will be included. If you want only one prefix that's mapped to the
- /// Namespace URI, and you don't care which one you get, use the getPrefix() method
- /// instead.
- ///
- /// Note: the empty (default) prefix is never included in this enumeration;
- /// to check for the presence of a default Namespace, use the getURI() method
- /// with an argument of "".
-
- const XMLString& getURI(const XMLString& prefix) const;
- /// Look up a prefix and get the currently-mapped Namespace URI.
- ///
- /// This method looks up the prefix in the current context. Use the empty string
- /// ("") for the default Namespace.
-
- void pushContext();
- /// Start a new Namespace context. The new context will automatically inherit
- /// the declarations of its parent context, but it will also keep track of which
- /// declarations were made within this context.
- ///
- /// Event callback code should start a new context once per element. This means
- /// being ready to call this in either of two places. For elements that don't
- /// include namespace declarations, the ContentHandler::startElement() callback
- /// is the right place. For elements with such a declaration, it'd done in the
- /// first ContentHandler::startPrefixMapping() callback. A boolean flag can be
- /// used to track whether a context has been started yet. When either of those
- /// methods is called, it checks the flag to see if a new context needs to be
- /// started. If so, it starts the context and sets the flag. After
- /// ContentHandler::startElement() does that, it always clears the flag.
- ///
- /// Normally, SAX drivers would push a new context at the beginning of each
- /// XML element. Then they perform a first pass over the attributes to process
- /// all namespace declarations, making ContentHandler::startPrefixMapping() callbacks.
- /// Then a second pass is made, to determine the namespace-qualified names for
- /// all attributes and for the element name. Finally all the information for
- /// the ContentHandler::startElement() callback is available, so it can then
- /// be made.
- ///
- /// The Namespace support object always starts with a base context already in
- /// force: in this context, only the "xml" prefix is declared.
-
- void popContext();
- /// Revert to the previous Namespace context.
- ///
- /// Normally, you should pop the context at the end of each XML element. After
- /// popping the context, all Namespace prefix mappings that were previously
- /// in force are restored.
- ///
- /// You must not attempt to declare additional Namespace prefixes after popping
- /// a context, unless you push another context first.
-
- bool processName(const XMLString& qname, XMLString& namespaceURI, XMLString& localName, bool isAttribute) const;
- /// Process a raw XML 1.0 name.
- /// This method processes a raw XML 1.0 name in the current context
- /// by removing the prefix and looking it up among the
- /// prefixes currently declared. The result will be returned in
- /// namespaceURI and localName.
- /// If the raw name has a prefix that has not been declared, then the return
- /// value will be false, otherwise true.
- ///
- /// Note that attribute names are processed differently than element names:
- /// an unprefixed element name will received the
- /// default Namespace (if any), while an unprefixed element name will not.
-
- void reset();
- /// Reset this Namespace support object for reuse.
- ///
- /// It is necessary to invoke this method before reusing the Namespace support
- /// object for a new session. If namespace declaration URIs are to be supported,
- /// that flag must also be set to a non-default value.
- /// Reset this Namespace support object for reuse.
-
- static const XMLString XML_NAMESPACE;
- static const XMLString XML_NAMESPACE_PREFIX;
- static const XMLString XMLNS_NAMESPACE;
- static const XMLString XMLNS_NAMESPACE_PREFIX;
-
-private:
- NamespaceSupport(const NamespaceSupport&);
- NamespaceSupport& operator = (const NamespaceSupport&);
-
- typedef std::map<XMLString, XMLString> Context;
- typedef std::vector<Context> ContextVec;
-
- ContextVec _contexts;
-
- static const XMLString EMPTY_STRING;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_NamespaceSupport_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/SAXException.h b/Utilities/Poco/XML/include/Poco/SAX/SAXException.h
deleted file mode 100755
index 54190b7a9b..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/SAXException.h
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// SAXException.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX exception classes.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_SAXException_INCLUDED
-#define SAX_SAXException_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLException.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-POCO_DECLARE_EXCEPTION(XML_API, SAXException, XMLException)
- /// The base class for all SAX-related exceptions like SAXParseException,
- /// SAXNotRecognizedException or SAXNotSupportedException.
- ///
- /// This class can contain basic error or warning information from either the XML parser
- /// or the application: a parser writer or application writer can subclass it to provide
- /// additional functionality. SAX handlers may throw this exception or any exception subclassed
- /// from it.
- ///
- /// If the application needs to pass through other types of exceptions, it must wrap those exceptions
- /// in a SAXException or an exception derived from a SAXException.
- ///
- /// If the parser or application needs to include information about a specific location in an XML
- /// document, it should use the SAXParseException subclass.
-
-
-POCO_DECLARE_EXCEPTION(XML_API, SAXNotRecognizedException, SAXException)
- /// Exception class for an unrecognized identifier.
- ///
- /// An XMLReader will throw this exception when it finds an unrecognized feature or property
- /// identifier; SAX applications and extensions may use this class for other, similar purposes.
-
-
-POCO_DECLARE_EXCEPTION(XML_API, SAXNotSupportedException, SAXException)
- /// Exception class for an unsupported operation.
- ///
- /// An XMLReader will throw this exception when it recognizes a feature or property identifier,
- /// but cannot perform the requested operation (setting a state or value). Other SAX2 applications
- /// and extensions may use this class for similar purposes.
-
-
-class Locator;
-
-
-class XML_API SAXParseException: public SAXException
- /// Encapsulate an XML parse error or warning.
- ///
- /// This exception may include information for locating the error in the original XML document,
- /// as if it came from a Locator object. Note that although the application will receive a
- /// SAXParseException as the argument to the handlers in the ErrorHandler interface, the application
- /// is not actually required to throw the exception; instead, it can simply read the information in it
- /// and take a different action.
- ///
- /// Since this exception is a subclass of SAXException, it inherits the ability to wrap another exception.
-{
-public:
- SAXParseException(const std::string& msg, const Locator& loc);
- /// Create a new SAXParseException from a message and a Locator.
-
- SAXParseException(const std::string& msg, const Locator& loc, const Poco::Exception& exc);
- /// Wrap an existing exception in a SAXParseException.
-
- SAXParseException(const std::string& msg, const XMLString& publicId, const XMLString& systemId, int lineNumber, int columnNumber);
- /// Create a new SAXParseException with an embedded exception.
- ///
- /// This constructor is most useful for parser writers.
- /// All parameters except the message are as if they were provided by a Locator.
- /// For example, if the system identifier is a URL (including relative filename),
- /// the caller must resolve it fully before creating the exception.
-
- SAXParseException(const std::string& msg, const XMLString& publicId, const XMLString& systemId, int lineNumber, int columnNumber, const Poco::Exception& exc);
- /// Create a new SAXParseException.
- ///
- /// This constructor is most useful for parser writers.
- /// All parameters except the message are as if they were provided by a Locator.
- /// For example, if the system identifier is a URL (including relative filename),
- /// the caller must resolve it fully before creating the exception.
-
- SAXParseException(const SAXParseException& exc);
- /// Creates a new SAXParseException from another one.
-
- ~SAXParseException() throw();
- /// Destroy the exception.
-
- SAXParseException& operator = (const SAXParseException& exc);
- /// Assignment operator.
-
- const char* name() const throw();
- /// Returns a static string describing the exception.
-
- const char* className() const throw();
- /// Returns the name of the exception class.
-
- Poco::Exception* clone() const;
- /// Creates an exact copy of the exception.
-
- void rethrow() const;
- /// (Re)Throws the exception.
-
- const XMLString& getPublicId() const;
- /// Get the public identifier of the entity where the exception occurred.
-
- const XMLString& getSystemId() const;
- /// Get the system identifier of the entity where the exception occurred.
-
- int getLineNumber() const;
- /// The line number of the end of the text where the exception occurred.
- /// The first line is line 1.
-
- int getColumnNumber() const;
- /// The column number of the end of the text where the exception occurred.
- /// The first column in a line is position 1.
-
-protected:
- static std::string buildMessage(const std::string& msg, const XMLString& publicId, const XMLString& systemId, int lineNumber, int columnNumber);
-
-private:
- SAXParseException();
-
- XMLString _publicId;
- XMLString _systemId;
- int _lineNumber;
- int _columnNumber;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& SAXParseException::getPublicId() const
-{
- return _publicId;
-}
-
-
-inline const XMLString& SAXParseException::getSystemId() const
-{
- return _systemId;
-}
-
-
-inline int SAXParseException::getLineNumber() const
-{
- return _lineNumber;
-}
-
-
-inline int SAXParseException::getColumnNumber() const
-{
- return _columnNumber;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_SAXException_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/SAXParser.h b/Utilities/Poco/XML/include/Poco/SAX/SAXParser.h
deleted file mode 100755
index 7148b9bc9e..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/SAXParser.h
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// SAXParser.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Implementation of the XMLReader interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_SAXParser_INCLUDED
-#define SAX_SAXParser_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/XMLReader.h"
-#include "Poco/XML/ParserEngine.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API SAXParser: public XMLReader
- /// This class provides a SAX2 (Simple API for XML) interface to expat,
- /// the XML parser toolkit.
- /// The following SAX2 features and properties are supported:
- /// * http://xml.org/sax/features/external-general-entities
- /// * http://xml.org/sax/features/external-parameter-entities
- /// * http://xml.org/sax/features/namespaces
- /// * http://xml.org/sax/features/namespace-prefixes
- /// * http://xml.org/sax/properties/lexical-handler
- /// * http://xml.org/sax/properties/declaration-handler
-{
-public:
- SAXParser();
- /// Creates an SAXParser.
-
- SAXParser(const XMLString& encoding);
- /// Creates an SAXParser with the given encoding.
-
- ~SAXParser();
- /// Destroys the SAXParser.
-
- void setEncoding(const XMLString& encoding);
- /// Sets the encoding used by the parser if no
- /// encoding is specified in the XML document.
-
- const XMLString& getEncoding() const;
- /// Returns the name of the encoding used by
- /// the parser if no encoding is specified in
- /// the XML document.
-
- void addEncoding(const XMLString& name, Poco::TextEncoding* pEncoding);
- /// Adds an encoding to the parser. Does not take ownership of the pointer!
-
- /// XMLReader
- void setEntityResolver(EntityResolver* pResolver);
- EntityResolver* getEntityResolver() const;
- void setDTDHandler(DTDHandler* pDTDHandler);
- DTDHandler* getDTDHandler() const;
- void setContentHandler(ContentHandler* pContentHandler);
- ContentHandler* getContentHandler() const;
- void setErrorHandler(ErrorHandler* pErrorHandler);
- ErrorHandler* getErrorHandler() const;
- void setFeature(const XMLString& featureId, bool state);
- bool getFeature(const XMLString& featureId) const;
- void setProperty(const XMLString& propertyId, const XMLString& value);
- void setProperty(const XMLString& propertyId, void* value);
- void* getProperty(const XMLString& propertyId) const;
- void parse(InputSource* pSource);
- void parse(const XMLString& systemId);
- void parseMemoryNP(const char* xml, std::size_t size);
-
- /// Extensions
- void parseString(const std::string& xml);
-
-protected:
- void setupParse();
-
-private:
- ParserEngine _engine;
- bool _namespaces;
- bool _namespacePrefixes;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_SAXParser_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/WhitespaceFilter.h b/Utilities/Poco/XML/include/Poco/SAX/WhitespaceFilter.h
deleted file mode 100755
index 5f43821e7e..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/WhitespaceFilter.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// WhitespaceFilter.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: WhitespaceFilter
-//
-// Definition of the WhitespaceFilter class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_WhitespaceFilter_INCLUDED
-#define SAX_WhitespaceFilter_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/XMLFilterImpl.h"
-#include "Poco/SAX/LexicalHandler.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API WhitespaceFilter: public XMLFilterImpl, public LexicalHandler
- /// This implementation of the SAX2 XMLFilter interface
- /// filters all whitespace-only character data element
- /// content.
-{
-public:
- WhitespaceFilter();
- /// Creates the WhitespaceFilter, with no parent.
-
- WhitespaceFilter(XMLReader* pReader);
- /// Creates the WhitespaceFilter with the specified parent.
-
- ~WhitespaceFilter();
- /// Destroys the WhitespaceFilter.
-
- // XMLReader
- void setProperty(const XMLString& propertyId, const XMLString& value);
- void setProperty(const XMLString& propertyId, void* value);
- void* getProperty(const XMLString& propertyId) const;
-
- // ContentHandler
- void startDocument();
- void endDocument();
- void startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attrList);
- void endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname);
- void characters(const XMLChar ch[], int start, int length);
- void ignorableWhitespace(const XMLChar ch[], int start, int length);
- void processingInstruction(const XMLString& target, const XMLString& data);
-
- // LexicalHandler
- void startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId);
- void endDTD();
- void startEntity(const XMLString& name);
- void endEntity(const XMLString& name);
- void startCDATA();
- void endCDATA();
- void comment(const XMLChar ch[], int start, int length);
-
-protected:
- void setupParse();
-
-private:
- LexicalHandler* _pLexicalHandler;
- XMLString _data;
- bool _filter;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_WhitespaceFilter_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/XMLFilter.h b/Utilities/Poco/XML/include/Poco/SAX/XMLFilter.h
deleted file mode 100755
index 2b0dd97346..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/XMLFilter.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// XMLFilter.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAXFilters
-//
-// SAX2 XMLFilter Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_XMLFilter_INCLUDED
-#define SAX_XMLFilter_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/XMLReader.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API XMLFilter: public XMLReader
- /// Interface for an XML filter.
- ///
- /// An XML filter is like an XML reader, except that it obtains its events from another XML reader
- /// rather than a primary source like an XML document or database. Filters can modify a stream of
- /// events as they pass on to the final application.
- ///
- /// The XMLFilterImpl helper class provides a convenient base for creating SAX2 filters, by passing on
- /// all EntityResolver, DTDHandler, ContentHandler and ErrorHandler events automatically.
-{
-public:
- virtual XMLReader* getParent() const = 0;
- /// Set the parent reader.
- ///
- /// This method allows the application to link the filter to a parent reader (which may be another
- /// filter). The argument may not be null.
-
- virtual void setParent(XMLReader* pParent) = 0;
- /// Get the parent reader.
- ///
- /// This method allows the application to query the parent reader (which may be another filter).
- /// It is generally a bad idea to perform any operations on the parent reader directly: they should
- /// all pass through this filter.
-
-protected:
- virtual ~XMLFilter();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_XMLFilter_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/XMLFilterImpl.h b/Utilities/Poco/XML/include/Poco/SAX/XMLFilterImpl.h
deleted file mode 100755
index c3cd8d1d25..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/XMLFilterImpl.h
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// XMLFilterImpl.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAXFilters
-//
-// SAX2 XMLFilterImpl class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_XMLFilterImpl_INCLUDED
-#define SAX_XMLFilterImpl_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/XMLFilter.h"
-#include "Poco/SAX/EntityResolver.h"
-#include "Poco/SAX/DTDHandler.h"
-#include "Poco/SAX/ContentHandler.h"
-#include "Poco/SAX/ErrorHandler.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API XMLFilterImpl: public XMLFilter, public EntityResolver, public DTDHandler, public ContentHandler, public ErrorHandler
- /// Base class for deriving an XML filter.
- ///
- /// This class is designed to sit between an XMLReader and the client application's event
- /// handlers. By default, it does nothing but pass requests up to the reader and events on to
- /// the handlers unmodified, but subclasses can override specific methods to modify the event
- /// stream or the configuration requests as they pass through.
-{
-public:
- XMLFilterImpl();
- /// Construct an empty XML filter, with no parent.
- ///
- /// This filter will have no parent: you must assign a parent before you start a parse or do any
- /// configuration with setFeature or setProperty, unless you use this as a pure event consumer rather
- /// than as an XMLReader.
-
- XMLFilterImpl(XMLReader* pParent);
- /// Construct an XML filter with the specified parent.
-
- ~XMLFilterImpl();
- /// Destroys the XMLFilterImpl.
-
- // XMLFilter
- XMLReader* getParent() const;
- void setParent(XMLReader* pParent);
-
- // XMLReader
- void setEntityResolver(EntityResolver* pResolver);
- EntityResolver* getEntityResolver() const;
- void setDTDHandler(DTDHandler* pDTDHandler);
- DTDHandler* getDTDHandler() const;
- void setContentHandler(ContentHandler* pContentHandler);
- ContentHandler* getContentHandler() const;
- void setErrorHandler(ErrorHandler* pErrorHandler);
- ErrorHandler* getErrorHandler() const;
- void setFeature(const XMLString& featureId, bool state);
- bool getFeature(const XMLString& featureId) const;
- void setProperty(const XMLString& propertyId, const XMLString& value);
- void setProperty(const XMLString& propertyId, void* value);
- void* getProperty(const XMLString& propertyId) const;
- void parse(InputSource* pSource);
- void parse(const XMLString& systemId);
- void parseMemoryNP(const char* xml, std::size_t size);
-
- // EntityResolver
- InputSource* resolveEntity(const XMLString* publicId, const XMLString& systemId);
- void releaseInputSource(InputSource* pSource);
-
- // DTDHandler
- void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId);
- void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName);
-
- // ContentHandler
- void setDocumentLocator(const Locator* loc);
- void startDocument();
- void endDocument();
- void startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attrList);
- void endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname);
- void characters(const XMLChar ch[], int start, int length);
- void ignorableWhitespace(const XMLChar ch[], int start, int length);
- void processingInstruction(const XMLString& target, const XMLString& data);
- void startPrefixMapping(const XMLString& prefix, const XMLString& uri);
- void endPrefixMapping(const XMLString& prefix);
- void skippedEntity(const XMLString& prefix);
- void warning(const SAXException& e);
- void error(const SAXException& e);
- void fatalError(const SAXException& e);
-
-protected:
- XMLReader* parent() const;
- /// Return a pointer to the parent reader.
- /// Subclasses can use this method instead of
- /// getParent() for better performance - this method
- /// is non-virtual and implemented as inline.
-
- virtual void setupParse();
- /// Setup the event handlers in the parent reader.
-
-private:
- XMLReader* _pParent;
- EntityResolver* _pEntityResolver;
- DTDHandler* _pDTDHandler;
- ContentHandler* _pContentHandler;
- ErrorHandler* _pErrorHandler;
-};
-
-
-//
-// inlines
-//
-inline XMLReader* XMLFilterImpl::parent() const
-{
- return _pParent;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_XMLFilterImpl_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/SAX/XMLReader.h b/Utilities/Poco/XML/include/Poco/SAX/XMLReader.h
deleted file mode 100755
index c8f092516f..0000000000
--- a/Utilities/Poco/XML/include/Poco/SAX/XMLReader.h
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// XMLReader.h
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// SAX2 XMLReader Interface.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAX_XMLReader_INCLUDED
-#define SAX_XMLReader_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class EntityResolver;
-class DTDHandler;
-class ContentHandler;
-class ErrorHandler;
-class InputSource;
-class LexicalHandler;
-class NamespaceHandler;
-
-
-class XML_API XMLReader
- /// Interface for reading an XML document using callbacks.
- /// XMLReader is the interface that an XML parser's SAX2 driver must
- /// implement. This interface allows an application to set and
- /// query features and properties in the parser, to register event handlers
- /// for document processing, and to initiate a document parse.
- /// All SAX interfaces are assumed to be synchronous: the parse methods must not
- /// return until parsing is complete, and readers
- /// must wait for an event-handler callback to return before reporting the next event.
-{
-public:
- virtual void setEntityResolver(EntityResolver* pResolver) = 0;
- /// Allow an application to register an entity resolver.
- ///
- /// If the application does not register an entity resolver, the
- /// XMLReader will perform its own default resolution.
- ///
- /// Applications may register a new or different resolver in the middle of a
- /// parse, and the SAX parser must begin using the new resolver immediately.
-
- virtual EntityResolver* getEntityResolver() const = 0;
- /// Return the current entity resolver.
-
- virtual void setDTDHandler(DTDHandler* pDTDHandler) = 0;
- /// Allow an application to register a DTD event handler.
- ///
- /// If the application does not register a DTD handler, all DTD events reported by
- /// the SAX parser will be silently ignored.
- ///
- /// Applications may register a new or different handler in the middle of a parse,
- /// and the SAX parser must begin using the new handler immediately.
-
- virtual DTDHandler* getDTDHandler() const = 0;
- /// Return the current DTD handler.
-
- virtual void setContentHandler(ContentHandler* pContentHandler) = 0;
- /// Allow an application to register a content event handler.
- ///
- /// If the application does not register a content handler, all content events
- /// reported by the SAX parser will be silently ignored.
- ///
- /// Applications may register a new or different handler in the middle of a parse,
- /// and the SAX parser must begin using the new handler immediately.
-
- virtual ContentHandler* getContentHandler() const = 0;
- /// Return the current content handler.
-
- virtual void setErrorHandler(ErrorHandler* pErrorHandler) = 0;
- /// Allow an application to register an error event handler.
- ///
- /// If the application does not register an error handler, all error events reported by
- /// the SAX parser will be silently ignored; however, normal processing may not continue.
- /// It is highly recommended that all SAX applications implement an error handler to avoid
- /// unexpected bugs.
- ///
- /// Applications may register a new or different handler in the middle of a parse, and the
- /// SAX parser must begin using the new handler immediately.
-
- virtual ErrorHandler* getErrorHandler() const = 0;
- /// Return the current error handler.
-
- virtual void setFeature(const XMLString& featureId, bool state) = 0;
- /// Set the state of a feature.
- ///
- /// The feature name is any fully-qualified URI. It is possible for an XMLReader to
- /// expose a feature value but to be unable to change the current value. Some feature
- /// values may be immutable or mutable only in specific contexts, such as before, during,
- /// or after a parse.
- ///
- /// All XMLReaders are required to support setting http://xml.org/sax/features/namespaces
- /// to true and http://xml.org/sax/features/namespace-prefixes to false.
-
- virtual bool getFeature(const XMLString& featureId) const = 0;
- /// Look up the value of a feature.
- ///
- /// The feature name is any fully-qualified URI. It is possible for an XMLReader
- /// to recognize a feature name but temporarily be unable to return its value.
- /// Some feature values may be available only in specific contexts, such as before,
- /// during, or after a parse. Also, some feature values may not be programmatically
- /// accessible. (In the case of an adapter for SAX1 Parser, there is no
- /// implementation-independent way to expose whether the underlying parser is performing
- /// validation, expanding external entities, and so forth.)
- ///
- /// All XMLReaders are required to recognize the
- /// http://xml.org/sax/features/namespaces and the
- /// http://xml.org/sax/features/namespace-prefixes feature names.
- /// Implementors are free (and encouraged) to invent their own features,
- /// using names built on their own URIs.
-
- virtual void setProperty(const XMLString& propertyId, const XMLString& value) = 0;
- /// Set the value of a property.
- ///
- /// The property name is any fully-qualified URI. It is possible for an XMLReader
- /// to recognize a property name but to be unable to change the current value.
- /// Some property values may be immutable or mutable only in specific contexts,
- /// such as before, during, or after a parse.
- ///
- /// XMLReaders are not required to recognize setting any specific property names, though a
- /// core set is defined by SAX2.
- ///
- /// This method is also the standard mechanism for setting extended handlers.
-
- virtual void setProperty(const XMLString& propertyId, void* value) = 0;
- /// Set the value of a property.
- /// See also setProperty(const XMLString&, const XMLString&).
-
- virtual void* getProperty(const XMLString& propertyId) const = 0;
- /// Look up the value of a property.
- /// String values are returned as XMLChar*
- /// The property name is any fully-qualified URI. It is possible for an XMLReader to
- /// recognize a property name but temporarily be unable to return its value. Some property
- /// values may be available only in specific contexts, such as before, during, or after a parse.
- ///
- /// XMLReaders are not required to recognize any specific property names, though an initial
- /// core set is documented for SAX2.
- ///
- /// Implementors are free (and encouraged) to invent their own properties, using names
- /// built on their own URIs.
-
- virtual void parse(InputSource* pSource) = 0;
- /// Parse an XML document.
- ///
- /// The application can use this method to instruct the XML reader to begin parsing an
- /// XML document from any valid input source (a character stream, a byte stream, or a URI).
- ///
- /// Applications may not invoke this method while a parse is in progress (they should create
- /// a new XMLReader instead for each nested XML document). Once a parse is complete, an
- /// application may reuse the same XMLReader object, possibly with a different input source.
- /// Configuration of the XMLReader object (such as handler bindings and values established for
- /// feature flags and properties) is unchanged by completion of a parse, unless the definition of that
- /// aspect of the configuration explicitly specifies other behavior. (For example, feature flags or
- /// properties exposing characteristics of the document being parsed.)
- ///
- /// During the parse, the XMLReader will provide information about the XML document through the registered
- /// event handlers.
- ///
- /// This method is synchronous: it will not return until parsing has ended. If a client application
- /// wants to terminate parsing early, it should throw an exception.
-
- virtual void parse(const XMLString& systemId) = 0;
- /// Parse an XML document from a system identifier.
- /// See also parse(InputSource*).
-
- virtual void parseMemoryNP(const char* xml, std::size_t size) = 0;
- /// Parse an XML document from memory.
- /// See also parse(InputSource*).
-
- // SAX Features
- static const XMLString FEATURE_VALIDATION;
- static const XMLString FEATURE_NAMESPACES;
- static const XMLString FEATURE_NAMESPACE_PREFIXES;
- static const XMLString FEATURE_EXTERNAL_GENERAL_ENTITIES;
- static const XMLString FEATURE_EXTERNAL_PARAMETER_ENTITIES;
- static const XMLString FEATURE_STRING_INTERNING;
-
- // SAX Properties
- static const XMLString PROPERTY_DECLARATION_HANDLER;
- static const XMLString PROPERTY_LEXICAL_HANDLER;
-
-protected:
- virtual ~XMLReader();
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // SAX_XMLReader_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/XML/Name.h b/Utilities/Poco/XML/include/Poco/XML/Name.h
deleted file mode 100755
index b87e147be9..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/Name.h
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// Name.h
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: Name
-//
-// Definition of the Name class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XML_Name_INCLUDED
-#define XML_Name_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class XML_API Name
- /// An XML element or attribute name, consisting of a
- /// qualified name, a namespace URI and a local name.
-{
-public:
- Name();
- /// Creates an empty Name.
-
- Name(const XMLString& qname);
- /// Creates a Name from a qualified name only.
-
- Name(const XMLString& qname, const XMLString& namespaceURI);
- /// Creates a Name from a qualified name and a namespace URI.
- /// The local name is extracted from the qualified name.
-
- Name(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName);
- /// Creates a Name from a qualified name, a namespace URI and a local name.
-
- Name(const Name& name);
- /// Copy constructor.
-
- ~Name();
- /// Destroys the name.
-
- Name& operator = (const Name& name);
- /// Assignment operator.
-
- void swap(Name& name);
- /// Swaps the name with another one.
-
- void assign(const XMLString& qname);
- /// Assigns a new value to the name.
-
- void assign(const XMLString& qname, const XMLString& namespaceURI);
- /// Assigns new values to the name.
- /// The local name is extracted from the qualified name.
-
- void assign(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName);
- /// Assigns new values to the name.
-
- bool equals(const Name& name) const;
- /// Returns true if both names are equal.
-
- bool equals(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) const;
- /// Returns true if all the name's components are equal to the given ones.
-
- bool equalsWeakly(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) const;
- /// Returns true if either the qnames are identical or the namespaceURIs and the localNames are identical.
-
- const XMLString& qname() const;
- /// Returns the qualified name.
-
- const XMLString& namespaceURI() const;
- /// Returns the namespace URI.
-
- const XMLString& localName() const;
- /// Returns the local name.
-
- XMLString prefix() const;
- /// Returns the namespace prefix.
-
- static void split(const XMLString& qname, XMLString& prefix, XMLString& localName);
- /// Splits the given qualified name into its prefix and localName parts.
-
- static XMLString localName(const XMLString& qname);
- /// Returns the local name part of the given qualified name.
-
- static XMLString prefix(const XMLString& qname);
- /// Returns the prefix part of the given qualified name.
-
- static const XMLString EMPTY_NAME;
-
-private:
- XMLString _qname;
- XMLString _namespaceURI;
- XMLString _localName;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& Name::qname() const
-{
- return _qname;
-}
-
-
-inline const XMLString& Name::namespaceURI() const
-{
- return _namespaceURI;
-}
-
-
-inline const XMLString& Name::localName() const
-{
- return _localName;
-}
-
-
-inline void swap(Name& n1, Name& n2)
-{
- n1.swap(n2);
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // XML_Name_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/XML/NamePool.h b/Utilities/Poco/XML/include/Poco/XML/NamePool.h
deleted file mode 100755
index 21c0374467..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/NamePool.h
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// NamePool.h
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: NamePool
-//
-// Definition of the NamePool class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XML_NamePool_INCLUDED
-#define XML_NamePool_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/XML/Name.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class NamePoolItem;
-
-
-class XML_API NamePool
- /// A hashtable that stores XML names consisting of an URI, a
- /// local name and a qualified name.
-{
-public:
- NamePool(unsigned long size = 251);
- /// Creates a name pool with room for up to size strings.
-
- const Name& insert(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName);
- /// Returns a const reference to an Name for the given names.
- /// Creates the Name if it does not already exist.
- /// Throws a PoolOverflowException if the name pool is full.
-
- const Name& insert(const Name& name);
- /// Returns a const reference to an Name for the given name.
- /// Creates the Name if it does not already exist.
- /// Throws a PoolOverflowException if the name pool is full.
-
- void duplicate();
- /// Increments the reference count.
-
- void release();
- /// Decrements the reference count and deletes the object if the reference count reaches zero.
-
-protected:
- unsigned long hash(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName);
- ~NamePool();
-
-private:
- NamePool(const NamePool&);
- NamePool& operator = (const NamePool&);
-
- NamePoolItem* _pItems;
- unsigned long _size;
- int _rc;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // XML_NamePool_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/XML/NamespaceStrategy.h b/Utilities/Poco/XML/include/Poco/XML/NamespaceStrategy.h
deleted file mode 100755
index bc71089646..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/NamespaceStrategy.h
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// NamespaceStrategy.h
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: NamespaceStrategy
-//
-// Definition of the NamespaceStrategy class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XML_NamespaceStrategy_INCLUDED
-#define XML_NamespaceStrategy_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/SAX/NamespaceSupport.h"
-#include "Poco/SAX/AttributesImpl.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class ContentHandler;
-
-
-class XML_API NamespaceStrategy
- /// This class is used by ParserEngine to handle the
- /// startElement, endElement, startPrefixMapping and
- /// endPrefixMapping events.
-{
-public:
- virtual ~NamespaceStrategy();
-
- virtual void startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler) = 0;
- /// Translate the arguments as delivered by Expat and
- /// call the startElement() method of the ContentHandler.
-
- virtual void endElement(const XMLChar* name, ContentHandler* pContentHandler) = 0;
- /// Translate the arguments as delivered by Expat and
- /// call the endElement() method of the ContentHandler.
-
-protected:
- static void splitName(const XMLChar* qname, XMLString& uri, XMLString& localName);
- static void splitName(const XMLChar* qname, XMLString& uri, XMLString& localName, XMLString& prefix);
-
- static const XMLString NOTHING;
-};
-
-
-class XML_API NoNamespacesStrategy: public NamespaceStrategy
- /// The NamespaceStrategy implementation used if no namespaces
- /// processing is requested.
-{
-public:
- NoNamespacesStrategy();
- ~NoNamespacesStrategy();
-
- void startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler);
- void endElement(const XMLChar* name, ContentHandler* pContentHandler);
-
-private:
- XMLString _name;
- AttributesImpl _attrs;
-};
-
-
-class XML_API NoNamespacePrefixesStrategy: public NamespaceStrategy
- /// The NamespaceStrategy implementation used if namespaces
- /// processing is requested, but prefixes are not reported.
-{
-public:
- NoNamespacePrefixesStrategy();
- ~NoNamespacePrefixesStrategy();
-
- void startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler);
- void endElement(const XMLChar* name, ContentHandler* pContentHandler);
-
-private:
- XMLString _uri;
- XMLString _local;
- AttributesImpl _attrs;
-};
-
-
-class XML_API NamespacePrefixesStrategy: public NamespaceStrategy
- /// The NamespaceStrategy implementation used if namespaces
- /// processing is requested and prefixes are reported.
-{
-public:
- NamespacePrefixesStrategy();
- ~NamespacePrefixesStrategy();
-
- void startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler);
- void endElement(const XMLChar* name, ContentHandler* pContentHandler);
-
-private:
- XMLString _uri;
- XMLString _local;
- XMLString _qname;
- AttributesImpl _attrs;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // XML_NamespaceStrategy_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/XML/ParserEngine.h b/Utilities/Poco/XML/include/Poco/XML/ParserEngine.h
deleted file mode 100755
index dafa18bbd6..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/ParserEngine.h
+++ /dev/null
@@ -1,343 +0,0 @@
-//
-// ParserEngine.h
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: ParserEngine
-//
-// Definition of the ParseEngine class.
-//
-// Copyright (c) 2004-2006, 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.
-
-
-#ifndef XML_ParserEngine_INCLUDED
-#define XML_ParserEngine_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/XML/expat.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/XML/XMLStream.h"
-#include "Poco/SAX/Locator.h"
-#include "Poco/TextEncoding.h"
-#include <map>
-#include <vector>
-
-
-namespace Poco {
-namespace XML {
-
-
-class InputSource;
-class EntityResolver;
-class DTDHandler;
-class DeclHandler;
-class ContentHandler;
-class LexicalHandler;
-class ErrorHandler;
-class NamespaceStrategy;
-class ContextLocator;
-
-
-class XML_API ParserEngine: public Locator
- /// This class provides an object-oriented, stream-based,
- /// low-level interface to the XML Parser Toolkit (expat).
- /// It is strongly recommended, that you use the
- /// SAX parser classes (which are based on this
- /// class) instead of this class, since they provide
- /// a standardized, higher-level interface to the parser.
-{
-public:
- ParserEngine();
- /// Creates the parser engine.
-
- ParserEngine(const XMLString& encoding);
- /// Creates the parser engine and passes the encoding
- /// to the underlying parser.
-
- ~ParserEngine();
- /// Destroys the parser.
-
- void setEncoding(const XMLString& encoding);
- /// Sets the encoding used by expat. The encoding must be
- /// set before parsing begins, otherwise it will be ignored.
-
- const XMLString& getEncoding() const;
- /// Returns the encoding used by expat.
-
- void addEncoding(const XMLString& name, Poco::TextEncoding* pEncoding);
- /// Adds an encoding to the parser.
-
- void setNamespaceStrategy(NamespaceStrategy* pStrategy);
- /// Sets the NamespaceStrategy used by the parser.
- /// The parser takes ownership of the strategy object
- /// and deletes it when it's no longer needed.
- /// The default is NoNamespacesStrategy.
-
- NamespaceStrategy* getNamespaceStrategy() const;
- /// Returns the NamespaceStrategy currently in use.
-
- void setExpandInternalEntities(bool flag = true);
- /// Enables/disables expansion of internal entities (enabled by
- /// default). If entity expansion is disabled, internal entities
- /// are reported via the default handler.
- /// Must be set before parsing begins, otherwise it will be
- /// ignored.
-
- bool getExpandInternalEntities() const;
- /// Returns true if internal entities will be expanded automatically,
- /// which is the default.
-
- void setExternalGeneralEntities(bool flag = true);
- /// Enable or disable processing of external general entities.
-
- bool getExternalGeneralEntities() const;
- /// Returns true if external general entities will be processed; false otherwise.
-
- void setExternalParameterEntities(bool flag = true);
- /// Enable or disable processing of external parameter entities.
-
- bool getExternalParameterEntities() const;
- /// Returns true if external parameter entities will be processed; false otherwise.
-
- void setEntityResolver(EntityResolver* pResolver);
- /// Allow an application to register an entity resolver.
-
- EntityResolver* getEntityResolver() const;
- /// Return the current entity resolver.
-
- void setDTDHandler(DTDHandler* pDTDHandler);
- /// Allow an application to register a DTD event handler.
-
- DTDHandler* getDTDHandler() const;
- /// Return the current DTD handler.
-
- void setDeclHandler(DeclHandler* pDeclHandler);
- /// Allow an application to register a DTD declarations event handler.
-
- DeclHandler* getDeclHandler() const;
- /// Return the current DTD declarations handler.
-
- void setContentHandler(ContentHandler* pContentHandler);
- /// Allow an application to register a content event handler.
-
- ContentHandler* getContentHandler() const;
- /// Return the current content handler.
-
- void setLexicalHandler(LexicalHandler* pLexicalHandler);
- /// Allow an application to register a lexical event handler.
-
- LexicalHandler* getLexicalHandler() const;
- /// Return the current lexical handler.
-
- void setErrorHandler(ErrorHandler* pErrorHandler);
- /// Allow an application to register an error event handler.
-
- ErrorHandler* getErrorHandler() const;
- /// Return the current error handler.
-
- void parse(InputSource* pInputSource);
- /// Parse an XML document from the given InputSource.
-
- void parse(const char* pBuffer, std::size_t size);
- /// Parses an XML document from the given buffer.
-
- // Locator
- XMLString getPublicId() const;
- /// Return the public identifier for the current document event.
-
- XMLString getSystemId() const;
- /// Return the system identifier for the current document event.
-
- int getLineNumber() const;
- /// Return the line number where the current document event ends.
-
- int getColumnNumber() const;
- /// Return the column number where the current document event ends.
-
-protected:
- void init();
- /// initializes expat
-
- void parseByteInputStream(XMLByteInputStream& istr);
- /// Parses an entity from the given stream.
-
- void parseCharInputStream(XMLCharInputStream& istr);
- /// Parses an entity from the given stream.
-
- void handleError(int errorNo);
- /// Throws an XMLException with a message corresponding
- /// to the given Expat error code.
-
- void parseExternal(XML_Parser extParser, InputSource* pInputSource);
- /// Parse an XML document from the given InputSource.
-
- void parseExternalByteInputStream(XML_Parser extParser, XMLByteInputStream& istr);
- /// Parses an external entity from the given stream, with a separate parser.
-
- void parseExternalCharInputStream(XML_Parser extParser, XMLCharInputStream& istr);
- /// Parses an external entity from the given stream, with a separate parser.
-
- void pushContext(XML_Parser parser, InputSource* pInputSource);
- /// Pushes a new entry to the context stack.
-
- void popContext();
- /// Pops the top-most entry from the context stack.
-
- void resetContext();
- /// Resets and clears the context stack.
-
- const Locator& locator() const;
- /// Returns a locator denoting the current parse location.
-
- // expat handler procedures
- static void handleStartElement(void* userData, const XML_Char* name, const XML_Char** atts);
- static void handleEndElement(void* userData, const XML_Char* name);
- static void handleCharacterData(void* userData, const XML_Char* s, int len);
- static void handleProcessingInstruction(void* userData, const XML_Char* target, const XML_Char* data);
- static void handleDefault(void* userData, const XML_Char* s, int len);
- static void handleUnparsedEntityDecl(void* userData, const XML_Char* entityName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId, const XML_Char* notationName);
- static void handleNotationDecl(void* userData, const XML_Char* notationName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId);
- static int handleExternalEntityRef(XML_Parser parser, const XML_Char* openEntityNames, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId);
- static int handleUnknownEncoding(void* encodingHandlerData, const XML_Char* name, XML_Encoding* info);
- static void handleComment(void* userData, const XML_Char* data);
- static void handleStartCdataSection(void* userData);
- static void handleEndCdataSection(void* userData);
- static void handleStartNamespaceDecl(void* userData, const XML_Char* prefix, const XML_Char* uri);
- static void handleEndNamespaceDecl(void* userData, const XML_Char* prefix);
- static void handleStartDoctypeDecl(void* userData, const XML_Char* doctypeName, const XML_Char *systemId, const XML_Char* publicId, int hasInternalSubset);
- static void handleEndDoctypeDecl(void* userData);
- static void handleEntityDecl(void *userData, const XML_Char *entityName, int isParamEntity, const XML_Char *value, int valueLength,
- const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName);
- static void handleExternalParsedEntityDecl(void* userData, const XML_Char* entityName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId);
- static void handleInternalParsedEntityDecl(void* userData, const XML_Char* entityName, const XML_Char* replacementText, int replacementTextLength);
- static void handleSkippedEntity(void* userData, const XML_Char* entityName, int isParameterEntity);
-
- // encoding support
- static int convert(void *data, const char *s);
-
-private:
- typedef std::map<XMLString, Poco::TextEncoding*> EncodingMap;
- typedef std::vector<ContextLocator*> ContextStack;
-
- XML_Parser _parser;
- char* _pBuffer;
- bool _encodingSpecified;
- XMLString _encoding;
- bool _expandInternalEntities;
- bool _externalGeneralEntities;
- bool _externalParameterEntities;
- NamespaceStrategy* _pNamespaceStrategy;
- EncodingMap _encodings;
- ContextStack _context;
-
- EntityResolver* _pEntityResolver;
- DTDHandler* _pDTDHandler;
- DeclHandler* _pDeclHandler;
- ContentHandler* _pContentHandler;
- LexicalHandler* _pLexicalHandler;
- ErrorHandler* _pErrorHandler;
-
- static const int PARSE_BUFFER_SIZE;
- static const XMLString EMPTY_STRING;
-};
-
-
-//
-// inlines
-//
-inline const XMLString& ParserEngine::getEncoding() const
-{
- return _encoding;
-}
-
-
-inline NamespaceStrategy* ParserEngine::getNamespaceStrategy() const
-{
- return _pNamespaceStrategy;
-}
-
-
-inline bool ParserEngine::getExpandInternalEntities() const
-{
- return _expandInternalEntities;
-}
-
-
-inline bool ParserEngine::getExternalGeneralEntities() const
-{
- return _externalGeneralEntities;
-}
-
-
-inline bool ParserEngine::getExternalParameterEntities() const
-{
- return _externalParameterEntities;
-}
-
-
-inline EntityResolver* ParserEngine::getEntityResolver() const
-{
- return _pEntityResolver;
-}
-
-
-inline DTDHandler* ParserEngine::getDTDHandler() const
-{
- return _pDTDHandler;
-}
-
-
-inline DeclHandler* ParserEngine::getDeclHandler() const
-{
- return _pDeclHandler;
-}
-
-
-inline ContentHandler* ParserEngine::getContentHandler() const
-{
- return _pContentHandler;
-}
-
-
-inline LexicalHandler* ParserEngine::getLexicalHandler() const
-{
- return _pLexicalHandler;
-}
-
-
-inline ErrorHandler* ParserEngine::getErrorHandler() const
-{
- return _pErrorHandler;
-}
-
-
-} } // namespace Poco::XML
-
-
-#endif // XML_ParserEngine_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/XML/XML.h b/Utilities/Poco/XML/include/Poco/XML/XML.h
deleted file mode 100755
index 56025fa753..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/XML.h
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// XML.h
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: XML
-//
-// Basic definitions for the Poco XML library.
-// This file must be the first file included by every other XML
-// header file.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XML_XML_INCLUDED
-#define XML_XML_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-
-//
-// The following block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the XML_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// XML_API functions as being imported from a DLL, wheras this DLL sees symbols
-// defined with this macro as being exported.
-//
-#if defined(_WIN32) && defined(POCO_DLL)
- #if defined(XML_EXPORTS)
- #define XML_API __declspec(dllexport)
- #else
- #define XML_API __declspec(dllimport)
- #endif
-#endif
-
-
-#if !defined(XML_API)
- #define XML_API
-#endif
-
-
-//
-// Automatically link XML library.
-//
-#if defined(_MSC_VER)
- #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(XML_EXPORTS)
- #if defined(POCO_DLL)
- #if defined(_DEBUG)
- #pragma comment(lib, "PocoXMLd.lib")
- #else
- #pragma comment(lib, "PocoXML.lib")
- #endif
- #else
- #if defined(_DEBUG)
- #pragma comment(lib, "PocoXMLmtd.lib")
- #else
- #pragma comment(lib, "PocoXMLmt.lib")
- #endif
- #endif
- #endif
-#endif
-
-
-#endif // XML_XML_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/XML/XMLException.h b/Utilities/Poco/XML/include/Poco/XML/XMLException.h
deleted file mode 100755
index c89e1f81c8..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/XMLException.h
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// XMLException.h
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: XMLException
-//
-// Definition of the XMLException class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XML_XMLException_INCLUDED
-#define XML_XMLException_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-POCO_DECLARE_EXCEPTION(XML_API, XMLException, Poco::RuntimeException)
- /// The base class for all XML-related exceptions like SAXException
- /// and DOMException.
-
-
-} } // namespace Poco::XML
-
-
-#endif // XML_XMLException_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/XML/XMLStream.h b/Utilities/Poco/XML/include/Poco/XML/XMLStream.h
deleted file mode 100755
index a474fe2105..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/XMLStream.h
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// XMLStream.h
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: XMLStream
-//
-// Definition of the XMLByteInputStream and XMLCharInputStream classes.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XML_XMLStream_INCLUDED
-#define XML_XMLStream_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-namespace XML {
-
-
-// The byte input stream is always a narrow stream.
-typedef std::istream XMLByteInputStream;
-typedef std::ostream XMLByteOutputStream;
-
-
-//
-// The XML parser uses the stream classes provided by the C++
-// standard library (based on the basic_stream<> template).
-// In Unicode mode, a wide stream is used.
-// To turn on Unicode mode, #define XML_UNICODE and
-// XML_UNICODE_WCHAR_T when compiling the library.
-//
-// XML_UNICODE XML_UNICODE_WCHAR_T XMLCharInputStream XMLCharOutputStream
-// -------------------------------------------------------------------------
-// N N std::istream std::ostream
-// N Y std::wistream std::wostream
-// Y Y std::wistream std::wostream
-// Y N <not supported>
-//
-#if defined(XML_UNICODE_WCHAR_T)
-
- // Unicode - use wide streams
- typedef std::wistream XMLCharInputStream;
- typedef std::wostream XMLCharOutputStream;
-
-#elif defined(XML_UNICODE)
-
- // not supported - leave XMLString undefined
-
-#else
-
- // Characters are UTF-8 encoded
- typedef std::istream XMLCharInputStream;
- typedef std::ostream XMLCharOutputStream;
-
-#endif
-
-
-} } // namespace Poco::XML
-
-
-#endif // XML_XMLStream_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/XML/XMLString.h b/Utilities/Poco/XML/include/Poco/XML/XMLString.h
deleted file mode 100755
index b8e0579160..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/XMLString.h
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// XMLString.h
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: XMLString
-//
-// Definition of the XMLString class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XML_XMLString_INCLUDED
-#define XML_XMLString_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-//
-// The XML parser uses the string classes provided by the C++
-// standard library (based on the basic_string<> template).
-// In Unicode mode, a std::wstring is used, otherwise
-// a std::string is used.
-// To turn on Unicode mode, #define XML_UNICODE and
-// XML_UNICODE_WCHAR_T when compiling the library.
-//
-// XML_UNICODE XML_UNICODE_WCHAR_T XMLChar XMLString
-// --------------------------------------------------------------
-// N N char std::string
-// N Y wchar_t std::wstring
-// Y Y wchar_t std::wstring
-// Y N <not supported>
-//
-#if defined(XML_UNICODE_WCHAR_T)
-
- // Unicode - use wchar_t
- typedef wchar_t XMLChar;
- typedef std::wstring XMLString;
-
- std::string fromXMLString(const XMLString& str);
- /// Converts an XMLString into an UTF-8 encoded
- /// string.
-
- XMLString toXMLString(const std::string& str);
- /// Converts an UTF-8 encoded string into an
- /// XMLString
-
- #define XML_LIT(lit) L##lit
-
-#elif defined(XML_UNICODE)
-
- // not supported - leave XMLString undefined
-
-#else
-
- // Characters are UTF-8 encoded
- typedef char XMLChar;
- typedef std::string XMLString;
-
- inline const std::string& fromXMLString(const XMLString& str)
- {
- return str;
- }
-
- inline const XMLString& toXMLString(const std::string& str)
- {
- return str;
- }
-
- #define XML_LIT(lit) lit
-
-#endif
-
-
-} } // namespace Poco::XML
-
-
-#endif // XML_XMLString_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/XML/XMLWriter.h b/Utilities/Poco/XML/include/Poco/XML/XMLWriter.h
deleted file mode 100755
index 5cb064d332..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/XMLWriter.h
+++ /dev/null
@@ -1,331 +0,0 @@
-//
-// XMLWriter.h
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: XMLWriter
-//
-// Definition of the XMLWriter class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XML_XMLWriter_INCLUDED
-#define XML_XMLWriter_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "Poco/SAX/ContentHandler.h"
-#include "Poco/SAX/LexicalHandler.h"
-#include "Poco/SAX/DTDHandler.h"
-#include "Poco/SAX/NamespaceSupport.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/XML/XMLStream.h"
-#include "Poco/XML/Name.h"
-#include "Poco/TextEncoding.h"
-#include "Poco/StreamConverter.h"
-#include <vector>
-#include <map>
-
-
-namespace Poco {
-namespace XML {
-
-
-class Locator;
-
-
-class XML_API XMLWriter: public ContentHandler, public LexicalHandler, public DTDHandler
- /// This class serializes SAX2 ContentHandler, LexicalHandler and
- /// DTDHandler events back into a stream.
- ///
- /// Various consistency checks are performed on the written data
- /// (i.e. there must be exactly one root element and every startElement()
- /// must have a matching endElement()).
- ///
- /// The XMLWriter supports optional pretty-printing of the serialized XML.
- /// Note, however, that pretty-printing XML data alters the
- /// information set of the document being written, since in
- /// XML all whitespace is potentially relevant to an application.
- ///
- /// The writer contains extensive support for XML Namespaces, so that a client
- /// application does not have to keep track of prefixes and supply xmlns attributes.
- ///
- /// If the client does not provide namespace prefixes (either by specifying them
- /// as part of the qualified name given to startElement(), or by calling
- /// startPrefixMapping()), the XMLWriter automatically generates namespace
- /// prefixes in the form ns1, ns2, etc.
-{
-public:
- enum Options
- {
- CANONICAL = 0x00, /// do not write an XML declaration
- WRITE_XML_DECLARATION = 0x01, /// write an XML declaration
- PRETTY_PRINT = 0x02 /// pretty-print XML markup
- };
-
- XMLWriter(XMLByteOutputStream& str, int options);
- /// Creates the XMLWriter and sets the specified options.
- ///
- /// The resulting stream will be UTF-8 encoded.
-
- XMLWriter(XMLByteOutputStream& str, int options, const std::string& encodingName, Poco::TextEncoding& textEncoding);
- /// Creates the XMLWriter and sets the specified options.
- ///
- /// The encoding is reflected in the XML declaration.
- /// The caller is responsible for that the given encodingName matches with
- /// the given textEncoding.
-
- XMLWriter(XMLByteOutputStream& str, int options, const std::string& encodingName, Poco::TextEncoding* pTextEncoding);
- /// Creates the XMLWriter and sets the specified options.
- ///
- /// The encoding is reflected in the XML declaration.
- /// The caller is responsible for that the given encodingName matches with
- /// the given textEncoding.
- /// If pTextEncoding is null, the given encodingName is ignored and the
- /// default UTF-8 encoding is used.
-
- ~XMLWriter();
- /// Destroys the XMLWriter.
-
- void setNewLine(const std::string& newLineCharacters);
- /// Sets the line ending for the resulting XML file.
- ///
- /// Possible values are:
- /// * NEWLINE_DEFAULT (whatever is appropriate for the current platform)
- /// * NEWLINE_CRLF (Windows),
- /// * NEWLINE_LF (Unix),
- /// * NEWLINE_CR (Macintosh)
-
- const std::string& getNewLine() const;
- /// Returns the line ending currently in use.
-
- // ContentHandler
- void setDocumentLocator(const Locator* loc);
- /// Currently unused.
-
- void startDocument();
- /// Writes a generic XML declaration to the stream.
- /// If a document type has been set (see SetDocumentType),
- /// a DOCTYPE declaration is also written.
-
- void endDocument();
- /// Checks that all elements are closed and prints a final newline.
-
- void startFragment();
- /// Use this instead of StartDocument() if you want to write
- /// a fragment rather than a document (no XML declaration and
- /// more than one "root" element allowed).
-
- void endFragment();
- /// Checks that all elements are closed and prints a final newline.
-
- void startElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const Attributes& attributes);
- /// Writes an XML start element tag.
- ///
- /// Namespaces are handled as follows.
- /// 1. If a qname, but no namespaceURI and localName are given, the qname is taken as element name.
- /// 2. If a namespaceURI and a localName, but no qname is given, and the given namespaceURI has been
- /// declared earlier, the namespace prefix for the given namespaceURI together with the localName
- /// is taken as element name. If the namespace has not been declared, a prefix in the form
- /// "ns1", "ns2", etc. is generated and the namespace is declared with the generated prefix.
- /// 3. If all three are given, and the namespace given in namespaceURI has not been declared, it is declared now.
- /// Otherwise, see 2.
-
- void startElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname);
- /// Writes an XML start element tag with no attributes.
- /// See the other startElement() method for more information.
-
- void endElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname);
- /// Writes an XML end element tag.
- ///
- /// Throws an exception if the name of doesn't match the
- /// one of the most recent startElement().
-
- void emptyElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname);
- /// Writes an empty XML element tag (<elem/>).
-
- void emptyElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const Attributes& attributes);
- /// Writes an empty XML element tag with the given attributes (<elem attr1="value1"... />).
-
- void characters(const XMLChar ch[], int start, int length);
- /// Writes XML character data. Quotes, ampersand's, less-than and
- /// greater-than signs are escaped, unless a CDATA section
- /// has been opened by calling startCDATA().
- ///
- /// The characters must be encoded in UTF-8 (if XMLChar is char) or
- /// UTF-16 (if XMLChar is wchar_t).
-
- void characters(const XMLString& str);
- /// Writes XML character data. Quotes, ampersand's, less-than and
- /// greater-than signs are escaped, unless a CDATA section
- /// has been opened by calling startCDATA().
- ///
- /// The characters must be encoded in UTF-8 (if XMLChar is char) or
- /// UTF-16 (if XMLChar is wchar_t).
-
- void rawCharacters(const XMLString& str);
- /// Writes the characters in the given string as they are.
- /// The caller is responsible for escaping characters as
- /// necessary to produce valid XML.
- ///
- /// The characters must be encoded in UTF-8 (if XMLChar is char) or
- /// UTF-16 (if XMLChar is wchar_t).
-
- void ignorableWhitespace(const XMLChar ch[], int start, int length);
- /// Writes whitespace characters by simply passing them to
- /// characters().
-
- void processingInstruction(const XMLString& target, const XMLString& data);
- /// Writes a processing instruction.
-
- void startPrefixMapping(const XMLString& prefix, const XMLString& namespaceURI);
- /// Begin the scope of a prefix-URI Namespace mapping.
- /// A namespace declaration is written with the next element.
-
- void endPrefixMapping(const XMLString& prefix);
- /// End the scope of a prefix-URI mapping.
-
- void skippedEntity(const XMLString& name);
- /// Does nothing.
-
- void dataElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& data,
- const XMLString& attr1 = XMLString(), const XMLString& value1 = XMLString(),
- const XMLString& attr2 = XMLString(), const XMLString& value2 = XMLString(),
- const XMLString& attr3 = XMLString(), const XMLString& value3 = XMLString());
- /// Writes a data element in the form <name attr1="value1"...>data</name>.
-
- // LexicalHandler
- void startCDATA();
- /// Writes the <![CDATA[ string that begins a CDATA section.
- /// Use characters() to write the actual character data.
-
- void endCDATA();
- /// Writes the ]]> string that ends a CDATA section.
-
- void comment(const XMLChar ch[], int start, int length);
- /// Writes a comment.
-
- void startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId);
- /// Writes a DTD declaration.
-
- void endDTD();
- /// Writes the closing characters of a DTD declaration.
-
- void startEntity(const XMLString& name);
- /// Does nothing.
-
- void endEntity(const XMLString& name);
- /// Does nothing.
-
- // DTDHandler
- void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId);
- void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName);
-
- static const std::string NEWLINE_DEFAULT;
- static const std::string NEWLINE_CR;
- static const std::string NEWLINE_CRLF;
- static const std::string NEWLINE_LF;
-
-protected:
- typedef std::map<XMLString, XMLString> AttributeMap;
-
- void writeStartElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const Attributes& attributes);
- void writeEndElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname);
- void writeMarkup(const std::string& str) const;
- void writeXML(const XMLString& str) const;
- void writeXML(XMLChar ch) const;
- void writeNewLine() const;
- void writeIndent() const;
- void writeName(const XMLString& prefix, const XMLString& localName);
- void writeXMLDeclaration();
- void closeStartTag();
- void declareAttributeNamespaces(const Attributes& attributes);
- void addNamespaceAttributes(AttributeMap& attributeMap);
- void addAttributes(AttributeMap& attributeMap, const Attributes& attributes, const XMLString& elementNamespaceURI);
- void writeAttributes(const AttributeMap& attributeMap);
- void prettyPrint() const;
- XMLString newPrefix();
- static std::string nameToString(const XMLString& localName, const XMLString& qname);
-
-private:
- struct Namespace
- {
- Namespace(const XMLString& thePrefix, const XMLString& theNamespaceURI):
- prefix(thePrefix),
- namespaceURI(theNamespaceURI)
- {
- }
-
- XMLString prefix;
- XMLString namespaceURI;
- };
- typedef std::vector<Name> ElementStack;
-
- Poco::OutputStreamConverter* _pTextConverter;
- Poco::TextEncoding* _pInEncoding;
- Poco::TextEncoding* _pOutEncoding;
- int _options;
- std::string _encoding;
- std::string _newLine;
- int _depth;
- int _elementCount;
- bool _inFragment;
- bool _inCDATA;
- bool _inDTD;
- bool _inInternalDTD;
- bool _contentWritten;
- bool _unclosedStartTag;
- ElementStack _elementStack;
- NamespaceSupport _namespaces;
- int _prefix;
-
- static const std::string MARKUP_QUOTENC;
- static const std::string MARKUP_APOSENC;
- static const std::string MARKUP_AMPENC;
- static const std::string MARKUP_LTENC;
- static const std::string MARKUP_GTENC;
- static const std::string MARKUP_LT;
- static const std::string MARKUP_GT;
- static const std::string MARKUP_SLASHGT;
- static const std::string MARKUP_LTSLASH;
- static const std::string MARKUP_COLON;
- static const std::string MARKUP_EQQUOT;
- static const std::string MARKUP_QUOT;
- static const std::string MARKUP_SPACE;
- static const std::string MARKUP_TAB;
- static const std::string MARKUP_BEGIN_CDATA;
- static const std::string MARKUP_END_CDATA;
-};
-
-
-} } // namespace Poco::XML
-
-
-#endif // XML_XMLWriter_INCLUDED
diff --git a/Utilities/Poco/XML/include/Poco/XML/expat.h b/Utilities/Poco/XML/include/Poco/XML/expat.h
deleted file mode 100755
index 20a8278f78..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/expat.h
+++ /dev/null
@@ -1,1014 +0,0 @@
-/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-#ifndef Expat_INCLUDED
-#define Expat_INCLUDED 1
-
-#ifdef __VMS
-/* 0 1 2 3 0 1 2 3
- 1234567890123456789012345678901 1234567890123456789012345678901 */
-#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler
-#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler
-#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler
-#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg
-#endif
-
-#include <stdlib.h>
-#include "expat_external.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct XML_ParserStruct;
-typedef struct XML_ParserStruct *XML_Parser;
-
-/* Should this be defined using stdbool.h when C99 is available? */
-typedef unsigned char XML_Bool;
-#define XML_TRUE ((XML_Bool) 1)
-#define XML_FALSE ((XML_Bool) 0)
-
-/* The XML_Status enum gives the possible return values for several
- API functions. The preprocessor #defines are included so this
- stanza can be added to code that still needs to support older
- versions of Expat 1.95.x:
-
- #ifndef XML_STATUS_OK
- #define XML_STATUS_OK 1
- #define XML_STATUS_ERROR 0
- #endif
-
- Otherwise, the #define hackery is quite ugly and would have been
- dropped.
-*/
-enum XML_Status {
- XML_STATUS_ERROR = 0,
-#define XML_STATUS_ERROR XML_STATUS_ERROR
- XML_STATUS_OK = 1,
-#define XML_STATUS_OK XML_STATUS_OK
- XML_STATUS_SUSPENDED = 2
-#define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED
-};
-
-enum XML_Error {
- XML_ERROR_NONE,
- XML_ERROR_NO_MEMORY,
- XML_ERROR_SYNTAX,
- XML_ERROR_NO_ELEMENTS,
- XML_ERROR_INVALID_TOKEN,
- XML_ERROR_UNCLOSED_TOKEN,
- XML_ERROR_PARTIAL_CHAR,
- XML_ERROR_TAG_MISMATCH,
- XML_ERROR_DUPLICATE_ATTRIBUTE,
- XML_ERROR_JUNK_AFTER_DOC_ELEMENT,
- XML_ERROR_PARAM_ENTITY_REF,
- XML_ERROR_UNDEFINED_ENTITY,
- XML_ERROR_RECURSIVE_ENTITY_REF,
- XML_ERROR_ASYNC_ENTITY,
- XML_ERROR_BAD_CHAR_REF,
- XML_ERROR_BINARY_ENTITY_REF,
- XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF,
- XML_ERROR_MISPLACED_XML_PI,
- XML_ERROR_UNKNOWN_ENCODING,
- XML_ERROR_INCORRECT_ENCODING,
- XML_ERROR_UNCLOSED_CDATA_SECTION,
- XML_ERROR_EXTERNAL_ENTITY_HANDLING,
- XML_ERROR_NOT_STANDALONE,
- XML_ERROR_UNEXPECTED_STATE,
- XML_ERROR_ENTITY_DECLARED_IN_PE,
- XML_ERROR_FEATURE_REQUIRES_XML_DTD,
- XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING,
- /* Added in 1.95.7. */
- XML_ERROR_UNBOUND_PREFIX,
- /* Added in 1.95.8. */
- XML_ERROR_UNDECLARING_PREFIX,
- XML_ERROR_INCOMPLETE_PE,
- XML_ERROR_XML_DECL,
- XML_ERROR_TEXT_DECL,
- XML_ERROR_PUBLICID,
- XML_ERROR_SUSPENDED,
- XML_ERROR_NOT_SUSPENDED,
- XML_ERROR_ABORTED,
- XML_ERROR_FINISHED,
- XML_ERROR_SUSPEND_PE,
- /* Added in 2.0. */
- XML_ERROR_RESERVED_PREFIX_XML,
- XML_ERROR_RESERVED_PREFIX_XMLNS,
- XML_ERROR_RESERVED_NAMESPACE_URI
-};
-
-enum XML_Content_Type {
- XML_CTYPE_EMPTY = 1,
- XML_CTYPE_ANY,
- XML_CTYPE_MIXED,
- XML_CTYPE_NAME,
- XML_CTYPE_CHOICE,
- XML_CTYPE_SEQ
-};
-
-enum XML_Content_Quant {
- XML_CQUANT_NONE,
- XML_CQUANT_OPT,
- XML_CQUANT_REP,
- XML_CQUANT_PLUS
-};
-
-/* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be
- XML_CQUANT_NONE, and the other fields will be zero or NULL.
- If type == XML_CTYPE_MIXED, then quant will be NONE or REP and
- numchildren will contain number of elements that may be mixed in
- and children point to an array of XML_Content cells that will be
- all of XML_CTYPE_NAME type with no quantification.
-
- If type == XML_CTYPE_NAME, then the name points to the name, and
- the numchildren field will be zero and children will be NULL. The
- quant fields indicates any quantifiers placed on the name.
-
- CHOICE and SEQ will have name NULL, the number of children in
- numchildren and children will point, recursively, to an array
- of XML_Content cells.
-
- The EMPTY, ANY, and MIXED types will only occur at top level.
-*/
-
-typedef struct XML_cp XML_Content;
-
-struct XML_cp {
- enum XML_Content_Type type;
- enum XML_Content_Quant quant;
- XML_Char * name;
- unsigned int numchildren;
- XML_Content * children;
-};
-
-
-/* This is called for an element declaration. See above for
- description of the model argument. It's the caller's responsibility
- to free model when finished with it.
-*/
-typedef void (XMLCALL *XML_ElementDeclHandler) (void *userData,
- const XML_Char *name,
- XML_Content *model);
-
-XMLPARSEAPI(void)
-XML_SetElementDeclHandler(XML_Parser parser,
- XML_ElementDeclHandler eldecl);
-
-/* The Attlist declaration handler is called for *each* attribute. So
- a single Attlist declaration with multiple attributes declared will
- generate multiple calls to this handler. The "default" parameter
- may be NULL in the case of the "#IMPLIED" or "#REQUIRED"
- keyword. The "isrequired" parameter will be true and the default
- value will be NULL in the case of "#REQUIRED". If "isrequired" is
- true and default is non-NULL, then this is a "#FIXED" default.
-*/
-typedef void (XMLCALL *XML_AttlistDeclHandler) (
- void *userData,
- const XML_Char *elname,
- const XML_Char *attname,
- const XML_Char *att_type,
- const XML_Char *dflt,
- int isrequired);
-
-XMLPARSEAPI(void)
-XML_SetAttlistDeclHandler(XML_Parser parser,
- XML_AttlistDeclHandler attdecl);
-
-/* The XML declaration handler is called for *both* XML declarations
- and text declarations. The way to distinguish is that the version
- parameter will be NULL for text declarations. The encoding
- parameter may be NULL for XML declarations. The standalone
- parameter will be -1, 0, or 1 indicating respectively that there
- was no standalone parameter in the declaration, that it was given
- as no, or that it was given as yes.
-*/
-typedef void (XMLCALL *XML_XmlDeclHandler) (void *userData,
- const XML_Char *version,
- const XML_Char *encoding,
- int standalone);
-
-XMLPARSEAPI(void)
-XML_SetXmlDeclHandler(XML_Parser parser,
- XML_XmlDeclHandler xmldecl);
-
-
-typedef struct {
- void *(*malloc_fcn)(size_t size);
- void *(*realloc_fcn)(void *ptr, size_t size);
- void (*free_fcn)(void *ptr);
-} XML_Memory_Handling_Suite;
-
-/* Constructs a new parser; encoding is the encoding specified by the
- external protocol or NULL if there is none specified.
-*/
-XMLPARSEAPI(XML_Parser)
-XML_ParserCreate(const XML_Char *encoding);
-
-/* Constructs a new parser and namespace processor. Element type
- names and attribute names that belong to a namespace will be
- expanded; unprefixed attribute names are never expanded; unprefixed
- element type names are expanded only if there is a default
- namespace. The expanded name is the concatenation of the namespace
- URI, the namespace separator character, and the local part of the
- name. If the namespace separator is '\0' then the namespace URI
- and the local part will be concatenated without any separator.
- It is a programming error to use the separator '\0' with namespace
- triplets (see XML_SetReturnNSTriplet).
-*/
-XMLPARSEAPI(XML_Parser)
-XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
-
-
-/* Constructs a new parser using the memory management suite referred to
- by memsuite. If memsuite is NULL, then use the standard library memory
- suite. If namespaceSeparator is non-NULL it creates a parser with
- namespace processing as described above. The character pointed at
- will serve as the namespace separator.
-
- All further memory operations used for the created parser will come from
- the given suite.
-*/
-XMLPARSEAPI(XML_Parser)
-XML_ParserCreate_MM(const XML_Char *encoding,
- const XML_Memory_Handling_Suite *memsuite,
- const XML_Char *namespaceSeparator);
-
-/* Prepare a parser object to be re-used. This is particularly
- valuable when memory allocation overhead is disproportionatly high,
- such as when a large number of small documnents need to be parsed.
- All handlers are cleared from the parser, except for the
- unknownEncodingHandler. The parser's external state is re-initialized
- except for the values of ns and ns_triplets.
-
- Added in Expat 1.95.3.
-*/
-XMLPARSEAPI(XML_Bool)
-XML_ParserReset(XML_Parser parser, const XML_Char *encoding);
-
-/* atts is array of name/value pairs, terminated by 0;
- names and values are 0 terminated.
-*/
-typedef void (XMLCALL *XML_StartElementHandler) (void *userData,
- const XML_Char *name,
- const XML_Char **atts);
-
-typedef void (XMLCALL *XML_EndElementHandler) (void *userData,
- const XML_Char *name);
-
-
-/* s is not 0 terminated. */
-typedef void (XMLCALL *XML_CharacterDataHandler) (void *userData,
- const XML_Char *s,
- int len);
-
-/* target and data are 0 terminated */
-typedef void (XMLCALL *XML_ProcessingInstructionHandler) (
- void *userData,
- const XML_Char *target,
- const XML_Char *data);
-
-/* data is 0 terminated */
-typedef void (XMLCALL *XML_CommentHandler) (void *userData,
- const XML_Char *data);
-
-typedef void (XMLCALL *XML_StartCdataSectionHandler) (void *userData);
-typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData);
-
-/* This is called for any characters in the XML document for which
- there is no applicable handler. This includes both characters that
- are part of markup which is of a kind that is not reported
- (comments, markup declarations), or characters that are part of a
- construct which could be reported but for which no handler has been
- supplied. The characters are passed exactly as they were in the XML
- document except that they will be encoded in UTF-8 or UTF-16.
- Line boundaries are not normalized. Note that a byte order mark
- character is not passed to the default handler. There are no
- guarantees about how characters are divided between calls to the
- default handler: for example, a comment might be split between
- multiple calls.
-*/
-typedef void (XMLCALL *XML_DefaultHandler) (void *userData,
- const XML_Char *s,
- int len);
-
-/* This is called for the start of the DOCTYPE declaration, before
- any DTD or internal subset is parsed.
-*/
-typedef void (XMLCALL *XML_StartDoctypeDeclHandler) (
- void *userData,
- const XML_Char *doctypeName,
- const XML_Char *sysid,
- const XML_Char *pubid,
- int has_internal_subset);
-
-/* This is called for the start of the DOCTYPE declaration when the
- closing > is encountered, but after processing any external
- subset.
-*/
-typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
-
-/* This is called for entity declarations. The is_parameter_entity
- argument will be non-zero if the entity is a parameter entity, zero
- otherwise.
-
- For internal entities (<!ENTITY foo "bar">), value will
- be non-NULL and systemId, publicID, and notationName will be NULL.
- The value string is NOT nul-terminated; the length is provided in
- the value_length argument. Since it is legal to have zero-length
- values, do not use this argument to test for internal entities.
-
- For external entities, value will be NULL and systemId will be
- non-NULL. The publicId argument will be NULL unless a public
- identifier was provided. The notationName argument will have a
- non-NULL value only for unparsed entity declarations.
-
- Note that is_parameter_entity can't be changed to XML_Bool, since
- that would break binary compatibility.
-*/
-typedef void (XMLCALL *XML_EntityDeclHandler) (
- void *userData,
- const XML_Char *entityName,
- int is_parameter_entity,
- const XML_Char *value,
- int value_length,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId,
- const XML_Char *notationName);
-
-XMLPARSEAPI(void)
-XML_SetEntityDeclHandler(XML_Parser parser,
- XML_EntityDeclHandler handler);
-
-/* OBSOLETE -- OBSOLETE -- OBSOLETE
- This handler has been superceded by the EntityDeclHandler above.
- It is provided here for backward compatibility.
-
- This is called for a declaration of an unparsed (NDATA) entity.
- The base argument is whatever was set by XML_SetBase. The
- entityName, systemId and notationName arguments will never be
- NULL. The other arguments may be.
-*/
-typedef void (XMLCALL *XML_UnparsedEntityDeclHandler) (
- void *userData,
- const XML_Char *entityName,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId,
- const XML_Char *notationName);
-
-/* This is called for a declaration of notation. The base argument is
- whatever was set by XML_SetBase. The notationName will never be
- NULL. The other arguments can be.
-*/
-typedef void (XMLCALL *XML_NotationDeclHandler) (
- void *userData,
- const XML_Char *notationName,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId);
-
-/* When namespace processing is enabled, these are called once for
- each namespace declaration. The call to the start and end element
- handlers occur between the calls to the start and end namespace
- declaration handlers. For an xmlns attribute, prefix will be
- NULL. For an xmlns="" attribute, uri will be NULL.
-*/
-typedef void (XMLCALL *XML_StartNamespaceDeclHandler) (
- void *userData,
- const XML_Char *prefix,
- const XML_Char *uri);
-
-typedef void (XMLCALL *XML_EndNamespaceDeclHandler) (
- void *userData,
- const XML_Char *prefix);
-
-/* This is called if the document is not standalone, that is, it has an
- external subset or a reference to a parameter entity, but does not
- have standalone="yes". If this handler returns XML_STATUS_ERROR,
- then processing will not continue, and the parser will return a
- XML_ERROR_NOT_STANDALONE error.
- If parameter entity parsing is enabled, then in addition to the
- conditions above this handler will only be called if the referenced
- entity was actually read.
-*/
-typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData);
-
-/* This is called for a reference to an external parsed general
- entity. The referenced entity is not automatically parsed. The
- application can parse it immediately or later using
- XML_ExternalEntityParserCreate.
-
- The parser argument is the parser parsing the entity containing the
- reference; it can be passed as the parser argument to
- XML_ExternalEntityParserCreate. The systemId argument is the
- system identifier as specified in the entity declaration; it will
- not be NULL.
-
- The base argument is the system identifier that should be used as
- the base for resolving systemId if systemId was relative; this is
- set by XML_SetBase; it may be NULL.
-
- The publicId argument is the public identifier as specified in the
- entity declaration, or NULL if none was specified; the whitespace
- in the public identifier will have been normalized as required by
- the XML spec.
-
- The context argument specifies the parsing context in the format
- expected by the context argument to XML_ExternalEntityParserCreate;
- context is valid only until the handler returns, so if the
- referenced entity is to be parsed later, it must be copied.
- context is NULL only when the entity is a parameter entity.
-
- The handler should return XML_STATUS_ERROR if processing should not
- continue because of a fatal error in the handling of the external
- entity. In this case the calling parser will return an
- XML_ERROR_EXTERNAL_ENTITY_HANDLING error.
-
- Note that unlike other handlers the first argument is the parser,
- not userData.
-*/
-typedef int (XMLCALL *XML_ExternalEntityRefHandler) (
- XML_Parser parser,
- const XML_Char *context,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId);
-
-/* This is called in two situations:
- 1) An entity reference is encountered for which no declaration
- has been read *and* this is not an error.
- 2) An internal entity reference is read, but not expanded, because
- XML_SetDefaultHandler has been called.
- Note: skipped parameter entities in declarations and skipped general
- entities in attribute values cannot be reported, because
- the event would be out of sync with the reporting of the
- declarations or attribute values
-*/
-typedef void (XMLCALL *XML_SkippedEntityHandler) (
- void *userData,
- const XML_Char *entityName,
- int is_parameter_entity);
-
-/* This structure is filled in by the XML_UnknownEncodingHandler to
- provide information to the parser about encodings that are unknown
- to the parser.
-
- The map[b] member gives information about byte sequences whose
- first byte is b.
-
- If map[b] is c where c is >= 0, then b by itself encodes the
- Unicode scalar value c.
-
- If map[b] is -1, then the byte sequence is malformed.
-
- If map[b] is -n, where n >= 2, then b is the first byte of an
- n-byte sequence that encodes a single Unicode scalar value.
-
- The data member will be passed as the first argument to the convert
- function.
-
- The convert function is used to convert multibyte sequences; s will
- point to a n-byte sequence where map[(unsigned char)*s] == -n. The
- convert function must return the Unicode scalar value represented
- by this byte sequence or -1 if the byte sequence is malformed.
-
- The convert function may be NULL if the encoding is a single-byte
- encoding, that is if map[b] >= -1 for all bytes b.
-
- When the parser is finished with the encoding, then if release is
- not NULL, it will call release passing it the data member; once
- release has been called, the convert function will not be called
- again.
-
- Expat places certain restrictions on the encodings that are supported
- using this mechanism.
-
- 1. Every ASCII character that can appear in a well-formed XML document,
- other than the characters
-
- $@\^`{}~
-
- must be represented by a single byte, and that byte must be the
- same byte that represents that character in ASCII.
-
- 2. No character may require more than 4 bytes to encode.
-
- 3. All characters encoded must have Unicode scalar values <=
- 0xFFFF, (i.e., characters that would be encoded by surrogates in
- UTF-16 are not allowed). Note that this restriction doesn't
- apply to the built-in support for UTF-8 and UTF-16.
-
- 4. No Unicode character may be encoded by more than one distinct
- sequence of bytes.
-*/
-typedef struct {
- int map[256];
- void *data;
- int (XMLCALL *convert)(void *data, const char *s);
- void (XMLCALL *release)(void *data);
-} XML_Encoding;
-
-/* This is called for an encoding that is unknown to the parser.
-
- The encodingHandlerData argument is that which was passed as the
- second argument to XML_SetUnknownEncodingHandler.
-
- The name argument gives the name of the encoding as specified in
- the encoding declaration.
-
- If the callback can provide information about the encoding, it must
- fill in the XML_Encoding structure, and return XML_STATUS_OK.
- Otherwise it must return XML_STATUS_ERROR.
-
- If info does not describe a suitable encoding, then the parser will
- return an XML_UNKNOWN_ENCODING error.
-*/
-typedef int (XMLCALL *XML_UnknownEncodingHandler) (
- void *encodingHandlerData,
- const XML_Char *name,
- XML_Encoding *info);
-
-XMLPARSEAPI(void)
-XML_SetElementHandler(XML_Parser parser,
- XML_StartElementHandler start,
- XML_EndElementHandler end);
-
-XMLPARSEAPI(void)
-XML_SetStartElementHandler(XML_Parser parser,
- XML_StartElementHandler handler);
-
-XMLPARSEAPI(void)
-XML_SetEndElementHandler(XML_Parser parser,
- XML_EndElementHandler handler);
-
-XMLPARSEAPI(void)
-XML_SetCharacterDataHandler(XML_Parser parser,
- XML_CharacterDataHandler handler);
-
-XMLPARSEAPI(void)
-XML_SetProcessingInstructionHandler(XML_Parser parser,
- XML_ProcessingInstructionHandler handler);
-XMLPARSEAPI(void)
-XML_SetCommentHandler(XML_Parser parser,
- XML_CommentHandler handler);
-
-XMLPARSEAPI(void)
-XML_SetCdataSectionHandler(XML_Parser parser,
- XML_StartCdataSectionHandler start,
- XML_EndCdataSectionHandler end);
-
-XMLPARSEAPI(void)
-XML_SetStartCdataSectionHandler(XML_Parser parser,
- XML_StartCdataSectionHandler start);
-
-XMLPARSEAPI(void)
-XML_SetEndCdataSectionHandler(XML_Parser parser,
- XML_EndCdataSectionHandler end);
-
-/* This sets the default handler and also inhibits expansion of
- internal entities. These entity references will be passed to the
- default handler, or to the skipped entity handler, if one is set.
-*/
-XMLPARSEAPI(void)
-XML_SetDefaultHandler(XML_Parser parser,
- XML_DefaultHandler handler);
-
-/* This sets the default handler but does not inhibit expansion of
- internal entities. The entity reference will not be passed to the
- default handler.
-*/
-XMLPARSEAPI(void)
-XML_SetDefaultHandlerExpand(XML_Parser parser,
- XML_DefaultHandler handler);
-
-XMLPARSEAPI(void)
-XML_SetDoctypeDeclHandler(XML_Parser parser,
- XML_StartDoctypeDeclHandler start,
- XML_EndDoctypeDeclHandler end);
-
-XMLPARSEAPI(void)
-XML_SetStartDoctypeDeclHandler(XML_Parser parser,
- XML_StartDoctypeDeclHandler start);
-
-XMLPARSEAPI(void)
-XML_SetEndDoctypeDeclHandler(XML_Parser parser,
- XML_EndDoctypeDeclHandler end);
-
-XMLPARSEAPI(void)
-XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
- XML_UnparsedEntityDeclHandler handler);
-
-XMLPARSEAPI(void)
-XML_SetNotationDeclHandler(XML_Parser parser,
- XML_NotationDeclHandler handler);
-
-XMLPARSEAPI(void)
-XML_SetNamespaceDeclHandler(XML_Parser parser,
- XML_StartNamespaceDeclHandler start,
- XML_EndNamespaceDeclHandler end);
-
-XMLPARSEAPI(void)
-XML_SetStartNamespaceDeclHandler(XML_Parser parser,
- XML_StartNamespaceDeclHandler start);
-
-XMLPARSEAPI(void)
-XML_SetEndNamespaceDeclHandler(XML_Parser parser,
- XML_EndNamespaceDeclHandler end);
-
-XMLPARSEAPI(void)
-XML_SetNotStandaloneHandler(XML_Parser parser,
- XML_NotStandaloneHandler handler);
-
-XMLPARSEAPI(void)
-XML_SetExternalEntityRefHandler(XML_Parser parser,
- XML_ExternalEntityRefHandler handler);
-
-/* If a non-NULL value for arg is specified here, then it will be
- passed as the first argument to the external entity ref handler
- instead of the parser object.
-*/
-XMLPARSEAPI(void)
-XML_SetExternalEntityRefHandlerArg(XML_Parser parser,
- void *arg);
-
-XMLPARSEAPI(void)
-XML_SetSkippedEntityHandler(XML_Parser parser,
- XML_SkippedEntityHandler handler);
-
-XMLPARSEAPI(void)
-XML_SetUnknownEncodingHandler(XML_Parser parser,
- XML_UnknownEncodingHandler handler,
- void *encodingHandlerData);
-
-/* This can be called within a handler for a start element, end
- element, processing instruction or character data. It causes the
- corresponding markup to be passed to the default handler.
-*/
-XMLPARSEAPI(void)
-XML_DefaultCurrent(XML_Parser parser);
-
-/* If do_nst is non-zero, and namespace processing is in effect, and
- a name has a prefix (i.e. an explicit namespace qualifier) then
- that name is returned as a triplet in a single string separated by
- the separator character specified when the parser was created: URI
- + sep + local_name + sep + prefix.
-
- If do_nst is zero, then namespace information is returned in the
- default manner (URI + sep + local_name) whether or not the name
- has a prefix.
-
- Note: Calling XML_SetReturnNSTriplet after XML_Parse or
- XML_ParseBuffer has no effect.
-*/
-
-XMLPARSEAPI(void)
-XML_SetReturnNSTriplet(XML_Parser parser, int do_nst);
-
-/* This value is passed as the userData argument to callbacks. */
-XMLPARSEAPI(void)
-XML_SetUserData(XML_Parser parser, void *userData);
-
-/* Returns the last value set by XML_SetUserData or NULL. */
-#define XML_GetUserData(parser) (*(void **)(parser))
-
-/* This is equivalent to supplying an encoding argument to
- XML_ParserCreate. On success XML_SetEncoding returns non-zero,
- zero otherwise.
- Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer
- has no effect and returns XML_STATUS_ERROR.
-*/
-XMLPARSEAPI(enum XML_Status)
-XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
-
-/* If this function is called, then the parser will be passed as the
- first argument to callbacks instead of userData. The userData will
- still be accessible using XML_GetUserData.
-*/
-XMLPARSEAPI(void)
-XML_UseParserAsHandlerArg(XML_Parser parser);
-
-/* If useDTD == XML_TRUE is passed to this function, then the parser
- will assume that there is an external subset, even if none is
- specified in the document. In such a case the parser will call the
- externalEntityRefHandler with a value of NULL for the systemId
- argument (the publicId and context arguments will be NULL as well).
- Note: For the purpose of checking WFC: Entity Declared, passing
- useDTD == XML_TRUE will make the parser behave as if the document
- had a DTD with an external subset.
- Note: If this function is called, then this must be done before
- the first call to XML_Parse or XML_ParseBuffer, since it will
- have no effect after that. Returns
- XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING.
- Note: If the document does not have a DOCTYPE declaration at all,
- then startDoctypeDeclHandler and endDoctypeDeclHandler will not
- be called, despite an external subset being parsed.
- Note: If XML_DTD is not defined when Expat is compiled, returns
- XML_ERROR_FEATURE_REQUIRES_XML_DTD.
-*/
-XMLPARSEAPI(enum XML_Error)
-XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
-
-
-/* Sets the base to be used for resolving relative URIs in system
- identifiers in declarations. Resolving relative identifiers is
- left to the application: this value will be passed through as the
- base argument to the XML_ExternalEntityRefHandler,
- XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base
- argument will be copied. Returns XML_STATUS_ERROR if out of memory,
- XML_STATUS_OK otherwise.
-*/
-XMLPARSEAPI(enum XML_Status)
-XML_SetBase(XML_Parser parser, const XML_Char *base);
-
-XMLPARSEAPI(const XML_Char *)
-XML_GetBase(XML_Parser parser);
-
-/* Returns the number of the attribute/value pairs passed in last call
- to the XML_StartElementHandler that were specified in the start-tag
- rather than defaulted. Each attribute/value pair counts as 2; thus
- this correspondds to an index into the atts array passed to the
- XML_StartElementHandler.
-*/
-XMLPARSEAPI(int)
-XML_GetSpecifiedAttributeCount(XML_Parser parser);
-
-/* Returns the index of the ID attribute passed in the last call to
- XML_StartElementHandler, or -1 if there is no ID attribute. Each
- attribute/value pair counts as 2; thus this correspondds to an
- index into the atts array passed to the XML_StartElementHandler.
-*/
-XMLPARSEAPI(int)
-XML_GetIdAttributeIndex(XML_Parser parser);
-
-/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
- detected. The last call to XML_Parse must have isFinal true; len
- may be zero for this call (or any other).
-
- Though the return values for these functions has always been
- described as a Boolean value, the implementation, at least for the
- 1.95.x series, has always returned exactly one of the XML_Status
- values.
-*/
-XMLPARSEAPI(enum XML_Status)
-XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
-
-XMLPARSEAPI(void *)
-XML_GetBuffer(XML_Parser parser, int len);
-
-XMLPARSEAPI(enum XML_Status)
-XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
-
-/* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return.
- Must be called from within a call-back handler, except when aborting
- (resumable = 0) an already suspended parser. Some call-backs may
- still follow because they would otherwise get lost. Examples:
- - endElementHandler() for empty elements when stopped in
- startElementHandler(),
- - endNameSpaceDeclHandler() when stopped in endElementHandler(),
- and possibly others.
-
- Can be called from most handlers, including DTD related call-backs,
- except when parsing an external parameter entity and resumable != 0.
- Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise.
- Possible error codes:
- - XML_ERROR_SUSPENDED: when suspending an already suspended parser.
- - XML_ERROR_FINISHED: when the parser has already finished.
- - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE.
-
- When resumable != 0 (true) then parsing is suspended, that is,
- XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED.
- Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer()
- return XML_STATUS_ERROR with error code XML_ERROR_ABORTED.
-
- *Note*:
- This will be applied to the current parser instance only, that is, if
- there is a parent parser then it will continue parsing when the
- externalEntityRefHandler() returns. It is up to the implementation of
- the externalEntityRefHandler() to call XML_StopParser() on the parent
- parser (recursively), if one wants to stop parsing altogether.
-
- When suspended, parsing can be resumed by calling XML_ResumeParser().
-*/
-XMLPARSEAPI(enum XML_Status)
-XML_StopParser(XML_Parser parser, XML_Bool resumable);
-
-/* Resumes parsing after it has been suspended with XML_StopParser().
- Must not be called from within a handler call-back. Returns same
- status codes as XML_Parse() or XML_ParseBuffer().
- Additional error code XML_ERROR_NOT_SUSPENDED possible.
-
- *Note*:
- This must be called on the most deeply nested child parser instance
- first, and on its parent parser only after the child parser has finished,
- to be applied recursively until the document entity's parser is restarted.
- That is, the parent parser will not resume by itself and it is up to the
- application to call XML_ResumeParser() on it at the appropriate moment.
-*/
-XMLPARSEAPI(enum XML_Status)
-XML_ResumeParser(XML_Parser parser);
-
-enum XML_Parsing {
- XML_INITIALIZED,
- XML_PARSING,
- XML_FINISHED,
- XML_SUSPENDED
-};
-
-typedef struct {
- enum XML_Parsing parsing;
- XML_Bool finalBuffer;
-} XML_ParsingStatus;
-
-/* Returns status of parser with respect to being initialized, parsing,
- finished, or suspended and processing the final buffer.
- XXX XML_Parse() and XML_ParseBuffer() should return XML_ParsingStatus,
- XXX with XML_FINISHED_OK or XML_FINISHED_ERROR replacing XML_FINISHED
-*/
-XMLPARSEAPI(void)
-XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status);
-
-/* Creates an XML_Parser object that can parse an external general
- entity; context is a '\0'-terminated string specifying the parse
- context; encoding is a '\0'-terminated string giving the name of
- the externally specified encoding, or NULL if there is no
- externally specified encoding. The context string consists of a
- sequence of tokens separated by formfeeds (\f); a token consisting
- of a name specifies that the general entity of the name is open; a
- token of the form prefix=uri specifies the namespace for a
- particular prefix; a token of the form =uri specifies the default
- namespace. This can be called at any point after the first call to
- an ExternalEntityRefHandler so longer as the parser has not yet
- been freed. The new parser is completely independent and may
- safely be used in a separate thread. The handlers and userData are
- initialized from the parser argument. Returns NULL if out of memory.
- Otherwise returns a new XML_Parser object.
-*/
-XMLPARSEAPI(XML_Parser)
-XML_ExternalEntityParserCreate(XML_Parser parser,
- const XML_Char *context,
- const XML_Char *encoding);
-
-enum XML_ParamEntityParsing {
- XML_PARAM_ENTITY_PARSING_NEVER,
- XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE,
- XML_PARAM_ENTITY_PARSING_ALWAYS
-};
-
-/* Controls parsing of parameter entities (including the external DTD
- subset). If parsing of parameter entities is enabled, then
- references to external parameter entities (including the external
- DTD subset) will be passed to the handler set with
- XML_SetExternalEntityRefHandler. The context passed will be 0.
-
- Unlike external general entities, external parameter entities can
- only be parsed synchronously. If the external parameter entity is
- to be parsed, it must be parsed during the call to the external
- entity ref handler: the complete sequence of
- XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and
- XML_ParserFree calls must be made during this call. After
- XML_ExternalEntityParserCreate has been called to create the parser
- for the external parameter entity (context must be 0 for this
- call), it is illegal to make any calls on the old parser until
- XML_ParserFree has been called on the newly created parser.
- If the library has been compiled without support for parameter
- entity parsing (ie without XML_DTD being defined), then
- XML_SetParamEntityParsing will return 0 if parsing of parameter
- entities is requested; otherwise it will return non-zero.
- Note: If XML_SetParamEntityParsing is called after XML_Parse or
- XML_ParseBuffer, then it has no effect and will always return 0.
-*/
-XMLPARSEAPI(int)
-XML_SetParamEntityParsing(XML_Parser parser,
- enum XML_ParamEntityParsing parsing);
-
-/* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
- XML_GetErrorCode returns information about the error.
-*/
-XMLPARSEAPI(enum XML_Error)
-XML_GetErrorCode(XML_Parser parser);
-
-/* These functions return information about the current parse
- location. They may be called from any callback called to report
- some parse event; in this case the location is the location of the
- first of the sequence of characters that generated the event. When
- called from callbacks generated by declarations in the document
- prologue, the location identified isn't as neatly defined, but will
- be within the relevant markup. When called outside of the callback
- functions, the position indicated will be just past the last parse
- event (regardless of whether there was an associated callback).
-
- They may also be called after returning from a call to XML_Parse
- or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then
- the location is the location of the character at which the error
- was detected; otherwise the location is the location of the last
- parse event, as described above.
-*/
-XMLPARSEAPI(XML_Size) XML_GetCurrentLineNumber(XML_Parser parser);
-XMLPARSEAPI(XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser);
-XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser);
-
-/* Return the number of bytes in the current event.
- Returns 0 if the event is in an internal entity.
-*/
-XMLPARSEAPI(int)
-XML_GetCurrentByteCount(XML_Parser parser);
-
-/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
- the integer pointed to by offset to the offset within this buffer
- of the current parse position, and sets the integer pointed to by size
- to the size of this buffer (the number of input bytes). Otherwise
- returns a NULL pointer. Also returns a NULL pointer if a parse isn't
- active.
-
- NOTE: The character pointer returned should not be used outside
- the handler that makes the call.
-*/
-XMLPARSEAPI(const char *)
-XML_GetInputContext(XML_Parser parser,
- int *offset,
- int *size);
-
-/* For backwards compatibility with previous versions. */
-#define XML_GetErrorLineNumber XML_GetCurrentLineNumber
-#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
-#define XML_GetErrorByteIndex XML_GetCurrentByteIndex
-
-/* Frees the content model passed to the element declaration handler */
-XMLPARSEAPI(void)
-XML_FreeContentModel(XML_Parser parser, XML_Content *model);
-
-/* Exposing the memory handling functions used in Expat */
-XMLPARSEAPI(void *)
-XML_MemMalloc(XML_Parser parser, size_t size);
-
-XMLPARSEAPI(void *)
-XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
-
-XMLPARSEAPI(void)
-XML_MemFree(XML_Parser parser, void *ptr);
-
-/* Frees memory used by the parser. */
-XMLPARSEAPI(void)
-XML_ParserFree(XML_Parser parser);
-
-/* Returns a string describing the error. */
-XMLPARSEAPI(const XML_LChar *)
-XML_ErrorString(enum XML_Error code);
-
-/* Return a string containing the version number of this expat */
-XMLPARSEAPI(const XML_LChar *)
-XML_ExpatVersion(void);
-
-typedef struct {
- int major;
- int minor;
- int micro;
-} XML_Expat_Version;
-
-/* Return an XML_Expat_Version structure containing numeric version
- number information for this version of expat.
-*/
-XMLPARSEAPI(XML_Expat_Version)
-XML_ExpatVersionInfo(void);
-
-/* Added in Expat 1.95.5. */
-enum XML_FeatureEnum {
- XML_FEATURE_END = 0,
- XML_FEATURE_UNICODE,
- XML_FEATURE_UNICODE_WCHAR_T,
- XML_FEATURE_DTD,
- XML_FEATURE_CONTEXT_BYTES,
- XML_FEATURE_MIN_SIZE,
- XML_FEATURE_SIZEOF_XML_CHAR,
- XML_FEATURE_SIZEOF_XML_LCHAR,
- XML_FEATURE_NS,
- XML_FEATURE_LARGE_SIZE
- /* Additional features must be added to the end of this enum. */
-};
-
-typedef struct {
- enum XML_FeatureEnum feature;
- const XML_LChar *name;
- long int value;
-} XML_Feature;
-
-XMLPARSEAPI(const XML_Feature *)
-XML_GetFeatureList(void);
-
-
-/* Expat follows the GNU/Linux convention of odd number minor version for
- beta/development releases and even number minor version for stable
- releases. Micro is bumped with each release, and set to 0 with each
- change to major or minor version.
-*/
-#define XML_MAJOR_VERSION 2
-#define XML_MINOR_VERSION 0
-#define XML_MICRO_VERSION 1
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* not Expat_INCLUDED */
diff --git a/Utilities/Poco/XML/include/Poco/XML/expat_external.h b/Utilities/Poco/XML/include/Poco/XML/expat_external.h
deleted file mode 100755
index 2c03284ea2..0000000000
--- a/Utilities/Poco/XML/include/Poco/XML/expat_external.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-#ifndef Expat_External_INCLUDED
-#define Expat_External_INCLUDED 1
-
-/* External API definitions */
-
-#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
-#define XML_USE_MSC_EXTENSIONS 1
-#endif
-
-/* Expat tries very hard to make the API boundary very specifically
- defined. There are two macros defined to control this boundary;
- each of these can be defined before including this header to
- achieve some different behavior, but doing so it not recommended or
- tested frequently.
-
- XMLCALL - The calling convention to use for all calls across the
- "library boundary." This will default to cdecl, and
- try really hard to tell the compiler that's what we
- want.
-
- XMLIMPORT - Whatever magic is needed to note that a function is
- to be imported from a dynamically loaded library
- (.dll, .so, or .sl, depending on your platform).
-
- The XMLCALL macro was added in Expat 1.95.7. The only one which is
- expected to be directly useful in client code is XMLCALL.
-
- Note that on at least some Unix versions, the Expat library must be
- compiled with the cdecl calling convention as the default since
- system headers may assume the cdecl convention.
-*/
-#ifndef XMLCALL
-#if defined(_MSC_VER)
-#define XMLCALL __cdecl
-#elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
-#define XMLCALL __attribute__((cdecl))
-#else
-/* For any platform which uses this definition and supports more than
- one calling convention, we need to extend this definition to
- declare the convention used on that platform, if it's possible to
- do so.
-
- If this is the case for your platform, please file a bug report
- with information on how to identify your platform via the C
- pre-processor and how to specify the same calling convention as the
- platform's malloc() implementation.
-*/
-#define XMLCALL
-#endif
-#endif /* not defined XMLCALL */
-
-
-#if !defined(XML_STATIC) && !defined(XMLIMPORT)
-#ifndef XML_BUILDING_EXPAT
-/* using Expat from an application */
-
-#ifdef XML_USE_MSC_EXTENSIONS
-#define XMLIMPORT __declspec(dllimport)
-#endif
-
-#endif
-#endif /* not defined XML_STATIC */
-
-
-/* If we didn't define it above, define it away: */
-#ifndef XMLIMPORT
-#define XMLIMPORT
-#endif
-
-
-#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef XML_UNICODE_WCHAR_T
-#define XML_UNICODE
-#endif
-
-#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
-#ifdef XML_UNICODE_WCHAR_T
-typedef wchar_t XML_Char;
-typedef wchar_t XML_LChar;
-#else
-typedef unsigned short XML_Char;
-typedef char XML_LChar;
-#endif /* XML_UNICODE_WCHAR_T */
-#else /* Information is UTF-8 encoded. */
-typedef char XML_Char;
-typedef char XML_LChar;
-#endif /* XML_UNICODE */
-
-#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
-#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
-typedef __int64 XML_Index;
-typedef unsigned __int64 XML_Size;
-#else
-typedef long long XML_Index;
-typedef unsigned long long XML_Size;
-#endif
-#else
-typedef long XML_Index;
-typedef unsigned long XML_Size;
-#endif /* XML_LARGE_SIZE */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* not Expat_External_INCLUDED */
diff --git a/Utilities/Poco/XML/src/AbstractContainerNode.cpp b/Utilities/Poco/XML/src/AbstractContainerNode.cpp
deleted file mode 100755
index 5c0e27c22f..0000000000
--- a/Utilities/Poco/XML/src/AbstractContainerNode.cpp
+++ /dev/null
@@ -1,325 +0,0 @@
-//
-// AbstractContainerNode.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/AbstractContainerNode.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/DOMException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-AbstractContainerNode::AbstractContainerNode(Document* pOwnerDocument):
- AbstractNode(pOwnerDocument),
- _pFirstChild(0)
-{
-}
-
-
-AbstractContainerNode::AbstractContainerNode(Document* pOwnerDocument, const AbstractContainerNode& node):
- AbstractNode(pOwnerDocument, node),
- _pFirstChild(0)
-{
-}
-
-
-AbstractContainerNode::~AbstractContainerNode()
-{
- AbstractNode* pChild = static_cast<AbstractNode*>(_pFirstChild);
- while (pChild)
- {
- AbstractNode* pDelNode = pChild;
- pChild = pChild->_pNext;
- pDelNode->_pNext = 0;
- pDelNode->_pParent = 0;
- pDelNode->release();
- }
-}
-
-
-Node* AbstractContainerNode::firstChild() const
-{
- return _pFirstChild;
-}
-
-
-Node* AbstractContainerNode::lastChild() const
-{
- AbstractNode* pChild = _pFirstChild;
- if (pChild)
- {
- while (pChild->_pNext) pChild = pChild->_pNext;
- return pChild;
- }
- return 0;
-}
-
-
-Node* AbstractContainerNode::insertBefore(Node* newChild, Node* refChild)
-{
- poco_check_ptr (newChild);
-
- if (static_cast<AbstractNode*>(newChild)->_pOwner != _pOwner && static_cast<AbstractNode*>(newChild)->_pOwner != this)
- throw DOMException(DOMException::WRONG_DOCUMENT_ERR);
- if (refChild && static_cast<AbstractNode*>(refChild)->_pParent != this)
- throw DOMException(DOMException::NOT_FOUND_ERR);
- if (newChild == refChild)
- return newChild;
- if (this == newChild)
- throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
-
- AbstractNode* pFirst = 0;
- AbstractNode* pLast = 0;
- if (newChild->nodeType() == Node::DOCUMENT_FRAGMENT_NODE)
- {
- AbstractContainerNode* pFrag = static_cast<AbstractContainerNode*>(newChild);
- pFirst = pFrag->_pFirstChild;
- pLast = pFirst;
- if (pFirst)
- {
- while (pLast->_pNext)
- {
- pLast->_pParent = this;
- pLast = pLast->_pNext;
- }
- pLast->_pParent = this;
- }
- pFrag->_pFirstChild = 0;
- }
- else
- {
- newChild->duplicate();
- AbstractContainerNode* pParent = static_cast<AbstractNode*>(newChild)->_pParent;
- if (pParent) pParent->removeChild(newChild);
- pFirst = static_cast<AbstractNode*>(newChild);
- pLast = pFirst;
- pFirst->_pParent = this;
- }
- if (_pFirstChild && pFirst)
- {
- AbstractNode* pCur = _pFirstChild;
- if (pCur == refChild)
- {
- pLast->_pNext = _pFirstChild;
- _pFirstChild = pFirst;
- }
- else
- {
- while (pCur && pCur->_pNext != refChild) pCur = pCur->_pNext;
- if (pCur)
- {
- pLast->_pNext = pCur->_pNext;
- pCur->_pNext = pFirst;
- }
- else throw DOMException(DOMException::NOT_FOUND_ERR);
- }
- }
- else _pFirstChild = pFirst;
-
- if (events())
- {
- while (pFirst && pFirst != pLast->_pNext)
- {
- pFirst->dispatchNodeInserted();
- pFirst->dispatchNodeInsertedIntoDocument();
- pFirst = pFirst->_pNext;
- }
- dispatchSubtreeModified();
- }
- return newChild;
-}
-
-
-Node* AbstractContainerNode::replaceChild(Node* newChild, Node* oldChild)
-{
- poco_check_ptr (newChild);
- poco_check_ptr (oldChild);
-
- if (static_cast<AbstractNode*>(newChild)->_pOwner != _pOwner && static_cast<AbstractNode*>(newChild)->_pOwner != this)
- throw DOMException(DOMException::WRONG_DOCUMENT_ERR);
- if (static_cast<AbstractNode*>(oldChild)->_pParent != this)
- throw DOMException(DOMException::NOT_FOUND_ERR);
- if (newChild == oldChild)
- return newChild;
- if (this == newChild)
- throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
-
- bool doEvents = events();
- if (newChild->nodeType() == Node::DOCUMENT_FRAGMENT_NODE)
- {
- insertBefore(newChild, oldChild);
- removeChild(oldChild);
- }
- else
- {
- AbstractContainerNode* pParent = static_cast<AbstractNode*>(newChild)->_pParent;
- if (pParent) pParent->removeChild(newChild);
-
- if (oldChild == _pFirstChild)
- {
- if (doEvents)
- {
- _pFirstChild->dispatchNodeRemoved();
- _pFirstChild->dispatchNodeRemovedFromDocument();
- }
- static_cast<AbstractNode*>(newChild)->_pNext = static_cast<AbstractNode*>(oldChild)->_pNext;
- static_cast<AbstractNode*>(newChild)->_pParent = this;
- _pFirstChild->_pNext = 0;
- _pFirstChild->_pParent = 0;
- _pFirstChild = static_cast<AbstractNode*>(newChild);
- if (doEvents)
- {
- static_cast<AbstractNode*>(newChild)->dispatchNodeInserted();
- static_cast<AbstractNode*>(newChild)->dispatchNodeInsertedIntoDocument();
- }
- }
- else
- {
- AbstractNode* pCur = _pFirstChild;
- while (pCur && pCur->_pNext != oldChild) pCur = pCur->_pNext;
- if (pCur)
- {
- poco_assert_dbg (pCur->_pNext == oldChild);
-
- if (doEvents)
- {
- static_cast<AbstractNode*>(oldChild)->dispatchNodeRemoved();
- static_cast<AbstractNode*>(oldChild)->dispatchNodeRemovedFromDocument();
- }
- static_cast<AbstractNode*>(newChild)->_pNext = static_cast<AbstractNode*>(oldChild)->_pNext;
- static_cast<AbstractNode*>(newChild)->_pParent = this;
- static_cast<AbstractNode*>(oldChild)->_pNext = 0;
- static_cast<AbstractNode*>(oldChild)->_pParent = 0;
- pCur->_pNext = static_cast<AbstractNode*>(newChild);
- if (doEvents)
- {
- static_cast<AbstractNode*>(newChild)->dispatchNodeInserted();
- static_cast<AbstractNode*>(newChild)->dispatchNodeInsertedIntoDocument();
- }
- }
- else throw DOMException(DOMException::NOT_FOUND_ERR);
- }
- newChild->duplicate();
- oldChild->autoRelease();
- }
- if (doEvents) dispatchSubtreeModified();
- return oldChild;
-}
-
-
-Node* AbstractContainerNode::removeChild(Node* oldChild)
-{
- poco_check_ptr (oldChild);
-
- bool doEvents = events();
- if (oldChild == _pFirstChild)
- {
- if (doEvents)
- {
- static_cast<AbstractNode*>(oldChild)->dispatchNodeRemoved();
- static_cast<AbstractNode*>(oldChild)->dispatchNodeRemovedFromDocument();
- }
- _pFirstChild = _pFirstChild->_pNext;
- static_cast<AbstractNode*>(oldChild)->_pNext = 0;
- static_cast<AbstractNode*>(oldChild)->_pParent = 0;
- }
- else
- {
- AbstractNode* pCur = _pFirstChild;
- while (pCur && pCur->_pNext != oldChild) pCur = pCur->_pNext;
- if (pCur)
- {
- if (doEvents)
- {
- static_cast<AbstractNode*>(oldChild)->dispatchNodeRemoved();
- static_cast<AbstractNode*>(oldChild)->dispatchNodeRemovedFromDocument();
- }
- pCur->_pNext = pCur->_pNext->_pNext;
- static_cast<AbstractNode*>(oldChild)->_pNext = 0;
- static_cast<AbstractNode*>(oldChild)->_pParent = 0;
- }
- else throw DOMException(DOMException::NOT_FOUND_ERR);
- }
- oldChild->autoRelease();
- if (doEvents) dispatchSubtreeModified();
- return oldChild;
-}
-
-
-Node* AbstractContainerNode::appendChild(Node* newChild)
-{
- return insertBefore(newChild, 0);
-}
-
-
-void AbstractContainerNode::dispatchNodeRemovedFromDocument()
-{
- AbstractNode::dispatchNodeRemovedFromDocument();
- Node* pChild = firstChild();
- while (pChild)
- {
- static_cast<AbstractNode*>(pChild)->dispatchNodeRemovedFromDocument();
- pChild = pChild->nextSibling();
- }
-}
-
-
-void AbstractContainerNode::dispatchNodeInsertedIntoDocument()
-{
- AbstractNode::dispatchNodeInsertedIntoDocument();
- Node* pChild = firstChild();
- while (pChild)
- {
- static_cast<AbstractNode*>(pChild)->dispatchNodeInsertedIntoDocument();
- pChild = pChild->nextSibling();
- }
-}
-
-
-bool AbstractContainerNode::hasChildNodes() const
-{
- return _pFirstChild != 0;
-}
-
-
-bool AbstractContainerNode::hasAttributes() const
-{
- return false;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/AbstractNode.cpp b/Utilities/Poco/XML/src/AbstractNode.cpp
deleted file mode 100755
index d6fe9c9d5e..0000000000
--- a/Utilities/Poco/XML/src/AbstractNode.cpp
+++ /dev/null
@@ -1,377 +0,0 @@
-//
-// AbstractNode.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/AbstractNode.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/ChildNodesList.h"
-#include "Poco/DOM/EventDispatcher.h"
-#include "Poco/DOM/DOMException.h"
-#include "Poco/DOM/EventException.h"
-#include "Poco/DOM/DOMImplementation.h"
-#include "Poco/DOM/Attr.h"
-#include "Poco/XML/Name.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString AbstractNode::NODE_NAME = toXMLString("#node");
-const XMLString AbstractNode::EMPTY_STRING;
-
-
-AbstractNode::AbstractNode(Document* pOwnerDocument):
- _pParent(0),
- _pNext(0),
- _pOwner(pOwnerDocument),
- _pEventDispatcher(0)
-{
-}
-
-
-AbstractNode::AbstractNode(Document* pOwnerDocument, const AbstractNode& node):
- _pParent(0),
- _pNext(0),
- _pOwner(pOwnerDocument),
- _pEventDispatcher(0)
-{
-}
-
-
-AbstractNode::~AbstractNode()
-{
- delete _pEventDispatcher;
- if (_pNext) _pNext->release();
-}
-
-
-void AbstractNode::autoRelease()
-{
- _pOwner->autoReleasePool().add(this);
-}
-
-
-const XMLString& AbstractNode::nodeName() const
-{
- return NODE_NAME;
-}
-
-
-const XMLString& AbstractNode::getNodeValue() const
-{
- return EMPTY_STRING;
-}
-
-
-void AbstractNode::setNodeValue(const XMLString& value)
-{
- throw DOMException(DOMException::NO_DATA_ALLOWED_ERR);
-}
-
-
-Node* AbstractNode::parentNode() const
-{
- return _pParent;
-}
-
-
-NodeList* AbstractNode::childNodes() const
-{
- return new ChildNodesList(this);
-}
-
-
-Node* AbstractNode::firstChild() const
-{
- return 0;
-}
-
-
-Node* AbstractNode::lastChild() const
-{
- return 0;
-}
-
-
-Node* AbstractNode::previousSibling() const
-{
- if (_pParent)
- {
- AbstractNode* pSibling = _pParent->_pFirstChild;
- while (pSibling)
- {
- if (pSibling->_pNext == this) return pSibling;
- pSibling = pSibling->_pNext;
- }
- }
- return 0;
-}
-
-
-Node* AbstractNode::nextSibling() const
-{
- return _pNext;
-}
-
-
-NamedNodeMap* AbstractNode::attributes() const
-{
- return 0;
-}
-
-
-Document* AbstractNode::ownerDocument() const
-{
- return _pOwner;
-}
-
-
-Node* AbstractNode::insertBefore(Node* newChild, Node* refChild)
-{
- throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
-}
-
-
-Node* AbstractNode::replaceChild(Node* newChild, Node* oldChild)
-{
- throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
-}
-
-
-Node* AbstractNode::removeChild(Node* oldChild)
-{
- throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
-}
-
-
-Node* AbstractNode::appendChild(Node* newChild)
-{
- throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
-}
-
-
-bool AbstractNode::hasChildNodes() const
-{
- return false;
-}
-
-
-Node* AbstractNode::cloneNode(bool deep) const
-{
- return copyNode(deep, _pOwner);
-}
-
-
-void AbstractNode::normalize()
-{
-}
-
-
-bool AbstractNode::isSupported(const XMLString& feature, const XMLString& version) const
-{
- return DOMImplementation::instance().hasFeature(feature, version);
-}
-
-
-const XMLString& AbstractNode::namespaceURI() const
-{
- return EMPTY_STRING;
-}
-
-
-XMLString AbstractNode::prefix() const
-{
- return EMPTY_STRING;
-}
-
-
-const XMLString& AbstractNode::localName() const
-{
- return EMPTY_STRING;
-}
-
-
-bool AbstractNode::hasAttributes() const
-{
- return false;
-}
-
-
-XMLString AbstractNode::innerText() const
-{
- return EMPTY_STRING;
-}
-
-
-void AbstractNode::addEventListener(const XMLString& type, EventListener* listener, bool useCapture)
-{
- if (_pEventDispatcher)
- _pEventDispatcher->removeEventListener(type, listener, useCapture);
- else
- _pEventDispatcher = new EventDispatcher;
-
- _pEventDispatcher->addEventListener(type, listener, useCapture);
-}
-
-
-void AbstractNode::removeEventListener(const XMLString& type, EventListener* listener, bool useCapture)
-{
- if (_pEventDispatcher)
- _pEventDispatcher->removeEventListener(type, listener, useCapture);
-}
-
-
-bool AbstractNode::dispatchEvent(Event* evt)
-{
- if (eventsSuspended()) return true;
-
- if (evt->type().empty()) throw EventException(EventException::UNSPECIFIED_EVENT_TYPE_ERR);
-
- evt->setTarget(this);
- evt->setCurrentPhase(Event::CAPTURING_PHASE);
-
- if (_pParent) _pParent->captureEvent(evt);
-
- if (_pEventDispatcher && !evt->isStopped())
- {
- evt->setCurrentPhase(Event::AT_TARGET);
- evt->setCurrentTarget(this);
- _pEventDispatcher->dispatchEvent(evt);
- }
- if (!evt->isStopped() && evt->bubbles() && _pParent)
- {
- evt->setCurrentPhase(Event::BUBBLING_PHASE);
- _pParent->bubbleEvent(evt);
- }
-
- return evt->isCanceled();
-}
-
-
-void AbstractNode::captureEvent(Event* evt)
-{
- if (_pParent)
- _pParent->captureEvent(evt);
-
- if (_pEventDispatcher && !evt->isStopped())
- {
- evt->setCurrentTarget(this);
- _pEventDispatcher->captureEvent(evt);
- }
-}
-
-
-void AbstractNode::bubbleEvent(Event* evt)
-{
- evt->setCurrentTarget(this);
- if (_pEventDispatcher)
- {
- _pEventDispatcher->bubbleEvent(evt);
- }
- if (_pParent && !evt->isStopped())
- _pParent->bubbleEvent(evt);
-}
-
-
-void AbstractNode::dispatchSubtreeModified()
-{
- AutoPtr<MutationEvent> pEvent = new MutationEvent(_pOwner, MutationEvent::DOMSubtreeModified, this, true, false, 0);
- dispatchEvent(pEvent.get());
-}
-
-
-void AbstractNode::dispatchNodeInserted()
-{
- AutoPtr<MutationEvent> pEvent = new MutationEvent(_pOwner, MutationEvent::DOMNodeInserted, this, true, false, parentNode());
- dispatchEvent(pEvent.get());
-}
-
-
-void AbstractNode::dispatchNodeRemoved()
-{
- AutoPtr<MutationEvent> pEvent = new MutationEvent(_pOwner, MutationEvent::DOMNodeRemoved, this, true, false, parentNode());
- dispatchEvent(pEvent.get());
-}
-
-
-void AbstractNode::dispatchNodeRemovedFromDocument()
-{
- AutoPtr<MutationEvent> pEvent = new MutationEvent(_pOwner, MutationEvent::DOMNodeRemovedFromDocument, this, false, false, 0);
- dispatchEvent(pEvent.get());
-}
-
-
-void AbstractNode::dispatchNodeInsertedIntoDocument()
-{
- AutoPtr<MutationEvent> pEvent = new MutationEvent(_pOwner, MutationEvent::DOMNodeInsertedIntoDocument, this, false, false, 0);
- dispatchEvent(pEvent.get());
-}
-
-
-void AbstractNode::dispatchAttrModified(Attr* pAttr, MutationEvent::AttrChangeType changeType, const XMLString& prevValue, const XMLString& newValue)
-{
- AutoPtr<MutationEvent> pEvent = new MutationEvent(_pOwner, MutationEvent::DOMAttrModified, this, true, false, pAttr, prevValue, newValue, pAttr->name(), changeType);
- dispatchEvent(pEvent.get());
-}
-
-
-void AbstractNode::dispatchCharacterDataModified(const XMLString& prevValue, const XMLString& newValue)
-{
- AutoPtr<MutationEvent> pEvent = new MutationEvent(_pOwner, MutationEvent::DOMCharacterDataModified, this, true, false, 0, prevValue, newValue, EMPTY_STRING, MutationEvent::MODIFICATION);
- dispatchEvent(pEvent.get());
-}
-
-
-bool AbstractNode::events() const
-{
- return _pOwner->events();
-}
-
-
-bool AbstractNode::eventsSuspended() const
-{
- return _pOwner->eventsSuspended();
-}
-
-
-void AbstractNode::setOwnerDocument(Document* pOwnerDocument)
-{
- _pOwner = pOwnerDocument;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Attr.cpp b/Utilities/Poco/XML/src/Attr.cpp
deleted file mode 100755
index 11b6adc82e..0000000000
--- a/Utilities/Poco/XML/src/Attr.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// Attr.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/Attr.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/XML/NamePool.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-Attr::Attr(Document* pOwnerDocument, Element* pOwnerElement, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& value, bool specified):
- AbstractNode(pOwnerDocument),
- _name(pOwnerDocument->namePool().insert(qname, namespaceURI, localName)),
- _value(value),
- _specified(specified)
-{
-}
-
-
-Attr::Attr(Document* pOwnerDocument, const Attr& attr):
- AbstractNode(pOwnerDocument, attr),
- _name(pOwnerDocument->namePool().insert(attr._name)),
- _value(attr._value),
- _specified(attr._specified)
-{
-}
-
-
-Attr::~Attr()
-{
-}
-
-
-void Attr::setValue(const XMLString& value)
-{
- XMLString oldValue = _value;
- _value = value;
- _specified = true;
- if (_pParent && !_pOwner->eventsSuspended())
- _pParent->dispatchAttrModified(this, MutationEvent::MODIFICATION, oldValue, value);
-}
-
-
-Node* Attr::parentNode() const
-{
- return 0;
-}
-
-
-Node* Attr::previousSibling() const
-{
- if (_pParent)
- {
- Attr* pSibling = static_cast<Element*>(_pParent)->_pFirstAttr;
- while (pSibling)
- {
- if (pSibling->_pNext == const_cast<Attr*>(this)) return pSibling;
- pSibling = static_cast<Attr*>(pSibling->_pNext);
- }
- return pSibling;
- }
- return 0;
-}
-
-
-const XMLString& Attr::nodeName() const
-{
- return _name.qname();
-}
-
-
-const XMLString& Attr::getNodeValue() const
-{
- return _value;
-}
-
-
-void Attr::setNodeValue(const XMLString& value)
-{
- setValue(value);
-}
-
-
-unsigned short Attr::nodeType() const
-{
- return ATTRIBUTE_NODE;
-}
-
-
-const XMLString& Attr::namespaceURI() const
-{
- return _name.namespaceURI();
-}
-
-
-XMLString Attr::prefix() const
-{
- return _name.prefix();
-}
-
-
-const XMLString& Attr::localName() const
-{
- return _name.localName();
-}
-
-
-XMLString Attr::innerText() const
-{
- return nodeValue();
-}
-
-
-Node* Attr::copyNode(bool deep, Document* pOwnerDocument) const
-{
- return new Attr(pOwnerDocument, *this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/AttrMap.cpp b/Utilities/Poco/XML/src/AttrMap.cpp
deleted file mode 100755
index 3b0689b84c..0000000000
--- a/Utilities/Poco/XML/src/AttrMap.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// AttrMap.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/AttrMap.h"
-#include "Poco/DOM/Attr.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/DOMException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-AttrMap::AttrMap(Element* pElement):
- _pElement(pElement)
-{
- poco_check_ptr (pElement);
-
- _pElement->duplicate();
-}
-
-
-AttrMap::~AttrMap()
-{
- _pElement->release();
-}
-
-
-Node* AttrMap::getNamedItem(const XMLString& name) const
-{
- return _pElement->getAttributeNode(name);
-}
-
-
-Node* AttrMap::setNamedItem(Node* arg)
-{
- poco_check_ptr (arg);
-
- if (arg->nodeType() != Node::ATTRIBUTE_NODE)
- throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
-
- return _pElement->setAttributeNode(static_cast<Attr*>(arg));
-}
-
-
-Node* AttrMap::removeNamedItem(const XMLString& name)
-{
- Attr* pAttr = _pElement->getAttributeNode(name);
- if (pAttr)
- return _pElement->removeAttributeNode(pAttr);
- else
- return 0;
-}
-
-
-Node* AttrMap::item(unsigned long index) const
-{
- AbstractNode* pAttr = _pElement->_pFirstAttr;
- while (index-- > 0 && pAttr) pAttr = static_cast<AbstractNode*>(pAttr->nextSibling());
- return pAttr;
-}
-
-
-unsigned long AttrMap::length() const
-{
- unsigned long result = 0;
- AbstractNode* pAttr = _pElement->_pFirstAttr;
- while (pAttr)
- {
- pAttr = static_cast<AbstractNode*>(pAttr->nextSibling());
- ++result;
- }
- return result;
-}
-
-
-Node* AttrMap::getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const
-{
- return _pElement->getAttributeNodeNS(namespaceURI, localName);
-}
-
-
-Node* AttrMap::setNamedItemNS(Node* arg)
-{
- poco_check_ptr (arg);
-
- if (arg->nodeType() != Node::ATTRIBUTE_NODE)
- throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
-
- return _pElement->setAttributeNodeNS(static_cast<Attr*>(arg));
-}
-
-
-Node* AttrMap::removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName)
-{
- Attr* pAttr = _pElement->getAttributeNodeNS(namespaceURI, localName);
- if (pAttr)
- return _pElement->removeAttributeNode(pAttr);
- else
- return 0;
-}
-
-
-void AttrMap::autoRelease()
-{
- _pElement->ownerDocument()->autoReleasePool().add(this);
-}
-
-
-} } // namespace Poco::XML
-
diff --git a/Utilities/Poco/XML/src/Attributes.cpp b/Utilities/Poco/XML/src/Attributes.cpp
deleted file mode 100755
index b4579d05d6..0000000000
--- a/Utilities/Poco/XML/src/Attributes.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// Attributes.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/Attributes.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-Attributes::~Attributes()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/AttributesImpl.cpp b/Utilities/Poco/XML/src/AttributesImpl.cpp
deleted file mode 100755
index 7a05ac73ad..0000000000
--- a/Utilities/Poco/XML/src/AttributesImpl.cpp
+++ /dev/null
@@ -1,302 +0,0 @@
-//
-// AttributesImpl.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/AttributesImpl.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-AttributesImpl::AttributesImpl()
-{
- _empty.specified = false;
- _empty.type = XML_LIT("CDATA");
-}
-
-
-AttributesImpl::AttributesImpl(const Attributes& attributes)
-{
- _empty.specified = false;
- _empty.type = XML_LIT("CDATA");
- setAttributes(attributes);
-}
-
-
-AttributesImpl::AttributesImpl(const AttributesImpl& attributes):
- _attributes(attributes._attributes),
- _empty(attributes._empty)
-{
-}
-
-
-AttributesImpl::~AttributesImpl()
-{
-}
-
-
-AttributesImpl& AttributesImpl::operator = (const AttributesImpl& attributes)
-{
- if (&attributes != this)
- {
- _attributes = attributes._attributes;
- }
- return *this;
-}
-
-
-int AttributesImpl::getIndex(const XMLString& qname) const
-{
- int i = 0;
- AttributeVec::const_iterator it;
- for (it = _attributes.begin(); it != _attributes.end(); ++it)
- {
- if (it->qname == qname) return i;
- ++i;
- }
- return -1;
-}
-
-
-int AttributesImpl::getIndex(const XMLString& namespaceURI, const XMLString& localName) const
-{
- int i = 0;
- AttributeVec::const_iterator it;
- for (it = _attributes.begin(); it != _attributes.end(); ++it)
- {
- if (it->namespaceURI == namespaceURI && it->localName == localName) return i;
- ++i;
- }
- return -1;
-}
-
-
-void AttributesImpl::setValue(int i, const XMLString& value)
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- _attributes[i].value = value;
- _attributes[i].specified = true;
-}
-
-
-void AttributesImpl::setValue(const XMLString& qname, const XMLString& value)
-{
- Attribute* pAttr = find(qname);
- if (pAttr)
- {
- pAttr->value = value;
- pAttr->specified = true;
- }
-}
-
-
-void AttributesImpl::setValue(const XMLString& namespaceURI, const XMLString& localName, const XMLString& value)
-{
- Attribute* pAttr = find(namespaceURI, localName);
- if (pAttr)
- {
- pAttr->value = value;
- pAttr->specified = true;
- }
-}
-
-
-void AttributesImpl::setAttributes(const Attributes& attributes)
-{
- if (&attributes != this)
- {
- int count = attributes.getLength();
- _attributes.clear();
- _attributes.reserve(count);
- for (int i = 0; i < count; i++)
- {
- addAttribute(attributes.getURI(i), attributes.getLocalName(i), attributes.getQName(i), attributes.getType(i), attributes.getValue(i));
- }
- }
-}
-
-
-void AttributesImpl::setAttribute(int i, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& type, const XMLString& value)
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- _attributes[i].namespaceURI = namespaceURI;
- _attributes[i].localName = localName;
- _attributes[i].qname = qname;
- _attributes[i].type = type;
- _attributes[i].value = value;
- _attributes[i].specified = true;
-}
-
-
-void AttributesImpl::addAttribute(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& type, const XMLString& value)
-{
- AttributeVec::iterator it = _attributes.insert(_attributes.end(), Attribute());
- it->namespaceURI = namespaceURI;
- it->localName = localName;
- it->qname = qname;
- it->value = value;
- it->type = type;
- it->specified = true;
-}
-
-
-void AttributesImpl::addAttribute(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& type, const XMLString& value, bool specified)
-{
- AttributeVec::iterator it = _attributes.insert(_attributes.end(), Attribute());
- it->namespaceURI = namespaceURI;
- it->localName = localName;
- it->qname = qname;
- it->value = value;
- it->type = type;
- it->specified = specified;
-}
-
-
-void AttributesImpl::addAttribute(const XMLChar* namespaceURI, const XMLChar* localName, const XMLChar* qname, const XMLChar* type, const XMLChar* value, bool specified)
-{
- AttributeVec::iterator it = _attributes.insert(_attributes.end(), Attribute());
- it->namespaceURI = namespaceURI;
- it->localName = localName;
- it->qname = qname;
- it->value = value;
- it->type = type;
- it->specified = specified;
-}
-
-
-void AttributesImpl::removeAttribute(int i)
-{
- int cur = 0;
- for (AttributeVec::iterator it = _attributes.begin(); it != _attributes.end(); ++it, ++cur)
- {
- if (cur == i)
- {
- _attributes.erase(it);
- break;
- }
- }
-}
-
-
-void AttributesImpl::removeAttribute(const XMLString& qname)
-{
- for (AttributeVec::iterator it = _attributes.begin(); it != _attributes.end(); ++it)
- {
- if (it->qname == qname)
- {
- _attributes.erase(it);
- break;
- }
- }
-}
-
-
-void AttributesImpl::removeAttribute(const XMLString& namespaceURI, const XMLString& localName)
-{
- for (AttributeVec::iterator it = _attributes.begin(); it != _attributes.end(); ++it)
- {
- if (it->namespaceURI == namespaceURI && it->localName == localName)
- {
- _attributes.erase(it);
- break;
- }
- }
-}
-
-
-void AttributesImpl::clear()
-{
- _attributes.clear();
-}
-
-
-void AttributesImpl::reserve(std::size_t capacity)
-{
- _attributes.reserve(capacity);
-}
-
-
-void AttributesImpl::setLocalName(int i, const XMLString& localName)
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- _attributes[i].localName = localName;
-}
-
-
-void AttributesImpl::setQName(int i, const XMLString& qname)
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- _attributes[i].qname = qname;
-}
-
-
-void AttributesImpl::setType(int i, const XMLString& type)
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- _attributes[i].type = type;
-}
-
-
-void AttributesImpl::setURI(int i, const XMLString& namespaceURI)
-{
- poco_assert (0 <= i && i < static_cast<int>(_attributes.size()));
- _attributes[i].namespaceURI = namespaceURI;
-}
-
-
-AttributesImpl::Attribute* AttributesImpl::find(const XMLString& qname) const
-{
- for (AttributeVec::const_iterator it = _attributes.begin(); it != _attributes.end(); ++it)
- {
- if (it->qname == qname)
- return const_cast<Attribute*>(&(*it));
- }
- return 0;
-}
-
-
-AttributesImpl::Attribute* AttributesImpl::find(const XMLString& namespaceURI, const XMLString& localName) const
-{
- for (AttributeVec::const_iterator it = _attributes.begin(); it != _attributes.end(); ++it)
- {
- if (it->namespaceURI == namespaceURI && it->localName == localName)
- return const_cast<Attribute*>(&(*it));
- }
- return 0;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/CDATASection.cpp b/Utilities/Poco/XML/src/CDATASection.cpp
deleted file mode 100755
index be28e31a83..0000000000
--- a/Utilities/Poco/XML/src/CDATASection.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// CDATASection.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/CDATASection.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/DOMException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString CDATASection::NODE_NAME = toXMLString("#cdata-section");
-
-
-CDATASection::CDATASection(Document* pOwnerDocument, const XMLString& data):
- Text(pOwnerDocument, data)
-{
-}
-
-
-CDATASection::CDATASection(Document* pOwnerDocument, const CDATASection& sec):
- Text(pOwnerDocument, sec)
-{
-}
-
-
-CDATASection::~CDATASection()
-{
-}
-
-
-Text* CDATASection::splitText(unsigned long offset)
-{
- Node* pParent = parentNode();
- if (!pParent) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
- int n = length() - offset;
- Text* pNew = ownerDocument()->createCDATASection(substringData(offset, n));
- deleteData(offset, n);
- pParent->insertBefore(pNew, nextSibling())->release();
- return pNew;
-}
-
-
-const XMLString& CDATASection::nodeName() const
-{
- return NODE_NAME;
-}
-
-
-unsigned short CDATASection::nodeType() const
-{
- return Node::CDATA_SECTION_NODE;
-}
-
-
-Node* CDATASection::copyNode(bool deep, Document* pOwnerDocument) const
-{
- return new CDATASection(pOwnerDocument, *this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/CharacterData.cpp b/Utilities/Poco/XML/src/CharacterData.cpp
deleted file mode 100755
index f00e05381d..0000000000
--- a/Utilities/Poco/XML/src/CharacterData.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// CharacterData.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/CharacterData.h"
-#include "Poco/DOM/DOMException.h"
-#include "Poco/String.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-CharacterData::CharacterData(Document* pOwnerDocument, const XMLString& data):
- AbstractNode(pOwnerDocument),
- _data(data)
-{
-}
-
-
-CharacterData::CharacterData(Document* pOwnerDocument, const CharacterData& data):
- AbstractNode(pOwnerDocument, data),
- _data(data._data)
-{
-}
-
-
-CharacterData::~CharacterData()
-{
-}
-
-
-void CharacterData::setData(const XMLString& data)
-{
- XMLString oldData = getData();
- _data = data;
- if (events()) dispatchCharacterDataModified(oldData, _data);
-}
-
-
-XMLString CharacterData::substringData(unsigned long offset, unsigned long count) const
-{
- if (offset >= _data.length())
- throw DOMException(DOMException::INDEX_SIZE_ERR);
-
- return _data.substr(offset, count);
-}
-
-
-void CharacterData::appendData(const XMLString& arg)
-{
- XMLString oldData = _data;
- _data.append(arg);
- if (events()) dispatchCharacterDataModified(oldData, _data);
-}
-
-
-void CharacterData::insertData(unsigned long offset, const XMLString& arg)
-{
- if (offset > _data.length())
- throw DOMException(DOMException::INDEX_SIZE_ERR);
-
- XMLString oldData = _data;
- _data.insert(offset, arg);
- if (events()) dispatchCharacterDataModified(oldData, _data);
-}
-
-
-void CharacterData::deleteData(unsigned long offset, unsigned long count)
-{
- if (offset >= _data.length())
- throw DOMException(DOMException::INDEX_SIZE_ERR);
-
- XMLString oldData = _data;
- _data.replace(offset, count, EMPTY_STRING);
- if (events()) dispatchCharacterDataModified(oldData, _data);
-}
-
-
-void CharacterData::replaceData(unsigned long offset, unsigned long count, const XMLString& arg)
-{
- if (offset >= _data.length())
- throw DOMException(DOMException::INDEX_SIZE_ERR);
-
- XMLString oldData = _data;
- _data.replace(offset, count, arg);
- if (events()) dispatchCharacterDataModified(oldData, _data);
-}
-
-
-const XMLString& CharacterData::getNodeValue() const
-{
- return _data;
-}
-
-
-void CharacterData::setNodeValue(const XMLString& value)
-{
- setData(value);
-}
-
-
-XMLString CharacterData::trimmedData() const
-{
- return Poco::trim(_data);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/ChildNodesList.cpp b/Utilities/Poco/XML/src/ChildNodesList.cpp
deleted file mode 100755
index 4005c0adef..0000000000
--- a/Utilities/Poco/XML/src/ChildNodesList.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// ChildNodesList.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/ChildNodesList.h"
-#include "Poco/DOM/Node.h"
-#include "Poco/DOM/Document.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-ChildNodesList::ChildNodesList(const Node* pParent):
- _pParent(pParent)
-{
- poco_check_ptr (pParent);
-
- _pParent->duplicate();
-}
-
-
-ChildNodesList::~ChildNodesList()
-{
- _pParent->release();
-}
-
-
-Node* ChildNodesList::item(unsigned long index) const
-{
- unsigned long n = 0;
- Node* pCur = _pParent->firstChild();
- while (pCur && n++ < index)
- {
- pCur = pCur->nextSibling();
- }
- return pCur;
-}
-
-
-unsigned long ChildNodesList::length() const
-{
- unsigned long n = 0;
- Node* pCur = _pParent->firstChild();
- while (pCur)
- {
- ++n;
- pCur = pCur->nextSibling();
- }
- return n;
-}
-
-
-void ChildNodesList::autoRelease()
-{
- _pParent->ownerDocument()->autoReleasePool().add(this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Comment.cpp b/Utilities/Poco/XML/src/Comment.cpp
deleted file mode 100755
index 961c8af1cb..0000000000
--- a/Utilities/Poco/XML/src/Comment.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// Comment.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/Comment.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString Comment::NODE_NAME = toXMLString("#comment");
-
-
-Comment::Comment(Document* pOwnerDocument, const XMLString& data):
- CharacterData(pOwnerDocument, data)
-{
-}
-
-
-Comment::Comment(Document* pOwnerDocument, const Comment& comment):
- CharacterData(pOwnerDocument, comment)
-{
-}
-
-
-Comment::~Comment()
-{
-}
-
-
-const XMLString& Comment::nodeName() const
-{
- return NODE_NAME;
-}
-
-
-unsigned short Comment::nodeType() const
-{
- return Node::COMMENT_NODE;
-}
-
-
-Node* Comment::copyNode(bool deep, Document* pOwnerDocument) const
-{
- return new Comment(pOwnerDocument, *this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/ContentHandler.cpp b/Utilities/Poco/XML/src/ContentHandler.cpp
deleted file mode 100755
index 51f7e772c7..0000000000
--- a/Utilities/Poco/XML/src/ContentHandler.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// ContentHandler.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/ContentHandler.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-ContentHandler::~ContentHandler()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DOMBuilder.cpp b/Utilities/Poco/XML/src/DOMBuilder.cpp
deleted file mode 100755
index f95b564a2d..0000000000
--- a/Utilities/Poco/XML/src/DOMBuilder.cpp
+++ /dev/null
@@ -1,334 +0,0 @@
-//
-// DOMBuilder.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMBuilder
-//
-// Copyright (c) 2004-2006, 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/DOM/DOMBuilder.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/DocumentType.h"
-#include "Poco/DOM/CharacterData.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/DOM/Comment.h"
-#include "Poco/DOM/CDATASection.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Attr.h"
-#include "Poco/DOM/Entity.h"
-#include "Poco/DOM/EntityReference.h"
-#include "Poco/DOM/Notation.h"
-#include "Poco/DOM/ProcessingInstruction.h"
-#include "Poco/DOM/AutoPtr.h"
-#include "Poco/SAX/XMLReader.h"
-#include "Poco/SAX/AttributesImpl.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString DOMBuilder::EMPTY_STRING;
-
-
-DOMBuilder::DOMBuilder(XMLReader& xmlReader, NamePool* pNamePool):
- _xmlReader(xmlReader),
- _pNamePool(pNamePool),
- _pDocument(0),
- _pParent(0),
- _pPrevious(0),
- _inCDATA(false),
- _namespaces(true)
-{
- _xmlReader.setContentHandler(this);
- _xmlReader.setDTDHandler(this);
- _xmlReader.setProperty(XMLReader::PROPERTY_LEXICAL_HANDLER, static_cast<LexicalHandler*>(this));
-
- if (_pNamePool) _pNamePool->duplicate();
-}
-
-
-DOMBuilder::~DOMBuilder()
-{
- if (_pNamePool) _pNamePool->release();
-}
-
-
-Document* DOMBuilder::parse(const XMLString& uri)
-{
- setupParse();
- _pDocument->suspendEvents();
- try
- {
- _xmlReader.parse(uri);
- }
- catch (...)
- {
- _pDocument->release();
- _pDocument = 0;
- _pParent = 0;
- _pPrevious = 0;
- throw;
- }
- _pDocument->resumeEvents();
- _pDocument->collectGarbage();
- return _pDocument;
-}
-
-
-Document* DOMBuilder::parse(InputSource* pInputSource)
-{
- setupParse();
- _pDocument->suspendEvents();
- try
- {
- _xmlReader.parse(pInputSource);
- }
- catch (...)
- {
- _pDocument->release();
- _pDocument = 0;
- _pParent = 0;
- _pPrevious = 0;
- throw;
- }
- _pDocument->resumeEvents();
- _pDocument->collectGarbage();
- return _pDocument;
-}
-
-
-Document* DOMBuilder::parseMemoryNP(const char* xml, std::size_t size)
-{
- setupParse();
- _pDocument->suspendEvents();
- try
- {
- _xmlReader.parseMemoryNP(xml, size);
- }
- catch (...)
- {
- _pDocument->release();
- _pDocument = 0;
- _pParent = 0;
- _pPrevious = 0;
- throw;
- }
- _pDocument->resumeEvents();
- _pDocument->collectGarbage();
- return _pDocument;
-}
-
-
-void DOMBuilder::setupParse()
-{
- _pDocument = new Document(_pNamePool);
- _pParent = _pDocument;
- _pPrevious = 0;
- _inCDATA = false;
- _namespaces = _xmlReader.getFeature(XMLReader::FEATURE_NAMESPACES);
-}
-
-
-inline void DOMBuilder::appendNode(AbstractNode* pNode)
-{
- if (_pPrevious && _pPrevious != _pParent)
- {
- _pPrevious->_pNext = pNode;
- pNode->_pParent = _pParent;
- pNode->duplicate();
- }
- else _pParent->appendChild(pNode);
- _pPrevious = pNode;
-}
-
-
-void DOMBuilder::notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId)
-{
- DocumentType* pDoctype = _pDocument->getDoctype();
- if (pDoctype)
- {
- AutoPtr<Notation> pNotation = _pDocument->createNotation(name, (publicId ? *publicId : EMPTY_STRING), (systemId ? *systemId : EMPTY_STRING));
- pDoctype->appendChild(pNotation);
- }
-}
-
-
-void DOMBuilder::unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName)
-{
- DocumentType* pDoctype = _pDocument->getDoctype();
- if (pDoctype)
- {
- AutoPtr<Entity> pEntity = _pDocument->createEntity(name, publicId ? *publicId : EMPTY_STRING, systemId, notationName);
- pDoctype->appendChild(pEntity);
- }
-}
-
-
-void DOMBuilder::setDocumentLocator(const Locator* loc)
-{
-}
-
-
-void DOMBuilder::startDocument()
-{
-}
-
-
-void DOMBuilder::endDocument()
-{
-}
-
-
-void DOMBuilder::startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attributes)
-{
- AutoPtr<Element> pElem = _namespaces ? _pDocument->createElementNS(uri, qname.empty() ? localName : qname) : _pDocument->createElement(qname);
-
- const AttributesImpl& attrs = dynamic_cast<const AttributesImpl&>(attributes);
- Attr* pPrevAttr = 0;
- for (AttributesImpl::iterator it = attrs.begin(); it != attrs.end(); ++it)
- {
- AutoPtr<Attr> pAttr = new Attr(_pDocument, 0, it->namespaceURI, it->localName, it->qname, it->value, it->specified);
- pPrevAttr = pElem->addAttributeNodeNP(pPrevAttr, pAttr);
- }
- appendNode(pElem);
- _pParent = pElem;
-}
-
-
-void DOMBuilder::endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname)
-{
- _pPrevious = _pParent;
- _pParent = static_cast<AbstractContainerNode*>(_pParent->parentNode());
-}
-
-
-void DOMBuilder::characters(const XMLChar ch[], int start, int length)
-{
- if (_inCDATA)
- {
- if (_pPrevious && _pPrevious->nodeType() == Node::CDATA_SECTION_NODE)
- {
- static_cast<CDATASection*>(_pPrevious)->appendData(XMLString(ch + start, length));
- }
- else
- {
- AutoPtr<CDATASection> pCDATA = _pDocument->createCDATASection(XMLString(ch + start, length));
- appendNode(pCDATA);
- }
- }
- else
- {
- if (_pPrevious && _pPrevious->nodeType() == Node::TEXT_NODE)
- {
- static_cast<Text*>(_pPrevious)->appendData(XMLString(ch + start, length));
- }
- else
- {
- AutoPtr<Text> pText = _pDocument->createTextNode(XMLString(ch + start, length));
- appendNode(pText);
- }
- }
-}
-
-
-void DOMBuilder::ignorableWhitespace(const XMLChar ch[], int start, int length)
-{
- characters(ch, start, length);
-}
-
-
-void DOMBuilder::processingInstruction(const XMLString& target, const XMLString& data)
-{
- AutoPtr<ProcessingInstruction> pPI = _pDocument->createProcessingInstruction(target, data);
- appendNode(pPI);
-}
-
-
-void DOMBuilder::startPrefixMapping(const XMLString& prefix, const XMLString& uri)
-{
-}
-
-
-void DOMBuilder::endPrefixMapping(const XMLString& prefix)
-{
-}
-
-
-void DOMBuilder::skippedEntity(const XMLString& name)
-{
- AutoPtr<EntityReference> pER = _pDocument->createEntityReference(name);
- appendNode(pER);
-}
-
-
-void DOMBuilder::startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId)
-{
- AutoPtr<DocumentType> pDoctype = new DocumentType(_pDocument, name, publicId, systemId);
- _pDocument->setDoctype(pDoctype);
-}
-
-
-void DOMBuilder::endDTD()
-{
-}
-
-
-void DOMBuilder::startEntity(const XMLString& name)
-{
-}
-
-
-void DOMBuilder::endEntity(const XMLString& name)
-{
-}
-
-
-void DOMBuilder::startCDATA()
-{
- _inCDATA = true;
-}
-
-
-void DOMBuilder::endCDATA()
-{
- _inCDATA = false;
-}
-
-
-void DOMBuilder::comment(const XMLChar ch[], int start, int length)
-{
- AutoPtr<Comment> pComment = _pDocument->createComment(XMLString(ch + start, length));
- appendNode(pComment);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DOMException.cpp b/Utilities/Poco/XML/src/DOMException.cpp
deleted file mode 100755
index f4a63d8218..0000000000
--- a/Utilities/Poco/XML/src/DOMException.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// DOMException.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/DOMException.h"
-#include <typeinfo>
-
-
-namespace Poco {
-namespace XML {
-
-
-const std::string DOMException::MESSAGES[_NUMBER_OF_MESSAGES] =
-{
- "Invalid DOM exception code",
- "Index or size is negative or greater than allowed value",
- "The specified range of text does not fit into a DOMString",
- "A node is inserted somewhere it doesn't belong",
- "A node is used in a different document than the one that created it",
- "An invalid character is specified",
- "Data is specified for a node which does not support data",
- "An attempt is made to modify an object where modifications are not allowed",
- "An attempt was made to reference a node in a context where it does not exist",
- "The implementation does not support the type of object requested",
- "An attempt is made to add an attribute that is already in use elsewhere",
- "A parameter or an operation is not supported by the underlying object",
- "An invalid or illegal string is specified",
- "An attempt is made to modify the type of the underlying object",
- "An attempt is made to create or change an object in a way which is incorrect with regard to namespaces",
- "An attempt is made to use an object that is not, or is no longer, usable"
-};
-
-
-DOMException::DOMException(unsigned short code):
- XMLException(message(code)),
- _code(code)
-{
-}
-
-
-DOMException::DOMException(const DOMException& exc):
- XMLException(exc),
- _code(exc._code)
-{
-}
-
-
-DOMException::~DOMException() throw()
-{
-}
-
-
-DOMException& DOMException::operator = (const DOMException& exc)
-{
- if (&exc != this)
- {
- XMLException::operator = (exc);
- _code = exc._code;
- }
- return *this;
-}
-
-
-const char* DOMException::name() const throw()
-{
- return "DOMException";
-}
-
-
-const char* DOMException::className() const throw()
-{
- return typeid(*this).name();
-}
-
-
-Poco::Exception* DOMException::clone() const
-{
- return new DOMException(*this);
-}
-
-
-void DOMException::rethrow() const
-{
- throw *this;
-}
-
-
-const std::string& DOMException::message(unsigned short code)
-{
- if (code >= 1 && code < _NUMBER_OF_MESSAGES)
- return MESSAGES[code];
- else
- return MESSAGES[0];
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DOMImplementation.cpp b/Utilities/Poco/XML/src/DOMImplementation.cpp
deleted file mode 100755
index 177f95fe60..0000000000
--- a/Utilities/Poco/XML/src/DOMImplementation.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// DOMImplementation.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/DOMImplementation.h"
-#include "Poco/DOM/DocumentType.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/String.h"
-#include "Poco/SingletonHolder.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString DOMImplementation::FEATURE_XML = toXMLString("xml");
-const XMLString DOMImplementation::FEATURE_CORE = toXMLString("core");
-const XMLString DOMImplementation::FEATURE_EVENTS = toXMLString("events");
-const XMLString DOMImplementation::FEATURE_MUTATIONEVENTS = toXMLString("mutationevents");
-const XMLString DOMImplementation::FEATURE_TRAVERSAL = toXMLString("traversal");
-const XMLString DOMImplementation::VERSION_1_0 = toXMLString("1.0");
-const XMLString DOMImplementation::VERSION_2_0 = toXMLString("2.0");
-
-
-DOMImplementation::DOMImplementation()
-{
-}
-
-
-DOMImplementation::~DOMImplementation()
-{
-}
-
-
-bool DOMImplementation::hasFeature(const XMLString& feature, const XMLString& version) const
-{
- XMLString lcFeature = Poco::toLower(feature);
- return (lcFeature == FEATURE_XML && version == VERSION_1_0) ||
- (lcFeature == FEATURE_CORE && version == VERSION_2_0) ||
- (lcFeature == FEATURE_EVENTS && version == VERSION_2_0) ||
- (lcFeature == FEATURE_MUTATIONEVENTS && version == VERSION_2_0) ||
- (lcFeature == FEATURE_TRAVERSAL && version == VERSION_2_0);
-}
-
-
-DocumentType* DOMImplementation::createDocumentType(const XMLString& name, const XMLString& publicId, const XMLString& systemId) const
-{
- return new DocumentType(0, name, publicId, systemId);
-}
-
-
-Document* DOMImplementation::createDocument(const XMLString& namespaceURI, const XMLString& qualifiedName, DocumentType* doctype) const
-{
- Document* pDoc = new Document(doctype);
- if (namespaceURI.empty())
- pDoc->appendChild(pDoc->createElement(qualifiedName))->release();
- else
- pDoc->appendChild(pDoc->createElementNS(namespaceURI, qualifiedName))->release();
- return pDoc;
-}
-
-
-const DOMImplementation& DOMImplementation::instance()
-{
- static Poco::SingletonHolder<DOMImplementation> sh;
- return *sh.get();
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DOMObject.cpp b/Utilities/Poco/XML/src/DOMObject.cpp
deleted file mode 100755
index b0527a803c..0000000000
--- a/Utilities/Poco/XML/src/DOMObject.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// DOMObject.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/DOMObject.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-DOMObject::DOMObject(): _rc(1)
-{
-}
-
-
-DOMObject::~DOMObject()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DOMParser.cpp b/Utilities/Poco/XML/src/DOMParser.cpp
deleted file mode 100755
index 5f08512444..0000000000
--- a/Utilities/Poco/XML/src/DOMParser.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-//
-// DOMParser.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMParser
-//
-// Copyright (c) 2004-2006, 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/DOM/DOMParser.h"
-#include "Poco/DOM/DOMBuilder.h"
-#include "Poco/SAX/WhitespaceFilter.h"
-#include "Poco/SAX/InputSource.h"
-#include "Poco/XML/NamePool.h"
-#include <sstream>
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString DOMParser::FEATURE_WHITESPACE = toXMLString("http://www.appinf.com/features/no-whitespace-in-element-content");
-
-
-DOMParser::DOMParser(NamePool* pNamePool):
- _pNamePool(pNamePool),
- _whitespace(true)
-{
- if (_pNamePool) _pNamePool->duplicate();
- _saxParser.setFeature(XMLReader::FEATURE_NAMESPACES, true);
- _saxParser.setFeature(XMLReader::FEATURE_NAMESPACE_PREFIXES, true);
-}
-
-
-DOMParser::~DOMParser()
-{
- if (_pNamePool) _pNamePool->release();
-}
-
-
-void DOMParser::setEncoding(const XMLString& encoding)
-{
- _saxParser.setEncoding(encoding);
-}
-
-
-const XMLString& DOMParser::getEncoding() const
-{
- return _saxParser.getEncoding();
-}
-
-
-void DOMParser::addEncoding(const XMLString& name, Poco::TextEncoding* pEncoding)
-{
- _saxParser.addEncoding(name, pEncoding);
-}
-
-
-void DOMParser::setFeature(const XMLString& name, bool state)
-{
- if (name == FEATURE_WHITESPACE)
- _whitespace = state;
- else
- _saxParser.setFeature(name, state);
-}
-
-
-bool DOMParser::getFeature(const XMLString& name) const
-{
- if (name == FEATURE_WHITESPACE)
- return _whitespace;
- else
- return _saxParser.getFeature(name);
-}
-
-
-Document* DOMParser::parse(const XMLString& uri)
-{
- if (_whitespace)
- {
- DOMBuilder builder(_saxParser, _pNamePool);
- return builder.parse(uri);
- }
- else
- {
- WhitespaceFilter filter(&_saxParser);
- DOMBuilder builder(filter, _pNamePool);
- return builder.parse(uri);
- }
-}
-
-
-Document* DOMParser::parse(InputSource* pInputSource)
-{
- if (_whitespace)
- {
- DOMBuilder builder(_saxParser, _pNamePool);
- return builder.parse(pInputSource);
- }
- else
- {
- WhitespaceFilter filter(&_saxParser);
- DOMBuilder builder(filter, _pNamePool);
- return builder.parse(pInputSource);
- }
-}
-
-
-Document* DOMParser::parseString(const std::string& xml)
-{
- return parseMemory(xml.data(), xml.size());
-}
-
-
-Document* DOMParser::parseMemory(const char* xml, std::size_t size)
-{
- if (_whitespace)
- {
- DOMBuilder builder(_saxParser, _pNamePool);
- return builder.parseMemoryNP(xml, size);
- }
- else
- {
- WhitespaceFilter filter(&_saxParser);
- DOMBuilder builder(filter, _pNamePool);
- return builder.parseMemoryNP(xml, size);
- }
-}
-
-
-EntityResolver* DOMParser::getEntityResolver() const
-{
- return _saxParser.getEntityResolver();
-}
-
-
-void DOMParser::setEntityResolver(EntityResolver* pEntityResolver)
-{
- _saxParser.setEntityResolver(pEntityResolver);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DOMSerializer.cpp b/Utilities/Poco/XML/src/DOMSerializer.cpp
deleted file mode 100755
index 2fda35fb74..0000000000
--- a/Utilities/Poco/XML/src/DOMSerializer.cpp
+++ /dev/null
@@ -1,345 +0,0 @@
-//
-// DOMSerializer.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMSerializer
-//
-// Copyright (c) 2004-2006, 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/DOM/DOMSerializer.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/DocumentType.h"
-#include "Poco/DOM/DocumentFragment.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Attr.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/DOM/CDATASection.h"
-#include "Poco/DOM/Comment.h"
-#include "Poco/DOM/ProcessingInstruction.h"
-#include "Poco/DOM/Entity.h"
-#include "Poco/DOM/Notation.h"
-#include "Poco/DOM/NamedNodeMap.h"
-#include "Poco/DOM/AutoPtr.h"
-#include "Poco/SAX/EntityResolver.h"
-#include "Poco/SAX/DTDHandler.h"
-#include "Poco/SAX/ContentHandler.h"
-#include "Poco/SAX/LexicalHandler.h"
-#include "Poco/SAX/AttributesImpl.h"
-#include "Poco/SAX/ErrorHandler.h"
-#include "Poco/SAX/SAXException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString DOMSerializer::CDATA = toXMLString("CDATA");
-
-
-DOMSerializer::DOMSerializer():
- _pEntityResolver(0),
- _pDTDHandler(0),
- _pContentHandler(0),
- _pErrorHandler(0),
- _pDeclHandler(0),
- _pLexicalHandler(0)
-{
-}
-
-
-DOMSerializer::~DOMSerializer()
-{
-}
-
-
-void DOMSerializer::setEntityResolver(EntityResolver* pEntityResolver)
-{
- _pEntityResolver = pEntityResolver;
-}
-
-
-EntityResolver* DOMSerializer::getEntityResolver() const
-{
- return _pEntityResolver;
-}
-
-
-void DOMSerializer::setDTDHandler(DTDHandler* pDTDHandler)
-{
- _pDTDHandler = pDTDHandler;
-}
-
-
-DTDHandler* DOMSerializer::getDTDHandler() const
-{
- return _pDTDHandler;
-}
-
-
-void DOMSerializer::setContentHandler(ContentHandler* pContentHandler)
-{
- _pContentHandler = pContentHandler;
-}
-
-
-ContentHandler* DOMSerializer::getContentHandler() const
-{
- return _pContentHandler;
-}
-
-
-void DOMSerializer::setErrorHandler(ErrorHandler* pErrorHandler)
-{
- _pErrorHandler = pErrorHandler;
-}
-
-
-ErrorHandler* DOMSerializer::getErrorHandler() const
-{
- return _pErrorHandler;
-}
-
-
-void DOMSerializer::setFeature(const XMLString& featureId, bool state)
-{
- if (featureId == XMLReader::FEATURE_NAMESPACES)
- throw SAXNotSupportedException(fromXMLString(XMLReader::FEATURE_NAMESPACES));
- else if (featureId == XMLReader::FEATURE_NAMESPACE_PREFIXES)
- throw SAXNotSupportedException(fromXMLString(XMLReader::FEATURE_NAMESPACE_PREFIXES));
- else
- throw SAXNotRecognizedException(fromXMLString(featureId));
-}
-
-
-bool DOMSerializer::getFeature(const XMLString& featureId) const
-{
- if (featureId == XMLReader::FEATURE_NAMESPACES)
- throw SAXNotSupportedException(fromXMLString(XMLReader::FEATURE_NAMESPACES));
- else if (featureId == XMLReader::FEATURE_NAMESPACE_PREFIXES)
- throw SAXNotSupportedException(fromXMLString(XMLReader::FEATURE_NAMESPACE_PREFIXES));
- else
- throw SAXNotRecognizedException(fromXMLString(featureId));
-}
-
-
-void DOMSerializer::setProperty(const XMLString& propertyId, const XMLString& value)
-{
- if (propertyId == XMLReader::PROPERTY_DECLARATION_HANDLER || propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
- throw SAXNotSupportedException(std::string("property does not take a string value: ") + fromXMLString(propertyId));
- else
- throw SAXNotRecognizedException(fromXMLString(propertyId));
-}
-
-
-void DOMSerializer::setProperty(const XMLString& propertyId, void* value)
-{
- if (propertyId == XMLReader::PROPERTY_DECLARATION_HANDLER)
- _pDeclHandler = reinterpret_cast<DeclHandler*>(value);
- else if (propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
- _pLexicalHandler = reinterpret_cast<LexicalHandler*>(value);
- else throw SAXNotRecognizedException(fromXMLString(propertyId));
-}
-
-
-void* DOMSerializer::getProperty(const XMLString& propertyId) const
-{
- if (propertyId == XMLReader::PROPERTY_DECLARATION_HANDLER)
- return _pDeclHandler;
- else if (propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
- return _pLexicalHandler;
- else throw SAXNotSupportedException(fromXMLString(propertyId));
-}
-
-
-void DOMSerializer::serialize(const Node* pNode)
-{
- poco_check_ptr (pNode);
-
- handleNode(pNode);
-}
-
-
-void DOMSerializer::parse(InputSource* pSource)
-{
- throw XMLException("The DOMSerializer cannot parse an InputSource");
-}
-
-
-void DOMSerializer::parse(const XMLString& systemId)
-{
- throw XMLException("The DOMSerializer cannot parse from a system identifier");
-}
-
-
-void DOMSerializer::parseMemoryNP(const char* xml, std::size_t size)
-{
- throw XMLException("The DOMSerializer cannot parse from memory");
-}
-
-
-void DOMSerializer::iterate(const Node* pNode) const
-{
- while (pNode)
- {
- handleNode(pNode);
- pNode = pNode->nextSibling();
- }
-}
-
-
-void DOMSerializer::handleNode(const Node* pNode) const
-{
- switch (pNode->nodeType())
- {
- case Node::ELEMENT_NODE:
- handleElement(static_cast<const Element*>(pNode));
- break;
- case Node::TEXT_NODE:
- handleCharacterData(static_cast<const Text*>(pNode));
- break;
- case Node::CDATA_SECTION_NODE:
- handleCDATASection(static_cast<const CDATASection*>(pNode));
- break;
- case Node::ENTITY_NODE:
- handleEntity(static_cast<const Entity*>(pNode));
- break;
- case Node::PROCESSING_INSTRUCTION_NODE:
- handlePI(static_cast<const ProcessingInstruction*>(pNode));
- break;
- case Node::COMMENT_NODE:
- handleComment(static_cast<const Comment*>(pNode));
- break;
- case Node::DOCUMENT_NODE:
- handleDocument(static_cast<const Document*>(pNode));
- break;
- case Node::DOCUMENT_TYPE_NODE:
- handleDocumentType(static_cast<const DocumentType*>(pNode));
- break;
- case Node::DOCUMENT_FRAGMENT_NODE:
- handleFragment(static_cast<const DocumentFragment*>(pNode));
- break;
- case Node::NOTATION_NODE:
- handleNotation(static_cast<const Notation*>(pNode));
- break;
- }
-}
-
-
-void DOMSerializer::handleElement(const Element* pElement) const
-{
- if (_pContentHandler)
- {
- AutoPtr<NamedNodeMap> pAttrs = pElement->attributes();
- AttributesImpl saxAttrs;
- for (unsigned long i = 0; i < pAttrs->length(); ++i)
- {
- Attr* pAttr = static_cast<Attr*>(pAttrs->item(i));
- saxAttrs.addAttribute(pAttr->namespaceURI(), pAttr->localName(), pAttr->nodeName(), CDATA, pAttr->value(), pAttr->specified());
- }
- _pContentHandler->startElement(pElement->namespaceURI(), pElement->localName(), pElement->tagName(), saxAttrs);
- }
- iterate(pElement->firstChild());
- if (_pContentHandler)
- _pContentHandler->endElement(pElement->namespaceURI(), pElement->localName(), pElement->tagName());
-}
-
-
-void DOMSerializer::handleCharacterData(const Text* pText) const
-{
- if (_pContentHandler)
- {
- const XMLString& data = pText->data();
- _pContentHandler->characters(data.c_str(), 0, (int) data.length());
- }
-}
-
-
-void DOMSerializer::handleComment(const Comment* pComment) const
-{
- if (_pLexicalHandler)
- {
- const XMLString& data = pComment->data();
- _pLexicalHandler->comment(data.c_str(), 0, (int) data.length());
- }
-}
-
-
-void DOMSerializer::handlePI(const ProcessingInstruction* pPI) const
-{
- if (_pContentHandler) _pContentHandler->processingInstruction(pPI->target(), pPI->data());
-}
-
-
-void DOMSerializer::handleCDATASection(const CDATASection* pCDATA) const
-{
- if (_pLexicalHandler) _pLexicalHandler->startCDATA();
- handleCharacterData(pCDATA);
- if (_pLexicalHandler) _pLexicalHandler->endCDATA();
-}
-
-
-void DOMSerializer::handleDocument(const Document* pDocument) const
-{
- if (_pContentHandler) _pContentHandler->startDocument();
- const DocumentType* pDoctype = pDocument->doctype();
- if (pDoctype) handleDocumentType(pDoctype);
- iterate(pDocument->firstChild());
- if (_pContentHandler) _pContentHandler->endDocument();
-}
-
-
-void DOMSerializer::handleDocumentType(const DocumentType* pDocumentType) const
-{
- if (_pLexicalHandler) _pLexicalHandler->startDTD(pDocumentType->name(), pDocumentType->publicId(), pDocumentType->systemId());
- iterate(pDocumentType->firstChild());
- if (_pLexicalHandler) _pLexicalHandler->endDTD();
-}
-
-
-void DOMSerializer::handleFragment(const DocumentFragment* pFragment) const
-{
- iterate(pFragment->firstChild());
-}
-
-
-void DOMSerializer::handleNotation(const Notation* pNotation) const
-{
- if (_pDTDHandler) _pDTDHandler->notationDecl(pNotation->nodeName(), &pNotation->publicId(), &pNotation->systemId());
-}
-
-
-void DOMSerializer::handleEntity(const Entity* pEntity) const
-{
- if (_pDTDHandler) _pDTDHandler->unparsedEntityDecl(pEntity->nodeName(), &pEntity->publicId(), pEntity->systemId(), pEntity->notationName());
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DOMWriter.cpp b/Utilities/Poco/XML/src/DOMWriter.cpp
deleted file mode 100755
index 3cf6ce039b..0000000000
--- a/Utilities/Poco/XML/src/DOMWriter.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// DOMWriter.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMWriter
-//
-// Copyright (c) 2004-2006, 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/DOM/DOMWriter.h"
-#include "Poco/XML/XMLWriter.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/DocumentFragment.h"
-#include "Poco/DOM/DocumentType.h"
-#include "Poco/DOM/DOMException.h"
-#include "Poco/DOM/DOMSerializer.h"
-#include "Poco/SAX/LexicalHandler.h"
-#include "Poco/XML/XMLException.h"
-#include "Poco/Path.h"
-#include "Poco/FileStream.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-DOMWriter::DOMWriter():
- _pTextEncoding(0),
- _options(0)
-{
-}
-
-
-DOMWriter::~DOMWriter()
-{
-}
-
-
-void DOMWriter::setEncoding(const std::string& encodingName, Poco::TextEncoding& textEncoding)
-{
- _encodingName = encodingName;
- _pTextEncoding = &textEncoding;
-}
-
-
-void DOMWriter::setOptions(int options)
-{
- _options = options;
-}
-
-
-void DOMWriter::setNewLine(const std::string& newLine)
-{
- _newLine = newLine;
-}
-
-
-void DOMWriter::writeNode(XMLByteOutputStream& ostr, const Node* pNode)
-{
- poco_check_ptr (pNode);
-
- bool isFragment = pNode->nodeType() != Node::DOCUMENT_NODE;
-
- XMLWriter writer(ostr, _options, _encodingName, _pTextEncoding);
- writer.setNewLine(_newLine);
-
- DOMSerializer serializer;
- serializer.setContentHandler(&writer);
- serializer.setDTDHandler(&writer);
- serializer.setProperty(XMLReader::PROPERTY_LEXICAL_HANDLER, static_cast<LexicalHandler*>(&writer));
- if (isFragment) writer.startFragment();
- serializer.serialize(pNode);
- if (isFragment) writer.endFragment();
-}
-
-
-void DOMWriter::writeNode(const std::string& systemId, const Node* pNode)
-{
- Poco::FileOutputStream ostr(systemId);
- if (ostr.good())
- writeNode(ostr, pNode);
- else
- throw Poco::CreateFileException(systemId);
-}
-
-
-} } // namespace Poco::XML
-
diff --git a/Utilities/Poco/XML/src/DTDHandler.cpp b/Utilities/Poco/XML/src/DTDHandler.cpp
deleted file mode 100755
index 8e41d495e1..0000000000
--- a/Utilities/Poco/XML/src/DTDHandler.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// DTDHandler.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/DTDHandler.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-DTDHandler::~DTDHandler()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DTDMap.cpp b/Utilities/Poco/XML/src/DTDMap.cpp
deleted file mode 100755
index 4c90542121..0000000000
--- a/Utilities/Poco/XML/src/DTDMap.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// DTDMap.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/DTDMap.h"
-#include "Poco/DOM/DocumentType.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/DOMException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-DTDMap::DTDMap(const DocumentType* pDocumentType, unsigned short type):
- _pDocumentType(pDocumentType),
- _type(type)
-{
- poco_check_ptr (pDocumentType->ownerDocument());
-}
-
-
-DTDMap::~DTDMap()
-{
-}
-
-
-Node* DTDMap::getNamedItem(const XMLString& name) const
-{
- Node* pCur = _pDocumentType->firstChild();
- while (pCur)
- {
- if (pCur->nodeType() == _type && pCur->nodeName() == name)
- return pCur;
- pCur = pCur->nextSibling();
- }
- return pCur;
-}
-
-
-Node* DTDMap::setNamedItem(Node* arg)
-{
- throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
-}
-
-
-Node* DTDMap::removeNamedItem(const XMLString& name)
-{
- throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
-}
-
-
-Node* DTDMap::item(unsigned long index) const
-{
- unsigned long n = 0;
- Node* pCur = _pDocumentType->firstChild();
- while (pCur)
- {
- if (pCur->nodeType() == _type)
- {
- if (n == index) return pCur;
- ++n;
- }
- pCur = pCur->nextSibling();
- }
- return pCur;
-}
-
-
-unsigned long DTDMap::length() const
-{
- unsigned long n = 0;
- Node* pCur = _pDocumentType->firstChild();
- while (pCur)
- {
- if (pCur->nodeType() == _type) ++n;
- pCur = pCur->nextSibling();
- }
- return n;
-}
-
-
-Node* DTDMap::getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const
-{
- return 0;
-}
-
-
-Node* DTDMap::setNamedItemNS(Node* arg)
-{
- throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
-}
-
-
-Node* DTDMap::removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName)
-{
- throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
-}
-
-
-void DTDMap::autoRelease()
-{
- _pDocumentType->ownerDocument()->autoReleasePool().add(this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DeclHandler.cpp b/Utilities/Poco/XML/src/DeclHandler.cpp
deleted file mode 100755
index b970aa9238..0000000000
--- a/Utilities/Poco/XML/src/DeclHandler.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// DeclHandler.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/DeclHandler.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-DeclHandler::~DeclHandler()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DefaultHandler.cpp b/Utilities/Poco/XML/src/DefaultHandler.cpp
deleted file mode 100755
index 8ef19fda5e..0000000000
--- a/Utilities/Poco/XML/src/DefaultHandler.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// DefaultHandler.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/DefaultHandler.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-DefaultHandler::DefaultHandler()
-{
-}
-
-
-DefaultHandler::~DefaultHandler()
-{
-}
-
-
-InputSource* DefaultHandler::resolveEntity(const XMLString* publicId, const XMLString& systemId)
-{
- return 0;
-}
-
-
-void DefaultHandler::releaseInputSource(InputSource* pSource)
-{
-}
-
-
-void DefaultHandler::notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId)
-{
-}
-
-
-void DefaultHandler::unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName)
-{
-}
-
-
-void DefaultHandler::setDocumentLocator(const Locator* loc)
-{
-}
-
-
-void DefaultHandler::startDocument()
-{
-}
-
-
-void DefaultHandler::endDocument()
-{
-}
-
-
-void DefaultHandler::startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attributes)
-{
-}
-
-
-void DefaultHandler::endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname)
-{
-}
-
-
-void DefaultHandler::characters(const XMLChar ch[], int start, int length)
-{
-}
-
-
-void DefaultHandler::ignorableWhitespace(const XMLChar ch[], int start, int length)
-{
-}
-
-
-void DefaultHandler::processingInstruction(const XMLString& target, const XMLString& data)
-{
-}
-
-
-void DefaultHandler::startPrefixMapping(const XMLString& prefix, const XMLString& uri)
-{
-}
-
-
-void DefaultHandler::endPrefixMapping(const XMLString& prefix)
-{
-}
-
-
-void DefaultHandler::skippedEntity(const XMLString& name)
-{
-}
-
-
-void DefaultHandler::warning(const SAXException& exc)
-{
-}
-
-
-void DefaultHandler::error(const SAXException& exc)
-{
-}
-
-
-void DefaultHandler::fatalError(const SAXException& exc)
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Document.cpp b/Utilities/Poco/XML/src/Document.cpp
deleted file mode 100755
index dc30cb1963..0000000000
--- a/Utilities/Poco/XML/src/Document.cpp
+++ /dev/null
@@ -1,325 +0,0 @@
-//
-// Document.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/Document.h"
-#include "Poco/DOM/DocumentType.h"
-#include "Poco/DOM/DOMImplementation.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Attr.h"
-#include "Poco/DOM/DocumentFragment.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/DOM/Comment.h"
-#include "Poco/DOM/CDATASection.h"
-#include "Poco/DOM/ProcessingInstruction.h"
-#include "Poco/DOM/EntityReference.h"
-#include "Poco/DOM/DOMException.h"
-#include "Poco/DOM/ElementsByTagNameList.h"
-#include "Poco/DOM/Entity.h"
-#include "Poco/DOM/Notation.h"
-#include "Poco/XML/Name.h"
-#include "Poco/XML/NamePool.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString Document::NODE_NAME = toXMLString("#document");
-
-
-Document::Document(NamePool* pNamePool):
- AbstractContainerNode(0),
- _pDocumentType(0),
- _eventSuspendLevel(0)
-{
- if (pNamePool)
- {
- _pNamePool = pNamePool;
- _pNamePool->duplicate();
- }
- else
- {
- _pNamePool = new NamePool;
- }
-}
-
-
-Document::Document(DocumentType* pDocumentType, NamePool* pNamePool):
- AbstractContainerNode(0),
- _pDocumentType(pDocumentType),
- _eventSuspendLevel(0)
-{
- if (pNamePool)
- {
- _pNamePool = pNamePool;
- _pNamePool->duplicate();
- }
- else
- {
- _pNamePool = new NamePool;
- }
- if (_pDocumentType)
- {
- _pDocumentType->duplicate();
- _pDocumentType->setOwnerDocument(this);
- }
-}
-
-
-Document::~Document()
-{
- if (_pDocumentType) _pDocumentType->release();
- _pNamePool->release();
-}
-
-
-bool Document::dispatchEvent(Event* evt)
-{
- return _eventSuspendLevel > 0 || AbstractContainerNode::dispatchEvent(evt);
-}
-
-
-void Document::collectGarbage()
-{
- _autoReleasePool.release();
-}
-
-
-void Document::suspendEvents()
-{
- ++_eventSuspendLevel;
-}
-
-
-void Document::resumeEvents()
-{
- poco_assert_dbg (_eventSuspendLevel > 0);
-
- --_eventSuspendLevel;
-}
-
-
-const DOMImplementation& Document::implementation() const
-{
- return DOMImplementation::instance();
-}
-
-
-Element* Document::documentElement() const
-{
- // Skip non-element nodes before the document element
- Node* pCur = firstChild();
- while (pCur)
- {
- if (dynamic_cast<Element*>(pCur))
- return static_cast<Element*>(pCur);
- pCur = pCur->nextSibling();
- }
- return 0;
-}
-
-
-Element* Document::createElement(const XMLString& tagName) const
-{
- return new Element(const_cast<Document*>(this), EMPTY_STRING, EMPTY_STRING, tagName);
-}
-
-
-DocumentFragment* Document::createDocumentFragment() const
-{
- return new DocumentFragment(const_cast<Document*>(this));
-}
-
-
-Text* Document::createTextNode(const XMLString& data) const
-{
- return new Text(const_cast<Document*>(this), data);
-}
-
-
-Comment* Document::createComment(const XMLString& data) const
-{
- return new Comment(const_cast<Document*>(this), data);
-}
-
-
-CDATASection* Document::createCDATASection(const XMLString& data) const
-{
- return new CDATASection(const_cast<Document*>(this), data);
-}
-
-
-ProcessingInstruction* Document::createProcessingInstruction(const XMLString& target, const XMLString& data) const
-{
- return new ProcessingInstruction(const_cast<Document*>(this), target, data);
-}
-
-
-Attr* Document::createAttribute(const XMLString& name) const
-{
- return new Attr(const_cast<Document*>(this), 0, EMPTY_STRING, EMPTY_STRING, name, EMPTY_STRING);
-}
-
-
-EntityReference* Document::createEntityReference(const XMLString& name) const
-{
- return new EntityReference(const_cast<Document*>(this), name);
-}
-
-
-NodeList* Document::getElementsByTagName(const XMLString& name) const
-{
- return new ElementsByTagNameList(const_cast<Document*>(this), name);
-}
-
-
-const XMLString& Document::nodeName() const
-{
- return NODE_NAME;
-}
-
-
-unsigned short Document::nodeType() const
-{
- return Node::DOCUMENT_NODE;
-}
-
-
-Node* Document::importNode(Node* importedNode, bool deep)
-{
- return static_cast<AbstractNode*>(importedNode)->copyNode(deep, this);
-}
-
-
-Element* Document::createElementNS(const XMLString& namespaceURI, const XMLString& qualifiedName) const
-{
- return new Element(const_cast<Document*>(this), namespaceURI, Name::localName(qualifiedName), qualifiedName);
-}
-
-
-Attr* Document::createAttributeNS(const XMLString& namespaceURI, const XMLString& qualifiedName) const
-{
- return new Attr(const_cast<Document*>(this), 0, namespaceURI, Name::localName(qualifiedName), qualifiedName, EMPTY_STRING);
-}
-
-
-NodeList* Document::getElementsByTagNameNS(const XMLString& namespaceURI, const XMLString& localName) const
-{
- return new ElementsByTagNameListNS(const_cast<Document*>(this), namespaceURI, localName);
-}
-
-
-Element* Document::getElementById(const XMLString& elementId) const
-{
- return 0;
-}
-
-
-Event* Document::createEvent(const XMLString& eventType) const
-{
- if (eventType == MutationEvent::DOMSubtreeModified ||
- eventType == MutationEvent::DOMNodeInserted ||
- eventType == MutationEvent::DOMNodeRemoved ||
- eventType == MutationEvent::DOMNodeRemovedFromDocument ||
- eventType == MutationEvent::DOMNodeInsertedIntoDocument ||
- eventType == MutationEvent::DOMAttrModified ||
- eventType == MutationEvent::DOMCharacterDataModified)
- {
- return new MutationEvent(const_cast<Document*>(this), eventType);
- }
- throw DOMException(DOMException::NOT_SUPPORTED_ERR);
-}
-
-
-Node* Document::copyNode(bool deep, Document* pOwnerDocument) const
-{
- throw DOMException(DOMException::NOT_SUPPORTED_ERR);
-}
-
-
-void Document::setDoctype(DocumentType* pDoctype)
-{
- if (_pDocumentType) _pDocumentType->release();
- _pDocumentType = pDoctype;
- if (_pDocumentType)
- {
- _pDocumentType->duplicate();
- _pDocumentType->setOwnerDocument(this);
- }
-}
-
-
-bool Document::eventsSuspended() const
-{
- return _eventSuspendLevel > 0;
-}
-
-
-bool Document::events() const
-{
- return _eventSuspendLevel == 0;
-}
-
-
-Entity* Document::createEntity(const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName) const
-{
- return new Entity(const_cast<Document*>(this), name, publicId, systemId, notationName);
-}
-
-
-Notation* Document::createNotation(const XMLString& name, const XMLString& publicId, const XMLString& systemId) const
-{
- return new Notation(const_cast<Document*>(this), name, publicId, systemId);
-}
-
-
-Element* Document::getElementById(const XMLString& elementId, const XMLString& idAttribute) const
-{
- Element* pElem = documentElement();
- if (pElem) pElem = pElem->getElementById(elementId, idAttribute);
- return pElem;
-}
-
-
-Element* Document::getElementByIdNS(const XMLString& elementId, const XMLString& idAttributeURI, const XMLString& idAttributeLocalName) const
-{
- Element* pElem = documentElement();
- if (pElem) pElem = pElem->getElementByIdNS(elementId, idAttributeURI, idAttributeLocalName);
- return pElem;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DocumentEvent.cpp b/Utilities/Poco/XML/src/DocumentEvent.cpp
deleted file mode 100755
index 1d9bc36b24..0000000000
--- a/Utilities/Poco/XML/src/DocumentEvent.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// DocumentEvent.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/DocumentEvent.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-DocumentEvent::~DocumentEvent()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DocumentFragment.cpp b/Utilities/Poco/XML/src/DocumentFragment.cpp
deleted file mode 100755
index e2cd1a8bb4..0000000000
--- a/Utilities/Poco/XML/src/DocumentFragment.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// DocumentFragment.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/DocumentFragment.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString DocumentFragment::NODE_NAME = toXMLString("#document-fragment");
-
-
-DocumentFragment::DocumentFragment(Document* pOwnerDocument):
- AbstractContainerNode(pOwnerDocument)
-{
-}
-
-
-DocumentFragment::DocumentFragment( Document* pOwnerDocument, const DocumentFragment& fragment):
- AbstractContainerNode(pOwnerDocument, fragment)
-{
-}
-
-
-DocumentFragment::~DocumentFragment()
-{
-}
-
-
-const XMLString& DocumentFragment::nodeName() const
-{
- return NODE_NAME;
-}
-
-
-unsigned short DocumentFragment::nodeType() const
-{
- return Node::DOCUMENT_FRAGMENT_NODE;
-}
-
-
-Node* DocumentFragment::copyNode(bool deep, Document* pOwnerDocument) const
-{
- DocumentFragment* pClone = new DocumentFragment(pOwnerDocument, *this);
- if (deep)
- {
- Node* pCur = firstChild();
- while (pCur)
- {
- pClone->appendChild(static_cast<AbstractNode*>(pCur)->copyNode(deep, pOwnerDocument))->release();
- pCur = pCur->nextSibling();
- }
- }
- return pClone;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/DocumentType.cpp b/Utilities/Poco/XML/src/DocumentType.cpp
deleted file mode 100755
index 9cc8487694..0000000000
--- a/Utilities/Poco/XML/src/DocumentType.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// DocumentType.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/DocumentType.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/DTDMap.h"
-#include "Poco/DOM/DOMException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-DocumentType::DocumentType(Document* pOwner, const XMLString& name, const XMLString& publicId, const XMLString& systemId):
- AbstractContainerNode(pOwner),
- _name(name),
- _publicId(publicId),
- _systemId(systemId)
-{
-}
-
-
-DocumentType::DocumentType(Document* pOwner, const DocumentType& doctype):
- AbstractContainerNode(pOwner, doctype),
- _name(doctype._name),
- _publicId(doctype._publicId),
- _systemId(doctype._systemId)
-{
-}
-
-
-DocumentType::~DocumentType()
-{
-}
-
-
-NamedNodeMap* DocumentType::entities() const
-{
- return new DTDMap(this, Node::ENTITY_NODE);
-}
-
-
-NamedNodeMap* DocumentType::notations() const
-{
- return new DTDMap(this, Node::NOTATION_NODE);
-}
-
-
-const XMLString& DocumentType::nodeName() const
-{
- return _name;
-}
-
-
-unsigned short DocumentType::nodeType() const
-{
- return Node::DOCUMENT_TYPE_NODE;
-}
-
-
-const XMLString& DocumentType::internalSubset() const
-{
- return EMPTY_STRING;
-}
-
-
-Node* DocumentType::copyNode(bool deep, Document* pOwnerDocument) const
-{
- return new DocumentType(pOwnerDocument, *this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Element.cpp b/Utilities/Poco/XML/src/Element.cpp
deleted file mode 100755
index 969f2cae91..0000000000
--- a/Utilities/Poco/XML/src/Element.cpp
+++ /dev/null
@@ -1,466 +0,0 @@
-//
-// Element.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/Element.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/Attr.h"
-#include "Poco/DOM/DOMException.h"
-#include "Poco/DOM/ElementsByTagNameList.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/DOM/AttrMap.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-Element::Element(Document* pOwnerDocument, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname):
- AbstractContainerNode(pOwnerDocument),
- _name(pOwnerDocument->namePool().insert(qname, namespaceURI, localName)),
- _pFirstAttr(0)
-{
-}
-
-
-Element::Element(Document* pOwnerDocument, const Element& element):
- AbstractContainerNode(pOwnerDocument, element),
- _name(pOwnerDocument->namePool().insert(element._name)),
- _pFirstAttr(0)
-{
- Attr* pAttr = element._pFirstAttr;
- while (pAttr)
- {
- Attr* pClonedAttr = static_cast<Attr*>(pAttr->copyNode(false, pOwnerDocument));
- setAttributeNode(pClonedAttr);
- pClonedAttr->release();
- pAttr = static_cast<Attr*>(pAttr->_pNext);
- }
-}
-
-
-Element::~Element()
-{
- if (_pFirstAttr) _pFirstAttr->release();
-}
-
-
-const XMLString& Element::getAttribute(const XMLString& name) const
-{
- Attr* pAttr = getAttributeNode(name);
- if (pAttr)
- return pAttr->getValue();
- else
- return EMPTY_STRING;
-}
-
-
-void Element::setAttribute(const XMLString& name, const XMLString& value)
-{
- Attr* pAttr = getAttributeNode(name);
- if (pAttr)
- {
- pAttr->setValue(value);
- }
- else
- {
- pAttr = ownerDocument()->createAttribute(name);
- pAttr->setValue(value);
- setAttributeNode(pAttr);
- pAttr->release();
- }
-}
-
-
-void Element::removeAttribute(const XMLString& name)
-{
- Attr* pAttr = getAttributeNode(name);
- if (pAttr) removeAttributeNode(pAttr);
-}
-
-
-Attr* Element::getAttributeNode(const XMLString& name) const
-{
- Attr* pAttr = _pFirstAttr;
- while (pAttr && pAttr->_name.qname() != name) pAttr = static_cast<Attr*>(pAttr->_pNext);
- return pAttr;
-}
-
-
-Attr* Element::setAttributeNode(Attr* newAttr)
-{
- poco_check_ptr (newAttr);
-
- if (newAttr->ownerDocument() != ownerDocument())
- throw DOMException(DOMException::WRONG_DOCUMENT_ERR);
- if (newAttr->ownerElement())
- throw DOMException(DOMException::INUSE_ATTRIBUTE_ERR);
-
- Attr* oldAttr = getAttributeNode(newAttr->name());
- if (oldAttr) removeAttributeNode(oldAttr);
-
- Attr* pCur = _pFirstAttr;
- if (pCur)
- {
- while (pCur->_pNext) pCur = static_cast<Attr*>(pCur->_pNext);
- pCur->_pNext = newAttr;
- }
- else _pFirstAttr = newAttr;
- newAttr->duplicate();
- newAttr->_pParent = this;
- if (_pOwner->events())
- dispatchAttrModified(newAttr, MutationEvent::ADDITION, EMPTY_STRING, newAttr->getValue());
-
- return oldAttr;
-}
-
-
-Attr* Element::removeAttributeNode(Attr* oldAttr)
-{
- poco_check_ptr (oldAttr);
-
- if (_pOwner->events())
- dispatchAttrModified(oldAttr, MutationEvent::REMOVAL, oldAttr->getValue(), EMPTY_STRING);
-
- if (oldAttr != _pFirstAttr)
- {
- Attr* pCur = _pFirstAttr;
- while (pCur->_pNext != oldAttr) pCur = static_cast<Attr*>(pCur->_pNext);
- if (pCur)
- {
- pCur->_pNext = static_cast<Attr*>(pCur->_pNext->_pNext);
- }
- else throw DOMException(DOMException::NOT_FOUND_ERR);
- }
- else _pFirstAttr = static_cast<Attr*>(_pFirstAttr->_pNext);
- oldAttr->_pNext = 0;
- oldAttr->_pParent = 0;
- oldAttr->autoRelease();
-
- return oldAttr;
-}
-
-
-Attr* Element::addAttributeNodeNP(Attr* oldAttr, Attr* newAttr)
-{
- newAttr->_pParent = this;
- if (oldAttr)
- {
- oldAttr->_pNext = newAttr;
- }
- else if (_pFirstAttr)
- {
- newAttr->_pNext = _pFirstAttr;
- _pFirstAttr = newAttr;
- }
- else
- {
- _pFirstAttr = newAttr;
- }
- newAttr->duplicate();
- return newAttr;
-}
-
-
-NodeList* Element::getElementsByTagName(const XMLString& name) const
-{
- return new ElementsByTagNameList(this, name);
-}
-
-
-NodeList* Element::getElementsByTagNameNS(const XMLString& namespaceURI, const XMLString& localName) const
-{
- return new ElementsByTagNameListNS(this, namespaceURI, localName);
-}
-
-
-void Element::normalize()
-{
- Node* pCur = firstChild();
- while (pCur)
- {
- if (pCur->nodeType() == Node::ELEMENT_NODE)
- {
- pCur->normalize();
- }
- else if (pCur->nodeType() == Node::TEXT_NODE)
- {
- Node* pNext = pCur->nextSibling();
- while (pNext && pNext->nodeType() == Node::TEXT_NODE)
- {
- static_cast<Text*>(pCur)->appendData(pNext->nodeValue());
- removeChild(pNext);
- pNext = pCur->nextSibling();
- }
- }
- pCur = pCur->nextSibling();
- }
-}
-
-
-const XMLString& Element::nodeName() const
-{
- return tagName();
-}
-
-
-NamedNodeMap* Element::attributes() const
-{
- return new AttrMap(const_cast<Element*>(this));
-}
-
-
-unsigned short Element::nodeType() const
-{
- return Node::ELEMENT_NODE;
-}
-
-
-const XMLString& Element::getAttributeNS(const XMLString& namespaceURI, const XMLString& localName) const
-{
- Attr* pAttr = getAttributeNodeNS(namespaceURI, localName);
- if (pAttr)
- return pAttr->getValue();
- else
- return EMPTY_STRING;
-}
-
-
-void Element::setAttributeNS(const XMLString& namespaceURI, const XMLString& qualifiedName, const XMLString& value)
-{
- Attr* pAttr = getAttributeNodeNS(namespaceURI, qualifiedName);
- if (pAttr)
- {
- pAttr->setValue(value);
- }
- else
- {
- pAttr = _pOwner->createAttributeNS(namespaceURI, qualifiedName);
- pAttr->setValue(value);
- setAttributeNodeNS(pAttr);
- pAttr->release();
- }
-}
-
-
-void Element::removeAttributeNS(const XMLString& namespaceURI, const XMLString& localName)
-{
- Attr* pAttr = getAttributeNodeNS(namespaceURI, localName);
- if (pAttr) removeAttributeNode(pAttr);
-}
-
-
-Attr* Element::getAttributeNodeNS(const XMLString& namespaceURI, const XMLString& localName) const
-{
- Attr* pAttr = _pFirstAttr;
- while (pAttr && (pAttr->_name.namespaceURI() != namespaceURI || pAttr->_name.localName() != localName)) pAttr = static_cast<Attr*>(pAttr->_pNext);
- return pAttr;
-}
-
-
-Attr* Element::setAttributeNodeNS(Attr* newAttr)
-{
- poco_check_ptr (newAttr);
-
- if (newAttr->ownerDocument() != ownerDocument())
- throw DOMException(DOMException::WRONG_DOCUMENT_ERR);
- if (newAttr->ownerElement())
- throw DOMException(DOMException::INUSE_ATTRIBUTE_ERR);
-
- Attr* oldAttr = getAttributeNodeNS(newAttr->namespaceURI(), newAttr->localName());
- if (oldAttr) removeAttributeNode(oldAttr);
-
- Attr* pCur = _pFirstAttr;
- if (pCur)
- {
- while (pCur->_pNext) pCur = static_cast<Attr*>(pCur->_pNext);
- pCur->_pNext = newAttr;
- }
- else _pFirstAttr = newAttr;
- newAttr->_pParent = this;
- newAttr->duplicate();
- if (_pOwner->events())
- dispatchAttrModified(newAttr, MutationEvent::ADDITION, EMPTY_STRING, newAttr->getValue());
-
- return oldAttr;
-}
-
-
-bool Element::hasAttribute(const XMLString& name) const
-{
- return getAttributeNode(name) != 0;
-}
-
-
-bool Element::hasAttributeNS(const XMLString& namespaceURI, const XMLString& localName) const
-{
- return getAttributeNodeNS(namespaceURI, localName) != 0;
-}
-
-
-const XMLString& Element::namespaceURI() const
-{
- return _name.namespaceURI();
-}
-
-
-XMLString Element::prefix() const
-{
- return _name.prefix();
-}
-
-
-const XMLString& Element::localName() const
-{
- return _name.localName();
-}
-
-
-bool Element::hasAttributes() const
-{
- return _pFirstAttr != 0;
-}
-
-
-XMLString Element::innerText() const
-{
- XMLString result;
- Node* pChild = firstChild();
- while (pChild)
- {
- result.append(pChild->innerText());
- pChild = pChild->nextSibling();
- }
- return result;
-}
-
-
-Element* Element::getChildElement(const XMLString& name) const
-{
- Node* pNode = firstChild();
- while (pNode && !(pNode->nodeType() == Node::ELEMENT_NODE && pNode->nodeName() == name))
- pNode = pNode->nextSibling();
- return static_cast<Element*>(pNode);
-}
-
-
-Element* Element::getChildElementNS(const XMLString& namespaceURI, const XMLString& localName) const
-{
- Node* pNode = firstChild();
- while (pNode && !(pNode->nodeType() == Node::ELEMENT_NODE && pNode->namespaceURI() == namespaceURI && pNode->localName() == localName))
- pNode = pNode->nextSibling();
- return static_cast<Element*>(pNode);
-}
-
-
-void Element::dispatchNodeRemovedFromDocument()
-{
- AbstractContainerNode::dispatchNodeRemovedFromDocument();
- Attr* pAttr = _pFirstAttr;
- while (pAttr)
- {
- pAttr->dispatchNodeRemovedFromDocument();
- pAttr = static_cast<Attr*>(pAttr->_pNext);
- }
-}
-
-
-void Element::dispatchNodeInsertedIntoDocument()
-{
- AbstractContainerNode::dispatchNodeInsertedIntoDocument();
- Attr* pAttr = _pFirstAttr;
- while (pAttr)
- {
- pAttr->dispatchNodeInsertedIntoDocument();
- pAttr = static_cast<Attr*>(pAttr->_pNext);
- }
-}
-
-
-Node* Element::copyNode(bool deep, Document* pOwnerDocument) const
-{
- Element* pClone = new Element(pOwnerDocument, *this);
- if (deep)
- {
- Node* pNode = firstChild();
- while (pNode)
- {
- pClone->appendChild(static_cast<AbstractNode*>(pNode)->copyNode(true, pOwnerDocument))->release();
- pNode = pNode->nextSibling();
- }
- }
- return pClone;
-}
-
-
-Element* Element::getElementById(const XMLString& elementId, const XMLString& idAttribute) const
-{
- if (getAttribute(idAttribute) == elementId)
- return const_cast<Element*>(this);
-
- Node* pNode = firstChild();
- while (pNode)
- {
- if (pNode->nodeType() == Node::ELEMENT_NODE)
- {
- Element* pResult = static_cast<Element*>(pNode)->getElementById(elementId, idAttribute);
- if (pResult) return pResult;
- }
- pNode = pNode->nextSibling();
- }
- return 0;
-}
-
-
-Element* Element::getElementByIdNS(const XMLString& elementId, const XMLString& idAttributeURI, const XMLString& idAttributeLocalName) const
-{
- if (getAttributeNS(idAttributeURI, idAttributeLocalName) == elementId)
- return const_cast<Element*>(this);
-
- Node* pNode = firstChild();
- while (pNode)
- {
- if (pNode->nodeType() == Node::ELEMENT_NODE)
- {
- Element* pResult = static_cast<Element*>(pNode)->getElementByIdNS(elementId, idAttributeURI, idAttributeLocalName);
- if (pResult) return pResult;
- }
- pNode = pNode->nextSibling();
- }
- return 0;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/ElementsByTagNameList.cpp b/Utilities/Poco/XML/src/ElementsByTagNameList.cpp
deleted file mode 100755
index c1b5f85453..0000000000
--- a/Utilities/Poco/XML/src/ElementsByTagNameList.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// ElementsByTagNameList.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/ElementsByTagNameList.h"
-#include "Poco/DOM/Node.h"
-#include "Poco/DOM/Document.h"
-#include <climits>
-
-
-namespace Poco {
-namespace XML {
-
-
-ElementsByTagNameList::ElementsByTagNameList(const Node* pParent, const XMLString& name):
- _pParent(pParent),
- _name(name),
- _count(0)
-{
- poco_check_ptr (pParent);
-
- _pParent->duplicate();
-}
-
-
-ElementsByTagNameList::~ElementsByTagNameList()
-{
- _pParent->release();
-}
-
-
-Node* ElementsByTagNameList::item(unsigned long index) const
-{
- _count = 0;
- return find(_pParent, index);
-}
-
-
-unsigned long ElementsByTagNameList::length() const
-{
- _count = 0;
- find(_pParent, ULONG_MAX);
- return _count;
-}
-
-
-Node* ElementsByTagNameList::find(const Node* pParent, unsigned long index) const
-{
- static const XMLString asterisk = toXMLString("*");
-
- if (!pParent) return 0;
-
- // preorder search
- Node* pCur = pParent->firstChild();
- while (pCur)
- {
- if (pCur->nodeType() == Node::ELEMENT_NODE && (_name == asterisk || pCur->nodeName() == _name))
- {
- if (_count == index) return pCur;
- _count++;
- }
- Node* pNode = find(pCur, index);
- if (pNode) return pNode;
- pCur = pCur->nextSibling();
- }
- return pCur;
-}
-
-
-void ElementsByTagNameList::autoRelease()
-{
- _pParent->ownerDocument()->autoReleasePool().add(this);
-}
-
-
-ElementsByTagNameListNS::ElementsByTagNameListNS(const Node* pParent, const XMLString& namespaceURI, const XMLString& localName):
- _pParent(pParent),
- _localName(localName),
- _namespaceURI(namespaceURI),
- _count(0)
-{
- poco_check_ptr (pParent);
-
- _pParent->duplicate();
-}
-
-
-
-ElementsByTagNameListNS::~ElementsByTagNameListNS()
-{
- _pParent->release();
-}
-
-
-Node* ElementsByTagNameListNS::item(unsigned long index) const
-{
- _count = 0;
- return find(_pParent, index);
-}
-
-
-unsigned long ElementsByTagNameListNS::length() const
-{
- _count = 0;
- find(_pParent, ULONG_MAX);
- return _count;
-}
-
-
-Node* ElementsByTagNameListNS::find(const Node* pParent, unsigned long index) const
-{
- static const XMLString asterisk = toXMLString("*");
-
- if (!pParent) return 0;
-
- // preorder search
- Node* pCur = pParent->firstChild();
- while (pCur)
- {
- if (pCur->nodeType() == Node::ELEMENT_NODE && (_localName == asterisk || pCur->localName() == _localName) && (_namespaceURI == asterisk || pCur->namespaceURI() == _namespaceURI))
- {
- if (_count == index) return pCur;
- _count++;
- }
- Node* pNode = find(pCur, index);
- if (pNode) return pNode;
- pCur = pCur->nextSibling();
- }
- return pCur;
-}
-
-
-void ElementsByTagNameListNS::autoRelease()
-{
- _pParent->ownerDocument()->autoReleasePool().add(this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Entity.cpp b/Utilities/Poco/XML/src/Entity.cpp
deleted file mode 100755
index b41c718a04..0000000000
--- a/Utilities/Poco/XML/src/Entity.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// Entity.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/Entity.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString Entity::NODE_NAME = toXMLString("#entity");
-
-
-Entity::Entity(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName):
- AbstractContainerNode(pOwnerDocument),
- _name(name),
- _publicId(publicId),
- _systemId(systemId),
- _notationName(notationName)
-{
-}
-
-
-Entity::Entity(Document* pOwnerDocument, const Entity& entity):
- AbstractContainerNode(pOwnerDocument, entity),
- _name(entity._name),
- _publicId(entity._publicId),
- _systemId(entity._systemId),
- _notationName(entity._notationName)
-{
-}
-
-
-Entity::~Entity()
-{
-}
-
-
-const XMLString& Entity::nodeName() const
-{
- return _name;
-}
-
-
-unsigned short Entity::nodeType() const
-{
- return Node::ENTITY_NODE;
-}
-
-
-Node* Entity::copyNode(bool deep, Document* pOwnerDocument) const
-{
- return new Entity(pOwnerDocument, *this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/EntityReference.cpp b/Utilities/Poco/XML/src/EntityReference.cpp
deleted file mode 100755
index 30795e506f..0000000000
--- a/Utilities/Poco/XML/src/EntityReference.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// EntityReference.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/EntityReference.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-EntityReference::EntityReference(Document* pOwnerDocument, const XMLString& name):
- AbstractNode(pOwnerDocument),
- _name(name)
-{
-}
-
-
-EntityReference::EntityReference(Document* pOwnerDocument, const EntityReference& ref):
- AbstractNode(pOwnerDocument, ref),
- _name(ref._name)
-{
-}
-
-
-EntityReference::~EntityReference()
-{
-}
-
-
-const XMLString& EntityReference::nodeName() const
-{
- return _name;
-}
-
-
-unsigned short EntityReference::nodeType() const
-{
- return Node::ENTITY_REFERENCE_NODE;
-}
-
-
-Node* EntityReference::copyNode(bool deep, Document* pOwnerDocument) const
-{
- return new EntityReference(pOwnerDocument, *this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/EntityResolver.cpp b/Utilities/Poco/XML/src/EntityResolver.cpp
deleted file mode 100755
index 7db1a882d9..0000000000
--- a/Utilities/Poco/XML/src/EntityResolver.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// EntityResolver.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/EntityResolver.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-EntityResolver::~EntityResolver()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/EntityResolverImpl.cpp b/Utilities/Poco/XML/src/EntityResolverImpl.cpp
deleted file mode 100755
index 095fc2bc78..0000000000
--- a/Utilities/Poco/XML/src/EntityResolverImpl.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// EntityResolverImpl.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/EntityResolverImpl.h"
-#include "Poco/SAX/InputSource.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/URI.h"
-#include "Poco/Path.h"
-#include "Poco/Exception.h"
-
-
-using Poco::URIStreamOpener;
-using Poco::URI;
-using Poco::Path;
-using Poco::Exception;
-using Poco::IOException;
-using Poco::OpenFileException;
-
-
-namespace Poco {
-namespace XML {
-
-
-EntityResolverImpl::EntityResolverImpl():
- _opener(URIStreamOpener::defaultOpener())
-{
-}
-
-
-EntityResolverImpl::EntityResolverImpl(const URIStreamOpener& opener):
- _opener(opener)
-{
-}
-
-
-EntityResolverImpl::~EntityResolverImpl()
-{
-}
-
-
-InputSource* EntityResolverImpl::resolveEntity(const XMLString* publicId, const XMLString& systemId)
-{
- std::istream* pIstr = resolveSystemId(systemId);
- InputSource* pInputSource = new InputSource(systemId);
- if (publicId) pInputSource->setPublicId(*publicId);
- pInputSource->setByteStream(*pIstr);
- return pInputSource;
-}
-
-
-void EntityResolverImpl::releaseInputSource(InputSource* pSource)
-{
- poco_check_ptr (pSource);
-
- delete pSource->getByteStream();
- delete pSource;
-}
-
-
-std::istream* EntityResolverImpl::resolveSystemId(const XMLString& systemId)
-{
- std::string sid = fromXMLString(systemId);
- return _opener.open(sid);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/ErrorHandler.cpp b/Utilities/Poco/XML/src/ErrorHandler.cpp
deleted file mode 100755
index fe098f9d46..0000000000
--- a/Utilities/Poco/XML/src/ErrorHandler.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// ErrorHandler.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/ErrorHandler.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-ErrorHandler::~ErrorHandler()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Event.cpp b/Utilities/Poco/XML/src/Event.cpp
deleted file mode 100755
index 85de172cb4..0000000000
--- a/Utilities/Poco/XML/src/Event.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// Event.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Copyright (c) 2004-2006, 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/DOM/Event.h"
-#include "Poco/DOM/Document.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-Event::Event(Document* pOwnerDocument, const XMLString& type):
- _pOwner(pOwnerDocument),
- _type(type),
- _pTarget(0),
- _pCurrentTarget(0),
- _currentPhase(CAPTURING_PHASE),
- _bubbles(true),
- _cancelable(true),
- _canceled(false),
- _stopped(false)
-{
-}
-
-
-Event::Event(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool isCancelable):
- _pOwner(pOwnerDocument),
- _type(type),
- _pTarget(pTarget),
- _pCurrentTarget(0),
- _currentPhase(CAPTURING_PHASE),
- _bubbles(canBubble),
- _cancelable(isCancelable),
- _canceled(false),
- _stopped(false)
-{
-}
-
-
-Event::~Event()
-{
-}
-
-
-void Event::stopPropagation()
-{
- _stopped = true;
-}
-
-
-void Event::preventDefault()
-{
- _canceled = true;
-}
-
-
-void Event::initEvent(const XMLString& eventType, bool canBubble, bool isCancelable)
-{
- _type = eventType;
- _bubbles = canBubble;
- _cancelable = isCancelable;
- _canceled = false;
- _stopped = false;
-}
-
-
-void Event::setTarget(EventTarget* pTarget)
-{
- _pTarget = pTarget;
-}
-
-
-void Event::setCurrentPhase(PhaseType phase)
-{
- _currentPhase = phase;
-}
-
-
-void Event::setCurrentTarget(EventTarget* pTarget)
-{
- _pCurrentTarget = pTarget;
-}
-
-
-void Event::autoRelease()
-{
- _pOwner->autoReleasePool().add(this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/EventDispatcher.cpp b/Utilities/Poco/XML/src/EventDispatcher.cpp
deleted file mode 100755
index 80892dedb8..0000000000
--- a/Utilities/Poco/XML/src/EventDispatcher.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// EventDispatcher.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Copyright (c) 2004-2006, 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/DOM/EventDispatcher.h"
-#include "Poco/DOM/Event.h"
-#include "Poco/DOM/EventListener.h"
-
-
-namespace
-{
- class DispatchGuard
- {
- public:
- DispatchGuard(int& count):
- _count(count)
- {
- ++_count;
- }
-
- ~DispatchGuard()
- {
- --_count;
- }
-
- private:
- int& _count;
- };
-}
-
-
-namespace Poco {
-namespace XML {
-
-
-EventDispatcher::EventDispatcher():
- _inDispatch(0)
-{
-}
-
-
-EventDispatcher::~EventDispatcher()
-{
-}
-
-
-void EventDispatcher::addEventListener(const XMLString& type, EventListener* listener, bool useCapture)
-{
- EventListenerItem item;
- item.type = type;
- item.pListener = listener;
- item.useCapture = useCapture;
- _listeners.push_front(item);
-}
-
-
-void EventDispatcher::removeEventListener(const XMLString& type, EventListener* listener, bool useCapture)
-{
- EventListenerList::iterator it = _listeners.begin();
- while (it != _listeners.end())
- {
- if (it->type == type && it->pListener == listener && it->useCapture == useCapture)
- {
- it->pListener = 0;
- }
- if (!_inDispatch && !it->pListener)
- {
- EventListenerList::iterator del = it++;
- _listeners.erase(del);
- }
- else ++it;
- }
-}
-
-
-void EventDispatcher::dispatchEvent(Event* evt)
-{
- DispatchGuard guard(_inDispatch);
- EventListenerList::iterator it = _listeners.begin();
- while (it != _listeners.end())
- {
- if (it->pListener && it->type == evt->type())
- {
- it->pListener->handleEvent(evt);
- }
- if (!it->pListener)
- {
- EventListenerList::iterator del = it++;
- _listeners.erase(del);
- }
- else ++it;
- }
-}
-
-
-void EventDispatcher::captureEvent(Event* evt)
-{
- DispatchGuard guard(_inDispatch);
- EventListenerList::iterator it = _listeners.begin();
- while (it != _listeners.end())
- {
- if (it->pListener && it->useCapture && it->type == evt->type())
- {
- it->pListener->handleEvent(evt);
- }
- if (!it->pListener)
- {
- EventListenerList::iterator del = it++;
- _listeners.erase(del);
- }
- else ++it;
- }
-}
-
-
-void EventDispatcher::bubbleEvent(Event* evt)
-{
- DispatchGuard guard(_inDispatch);
- EventListenerList::iterator it = _listeners.begin();
- while (it != _listeners.end())
- {
- if (it->pListener && !it->useCapture && it->type == evt->type())
- {
- it->pListener->handleEvent(evt);
- }
- if (!it->pListener)
- {
- EventListenerList::iterator del = it++;
- _listeners.erase(del);
- }
- else ++it;
- }
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/EventException.cpp b/Utilities/Poco/XML/src/EventException.cpp
deleted file mode 100755
index 50bd2596a3..0000000000
--- a/Utilities/Poco/XML/src/EventException.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// EventException.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Copyright (c) 2004-2006, 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/DOM/EventException.h"
-#include <typeinfo>
-
-
-namespace Poco {
-namespace XML {
-
-
-EventException::EventException(int code):
- XMLException("Unspecified event type")
-{
-}
-
-
-EventException::EventException(const EventException& exc):
- XMLException(exc)
-{
-}
-
-
-EventException::~EventException() throw()
-{
-}
-
-
-EventException& EventException::operator = (const EventException& exc)
-{
- XMLException::operator = (exc);
- return *this;
-}
-
-
-const char* EventException::name() const throw()
-{
- return "EventException";
-}
-
-
-const char* EventException::className() const throw()
-{
- return typeid(*this).name();
-}
-
-
-Poco::Exception* EventException::clone() const
-{
- return new EventException(*this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/EventListener.cpp b/Utilities/Poco/XML/src/EventListener.cpp
deleted file mode 100755
index f3787b81c2..0000000000
--- a/Utilities/Poco/XML/src/EventListener.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// EventListener.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Copyright (c) 2004-2006, 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/DOM/EventListener.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-EventListener::~EventListener()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/EventTarget.cpp b/Utilities/Poco/XML/src/EventTarget.cpp
deleted file mode 100755
index c75cafcb2e..0000000000
--- a/Utilities/Poco/XML/src/EventTarget.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// EventTarget.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Copyright (c) 2004-2006, 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/DOM/EventTarget.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-EventTarget::~EventTarget()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/InputSource.cpp b/Utilities/Poco/XML/src/InputSource.cpp
deleted file mode 100755
index fb8e154db2..0000000000
--- a/Utilities/Poco/XML/src/InputSource.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// InputSource.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/InputSource.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-InputSource::InputSource():
- _bistr(0),
- _cistr(0)
-{
-}
-
-
-InputSource::InputSource(const XMLString& systemId):
- _systemId(systemId),
- _bistr(0),
- _cistr(0)
-{
-}
-
-
-InputSource::InputSource(XMLByteInputStream& bistr):
- _bistr(&bistr),
- _cistr(0)
-{
-}
-
-
-InputSource::~InputSource()
-{
-}
-
-
-void InputSource::setPublicId(const XMLString& publicId)
-{
- _publicId = publicId;
-}
-
-
-void InputSource::setSystemId(const XMLString& systemId)
-{
- _systemId = systemId;
-}
-
-
-void InputSource::setEncoding(const XMLString& encoding)
-{
- _encoding = encoding;
-}
-
-
-void InputSource::setByteStream(XMLByteInputStream& bistr)
-{
- _bistr = &bistr;
-}
-
-
-void InputSource::setCharacterStream(XMLCharInputStream& cistr)
-{
- _cistr = &cistr;
-}
-
-
-} } // namespace Poco::XML
-
diff --git a/Utilities/Poco/XML/src/LexicalHandler.cpp b/Utilities/Poco/XML/src/LexicalHandler.cpp
deleted file mode 100755
index a6bde4842e..0000000000
--- a/Utilities/Poco/XML/src/LexicalHandler.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// LexicalHandler.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/LexicalHandler.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-LexicalHandler::~LexicalHandler()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Locator.cpp b/Utilities/Poco/XML/src/Locator.cpp
deleted file mode 100755
index 645e118470..0000000000
--- a/Utilities/Poco/XML/src/Locator.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// Locator.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/Locator.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-Locator::~Locator()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/LocatorImpl.cpp b/Utilities/Poco/XML/src/LocatorImpl.cpp
deleted file mode 100755
index 39d3ae31b6..0000000000
--- a/Utilities/Poco/XML/src/LocatorImpl.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// LocatorImpl.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/LocatorImpl.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-LocatorImpl::LocatorImpl()
-{
- _lineNumber = 0;
- _columnNumber = 0;
-}
-
-
-LocatorImpl::LocatorImpl(const Locator& loc)
-{
- _publicId = loc.getPublicId();
- _systemId = loc.getSystemId();
- _lineNumber = loc.getLineNumber();
- _columnNumber = loc.getColumnNumber();
-}
-
-
-LocatorImpl::~LocatorImpl()
-{
-}
-
-
-LocatorImpl& LocatorImpl::operator = (const Locator& loc)
-{
- if (&loc != this)
- {
- _publicId = loc.getPublicId();
- _systemId = loc.getSystemId();
- _lineNumber = loc.getLineNumber();
- _columnNumber = loc.getColumnNumber();
- }
- return *this;
-}
-
-
-XMLString LocatorImpl::getPublicId() const
-{
- return _publicId;
-}
-
-
-XMLString LocatorImpl::getSystemId() const
-{
- return _systemId;
-}
-
-
-int LocatorImpl::getLineNumber() const
-{
- return _lineNumber;
-}
-
-
-int LocatorImpl::getColumnNumber() const
-{
- return _columnNumber;
-}
-
-
-void LocatorImpl::setPublicId(const XMLString& publicId)
-{
- _publicId = publicId;
-}
-
-
-void LocatorImpl::setSystemId(const XMLString& systemId)
-{
- _systemId = systemId;
-}
-
-
-void LocatorImpl::setLineNumber(int lineNumber)
-{
- _lineNumber = lineNumber;
-}
-
-
-void LocatorImpl::setColumnNumber(int columnNumber)
-{
- _columnNumber = columnNumber;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/MutationEvent.cpp b/Utilities/Poco/XML/src/MutationEvent.cpp
deleted file mode 100755
index 2ded812d99..0000000000
--- a/Utilities/Poco/XML/src/MutationEvent.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// MutationEvent.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOMEvents
-//
-// Copyright (c) 2004-2006, 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/DOM/MutationEvent.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString MutationEvent::DOMSubtreeModified = toXMLString("DOMSubtreeModified");
-const XMLString MutationEvent::DOMNodeInserted = toXMLString("DOMNodeInserted");
-const XMLString MutationEvent::DOMNodeRemoved = toXMLString("DOMNodeRemoved");
-const XMLString MutationEvent::DOMNodeRemovedFromDocument = toXMLString("DOMNodeRemovedFromDocument");
-const XMLString MutationEvent::DOMNodeInsertedIntoDocument = toXMLString("DOMNodeInsertedIntoDocument");
-const XMLString MutationEvent::DOMAttrModified = toXMLString("DOMAttrModified");
-const XMLString MutationEvent::DOMCharacterDataModified = toXMLString("DOMCharacterDataModified");
-
-
-MutationEvent::MutationEvent(Document* pOwnerDocument, const XMLString& type):
- Event(pOwnerDocument, type, 0, true, false),
- _change(MODIFICATION),
- _pRelatedNode(0)
-{
-}
-
-
-MutationEvent::MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode):
- Event(pOwnerDocument, type, pTarget, canBubble, cancelable),
- _change(MODIFICATION),
- _pRelatedNode(relatedNode)
-{
-}
-
-
-MutationEvent::MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode,
- const XMLString& prevValue, const XMLString& newValue, const XMLString& attrName, AttrChangeType change):
- Event(pOwnerDocument, type, pTarget, canBubble, cancelable),
- _prevValue(prevValue),
- _newValue(newValue),
- _attrName(attrName),
- _change(change),
- _pRelatedNode(relatedNode)
-{
-}
-
-
-MutationEvent::~MutationEvent()
-{
-}
-
-
-void MutationEvent::initMutationEvent(const XMLString& type, bool canBubble, bool cancelable, Node* relatedNode,
- const XMLString& prevValue, const XMLString& newValue, const XMLString& attrName, AttrChangeType change)
-{
- initEvent(type, canBubble, cancelable);
- _pRelatedNode = relatedNode;
- _prevValue = prevValue;
- _newValue = newValue;
- _attrName = attrName;
- _change = change;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Name.cpp b/Utilities/Poco/XML/src/Name.cpp
deleted file mode 100755
index dc3ce1b11c..0000000000
--- a/Utilities/Poco/XML/src/Name.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-//
-// Name.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: Name
-//
-// Copyright (c) 2004-2006, 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/XML/Name.h"
-#include <algorithm>
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString Name::EMPTY_NAME;
-
-
-Name::Name()
-{
-}
-
-
-Name::Name(const XMLString& qname):
- _qname(qname)
-{
-}
-
-
-Name::Name(const XMLString& qname, const XMLString& namespaceURI):
- _qname(qname),
- _namespaceURI(namespaceURI),
- _localName(localName(qname))
-{
-}
-
-
-Name::Name(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName):
- _qname(qname),
- _namespaceURI(namespaceURI),
- _localName(localName)
-{
-}
-
-
-Name::Name(const Name& name):
- _qname(name._qname),
- _namespaceURI(name._namespaceURI),
- _localName(name._localName)
-{
-}
-
-
-Name::~Name()
-{
-}
-
-
-Name& Name::operator = (const Name& name)
-{
- if (this != &name)
- {
- _qname = name._qname;
- _namespaceURI = name._namespaceURI;
- _localName = name._localName;
- }
- return *this;
-}
-
-
-void Name::swap(Name& name)
-{
- std::swap(_qname, name._qname);
- std::swap(_namespaceURI, name._namespaceURI);
- std::swap(_localName, name._localName);
-}
-
-
-void Name::assign(const XMLString& qname)
-{
- _qname = qname;
- _namespaceURI.clear();
- _localName.clear();
-}
-
-
-void Name::assign(const XMLString& qname, const XMLString& namespaceURI)
-{
- _qname = qname;
- _namespaceURI = namespaceURI;
- _localName = localName(qname);
-}
-
-
-void Name::assign(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName)
-{
- _qname = qname;
- _namespaceURI = namespaceURI;
- _localName = localName;
-}
-
-
-bool Name::equals(const Name& name) const
-{
- return name._namespaceURI == _namespaceURI && name._localName == _localName && name._qname == _qname;
-}
-
-
-bool Name::equals(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) const
-{
- return _namespaceURI == namespaceURI && _localName == localName && _qname == qname;
-}
-
-
-bool Name::equalsWeakly(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) const
-{
- return (_qname == qname && !qname.empty()) || (_namespaceURI == namespaceURI && _localName == localName && !_localName.empty());
-}
-
-
-XMLString Name::prefix() const
-{
- return prefix(_qname);
-}
-
-
-void Name::split(const XMLString& qname, XMLString& prefix, XMLString& localName)
-{
- XMLString::size_type pos = qname.find(':');
- if (pos != XMLString::npos)
- {
- prefix.assign(qname, 0, pos);
- localName.assign(qname, pos + 1, qname.size() - pos - 1);
- }
- else
- {
- prefix.clear();
- localName.assign(qname);
- }
-}
-
-
-XMLString Name::localName(const XMLString& qname)
-{
- XMLString::size_type pos = qname.find(':');
- if (pos != XMLString::npos)
- return XMLString(qname, pos + 1, qname.size() - pos - 1);
- else
- return qname;
-}
-
-
-XMLString Name::prefix(const XMLString& qname)
-{
- XMLString::size_type pos = qname.find(':');
- if (pos != XMLString::npos)
- return XMLString(qname, 0, pos);
- else
- return EMPTY_NAME;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/NamePool.cpp b/Utilities/Poco/XML/src/NamePool.cpp
deleted file mode 100755
index 8156d02714..0000000000
--- a/Utilities/Poco/XML/src/NamePool.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// NamePool.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: NamePool
-//
-// Copyright (c) 2004-2006, 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/XML/NamePool.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-class NamePoolItem
-{
-public:
- NamePoolItem(): _used(false)
- {
- }
-
- ~NamePoolItem()
- {
- }
-
- bool set(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName)
- {
- if (!_used)
- {
- _name.assign(qname, namespaceURI, localName);
- _used = true;
- return true;
- }
- else return _name.equals(qname, namespaceURI, localName);
- }
-
- const Name& get() const
- {
- return _name;
- }
-
- bool used() const
- {
- return _used;
- }
-
-private:
- Name _name;
- bool _used;
-};
-
-
-NamePool::NamePool(unsigned long size):
- _size(size),
- _rc(1)
-{
- poco_assert (size > 1);
-
- _pItems = new NamePoolItem[size];
-}
-
-
-NamePool::~NamePool()
-{
- delete [] _pItems;
-}
-
-
-void NamePool::duplicate()
-{
- ++_rc;
-}
-
-
-void NamePool::release()
-{
- if (--_rc == 0)
- delete this;
-}
-
-
-const Name& NamePool::insert(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName)
-{
- unsigned long i = 0;
- unsigned long n = hash(qname, namespaceURI, localName) % _size;
-
- while (!_pItems[n].set(qname, namespaceURI, localName) && i++ < _size)
- n = (n + 1) % _size;
-
- if (i > _size) throw Poco::PoolOverflowException("XML name pool");
-
- return _pItems[n].get();
-}
-
-
-const Name& NamePool::insert(const Name& name)
-{
- return insert(name.qname(), name.namespaceURI(), name.localName());
-}
-
-
-unsigned long NamePool::hash(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName)
-{
- unsigned long h = 0;
- XMLString::const_iterator it = qname.begin();
- XMLString::const_iterator end = qname.end();
- while (it != end) h = (h << 5) + h + (unsigned long) *it++;
- it = namespaceURI.begin();
- end = namespaceURI.end();
- while (it != end) h = (h << 5) + h + (unsigned long) *it++;
- it = localName.begin();
- end = localName.end();
- while (it != end) h = (h << 5) + h + (unsigned long) *it++;
- return h;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/NamedNodeMap.cpp b/Utilities/Poco/XML/src/NamedNodeMap.cpp
deleted file mode 100755
index 4c3d203a37..0000000000
--- a/Utilities/Poco/XML/src/NamedNodeMap.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// NamedNodeMap.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/NamedNodeMap.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-NamedNodeMap::~NamedNodeMap()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/NamespaceStrategy.cpp b/Utilities/Poco/XML/src/NamespaceStrategy.cpp
deleted file mode 100755
index a857654837..0000000000
--- a/Utilities/Poco/XML/src/NamespaceStrategy.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-//
-// NamespaceStrategy.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: NamespaceStrategy
-//
-// Copyright (c) 2004-2006, 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/XML/NamespaceStrategy.h"
-#include "Poco/SAX/AttributesImpl.h"
-#include "Poco/SAX/ContentHandler.h"
-#include "Poco/XML/XMLException.h"
-#include "Poco/XML/Name.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString NamespaceStrategy::NOTHING;
-
-
-NamespaceStrategy::~NamespaceStrategy()
-{
-}
-
-
-void NamespaceStrategy::splitName(const XMLChar* qname, XMLString& uri, XMLString& localName)
-{
- for (const XMLChar* p = qname; *p; ++p)
- {
- if (*p == '\t')
- {
- uri.assign(qname, p - qname);
- localName.assign(p + 1);
- return;
- }
- }
- localName = qname;
-}
-
-
-void NamespaceStrategy::splitName(const XMLChar* qname, XMLString& uri, XMLString& localName, XMLString& prefix)
-{
- const XMLChar* p = qname;
- while (*p && *p != '\t') ++p;
- if (*p)
- {
- uri.assign(qname, p - qname);
- ++p;
- const XMLChar* loc = p;
- while (*p && *p != '\t') ++p;
- localName.assign(loc, p - loc);
- if (*p)
- prefix.assign(++p);
- else
- prefix.assign(XML_LIT(""));
- }
- else
- {
- uri.assign(XML_LIT(""));
- localName = qname;
- prefix.assign(XML_LIT(""));
- }
-}
-
-
-NoNamespacesStrategy::NoNamespacesStrategy()
-{
- _attrs.reserve(32);
-}
-
-
-NoNamespacesStrategy::~NoNamespacesStrategy()
-{
-}
-
-
-void NoNamespacesStrategy::startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler)
-{
- poco_assert_dbg (name && atts && pContentHandler);
-
- _attrs.clear();
- for (int i = 0; *atts; ++i)
- {
- AttributesImpl::Attribute& attr = _attrs.addAttribute();
- attr.qname.assign(*atts++);
- attr.value.assign(*atts++);
- attr.specified = i < specifiedCount;
- }
- _name.assign(name);
- pContentHandler->startElement(NOTHING, NOTHING, _name, _attrs);
-}
-
-
-void NoNamespacesStrategy::endElement(const XMLChar* name, ContentHandler* pContentHandler)
-{
- poco_assert_dbg (name && pContentHandler);
-
- _name.assign(name);
- pContentHandler->endElement(NOTHING, NOTHING, _name);
-}
-
-
-NoNamespacePrefixesStrategy::NoNamespacePrefixesStrategy()
-{
- _attrs.reserve(32);
-}
-
-
-NoNamespacePrefixesStrategy::~NoNamespacePrefixesStrategy()
-{
-}
-
-
-void NoNamespacePrefixesStrategy::startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler)
-{
- poco_assert_dbg (name && atts && pContentHandler);
-
- _attrs.clear();
- for (int i = 0; *atts; ++i)
- {
- const XMLChar* attrName = *atts++;
- const XMLChar* attrValue = *atts++;
- AttributesImpl::Attribute& attr = _attrs.addAttribute();
- splitName(attrName, attr.namespaceURI, attr.localName);
- attr.value.assign(attrValue);
- attr.specified = i < specifiedCount;
- }
- splitName(name, _uri, _local);
- pContentHandler->startElement(_uri, _local, NOTHING, _attrs);
-}
-
-
-void NoNamespacePrefixesStrategy::endElement(const XMLChar* name, ContentHandler* pContentHandler)
-{
- poco_assert_dbg (name && pContentHandler);
-
- splitName(name, _uri, _local);
- pContentHandler->endElement(_uri, _local, NOTHING);
-}
-
-
-NamespacePrefixesStrategy::NamespacePrefixesStrategy()
-{
- _attrs.reserve(32);
-}
-
-
-NamespacePrefixesStrategy::~NamespacePrefixesStrategy()
-{
-}
-
-
-void NamespacePrefixesStrategy::startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler)
-{
- poco_assert_dbg (name && atts && pContentHandler);
-
- _attrs.clear();
- for (int i = 0; *atts; ++i)
- {
- const XMLChar* attrName = *atts++;
- const XMLChar* attrValue = *atts++;
- AttributesImpl::Attribute& attr = _attrs.addAttribute();
- splitName(attrName, attr.namespaceURI, attr.localName, attr.qname);
- if (!attr.qname.empty()) attr.qname += ':';
- attr.qname.append(attr.localName);
- attr.value.assign(attrValue);
- attr.specified = i < specifiedCount;
- }
- splitName(name, _uri, _local, _qname);
- if (!_qname.empty()) _qname += ':';
- _qname.append(_local);
- pContentHandler->startElement(_uri, _local, _qname, _attrs);
-}
-
-
-void NamespacePrefixesStrategy::endElement(const XMLChar* name, ContentHandler* pContentHandler)
-{
- poco_assert_dbg (name && pContentHandler);
-
- splitName(name, _uri, _local, _qname);
- if (!_qname.empty()) _qname += ':';
- _qname.append(_local);
- pContentHandler->endElement(_uri, _local, _qname);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/NamespaceSupport.cpp b/Utilities/Poco/XML/src/NamespaceSupport.cpp
deleted file mode 100755
index 76679d4da7..0000000000
--- a/Utilities/Poco/XML/src/NamespaceSupport.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-//
-// NamespaceSupport.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/NamespaceSupport.h"
-#include "Poco/XML/Name.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString NamespaceSupport::EMPTY_STRING;
-const XMLString NamespaceSupport::XML_NAMESPACE = toXMLString("http://www.w3.org/XML/1998/namespace");
-const XMLString NamespaceSupport::XML_NAMESPACE_PREFIX = toXMLString("xml");
-const XMLString NamespaceSupport::XMLNS_NAMESPACE = toXMLString("http://www.w3.org/xmlns/2000/");
-const XMLString NamespaceSupport::XMLNS_NAMESPACE_PREFIX = toXMLString("xmlns");
-
-
-NamespaceSupport::NamespaceSupport()
-{
- reset();
-}
-
-
-NamespaceSupport::~NamespaceSupport()
-{
-}
-
-
-bool NamespaceSupport::declarePrefix(const XMLString& prefix, const XMLString& namespaceURI)
-{
- poco_assert (_contexts.size() > 0);
-
- Context& ctx = _contexts.back();
- if (ctx.find(prefix) == ctx.end())
- {
- ctx.insert(Context::value_type(prefix, namespaceURI));
- return true;
- }
- else return false;
-}
-
-
-bool NamespaceSupport::undeclarePrefix(const XMLString& prefix)
-{
- for (ContextVec::reverse_iterator rit = _contexts.rbegin(); rit != _contexts.rend(); ++rit)
- {
- Context::iterator it = rit->find(prefix);
- if (it != rit->end())
- {
- rit->erase(it);
- return true;
- }
- }
- return false;
-}
-
-
-void NamespaceSupport::getDeclaredPrefixes(PrefixSet& prefixes) const
-{
- prefixes.clear();
- const Context& ctx = _contexts.back();
- for (Context::const_iterator it = ctx.begin(); it != ctx.end(); ++it)
- prefixes.insert(it->first);
-}
-
-
-const XMLString& NamespaceSupport::getPrefix(const XMLString& namespaceURI) const
-{
- for (ContextVec::const_reverse_iterator rit = _contexts.rbegin(); rit != _contexts.rend(); ++rit)
- {
- for (Context::const_iterator it = rit->begin(); it != rit->end(); ++it)
- {
- if (it->second == namespaceURI)
- return it->first;
- }
- }
- return EMPTY_STRING;
-}
-
-
-bool NamespaceSupport::isMapped(const XMLString& namespaceURI) const
-{
- for (ContextVec::const_reverse_iterator rit = _contexts.rbegin(); rit != _contexts.rend(); ++rit)
- {
- for (Context::const_iterator it = rit->begin(); it != rit->end(); ++it)
- {
- if (it->second == namespaceURI)
- return true;
- }
- }
- return false;
-}
-
-
-void NamespaceSupport::getPrefixes(PrefixSet& prefixes) const
-{
- prefixes.clear();
- for (ContextVec::const_reverse_iterator rit = _contexts.rbegin(); rit != _contexts.rend(); ++rit)
- {
- for (Context::const_iterator it = rit->begin(); it != rit->end(); ++it)
- {
- const XMLString& prefix = it->first;
- if (!prefix.empty() && prefixes.find(prefix) == prefixes.end())
- prefixes.insert(it->first);
- }
- }
-}
-
-
-void NamespaceSupport::getPrefixes(const XMLString& namespaceURI, PrefixSet& prefixes) const
-{
- prefixes.clear();
- for (ContextVec::const_reverse_iterator rit = _contexts.rbegin(); rit != _contexts.rend(); ++rit)
- {
- for (Context::const_iterator it = rit->begin(); it != rit->end(); ++it)
- {
- const XMLString& prefix = it->first;
- if (it->second == namespaceURI && !prefix.empty() && prefixes.find(prefix) == prefixes.end())
- prefixes.insert(it->first);
- }
- }
-}
-
-
-const XMLString& NamespaceSupport::getURI(const XMLString& prefix) const
-{
- for (ContextVec::const_reverse_iterator rit = _contexts.rbegin(); rit != _contexts.rend(); ++rit)
- {
- Context::const_iterator it = rit->find(prefix);
- if (it != rit->end())
- return it->second;
- }
- return EMPTY_STRING;
-}
-
-
-void NamespaceSupport::pushContext()
-{
- _contexts.push_back(Context());
-}
-
-
-void NamespaceSupport::popContext()
-{
- _contexts.pop_back();
-}
-
-
-bool NamespaceSupport::processName(const XMLString& qname, XMLString& namespaceURI, XMLString& localName, bool isAttribute) const
-{
- XMLString prefix;
- Name::split(qname, prefix, localName);
- if (prefix.empty() && isAttribute)
- {
- namespaceURI.clear();
- return true;
- }
- else
- {
- namespaceURI = getURI(prefix);
- return !namespaceURI.empty() || prefix.empty();
- }
-}
-
-
-void NamespaceSupport::reset()
-{
- _contexts.clear();
- pushContext();
- declarePrefix(XML_NAMESPACE_PREFIX, XML_NAMESPACE);
- declarePrefix(XMLNS_NAMESPACE_PREFIX, XMLNS_NAMESPACE);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Node.cpp b/Utilities/Poco/XML/src/Node.cpp
deleted file mode 100755
index 95eedbaf7c..0000000000
--- a/Utilities/Poco/XML/src/Node.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// Node.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/Node.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-Node::~Node()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/NodeAppender.cpp b/Utilities/Poco/XML/src/NodeAppender.cpp
deleted file mode 100755
index ed00afb7d7..0000000000
--- a/Utilities/Poco/XML/src/NodeAppender.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// NodeAppender.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: NodeAppender
-//
-// Copyright (c) 2007, 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/DOM/NodeAppender.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/DOMException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-NodeAppender::NodeAppender(Element* parent):
- _pParent(parent),
- _pLast(0)
-{
- poco_check_ptr (parent);
-
- _pLast = static_cast<AbstractNode*>(_pParent->lastChild());
-}
-
-
-NodeAppender::~NodeAppender()
-{
-}
-
-
-void NodeAppender::appendChild(Node* newChild)
-{
- poco_check_ptr (newChild);
- poco_assert (_pLast == 0 || _pLast->_pNext == 0);
-
- if (static_cast<AbstractNode*>(newChild)->_pOwner != _pParent->_pOwner)
- throw DOMException(DOMException::WRONG_DOCUMENT_ERR);
-
- if (newChild->nodeType() == Node::DOCUMENT_FRAGMENT_NODE)
- {
- AbstractContainerNode* pFrag = static_cast<AbstractContainerNode*>(newChild);
- AbstractNode* pChild = pFrag->_pFirstChild;
- if (pChild)
- {
- if (_pLast)
- _pLast->_pNext = pChild;
- else
- _pParent->_pFirstChild = pChild;
- while (pChild)
- {
- _pLast = pChild;
- pChild->_pParent = _pParent;
- pChild = pChild->_pNext;
- }
- pFrag->_pFirstChild = 0;
- }
- }
- else
- {
- AbstractNode* pAN = static_cast<AbstractNode*>(newChild);
- pAN->duplicate();
- if (pAN->_pParent)
- pAN->_pParent->removeChild(pAN);
- pAN->_pParent = _pParent;
- if (_pLast)
- _pLast->_pNext = pAN;
- else
- _pParent->_pFirstChild = pAN;
- _pLast = pAN;
- }
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/NodeFilter.cpp b/Utilities/Poco/XML/src/NodeFilter.cpp
deleted file mode 100755
index 06e7fe81cc..0000000000
--- a/Utilities/Poco/XML/src/NodeFilter.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// NodeFilter.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: NodeFilter
-//
-// Copyright (c) 2004-2006, 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/DOM/NodeFilter.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-NodeFilter::~NodeFilter()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/NodeIterator.cpp b/Utilities/Poco/XML/src/NodeIterator.cpp
deleted file mode 100755
index e5139ab091..0000000000
--- a/Utilities/Poco/XML/src/NodeIterator.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// NodeIterator.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: NodeIterator
-//
-// Copyright (c) 2004-2006, 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/DOM/NodeIterator.h"
-#include "Poco/DOM/AbstractNode.h"
-#include "Poco/DOM/NodeFilter.h"
-#include "Poco/DOM/DOMException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-NodeIterator::NodeIterator(Node* root, unsigned long whatToShow, NodeFilter* pFilter):
- _pRoot(root),
- _whatToShow(whatToShow),
- _pFilter(pFilter),
- _pCurrent(0)
-{
-}
-
-
-NodeIterator::NodeIterator(const NodeIterator& iterator):
- _pRoot(iterator._pRoot),
- _whatToShow(iterator._whatToShow),
- _pFilter(iterator._pFilter),
- _pCurrent(iterator._pCurrent)
-{
-}
-
-
-NodeIterator& NodeIterator::operator = (const NodeIterator& iterator)
-{
- if (&iterator != this)
- {
- _pRoot = iterator._pRoot;
- _whatToShow = iterator._whatToShow;
- _pFilter = iterator._pFilter;
- _pCurrent = iterator._pCurrent;
- }
- return *this;
-}
-
-
-NodeIterator::~NodeIterator()
-{
-}
-
-
-Node* NodeIterator::nextNode()
-{
- if (!_pRoot) throw DOMException(DOMException::INVALID_STATE_ERR);
-
- if (_pCurrent)
- _pCurrent = next();
- else
- _pCurrent = _pRoot;
- while (_pCurrent && !accept(_pCurrent))
- _pCurrent = next();
- return _pCurrent;
-}
-
-
-Node* NodeIterator::previousNode()
-{
- if (!_pRoot) throw DOMException(DOMException::INVALID_STATE_ERR);
-
- if (_pCurrent)
- _pCurrent = previous();
- else
- _pCurrent = last();
- while (_pCurrent && !accept(_pCurrent))
- _pCurrent = previous();
- return _pCurrent;
-}
-
-
-void NodeIterator::detach()
-{
- _pRoot = 0;
- _pCurrent = 0;
-}
-
-
-bool NodeIterator::accept(Node* pNode) const
-{
- bool accept = false;
- switch (pNode->nodeType())
- {
- case Node::ELEMENT_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_ELEMENT) != 0; break;
- case Node::ATTRIBUTE_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_ATTRIBUTE) != 0; break;
- case Node::TEXT_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_TEXT) != 0; break;
- case Node::CDATA_SECTION_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_CDATA_SECTION) != 0; break;
- case Node::ENTITY_REFERENCE_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_ENTITY_REFERENCE) != 0; break;
- case Node::ENTITY_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_ENTITY) != 0; break;
- case Node::PROCESSING_INSTRUCTION_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_PROCESSING_INSTRUCTION) != 0; break;
- case Node::COMMENT_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_COMMENT) != 0; break;
- case Node::DOCUMENT_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_DOCUMENT) != 0; break;
- case Node::DOCUMENT_TYPE_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_DOCUMENT_TYPE) != 0; break;
- case Node::DOCUMENT_FRAGMENT_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_DOCUMENT_FRAGMENT) != 0; break;
- case Node::NOTATION_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_NOTATION) != 0; break;
- }
- if (accept && _pFilter)
- accept = _pFilter->acceptNode(pNode) == NodeFilter::FILTER_ACCEPT;
- return accept;
-}
-
-
-Node* NodeIterator::next() const
-{
- Node* pNext = _pCurrent->firstChild();
- if (pNext) return pNext;
- pNext = _pCurrent;
- while (pNext && pNext != _pRoot)
- {
- Node* pSibling = pNext->nextSibling();
- if (pSibling) return pSibling;
- pNext = pNext->parentNode();
- }
- return 0;
-}
-
-
-Node* NodeIterator::previous() const
-{
- if (_pCurrent == _pRoot) return 0;
- Node* pPrev = _pCurrent->previousSibling();
- while (pPrev)
- {
- Node* pLastChild = pPrev->lastChild();
- if (pLastChild)
- pPrev = pLastChild;
- else
- return pPrev;
- }
- return _pCurrent->parentNode();
-}
-
-
-Node* NodeIterator::last()
-{
- _pCurrent = _pRoot;
- Node* pLast = 0;
- while (_pCurrent)
- {
- pLast = _pCurrent;
- _pCurrent = next();
- }
- return pLast;
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/NodeList.cpp b/Utilities/Poco/XML/src/NodeList.cpp
deleted file mode 100755
index 657123b7cf..0000000000
--- a/Utilities/Poco/XML/src/NodeList.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// NodeList.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/NodeList.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-NodeList::~NodeList()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Notation.cpp b/Utilities/Poco/XML/src/Notation.cpp
deleted file mode 100755
index e6794d9536..0000000000
--- a/Utilities/Poco/XML/src/Notation.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// Notation.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/Notation.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-Notation::Notation(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId):
- AbstractNode(pOwnerDocument),
- _name(name),
- _publicId(publicId),
- _systemId(systemId)
-{
-}
-
-
-Notation::Notation(Document* pOwnerDocument, const Notation& notation):
- AbstractNode(pOwnerDocument, notation),
- _name(notation._name),
- _publicId(notation._publicId),
- _systemId(notation._systemId)
-{
-}
-
-
-Notation::~Notation()
-{
-}
-
-
-const XMLString& Notation::nodeName() const
-{
- return _name;
-}
-
-
-unsigned short Notation::nodeType() const
-{
- return Node::NOTATION_NODE;
-}
-
-
-Node* Notation::copyNode(bool deep, Document* pOwnerDocument) const
-{
- return new Notation(pOwnerDocument, *this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/ParserEngine.cpp b/Utilities/Poco/XML/src/ParserEngine.cpp
deleted file mode 100755
index c30364f8e1..0000000000
--- a/Utilities/Poco/XML/src/ParserEngine.cpp
+++ /dev/null
@@ -1,859 +0,0 @@
-//
-// ParserEngine.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: ParserEngine
-//
-// Copyright (c) 2004-2007, 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/XML/ParserEngine.h"
-#include "Poco/XML/NamespaceStrategy.h"
-#include "Poco/XML/XMLException.h"
-#include "Poco/SAX/EntityResolver.h"
-#include "Poco/SAX/EntityResolverImpl.h"
-#include "Poco/SAX/DTDHandler.h"
-#include "Poco/SAX/DeclHandler.h"
-#include "Poco/SAX/ContentHandler.h"
-#include "Poco/SAX/LexicalHandler.h"
-#include "Poco/SAX/ErrorHandler.h"
-#include "Poco/SAX/InputSource.h"
-#include "Poco/SAX/Locator.h"
-#include "Poco/SAX/LocatorImpl.h"
-#include "Poco/SAX/SAXException.h"
-#include "Poco/URI.h"
-#include <cstring>
-
-
-using Poco::URI;
-using Poco::TextEncoding;
-
-
-namespace Poco {
-namespace XML {
-
-
-class ContextLocator: public Locator
-{
-public:
- ContextLocator(XML_Parser parser, const XMLString& publicId, const XMLString& systemId):
- _parser(parser),
- _publicId(publicId),
- _systemId(systemId)
- {
- }
-
- ~ContextLocator()
- {
- }
-
- XMLString getPublicId() const
- {
- return _publicId;
- }
-
- XMLString getSystemId() const
- {
- return _systemId;
- }
-
- int getLineNumber() const
- {
- return XML_GetCurrentLineNumber(_parser);
- }
-
- int getColumnNumber() const
- {
- return XML_GetCurrentColumnNumber(_parser);
- }
-
-private:
- XML_Parser _parser;
- XMLString _publicId;
- XMLString _systemId;
-};
-
-
-const int ParserEngine::PARSE_BUFFER_SIZE = 4096;
-const XMLString ParserEngine::EMPTY_STRING;
-
-
-ParserEngine::ParserEngine():
- _parser(0),
- _pBuffer(0),
- _encodingSpecified(false),
- _expandInternalEntities(true),
- _externalGeneralEntities(false),
- _externalParameterEntities(false),
- _pNamespaceStrategy(new NoNamespacesStrategy()),
- _pEntityResolver(0),
- _pDTDHandler(0),
- _pDeclHandler(0),
- _pContentHandler(0),
- _pLexicalHandler(0),
- _pErrorHandler(0)
-{
-}
-
-
-ParserEngine::ParserEngine(const XMLString& encoding):
- _parser(0),
- _pBuffer(0),
- _encodingSpecified(true),
- _encoding(encoding),
- _expandInternalEntities(true),
- _externalGeneralEntities(false),
- _externalParameterEntities(false),
- _pNamespaceStrategy(new NoNamespacesStrategy()),
- _pEntityResolver(0),
- _pDTDHandler(0),
- _pDeclHandler(0),
- _pContentHandler(0),
- _pLexicalHandler(0),
- _pErrorHandler(0)
-{
-}
-
-
-ParserEngine::~ParserEngine()
-{
- resetContext();
- if (_parser) XML_ParserFree(_parser);
- delete [] _pBuffer;
- delete _pNamespaceStrategy;
-}
-
-
-void ParserEngine::setEncoding(const XMLString& encoding)
-{
- _encoding = encoding;
- _encodingSpecified = true;
-}
-
-
-void ParserEngine::addEncoding(const XMLString& name, TextEncoding* pEncoding)
-{
- poco_check_ptr (pEncoding);
-
- if (_encodings.find(name) == _encodings.end())
- _encodings[name] = pEncoding;
- else
- throw XMLException("Encoding already defined");
-}
-
-
-void ParserEngine::setNamespaceStrategy(NamespaceStrategy* pStrategy)
-{
- poco_check_ptr (pStrategy);
-
- delete _pNamespaceStrategy;
- _pNamespaceStrategy = pStrategy;
-}
-
-
-void ParserEngine::setExpandInternalEntities(bool flag)
-{
- _expandInternalEntities = flag;
-}
-
-
-void ParserEngine::setExternalGeneralEntities(bool flag)
-{
- _externalGeneralEntities = flag;
-}
-
-
-void ParserEngine::setExternalParameterEntities(bool flag)
-{
- _externalParameterEntities = flag;
-}
-
-
-void ParserEngine::setEntityResolver(EntityResolver* pResolver)
-{
- _pEntityResolver = pResolver;
-}
-
-
-void ParserEngine::setDTDHandler(DTDHandler* pDTDHandler)
-{
- _pDTDHandler = pDTDHandler;
-}
-
-
-void ParserEngine::setDeclHandler(DeclHandler* pDeclHandler)
-{
- _pDeclHandler = pDeclHandler;
-}
-
-
-void ParserEngine::setContentHandler(ContentHandler* pContentHandler)
-{
- _pContentHandler = pContentHandler;
-}
-
-
-void ParserEngine::setLexicalHandler(LexicalHandler* pLexicalHandler)
-{
- _pLexicalHandler = pLexicalHandler;
-}
-
-
-void ParserEngine::setErrorHandler(ErrorHandler* pErrorHandler)
-{
- _pErrorHandler = pErrorHandler;
-}
-
-
-void ParserEngine::parse(InputSource* pInputSource)
-{
- init();
- resetContext();
- pushContext(_parser, pInputSource);
- if (_pContentHandler) _pContentHandler->setDocumentLocator(this);
- if (_pContentHandler) _pContentHandler->startDocument();
- if (pInputSource->getCharacterStream())
- parseCharInputStream(*pInputSource->getCharacterStream());
- else if (pInputSource->getByteStream())
- parseByteInputStream(*pInputSource->getByteStream());
- else throw XMLException("Input source has no stream");
- if (_pContentHandler) _pContentHandler->endDocument();
- popContext();
-}
-
-
-void ParserEngine::parse(const char* pBuffer, std::size_t size)
-{
- init();
- resetContext();
- InputSource src;
- pushContext(_parser, &src);
- if (_pContentHandler) _pContentHandler->setDocumentLocator(this);
- if (_pContentHandler) _pContentHandler->startDocument();
- if (!XML_Parse(_parser, pBuffer, static_cast<int>(size), 1))
- handleError(XML_GetErrorCode(_parser));
- if (_pContentHandler) _pContentHandler->endDocument();
- popContext();
-}
-
-
-void ParserEngine::parseByteInputStream(XMLByteInputStream& istr)
-{
- istr.read(_pBuffer, PARSE_BUFFER_SIZE);
- int n = static_cast<int>(istr.gcount());
- while (n > 0)
- {
- if (!XML_Parse(_parser, _pBuffer, n, 0))
- handleError(XML_GetErrorCode(_parser));
- if (istr.good())
- {
- istr.read(_pBuffer, PARSE_BUFFER_SIZE);
- n = static_cast<int>(istr.gcount());
- }
- else n = 0;
- }
- if (!XML_Parse(_parser, _pBuffer, 0, 1))
- handleError(XML_GetErrorCode(_parser));
-}
-
-
-void ParserEngine::parseCharInputStream(XMLCharInputStream& istr)
-{
- istr.read(reinterpret_cast<XMLChar*>(_pBuffer), PARSE_BUFFER_SIZE/sizeof(XMLChar));
- int n = static_cast<int>(istr.gcount());
- while (n > 0)
- {
- if (!XML_Parse(_parser, _pBuffer, n*sizeof(XMLChar), 0))
- handleError(XML_GetErrorCode(_parser));
- if (istr.good())
- {
- istr.read(reinterpret_cast<XMLChar*>(_pBuffer), PARSE_BUFFER_SIZE/sizeof(XMLChar));
- n = static_cast<int>(istr.gcount());
- }
- else n = 0;
- }
- if (!XML_Parse(_parser, _pBuffer, 0, 1))
- handleError(XML_GetErrorCode(_parser));
-}
-
-
-void ParserEngine::parseExternal(XML_Parser extParser, InputSource* pInputSource)
-{
- pushContext(extParser, pInputSource);
- if (pInputSource->getCharacterStream())
- parseExternalCharInputStream(extParser, *pInputSource->getCharacterStream());
- else if (pInputSource->getByteStream())
- parseExternalByteInputStream(extParser, *pInputSource->getByteStream());
- else throw XMLException("Input source has no stream");
- popContext();
-}
-
-
-void ParserEngine::parseExternalByteInputStream(XML_Parser extParser, XMLByteInputStream& istr)
-{
- char *pBuffer = new char[PARSE_BUFFER_SIZE];
- try
- {
- istr.read(pBuffer, PARSE_BUFFER_SIZE);
- int n = static_cast<int>(istr.gcount());
- while (n > 0)
- {
- if (!XML_Parse(extParser, pBuffer, n, 0))
- handleError(XML_GetErrorCode(extParser));
- if (istr.good())
- {
- istr.read(pBuffer, PARSE_BUFFER_SIZE);
- n = static_cast<int>(istr.gcount());
- }
- else n = 0;
- }
- if (!XML_Parse(extParser, pBuffer, 0, 1))
- handleError(XML_GetErrorCode(extParser));
- }
- catch (...)
- {
- delete [] pBuffer;
- throw;
- }
- delete [] pBuffer;
-}
-
-
-void ParserEngine::parseExternalCharInputStream(XML_Parser extParser, XMLCharInputStream& istr)
-{
- XMLChar *pBuffer = new XMLChar[PARSE_BUFFER_SIZE/sizeof(XMLChar)];
- try
- {
- istr.read(pBuffer, PARSE_BUFFER_SIZE/sizeof(XMLChar));
- int n = static_cast<int>(istr.gcount());
- while (n > 0)
- {
- if (!XML_Parse(extParser, reinterpret_cast<char*>(pBuffer), n*sizeof(XMLChar), 0))
- handleError(XML_GetErrorCode(extParser));
- if (istr.good())
- {
- istr.read(pBuffer, PARSE_BUFFER_SIZE/sizeof(XMLChar));
- n = static_cast<int>(istr.gcount());
- }
- else n = 0;
- }
- if (!XML_Parse(extParser, reinterpret_cast<char*>(pBuffer), 0, 1))
- handleError(XML_GetErrorCode(extParser));
- }
- catch (...)
- {
- delete [] pBuffer;
- throw;
- }
- delete [] pBuffer;
-}
-
-
-XMLString ParserEngine::getPublicId() const
-{
- return locator().getPublicId();
-}
-
-
-XMLString ParserEngine::getSystemId() const
-{
- return locator().getSystemId();
-}
-
-
-int ParserEngine::getLineNumber() const
-{
- return locator().getLineNumber();
-}
-
-
-int ParserEngine::getColumnNumber() const
-{
- return locator().getColumnNumber();
-}
-
-
-const Locator& ParserEngine::locator() const
-{
- static LocatorImpl nullLocator;
- if (_context.empty())
- return nullLocator;
- else
- return *_context.back();
-}
-
-
-void ParserEngine::init()
-{
- if (_parser)
- XML_ParserFree(_parser);
-
- if (!_pBuffer)
- _pBuffer = new char[PARSE_BUFFER_SIZE];
-
- if (dynamic_cast<NoNamespacePrefixesStrategy*>(_pNamespaceStrategy))
- {
- _parser = XML_ParserCreateNS(_encodingSpecified ? _encoding.c_str() : 0, '\t');
- XML_SetNamespaceDeclHandler(_parser, handleStartNamespaceDecl, handleEndNamespaceDecl);
- }
- else if (dynamic_cast<NamespacePrefixesStrategy*>(_pNamespaceStrategy))
- {
- _parser = XML_ParserCreateNS(_encodingSpecified ? _encoding.c_str() : 0, '\t');
- XML_SetReturnNSTriplet(_parser, 1);
- XML_SetNamespaceDeclHandler(_parser, handleStartNamespaceDecl, handleEndNamespaceDecl);
- }
- else
- {
- _parser = XML_ParserCreate(_encodingSpecified ? _encoding.c_str() : 0);
- }
-
- XML_SetUserData(_parser, this);
- XML_SetElementHandler(_parser, handleStartElement, handleEndElement);
- XML_SetCharacterDataHandler(_parser, handleCharacterData);
- XML_SetProcessingInstructionHandler(_parser, handleProcessingInstruction);
- if (_expandInternalEntities)
- XML_SetDefaultHandlerExpand(_parser, handleDefault);
- else
- XML_SetDefaultHandler(_parser, handleDefault);
- XML_SetUnparsedEntityDeclHandler(_parser, handleUnparsedEntityDecl);
- XML_SetNotationDeclHandler(_parser, handleNotationDecl);
- XML_SetExternalEntityRefHandler(_parser, handleExternalEntityRef);
- XML_SetCommentHandler(_parser, handleComment);
- XML_SetCdataSectionHandler(_parser, handleStartCdataSection, handleEndCdataSection);
- XML_SetDoctypeDeclHandler(_parser, handleStartDoctypeDecl, handleEndDoctypeDecl);
- XML_SetEntityDeclHandler(_parser, handleEntityDecl);
- XML_SetSkippedEntityHandler(_parser, handleSkippedEntity);
- XML_SetParamEntityParsing(_parser, _externalParameterEntities ? XML_PARAM_ENTITY_PARSING_ALWAYS : XML_PARAM_ENTITY_PARSING_NEVER);
- XML_SetUnknownEncodingHandler(_parser, handleUnknownEncoding, this);
-}
-
-
-void ParserEngine::handleError(int errorNo)
-{
- try
- {
- switch (errorNo)
- {
- case XML_ERROR_NO_MEMORY:
- throw XMLException("No memory");
- case XML_ERROR_SYNTAX:
- throw SAXParseException("Syntax error", locator());
- case XML_ERROR_NO_ELEMENTS:
- throw SAXParseException("No element found", locator());
- case XML_ERROR_INVALID_TOKEN:
- throw SAXParseException("Invalid token", locator());
- case XML_ERROR_UNCLOSED_TOKEN:
- throw SAXParseException("Unclosed token", locator());
- case XML_ERROR_PARTIAL_CHAR:
- throw SAXParseException("Partial character", locator());
- case XML_ERROR_TAG_MISMATCH:
- throw SAXParseException("Tag mismatch", locator());
- case XML_ERROR_DUPLICATE_ATTRIBUTE:
- throw SAXParseException("Duplicate attribute", locator());
- case XML_ERROR_JUNK_AFTER_DOC_ELEMENT:
- throw SAXParseException("Junk after document element", locator());
- case XML_ERROR_PARAM_ENTITY_REF:
- throw SAXParseException("Illegal parameter entity reference", locator());
- case XML_ERROR_UNDEFINED_ENTITY:
- throw SAXParseException("Undefined entity", locator());
- case XML_ERROR_RECURSIVE_ENTITY_REF:
- throw SAXParseException("Recursive entity reference", locator());
- case XML_ERROR_ASYNC_ENTITY:
- throw SAXParseException("Asynchronous entity", locator());
- case XML_ERROR_BAD_CHAR_REF:
- throw SAXParseException("Reference to invalid character number", locator());
- case XML_ERROR_BINARY_ENTITY_REF:
- throw SAXParseException("Reference to binary entity", locator());
- case XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF:
- throw SAXParseException("Reference to external entity in attribute", locator());
- case XML_ERROR_MISPLACED_XML_PI:
- throw SAXParseException("XML processing instruction not at start of external entity", locator());
- case XML_ERROR_UNKNOWN_ENCODING:
- throw SAXParseException("Unknown encoding", locator());
- case XML_ERROR_INCORRECT_ENCODING:
- throw SAXParseException("Encoding specified in XML declaration is incorrect", locator());
- case XML_ERROR_UNCLOSED_CDATA_SECTION:
- throw SAXParseException("Unclosed CDATA section", locator());
- case XML_ERROR_EXTERNAL_ENTITY_HANDLING:
- throw SAXParseException("Error in processing external entity reference", locator());
- case XML_ERROR_NOT_STANDALONE:
- throw SAXParseException("Document is not standalone", locator());
- case XML_ERROR_UNEXPECTED_STATE:
- throw SAXParseException("Unexpected parser state - please send a bug report", locator());
- case XML_ERROR_ENTITY_DECLARED_IN_PE:
- throw SAXParseException("Entity declared in parameter entity", locator());
- case XML_ERROR_FEATURE_REQUIRES_XML_DTD:
- throw SAXParseException("Requested feature requires XML_DTD support in Expat", locator());
- case XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING:
- throw SAXParseException("Cannot change setting once parsing has begun", locator());
- case XML_ERROR_UNBOUND_PREFIX:
- throw SAXParseException("Unbound prefix", locator());
- case XML_ERROR_UNDECLARING_PREFIX:
- throw SAXParseException("Must not undeclare prefix", locator());
- case XML_ERROR_INCOMPLETE_PE:
- throw SAXParseException("Incomplete markup in parameter entity", locator());
- case XML_ERROR_XML_DECL:
- throw SAXParseException("XML declaration not well-formed", locator());
- case XML_ERROR_TEXT_DECL:
- throw SAXParseException("Text declaration not well-formed", locator());
- case XML_ERROR_PUBLICID:
- throw SAXParseException("Illegal character(s) in public identifier", locator());
- case XML_ERROR_SUSPENDED:
- throw SAXParseException("Parser suspended", locator());
- case XML_ERROR_NOT_SUSPENDED:
- throw SAXParseException("Parser not suspended", locator());
- case XML_ERROR_ABORTED:
- throw SAXParseException("Parsing aborted", locator());
- case XML_ERROR_FINISHED:
- throw SAXParseException("Parsing finished", locator());
- case XML_ERROR_SUSPEND_PE:
- throw SAXParseException("Cannot suspend in external parameter entity", locator());
- }
- throw XMLException("Unknown Expat error code");
- }
- catch (SAXException& exc)
- {
- if (_pErrorHandler) _pErrorHandler->error(exc);
- throw;
- }
- catch (Poco::Exception& exc)
- {
- if (_pErrorHandler) _pErrorHandler->fatalError(SAXParseException("Fatal error", locator(), exc));
- throw;
- }
-}
-
-
-void ParserEngine::pushContext(XML_Parser parser, InputSource* pInputSource)
-{
- ContextLocator* pLocator = new ContextLocator(parser, pInputSource->getPublicId(), pInputSource->getSystemId());
- _context.push_back(pLocator);
-}
-
-
-void ParserEngine::popContext()
-{
- poco_assert (!_context.empty());
- delete _context.back();
- _context.pop_back();
-}
-
-
-void ParserEngine::resetContext()
-{
- for (ContextStack::iterator it = _context.begin(); it != _context.end(); ++it)
- {
- delete *it;
- }
- _context.clear();
-}
-
-
-void ParserEngine::handleStartElement(void* userData, const XML_Char* name, const XML_Char** atts)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pContentHandler)
- {
- try
- {
- pThis->_pNamespaceStrategy->startElement(name, atts, XML_GetSpecifiedAttributeCount(pThis->_parser)/2, pThis->_pContentHandler);
- }
- catch (XMLException& exc)
- {
- throw SAXParseException(exc.message(), pThis->locator());
- }
- }
-}
-
-
-void ParserEngine::handleEndElement(void* userData, const XML_Char* name)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pContentHandler)
- {
- try
- {
- pThis->_pNamespaceStrategy->endElement(name, pThis->_pContentHandler);
- }
- catch (XMLException& exc)
- {
- throw SAXParseException(exc.message(), pThis->locator());
- }
- }
-}
-
-
-void ParserEngine::handleCharacterData(void* userData, const XML_Char* s, int len)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pContentHandler)
- pThis->_pContentHandler->characters(s, 0, len);
-}
-
-
-void ParserEngine::handleProcessingInstruction(void* userData, const XML_Char* target, const XML_Char* data)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pContentHandler)
- pThis->_pContentHandler->processingInstruction(target, data);
-}
-
-
-void ParserEngine::handleDefault(void* userData, const XML_Char* s, int len)
-{
-}
-
-
-void ParserEngine::handleUnparsedEntityDecl(void* userData, const XML_Char* entityName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId, const XML_Char* notationName)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- XMLString pubId;
- if (publicId) pubId.assign(publicId);
- if (pThis->_pDTDHandler)
- pThis->_pDTDHandler->unparsedEntityDecl(entityName, publicId ? &pubId : 0, systemId, notationName);
-}
-
-
-void ParserEngine::handleNotationDecl(void* userData, const XML_Char* notationName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- XMLString pubId;
- if (publicId) pubId.assign(publicId);
- XMLString sysId;
- if (systemId) sysId.assign(systemId);
- if (pThis->_pDTDHandler)
- pThis->_pDTDHandler->notationDecl(notationName, publicId ? &pubId : 0, systemId ? &sysId : 0);
-}
-
-
-int ParserEngine::handleExternalEntityRef(XML_Parser parser, const XML_Char* context, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(XML_GetUserData(parser));
-
- if (!context && !pThis->_externalParameterEntities) return XML_STATUS_ERROR;
- if (context && !pThis->_externalGeneralEntities) return XML_STATUS_ERROR;
-
- InputSource* pInputSource = 0;
- EntityResolver* pEntityResolver = 0;
- EntityResolverImpl defaultResolver;
-
- XMLString sysId(systemId);
- XMLString pubId;
- if (publicId) pubId.assign(publicId);
-
- URI uri(fromXMLString(pThis->_context.back()->getSystemId()));
- uri.resolve(fromXMLString(sysId));
-
- if (pThis->_pEntityResolver)
- {
- pEntityResolver = pThis->_pEntityResolver;
- pInputSource = pEntityResolver->resolveEntity(publicId ? &pubId : 0, toXMLString(uri.toString()));
- }
- if (!pInputSource && pThis->_externalGeneralEntities)
- {
- pEntityResolver = &defaultResolver;
- pInputSource = pEntityResolver->resolveEntity(publicId ? &pubId : 0, toXMLString(uri.toString()));
- }
-
- if (pInputSource)
- {
- XML_Parser extParser = XML_ExternalEntityParserCreate(pThis->_parser, context, 0);
- try
- {
- pThis->parseExternal(extParser, pInputSource);
- }
- catch (XMLException&)
- {
- pEntityResolver->releaseInputSource(pInputSource);
- XML_ParserFree(extParser);
- throw;
- }
- pEntityResolver->releaseInputSource(pInputSource);
- XML_ParserFree(extParser);
- return XML_STATUS_OK;
- }
- else return XML_STATUS_ERROR;
-}
-
-
-int ParserEngine::handleUnknownEncoding(void* encodingHandlerData, const XML_Char* name, XML_Encoding* info)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(encodingHandlerData);
-
- XMLString encoding(name);
- TextEncoding* knownEncoding = 0;
-
- EncodingMap::const_iterator it = pThis->_encodings.find(encoding);
- if (it != pThis->_encodings.end())
- knownEncoding = it->second;
- else
- knownEncoding = Poco::TextEncoding::find(fromXMLString(encoding));
-
- if (knownEncoding)
- {
- const TextEncoding::CharacterMap& map = knownEncoding->characterMap();
- for (int i = 0; i < 256; ++i)
- info->map[i] = map[i];
-
- info->data = knownEncoding;
- info->convert = &ParserEngine::convert;
- info->release = 0;
- return XML_STATUS_OK;
- }
- else return XML_STATUS_ERROR;
-}
-
-
-void ParserEngine::handleComment(void* userData, const XML_Char* data)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
-#if defined(XML_UNICODE_WCHAR_T)
- if (pThis->_pLexicalHandler)
- pThis->_pLexicalHandler->comment(data, 0, (int) std::wcslen(data));
-#else
- if (pThis->_pLexicalHandler)
- pThis->_pLexicalHandler->comment(data, 0, (int) std::strlen(data));
-#endif
-}
-
-
-void ParserEngine::handleStartCdataSection(void* userData)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pLexicalHandler)
- pThis->_pLexicalHandler->startCDATA();
-}
-
-
-void ParserEngine::handleEndCdataSection(void* userData)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pLexicalHandler)
- pThis->_pLexicalHandler->endCDATA();
-}
-
-
-void ParserEngine::handleStartNamespaceDecl(void* userData, const XML_Char* prefix, const XML_Char* uri)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pContentHandler)
- pThis->_pContentHandler->startPrefixMapping((prefix ? XMLString(prefix) : EMPTY_STRING), (uri ? XMLString(uri) : EMPTY_STRING));
-}
-
-
-void ParserEngine::handleEndNamespaceDecl(void* userData, const XML_Char* prefix)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pContentHandler)
- pThis->_pContentHandler->endPrefixMapping(prefix ? XMLString(prefix) : EMPTY_STRING);
-}
-
-
-void ParserEngine::handleStartDoctypeDecl(void* userData, const XML_Char* doctypeName, const XML_Char *systemId, const XML_Char* publicId, int hasInternalSubset)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pLexicalHandler)
- {
- XMLString sysId = systemId ? XMLString(systemId) : EMPTY_STRING;
- XMLString pubId = publicId ? XMLString(publicId) : EMPTY_STRING;
- pThis->_pLexicalHandler->startDTD(doctypeName, pubId, sysId);
- }
-}
-
-
-void ParserEngine::handleEndDoctypeDecl(void* userData)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pLexicalHandler)
- pThis->_pLexicalHandler->endDTD();
-}
-
-
-void ParserEngine::handleEntityDecl(void *userData, const XML_Char *entityName, int isParamEntity, const XML_Char *value, int valueLength,
- const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName)
-{
- if (value)
- handleInternalParsedEntityDecl(userData, entityName, value, valueLength);
- else
- handleExternalParsedEntityDecl(userData, entityName, base, systemId, publicId);
-}
-
-
-void ParserEngine::handleExternalParsedEntityDecl(void* userData, const XML_Char* entityName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- XMLString pubId;
- if (publicId) pubId.assign(publicId);
- if (pThis->_pDeclHandler)
- pThis->_pDeclHandler->externalEntityDecl(entityName, publicId ? &pubId : 0, systemId);
-}
-
-
-void ParserEngine::handleInternalParsedEntityDecl(void* userData, const XML_Char* entityName, const XML_Char* replacementText, int replacementTextLength)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- XMLString replText(replacementText, replacementTextLength);
- if (pThis->_pDeclHandler)
- pThis->_pDeclHandler->internalEntityDecl(entityName, replText);
-}
-
-
-void ParserEngine::handleSkippedEntity(void* userData, const XML_Char* entityName, int isParameterEntity)
-{
- ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
-
- if (pThis->_pContentHandler)
- pThis->_pContentHandler->skippedEntity(entityName);
-}
-
-
-int ParserEngine::convert(void* data, const char* s)
-{
- TextEncoding* pEncoding = reinterpret_cast<TextEncoding*>(data);
- return pEncoding->convert((const unsigned char*) s);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/ProcessingInstruction.cpp b/Utilities/Poco/XML/src/ProcessingInstruction.cpp
deleted file mode 100755
index 222d3551d1..0000000000
--- a/Utilities/Poco/XML/src/ProcessingInstruction.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// ProcessingInstruction.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/ProcessingInstruction.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-ProcessingInstruction::ProcessingInstruction(Document* pOwnerDocument, const XMLString& target, const XMLString& data):
- AbstractNode(pOwnerDocument),
- _target(target),
- _data(data)
-{
-}
-
-
-ProcessingInstruction::ProcessingInstruction(Document* pOwnerDocument, const ProcessingInstruction& processingInstruction):
- AbstractNode(pOwnerDocument, processingInstruction),
- _target(processingInstruction._target),
- _data(processingInstruction._data)
-{
-}
-
-
-ProcessingInstruction::~ProcessingInstruction()
-{
-}
-
-
-void ProcessingInstruction::setData(const XMLString& data)
-{
- _data = data;
-}
-
-
-const XMLString& ProcessingInstruction::nodeName() const
-{
- return _target;
-}
-
-
-const XMLString& ProcessingInstruction::getNodeValue() const
-{
- return _data;
-}
-
-
-void ProcessingInstruction::setNodeValue(const XMLString& data)
-{
- setData(data);
-}
-
-
-unsigned short ProcessingInstruction::nodeType() const
-{
- return Node::PROCESSING_INSTRUCTION_NODE;
-}
-
-
-Node* ProcessingInstruction::copyNode(bool deep, Document* pOwnerDocument) const
-{
- return new ProcessingInstruction(pOwnerDocument, *this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/SAXException.cpp b/Utilities/Poco/XML/src/SAXException.cpp
deleted file mode 100755
index 644c683cac..0000000000
--- a/Utilities/Poco/XML/src/SAXException.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// SAXException.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/SAXException.h"
-#include "Poco/SAX/Locator.h"
-#include <typeinfo>
-#include <sstream>
-
-
-namespace Poco {
-namespace XML {
-
-
-POCO_IMPLEMENT_EXCEPTION(SAXException, XMLException, "SAX Exception")
-POCO_IMPLEMENT_EXCEPTION(SAXNotRecognizedException, SAXException, "Unrecognized SAX feature or property identifier")
-POCO_IMPLEMENT_EXCEPTION(SAXNotSupportedException, SAXException, "Unsupported SAX feature or property identifier")
-
-
-SAXParseException::SAXParseException(const std::string& msg, const Locator& loc):
- SAXException(buildMessage(msg, loc.getPublicId(), loc.getSystemId(), loc.getLineNumber(), loc.getColumnNumber())),
- _publicId(loc.getPublicId()),
- _systemId(loc.getSystemId()),
- _lineNumber(loc.getLineNumber()),
- _columnNumber(loc.getColumnNumber())
-{
-}
-
-
-SAXParseException::SAXParseException(const std::string& msg, const Locator& loc, const Poco::Exception& exc):
- SAXException(buildMessage(msg, loc.getPublicId(), loc.getSystemId(), loc.getLineNumber(), loc.getColumnNumber()), exc),
- _publicId(loc.getPublicId()),
- _systemId(loc.getSystemId()),
- _lineNumber(loc.getLineNumber()),
- _columnNumber(loc.getColumnNumber())
-{
-}
-
-
-SAXParseException::SAXParseException(const std::string& msg, const XMLString& publicId, const XMLString& systemId, int lineNumber, int columnNumber):
- SAXException(buildMessage(msg, publicId, systemId, lineNumber, columnNumber)),
- _publicId(publicId),
- _systemId(systemId),
- _lineNumber(lineNumber),
- _columnNumber(columnNumber)
-{
-}
-
-
-SAXParseException::SAXParseException(const std::string& msg, const XMLString& publicId, const XMLString& systemId, int lineNumber, int columnNumber, const Poco::Exception& exc):
- SAXException(buildMessage(msg, publicId, systemId, lineNumber, columnNumber), exc),
- _publicId(publicId),
- _systemId(systemId),
- _lineNumber(lineNumber),
- _columnNumber(columnNumber)
-{
-}
-
-
-SAXParseException::SAXParseException(const SAXParseException& exc):
- SAXException(exc),
- _publicId(exc._publicId),
- _systemId(exc._systemId),
- _lineNumber(exc._lineNumber),
- _columnNumber(exc._columnNumber)
-{
-}
-
-
-SAXParseException::~SAXParseException() throw()
-{
-}
-
-
-SAXParseException& SAXParseException::operator = (const SAXParseException& exc)
-{
- if (&exc != this)
- {
- SAXException::operator = (exc);
- _publicId = exc._publicId;
- _systemId = exc._systemId;
- _lineNumber = exc._lineNumber;
- _columnNumber = exc._columnNumber;
- }
- return *this;
-}
-
-
-const char* SAXParseException::name() const throw()
-{
- return "SAXParseException";
-}
-
-
-const char* SAXParseException::className() const throw()
-{
- return typeid(*this).name();
-}
-
-
-Poco::Exception* SAXParseException::clone() const
-{
- return new SAXParseException(*this);
-}
-
-
-void SAXParseException::rethrow() const
-{
- throw *this;
-}
-
-
-std::string SAXParseException::buildMessage(const std::string& msg, const XMLString& publicId, const XMLString& systemId, int lineNumber, int columnNumber)
-{
- std::ostringstream result;
- if (!msg.empty()) result << msg << " ";
- result << "in ";
- if (!systemId.empty())
- result << "'" << fromXMLString(systemId) << "', ";
- else if (!publicId.empty())
- result << "'" << fromXMLString(publicId) << "', ";
- if (lineNumber > 0)
- result << "line " << lineNumber << " column " << columnNumber;
- return result.str();
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/SAXParser.cpp b/Utilities/Poco/XML/src/SAXParser.cpp
deleted file mode 100755
index 53141b07a6..0000000000
--- a/Utilities/Poco/XML/src/SAXParser.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-//
-// SAXParser.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/SAXParser.h"
-#include "Poco/SAX/SAXException.h"
-#include "Poco/SAX/EntityResolverImpl.h"
-#include "Poco/SAX/InputSource.h"
-#include "Poco/XML/NamespaceStrategy.h"
-#include <sstream>
-
-
-namespace Poco {
-namespace XML {
-
-
-SAXParser::SAXParser():
- _namespaces(true),
- _namespacePrefixes(false)
-{
-}
-
-
-SAXParser::SAXParser(const XMLString& encoding):
- _engine(encoding),
- _namespaces(true),
- _namespacePrefixes(false)
-{
-}
-
-
-SAXParser::~SAXParser()
-{
-}
-
-
-void SAXParser::setEncoding(const XMLString& encoding)
-{
- _engine.setEncoding(encoding);
-}
-
-
-const XMLString& SAXParser::getEncoding() const
-{
- return _engine.getEncoding();
-}
-
-
-void SAXParser::addEncoding(const XMLString& name, Poco::TextEncoding* pEncoding)
-{
- _engine.addEncoding(name, pEncoding);
-}
-
-
-void SAXParser::setEntityResolver(EntityResolver* pResolver)
-{
- _engine.setEntityResolver(pResolver);
-}
-
-
-EntityResolver* SAXParser::getEntityResolver() const
-{
- return _engine.getEntityResolver();
-}
-
-
-void SAXParser::setDTDHandler(DTDHandler* pDTDHandler)
-{
- _engine.setDTDHandler(pDTDHandler);
-}
-
-
-DTDHandler* SAXParser::getDTDHandler() const
-{
- return _engine.getDTDHandler();
-}
-
-
-void SAXParser::setContentHandler(ContentHandler* pContentHandler)
-{
- _engine.setContentHandler(pContentHandler);
-}
-
-
-ContentHandler* SAXParser::getContentHandler() const
-{
- return _engine.getContentHandler();
-}
-
-
-void SAXParser::setErrorHandler(ErrorHandler* pErrorHandler)
-{
- _engine.setErrorHandler(pErrorHandler);
-}
-
-
-ErrorHandler* SAXParser::getErrorHandler() const
-{
- return _engine.getErrorHandler();
-}
-
-
-void SAXParser::setFeature(const XMLString& featureId, bool state)
-{
- if (featureId == XMLReader::FEATURE_VALIDATION || featureId == XMLReader::FEATURE_STRING_INTERNING)
- throw SAXNotSupportedException(fromXMLString(XMLReader::FEATURE_VALIDATION));
- else if (featureId == XMLReader::FEATURE_EXTERNAL_GENERAL_ENTITIES)
- _engine.setExternalGeneralEntities(state);
- else if (featureId == XMLReader::FEATURE_EXTERNAL_PARAMETER_ENTITIES)
- _engine.setExternalParameterEntities(state);
- else if (featureId == XMLReader::FEATURE_NAMESPACES)
- _namespaces = state;
- else if (featureId == XMLReader::FEATURE_NAMESPACE_PREFIXES)
- _namespacePrefixes = state;
- else throw SAXNotRecognizedException(fromXMLString(featureId));
-}
-
-
-bool SAXParser::getFeature(const XMLString& featureId) const
-{
- if (featureId == XMLReader::FEATURE_VALIDATION || featureId == XMLReader::FEATURE_STRING_INTERNING)
- throw SAXNotSupportedException(fromXMLString(XMLReader::FEATURE_VALIDATION));
- else if (featureId == XMLReader::FEATURE_EXTERNAL_GENERAL_ENTITIES)
- return _engine.getExternalGeneralEntities();
- else if (featureId == XMLReader::FEATURE_EXTERNAL_PARAMETER_ENTITIES)
- return _engine.getExternalParameterEntities();
- else if (featureId == XMLReader::FEATURE_NAMESPACES)
- return _namespaces;
- else if (featureId == XMLReader::FEATURE_NAMESPACE_PREFIXES)
- return _namespacePrefixes;
- else throw SAXNotRecognizedException(fromXMLString(featureId));
-}
-
-
-void SAXParser::setProperty(const XMLString& propertyId, const XMLString& value)
-{
- if (propertyId == XMLReader::PROPERTY_DECLARATION_HANDLER || propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
- throw SAXNotSupportedException(std::string("property does not take a string value: ") + fromXMLString(propertyId));
- else
- throw SAXNotRecognizedException(fromXMLString(propertyId));
-}
-
-
-void SAXParser::setProperty(const XMLString& propertyId, void* value)
-{
- if (propertyId == XMLReader::PROPERTY_DECLARATION_HANDLER)
- _engine.setDeclHandler(reinterpret_cast<DeclHandler*>(value));
- else if (propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
- _engine.setLexicalHandler(reinterpret_cast<LexicalHandler*>(value));
- else throw SAXNotRecognizedException(fromXMLString(propertyId));
-}
-
-
-void* SAXParser::getProperty(const XMLString& propertyId) const
-{
- if (propertyId == XMLReader::PROPERTY_DECLARATION_HANDLER)
- return _engine.getDeclHandler();
- else if (propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
- return _engine.getLexicalHandler();
- else throw SAXNotSupportedException(fromXMLString(propertyId));
-}
-
-
-void SAXParser::parse(InputSource* pInputSource)
-{
- if (pInputSource->getByteStream() || pInputSource->getCharacterStream())
- {
- setupParse();
- _engine.parse(pInputSource);
- }
- else parse(pInputSource->getSystemId());
-}
-
-
-void SAXParser::parse(const XMLString& systemId)
-{
- setupParse();
- EntityResolverImpl entityResolver;
- InputSource* pInputSource = entityResolver.resolveEntity(0, systemId);
- if (pInputSource)
- {
- try
- {
- _engine.parse(pInputSource);
- }
- catch (...)
- {
- entityResolver.releaseInputSource(pInputSource);
- throw;
- }
- entityResolver.releaseInputSource(pInputSource);
- }
- else throw XMLException("Cannot resolve system identifier", fromXMLString(systemId));
-}
-
-
-void SAXParser::parseString(const std::string& xml)
-{
- parseMemoryNP(xml.data(), xml.size());
-}
-
-
-void SAXParser::parseMemoryNP(const char* xml, std::size_t size)
-{
- setupParse();
- _engine.parse(xml, size);
-}
-
-
-void SAXParser::setupParse()
-{
- if (_namespaces && !_namespacePrefixes)
- _engine.setNamespaceStrategy(new NoNamespacePrefixesStrategy);
- else if (_namespaces && _namespacePrefixes)
- _engine.setNamespaceStrategy(new NamespacePrefixesStrategy);
- else
- _engine.setNamespaceStrategy(new NoNamespacesStrategy);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/Text.cpp b/Utilities/Poco/XML/src/Text.cpp
deleted file mode 100755
index 6c066f3786..0000000000
--- a/Utilities/Poco/XML/src/Text.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// Text.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: DOM
-//
-// Copyright (c) 2004-2006, 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/DOM/Text.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/DOMException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString Text::NODE_NAME = toXMLString("#text");
-
-
-Text::Text(Document* pOwnerDocument, const XMLString& data):
- CharacterData(pOwnerDocument, data)
-{
-}
-
-
-Text::Text(Document* pOwnerDocument, const Text& text):
- CharacterData(pOwnerDocument, text)
-{
-}
-
-
-Text::~Text()
-{
-}
-
-
-Text* Text::splitText(unsigned long offset)
-{
- Node* pParent = parentNode();
- if (!pParent) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
- int n = length() - offset;
- Text* pNew = ownerDocument()->createTextNode(substringData(offset, n));
- deleteData(offset, n);
- pParent->insertBefore(pNew, nextSibling())->release();
- return pNew;
-}
-
-
-const XMLString& Text::nodeName() const
-{
- return NODE_NAME;
-}
-
-
-unsigned short Text::nodeType() const
-{
- return Node::TEXT_NODE;
-}
-
-
-XMLString Text::innerText() const
-{
- return nodeValue();
-}
-
-
-Node* Text::copyNode(bool deep, Document* pOwnerDocument) const
-{
- return new Text(pOwnerDocument, *this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/TreeWalker.cpp b/Utilities/Poco/XML/src/TreeWalker.cpp
deleted file mode 100755
index 9877841817..0000000000
--- a/Utilities/Poco/XML/src/TreeWalker.cpp
+++ /dev/null
@@ -1,249 +0,0 @@
-//
-// TreeWalker.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: DOM
-// Module: TreeWalker
-//
-// Copyright (c) 2004-2006, 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/DOM/TreeWalker.h"
-#include "Poco/DOM/Node.h"
-#include "Poco/DOM/NodeFilter.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-TreeWalker::TreeWalker(Node* root, unsigned long whatToShow, NodeFilter* pFilter):
- _pRoot(root),
- _whatToShow(whatToShow),
- _pFilter(pFilter),
- _pCurrent(root)
-{
-}
-
-
-TreeWalker::TreeWalker(const TreeWalker& walker):
- _pRoot(walker._pRoot),
- _whatToShow(walker._whatToShow),
- _pFilter(walker._pFilter),
- _pCurrent(walker._pCurrent)
-{
-}
-
-
-TreeWalker& TreeWalker::operator = (const TreeWalker& walker)
-{
- if (&walker != this)
- {
- _pRoot = walker._pRoot;
- _whatToShow = walker._whatToShow;
- _pFilter = walker._pFilter;
- _pCurrent = walker._pCurrent;
- }
- return *this;
-}
-
-
-TreeWalker::~TreeWalker()
-{
-}
-
-
-void TreeWalker::setCurrentNode(Node* pNode)
-{
- _pCurrent = pNode;
-}
-
-
-Node* TreeWalker::parentNode()
-{
- if (!_pCurrent || _pCurrent == _pRoot) return 0;
-
- Node* pParent = _pCurrent->parentNode();
- while (pParent && pParent != _pRoot && accept(pParent) != NodeFilter::FILTER_ACCEPT)
- pParent = pParent->parentNode();
- if (pParent && accept(pParent) == NodeFilter::FILTER_ACCEPT)
- _pCurrent = pParent;
- else
- pParent = 0;
- return pParent;
-}
-
-
-Node* TreeWalker::firstChild()
-{
- if (!_pCurrent) return 0;
-
- Node* pNode = accept(_pCurrent) != NodeFilter::FILTER_REJECT ? _pCurrent->firstChild() : 0;
- while (pNode && accept(pNode) != NodeFilter::FILTER_ACCEPT)
- pNode = pNode->nextSibling();
- if (pNode)
- _pCurrent = pNode;
- return pNode;
-}
-
-
-Node* TreeWalker::lastChild()
-{
- if (!_pCurrent) return 0;
-
- Node* pNode = accept(_pCurrent) != NodeFilter::FILTER_REJECT ? _pCurrent->lastChild() : 0;
- while (pNode && accept(pNode) != NodeFilter::FILTER_ACCEPT)
- pNode = pNode->previousSibling();
- if (pNode)
- _pCurrent = pNode;
- return pNode;
-}
-
-
-Node* TreeWalker::previousSibling()
-{
- if (!_pCurrent) return 0;
-
- Node* pNode = _pCurrent->previousSibling();
- while (pNode && accept(pNode) != NodeFilter::FILTER_ACCEPT)
- pNode = pNode->previousSibling();
- if (pNode)
- _pCurrent = pNode;
- return pNode;
-}
-
-
-Node* TreeWalker::nextSibling()
-{
- if (!_pCurrent) return 0;
-
- Node* pNode = _pCurrent->nextSibling();
- while (pNode && accept(pNode) != NodeFilter::FILTER_ACCEPT)
- pNode = pNode->nextSibling();
- if (pNode)
- _pCurrent = pNode;
- return pNode;
-}
-
-
-Node* TreeWalker::previousNode()
-{
- if (!_pCurrent) return 0;
-
- Node* pPrev = previous(_pCurrent);
- while (pPrev && accept(pPrev) != NodeFilter::FILTER_ACCEPT)
- pPrev = previous(pPrev);
- if (pPrev)
- _pCurrent = pPrev;
- return pPrev;
-}
-
-
-Node* TreeWalker::nextNode()
-{
- if (!_pCurrent) return 0;
-
- Node* pNext = next(_pCurrent);
- while (pNext && accept(pNext) != NodeFilter::FILTER_ACCEPT)
- pNext = next(pNext);
- if (pNext)
- _pCurrent = pNext;
- return pNext;
-}
-
-
-int TreeWalker::accept(Node* pNode) const
-{
- bool accept = false;
- switch (pNode->nodeType())
- {
- case Node::ELEMENT_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_ELEMENT) != 0; break;
- case Node::ATTRIBUTE_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_ATTRIBUTE) != 0; break;
- case Node::TEXT_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_TEXT) != 0; break;
- case Node::CDATA_SECTION_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_CDATA_SECTION) != 0; break;
- case Node::ENTITY_REFERENCE_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_ENTITY_REFERENCE) != 0; break;
- case Node::ENTITY_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_ENTITY) != 0; break;
- case Node::PROCESSING_INSTRUCTION_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_PROCESSING_INSTRUCTION) != 0; break;
- case Node::COMMENT_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_COMMENT) != 0; break;
- case Node::DOCUMENT_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_DOCUMENT) != 0; break;
- case Node::DOCUMENT_TYPE_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_DOCUMENT_TYPE) != 0; break;
- case Node::DOCUMENT_FRAGMENT_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_DOCUMENT_FRAGMENT) != 0; break;
- case Node::NOTATION_NODE:
- accept = (_whatToShow & NodeFilter::SHOW_NOTATION) != 0; break;
- }
- if (accept && _pFilter)
- return _pFilter->acceptNode(pNode);
- else
- return accept ? NodeFilter::FILTER_ACCEPT : NodeFilter::FILTER_REJECT;
-}
-
-
-Node* TreeWalker::next(Node* pNode) const
-{
- Node* pNext = accept(pNode) != NodeFilter::FILTER_REJECT ? pNode->firstChild() : 0;
- if (pNext) return pNext;
- pNext = pNode;
- while (pNext && pNext != _pRoot)
- {
- Node* pSibling = pNext->nextSibling();
- if (pSibling) return pSibling;
- pNext = pNext->parentNode();
- }
- return 0;
-}
-
-
-Node* TreeWalker::previous(Node* pNode) const
-{
- if (pNode == _pRoot) return 0;
- Node* pPrev = pNode->previousSibling();
- while (pPrev)
- {
- Node* pLastChild = accept(pPrev) != NodeFilter::FILTER_REJECT ? pPrev->lastChild() : 0;
- if (pLastChild)
- pPrev = pLastChild;
- else
- return pPrev;
- }
- return pNode->parentNode();
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/WhitespaceFilter.cpp b/Utilities/Poco/XML/src/WhitespaceFilter.cpp
deleted file mode 100755
index 2d33ebcabf..0000000000
--- a/Utilities/Poco/XML/src/WhitespaceFilter.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// WhitespaceFilter.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: WhitespaceFilter
-//
-// Copyright (c) 2004-2006, 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/SAX/WhitespaceFilter.h"
-#include "Poco/SAX/SAXException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-WhitespaceFilter::WhitespaceFilter():
- _pLexicalHandler(0),
- _filter(true)
-{
-}
-
-
-WhitespaceFilter::WhitespaceFilter(XMLReader* pReader):
- XMLFilterImpl(pReader),
- _pLexicalHandler(0),
- _filter(true)
-{
-}
-
-
-WhitespaceFilter::~WhitespaceFilter()
-{
-}
-
-
-void WhitespaceFilter::setProperty(const XMLString& propertyId, const XMLString& value)
-{
- if (propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
- throw SAXNotSupportedException(std::string("property does not take a string value: ") + fromXMLString(propertyId));
- else
- XMLFilterImpl::setProperty(propertyId, value);
-
-}
-
-
-void WhitespaceFilter::setProperty(const XMLString& propertyId, void* value)
-{
- if (propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
- _pLexicalHandler = reinterpret_cast<LexicalHandler*>(value);
- else
- XMLFilterImpl::setProperty(propertyId, value);
-}
-
-
-void* WhitespaceFilter::getProperty(const XMLString& propertyId) const
-{
- if (propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
- return _pLexicalHandler;
- else
- return XMLFilterImpl::getProperty(propertyId);
-}
-
-
-void WhitespaceFilter::startDocument()
-{
- XMLFilterImpl::startDocument();
- _filter = true;
- _data.clear();
-}
-
-
-void WhitespaceFilter::endDocument()
-{
- XMLFilterImpl::endDocument();
- _filter = true;
- _data.clear();
-}
-
-
-void WhitespaceFilter::startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attrList)
-{
- XMLFilterImpl::startElement(uri, localName, qname, attrList);
- _filter = true;
- _data.clear();
-}
-
-
-void WhitespaceFilter::endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname)
-{
- XMLFilterImpl::endElement(uri, localName, qname);
- _filter = true;
- _data.clear();
-}
-
-
-void WhitespaceFilter::characters(const XMLChar ch[], int start, int length)
-{
- if (_filter)
- {
- bool ws = true;
- const XMLChar* it = ch + start;
- const XMLChar* end = ch + start + length;
- _data.append(it, end);
- while (it != end)
- {
- if (*it != '\r' && *it != '\n' && *it != '\t' && *it != ' ')
- {
- ws = false;
- break;
- }
- ++it;
- }
- if (!ws)
- {
- XMLFilterImpl::characters(_data.data(), 0, (int) _data.length());
- _filter = false;
- _data.clear();
- }
- }
- else XMLFilterImpl::characters(ch, start, length);
-}
-
-
-void WhitespaceFilter::ignorableWhitespace(const XMLChar ch[], int start, int length)
-{
- // the handler name already says that this data can be ignored
-}
-
-
-void WhitespaceFilter::processingInstruction(const XMLString& target, const XMLString& data)
-{
- XMLFilterImpl::processingInstruction(target, data);
- _filter = true;
- _data.clear();
-}
-
-
-void WhitespaceFilter::startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId)
-{
- if (_pLexicalHandler)
- _pLexicalHandler->startDTD(name, publicId, systemId);
-}
-
-
-void WhitespaceFilter::endDTD()
-{
- if (_pLexicalHandler)
- _pLexicalHandler->endDTD();
-}
-
-
-void WhitespaceFilter::startEntity(const XMLString& name)
-{
- if (_pLexicalHandler)
- _pLexicalHandler->startEntity(name);
- _filter = true;
- _data.clear();
-}
-
-
-void WhitespaceFilter::endEntity(const XMLString& name)
-{
- if (_pLexicalHandler)
- _pLexicalHandler->endEntity(name);
- _filter = true;
- _data.clear();
-}
-
-
-void WhitespaceFilter::startCDATA()
-{
- if (_pLexicalHandler)
- _pLexicalHandler->startCDATA();
- _filter = false;
- _data.clear();
-}
-
-
-void WhitespaceFilter::endCDATA()
-{
- if (_pLexicalHandler)
- _pLexicalHandler->endCDATA();
- _filter = true;
- _data.clear();
-}
-
-
-void WhitespaceFilter::comment(const XMLChar ch[], int start, int length)
-{
- if (_pLexicalHandler)
- _pLexicalHandler->comment(ch, start, length);
- _filter = true;
- _data.clear();
-}
-
-
-void WhitespaceFilter::setupParse()
-{
- XMLFilterImpl::setupParse();
-
- parent()->setProperty(XMLReader::PROPERTY_LEXICAL_HANDLER, static_cast<LexicalHandler*>(this));
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/XMLException.cpp b/Utilities/Poco/XML/src/XMLException.cpp
deleted file mode 100755
index 945ddd05c8..0000000000
--- a/Utilities/Poco/XML/src/XMLException.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// XMLException.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: XMLException
-//
-// Copyright (c) 2004-2006, 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/XML/XMLException.h"
-#include <typeinfo>
-
-
-using Poco::RuntimeException;
-
-
-namespace Poco {
-namespace XML {
-
-
-POCO_IMPLEMENT_EXCEPTION(XMLException, RuntimeException, "XML Exception")
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/XMLFilter.cpp b/Utilities/Poco/XML/src/XMLFilter.cpp
deleted file mode 100755
index 2edeed9707..0000000000
--- a/Utilities/Poco/XML/src/XMLFilter.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// XMLFilter.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAXFilters
-//
-// Copyright (c) 2004-2006, 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/SAX/XMLFilter.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-XMLFilter::~XMLFilter()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/XMLFilterImpl.cpp b/Utilities/Poco/XML/src/XMLFilterImpl.cpp
deleted file mode 100755
index d1326a0126..0000000000
--- a/Utilities/Poco/XML/src/XMLFilterImpl.cpp
+++ /dev/null
@@ -1,335 +0,0 @@
-//
-// XMLFilterImpl.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAXFilters
-//
-// Copyright (c) 2004-2006, 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/SAX/XMLFilterImpl.h"
-#include "Poco/SAX/SAXException.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-XMLFilterImpl::XMLFilterImpl():
- _pParent(0),
- _pEntityResolver(0),
- _pDTDHandler(0),
- _pContentHandler(0),
- _pErrorHandler(0)
-{
-}
-
-
-XMLFilterImpl::XMLFilterImpl(XMLReader* pParent):
- _pParent(pParent),
- _pEntityResolver(0),
- _pDTDHandler(0),
- _pContentHandler(0),
- _pErrorHandler(0)
-{
-}
-
-
-XMLFilterImpl::~XMLFilterImpl()
-{
-}
-
-
-XMLReader* XMLFilterImpl::getParent() const
-{
- return _pParent;
-}
-
-
-void XMLFilterImpl::setParent(XMLReader* pParent)
-{
- _pParent = pParent;
-}
-
-
-void XMLFilterImpl::setEntityResolver(EntityResolver* pResolver)
-{
- _pEntityResolver = pResolver;
-}
-
-
-EntityResolver* XMLFilterImpl::getEntityResolver() const
-{
- return _pEntityResolver;
-}
-
-
-void XMLFilterImpl::setDTDHandler(DTDHandler* pDTDHandler)
-{
- _pDTDHandler = pDTDHandler;
-}
-
-
-DTDHandler* XMLFilterImpl::getDTDHandler() const
-{
- return _pDTDHandler;
-}
-
-
-void XMLFilterImpl::setContentHandler(ContentHandler* pContentHandler)
-{
- _pContentHandler = pContentHandler;
-}
-
-
-ContentHandler* XMLFilterImpl::getContentHandler() const
-{
- return _pContentHandler;
-}
-
-
-void XMLFilterImpl::setErrorHandler(ErrorHandler* pErrorHandler)
-{
- _pErrorHandler = pErrorHandler;
-}
-
-
-ErrorHandler* XMLFilterImpl::getErrorHandler() const
-{
- return _pErrorHandler;
-}
-
-
-void XMLFilterImpl::setFeature(const XMLString& featureId, bool state)
-{
- if (_pParent)
- _pParent->setFeature(featureId, state);
- else
- throw SAXNotRecognizedException(fromXMLString(featureId));
-}
-
-
-bool XMLFilterImpl::getFeature(const XMLString& featureId) const
-{
- if (_pParent)
- return _pParent->getFeature(featureId);
- else
- throw SAXNotRecognizedException(fromXMLString(featureId));
-}
-
-
-void XMLFilterImpl::setProperty(const XMLString& propertyId, const XMLString& value)
-{
- if (_pParent)
- _pParent->setProperty(propertyId, value);
- else
- throw SAXNotRecognizedException(fromXMLString(propertyId));
-}
-
-
-void XMLFilterImpl::setProperty(const XMLString& propertyId, void* value)
-{
- if (_pParent)
- _pParent->setProperty(propertyId, value);
- else
- throw SAXNotRecognizedException(fromXMLString(propertyId));
-}
-
-
-void* XMLFilterImpl::getProperty(const XMLString& propertyId) const
-{
- if (_pParent)
- return _pParent->getProperty(propertyId);
- else
- throw SAXNotRecognizedException(fromXMLString(propertyId));
-}
-
-
-void XMLFilterImpl::parse(InputSource* pSource)
-{
- setupParse();
- _pParent->parse(pSource);
-}
-
-
-void XMLFilterImpl::parse(const XMLString& systemId)
-{
- setupParse();
- _pParent->parse(systemId);
-}
-
-
-void XMLFilterImpl::parseMemoryNP(const char* xml, std::size_t size)
-{
- setupParse();
- _pParent->parseMemoryNP(xml, size);
-}
-
-
-InputSource* XMLFilterImpl::resolveEntity(const XMLString* publicId, const XMLString& systemId)
-{
- if (_pEntityResolver)
- return _pEntityResolver->resolveEntity(publicId, systemId);
- else
- return 0;
-}
-
-
-void XMLFilterImpl::releaseInputSource(InputSource* pSource)
-{
- if (_pEntityResolver)
- _pEntityResolver->releaseInputSource(pSource);
-}
-
-
-void XMLFilterImpl::notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId)
-{
- if (_pDTDHandler)
- _pDTDHandler->notationDecl(name, publicId, systemId);
-}
-
-
-void XMLFilterImpl::unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName)
-{
- if (_pDTDHandler)
- _pDTDHandler->unparsedEntityDecl(name, publicId, systemId, notationName);
-}
-
-
-void XMLFilterImpl::setDocumentLocator(const Locator* loc)
-{
- if (_pContentHandler)
- _pContentHandler->setDocumentLocator(loc);
-}
-
-
-void XMLFilterImpl::startDocument()
-{
- if (_pContentHandler)
- _pContentHandler->startDocument();
-}
-
-
-void XMLFilterImpl::endDocument()
-{
- if (_pContentHandler)
- _pContentHandler->endDocument();
-}
-
-
-void XMLFilterImpl::startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attrList)
-{
- if (_pContentHandler)
- _pContentHandler->startElement(uri, localName, qname, attrList);
-}
-
-
-void XMLFilterImpl::endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname)
-{
- if (_pContentHandler)
- _pContentHandler->endElement(uri, localName, qname);
-}
-
-
-void XMLFilterImpl::characters(const XMLChar ch[], int start, int length)
-{
- if (_pContentHandler)
- _pContentHandler->characters(ch, start, length);
-}
-
-
-void XMLFilterImpl::ignorableWhitespace(const XMLChar ch[], int start, int length)
-{
- if (_pContentHandler)
- _pContentHandler->ignorableWhitespace(ch, start, length);
-}
-
-
-void XMLFilterImpl::processingInstruction(const XMLString& target, const XMLString& data)
-{
- if (_pContentHandler)
- _pContentHandler->processingInstruction(target, data);
-}
-
-
-void XMLFilterImpl::startPrefixMapping(const XMLString& prefix, const XMLString& uri)
-{
- if (_pContentHandler)
- _pContentHandler->startPrefixMapping(prefix, uri);
-}
-
-
-void XMLFilterImpl::endPrefixMapping(const XMLString& prefix)
-{
- if (_pContentHandler)
- _pContentHandler->endPrefixMapping(prefix);
-}
-
-
-void XMLFilterImpl::skippedEntity(const XMLString& prefix)
-{
- if (_pContentHandler)
- _pContentHandler->skippedEntity(prefix);
-}
-
-
-void XMLFilterImpl::warning(const SAXException& e)
-{
- if (_pErrorHandler)
- _pErrorHandler->warning(e);
-}
-
-
-void XMLFilterImpl::error(const SAXException& e)
-{
- if (_pErrorHandler)
- _pErrorHandler->error(e);
-}
-
-
-void XMLFilterImpl::fatalError(const SAXException& e)
-{
- if (_pErrorHandler)
- _pErrorHandler->fatalError(e);
-}
-
-
-void XMLFilterImpl::setupParse()
-{
- poco_check_ptr (_pParent);
-
- _pParent->setEntityResolver(this);
- _pParent->setDTDHandler(this);
- _pParent->setContentHandler(this);
- _pParent->setErrorHandler(this);
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/XMLReader.cpp b/Utilities/Poco/XML/src/XMLReader.cpp
deleted file mode 100755
index f21c0dc031..0000000000
--- a/Utilities/Poco/XML/src/XMLReader.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// XMLReader.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: SAX
-// Module: SAX
-//
-// Copyright (c) 2004-2006, 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/SAX/XMLReader.h"
-
-
-namespace Poco {
-namespace XML {
-
-
-const XMLString XMLReader::FEATURE_VALIDATION = toXMLString("http://xml.org/sax/features/validation");
-const XMLString XMLReader::FEATURE_NAMESPACES = toXMLString("http://xml.org/sax/features/namespaces");
-const XMLString XMLReader::FEATURE_NAMESPACE_PREFIXES = toXMLString("http://xml.org/sax/features/namespace-prefixes");
-const XMLString XMLReader::FEATURE_EXTERNAL_GENERAL_ENTITIES = toXMLString("http://xml.org/sax/features/external-general-entities");
-const XMLString XMLReader::FEATURE_EXTERNAL_PARAMETER_ENTITIES = toXMLString("http://xml.org/sax/features/external-parameter-entities");
-const XMLString XMLReader::FEATURE_STRING_INTERNING = toXMLString("http://xml.org/sax/features/string-interning");
-const XMLString XMLReader::PROPERTY_DECLARATION_HANDLER = toXMLString("http://xml.org/sax/properties/declaration-handler");
-const XMLString XMLReader::PROPERTY_LEXICAL_HANDLER = toXMLString("http://xml.org/sax/properties/lexical-handler");
-
-
-XMLReader::~XMLReader()
-{
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/XMLString.cpp b/Utilities/Poco/XML/src/XMLString.cpp
deleted file mode 100755
index c8e79aba88..0000000000
--- a/Utilities/Poco/XML/src/XMLString.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// XMLString.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: XMLString
-//
-// Copyright (c) 2004-2006, 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/XML/XMLString.h"
-
-
-#if defined(XML_UNICODE_WCHAR_T)
-#include <stdlib.h>
-#endif
-
-
-namespace Poco {
-namespace XML {
-
-
-#if defined(XML_UNICODE_WCHAR_T)
-
-
-std::string fromXMLString(const XMLString& str)
-{
- std::string result;
- result.reserve(str.size());
-
- for (XMLString::const_iterator it = str.begin(); it != str.end(); ++it)
- {
- char c;
- wctomb(&c, *it);
- result += c;
- }
- return result;
-}
-
-
-XMLString toXMLString(const std::string& str)
-{
- XMLString result;
- result.reserve(str.size());
-
- for (std::string::const_iterator it = str.begin(); it != str.end();)
- {
- wchar_t c;
- int n = mbtowc(&c, &*it, MB_CUR_MAX);
- result += c;
- it += (n > 0 ? n : 1);
- }
- return result;
-}
-
-
-#endif // XML_UNICODE_WCHAR_T
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/XMLWriter.cpp b/Utilities/Poco/XML/src/XMLWriter.cpp
deleted file mode 100755
index 4fa4b7b9aa..0000000000
--- a/Utilities/Poco/XML/src/XMLWriter.cpp
+++ /dev/null
@@ -1,816 +0,0 @@
-//
-// XMLWriter.cpp
-//
-// $Id$
-//
-// Library: XML
-// Package: XML
-// Module: XMLWriter
-//
-// Copyright (c) 2004-2006, 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/XML/XMLWriter.h"
-#include "Poco/XML/XMLString.h"
-#include "Poco/XML/XMLException.h"
-#include "Poco/SAX/AttributesImpl.h"
-#include "Poco/UTF8Encoding.h"
-#include "Poco/UTF16Encoding.h"
-#include <sstream>
-
-
-namespace Poco {
-namespace XML {
-
-
-const std::string XMLWriter::NEWLINE_DEFAULT;
-const std::string XMLWriter::NEWLINE_CR = "\r";
-const std::string XMLWriter::NEWLINE_CRLF = "\r\n";
-const std::string XMLWriter::NEWLINE_LF = "\n";
-const std::string XMLWriter::MARKUP_QUOTENC = "&quot;";
-const std::string XMLWriter::MARKUP_APOSENC = "&apos;";
-const std::string XMLWriter::MARKUP_AMPENC = "&amp;";
-const std::string XMLWriter::MARKUP_LTENC = "&lt;";
-const std::string XMLWriter::MARKUP_GTENC = "&gt;";
-const std::string XMLWriter::MARKUP_LT = "<";
-const std::string XMLWriter::MARKUP_GT = ">";
-const std::string XMLWriter::MARKUP_SLASHGT = "/>";
-const std::string XMLWriter::MARKUP_LTSLASH = "</";
-const std::string XMLWriter::MARKUP_COLON = ":";
-const std::string XMLWriter::MARKUP_EQQUOT = "=\"";
-const std::string XMLWriter::MARKUP_QUOT = "\"";
-const std::string XMLWriter::MARKUP_SPACE = " ";
-const std::string XMLWriter::MARKUP_TAB = "\t";
-const std::string XMLWriter::MARKUP_BEGIN_CDATA = "<![CDATA[";
-const std::string XMLWriter::MARKUP_END_CDATA = "]]>";
-
-
-#if defined(XML_UNICODE_WCHAR_T)
- #define NATIVE_ENCODING Poco::UTF16Encoding
-#else
- #define NATIVE_ENCODING Poco::UTF8Encoding
-#endif
-
-
-XMLWriter::XMLWriter(XMLByteOutputStream& str, int options):
- _pTextConverter(0),
- _pInEncoding(new NATIVE_ENCODING),
- _pOutEncoding(new Poco::UTF8Encoding),
- _options(options),
- _encoding("UTF-8"),
- _depth(-1),
- _elementCount(0),
- _inFragment(false),
- _inCDATA(false),
- _inDTD(false),
- _inInternalDTD(false),
- _contentWritten(false),
- _unclosedStartTag(false),
- _prefix(0)
-{
- _pTextConverter = new Poco::OutputStreamConverter(str, *_pInEncoding, *_pOutEncoding);
- setNewLine(NEWLINE_DEFAULT);
-}
-
-
-XMLWriter::XMLWriter(XMLByteOutputStream& str, int options, const std::string& encodingName, Poco::TextEncoding& textEncoding):
- _pTextConverter(0),
- _pInEncoding(new NATIVE_ENCODING),
- _pOutEncoding(0),
- _options(options),
- _encoding(encodingName),
- _depth(-1),
- _elementCount(0),
- _inFragment(false),
- _inCDATA(false),
- _inDTD(false),
- _inInternalDTD(false),
- _contentWritten(false),
- _unclosedStartTag(false),
- _prefix(0)
-{
- _pTextConverter = new Poco::OutputStreamConverter(str, *_pInEncoding, textEncoding);
- setNewLine(NEWLINE_DEFAULT);
-}
-
-
-XMLWriter::XMLWriter(XMLByteOutputStream& str, int options, const std::string& encodingName, Poco::TextEncoding* pTextEncoding):
- _pTextConverter(0),
- _pInEncoding(new NATIVE_ENCODING),
- _pOutEncoding(0),
- _options(options),
- _encoding(encodingName),
- _depth(-1),
- _elementCount(0),
- _inFragment(false),
- _inCDATA(false),
- _inDTD(false),
- _inInternalDTD(false),
- _contentWritten(false),
- _unclosedStartTag(false),
- _prefix(0)
-{
- if (pTextEncoding)
- {
- _pTextConverter = new Poco::OutputStreamConverter(str, *_pInEncoding, *pTextEncoding);
- }
- else
- {
- _encoding = "UTF-8";
- _pOutEncoding = new Poco::UTF8Encoding;
- _pTextConverter = new Poco::OutputStreamConverter(str, *_pInEncoding, *_pOutEncoding);
- }
- setNewLine(NEWLINE_DEFAULT);
-}
-
-
-XMLWriter::~XMLWriter()
-{
- delete _pTextConverter;
- delete _pInEncoding;
- delete _pOutEncoding;
-}
-
-
-void XMLWriter::setDocumentLocator(const Locator* loc)
-{
-}
-
-
-void XMLWriter::setNewLine(const std::string& newLineCharacters)
-{
- if (newLineCharacters.empty())
- {
-#if defined(_WIN32)
- _newLine = NEWLINE_CRLF;
-#else
- _newLine = NEWLINE_LF;
-#endif
- }
- else _newLine = newLineCharacters;
-}
-
-
-const std::string& XMLWriter::getNewLine() const
-{
- return _newLine;
-}
-
-
-void XMLWriter::startDocument()
-{
- if (_depth != -1)
- throw XMLException("Cannot start a document in another document");
-
- _inFragment = false;
- _depth = 0;
- _elementCount = 0;
- _inDTD = false;
- _inInternalDTD = false;
- _prefix = 0;
-
- if (_options & WRITE_XML_DECLARATION)
- writeXMLDeclaration();
-
- _contentWritten = true;
- _namespaces.reset();
- _namespaces.pushContext();
-}
-
-
-void XMLWriter::endDocument()
-{
- if (_depth > 0)
- throw XMLException("Not well-formed (at least one tag has no matching end tag)");
- if (_elementCount == 0)
- throw XMLException("No document element");
-
- poco_assert_dbg (!_unclosedStartTag);
-
- _elementCount = 0;
- _depth = -1;
-}
-
-
-void XMLWriter::startFragment()
-{
- if (_depth != -1)
- throw XMLException("Cannot start a fragment in another fragment or document");
-
- _inFragment = true;
- _depth = 0;
- _elementCount = 0;
- _prefix = 0;
-
- _contentWritten = true;
- _namespaces.reset();
- _namespaces.pushContext();
-}
-
-
-void XMLWriter::endFragment()
-{
- if (_depth > 1)
- throw XMLException("Not well-formed (at least one tag has no matching end tag)");
-
- _inFragment = false;
- _elementCount = 0;
- _depth = -1;
-}
-
-
-void XMLWriter::startElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname)
-{
- static const AttributesImpl attributes;
- startElement(namespaceURI, localName, qname, attributes);
-}
-
-
-void XMLWriter::startElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const Attributes& attributes)
-{
- if (_depth == 0 && !_inFragment && _elementCount > 1)
- throw XMLException("Not well-formed. Second root element found", nameToString(localName, qname));
-
- if (_unclosedStartTag) closeStartTag();
- prettyPrint();
- writeStartElement(namespaceURI, localName, qname, attributes);
- _elementStack.push_back(Name(qname, namespaceURI, localName));
- _contentWritten = false;
- ++_depth;
-}
-
-
-void XMLWriter::endElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname)
-{
- if (_depth < 1)
- throw XMLException("No unclosed tag");
-
- if (!_elementStack.back().equalsWeakly(qname, namespaceURI, localName))
- throw XMLException("End tag does not match start tag", nameToString(localName, qname));
-
- _elementStack.pop_back();
- --_depth;
- if (!_unclosedStartTag) prettyPrint();
- writeEndElement(namespaceURI, localName, qname);
- _contentWritten = false;
- if (_depth == 0)
- writeNewLine();
-}
-
-
-void XMLWriter::emptyElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname)
-{
- static const AttributesImpl attributes;
- emptyElement(namespaceURI, localName, qname, attributes);
-}
-
-
-void XMLWriter::emptyElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const Attributes& attributes)
-{
- if (_depth == 0 && _elementCount > 1)
- throw XMLException("Not well-formed. Second root element found.");
-
- if (_unclosedStartTag) closeStartTag();
- prettyPrint();
- writeStartElement(namespaceURI, localName, qname, attributes);
- _contentWritten = false;
- writeMarkup("/");
- closeStartTag();
-}
-
-
-void XMLWriter::characters(const XMLChar ch[], int start, int length)
-{
- if (length == 0) return;
-
- if (_unclosedStartTag) closeStartTag();
- _contentWritten = _contentWritten || length > 0;
- if (_inCDATA)
- {
- while (length-- > 0) writeXML(ch[start++]);
- }
- else
- {
- while (length-- > 0)
- {
- XMLChar c = ch[start++];
- switch (c)
- {
- case '"': writeMarkup(MARKUP_QUOTENC); break;
- case '\'': writeMarkup(MARKUP_APOSENC); break;
- case '&': writeMarkup(MARKUP_AMPENC); break;
- case '<': writeMarkup(MARKUP_LTENC); break;
- case '>': writeMarkup(MARKUP_GTENC); break;
- default:
- if (c >= 0 && c < 32)
- {
- if (c == '\t' || c == '\r' || c == '\n')
- writeXML(c);
- else
- throw XMLException("Invalid character token.");
- }
- else writeXML(c);
- }
- }
- }
-}
-
-
-void XMLWriter::characters(const XMLString& str)
-{
- characters(str.data(), 0, (int) str.length());
-}
-
-
-void XMLWriter::rawCharacters(const XMLString& str)
-{
- if (_unclosedStartTag) closeStartTag();
- _contentWritten = _contentWritten || !str.empty();
- writeXML(str);
-}
-
-
-void XMLWriter::ignorableWhitespace(const XMLChar ch[], int start, int length)
-{
- characters(ch, start, length);
-}
-
-
-void XMLWriter::processingInstruction(const XMLString& target, const XMLString& data)
-{
- if (_unclosedStartTag) closeStartTag();
- prettyPrint();
- writeMarkup("<?");
- writeXML(target);
- if (!data.empty())
- {
- writeMarkup(MARKUP_SPACE);
- writeXML(data);
- }
- writeMarkup("?>");
- if (_depth == 0)
- writeNewLine();
-}
-
-
-void XMLWriter::dataElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname,
- const XMLString& data,
- const XMLString& attr1, const XMLString& value1,
- const XMLString& attr2, const XMLString& value2,
- const XMLString& attr3, const XMLString& value3)
-{
- static const XMLString CDATA = toXMLString("CDATA");
-
- AttributesImpl attributes;
- if (!attr1.empty()) attributes.addAttribute(XMLString(), XMLString(), attr1, CDATA, value1);
- if (!attr2.empty()) attributes.addAttribute(XMLString(), XMLString(), attr2, CDATA, value2);
- if (!attr3.empty()) attributes.addAttribute(XMLString(), XMLString(), attr3, CDATA, value3);
- if (data.empty())
- {
- emptyElement(namespaceURI, localName, qname, attributes);
- }
- else
- {
- startElement(namespaceURI, localName, qname, attributes);
- characters(data);
- endElement(namespaceURI, localName, qname);
- }
-}
-
-
-void XMLWriter::startPrefixMapping(const XMLString& prefix, const XMLString& namespaceURI)
-{
- if (prefix != NamespaceSupport::XML_NAMESPACE_PREFIX)
- _namespaces.declarePrefix(prefix, namespaceURI);
-}
-
-
-void XMLWriter::endPrefixMapping(const XMLString& prefix)
-{
- if (prefix != NamespaceSupport::XML_NAMESPACE_PREFIX)
- _namespaces.undeclarePrefix(prefix);
-}
-
-
-void XMLWriter::skippedEntity(const XMLString& name)
-{
-}
-
-
-void XMLWriter::startCDATA()
-{
- if (_inCDATA) throw XMLException("Cannot nest CDATA sections");
- if (_unclosedStartTag) closeStartTag();
- _inCDATA = true;
- writeMarkup(MARKUP_BEGIN_CDATA);
-}
-
-
-void XMLWriter::endCDATA()
-{
- poco_assert (_inCDATA);
- _inCDATA = false;
- writeMarkup(MARKUP_END_CDATA);
-}
-
-
-void XMLWriter::comment(const XMLChar ch[], int start, int length)
-{
- if (_unclosedStartTag) closeStartTag();
- prettyPrint();
- writeMarkup("<!--");
- while (length-- > 0) writeXML(ch[start++]);
- writeMarkup("-->");
- _contentWritten = false;
-}
-
-
-void XMLWriter::startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId)
-{
- writeMarkup("<!DOCTYPE ");
- writeXML(name);
- if (!publicId.empty())
- {
- writeMarkup(" PUBLIC \"");
- writeXML(publicId);
- writeMarkup("\"");
- }
- if (!systemId.empty())
- {
- writeMarkup(" SYSTEM \"");
- writeXML(systemId);
- writeMarkup("\"");
- }
- _inDTD = true;
-}
-
-
-void XMLWriter::endDTD()
-{
- poco_assert (_inDTD);
- if (_inInternalDTD)
- {
- writeNewLine();
- writeMarkup("]");
- _inInternalDTD = false;
- }
- writeMarkup(">");
- writeNewLine();
- _inDTD = false;
-}
-
-
-void XMLWriter::startEntity(const XMLString& name)
-{
-}
-
-
-void XMLWriter::endEntity(const XMLString& name)
-{
-}
-
-
-void XMLWriter::notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId)
-{
- if (!_inDTD) throw XMLException("Notation declaration not within DTD");
- if (!_inInternalDTD)
- {
- writeMarkup(" [");
- _inInternalDTD = true;
- }
- if (_options & PRETTY_PRINT)
- {
- writeNewLine();
- writeMarkup(MARKUP_TAB);
- }
- writeMarkup("<!NOTATION ");
- writeXML(name);
- if (systemId && !systemId->empty())
- {
- writeMarkup(" SYSTEM \"");
- writeXML(*systemId);
- writeMarkup("\"");
- }
- if (publicId && !publicId->empty())
- {
- writeMarkup(" PUBLIC \"");
- writeXML(*publicId);
- writeMarkup("\"");
- }
- writeMarkup(">");
-}
-
-
-void XMLWriter::unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName)
-{
- if (!_inDTD) throw XMLException("Entity declaration not within DTD");
- if (!_inInternalDTD)
- {
- writeMarkup(" [");
- _inInternalDTD = true;
- }
- if (_options & PRETTY_PRINT)
- {
- writeNewLine();
- writeMarkup(MARKUP_TAB);
- }
- writeMarkup("<!ENTITY ");
- writeXML(name);
- if (!systemId.empty())
- {
- writeMarkup(" SYSTEM \"");
- writeXML(systemId);
- writeMarkup("\"");
- }
- if (publicId && !publicId->empty())
- {
- writeMarkup(" PUBLIC \"");
- writeXML(*publicId);
- writeMarkup("\"");
- }
- if (!notationName.empty())
- {
- writeMarkup(" NDATA ");
- writeXML(notationName);
- }
- writeMarkup(">");
-}
-
-
-void XMLWriter::prettyPrint() const
-{
- if ((_options & PRETTY_PRINT) && !_contentWritten)
- {
- writeNewLine();
- writeIndent();
- }
-}
-
-
-void XMLWriter::writeStartElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const Attributes& attributes)
-{
- ++_elementCount;
- writeMarkup(MARKUP_LT);
- if (!localName.empty() && (qname.empty() || localName == qname))
- {
- XMLString prefix;
- if (!namespaceURI.empty() && !_namespaces.isMapped(namespaceURI))
- {
- prefix = newPrefix();
- _namespaces.declarePrefix(prefix, namespaceURI);
- }
- else prefix = _namespaces.getPrefix(namespaceURI);
- writeName(prefix, localName);
- }
- else if (namespaceURI.empty() && localName.empty() && !qname.empty())
- {
- writeXML(qname);
- }
- else if (!localName.empty() && !qname.empty())
- {
- XMLString local;
- XMLString prefix;
- Name::split(qname, prefix, local);
- if (prefix.empty()) prefix = _namespaces.getPrefix(namespaceURI);
- const XMLString& uri = _namespaces.getURI(prefix);
- if ((uri.empty() || uri != namespaceURI) && !namespaceURI.empty())
- {
- _namespaces.declarePrefix(prefix, namespaceURI);
- }
- writeName(prefix, localName);
- }
- else throw XMLException("Tag mismatch", nameToString(localName, qname));
-
- declareAttributeNamespaces(attributes);
- AttributeMap attributeMap;
- addNamespaceAttributes(attributeMap);
- addAttributes(attributeMap, attributes, namespaceURI);
- writeAttributes(attributeMap);
- _unclosedStartTag = true;
- _namespaces.pushContext();
-}
-
-
-void XMLWriter::writeEndElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname)
-{
- if (_unclosedStartTag)
- {
- writeMarkup(MARKUP_SLASHGT);
- _unclosedStartTag = false;
- }
- else
- {
- writeMarkup(MARKUP_LTSLASH);
- if (!localName.empty())
- {
- XMLString prefix = _namespaces.getPrefix(namespaceURI);
- writeName(prefix, localName);
- }
- else
- {
- writeXML(qname);
- }
- writeMarkup(MARKUP_GT);
- }
- _namespaces.popContext();
-}
-
-
-void XMLWriter::closeStartTag()
-{
- _unclosedStartTag = false;
- writeMarkup(MARKUP_GT);
-}
-
-
-void XMLWriter::declareAttributeNamespaces(const Attributes& attributes)
-{
- for (int i = 0; i < attributes.getLength(); i++)
- {
- XMLString namespaceURI = attributes.getURI(i);
- XMLString localName = attributes.getLocalName(i);
- XMLString qname = attributes.getQName(i);
- if (!localName.empty())
- {
- XMLString prefix;
- XMLString splitLocalName;
- Name::split(qname, prefix, splitLocalName);
- if (prefix.empty()) prefix = _namespaces.getPrefix(namespaceURI);
- if (prefix.empty() && !namespaceURI.empty() && !_namespaces.isMapped(namespaceURI))
- {
- prefix = newPrefix();
- _namespaces.declarePrefix(prefix, namespaceURI);
- }
-
-
- const XMLString& uri = _namespaces.getURI(prefix);
- if ((uri.empty() || uri != namespaceURI) && !namespaceURI.empty())
- {
- _namespaces.declarePrefix(prefix, namespaceURI);
- }
- }
- }
-}
-
-
-void XMLWriter::addNamespaceAttributes(AttributeMap& attributeMap)
-{
- NamespaceSupport::PrefixSet prefixes;
- _namespaces.getDeclaredPrefixes(prefixes);
- for (NamespaceSupport::PrefixSet::const_iterator it = prefixes.begin(); it != prefixes.end(); ++it)
- {
- XMLString prefix = *it;
- XMLString uri = _namespaces.getURI(prefix);
- XMLString qname = NamespaceSupport::XMLNS_NAMESPACE_PREFIX;
-
- if (!prefix.empty())
- {
- qname.append(toXMLString(MARKUP_COLON));
- qname.append(prefix);
- }
- attributeMap[qname] = uri;
- }
-}
-
-
-void XMLWriter::addAttributes(AttributeMap& attributeMap, const Attributes& attributes, const XMLString& elementNamespaceURI)
-{
- for (int i = 0; i < attributes.getLength(); i++)
- {
- XMLString namespaceURI = attributes.getURI(i);
- XMLString localName = attributes.getLocalName(i);
- XMLString qname = attributes.getQName(i);
- if (!localName.empty())
- {
- XMLString prefix;
- if (namespaceURI != elementNamespaceURI)
- prefix = _namespaces.getPrefix(namespaceURI);
- if (!prefix.empty())
- {
- qname = prefix;
- qname.append(toXMLString(MARKUP_COLON));
- }
- else qname.clear();
- qname.append(localName);
- }
- attributeMap[qname] = attributes.getValue(i);
- }
-}
-
-
-void XMLWriter::writeAttributes(const AttributeMap& attributeMap)
-{
- for (AttributeMap::const_iterator it = attributeMap.begin(); it != attributeMap.end(); ++it)
- {
- writeMarkup(MARKUP_SPACE);
- writeXML(it->first);
- writeMarkup(MARKUP_EQQUOT);
- characters(it->second);
- writeMarkup(MARKUP_QUOT);
- }
-}
-
-
-void XMLWriter::writeMarkup(const std::string& str) const
-{
- _pTextConverter->write(str.data(), (int) str.size());
-}
-
-
-void XMLWriter::writeXML(const XMLString& str) const
-{
- _pTextConverter->write((const char*) str.data(), (int) str.size()*sizeof(XMLChar));
-}
-
-
-void XMLWriter::writeXML(XMLChar ch) const
-{
- _pTextConverter->write((const char*) &ch, sizeof(ch));
-}
-
-
-void XMLWriter::writeName(const XMLString& prefix, const XMLString& localName)
-{
- if (prefix.empty())
- {
- writeXML(localName);
- }
- else
- {
- writeXML(prefix);
- writeMarkup(MARKUP_COLON);
- writeXML(localName);
- }
-}
-
-
-void XMLWriter::writeNewLine() const
-{
- if (_options & PRETTY_PRINT)
- writeMarkup(_newLine);
-}
-
-
-void XMLWriter::writeIndent() const
-{
- for (int i = 0; i < _depth; ++i)
- writeMarkup(MARKUP_TAB);
-}
-
-
-void XMLWriter::writeXMLDeclaration()
-{
- writeMarkup("<?xml version=\"1.0\"");
- if (!_encoding.empty())
- {
- writeMarkup(" encoding=\"");
- writeMarkup(_encoding);
- writeMarkup("\"");
- }
- writeMarkup("?>");
- writeNewLine();
-}
-
-
-std::string XMLWriter::nameToString(const XMLString& localName, const XMLString& qname)
-{
- if (qname.empty())
- return fromXMLString(localName);
- else
- return fromXMLString(qname);
-}
-
-
-XMLString XMLWriter::newPrefix()
-{
- std::ostringstream str;
- str << "ns" << ++_prefix;
- return toXMLString(str.str());
-}
-
-
-} } // namespace Poco::XML
diff --git a/Utilities/Poco/XML/src/ascii.h b/Utilities/Poco/XML/src/ascii.h
deleted file mode 100755
index d10530b09b..0000000000
--- a/Utilities/Poco/XML/src/ascii.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-#define ASCII_A 0x41
-#define ASCII_B 0x42
-#define ASCII_C 0x43
-#define ASCII_D 0x44
-#define ASCII_E 0x45
-#define ASCII_F 0x46
-#define ASCII_G 0x47
-#define ASCII_H 0x48
-#define ASCII_I 0x49
-#define ASCII_J 0x4A
-#define ASCII_K 0x4B
-#define ASCII_L 0x4C
-#define ASCII_M 0x4D
-#define ASCII_N 0x4E
-#define ASCII_O 0x4F
-#define ASCII_P 0x50
-#define ASCII_Q 0x51
-#define ASCII_R 0x52
-#define ASCII_S 0x53
-#define ASCII_T 0x54
-#define ASCII_U 0x55
-#define ASCII_V 0x56
-#define ASCII_W 0x57
-#define ASCII_X 0x58
-#define ASCII_Y 0x59
-#define ASCII_Z 0x5A
-
-#define ASCII_a 0x61
-#define ASCII_b 0x62
-#define ASCII_c 0x63
-#define ASCII_d 0x64
-#define ASCII_e 0x65
-#define ASCII_f 0x66
-#define ASCII_g 0x67
-#define ASCII_h 0x68
-#define ASCII_i 0x69
-#define ASCII_j 0x6A
-#define ASCII_k 0x6B
-#define ASCII_l 0x6C
-#define ASCII_m 0x6D
-#define ASCII_n 0x6E
-#define ASCII_o 0x6F
-#define ASCII_p 0x70
-#define ASCII_q 0x71
-#define ASCII_r 0x72
-#define ASCII_s 0x73
-#define ASCII_t 0x74
-#define ASCII_u 0x75
-#define ASCII_v 0x76
-#define ASCII_w 0x77
-#define ASCII_x 0x78
-#define ASCII_y 0x79
-#define ASCII_z 0x7A
-
-#define ASCII_0 0x30
-#define ASCII_1 0x31
-#define ASCII_2 0x32
-#define ASCII_3 0x33
-#define ASCII_4 0x34
-#define ASCII_5 0x35
-#define ASCII_6 0x36
-#define ASCII_7 0x37
-#define ASCII_8 0x38
-#define ASCII_9 0x39
-
-#define ASCII_TAB 0x09
-#define ASCII_SPACE 0x20
-#define ASCII_EXCL 0x21
-#define ASCII_QUOT 0x22
-#define ASCII_AMP 0x26
-#define ASCII_APOS 0x27
-#define ASCII_MINUS 0x2D
-#define ASCII_PERIOD 0x2E
-#define ASCII_COLON 0x3A
-#define ASCII_SEMI 0x3B
-#define ASCII_LT 0x3C
-#define ASCII_EQUALS 0x3D
-#define ASCII_GT 0x3E
-#define ASCII_LSQB 0x5B
-#define ASCII_RSQB 0x5D
-#define ASCII_UNDERSCORE 0x5F
-#define ASCII_LPAREN 0x28
-#define ASCII_RPAREN 0x29
-#define ASCII_FF 0x0C
-#define ASCII_SLASH 0x2F
-#define ASCII_HASH 0x23
-#define ASCII_PIPE 0x7C
-#define ASCII_COMMA 0x2C
diff --git a/Utilities/Poco/XML/src/asciitab.h b/Utilities/Poco/XML/src/asciitab.h
deleted file mode 100755
index 79a15c28ca..0000000000
--- a/Utilities/Poco/XML/src/asciitab.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
-/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
-/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
-/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
-/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
-/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
-/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
-/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
-/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
-/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
-/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
-/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
-/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
-/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
-/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
-/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
-/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
-/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
diff --git a/Utilities/Poco/XML/src/expat_config.h b/Utilities/Poco/XML/src/expat_config.h
deleted file mode 100755
index 441c07c53d..0000000000
--- a/Utilities/Poco/XML/src/expat_config.h
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// expat_config.h
-//
-// $Id$
-//
-// Poco XML specific configuration for expat.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef EXPAT_CONFIG_H
-#define EXPAT_CONFIG_H
-
-
-#include "Poco/Platform.h"
-
-
-#include <memory.h>
-#include <string.h>
-
-
-#define XML_CONTEXT_BYTES 1024
-
-
-#if defined POCO_ARCH_LITTLE_ENDIAN
-#define BYTEORDER 1234
-#else
-#define BYTEORDER 4321
-#endif
-
-
-#define HAVE_MEMMOVE
-
-
-#endif /* EXPAT_CONFIG_H */
diff --git a/Utilities/Poco/XML/src/iasciitab.h b/Utilities/Poco/XML/src/iasciitab.h
deleted file mode 100755
index 24a1d5ccc9..0000000000
--- a/Utilities/Poco/XML/src/iasciitab.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
-/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
-/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
-/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
-/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
-/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
-/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
-/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
-/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
-/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
-/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
-/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
-/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
-/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
-/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
-/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
-/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
-/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
-/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
diff --git a/Utilities/Poco/XML/src/internal.h b/Utilities/Poco/XML/src/internal.h
deleted file mode 100755
index dd5454831d..0000000000
--- a/Utilities/Poco/XML/src/internal.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* internal.h
-
- Internal definitions used by Expat. This is not needed to compile
- client code.
-
- The following calling convention macros are defined for frequently
- called functions:
-
- FASTCALL - Used for those internal functions that have a simple
- body and a low number of arguments and local variables.
-
- PTRCALL - Used for functions called though function pointers.
-
- PTRFASTCALL - Like PTRCALL, but for low number of arguments.
-
- inline - Used for selected internal functions for which inlining
- may improve performance on some platforms.
-
- Note: Use of these macros is based on judgement, not hard rules,
- and therefore subject to change.
-*/
-
-#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__)
-/* We'll use this version by default only where we know it helps.
-
- regparm() generates warnings on Solaris boxes. See SF bug #692878.
-
- Instability reported with egcs on a RedHat Linux 7.3.
- Let's comment out:
- #define FASTCALL __attribute__((stdcall, regparm(3)))
- and let's try this:
-*/
-#define FASTCALL __attribute__((regparm(3)))
-#define PTRFASTCALL __attribute__((regparm(3)))
-#endif
-
-/* Using __fastcall seems to have an unexpected negative effect under
- MS VC++, especially for function pointers, so we won't use it for
- now on that platform. It may be reconsidered for a future release
- if it can be made more effective.
- Likely reason: __fastcall on Windows is like stdcall, therefore
- the compiler cannot perform stack optimizations for call clusters.
-*/
-
-/* Make sure all of these are defined if they aren't already. */
-
-#ifndef FASTCALL
-#define FASTCALL
-#endif
-
-#ifndef PTRCALL
-#define PTRCALL
-#endif
-
-#ifndef PTRFASTCALL
-#define PTRFASTCALL
-#endif
-
-#ifndef XML_MIN_SIZE
-#if !defined(__cplusplus) && !defined(inline)
-#ifdef __GNUC__
-#define inline __inline
-#endif /* __GNUC__ */
-#endif
-#endif /* XML_MIN_SIZE */
-
-#ifdef __cplusplus
-#define inline inline
-#else
-#ifndef inline
-#define inline
-#endif
-#endif
diff --git a/Utilities/Poco/XML/src/latin1tab.h b/Utilities/Poco/XML/src/latin1tab.h
deleted file mode 100755
index 53c25d76b2..0000000000
--- a/Utilities/Poco/XML/src/latin1tab.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
-/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME,
-/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
-/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
-/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
-/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
diff --git a/Utilities/Poco/XML/src/nametab.h b/Utilities/Poco/XML/src/nametab.h
deleted file mode 100755
index b05e62c77a..0000000000
--- a/Utilities/Poco/XML/src/nametab.h
+++ /dev/null
@@ -1,150 +0,0 @@
-static const unsigned namingBitmap[] = {
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
-0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE,
-0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
-0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF,
-0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
-0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
-0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
-0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
-0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
-0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF,
-0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000,
-0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
-0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003,
-0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003,
-0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
-0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001,
-0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003,
-0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
-0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003,
-0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003,
-0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000,
-0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
-0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF,
-0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB,
-0x40000000, 0xF580C900, 0x00000007, 0x02010800,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
-0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF,
-0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
-0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF,
-0x00000000, 0x00004C40, 0x00000000, 0x00000000,
-0x00000007, 0x00000000, 0x00000000, 0x00000000,
-0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF,
-0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF,
-0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
-0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
-0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000,
-0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
-0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF,
-0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
-0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
-0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003,
-0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
-0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
-0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
-0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
-0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
-0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF,
-0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF,
-0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
-0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF,
-0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0,
-0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
-0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3,
-0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80,
-0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
-0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3,
-0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000,
-0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000,
-0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
-0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
-0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF,
-0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF,
-};
-static const unsigned char nmstrtPages[] = {
-0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00,
-0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
-0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-static const unsigned char namePages[] = {
-0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00,
-0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
-0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
-0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
diff --git a/Utilities/Poco/XML/src/utf8tab.h b/Utilities/Poco/XML/src/utf8tab.h
deleted file mode 100755
index 7bb3e77603..0000000000
--- a/Utilities/Poco/XML/src/utf8tab.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-
-/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
-/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
-/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
-/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
-/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4,
-/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM,
diff --git a/Utilities/Poco/XML/src/xmlparse.cpp b/Utilities/Poco/XML/src/xmlparse.cpp
deleted file mode 100755
index da100284bd..0000000000
--- a/Utilities/Poco/XML/src/xmlparse.cpp
+++ /dev/null
@@ -1,6287 +0,0 @@
-/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-#include <stddef.h>
-#include <string.h> /* memset(), memcpy() */
-#include <assert.h>
-
-#define XML_BUILDING_EXPAT 1
-
-#ifdef COMPILED_FROM_DSP
-#include "winconfig.h"
-#elif defined(MACOS_CLASSIC)
-#include "macconfig.h"
-#elif defined(__amigaos4__)
-#include "amigaconfig.h"
-#elif defined(__WATCOMC__)
-#include "watcomconfig.h"
-#elif defined(HAVE_EXPAT_CONFIG_H)
-#include "expat_config.h"
-#endif /* ndef COMPILED_FROM_DSP */
-
-#include "ascii.h"
-#include "Poco/XML/expat.h"
-
-#ifdef XML_UNICODE
-#define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX
-#define XmlConvert XmlUtf16Convert
-#define XmlGetInternalEncoding XmlGetUtf16InternalEncoding
-#define XmlGetInternalEncodingNS XmlGetUtf16InternalEncodingNS
-#define XmlEncode XmlUtf16Encode
-/* Using pointer subtraction to convert to integer type. */
-#define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((char *)(s) - (char *)NULL) & 1))
-typedef unsigned short ICHAR;
-#else
-#define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX
-#define XmlConvert XmlUtf8Convert
-#define XmlGetInternalEncoding XmlGetUtf8InternalEncoding
-#define XmlGetInternalEncodingNS XmlGetUtf8InternalEncodingNS
-#define XmlEncode XmlUtf8Encode
-#define MUST_CONVERT(enc, s) (!(enc)->isUtf8)
-typedef char ICHAR;
-#endif
-
-
-#ifndef XML_NS
-
-#define XmlInitEncodingNS XmlInitEncoding
-#define XmlInitUnknownEncodingNS XmlInitUnknownEncoding
-#undef XmlGetInternalEncodingNS
-#define XmlGetInternalEncodingNS XmlGetInternalEncoding
-#define XmlParseXmlDeclNS XmlParseXmlDecl
-
-#endif
-
-#ifdef XML_UNICODE
-
-#ifdef XML_UNICODE_WCHAR_T
-#define XML_T(x) (const wchar_t)x
-#define XML_L(x) L ## x
-#else
-#define XML_T(x) (const unsigned short)x
-#define XML_L(x) x
-#endif
-
-#else
-
-#define XML_T(x) x
-#define XML_L(x) x
-
-#endif
-
-/* Round up n to be a multiple of sz, where sz is a power of 2. */
-#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))
-
-/* Handle the case where memmove() doesn't exist. */
-#ifndef HAVE_MEMMOVE
-#ifdef HAVE_BCOPY
-#define memmove(d,s,l) bcopy((s),(d),(l))
-#else
-#error memmove does not exist on this platform, nor is a substitute available
-#endif /* HAVE_BCOPY */
-#endif /* HAVE_MEMMOVE */
-
-#include "internal.h"
-#include "xmltok.h"
-#include "xmlrole.h"
-
-typedef const XML_Char *KEY;
-
-typedef struct {
- KEY name;
-} NAMED;
-
-typedef struct {
- NAMED **v;
- unsigned char power;
- size_t size;
- size_t used;
- const XML_Memory_Handling_Suite *mem;
-} HASH_TABLE;
-
-/* Basic character hash algorithm, taken from Python's string hash:
- h = h * 1000003 ^ character, the constant being a prime number.
-
-*/
-#ifdef XML_UNICODE
-#define CHAR_HASH(h, c) \
- (((h) * 0xF4243) ^ (unsigned short)(c))
-#else
-#define CHAR_HASH(h, c) \
- (((h) * 0xF4243) ^ (unsigned char)(c))
-#endif
-
-/* For probing (after a collision) we need a step size relative prime
- to the hash table size, which is a power of 2. We use double-hashing,
- since we can calculate a second hash value cheaply by taking those bits
- of the first hash value that were discarded (masked out) when the table
- index was calculated: index = hash & mask, where mask = table->size - 1.
- We limit the maximum step size to table->size / 4 (mask >> 2) and make
- it odd, since odd numbers are always relative prime to a power of 2.
-*/
-#define SECOND_HASH(hash, mask, power) \
- ((((hash) & ~(mask)) >> ((power) - 1)) & ((mask) >> 2))
-#define PROBE_STEP(hash, mask, power) \
- ((unsigned char)((SECOND_HASH(hash, mask, power)) | 1))
-
-typedef struct {
- NAMED **p;
- NAMED **end;
-} HASH_TABLE_ITER;
-
-#define INIT_TAG_BUF_SIZE 32 /* must be a multiple of sizeof(XML_Char) */
-#define INIT_DATA_BUF_SIZE 1024
-#define INIT_ATTS_SIZE 16
-#define INIT_ATTS_VERSION 0xFFFFFFFF
-#define INIT_BLOCK_SIZE 1024
-#define INIT_BUFFER_SIZE 1024
-
-#define EXPAND_SPARE 24
-
-typedef struct binding {
- struct prefix *prefix;
- struct binding *nextTagBinding;
- struct binding *prevPrefixBinding;
- const struct attribute_id *attId;
- XML_Char *uri;
- int uriLen;
- int uriAlloc;
-} BINDING;
-
-typedef struct prefix {
- const XML_Char *name;
- BINDING *binding;
-} PREFIX;
-
-typedef struct {
- const XML_Char *str;
- const XML_Char *localPart;
- const XML_Char *prefix;
- int strLen;
- int uriLen;
- int prefixLen;
-} TAG_NAME;
-
-/* TAG represents an open element.
- The name of the element is stored in both the document and API
- encodings. The memory buffer 'buf' is a separately-allocated
- memory area which stores the name. During the XML_Parse()/
- XMLParseBuffer() when the element is open, the memory for the 'raw'
- version of the name (in the document encoding) is shared with the
- document buffer. If the element is open across calls to
- XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to
- contain the 'raw' name as well.
-
- A parser re-uses these structures, maintaining a list of allocated
- TAG objects in a free list.
-*/
-typedef struct tag {
- struct tag *parent; /* parent of this element */
- const char *rawName; /* tagName in the original encoding */
- int rawNameLength;
- TAG_NAME name; /* tagName in the API encoding */
- char *buf; /* buffer for name components */
- char *bufEnd; /* end of the buffer */
- BINDING *bindings;
-} TAG;
-
-typedef struct {
- const XML_Char *name;
- const XML_Char *textPtr;
- int textLen; /* length in XML_Chars */
- int processed; /* # of processed bytes - when suspended */
- const XML_Char *systemId;
- const XML_Char *base;
- const XML_Char *publicId;
- const XML_Char *notation;
- XML_Bool open;
- XML_Bool is_param;
- XML_Bool is_internal; /* true if declared in internal subset outside PE */
-} ENTITY;
-
-typedef struct {
- enum XML_Content_Type type;
- enum XML_Content_Quant quant;
- const XML_Char * name;
- int firstchild;
- int lastchild;
- int childcnt;
- int nextsib;
-} CONTENT_SCAFFOLD;
-
-#define INIT_SCAFFOLD_ELEMENTS 32
-
-typedef struct block {
- struct block *next;
- int size;
- XML_Char s[1];
-} BLOCK;
-
-typedef struct {
- BLOCK *blocks;
- BLOCK *freeBlocks;
- const XML_Char *end;
- XML_Char *ptr;
- XML_Char *start;
- const XML_Memory_Handling_Suite *mem;
-} STRING_POOL;
-
-/* The XML_Char before the name is used to determine whether
- an attribute has been specified. */
-typedef struct attribute_id {
- XML_Char *name;
- PREFIX *prefix;
- XML_Bool maybeTokenized;
- XML_Bool xmlns;
-} ATTRIBUTE_ID;
-
-typedef struct {
- const ATTRIBUTE_ID *id;
- XML_Bool isCdata;
- const XML_Char *value;
-} DEFAULT_ATTRIBUTE;
-
-typedef struct {
- unsigned long version;
- unsigned long hash;
- const XML_Char *uriName;
-} NS_ATT;
-
-typedef struct {
- const XML_Char *name;
- PREFIX *prefix;
- const ATTRIBUTE_ID *idAtt;
- int nDefaultAtts;
- int allocDefaultAtts;
- DEFAULT_ATTRIBUTE *defaultAtts;
-} ELEMENT_TYPE;
-
-typedef struct {
- HASH_TABLE generalEntities;
- HASH_TABLE elementTypes;
- HASH_TABLE attributeIds;
- HASH_TABLE prefixes;
- STRING_POOL pool;
- STRING_POOL entityValuePool;
- /* false once a parameter entity reference has been skipped */
- XML_Bool keepProcessing;
- /* true once an internal or external PE reference has been encountered;
- this includes the reference to an external subset */
- XML_Bool hasParamEntityRefs;
- XML_Bool standalone;
-#ifdef XML_DTD
- /* indicates if external PE has been read */
- XML_Bool paramEntityRead;
- HASH_TABLE paramEntities;
-#endif /* XML_DTD */
- PREFIX defaultPrefix;
- /* === scaffolding for building content model === */
- XML_Bool in_eldecl;
- CONTENT_SCAFFOLD *scaffold;
- unsigned contentStringLen;
- unsigned scaffSize;
- unsigned scaffCount;
- int scaffLevel;
- int *scaffIndex;
-} DTD;
-
-typedef struct open_internal_entity {
- const char *internalEventPtr;
- const char *internalEventEndPtr;
- struct open_internal_entity *next;
- ENTITY *entity;
- int startTagLevel;
- XML_Bool betweenDecl; /* WFC: PE Between Declarations */
-} OPEN_INTERNAL_ENTITY;
-
-typedef enum XML_Error PTRCALL Processor(XML_Parser parser,
- const char *start,
- const char *end,
- const char **endPtr);
-
-static Processor prologProcessor;
-static Processor prologInitProcessor;
-static Processor contentProcessor;
-static Processor cdataSectionProcessor;
-#ifdef XML_DTD
-static Processor ignoreSectionProcessor;
-static Processor externalParEntProcessor;
-static Processor externalParEntInitProcessor;
-static Processor entityValueProcessor;
-static Processor entityValueInitProcessor;
-#endif /* XML_DTD */
-static Processor epilogProcessor;
-static Processor errorProcessor;
-static Processor externalEntityInitProcessor;
-static Processor externalEntityInitProcessor2;
-static Processor externalEntityInitProcessor3;
-static Processor externalEntityContentProcessor;
-static Processor internalEntityProcessor;
-
-static enum XML_Error
-handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName);
-static enum XML_Error
-processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
- const char *s, const char *next);
-static enum XML_Error
-initializeEncoding(XML_Parser parser);
-static enum XML_Error
-doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
- const char *end, int tok, const char *next, const char **nextPtr,
- XML_Bool haveMore);
-static enum XML_Error
-processInternalEntity(XML_Parser parser, ENTITY *entity,
- XML_Bool betweenDecl);
-static enum XML_Error
-doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
- const char *start, const char *end, const char **endPtr,
- XML_Bool haveMore);
-static enum XML_Error
-doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr,
- const char *end, const char **nextPtr, XML_Bool haveMore);
-#ifdef XML_DTD
-static enum XML_Error
-doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr,
- const char *end, const char **nextPtr, XML_Bool haveMore);
-#endif /* XML_DTD */
-
-static enum XML_Error
-storeAtts(XML_Parser parser, const ENCODING *, const char *s,
- TAG_NAME *tagNamePtr, BINDING **bindingsPtr);
-static enum XML_Error
-addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
- const XML_Char *uri, BINDING **bindingsPtr);
-static int
-defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata,
- XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser);
-static enum XML_Error
-storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
- const char *, const char *, STRING_POOL *);
-static enum XML_Error
-appendAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
- const char *, const char *, STRING_POOL *);
-static ATTRIBUTE_ID *
-getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start,
- const char *end);
-static int
-setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *);
-static enum XML_Error
-storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start,
- const char *end);
-static int
-reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
- const char *start, const char *end);
-static int
-reportComment(XML_Parser parser, const ENCODING *enc, const char *start,
- const char *end);
-static void
-reportDefault(XML_Parser parser, const ENCODING *enc, const char *start,
- const char *end);
-
-static const XML_Char * getContext(XML_Parser parser);
-static XML_Bool
-setContext(XML_Parser parser, const XML_Char *context);
-
-static void FASTCALL normalizePublicId(XML_Char *s);
-
-static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms);
-/* do not call if parentParser != NULL */
-static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms);
-static void
-dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
-static int
-dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
-static int
-copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
-
-static NAMED *
-lookup(HASH_TABLE *table, KEY name, size_t createSize);
-static void FASTCALL
-hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms);
-static void FASTCALL hashTableClear(HASH_TABLE *);
-static void FASTCALL hashTableDestroy(HASH_TABLE *);
-static void FASTCALL
-hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *);
-static NAMED * FASTCALL hashTableIterNext(HASH_TABLE_ITER *);
-
-static void FASTCALL
-poolInit(STRING_POOL *, const XML_Memory_Handling_Suite *ms);
-static void FASTCALL poolClear(STRING_POOL *);
-static void FASTCALL poolDestroy(STRING_POOL *);
-static XML_Char *
-poolAppend(STRING_POOL *pool, const ENCODING *enc,
- const char *ptr, const char *end);
-static XML_Char *
-poolStoreString(STRING_POOL *pool, const ENCODING *enc,
- const char *ptr, const char *end);
-static XML_Bool FASTCALL poolGrow(STRING_POOL *pool);
-static const XML_Char * FASTCALL
-poolCopyString(STRING_POOL *pool, const XML_Char *s);
-static const XML_Char *
-poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n);
-static const XML_Char * FASTCALL
-poolAppendString(STRING_POOL *pool, const XML_Char *s);
-
-static int FASTCALL nextScaffoldPart(XML_Parser parser);
-static XML_Content * build_model(XML_Parser parser);
-static ELEMENT_TYPE *
-getElementType(XML_Parser parser, const ENCODING *enc,
- const char *ptr, const char *end);
-
-static XML_Parser
-parserCreate(const XML_Char *encodingName,
- const XML_Memory_Handling_Suite *memsuite,
- const XML_Char *nameSep,
- DTD *dtd);
-static void
-parserInit(XML_Parser parser, const XML_Char *encodingName);
-
-#define poolStart(pool) ((pool)->start)
-#define poolEnd(pool) ((pool)->ptr)
-#define poolLength(pool) ((pool)->ptr - (pool)->start)
-#define poolChop(pool) ((void)--(pool->ptr))
-#define poolLastChar(pool) (((pool)->ptr)[-1])
-#define poolDiscard(pool) ((pool)->ptr = (pool)->start)
-#define poolFinish(pool) ((pool)->start = (pool)->ptr)
-#define poolAppendChar(pool, c) \
- (((pool)->ptr == (pool)->end && !poolGrow(pool)) \
- ? 0 \
- : ((*((pool)->ptr)++ = c), 1))
-
-struct XML_ParserStruct {
- /* The first member must be userData so that the XML_GetUserData
- macro works. */
- void *m_userData;
- void *m_handlerArg;
- char *m_buffer;
- const XML_Memory_Handling_Suite m_mem;
- /* first character to be parsed */
- const char *m_bufferPtr;
- /* past last character to be parsed */
- char *m_bufferEnd;
- /* allocated end of buffer */
- const char *m_bufferLim;
- XML_Index m_parseEndByteIndex;
- const char *m_parseEndPtr;
- XML_Char *m_dataBuf;
- XML_Char *m_dataBufEnd;
- XML_StartElementHandler m_startElementHandler;
- XML_EndElementHandler m_endElementHandler;
- XML_CharacterDataHandler m_characterDataHandler;
- XML_ProcessingInstructionHandler m_processingInstructionHandler;
- XML_CommentHandler m_commentHandler;
- XML_StartCdataSectionHandler m_startCdataSectionHandler;
- XML_EndCdataSectionHandler m_endCdataSectionHandler;
- XML_DefaultHandler m_defaultHandler;
- XML_StartDoctypeDeclHandler m_startDoctypeDeclHandler;
- XML_EndDoctypeDeclHandler m_endDoctypeDeclHandler;
- XML_UnparsedEntityDeclHandler m_unparsedEntityDeclHandler;
- XML_NotationDeclHandler m_notationDeclHandler;
- XML_StartNamespaceDeclHandler m_startNamespaceDeclHandler;
- XML_EndNamespaceDeclHandler m_endNamespaceDeclHandler;
- XML_NotStandaloneHandler m_notStandaloneHandler;
- XML_ExternalEntityRefHandler m_externalEntityRefHandler;
- XML_Parser m_externalEntityRefHandlerArg;
- XML_SkippedEntityHandler m_skippedEntityHandler;
- XML_UnknownEncodingHandler m_unknownEncodingHandler;
- XML_ElementDeclHandler m_elementDeclHandler;
- XML_AttlistDeclHandler m_attlistDeclHandler;
- XML_EntityDeclHandler m_entityDeclHandler;
- XML_XmlDeclHandler m_xmlDeclHandler;
- const ENCODING *m_encoding;
- INIT_ENCODING m_initEncoding;
- const ENCODING *m_internalEncoding;
- const XML_Char *m_protocolEncodingName;
- XML_Bool m_ns;
- XML_Bool m_ns_triplets;
- void *m_unknownEncodingMem;
- void *m_unknownEncodingData;
- void *m_unknownEncodingHandlerData;
- void (XMLCALL *m_unknownEncodingRelease)(void *);
- PROLOG_STATE m_prologState;
- Processor *m_processor;
- enum XML_Error m_errorCode;
- const char *m_eventPtr;
- const char *m_eventEndPtr;
- const char *m_positionPtr;
- OPEN_INTERNAL_ENTITY *m_openInternalEntities;
- OPEN_INTERNAL_ENTITY *m_freeInternalEntities;
- XML_Bool m_defaultExpandInternalEntities;
- int m_tagLevel;
- ENTITY *m_declEntity;
- const XML_Char *m_doctypeName;
- const XML_Char *m_doctypeSysid;
- const XML_Char *m_doctypePubid;
- const XML_Char *m_declAttributeType;
- const XML_Char *m_declNotationName;
- const XML_Char *m_declNotationPublicId;
- ELEMENT_TYPE *m_declElementType;
- ATTRIBUTE_ID *m_declAttributeId;
- XML_Bool m_declAttributeIsCdata;
- XML_Bool m_declAttributeIsId;
- DTD *m_dtd;
- const XML_Char *m_curBase;
- TAG *m_tagStack;
- TAG *m_freeTagList;
- BINDING *m_inheritedBindings;
- BINDING *m_freeBindingList;
- int m_attsSize;
- int m_nSpecifiedAtts;
- int m_idAttIndex;
- ATTRIBUTE *m_atts;
- NS_ATT *m_nsAtts;
- unsigned long m_nsAttsVersion;
- unsigned char m_nsAttsPower;
- POSITION m_position;
- STRING_POOL m_tempPool;
- STRING_POOL m_temp2Pool;
- char *m_groupConnector;
- unsigned int m_groupSize;
- XML_Char m_namespaceSeparator;
- XML_Parser m_parentParser;
- XML_ParsingStatus m_parsingStatus;
-#ifdef XML_DTD
- XML_Bool m_isParamEntity;
- XML_Bool m_useForeignDTD;
- enum XML_ParamEntityParsing m_paramEntityParsing;
-#endif
-};
-
-#define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
-#define REALLOC(p,s) (parser->m_mem.realloc_fcn((p),(s)))
-#define FREE(p) (parser->m_mem.free_fcn((p)))
-
-#define userData (parser->m_userData)
-#define handlerArg (parser->m_handlerArg)
-#define startElementHandler (parser->m_startElementHandler)
-#define endElementHandler (parser->m_endElementHandler)
-#define characterDataHandler (parser->m_characterDataHandler)
-#define processingInstructionHandler \
- (parser->m_processingInstructionHandler)
-#define commentHandler (parser->m_commentHandler)
-#define startCdataSectionHandler \
- (parser->m_startCdataSectionHandler)
-#define endCdataSectionHandler (parser->m_endCdataSectionHandler)
-#define defaultHandler (parser->m_defaultHandler)
-#define startDoctypeDeclHandler (parser->m_startDoctypeDeclHandler)
-#define endDoctypeDeclHandler (parser->m_endDoctypeDeclHandler)
-#define unparsedEntityDeclHandler \
- (parser->m_unparsedEntityDeclHandler)
-#define notationDeclHandler (parser->m_notationDeclHandler)
-#define startNamespaceDeclHandler \
- (parser->m_startNamespaceDeclHandler)
-#define endNamespaceDeclHandler (parser->m_endNamespaceDeclHandler)
-#define notStandaloneHandler (parser->m_notStandaloneHandler)
-#define externalEntityRefHandler \
- (parser->m_externalEntityRefHandler)
-#define externalEntityRefHandlerArg \
- (parser->m_externalEntityRefHandlerArg)
-#define internalEntityRefHandler \
- (parser->m_internalEntityRefHandler)
-#define skippedEntityHandler (parser->m_skippedEntityHandler)
-#define unknownEncodingHandler (parser->m_unknownEncodingHandler)
-#define elementDeclHandler (parser->m_elementDeclHandler)
-#define attlistDeclHandler (parser->m_attlistDeclHandler)
-#define entityDeclHandler (parser->m_entityDeclHandler)
-#define xmlDeclHandler (parser->m_xmlDeclHandler)
-#define encoding (parser->m_encoding)
-#define initEncoding (parser->m_initEncoding)
-#define internalEncoding (parser->m_internalEncoding)
-#define unknownEncodingMem (parser->m_unknownEncodingMem)
-#define unknownEncodingData (parser->m_unknownEncodingData)
-#define unknownEncodingHandlerData \
- (parser->m_unknownEncodingHandlerData)
-#define unknownEncodingRelease (parser->m_unknownEncodingRelease)
-#define protocolEncodingName (parser->m_protocolEncodingName)
-#define ns (parser->m_ns)
-#define ns_triplets (parser->m_ns_triplets)
-#define prologState (parser->m_prologState)
-#define processor (parser->m_processor)
-#define errorCode (parser->m_errorCode)
-#define eventPtr (parser->m_eventPtr)
-#define eventEndPtr (parser->m_eventEndPtr)
-#define positionPtr (parser->m_positionPtr)
-#define position (parser->m_position)
-#define openInternalEntities (parser->m_openInternalEntities)
-#define freeInternalEntities (parser->m_freeInternalEntities)
-#define defaultExpandInternalEntities \
- (parser->m_defaultExpandInternalEntities)
-#define tagLevel (parser->m_tagLevel)
-#define buffer (parser->m_buffer)
-#define bufferPtr (parser->m_bufferPtr)
-#define bufferEnd (parser->m_bufferEnd)
-#define parseEndByteIndex (parser->m_parseEndByteIndex)
-#define parseEndPtr (parser->m_parseEndPtr)
-#define bufferLim (parser->m_bufferLim)
-#define dataBuf (parser->m_dataBuf)
-#define dataBufEnd (parser->m_dataBufEnd)
-#define _dtd (parser->m_dtd)
-#define curBase (parser->m_curBase)
-#define declEntity (parser->m_declEntity)
-#define doctypeName (parser->m_doctypeName)
-#define doctypeSysid (parser->m_doctypeSysid)
-#define doctypePubid (parser->m_doctypePubid)
-#define declAttributeType (parser->m_declAttributeType)
-#define declNotationName (parser->m_declNotationName)
-#define declNotationPublicId (parser->m_declNotationPublicId)
-#define declElementType (parser->m_declElementType)
-#define declAttributeId (parser->m_declAttributeId)
-#define declAttributeIsCdata (parser->m_declAttributeIsCdata)
-#define declAttributeIsId (parser->m_declAttributeIsId)
-#define freeTagList (parser->m_freeTagList)
-#define freeBindingList (parser->m_freeBindingList)
-#define inheritedBindings (parser->m_inheritedBindings)
-#define tagStack (parser->m_tagStack)
-#define atts (parser->m_atts)
-#define attsSize (parser->m_attsSize)
-#define nSpecifiedAtts (parser->m_nSpecifiedAtts)
-#define idAttIndex (parser->m_idAttIndex)
-#define nsAtts (parser->m_nsAtts)
-#define nsAttsVersion (parser->m_nsAttsVersion)
-#define nsAttsPower (parser->m_nsAttsPower)
-#define tempPool (parser->m_tempPool)
-#define temp2Pool (parser->m_temp2Pool)
-#define groupConnector (parser->m_groupConnector)
-#define groupSize (parser->m_groupSize)
-#define namespaceSeparator (parser->m_namespaceSeparator)
-#define parentParser (parser->m_parentParser)
-#define ps_parsing (parser->m_parsingStatus.parsing)
-#define ps_finalBuffer (parser->m_parsingStatus.finalBuffer)
-#ifdef XML_DTD
-#define isParamEntity (parser->m_isParamEntity)
-#define useForeignDTD (parser->m_useForeignDTD)
-#define paramEntityParsing (parser->m_paramEntityParsing)
-#endif /* XML_DTD */
-
-XML_Parser XMLCALL
-XML_ParserCreate(const XML_Char *encodingName)
-{
- return XML_ParserCreate_MM(encodingName, NULL, NULL);
-}
-
-XML_Parser XMLCALL
-XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep)
-{
- XML_Char tmp[2];
- *tmp = nsSep;
- return XML_ParserCreate_MM(encodingName, NULL, tmp);
-}
-
-static const XML_Char implicitContext[] = {
- ASCII_x, ASCII_m, ASCII_l, ASCII_EQUALS, ASCII_h, ASCII_t, ASCII_t, ASCII_p,
- ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w,
- ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD, ASCII_o, ASCII_r, ASCII_g,
- ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L, ASCII_SLASH, ASCII_1, ASCII_9,
- ASCII_9, ASCII_8, ASCII_SLASH, ASCII_n, ASCII_a, ASCII_m, ASCII_e,
- ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e, '\0'
-};
-
-XML_Parser XMLCALL
-XML_ParserCreate_MM(const XML_Char *encodingName,
- const XML_Memory_Handling_Suite *memsuite,
- const XML_Char *nameSep)
-{
- XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
- if (parser != NULL && ns) {
- /* implicit context only set for root parser, since child
- parsers (i.e. external entity parsers) will inherit it
- */
- if (!setContext(parser, implicitContext)) {
- XML_ParserFree(parser);
- return NULL;
- }
- }
- return parser;
-}
-
-static XML_Parser
-parserCreate(const XML_Char *encodingName,
- const XML_Memory_Handling_Suite *memsuite,
- const XML_Char *nameSep,
- DTD *dtd)
-{
- XML_Parser parser;
-
- if (memsuite) {
- XML_Memory_Handling_Suite *mtemp;
- parser = (XML_Parser)
- memsuite->malloc_fcn(sizeof(struct XML_ParserStruct));
- if (parser != NULL) {
- mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem);
- mtemp->malloc_fcn = memsuite->malloc_fcn;
- mtemp->realloc_fcn = memsuite->realloc_fcn;
- mtemp->free_fcn = memsuite->free_fcn;
- }
- }
- else {
- XML_Memory_Handling_Suite *mtemp;
- parser = (XML_Parser)malloc(sizeof(struct XML_ParserStruct));
- if (parser != NULL) {
- mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem);
- mtemp->malloc_fcn = malloc;
- mtemp->realloc_fcn = realloc;
- mtemp->free_fcn = free;
- }
- }
-
- if (!parser)
- return parser;
-
- buffer = NULL;
- bufferLim = NULL;
-
- attsSize = INIT_ATTS_SIZE;
- atts = (ATTRIBUTE *)MALLOC(attsSize * sizeof(ATTRIBUTE));
- if (atts == NULL) {
- FREE(parser);
- return NULL;
- }
- dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
- if (dataBuf == NULL) {
- FREE(atts);
- FREE(parser);
- return NULL;
- }
- dataBufEnd = dataBuf + INIT_DATA_BUF_SIZE;
-
- if (dtd)
- _dtd = dtd;
- else {
- _dtd = dtdCreate(&parser->m_mem);
- if (_dtd == NULL) {
- FREE(dataBuf);
- FREE(atts);
- FREE(parser);
- return NULL;
- }
- }
-
- freeBindingList = NULL;
- freeTagList = NULL;
- freeInternalEntities = NULL;
-
- groupSize = 0;
- groupConnector = NULL;
-
- unknownEncodingHandler = NULL;
- unknownEncodingHandlerData = NULL;
-
- namespaceSeparator = ASCII_EXCL;
- ns = XML_FALSE;
- ns_triplets = XML_FALSE;
-
- nsAtts = NULL;
- nsAttsVersion = 0;
- nsAttsPower = 0;
-
- poolInit(&tempPool, &(parser->m_mem));
- poolInit(&temp2Pool, &(parser->m_mem));
- parserInit(parser, encodingName);
-
- if (encodingName && !protocolEncodingName) {
- XML_ParserFree(parser);
- return NULL;
- }
-
- if (nameSep) {
- ns = XML_TRUE;
- internalEncoding = XmlGetInternalEncodingNS();
- namespaceSeparator = *nameSep;
- }
- else {
- internalEncoding = XmlGetInternalEncoding();
- }
-
- return parser;
-}
-
-static void
-parserInit(XML_Parser parser, const XML_Char *encodingName)
-{
- processor = prologInitProcessor;
- XmlPrologStateInit(&prologState);
- protocolEncodingName = (encodingName != NULL
- ? poolCopyString(&tempPool, encodingName)
- : NULL);
- curBase = NULL;
- XmlInitEncoding(&initEncoding, &encoding, 0);
- userData = NULL;
- handlerArg = NULL;
- startElementHandler = NULL;
- endElementHandler = NULL;
- characterDataHandler = NULL;
- processingInstructionHandler = NULL;
- commentHandler = NULL;
- startCdataSectionHandler = NULL;
- endCdataSectionHandler = NULL;
- defaultHandler = NULL;
- startDoctypeDeclHandler = NULL;
- endDoctypeDeclHandler = NULL;
- unparsedEntityDeclHandler = NULL;
- notationDeclHandler = NULL;
- startNamespaceDeclHandler = NULL;
- endNamespaceDeclHandler = NULL;
- notStandaloneHandler = NULL;
- externalEntityRefHandler = NULL;
- externalEntityRefHandlerArg = parser;
- skippedEntityHandler = NULL;
- elementDeclHandler = NULL;
- attlistDeclHandler = NULL;
- entityDeclHandler = NULL;
- xmlDeclHandler = NULL;
- bufferPtr = buffer;
- bufferEnd = buffer;
- parseEndByteIndex = 0;
- parseEndPtr = NULL;
- declElementType = NULL;
- declAttributeId = NULL;
- declEntity = NULL;
- doctypeName = NULL;
- doctypeSysid = NULL;
- doctypePubid = NULL;
- declAttributeType = NULL;
- declNotationName = NULL;
- declNotationPublicId = NULL;
- declAttributeIsCdata = XML_FALSE;
- declAttributeIsId = XML_FALSE;
- memset(&position, 0, sizeof(POSITION));
- errorCode = XML_ERROR_NONE;
- eventPtr = NULL;
- eventEndPtr = NULL;
- positionPtr = NULL;
- openInternalEntities = NULL;
- defaultExpandInternalEntities = XML_TRUE;
- tagLevel = 0;
- tagStack = NULL;
- inheritedBindings = NULL;
- nSpecifiedAtts = 0;
- unknownEncodingMem = NULL;
- unknownEncodingRelease = NULL;
- unknownEncodingData = NULL;
- parentParser = NULL;
- ps_parsing = XML_INITIALIZED;
-#ifdef XML_DTD
- isParamEntity = XML_FALSE;
- useForeignDTD = XML_FALSE;
- paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
-#endif
-}
-
-/* moves list of bindings to freeBindingList */
-static void FASTCALL
-moveToFreeBindingList(XML_Parser parser, BINDING *bindings)
-{
- while (bindings) {
- BINDING *b = bindings;
- bindings = bindings->nextTagBinding;
- b->nextTagBinding = freeBindingList;
- freeBindingList = b;
- }
-}
-
-XML_Bool XMLCALL
-XML_ParserReset(XML_Parser parser, const XML_Char *encodingName)
-{
- TAG *tStk;
- OPEN_INTERNAL_ENTITY *openEntityList;
- if (parentParser)
- return XML_FALSE;
- /* move tagStack to freeTagList */
- tStk = tagStack;
- while (tStk) {
- TAG *tag = tStk;
- tStk = tStk->parent;
- tag->parent = freeTagList;
- moveToFreeBindingList(parser, tag->bindings);
- tag->bindings = NULL;
- freeTagList = tag;
- }
- /* move openInternalEntities to freeInternalEntities */
- openEntityList = openInternalEntities;
- while (openEntityList) {
- OPEN_INTERNAL_ENTITY *openEntity = openEntityList;
- openEntityList = openEntity->next;
- openEntity->next = freeInternalEntities;
- freeInternalEntities = openEntity;
- }
- moveToFreeBindingList(parser, inheritedBindings);
- FREE(unknownEncodingMem);
- if (unknownEncodingRelease)
- unknownEncodingRelease(unknownEncodingData);
- poolClear(&tempPool);
- poolClear(&temp2Pool);
- parserInit(parser, encodingName);
- dtdReset(_dtd, &parser->m_mem);
- return setContext(parser, implicitContext);
-}
-
-enum XML_Status XMLCALL
-XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName)
-{
- /* Block after XML_Parse()/XML_ParseBuffer() has been called.
- XXX There's no way for the caller to determine which of the
- XXX possible error cases caused the XML_STATUS_ERROR return.
- */
- if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
- return XML_STATUS_ERROR;
- if (encodingName == NULL)
- protocolEncodingName = NULL;
- else {
- protocolEncodingName = poolCopyString(&tempPool, encodingName);
- if (!protocolEncodingName)
- return XML_STATUS_ERROR;
- }
- return XML_STATUS_OK;
-}
-
-XML_Parser XMLCALL
-XML_ExternalEntityParserCreate(XML_Parser oldParser,
- const XML_Char *context,
- const XML_Char *encodingName)
-{
- XML_Parser parser = oldParser;
- DTD *newDtd = NULL;
- DTD *oldDtd = _dtd;
- XML_StartElementHandler oldStartElementHandler = startElementHandler;
- XML_EndElementHandler oldEndElementHandler = endElementHandler;
- XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler;
- XML_ProcessingInstructionHandler oldProcessingInstructionHandler
- = processingInstructionHandler;
- XML_CommentHandler oldCommentHandler = commentHandler;
- XML_StartCdataSectionHandler oldStartCdataSectionHandler
- = startCdataSectionHandler;
- XML_EndCdataSectionHandler oldEndCdataSectionHandler
- = endCdataSectionHandler;
- XML_DefaultHandler oldDefaultHandler = defaultHandler;
- XML_UnparsedEntityDeclHandler oldUnparsedEntityDeclHandler
- = unparsedEntityDeclHandler;
- XML_NotationDeclHandler oldNotationDeclHandler = notationDeclHandler;
- XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler
- = startNamespaceDeclHandler;
- XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler
- = endNamespaceDeclHandler;
- XML_NotStandaloneHandler oldNotStandaloneHandler = notStandaloneHandler;
- XML_ExternalEntityRefHandler oldExternalEntityRefHandler
- = externalEntityRefHandler;
- XML_SkippedEntityHandler oldSkippedEntityHandler = skippedEntityHandler;
- XML_UnknownEncodingHandler oldUnknownEncodingHandler
- = unknownEncodingHandler;
- XML_ElementDeclHandler oldElementDeclHandler = elementDeclHandler;
- XML_AttlistDeclHandler oldAttlistDeclHandler = attlistDeclHandler;
- XML_EntityDeclHandler oldEntityDeclHandler = entityDeclHandler;
- XML_XmlDeclHandler oldXmlDeclHandler = xmlDeclHandler;
- ELEMENT_TYPE * oldDeclElementType = declElementType;
-
- void *oldUserData = userData;
- void *oldHandlerArg = handlerArg;
- XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities;
- XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg;
-#ifdef XML_DTD
- enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing;
- int oldInEntityValue = prologState.inEntityValue;
-#endif
- XML_Bool oldns_triplets = ns_triplets;
-
-#ifdef XML_DTD
- if (!context)
- newDtd = oldDtd;
-#endif /* XML_DTD */
-
- /* Note that the magical uses of the pre-processor to make field
- access look more like C++ require that `parser' be overwritten
- here. This makes this function more painful to follow than it
- would be otherwise.
- */
- if (ns) {
- XML_Char tmp[2];
- *tmp = namespaceSeparator;
- parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
- }
- else {
- parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd);
- }
-
- if (!parser)
- return NULL;
-
- startElementHandler = oldStartElementHandler;
- endElementHandler = oldEndElementHandler;
- characterDataHandler = oldCharacterDataHandler;
- processingInstructionHandler = oldProcessingInstructionHandler;
- commentHandler = oldCommentHandler;
- startCdataSectionHandler = oldStartCdataSectionHandler;
- endCdataSectionHandler = oldEndCdataSectionHandler;
- defaultHandler = oldDefaultHandler;
- unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler;
- notationDeclHandler = oldNotationDeclHandler;
- startNamespaceDeclHandler = oldStartNamespaceDeclHandler;
- endNamespaceDeclHandler = oldEndNamespaceDeclHandler;
- notStandaloneHandler = oldNotStandaloneHandler;
- externalEntityRefHandler = oldExternalEntityRefHandler;
- skippedEntityHandler = oldSkippedEntityHandler;
- unknownEncodingHandler = oldUnknownEncodingHandler;
- elementDeclHandler = oldElementDeclHandler;
- attlistDeclHandler = oldAttlistDeclHandler;
- entityDeclHandler = oldEntityDeclHandler;
- xmlDeclHandler = oldXmlDeclHandler;
- declElementType = oldDeclElementType;
- userData = oldUserData;
- if (oldUserData == oldHandlerArg)
- handlerArg = userData;
- else
- handlerArg = parser;
- if (oldExternalEntityRefHandlerArg != oldParser)
- externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
- defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
- ns_triplets = oldns_triplets;
- parentParser = oldParser;
-#ifdef XML_DTD
- paramEntityParsing = oldParamEntityParsing;
- prologState.inEntityValue = oldInEntityValue;
- if (context) {
-#endif /* XML_DTD */
- if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
- || !setContext(parser, context)) {
- XML_ParserFree(parser);
- return NULL;
- }
- processor = externalEntityInitProcessor;
-#ifdef XML_DTD
- }
- else {
- /* The DTD instance referenced by _dtd is shared between the document's
- root parser and external PE parsers, therefore one does not need to
- call setContext. In addition, one also *must* not call setContext,
- because this would overwrite existing prefix->binding pointers in
- _dtd with ones that get destroyed with the external PE parser.
- This would leave those prefixes with dangling pointers.
- */
- isParamEntity = XML_TRUE;
- XmlPrologStateInitExternalEntity(&prologState);
- processor = externalParEntInitProcessor;
- }
-#endif /* XML_DTD */
- return parser;
-}
-
-static void FASTCALL
-destroyBindings(BINDING *bindings, XML_Parser parser)
-{
- for (;;) {
- BINDING *b = bindings;
- if (!b)
- break;
- bindings = b->nextTagBinding;
- FREE(b->uri);
- FREE(b);
- }
-}
-
-void XMLCALL
-XML_ParserFree(XML_Parser parser)
-{
- TAG *tagList;
- OPEN_INTERNAL_ENTITY *entityList;
- if (parser == NULL)
- return;
- /* free tagStack and freeTagList */
- tagList = tagStack;
- for (;;) {
- TAG *p;
- if (tagList == NULL) {
- if (freeTagList == NULL)
- break;
- tagList = freeTagList;
- freeTagList = NULL;
- }
- p = tagList;
- tagList = tagList->parent;
- FREE(p->buf);
- destroyBindings(p->bindings, parser);
- FREE(p);
- }
- /* free openInternalEntities and freeInternalEntities */
- entityList = openInternalEntities;
- for (;;) {
- OPEN_INTERNAL_ENTITY *openEntity;
- if (entityList == NULL) {
- if (freeInternalEntities == NULL)
- break;
- entityList = freeInternalEntities;
- freeInternalEntities = NULL;
- }
- openEntity = entityList;
- entityList = entityList->next;
- FREE(openEntity);
- }
-
- destroyBindings(freeBindingList, parser);
- destroyBindings(inheritedBindings, parser);
- poolDestroy(&tempPool);
- poolDestroy(&temp2Pool);
-#ifdef XML_DTD
- /* external parameter entity parsers share the DTD structure
- parser->m_dtd with the root parser, so we must not destroy it
- */
- if (!isParamEntity && _dtd)
-#else
- if (_dtd)
-#endif /* XML_DTD */
- dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
- FREE((void *)atts);
- FREE(groupConnector);
- FREE(buffer);
- FREE(dataBuf);
- FREE(nsAtts);
- FREE(unknownEncodingMem);
- if (unknownEncodingRelease)
- unknownEncodingRelease(unknownEncodingData);
- FREE(parser);
-}
-
-void XMLCALL
-XML_UseParserAsHandlerArg(XML_Parser parser)
-{
- handlerArg = parser;
-}
-
-enum XML_Error XMLCALL
-XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD)
-{
-#ifdef XML_DTD
- /* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
- return XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING;
- useForeignDTD = useDTD;
- return XML_ERROR_NONE;
-#else
- return XML_ERROR_FEATURE_REQUIRES_XML_DTD;
-#endif
-}
-
-void XMLCALL
-XML_SetReturnNSTriplet(XML_Parser parser, int do_nst)
-{
- /* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
- return;
- ns_triplets = do_nst ? XML_TRUE : XML_FALSE;
-}
-
-void XMLCALL
-XML_SetUserData(XML_Parser parser, void *p)
-{
- if (handlerArg == userData)
- handlerArg = userData = p;
- else
- userData = p;
-}
-
-enum XML_Status XMLCALL
-XML_SetBase(XML_Parser parser, const XML_Char *p)
-{
- if (p) {
- p = poolCopyString(&_dtd->pool, p);
- if (!p)
- return XML_STATUS_ERROR;
- curBase = p;
- }
- else
- curBase = NULL;
- return XML_STATUS_OK;
-}
-
-const XML_Char * XMLCALL
-XML_GetBase(XML_Parser parser)
-{
- return curBase;
-}
-
-int XMLCALL
-XML_GetSpecifiedAttributeCount(XML_Parser parser)
-{
- return nSpecifiedAtts;
-}
-
-int XMLCALL
-XML_GetIdAttributeIndex(XML_Parser parser)
-{
- return idAttIndex;
-}
-
-void XMLCALL
-XML_SetElementHandler(XML_Parser parser,
- XML_StartElementHandler start,
- XML_EndElementHandler end)
-{
- startElementHandler = start;
- endElementHandler = end;
-}
-
-void XMLCALL
-XML_SetStartElementHandler(XML_Parser parser,
- XML_StartElementHandler start) {
- startElementHandler = start;
-}
-
-void XMLCALL
-XML_SetEndElementHandler(XML_Parser parser,
- XML_EndElementHandler end) {
- endElementHandler = end;
-}
-
-void XMLCALL
-XML_SetCharacterDataHandler(XML_Parser parser,
- XML_CharacterDataHandler handler)
-{
- characterDataHandler = handler;
-}
-
-void XMLCALL
-XML_SetProcessingInstructionHandler(XML_Parser parser,
- XML_ProcessingInstructionHandler handler)
-{
- processingInstructionHandler = handler;
-}
-
-void XMLCALL
-XML_SetCommentHandler(XML_Parser parser,
- XML_CommentHandler handler)
-{
- commentHandler = handler;
-}
-
-void XMLCALL
-XML_SetCdataSectionHandler(XML_Parser parser,
- XML_StartCdataSectionHandler start,
- XML_EndCdataSectionHandler end)
-{
- startCdataSectionHandler = start;
- endCdataSectionHandler = end;
-}
-
-void XMLCALL
-XML_SetStartCdataSectionHandler(XML_Parser parser,
- XML_StartCdataSectionHandler start) {
- startCdataSectionHandler = start;
-}
-
-void XMLCALL
-XML_SetEndCdataSectionHandler(XML_Parser parser,
- XML_EndCdataSectionHandler end) {
- endCdataSectionHandler = end;
-}
-
-void XMLCALL
-XML_SetDefaultHandler(XML_Parser parser,
- XML_DefaultHandler handler)
-{
- defaultHandler = handler;
- defaultExpandInternalEntities = XML_FALSE;
-}
-
-void XMLCALL
-XML_SetDefaultHandlerExpand(XML_Parser parser,
- XML_DefaultHandler handler)
-{
- defaultHandler = handler;
- defaultExpandInternalEntities = XML_TRUE;
-}
-
-void XMLCALL
-XML_SetDoctypeDeclHandler(XML_Parser parser,
- XML_StartDoctypeDeclHandler start,
- XML_EndDoctypeDeclHandler end)
-{
- startDoctypeDeclHandler = start;
- endDoctypeDeclHandler = end;
-}
-
-void XMLCALL
-XML_SetStartDoctypeDeclHandler(XML_Parser parser,
- XML_StartDoctypeDeclHandler start) {
- startDoctypeDeclHandler = start;
-}
-
-void XMLCALL
-XML_SetEndDoctypeDeclHandler(XML_Parser parser,
- XML_EndDoctypeDeclHandler end) {
- endDoctypeDeclHandler = end;
-}
-
-void XMLCALL
-XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
- XML_UnparsedEntityDeclHandler handler)
-{
- unparsedEntityDeclHandler = handler;
-}
-
-void XMLCALL
-XML_SetNotationDeclHandler(XML_Parser parser,
- XML_NotationDeclHandler handler)
-{
- notationDeclHandler = handler;
-}
-
-void XMLCALL
-XML_SetNamespaceDeclHandler(XML_Parser parser,
- XML_StartNamespaceDeclHandler start,
- XML_EndNamespaceDeclHandler end)
-{
- startNamespaceDeclHandler = start;
- endNamespaceDeclHandler = end;
-}
-
-void XMLCALL
-XML_SetStartNamespaceDeclHandler(XML_Parser parser,
- XML_StartNamespaceDeclHandler start) {
- startNamespaceDeclHandler = start;
-}
-
-void XMLCALL
-XML_SetEndNamespaceDeclHandler(XML_Parser parser,
- XML_EndNamespaceDeclHandler end) {
- endNamespaceDeclHandler = end;
-}
-
-void XMLCALL
-XML_SetNotStandaloneHandler(XML_Parser parser,
- XML_NotStandaloneHandler handler)
-{
- notStandaloneHandler = handler;
-}
-
-void XMLCALL
-XML_SetExternalEntityRefHandler(XML_Parser parser,
- XML_ExternalEntityRefHandler handler)
-{
- externalEntityRefHandler = handler;
-}
-
-void XMLCALL
-XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg)
-{
- if (arg)
- externalEntityRefHandlerArg = (XML_Parser)arg;
- else
- externalEntityRefHandlerArg = parser;
-}
-
-void XMLCALL
-XML_SetSkippedEntityHandler(XML_Parser parser,
- XML_SkippedEntityHandler handler)
-{
- skippedEntityHandler = handler;
-}
-
-void XMLCALL
-XML_SetUnknownEncodingHandler(XML_Parser parser,
- XML_UnknownEncodingHandler handler,
- void *data)
-{
- unknownEncodingHandler = handler;
- unknownEncodingHandlerData = data;
-}
-
-void XMLCALL
-XML_SetElementDeclHandler(XML_Parser parser,
- XML_ElementDeclHandler eldecl)
-{
- elementDeclHandler = eldecl;
-}
-
-void XMLCALL
-XML_SetAttlistDeclHandler(XML_Parser parser,
- XML_AttlistDeclHandler attdecl)
-{
- attlistDeclHandler = attdecl;
-}
-
-void XMLCALL
-XML_SetEntityDeclHandler(XML_Parser parser,
- XML_EntityDeclHandler handler)
-{
- entityDeclHandler = handler;
-}
-
-void XMLCALL
-XML_SetXmlDeclHandler(XML_Parser parser,
- XML_XmlDeclHandler handler) {
- xmlDeclHandler = handler;
-}
-
-int XMLCALL
-XML_SetParamEntityParsing(XML_Parser parser,
- enum XML_ParamEntityParsing peParsing)
-{
- /* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
- return 0;
-#ifdef XML_DTD
- paramEntityParsing = peParsing;
- return 1;
-#else
- return peParsing == XML_PARAM_ENTITY_PARSING_NEVER;
-#endif
-}
-
-enum XML_Status XMLCALL
-XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
-{
- switch (ps_parsing) {
- case XML_SUSPENDED:
- errorCode = XML_ERROR_SUSPENDED;
- return XML_STATUS_ERROR;
- case XML_FINISHED:
- errorCode = XML_ERROR_FINISHED;
- return XML_STATUS_ERROR;
- default:
- ps_parsing = XML_PARSING;
- }
-
- if (len == 0) {
- ps_finalBuffer = (XML_Bool)isFinal;
- if (!isFinal)
- return XML_STATUS_OK;
- positionPtr = bufferPtr;
- parseEndPtr = bufferEnd;
-
- /* If data are left over from last buffer, and we now know that these
- data are the final chunk of input, then we have to check them again
- to detect errors based on that fact.
- */
- errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr);
-
- if (errorCode == XML_ERROR_NONE) {
- switch (ps_parsing) {
- case XML_SUSPENDED:
- XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
- positionPtr = bufferPtr;
- return XML_STATUS_SUSPENDED;
- case XML_INITIALIZED:
- case XML_PARSING:
- ps_parsing = XML_FINISHED;
- /* fall through */
- default:
- return XML_STATUS_OK;
- }
- }
- eventEndPtr = eventPtr;
- processor = errorProcessor;
- return XML_STATUS_ERROR;
- }
-#ifndef XML_CONTEXT_BYTES
- else if (bufferPtr == bufferEnd) {
- const char *end;
- int nLeftOver;
- enum XML_Error result;
- parseEndByteIndex += len;
- positionPtr = s;
- ps_finalBuffer = (XML_Bool)isFinal;
-
- errorCode = processor(parser, s, parseEndPtr = s + len, &end);
-
- if (errorCode != XML_ERROR_NONE) {
- eventEndPtr = eventPtr;
- processor = errorProcessor;
- return XML_STATUS_ERROR;
- }
- else {
- switch (ps_parsing) {
- case XML_SUSPENDED:
- result = XML_STATUS_SUSPENDED;
- break;
- case XML_INITIALIZED:
- case XML_PARSING:
- result = XML_STATUS_OK;
- if (isFinal) {
- ps_parsing = XML_FINISHED;
- return result;
- }
- }
- }
-
- XmlUpdatePosition(encoding, positionPtr, end, &position);
- nLeftOver = s + len - end;
- if (nLeftOver) {
- if (buffer == NULL || nLeftOver > bufferLim - buffer) {
- /* FIXME avoid integer overflow */
- char *temp;
- temp = (buffer == NULL
- ? (char *)MALLOC(len * 2)
- : (char *)REALLOC(buffer, len * 2));
- if (temp == NULL) {
- errorCode = XML_ERROR_NO_MEMORY;
- return XML_STATUS_ERROR;
- }
- buffer = temp;
- if (!buffer) {
- errorCode = XML_ERROR_NO_MEMORY;
- eventPtr = eventEndPtr = NULL;
- processor = errorProcessor;
- return XML_STATUS_ERROR;
- }
- bufferLim = buffer + len * 2;
- }
- memcpy(buffer, end, nLeftOver);
- }
- bufferPtr = buffer;
- bufferEnd = buffer + nLeftOver;
- positionPtr = bufferPtr;
- parseEndPtr = bufferEnd;
- eventPtr = bufferPtr;
- eventEndPtr = bufferPtr;
- return result;
- }
-#endif /* not defined XML_CONTEXT_BYTES */
- else {
- void *buff = XML_GetBuffer(parser, len);
- if (buff == NULL)
- return XML_STATUS_ERROR;
- else {
- memcpy(buff, s, len);
- return XML_ParseBuffer(parser, len, isFinal);
- }
- }
-}
-
-enum XML_Status XMLCALL
-XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
-{
- const char *start;
- enum XML_Status result = XML_STATUS_OK;
-
- switch (ps_parsing) {
- case XML_SUSPENDED:
- errorCode = XML_ERROR_SUSPENDED;
- return XML_STATUS_ERROR;
- case XML_FINISHED:
- errorCode = XML_ERROR_FINISHED;
- return XML_STATUS_ERROR;
- default:
- ps_parsing = XML_PARSING;
- }
-
- start = bufferPtr;
- positionPtr = start;
- bufferEnd += len;
- parseEndPtr = bufferEnd;
- parseEndByteIndex += len;
- ps_finalBuffer = (XML_Bool)isFinal;
-
- errorCode = processor(parser, start, parseEndPtr, &bufferPtr);
-
- if (errorCode != XML_ERROR_NONE) {
- eventEndPtr = eventPtr;
- processor = errorProcessor;
- return XML_STATUS_ERROR;
- }
- else {
- switch (ps_parsing) {
- case XML_SUSPENDED:
- result = XML_STATUS_SUSPENDED;
- break;
- case XML_INITIALIZED:
- case XML_PARSING:
- if (isFinal) {
- ps_parsing = XML_FINISHED;
- return result;
- }
- default: ; /* should not happen */
- }
- }
-
- XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
- positionPtr = bufferPtr;
- return result;
-}
-
-void * XMLCALL
-XML_GetBuffer(XML_Parser parser, int len)
-{
- switch (ps_parsing) {
- case XML_SUSPENDED:
- errorCode = XML_ERROR_SUSPENDED;
- return NULL;
- case XML_FINISHED:
- errorCode = XML_ERROR_FINISHED;
- return NULL;
- default: ;
- }
-
- if (len > bufferLim - bufferEnd) {
- /* FIXME avoid integer overflow */
- int neededSize = len + (int)(bufferEnd - bufferPtr);
-#ifdef XML_CONTEXT_BYTES
- int keep = (int)(bufferPtr - buffer);
-
- if (keep > XML_CONTEXT_BYTES)
- keep = XML_CONTEXT_BYTES;
- neededSize += keep;
-#endif /* defined XML_CONTEXT_BYTES */
- if (neededSize <= bufferLim - buffer) {
-#ifdef XML_CONTEXT_BYTES
- if (keep < bufferPtr - buffer) {
- int offset = (int)(bufferPtr - buffer) - keep;
- memmove(buffer, &buffer[offset], bufferEnd - bufferPtr + keep);
- bufferEnd -= offset;
- bufferPtr -= offset;
- }
-#else
- memmove(buffer, bufferPtr, bufferEnd - bufferPtr);
- bufferEnd = buffer + (bufferEnd - bufferPtr);
- bufferPtr = buffer;
-#endif /* not defined XML_CONTEXT_BYTES */
- }
- else {
- char *newBuf;
- int bufferSize = (int)(bufferLim - bufferPtr);
- if (bufferSize == 0)
- bufferSize = INIT_BUFFER_SIZE;
- do {
- bufferSize *= 2;
- } while (bufferSize < neededSize);
- newBuf = (char *)MALLOC(bufferSize);
- if (newBuf == 0) {
- errorCode = XML_ERROR_NO_MEMORY;
- return NULL;
- }
- bufferLim = newBuf + bufferSize;
-#ifdef XML_CONTEXT_BYTES
- if (bufferPtr) {
- int keep = (int)(bufferPtr - buffer);
- if (keep > XML_CONTEXT_BYTES)
- keep = XML_CONTEXT_BYTES;
- memcpy(newBuf, &bufferPtr[-keep], bufferEnd - bufferPtr + keep);
- FREE(buffer);
- buffer = newBuf;
- bufferEnd = buffer + (bufferEnd - bufferPtr) + keep;
- bufferPtr = buffer + keep;
- }
- else {
- bufferEnd = newBuf + (bufferEnd - bufferPtr);
- bufferPtr = buffer = newBuf;
- }
-#else
- if (bufferPtr) {
- memcpy(newBuf, bufferPtr, bufferEnd - bufferPtr);
- FREE(buffer);
- }
- bufferEnd = newBuf + (bufferEnd - bufferPtr);
- bufferPtr = buffer = newBuf;
-#endif /* not defined XML_CONTEXT_BYTES */
- }
- }
- return bufferEnd;
-}
-
-enum XML_Status XMLCALL
-XML_StopParser(XML_Parser parser, XML_Bool resumable)
-{
- switch (ps_parsing) {
- case XML_SUSPENDED:
- if (resumable) {
- errorCode = XML_ERROR_SUSPENDED;
- return XML_STATUS_ERROR;
- }
- ps_parsing = XML_FINISHED;
- break;
- case XML_FINISHED:
- errorCode = XML_ERROR_FINISHED;
- return XML_STATUS_ERROR;
- default:
- if (resumable) {
-#ifdef XML_DTD
- if (isParamEntity) {
- errorCode = XML_ERROR_SUSPEND_PE;
- return XML_STATUS_ERROR;
- }
-#endif
- ps_parsing = XML_SUSPENDED;
- }
- else
- ps_parsing = XML_FINISHED;
- }
- return XML_STATUS_OK;
-}
-
-enum XML_Status XMLCALL
-XML_ResumeParser(XML_Parser parser)
-{
- enum XML_Status result = XML_STATUS_OK;
-
- if (ps_parsing != XML_SUSPENDED) {
- errorCode = XML_ERROR_NOT_SUSPENDED;
- return XML_STATUS_ERROR;
- }
- ps_parsing = XML_PARSING;
-
- errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr);
-
- if (errorCode != XML_ERROR_NONE) {
- eventEndPtr = eventPtr;
- processor = errorProcessor;
- return XML_STATUS_ERROR;
- }
- else {
- switch (ps_parsing) {
- case XML_SUSPENDED:
- result = XML_STATUS_SUSPENDED;
- break;
- case XML_INITIALIZED:
- case XML_PARSING:
- if (ps_finalBuffer) {
- ps_parsing = XML_FINISHED;
- return result;
- }
- default: ;
- }
- }
-
- XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
- positionPtr = bufferPtr;
- return result;
-}
-
-void XMLCALL
-XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status)
-{
- assert(status != NULL);
- *status = parser->m_parsingStatus;
-}
-
-enum XML_Error XMLCALL
-XML_GetErrorCode(XML_Parser parser)
-{
- return errorCode;
-}
-
-XML_Index XMLCALL
-XML_GetCurrentByteIndex(XML_Parser parser)
-{
- if (eventPtr)
- return parseEndByteIndex - (parseEndPtr - eventPtr);
- return -1;
-}
-
-int XMLCALL
-XML_GetCurrentByteCount(XML_Parser parser)
-{
- if (eventEndPtr && eventPtr)
- return (int)(eventEndPtr - eventPtr);
- return 0;
-}
-
-const char * XMLCALL
-XML_GetInputContext(XML_Parser parser, int *offset, int *size)
-{
-#ifdef XML_CONTEXT_BYTES
- if (eventPtr && buffer) {
- *offset = (int)(eventPtr - buffer);
- *size = (int)(bufferEnd - buffer);
- return buffer;
- }
-#endif /* defined XML_CONTEXT_BYTES */
- return (char *) 0;
-}
-
-XML_Size XMLCALL
-XML_GetCurrentLineNumber(XML_Parser parser)
-{
- if (eventPtr && eventPtr >= positionPtr) {
- XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
- positionPtr = eventPtr;
- }
- return position.lineNumber + 1;
-}
-
-XML_Size XMLCALL
-XML_GetCurrentColumnNumber(XML_Parser parser)
-{
- if (eventPtr && eventPtr >= positionPtr) {
- XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
- positionPtr = eventPtr;
- }
- return position.columnNumber;
-}
-
-void XMLCALL
-XML_FreeContentModel(XML_Parser parser, XML_Content *model)
-{
- FREE(model);
-}
-
-void * XMLCALL
-XML_MemMalloc(XML_Parser parser, size_t size)
-{
- return MALLOC(size);
-}
-
-void * XMLCALL
-XML_MemRealloc(XML_Parser parser, void *ptr, size_t size)
-{
- return REALLOC(ptr, size);
-}
-
-void XMLCALL
-XML_MemFree(XML_Parser parser, void *ptr)
-{
- FREE(ptr);
-}
-
-void XMLCALL
-XML_DefaultCurrent(XML_Parser parser)
-{
- if (defaultHandler) {
- if (openInternalEntities)
- reportDefault(parser,
- internalEncoding,
- openInternalEntities->internalEventPtr,
- openInternalEntities->internalEventEndPtr);
- else
- reportDefault(parser, encoding, eventPtr, eventEndPtr);
- }
-}
-
-const XML_LChar * XMLCALL
-XML_ErrorString(enum XML_Error code)
-{
- static const XML_LChar* const message[] = {
- 0,
- XML_L("out of memory"),
- XML_L("syntax error"),
- XML_L("no element found"),
- XML_L("not well-formed (invalid token)"),
- XML_L("unclosed token"),
- XML_L("partial character"),
- XML_L("mismatched tag"),
- XML_L("duplicate attribute"),
- XML_L("junk after document element"),
- XML_L("illegal parameter entity reference"),
- XML_L("undefined entity"),
- XML_L("recursive entity reference"),
- XML_L("asynchronous entity"),
- XML_L("reference to invalid character number"),
- XML_L("reference to binary entity"),
- XML_L("reference to external entity in attribute"),
- XML_L("XML or text declaration not at start of entity"),
- XML_L("unknown encoding"),
- XML_L("encoding specified in XML declaration is incorrect"),
- XML_L("unclosed CDATA section"),
- XML_L("error in processing external entity reference"),
- XML_L("document is not standalone"),
- XML_L("unexpected parser state - please send a bug report"),
- XML_L("entity declared in parameter entity"),
- XML_L("requested feature requires XML_DTD support in Expat"),
- XML_L("cannot change setting once parsing has begun"),
- XML_L("unbound prefix"),
- XML_L("must not undeclare prefix"),
- XML_L("incomplete markup in parameter entity"),
- XML_L("XML declaration not well-formed"),
- XML_L("text declaration not well-formed"),
- XML_L("illegal character(s) in public id"),
- XML_L("parser suspended"),
- XML_L("parser not suspended"),
- XML_L("parsing aborted"),
- XML_L("parsing finished"),
- XML_L("cannot suspend in external parameter entity"),
- XML_L("reserved prefix (xml) must not be undeclared or bound to another namespace name"),
- XML_L("reserved prefix (xmlns) must not be declared or undeclared"),
- XML_L("prefix must not be bound to one of the reserved namespace names")
- };
- if (code > 0 && code < sizeof(message)/sizeof(message[0]))
- return message[code];
- return NULL;
-}
-
-const XML_LChar * XMLCALL
-XML_ExpatVersion(void) {
-
- /* V1 is used to string-ize the version number. However, it would
- string-ize the actual version macro *names* unless we get them
- substituted before being passed to V1. CPP is defined to expand
- a macro, then rescan for more expansions. Thus, we use V2 to expand
- the version macros, then CPP will expand the resulting V1() macro
- with the correct numerals. */
- /* ### I'm assuming cpp is portable in this respect... */
-
-#define V1(a,b,c) XML_L(#a)XML_L(".")XML_L(#b)XML_L(".")XML_L(#c)
-#define V2(a,b,c) XML_L("expat_")V1(a,b,c)
-
- return V2(XML_MAJOR_VERSION, XML_MINOR_VERSION, XML_MICRO_VERSION);
-
-#undef V1
-#undef V2
-}
-
-XML_Expat_Version XMLCALL
-XML_ExpatVersionInfo(void)
-{
- XML_Expat_Version version;
-
- version.major = XML_MAJOR_VERSION;
- version.minor = XML_MINOR_VERSION;
- version.micro = XML_MICRO_VERSION;
-
- return version;
-}
-
-const XML_Feature * XMLCALL
-XML_GetFeatureList(void)
-{
- static const XML_Feature features[] = {
- {XML_FEATURE_SIZEOF_XML_CHAR, XML_L("sizeof(XML_Char)"),
- sizeof(XML_Char)},
- {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)"),
- sizeof(XML_LChar)},
-#ifdef XML_UNICODE
- {XML_FEATURE_UNICODE, XML_L("XML_UNICODE"), 0},
-#endif
-#ifdef XML_UNICODE_WCHAR_T
- {XML_FEATURE_UNICODE_WCHAR_T, XML_L("XML_UNICODE_WCHAR_T"), 0},
-#endif
-#ifdef XML_DTD
- {XML_FEATURE_DTD, XML_L("XML_DTD"), 0},
-#endif
-#ifdef XML_CONTEXT_BYTES
- {XML_FEATURE_CONTEXT_BYTES, XML_L("XML_CONTEXT_BYTES"),
- XML_CONTEXT_BYTES},
-#endif
-#ifdef XML_MIN_SIZE
- {XML_FEATURE_MIN_SIZE, XML_L("XML_MIN_SIZE"), 0},
-#endif
-#ifdef XML_NS
- {XML_FEATURE_NS, XML_L("XML_NS"), 0},
-#endif
-#ifdef XML_LARGE_SIZE
- {XML_FEATURE_LARGE_SIZE, XML_L("XML_LARGE_SIZE"), 0},
-#endif
- {XML_FEATURE_END, NULL, 0}
- };
-
- return features;
-}
-
-/* Initially tag->rawName always points into the parse buffer;
- for those TAG instances opened while the current parse buffer was
- processed, and not yet closed, we need to store tag->rawName in a more
- permanent location, since the parse buffer is about to be discarded.
-*/
-static XML_Bool
-storeRawNames(XML_Parser parser)
-{
- TAG *tag = tagStack;
- while (tag) {
- int bufSize;
- int nameLen = sizeof(XML_Char) * (tag->name.strLen + 1);
- char *rawNameBuf = tag->buf + nameLen;
- /* Stop if already stored. Since tagStack is a stack, we can stop
- at the first entry that has already been copied; everything
- below it in the stack is already been accounted for in a
- previous call to this function.
- */
- if (tag->rawName == rawNameBuf)
- break;
- /* For re-use purposes we need to ensure that the
- size of tag->buf is a multiple of sizeof(XML_Char).
- */
- bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char));
- if (bufSize > tag->bufEnd - tag->buf) {
- char *temp = (char *)REALLOC(tag->buf, bufSize);
- if (temp == NULL)
- return XML_FALSE;
- /* if tag->name.str points to tag->buf (only when namespace
- processing is off) then we have to update it
- */
- if (tag->name.str == (XML_Char *)tag->buf)
- tag->name.str = (XML_Char *)temp;
- /* if tag->name.localPart is set (when namespace processing is on)
- then update it as well, since it will always point into tag->buf
- */
- if (tag->name.localPart)
- tag->name.localPart = (XML_Char *)temp + (tag->name.localPart -
- (XML_Char *)tag->buf);
- tag->buf = temp;
- tag->bufEnd = temp + bufSize;
- rawNameBuf = temp + nameLen;
- }
- memcpy(rawNameBuf, tag->rawName, tag->rawNameLength);
- tag->rawName = rawNameBuf;
- tag = tag->parent;
- }
- return XML_TRUE;
-}
-
-static enum XML_Error PTRCALL
-contentProcessor(XML_Parser parser,
- const char *start,
- const char *end,
- const char **endPtr)
-{
- enum XML_Error result = doContent(parser, 0, encoding, start, end,
- endPtr, (XML_Bool)!ps_finalBuffer);
- if (result == XML_ERROR_NONE) {
- if (!storeRawNames(parser))
- return XML_ERROR_NO_MEMORY;
- }
- return result;
-}
-
-static enum XML_Error PTRCALL
-externalEntityInitProcessor(XML_Parser parser,
- const char *start,
- const char *end,
- const char **endPtr)
-{
- enum XML_Error result = initializeEncoding(parser);
- if (result != XML_ERROR_NONE)
- return result;
- processor = externalEntityInitProcessor2;
- return externalEntityInitProcessor2(parser, start, end, endPtr);
-}
-
-static enum XML_Error PTRCALL
-externalEntityInitProcessor2(XML_Parser parser,
- const char *start,
- const char *end,
- const char **endPtr)
-{
- const char *next = start; /* XmlContentTok doesn't always set the last arg */
- int tok = XmlContentTok(encoding, start, end, &next);
- switch (tok) {
- case XML_TOK_BOM:
- /* If we are at the end of the buffer, this would cause the next stage,
- i.e. externalEntityInitProcessor3, to pass control directly to
- doContent (by detecting XML_TOK_NONE) without processing any xml text
- declaration - causing the error XML_ERROR_MISPLACED_XML_PI in doContent.
- */
- if (next == end && !ps_finalBuffer) {
- *endPtr = next;
- return XML_ERROR_NONE;
- }
- start = next;
- break;
- case XML_TOK_PARTIAL:
- if (!ps_finalBuffer) {
- *endPtr = start;
- return XML_ERROR_NONE;
- }
- eventPtr = start;
- return XML_ERROR_UNCLOSED_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- if (!ps_finalBuffer) {
- *endPtr = start;
- return XML_ERROR_NONE;
- }
- eventPtr = start;
- return XML_ERROR_PARTIAL_CHAR;
- }
- processor = externalEntityInitProcessor3;
- return externalEntityInitProcessor3(parser, start, end, endPtr);
-}
-
-static enum XML_Error PTRCALL
-externalEntityInitProcessor3(XML_Parser parser,
- const char *start,
- const char *end,
- const char **endPtr)
-{
- int tok;
- const char *next = start; /* XmlContentTok doesn't always set the last arg */
- eventPtr = start;
- tok = XmlContentTok(encoding, start, end, &next);
- eventEndPtr = next;
-
- switch (tok) {
- case XML_TOK_XML_DECL:
- {
- enum XML_Error result;
- result = processXmlDecl(parser, 1, start, next);
- if (result != XML_ERROR_NONE)
- return result;
- switch (ps_parsing) {
- case XML_SUSPENDED:
- *endPtr = next;
- return XML_ERROR_NONE;
- case XML_FINISHED:
- return XML_ERROR_ABORTED;
- default:
- start = next;
- }
- }
- break;
- case XML_TOK_PARTIAL:
- if (!ps_finalBuffer) {
- *endPtr = start;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_UNCLOSED_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- if (!ps_finalBuffer) {
- *endPtr = start;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_PARTIAL_CHAR;
- }
- processor = externalEntityContentProcessor;
- tagLevel = 1;
- return externalEntityContentProcessor(parser, start, end, endPtr);
-}
-
-static enum XML_Error PTRCALL
-externalEntityContentProcessor(XML_Parser parser,
- const char *start,
- const char *end,
- const char **endPtr)
-{
- enum XML_Error result = doContent(parser, 1, encoding, start, end,
- endPtr, (XML_Bool)!ps_finalBuffer);
- if (result == XML_ERROR_NONE) {
- if (!storeRawNames(parser))
- return XML_ERROR_NO_MEMORY;
- }
- return result;
-}
-
-static enum XML_Error
-doContent(XML_Parser parser,
- int startTagLevel,
- const ENCODING *enc,
- const char *s,
- const char *end,
- const char **nextPtr,
- XML_Bool haveMore)
-{
- /* save one level of indirection */
- DTD * const dtd = _dtd;
-
- const char **eventPP;
- const char **eventEndPP;
- if (enc == encoding) {
- eventPP = &eventPtr;
- eventEndPP = &eventEndPtr;
- }
- else {
- eventPP = &(openInternalEntities->internalEventPtr);
- eventEndPP = &(openInternalEntities->internalEventEndPtr);
- }
- *eventPP = s;
-
- for (;;) {
- const char *next = s; /* XmlContentTok doesn't always set the last arg */
- int tok = XmlContentTok(enc, s, end, &next);
- *eventEndPP = next;
- switch (tok) {
- case XML_TOK_TRAILING_CR:
- if (haveMore) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- *eventEndPP = end;
- if (characterDataHandler) {
- XML_Char c = 0xA;
- characterDataHandler(handlerArg, &c, 1);
- }
- else if (defaultHandler)
- reportDefault(parser, enc, s, end);
- /* We are at the end of the final buffer, should we check for
- XML_SUSPENDED, XML_FINISHED?
- */
- if (startTagLevel == 0)
- return XML_ERROR_NO_ELEMENTS;
- if (tagLevel != startTagLevel)
- return XML_ERROR_ASYNC_ENTITY;
- *nextPtr = end;
- return XML_ERROR_NONE;
- case XML_TOK_NONE:
- if (haveMore) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- if (startTagLevel > 0) {
- if (tagLevel != startTagLevel)
- return XML_ERROR_ASYNC_ENTITY;
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_NO_ELEMENTS;
- case XML_TOK_INVALID:
- *eventPP = next;
- return XML_ERROR_INVALID_TOKEN;
- case XML_TOK_PARTIAL:
- if (haveMore) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_UNCLOSED_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- if (haveMore) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_PARTIAL_CHAR;
- case XML_TOK_ENTITY_REF:
- {
- const XML_Char *name;
- ENTITY *entity;
- XML_Char ch = (XML_Char) XmlPredefinedEntityName(enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (ch) {
- if (characterDataHandler)
- characterDataHandler(handlerArg, &ch, 1);
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- break;
- }
- name = poolStoreString(&dtd->pool, enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (!name)
- return XML_ERROR_NO_MEMORY;
- entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0);
- poolDiscard(&dtd->pool);
- /* First, determine if a check for an existing declaration is needed;
- if yes, check that the entity exists, and that it is internal,
- otherwise call the skipped entity or default handler.
- */
- if (!dtd->hasParamEntityRefs || dtd->standalone) {
- if (!entity)
- return XML_ERROR_UNDEFINED_ENTITY;
- else if (!entity->is_internal)
- return XML_ERROR_ENTITY_DECLARED_IN_PE;
- }
- else if (!entity) {
- if (skippedEntityHandler)
- skippedEntityHandler(handlerArg, name, 0);
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- break;
- }
- if (entity->open)
- return XML_ERROR_RECURSIVE_ENTITY_REF;
- if (entity->notation)
- return XML_ERROR_BINARY_ENTITY_REF;
- if (entity->textPtr) {
- enum XML_Error result;
- if (!defaultExpandInternalEntities) {
- if (skippedEntityHandler)
- skippedEntityHandler(handlerArg, entity->name, 0);
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- break;
- }
- result = processInternalEntity(parser, entity, XML_FALSE);
- if (result != XML_ERROR_NONE)
- return result;
- }
- else if (externalEntityRefHandler) {
- const XML_Char *context;
- entity->open = XML_TRUE;
- context = getContext(parser);
- entity->open = XML_FALSE;
- if (!context)
- return XML_ERROR_NO_MEMORY;
- if (!externalEntityRefHandler(externalEntityRefHandlerArg,
- context,
- entity->base,
- entity->systemId,
- entity->publicId))
- return XML_ERROR_EXTERNAL_ENTITY_HANDLING;
- poolDiscard(&tempPool);
- }
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- break;
- }
- case XML_TOK_START_TAG_NO_ATTS:
- /* fall through */
- case XML_TOK_START_TAG_WITH_ATTS:
- {
- TAG *tag;
- enum XML_Error result;
- XML_Char *toPtr;
- if (freeTagList) {
- tag = freeTagList;
- freeTagList = freeTagList->parent;
- }
- else {
- tag = (TAG *)MALLOC(sizeof(TAG));
- if (!tag)
- return XML_ERROR_NO_MEMORY;
- tag->buf = (char *)MALLOC(INIT_TAG_BUF_SIZE);
- if (!tag->buf) {
- FREE(tag);
- return XML_ERROR_NO_MEMORY;
- }
- tag->bufEnd = tag->buf + INIT_TAG_BUF_SIZE;
- }
- tag->bindings = NULL;
- tag->parent = tagStack;
- tagStack = tag;
- tag->name.localPart = NULL;
- tag->name.prefix = NULL;
- tag->rawName = s + enc->minBytesPerChar;
- tag->rawNameLength = XmlNameLength(enc, tag->rawName);
- ++tagLevel;
- {
- const char *rawNameEnd = tag->rawName + tag->rawNameLength;
- const char *fromPtr = tag->rawName;
- toPtr = (XML_Char *)tag->buf;
- for (;;) {
- int bufSize;
- int convLen;
- XmlConvert(enc,
- &fromPtr, rawNameEnd,
- (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1);
- convLen = (int)(toPtr - (XML_Char *)tag->buf);
- if (fromPtr == rawNameEnd) {
- tag->name.strLen = convLen;
- break;
- }
- bufSize = (int)(tag->bufEnd - tag->buf) << 1;
- {
- char *temp = (char *)REALLOC(tag->buf, bufSize);
- if (temp == NULL)
- return XML_ERROR_NO_MEMORY;
- tag->buf = temp;
- tag->bufEnd = temp + bufSize;
- toPtr = (XML_Char *)temp + convLen;
- }
- }
- }
- tag->name.str = (XML_Char *)tag->buf;
- *toPtr = XML_T('\0');
- result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings));
- if (result)
- return result;
- if (startElementHandler)
- startElementHandler(handlerArg, tag->name.str,
- (const XML_Char **)atts);
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- poolClear(&tempPool);
- break;
- }
- case XML_TOK_EMPTY_ELEMENT_NO_ATTS:
- /* fall through */
- case XML_TOK_EMPTY_ELEMENT_WITH_ATTS:
- {
- const char *rawName = s + enc->minBytesPerChar;
- enum XML_Error result;
- BINDING *bindings = NULL;
- XML_Bool noElmHandlers = XML_TRUE;
- TAG_NAME name;
- name.str = poolStoreString(&tempPool, enc, rawName,
- rawName + XmlNameLength(enc, rawName));
- if (!name.str)
- return XML_ERROR_NO_MEMORY;
- poolFinish(&tempPool);
- result = storeAtts(parser, enc, s, &name, &bindings);
- if (result)
- return result;
- poolFinish(&tempPool);
- if (startElementHandler) {
- startElementHandler(handlerArg, name.str, (const XML_Char **)atts);
- noElmHandlers = XML_FALSE;
- }
- if (endElementHandler) {
- if (startElementHandler)
- *eventPP = *eventEndPP;
- endElementHandler(handlerArg, name.str);
- noElmHandlers = XML_FALSE;
- }
- if (noElmHandlers && defaultHandler)
- reportDefault(parser, enc, s, next);
- poolClear(&tempPool);
- while (bindings) {
- BINDING *b = bindings;
- if (endNamespaceDeclHandler)
- endNamespaceDeclHandler(handlerArg, b->prefix->name);
- bindings = bindings->nextTagBinding;
- b->nextTagBinding = freeBindingList;
- freeBindingList = b;
- b->prefix->binding = b->prevPrefixBinding;
- }
- }
- if (tagLevel == 0)
- return epilogProcessor(parser, next, end, nextPtr);
- break;
- case XML_TOK_END_TAG:
- if (tagLevel == startTagLevel)
- return XML_ERROR_ASYNC_ENTITY;
- else {
- int len;
- const char *rawName;
- TAG *tag = tagStack;
- tagStack = tag->parent;
- tag->parent = freeTagList;
- freeTagList = tag;
- rawName = s + enc->minBytesPerChar*2;
- len = XmlNameLength(enc, rawName);
- if (len != tag->rawNameLength
- || memcmp(tag->rawName, rawName, len) != 0) {
- *eventPP = rawName;
- return XML_ERROR_TAG_MISMATCH;
- }
- --tagLevel;
- if (endElementHandler) {
- const XML_Char *localPart;
- const XML_Char *prefix;
- XML_Char *uri;
- localPart = tag->name.localPart;
- if (ns && localPart) {
- /* localPart and prefix may have been overwritten in
- tag->name.str, since this points to the binding->uri
- buffer which gets re-used; so we have to add them again
- */
- uri = (XML_Char *)tag->name.str + tag->name.uriLen;
- /* don't need to check for space - already done in storeAtts() */
- while (*localPart) *uri++ = *localPart++;
- prefix = (XML_Char *)tag->name.prefix;
- if (ns_triplets && prefix) {
- *uri++ = namespaceSeparator;
- while (*prefix) *uri++ = *prefix++;
- }
- *uri = XML_T('\0');
- }
- endElementHandler(handlerArg, tag->name.str);
- }
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- while (tag->bindings) {
- BINDING *b = tag->bindings;
- if (endNamespaceDeclHandler)
- endNamespaceDeclHandler(handlerArg, b->prefix->name);
- tag->bindings = tag->bindings->nextTagBinding;
- b->nextTagBinding = freeBindingList;
- freeBindingList = b;
- b->prefix->binding = b->prevPrefixBinding;
- }
- if (tagLevel == 0)
- return epilogProcessor(parser, next, end, nextPtr);
- }
- break;
- case XML_TOK_CHAR_REF:
- {
- int n = XmlCharRefNumber(enc, s);
- if (n < 0)
- return XML_ERROR_BAD_CHAR_REF;
- if (characterDataHandler) {
- XML_Char buf[XML_ENCODE_MAX];
- characterDataHandler(handlerArg, buf, XmlEncode(n, (ICHAR *)buf));
- }
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- }
- break;
- case XML_TOK_XML_DECL:
- return XML_ERROR_MISPLACED_XML_PI;
- case XML_TOK_DATA_NEWLINE:
- if (characterDataHandler) {
- XML_Char c = 0xA;
- characterDataHandler(handlerArg, &c, 1);
- }
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- break;
- case XML_TOK_CDATA_SECT_OPEN:
- {
- enum XML_Error result;
- if (startCdataSectionHandler)
- startCdataSectionHandler(handlerArg);
-#if 0
- /* Suppose you doing a transformation on a document that involves
- changing only the character data. You set up a defaultHandler
- and a characterDataHandler. The defaultHandler simply copies
- characters through. The characterDataHandler does the
- transformation and writes the characters out escaping them as
- necessary. This case will fail to work if we leave out the
- following two lines (because & and < inside CDATA sections will
- be incorrectly escaped).
-
- However, now we have a start/endCdataSectionHandler, so it seems
- easier to let the user deal with this.
- */
- else if (characterDataHandler)
- characterDataHandler(handlerArg, dataBuf, 0);
-#endif
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- result = doCdataSection(parser, enc, &next, end, nextPtr, haveMore);
- if (result != XML_ERROR_NONE)
- return result;
- else if (!next) {
- processor = cdataSectionProcessor;
- return result;
- }
- }
- break;
- case XML_TOK_TRAILING_RSQB:
- if (haveMore) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- if (characterDataHandler) {
- if (MUST_CONVERT(enc, s)) {
- ICHAR *dataPtr = (ICHAR *)dataBuf;
- XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd);
- characterDataHandler(handlerArg, dataBuf,
- (int)(dataPtr - (ICHAR *)dataBuf));
- }
- else
- characterDataHandler(handlerArg,
- (XML_Char *)s,
- (int)((XML_Char *)end - (XML_Char *)s));
- }
- else if (defaultHandler)
- reportDefault(parser, enc, s, end);
- /* We are at the end of the final buffer, should we check for
- XML_SUSPENDED, XML_FINISHED?
- */
- if (startTagLevel == 0) {
- *eventPP = end;
- return XML_ERROR_NO_ELEMENTS;
- }
- if (tagLevel != startTagLevel) {
- *eventPP = end;
- return XML_ERROR_ASYNC_ENTITY;
- }
- *nextPtr = end;
- return XML_ERROR_NONE;
- case XML_TOK_DATA_CHARS:
- {
- XML_CharacterDataHandler charDataHandler = characterDataHandler;
- if (charDataHandler) {
- if (MUST_CONVERT(enc, s)) {
- for (;;) {
- ICHAR *dataPtr = (ICHAR *)dataBuf;
- XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
- *eventEndPP = s;
- charDataHandler(handlerArg, dataBuf,
- (int)(dataPtr - (ICHAR *)dataBuf));
- if (s == next)
- break;
- *eventPP = s;
- }
- }
- else
- charDataHandler(handlerArg,
- (XML_Char *)s,
- (int)((XML_Char *)next - (XML_Char *)s));
- }
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- }
- break;
- case XML_TOK_PI:
- if (!reportProcessingInstruction(parser, enc, s, next))
- return XML_ERROR_NO_MEMORY;
- break;
- case XML_TOK_COMMENT:
- if (!reportComment(parser, enc, s, next))
- return XML_ERROR_NO_MEMORY;
- break;
- default:
- if (defaultHandler)
- reportDefault(parser, enc, s, next);
- break;
- }
- *eventPP = s = next;
- switch (ps_parsing) {
- case XML_SUSPENDED:
- *nextPtr = next;
- return XML_ERROR_NONE;
- case XML_FINISHED:
- return XML_ERROR_ABORTED;
- default: ;
- }
- }
- /* not reached */
-}
-
-/* Precondition: all arguments must be non-NULL;
- Purpose:
- - normalize attributes
- - check attributes for well-formedness
- - generate namespace aware attribute names (URI, prefix)
- - build list of attributes for startElementHandler
- - default attributes
- - process namespace declarations (check and report them)
- - generate namespace aware element name (URI, prefix)
-*/
-static enum XML_Error
-storeAtts(XML_Parser parser, const ENCODING *enc,
- const char *attStr, TAG_NAME *tagNamePtr,
- BINDING **bindingsPtr)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- ELEMENT_TYPE *elementType;
- int nDefaultAtts;
- const XML_Char **appAtts; /* the attribute list for the application */
- int attIndex = 0;
- int prefixLen;
- int i;
- int n;
- XML_Char *uri;
- int nPrefixes = 0;
- BINDING *binding;
- const XML_Char *localPart;
-
- /* lookup the element type name */
- elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0);
- if (!elementType) {
- const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
- if (!name)
- return XML_ERROR_NO_MEMORY;
- elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name,
- sizeof(ELEMENT_TYPE));
- if (!elementType)
- return XML_ERROR_NO_MEMORY;
- if (ns && !setElementTypePrefix(parser, elementType))
- return XML_ERROR_NO_MEMORY;
- }
- nDefaultAtts = elementType->nDefaultAtts;
-
- /* get the attributes from the tokenizer */
- n = XmlGetAttributes(enc, attStr, attsSize, atts);
- if (n + nDefaultAtts > attsSize) {
- int oldAttsSize = attsSize;
- ATTRIBUTE *temp;
- attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;
- temp = (ATTRIBUTE *)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE));
- if (temp == NULL)
- return XML_ERROR_NO_MEMORY;
- atts = temp;
- if (n > oldAttsSize)
- XmlGetAttributes(enc, attStr, n, atts);
- }
-
- appAtts = (const XML_Char **)atts;
- for (i = 0; i < n; i++) {
- /* add the name and value to the attribute list */
- ATTRIBUTE_ID *attId = getAttributeId(parser, enc, atts[i].name,
- atts[i].name
- + XmlNameLength(enc, atts[i].name));
- if (!attId)
- return XML_ERROR_NO_MEMORY;
- /* Detect duplicate attributes by their QNames. This does not work when
- namespace processing is turned on and different prefixes for the same
- namespace are used. For this case we have a check further down.
- */
- if ((attId->name)[-1]) {
- if (enc == encoding)
- eventPtr = atts[i].name;
- return XML_ERROR_DUPLICATE_ATTRIBUTE;
- }
- (attId->name)[-1] = 1;
- appAtts[attIndex++] = attId->name;
- if (!atts[i].normalized) {
- enum XML_Error result;
- XML_Bool isCdata = XML_TRUE;
-
- /* figure out whether declared as other than CDATA */
- if (attId->maybeTokenized) {
- int j;
- for (j = 0; j < nDefaultAtts; j++) {
- if (attId == elementType->defaultAtts[j].id) {
- isCdata = elementType->defaultAtts[j].isCdata;
- break;
- }
- }
- }
-
- /* normalize the attribute value */
- result = storeAttributeValue(parser, enc, isCdata,
- atts[i].valuePtr, atts[i].valueEnd,
- &tempPool);
- if (result)
- return result;
- appAtts[attIndex] = poolStart(&tempPool);
- poolFinish(&tempPool);
- }
- else {
- /* the value did not need normalizing */
- appAtts[attIndex] = poolStoreString(&tempPool, enc, atts[i].valuePtr,
- atts[i].valueEnd);
- if (appAtts[attIndex] == 0)
- return XML_ERROR_NO_MEMORY;
- poolFinish(&tempPool);
- }
- /* handle prefixed attribute names */
- if (attId->prefix) {
- if (attId->xmlns) {
- /* deal with namespace declarations here */
- enum XML_Error result = addBinding(parser, attId->prefix, attId,
- appAtts[attIndex], bindingsPtr);
- if (result)
- return result;
- --attIndex;
- }
- else {
- /* deal with other prefixed names later */
- attIndex++;
- nPrefixes++;
- (attId->name)[-1] = 2;
- }
- }
- else
- attIndex++;
- }
-
- /* set-up for XML_GetSpecifiedAttributeCount and XML_GetIdAttributeIndex */
- nSpecifiedAtts = attIndex;
- if (elementType->idAtt && (elementType->idAtt->name)[-1]) {
- for (i = 0; i < attIndex; i += 2)
- if (appAtts[i] == elementType->idAtt->name) {
- idAttIndex = i;
- break;
- }
- }
- else
- idAttIndex = -1;
-
- /* do attribute defaulting */
- for (i = 0; i < nDefaultAtts; i++) {
- const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + i;
- if (!(da->id->name)[-1] && da->value) {
- if (da->id->prefix) {
- if (da->id->xmlns) {
- enum XML_Error result = addBinding(parser, da->id->prefix, da->id,
- da->value, bindingsPtr);
- if (result)
- return result;
- }
- else {
- (da->id->name)[-1] = 2;
- nPrefixes++;
- appAtts[attIndex++] = da->id->name;
- appAtts[attIndex++] = da->value;
- }
- }
- else {
- (da->id->name)[-1] = 1;
- appAtts[attIndex++] = da->id->name;
- appAtts[attIndex++] = da->value;
- }
- }
- }
- appAtts[attIndex] = 0;
-
- /* expand prefixed attribute names, check for duplicates,
- and clear flags that say whether attributes were specified */
- i = 0;
- if (nPrefixes) {
- int j; /* hash table index */
- unsigned long version = nsAttsVersion;
- int nsAttsSize = (int)1 << nsAttsPower;
- /* size of hash table must be at least 2 * (# of prefixed attributes) */
- if ((nPrefixes << 1) >> nsAttsPower) { /* true for nsAttsPower = 0 */
- NS_ATT *temp;
- /* hash table size must also be a power of 2 and >= 8 */
- while (nPrefixes >> nsAttsPower++);
- if (nsAttsPower < 3)
- nsAttsPower = 3;
- nsAttsSize = (int)1 << nsAttsPower;
- temp = (NS_ATT *)REALLOC(nsAtts, nsAttsSize * sizeof(NS_ATT));
- if (!temp)
- return XML_ERROR_NO_MEMORY;
- nsAtts = temp;
- version = 0; /* force re-initialization of nsAtts hash table */
- }
- /* using a version flag saves us from initializing nsAtts every time */
- if (!version) { /* initialize version flags when version wraps around */
- version = INIT_ATTS_VERSION;
- for (j = nsAttsSize; j != 0; )
- nsAtts[--j].version = version;
- }
- nsAttsVersion = --version;
-
- /* expand prefixed names and check for duplicates */
- for (; i < attIndex; i += 2) {
- const XML_Char *s = appAtts[i];
- if (s[-1] == 2) { /* prefixed */
- ATTRIBUTE_ID *id;
- const BINDING *b;
- unsigned long uriHash = 0;
- ((XML_Char *)s)[-1] = 0; /* clear flag */
- id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, s, 0);
- b = id->prefix->binding;
- if (!b)
- return XML_ERROR_UNBOUND_PREFIX;
-
- /* as we expand the name we also calculate its hash value */
- for (j = 0; j < b->uriLen; j++) {
- const XML_Char c = b->uri[j];
- if (!poolAppendChar(&tempPool, c))
- return XML_ERROR_NO_MEMORY;
- uriHash = CHAR_HASH(uriHash, c);
- }
- while (*s++ != XML_T(ASCII_COLON))
- ;
- do { /* copies null terminator */
- const XML_Char c = *s;
- if (!poolAppendChar(&tempPool, *s))
- return XML_ERROR_NO_MEMORY;
- uriHash = CHAR_HASH(uriHash, c);
- } while (*s++);
-
- { /* Check hash table for duplicate of expanded name (uriName).
- Derived from code in lookup(HASH_TABLE *table, ...).
- */
- unsigned char step = 0;
- unsigned long mask = nsAttsSize - 1;
- j = uriHash & mask; /* index into hash table */
- while (nsAtts[j].version == version) {
- /* for speed we compare stored hash values first */
- if (uriHash == nsAtts[j].hash) {
- const XML_Char *s1 = poolStart(&tempPool);
- const XML_Char *s2 = nsAtts[j].uriName;
- /* s1 is null terminated, but not s2 */
- for (; *s1 == *s2 && *s1 != 0; s1++, s2++);
- if (*s1 == 0)
- return XML_ERROR_DUPLICATE_ATTRIBUTE;
- }
- if (!step)
- step = PROBE_STEP(uriHash, mask, nsAttsPower);
- j < step ? (j += nsAttsSize - step) : (j -= step);
- }
- }
-
- if (ns_triplets) { /* append namespace separator and prefix */
- tempPool.ptr[-1] = namespaceSeparator;
- s = b->prefix->name;
- do {
- if (!poolAppendChar(&tempPool, *s))
- return XML_ERROR_NO_MEMORY;
- } while (*s++);
- }
-
- /* store expanded name in attribute list */
- s = poolStart(&tempPool);
- poolFinish(&tempPool);
- appAtts[i] = s;
-
- /* fill empty slot with new version, uriName and hash value */
- nsAtts[j].version = version;
- nsAtts[j].hash = uriHash;
- nsAtts[j].uriName = s;
-
- if (!--nPrefixes) {
- i += 2;
- break;
- }
- }
- else /* not prefixed */
- ((XML_Char *)s)[-1] = 0; /* clear flag */
- }
- }
- /* clear flags for the remaining attributes */
- for (; i < attIndex; i += 2)
- ((XML_Char *)(appAtts[i]))[-1] = 0;
- for (binding = *bindingsPtr; binding; binding = binding->nextTagBinding)
- binding->attId->name[-1] = 0;
-
- if (!ns)
- return XML_ERROR_NONE;
-
- /* expand the element type name */
- if (elementType->prefix) {
- binding = elementType->prefix->binding;
- if (!binding)
- return XML_ERROR_UNBOUND_PREFIX;
- localPart = tagNamePtr->str;
- while (*localPart++ != XML_T(ASCII_COLON))
- ;
- }
- else if (dtd->defaultPrefix.binding) {
- binding = dtd->defaultPrefix.binding;
- localPart = tagNamePtr->str;
- }
- else
- return XML_ERROR_NONE;
- prefixLen = 0;
- if (ns_triplets && binding->prefix->name) {
- for (; binding->prefix->name[prefixLen++];)
- ; /* prefixLen includes null terminator */
- }
- tagNamePtr->localPart = localPart;
- tagNamePtr->uriLen = binding->uriLen;
- tagNamePtr->prefix = binding->prefix->name;
- tagNamePtr->prefixLen = prefixLen;
- for (i = 0; localPart[i++];)
- ; /* i includes null terminator */
- n = i + binding->uriLen + prefixLen;
- if (n > binding->uriAlloc) {
- TAG *p;
- uri = (XML_Char *)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char));
- if (!uri)
- return XML_ERROR_NO_MEMORY;
- binding->uriAlloc = n + EXPAND_SPARE;
- memcpy(uri, binding->uri, binding->uriLen * sizeof(XML_Char));
- for (p = tagStack; p; p = p->parent)
- if (p->name.str == binding->uri)
- p->name.str = uri;
- FREE(binding->uri);
- binding->uri = uri;
- }
- /* if namespaceSeparator != '\0' then uri includes it already */
- uri = binding->uri + binding->uriLen;
- memcpy(uri, localPart, i * sizeof(XML_Char));
- /* we always have a namespace separator between localPart and prefix */
- if (prefixLen) {
- uri += i - 1;
- *uri = namespaceSeparator; /* replace null terminator */
- memcpy(uri + 1, binding->prefix->name, prefixLen * sizeof(XML_Char));
- }
- tagNamePtr->str = binding->uri;
- return XML_ERROR_NONE;
-}
-
-/* addBinding() overwrites the value of prefix->binding without checking.
- Therefore one must keep track of the old value outside of addBinding().
-*/
-static enum XML_Error
-addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
- const XML_Char *uri, BINDING **bindingsPtr)
-{
- static const XML_Char xmlNamespace[] = {
- ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH, ASCII_SLASH,
- ASCII_w, ASCII_w, ASCII_w, ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD,
- ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L,
- ASCII_SLASH, ASCII_1, ASCII_9, ASCII_9, ASCII_8, ASCII_SLASH,
- ASCII_n, ASCII_a, ASCII_m, ASCII_e, ASCII_s, ASCII_p, ASCII_a, ASCII_c,
- ASCII_e, '\0'
- };
- static const int xmlLen =
- (int)sizeof(xmlNamespace)/sizeof(XML_Char) - 1;
- static const XML_Char xmlnsNamespace[] = {
- ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH, ASCII_SLASH,
- ASCII_w, ASCII_w, ASCII_w, ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD,
- ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_2, ASCII_0, ASCII_0,
- ASCII_0, ASCII_SLASH, ASCII_x, ASCII_m, ASCII_l, ASCII_n, ASCII_s,
- ASCII_SLASH, '\0'
- };
- static const int xmlnsLen =
- (int)sizeof(xmlnsNamespace)/sizeof(XML_Char) - 1;
-
- XML_Bool mustBeXML = XML_FALSE;
- XML_Bool isXML = XML_TRUE;
- XML_Bool isXMLNS = XML_TRUE;
-
- BINDING *b;
- int len;
-
- /* empty URI is only valid for default namespace per XML NS 1.0 (not 1.1) */
- if (*uri == XML_T('\0') && prefix->name)
- return XML_ERROR_UNDECLARING_PREFIX;
-
- if (prefix->name
- && prefix->name[0] == XML_T(ASCII_x)
- && prefix->name[1] == XML_T(ASCII_m)
- && prefix->name[2] == XML_T(ASCII_l)) {
-
- /* Not allowed to bind xmlns */
- if (prefix->name[3] == XML_T(ASCII_n)
- && prefix->name[4] == XML_T(ASCII_s)
- && prefix->name[5] == XML_T('\0'))
- return XML_ERROR_RESERVED_PREFIX_XMLNS;
-
- if (prefix->name[3] == XML_T('\0'))
- mustBeXML = XML_TRUE;
- }
-
- for (len = 0; uri[len]; len++) {
- if (isXML && (len > xmlLen || uri[len] != xmlNamespace[len]))
- isXML = XML_FALSE;
-
- if (!mustBeXML && isXMLNS
- && (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
- isXMLNS = XML_FALSE;
- }
- isXML = isXML && len == xmlLen;
- isXMLNS = isXMLNS && len == xmlnsLen;
-
- if (mustBeXML != isXML)
- return mustBeXML ? XML_ERROR_RESERVED_PREFIX_XML
- : XML_ERROR_RESERVED_NAMESPACE_URI;
-
- if (isXMLNS)
- return XML_ERROR_RESERVED_NAMESPACE_URI;
-
- if (namespaceSeparator)
- len++;
- if (freeBindingList) {
- b = freeBindingList;
- if (len > b->uriAlloc) {
- XML_Char *temp = (XML_Char *)REALLOC(b->uri,
- sizeof(XML_Char) * (len + EXPAND_SPARE));
- if (temp == NULL)
- return XML_ERROR_NO_MEMORY;
- b->uri = temp;
- b->uriAlloc = len + EXPAND_SPARE;
- }
- freeBindingList = b->nextTagBinding;
- }
- else {
- b = (BINDING *)MALLOC(sizeof(BINDING));
- if (!b)
- return XML_ERROR_NO_MEMORY;
- b->uri = (XML_Char *)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));
- if (!b->uri) {
- FREE(b);
- return XML_ERROR_NO_MEMORY;
- }
- b->uriAlloc = len + EXPAND_SPARE;
- }
- b->uriLen = len;
- memcpy(b->uri, uri, len * sizeof(XML_Char));
- if (namespaceSeparator)
- b->uri[len - 1] = namespaceSeparator;
- b->prefix = prefix;
- b->attId = attId;
- b->prevPrefixBinding = prefix->binding;
- /* NULL binding when default namespace undeclared */
- if (*uri == XML_T('\0') && prefix == &_dtd->defaultPrefix)
- prefix->binding = NULL;
- else
- prefix->binding = b;
- b->nextTagBinding = *bindingsPtr;
- *bindingsPtr = b;
- /* if attId == NULL then we are not starting a namespace scope */
- if (attId && startNamespaceDeclHandler)
- startNamespaceDeclHandler(handlerArg, prefix->name,
- prefix->binding ? uri : 0);
- return XML_ERROR_NONE;
-}
-
-/* The idea here is to avoid using stack for each CDATA section when
- the whole file is parsed with one call.
-*/
-static enum XML_Error PTRCALL
-cdataSectionProcessor(XML_Parser parser,
- const char *start,
- const char *end,
- const char **endPtr)
-{
- enum XML_Error result = doCdataSection(parser, encoding, &start, end,
- endPtr, (XML_Bool)!ps_finalBuffer);
- if (result != XML_ERROR_NONE)
- return result;
- if (start) {
- if (parentParser) { /* we are parsing an external entity */
- processor = externalEntityContentProcessor;
- return externalEntityContentProcessor(parser, start, end, endPtr);
- }
- else {
- processor = contentProcessor;
- return contentProcessor(parser, start, end, endPtr);
- }
- }
- return result;
-}
-
-/* startPtr gets set to non-null if the section is closed, and to null if
- the section is not yet closed.
-*/
-static enum XML_Error
-doCdataSection(XML_Parser parser,
- const ENCODING *enc,
- const char **startPtr,
- const char *end,
- const char **nextPtr,
- XML_Bool haveMore)
-{
- const char *s = *startPtr;
- const char **eventPP;
- const char **eventEndPP;
- if (enc == encoding) {
- eventPP = &eventPtr;
- *eventPP = s;
- eventEndPP = &eventEndPtr;
- }
- else {
- eventPP = &(openInternalEntities->internalEventPtr);
- eventEndPP = &(openInternalEntities->internalEventEndPtr);
- }
- *eventPP = s;
- *startPtr = NULL;
-
- for (;;) {
- const char *next;
- int tok = XmlCdataSectionTok(enc, s, end, &next);
- *eventEndPP = next;
- switch (tok) {
- case XML_TOK_CDATA_SECT_CLOSE:
- if (endCdataSectionHandler)
- endCdataSectionHandler(handlerArg);
-#if 0
- /* see comment under XML_TOK_CDATA_SECT_OPEN */
- else if (characterDataHandler)
- characterDataHandler(handlerArg, dataBuf, 0);
-#endif
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- *startPtr = next;
- *nextPtr = next;
- if (ps_parsing == XML_FINISHED)
- return XML_ERROR_ABORTED;
- else
- return XML_ERROR_NONE;
- case XML_TOK_DATA_NEWLINE:
- if (characterDataHandler) {
- XML_Char c = 0xA;
- characterDataHandler(handlerArg, &c, 1);
- }
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- break;
- case XML_TOK_DATA_CHARS:
- {
- XML_CharacterDataHandler charDataHandler = characterDataHandler;
- if (charDataHandler) {
- if (MUST_CONVERT(enc, s)) {
- for (;;) {
- ICHAR *dataPtr = (ICHAR *)dataBuf;
- XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
- *eventEndPP = next;
- charDataHandler(handlerArg, dataBuf,
- (int)(dataPtr - (ICHAR *)dataBuf));
- if (s == next)
- break;
- *eventPP = s;
- }
- }
- else
- charDataHandler(handlerArg,
- (XML_Char *)s,
- (int)((XML_Char *)next - (XML_Char *)s));
- }
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
- }
- break;
- case XML_TOK_INVALID:
- *eventPP = next;
- return XML_ERROR_INVALID_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- if (haveMore) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_PARTIAL_CHAR;
- case XML_TOK_PARTIAL:
- case XML_TOK_NONE:
- if (haveMore) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_UNCLOSED_CDATA_SECTION;
- default:
- *eventPP = next;
- return XML_ERROR_UNEXPECTED_STATE;
- }
-
- *eventPP = s = next;
- switch (ps_parsing) {
- case XML_SUSPENDED:
- *nextPtr = next;
- return XML_ERROR_NONE;
- case XML_FINISHED:
- return XML_ERROR_ABORTED;
- default: ;
- }
- }
- /* not reached */
-}
-
-#ifdef XML_DTD
-
-/* The idea here is to avoid using stack for each IGNORE section when
- the whole file is parsed with one call.
-*/
-static enum XML_Error PTRCALL
-ignoreSectionProcessor(XML_Parser parser,
- const char *start,
- const char *end,
- const char **endPtr)
-{
- enum XML_Error result = doIgnoreSection(parser, encoding, &start, end,
- endPtr, (XML_Bool)!ps_finalBuffer);
- if (result != XML_ERROR_NONE)
- return result;
- if (start) {
- processor = prologProcessor;
- return prologProcessor(parser, start, end, endPtr);
- }
- return result;
-}
-
-/* startPtr gets set to non-null is the section is closed, and to null
- if the section is not yet closed.
-*/
-static enum XML_Error
-doIgnoreSection(XML_Parser parser,
- const ENCODING *enc,
- const char **startPtr,
- const char *end,
- const char **nextPtr,
- XML_Bool haveMore)
-{
- const char *next;
- int tok;
- const char *s = *startPtr;
- const char **eventPP;
- const char **eventEndPP;
- if (enc == encoding) {
- eventPP = &eventPtr;
- *eventPP = s;
- eventEndPP = &eventEndPtr;
- }
- else {
- eventPP = &(openInternalEntities->internalEventPtr);
- eventEndPP = &(openInternalEntities->internalEventEndPtr);
- }
- *eventPP = s;
- *startPtr = NULL;
- tok = XmlIgnoreSectionTok(enc, s, end, &next);
- *eventEndPP = next;
- switch (tok) {
- case XML_TOK_IGNORE_SECT:
- if (defaultHandler)
- reportDefault(parser, enc, s, next);
- *startPtr = next;
- *nextPtr = next;
- if (ps_parsing == XML_FINISHED)
- return XML_ERROR_ABORTED;
- else
- return XML_ERROR_NONE;
- case XML_TOK_INVALID:
- *eventPP = next;
- return XML_ERROR_INVALID_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- if (haveMore) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_PARTIAL_CHAR;
- case XML_TOK_PARTIAL:
- case XML_TOK_NONE:
- if (haveMore) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_SYNTAX; /* XML_ERROR_UNCLOSED_IGNORE_SECTION */
- default:
- *eventPP = next;
- return XML_ERROR_UNEXPECTED_STATE;
- }
- /* not reached */
-}
-
-#endif /* XML_DTD */
-
-static enum XML_Error
-initializeEncoding(XML_Parser parser)
-{
- const char *s;
-#ifdef XML_UNICODE
- char encodingBuf[128];
- if (!protocolEncodingName)
- s = NULL;
- else {
- int i;
- for (i = 0; protocolEncodingName[i]; i++) {
- if (i == sizeof(encodingBuf) - 1
- || (protocolEncodingName[i] & ~0x7f) != 0) {
- encodingBuf[0] = '\0';
- break;
- }
- encodingBuf[i] = (char)protocolEncodingName[i];
- }
- encodingBuf[i] = '\0';
- s = encodingBuf;
- }
-#else
- s = protocolEncodingName;
-#endif
- if ((ns ? XmlInitEncodingNS : XmlInitEncoding)(&initEncoding, &encoding, s))
- return XML_ERROR_NONE;
- return handleUnknownEncoding(parser, protocolEncodingName);
-}
-
-static enum XML_Error
-processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
- const char *s, const char *next)
-{
- const char *encodingName = NULL;
- const XML_Char *storedEncName = NULL;
- const ENCODING *newEncoding = NULL;
- const char *version = NULL;
- const char *versionend;
- const XML_Char *storedversion = NULL;
- int standalone = -1;
- if (!(ns
- ? XmlParseXmlDeclNS
- : XmlParseXmlDecl)(isGeneralTextEntity,
- encoding,
- s,
- next,
- &eventPtr,
- &version,
- &versionend,
- &encodingName,
- &newEncoding,
- &standalone)) {
- if (isGeneralTextEntity)
- return XML_ERROR_TEXT_DECL;
- else
- return XML_ERROR_XML_DECL;
- }
- if (!isGeneralTextEntity && standalone == 1) {
- _dtd->standalone = XML_TRUE;
-#ifdef XML_DTD
- if (paramEntityParsing == XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE)
- paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
-#endif /* XML_DTD */
- }
- if (xmlDeclHandler) {
- if (encodingName != NULL) {
- storedEncName = poolStoreString(&temp2Pool,
- encoding,
- encodingName,
- encodingName
- + XmlNameLength(encoding, encodingName));
- if (!storedEncName)
- return XML_ERROR_NO_MEMORY;
- poolFinish(&temp2Pool);
- }
- if (version) {
- storedversion = poolStoreString(&temp2Pool,
- encoding,
- version,
- versionend - encoding->minBytesPerChar);
- if (!storedversion)
- return XML_ERROR_NO_MEMORY;
- }
- xmlDeclHandler(handlerArg, storedversion, storedEncName, standalone);
- }
- else if (defaultHandler)
- reportDefault(parser, encoding, s, next);
- if (protocolEncodingName == NULL) {
- if (newEncoding) {
- if (newEncoding->minBytesPerChar != encoding->minBytesPerChar) {
- eventPtr = encodingName;
- return XML_ERROR_INCORRECT_ENCODING;
- }
- encoding = newEncoding;
- }
- else if (encodingName) {
- enum XML_Error result;
- if (!storedEncName) {
- storedEncName = poolStoreString(
- &temp2Pool, encoding, encodingName,
- encodingName + XmlNameLength(encoding, encodingName));
- if (!storedEncName)
- return XML_ERROR_NO_MEMORY;
- }
- result = handleUnknownEncoding(parser, storedEncName);
- poolClear(&temp2Pool);
- if (result == XML_ERROR_UNKNOWN_ENCODING)
- eventPtr = encodingName;
- return result;
- }
- }
-
- if (storedEncName || storedversion)
- poolClear(&temp2Pool);
-
- return XML_ERROR_NONE;
-}
-
-static enum XML_Error
-handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName)
-{
- if (unknownEncodingHandler) {
- XML_Encoding info;
- int i;
- for (i = 0; i < 256; i++)
- info.map[i] = -1;
- info.convert = NULL;
- info.data = NULL;
- info.release = NULL;
- if (unknownEncodingHandler(unknownEncodingHandlerData, encodingName,
- &info)) {
- ENCODING *enc;
- unknownEncodingMem = MALLOC(XmlSizeOfUnknownEncoding());
- if (!unknownEncodingMem) {
- if (info.release)
- info.release(info.data);
- return XML_ERROR_NO_MEMORY;
- }
- enc = (ns
- ? XmlInitUnknownEncodingNS
- : XmlInitUnknownEncoding)(unknownEncodingMem,
- info.map,
- info.convert,
- info.data);
- if (enc) {
- unknownEncodingData = info.data;
- unknownEncodingRelease = info.release;
- encoding = enc;
- return XML_ERROR_NONE;
- }
- }
- if (info.release != NULL)
- info.release(info.data);
- }
- return XML_ERROR_UNKNOWN_ENCODING;
-}
-
-static enum XML_Error PTRCALL
-prologInitProcessor(XML_Parser parser,
- const char *s,
- const char *end,
- const char **nextPtr)
-{
- enum XML_Error result = initializeEncoding(parser);
- if (result != XML_ERROR_NONE)
- return result;
- processor = prologProcessor;
- return prologProcessor(parser, s, end, nextPtr);
-}
-
-#ifdef XML_DTD
-
-static enum XML_Error PTRCALL
-externalParEntInitProcessor(XML_Parser parser,
- const char *s,
- const char *end,
- const char **nextPtr)
-{
- enum XML_Error result = initializeEncoding(parser);
- if (result != XML_ERROR_NONE)
- return result;
-
- /* we know now that XML_Parse(Buffer) has been called,
- so we consider the external parameter entity read */
- _dtd->paramEntityRead = XML_TRUE;
-
- if (prologState.inEntityValue) {
- processor = entityValueInitProcessor;
- return entityValueInitProcessor(parser, s, end, nextPtr);
- }
- else {
- processor = externalParEntProcessor;
- return externalParEntProcessor(parser, s, end, nextPtr);
- }
-}
-
-static enum XML_Error PTRCALL
-entityValueInitProcessor(XML_Parser parser,
- const char *s,
- const char *end,
- const char **nextPtr)
-{
- int tok;
- const char *start = s;
- const char *next = start;
- eventPtr = start;
-
- for (;;) {
- tok = XmlPrologTok(encoding, start, end, &next);
- eventEndPtr = next;
- if (tok <= 0) {
- if (!ps_finalBuffer && tok != XML_TOK_INVALID) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- switch (tok) {
- case XML_TOK_INVALID:
- return XML_ERROR_INVALID_TOKEN;
- case XML_TOK_PARTIAL:
- return XML_ERROR_UNCLOSED_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- return XML_ERROR_PARTIAL_CHAR;
- case XML_TOK_NONE: /* start == end */
- default:
- break;
- }
- /* found end of entity value - can store it now */
- return storeEntityValue(parser, encoding, s, end);
- }
- else if (tok == XML_TOK_XML_DECL) {
- enum XML_Error result;
- result = processXmlDecl(parser, 0, start, next);
- if (result != XML_ERROR_NONE)
- return result;
- switch (ps_parsing) {
- case XML_SUSPENDED:
- *nextPtr = next;
- return XML_ERROR_NONE;
- case XML_FINISHED:
- return XML_ERROR_ABORTED;
- default:
- *nextPtr = next;
- }
- /* stop scanning for text declaration - we found one */
- processor = entityValueProcessor;
- return entityValueProcessor(parser, next, end, nextPtr);
- }
- /* If we are at the end of the buffer, this would cause XmlPrologTok to
- return XML_TOK_NONE on the next call, which would then cause the
- function to exit with *nextPtr set to s - that is what we want for other
- tokens, but not for the BOM - we would rather like to skip it;
- then, when this routine is entered the next time, XmlPrologTok will
- return XML_TOK_INVALID, since the BOM is still in the buffer
- */
- else if (tok == XML_TOK_BOM && next == end && !ps_finalBuffer) {
- *nextPtr = next;
- return XML_ERROR_NONE;
- }
- start = next;
- eventPtr = start;
- }
-}
-
-static enum XML_Error PTRCALL
-externalParEntProcessor(XML_Parser parser,
- const char *s,
- const char *end,
- const char **nextPtr)
-{
- const char *next = s;
- int tok;
-
- tok = XmlPrologTok(encoding, s, end, &next);
- if (tok <= 0) {
- if (!ps_finalBuffer && tok != XML_TOK_INVALID) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- switch (tok) {
- case XML_TOK_INVALID:
- return XML_ERROR_INVALID_TOKEN;
- case XML_TOK_PARTIAL:
- return XML_ERROR_UNCLOSED_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- return XML_ERROR_PARTIAL_CHAR;
- case XML_TOK_NONE: /* start == end */
- default:
- break;
- }
- }
- /* This would cause the next stage, i.e. doProlog to be passed XML_TOK_BOM.
- However, when parsing an external subset, doProlog will not accept a BOM
- as valid, and report a syntax error, so we have to skip the BOM
- */
- else if (tok == XML_TOK_BOM) {
- s = next;
- tok = XmlPrologTok(encoding, s, end, &next);
- }
-
- processor = prologProcessor;
- return doProlog(parser, encoding, s, end, tok, next,
- nextPtr, (XML_Bool)!ps_finalBuffer);
-}
-
-static enum XML_Error PTRCALL
-entityValueProcessor(XML_Parser parser,
- const char *s,
- const char *end,
- const char **nextPtr)
-{
- const char *start = s;
- const char *next = s;
- const ENCODING *enc = encoding;
- int tok;
-
- for (;;) {
- tok = XmlPrologTok(enc, start, end, &next);
- if (tok <= 0) {
- if (!ps_finalBuffer && tok != XML_TOK_INVALID) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- switch (tok) {
- case XML_TOK_INVALID:
- return XML_ERROR_INVALID_TOKEN;
- case XML_TOK_PARTIAL:
- return XML_ERROR_UNCLOSED_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- return XML_ERROR_PARTIAL_CHAR;
- case XML_TOK_NONE: /* start == end */
- default:
- break;
- }
- /* found end of entity value - can store it now */
- return storeEntityValue(parser, enc, s, end);
- }
- start = next;
- }
-}
-
-#endif /* XML_DTD */
-
-static enum XML_Error PTRCALL
-prologProcessor(XML_Parser parser,
- const char *s,
- const char *end,
- const char **nextPtr)
-{
- const char *next = s;
- int tok = XmlPrologTok(encoding, s, end, &next);
- return doProlog(parser, encoding, s, end, tok, next,
- nextPtr, (XML_Bool)!ps_finalBuffer);
-}
-
-static enum XML_Error
-doProlog(XML_Parser parser,
- const ENCODING *enc,
- const char *s,
- const char *end,
- int tok,
- const char *next,
- const char **nextPtr,
- XML_Bool haveMore)
-{
-#ifdef XML_DTD
- static const XML_Char externalSubsetName[] = { ASCII_HASH , '\0' };
-#endif /* XML_DTD */
- static const XML_Char atypeCDATA[] =
- { ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' };
- static const XML_Char atypeID[] = { ASCII_I, ASCII_D, '\0' };
- static const XML_Char atypeIDREF[] =
- { ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' };
- static const XML_Char atypeIDREFS[] =
- { ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' };
- static const XML_Char atypeENTITY[] =
- { ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_Y, '\0' };
- static const XML_Char atypeENTITIES[] = { ASCII_E, ASCII_N,
- ASCII_T, ASCII_I, ASCII_T, ASCII_I, ASCII_E, ASCII_S, '\0' };
- static const XML_Char atypeNMTOKEN[] = {
- ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0' };
- static const XML_Char atypeNMTOKENS[] = { ASCII_N, ASCII_M, ASCII_T,
- ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, '\0' };
- static const XML_Char notationPrefix[] = { ASCII_N, ASCII_O, ASCII_T,
- ASCII_A, ASCII_T, ASCII_I, ASCII_O, ASCII_N, ASCII_LPAREN, '\0' };
- static const XML_Char enumValueSep[] = { ASCII_PIPE, '\0' };
- static const XML_Char enumValueStart[] = { ASCII_LPAREN, '\0' };
-
- /* save one level of indirection */
- DTD * const dtd = _dtd;
-
- const char **eventPP;
- const char **eventEndPP;
- enum XML_Content_Quant quant;
-
- if (enc == encoding) {
- eventPP = &eventPtr;
- eventEndPP = &eventEndPtr;
- }
- else {
- eventPP = &(openInternalEntities->internalEventPtr);
- eventEndPP = &(openInternalEntities->internalEventEndPtr);
- }
-
- for (;;) {
- int role;
- XML_Bool handleDefault = XML_TRUE;
- *eventPP = s;
- *eventEndPP = next;
- if (tok <= 0) {
- if (haveMore && tok != XML_TOK_INVALID) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- switch (tok) {
- case XML_TOK_INVALID:
- *eventPP = next;
- return XML_ERROR_INVALID_TOKEN;
- case XML_TOK_PARTIAL:
- return XML_ERROR_UNCLOSED_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- return XML_ERROR_PARTIAL_CHAR;
- case XML_TOK_NONE:
-#ifdef XML_DTD
- /* for internal PE NOT referenced between declarations */
- if (enc != encoding && !openInternalEntities->betweenDecl) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- /* WFC: PE Between Declarations - must check that PE contains
- complete markup, not only for external PEs, but also for
- internal PEs if the reference occurs between declarations.
- */
- if (isParamEntity || enc != encoding) {
- if (XmlTokenRole(&prologState, XML_TOK_NONE, end, end, enc)
- == XML_ROLE_ERROR)
- return XML_ERROR_INCOMPLETE_PE;
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
-#endif /* XML_DTD */
- return XML_ERROR_NO_ELEMENTS;
- default:
- tok = -tok;
- next = end;
- break;
- }
- }
- role = XmlTokenRole(&prologState, tok, s, next, enc);
- switch (role) {
- case XML_ROLE_XML_DECL:
- {
- enum XML_Error result = processXmlDecl(parser, 0, s, next);
- if (result != XML_ERROR_NONE)
- return result;
- enc = encoding;
- handleDefault = XML_FALSE;
- }
- break;
- case XML_ROLE_DOCTYPE_NAME:
- if (startDoctypeDeclHandler) {
- doctypeName = poolStoreString(&tempPool, enc, s, next);
- if (!doctypeName)
- return XML_ERROR_NO_MEMORY;
- poolFinish(&tempPool);
- doctypePubid = NULL;
- handleDefault = XML_FALSE;
- }
- doctypeSysid = NULL; /* always initialize to NULL */
- break;
- case XML_ROLE_DOCTYPE_INTERNAL_SUBSET:
- if (startDoctypeDeclHandler) {
- startDoctypeDeclHandler(handlerArg, doctypeName, doctypeSysid,
- doctypePubid, 1);
- doctypeName = NULL;
- poolClear(&tempPool);
- handleDefault = XML_FALSE;
- }
- break;
-#ifdef XML_DTD
- case XML_ROLE_TEXT_DECL:
- {
- enum XML_Error result = processXmlDecl(parser, 1, s, next);
- if (result != XML_ERROR_NONE)
- return result;
- enc = encoding;
- handleDefault = XML_FALSE;
- }
- break;
-#endif /* XML_DTD */
- case XML_ROLE_DOCTYPE_PUBLIC_ID:
-#ifdef XML_DTD
- useForeignDTD = XML_FALSE;
- declEntity = (ENTITY *)lookup(&dtd->paramEntities,
- externalSubsetName,
- sizeof(ENTITY));
- if (!declEntity)
- return XML_ERROR_NO_MEMORY;
-#endif /* XML_DTD */
- dtd->hasParamEntityRefs = XML_TRUE;
- if (startDoctypeDeclHandler) {
- if (!XmlIsPublicId(enc, s, next, eventPP))
- return XML_ERROR_PUBLICID;
- doctypePubid = poolStoreString(&tempPool, enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (!doctypePubid)
- return XML_ERROR_NO_MEMORY;
- normalizePublicId((XML_Char *)doctypePubid);
- poolFinish(&tempPool);
- handleDefault = XML_FALSE;
- goto alreadyChecked;
- }
- /* fall through */
- case XML_ROLE_ENTITY_PUBLIC_ID:
- if (!XmlIsPublicId(enc, s, next, eventPP))
- return XML_ERROR_PUBLICID;
- alreadyChecked:
- if (dtd->keepProcessing && declEntity) {
- XML_Char *tem = poolStoreString(&dtd->pool,
- enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (!tem)
- return XML_ERROR_NO_MEMORY;
- normalizePublicId(tem);
- declEntity->publicId = tem;
- poolFinish(&dtd->pool);
- if (entityDeclHandler)
- handleDefault = XML_FALSE;
- }
- break;
- case XML_ROLE_DOCTYPE_CLOSE:
- if (doctypeName) {
- startDoctypeDeclHandler(handlerArg, doctypeName,
- doctypeSysid, doctypePubid, 0);
- poolClear(&tempPool);
- handleDefault = XML_FALSE;
- }
- /* doctypeSysid will be non-NULL in the case of a previous
- XML_ROLE_DOCTYPE_SYSTEM_ID, even if startDoctypeDeclHandler
- was not set, indicating an external subset
- */
-#ifdef XML_DTD
- if (doctypeSysid || useForeignDTD) {
- XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
- dtd->hasParamEntityRefs = XML_TRUE;
- if (paramEntityParsing && externalEntityRefHandler) {
- ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities,
- externalSubsetName,
- sizeof(ENTITY));
- if (!entity)
- return XML_ERROR_NO_MEMORY;
- if (useForeignDTD)
- entity->base = curBase;
- dtd->paramEntityRead = XML_FALSE;
- if (!externalEntityRefHandler(externalEntityRefHandlerArg,
- 0,
- entity->base,
- entity->systemId,
- entity->publicId))
- return XML_ERROR_EXTERNAL_ENTITY_HANDLING;
- if (dtd->paramEntityRead) {
- if (!dtd->standalone &&
- notStandaloneHandler &&
- !notStandaloneHandler(handlerArg))
- return XML_ERROR_NOT_STANDALONE;
- }
- /* if we didn't read the foreign DTD then this means that there
- is no external subset and we must reset dtd->hasParamEntityRefs
- */
- else if (!doctypeSysid)
- dtd->hasParamEntityRefs = hadParamEntityRefs;
- /* end of DTD - no need to update dtd->keepProcessing */
- }
- useForeignDTD = XML_FALSE;
- }
-#endif /* XML_DTD */
- if (endDoctypeDeclHandler) {
- endDoctypeDeclHandler(handlerArg);
- handleDefault = XML_FALSE;
- }
- break;
- case XML_ROLE_INSTANCE_START:
-#ifdef XML_DTD
- /* if there is no DOCTYPE declaration then now is the
- last chance to read the foreign DTD
- */
- if (useForeignDTD) {
- XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
- dtd->hasParamEntityRefs = XML_TRUE;
- if (paramEntityParsing && externalEntityRefHandler) {
- ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities,
- externalSubsetName,
- sizeof(ENTITY));
- if (!entity)
- return XML_ERROR_NO_MEMORY;
- entity->base = curBase;
- dtd->paramEntityRead = XML_FALSE;
- if (!externalEntityRefHandler(externalEntityRefHandlerArg,
- 0,
- entity->base,
- entity->systemId,
- entity->publicId))
- return XML_ERROR_EXTERNAL_ENTITY_HANDLING;
- if (dtd->paramEntityRead) {
- if (!dtd->standalone &&
- notStandaloneHandler &&
- !notStandaloneHandler(handlerArg))
- return XML_ERROR_NOT_STANDALONE;
- }
- /* if we didn't read the foreign DTD then this means that there
- is no external subset and we must reset dtd->hasParamEntityRefs
- */
- else
- dtd->hasParamEntityRefs = hadParamEntityRefs;
- /* end of DTD - no need to update dtd->keepProcessing */
- }
- }
-#endif /* XML_DTD */
- processor = contentProcessor;
- return contentProcessor(parser, s, end, nextPtr);
- case XML_ROLE_ATTLIST_ELEMENT_NAME:
- declElementType = getElementType(parser, enc, s, next);
- if (!declElementType)
- return XML_ERROR_NO_MEMORY;
- goto checkAttListDeclHandler;
- case XML_ROLE_ATTRIBUTE_NAME:
- declAttributeId = getAttributeId(parser, enc, s, next);
- if (!declAttributeId)
- return XML_ERROR_NO_MEMORY;
- declAttributeIsCdata = XML_FALSE;
- declAttributeType = NULL;
- declAttributeIsId = XML_FALSE;
- goto checkAttListDeclHandler;
- case XML_ROLE_ATTRIBUTE_TYPE_CDATA:
- declAttributeIsCdata = XML_TRUE;
- declAttributeType = atypeCDATA;
- goto checkAttListDeclHandler;
- case XML_ROLE_ATTRIBUTE_TYPE_ID:
- declAttributeIsId = XML_TRUE;
- declAttributeType = atypeID;
- goto checkAttListDeclHandler;
- case XML_ROLE_ATTRIBUTE_TYPE_IDREF:
- declAttributeType = atypeIDREF;
- goto checkAttListDeclHandler;
- case XML_ROLE_ATTRIBUTE_TYPE_IDREFS:
- declAttributeType = atypeIDREFS;
- goto checkAttListDeclHandler;
- case XML_ROLE_ATTRIBUTE_TYPE_ENTITY:
- declAttributeType = atypeENTITY;
- goto checkAttListDeclHandler;
- case XML_ROLE_ATTRIBUTE_TYPE_ENTITIES:
- declAttributeType = atypeENTITIES;
- goto checkAttListDeclHandler;
- case XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN:
- declAttributeType = atypeNMTOKEN;
- goto checkAttListDeclHandler;
- case XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS:
- declAttributeType = atypeNMTOKENS;
- checkAttListDeclHandler:
- if (dtd->keepProcessing && attlistDeclHandler)
- handleDefault = XML_FALSE;
- break;
- case XML_ROLE_ATTRIBUTE_ENUM_VALUE:
- case XML_ROLE_ATTRIBUTE_NOTATION_VALUE:
- if (dtd->keepProcessing && attlistDeclHandler) {
- const XML_Char *prefix;
- if (declAttributeType) {
- prefix = enumValueSep;
- }
- else {
- prefix = (role == XML_ROLE_ATTRIBUTE_NOTATION_VALUE
- ? notationPrefix
- : enumValueStart);
- }
- if (!poolAppendString(&tempPool, prefix))
- return XML_ERROR_NO_MEMORY;
- if (!poolAppend(&tempPool, enc, s, next))
- return XML_ERROR_NO_MEMORY;
- declAttributeType = tempPool.start;
- handleDefault = XML_FALSE;
- }
- break;
- case XML_ROLE_IMPLIED_ATTRIBUTE_VALUE:
- case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE:
- if (dtd->keepProcessing) {
- if (!defineAttribute(declElementType, declAttributeId,
- declAttributeIsCdata, declAttributeIsId,
- 0, parser))
- return XML_ERROR_NO_MEMORY;
- if (attlistDeclHandler && declAttributeType) {
- if (*declAttributeType == XML_T(ASCII_LPAREN)
- || (*declAttributeType == XML_T(ASCII_N)
- && declAttributeType[1] == XML_T(ASCII_O))) {
- /* Enumerated or Notation type */
- if (!poolAppendChar(&tempPool, XML_T(ASCII_RPAREN))
- || !poolAppendChar(&tempPool, XML_T('\0')))
- return XML_ERROR_NO_MEMORY;
- declAttributeType = tempPool.start;
- poolFinish(&tempPool);
- }
- *eventEndPP = s;
- attlistDeclHandler(handlerArg, declElementType->name,
- declAttributeId->name, declAttributeType,
- 0, role == XML_ROLE_REQUIRED_ATTRIBUTE_VALUE);
- poolClear(&tempPool);
- handleDefault = XML_FALSE;
- }
- }
- break;
- case XML_ROLE_DEFAULT_ATTRIBUTE_VALUE:
- case XML_ROLE_FIXED_ATTRIBUTE_VALUE:
- if (dtd->keepProcessing) {
- const XML_Char *attVal;
- enum XML_Error result =
- storeAttributeValue(parser, enc, declAttributeIsCdata,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar,
- &dtd->pool);
- if (result)
- return result;
- attVal = poolStart(&dtd->pool);
- poolFinish(&dtd->pool);
- /* ID attributes aren't allowed to have a default */
- if (!defineAttribute(declElementType, declAttributeId,
- declAttributeIsCdata, XML_FALSE, attVal, parser))
- return XML_ERROR_NO_MEMORY;
- if (attlistDeclHandler && declAttributeType) {
- if (*declAttributeType == XML_T(ASCII_LPAREN)
- || (*declAttributeType == XML_T(ASCII_N)
- && declAttributeType[1] == XML_T(ASCII_O))) {
- /* Enumerated or Notation type */
- if (!poolAppendChar(&tempPool, XML_T(ASCII_RPAREN))
- || !poolAppendChar(&tempPool, XML_T('\0')))
- return XML_ERROR_NO_MEMORY;
- declAttributeType = tempPool.start;
- poolFinish(&tempPool);
- }
- *eventEndPP = s;
- attlistDeclHandler(handlerArg, declElementType->name,
- declAttributeId->name, declAttributeType,
- attVal,
- role == XML_ROLE_FIXED_ATTRIBUTE_VALUE);
- poolClear(&tempPool);
- handleDefault = XML_FALSE;
- }
- }
- break;
- case XML_ROLE_ENTITY_VALUE:
- if (dtd->keepProcessing) {
- enum XML_Error result = storeEntityValue(parser, enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (declEntity) {
- declEntity->textPtr = poolStart(&dtd->entityValuePool);
- declEntity->textLen = (int)(poolLength(&dtd->entityValuePool));
- poolFinish(&dtd->entityValuePool);
- if (entityDeclHandler) {
- *eventEndPP = s;
- entityDeclHandler(handlerArg,
- declEntity->name,
- declEntity->is_param,
- declEntity->textPtr,
- declEntity->textLen,
- curBase, 0, 0, 0);
- handleDefault = XML_FALSE;
- }
- }
- else
- poolDiscard(&dtd->entityValuePool);
- if (result != XML_ERROR_NONE)
- return result;
- }
- break;
- case XML_ROLE_DOCTYPE_SYSTEM_ID:
-#ifdef XML_DTD
- useForeignDTD = XML_FALSE;
-#endif /* XML_DTD */
- dtd->hasParamEntityRefs = XML_TRUE;
- if (startDoctypeDeclHandler) {
- doctypeSysid = poolStoreString(&tempPool, enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (doctypeSysid == NULL)
- return XML_ERROR_NO_MEMORY;
- poolFinish(&tempPool);
- handleDefault = XML_FALSE;
- }
-#ifdef XML_DTD
- else
- /* use externalSubsetName to make doctypeSysid non-NULL
- for the case where no startDoctypeDeclHandler is set */
- doctypeSysid = externalSubsetName;
-#endif /* XML_DTD */
- if (!dtd->standalone
-#ifdef XML_DTD
- && !paramEntityParsing
-#endif /* XML_DTD */
- && notStandaloneHandler
- && !notStandaloneHandler(handlerArg))
- return XML_ERROR_NOT_STANDALONE;
-#ifndef XML_DTD
- break;
-#else /* XML_DTD */
- if (!declEntity) {
- declEntity = (ENTITY *)lookup(&dtd->paramEntities,
- externalSubsetName,
- sizeof(ENTITY));
- if (!declEntity)
- return XML_ERROR_NO_MEMORY;
- declEntity->publicId = NULL;
- }
- /* fall through */
-#endif /* XML_DTD */
- case XML_ROLE_ENTITY_SYSTEM_ID:
- if (dtd->keepProcessing && declEntity) {
- declEntity->systemId = poolStoreString(&dtd->pool, enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (!declEntity->systemId)
- return XML_ERROR_NO_MEMORY;
- declEntity->base = curBase;
- poolFinish(&dtd->pool);
- if (entityDeclHandler)
- handleDefault = XML_FALSE;
- }
- break;
- case XML_ROLE_ENTITY_COMPLETE:
- if (dtd->keepProcessing && declEntity && entityDeclHandler) {
- *eventEndPP = s;
- entityDeclHandler(handlerArg,
- declEntity->name,
- declEntity->is_param,
- 0,0,
- declEntity->base,
- declEntity->systemId,
- declEntity->publicId,
- 0);
- handleDefault = XML_FALSE;
- }
- break;
- case XML_ROLE_ENTITY_NOTATION_NAME:
- if (dtd->keepProcessing && declEntity) {
- declEntity->notation = poolStoreString(&dtd->pool, enc, s, next);
- if (!declEntity->notation)
- return XML_ERROR_NO_MEMORY;
- poolFinish(&dtd->pool);
- if (unparsedEntityDeclHandler) {
- *eventEndPP = s;
- unparsedEntityDeclHandler(handlerArg,
- declEntity->name,
- declEntity->base,
- declEntity->systemId,
- declEntity->publicId,
- declEntity->notation);
- handleDefault = XML_FALSE;
- }
- else if (entityDeclHandler) {
- *eventEndPP = s;
- entityDeclHandler(handlerArg,
- declEntity->name,
- 0,0,0,
- declEntity->base,
- declEntity->systemId,
- declEntity->publicId,
- declEntity->notation);
- handleDefault = XML_FALSE;
- }
- }
- break;
- case XML_ROLE_GENERAL_ENTITY_NAME:
- {
- if (XmlPredefinedEntityName(enc, s, next)) {
- declEntity = NULL;
- break;
- }
- if (dtd->keepProcessing) {
- const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
- if (!name)
- return XML_ERROR_NO_MEMORY;
- declEntity = (ENTITY *)lookup(&dtd->generalEntities, name,
- sizeof(ENTITY));
- if (!declEntity)
- return XML_ERROR_NO_MEMORY;
- if (declEntity->name != name) {
- poolDiscard(&dtd->pool);
- declEntity = NULL;
- }
- else {
- poolFinish(&dtd->pool);
- declEntity->publicId = NULL;
- declEntity->is_param = XML_FALSE;
- /* if we have a parent parser or are reading an internal parameter
- entity, then the entity declaration is not considered "internal"
- */
- declEntity->is_internal = !(parentParser || openInternalEntities);
- if (entityDeclHandler)
- handleDefault = XML_FALSE;
- }
- }
- else {
- poolDiscard(&dtd->pool);
- declEntity = NULL;
- }
- }
- break;
- case XML_ROLE_PARAM_ENTITY_NAME:
-#ifdef XML_DTD
- if (dtd->keepProcessing) {
- const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
- if (!name)
- return XML_ERROR_NO_MEMORY;
- declEntity = (ENTITY *)lookup(&dtd->paramEntities,
- name, sizeof(ENTITY));
- if (!declEntity)
- return XML_ERROR_NO_MEMORY;
- if (declEntity->name != name) {
- poolDiscard(&dtd->pool);
- declEntity = NULL;
- }
- else {
- poolFinish(&dtd->pool);
- declEntity->publicId = NULL;
- declEntity->is_param = XML_TRUE;
- /* if we have a parent parser or are reading an internal parameter
- entity, then the entity declaration is not considered "internal"
- */
- declEntity->is_internal = !(parentParser || openInternalEntities);
- if (entityDeclHandler)
- handleDefault = XML_FALSE;
- }
- }
- else {
- poolDiscard(&dtd->pool);
- declEntity = NULL;
- }
-#else /* not XML_DTD */
- declEntity = NULL;
-#endif /* XML_DTD */
- break;
- case XML_ROLE_NOTATION_NAME:
- declNotationPublicId = NULL;
- declNotationName = NULL;
- if (notationDeclHandler) {
- declNotationName = poolStoreString(&tempPool, enc, s, next);
- if (!declNotationName)
- return XML_ERROR_NO_MEMORY;
- poolFinish(&tempPool);
- handleDefault = XML_FALSE;
- }
- break;
- case XML_ROLE_NOTATION_PUBLIC_ID:
- if (!XmlIsPublicId(enc, s, next, eventPP))
- return XML_ERROR_PUBLICID;
- if (declNotationName) { /* means notationDeclHandler != NULL */
- XML_Char *tem = poolStoreString(&tempPool,
- enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (!tem)
- return XML_ERROR_NO_MEMORY;
- normalizePublicId(tem);
- declNotationPublicId = tem;
- poolFinish(&tempPool);
- handleDefault = XML_FALSE;
- }
- break;
- case XML_ROLE_NOTATION_SYSTEM_ID:
- if (declNotationName && notationDeclHandler) {
- const XML_Char *systemId
- = poolStoreString(&tempPool, enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (!systemId)
- return XML_ERROR_NO_MEMORY;
- *eventEndPP = s;
- notationDeclHandler(handlerArg,
- declNotationName,
- curBase,
- systemId,
- declNotationPublicId);
- handleDefault = XML_FALSE;
- }
- poolClear(&tempPool);
- break;
- case XML_ROLE_NOTATION_NO_SYSTEM_ID:
- if (declNotationPublicId && notationDeclHandler) {
- *eventEndPP = s;
- notationDeclHandler(handlerArg,
- declNotationName,
- curBase,
- 0,
- declNotationPublicId);
- handleDefault = XML_FALSE;
- }
- poolClear(&tempPool);
- break;
- case XML_ROLE_ERROR:
- switch (tok) {
- case XML_TOK_PARAM_ENTITY_REF:
- /* PE references in internal subset are
- not allowed within declarations. */
- return XML_ERROR_PARAM_ENTITY_REF;
- case XML_TOK_XML_DECL:
- return XML_ERROR_MISPLACED_XML_PI;
- default:
- return XML_ERROR_SYNTAX;
- }
-#ifdef XML_DTD
- case XML_ROLE_IGNORE_SECT:
- {
- enum XML_Error result;
- if (defaultHandler)
- reportDefault(parser, enc, s, next);
- handleDefault = XML_FALSE;
- result = doIgnoreSection(parser, enc, &next, end, nextPtr, haveMore);
- if (result != XML_ERROR_NONE)
- return result;
- else if (!next) {
- processor = ignoreSectionProcessor;
- return result;
- }
- }
- break;
-#endif /* XML_DTD */
- case XML_ROLE_GROUP_OPEN:
- if (prologState.level >= groupSize) {
- if (groupSize) {
- char *temp = (char *)REALLOC(groupConnector, groupSize *= 2);
- if (temp == NULL)
- return XML_ERROR_NO_MEMORY;
- groupConnector = temp;
- if (dtd->scaffIndex) {
- int *temp = (int *)REALLOC(dtd->scaffIndex,
- groupSize * sizeof(int));
- if (temp == NULL)
- return XML_ERROR_NO_MEMORY;
- dtd->scaffIndex = temp;
- }
- }
- else {
- groupConnector = (char *)MALLOC(groupSize = 32);
- if (!groupConnector)
- return XML_ERROR_NO_MEMORY;
- }
- }
- groupConnector[prologState.level] = 0;
- if (dtd->in_eldecl) {
- int myindex = nextScaffoldPart(parser);
- if (myindex < 0)
- return XML_ERROR_NO_MEMORY;
- dtd->scaffIndex[dtd->scaffLevel] = myindex;
- dtd->scaffLevel++;
- dtd->scaffold[myindex].type = XML_CTYPE_SEQ;
- if (elementDeclHandler)
- handleDefault = XML_FALSE;
- }
- break;
- case XML_ROLE_GROUP_SEQUENCE:
- if (groupConnector[prologState.level] == ASCII_PIPE)
- return XML_ERROR_SYNTAX;
- groupConnector[prologState.level] = ASCII_COMMA;
- if (dtd->in_eldecl && elementDeclHandler)
- handleDefault = XML_FALSE;
- break;
- case XML_ROLE_GROUP_CHOICE:
- if (groupConnector[prologState.level] == ASCII_COMMA)
- return XML_ERROR_SYNTAX;
- if (dtd->in_eldecl
- && !groupConnector[prologState.level]
- && (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
- != XML_CTYPE_MIXED)
- ) {
- dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
- = XML_CTYPE_CHOICE;
- if (elementDeclHandler)
- handleDefault = XML_FALSE;
- }
- groupConnector[prologState.level] = ASCII_PIPE;
- break;
- case XML_ROLE_PARAM_ENTITY_REF:
-#ifdef XML_DTD
- case XML_ROLE_INNER_PARAM_ENTITY_REF:
- dtd->hasParamEntityRefs = XML_TRUE;
- if (!paramEntityParsing)
- dtd->keepProcessing = dtd->standalone;
- else {
- const XML_Char *name;
- ENTITY *entity;
- name = poolStoreString(&dtd->pool, enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (!name)
- return XML_ERROR_NO_MEMORY;
- entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0);
- poolDiscard(&dtd->pool);
- /* first, determine if a check for an existing declaration is needed;
- if yes, check that the entity exists, and that it is internal,
- otherwise call the skipped entity handler
- */
- if (prologState.documentEntity &&
- (dtd->standalone
- ? !openInternalEntities
- : !dtd->hasParamEntityRefs)) {
- if (!entity)
- return XML_ERROR_UNDEFINED_ENTITY;
- else if (!entity->is_internal)
- return XML_ERROR_ENTITY_DECLARED_IN_PE;
- }
- else if (!entity) {
- dtd->keepProcessing = dtd->standalone;
- /* cannot report skipped entities in declarations */
- if ((role == XML_ROLE_PARAM_ENTITY_REF) && skippedEntityHandler) {
- skippedEntityHandler(handlerArg, name, 1);
- handleDefault = XML_FALSE;
- }
- break;
- }
- if (entity->open)
- return XML_ERROR_RECURSIVE_ENTITY_REF;
- if (entity->textPtr) {
- enum XML_Error result;
- XML_Bool betweenDecl =
- (role == XML_ROLE_PARAM_ENTITY_REF ? XML_TRUE : XML_FALSE);
- result = processInternalEntity(parser, entity, betweenDecl);
- if (result != XML_ERROR_NONE)
- return result;
- handleDefault = XML_FALSE;
- break;
- }
- if (externalEntityRefHandler) {
- dtd->paramEntityRead = XML_FALSE;
- entity->open = XML_TRUE;
- if (!externalEntityRefHandler(externalEntityRefHandlerArg,
- 0,
- entity->base,
- entity->systemId,
- entity->publicId)) {
- entity->open = XML_FALSE;
- return XML_ERROR_EXTERNAL_ENTITY_HANDLING;
- }
- entity->open = XML_FALSE;
- handleDefault = XML_FALSE;
- if (!dtd->paramEntityRead) {
- dtd->keepProcessing = dtd->standalone;
- break;
- }
- }
- else {
- dtd->keepProcessing = dtd->standalone;
- break;
- }
- }
-#endif /* XML_DTD */
- if (!dtd->standalone &&
- notStandaloneHandler &&
- !notStandaloneHandler(handlerArg))
- return XML_ERROR_NOT_STANDALONE;
- break;
-
- /* Element declaration stuff */
-
- case XML_ROLE_ELEMENT_NAME:
- if (elementDeclHandler) {
- declElementType = getElementType(parser, enc, s, next);
- if (!declElementType)
- return XML_ERROR_NO_MEMORY;
- dtd->scaffLevel = 0;
- dtd->scaffCount = 0;
- dtd->in_eldecl = XML_TRUE;
- handleDefault = XML_FALSE;
- }
- break;
-
- case XML_ROLE_CONTENT_ANY:
- case XML_ROLE_CONTENT_EMPTY:
- if (dtd->in_eldecl) {
- if (elementDeclHandler) {
- XML_Content * content = (XML_Content *) MALLOC(sizeof(XML_Content));
- if (!content)
- return XML_ERROR_NO_MEMORY;
- content->quant = XML_CQUANT_NONE;
- content->name = NULL;
- content->numchildren = 0;
- content->children = NULL;
- content->type = ((role == XML_ROLE_CONTENT_ANY) ?
- XML_CTYPE_ANY :
- XML_CTYPE_EMPTY);
- *eventEndPP = s;
- elementDeclHandler(handlerArg, declElementType->name, content);
- handleDefault = XML_FALSE;
- }
- dtd->in_eldecl = XML_FALSE;
- }
- break;
-
- case XML_ROLE_CONTENT_PCDATA:
- if (dtd->in_eldecl) {
- dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
- = XML_CTYPE_MIXED;
- if (elementDeclHandler)
- handleDefault = XML_FALSE;
- }
- break;
-
- case XML_ROLE_CONTENT_ELEMENT:
- quant = XML_CQUANT_NONE;
- goto elementContent;
- case XML_ROLE_CONTENT_ELEMENT_OPT:
- quant = XML_CQUANT_OPT;
- goto elementContent;
- case XML_ROLE_CONTENT_ELEMENT_REP:
- quant = XML_CQUANT_REP;
- goto elementContent;
- case XML_ROLE_CONTENT_ELEMENT_PLUS:
- quant = XML_CQUANT_PLUS;
- elementContent:
- if (dtd->in_eldecl) {
- ELEMENT_TYPE *el;
- const XML_Char *name;
- int nameLen;
- const char *nxt = (quant == XML_CQUANT_NONE
- ? next
- : next - enc->minBytesPerChar);
- int myindex = nextScaffoldPart(parser);
- if (myindex < 0)
- return XML_ERROR_NO_MEMORY;
- dtd->scaffold[myindex].type = XML_CTYPE_NAME;
- dtd->scaffold[myindex].quant = quant;
- el = getElementType(parser, enc, s, nxt);
- if (!el)
- return XML_ERROR_NO_MEMORY;
- name = el->name;
- dtd->scaffold[myindex].name = name;
- nameLen = 0;
- for (; name[nameLen++]; );
- dtd->contentStringLen += nameLen;
- if (elementDeclHandler)
- handleDefault = XML_FALSE;
- }
- break;
-
- case XML_ROLE_GROUP_CLOSE:
- quant = XML_CQUANT_NONE;
- goto closeGroup;
- case XML_ROLE_GROUP_CLOSE_OPT:
- quant = XML_CQUANT_OPT;
- goto closeGroup;
- case XML_ROLE_GROUP_CLOSE_REP:
- quant = XML_CQUANT_REP;
- goto closeGroup;
- case XML_ROLE_GROUP_CLOSE_PLUS:
- quant = XML_CQUANT_PLUS;
- closeGroup:
- if (dtd->in_eldecl) {
- if (elementDeclHandler)
- handleDefault = XML_FALSE;
- dtd->scaffLevel--;
- dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant;
- if (dtd->scaffLevel == 0) {
- if (!handleDefault) {
- XML_Content *model = build_model(parser);
- if (!model)
- return XML_ERROR_NO_MEMORY;
- *eventEndPP = s;
- elementDeclHandler(handlerArg, declElementType->name, model);
- }
- dtd->in_eldecl = XML_FALSE;
- dtd->contentStringLen = 0;
- }
- }
- break;
- /* End element declaration stuff */
-
- case XML_ROLE_PI:
- if (!reportProcessingInstruction(parser, enc, s, next))
- return XML_ERROR_NO_MEMORY;
- handleDefault = XML_FALSE;
- break;
- case XML_ROLE_COMMENT:
- if (!reportComment(parser, enc, s, next))
- return XML_ERROR_NO_MEMORY;
- handleDefault = XML_FALSE;
- break;
- case XML_ROLE_NONE:
- switch (tok) {
- case XML_TOK_BOM:
- handleDefault = XML_FALSE;
- break;
- }
- break;
- case XML_ROLE_DOCTYPE_NONE:
- if (startDoctypeDeclHandler)
- handleDefault = XML_FALSE;
- break;
- case XML_ROLE_ENTITY_NONE:
- if (dtd->keepProcessing && entityDeclHandler)
- handleDefault = XML_FALSE;
- break;
- case XML_ROLE_NOTATION_NONE:
- if (notationDeclHandler)
- handleDefault = XML_FALSE;
- break;
- case XML_ROLE_ATTLIST_NONE:
- if (dtd->keepProcessing && attlistDeclHandler)
- handleDefault = XML_FALSE;
- break;
- case XML_ROLE_ELEMENT_NONE:
- if (elementDeclHandler)
- handleDefault = XML_FALSE;
- break;
- } /* end of big switch */
-
- if (handleDefault && defaultHandler)
- reportDefault(parser, enc, s, next);
-
- switch (ps_parsing) {
- case XML_SUSPENDED:
- *nextPtr = next;
- return XML_ERROR_NONE;
- case XML_FINISHED:
- return XML_ERROR_ABORTED;
- default:
- s = next;
- tok = XmlPrologTok(enc, s, end, &next);
- }
- }
- /* not reached */
-}
-
-static enum XML_Error PTRCALL
-epilogProcessor(XML_Parser parser,
- const char *s,
- const char *end,
- const char **nextPtr)
-{
- processor = epilogProcessor;
- eventPtr = s;
- for (;;) {
- const char *next = NULL;
- int tok = XmlPrologTok(encoding, s, end, &next);
- eventEndPtr = next;
- switch (tok) {
- /* report partial linebreak - it might be the last token */
- case -XML_TOK_PROLOG_S:
- if (defaultHandler) {
- reportDefault(parser, encoding, s, next);
- if (ps_parsing == XML_FINISHED)
- return XML_ERROR_ABORTED;
- }
- *nextPtr = next;
- return XML_ERROR_NONE;
- case XML_TOK_NONE:
- *nextPtr = s;
- return XML_ERROR_NONE;
- case XML_TOK_PROLOG_S:
- if (defaultHandler)
- reportDefault(parser, encoding, s, next);
- break;
- case XML_TOK_PI:
- if (!reportProcessingInstruction(parser, encoding, s, next))
- return XML_ERROR_NO_MEMORY;
- break;
- case XML_TOK_COMMENT:
- if (!reportComment(parser, encoding, s, next))
- return XML_ERROR_NO_MEMORY;
- break;
- case XML_TOK_INVALID:
- eventPtr = next;
- return XML_ERROR_INVALID_TOKEN;
- case XML_TOK_PARTIAL:
- if (!ps_finalBuffer) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_UNCLOSED_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- if (!ps_finalBuffer) {
- *nextPtr = s;
- return XML_ERROR_NONE;
- }
- return XML_ERROR_PARTIAL_CHAR;
- default:
- return XML_ERROR_JUNK_AFTER_DOC_ELEMENT;
- }
- eventPtr = s = next;
- switch (ps_parsing) {
- case XML_SUSPENDED:
- *nextPtr = next;
- return XML_ERROR_NONE;
- case XML_FINISHED:
- return XML_ERROR_ABORTED;
- default: ;
- }
- }
-}
-
-static enum XML_Error
-processInternalEntity(XML_Parser parser, ENTITY *entity,
- XML_Bool betweenDecl)
-{
- const char *textStart, *textEnd;
- const char *next;
- enum XML_Error result;
- OPEN_INTERNAL_ENTITY *openEntity;
-
- if (freeInternalEntities) {
- openEntity = freeInternalEntities;
- freeInternalEntities = openEntity->next;
- }
- else {
- openEntity = (OPEN_INTERNAL_ENTITY *)MALLOC(sizeof(OPEN_INTERNAL_ENTITY));
- if (!openEntity)
- return XML_ERROR_NO_MEMORY;
- }
- entity->open = XML_TRUE;
- entity->processed = 0;
- openEntity->next = openInternalEntities;
- openInternalEntities = openEntity;
- openEntity->entity = entity;
- openEntity->startTagLevel = tagLevel;
- openEntity->betweenDecl = betweenDecl;
- openEntity->internalEventPtr = NULL;
- openEntity->internalEventEndPtr = NULL;
- textStart = (char *)entity->textPtr;
- textEnd = (char *)(entity->textPtr + entity->textLen);
-
-#ifdef XML_DTD
- if (entity->is_param) {
- int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next);
- result = doProlog(parser, internalEncoding, textStart, textEnd, tok,
- next, &next, XML_FALSE);
- }
- else
-#endif /* XML_DTD */
- result = doContent(parser, tagLevel, internalEncoding, textStart,
- textEnd, &next, XML_FALSE);
-
- if (result == XML_ERROR_NONE) {
- if (textEnd != next && ps_parsing == XML_SUSPENDED) {
- entity->processed = (int)(next - textStart);
- processor = internalEntityProcessor;
- }
- else {
- entity->open = XML_FALSE;
- openInternalEntities = openEntity->next;
- /* put openEntity back in list of free instances */
- openEntity->next = freeInternalEntities;
- freeInternalEntities = openEntity;
- }
- }
- return result;
-}
-
-static enum XML_Error PTRCALL
-internalEntityProcessor(XML_Parser parser,
- const char *s,
- const char *end,
- const char **nextPtr)
-{
- ENTITY *entity;
- const char *textStart, *textEnd;
- const char *next;
- enum XML_Error result;
- OPEN_INTERNAL_ENTITY *openEntity = openInternalEntities;
- if (!openEntity)
- return XML_ERROR_UNEXPECTED_STATE;
-
- entity = openEntity->entity;
- textStart = ((char *)entity->textPtr) + entity->processed;
- textEnd = (char *)(entity->textPtr + entity->textLen);
-
-#ifdef XML_DTD
- if (entity->is_param) {
- int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next);
- result = doProlog(parser, internalEncoding, textStart, textEnd, tok,
- next, &next, XML_FALSE);
- }
- else
-#endif /* XML_DTD */
- result = doContent(parser, openEntity->startTagLevel, internalEncoding,
- textStart, textEnd, &next, XML_FALSE);
-
- if (result != XML_ERROR_NONE)
- return result;
- else if (textEnd != next && ps_parsing == XML_SUSPENDED) {
- entity->processed = (int)(next - (char *)entity->textPtr);
- return result;
- }
- else {
- entity->open = XML_FALSE;
- openInternalEntities = openEntity->next;
- /* put openEntity back in list of free instances */
- openEntity->next = freeInternalEntities;
- freeInternalEntities = openEntity;
- }
-
-#ifdef XML_DTD
- if (entity->is_param) {
- int tok;
- processor = prologProcessor;
- tok = XmlPrologTok(encoding, s, end, &next);
- return doProlog(parser, encoding, s, end, tok, next, nextPtr,
- (XML_Bool)!ps_finalBuffer);
- }
- else
-#endif /* XML_DTD */
- {
- processor = contentProcessor;
- /* see externalEntityContentProcessor vs contentProcessor */
- return doContent(parser, parentParser ? 1 : 0, encoding, s, end,
- nextPtr, (XML_Bool)!ps_finalBuffer);
- }
-}
-
-static enum XML_Error PTRCALL
-errorProcessor(XML_Parser parser,
- const char *s,
- const char *end,
- const char **nextPtr)
-{
- return errorCode;
-}
-
-static enum XML_Error
-storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
- const char *ptr, const char *end,
- STRING_POOL *pool)
-{
- enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr,
- end, pool);
- if (result)
- return result;
- if (!isCdata && poolLength(pool) && poolLastChar(pool) == 0x20)
- poolChop(pool);
- if (!poolAppendChar(pool, XML_T('\0')))
- return XML_ERROR_NO_MEMORY;
- return XML_ERROR_NONE;
-}
-
-static enum XML_Error
-appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
- const char *ptr, const char *end,
- STRING_POOL *pool)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- for (;;) {
- const char *next;
- int tok = XmlAttributeValueTok(enc, ptr, end, &next);
- switch (tok) {
- case XML_TOK_NONE:
- return XML_ERROR_NONE;
- case XML_TOK_INVALID:
- if (enc == encoding)
- eventPtr = next;
- return XML_ERROR_INVALID_TOKEN;
- case XML_TOK_PARTIAL:
- if (enc == encoding)
- eventPtr = ptr;
- return XML_ERROR_INVALID_TOKEN;
- case XML_TOK_CHAR_REF:
- {
- XML_Char buf[XML_ENCODE_MAX];
- int i;
- int n = XmlCharRefNumber(enc, ptr);
- if (n < 0) {
- if (enc == encoding)
- eventPtr = ptr;
- return XML_ERROR_BAD_CHAR_REF;
- }
- if (!isCdata
- && n == 0x20 /* space */
- && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20))
- break;
- n = XmlEncode(n, (ICHAR *)buf);
- if (!n) {
- if (enc == encoding)
- eventPtr = ptr;
- return XML_ERROR_BAD_CHAR_REF;
- }
- for (i = 0; i < n; i++) {
- if (!poolAppendChar(pool, buf[i]))
- return XML_ERROR_NO_MEMORY;
- }
- }
- break;
- case XML_TOK_DATA_CHARS:
- if (!poolAppend(pool, enc, ptr, next))
- return XML_ERROR_NO_MEMORY;
- break;
- case XML_TOK_TRAILING_CR:
- next = ptr + enc->minBytesPerChar;
- /* fall through */
- case XML_TOK_ATTRIBUTE_VALUE_S:
- case XML_TOK_DATA_NEWLINE:
- if (!isCdata && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20))
- break;
- if (!poolAppendChar(pool, 0x20))
- return XML_ERROR_NO_MEMORY;
- break;
- case XML_TOK_ENTITY_REF:
- {
- const XML_Char *name;
- ENTITY *entity;
- char checkEntityDecl;
- XML_Char ch = (XML_Char) XmlPredefinedEntityName(enc,
- ptr + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (ch) {
- if (!poolAppendChar(pool, ch))
- return XML_ERROR_NO_MEMORY;
- break;
- }
- name = poolStoreString(&temp2Pool, enc,
- ptr + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (!name)
- return XML_ERROR_NO_MEMORY;
- entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0);
- poolDiscard(&temp2Pool);
- /* First, determine if a check for an existing declaration is needed;
- if yes, check that the entity exists, and that it is internal.
- */
- if (pool == &dtd->pool) /* are we called from prolog? */
- checkEntityDecl =
-#ifdef XML_DTD
- prologState.documentEntity &&
-#endif /* XML_DTD */
- (dtd->standalone
- ? !openInternalEntities
- : !dtd->hasParamEntityRefs);
- else /* if (pool == &tempPool): we are called from content */
- checkEntityDecl = !dtd->hasParamEntityRefs || dtd->standalone;
- if (checkEntityDecl) {
- if (!entity)
- return XML_ERROR_UNDEFINED_ENTITY;
- else if (!entity->is_internal)
- return XML_ERROR_ENTITY_DECLARED_IN_PE;
- }
- else if (!entity) {
- /* Cannot report skipped entity here - see comments on
- skippedEntityHandler.
- if (skippedEntityHandler)
- skippedEntityHandler(handlerArg, name, 0);
- */
- /* Cannot call the default handler because this would be
- out of sync with the call to the startElementHandler.
- if ((pool == &tempPool) && defaultHandler)
- reportDefault(parser, enc, ptr, next);
- */
- break;
- }
- if (entity->open) {
- if (enc == encoding)
- eventPtr = ptr;
- return XML_ERROR_RECURSIVE_ENTITY_REF;
- }
- if (entity->notation) {
- if (enc == encoding)
- eventPtr = ptr;
- return XML_ERROR_BINARY_ENTITY_REF;
- }
- if (!entity->textPtr) {
- if (enc == encoding)
- eventPtr = ptr;
- return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF;
- }
- else {
- enum XML_Error result;
- const XML_Char *textEnd = entity->textPtr + entity->textLen;
- entity->open = XML_TRUE;
- result = appendAttributeValue(parser, internalEncoding, isCdata,
- (char *)entity->textPtr,
- (char *)textEnd, pool);
- entity->open = XML_FALSE;
- if (result)
- return result;
- }
- }
- break;
- default:
- if (enc == encoding)
- eventPtr = ptr;
- return XML_ERROR_UNEXPECTED_STATE;
- }
- ptr = next;
- }
- /* not reached */
-}
-
-static enum XML_Error
-storeEntityValue(XML_Parser parser,
- const ENCODING *enc,
- const char *entityTextPtr,
- const char *entityTextEnd)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- STRING_POOL *pool = &(dtd->entityValuePool);
- enum XML_Error result = XML_ERROR_NONE;
-#ifdef XML_DTD
- int oldInEntityValue = prologState.inEntityValue;
- prologState.inEntityValue = 1;
-#endif /* XML_DTD */
- /* never return Null for the value argument in EntityDeclHandler,
- since this would indicate an external entity; therefore we
- have to make sure that entityValuePool.start is not null */
- if (!pool->blocks) {
- if (!poolGrow(pool))
- return XML_ERROR_NO_MEMORY;
- }
-
- for (;;) {
- const char *next;
- int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next);
- switch (tok) {
- case XML_TOK_PARAM_ENTITY_REF:
-#ifdef XML_DTD
- if (isParamEntity || enc != encoding) {
- const XML_Char *name;
- ENTITY *entity;
- name = poolStoreString(&tempPool, enc,
- entityTextPtr + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (!name) {
- result = XML_ERROR_NO_MEMORY;
- goto endEntityValue;
- }
- entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0);
- poolDiscard(&tempPool);
- if (!entity) {
- /* not a well-formedness error - see XML 1.0: WFC Entity Declared */
- /* cannot report skipped entity here - see comments on
- skippedEntityHandler
- if (skippedEntityHandler)
- skippedEntityHandler(handlerArg, name, 0);
- */
- dtd->keepProcessing = dtd->standalone;
- goto endEntityValue;
- }
- if (entity->open) {
- if (enc == encoding)
- eventPtr = entityTextPtr;
- result = XML_ERROR_RECURSIVE_ENTITY_REF;
- goto endEntityValue;
- }
- if (entity->systemId) {
- if (externalEntityRefHandler) {
- dtd->paramEntityRead = XML_FALSE;
- entity->open = XML_TRUE;
- if (!externalEntityRefHandler(externalEntityRefHandlerArg,
- 0,
- entity->base,
- entity->systemId,
- entity->publicId)) {
- entity->open = XML_FALSE;
- result = XML_ERROR_EXTERNAL_ENTITY_HANDLING;
- goto endEntityValue;
- }
- entity->open = XML_FALSE;
- if (!dtd->paramEntityRead)
- dtd->keepProcessing = dtd->standalone;
- }
- else
- dtd->keepProcessing = dtd->standalone;
- }
- else {
- entity->open = XML_TRUE;
- result = storeEntityValue(parser,
- internalEncoding,
- (char *)entity->textPtr,
- (char *)(entity->textPtr
- + entity->textLen));
- entity->open = XML_FALSE;
- if (result)
- goto endEntityValue;
- }
- break;
- }
-#endif /* XML_DTD */
- /* In the internal subset, PE references are not legal
- within markup declarations, e.g entity values in this case. */
- eventPtr = entityTextPtr;
- result = XML_ERROR_PARAM_ENTITY_REF;
- goto endEntityValue;
- case XML_TOK_NONE:
- result = XML_ERROR_NONE;
- goto endEntityValue;
- case XML_TOK_ENTITY_REF:
- case XML_TOK_DATA_CHARS:
- if (!poolAppend(pool, enc, entityTextPtr, next)) {
- result = XML_ERROR_NO_MEMORY;
- goto endEntityValue;
- }
- break;
- case XML_TOK_TRAILING_CR:
- next = entityTextPtr + enc->minBytesPerChar;
- /* fall through */
- case XML_TOK_DATA_NEWLINE:
- if (pool->end == pool->ptr && !poolGrow(pool)) {
- result = XML_ERROR_NO_MEMORY;
- goto endEntityValue;
- }
- *(pool->ptr)++ = 0xA;
- break;
- case XML_TOK_CHAR_REF:
- {
- XML_Char buf[XML_ENCODE_MAX];
- int i;
- int n = XmlCharRefNumber(enc, entityTextPtr);
- if (n < 0) {
- if (enc == encoding)
- eventPtr = entityTextPtr;
- result = XML_ERROR_BAD_CHAR_REF;
- goto endEntityValue;
- }
- n = XmlEncode(n, (ICHAR *)buf);
- if (!n) {
- if (enc == encoding)
- eventPtr = entityTextPtr;
- result = XML_ERROR_BAD_CHAR_REF;
- goto endEntityValue;
- }
- for (i = 0; i < n; i++) {
- if (pool->end == pool->ptr && !poolGrow(pool)) {
- result = XML_ERROR_NO_MEMORY;
- goto endEntityValue;
- }
- *(pool->ptr)++ = buf[i];
- }
- }
- break;
- case XML_TOK_PARTIAL:
- if (enc == encoding)
- eventPtr = entityTextPtr;
- result = XML_ERROR_INVALID_TOKEN;
- goto endEntityValue;
- case XML_TOK_INVALID:
- if (enc == encoding)
- eventPtr = next;
- result = XML_ERROR_INVALID_TOKEN;
- goto endEntityValue;
- default:
- if (enc == encoding)
- eventPtr = entityTextPtr;
- result = XML_ERROR_UNEXPECTED_STATE;
- goto endEntityValue;
- }
- entityTextPtr = next;
- }
-endEntityValue:
-#ifdef XML_DTD
- prologState.inEntityValue = oldInEntityValue;
-#endif /* XML_DTD */
- return result;
-}
-
-static void FASTCALL
-normalizeLines(XML_Char *s)
-{
- XML_Char *p;
- for (;; s++) {
- if (*s == XML_T('\0'))
- return;
- if (*s == 0xD)
- break;
- }
- p = s;
- do {
- if (*s == 0xD) {
- *p++ = 0xA;
- if (*++s == 0xA)
- s++;
- }
- else
- *p++ = *s++;
- } while (*s);
- *p = XML_T('\0');
-}
-
-static int
-reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
- const char *start, const char *end)
-{
- const XML_Char *target;
- XML_Char *data;
- const char *tem;
- if (!processingInstructionHandler) {
- if (defaultHandler)
- reportDefault(parser, enc, start, end);
- return 1;
- }
- start += enc->minBytesPerChar * 2;
- tem = start + XmlNameLength(enc, start);
- target = poolStoreString(&tempPool, enc, start, tem);
- if (!target)
- return 0;
- poolFinish(&tempPool);
- data = poolStoreString(&tempPool, enc,
- XmlSkipS(enc, tem),
- end - enc->minBytesPerChar*2);
- if (!data)
- return 0;
- normalizeLines(data);
- processingInstructionHandler(handlerArg, target, data);
- poolClear(&tempPool);
- return 1;
-}
-
-static int
-reportComment(XML_Parser parser, const ENCODING *enc,
- const char *start, const char *end)
-{
- XML_Char *data;
- if (!commentHandler) {
- if (defaultHandler)
- reportDefault(parser, enc, start, end);
- return 1;
- }
- data = poolStoreString(&tempPool,
- enc,
- start + enc->minBytesPerChar * 4,
- end - enc->minBytesPerChar * 3);
- if (!data)
- return 0;
- normalizeLines(data);
- commentHandler(handlerArg, data);
- poolClear(&tempPool);
- return 1;
-}
-
-static void
-reportDefault(XML_Parser parser, const ENCODING *enc,
- const char *s, const char *end)
-{
- if (MUST_CONVERT(enc, s)) {
- const char **eventPP;
- const char **eventEndPP;
- if (enc == encoding) {
- eventPP = &eventPtr;
- eventEndPP = &eventEndPtr;
- }
- else {
- eventPP = &(openInternalEntities->internalEventPtr);
- eventEndPP = &(openInternalEntities->internalEventEndPtr);
- }
- do {
- ICHAR *dataPtr = (ICHAR *)dataBuf;
- XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd);
- *eventEndPP = s;
- defaultHandler(handlerArg, dataBuf, (int)(dataPtr - (ICHAR *)dataBuf));
- *eventPP = s;
- } while (s != end);
- }
- else
- defaultHandler(handlerArg, (XML_Char *)s, (int)((XML_Char *)end - (XML_Char *)s));
-}
-
-
-static int
-defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, XML_Bool isCdata,
- XML_Bool isId, const XML_Char *value, XML_Parser parser)
-{
- DEFAULT_ATTRIBUTE *att;
- if (value || isId) {
- /* The handling of default attributes gets messed up if we have
- a default which duplicates a non-default. */
- int i;
- for (i = 0; i < type->nDefaultAtts; i++)
- if (attId == type->defaultAtts[i].id)
- return 1;
- if (isId && !type->idAtt && !attId->xmlns)
- type->idAtt = attId;
- }
- if (type->nDefaultAtts == type->allocDefaultAtts) {
- if (type->allocDefaultAtts == 0) {
- type->allocDefaultAtts = 8;
- type->defaultAtts = (DEFAULT_ATTRIBUTE *)MALLOC(type->allocDefaultAtts
- * sizeof(DEFAULT_ATTRIBUTE));
- if (!type->defaultAtts)
- return 0;
- }
- else {
- DEFAULT_ATTRIBUTE *temp;
- int count = type->allocDefaultAtts * 2;
- temp = (DEFAULT_ATTRIBUTE *)
- REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE)));
- if (temp == NULL)
- return 0;
- type->allocDefaultAtts = count;
- type->defaultAtts = temp;
- }
- }
- att = type->defaultAtts + type->nDefaultAtts;
- att->id = attId;
- att->value = value;
- att->isCdata = isCdata;
- if (!isCdata)
- attId->maybeTokenized = XML_TRUE;
- type->nDefaultAtts += 1;
- return 1;
-}
-
-static int
-setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- const XML_Char *name;
- for (name = elementType->name; *name; name++) {
- if (*name == XML_T(ASCII_COLON)) {
- PREFIX *prefix;
- const XML_Char *s;
- for (s = elementType->name; s != name; s++) {
- if (!poolAppendChar(&dtd->pool, *s))
- return 0;
- }
- if (!poolAppendChar(&dtd->pool, XML_T('\0')))
- return 0;
- prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool),
- sizeof(PREFIX));
- if (!prefix)
- return 0;
- if (prefix->name == poolStart(&dtd->pool))
- poolFinish(&dtd->pool);
- else
- poolDiscard(&dtd->pool);
- elementType->prefix = prefix;
-
- }
- }
- return 1;
-}
-
-static ATTRIBUTE_ID *
-getAttributeId(XML_Parser parser, const ENCODING *enc,
- const char *start, const char *end)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- ATTRIBUTE_ID *id;
- const XML_Char *name;
- if (!poolAppendChar(&dtd->pool, XML_T('\0')))
- return NULL;
- name = poolStoreString(&dtd->pool, enc, start, end);
- if (!name)
- return NULL;
- /* skip quotation mark - its storage will be re-used (like in name[-1]) */
- ++name;
- id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, name, sizeof(ATTRIBUTE_ID));
- if (!id)
- return NULL;
- if (id->name != name)
- poolDiscard(&dtd->pool);
- else {
- poolFinish(&dtd->pool);
- if (!ns)
- ;
- else if (name[0] == XML_T(ASCII_x)
- && name[1] == XML_T(ASCII_m)
- && name[2] == XML_T(ASCII_l)
- && name[3] == XML_T(ASCII_n)
- && name[4] == XML_T(ASCII_s)
- && (name[5] == XML_T('\0') || name[5] == XML_T(ASCII_COLON))) {
- if (name[5] == XML_T('\0'))
- id->prefix = &dtd->defaultPrefix;
- else
- id->prefix = (PREFIX *)lookup(&dtd->prefixes, name + 6, sizeof(PREFIX));
- id->xmlns = XML_TRUE;
- }
- else {
- int i;
- for (i = 0; name[i]; i++) {
- /* attributes without prefix are *not* in the default namespace */
- if (name[i] == XML_T(ASCII_COLON)) {
- int j;
- for (j = 0; j < i; j++) {
- if (!poolAppendChar(&dtd->pool, name[j]))
- return NULL;
- }
- if (!poolAppendChar(&dtd->pool, XML_T('\0')))
- return NULL;
- id->prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool),
- sizeof(PREFIX));
- if (id->prefix->name == poolStart(&dtd->pool))
- poolFinish(&dtd->pool);
- else
- poolDiscard(&dtd->pool);
- break;
- }
- }
- }
- }
- return id;
-}
-
-#define CONTEXT_SEP XML_T(ASCII_FF)
-
-static const XML_Char *
-getContext(XML_Parser parser)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- HASH_TABLE_ITER iter;
- XML_Bool needSep = XML_FALSE;
-
- if (dtd->defaultPrefix.binding) {
- int i;
- int len;
- if (!poolAppendChar(&tempPool, XML_T(ASCII_EQUALS)))
- return NULL;
- len = dtd->defaultPrefix.binding->uriLen;
- if (namespaceSeparator)
- len--;
- for (i = 0; i < len; i++)
- if (!poolAppendChar(&tempPool, dtd->defaultPrefix.binding->uri[i]))
- return NULL;
- needSep = XML_TRUE;
- }
-
- hashTableIterInit(&iter, &(dtd->prefixes));
- for (;;) {
- int i;
- int len;
- const XML_Char *s;
- PREFIX *prefix = (PREFIX *)hashTableIterNext(&iter);
- if (!prefix)
- break;
- if (!prefix->binding)
- continue;
- if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP))
- return NULL;
- for (s = prefix->name; *s; s++)
- if (!poolAppendChar(&tempPool, *s))
- return NULL;
- if (!poolAppendChar(&tempPool, XML_T(ASCII_EQUALS)))
- return NULL;
- len = prefix->binding->uriLen;
- if (namespaceSeparator)
- len--;
- for (i = 0; i < len; i++)
- if (!poolAppendChar(&tempPool, prefix->binding->uri[i]))
- return NULL;
- needSep = XML_TRUE;
- }
-
-
- hashTableIterInit(&iter, &(dtd->generalEntities));
- for (;;) {
- const XML_Char *s;
- ENTITY *e = (ENTITY *)hashTableIterNext(&iter);
- if (!e)
- break;
- if (!e->open)
- continue;
- if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP))
- return NULL;
- for (s = e->name; *s; s++)
- if (!poolAppendChar(&tempPool, *s))
- return 0;
- needSep = XML_TRUE;
- }
-
- if (!poolAppendChar(&tempPool, XML_T('\0')))
- return NULL;
- return tempPool.start;
-}
-
-static XML_Bool
-setContext(XML_Parser parser, const XML_Char *context)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- const XML_Char *s = context;
-
- while (*context != XML_T('\0')) {
- if (*s == CONTEXT_SEP || *s == XML_T('\0')) {
- ENTITY *e;
- if (!poolAppendChar(&tempPool, XML_T('\0')))
- return XML_FALSE;
- e = (ENTITY *)lookup(&dtd->generalEntities, poolStart(&tempPool), 0);
- if (e)
- e->open = XML_TRUE;
- if (*s != XML_T('\0'))
- s++;
- context = s;
- poolDiscard(&tempPool);
- }
- else if (*s == XML_T(ASCII_EQUALS)) {
- PREFIX *prefix;
- if (poolLength(&tempPool) == 0)
- prefix = &dtd->defaultPrefix;
- else {
- if (!poolAppendChar(&tempPool, XML_T('\0')))
- return XML_FALSE;
- prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&tempPool),
- sizeof(PREFIX));
- if (!prefix)
- return XML_FALSE;
- if (prefix->name == poolStart(&tempPool)) {
- prefix->name = poolCopyString(&dtd->pool, prefix->name);
- if (!prefix->name)
- return XML_FALSE;
- }
- poolDiscard(&tempPool);
- }
- for (context = s + 1;
- *context != CONTEXT_SEP && *context != XML_T('\0');
- context++)
- if (!poolAppendChar(&tempPool, *context))
- return XML_FALSE;
- if (!poolAppendChar(&tempPool, XML_T('\0')))
- return XML_FALSE;
- if (addBinding(parser, prefix, NULL, poolStart(&tempPool),
- &inheritedBindings) != XML_ERROR_NONE)
- return XML_FALSE;
- poolDiscard(&tempPool);
- if (*context != XML_T('\0'))
- ++context;
- s = context;
- }
- else {
- if (!poolAppendChar(&tempPool, *s))
- return XML_FALSE;
- s++;
- }
- }
- return XML_TRUE;
-}
-
-static void FASTCALL
-normalizePublicId(XML_Char *publicId)
-{
- XML_Char *p = publicId;
- XML_Char *s;
- for (s = publicId; *s; s++) {
- switch (*s) {
- case 0x20:
- case 0xD:
- case 0xA:
- if (p != publicId && p[-1] != 0x20)
- *p++ = 0x20;
- break;
- default:
- *p++ = *s;
- }
- }
- if (p != publicId && p[-1] == 0x20)
- --p;
- *p = XML_T('\0');
-}
-
-static DTD *
-dtdCreate(const XML_Memory_Handling_Suite *ms)
-{
- DTD *p = (DTD *)ms->malloc_fcn(sizeof(DTD));
- if (p == NULL)
- return p;
- poolInit(&(p->pool), ms);
- poolInit(&(p->entityValuePool), ms);
- hashTableInit(&(p->generalEntities), ms);
- hashTableInit(&(p->elementTypes), ms);
- hashTableInit(&(p->attributeIds), ms);
- hashTableInit(&(p->prefixes), ms);
-#ifdef XML_DTD
- p->paramEntityRead = XML_FALSE;
- hashTableInit(&(p->paramEntities), ms);
-#endif /* XML_DTD */
- p->defaultPrefix.name = NULL;
- p->defaultPrefix.binding = NULL;
-
- p->in_eldecl = XML_FALSE;
- p->scaffIndex = NULL;
- p->scaffold = NULL;
- p->scaffLevel = 0;
- p->scaffSize = 0;
- p->scaffCount = 0;
- p->contentStringLen = 0;
-
- p->keepProcessing = XML_TRUE;
- p->hasParamEntityRefs = XML_FALSE;
- p->standalone = XML_FALSE;
- return p;
-}
-
-static void
-dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms)
-{
- HASH_TABLE_ITER iter;
- hashTableIterInit(&iter, &(p->elementTypes));
- for (;;) {
- ELEMENT_TYPE *e = (ELEMENT_TYPE *)hashTableIterNext(&iter);
- if (!e)
- break;
- if (e->allocDefaultAtts != 0)
- ms->free_fcn(e->defaultAtts);
- }
- hashTableClear(&(p->generalEntities));
-#ifdef XML_DTD
- p->paramEntityRead = XML_FALSE;
- hashTableClear(&(p->paramEntities));
-#endif /* XML_DTD */
- hashTableClear(&(p->elementTypes));
- hashTableClear(&(p->attributeIds));
- hashTableClear(&(p->prefixes));
- poolClear(&(p->pool));
- poolClear(&(p->entityValuePool));
- p->defaultPrefix.name = NULL;
- p->defaultPrefix.binding = NULL;
-
- p->in_eldecl = XML_FALSE;
-
- ms->free_fcn(p->scaffIndex);
- p->scaffIndex = NULL;
- ms->free_fcn(p->scaffold);
- p->scaffold = NULL;
-
- p->scaffLevel = 0;
- p->scaffSize = 0;
- p->scaffCount = 0;
- p->contentStringLen = 0;
-
- p->keepProcessing = XML_TRUE;
- p->hasParamEntityRefs = XML_FALSE;
- p->standalone = XML_FALSE;
-}
-
-static void
-dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms)
-{
- HASH_TABLE_ITER iter;
- hashTableIterInit(&iter, &(p->elementTypes));
- for (;;) {
- ELEMENT_TYPE *e = (ELEMENT_TYPE *)hashTableIterNext(&iter);
- if (!e)
- break;
- if (e->allocDefaultAtts != 0)
- ms->free_fcn(e->defaultAtts);
- }
- hashTableDestroy(&(p->generalEntities));
-#ifdef XML_DTD
- hashTableDestroy(&(p->paramEntities));
-#endif /* XML_DTD */
- hashTableDestroy(&(p->elementTypes));
- hashTableDestroy(&(p->attributeIds));
- hashTableDestroy(&(p->prefixes));
- poolDestroy(&(p->pool));
- poolDestroy(&(p->entityValuePool));
- if (isDocEntity) {
- ms->free_fcn(p->scaffIndex);
- ms->free_fcn(p->scaffold);
- }
- ms->free_fcn(p);
-}
-
-/* Do a deep copy of the DTD. Return 0 for out of memory, non-zero otherwise.
- The new DTD has already been initialized.
-*/
-static int
-dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
-{
- HASH_TABLE_ITER iter;
-
- /* Copy the prefix table. */
-
- hashTableIterInit(&iter, &(oldDtd->prefixes));
- for (;;) {
- const XML_Char *name;
- const PREFIX *oldP = (PREFIX *)hashTableIterNext(&iter);
- if (!oldP)
- break;
- name = poolCopyString(&(newDtd->pool), oldP->name);
- if (!name)
- return 0;
- if (!lookup(&(newDtd->prefixes), name, sizeof(PREFIX)))
- return 0;
- }
-
- hashTableIterInit(&iter, &(oldDtd->attributeIds));
-
- /* Copy the attribute id table. */
-
- for (;;) {
- ATTRIBUTE_ID *newA;
- const XML_Char *name;
- const ATTRIBUTE_ID *oldA = (ATTRIBUTE_ID *)hashTableIterNext(&iter);
-
- if (!oldA)
- break;
- /* Remember to allocate the scratch byte before the name. */
- if (!poolAppendChar(&(newDtd->pool), XML_T('\0')))
- return 0;
- name = poolCopyString(&(newDtd->pool), oldA->name);
- if (!name)
- return 0;
- ++name;
- newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name,
- sizeof(ATTRIBUTE_ID));
- if (!newA)
- return 0;
- newA->maybeTokenized = oldA->maybeTokenized;
- if (oldA->prefix) {
- newA->xmlns = oldA->xmlns;
- if (oldA->prefix == &oldDtd->defaultPrefix)
- newA->prefix = &newDtd->defaultPrefix;
- else
- newA->prefix = (PREFIX *)lookup(&(newDtd->prefixes),
- oldA->prefix->name, 0);
- }
- }
-
- /* Copy the element type table. */
-
- hashTableIterInit(&iter, &(oldDtd->elementTypes));
-
- for (;;) {
- int i;
- ELEMENT_TYPE *newE;
- const XML_Char *name;
- const ELEMENT_TYPE *oldE = (ELEMENT_TYPE *)hashTableIterNext(&iter);
- if (!oldE)
- break;
- name = poolCopyString(&(newDtd->pool), oldE->name);
- if (!name)
- return 0;
- newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name,
- sizeof(ELEMENT_TYPE));
- if (!newE)
- return 0;
- if (oldE->nDefaultAtts) {
- newE->defaultAtts = (DEFAULT_ATTRIBUTE *)
- ms->malloc_fcn(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
- if (!newE->defaultAtts) {
- ms->free_fcn(newE);
- return 0;
- }
- }
- if (oldE->idAtt)
- newE->idAtt = (ATTRIBUTE_ID *)
- lookup(&(newDtd->attributeIds), oldE->idAtt->name, 0);
- newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts;
- if (oldE->prefix)
- newE->prefix = (PREFIX *)lookup(&(newDtd->prefixes),
- oldE->prefix->name, 0);
- for (i = 0; i < newE->nDefaultAtts; i++) {
- newE->defaultAtts[i].id = (ATTRIBUTE_ID *)
- lookup(&(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0);
- newE->defaultAtts[i].isCdata = oldE->defaultAtts[i].isCdata;
- if (oldE->defaultAtts[i].value) {
- newE->defaultAtts[i].value
- = poolCopyString(&(newDtd->pool), oldE->defaultAtts[i].value);
- if (!newE->defaultAtts[i].value)
- return 0;
- }
- else
- newE->defaultAtts[i].value = NULL;
- }
- }
-
- /* Copy the entity tables. */
- if (!copyEntityTable(&(newDtd->generalEntities),
- &(newDtd->pool),
- &(oldDtd->generalEntities)))
- return 0;
-
-#ifdef XML_DTD
- if (!copyEntityTable(&(newDtd->paramEntities),
- &(newDtd->pool),
- &(oldDtd->paramEntities)))
- return 0;
- newDtd->paramEntityRead = oldDtd->paramEntityRead;
-#endif /* XML_DTD */
-
- newDtd->keepProcessing = oldDtd->keepProcessing;
- newDtd->hasParamEntityRefs = oldDtd->hasParamEntityRefs;
- newDtd->standalone = oldDtd->standalone;
-
- /* Don't want deep copying for scaffolding */
- newDtd->in_eldecl = oldDtd->in_eldecl;
- newDtd->scaffold = oldDtd->scaffold;
- newDtd->contentStringLen = oldDtd->contentStringLen;
- newDtd->scaffSize = oldDtd->scaffSize;
- newDtd->scaffLevel = oldDtd->scaffLevel;
- newDtd->scaffIndex = oldDtd->scaffIndex;
-
- return 1;
-} /* End dtdCopy */
-
-static int
-copyEntityTable(HASH_TABLE *newTable,
- STRING_POOL *newPool,
- const HASH_TABLE *oldTable)
-{
- HASH_TABLE_ITER iter;
- const XML_Char *cachedOldBase = NULL;
- const XML_Char *cachedNewBase = NULL;
-
- hashTableIterInit(&iter, oldTable);
-
- for (;;) {
- ENTITY *newE;
- const XML_Char *name;
- const ENTITY *oldE = (ENTITY *)hashTableIterNext(&iter);
- if (!oldE)
- break;
- name = poolCopyString(newPool, oldE->name);
- if (!name)
- return 0;
- newE = (ENTITY *)lookup(newTable, name, sizeof(ENTITY));
- if (!newE)
- return 0;
- if (oldE->systemId) {
- const XML_Char *tem = poolCopyString(newPool, oldE->systemId);
- if (!tem)
- return 0;
- newE->systemId = tem;
- if (oldE->base) {
- if (oldE->base == cachedOldBase)
- newE->base = cachedNewBase;
- else {
- cachedOldBase = oldE->base;
- tem = poolCopyString(newPool, cachedOldBase);
- if (!tem)
- return 0;
- cachedNewBase = newE->base = tem;
- }
- }
- if (oldE->publicId) {
- tem = poolCopyString(newPool, oldE->publicId);
- if (!tem)
- return 0;
- newE->publicId = tem;
- }
- }
- else {
- const XML_Char *tem = poolCopyStringN(newPool, oldE->textPtr,
- oldE->textLen);
- if (!tem)
- return 0;
- newE->textPtr = tem;
- newE->textLen = oldE->textLen;
- }
- if (oldE->notation) {
- const XML_Char *tem = poolCopyString(newPool, oldE->notation);
- if (!tem)
- return 0;
- newE->notation = tem;
- }
- newE->is_param = oldE->is_param;
- newE->is_internal = oldE->is_internal;
- }
- return 1;
-}
-
-#define INIT_POWER 6
-
-static XML_Bool FASTCALL
-keyeq(KEY s1, KEY s2)
-{
- for (; *s1 == *s2; s1++, s2++)
- if (*s1 == 0)
- return XML_TRUE;
- return XML_FALSE;
-}
-
-static unsigned long FASTCALL
-hash(KEY s)
-{
- unsigned long h = 0;
- while (*s)
- h = CHAR_HASH(h, *s++);
- return h;
-}
-
-static NAMED *
-lookup(HASH_TABLE *table, KEY name, size_t createSize)
-{
- size_t i;
- if (table->size == 0) {
- size_t tsize;
- if (!createSize)
- return NULL;
- table->power = INIT_POWER;
- /* table->size is a power of 2 */
- table->size = (size_t)1 << INIT_POWER;
- tsize = table->size * sizeof(NAMED *);
- table->v = (NAMED **)table->mem->malloc_fcn(tsize);
- if (!table->v) {
- table->size = 0;
- return NULL;
- }
- memset(table->v, 0, tsize);
- i = hash(name) & ((unsigned long)table->size - 1);
- }
- else {
- unsigned long h = hash(name);
- unsigned long mask = (unsigned long)table->size - 1;
- unsigned char step = 0;
- i = h & mask;
- while (table->v[i]) {
- if (keyeq(name, table->v[i]->name))
- return table->v[i];
- if (!step)
- step = PROBE_STEP(h, mask, table->power);
- i < step ? (i += table->size - step) : (i -= step);
- }
- if (!createSize)
- return NULL;
-
- /* check for overflow (table is half full) */
- if (table->used >> (table->power - 1)) {
- unsigned char newPower = table->power + 1;
- size_t newSize = (size_t)1 << newPower;
- unsigned long newMask = (unsigned long)newSize - 1;
- size_t tsize = newSize * sizeof(NAMED *);
- NAMED **newV = (NAMED **)table->mem->malloc_fcn(tsize);
- if (!newV)
- return NULL;
- memset(newV, 0, tsize);
- for (i = 0; i < table->size; i++)
- if (table->v[i]) {
- unsigned long newHash = hash(table->v[i]->name);
- size_t j = newHash & newMask;
- step = 0;
- while (newV[j]) {
- if (!step)
- step = PROBE_STEP(newHash, newMask, newPower);
- j < step ? (j += newSize - step) : (j -= step);
- }
- newV[j] = table->v[i];
- }
- table->mem->free_fcn(table->v);
- table->v = newV;
- table->power = newPower;
- table->size = newSize;
- i = h & newMask;
- step = 0;
- while (table->v[i]) {
- if (!step)
- step = PROBE_STEP(h, newMask, newPower);
- i < step ? (i += newSize - step) : (i -= step);
- }
- }
- }
- table->v[i] = (NAMED *)table->mem->malloc_fcn(createSize);
- if (!table->v[i])
- return NULL;
- memset(table->v[i], 0, createSize);
- table->v[i]->name = name;
- (table->used)++;
- return table->v[i];
-}
-
-static void FASTCALL
-hashTableClear(HASH_TABLE *table)
-{
- size_t i;
- for (i = 0; i < table->size; i++) {
- table->mem->free_fcn(table->v[i]);
- table->v[i] = NULL;
- }
- table->used = 0;
-}
-
-static void FASTCALL
-hashTableDestroy(HASH_TABLE *table)
-{
- size_t i;
- for (i = 0; i < table->size; i++)
- table->mem->free_fcn(table->v[i]);
- table->mem->free_fcn(table->v);
-}
-
-static void FASTCALL
-hashTableInit(HASH_TABLE *p, const XML_Memory_Handling_Suite *ms)
-{
- p->power = 0;
- p->size = 0;
- p->used = 0;
- p->v = NULL;
- p->mem = ms;
-}
-
-static void FASTCALL
-hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table)
-{
- iter->p = table->v;
- iter->end = iter->p + table->size;
-}
-
-static NAMED * FASTCALL
-hashTableIterNext(HASH_TABLE_ITER *iter)
-{
- while (iter->p != iter->end) {
- NAMED *tem = *(iter->p)++;
- if (tem)
- return tem;
- }
- return NULL;
-}
-
-static void FASTCALL
-poolInit(STRING_POOL *pool, const XML_Memory_Handling_Suite *ms)
-{
- pool->blocks = NULL;
- pool->freeBlocks = NULL;
- pool->start = NULL;
- pool->ptr = NULL;
- pool->end = NULL;
- pool->mem = ms;
-}
-
-static void FASTCALL
-poolClear(STRING_POOL *pool)
-{
- if (!pool->freeBlocks)
- pool->freeBlocks = pool->blocks;
- else {
- BLOCK *p = pool->blocks;
- while (p) {
- BLOCK *tem = p->next;
- p->next = pool->freeBlocks;
- pool->freeBlocks = p;
- p = tem;
- }
- }
- pool->blocks = NULL;
- pool->start = NULL;
- pool->ptr = NULL;
- pool->end = NULL;
-}
-
-static void FASTCALL
-poolDestroy(STRING_POOL *pool)
-{
- BLOCK *p = pool->blocks;
- while (p) {
- BLOCK *tem = p->next;
- pool->mem->free_fcn(p);
- p = tem;
- }
- p = pool->freeBlocks;
- while (p) {
- BLOCK *tem = p->next;
- pool->mem->free_fcn(p);
- p = tem;
- }
-}
-
-static XML_Char *
-poolAppend(STRING_POOL *pool, const ENCODING *enc,
- const char *ptr, const char *end)
-{
- if (!pool->ptr && !poolGrow(pool))
- return NULL;
- for (;;) {
- XmlConvert(enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end);
- if (ptr == end)
- break;
- if (!poolGrow(pool))
- return NULL;
- }
- return pool->start;
-}
-
-static const XML_Char * FASTCALL
-poolCopyString(STRING_POOL *pool, const XML_Char *s)
-{
- do {
- if (!poolAppendChar(pool, *s))
- return NULL;
- } while (*s++);
- s = pool->start;
- poolFinish(pool);
- return s;
-}
-
-static const XML_Char *
-poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n)
-{
- if (!pool->ptr && !poolGrow(pool))
- return NULL;
- for (; n > 0; --n, s++) {
- if (!poolAppendChar(pool, *s))
- return NULL;
- }
- s = pool->start;
- poolFinish(pool);
- return s;
-}
-
-static const XML_Char * FASTCALL
-poolAppendString(STRING_POOL *pool, const XML_Char *s)
-{
- while (*s) {
- if (!poolAppendChar(pool, *s))
- return NULL;
- s++;
- }
- return pool->start;
-}
-
-static XML_Char *
-poolStoreString(STRING_POOL *pool, const ENCODING *enc,
- const char *ptr, const char *end)
-{
- if (!poolAppend(pool, enc, ptr, end))
- return NULL;
- if (pool->ptr == pool->end && !poolGrow(pool))
- return NULL;
- *(pool->ptr)++ = 0;
- return pool->start;
-}
-
-static XML_Bool FASTCALL
-poolGrow(STRING_POOL *pool)
-{
- if (pool->freeBlocks) {
- if (pool->start == 0) {
- pool->blocks = pool->freeBlocks;
- pool->freeBlocks = pool->freeBlocks->next;
- pool->blocks->next = NULL;
- pool->start = pool->blocks->s;
- pool->end = pool->start + pool->blocks->size;
- pool->ptr = pool->start;
- return XML_TRUE;
- }
- if (pool->end - pool->start < pool->freeBlocks->size) {
- BLOCK *tem = pool->freeBlocks->next;
- pool->freeBlocks->next = pool->blocks;
- pool->blocks = pool->freeBlocks;
- pool->freeBlocks = tem;
- memcpy(pool->blocks->s, pool->start,
- (pool->end - pool->start) * sizeof(XML_Char));
- pool->ptr = pool->blocks->s + (pool->ptr - pool->start);
- pool->start = pool->blocks->s;
- pool->end = pool->start + pool->blocks->size;
- return XML_TRUE;
- }
- }
- if (pool->blocks && pool->start == pool->blocks->s) {
- int blockSize = (int)(pool->end - pool->start)*2;
- pool->blocks = (BLOCK *)
- pool->mem->realloc_fcn(pool->blocks,
- (offsetof(BLOCK, s)
- + blockSize * sizeof(XML_Char)));
- if (pool->blocks == NULL)
- return XML_FALSE;
- pool->blocks->size = blockSize;
- pool->ptr = pool->blocks->s + (pool->ptr - pool->start);
- pool->start = pool->blocks->s;
- pool->end = pool->start + blockSize;
- }
- else {
- BLOCK *tem;
- int blockSize = (int)(pool->end - pool->start);
- if (blockSize < INIT_BLOCK_SIZE)
- blockSize = INIT_BLOCK_SIZE;
- else
- blockSize *= 2;
- tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s)
- + blockSize * sizeof(XML_Char));
- if (!tem)
- return XML_FALSE;
- tem->size = blockSize;
- tem->next = pool->blocks;
- pool->blocks = tem;
- if (pool->ptr != pool->start)
- memcpy(tem->s, pool->start,
- (pool->ptr - pool->start) * sizeof(XML_Char));
- pool->ptr = tem->s + (pool->ptr - pool->start);
- pool->start = tem->s;
- pool->end = tem->s + blockSize;
- }
- return XML_TRUE;
-}
-
-static int FASTCALL
-nextScaffoldPart(XML_Parser parser)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- CONTENT_SCAFFOLD * me;
- int next;
-
- if (!dtd->scaffIndex) {
- dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int));
- if (!dtd->scaffIndex)
- return -1;
- dtd->scaffIndex[0] = 0;
- }
-
- if (dtd->scaffCount >= dtd->scaffSize) {
- CONTENT_SCAFFOLD *temp;
- if (dtd->scaffold) {
- temp = (CONTENT_SCAFFOLD *)
- REALLOC(dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD));
- if (temp == NULL)
- return -1;
- dtd->scaffSize *= 2;
- }
- else {
- temp = (CONTENT_SCAFFOLD *)MALLOC(INIT_SCAFFOLD_ELEMENTS
- * sizeof(CONTENT_SCAFFOLD));
- if (temp == NULL)
- return -1;
- dtd->scaffSize = INIT_SCAFFOLD_ELEMENTS;
- }
- dtd->scaffold = temp;
- }
- next = dtd->scaffCount++;
- me = &dtd->scaffold[next];
- if (dtd->scaffLevel) {
- CONTENT_SCAFFOLD *parent = &dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel-1]];
- if (parent->lastchild) {
- dtd->scaffold[parent->lastchild].nextsib = next;
- }
- if (!parent->childcnt)
- parent->firstchild = next;
- parent->lastchild = next;
- parent->childcnt++;
- }
- me->firstchild = me->lastchild = me->childcnt = me->nextsib = 0;
- return next;
-}
-
-static void
-build_node(XML_Parser parser,
- int src_node,
- XML_Content *dest,
- XML_Content **contpos,
- XML_Char **strpos)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- dest->type = dtd->scaffold[src_node].type;
- dest->quant = dtd->scaffold[src_node].quant;
- if (dest->type == XML_CTYPE_NAME) {
- const XML_Char *src;
- dest->name = *strpos;
- src = dtd->scaffold[src_node].name;
- for (;;) {
- *(*strpos)++ = *src;
- if (!*src)
- break;
- src++;
- }
- dest->numchildren = 0;
- dest->children = NULL;
- }
- else {
- unsigned int i;
- int cn;
- dest->numchildren = dtd->scaffold[src_node].childcnt;
- dest->children = *contpos;
- *contpos += dest->numchildren;
- for (i = 0, cn = dtd->scaffold[src_node].firstchild;
- i < dest->numchildren;
- i++, cn = dtd->scaffold[cn].nextsib) {
- build_node(parser, cn, &(dest->children[i]), contpos, strpos);
- }
- dest->name = NULL;
- }
-}
-
-static XML_Content *
-build_model (XML_Parser parser)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- XML_Content *ret;
- XML_Content *cpos;
- XML_Char * str;
- int allocsize = (dtd->scaffCount * sizeof(XML_Content)
- + (dtd->contentStringLen * sizeof(XML_Char)));
-
- ret = (XML_Content *)MALLOC(allocsize);
- if (!ret)
- return NULL;
-
- str = (XML_Char *) (&ret[dtd->scaffCount]);
- cpos = &ret[1];
-
- build_node(parser, 0, ret, &cpos, &str);
- return ret;
-}
-
-static ELEMENT_TYPE *
-getElementType(XML_Parser parser,
- const ENCODING *enc,
- const char *ptr,
- const char *end)
-{
- DTD * const dtd = _dtd; /* save one level of indirection */
- const XML_Char *name = poolStoreString(&dtd->pool, enc, ptr, end);
- ELEMENT_TYPE *ret;
-
- if (!name)
- return NULL;
- ret = (ELEMENT_TYPE *) lookup(&dtd->elementTypes, name, sizeof(ELEMENT_TYPE));
- if (!ret)
- return NULL;
- if (ret->name != name)
- poolDiscard(&dtd->pool);
- else {
- poolFinish(&dtd->pool);
- if (!setElementTypePrefix(parser, ret))
- return NULL;
- }
- return ret;
-}
diff --git a/Utilities/Poco/XML/src/xmlrole.c b/Utilities/Poco/XML/src/xmlrole.c
deleted file mode 100755
index f41ca8fcec..0000000000
--- a/Utilities/Poco/XML/src/xmlrole.c
+++ /dev/null
@@ -1,1336 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-#include <stddef.h>
-
-#ifdef COMPILED_FROM_DSP
-#include "winconfig.h"
-#elif defined(MACOS_CLASSIC)
-#include "macconfig.h"
-#elif defined(__amigaos4__)
-#include "amigaconfig.h"
-#elif defined(__WATCOMC__)
-#include "watcomconfig.h"
-#else
-#ifdef HAVE_EXPAT_CONFIG_H
-#include "expat_config.h"
-#endif
-#endif /* ndef COMPILED_FROM_DSP */
-
-#include "Poco/XML/expat_external.h"
-#include "internal.h"
-#include "xmlrole.h"
-#include "ascii.h"
-
-/* Doesn't check:
-
- that ,| are not mixed in a model group
- content of literals
-
-*/
-
-static const char KW_ANY[] = {
- ASCII_A, ASCII_N, ASCII_Y, '\0' };
-static const char KW_ATTLIST[] = {
- ASCII_A, ASCII_T, ASCII_T, ASCII_L, ASCII_I, ASCII_S, ASCII_T, '\0' };
-static const char KW_CDATA[] = {
- ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' };
-static const char KW_DOCTYPE[] = {
- ASCII_D, ASCII_O, ASCII_C, ASCII_T, ASCII_Y, ASCII_P, ASCII_E, '\0' };
-static const char KW_ELEMENT[] = {
- ASCII_E, ASCII_L, ASCII_E, ASCII_M, ASCII_E, ASCII_N, ASCII_T, '\0' };
-static const char KW_EMPTY[] = {
- ASCII_E, ASCII_M, ASCII_P, ASCII_T, ASCII_Y, '\0' };
-static const char KW_ENTITIES[] = {
- ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_I, ASCII_E, ASCII_S,
- '\0' };
-static const char KW_ENTITY[] = {
- ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_Y, '\0' };
-static const char KW_FIXED[] = {
- ASCII_F, ASCII_I, ASCII_X, ASCII_E, ASCII_D, '\0' };
-static const char KW_ID[] = {
- ASCII_I, ASCII_D, '\0' };
-static const char KW_IDREF[] = {
- ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' };
-static const char KW_IDREFS[] = {
- ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' };
-#ifdef XML_DTD
-static const char KW_IGNORE[] = {
- ASCII_I, ASCII_G, ASCII_N, ASCII_O, ASCII_R, ASCII_E, '\0' };
-#endif
-static const char KW_IMPLIED[] = {
- ASCII_I, ASCII_M, ASCII_P, ASCII_L, ASCII_I, ASCII_E, ASCII_D, '\0' };
-#ifdef XML_DTD
-static const char KW_INCLUDE[] = {
- ASCII_I, ASCII_N, ASCII_C, ASCII_L, ASCII_U, ASCII_D, ASCII_E, '\0' };
-#endif
-static const char KW_NDATA[] = {
- ASCII_N, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' };
-static const char KW_NMTOKEN[] = {
- ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0' };
-static const char KW_NMTOKENS[] = {
- ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S,
- '\0' };
-static const char KW_NOTATION[] =
- { ASCII_N, ASCII_O, ASCII_T, ASCII_A, ASCII_T, ASCII_I, ASCII_O, ASCII_N,
- '\0' };
-static const char KW_PCDATA[] = {
- ASCII_P, ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' };
-static const char KW_PUBLIC[] = {
- ASCII_P, ASCII_U, ASCII_B, ASCII_L, ASCII_I, ASCII_C, '\0' };
-static const char KW_REQUIRED[] = {
- ASCII_R, ASCII_E, ASCII_Q, ASCII_U, ASCII_I, ASCII_R, ASCII_E, ASCII_D,
- '\0' };
-static const char KW_SYSTEM[] = {
- ASCII_S, ASCII_Y, ASCII_S, ASCII_T, ASCII_E, ASCII_M, '\0' };
-
-#ifndef MIN_BYTES_PER_CHAR
-#define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar)
-#endif
-
-#ifdef XML_DTD
-#define setTopLevel(state) \
- ((state)->handler = ((state)->documentEntity \
- ? internalSubset \
- : externalSubset1))
-#else /* not XML_DTD */
-#define setTopLevel(state) ((state)->handler = internalSubset)
-#endif /* not XML_DTD */
-
-typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc);
-
-static PROLOG_HANDLER
- prolog0, prolog1, prolog2,
- doctype0, doctype1, doctype2, doctype3, doctype4, doctype5,
- internalSubset,
- entity0, entity1, entity2, entity3, entity4, entity5, entity6,
- entity7, entity8, entity9, entity10,
- notation0, notation1, notation2, notation3, notation4,
- attlist0, attlist1, attlist2, attlist3, attlist4, attlist5, attlist6,
- attlist7, attlist8, attlist9,
- element0, element1, element2, element3, element4, element5, element6,
- element7,
-#ifdef XML_DTD
- externalSubset0, externalSubset1,
- condSect0, condSect1, condSect2,
-#endif /* XML_DTD */
- declClose,
- error;
-
-static int FASTCALL common(PROLOG_STATE *state, int tok);
-
-static int PTRCALL
-prolog0(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- state->handler = prolog1;
- return XML_ROLE_NONE;
- case XML_TOK_XML_DECL:
- state->handler = prolog1;
- return XML_ROLE_XML_DECL;
- case XML_TOK_PI:
- state->handler = prolog1;
- return XML_ROLE_PI;
- case XML_TOK_COMMENT:
- state->handler = prolog1;
- return XML_ROLE_COMMENT;
- case XML_TOK_BOM:
- return XML_ROLE_NONE;
- case XML_TOK_DECL_OPEN:
- if (!XmlNameMatchesAscii(enc,
- ptr + 2 * MIN_BYTES_PER_CHAR(enc),
- end,
- KW_DOCTYPE))
- break;
- state->handler = doctype0;
- return XML_ROLE_DOCTYPE_NONE;
- case XML_TOK_INSTANCE_START:
- state->handler = error;
- return XML_ROLE_INSTANCE_START;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-prolog1(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NONE;
- case XML_TOK_PI:
- return XML_ROLE_PI;
- case XML_TOK_COMMENT:
- return XML_ROLE_COMMENT;
- case XML_TOK_BOM:
- return XML_ROLE_NONE;
- case XML_TOK_DECL_OPEN:
- if (!XmlNameMatchesAscii(enc,
- ptr + 2 * MIN_BYTES_PER_CHAR(enc),
- end,
- KW_DOCTYPE))
- break;
- state->handler = doctype0;
- return XML_ROLE_DOCTYPE_NONE;
- case XML_TOK_INSTANCE_START:
- state->handler = error;
- return XML_ROLE_INSTANCE_START;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-prolog2(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NONE;
- case XML_TOK_PI:
- return XML_ROLE_PI;
- case XML_TOK_COMMENT:
- return XML_ROLE_COMMENT;
- case XML_TOK_INSTANCE_START:
- state->handler = error;
- return XML_ROLE_INSTANCE_START;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-doctype0(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_DOCTYPE_NONE;
- case XML_TOK_NAME:
- case XML_TOK_PREFIXED_NAME:
- state->handler = doctype1;
- return XML_ROLE_DOCTYPE_NAME;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-doctype1(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_DOCTYPE_NONE;
- case XML_TOK_OPEN_BRACKET:
- state->handler = internalSubset;
- return XML_ROLE_DOCTYPE_INTERNAL_SUBSET;
- case XML_TOK_DECL_CLOSE:
- state->handler = prolog2;
- return XML_ROLE_DOCTYPE_CLOSE;
- case XML_TOK_NAME:
- if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) {
- state->handler = doctype3;
- return XML_ROLE_DOCTYPE_NONE;
- }
- if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) {
- state->handler = doctype2;
- return XML_ROLE_DOCTYPE_NONE;
- }
- break;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-doctype2(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_DOCTYPE_NONE;
- case XML_TOK_LITERAL:
- state->handler = doctype3;
- return XML_ROLE_DOCTYPE_PUBLIC_ID;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-doctype3(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_DOCTYPE_NONE;
- case XML_TOK_LITERAL:
- state->handler = doctype4;
- return XML_ROLE_DOCTYPE_SYSTEM_ID;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-doctype4(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_DOCTYPE_NONE;
- case XML_TOK_OPEN_BRACKET:
- state->handler = internalSubset;
- return XML_ROLE_DOCTYPE_INTERNAL_SUBSET;
- case XML_TOK_DECL_CLOSE:
- state->handler = prolog2;
- return XML_ROLE_DOCTYPE_CLOSE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-doctype5(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_DOCTYPE_NONE;
- case XML_TOK_DECL_CLOSE:
- state->handler = prolog2;
- return XML_ROLE_DOCTYPE_CLOSE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-internalSubset(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NONE;
- case XML_TOK_DECL_OPEN:
- if (XmlNameMatchesAscii(enc,
- ptr + 2 * MIN_BYTES_PER_CHAR(enc),
- end,
- KW_ENTITY)) {
- state->handler = entity0;
- return XML_ROLE_ENTITY_NONE;
- }
- if (XmlNameMatchesAscii(enc,
- ptr + 2 * MIN_BYTES_PER_CHAR(enc),
- end,
- KW_ATTLIST)) {
- state->handler = attlist0;
- return XML_ROLE_ATTLIST_NONE;
- }
- if (XmlNameMatchesAscii(enc,
- ptr + 2 * MIN_BYTES_PER_CHAR(enc),
- end,
- KW_ELEMENT)) {
- state->handler = element0;
- return XML_ROLE_ELEMENT_NONE;
- }
- if (XmlNameMatchesAscii(enc,
- ptr + 2 * MIN_BYTES_PER_CHAR(enc),
- end,
- KW_NOTATION)) {
- state->handler = notation0;
- return XML_ROLE_NOTATION_NONE;
- }
- break;
- case XML_TOK_PI:
- return XML_ROLE_PI;
- case XML_TOK_COMMENT:
- return XML_ROLE_COMMENT;
- case XML_TOK_PARAM_ENTITY_REF:
- return XML_ROLE_PARAM_ENTITY_REF;
- case XML_TOK_CLOSE_BRACKET:
- state->handler = doctype5;
- return XML_ROLE_DOCTYPE_NONE;
- case XML_TOK_NONE:
- return XML_ROLE_NONE;
- }
- return common(state, tok);
-}
-
-#ifdef XML_DTD
-
-static int PTRCALL
-externalSubset0(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- state->handler = externalSubset1;
- if (tok == XML_TOK_XML_DECL)
- return XML_ROLE_TEXT_DECL;
- return externalSubset1(state, tok, ptr, end, enc);
-}
-
-static int PTRCALL
-externalSubset1(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_COND_SECT_OPEN:
- state->handler = condSect0;
- return XML_ROLE_NONE;
- case XML_TOK_COND_SECT_CLOSE:
- if (state->includeLevel == 0)
- break;
- state->includeLevel -= 1;
- return XML_ROLE_NONE;
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NONE;
- case XML_TOK_CLOSE_BRACKET:
- break;
- case XML_TOK_NONE:
- if (state->includeLevel)
- break;
- return XML_ROLE_NONE;
- default:
- return internalSubset(state, tok, ptr, end, enc);
- }
- return common(state, tok);
-}
-
-#endif /* XML_DTD */
-
-static int PTRCALL
-entity0(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_PERCENT:
- state->handler = entity1;
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_NAME:
- state->handler = entity2;
- return XML_ROLE_GENERAL_ENTITY_NAME;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-entity1(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_NAME:
- state->handler = entity7;
- return XML_ROLE_PARAM_ENTITY_NAME;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-entity2(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_NAME:
- if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) {
- state->handler = entity4;
- return XML_ROLE_ENTITY_NONE;
- }
- if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) {
- state->handler = entity3;
- return XML_ROLE_ENTITY_NONE;
- }
- break;
- case XML_TOK_LITERAL:
- state->handler = declClose;
- state->role_none = XML_ROLE_ENTITY_NONE;
- return XML_ROLE_ENTITY_VALUE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-entity3(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_LITERAL:
- state->handler = entity4;
- return XML_ROLE_ENTITY_PUBLIC_ID;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-entity4(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_LITERAL:
- state->handler = entity5;
- return XML_ROLE_ENTITY_SYSTEM_ID;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-entity5(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_DECL_CLOSE:
- setTopLevel(state);
- return XML_ROLE_ENTITY_COMPLETE;
- case XML_TOK_NAME:
- if (XmlNameMatchesAscii(enc, ptr, end, KW_NDATA)) {
- state->handler = entity6;
- return XML_ROLE_ENTITY_NONE;
- }
- break;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-entity6(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_NAME:
- state->handler = declClose;
- state->role_none = XML_ROLE_ENTITY_NONE;
- return XML_ROLE_ENTITY_NOTATION_NAME;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-entity7(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_NAME:
- if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) {
- state->handler = entity9;
- return XML_ROLE_ENTITY_NONE;
- }
- if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) {
- state->handler = entity8;
- return XML_ROLE_ENTITY_NONE;
- }
- break;
- case XML_TOK_LITERAL:
- state->handler = declClose;
- state->role_none = XML_ROLE_ENTITY_NONE;
- return XML_ROLE_ENTITY_VALUE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-entity8(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_LITERAL:
- state->handler = entity9;
- return XML_ROLE_ENTITY_PUBLIC_ID;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-entity9(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_LITERAL:
- state->handler = entity10;
- return XML_ROLE_ENTITY_SYSTEM_ID;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-entity10(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ENTITY_NONE;
- case XML_TOK_DECL_CLOSE:
- setTopLevel(state);
- return XML_ROLE_ENTITY_COMPLETE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-notation0(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NOTATION_NONE;
- case XML_TOK_NAME:
- state->handler = notation1;
- return XML_ROLE_NOTATION_NAME;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-notation1(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NOTATION_NONE;
- case XML_TOK_NAME:
- if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) {
- state->handler = notation3;
- return XML_ROLE_NOTATION_NONE;
- }
- if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) {
- state->handler = notation2;
- return XML_ROLE_NOTATION_NONE;
- }
- break;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-notation2(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NOTATION_NONE;
- case XML_TOK_LITERAL:
- state->handler = notation4;
- return XML_ROLE_NOTATION_PUBLIC_ID;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-notation3(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NOTATION_NONE;
- case XML_TOK_LITERAL:
- state->handler = declClose;
- state->role_none = XML_ROLE_NOTATION_NONE;
- return XML_ROLE_NOTATION_SYSTEM_ID;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-notation4(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NOTATION_NONE;
- case XML_TOK_LITERAL:
- state->handler = declClose;
- state->role_none = XML_ROLE_NOTATION_NONE;
- return XML_ROLE_NOTATION_SYSTEM_ID;
- case XML_TOK_DECL_CLOSE:
- setTopLevel(state);
- return XML_ROLE_NOTATION_NO_SYSTEM_ID;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-attlist0(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_NAME:
- case XML_TOK_PREFIXED_NAME:
- state->handler = attlist1;
- return XML_ROLE_ATTLIST_ELEMENT_NAME;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-attlist1(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_DECL_CLOSE:
- setTopLevel(state);
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_NAME:
- case XML_TOK_PREFIXED_NAME:
- state->handler = attlist2;
- return XML_ROLE_ATTRIBUTE_NAME;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-attlist2(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_NAME:
- {
- static const char * const types[] = {
- KW_CDATA,
- KW_ID,
- KW_IDREF,
- KW_IDREFS,
- KW_ENTITY,
- KW_ENTITIES,
- KW_NMTOKEN,
- KW_NMTOKENS,
- };
- int i;
- for (i = 0; i < (int)(sizeof(types)/sizeof(types[0])); i++)
- if (XmlNameMatchesAscii(enc, ptr, end, types[i])) {
- state->handler = attlist8;
- return XML_ROLE_ATTRIBUTE_TYPE_CDATA + i;
- }
- }
- if (XmlNameMatchesAscii(enc, ptr, end, KW_NOTATION)) {
- state->handler = attlist5;
- return XML_ROLE_ATTLIST_NONE;
- }
- break;
- case XML_TOK_OPEN_PAREN:
- state->handler = attlist3;
- return XML_ROLE_ATTLIST_NONE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-attlist3(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_NMTOKEN:
- case XML_TOK_NAME:
- case XML_TOK_PREFIXED_NAME:
- state->handler = attlist4;
- return XML_ROLE_ATTRIBUTE_ENUM_VALUE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-attlist4(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_CLOSE_PAREN:
- state->handler = attlist8;
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_OR:
- state->handler = attlist3;
- return XML_ROLE_ATTLIST_NONE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-attlist5(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_OPEN_PAREN:
- state->handler = attlist6;
- return XML_ROLE_ATTLIST_NONE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-attlist6(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_NAME:
- state->handler = attlist7;
- return XML_ROLE_ATTRIBUTE_NOTATION_VALUE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-attlist7(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_CLOSE_PAREN:
- state->handler = attlist8;
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_OR:
- state->handler = attlist6;
- return XML_ROLE_ATTLIST_NONE;
- }
- return common(state, tok);
-}
-
-/* default value */
-static int PTRCALL
-attlist8(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_POUND_NAME:
- if (XmlNameMatchesAscii(enc,
- ptr + MIN_BYTES_PER_CHAR(enc),
- end,
- KW_IMPLIED)) {
- state->handler = attlist1;
- return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE;
- }
- if (XmlNameMatchesAscii(enc,
- ptr + MIN_BYTES_PER_CHAR(enc),
- end,
- KW_REQUIRED)) {
- state->handler = attlist1;
- return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE;
- }
- if (XmlNameMatchesAscii(enc,
- ptr + MIN_BYTES_PER_CHAR(enc),
- end,
- KW_FIXED)) {
- state->handler = attlist9;
- return XML_ROLE_ATTLIST_NONE;
- }
- break;
- case XML_TOK_LITERAL:
- state->handler = attlist1;
- return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-attlist9(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ATTLIST_NONE;
- case XML_TOK_LITERAL:
- state->handler = attlist1;
- return XML_ROLE_FIXED_ATTRIBUTE_VALUE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-element0(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ELEMENT_NONE;
- case XML_TOK_NAME:
- case XML_TOK_PREFIXED_NAME:
- state->handler = element1;
- return XML_ROLE_ELEMENT_NAME;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-element1(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ELEMENT_NONE;
- case XML_TOK_NAME:
- if (XmlNameMatchesAscii(enc, ptr, end, KW_EMPTY)) {
- state->handler = declClose;
- state->role_none = XML_ROLE_ELEMENT_NONE;
- return XML_ROLE_CONTENT_EMPTY;
- }
- if (XmlNameMatchesAscii(enc, ptr, end, KW_ANY)) {
- state->handler = declClose;
- state->role_none = XML_ROLE_ELEMENT_NONE;
- return XML_ROLE_CONTENT_ANY;
- }
- break;
- case XML_TOK_OPEN_PAREN:
- state->handler = element2;
- state->level = 1;
- return XML_ROLE_GROUP_OPEN;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-element2(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ELEMENT_NONE;
- case XML_TOK_POUND_NAME:
- if (XmlNameMatchesAscii(enc,
- ptr + MIN_BYTES_PER_CHAR(enc),
- end,
- KW_PCDATA)) {
- state->handler = element3;
- return XML_ROLE_CONTENT_PCDATA;
- }
- break;
- case XML_TOK_OPEN_PAREN:
- state->level = 2;
- state->handler = element6;
- return XML_ROLE_GROUP_OPEN;
- case XML_TOK_NAME:
- case XML_TOK_PREFIXED_NAME:
- state->handler = element7;
- return XML_ROLE_CONTENT_ELEMENT;
- case XML_TOK_NAME_QUESTION:
- state->handler = element7;
- return XML_ROLE_CONTENT_ELEMENT_OPT;
- case XML_TOK_NAME_ASTERISK:
- state->handler = element7;
- return XML_ROLE_CONTENT_ELEMENT_REP;
- case XML_TOK_NAME_PLUS:
- state->handler = element7;
- return XML_ROLE_CONTENT_ELEMENT_PLUS;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-element3(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ELEMENT_NONE;
- case XML_TOK_CLOSE_PAREN:
- state->handler = declClose;
- state->role_none = XML_ROLE_ELEMENT_NONE;
- return XML_ROLE_GROUP_CLOSE;
- case XML_TOK_CLOSE_PAREN_ASTERISK:
- state->handler = declClose;
- state->role_none = XML_ROLE_ELEMENT_NONE;
- return XML_ROLE_GROUP_CLOSE_REP;
- case XML_TOK_OR:
- state->handler = element4;
- return XML_ROLE_ELEMENT_NONE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-element4(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ELEMENT_NONE;
- case XML_TOK_NAME:
- case XML_TOK_PREFIXED_NAME:
- state->handler = element5;
- return XML_ROLE_CONTENT_ELEMENT;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-element5(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ELEMENT_NONE;
- case XML_TOK_CLOSE_PAREN_ASTERISK:
- state->handler = declClose;
- state->role_none = XML_ROLE_ELEMENT_NONE;
- return XML_ROLE_GROUP_CLOSE_REP;
- case XML_TOK_OR:
- state->handler = element4;
- return XML_ROLE_ELEMENT_NONE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-element6(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ELEMENT_NONE;
- case XML_TOK_OPEN_PAREN:
- state->level += 1;
- return XML_ROLE_GROUP_OPEN;
- case XML_TOK_NAME:
- case XML_TOK_PREFIXED_NAME:
- state->handler = element7;
- return XML_ROLE_CONTENT_ELEMENT;
- case XML_TOK_NAME_QUESTION:
- state->handler = element7;
- return XML_ROLE_CONTENT_ELEMENT_OPT;
- case XML_TOK_NAME_ASTERISK:
- state->handler = element7;
- return XML_ROLE_CONTENT_ELEMENT_REP;
- case XML_TOK_NAME_PLUS:
- state->handler = element7;
- return XML_ROLE_CONTENT_ELEMENT_PLUS;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-element7(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_ELEMENT_NONE;
- case XML_TOK_CLOSE_PAREN:
- state->level -= 1;
- if (state->level == 0) {
- state->handler = declClose;
- state->role_none = XML_ROLE_ELEMENT_NONE;
- }
- return XML_ROLE_GROUP_CLOSE;
- case XML_TOK_CLOSE_PAREN_ASTERISK:
- state->level -= 1;
- if (state->level == 0) {
- state->handler = declClose;
- state->role_none = XML_ROLE_ELEMENT_NONE;
- }
- return XML_ROLE_GROUP_CLOSE_REP;
- case XML_TOK_CLOSE_PAREN_QUESTION:
- state->level -= 1;
- if (state->level == 0) {
- state->handler = declClose;
- state->role_none = XML_ROLE_ELEMENT_NONE;
- }
- return XML_ROLE_GROUP_CLOSE_OPT;
- case XML_TOK_CLOSE_PAREN_PLUS:
- state->level -= 1;
- if (state->level == 0) {
- state->handler = declClose;
- state->role_none = XML_ROLE_ELEMENT_NONE;
- }
- return XML_ROLE_GROUP_CLOSE_PLUS;
- case XML_TOK_COMMA:
- state->handler = element6;
- return XML_ROLE_GROUP_SEQUENCE;
- case XML_TOK_OR:
- state->handler = element6;
- return XML_ROLE_GROUP_CHOICE;
- }
- return common(state, tok);
-}
-
-#ifdef XML_DTD
-
-static int PTRCALL
-condSect0(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NONE;
- case XML_TOK_NAME:
- if (XmlNameMatchesAscii(enc, ptr, end, KW_INCLUDE)) {
- state->handler = condSect1;
- return XML_ROLE_NONE;
- }
- if (XmlNameMatchesAscii(enc, ptr, end, KW_IGNORE)) {
- state->handler = condSect2;
- return XML_ROLE_NONE;
- }
- break;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-condSect1(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NONE;
- case XML_TOK_OPEN_BRACKET:
- state->handler = externalSubset1;
- state->includeLevel += 1;
- return XML_ROLE_NONE;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-condSect2(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return XML_ROLE_NONE;
- case XML_TOK_OPEN_BRACKET:
- state->handler = externalSubset1;
- return XML_ROLE_IGNORE_SECT;
- }
- return common(state, tok);
-}
-
-#endif /* XML_DTD */
-
-static int PTRCALL
-declClose(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- switch (tok) {
- case XML_TOK_PROLOG_S:
- return state->role_none;
- case XML_TOK_DECL_CLOSE:
- setTopLevel(state);
- return state->role_none;
- }
- return common(state, tok);
-}
-
-static int PTRCALL
-error(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc)
-{
- return XML_ROLE_NONE;
-}
-
-static int FASTCALL
-common(PROLOG_STATE *state, int tok)
-{
-#ifdef XML_DTD
- if (!state->documentEntity && tok == XML_TOK_PARAM_ENTITY_REF)
- return XML_ROLE_INNER_PARAM_ENTITY_REF;
-#endif
- state->handler = error;
- return XML_ROLE_ERROR;
-}
-
-void
-XmlPrologStateInit(PROLOG_STATE *state)
-{
- state->handler = prolog0;
-#ifdef XML_DTD
- state->documentEntity = 1;
- state->includeLevel = 0;
- state->inEntityValue = 0;
-#endif /* XML_DTD */
-}
-
-#ifdef XML_DTD
-
-void
-XmlPrologStateInitExternalEntity(PROLOG_STATE *state)
-{
- state->handler = externalSubset0;
- state->documentEntity = 0;
- state->includeLevel = 0;
-}
-
-#endif /* XML_DTD */
diff --git a/Utilities/Poco/XML/src/xmlrole.h b/Utilities/Poco/XML/src/xmlrole.h
deleted file mode 100755
index 4dd9f06f97..0000000000
--- a/Utilities/Poco/XML/src/xmlrole.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-#ifndef XmlRole_INCLUDED
-#define XmlRole_INCLUDED 1
-
-#ifdef __VMS
-/* 0 1 2 3 0 1 2 3
- 1234567890123456789012345678901 1234567890123456789012345678901 */
-#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt
-#endif
-
-#include "xmltok.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum {
- XML_ROLE_ERROR = -1,
- XML_ROLE_NONE = 0,
- XML_ROLE_XML_DECL,
- XML_ROLE_INSTANCE_START,
- XML_ROLE_DOCTYPE_NONE,
- XML_ROLE_DOCTYPE_NAME,
- XML_ROLE_DOCTYPE_SYSTEM_ID,
- XML_ROLE_DOCTYPE_PUBLIC_ID,
- XML_ROLE_DOCTYPE_INTERNAL_SUBSET,
- XML_ROLE_DOCTYPE_CLOSE,
- XML_ROLE_GENERAL_ENTITY_NAME,
- XML_ROLE_PARAM_ENTITY_NAME,
- XML_ROLE_ENTITY_NONE,
- XML_ROLE_ENTITY_VALUE,
- XML_ROLE_ENTITY_SYSTEM_ID,
- XML_ROLE_ENTITY_PUBLIC_ID,
- XML_ROLE_ENTITY_COMPLETE,
- XML_ROLE_ENTITY_NOTATION_NAME,
- XML_ROLE_NOTATION_NONE,
- XML_ROLE_NOTATION_NAME,
- XML_ROLE_NOTATION_SYSTEM_ID,
- XML_ROLE_NOTATION_NO_SYSTEM_ID,
- XML_ROLE_NOTATION_PUBLIC_ID,
- XML_ROLE_ATTRIBUTE_NAME,
- XML_ROLE_ATTRIBUTE_TYPE_CDATA,
- XML_ROLE_ATTRIBUTE_TYPE_ID,
- XML_ROLE_ATTRIBUTE_TYPE_IDREF,
- XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
- XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
- XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
- XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
- XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
- XML_ROLE_ATTRIBUTE_ENUM_VALUE,
- XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
- XML_ROLE_ATTLIST_NONE,
- XML_ROLE_ATTLIST_ELEMENT_NAME,
- XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
- XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
- XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
- XML_ROLE_FIXED_ATTRIBUTE_VALUE,
- XML_ROLE_ELEMENT_NONE,
- XML_ROLE_ELEMENT_NAME,
- XML_ROLE_CONTENT_ANY,
- XML_ROLE_CONTENT_EMPTY,
- XML_ROLE_CONTENT_PCDATA,
- XML_ROLE_GROUP_OPEN,
- XML_ROLE_GROUP_CLOSE,
- XML_ROLE_GROUP_CLOSE_REP,
- XML_ROLE_GROUP_CLOSE_OPT,
- XML_ROLE_GROUP_CLOSE_PLUS,
- XML_ROLE_GROUP_CHOICE,
- XML_ROLE_GROUP_SEQUENCE,
- XML_ROLE_CONTENT_ELEMENT,
- XML_ROLE_CONTENT_ELEMENT_REP,
- XML_ROLE_CONTENT_ELEMENT_OPT,
- XML_ROLE_CONTENT_ELEMENT_PLUS,
- XML_ROLE_PI,
- XML_ROLE_COMMENT,
-#ifdef XML_DTD
- XML_ROLE_TEXT_DECL,
- XML_ROLE_IGNORE_SECT,
- XML_ROLE_INNER_PARAM_ENTITY_REF,
-#endif /* XML_DTD */
- XML_ROLE_PARAM_ENTITY_REF
-};
-
-typedef struct prolog_state {
- int (PTRCALL *handler) (struct prolog_state *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc);
- unsigned level;
- int role_none;
-#ifdef XML_DTD
- unsigned includeLevel;
- int documentEntity;
- int inEntityValue;
-#endif /* XML_DTD */
-} PROLOG_STATE;
-
-void XmlPrologStateInit(PROLOG_STATE *);
-#ifdef XML_DTD
-void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
-#endif /* XML_DTD */
-
-#define XmlTokenRole(state, tok, ptr, end, enc) \
- (((state)->handler)(state, tok, ptr, end, enc))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* not XmlRole_INCLUDED */
diff --git a/Utilities/Poco/XML/src/xmltok.c b/Utilities/Poco/XML/src/xmltok.c
deleted file mode 100755
index 44d1309036..0000000000
--- a/Utilities/Poco/XML/src/xmltok.c
+++ /dev/null
@@ -1,1651 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-#include <stddef.h>
-
-#ifdef COMPILED_FROM_DSP
-#include "winconfig.h"
-#elif defined(MACOS_CLASSIC)
-#include "macconfig.h"
-#elif defined(__amigaos4__)
-#include "amigaconfig.h"
-#elif defined(__WATCOMC__)
-#include "watcomconfig.h"
-#else
-#ifdef HAVE_EXPAT_CONFIG_H
-#include "expat_config.h"
-#endif
-#endif /* ndef COMPILED_FROM_DSP */
-
-#include "Poco/XML/expat_external.h"
-#include "internal.h"
-#include "xmltok.h"
-#include "nametab.h"
-
-#ifdef XML_DTD
-#define IGNORE_SECTION_TOK_VTABLE , PREFIX(ignoreSectionTok)
-#else
-#define IGNORE_SECTION_TOK_VTABLE /* as nothing */
-#endif
-
-#define VTABLE1 \
- { PREFIX(prologTok), PREFIX(contentTok), \
- PREFIX(cdataSectionTok) IGNORE_SECTION_TOK_VTABLE }, \
- { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \
- PREFIX(sameName), \
- PREFIX(nameMatchesAscii), \
- PREFIX(nameLength), \
- PREFIX(skipS), \
- PREFIX(getAtts), \
- PREFIX(charRefNumber), \
- PREFIX(predefinedEntityName), \
- PREFIX(updatePosition), \
- PREFIX(isPublicId)
-
-#define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16)
-
-#define UCS2_GET_NAMING(pages, hi, lo) \
- (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1 << ((lo) & 0x1F)))
-
-/* A 2 byte UTF-8 representation splits the characters 11 bits between
- the bottom 5 and 6 bits of the bytes. We need 8 bits to index into
- pages, 3 bits to add to that index and 5 bits to generate the mask.
-*/
-#define UTF8_GET_NAMING2(pages, byte) \
- (namingBitmap[((pages)[(((byte)[0]) >> 2) & 7] << 3) \
- + ((((byte)[0]) & 3) << 1) \
- + ((((byte)[1]) >> 5) & 1)] \
- & (1 << (((byte)[1]) & 0x1F)))
-
-/* A 3 byte UTF-8 representation splits the characters 16 bits between
- the bottom 4, 6 and 6 bits of the bytes. We need 8 bits to index
- into pages, 3 bits to add to that index and 5 bits to generate the
- mask.
-*/
-#define UTF8_GET_NAMING3(pages, byte) \
- (namingBitmap[((pages)[((((byte)[0]) & 0xF) << 4) \
- + ((((byte)[1]) >> 2) & 0xF)] \
- << 3) \
- + ((((byte)[1]) & 3) << 1) \
- + ((((byte)[2]) >> 5) & 1)] \
- & (1 << (((byte)[2]) & 0x1F)))
-
-#define UTF8_GET_NAMING(pages, p, n) \
- ((n) == 2 \
- ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \
- : ((n) == 3 \
- ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) \
- : 0))
-
-/* Detection of invalid UTF-8 sequences is based on Table 3.1B
- of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/
- with the additional restriction of not allowing the Unicode
- code points 0xFFFF and 0xFFFE (sequences EF,BF,BF and EF,BF,BE).
- Implementation details:
- (A & 0x80) == 0 means A < 0x80
- and
- (A & 0xC0) == 0xC0 means A > 0xBF
-*/
-
-#define UTF8_INVALID2(p) \
- ((*p) < 0xC2 || ((p)[1] & 0x80) == 0 || ((p)[1] & 0xC0) == 0xC0)
-
-#define UTF8_INVALID3(p) \
- (((p)[2] & 0x80) == 0 \
- || \
- ((*p) == 0xEF && (p)[1] == 0xBF \
- ? \
- (p)[2] > 0xBD \
- : \
- ((p)[2] & 0xC0) == 0xC0) \
- || \
- ((*p) == 0xE0 \
- ? \
- (p)[1] < 0xA0 || ((p)[1] & 0xC0) == 0xC0 \
- : \
- ((p)[1] & 0x80) == 0 \
- || \
- ((*p) == 0xED ? (p)[1] > 0x9F : ((p)[1] & 0xC0) == 0xC0)))
-
-#define UTF8_INVALID4(p) \
- (((p)[3] & 0x80) == 0 || ((p)[3] & 0xC0) == 0xC0 \
- || \
- ((p)[2] & 0x80) == 0 || ((p)[2] & 0xC0) == 0xC0 \
- || \
- ((*p) == 0xF0 \
- ? \
- (p)[1] < 0x90 || ((p)[1] & 0xC0) == 0xC0 \
- : \
- ((p)[1] & 0x80) == 0 \
- || \
- ((*p) == 0xF4 ? (p)[1] > 0x8F : ((p)[1] & 0xC0) == 0xC0)))
-
-static int PTRFASTCALL
-isNever(const ENCODING *enc, const char *p)
-{
- return 0;
-}
-
-static int PTRFASTCALL
-utf8_isName2(const ENCODING *enc, const char *p)
-{
- return UTF8_GET_NAMING2(namePages, (const unsigned char *)p);
-}
-
-static int PTRFASTCALL
-utf8_isName3(const ENCODING *enc, const char *p)
-{
- return UTF8_GET_NAMING3(namePages, (const unsigned char *)p);
-}
-
-#define utf8_isName4 isNever
-
-static int PTRFASTCALL
-utf8_isNmstrt2(const ENCODING *enc, const char *p)
-{
- return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p);
-}
-
-static int PTRFASTCALL
-utf8_isNmstrt3(const ENCODING *enc, const char *p)
-{
- return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p);
-}
-
-#define utf8_isNmstrt4 isNever
-
-static int PTRFASTCALL
-utf8_isInvalid2(const ENCODING *enc, const char *p)
-{
- return UTF8_INVALID2((const unsigned char *)p);
-}
-
-static int PTRFASTCALL
-utf8_isInvalid3(const ENCODING *enc, const char *p)
-{
- return UTF8_INVALID3((const unsigned char *)p);
-}
-
-static int PTRFASTCALL
-utf8_isInvalid4(const ENCODING *enc, const char *p)
-{
- return UTF8_INVALID4((const unsigned char *)p);
-}
-
-struct normal_encoding {
- ENCODING enc;
- unsigned char type[256];
-#ifdef XML_MIN_SIZE
- int (PTRFASTCALL *byteType)(const ENCODING *, const char *);
- int (PTRFASTCALL *isNameMin)(const ENCODING *, const char *);
- int (PTRFASTCALL *isNmstrtMin)(const ENCODING *, const char *);
- int (PTRFASTCALL *byteToAscii)(const ENCODING *, const char *);
- int (PTRCALL *charMatches)(const ENCODING *, const char *, int);
-#endif /* XML_MIN_SIZE */
- int (PTRFASTCALL *isName2)(const ENCODING *, const char *);
- int (PTRFASTCALL *isName3)(const ENCODING *, const char *);
- int (PTRFASTCALL *isName4)(const ENCODING *, const char *);
- int (PTRFASTCALL *isNmstrt2)(const ENCODING *, const char *);
- int (PTRFASTCALL *isNmstrt3)(const ENCODING *, const char *);
- int (PTRFASTCALL *isNmstrt4)(const ENCODING *, const char *);
- int (PTRFASTCALL *isInvalid2)(const ENCODING *, const char *);
- int (PTRFASTCALL *isInvalid3)(const ENCODING *, const char *);
- int (PTRFASTCALL *isInvalid4)(const ENCODING *, const char *);
-};
-
-#define AS_NORMAL_ENCODING(enc) ((const struct normal_encoding *) (enc))
-
-#ifdef XML_MIN_SIZE
-
-#define STANDARD_VTABLE(E) \
- E ## byteType, \
- E ## isNameMin, \
- E ## isNmstrtMin, \
- E ## byteToAscii, \
- E ## charMatches,
-
-#else
-
-#define STANDARD_VTABLE(E) /* as nothing */
-
-#endif
-
-#define NORMAL_VTABLE(E) \
- E ## isName2, \
- E ## isName3, \
- E ## isName4, \
- E ## isNmstrt2, \
- E ## isNmstrt3, \
- E ## isNmstrt4, \
- E ## isInvalid2, \
- E ## isInvalid3, \
- E ## isInvalid4
-
-static int FASTCALL checkCharRefNumber(int);
-
-#include "xmltok_impl.h"
-#include "ascii.h"
-
-#ifdef XML_MIN_SIZE
-#define sb_isNameMin isNever
-#define sb_isNmstrtMin isNever
-#endif
-
-#ifdef XML_MIN_SIZE
-#define MINBPC(enc) ((enc)->minBytesPerChar)
-#else
-/* minimum bytes per character */
-#define MINBPC(enc) 1
-#endif
-
-#define SB_BYTE_TYPE(enc, p) \
- (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
-
-#ifdef XML_MIN_SIZE
-static int PTRFASTCALL
-sb_byteType(const ENCODING *enc, const char *p)
-{
- return SB_BYTE_TYPE(enc, p);
-}
-#define BYTE_TYPE(enc, p) \
- (AS_NORMAL_ENCODING(enc)->byteType(enc, p))
-#else
-#define BYTE_TYPE(enc, p) SB_BYTE_TYPE(enc, p)
-#endif
-
-#ifdef XML_MIN_SIZE
-#define BYTE_TO_ASCII(enc, p) \
- (AS_NORMAL_ENCODING(enc)->byteToAscii(enc, p))
-static int PTRFASTCALL
-sb_byteToAscii(const ENCODING *enc, const char *p)
-{
- return *p;
-}
-#else
-#define BYTE_TO_ASCII(enc, p) (*(p))
-#endif
-
-#define IS_NAME_CHAR(enc, p, n) \
- (AS_NORMAL_ENCODING(enc)->isName ## n(enc, p))
-#define IS_NMSTRT_CHAR(enc, p, n) \
- (AS_NORMAL_ENCODING(enc)->isNmstrt ## n(enc, p))
-#define IS_INVALID_CHAR(enc, p, n) \
- (AS_NORMAL_ENCODING(enc)->isInvalid ## n(enc, p))
-
-#ifdef XML_MIN_SIZE
-#define IS_NAME_CHAR_MINBPC(enc, p) \
- (AS_NORMAL_ENCODING(enc)->isNameMin(enc, p))
-#define IS_NMSTRT_CHAR_MINBPC(enc, p) \
- (AS_NORMAL_ENCODING(enc)->isNmstrtMin(enc, p))
-#else
-#define IS_NAME_CHAR_MINBPC(enc, p) (0)
-#define IS_NMSTRT_CHAR_MINBPC(enc, p) (0)
-#endif
-
-#ifdef XML_MIN_SIZE
-#define CHAR_MATCHES(enc, p, c) \
- (AS_NORMAL_ENCODING(enc)->charMatches(enc, p, c))
-static int PTRCALL
-sb_charMatches(const ENCODING *enc, const char *p, int c)
-{
- return *p == c;
-}
-#else
-/* c is an ASCII character */
-#define CHAR_MATCHES(enc, p, c) (*(p) == c)
-#endif
-
-#define PREFIX(ident) normal_ ## ident
-#define XML_TOK_IMPL_C
-#include "xmltok_impl.c"
-#undef XML_TOK_IMPL_C
-
-#undef MINBPC
-#undef BYTE_TYPE
-#undef BYTE_TO_ASCII
-#undef CHAR_MATCHES
-#undef IS_NAME_CHAR
-#undef IS_NAME_CHAR_MINBPC
-#undef IS_NMSTRT_CHAR
-#undef IS_NMSTRT_CHAR_MINBPC
-#undef IS_INVALID_CHAR
-
-enum { /* UTF8_cvalN is value of masked first byte of N byte sequence */
- UTF8_cval1 = 0x00,
- UTF8_cval2 = 0xc0,
- UTF8_cval3 = 0xe0,
- UTF8_cval4 = 0xf0
-};
-
-static void PTRCALL
-utf8_toUtf8(const ENCODING *enc,
- const char **fromP, const char *fromLim,
- char **toP, const char *toLim)
-{
- char *to;
- const char *from;
- if (fromLim - *fromP > toLim - *toP) {
- /* Avoid copying partial characters. */
- for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--)
- if (((unsigned char)fromLim[-1] & 0xc0) != 0x80)
- break;
- }
- for (to = *toP, from = *fromP; from != fromLim; from++, to++)
- *to = *from;
- *fromP = from;
- *toP = to;
-}
-
-static void PTRCALL
-utf8_toUtf16(const ENCODING *enc,
- const char **fromP, const char *fromLim,
- unsigned short **toP, const unsigned short *toLim)
-{
- unsigned short *to = *toP;
- const char *from = *fromP;
- while (from != fromLim && to != toLim) {
- switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) {
- case BT_LEAD2:
- *to++ = (unsigned short)(((from[0] & 0x1f) << 6) | (from[1] & 0x3f));
- from += 2;
- break;
- case BT_LEAD3:
- *to++ = (unsigned short)(((from[0] & 0xf) << 12)
- | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f));
- from += 3;
- break;
- case BT_LEAD4:
- {
- unsigned long n;
- if (to + 1 == toLim)
- goto after;
- n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12)
- | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f);
- n -= 0x10000;
- to[0] = (unsigned short)((n >> 10) | 0xD800);
- to[1] = (unsigned short)((n & 0x3FF) | 0xDC00);
- to += 2;
- from += 4;
- }
- break;
- default:
- *to++ = *from++;
- break;
- }
- }
-after:
- *fromP = from;
- *toP = to;
-}
-
-#ifdef XML_NS
-static const struct normal_encoding utf8_encoding_ns = {
- { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 },
- {
-#include "asciitab.h"
-#include "utf8tab.h"
- },
- STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_)
-};
-#endif
-
-static const struct normal_encoding utf8_encoding = {
- { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 },
- {
-#define BT_COLON BT_NMSTRT
-#include "asciitab.h"
-#undef BT_COLON
-#include "utf8tab.h"
- },
- STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_)
-};
-
-#ifdef XML_NS
-
-static const struct normal_encoding internal_utf8_encoding_ns = {
- { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 },
- {
-#include "iasciitab.h"
-#include "utf8tab.h"
- },
- STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_)
-};
-
-#endif
-
-static const struct normal_encoding internal_utf8_encoding = {
- { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 },
- {
-#define BT_COLON BT_NMSTRT
-#include "iasciitab.h"
-#undef BT_COLON
-#include "utf8tab.h"
- },
- STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_)
-};
-
-static void PTRCALL
-latin1_toUtf8(const ENCODING *enc,
- const char **fromP, const char *fromLim,
- char **toP, const char *toLim)
-{
- for (;;) {
- unsigned char c;
- if (*fromP == fromLim)
- break;
- c = (unsigned char)**fromP;
- if (c & 0x80) {
- if (toLim - *toP < 2)
- break;
- *(*toP)++ = (char)((c >> 6) | UTF8_cval2);
- *(*toP)++ = (char)((c & 0x3f) | 0x80);
- (*fromP)++;
- }
- else {
- if (*toP == toLim)
- break;
- *(*toP)++ = *(*fromP)++;
- }
- }
-}
-
-static void PTRCALL
-latin1_toUtf16(const ENCODING *enc,
- const char **fromP, const char *fromLim,
- unsigned short **toP, const unsigned short *toLim)
-{
- while (*fromP != fromLim && *toP != toLim)
- *(*toP)++ = (unsigned char)*(*fromP)++;
-}
-
-#ifdef XML_NS
-
-static const struct normal_encoding latin1_encoding_ns = {
- { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 },
- {
-#include "asciitab.h"
-#include "latin1tab.h"
- },
- STANDARD_VTABLE(sb_)
-};
-
-#endif
-
-static const struct normal_encoding latin1_encoding = {
- { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 },
- {
-#define BT_COLON BT_NMSTRT
-#include "asciitab.h"
-#undef BT_COLON
-#include "latin1tab.h"
- },
- STANDARD_VTABLE(sb_)
-};
-
-static void PTRCALL
-ascii_toUtf8(const ENCODING *enc,
- const char **fromP, const char *fromLim,
- char **toP, const char *toLim)
-{
- while (*fromP != fromLim && *toP != toLim)
- *(*toP)++ = *(*fromP)++;
-}
-
-#ifdef XML_NS
-
-static const struct normal_encoding ascii_encoding_ns = {
- { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 },
- {
-#include "asciitab.h"
-/* BT_NONXML == 0 */
- },
- STANDARD_VTABLE(sb_)
-};
-
-#endif
-
-static const struct normal_encoding ascii_encoding = {
- { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 },
- {
-#define BT_COLON BT_NMSTRT
-#include "asciitab.h"
-#undef BT_COLON
-/* BT_NONXML == 0 */
- },
- STANDARD_VTABLE(sb_)
-};
-
-static int PTRFASTCALL
-unicode_byte_type(char hi, char lo)
-{
- switch ((unsigned char)hi) {
- case 0xD8: case 0xD9: case 0xDA: case 0xDB:
- return BT_LEAD4;
- case 0xDC: case 0xDD: case 0xDE: case 0xDF:
- return BT_TRAIL;
- case 0xFF:
- switch ((unsigned char)lo) {
- case 0xFF:
- case 0xFE:
- return BT_NONXML;
- }
- break;
- }
- return BT_NONASCII;
-}
-
-#define DEFINE_UTF16_TO_UTF8(E) \
-static void PTRCALL \
-E ## toUtf8(const ENCODING *enc, \
- const char **fromP, const char *fromLim, \
- char **toP, const char *toLim) \
-{ \
- const char *from; \
- for (from = *fromP; from != fromLim; from += 2) { \
- int plane; \
- unsigned char lo2; \
- unsigned char lo = GET_LO(from); \
- unsigned char hi = GET_HI(from); \
- switch (hi) { \
- case 0: \
- if (lo < 0x80) { \
- if (*toP == toLim) { \
- *fromP = from; \
- return; \
- } \
- *(*toP)++ = lo; \
- break; \
- } \
- /* fall through */ \
- case 0x1: case 0x2: case 0x3: \
- case 0x4: case 0x5: case 0x6: case 0x7: \
- if (toLim - *toP < 2) { \
- *fromP = from; \
- return; \
- } \
- *(*toP)++ = ((lo >> 6) | (hi << 2) | UTF8_cval2); \
- *(*toP)++ = ((lo & 0x3f) | 0x80); \
- break; \
- default: \
- if (toLim - *toP < 3) { \
- *fromP = from; \
- return; \
- } \
- /* 16 bits divided 4, 6, 6 amongst 3 bytes */ \
- *(*toP)++ = ((hi >> 4) | UTF8_cval3); \
- *(*toP)++ = (((hi & 0xf) << 2) | (lo >> 6) | 0x80); \
- *(*toP)++ = ((lo & 0x3f) | 0x80); \
- break; \
- case 0xD8: case 0xD9: case 0xDA: case 0xDB: \
- if (toLim - *toP < 4) { \
- *fromP = from; \
- return; \
- } \
- plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \
- *(*toP)++ = ((plane >> 2) | UTF8_cval4); \
- *(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \
- from += 2; \
- lo2 = GET_LO(from); \
- *(*toP)++ = (((lo & 0x3) << 4) \
- | ((GET_HI(from) & 0x3) << 2) \
- | (lo2 >> 6) \
- | 0x80); \
- *(*toP)++ = ((lo2 & 0x3f) | 0x80); \
- break; \
- } \
- } \
- *fromP = from; \
-}
-
-#define DEFINE_UTF16_TO_UTF16(E) \
-static void PTRCALL \
-E ## toUtf16(const ENCODING *enc, \
- const char **fromP, const char *fromLim, \
- unsigned short **toP, const unsigned short *toLim) \
-{ \
- /* Avoid copying first half only of surrogate */ \
- if (fromLim - *fromP > ((toLim - *toP) << 1) \
- && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \
- fromLim -= 2; \
- for (; *fromP != fromLim && *toP != toLim; *fromP += 2) \
- *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \
-}
-
-#define SET2(ptr, ch) \
- (((ptr)[0] = ((ch) & 0xff)), ((ptr)[1] = ((ch) >> 8)))
-#define GET_LO(ptr) ((unsigned char)(ptr)[0])
-#define GET_HI(ptr) ((unsigned char)(ptr)[1])
-
-DEFINE_UTF16_TO_UTF8(little2_)
-DEFINE_UTF16_TO_UTF16(little2_)
-
-#undef SET2
-#undef GET_LO
-#undef GET_HI
-
-#define SET2(ptr, ch) \
- (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch) & 0xFF)))
-#define GET_LO(ptr) ((unsigned char)(ptr)[1])
-#define GET_HI(ptr) ((unsigned char)(ptr)[0])
-
-DEFINE_UTF16_TO_UTF8(big2_)
-DEFINE_UTF16_TO_UTF16(big2_)
-
-#undef SET2
-#undef GET_LO
-#undef GET_HI
-
-#define LITTLE2_BYTE_TYPE(enc, p) \
- ((p)[1] == 0 \
- ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \
- : unicode_byte_type((p)[1], (p)[0]))
-#define LITTLE2_BYTE_TO_ASCII(enc, p) ((p)[1] == 0 ? (p)[0] : -1)
-#define LITTLE2_CHAR_MATCHES(enc, p, c) ((p)[1] == 0 && (p)[0] == c)
-#define LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) \
- UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0])
-#define LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) \
- UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0])
-
-#ifdef XML_MIN_SIZE
-
-static int PTRFASTCALL
-little2_byteType(const ENCODING *enc, const char *p)
-{
- return LITTLE2_BYTE_TYPE(enc, p);
-}
-
-static int PTRFASTCALL
-little2_byteToAscii(const ENCODING *enc, const char *p)
-{
- return LITTLE2_BYTE_TO_ASCII(enc, p);
-}
-
-static int PTRCALL
-little2_charMatches(const ENCODING *enc, const char *p, int c)
-{
- return LITTLE2_CHAR_MATCHES(enc, p, c);
-}
-
-static int PTRFASTCALL
-little2_isNameMin(const ENCODING *enc, const char *p)
-{
- return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p);
-}
-
-static int PTRFASTCALL
-little2_isNmstrtMin(const ENCODING *enc, const char *p)
-{
- return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p);
-}
-
-#undef VTABLE
-#define VTABLE VTABLE1, little2_toUtf8, little2_toUtf16
-
-#else /* not XML_MIN_SIZE */
-
-#undef PREFIX
-#define PREFIX(ident) little2_ ## ident
-#define MINBPC(enc) 2
-/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */
-#define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p)
-#define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p)
-#define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c)
-#define IS_NAME_CHAR(enc, p, n) 0
-#define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p)
-#define IS_NMSTRT_CHAR(enc, p, n) (0)
-#define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p)
-
-#define XML_TOK_IMPL_C
-#include "xmltok_impl.c"
-#undef XML_TOK_IMPL_C
-
-#undef MINBPC
-#undef BYTE_TYPE
-#undef BYTE_TO_ASCII
-#undef CHAR_MATCHES
-#undef IS_NAME_CHAR
-#undef IS_NAME_CHAR_MINBPC
-#undef IS_NMSTRT_CHAR
-#undef IS_NMSTRT_CHAR_MINBPC
-#undef IS_INVALID_CHAR
-
-#endif /* not XML_MIN_SIZE */
-
-#ifdef XML_NS
-
-static const struct normal_encoding little2_encoding_ns = {
- { VTABLE, 2, 0,
-#if BYTEORDER == 1234
- 1
-#else
- 0
-#endif
- },
- {
-#include "asciitab.h"
-#include "latin1tab.h"
- },
- STANDARD_VTABLE(little2_)
-};
-
-#endif
-
-static const struct normal_encoding little2_encoding = {
- { VTABLE, 2, 0,
-#if BYTEORDER == 1234
- 1
-#else
- 0
-#endif
- },
- {
-#define BT_COLON BT_NMSTRT
-#include "asciitab.h"
-#undef BT_COLON
-#include "latin1tab.h"
- },
- STANDARD_VTABLE(little2_)
-};
-
-#if BYTEORDER != 4321
-
-#ifdef XML_NS
-
-static const struct normal_encoding internal_little2_encoding_ns = {
- { VTABLE, 2, 0, 1 },
- {
-#include "iasciitab.h"
-#include "latin1tab.h"
- },
- STANDARD_VTABLE(little2_)
-};
-
-#endif
-
-static const struct normal_encoding internal_little2_encoding = {
- { VTABLE, 2, 0, 1 },
- {
-#define BT_COLON BT_NMSTRT
-#include "iasciitab.h"
-#undef BT_COLON
-#include "latin1tab.h"
- },
- STANDARD_VTABLE(little2_)
-};
-
-#endif
-
-
-#define BIG2_BYTE_TYPE(enc, p) \
- ((p)[0] == 0 \
- ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \
- : unicode_byte_type((p)[0], (p)[1]))
-#define BIG2_BYTE_TO_ASCII(enc, p) ((p)[0] == 0 ? (p)[1] : -1)
-#define BIG2_CHAR_MATCHES(enc, p, c) ((p)[0] == 0 && (p)[1] == c)
-#define BIG2_IS_NAME_CHAR_MINBPC(enc, p) \
- UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1])
-#define BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) \
- UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1])
-
-#ifdef XML_MIN_SIZE
-
-static int PTRFASTCALL
-big2_byteType(const ENCODING *enc, const char *p)
-{
- return BIG2_BYTE_TYPE(enc, p);
-}
-
-static int PTRFASTCALL
-big2_byteToAscii(const ENCODING *enc, const char *p)
-{
- return BIG2_BYTE_TO_ASCII(enc, p);
-}
-
-static int PTRCALL
-big2_charMatches(const ENCODING *enc, const char *p, int c)
-{
- return BIG2_CHAR_MATCHES(enc, p, c);
-}
-
-static int PTRFASTCALL
-big2_isNameMin(const ENCODING *enc, const char *p)
-{
- return BIG2_IS_NAME_CHAR_MINBPC(enc, p);
-}
-
-static int PTRFASTCALL
-big2_isNmstrtMin(const ENCODING *enc, const char *p)
-{
- return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p);
-}
-
-#undef VTABLE
-#define VTABLE VTABLE1, big2_toUtf8, big2_toUtf16
-
-#else /* not XML_MIN_SIZE */
-
-#undef PREFIX
-#define PREFIX(ident) big2_ ## ident
-#define MINBPC(enc) 2
-/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */
-#define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p)
-#define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p)
-#define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c)
-#define IS_NAME_CHAR(enc, p, n) 0
-#define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p)
-#define IS_NMSTRT_CHAR(enc, p, n) (0)
-#define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p)
-
-#define XML_TOK_IMPL_C
-#include "xmltok_impl.c"
-#undef XML_TOK_IMPL_C
-
-#undef MINBPC
-#undef BYTE_TYPE
-#undef BYTE_TO_ASCII
-#undef CHAR_MATCHES
-#undef IS_NAME_CHAR
-#undef IS_NAME_CHAR_MINBPC
-#undef IS_NMSTRT_CHAR
-#undef IS_NMSTRT_CHAR_MINBPC
-#undef IS_INVALID_CHAR
-
-#endif /* not XML_MIN_SIZE */
-
-#ifdef XML_NS
-
-static const struct normal_encoding big2_encoding_ns = {
- { VTABLE, 2, 0,
-#if BYTEORDER == 4321
- 1
-#else
- 0
-#endif
- },
- {
-#include "asciitab.h"
-#include "latin1tab.h"
- },
- STANDARD_VTABLE(big2_)
-};
-
-#endif
-
-static const struct normal_encoding big2_encoding = {
- { VTABLE, 2, 0,
-#if BYTEORDER == 4321
- 1
-#else
- 0
-#endif
- },
- {
-#define BT_COLON BT_NMSTRT
-#include "asciitab.h"
-#undef BT_COLON
-#include "latin1tab.h"
- },
- STANDARD_VTABLE(big2_)
-};
-
-#if BYTEORDER != 1234
-
-#ifdef XML_NS
-
-static const struct normal_encoding internal_big2_encoding_ns = {
- { VTABLE, 2, 0, 1 },
- {
-#include "iasciitab.h"
-#include "latin1tab.h"
- },
- STANDARD_VTABLE(big2_)
-};
-
-#endif
-
-static const struct normal_encoding internal_big2_encoding = {
- { VTABLE, 2, 0, 1 },
- {
-#define BT_COLON BT_NMSTRT
-#include "iasciitab.h"
-#undef BT_COLON
-#include "latin1tab.h"
- },
- STANDARD_VTABLE(big2_)
-};
-
-#endif
-
-#undef PREFIX
-
-static int FASTCALL
-streqci(const char *s1, const char *s2)
-{
- for (;;) {
- char c1 = *s1++;
- char c2 = *s2++;
- if (ASCII_a <= c1 && c1 <= ASCII_z)
- c1 += ASCII_A - ASCII_a;
- if (ASCII_a <= c2 && c2 <= ASCII_z)
- c2 += ASCII_A - ASCII_a;
- if (c1 != c2)
- return 0;
- if (!c1)
- break;
- }
- return 1;
-}
-
-static void PTRCALL
-initUpdatePosition(const ENCODING *enc, const char *ptr,
- const char *end, POSITION *pos)
-{
- normal_updatePosition(&utf8_encoding.enc, ptr, end, pos);
-}
-
-static int
-toAscii(const ENCODING *enc, const char *ptr, const char *end)
-{
- char buf[1];
- char *p = buf;
- XmlUtf8Convert(enc, &ptr, end, &p, p + 1);
- if (p == buf)
- return -1;
- else
- return buf[0];
-}
-
-static int FASTCALL
-isSpace(int c)
-{
- switch (c) {
- case 0x20:
- case 0xD:
- case 0xA:
- case 0x9:
- return 1;
- }
- return 0;
-}
-
-/* Return 1 if there's just optional white space or there's an S
- followed by name=val.
-*/
-static int
-parsePseudoAttribute(const ENCODING *enc,
- const char *ptr,
- const char *end,
- const char **namePtr,
- const char **nameEndPtr,
- const char **valPtr,
- const char **nextTokPtr)
-{
- int c;
- char open;
- if (ptr == end) {
- *namePtr = NULL;
- return 1;
- }
- if (!isSpace(toAscii(enc, ptr, end))) {
- *nextTokPtr = ptr;
- return 0;
- }
- do {
- ptr += enc->minBytesPerChar;
- } while (isSpace(toAscii(enc, ptr, end)));
- if (ptr == end) {
- *namePtr = NULL;
- return 1;
- }
- *namePtr = ptr;
- for (;;) {
- c = toAscii(enc, ptr, end);
- if (c == -1) {
- *nextTokPtr = ptr;
- return 0;
- }
- if (c == ASCII_EQUALS) {
- *nameEndPtr = ptr;
- break;
- }
- if (isSpace(c)) {
- *nameEndPtr = ptr;
- do {
- ptr += enc->minBytesPerChar;
- } while (isSpace(c = toAscii(enc, ptr, end)));
- if (c != ASCII_EQUALS) {
- *nextTokPtr = ptr;
- return 0;
- }
- break;
- }
- ptr += enc->minBytesPerChar;
- }
- if (ptr == *namePtr) {
- *nextTokPtr = ptr;
- return 0;
- }
- ptr += enc->minBytesPerChar;
- c = toAscii(enc, ptr, end);
- while (isSpace(c)) {
- ptr += enc->minBytesPerChar;
- c = toAscii(enc, ptr, end);
- }
- if (c != ASCII_QUOT && c != ASCII_APOS) {
- *nextTokPtr = ptr;
- return 0;
- }
- open = (char)c;
- ptr += enc->minBytesPerChar;
- *valPtr = ptr;
- for (;; ptr += enc->minBytesPerChar) {
- c = toAscii(enc, ptr, end);
- if (c == open)
- break;
- if (!(ASCII_a <= c && c <= ASCII_z)
- && !(ASCII_A <= c && c <= ASCII_Z)
- && !(ASCII_0 <= c && c <= ASCII_9)
- && c != ASCII_PERIOD
- && c != ASCII_MINUS
- && c != ASCII_UNDERSCORE) {
- *nextTokPtr = ptr;
- return 0;
- }
- }
- *nextTokPtr = ptr + enc->minBytesPerChar;
- return 1;
-}
-
-static const char KW_version[] = {
- ASCII_v, ASCII_e, ASCII_r, ASCII_s, ASCII_i, ASCII_o, ASCII_n, '\0'
-};
-
-static const char KW_encoding[] = {
- ASCII_e, ASCII_n, ASCII_c, ASCII_o, ASCII_d, ASCII_i, ASCII_n, ASCII_g, '\0'
-};
-
-static const char KW_standalone[] = {
- ASCII_s, ASCII_t, ASCII_a, ASCII_n, ASCII_d, ASCII_a, ASCII_l, ASCII_o,
- ASCII_n, ASCII_e, '\0'
-};
-
-static const char KW_yes[] = {
- ASCII_y, ASCII_e, ASCII_s, '\0'
-};
-
-static const char KW_no[] = {
- ASCII_n, ASCII_o, '\0'
-};
-
-static int
-doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *,
- const char *,
- const char *),
- int isGeneralTextEntity,
- const ENCODING *enc,
- const char *ptr,
- const char *end,
- const char **badPtr,
- const char **versionPtr,
- const char **versionEndPtr,
- const char **encodingName,
- const ENCODING **encoding,
- int *standalone)
-{
- const char *val = NULL;
- const char *name = NULL;
- const char *nameEnd = NULL;
- ptr += 5 * enc->minBytesPerChar;
- end -= 2 * enc->minBytesPerChar;
- if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)
- || !name) {
- *badPtr = ptr;
- return 0;
- }
- if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_version)) {
- if (!isGeneralTextEntity) {
- *badPtr = name;
- return 0;
- }
- }
- else {
- if (versionPtr)
- *versionPtr = val;
- if (versionEndPtr)
- *versionEndPtr = ptr;
- if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) {
- *badPtr = ptr;
- return 0;
- }
- if (!name) {
- if (isGeneralTextEntity) {
- /* a TextDecl must have an EncodingDecl */
- *badPtr = ptr;
- return 0;
- }
- return 1;
- }
- }
- if (XmlNameMatchesAscii(enc, name, nameEnd, KW_encoding)) {
- int c = toAscii(enc, val, end);
- if (!(ASCII_a <= c && c <= ASCII_z) && !(ASCII_A <= c && c <= ASCII_Z)) {
- *badPtr = val;
- return 0;
- }
- if (encodingName)
- *encodingName = val;
- if (encoding)
- *encoding = encodingFinder(enc, val, ptr - enc->minBytesPerChar);
- if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) {
- *badPtr = ptr;
- return 0;
- }
- if (!name)
- return 1;
- }
- if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_standalone)
- || isGeneralTextEntity) {
- *badPtr = name;
- return 0;
- }
- if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_yes)) {
- if (standalone)
- *standalone = 1;
- }
- else if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_no)) {
- if (standalone)
- *standalone = 0;
- }
- else {
- *badPtr = val;
- return 0;
- }
- while (isSpace(toAscii(enc, ptr, end)))
- ptr += enc->minBytesPerChar;
- if (ptr != end) {
- *badPtr = ptr;
- return 0;
- }
- return 1;
-}
-
-static int FASTCALL
-checkCharRefNumber(int result)
-{
- switch (result >> 8) {
- case 0xD8: case 0xD9: case 0xDA: case 0xDB:
- case 0xDC: case 0xDD: case 0xDE: case 0xDF:
- return -1;
- case 0:
- if (latin1_encoding.type[result] == BT_NONXML)
- return -1;
- break;
- case 0xFF:
- if (result == 0xFFFE || result == 0xFFFF)
- return -1;
- break;
- }
- return result;
-}
-
-int FASTCALL
-XmlUtf8Encode(int c, char *buf)
-{
- enum {
- /* minN is minimum legal resulting value for N byte sequence */
- min2 = 0x80,
- min3 = 0x800,
- min4 = 0x10000
- };
-
- if (c < 0)
- return 0;
- if (c < min2) {
- buf[0] = (char)(c | UTF8_cval1);
- return 1;
- }
- if (c < min3) {
- buf[0] = (char)((c >> 6) | UTF8_cval2);
- buf[1] = (char)((c & 0x3f) | 0x80);
- return 2;
- }
- if (c < min4) {
- buf[0] = (char)((c >> 12) | UTF8_cval3);
- buf[1] = (char)(((c >> 6) & 0x3f) | 0x80);
- buf[2] = (char)((c & 0x3f) | 0x80);
- return 3;
- }
- if (c < 0x110000) {
- buf[0] = (char)((c >> 18) | UTF8_cval4);
- buf[1] = (char)(((c >> 12) & 0x3f) | 0x80);
- buf[2] = (char)(((c >> 6) & 0x3f) | 0x80);
- buf[3] = (char)((c & 0x3f) | 0x80);
- return 4;
- }
- return 0;
-}
-
-int FASTCALL
-XmlUtf16Encode(int charNum, unsigned short *buf)
-{
- if (charNum < 0)
- return 0;
- if (charNum < 0x10000) {
- buf[0] = (unsigned short)charNum;
- return 1;
- }
- if (charNum < 0x110000) {
- charNum -= 0x10000;
- buf[0] = (unsigned short)((charNum >> 10) + 0xD800);
- buf[1] = (unsigned short)((charNum & 0x3FF) + 0xDC00);
- return 2;
- }
- return 0;
-}
-
-struct unknown_encoding {
- struct normal_encoding normal;
- CONVERTER convert;
- void *userData;
- unsigned short utf16[256];
- char utf8[256][4];
-};
-
-#define AS_UNKNOWN_ENCODING(enc) ((const struct unknown_encoding *) (enc))
-
-int
-XmlSizeOfUnknownEncoding(void)
-{
- return sizeof(struct unknown_encoding);
-}
-
-static int PTRFASTCALL
-unknown_isName(const ENCODING *enc, const char *p)
-{
- const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc);
- int c = uenc->convert(uenc->userData, p);
- if (c & ~0xFFFF)
- return 0;
- return UCS2_GET_NAMING(namePages, c >> 8, c & 0xFF);
-}
-
-static int PTRFASTCALL
-unknown_isNmstrt(const ENCODING *enc, const char *p)
-{
- const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc);
- int c = uenc->convert(uenc->userData, p);
- if (c & ~0xFFFF)
- return 0;
- return UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xFF);
-}
-
-static int PTRFASTCALL
-unknown_isInvalid(const ENCODING *enc, const char *p)
-{
- const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc);
- int c = uenc->convert(uenc->userData, p);
- return (c & ~0xFFFF) || checkCharRefNumber(c) < 0;
-}
-
-static void PTRCALL
-unknown_toUtf8(const ENCODING *enc,
- const char **fromP, const char *fromLim,
- char **toP, const char *toLim)
-{
- const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc);
- char buf[XML_UTF8_ENCODE_MAX];
- for (;;) {
- const char *utf8;
- int n;
- if (*fromP == fromLim)
- break;
- utf8 = uenc->utf8[(unsigned char)**fromP];
- n = *utf8++;
- if (n == 0) {
- int c = uenc->convert(uenc->userData, *fromP);
- n = XmlUtf8Encode(c, buf);
- if (n > toLim - *toP)
- break;
- utf8 = buf;
- *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP]
- - (BT_LEAD2 - 2));
- }
- else {
- if (n > toLim - *toP)
- break;
- (*fromP)++;
- }
- do {
- *(*toP)++ = *utf8++;
- } while (--n != 0);
- }
-}
-
-static void PTRCALL
-unknown_toUtf16(const ENCODING *enc,
- const char **fromP, const char *fromLim,
- unsigned short **toP, const unsigned short *toLim)
-{
- const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc);
- while (*fromP != fromLim && *toP != toLim) {
- unsigned short c = uenc->utf16[(unsigned char)**fromP];
- if (c == 0) {
- c = (unsigned short)
- uenc->convert(uenc->userData, *fromP);
- *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP]
- - (BT_LEAD2 - 2));
- }
- else
- (*fromP)++;
- *(*toP)++ = c;
- }
-}
-
-ENCODING *
-XmlInitUnknownEncoding(void *mem,
- int *table,
- CONVERTER convert,
- void *userData)
-{
- int i;
- struct unknown_encoding *e = (struct unknown_encoding *)mem;
- for (i = 0; i < (int)sizeof(struct normal_encoding); i++)
- ((char *)mem)[i] = ((char *)&latin1_encoding)[i];
- for (i = 0; i < 128; i++)
- if (latin1_encoding.type[i] != BT_OTHER
- && latin1_encoding.type[i] != BT_NONXML
- && table[i] != i)
- return 0;
- for (i = 0; i < 256; i++) {
- int c = table[i];
- if (c == -1) {
- e->normal.type[i] = BT_MALFORM;
- /* This shouldn't really get used. */
- e->utf16[i] = 0xFFFF;
- e->utf8[i][0] = 1;
- e->utf8[i][1] = 0;
- }
- else if (c < 0) {
- if (c < -4)
- return 0;
- e->normal.type[i] = (unsigned char)(BT_LEAD2 - (c + 2));
- e->utf8[i][0] = 0;
- e->utf16[i] = 0;
- }
- else if (c < 0x80) {
- if (latin1_encoding.type[c] != BT_OTHER
- && latin1_encoding.type[c] != BT_NONXML
- && c != i)
- return 0;
- e->normal.type[i] = latin1_encoding.type[c];
- e->utf8[i][0] = 1;
- e->utf8[i][1] = (char)c;
- e->utf16[i] = (unsigned short)(c == 0 ? 0xFFFF : c);
- }
- else if (checkCharRefNumber(c) < 0) {
- e->normal.type[i] = BT_NONXML;
- /* This shouldn't really get used. */
- e->utf16[i] = 0xFFFF;
- e->utf8[i][0] = 1;
- e->utf8[i][1] = 0;
- }
- else {
- if (c > 0xFFFF)
- return 0;
- if (UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xff))
- e->normal.type[i] = BT_NMSTRT;
- else if (UCS2_GET_NAMING(namePages, c >> 8, c & 0xff))
- e->normal.type[i] = BT_NAME;
- else
- e->normal.type[i] = BT_OTHER;
- e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1);
- e->utf16[i] = (unsigned short)c;
- }
- }
- e->userData = userData;
- e->convert = convert;
- if (convert) {
- e->normal.isName2 = unknown_isName;
- e->normal.isName3 = unknown_isName;
- e->normal.isName4 = unknown_isName;
- e->normal.isNmstrt2 = unknown_isNmstrt;
- e->normal.isNmstrt3 = unknown_isNmstrt;
- e->normal.isNmstrt4 = unknown_isNmstrt;
- e->normal.isInvalid2 = unknown_isInvalid;
- e->normal.isInvalid3 = unknown_isInvalid;
- e->normal.isInvalid4 = unknown_isInvalid;
- }
- e->normal.enc.utf8Convert = unknown_toUtf8;
- e->normal.enc.utf16Convert = unknown_toUtf16;
- return &(e->normal.enc);
-}
-
-/* If this enumeration is changed, getEncodingIndex and encodings
-must also be changed. */
-enum {
- UNKNOWN_ENC = -1,
- ISO_8859_1_ENC = 0,
- US_ASCII_ENC,
- UTF_8_ENC,
- UTF_16_ENC,
- UTF_16BE_ENC,
- UTF_16LE_ENC,
- /* must match encodingNames up to here */
- NO_ENC
-};
-
-static const char KW_ISO_8859_1[] = {
- ASCII_I, ASCII_S, ASCII_O, ASCII_MINUS, ASCII_8, ASCII_8, ASCII_5, ASCII_9,
- ASCII_MINUS, ASCII_1, '\0'
-};
-static const char KW_US_ASCII[] = {
- ASCII_U, ASCII_S, ASCII_MINUS, ASCII_A, ASCII_S, ASCII_C, ASCII_I, ASCII_I,
- '\0'
-};
-static const char KW_UTF_8[] = {
- ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_8, '\0'
-};
-static const char KW_UTF_16[] = {
- ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, '\0'
-};
-static const char KW_UTF_16BE[] = {
- ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_B, ASCII_E,
- '\0'
-};
-static const char KW_UTF_16LE[] = {
- ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_L, ASCII_E,
- '\0'
-};
-
-static int FASTCALL
-getEncodingIndex(const char *name)
-{
- static const char * const encodingNames[] = {
- KW_ISO_8859_1,
- KW_US_ASCII,
- KW_UTF_8,
- KW_UTF_16,
- KW_UTF_16BE,
- KW_UTF_16LE,
- };
- int i;
- if (name == NULL)
- return NO_ENC;
- for (i = 0; i < (int)(sizeof(encodingNames)/sizeof(encodingNames[0])); i++)
- if (streqci(name, encodingNames[i]))
- return i;
- return UNKNOWN_ENC;
-}
-
-/* For binary compatibility, we store the index of the encoding
- specified at initialization in the isUtf16 member.
-*/
-
-#define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16)
-#define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i)
-
-/* This is what detects the encoding. encodingTable maps from
- encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of
- the external (protocol) specified encoding; state is
- XML_CONTENT_STATE if we're parsing an external text entity, and
- XML_PROLOG_STATE otherwise.
-*/
-
-
-static int
-initScan(const ENCODING * const *encodingTable,
- const INIT_ENCODING *enc,
- int state,
- const char *ptr,
- const char *end,
- const char **nextTokPtr)
-{
- const ENCODING **encPtr;
-
- if (ptr == end)
- return XML_TOK_NONE;
- encPtr = enc->encPtr;
- if (ptr + 1 == end) {
- /* only a single byte available for auto-detection */
-#ifndef XML_DTD /* FIXME */
- /* a well-formed document entity must have more than one byte */
- if (state != XML_CONTENT_STATE)
- return XML_TOK_PARTIAL;
-#endif
- /* so we're parsing an external text entity... */
- /* if UTF-16 was externally specified, then we need at least 2 bytes */
- switch (INIT_ENC_INDEX(enc)) {
- case UTF_16_ENC:
- case UTF_16LE_ENC:
- case UTF_16BE_ENC:
- return XML_TOK_PARTIAL;
- }
- switch ((unsigned char)*ptr) {
- case 0xFE:
- case 0xFF:
- case 0xEF: /* possibly first byte of UTF-8 BOM */
- if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC
- && state == XML_CONTENT_STATE)
- break;
- /* fall through */
- case 0x00:
- case 0x3C:
- return XML_TOK_PARTIAL;
- }
- }
- else {
- switch (((unsigned char)ptr[0] << 8) | (unsigned char)ptr[1]) {
- case 0xFEFF:
- if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC
- && state == XML_CONTENT_STATE)
- break;
- *nextTokPtr = ptr + 2;
- *encPtr = encodingTable[UTF_16BE_ENC];
- return XML_TOK_BOM;
- /* 00 3C is handled in the default case */
- case 0x3C00:
- if ((INIT_ENC_INDEX(enc) == UTF_16BE_ENC
- || INIT_ENC_INDEX(enc) == UTF_16_ENC)
- && state == XML_CONTENT_STATE)
- break;
- *encPtr = encodingTable[UTF_16LE_ENC];
- return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
- case 0xFFFE:
- if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC
- && state == XML_CONTENT_STATE)
- break;
- *nextTokPtr = ptr + 2;
- *encPtr = encodingTable[UTF_16LE_ENC];
- return XML_TOK_BOM;
- case 0xEFBB:
- /* Maybe a UTF-8 BOM (EF BB BF) */
- /* If there's an explicitly specified (external) encoding
- of ISO-8859-1 or some flavour of UTF-16
- and this is an external text entity,
- don't look for the BOM,
- because it might be a legal data.
- */
- if (state == XML_CONTENT_STATE) {
- int e = INIT_ENC_INDEX(enc);
- if (e == ISO_8859_1_ENC || e == UTF_16BE_ENC
- || e == UTF_16LE_ENC || e == UTF_16_ENC)
- break;
- }
- if (ptr + 2 == end)
- return XML_TOK_PARTIAL;
- if ((unsigned char)ptr[2] == 0xBF) {
- *nextTokPtr = ptr + 3;
- *encPtr = encodingTable[UTF_8_ENC];
- return XML_TOK_BOM;
- }
- break;
- default:
- if (ptr[0] == '\0') {
- /* 0 isn't a legal data character. Furthermore a document
- entity can only start with ASCII characters. So the only
- way this can fail to be big-endian UTF-16 if it it's an
- external parsed general entity that's labelled as
- UTF-16LE.
- */
- if (state == XML_CONTENT_STATE && INIT_ENC_INDEX(enc) == UTF_16LE_ENC)
- break;
- *encPtr = encodingTable[UTF_16BE_ENC];
- return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
- }
- else if (ptr[1] == '\0') {
- /* We could recover here in the case:
- - parsing an external entity
- - second byte is 0
- - no externally specified encoding
- - no encoding declaration
- by assuming UTF-16LE. But we don't, because this would mean when
- presented just with a single byte, we couldn't reliably determine
- whether we needed further bytes.
- */
- if (state == XML_CONTENT_STATE)
- break;
- *encPtr = encodingTable[UTF_16LE_ENC];
- return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
- }
- break;
- }
- }
- *encPtr = encodingTable[INIT_ENC_INDEX(enc)];
- return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
-}
-
-
-#define NS(x) x
-#define ns(x) x
-#define XML_TOK_NS_C
-#include "xmltok_ns.c"
-#undef XML_TOK_NS_C
-#undef NS
-#undef ns
-
-#ifdef XML_NS
-
-#define NS(x) x ## NS
-#define ns(x) x ## _ns
-
-#define XML_TOK_NS_C
-#include "xmltok_ns.c"
-#undef XML_TOK_NS_C
-
-#undef NS
-#undef ns
-
-ENCODING *
-XmlInitUnknownEncodingNS(void *mem,
- int *table,
- CONVERTER convert,
- void *userData)
-{
- ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData);
- if (enc)
- ((struct normal_encoding *)enc)->type[ASCII_COLON] = BT_COLON;
- return enc;
-}
-
-#endif /* XML_NS */
diff --git a/Utilities/Poco/XML/src/xmltok.h b/Utilities/Poco/XML/src/xmltok.h
deleted file mode 100755
index ca867aa6b4..0000000000
--- a/Utilities/Poco/XML/src/xmltok.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-#ifndef XmlTok_INCLUDED
-#define XmlTok_INCLUDED 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The following token may be returned by XmlContentTok */
-#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be
- start of illegal ]]> sequence */
-/* The following tokens may be returned by both XmlPrologTok and
- XmlContentTok.
-*/
-#define XML_TOK_NONE -4 /* The string to be scanned is empty */
-#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan;
- might be part of CRLF sequence */
-#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
-#define XML_TOK_PARTIAL -1 /* only part of a token */
-#define XML_TOK_INVALID 0
-
-/* The following tokens are returned by XmlContentTok; some are also
- returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok.
-*/
-#define XML_TOK_START_TAG_WITH_ATTS 1
-#define XML_TOK_START_TAG_NO_ATTS 2
-#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
-#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
-#define XML_TOK_END_TAG 5
-#define XML_TOK_DATA_CHARS 6
-#define XML_TOK_DATA_NEWLINE 7
-#define XML_TOK_CDATA_SECT_OPEN 8
-#define XML_TOK_ENTITY_REF 9
-#define XML_TOK_CHAR_REF 10 /* numeric character reference */
-
-/* The following tokens may be returned by both XmlPrologTok and
- XmlContentTok.
-*/
-#define XML_TOK_PI 11 /* processing instruction */
-#define XML_TOK_XML_DECL 12 /* XML decl or text decl */
-#define XML_TOK_COMMENT 13
-#define XML_TOK_BOM 14 /* Byte order mark */
-
-/* The following tokens are returned only by XmlPrologTok */
-#define XML_TOK_PROLOG_S 15
-#define XML_TOK_DECL_OPEN 16 /* <!foo */
-#define XML_TOK_DECL_CLOSE 17 /* > */
-#define XML_TOK_NAME 18
-#define XML_TOK_NMTOKEN 19
-#define XML_TOK_POUND_NAME 20 /* #name */
-#define XML_TOK_OR 21 /* | */
-#define XML_TOK_PERCENT 22
-#define XML_TOK_OPEN_PAREN 23
-#define XML_TOK_CLOSE_PAREN 24
-#define XML_TOK_OPEN_BRACKET 25
-#define XML_TOK_CLOSE_BRACKET 26
-#define XML_TOK_LITERAL 27
-#define XML_TOK_PARAM_ENTITY_REF 28
-#define XML_TOK_INSTANCE_START 29
-
-/* The following occur only in element type declarations */
-#define XML_TOK_NAME_QUESTION 30 /* name? */
-#define XML_TOK_NAME_ASTERISK 31 /* name* */
-#define XML_TOK_NAME_PLUS 32 /* name+ */
-#define XML_TOK_COND_SECT_OPEN 33 /* <![ */
-#define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
-#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
-#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
-#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
-#define XML_TOK_COMMA 38
-
-/* The following token is returned only by XmlAttributeValueTok */
-#define XML_TOK_ATTRIBUTE_VALUE_S 39
-
-/* The following token is returned only by XmlCdataSectionTok */
-#define XML_TOK_CDATA_SECT_CLOSE 40
-
-/* With namespace processing this is returned by XmlPrologTok for a
- name with a colon.
-*/
-#define XML_TOK_PREFIXED_NAME 41
-
-#ifdef XML_DTD
-#define XML_TOK_IGNORE_SECT 42
-#endif /* XML_DTD */
-
-#ifdef XML_DTD
-#define XML_N_STATES 4
-#else /* not XML_DTD */
-#define XML_N_STATES 3
-#endif /* not XML_DTD */
-
-#define XML_PROLOG_STATE 0
-#define XML_CONTENT_STATE 1
-#define XML_CDATA_SECTION_STATE 2
-#ifdef XML_DTD
-#define XML_IGNORE_SECTION_STATE 3
-#endif /* XML_DTD */
-
-#define XML_N_LITERAL_TYPES 2
-#define XML_ATTRIBUTE_VALUE_LITERAL 0
-#define XML_ENTITY_VALUE_LITERAL 1
-
-/* The size of the buffer passed to XmlUtf8Encode must be at least this. */
-#define XML_UTF8_ENCODE_MAX 4
-/* The size of the buffer passed to XmlUtf16Encode must be at least this. */
-#define XML_UTF16_ENCODE_MAX 2
-
-typedef struct position {
- /* first line and first column are 0 not 1 */
- XML_Size lineNumber;
- XML_Size columnNumber;
-} POSITION;
-
-typedef struct {
- const char *name;
- const char *valuePtr;
- const char *valueEnd;
- char normalized;
-} ATTRIBUTE;
-
-struct encoding;
-typedef struct encoding ENCODING;
-
-typedef int (PTRCALL *SCANNER)(const ENCODING *,
- const char *,
- const char *,
- const char **);
-
-struct encoding {
- SCANNER scanners[XML_N_STATES];
- SCANNER literalScanners[XML_N_LITERAL_TYPES];
- int (PTRCALL *sameName)(const ENCODING *,
- const char *,
- const char *);
- int (PTRCALL *nameMatchesAscii)(const ENCODING *,
- const char *,
- const char *,
- const char *);
- int (PTRFASTCALL *nameLength)(const ENCODING *, const char *);
- const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *);
- int (PTRCALL *getAtts)(const ENCODING *enc,
- const char *ptr,
- int attsMax,
- ATTRIBUTE *atts);
- int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
- int (PTRCALL *predefinedEntityName)(const ENCODING *,
- const char *,
- const char *);
- void (PTRCALL *updatePosition)(const ENCODING *,
- const char *ptr,
- const char *end,
- POSITION *);
- int (PTRCALL *isPublicId)(const ENCODING *enc,
- const char *ptr,
- const char *end,
- const char **badPtr);
- void (PTRCALL *utf8Convert)(const ENCODING *enc,
- const char **fromP,
- const char *fromLim,
- char **toP,
- const char *toLim);
- void (PTRCALL *utf16Convert)(const ENCODING *enc,
- const char **fromP,
- const char *fromLim,
- unsigned short **toP,
- const unsigned short *toLim);
- int minBytesPerChar;
- char isUtf8;
- char isUtf16;
-};
-
-/* Scan the string starting at ptr until the end of the next complete
- token, but do not scan past eptr. Return an integer giving the
- type of token.
-
- Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set.
-
- Return XML_TOK_PARTIAL when the string does not contain a complete
- token; nextTokPtr will not be set.
-
- Return XML_TOK_INVALID when the string does not start a valid
- token; nextTokPtr will be set to point to the character which made
- the token invalid.
-
- Otherwise the string starts with a valid token; nextTokPtr will be
- set to point to the character following the end of that token.
-
- Each data character counts as a single token, but adjacent data
- characters may be returned together. Similarly for characters in
- the prolog outside literals, comments and processing instructions.
-*/
-
-
-#define XmlTok(enc, state, ptr, end, nextTokPtr) \
- (((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
-
-#define XmlPrologTok(enc, ptr, end, nextTokPtr) \
- XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
-
-#define XmlContentTok(enc, ptr, end, nextTokPtr) \
- XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
-
-#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
- XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
-
-#ifdef XML_DTD
-
-#define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
- XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
-
-#endif /* XML_DTD */
-
-/* This is used for performing a 2nd-level tokenization on the content
- of a literal that has already been returned by XmlTok.
-*/
-#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
- (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
-
-#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
- XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
-
-#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
- XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
-
-#define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2))
-
-#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
- (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
-
-#define XmlNameLength(enc, ptr) \
- (((enc)->nameLength)(enc, ptr))
-
-#define XmlSkipS(enc, ptr) \
- (((enc)->skipS)(enc, ptr))
-
-#define XmlGetAttributes(enc, ptr, attsMax, atts) \
- (((enc)->getAtts)(enc, ptr, attsMax, atts))
-
-#define XmlCharRefNumber(enc, ptr) \
- (((enc)->charRefNumber)(enc, ptr))
-
-#define XmlPredefinedEntityName(enc, ptr, end) \
- (((enc)->predefinedEntityName)(enc, ptr, end))
-
-#define XmlUpdatePosition(enc, ptr, end, pos) \
- (((enc)->updatePosition)(enc, ptr, end, pos))
-
-#define XmlIsPublicId(enc, ptr, end, badPtr) \
- (((enc)->isPublicId)(enc, ptr, end, badPtr))
-
-#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
- (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
-
-#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
- (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
-
-typedef struct {
- ENCODING initEnc;
- const ENCODING **encPtr;
-} INIT_ENCODING;
-
-int XmlParseXmlDecl(int isGeneralTextEntity,
- const ENCODING *enc,
- const char *ptr,
- const char *end,
- const char **badPtr,
- const char **versionPtr,
- const char **versionEndPtr,
- const char **encodingNamePtr,
- const ENCODING **namedEncodingPtr,
- int *standalonePtr);
-
-int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
-const ENCODING *XmlGetUtf8InternalEncoding(void);
-const ENCODING *XmlGetUtf16InternalEncoding(void);
-int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
-int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf);
-int XmlSizeOfUnknownEncoding(void);
-
-
-typedef int (XMLCALL *CONVERTER) (void *userData, const char *p);
-
-ENCODING *
-XmlInitUnknownEncoding(void *mem,
- int *table,
- CONVERTER convert,
- void *userData);
-
-int XmlParseXmlDeclNS(int isGeneralTextEntity,
- const ENCODING *enc,
- const char *ptr,
- const char *end,
- const char **badPtr,
- const char **versionPtr,
- const char **versionEndPtr,
- const char **encodingNamePtr,
- const ENCODING **namedEncodingPtr,
- int *standalonePtr);
-
-int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
-const ENCODING *XmlGetUtf8InternalEncodingNS(void);
-const ENCODING *XmlGetUtf16InternalEncodingNS(void);
-ENCODING *
-XmlInitUnknownEncodingNS(void *mem,
- int *table,
- CONVERTER convert,
- void *userData);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* not XmlTok_INCLUDED */
diff --git a/Utilities/Poco/XML/src/xmltok_impl.c b/Utilities/Poco/XML/src/xmltok_impl.c
deleted file mode 100755
index 1268819252..0000000000
--- a/Utilities/Poco/XML/src/xmltok_impl.c
+++ /dev/null
@@ -1,1783 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-/* This file is included! */
-#ifdef XML_TOK_IMPL_C
-
-#ifndef IS_INVALID_CHAR
-#define IS_INVALID_CHAR(enc, ptr, n) (0)
-#endif
-
-#define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \
- case BT_LEAD ## n: \
- if (end - ptr < n) \
- return XML_TOK_PARTIAL_CHAR; \
- if (IS_INVALID_CHAR(enc, ptr, n)) { \
- *(nextTokPtr) = (ptr); \
- return XML_TOK_INVALID; \
- } \
- ptr += n; \
- break;
-
-#define INVALID_CASES(ptr, nextTokPtr) \
- INVALID_LEAD_CASE(2, ptr, nextTokPtr) \
- INVALID_LEAD_CASE(3, ptr, nextTokPtr) \
- INVALID_LEAD_CASE(4, ptr, nextTokPtr) \
- case BT_NONXML: \
- case BT_MALFORM: \
- case BT_TRAIL: \
- *(nextTokPtr) = (ptr); \
- return XML_TOK_INVALID;
-
-#define CHECK_NAME_CASE(n, enc, ptr, end, nextTokPtr) \
- case BT_LEAD ## n: \
- if (end - ptr < n) \
- return XML_TOK_PARTIAL_CHAR; \
- if (!IS_NAME_CHAR(enc, ptr, n)) { \
- *nextTokPtr = ptr; \
- return XML_TOK_INVALID; \
- } \
- ptr += n; \
- break;
-
-#define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \
- case BT_NONASCII: \
- if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \
- *nextTokPtr = ptr; \
- return XML_TOK_INVALID; \
- } \
- case BT_NMSTRT: \
- case BT_HEX: \
- case BT_DIGIT: \
- case BT_NAME: \
- case BT_MINUS: \
- ptr += MINBPC(enc); \
- break; \
- CHECK_NAME_CASE(2, enc, ptr, end, nextTokPtr) \
- CHECK_NAME_CASE(3, enc, ptr, end, nextTokPtr) \
- CHECK_NAME_CASE(4, enc, ptr, end, nextTokPtr)
-
-#define CHECK_NMSTRT_CASE(n, enc, ptr, end, nextTokPtr) \
- case BT_LEAD ## n: \
- if (end - ptr < n) \
- return XML_TOK_PARTIAL_CHAR; \
- if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \
- *nextTokPtr = ptr; \
- return XML_TOK_INVALID; \
- } \
- ptr += n; \
- break;
-
-#define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \
- case BT_NONASCII: \
- if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \
- *nextTokPtr = ptr; \
- return XML_TOK_INVALID; \
- } \
- case BT_NMSTRT: \
- case BT_HEX: \
- ptr += MINBPC(enc); \
- break; \
- CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \
- CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \
- CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr)
-
-#ifndef PREFIX
-#define PREFIX(ident) ident
-#endif
-
-/* ptr points to character following "<!-" */
-
-static int PTRCALL
-PREFIX(scanComment)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- if (ptr != end) {
- if (!CHAR_MATCHES(enc, ptr, ASCII_MINUS)) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- ptr += MINBPC(enc);
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- INVALID_CASES(ptr, nextTokPtr)
- case BT_MINUS:
- if ((ptr += MINBPC(enc)) == end)
- return XML_TOK_PARTIAL;
- if (CHAR_MATCHES(enc, ptr, ASCII_MINUS)) {
- if ((ptr += MINBPC(enc)) == end)
- return XML_TOK_PARTIAL;
- if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_COMMENT;
- }
- break;
- default:
- ptr += MINBPC(enc);
- break;
- }
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-/* ptr points to character following "<!" */
-
-static int PTRCALL
-PREFIX(scanDecl)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_MINUS:
- return PREFIX(scanComment)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- case BT_LSQB:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_COND_SECT_OPEN;
- case BT_NMSTRT:
- case BT_HEX:
- ptr += MINBPC(enc);
- break;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_PERCNT:
- if (ptr + MINBPC(enc) == end)
- return XML_TOK_PARTIAL;
- /* don't allow <!ENTITY% foo "whatever"> */
- switch (BYTE_TYPE(enc, ptr + MINBPC(enc))) {
- case BT_S: case BT_CR: case BT_LF: case BT_PERCNT:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- /* fall through */
- case BT_S: case BT_CR: case BT_LF:
- *nextTokPtr = ptr;
- return XML_TOK_DECL_OPEN;
- case BT_NMSTRT:
- case BT_HEX:
- ptr += MINBPC(enc);
- break;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-static int PTRCALL
-PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr,
- const char *end, int *tokPtr)
-{
- int upper = 0;
- *tokPtr = XML_TOK_PI;
- if (end - ptr != MINBPC(enc)*3)
- return 1;
- switch (BYTE_TO_ASCII(enc, ptr)) {
- case ASCII_x:
- break;
- case ASCII_X:
- upper = 1;
- break;
- default:
- return 1;
- }
- ptr += MINBPC(enc);
- switch (BYTE_TO_ASCII(enc, ptr)) {
- case ASCII_m:
- break;
- case ASCII_M:
- upper = 1;
- break;
- default:
- return 1;
- }
- ptr += MINBPC(enc);
- switch (BYTE_TO_ASCII(enc, ptr)) {
- case ASCII_l:
- break;
- case ASCII_L:
- upper = 1;
- break;
- default:
- return 1;
- }
- if (upper)
- return 0;
- *tokPtr = XML_TOK_XML_DECL;
- return 1;
-}
-
-/* ptr points to character following "<?" */
-
-static int PTRCALL
-PREFIX(scanPi)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- int tok;
- const char *target = ptr;
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
- case BT_S: case BT_CR: case BT_LF:
- if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- ptr += MINBPC(enc);
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- INVALID_CASES(ptr, nextTokPtr)
- case BT_QUEST:
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- if (CHAR_MATCHES(enc, ptr, ASCII_GT)) {
- *nextTokPtr = ptr + MINBPC(enc);
- return tok;
- }
- break;
- default:
- ptr += MINBPC(enc);
- break;
- }
- }
- return XML_TOK_PARTIAL;
- case BT_QUEST:
- if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- if (CHAR_MATCHES(enc, ptr, ASCII_GT)) {
- *nextTokPtr = ptr + MINBPC(enc);
- return tok;
- }
- /* fall through */
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-static int PTRCALL
-PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- static const char CDATA_LSQB[] = { ASCII_C, ASCII_D, ASCII_A,
- ASCII_T, ASCII_A, ASCII_LSQB };
- int i;
- /* CDATA[ */
- if (end - ptr < 6 * MINBPC(enc))
- return XML_TOK_PARTIAL;
- for (i = 0; i < 6; i++, ptr += MINBPC(enc)) {
- if (!CHAR_MATCHES(enc, ptr, CDATA_LSQB[i])) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- *nextTokPtr = ptr;
- return XML_TOK_CDATA_SECT_OPEN;
-}
-
-static int PTRCALL
-PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- if (ptr == end)
- return XML_TOK_NONE;
- if (MINBPC(enc) > 1) {
- size_t n = end - ptr;
- if (n & (MINBPC(enc) - 1)) {
- n &= ~(MINBPC(enc) - 1);
- if (n == 0)
- return XML_TOK_PARTIAL;
- end = ptr + n;
- }
- }
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_RSQB:
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB))
- break;
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) {
- ptr -= MINBPC(enc);
- break;
- }
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_CDATA_SECT_CLOSE;
- case BT_CR:
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- if (BYTE_TYPE(enc, ptr) == BT_LF)
- ptr += MINBPC(enc);
- *nextTokPtr = ptr;
- return XML_TOK_DATA_NEWLINE;
- case BT_LF:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_DATA_NEWLINE;
- INVALID_CASES(ptr, nextTokPtr)
- default:
- ptr += MINBPC(enc);
- break;
- }
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
-#define LEAD_CASE(n) \
- case BT_LEAD ## n: \
- if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \
- *nextTokPtr = ptr; \
- return XML_TOK_DATA_CHARS; \
- } \
- ptr += n; \
- break;
- LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
-#undef LEAD_CASE
- case BT_NONXML:
- case BT_MALFORM:
- case BT_TRAIL:
- case BT_CR:
- case BT_LF:
- case BT_RSQB:
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
- default:
- ptr += MINBPC(enc);
- break;
- }
- }
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
-}
-
-/* ptr points to character following "</" */
-
-static int PTRCALL
-PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
- case BT_S: case BT_CR: case BT_LF:
- for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) {
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_S: case BT_CR: case BT_LF:
- break;
- case BT_GT:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_END_TAG;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- return XML_TOK_PARTIAL;
-#ifdef XML_NS
- case BT_COLON:
- /* no need to check qname syntax here,
- since end-tag must match exactly */
- ptr += MINBPC(enc);
- break;
-#endif
- case BT_GT:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_END_TAG;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-/* ptr points to character following "&#X" */
-
-static int PTRCALL
-PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- if (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_DIGIT:
- case BT_HEX:
- break;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) {
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_DIGIT:
- case BT_HEX:
- break;
- case BT_SEMI:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_CHAR_REF;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-/* ptr points to character following "&#" */
-
-static int PTRCALL
-PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- if (ptr != end) {
- if (CHAR_MATCHES(enc, ptr, ASCII_x))
- return PREFIX(scanHexCharRef)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_DIGIT:
- break;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) {
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_DIGIT:
- break;
- case BT_SEMI:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_CHAR_REF;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-/* ptr points to character following "&" */
-
-static int PTRCALL
-PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
- case BT_NUM:
- return PREFIX(scanCharRef)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
- case BT_SEMI:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_ENTITY_REF;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-/* ptr points to character following first character of attribute name */
-
-static int PTRCALL
-PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
-#ifdef XML_NS
- int hadColon = 0;
-#endif
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
-#ifdef XML_NS
- case BT_COLON:
- if (hadColon) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- hadColon = 1;
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- break;
-#endif
- case BT_S: case BT_CR: case BT_LF:
- for (;;) {
- int t;
-
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- t = BYTE_TYPE(enc, ptr);
- if (t == BT_EQUALS)
- break;
- switch (t) {
- case BT_S:
- case BT_LF:
- case BT_CR:
- break;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- /* fall through */
- case BT_EQUALS:
- {
- int open;
-#ifdef XML_NS
- hadColon = 0;
-#endif
- for (;;) {
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- open = BYTE_TYPE(enc, ptr);
- if (open == BT_QUOT || open == BT_APOS)
- break;
- switch (open) {
- case BT_S:
- case BT_LF:
- case BT_CR:
- break;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- ptr += MINBPC(enc);
- /* in attribute value */
- for (;;) {
- int t;
- if (ptr == end)
- return XML_TOK_PARTIAL;
- t = BYTE_TYPE(enc, ptr);
- if (t == open)
- break;
- switch (t) {
- INVALID_CASES(ptr, nextTokPtr)
- case BT_AMP:
- {
- int tok = PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, &ptr);
- if (tok <= 0) {
- if (tok == XML_TOK_INVALID)
- *nextTokPtr = ptr;
- return tok;
- }
- break;
- }
- case BT_LT:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- default:
- ptr += MINBPC(enc);
- break;
- }
- }
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_S:
- case BT_CR:
- case BT_LF:
- break;
- case BT_SOL:
- goto sol;
- case BT_GT:
- goto gt;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- /* ptr points to closing quote */
- for (;;) {
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
- case BT_S: case BT_CR: case BT_LF:
- continue;
- case BT_GT:
- gt:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_START_TAG_WITH_ATTS;
- case BT_SOL:
- sol:
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_EMPTY_ELEMENT_WITH_ATTS;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- break;
- }
- break;
- }
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-/* ptr points to character following "<" */
-
-static int PTRCALL
-PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
-#ifdef XML_NS
- int hadColon;
-#endif
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
- case BT_EXCL:
- if ((ptr += MINBPC(enc)) == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_MINUS:
- return PREFIX(scanComment)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- case BT_LSQB:
- return PREFIX(scanCdataSection)(enc, ptr + MINBPC(enc),
- end, nextTokPtr);
- }
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- case BT_QUEST:
- return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- case BT_SOL:
- return PREFIX(scanEndTag)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
-#ifdef XML_NS
- hadColon = 0;
-#endif
- /* we have a start-tag */
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
-#ifdef XML_NS
- case BT_COLON:
- if (hadColon) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- hadColon = 1;
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- break;
-#endif
- case BT_S: case BT_CR: case BT_LF:
- {
- ptr += MINBPC(enc);
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
- case BT_GT:
- goto gt;
- case BT_SOL:
- goto sol;
- case BT_S: case BT_CR: case BT_LF:
- ptr += MINBPC(enc);
- continue;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- return PREFIX(scanAtts)(enc, ptr, end, nextTokPtr);
- }
- return XML_TOK_PARTIAL;
- }
- case BT_GT:
- gt:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_START_TAG_NO_ATTS;
- case BT_SOL:
- sol:
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_EMPTY_ELEMENT_NO_ATTS;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-static int PTRCALL
-PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
- if (ptr == end)
- return XML_TOK_NONE;
- if (MINBPC(enc) > 1) {
- size_t n = end - ptr;
- if (n & (MINBPC(enc) - 1)) {
- n &= ~(MINBPC(enc) - 1);
- if (n == 0)
- return XML_TOK_PARTIAL;
- end = ptr + n;
- }
- }
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_LT:
- return PREFIX(scanLt)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- case BT_AMP:
- return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- case BT_CR:
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_TRAILING_CR;
- if (BYTE_TYPE(enc, ptr) == BT_LF)
- ptr += MINBPC(enc);
- *nextTokPtr = ptr;
- return XML_TOK_DATA_NEWLINE;
- case BT_LF:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_DATA_NEWLINE;
- case BT_RSQB:
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_TRAILING_RSQB;
- if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB))
- break;
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_TRAILING_RSQB;
- if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) {
- ptr -= MINBPC(enc);
- break;
- }
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- INVALID_CASES(ptr, nextTokPtr)
- default:
- ptr += MINBPC(enc);
- break;
- }
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
-#define LEAD_CASE(n) \
- case BT_LEAD ## n: \
- if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \
- *nextTokPtr = ptr; \
- return XML_TOK_DATA_CHARS; \
- } \
- ptr += n; \
- break;
- LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
-#undef LEAD_CASE
- case BT_RSQB:
- if (ptr + MINBPC(enc) != end) {
- if (!CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_RSQB)) {
- ptr += MINBPC(enc);
- break;
- }
- if (ptr + 2*MINBPC(enc) != end) {
- if (!CHAR_MATCHES(enc, ptr + 2*MINBPC(enc), ASCII_GT)) {
- ptr += MINBPC(enc);
- break;
- }
- *nextTokPtr = ptr + 2*MINBPC(enc);
- return XML_TOK_INVALID;
- }
- }
- /* fall through */
- case BT_AMP:
- case BT_LT:
- case BT_NONXML:
- case BT_MALFORM:
- case BT_TRAIL:
- case BT_CR:
- case BT_LF:
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
- default:
- ptr += MINBPC(enc);
- break;
- }
- }
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
-}
-
-/* ptr points to character following "%" */
-
-static int PTRCALL
-PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
- if (ptr == end)
- return -XML_TOK_PERCENT;
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
- case BT_S: case BT_LF: case BT_CR: case BT_PERCNT:
- *nextTokPtr = ptr;
- return XML_TOK_PERCENT;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
- case BT_SEMI:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_PARAM_ENTITY_REF;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-static int PTRCALL
-PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
- case BT_CR: case BT_LF: case BT_S:
- case BT_RPAR: case BT_GT: case BT_PERCNT: case BT_VERBAR:
- *nextTokPtr = ptr;
- return XML_TOK_POUND_NAME;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- return -XML_TOK_POUND_NAME;
-}
-
-static int PTRCALL
-PREFIX(scanLit)(int open, const ENCODING *enc,
- const char *ptr, const char *end,
- const char **nextTokPtr)
-{
- while (ptr != end) {
- int t = BYTE_TYPE(enc, ptr);
- switch (t) {
- INVALID_CASES(ptr, nextTokPtr)
- case BT_QUOT:
- case BT_APOS:
- ptr += MINBPC(enc);
- if (t != open)
- break;
- if (ptr == end)
- return -XML_TOK_LITERAL;
- *nextTokPtr = ptr;
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_S: case BT_CR: case BT_LF:
- case BT_GT: case BT_PERCNT: case BT_LSQB:
- return XML_TOK_LITERAL;
- default:
- return XML_TOK_INVALID;
- }
- default:
- ptr += MINBPC(enc);
- break;
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-static int PTRCALL
-PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
- int tok;
- if (ptr == end)
- return XML_TOK_NONE;
- if (MINBPC(enc) > 1) {
- size_t n = end - ptr;
- if (n & (MINBPC(enc) - 1)) {
- n &= ~(MINBPC(enc) - 1);
- if (n == 0)
- return XML_TOK_PARTIAL;
- end = ptr + n;
- }
- }
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_QUOT:
- return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC(enc), end, nextTokPtr);
- case BT_APOS:
- return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC(enc), end, nextTokPtr);
- case BT_LT:
- {
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_PARTIAL;
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_EXCL:
- return PREFIX(scanDecl)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- case BT_QUEST:
- return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- case BT_NMSTRT:
- case BT_HEX:
- case BT_NONASCII:
- case BT_LEAD2:
- case BT_LEAD3:
- case BT_LEAD4:
- *nextTokPtr = ptr - MINBPC(enc);
- return XML_TOK_INSTANCE_START;
- }
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- case BT_CR:
- if (ptr + MINBPC(enc) == end) {
- *nextTokPtr = end;
- /* indicate that this might be part of a CR/LF pair */
- return -XML_TOK_PROLOG_S;
- }
- /* fall through */
- case BT_S: case BT_LF:
- for (;;) {
- ptr += MINBPC(enc);
- if (ptr == end)
- break;
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_S: case BT_LF:
- break;
- case BT_CR:
- /* don't split CR/LF pair */
- if (ptr + MINBPC(enc) != end)
- break;
- /* fall through */
- default:
- *nextTokPtr = ptr;
- return XML_TOK_PROLOG_S;
- }
- }
- *nextTokPtr = ptr;
- return XML_TOK_PROLOG_S;
- case BT_PERCNT:
- return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- case BT_COMMA:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_COMMA;
- case BT_LSQB:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_OPEN_BRACKET;
- case BT_RSQB:
- ptr += MINBPC(enc);
- if (ptr == end)
- return -XML_TOK_CLOSE_BRACKET;
- if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) {
- if (ptr + MINBPC(enc) == end)
- return XML_TOK_PARTIAL;
- if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_GT)) {
- *nextTokPtr = ptr + 2*MINBPC(enc);
- return XML_TOK_COND_SECT_CLOSE;
- }
- }
- *nextTokPtr = ptr;
- return XML_TOK_CLOSE_BRACKET;
- case BT_LPAR:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_OPEN_PAREN;
- case BT_RPAR:
- ptr += MINBPC(enc);
- if (ptr == end)
- return -XML_TOK_CLOSE_PAREN;
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_AST:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_CLOSE_PAREN_ASTERISK;
- case BT_QUEST:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_CLOSE_PAREN_QUESTION;
- case BT_PLUS:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_CLOSE_PAREN_PLUS;
- case BT_CR: case BT_LF: case BT_S:
- case BT_GT: case BT_COMMA: case BT_VERBAR:
- case BT_RPAR:
- *nextTokPtr = ptr;
- return XML_TOK_CLOSE_PAREN;
- }
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- case BT_VERBAR:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_OR;
- case BT_GT:
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_DECL_CLOSE;
- case BT_NUM:
- return PREFIX(scanPoundName)(enc, ptr + MINBPC(enc), end, nextTokPtr);
-#define LEAD_CASE(n) \
- case BT_LEAD ## n: \
- if (end - ptr < n) \
- return XML_TOK_PARTIAL_CHAR; \
- if (IS_NMSTRT_CHAR(enc, ptr, n)) { \
- ptr += n; \
- tok = XML_TOK_NAME; \
- break; \
- } \
- if (IS_NAME_CHAR(enc, ptr, n)) { \
- ptr += n; \
- tok = XML_TOK_NMTOKEN; \
- break; \
- } \
- *nextTokPtr = ptr; \
- return XML_TOK_INVALID;
- LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
-#undef LEAD_CASE
- case BT_NMSTRT:
- case BT_HEX:
- tok = XML_TOK_NAME;
- ptr += MINBPC(enc);
- break;
- case BT_DIGIT:
- case BT_NAME:
- case BT_MINUS:
-#ifdef XML_NS
- case BT_COLON:
-#endif
- tok = XML_TOK_NMTOKEN;
- ptr += MINBPC(enc);
- break;
- case BT_NONASCII:
- if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) {
- ptr += MINBPC(enc);
- tok = XML_TOK_NAME;
- break;
- }
- if (IS_NAME_CHAR_MINBPC(enc, ptr)) {
- ptr += MINBPC(enc);
- tok = XML_TOK_NMTOKEN;
- break;
- }
- /* fall through */
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
- case BT_GT: case BT_RPAR: case BT_COMMA:
- case BT_VERBAR: case BT_LSQB: case BT_PERCNT:
- case BT_S: case BT_CR: case BT_LF:
- *nextTokPtr = ptr;
- return tok;
-#ifdef XML_NS
- case BT_COLON:
- ptr += MINBPC(enc);
- switch (tok) {
- case XML_TOK_NAME:
- if (ptr == end)
- return XML_TOK_PARTIAL;
- tok = XML_TOK_PREFIXED_NAME;
- switch (BYTE_TYPE(enc, ptr)) {
- CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
- default:
- tok = XML_TOK_NMTOKEN;
- break;
- }
- break;
- case XML_TOK_PREFIXED_NAME:
- tok = XML_TOK_NMTOKEN;
- break;
- }
- break;
-#endif
- case BT_PLUS:
- if (tok == XML_TOK_NMTOKEN) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_NAME_PLUS;
- case BT_AST:
- if (tok == XML_TOK_NMTOKEN) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_NAME_ASTERISK;
- case BT_QUEST:
- if (tok == XML_TOK_NMTOKEN) {
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_NAME_QUESTION;
- default:
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- }
- }
- return -tok;
-}
-
-static int PTRCALL
-PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- const char *start;
- if (ptr == end)
- return XML_TOK_NONE;
- start = ptr;
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
-#define LEAD_CASE(n) \
- case BT_LEAD ## n: ptr += n; break;
- LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
-#undef LEAD_CASE
- case BT_AMP:
- if (ptr == start)
- return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
- case BT_LT:
- /* this is for inside entity references */
- *nextTokPtr = ptr;
- return XML_TOK_INVALID;
- case BT_LF:
- if (ptr == start) {
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_DATA_NEWLINE;
- }
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
- case BT_CR:
- if (ptr == start) {
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_TRAILING_CR;
- if (BYTE_TYPE(enc, ptr) == BT_LF)
- ptr += MINBPC(enc);
- *nextTokPtr = ptr;
- return XML_TOK_DATA_NEWLINE;
- }
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
- case BT_S:
- if (ptr == start) {
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_ATTRIBUTE_VALUE_S;
- }
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
- default:
- ptr += MINBPC(enc);
- break;
- }
- }
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
-}
-
-static int PTRCALL
-PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- const char *start;
- if (ptr == end)
- return XML_TOK_NONE;
- start = ptr;
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
-#define LEAD_CASE(n) \
- case BT_LEAD ## n: ptr += n; break;
- LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
-#undef LEAD_CASE
- case BT_AMP:
- if (ptr == start)
- return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr);
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
- case BT_PERCNT:
- if (ptr == start) {
- int tok = PREFIX(scanPercent)(enc, ptr + MINBPC(enc),
- end, nextTokPtr);
- return (tok == XML_TOK_PERCENT) ? XML_TOK_INVALID : tok;
- }
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
- case BT_LF:
- if (ptr == start) {
- *nextTokPtr = ptr + MINBPC(enc);
- return XML_TOK_DATA_NEWLINE;
- }
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
- case BT_CR:
- if (ptr == start) {
- ptr += MINBPC(enc);
- if (ptr == end)
- return XML_TOK_TRAILING_CR;
- if (BYTE_TYPE(enc, ptr) == BT_LF)
- ptr += MINBPC(enc);
- *nextTokPtr = ptr;
- return XML_TOK_DATA_NEWLINE;
- }
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
- default:
- ptr += MINBPC(enc);
- break;
- }
- }
- *nextTokPtr = ptr;
- return XML_TOK_DATA_CHARS;
-}
-
-#ifdef XML_DTD
-
-static int PTRCALL
-PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr,
- const char *end, const char **nextTokPtr)
-{
- int level = 0;
- if (MINBPC(enc) > 1) {
- size_t n = end - ptr;
- if (n & (MINBPC(enc) - 1)) {
- n &= ~(MINBPC(enc) - 1);
- end = ptr + n;
- }
- }
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
- INVALID_CASES(ptr, nextTokPtr)
- case BT_LT:
- if ((ptr += MINBPC(enc)) == end)
- return XML_TOK_PARTIAL;
- if (CHAR_MATCHES(enc, ptr, ASCII_EXCL)) {
- if ((ptr += MINBPC(enc)) == end)
- return XML_TOK_PARTIAL;
- if (CHAR_MATCHES(enc, ptr, ASCII_LSQB)) {
- ++level;
- ptr += MINBPC(enc);
- }
- }
- break;
- case BT_RSQB:
- if ((ptr += MINBPC(enc)) == end)
- return XML_TOK_PARTIAL;
- if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) {
- if ((ptr += MINBPC(enc)) == end)
- return XML_TOK_PARTIAL;
- if (CHAR_MATCHES(enc, ptr, ASCII_GT)) {
- ptr += MINBPC(enc);
- if (level == 0) {
- *nextTokPtr = ptr;
- return XML_TOK_IGNORE_SECT;
- }
- --level;
- }
- }
- break;
- default:
- ptr += MINBPC(enc);
- break;
- }
- }
- return XML_TOK_PARTIAL;
-}
-
-#endif /* XML_DTD */
-
-static int PTRCALL
-PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
- const char **badPtr)
-{
- ptr += MINBPC(enc);
- end -= MINBPC(enc);
- for (; ptr != end; ptr += MINBPC(enc)) {
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_DIGIT:
- case BT_HEX:
- case BT_MINUS:
- case BT_APOS:
- case BT_LPAR:
- case BT_RPAR:
- case BT_PLUS:
- case BT_COMMA:
- case BT_SOL:
- case BT_EQUALS:
- case BT_QUEST:
- case BT_CR:
- case BT_LF:
- case BT_SEMI:
- case BT_EXCL:
- case BT_AST:
- case BT_PERCNT:
- case BT_NUM:
-#ifdef XML_NS
- case BT_COLON:
-#endif
- break;
- case BT_S:
- if (CHAR_MATCHES(enc, ptr, ASCII_TAB)) {
- *badPtr = ptr;
- return 0;
- }
- break;
- case BT_NAME:
- case BT_NMSTRT:
- if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f))
- break;
- default:
- switch (BYTE_TO_ASCII(enc, ptr)) {
- case 0x24: /* $ */
- case 0x40: /* @ */
- break;
- default:
- *badPtr = ptr;
- return 0;
- }
- break;
- }
- }
- return 1;
-}
-
-/* This must only be called for a well-formed start-tag or empty
- element tag. Returns the number of attributes. Pointers to the
- first attsMax attributes are stored in atts.
-*/
-
-static int PTRCALL
-PREFIX(getAtts)(const ENCODING *enc, const char *ptr,
- int attsMax, ATTRIBUTE *atts)
-{
- enum { other, inName, inValue } state = inName;
- int nAtts = 0;
- int open = 0; /* defined when state == inValue;
- initialization just to shut up compilers */
-
- for (ptr += MINBPC(enc);; ptr += MINBPC(enc)) {
- switch (BYTE_TYPE(enc, ptr)) {
-#define START_NAME \
- if (state == other) { \
- if (nAtts < attsMax) { \
- atts[nAtts].name = ptr; \
- atts[nAtts].normalized = 1; \
- } \
- state = inName; \
- }
-#define LEAD_CASE(n) \
- case BT_LEAD ## n: START_NAME ptr += (n - MINBPC(enc)); break;
- LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
-#undef LEAD_CASE
- case BT_NONASCII:
- case BT_NMSTRT:
- case BT_HEX:
- START_NAME
- break;
-#undef START_NAME
- case BT_QUOT:
- if (state != inValue) {
- if (nAtts < attsMax)
- atts[nAtts].valuePtr = ptr + MINBPC(enc);
- state = inValue;
- open = BT_QUOT;
- }
- else if (open == BT_QUOT) {
- state = other;
- if (nAtts < attsMax)
- atts[nAtts].valueEnd = ptr;
- nAtts++;
- }
- break;
- case BT_APOS:
- if (state != inValue) {
- if (nAtts < attsMax)
- atts[nAtts].valuePtr = ptr + MINBPC(enc);
- state = inValue;
- open = BT_APOS;
- }
- else if (open == BT_APOS) {
- state = other;
- if (nAtts < attsMax)
- atts[nAtts].valueEnd = ptr;
- nAtts++;
- }
- break;
- case BT_AMP:
- if (nAtts < attsMax)
- atts[nAtts].normalized = 0;
- break;
- case BT_S:
- if (state == inName)
- state = other;
- else if (state == inValue
- && nAtts < attsMax
- && atts[nAtts].normalized
- && (ptr == atts[nAtts].valuePtr
- || BYTE_TO_ASCII(enc, ptr) != ASCII_SPACE
- || BYTE_TO_ASCII(enc, ptr + MINBPC(enc)) == ASCII_SPACE
- || BYTE_TYPE(enc, ptr + MINBPC(enc)) == open))
- atts[nAtts].normalized = 0;
- break;
- case BT_CR: case BT_LF:
- /* This case ensures that the first attribute name is counted
- Apart from that we could just change state on the quote. */
- if (state == inName)
- state = other;
- else if (state == inValue && nAtts < attsMax)
- atts[nAtts].normalized = 0;
- break;
- case BT_GT:
- case BT_SOL:
- if (state != inValue)
- return nAtts;
- break;
- default:
- break;
- }
- }
- /* not reached */
-}
-
-static int PTRFASTCALL
-PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr)
-{
- int result = 0;
- /* skip &# */
- ptr += 2*MINBPC(enc);
- if (CHAR_MATCHES(enc, ptr, ASCII_x)) {
- for (ptr += MINBPC(enc);
- !CHAR_MATCHES(enc, ptr, ASCII_SEMI);
- ptr += MINBPC(enc)) {
- int c = BYTE_TO_ASCII(enc, ptr);
- switch (c) {
- case ASCII_0: case ASCII_1: case ASCII_2: case ASCII_3: case ASCII_4:
- case ASCII_5: case ASCII_6: case ASCII_7: case ASCII_8: case ASCII_9:
- result <<= 4;
- result |= (c - ASCII_0);
- break;
- case ASCII_A: case ASCII_B: case ASCII_C:
- case ASCII_D: case ASCII_E: case ASCII_F:
- result <<= 4;
- result += 10 + (c - ASCII_A);
- break;
- case ASCII_a: case ASCII_b: case ASCII_c:
- case ASCII_d: case ASCII_e: case ASCII_f:
- result <<= 4;
- result += 10 + (c - ASCII_a);
- break;
- }
- if (result >= 0x110000)
- return -1;
- }
- }
- else {
- for (; !CHAR_MATCHES(enc, ptr, ASCII_SEMI); ptr += MINBPC(enc)) {
- int c = BYTE_TO_ASCII(enc, ptr);
- result *= 10;
- result += (c - ASCII_0);
- if (result >= 0x110000)
- return -1;
- }
- }
- return checkCharRefNumber(result);
-}
-
-static int PTRCALL
-PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr,
- const char *end)
-{
- switch ((end - ptr)/MINBPC(enc)) {
- case 2:
- if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_t)) {
- switch (BYTE_TO_ASCII(enc, ptr)) {
- case ASCII_l:
- return ASCII_LT;
- case ASCII_g:
- return ASCII_GT;
- }
- }
- break;
- case 3:
- if (CHAR_MATCHES(enc, ptr, ASCII_a)) {
- ptr += MINBPC(enc);
- if (CHAR_MATCHES(enc, ptr, ASCII_m)) {
- ptr += MINBPC(enc);
- if (CHAR_MATCHES(enc, ptr, ASCII_p))
- return ASCII_AMP;
- }
- }
- break;
- case 4:
- switch (BYTE_TO_ASCII(enc, ptr)) {
- case ASCII_q:
- ptr += MINBPC(enc);
- if (CHAR_MATCHES(enc, ptr, ASCII_u)) {
- ptr += MINBPC(enc);
- if (CHAR_MATCHES(enc, ptr, ASCII_o)) {
- ptr += MINBPC(enc);
- if (CHAR_MATCHES(enc, ptr, ASCII_t))
- return ASCII_QUOT;
- }
- }
- break;
- case ASCII_a:
- ptr += MINBPC(enc);
- if (CHAR_MATCHES(enc, ptr, ASCII_p)) {
- ptr += MINBPC(enc);
- if (CHAR_MATCHES(enc, ptr, ASCII_o)) {
- ptr += MINBPC(enc);
- if (CHAR_MATCHES(enc, ptr, ASCII_s))
- return ASCII_APOS;
- }
- }
- break;
- }
- }
- return 0;
-}
-
-static int PTRCALL
-PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2)
-{
- for (;;) {
- switch (BYTE_TYPE(enc, ptr1)) {
-#define LEAD_CASE(n) \
- case BT_LEAD ## n: \
- if (*ptr1++ != *ptr2++) \
- return 0;
- LEAD_CASE(4) LEAD_CASE(3) LEAD_CASE(2)
-#undef LEAD_CASE
- /* fall through */
- if (*ptr1++ != *ptr2++)
- return 0;
- break;
- case BT_NONASCII:
- case BT_NMSTRT:
-#ifdef XML_NS
- case BT_COLON:
-#endif
- case BT_HEX:
- case BT_DIGIT:
- case BT_NAME:
- case BT_MINUS:
- if (*ptr2++ != *ptr1++)
- return 0;
- if (MINBPC(enc) > 1) {
- if (*ptr2++ != *ptr1++)
- return 0;
- if (MINBPC(enc) > 2) {
- if (*ptr2++ != *ptr1++)
- return 0;
- if (MINBPC(enc) > 3) {
- if (*ptr2++ != *ptr1++)
- return 0;
- }
- }
- }
- break;
- default:
- if (MINBPC(enc) == 1 && *ptr1 == *ptr2)
- return 1;
- switch (BYTE_TYPE(enc, ptr2)) {
- case BT_LEAD2:
- case BT_LEAD3:
- case BT_LEAD4:
- case BT_NONASCII:
- case BT_NMSTRT:
-#ifdef XML_NS
- case BT_COLON:
-#endif
- case BT_HEX:
- case BT_DIGIT:
- case BT_NAME:
- case BT_MINUS:
- return 0;
- default:
- return 1;
- }
- }
- }
- /* not reached */
-}
-
-static int PTRCALL
-PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1,
- const char *end1, const char *ptr2)
-{
- for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) {
- if (ptr1 == end1)
- return 0;
- if (!CHAR_MATCHES(enc, ptr1, *ptr2))
- return 0;
- }
- return ptr1 == end1;
-}
-
-static int PTRFASTCALL
-PREFIX(nameLength)(const ENCODING *enc, const char *ptr)
-{
- const char *start = ptr;
- for (;;) {
- switch (BYTE_TYPE(enc, ptr)) {
-#define LEAD_CASE(n) \
- case BT_LEAD ## n: ptr += n; break;
- LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
-#undef LEAD_CASE
- case BT_NONASCII:
- case BT_NMSTRT:
-#ifdef XML_NS
- case BT_COLON:
-#endif
- case BT_HEX:
- case BT_DIGIT:
- case BT_NAME:
- case BT_MINUS:
- ptr += MINBPC(enc);
- break;
- default:
- return (int)(ptr - start);
- }
- }
-}
-
-static const char * PTRFASTCALL
-PREFIX(skipS)(const ENCODING *enc, const char *ptr)
-{
- for (;;) {
- switch (BYTE_TYPE(enc, ptr)) {
- case BT_LF:
- case BT_CR:
- case BT_S:
- ptr += MINBPC(enc);
- break;
- default:
- return ptr;
- }
- }
-}
-
-static void PTRCALL
-PREFIX(updatePosition)(const ENCODING *enc,
- const char *ptr,
- const char *end,
- POSITION *pos)
-{
- while (ptr != end) {
- switch (BYTE_TYPE(enc, ptr)) {
-#define LEAD_CASE(n) \
- case BT_LEAD ## n: \
- ptr += n; \
- break;
- LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
-#undef LEAD_CASE
- case BT_LF:
- pos->columnNumber = (XML_Size)-1;
- pos->lineNumber++;
- ptr += MINBPC(enc);
- break;
- case BT_CR:
- pos->lineNumber++;
- ptr += MINBPC(enc);
- if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF)
- ptr += MINBPC(enc);
- pos->columnNumber = (XML_Size)-1;
- break;
- default:
- ptr += MINBPC(enc);
- break;
- }
- pos->columnNumber++;
- }
-}
-
-#undef DO_LEAD_CASE
-#undef MULTIBYTE_CASES
-#undef INVALID_CASES
-#undef CHECK_NAME_CASE
-#undef CHECK_NAME_CASES
-#undef CHECK_NMSTRT_CASE
-#undef CHECK_NMSTRT_CASES
-
-#endif /* XML_TOK_IMPL_C */
diff --git a/Utilities/Poco/XML/src/xmltok_impl.h b/Utilities/Poco/XML/src/xmltok_impl.h
deleted file mode 100755
index da0ea60a65..0000000000
--- a/Utilities/Poco/XML/src/xmltok_impl.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
-See the file COPYING for copying permission.
-*/
-
-enum {
- BT_NONXML,
- BT_MALFORM,
- BT_LT,
- BT_AMP,
- BT_RSQB,
- BT_LEAD2,
- BT_LEAD3,
- BT_LEAD4,
- BT_TRAIL,
- BT_CR,
- BT_LF,
- BT_GT,
- BT_QUOT,
- BT_APOS,
- BT_EQUALS,
- BT_QUEST,
- BT_EXCL,
- BT_SOL,
- BT_SEMI,
- BT_NUM,
- BT_LSQB,
- BT_S,
- BT_NMSTRT,
- BT_COLON,
- BT_HEX,
- BT_DIGIT,
- BT_NAME,
- BT_MINUS,
- BT_OTHER, /* known not to be a name or name start character */
- BT_NONASCII, /* might be a name or name start character */
- BT_PERCNT,
- BT_LPAR,
- BT_RPAR,
- BT_AST,
- BT_PLUS,
- BT_COMMA,
- BT_VERBAR
-};
-
-#include <stddef.h>
diff --git a/Utilities/Poco/XML/src/xmltok_ns.c b/Utilities/Poco/XML/src/xmltok_ns.c
deleted file mode 100755
index c3b88fdf4e..0000000000
--- a/Utilities/Poco/XML/src/xmltok_ns.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
-
-/* This file is included! */
-#ifdef XML_TOK_NS_C
-
-const ENCODING *
-NS(XmlGetUtf8InternalEncoding)(void)
-{
- return &ns(internal_utf8_encoding).enc;
-}
-
-const ENCODING *
-NS(XmlGetUtf16InternalEncoding)(void)
-{
-#if BYTEORDER == 1234
- return &ns(internal_little2_encoding).enc;
-#elif BYTEORDER == 4321
- return &ns(internal_big2_encoding).enc;
-#else
- const short n = 1;
- return (*(const char *)&n
- ? &ns(internal_little2_encoding).enc
- : &ns(internal_big2_encoding).enc);
-#endif
-}
-
-static const ENCODING * const NS(encodings)[] = {
- &ns(latin1_encoding).enc,
- &ns(ascii_encoding).enc,
- &ns(utf8_encoding).enc,
- &ns(big2_encoding).enc,
- &ns(big2_encoding).enc,
- &ns(little2_encoding).enc,
- &ns(utf8_encoding).enc /* NO_ENC */
-};
-
-static int PTRCALL
-NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
- return initScan(NS(encodings), (const INIT_ENCODING *)enc,
- XML_PROLOG_STATE, ptr, end, nextTokPtr);
-}
-
-static int PTRCALL
-NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
- const char **nextTokPtr)
-{
- return initScan(NS(encodings), (const INIT_ENCODING *)enc,
- XML_CONTENT_STATE, ptr, end, nextTokPtr);
-}
-
-int
-NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
- const char *name)
-{
- int i = getEncodingIndex(name);
- if (i == UNKNOWN_ENC)
- return 0;
- SET_INIT_ENC_INDEX(p, i);
- p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
- p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
- p->initEnc.updatePosition = initUpdatePosition;
- p->encPtr = encPtr;
- *encPtr = &(p->initEnc);
- return 1;
-}
-
-static const ENCODING *
-NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
-{
-#define ENCODING_MAX 128
- char buf[ENCODING_MAX];
- char *p = buf;
- int i;
- XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
- if (ptr != end)
- return 0;
- *p = 0;
- if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
- return enc;
- i = getEncodingIndex(buf);
- if (i == UNKNOWN_ENC)
- return 0;
- return NS(encodings)[i];
-}
-
-int
-NS(XmlParseXmlDecl)(int isGeneralTextEntity,
- const ENCODING *enc,
- const char *ptr,
- const char *end,
- const char **badPtr,
- const char **versionPtr,
- const char **versionEndPtr,
- const char **encodingName,
- const ENCODING **encoding,
- int *standalone)
-{
- return doParseXmlDecl(NS(findEncoding),
- isGeneralTextEntity,
- enc,
- ptr,
- end,
- badPtr,
- versionPtr,
- versionEndPtr,
- encodingName,
- encoding,
- standalone);
-}
-
-#endif /* XML_TOK_NS_C */
diff --git a/Utilities/Poco/XML/testsuite/CMakeLists.txt b/Utilities/Poco/XML/testsuite/CMakeLists.txt
deleted file mode 100755
index a8611be378..0000000000
--- a/Utilities/Poco/XML/testsuite/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-include(files.cmake)
-
-add_executable(PocoTestRunnerXML ${CPP_FILES})
-target_link_libraries(PocoTestRunnerXML PocoXML PocoFoundation CppUnit)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../Foundation/include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../XML/include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../CppUnit/include
-)
-
-if(WIN32)
- target_link_libraries(PocoTestRunnerXML
- WinTestRunner
- )
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../CppUnit/WinTestRunner/include)
- add_definitions(-D_AFXDLL)
-endif(WIN32)
-
-#set_target_properties(PocoTestRunnerXML PROPERTIES COMPILE_FLAGS "${POCO_UNIX_COMPILE_FLAGS}")
diff --git a/Utilities/Poco/XML/testsuite/files.cmake b/Utilities/Poco/XML/testsuite/files.cmake
deleted file mode 100755
index d86d94aad4..0000000000
--- a/Utilities/Poco/XML/testsuite/files.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-set(CPP_BASE_FILENAMES
- AttributesImplTest ChildNodesTest DOMTestSuite DocumentTest
- DocumentTypeTest Driver ElementTest EventTest NamePoolTest NameTest
- NamespaceSupportTest NodeIteratorTest NodeTest ParserWriterTest
- SAXParserTest SAXTestSuite TextTest TreeWalkerTest
- XMLTestSuite XMLWriterTest NodeAppenderTest
-)
-
-if(WIN32)
- set(CPP_BASE_FILENAMES
- WinDriver
- ${CPP_BASE_FILENAMES}
- )
-endif(WIN32)
-
-set(CPP_FILES "")
-foreach(basename ${CPP_BASE_FILENAMES})
- set(CPP_FILES ${CPP_FILES} src/${basename})
-endforeach(basename ${CPP_BASE_FILENAMES})
diff --git a/Utilities/Poco/XML/testsuite/src/AttributesImplTest.cpp b/Utilities/Poco/XML/testsuite/src/AttributesImplTest.cpp
deleted file mode 100755
index 6623a33f7d..0000000000
--- a/Utilities/Poco/XML/testsuite/src/AttributesImplTest.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-//
-// AttributesImplTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "AttributesImplTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/SAX/AttributesImpl.h"
-
-
-using Poco::XML::AttributesImpl;
-
-
-AttributesImplTest::AttributesImplTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-AttributesImplTest::~AttributesImplTest()
-{
-}
-
-
-void AttributesImplTest::testNoNamespaces()
-{
- AttributesImpl attrs;
-
- assert (attrs.getLength() == 0);
- assert (attrs.getIndex("foo") == -1);
- assert (attrs.getValue("foo").empty());
-
- attrs.addAttribute("", "", "a1", "CDATA", "v1");
- assert (attrs.getLength() == 1);
- assert (attrs.getIndex("a1") == 0);
- assert (attrs.getQName(0) == "a1");
- assert (attrs.getType(0) == "CDATA");
- assert (attrs.getValue(0) == "v1");
- assert (attrs.isSpecified(0));
-
- assert (attrs.getType("a1") == "CDATA");
- assert (attrs.getValue("a1") == "v1");
-
- attrs.addAttribute("", "", "a2", "CDATA", "v2");
- assert (attrs.getLength() == 2);
- assert (attrs.getIndex("a2") == 1);
- assert (attrs.getQName(1) == "a2");
- assert (attrs.getType(1) == "CDATA");
- assert (attrs.getValue(1) == "v2");
- assert (attrs.isSpecified(1));
-
- assert (attrs.getType("a2") == "CDATA");
- assert (attrs.getValue("a2") == "v2");
-
- attrs.addAttribute("", "", "a3", "CDATA", "v3");
- assert (attrs.getLength() == 3);
- assert (attrs.getIndex("a3") == 2);
- assert (attrs.getValue("a3") == "v3");
-
- attrs.removeAttribute(0);
- assert (attrs.getLength() == 2);
- assert (attrs.getIndex("a1") == -1);
- assert (attrs.getIndex("a2") == 0);
- assert (attrs.getIndex("a3") == 1);
- assert (attrs.getQName(0) == "a2");
- assert (attrs.getQName(1) == "a3");
-
- attrs.removeAttribute("a3");
- assert (attrs.getLength() == 1);
- assert (attrs.getIndex("a1") == -1);
- assert (attrs.getIndex("a2") == 0);
- assert (attrs.getIndex("a3") == -1);
- assert (attrs.getQName(0) == "a2");
-}
-
-
-void AttributesImplTest::testNamespaces()
-{
- AttributesImpl attrs;
-
- assert (attrs.getLength() == 0);
- assert (attrs.getIndex("urn:ns", "foo") == -1);
- assert (attrs.getValue("urn:ns", "foo").empty());
-
- attrs.addAttribute("urn:ns", "a1", "p:a1", "CDATA", "v1");
- assert (attrs.getLength() == 1);
- assert (attrs.getIndex("urn:ns", "a1") == 0);
- assert (attrs.getQName(0) == "p:a1");
- assert (attrs.getLocalName(0) == "a1");
- assert (attrs.getURI(0) == "urn:ns");
- assert (attrs.getType(0) == "CDATA");
- assert (attrs.getValue(0) == "v1");
- assert (attrs.isSpecified(0));
-
- assert (attrs.getType("urn:ns", "a1") == "CDATA");
- assert (attrs.getValue("urn:ns", "a1") == "v1");
-
- attrs.addAttribute("urn:ns", "a2", "p:a2", "CDATA", "v2");
- assert (attrs.getLength() == 2);
- assert (attrs.getIndex("urn:ns", "a2") == 1);
- assert (attrs.getQName(1) == "p:a2");
- assert (attrs.getLocalName(1) == "a2");
- assert (attrs.getURI(1) == "urn:ns");
- assert (attrs.getType(1) == "CDATA");
- assert (attrs.getValue(1) == "v2");
- assert (attrs.isSpecified(1));
-
- assert (attrs.getType("urn:ns", "a2") == "CDATA");
- assert (attrs.getValue("urn:ns", "a2") == "v2");
-
- assert (attrs.getIndex("urn:ns2", "a2") == -1);
-
- attrs.addAttribute("urn:ns2", "a3", "q:a3", "CDATA", "v3");
- assert (attrs.getLength() == 3);
- assert (attrs.getIndex("urn:ns2", "a3") == 2);
- assert (attrs.getValue("urn:ns2", "a3") == "v3");
-
- attrs.removeAttribute(0);
- assert (attrs.getLength() == 2);
- assert (attrs.getIndex("urn:ns", "a1") == -1);
- assert (attrs.getIndex("urn:ns", "a2") == 0);
- assert (attrs.getIndex("urn:ns2", "a3") == 1);
- assert (attrs.getQName(0) == "p:a2");
- assert (attrs.getLocalName(0) == "a2");
- assert (attrs.getURI(0) == "urn:ns");
- assert (attrs.getQName(1) == "q:a3");
- assert (attrs.getLocalName(1) == "a3");
- assert (attrs.getURI(1) == "urn:ns2");
-
- attrs.removeAttribute("urn:ns", "a3");
- assert (attrs.getLength() == 2);
-
- attrs.removeAttribute("urn:ns2", "a3");
- assert (attrs.getLength() == 1);
- assert (attrs.getIndex("urn:ns", "a1") == -1);
- assert (attrs.getIndex("urn:ns", "a2") == 0);
- assert (attrs.getIndex("urn:ns2", "a3") == -1);
- assert (attrs.getQName(0) == "p:a2");
-}
-
-
-void AttributesImplTest::testAccessors()
-{
- AttributesImpl attrs;
- attrs.addAttribute("urn:ns1", "a1", "p:a1", "CDATA", "v1");
- attrs.addAttribute("urn:ns1", "a2", "p:a2", "CDATA", "v2", false);
- attrs.addAttribute("urn:ns2", "a3", "q:a3", "CDATA", "v3", true);
-
- assert (attrs.getQName(0) == "p:a1");
- assert (attrs.getQName(1) == "p:a2");
- assert (attrs.getQName(2) == "q:a3");
-
- assert (attrs.getLocalName(0) == "a1");
- assert (attrs.getLocalName(1) == "a2");
- assert (attrs.getLocalName(2) == "a3");
-
- assert (attrs.getURI(0) == "urn:ns1");
- assert (attrs.getURI(1) == "urn:ns1");
- assert (attrs.getURI(2) == "urn:ns2");
-
- assert (attrs.getValue(0) == "v1");
- assert (attrs.getValue(1) == "v2");
- assert (attrs.getValue(2) == "v3");
-
- assert (attrs.isSpecified(0));
- assert (!attrs.isSpecified(1));
- assert (attrs.isSpecified(2));
-
- attrs.setType(0, "NMTOKEN");
- assert (attrs.getType(0) == "NMTOKEN");
- assert (attrs.getType("urn:ns1", "a1") == "NMTOKEN");
-
- attrs.setValue(1, "v2 v2");
- assert (attrs.getValue(1) == "v2 v2");
- assert (attrs.getValue("urn:ns1", "a2") == "v2 v2");
- assert (attrs.isSpecified(1));
-
- attrs.setLocalName(2, "A3");
- assert (attrs.getLocalName(2) == "A3");
- attrs.setQName(2, "p:A3");
- assert (attrs.getQName(2) == "p:A3");
- attrs.setURI(2, "urn:ns1");
- assert (attrs.getURI(2) == "urn:ns1");
-
- assert (attrs.getValue("urn:ns1", "A3") == "v3");
-}
-
-
-void AttributesImplTest::testCopy()
-{
- AttributesImpl attrs;
- attrs.addAttribute("urn:ns1", "a1", "p:a1", "CDATA", "v1");
- attrs.addAttribute("urn:ns1", "a2", "p:a2", "CDATA", "v2");
- attrs.addAttribute("urn:ns2", "a3", "q:a3", "CDATA", "v3");
-
- AttributesImpl attrs2;
- attrs2.setAttributes(attrs);
-
- assert (attrs2.getLength() == 3);
-
- assert (attrs2.getQName(0) == "p:a1");
- assert (attrs2.getQName(1) == "p:a2");
- assert (attrs2.getQName(2) == "q:a3");
-
- assert (attrs2.getLocalName(0) == "a1");
- assert (attrs2.getLocalName(1) == "a2");
- assert (attrs2.getLocalName(2) == "a3");
-
- assert (attrs2.getURI(0) == "urn:ns1");
- assert (attrs2.getURI(1) == "urn:ns1");
- assert (attrs2.getURI(2) == "urn:ns2");
-
- assert (attrs2.getValue(0) == "v1");
- assert (attrs2.getValue(1) == "v2");
- assert (attrs2.getValue(2) == "v3");
-}
-
-
-void AttributesImplTest::setUp()
-{
-}
-
-
-void AttributesImplTest::tearDown()
-{
-}
-
-
-CppUnit::Test* AttributesImplTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("AttributesImplTest");
-
- CppUnit_addTest(pSuite, AttributesImplTest, testNoNamespaces);
- CppUnit_addTest(pSuite, AttributesImplTest, testNamespaces);
- CppUnit_addTest(pSuite, AttributesImplTest, testAccessors);
- CppUnit_addTest(pSuite, AttributesImplTest, testCopy);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/AttributesImplTest.h b/Utilities/Poco/XML/testsuite/src/AttributesImplTest.h
deleted file mode 100755
index d916facc65..0000000000
--- a/Utilities/Poco/XML/testsuite/src/AttributesImplTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// AttributesImplTest.h
-//
-// $Id$
-//
-// Definition of the AttributesImplTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef AttributesImplTest_INCLUDED
-#define AttributesImplTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class AttributesImplTest: public CppUnit::TestCase
-{
-public:
- AttributesImplTest(const std::string& name);
- ~AttributesImplTest();
-
- void testNoNamespaces();
- void testNamespaces();
- void testAccessors();
- void testCopy();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // AttributesImplTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/ChildNodesTest.cpp b/Utilities/Poco/XML/testsuite/src/ChildNodesTest.cpp
deleted file mode 100755
index 51dcd1e3f8..0000000000
--- a/Utilities/Poco/XML/testsuite/src/ChildNodesTest.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// ChildNodesTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ChildNodesTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/NodeList.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-using Poco::XML::Element;
-using Poco::XML::Document;
-using Poco::XML::NodeList;
-using Poco::XML::Node;
-using Poco::XML::AutoPtr;
-
-
-ChildNodesTest::ChildNodesTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ChildNodesTest::~ChildNodesTest()
-{
-}
-
-
-void ChildNodesTest::testChildNodes()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- assert (!pRoot->hasChildNodes());
- AutoPtr<NodeList> pNL = pRoot->childNodes();
- assert (pNL->length() == 0);
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pRoot->appendChild(pChild1);
- assert (pRoot->hasChildNodes());
-
- assert (pNL->length() == 1);
- assert (pNL->item(0) == pChild1);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pRoot->appendChild(pChild2);
-
- assert (pNL->length() == 2);
- assert (pNL->item(0) == pChild1);
- assert (pNL->item(1) == pChild2);
-
- AutoPtr<Element> pChild0 = pDoc->createElement("child0");
- pRoot->insertBefore(pChild0, pChild1);
-
- assert (pNL->length() == 3);
- assert (pNL->item(0) == pChild0);
- assert (pNL->item(1) == pChild1);
- assert (pNL->item(2) == pChild2);
-
- pRoot->removeChild(pChild1);
- assert (pNL->length() == 2);
- assert (pNL->item(0) == pChild0);
- assert (pNL->item(1) == pChild2);
-
- pRoot->removeChild(pChild0);
- assert (pNL->length() == 1);
- assert (pNL->item(0) == pChild2);
-
- pRoot->removeChild(pChild2);
- assert (pNL->length() == 0);
- assert (pNL->item(0) == 0);
-
- assert (!pRoot->hasChildNodes());
-}
-
-
-void ChildNodesTest::setUp()
-{
-}
-
-
-void ChildNodesTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ChildNodesTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ChildNodesTest");
-
- CppUnit_addTest(pSuite, ChildNodesTest, testChildNodes);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/ChildNodesTest.h b/Utilities/Poco/XML/testsuite/src/ChildNodesTest.h
deleted file mode 100755
index 24502ff277..0000000000
--- a/Utilities/Poco/XML/testsuite/src/ChildNodesTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// ChildNodesTest.h
-//
-// $Id$
-//
-// Definition of the ChildNodesTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ChildNodesTest_INCLUDED
-#define ChildNodesTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class ChildNodesTest: public CppUnit::TestCase
-{
-public:
- ChildNodesTest(const std::string& name);
- ~ChildNodesTest();
-
- void testChildNodes();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ChildNodesTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/DOMTestSuite.cpp b/Utilities/Poco/XML/testsuite/src/DOMTestSuite.cpp
deleted file mode 100755
index 84ed245b0a..0000000000
--- a/Utilities/Poco/XML/testsuite/src/DOMTestSuite.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// DOMTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "DOMTestSuite.h"
-#include "NodeTest.h"
-#include "ChildNodesTest.h"
-#include "ElementTest.h"
-#include "TextTest.h"
-#include "DocumentTest.h"
-#include "DocumentTypeTest.h"
-#include "EventTest.h"
-#include "NodeIteratorTest.h"
-#include "TreeWalkerTest.h"
-#include "ParserWriterTest.h"
-#include "NodeAppenderTest.h"
-
-
-CppUnit::Test* DOMTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DOMTestSuite");
-
- pSuite->addTest(NodeTest::suite());
- pSuite->addTest(ChildNodesTest::suite());
- pSuite->addTest(ElementTest::suite());
- pSuite->addTest(TextTest::suite());
- pSuite->addTest(DocumentTest::suite());
- pSuite->addTest(DocumentTypeTest::suite());
- pSuite->addTest(EventTest::suite());
- pSuite->addTest(NodeIteratorTest::suite());
- pSuite->addTest(TreeWalkerTest::suite());
- pSuite->addTest(ParserWriterTest::suite());
- pSuite->addTest(NodeAppenderTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/DOMTestSuite.h b/Utilities/Poco/XML/testsuite/src/DOMTestSuite.h
deleted file mode 100755
index 9d0932f34e..0000000000
--- a/Utilities/Poco/XML/testsuite/src/DOMTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// DOMTestSuite.h
-//
-// $Id$
-//
-// Definition of the DOMTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DOMTestSuite_INCLUDED
-#define DOMTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class DOMTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // DOMTestSuite_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/DocumentTest.cpp b/Utilities/Poco/XML/testsuite/src/DocumentTest.cpp
deleted file mode 100755
index d6ca466f4f..0000000000
--- a/Utilities/Poco/XML/testsuite/src/DocumentTest.cpp
+++ /dev/null
@@ -1,310 +0,0 @@
-//
-// DocumentTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "DocumentTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/DOM/NodeList.h"
-#include "Poco/DOM/AutoPtr.h"
-#include "Poco/DOM/DOMException.h"
-
-
-using Poco::XML::Element;
-using Poco::XML::Document;
-using Poco::XML::Text;
-using Poco::XML::Node;
-using Poco::XML::NodeList;
-using Poco::XML::AutoPtr;
-using Poco::XML::XMLString;
-using Poco::XML::DOMException;
-
-
-DocumentTest::DocumentTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-DocumentTest::~DocumentTest()
-{
-}
-
-
-void DocumentTest::testDocumentElement()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- assert (pDoc->documentElement() == 0);
- pDoc->appendChild(pRoot);
- assert (pDoc->documentElement() == pRoot);
-
- AutoPtr<Text> pText = pDoc->createTextNode(" ");
- pDoc->insertBefore(pText, pRoot);
- assert (pDoc->documentElement() == pRoot);
-
-}
-
-
-void DocumentTest::testImport()
-{
- AutoPtr<Document> pDoc1 = new Document;
- AutoPtr<Element> pRoot1 = pDoc1->createElement("root");
-
- AutoPtr<Document> pDoc2 = new Document;
-
- try
- {
- pDoc2->appendChild(pRoot1);
- fail("wrong document - must throw exception");
- }
- catch (DOMException&)
- {
- }
-
- AutoPtr<Element> pRoot2 = static_cast<Element*>(pDoc2->importNode(pRoot1, false));
- assert (pRoot2->ownerDocument() == pDoc2);
- assert (pRoot1->ownerDocument() == pDoc1);
-
- pDoc2->appendChild(pRoot2);
-}
-
-
-void DocumentTest::testImportDeep()
-{
- AutoPtr<Document> pDoc1 = new Document;
- AutoPtr<Element> pRoot1 = pDoc1->createElement("root");
- AutoPtr<Element> pElem1 = pDoc1->createElement("elem");
- AutoPtr<Text> pText1 = pDoc1->createTextNode("text");
-
- pElem1->appendChild(pText1);
- pRoot1->appendChild(pElem1);
-
- pRoot1->setAttribute("a1", "v1");
- pRoot1->setAttribute("a2", "v2");
-
- AutoPtr<Document> pDoc2 = new Document;
-
- try
- {
- pDoc2->appendChild(pRoot1);
- fail("wrong document - must throw exception");
- }
- catch (DOMException&)
- {
- }
-
- AutoPtr<Element> pRoot2 = static_cast<Element*>(pDoc2->importNode(pRoot1, true));
- assert (pRoot2->ownerDocument() == pDoc2);
- assert (pRoot2->firstChild()->ownerDocument() == pDoc2);
- assert (pRoot2->firstChild()->firstChild()->ownerDocument() == pDoc2);
- assert (pRoot1->ownerDocument() == pDoc1);
- assert (pRoot1->firstChild()->ownerDocument() == pDoc1);
- assert (pRoot1->firstChild()->firstChild()->ownerDocument() == pDoc1);
-
- pDoc2->appendChild(pRoot2);
-}
-
-
-void DocumentTest::testElementsByTagName()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- pDoc->appendChild(pRoot);
- AutoPtr<NodeList> pNL1 = pDoc->getElementsByTagName("*");
- AutoPtr<NodeList> pNL2 = pDoc->getElementsByTagName("elem");
-
- assert (pNL1->length() == 1);
- assert (pNL1->item(0) == pRoot);
- assert (pNL2->length() == 0);
-
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- pRoot->appendChild(pElem1);
-
- assert (pNL1->length() == 2);
- assert (pNL2->length() == 1);
- assert (pNL1->item(0) == pRoot);
- assert (pNL1->item(1) == pElem1);
- assert (pNL2->item(0) == pElem1);
-
- AutoPtr<Element> pElem2 = pDoc->createElement("Elem");
- pRoot->appendChild(pElem2);
-
- assert (pNL1->length() == 3);
- assert (pNL2->length() == 1);
- assert (pNL1->item(0) == pRoot);
- assert (pNL1->item(1) == pElem1);
- assert (pNL1->item(2) == pElem2);
- assert (pNL2->item(0) == pElem1);
-}
-
-
-void DocumentTest::testElementsByTagNameNS()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElementNS("urn:ns1", "root");
- pDoc->appendChild(pRoot);
- AutoPtr<NodeList> pNL1 = pDoc->getElementsByTagNameNS("*", "*");
- AutoPtr<NodeList> pNL2 = pDoc->getElementsByTagNameNS("*", "elem");
-
- assert (pNL1->length() == 1);
- assert (pNL1->item(0) == pRoot);
- assert (pNL2->length() == 0);
-
- AutoPtr<Element> pElem1 = pDoc->createElementNS("urn:ns1", "elem");
- pRoot->appendChild(pElem1);
-
- assert (pNL1->length() == 2);
- assert (pNL2->length() == 1);
- assert (pNL1->item(0) == pRoot);
- assert (pNL1->item(1) == pElem1);
- assert (pNL2->item(0) == pElem1);
-
- AutoPtr<Element> pElem2 = pDoc->createElementNS("urn:ns1", "Elem");
- pRoot->appendChild(pElem2);
-
- assert (pNL1->length() == 3);
- assert (pNL2->length() == 1);
- assert (pNL1->item(0) == pRoot);
- assert (pNL1->item(1) == pElem1);
- assert (pNL1->item(2) == pElem2);
- assert (pNL2->item(0) == pElem1);
-}
-
-
-void DocumentTest::testElementById()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- pRoot->setAttribute("id", "0");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- pElem1->setAttribute("id", "1");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- pElem2->setAttribute("id", "2");
- AutoPtr<Element> pElem3 = pDoc->createElement("elem");
- pElem3->setAttribute("id", "3");
-
- pElem1->appendChild(pText1);
- pElem1->appendChild(pElem2);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem3);
- pDoc->appendChild(pRoot);
-
- Element* pFound = pDoc->getElementById("0", "id");
- assert (pFound == pRoot);
-
- pFound = pDoc->getElementById("1", "id");
- assert (pFound == pElem1);
-
- pFound = pDoc->getElementById("2", "id");
- assert (pFound == pElem2);
-
- pFound = pDoc->getElementById("3", "id");
- assert (pFound == pElem3);
-
- pFound = pDoc->getElementById("4", "id");
- assert (pFound == 0);
-
- pFound = pDoc->getElementById("0", "ID");
- assert (pFound == 0);
-}
-
-
-void DocumentTest::testElementByIdNS()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElementNS("urn:ns1", "root");
- pRoot->setAttributeNS("urn:ns1", "id", "0");
- AutoPtr<Element> pElem1 = pDoc->createElementNS("urn:ns1", "elem");
- pElem1->setAttributeNS("urn:ns1", "id", "1");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text");
- AutoPtr<Element> pElem2 = pDoc->createElementNS("urn:ns1", "elem");
- pElem2->setAttributeNS("urn:ns1", "id", "2");
- AutoPtr<Element> pElem3 = pDoc->createElementNS("urn:ns1", "elem");
- pElem3->setAttributeNS("urn:ns1", "id", "3");
-
- pElem1->appendChild(pText1);
- pElem1->appendChild(pElem2);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem3);
- pDoc->appendChild(pRoot);
-
- Element* pFound = pDoc->getElementByIdNS("0", "urn:ns1", "id");
- assert (pFound == pRoot);
-
- pFound = pDoc->getElementByIdNS("1", "urn:ns1", "id");
- assert (pFound == pElem1);
-
- pFound = pDoc->getElementByIdNS("2", "urn:ns1", "id");
- assert (pFound == pElem2);
-
- pFound = pDoc->getElementByIdNS("3", "urn:ns1", "id");
- assert (pFound == pElem3);
-
- pFound = pDoc->getElementByIdNS("4", "urn:ns1", "id");
- assert (pFound == 0);
-
- pFound = pDoc->getElementByIdNS("0", "urn:ns1", "ID");
- assert (pFound == 0);
-
- pFound = pDoc->getElementByIdNS("0", "urn:ns2", "id");
- assert (pFound == 0);
-}
-
-
-void DocumentTest::setUp()
-{
-}
-
-
-void DocumentTest::tearDown()
-{
-}
-
-
-CppUnit::Test* DocumentTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DocumentTest");
-
- CppUnit_addTest(pSuite, DocumentTest, testDocumentElement);
- CppUnit_addTest(pSuite, DocumentTest, testImport);
- CppUnit_addTest(pSuite, DocumentTest, testImportDeep);
- CppUnit_addTest(pSuite, DocumentTest, testElementsByTagName);
- CppUnit_addTest(pSuite, DocumentTest, testElementsByTagNameNS);
- CppUnit_addTest(pSuite, DocumentTest, testElementById);
- CppUnit_addTest(pSuite, DocumentTest, testElementByIdNS);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/DocumentTest.h b/Utilities/Poco/XML/testsuite/src/DocumentTest.h
deleted file mode 100755
index cc666c53a2..0000000000
--- a/Utilities/Poco/XML/testsuite/src/DocumentTest.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// DocumentTest.h
-//
-// $Id$
-//
-// Definition of the DocumentTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DocumentTest_INCLUDED
-#define DocumentTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class DocumentTest: public CppUnit::TestCase
-{
-public:
- DocumentTest(const std::string& name);
- ~DocumentTest();
-
- void testDocumentElement();
- void testImport();
- void testImportDeep();
- void testElementsByTagName();
- void testElementsByTagNameNS();
- void testElementById();
- void testElementByIdNS();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // DocumentTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/DocumentTypeTest.cpp b/Utilities/Poco/XML/testsuite/src/DocumentTypeTest.cpp
deleted file mode 100755
index e03be39605..0000000000
--- a/Utilities/Poco/XML/testsuite/src/DocumentTypeTest.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-//
-// DocumentTypeTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "DocumentTypeTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/DocumentType.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/Notation.h"
-#include "Poco/DOM/Entity.h"
-#include "Poco/DOM/DOMImplementation.h"
-#include "Poco/DOM/NamedNodeMap.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-using Poco::XML::DocumentType;
-using Poco::XML::Document;
-using Poco::XML::Entity;
-using Poco::XML::Notation;
-using Poco::XML::DOMImplementation;
-using Poco::XML::NamedNodeMap;
-using Poco::XML::AutoPtr;
-
-
-DocumentTypeTest::DocumentTypeTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-DocumentTypeTest::~DocumentTypeTest()
-{
-}
-
-
-void DocumentTypeTest::testDocumentType()
-{
- AutoPtr<DocumentType> pDoctype = DOMImplementation::instance().createDocumentType("test", "public", "system");
-
- assert (pDoctype->ownerDocument() == 0);
- assert (pDoctype->name() == "test");
- assert (pDoctype->publicId() == "public");
- assert (pDoctype->systemId() == "system");
-
- AutoPtr<Document> pDoc = new Document(pDoctype);
- assert (pDoc->doctype() == pDoctype);
- assert (pDoctype->ownerDocument() == pDoc);
-
- AutoPtr<NamedNodeMap> pEntities = pDoctype->entities();
- AutoPtr<NamedNodeMap> pNotations = pDoctype->notations();
-
- assert (pEntities->length() == 0);
- assert (pNotations->length() == 0);
-
- AutoPtr<Entity> pEntity1 = pDoc->createEntity("entity1", "public1", "system1", "");
- pDoctype->appendChild(pEntity1);
-
- assert (pEntities->length() == 1);
- assert (pNotations->length() == 0);
- assert (pEntities->item(0) == pEntity1);
- assert (pEntities->getNamedItem("entity1") == pEntity1);
-
- AutoPtr<Entity> pEntity2 = pDoc->createEntity("entity2", "public2", "system2", "");
- pDoctype->appendChild(pEntity2);
- assert (pEntities->length() == 2);
- assert (pNotations->length() == 0);
- assert (pEntities->item(0) == pEntity1);
- assert (pEntities->item(1) == pEntity2);
- assert (pEntities->getNamedItem("entity1") == pEntity1);
- assert (pEntities->getNamedItem("entity2") == pEntity2);
-
- AutoPtr<Notation> pNotation = pDoc->createNotation("notation", "public", "system");
- pDoctype->appendChild(pNotation);
- assert (pEntities->length() == 2);
- assert (pNotations->length() == 1);
- assert (pEntities->item(0) == pEntity1);
- assert (pEntities->item(1) == pEntity2);
- assert (pNotations->item(0) == pNotation);
- assert (pEntities->getNamedItem("entity1") == pEntity1);
- assert (pEntities->getNamedItem("entity2") == pEntity2);
- assert (pNotations->getNamedItem("notation") == pNotation);
-}
-
-
-void DocumentTypeTest::setUp()
-{
-}
-
-
-void DocumentTypeTest::tearDown()
-{
-}
-
-
-CppUnit::Test* DocumentTypeTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DocumentTypeTest");
-
- CppUnit_addTest(pSuite, DocumentTypeTest, testDocumentType);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/DocumentTypeTest.h b/Utilities/Poco/XML/testsuite/src/DocumentTypeTest.h
deleted file mode 100755
index f60c46f5d4..0000000000
--- a/Utilities/Poco/XML/testsuite/src/DocumentTypeTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// DocumentTypeTest.h
-//
-// $Id$
-//
-// Definition of the DocumentTypeTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef DocumentTypeTest_INCLUDED
-#define DocumentTypeTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class DocumentTypeTest: public CppUnit::TestCase
-{
-public:
- DocumentTypeTest(const std::string& name);
- ~DocumentTypeTest();
-
- void testDocumentType();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // DocumentTypeTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/Driver.cpp b/Utilities/Poco/XML/testsuite/src/Driver.cpp
deleted file mode 100755
index 6d9ad3cc02..0000000000
--- a/Utilities/Poco/XML/testsuite/src/Driver.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Driver.cpp
-//
-// $Id$
-//
-// Console-based test driver for Poco XML.
-//
-// Copyright (c) 2004-2006, 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 "CppUnit/TestRunner.h"
-#include "XMLTestSuite.h"
-
-
-CppUnitMain(XMLTestSuite)
diff --git a/Utilities/Poco/XML/testsuite/src/ElementTest.cpp b/Utilities/Poco/XML/testsuite/src/ElementTest.cpp
deleted file mode 100755
index 5b72da725e..0000000000
--- a/Utilities/Poco/XML/testsuite/src/ElementTest.cpp
+++ /dev/null
@@ -1,658 +0,0 @@
-//
-// ElementTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ElementTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Attr.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/DOM/NamedNodeMap.h"
-#include "Poco/DOM/NodeList.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-using Poco::XML::Element;
-using Poco::XML::Document;
-using Poco::XML::Attr;
-using Poco::XML::Text;
-using Poco::XML::Node;
-using Poco::XML::NamedNodeMap;
-using Poco::XML::NodeList;
-using Poco::XML::AutoPtr;
-using Poco::XML::XMLString;
-
-
-ElementTest::ElementTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ElementTest::~ElementTest()
-{
-}
-
-
-void ElementTest::testAttributes()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pElem = pDoc->createElement("elem");
-
- assert (!pElem->hasAttributes());
-
- pElem->setAttribute("a1", "v1");
- assert (pElem->hasAttributes());
-
- assert (pElem->hasAttribute("a1"));
- assert (pElem->getAttribute("a1") == "v1");
-
- Attr* pAttr1 = pElem->getAttributeNode("a1");
- assert (pAttr1 != 0);
- assert (pAttr1->name() == "a1");
- assert (pAttr1->nodeName() == "a1");
- assert (pAttr1->value() == "v1");
- assert (pAttr1->nodeValue() == "v1");
- assert (pAttr1->ownerElement() == pElem);
- assert (pAttr1->ownerDocument() == pDoc);
- assert (pAttr1->innerText() == "v1");
-
- assert (pAttr1->previousSibling() == 0);
- assert (pAttr1->nextSibling() == 0);
-
- pAttr1->setValue("V1");
- assert (pElem->getAttribute("a1") == "V1");
-
- pElem->setAttribute("a2", "v2");
- assert (pElem->hasAttribute("a1"));
- assert (pElem->getAttribute("a1") == "V1");
- assert (pElem->hasAttribute("a2"));
- assert (pElem->getAttribute("a2") == "v2");
-
- Attr* pAttr2 = pElem->getAttributeNode("a2");
- assert (pAttr2 != 0);
- assert (pAttr2->name() == "a2");
- assert (pAttr2->value() == "v2");
- assert (pAttr2->ownerElement() == pElem);
-
- assert (pAttr1->previousSibling() == 0);
- assert (pAttr1->nextSibling() == pAttr2);
- assert (pAttr2->previousSibling() == pAttr1);
- assert (pAttr2->nextSibling() == 0);
-
- Attr* pAttr3 = pElem->getAttributeNode("a3");
- assert (pAttr3 == 0);
-
- pAttr3 = pDoc->createAttribute("a3");
- pAttr3->setValue("v3");
- pElem->setAttributeNode(pAttr3);
- pAttr3->release();
-
- assert (pElem->hasAttribute("a1"));
- assert (pElem->getAttribute("a1") == "V1");
- assert (pElem->hasAttribute("a2"));
- assert (pElem->getAttribute("a2") == "v2");
- assert (pElem->hasAttribute("a3"));
- assert (pElem->getAttribute("a3") == "v3");
-
- assert (pAttr1->previousSibling() == 0);
- assert (pAttr1->nextSibling() == pAttr2);
- assert (pAttr2->previousSibling() == pAttr1);
- assert (pAttr2->nextSibling() == pAttr3);
- assert (pAttr3->previousSibling() == pAttr2);
- assert (pAttr3->nextSibling() == 0);
-
- pAttr2 = pDoc->createAttribute("a2");
- pAttr2->setValue("V2");
- pElem->setAttributeNode(pAttr2);
- pAttr2->release();
-
- assert (pElem->hasAttribute("a1"));
- assert (pElem->getAttribute("a1") == "V1");
- assert (pElem->hasAttribute("a2"));
- assert (pElem->getAttribute("a2") == "V2");
- assert (pElem->hasAttribute("a3"));
- assert (pElem->getAttribute("a3") == "v3");
-
- pAttr1 = pDoc->createAttribute("a1");
- pAttr1->setValue("v1");
- pElem->setAttributeNode(pAttr1);
- pAttr1->release();
-
- assert (pElem->hasAttribute("a1"));
- assert (pElem->getAttribute("a1") == "v1");
- assert (pElem->hasAttribute("a2"));
- assert (pElem->getAttribute("a2") == "V2");
- assert (pElem->hasAttribute("a3"));
- assert (pElem->getAttribute("a3") == "v3");
-
- pAttr3 = pDoc->createAttribute("a3");
- pAttr3->setValue("V3");
- pElem->setAttributeNode(pAttr3);
- pAttr3->release();
-
- assert (pElem->hasAttribute("a1"));
- assert (pElem->getAttribute("a1") == "v1");
- assert (pElem->hasAttribute("a2"));
- assert (pElem->getAttribute("a2") == "V2");
- assert (pElem->hasAttribute("a3"));
- assert (pElem->getAttribute("a3") == "V3");
-
- pElem->removeAttributeNode(pAttr3);
- assert (!pElem->hasAttribute("a3"));
-
- pElem->removeAttribute("a1");
- assert (!pElem->hasAttribute("a1"));
-
- pElem->removeAttribute("a2");
- assert (!pElem->hasAttribute("a2"));
-
- assert (!pElem->hasAttributes());
-}
-
-
-void ElementTest::testAttributesNS()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pElem = pDoc->createElementNS("urn:ns1", "p:elem");
-
- assert (pElem->namespaceURI() == "urn:ns1");
- assert (pElem->prefix() == "p");
- assert (pElem->tagName() == "p:elem");
- assert (pElem->localName() == "elem");
-
- assert (!pElem->hasAttributes());
-
- pElem->setAttributeNS("urn:ns1", "a1", "v1");
- assert (pElem->hasAttributes());
-
- assert (pElem->hasAttributeNS("urn:ns1", "a1"));
- assert (pElem->getAttributeNS("urn:ns1", "a1") == "v1");
-
- Attr* pAttr1 = pElem->getAttributeNodeNS("urn:ns1", "a1");
- assert (pAttr1 != 0);
- assert (pAttr1->name() == "a1");
- assert (pAttr1->namespaceURI() == "urn:ns1");
- assert (pAttr1->prefix().empty());
- assert (pAttr1->localName() == "a1");
- assert (pAttr1->nodeName() == "a1");
- assert (pAttr1->value() == "v1");
- assert (pAttr1->nodeValue() == "v1");
- assert (pAttr1->ownerElement() == pElem);
-
- pAttr1->setValue("V1");
- assert (pElem->getAttributeNS("urn:ns1", "a1") == "V1");
-
- pElem->setAttributeNS("urn:ns1", "a2", "v2");
- assert (pElem->hasAttributeNS("urn:ns1", "a1"));
- assert (pElem->getAttributeNS("urn:ns1", "a1") == "V1");
- assert (pElem->hasAttributeNS("urn:ns1", "a2"));
- assert (pElem->getAttributeNS("urn:ns1", "a2") == "v2");
-
- Attr* pAttr2 = pElem->getAttributeNodeNS("urn:ns1", "a2");
- assert (pAttr2 != 0);
- assert (pAttr2->name() == "a2");
- assert (pAttr2->namespaceURI() == "urn:ns1");
- assert (pAttr2->prefix().empty());
- assert (pAttr2->localName() == "a2");
- assert (pAttr2->value() == "v2");
- assert (pAttr2->ownerElement() == pElem);
-
- Attr* pAttr3 = pElem->getAttributeNodeNS("urn:ns2", "p:a3");
- assert (pAttr3 == 0);
-
- pAttr3 = pDoc->createAttributeNS("urn:ns2", "p:a3");
- pAttr3->setValue("v3");
- pElem->setAttributeNodeNS(pAttr3);
- pAttr3->release();
-
- assert (pElem->hasAttributeNS("urn:ns1", "a1"));
- assert (pElem->getAttributeNS("urn:ns1", "a1") == "V1");
- assert (pElem->hasAttributeNS("urn:ns1", "a2"));
- assert (pElem->getAttributeNS("urn:ns1", "a2") == "v2");
- assert (pElem->hasAttributeNS("urn:ns2", "a3"));
- assert (pElem->getAttributeNS("urn:ns2", "a3") == "v3");
-
- pAttr2 = pDoc->createAttributeNS("urn:ns1", "a2");
- pAttr2->setValue("V2");
- pElem->setAttributeNodeNS(pAttr2);
- pAttr2->release();
-
- assert (pElem->hasAttributeNS("urn:ns1", "a1"));
- assert (pElem->getAttributeNS("urn:ns1", "a1") == "V1");
- assert (pElem->hasAttributeNS("urn:ns1", "a2"));
- assert (pElem->getAttributeNS("urn:ns1", "a2") == "V2");
- assert (pElem->hasAttributeNS("urn:ns2", "a3"));
- assert (pElem->getAttributeNS("urn:ns2", "a3") == "v3");
-
- pAttr1 = pDoc->createAttributeNS("urn:ns1", "a1");
- pAttr1->setValue("v1");
- pElem->setAttributeNodeNS(pAttr1);
- pAttr1->release();
-
- assert (pElem->hasAttributeNS("urn:ns1", "a1"));
- assert (pElem->getAttributeNS("urn:ns1", "a1") == "v1");
- assert (pElem->hasAttributeNS("urn:ns1", "a2"));
- assert (pElem->getAttributeNS("urn:ns1", "a2") == "V2");
- assert (pElem->hasAttributeNS("urn:ns2", "a3"));
- assert (pElem->getAttributeNS("urn:ns2", "a3") == "v3");
-
- pAttr3 = pDoc->createAttributeNS("urn:ns2", "q:a3");
- pAttr3->setValue("V3");
- pElem->setAttributeNodeNS(pAttr3);
- pAttr3->release();
-
- assert (pElem->hasAttributeNS("urn:ns1", "a1"));
- assert (pElem->getAttributeNS("urn:ns1", "a1") == "v1");
- assert (pElem->hasAttributeNS("urn:ns1", "a2"));
- assert (pElem->getAttributeNS("urn:ns1", "a2") == "V2");
- assert (pElem->hasAttributeNS("urn:ns2", "a3"));
- assert (pElem->getAttributeNS("urn:ns2", "a3") == "V3");
-
- pElem->removeAttributeNode(pAttr3);
- assert (!pElem->hasAttributeNS("urn:ns2", "a3"));
-
- pElem->removeAttributeNS("urn:ns1", "a1");
- assert (!pElem->hasAttributeNS("urn:ns1", "a1"));
-
- pElem->removeAttributeNS("urn:ns1", "a2");
- assert (!pElem->hasAttributeNS("urn:ns1", "a2"));
-
- assert (!pElem->hasAttributes());
-}
-
-
-void ElementTest::testAttrMap()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pElem = pDoc->createElement("elem");
-
- AutoPtr<NamedNodeMap> pNNM = pElem->attributes();
- assert (pNNM->length() == 0);
-
- pElem->setAttribute("a1", "v1");
- assert (pNNM->length() == 1);
- assert (pNNM->item(0)->nodeName() == "a1");
- assert (pNNM->getNamedItem("a1")->nodeName() == "a1");
-
- pElem->setAttribute("a2", "v2");
- assert (pNNM->length() == 2);
- assert (pNNM->item(0)->nodeName() == "a1");
- assert (pNNM->getNamedItem("a1")->nodeName() == "a1");
- assert (pNNM->item(1)->nodeName() == "a2");
- assert (pNNM->getNamedItem("a2")->nodeName() == "a2");
-
- Attr* pAttr = pDoc->createAttribute("a3");
- pNNM->setNamedItem(pAttr);
- pAttr->release();
-
- assert (pNNM->length() == 3);
- assert (pNNM->item(0)->nodeName() == "a1");
- assert (pNNM->getNamedItem("a1")->nodeName() == "a1");
- assert (pNNM->item(1)->nodeName() == "a2");
- assert (pNNM->getNamedItem("a2")->nodeName() == "a2");
- assert (pNNM->item(2)->nodeName() == "a3");
- assert (pNNM->getNamedItem("a3")->nodeName() == "a3");
-
- pNNM->removeNamedItem("a2");
- assert (pNNM->length() == 2);
- assert (!pElem->hasAttribute("a2"));
-
- pNNM->removeNamedItem("a3");
- assert (pNNM->length() == 1);
- assert (!pElem->hasAttribute("a3"));
-
- pElem->removeAttribute("a1");
- assert (pNNM->length() == 0);
-}
-
-
-void ElementTest::testAttrMapNS()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pElem = pDoc->createElementNS("urn:ns1", "elem");
-
- AutoPtr<NamedNodeMap> pNNM = pElem->attributes();
- assert (pNNM->length() == 0);
-
- pElem->setAttributeNS("urn:ns1", "a1", "v1");
- assert (pNNM->length() == 1);
- assert (pNNM->item(0)->nodeName() == "a1");
- assert (pNNM->getNamedItemNS("urn:ns1", "a1")->nodeName() == "a1");
-
- pElem->setAttributeNS("urn:ns1", "a2", "v2");
- assert (pNNM->length() == 2);
- assert (pNNM->item(0)->nodeName() == "a1");
- assert (pNNM->getNamedItem("a1")->nodeName() == "a1");
- assert (pNNM->item(1)->nodeName() == "a2");
- assert (pNNM->getNamedItem("a2")->nodeName() == "a2");
-
- Attr* pAttr = pDoc->createAttributeNS("urn:ns2", "a3");
- pNNM->setNamedItem(pAttr);
- pAttr->release();
-
- assert (pNNM->length() == 3);
- assert (pNNM->item(0)->nodeName() == "a1");
- assert (pNNM->getNamedItemNS("urn:ns1", "a1")->nodeName() == "a1");
- assert (pNNM->item(1)->nodeName() == "a2");
- assert (pNNM->getNamedItemNS("urn:ns1", "a2")->nodeName() == "a2");
- assert (pNNM->item(2)->nodeName() == "a3");
- assert (pNNM->getNamedItemNS("urn:ns2", "a3")->nodeName() == "a3");
-
- pNNM->removeNamedItemNS("urn:ns1", "a2");
- assert (pNNM->length() == 2);
- assert (!pElem->hasAttributeNS("urn:ns1", "a2"));
-
- pNNM->removeNamedItemNS("urn:ns2", "a3");
- assert (pNNM->length() == 1);
- assert (!pElem->hasAttributeNS("urn:ns2", "a3"));
-
- pElem->removeAttributeNS("urn:ns1", "a1");
- assert (pNNM->length() == 0);
-}
-
-
-void ElementTest::testElementsByTagName()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<NodeList> pNL1 = pRoot->getElementsByTagName("*");
- AutoPtr<NodeList> pNL2 = pRoot->getElementsByTagName("elem");
-
- assert (pNL1->length() == 0);
- assert (pNL2->length() == 0);
-
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- pRoot->appendChild(pElem1);
-
- assert (pNL1->length() == 1);
- assert (pNL2->length() == 1);
- assert (pNL1->item(0) == pElem1);
- assert (pNL2->item(0) == pElem1);
-
- AutoPtr<Element> pElem2 = pDoc->createElement("Elem");
- pRoot->appendChild(pElem2);
-
- assert (pNL1->length() == 2);
- assert (pNL2->length() == 1);
- assert (pNL1->item(0) == pElem1);
- assert (pNL1->item(1) == pElem2);
- assert (pNL2->item(0) == pElem1);
-
- AutoPtr<Element> pElem3 = pDoc->createElement("elem");
- pRoot->appendChild(pElem3);
-
- assert (pNL1->length() == 3);
- assert (pNL2->length() == 2);
- assert (pNL1->item(0) == pElem1);
- assert (pNL1->item(1) == pElem2);
- assert (pNL1->item(2) == pElem3);
- assert (pNL2->item(0) == pElem1);
- assert (pNL2->item(1) == pElem3);
-
- AutoPtr<Element> pElem11 = pDoc->createElement("elem");
- pElem1->appendChild(pElem11);
-
- assert (pNL1->length() == 4);
- assert (pNL2->length() == 3);
- assert (pNL1->item(0) == pElem1);
- assert (pNL1->item(1) == pElem11);
- assert (pNL1->item(2) == pElem2);
- assert (pNL1->item(3) == pElem3);
- assert (pNL2->item(0) == pElem1);
- assert (pNL2->item(1) == pElem11);
- assert (pNL2->item(2) == pElem3);
-
- AutoPtr<Element> pElem12 = pDoc->createElement("Elem");
- pElem1->appendChild(pElem12);
-
- assert (pNL1->length() == 5);
- assert (pNL2->length() == 3);
- assert (pNL1->item(0) == pElem1);
- assert (pNL1->item(1) == pElem11);
- assert (pNL1->item(2) == pElem12);
- assert (pNL1->item(3) == pElem2);
- assert (pNL1->item(4) == pElem3);
- assert (pNL2->item(0) == pElem1);
- assert (pNL2->item(1) == pElem11);
- assert (pNL2->item(2) == pElem3);
-
- AutoPtr<Element> pElem21 = pDoc->createElement("elem");
- pElem2->appendChild(pElem21);
-
- assert (pNL1->length() == 6);
- assert (pNL2->length() == 4);
- assert (pNL1->item(0) == pElem1);
- assert (pNL1->item(1) == pElem11);
- assert (pNL1->item(2) == pElem12);
- assert (pNL1->item(3) == pElem2);
- assert (pNL1->item(4) == pElem21);
- assert (pNL1->item(5) == pElem3);
- assert (pNL2->item(0) == pElem1);
- assert (pNL2->item(1) == pElem11);
- assert (pNL2->item(2) == pElem21);
- assert (pNL2->item(3) == pElem3);
-}
-
-
-void ElementTest::testElementsByTagNameNS()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElementNS("urn:ns1", "root");
- AutoPtr<NodeList> pNL1 = pRoot->getElementsByTagNameNS("*", "*");
- AutoPtr<NodeList> pNL2 = pRoot->getElementsByTagNameNS("*", "elem");
- AutoPtr<NodeList> pNL3 = pRoot->getElementsByTagNameNS("urn:ns1", "elem");
-
- assert (pNL1->length() == 0);
- assert (pNL2->length() == 0);
-
- AutoPtr<Element> pElem1 = pDoc->createElementNS("urn:ns1", "elem");
- pRoot->appendChild(pElem1);
-
- assert (pNL1->length() == 1);
- assert (pNL2->length() == 1);
- assert (pNL3->length() == 1);
- assert (pNL1->item(0) == pElem1);
- assert (pNL2->item(0) == pElem1);
- assert (pNL3->item(0) == pElem1);
-
- AutoPtr<Element> pElem2 = pDoc->createElementNS("urn:ns1", "Elem");
- pRoot->appendChild(pElem2);
-
- assert (pNL1->length() == 2);
- assert (pNL2->length() == 1);
- assert (pNL3->length() == 1);
- assert (pNL1->item(0) == pElem1);
- assert (pNL1->item(1) == pElem2);
- assert (pNL2->item(0) == pElem1);
- assert (pNL3->item(0) == pElem1);
-
- AutoPtr<Element> pElem3 = pDoc->createElementNS("urn:ns2", "elem");
- pRoot->appendChild(pElem3);
-
- assert (pNL1->length() == 3);
- assert (pNL2->length() == 2);
- assert (pNL3->length() == 1);
- assert (pNL1->item(0) == pElem1);
- assert (pNL1->item(1) == pElem2);
- assert (pNL1->item(2) == pElem3);
- assert (pNL2->item(0) == pElem1);
- assert (pNL2->item(1) == pElem3);
- assert (pNL3->item(0) == pElem1);
-
- AutoPtr<Element> pElem11 = pDoc->createElementNS("urn:ns1", "elem");
- pElem1->appendChild(pElem11);
-
- assert (pNL1->length() == 4);
- assert (pNL2->length() == 3);
- assert (pNL3->length() == 2);
- assert (pNL1->item(0) == pElem1);
- assert (pNL1->item(1) == pElem11);
- assert (pNL1->item(2) == pElem2);
- assert (pNL1->item(3) == pElem3);
- assert (pNL2->item(0) == pElem1);
- assert (pNL2->item(1) == pElem11);
- assert (pNL2->item(2) == pElem3);
- assert (pNL3->item(0) == pElem1);
- assert (pNL3->item(1) == pElem11);
-
- AutoPtr<Element> pElem12 = pDoc->createElementNS("urn:ns1", "Elem");
- pElem1->appendChild(pElem12);
-
- assert (pNL1->length() == 5);
- assert (pNL2->length() == 3);
- assert (pNL3->length() == 2);
- assert (pNL1->item(0) == pElem1);
- assert (pNL1->item(1) == pElem11);
- assert (pNL1->item(2) == pElem12);
- assert (pNL1->item(3) == pElem2);
- assert (pNL1->item(4) == pElem3);
- assert (pNL2->item(0) == pElem1);
- assert (pNL2->item(1) == pElem11);
- assert (pNL2->item(2) == pElem3);
- assert (pNL3->item(0) == pElem1);
- assert (pNL3->item(1) == pElem11);
-
- AutoPtr<Element> pElem21 = pDoc->createElementNS("urn:ns1", "elem");
- pElem2->appendChild(pElem21);
-
- assert (pNL1->length() == 6);
- assert (pNL2->length() == 4);
- assert (pNL3->length() == 3);
- assert (pNL1->item(0) == pElem1);
- assert (pNL1->item(1) == pElem11);
- assert (pNL1->item(2) == pElem12);
- assert (pNL1->item(3) == pElem2);
- assert (pNL1->item(4) == pElem21);
- assert (pNL1->item(5) == pElem3);
- assert (pNL2->item(0) == pElem1);
- assert (pNL2->item(1) == pElem11);
- assert (pNL2->item(2) == pElem21);
- assert (pNL2->item(3) == pElem3);
- assert (pNL3->item(0) == pElem1);
- assert (pNL3->item(1) == pElem11);
- assert (pNL3->item(2) == pElem21);
-}
-
-
-void ElementTest::testInnerText()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text1");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem1");
- AutoPtr<Text> pText2 = pDoc->createTextNode("text2");
- AutoPtr<Text> pText3 = pDoc->createTextNode("text3");
-
- pElem1->appendChild(pText2);
- pRoot->appendChild(pText1);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pText3);
-
- XMLString innerText = pRoot->innerText();
- assert (innerText == "text1text2text3");
-}
-
-
-void ElementTest::testChildElement()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem1");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem2");
- AutoPtr<Element> pElem3 = pDoc->createElement("elem3");
- AutoPtr<Element> pElem4 = pDoc->createElement("elem3");
-
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem2);
- pRoot->appendChild(pElem3);
- pRoot->appendChild(pElem4);
-
- assert (pRoot->getChildElement("elem1") == pElem1);
- assert (pRoot->getChildElement("elem2") == pElem2);
- assert (pRoot->getChildElement("elem3") == pElem3);
- assert (pRoot->getChildElement("elem4") == 0);
-
- assert (pElem1->getChildElement("elem11") == 0);
-}
-
-
-void ElementTest::testChildElementNS()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElementNS("urn:ns", "root");
- AutoPtr<Element> pElem1 = pDoc->createElementNS("urn:ns", "elem1");
- AutoPtr<Element> pElem2 = pDoc->createElementNS("urn:ns", "elem2");
- AutoPtr<Element> pElem3 = pDoc->createElementNS("urn:ns", "elem3");
- AutoPtr<Element> pElem4 = pDoc->createElementNS("urn:ns", "elem3");
-
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem2);
- pRoot->appendChild(pElem3);
- pRoot->appendChild(pElem4);
-
- assert (pRoot->getChildElementNS("urn:ns", "elem1") == pElem1);
- assert (pRoot->getChildElementNS("urn:ns", "elem2") == pElem2);
- assert (pRoot->getChildElementNS("urn:ns", "elem3") == pElem3);
- assert (pRoot->getChildElementNS("urn:ns", "elem4") == 0);
- assert (pRoot->getChildElementNS("urn:NS", "elem1") == 0);
-
- assert (pElem1->getChildElementNS("urn:ns", "elem11") == 0);
-}
-
-
-void ElementTest::setUp()
-{
-}
-
-
-void ElementTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ElementTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ElementTest");
-
- CppUnit_addTest(pSuite, ElementTest, testAttributes);
- CppUnit_addTest(pSuite, ElementTest, testAttributesNS);
- CppUnit_addTest(pSuite, ElementTest, testAttrMap);
- CppUnit_addTest(pSuite, ElementTest, testAttrMapNS);
- CppUnit_addTest(pSuite, ElementTest, testElementsByTagName);
- CppUnit_addTest(pSuite, ElementTest, testElementsByTagNameNS);
- CppUnit_addTest(pSuite, ElementTest, testInnerText);
- CppUnit_addTest(pSuite, ElementTest, testChildElement);
- CppUnit_addTest(pSuite, ElementTest, testChildElementNS);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/ElementTest.h b/Utilities/Poco/XML/testsuite/src/ElementTest.h
deleted file mode 100755
index 5fe6993fa2..0000000000
--- a/Utilities/Poco/XML/testsuite/src/ElementTest.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// ElementTest.h
-//
-// $Id$
-//
-// Definition of the ElementTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ElementTest_INCLUDED
-#define ElementTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class ElementTest: public CppUnit::TestCase
-{
-public:
- ElementTest(const std::string& name);
- ~ElementTest();
-
- void testAttributes();
- void testAttributesNS();
- void testAttrMap();
- void testAttrMapNS();
- void testElementsByTagName();
- void testElementsByTagNameNS();
- void testInnerText();
- void testChildElement();
- void testChildElementNS();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // ElementTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/EventTest.cpp b/Utilities/Poco/XML/testsuite/src/EventTest.cpp
deleted file mode 100755
index dcf607e493..0000000000
--- a/Utilities/Poco/XML/testsuite/src/EventTest.cpp
+++ /dev/null
@@ -1,593 +0,0 @@
-//
-// EventTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "EventTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/Event.h"
-#include "Poco/DOM/MutationEvent.h"
-#include "Poco/DOM/EventListener.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Attr.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-using Poco::XML::Event;
-using Poco::XML::MutationEvent;
-using Poco::XML::EventListener;
-using Poco::XML::Element;
-using Poco::XML::Document;
-using Poco::XML::Attr;
-using Poco::XML::Text;
-using Poco::XML::Node;
-using Poco::XML::AutoPtr;
-using Poco::XML::XMLString;
-
-
-class TestEventListener: public EventListener
-{
-public:
- TestEventListener(const XMLString& name, bool cancel = false, bool readd = false, bool capture = false):
- _name(name),
- _cancel(cancel),
- _readd(readd),
- _capture(capture)
- {
- }
-
- void handleEvent(Event* evt)
- {
- XMLString type = evt->type();
- XMLString phase;
- switch (evt->eventPhase())
- {
- case Event::CAPTURING_PHASE:
- phase = "CAPTURING_PHASE"; break;
- case Event::AT_TARGET:
- phase = "AT_TARGET"; break;
- case Event::BUBBLING_PHASE:
- phase = "BUBBLING_PHASE"; break;
- }
- Node* pTarget = static_cast<Node*>(evt->target());
- Node* pCurrentTarget = static_cast<Node*>(evt->currentTarget());
-
- _log.append(_name);
- _log.append(":");
- _log.append(type);
- _log.append(":");
- _log.append(phase);
- _log.append(":");
- _log.append(pTarget->nodeName());
- _log.append(":");
- _log.append(pCurrentTarget->nodeName());
- _log.append(":");
- _log.append(evt->bubbles() ? "B" : "-");
- _log.append(":");
- _log.append(evt->cancelable() ? "C" : "-");
-
- MutationEvent* pME = dynamic_cast<MutationEvent*>(evt);
- if (pME)
- {
- XMLString attrChange;
- switch (pME->attrChange())
- {
- case MutationEvent::MODIFICATION:
- attrChange = "MODIFICATION"; break;
- case MutationEvent::ADDITION:
- attrChange = "ADDITION"; break;
- case MutationEvent::REMOVAL:
- attrChange = "REMOVAL"; break;
- }
- XMLString relatedNode;
- Node* pRelatedNode = pME->relatedNode();
- if (pRelatedNode) relatedNode = pRelatedNode->nodeName();
-
- _log.append(":");
- _log.append(attrChange);
- _log.append(":");
- _log.append(relatedNode);
- _log.append(":");
- _log.append(pME->attrName());
- _log.append(":");
- _log.append(pME->prevValue());
- _log.append(":");
- _log.append(pME->newValue());
- }
- _log.append("\n");
-
- if (_cancel) evt->stopPropagation();
- if (_readd)
- pCurrentTarget->addEventListener(type, this, _capture);
- }
-
- static const XMLString& log()
- {
- return _log;
- }
-
- static void reset()
- {
- _log.clear();
- }
-
-private:
- XMLString _name;
- bool _cancel;
- bool _readd;
- bool _capture;
- static XMLString _log;
-};
-
-
-XMLString TestEventListener::_log;
-
-
-EventTest::EventTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-EventTest::~EventTest()
-{
-}
-
-
-void EventTest::testInsert()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- TestEventListener docListener("doc");
- TestEventListener docCapListener("docCap");
- TestEventListener rootListener("root");
- TestEventListener rootCapListener("rootCap");
-
- pDoc->addEventListener(MutationEvent::DOMSubtreeModified, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMNodeInserted, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &docListener, false);
-
- pDoc->addEventListener(MutationEvent::DOMSubtreeModified, &docCapListener, true);
- pDoc->addEventListener(MutationEvent::DOMNodeInserted, &docCapListener, true);
- pDoc->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &docCapListener, true);
-
- pRoot->addEventListener(MutationEvent::DOMSubtreeModified, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMNodeInserted, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &rootListener, false);
-
- pRoot->addEventListener(MutationEvent::DOMSubtreeModified, &rootCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMNodeInserted, &rootCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &rootCapListener, true);
-
- pDoc->appendChild(pRoot);
-
- const XMLString& log = TestEventListener::log();
-
- assert (log ==
- "docCap:DOMNodeInserted:CAPTURING_PHASE:root:#document:B:-:MODIFICATION:#document:::\n"
- "rootCap:DOMNodeInserted:AT_TARGET:root:root:B:-:MODIFICATION:#document:::\n"
- "root:DOMNodeInserted:AT_TARGET:root:root:B:-:MODIFICATION:#document:::\n"
- "doc:DOMNodeInserted:BUBBLING_PHASE:root:#document:B:-:MODIFICATION:#document:::\n"
- "docCap:DOMNodeInsertedIntoDocument:CAPTURING_PHASE:root:#document:-:-:MODIFICATION::::\n"
- "rootCap:DOMNodeInsertedIntoDocument:AT_TARGET:root:root:-:-:MODIFICATION::::\n"
- "root:DOMNodeInsertedIntoDocument:AT_TARGET:root:root:-:-:MODIFICATION::::\n"
- "docCap:DOMSubtreeModified:AT_TARGET:#document:#document:B:-:MODIFICATION::::\n"
- "doc:DOMSubtreeModified:AT_TARGET:#document:#document:B:-:MODIFICATION::::\n"
- );
-
- TestEventListener::reset();
-
- AutoPtr<Text> pText = pDoc->createTextNode("text");
- pRoot->appendChild(pText);
-
- assert (log ==
- "docCap:DOMNodeInserted:CAPTURING_PHASE:#text:#document:B:-:MODIFICATION:root:::\n"
- "rootCap:DOMNodeInserted:CAPTURING_PHASE:#text:root:B:-:MODIFICATION:root:::\n"
- "root:DOMNodeInserted:BUBBLING_PHASE:#text:root:B:-:MODIFICATION:root:::\n"
- "doc:DOMNodeInserted:BUBBLING_PHASE:#text:#document:B:-:MODIFICATION:root:::\n"
- "docCap:DOMNodeInsertedIntoDocument:CAPTURING_PHASE:#text:#document:-:-:MODIFICATION::::\n"
- "rootCap:DOMNodeInsertedIntoDocument:CAPTURING_PHASE:#text:root:-:-:MODIFICATION::::\n"
- "docCap:DOMSubtreeModified:CAPTURING_PHASE:root:#document:B:-:MODIFICATION::::\n"
- "rootCap:DOMSubtreeModified:AT_TARGET:root:root:B:-:MODIFICATION::::\n"
- "root:DOMSubtreeModified:AT_TARGET:root:root:B:-:MODIFICATION::::\n"
- "doc:DOMSubtreeModified:BUBBLING_PHASE:root:#document:B:-:MODIFICATION::::\n"
- );
-}
-
-
-void EventTest::testInsertSubtree()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- TestEventListener docListener("doc");
- TestEventListener docCapListener("docCap");
- TestEventListener rootListener("root");
- TestEventListener rootCapListener("rootCap");
-
- pDoc->addEventListener(MutationEvent::DOMSubtreeModified, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMNodeInserted, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &docListener, false);
-
- pDoc->addEventListener(MutationEvent::DOMSubtreeModified, &docCapListener, true);
- pDoc->addEventListener(MutationEvent::DOMNodeInserted, &docCapListener, true);
- pDoc->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &docCapListener, true);
-
- pRoot->addEventListener(MutationEvent::DOMSubtreeModified, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMNodeInserted, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &rootListener, false);
-
- pRoot->addEventListener(MutationEvent::DOMSubtreeModified, &rootCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMNodeInserted, &rootCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &rootCapListener, true);
-
- AutoPtr<Text> pText = pDoc->createTextNode("text");
- pRoot->appendChild(pText);
-
- TestEventListener::reset();
-
- pDoc->appendChild(pRoot);
-
- const XMLString& log = TestEventListener::log();
- assert (log ==
- "docCap:DOMNodeInserted:CAPTURING_PHASE:root:#document:B:-:MODIFICATION:#document:::\n"
- "rootCap:DOMNodeInserted:AT_TARGET:root:root:B:-:MODIFICATION:#document:::\n"
- "root:DOMNodeInserted:AT_TARGET:root:root:B:-:MODIFICATION:#document:::\n"
- "doc:DOMNodeInserted:BUBBLING_PHASE:root:#document:B:-:MODIFICATION:#document:::\n"
- "docCap:DOMNodeInsertedIntoDocument:CAPTURING_PHASE:root:#document:-:-:MODIFICATION::::\n"
- "rootCap:DOMNodeInsertedIntoDocument:AT_TARGET:root:root:-:-:MODIFICATION::::\n"
- "root:DOMNodeInsertedIntoDocument:AT_TARGET:root:root:-:-:MODIFICATION::::\n"
- "docCap:DOMNodeInsertedIntoDocument:CAPTURING_PHASE:#text:#document:-:-:MODIFICATION::::\n"
- "rootCap:DOMNodeInsertedIntoDocument:CAPTURING_PHASE:#text:root:-:-:MODIFICATION::::\n"
- "docCap:DOMSubtreeModified:AT_TARGET:#document:#document:B:-:MODIFICATION::::\n"
- "doc:DOMSubtreeModified:AT_TARGET:#document:#document:B:-:MODIFICATION::::\n"
- );
-}
-
-
-void EventTest::testRemove()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- TestEventListener docListener("doc");
- TestEventListener docCapListener("docCap");
- TestEventListener rootListener("root");
- TestEventListener rootCapListener("rootCap");
-
- pDoc->addEventListener(MutationEvent::DOMSubtreeModified, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMNodeRemoved, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMNodeRemovedFromDocument, &docListener, false);
-
- pDoc->addEventListener(MutationEvent::DOMSubtreeModified, &docCapListener, true);
- pDoc->addEventListener(MutationEvent::DOMNodeRemoved, &docCapListener, true);
- pDoc->addEventListener(MutationEvent::DOMNodeRemovedFromDocument, &docCapListener, true);
-
- pRoot->addEventListener(MutationEvent::DOMSubtreeModified, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMNodeRemoved, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMNodeRemovedFromDocument, &rootListener, false);
-
- pRoot->addEventListener(MutationEvent::DOMSubtreeModified, &rootCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMNodeRemoved, &rootCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMNodeRemovedFromDocument, &rootCapListener, true);
-
- pDoc->appendChild(pRoot);
-
- AutoPtr<Text> pText = pDoc->createTextNode("text");
- pRoot->appendChild(pText);
-
- TestEventListener::reset();
-
- pRoot->removeChild(pText);
-
- const XMLString& log = TestEventListener::log();
- assert (log ==
- "docCap:DOMNodeRemoved:CAPTURING_PHASE:#text:#document:B:-:MODIFICATION:root:::\n"
- "rootCap:DOMNodeRemoved:CAPTURING_PHASE:#text:root:B:-:MODIFICATION:root:::\n"
- "root:DOMNodeRemoved:BUBBLING_PHASE:#text:root:B:-:MODIFICATION:root:::\n"
- "doc:DOMNodeRemoved:BUBBLING_PHASE:#text:#document:B:-:MODIFICATION:root:::\n"
- "docCap:DOMNodeRemovedFromDocument:CAPTURING_PHASE:#text:#document:-:-:MODIFICATION::::\n"
- "rootCap:DOMNodeRemovedFromDocument:CAPTURING_PHASE:#text:root:-:-:MODIFICATION::::\n"
- "docCap:DOMSubtreeModified:CAPTURING_PHASE:root:#document:B:-:MODIFICATION::::\n"
- "rootCap:DOMSubtreeModified:AT_TARGET:root:root:B:-:MODIFICATION::::\n"
- "root:DOMSubtreeModified:AT_TARGET:root:root:B:-:MODIFICATION::::\n"
- "doc:DOMSubtreeModified:BUBBLING_PHASE:root:#document:B:-:MODIFICATION::::\n"
- );
-}
-
-
-void EventTest::testRemoveSubtree()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- TestEventListener docListener("doc");
- TestEventListener docCapListener("docCap");
- TestEventListener rootListener("root");
- TestEventListener rootCapListener("rootCap");
-
- pDoc->addEventListener(MutationEvent::DOMSubtreeModified, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMNodeRemoved, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMNodeRemovedFromDocument, &docListener, false);
-
- pDoc->addEventListener(MutationEvent::DOMSubtreeModified, &docCapListener, true);
- pDoc->addEventListener(MutationEvent::DOMNodeRemoved, &docCapListener, true);
- pDoc->addEventListener(MutationEvent::DOMNodeRemovedFromDocument, &docCapListener, true);
-
- pRoot->addEventListener(MutationEvent::DOMSubtreeModified, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMNodeRemoved, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMNodeRemovedFromDocument, &rootListener, false);
-
- pRoot->addEventListener(MutationEvent::DOMSubtreeModified, &rootCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMNodeRemoved, &rootCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMNodeRemovedFromDocument, &rootCapListener, true);
-
- pDoc->appendChild(pRoot);
-
- AutoPtr<Text> pText = pDoc->createTextNode("text");
- pRoot->appendChild(pText);
-
- TestEventListener::reset();
-
- pDoc->removeChild(pRoot);
-
- const XMLString& log = TestEventListener::log();
- assert (log ==
- "docCap:DOMNodeRemoved:CAPTURING_PHASE:root:#document:B:-:MODIFICATION:#document:::\n"
- "rootCap:DOMNodeRemoved:AT_TARGET:root:root:B:-:MODIFICATION:#document:::\n"
- "root:DOMNodeRemoved:AT_TARGET:root:root:B:-:MODIFICATION:#document:::\n"
- "doc:DOMNodeRemoved:BUBBLING_PHASE:root:#document:B:-:MODIFICATION:#document:::\n"
- "docCap:DOMNodeRemovedFromDocument:CAPTURING_PHASE:root:#document:-:-:MODIFICATION::::\n"
- "rootCap:DOMNodeRemovedFromDocument:AT_TARGET:root:root:-:-:MODIFICATION::::\n"
- "root:DOMNodeRemovedFromDocument:AT_TARGET:root:root:-:-:MODIFICATION::::\n"
- "docCap:DOMNodeRemovedFromDocument:CAPTURING_PHASE:#text:#document:-:-:MODIFICATION::::\n"
- "rootCap:DOMNodeRemovedFromDocument:CAPTURING_PHASE:#text:root:-:-:MODIFICATION::::\n"
- "docCap:DOMSubtreeModified:AT_TARGET:#document:#document:B:-:MODIFICATION::::\n"
- "doc:DOMSubtreeModified:AT_TARGET:#document:#document:B:-:MODIFICATION::::\n"
- );
-}
-
-
-void EventTest::testCharacterData()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Text> pText = pDoc->createTextNode("text");
- pRoot->appendChild(pText);
- pDoc->appendChild(pRoot);
-
- TestEventListener docListener("doc");
- TestEventListener docCapListener("docCap");
- TestEventListener rootListener("root");
- TestEventListener rootCapListener("rootCap");
- TestEventListener textListener("text");
- TestEventListener textCapListener("textCap");
-
- pDoc->addEventListener(MutationEvent::DOMCharacterDataModified, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMCharacterDataModified, &docCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMCharacterDataModified, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMCharacterDataModified, &rootCapListener, true);
- pText->addEventListener(MutationEvent::DOMCharacterDataModified, &textListener, false);
- pText->addEventListener(MutationEvent::DOMCharacterDataModified, &textCapListener, true);
-
- TestEventListener::reset();
-
- pText->setData("modified");
-
- const XMLString& log = TestEventListener::log();
- assert (log ==
- "docCap:DOMCharacterDataModified:CAPTURING_PHASE:#text:#document:B:-:MODIFICATION:::text:modified\n"
- "rootCap:DOMCharacterDataModified:CAPTURING_PHASE:#text:root:B:-:MODIFICATION:::text:modified\n"
- "textCap:DOMCharacterDataModified:AT_TARGET:#text:#text:B:-:MODIFICATION:::text:modified\n"
- "text:DOMCharacterDataModified:AT_TARGET:#text:#text:B:-:MODIFICATION:::text:modified\n"
- "root:DOMCharacterDataModified:BUBBLING_PHASE:#text:root:B:-:MODIFICATION:::text:modified\n"
- "doc:DOMCharacterDataModified:BUBBLING_PHASE:#text:#document:B:-:MODIFICATION:::text:modified\n"
- );
-}
-
-
-void EventTest::testCancel()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Text> pText = pDoc->createTextNode("text");
- pRoot->appendChild(pText);
- pDoc->appendChild(pRoot);
-
- TestEventListener docListener("doc");
- TestEventListener docCapListener("docCap", true);
- TestEventListener rootListener("root");
- TestEventListener rootCapListener("rootCap");
- TestEventListener textListener("text");
- TestEventListener textCapListener("textCap");
-
- pDoc->addEventListener(MutationEvent::DOMCharacterDataModified, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMCharacterDataModified, &docCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMCharacterDataModified, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMCharacterDataModified, &rootCapListener, true);
- pText->addEventListener(MutationEvent::DOMCharacterDataModified, &textListener, false);
- pText->addEventListener(MutationEvent::DOMCharacterDataModified, &textCapListener, true);
-
- TestEventListener::reset();
-
- pText->setData("modified");
-
- const XMLString& log = TestEventListener::log();
- assert (log == "docCap:DOMCharacterDataModified:CAPTURING_PHASE:#text:#document:B:-:MODIFICATION:::text:modified\n");
-}
-
-
-void EventTest::testAttributes()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- TestEventListener rootListener("root");
- pRoot->addEventListener(MutationEvent::DOMAttrModified, &rootListener, false);
-
- pRoot->setAttribute("a1", "v1");
-
- const XMLString& log = TestEventListener::log();
- assert (log == "root:DOMAttrModified:AT_TARGET:root:root:B:-:ADDITION:a1:a1::v1\n");
-
- TestEventListener::reset();
- pRoot->setAttribute("a1", "V1");
- assert (log == "root:DOMAttrModified:AT_TARGET:root:root:B:-:MODIFICATION:a1:a1:v1:V1\n");
-
- TestEventListener::reset();
- pRoot->setAttribute("a2", "v2");
- assert (log == "root:DOMAttrModified:AT_TARGET:root:root:B:-:ADDITION:a2:a2::v2\n");
-
- TestEventListener::reset();
- pRoot->removeAttribute("a1");
- assert (log == "root:DOMAttrModified:AT_TARGET:root:root:B:-:REMOVAL:a1:a1:V1:\n");
-}
-
-
-void EventTest::testAddRemoveInEvent()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- TestEventListener docListener("doc", false, true, false);
- TestEventListener docCapListener("docCap", false, true, true);
- TestEventListener rootListener("root", false, true, false);
- TestEventListener rootCapListener("rootCap", false, true, true);
-
- pDoc->addEventListener(MutationEvent::DOMSubtreeModified, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMNodeInserted, &docListener, false);
- pDoc->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &docListener, false);
-
- pDoc->addEventListener(MutationEvent::DOMSubtreeModified, &docCapListener, true);
- pDoc->addEventListener(MutationEvent::DOMNodeInserted, &docCapListener, true);
- pDoc->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &docCapListener, true);
-
- pRoot->addEventListener(MutationEvent::DOMSubtreeModified, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMNodeInserted, &rootListener, false);
- pRoot->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &rootListener, false);
-
- pRoot->addEventListener(MutationEvent::DOMSubtreeModified, &rootCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMNodeInserted, &rootCapListener, true);
- pRoot->addEventListener(MutationEvent::DOMNodeInsertedIntoDocument, &rootCapListener, true);
-
- pDoc->appendChild(pRoot);
-
- const XMLString& log = TestEventListener::log();
- assert (log ==
- "docCap:DOMNodeInserted:CAPTURING_PHASE:root:#document:B:-:MODIFICATION:#document:::\n"
- "rootCap:DOMNodeInserted:AT_TARGET:root:root:B:-:MODIFICATION:#document:::\n"
- "root:DOMNodeInserted:AT_TARGET:root:root:B:-:MODIFICATION:#document:::\n"
- "doc:DOMNodeInserted:BUBBLING_PHASE:root:#document:B:-:MODIFICATION:#document:::\n"
- "docCap:DOMNodeInsertedIntoDocument:CAPTURING_PHASE:root:#document:-:-:MODIFICATION::::\n"
- "rootCap:DOMNodeInsertedIntoDocument:AT_TARGET:root:root:-:-:MODIFICATION::::\n"
- "root:DOMNodeInsertedIntoDocument:AT_TARGET:root:root:-:-:MODIFICATION::::\n"
- "docCap:DOMSubtreeModified:AT_TARGET:#document:#document:B:-:MODIFICATION::::\n"
- "doc:DOMSubtreeModified:AT_TARGET:#document:#document:B:-:MODIFICATION::::\n"
- );
-
- TestEventListener::reset();
-
- AutoPtr<Text> pText = pDoc->createTextNode("text");
- pRoot->appendChild(pText);
-
- assert (log ==
- "docCap:DOMNodeInserted:CAPTURING_PHASE:#text:#document:B:-:MODIFICATION:root:::\n"
- "rootCap:DOMNodeInserted:CAPTURING_PHASE:#text:root:B:-:MODIFICATION:root:::\n"
- "root:DOMNodeInserted:BUBBLING_PHASE:#text:root:B:-:MODIFICATION:root:::\n"
- "doc:DOMNodeInserted:BUBBLING_PHASE:#text:#document:B:-:MODIFICATION:root:::\n"
- "docCap:DOMNodeInsertedIntoDocument:CAPTURING_PHASE:#text:#document:-:-:MODIFICATION::::\n"
- "rootCap:DOMNodeInsertedIntoDocument:CAPTURING_PHASE:#text:root:-:-:MODIFICATION::::\n"
- "docCap:DOMSubtreeModified:CAPTURING_PHASE:root:#document:B:-:MODIFICATION::::\n"
- "rootCap:DOMSubtreeModified:AT_TARGET:root:root:B:-:MODIFICATION::::\n"
- "root:DOMSubtreeModified:AT_TARGET:root:root:B:-:MODIFICATION::::\n"
- "doc:DOMSubtreeModified:BUBBLING_PHASE:root:#document:B:-:MODIFICATION::::\n"
- );
-}
-
-
-void EventTest::testSuspended()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- pDoc->suspendEvents();
-
- TestEventListener rootListener("root");
- pRoot->addEventListener(MutationEvent::DOMAttrModified, &rootListener, false);
-
- pRoot->setAttribute("a1", "v1");
-
- const XMLString& log = TestEventListener::log();
- assert (log.empty());
-
- TestEventListener::reset();
- pRoot->setAttribute("a1", "V1");
- assert (log.empty());
-
- TestEventListener::reset();
- pRoot->setAttribute("a2", "v2");
- assert (log.empty());
-
- TestEventListener::reset();
- pRoot->removeAttribute("a1");
- assert (log.empty());
-}
-
-
-void EventTest::setUp()
-{
- TestEventListener::reset();
-}
-
-
-void EventTest::tearDown()
-{
-}
-
-
-CppUnit::Test* EventTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("EventTest");
-
- CppUnit_addTest(pSuite, EventTest, testInsert);
- CppUnit_addTest(pSuite, EventTest, testInsertSubtree);
- CppUnit_addTest(pSuite, EventTest, testRemove);
- CppUnit_addTest(pSuite, EventTest, testRemoveSubtree);
- CppUnit_addTest(pSuite, EventTest, testCharacterData);
- CppUnit_addTest(pSuite, EventTest, testCancel);
- CppUnit_addTest(pSuite, EventTest, testAttributes);
- CppUnit_addTest(pSuite, EventTest, testAddRemoveInEvent);
- CppUnit_addTest(pSuite, EventTest, testSuspended);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/EventTest.h b/Utilities/Poco/XML/testsuite/src/EventTest.h
deleted file mode 100755
index 821a4aa4b2..0000000000
--- a/Utilities/Poco/XML/testsuite/src/EventTest.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// EventTest.h
-//
-// $Id$
-//
-// Definition of the EventTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef EventTest_INCLUDED
-#define EventTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class EventTest: public CppUnit::TestCase
-{
-public:
- EventTest(const std::string& name);
- ~EventTest();
-
- void testInsert();
- void testInsertSubtree();
- void testRemove();
- void testRemoveSubtree();
- void testCharacterData();
- void testCancel();
- void testAttributes();
- void testAddRemoveInEvent();
- void testSuspended();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // EventTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/NamePoolTest.cpp b/Utilities/Poco/XML/testsuite/src/NamePoolTest.cpp
deleted file mode 100755
index ab7f2ca9b4..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NamePoolTest.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// NamePoolTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NamePoolTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/XML/NamePool.h"
-#include "Poco/XML/Name.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-using Poco::XML::NamePool;
-using Poco::XML::Name;
-using Poco::XML::AutoPtr;
-
-
-NamePoolTest::NamePoolTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NamePoolTest::~NamePoolTest()
-{
-}
-
-
-void NamePoolTest::testNamePool()
-{
- AutoPtr<NamePool> pool = new NamePool;
- const Name* pName = 0;
- Name name("pre:local", "http://www.appinf.com");
-
- pName = &pool->insert(name);
- const Name* pName2 = &pool->insert("pre:local", "http://www.appinf.com", "local");
- assert (pName == pName2);
-
- pName2 = &pool->insert("pre:local2", "http://www.appinf.com", "local2");
- assert (pName2 != pName);
-
- pName2 = &pool->insert(name);
- assert (pName2 == pName);
-
- pName2 = &pool->insert(*pName);
- assert (pName2 == pName);
-}
-
-
-void NamePoolTest::setUp()
-{
-}
-
-
-void NamePoolTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NamePoolTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NamePoolTest");
-
- CppUnit_addTest(pSuite, NamePoolTest, testNamePool);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/NamePoolTest.h b/Utilities/Poco/XML/testsuite/src/NamePoolTest.h
deleted file mode 100755
index afe85084d8..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NamePoolTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// NamePoolTest.h
-//
-// $Id$
-//
-// Definition of the NamePoolTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NamePoolTest_INCLUDED
-#define NamePoolTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class NamePoolTest: public CppUnit::TestCase
-{
-public:
- NamePoolTest(const std::string& name);
- ~NamePoolTest();
-
- void testNamePool();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NamePoolTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/NameTest.cpp b/Utilities/Poco/XML/testsuite/src/NameTest.cpp
deleted file mode 100755
index 17d905900f..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NameTest.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-// NameTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NameTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/XML/Name.h"
-
-
-using Poco::XML::Name;
-
-
-NameTest::NameTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NameTest::~NameTest()
-{
-}
-
-
-void NameTest::testSplit()
-{
- std::string qname = "name";
- std::string prefix;
- std::string local;
- Name::split(qname, prefix, local);
- assert (prefix.empty());
- assert (local == "name");
-
- qname = "p:l";
- Name::split(qname, prefix, local);
- assert (prefix == "p");
- assert (local == "l");
-
- qname = "pre:local";
- Name::split(qname, prefix, local);
- assert (prefix == "pre");
- assert (local == "local");
-}
-
-
-void NameTest::testLocalName()
-{
- std::string qname = "name";
- std::string local = Name::localName(qname);
- assert (local == "name");
- qname = "p:l";
- local = Name::localName(qname);
- assert (local == "l");
- qname = "pre:local";
- local = Name::localName(qname);
- assert (local == "local");
-}
-
-
-void NameTest::testPrefix()
-{
- std::string qname = "name";
- std::string prefix = Name::prefix(qname);
- assert (prefix.empty());
- qname = "p:l";
- prefix = Name::prefix(qname);
- assert (prefix == "p");
- qname = "pre:local";
- prefix = Name::prefix(qname);
- assert (prefix == "pre");
-}
-
-
-void NameTest::testName()
-{
- std::string qname = "name";
- Name name(qname);
- assert (name.qname() == "name");
- assert (name.prefix().empty());
- assert (name.namespaceURI().empty());
- assert (name.localName().empty());
-
- qname.clear();
- name.assign(qname, "http://www.appinf.com/", "local");
- assert (name.qname().empty());
- assert (name.prefix().empty());
- assert (name.namespaceURI() == "http://www.appinf.com/");
- assert (name.localName() == "local");
-
- Name name2("pre:local", "http://www.appinf.com/");
- assert (name2.qname() == "pre:local");
- assert (name2.prefix() == "pre");
- assert (name2.namespaceURI() == "http://www.appinf.com/");
- assert (name2.localName() == "local");
-
- name2.assign("PRE:Local", "http://www.appinf.com/");
- assert (name2.qname() == "PRE:Local");
- assert (name2.prefix() == "PRE");
- assert (name2.namespaceURI() == "http://www.appinf.com/");
- assert (name2.localName() == "Local");
-}
-
-
-void NameTest::testCompare()
-{
- Name n1("pre:local");
- Name n2(n1);
- Name n3("pre:local2");
-
- assert (n1.equals(n2));
- assert (!n1.equals(n3));
-
- n1.assign("pre:local", "http://www.appinf.com", "local");
- n2.assign("pre:local", "http://www.appinf.com", "local");
- n3.assign("pre:local2", "http://www.appinf.com", "local2");
-
- assert (n1.equals(n2));
- assert (!n1.equals(n3));
-
- assert (n1.equals("pre:local", "http://www.appinf.com", "local"));
- assert (!n1.equals("pre:local", "", ""));
- assert (n1.equalsWeakly("pre:local", "", ""));
- assert (!n1.equalsWeakly("pre:local2", "", ""));
- assert (!n1.equals("", "http://www.appinf.com", "local"));
- assert (n1.equalsWeakly("", "http://www.appinf.com", "local"));
- assert (!n1.equalsWeakly("", "http://www.appinf.com", "local2"));
-}
-
-
-void NameTest::testSwap()
-{
- Name n1("ns:name1", "http://www.appinf.com");
- Name n2("ns:name2", "http://www.foobar.com");
- n1.swap(n2);
- assert (n1.qname() == "ns:name2");
- assert (n1.namespaceURI() == "http://www.foobar.com");
- assert (n1.localName() == "name2");
- assert (n2.qname() == "ns:name1");
- assert (n2.namespaceURI() == "http://www.appinf.com");
- assert (n2.localName() == "name1");
-}
-
-
-void NameTest::setUp()
-{
-}
-
-
-void NameTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NameTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NameTest");
-
- CppUnit_addTest(pSuite, NameTest, testSplit);
- CppUnit_addTest(pSuite, NameTest, testLocalName);
- CppUnit_addTest(pSuite, NameTest, testPrefix);
- CppUnit_addTest(pSuite, NameTest, testName);
- CppUnit_addTest(pSuite, NameTest, testCompare);
- CppUnit_addTest(pSuite, NameTest, testSwap);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/NameTest.h b/Utilities/Poco/XML/testsuite/src/NameTest.h
deleted file mode 100755
index 29123db843..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NameTest.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// NameTest.h
-//
-// $Id$
-//
-// Definition of the NameTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NameTest_INCLUDED
-#define NameTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class NameTest: public CppUnit::TestCase
-{
-public:
- NameTest(const std::string& name);
- ~NameTest();
-
- void testSplit();
- void testLocalName();
- void testPrefix();
- void testName();
- void testCompare();
- void testSwap();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NameTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/NamespaceSupportTest.cpp b/Utilities/Poco/XML/testsuite/src/NamespaceSupportTest.cpp
deleted file mode 100755
index af9a5fd9df..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NamespaceSupportTest.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// NamespaceSupportTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NamespaceSupportTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/SAX/NamespaceSupport.h"
-
-
-using Poco::XML::NamespaceSupport;
-
-
-NamespaceSupportTest::NamespaceSupportTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NamespaceSupportTest::~NamespaceSupportTest()
-{
-}
-
-
-void NamespaceSupportTest::testNamespaceSupport()
-{
- NamespaceSupport ns;
- NamespaceSupport::PrefixSet prefixes;
- ns.getDeclaredPrefixes(prefixes);
- assert (prefixes.size() == 2);
- assert (prefixes.find("xml") != prefixes.end());
- assert (prefixes.find("xmlns") != prefixes.end());
-
- ns.getPrefixes(prefixes);
- assert (prefixes.size() == 2);
- assert (prefixes.find("xml") != prefixes.end());
- assert (prefixes.find("xmlns") != prefixes.end());
-
- ns.pushContext();
- ns.declarePrefix("ns1", "urn:ns1");
- ns.declarePrefix("ns2", "urn:ns2");
-
- ns.getDeclaredPrefixes(prefixes);
- assert (prefixes.size() == 2);
- assert (prefixes.find("ns1") != prefixes.end());
- assert (prefixes.find("ns2") != prefixes.end());
-
- ns.pushContext();
- ns.declarePrefix("ns3", "urn:ns3");
-
- ns.getDeclaredPrefixes(prefixes);
- assert (prefixes.size() == 1);
- assert (prefixes.find("ns3") != prefixes.end());
-
- ns.getPrefixes(prefixes);
- assert (prefixes.size() == 5);
- assert (prefixes.find("xml") != prefixes.end());
- assert (prefixes.find("xmlns") != prefixes.end());
- assert (prefixes.find("ns1") != prefixes.end());
- assert (prefixes.find("ns2") != prefixes.end());
- assert (prefixes.find("ns3") != prefixes.end());
-
- ns.popContext();
- ns.getDeclaredPrefixes(prefixes);
- assert (prefixes.size() == 2);
- assert (prefixes.find("ns1") != prefixes.end());
- assert (prefixes.find("ns2") != prefixes.end());
-
- assert (ns.isMapped("urn:ns1"));
- assert (ns.isMapped("urn:ns2"));
- assert (ns.isMapped("http://www.w3.org/XML/1998/namespace"));
- assert (!ns.isMapped("urn:ns3"));
-
- ns.getPrefixes("urn:ns2", prefixes);
- assert (prefixes.size() == 1);
- assert (prefixes.find("ns2") != prefixes.end());
-
- ns.pushContext();
- ns.declarePrefix("", "urn:ns3");
- ns.declarePrefix("NS2", "urn:ns2");
-
- ns.getPrefixes("urn:ns2", prefixes);
- assert (prefixes.size() == 2);
- assert (prefixes.find("ns2") != prefixes.end());
- assert (prefixes.find("NS2") != prefixes.end());
-
- ns.getPrefixes(prefixes);
- assert (prefixes.size() == 5);
- assert (prefixes.find("xml") != prefixes.end());
- assert (prefixes.find("xmlns") != prefixes.end());
- assert (prefixes.find("ns1") != prefixes.end());
- assert (prefixes.find("ns2") != prefixes.end());
- assert (prefixes.find("NS2") != prefixes.end());
-
- ns.getDeclaredPrefixes(prefixes);
- assert (prefixes.size() == 2);
- assert (prefixes.find("") != prefixes.end());
- assert (prefixes.find("NS2") != prefixes.end());
-
- assert (ns.getPrefix("urn:ns3") == "");
- assert (ns.getPrefix("urn:ns2") == "NS2");
- assert (ns.getPrefix("urn:ns4") == "");
-
- assert (ns.isMapped("urn:ns3"));
- assert (ns.isMapped("urn:ns2"));
- assert (!ns.isMapped("urn:ns4"));
-
- assert (ns.getURI("xml") == "http://www.w3.org/XML/1998/namespace");
- assert (ns.getURI("ns1") == "urn:ns1");
- assert (ns.getURI("") == "urn:ns3");
- assert (ns.getURI("NS2") == "urn:ns2");
-
- std::string localName;
- std::string namespaceURI;
- bool declared = ns.processName("elem", namespaceURI, localName, false);
- assert (declared);
- assert (localName == "elem");
- assert (namespaceURI == "urn:ns3");
-
- declared = ns.processName("NS2:elem", namespaceURI, localName, false);
- assert (declared);
- assert (localName == "elem");
- assert (namespaceURI == "urn:ns2");
-
- declared = ns.processName("ns3:elem", namespaceURI, localName, false);
- assert (!declared);
- assert (localName == "elem");
- assert (namespaceURI == "");
-
- declared = ns.processName("ns2:attr", namespaceURI, localName, true);
- assert (declared);
- assert (localName == "attr");
- assert (namespaceURI == "urn:ns2");
-
- declared = ns.processName("attr", namespaceURI, localName, true);
- assert (declared);
- assert (localName == "attr");
- assert (namespaceURI == "");
-
- declared = ns.processName("ns3:attr", namespaceURI, localName, true);
- assert (!declared);
- assert (localName == "attr");
- assert (namespaceURI == "");
-
- ns.popContext();
- assert (ns.getURI("xml") == "http://www.w3.org/XML/1998/namespace");
- assert (ns.getURI("ns1") == "urn:ns1");
- assert (ns.getURI("") == "");
- assert (ns.getURI("NS2") == "");
-
- declared = ns.processName("elem", namespaceURI, localName, false);
- assert (declared);
- assert (localName == "elem");
- assert (namespaceURI == "");
-
- declared = ns.processName("ns2:elem", namespaceURI, localName, false);
- assert (declared);
- assert (localName == "elem");
- assert (namespaceURI == "urn:ns2");
-
- declared = ns.processName("ns3:elem", namespaceURI, localName, false);
- assert (!declared);
- assert (localName == "elem");
- assert (namespaceURI == "");
-}
-
-
-void NamespaceSupportTest::setUp()
-{
-}
-
-
-void NamespaceSupportTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NamespaceSupportTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NamespaceSupportTest");
-
- CppUnit_addTest(pSuite, NamespaceSupportTest, testNamespaceSupport);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/NamespaceSupportTest.h b/Utilities/Poco/XML/testsuite/src/NamespaceSupportTest.h
deleted file mode 100755
index 461b9310e4..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NamespaceSupportTest.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// NamespaceSupportTest.h
-//
-// $Id$
-//
-// Definition of the NamespaceSupportTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NamespaceSupportTest_INCLUDED
-#define NamespaceSupportTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class NamespaceSupportTest: public CppUnit::TestCase
-{
-public:
- NamespaceSupportTest(const std::string& name);
- ~NamespaceSupportTest();
-
- void testNamespaceSupport();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NamespaceSupportTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/NodeAppenderTest.cpp b/Utilities/Poco/XML/testsuite/src/NodeAppenderTest.cpp
deleted file mode 100755
index 593760d101..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NodeAppenderTest.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-//
-// NodeAppenderTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2007, 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 "NodeAppenderTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/NodeAppender.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/DocumentFragment.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-using Poco::XML::NodeAppender;
-using Poco::XML::Element;
-using Poco::XML::Document;
-using Poco::XML::DocumentFragment;
-using Poco::XML::AutoPtr;
-using Poco::XML::XMLString;
-
-
-NodeAppenderTest::NodeAppenderTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NodeAppenderTest::~NodeAppenderTest()
-{
-}
-
-
-void NodeAppenderTest::testAppendNode()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- pDoc->appendChild(pRoot);
-
- NodeAppender appender(pRoot);
-
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- AutoPtr<Element> pElem3 = pDoc->createElement("elem");
-
- appender.appendChild(pElem1);
- appender.appendChild(pElem2);
- appender.appendChild(pElem3);
-
- assert (pRoot->firstChild() == pElem1);
- assert (pRoot->lastChild() == pElem3);
-
- assert (pElem1->nextSibling() == pElem2);
- assert (pElem2->nextSibling() == pElem3);
- assert (pElem3->nextSibling() == 0);
-
- assert (pElem1->previousSibling() == 0);
- assert (pElem2->previousSibling() == pElem1);
- assert (pElem3->previousSibling() == pElem2);
-
- assert (pElem1->parentNode() == pRoot);
- assert (pElem2->parentNode() == pRoot);
- assert (pElem3->parentNode() == pRoot);
-}
-
-
-void NodeAppenderTest::testAppendNodeList()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- pDoc->appendChild(pRoot);
-
- NodeAppender appender(pRoot);
-
- AutoPtr<DocumentFragment> pFrag1 = pDoc->createDocumentFragment();
- AutoPtr<DocumentFragment> pFrag2 = pDoc->createDocumentFragment();
- AutoPtr<DocumentFragment> pFrag3 = pDoc->createDocumentFragment();
-
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- AutoPtr<Element> pElem3 = pDoc->createElement("elem");
- AutoPtr<Element> pElem4 = pDoc->createElement("elem");
-
- pFrag2->appendChild(pElem1);
- pFrag2->appendChild(pElem2);
- pFrag2->appendChild(pElem3);
-
- pFrag3->appendChild(pElem4);
-
- appender.appendChild(pFrag1);
- assert (pRoot->firstChild() == 0);
-
- appender.appendChild(pFrag2);
- assert (pRoot->firstChild() == pElem1);
- assert (pRoot->lastChild() == pElem3);
-
- assert (pElem1->nextSibling() == pElem2);
- assert (pElem2->nextSibling() == pElem3);
- assert (pElem3->nextSibling() == 0);
-
- assert (pElem1->previousSibling() == 0);
- assert (pElem2->previousSibling() == pElem1);
- assert (pElem3->previousSibling() == pElem2);
-
- assert (pElem1->parentNode() == pRoot);
- assert (pElem2->parentNode() == pRoot);
- assert (pElem3->parentNode() == pRoot);
-
- appender.appendChild(pFrag3);
- assert (pRoot->lastChild() == pElem4);
- assert (pElem4->parentNode() == pRoot);
- assert (pElem3->nextSibling() == pElem4);
- assert (pElem4->previousSibling() == pElem3);
-}
-
-
-void NodeAppenderTest::setUp()
-{
-}
-
-
-void NodeAppenderTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NodeAppenderTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NodeAppenderTest");
-
- CppUnit_addTest(pSuite, NodeAppenderTest, testAppendNode);
- CppUnit_addTest(pSuite, NodeAppenderTest, testAppendNodeList);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/NodeAppenderTest.h b/Utilities/Poco/XML/testsuite/src/NodeAppenderTest.h
deleted file mode 100755
index 33cf3862b6..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NodeAppenderTest.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// NodeAppenderTest.h
-//
-// $Id$
-//
-// Definition of the NodeAppenderTest class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef NodeAppenderTest_INCLUDED
-#define NodeAppenderTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class NodeAppenderTest: public CppUnit::TestCase
-{
-public:
- NodeAppenderTest(const std::string& name);
- ~NodeAppenderTest();
-
- void testAppendNode();
- void testAppendNodeList();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NodeAppenderTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/NodeIteratorTest.cpp b/Utilities/Poco/XML/testsuite/src/NodeIteratorTest.cpp
deleted file mode 100755
index dc04ea2869..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NodeIteratorTest.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-//
-// NodeIteratorTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NodeIteratorTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/NodeIterator.h"
-#include "Poco/DOM/NodeFilter.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-using Poco::XML::NodeIterator;
-using Poco::XML::NodeFilter;
-using Poco::XML::Element;
-using Poco::XML::Document;
-using Poco::XML::Text;
-using Poco::XML::Node;
-using Poco::XML::AutoPtr;
-using Poco::XML::XMLString;
-
-
-namespace
-{
- class TestNodeFilter: public NodeFilter
- {
- short acceptNode(Node* node)
- {
- if (node->innerText() == "text1")
- return NodeFilter::FILTER_ACCEPT;
- else
- return NodeFilter::FILTER_REJECT;
- }
- };
-}
-
-
-NodeIteratorTest::NodeIteratorTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NodeIteratorTest::~NodeIteratorTest()
-{
-}
-
-
-void NodeIteratorTest::testShowAll()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text1");
- AutoPtr<Text> pText2 = pDoc->createTextNode("text2");
-
- pElem1->appendChild(pText1);
- pElem2->appendChild(pText2);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem2);
- pDoc->appendChild(pRoot);
-
- NodeIterator it(pRoot, NodeFilter::SHOW_ALL);
-
- assert (it.nextNode() == pRoot);
- assert (it.nextNode() == pElem1);
- assert (it.nextNode() == pText1);
- assert (it.nextNode() == pElem2);
- assert (it.nextNode() == pText2);
- assert (it.nextNode() == 0);
-
- assert (it.previousNode() == pText2);
- assert (it.previousNode() == pElem2);
- assert (it.previousNode() == pText1);
- assert (it.previousNode() == pElem1);
- assert (it.previousNode() == pRoot);
- assert (it.previousNode() == 0);
-}
-
-
-void NodeIteratorTest::testShowElements()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text1");
- AutoPtr<Text> pText2 = pDoc->createTextNode("text2");
-
- pElem1->appendChild(pText1);
- pElem2->appendChild(pText2);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem2);
- pDoc->appendChild(pRoot);
-
- NodeIterator it(pRoot, NodeFilter::SHOW_ELEMENT);
-
- assert (it.nextNode() == pRoot);
- assert (it.nextNode() == pElem1);
- assert (it.nextNode() == pElem2);
- assert (it.nextNode() == 0);
-
- assert (it.previousNode() == pElem2);
- assert (it.previousNode() == pElem1);
- assert (it.previousNode() == pRoot);
- assert (it.previousNode() == 0);
-}
-
-
-void NodeIteratorTest::testFilter()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text1");
- AutoPtr<Text> pText2 = pDoc->createTextNode("text2");
-
- pElem1->appendChild(pText1);
- pElem2->appendChild(pText2);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem2);
- pDoc->appendChild(pRoot);
-
- TestNodeFilter filter;
- NodeIterator it(pRoot, NodeFilter::SHOW_ELEMENT, &filter);
-
- assert (it.nextNode() == pElem1);
- assert (it.nextNode() == 0);
-
- assert (it.previousNode() == pElem1);
- assert (it.previousNode() == 0);
-}
-
-
-void NodeIteratorTest::testShowNothing()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text1");
- AutoPtr<Text> pText2 = pDoc->createTextNode("text2");
-
- pElem1->appendChild(pText1);
- pElem2->appendChild(pText2);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem2);
- pDoc->appendChild(pRoot);
-
- NodeIterator it(pRoot, 0);
-
- assert (it.nextNode() == 0);
-
- assert (it.previousNode() == 0);
-}
-
-
-void NodeIteratorTest::setUp()
-{
-}
-
-
-void NodeIteratorTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NodeIteratorTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NodeIteratorTest");
-
- CppUnit_addTest(pSuite, NodeIteratorTest, testShowAll);
- CppUnit_addTest(pSuite, NodeIteratorTest, testShowElements);
- CppUnit_addTest(pSuite, NodeIteratorTest, testFilter);
- CppUnit_addTest(pSuite, NodeIteratorTest, testShowNothing);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/NodeIteratorTest.h b/Utilities/Poco/XML/testsuite/src/NodeIteratorTest.h
deleted file mode 100755
index d15d525c6f..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NodeIteratorTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// NodeIteratorTest.h
-//
-// $Id$
-//
-// Definition of the NodeIteratorTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NodeIteratorTest_INCLUDED
-#define NodeIteratorTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class NodeIteratorTest: public CppUnit::TestCase
-{
-public:
- NodeIteratorTest(const std::string& name);
- ~NodeIteratorTest();
-
- void testShowAll();
- void testShowElements();
- void testFilter();
- void testShowNothing();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NodeIteratorTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/NodeTest.cpp b/Utilities/Poco/XML/testsuite/src/NodeTest.cpp
deleted file mode 100755
index 98538e8ee0..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NodeTest.cpp
+++ /dev/null
@@ -1,1126 +0,0 @@
-//
-// NodeTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "NodeTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/DocumentFragment.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-using Poco::XML::Element;
-using Poco::XML::Document;
-using Poco::XML::DocumentFragment;
-using Poco::XML::Node;
-using Poco::XML::AutoPtr;
-
-
-NodeTest::NodeTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-NodeTest::~NodeTest()
-{
-}
-
-
-void NodeTest::testInsert()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- assert (!pRoot->hasChildNodes());
- assert (pRoot->firstChild() == 0);
- assert (pRoot->lastChild() == 0);
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pRoot->insertBefore(pChild1, 0);
- assert (pRoot->hasChildNodes());
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild1);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == 0);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pRoot->insertBefore(pChild3, 0);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild3);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild1);
- assert (pChild3->nextSibling() == 0);
-
- AutoPtr<Element> pChild0 = pDoc->createElement("child0");
- pRoot->insertBefore(pChild0, pChild1);
- assert (pRoot->firstChild() == pChild0);
- assert (pRoot->lastChild() == pChild3);
-
- assert (pChild0->previousSibling() == 0);
- assert (pChild0->nextSibling() == pChild1);
- assert (pChild1->previousSibling() == pChild0);
- assert (pChild1->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild1);
- assert (pChild3->nextSibling() == 0);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pRoot->insertBefore(pChild2, pChild3);
- assert (pRoot->firstChild() == pChild0);
- assert (pRoot->lastChild() == pChild3);
-
- assert (pChild0->previousSibling() == 0);
- assert (pChild0->nextSibling() == pChild1);
- assert (pChild1->previousSibling() == pChild0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == 0);
-}
-
-
-void NodeTest::testAppend()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pRoot->appendChild(pChild1);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild1);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == 0);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pRoot->appendChild(pChild2);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild2);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == 0);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pRoot->appendChild(pChild3);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild3);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == 0);
-}
-
-
-void NodeTest::testRemove()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pRoot->appendChild(pChild1);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pRoot->appendChild(pChild2);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pRoot->appendChild(pChild3);
-
- AutoPtr<Element> pChild4 = pDoc->createElement("child4");
- pRoot->appendChild(pChild4);
-
- pRoot->removeChild(pChild2);
- assert (pChild2->previousSibling() == 0);
- assert (pChild2->nextSibling() == 0);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild1);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == 0);
-
- pRoot->removeChild(pChild4);
- assert (pChild4->previousSibling() == 0);
- assert (pChild4->nextSibling() == 0);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild1);
- assert (pChild3->nextSibling() == 0);
-
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild3);
-
- pRoot->removeChild(pChild1);
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == 0);
-
- assert (pRoot->firstChild() == pChild3);
- assert (pRoot->lastChild() == pChild3);
-
- pRoot->removeChild(pChild3);
- assert (pChild3->previousSibling() == 0);
- assert (pChild3->nextSibling() == 0);
- assert (pRoot->firstChild() == 0);
- assert (pRoot->lastChild() == 0);
-}
-
-
-void NodeTest::testReplace()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pRoot->appendChild(pChild1);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pRoot->appendChild(pChild2);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pRoot->appendChild(pChild3);
-
- AutoPtr<Element> pChild4 = pDoc->createElement("child4");
- pRoot->appendChild(pChild4);
-
- AutoPtr<Element> pChild11 = pDoc->createElement("child11");
- pRoot->replaceChild(pChild11, pChild1);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild11);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild22 = pDoc->createElement("child22");
- pRoot->replaceChild(pChild22, pChild2);
-
- assert (pChild2->previousSibling() == 0);
- assert (pChild2->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild11);
- assert (pChild22->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild22);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild33 = pDoc->createElement("child33");
- pRoot->replaceChild(pChild33, pChild3);
-
- assert (pChild3->previousSibling() == 0);
- assert (pChild3->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild11);
- assert (pChild22->nextSibling() == pChild33);
- assert (pChild33->previousSibling() == pChild22);
- assert (pChild33->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild33);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild44 = pDoc->createElement("child44");
- pRoot->replaceChild(pChild44, pChild4);
-
- assert (pChild4->previousSibling() == 0);
- assert (pChild4->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild44);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild11);
- assert (pChild22->nextSibling() == pChild33);
- assert (pChild33->previousSibling() == pChild22);
- assert (pChild33->nextSibling() == pChild44);
- assert (pChild44->previousSibling() == pChild33);
- assert (pChild44->nextSibling() == 0);
-}
-
-
-void NodeTest::testInsertFragment1()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<DocumentFragment> pFrag = pDoc->createDocumentFragment();
-
- assert (!pRoot->hasChildNodes());
- assert (pRoot->firstChild() == 0);
- assert (pRoot->lastChild() == 0);
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pFrag->appendChild(pChild1);
- pRoot->insertBefore(pFrag, 0);
- assert (pFrag->firstChild() == 0);
- assert (pFrag->lastChild() == 0);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild1);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == 0);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pFrag->appendChild(pChild3);
- pRoot->insertBefore(pFrag, 0);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild3);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild1);
- assert (pChild3->nextSibling() == 0);
-
- AutoPtr<Element> pChild0 = pDoc->createElement("child0");
- pFrag->appendChild(pChild0);
- pRoot->insertBefore(pFrag, pChild1);
- assert (pRoot->firstChild() == pChild0);
- assert (pRoot->lastChild() == pChild3);
-
- assert (pChild0->previousSibling() == 0);
- assert (pChild0->nextSibling() == pChild1);
- assert (pChild1->previousSibling() == pChild0);
- assert (pChild1->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild1);
- assert (pChild3->nextSibling() == 0);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pFrag->appendChild(pChild2);
- pRoot->insertBefore(pFrag, pChild3);
- assert (pRoot->firstChild() == pChild0);
- assert (pRoot->lastChild() == pChild3);
-
- assert (pChild0->previousSibling() == 0);
- assert (pChild0->nextSibling() == pChild1);
- assert (pChild1->previousSibling() == pChild0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == 0);
-}
-
-
-void NodeTest::testInsertFragment2()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<DocumentFragment> pFrag = pDoc->createDocumentFragment();
-
- assert (!pRoot->hasChildNodes());
- assert (pRoot->firstChild() == 0);
- assert (pRoot->lastChild() == 0);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pFrag->appendChild(pChild2);
- pFrag->appendChild(pChild3);
- pRoot->insertBefore(pFrag, 0);
- assert (pFrag->firstChild() == 0);
- assert (pFrag->lastChild() == 0);
- assert (pRoot->firstChild() == pChild2);
- assert (pRoot->lastChild() == pChild3);
-
- assert (pChild2->previousSibling() == 0);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == 0);
-
- AutoPtr<Element> pChild6 = pDoc->createElement("child6");
- AutoPtr<Element> pChild7 = pDoc->createElement("child7");
- pFrag->appendChild(pChild6);
- pFrag->appendChild(pChild7);
- pRoot->insertBefore(pFrag, 0);
- assert (pRoot->firstChild() == pChild2);
- assert (pRoot->lastChild() == pChild7);
-
- assert (pChild2->previousSibling() == 0);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild6);
- assert (pChild6->previousSibling() == pChild3);
- assert (pChild6->nextSibling() == pChild7);
- assert (pChild7->previousSibling() == pChild6);
- assert (pChild7->nextSibling() == 0);
-
- AutoPtr<Element> pChild0 = pDoc->createElement("child0");
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pFrag->appendChild(pChild0);
- pFrag->appendChild(pChild1);
- pRoot->insertBefore(pFrag, pChild2);
- assert (pRoot->firstChild() == pChild0);
- assert (pRoot->lastChild() == pChild7);
-
- assert (pChild0->previousSibling() == 0);
- assert (pChild0->nextSibling() == pChild1);
- assert (pChild1->previousSibling() == pChild0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild6);
- assert (pChild6->previousSibling() == pChild3);
- assert (pChild6->nextSibling() == pChild7);
- assert (pChild7->previousSibling() == pChild6);
- assert (pChild7->nextSibling() == 0);
-
- AutoPtr<Element> pChild4 = pDoc->createElement("child4");
- AutoPtr<Element> pChild5 = pDoc->createElement("child5");
- pFrag->appendChild(pChild4);
- pFrag->appendChild(pChild5);
- pRoot->insertBefore(pFrag, pChild6);
- assert (pRoot->firstChild() == pChild0);
- assert (pRoot->lastChild() == pChild7);
-
- assert (pChild0->previousSibling() == 0);
- assert (pChild0->nextSibling() == pChild1);
- assert (pChild1->previousSibling() == pChild0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == pChild5);
- assert (pChild5->previousSibling() == pChild4);
- assert (pChild5->nextSibling() == pChild6);
- assert (pChild6->previousSibling() == pChild5);
- assert (pChild6->nextSibling() == pChild7);
- assert (pChild7->previousSibling() == pChild6);
- assert (pChild7->nextSibling() == 0);
-}
-
-
-void NodeTest::testInsertFragment3()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<DocumentFragment> pFrag = pDoc->createDocumentFragment();
-
- assert (!pRoot->hasChildNodes());
- assert (pRoot->firstChild() == 0);
- assert (pRoot->lastChild() == 0);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- AutoPtr<Element> pChild4 = pDoc->createElement("child4");
- AutoPtr<Element> pChild5 = pDoc->createElement("child5");
- pFrag->appendChild(pChild3);
- pFrag->appendChild(pChild4);
- pFrag->appendChild(pChild5);
- pRoot->insertBefore(pFrag, 0);
- assert (pFrag->firstChild() == 0);
- assert (pFrag->lastChild() == 0);
- assert (pRoot->firstChild() == pChild3);
- assert (pRoot->lastChild() == pChild5);
-
- assert (pChild3->previousSibling() == 0);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == pChild5);
- assert (pChild5->previousSibling() == pChild4);
- assert (pChild5->nextSibling() == 0);
-
- AutoPtr<Element> pChild9 = pDoc->createElement("child9");
- AutoPtr<Element> pChild10 = pDoc->createElement("child10");
- AutoPtr<Element> pChild11 = pDoc->createElement("child11");
- pFrag->appendChild(pChild9);
- pFrag->appendChild(pChild10);
- pFrag->appendChild(pChild11);
- pRoot->insertBefore(pFrag, 0);
- assert (pRoot->firstChild() == pChild3);
- assert (pRoot->lastChild() == pChild11);
-
- assert (pChild3->previousSibling() == 0);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == pChild5);
- assert (pChild5->previousSibling() == pChild4);
- assert (pChild5->nextSibling() == pChild9);
- assert (pChild9->previousSibling() == pChild5);
- assert (pChild9->nextSibling() == pChild10);
- assert (pChild10->previousSibling() == pChild9);
- assert (pChild10->nextSibling() == pChild11);
- assert (pChild11->previousSibling() == pChild10);
- assert (pChild11->nextSibling() == 0);
-
- AutoPtr<Element> pChild0 = pDoc->createElement("child0");
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pFrag->appendChild(pChild0);
- pFrag->appendChild(pChild1);
- pFrag->appendChild(pChild2);
- pRoot->insertBefore(pFrag, pChild3);
- assert (pRoot->firstChild() == pChild0);
- assert (pRoot->lastChild() == pChild11);
-
- assert (pChild0->previousSibling() == 0);
- assert (pChild0->nextSibling() == pChild1);
- assert (pChild1->previousSibling() == pChild0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == pChild5);
- assert (pChild5->previousSibling() == pChild4);
- assert (pChild5->nextSibling() == pChild9);
- assert (pChild9->previousSibling() == pChild5);
- assert (pChild9->nextSibling() == pChild10);
- assert (pChild10->previousSibling() == pChild9);
- assert (pChild10->nextSibling() == pChild11);
- assert (pChild11->previousSibling() == pChild10);
- assert (pChild11->nextSibling() == 0);
-
- AutoPtr<Element> pChild6 = pDoc->createElement("child6");
- AutoPtr<Element> pChild7 = pDoc->createElement("child7");
- AutoPtr<Element> pChild8 = pDoc->createElement("child8");
- pFrag->appendChild(pChild6);
- pFrag->appendChild(pChild7);
- pFrag->appendChild(pChild8);
- pRoot->insertBefore(pFrag, pChild9);
- assert (pRoot->firstChild() == pChild0);
- assert (pRoot->lastChild() == pChild11);
-
- assert (pChild0->previousSibling() == 0);
- assert (pChild0->nextSibling() == pChild1);
- assert (pChild1->previousSibling() == pChild0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == pChild5);
- assert (pChild5->previousSibling() == pChild4);
- assert (pChild5->nextSibling() == pChild6);
- assert (pChild6->previousSibling() == pChild5);
- assert (pChild6->nextSibling() == pChild7);
- assert (pChild7->previousSibling() == pChild6);
- assert (pChild7->nextSibling() == pChild8);
- assert (pChild8->previousSibling() == pChild7);
- assert (pChild8->nextSibling() == pChild9);
- assert (pChild9->previousSibling() == pChild8);
- assert (pChild9->nextSibling() == pChild10);
- assert (pChild10->previousSibling() == pChild9);
- assert (pChild10->nextSibling() == pChild11);
- assert (pChild11->previousSibling() == pChild10);
- assert (pChild11->nextSibling() == 0);
-}
-
-
-void NodeTest::testAppendFragment1()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<DocumentFragment> pFrag = pDoc->createDocumentFragment();
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pFrag->appendChild(pChild1);
- pRoot->appendChild(pFrag);
- assert (pFrag->firstChild() == 0);
- assert (pFrag->lastChild() == 0);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild1);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == 0);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pFrag->appendChild(pChild2);
- pRoot->appendChild(pFrag);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild2);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == 0);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pFrag->appendChild(pChild3);
- pRoot->appendChild(pFrag);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild3);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == 0);
-}
-
-
-void NodeTest::testAppendFragment2()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<DocumentFragment> pFrag = pDoc->createDocumentFragment();
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pFrag->appendChild(pChild1);
- pFrag->appendChild(pChild2);
- pRoot->appendChild(pFrag);
- assert (pFrag->firstChild() == 0);
- assert (pFrag->lastChild() == 0);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild2);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == 0);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- AutoPtr<Element> pChild4 = pDoc->createElement("child4");
- pFrag->appendChild(pChild3);
- pFrag->appendChild(pChild4);
- pRoot->appendChild(pFrag);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild4);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild5 = pDoc->createElement("child5");
- AutoPtr<Element> pChild6 = pDoc->createElement("child6");
- pFrag->appendChild(pChild5);
- pFrag->appendChild(pChild6);
- pRoot->appendChild(pFrag);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild6);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == pChild5);
- assert (pChild5->previousSibling() == pChild4);
- assert (pChild5->nextSibling() == pChild6);
- assert (pChild6->previousSibling() == pChild5);
- assert (pChild6->nextSibling() == 0);
-}
-
-
-void NodeTest::testAppendFragment3()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<DocumentFragment> pFrag = pDoc->createDocumentFragment();
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pFrag->appendChild(pChild1);
- pFrag->appendChild(pChild2);
- pFrag->appendChild(pChild3);
- pRoot->appendChild(pFrag);
- assert (pFrag->firstChild() == 0);
- assert (pFrag->lastChild() == 0);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild3);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == 0);
-
- AutoPtr<Element> pChild4 = pDoc->createElement("child4");
- AutoPtr<Element> pChild5 = pDoc->createElement("child5");
- AutoPtr<Element> pChild6 = pDoc->createElement("child6");
- pFrag->appendChild(pChild4);
- pFrag->appendChild(pChild5);
- pFrag->appendChild(pChild6);
- pRoot->appendChild(pFrag);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild6);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == pChild5);
- assert (pChild5->previousSibling() == pChild4);
- assert (pChild5->nextSibling() == pChild6);
- assert (pChild6->previousSibling() == pChild5);
- assert (pChild6->nextSibling() == 0);
-
- AutoPtr<Element> pChild7 = pDoc->createElement("child7");
- AutoPtr<Element> pChild8 = pDoc->createElement("child8");
- AutoPtr<Element> pChild9 = pDoc->createElement("child9");
- pFrag->appendChild(pChild7);
- pFrag->appendChild(pChild8);
- pFrag->appendChild(pChild9);
- pRoot->appendChild(pFrag);
- assert (pRoot->firstChild() == pChild1);
- assert (pRoot->lastChild() == pChild9);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild1);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == pChild5);
- assert (pChild5->previousSibling() == pChild4);
- assert (pChild5->nextSibling() == pChild6);
- assert (pChild6->previousSibling() == pChild5);
- assert (pChild6->nextSibling() == pChild7);
- assert (pChild7->previousSibling() == pChild6);
- assert (pChild7->nextSibling() == pChild8);
- assert (pChild8->previousSibling() == pChild7);
- assert (pChild8->nextSibling() == pChild9);
- assert (pChild9->previousSibling() == pChild8);
- assert (pChild9->nextSibling() == 0);
-}
-
-
-void NodeTest::testReplaceFragment1()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<DocumentFragment> pFrag = pDoc->createDocumentFragment();
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pRoot->appendChild(pChild1);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pRoot->appendChild(pChild2);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pRoot->appendChild(pChild3);
-
- AutoPtr<Element> pChild4 = pDoc->createElement("child4");
- pRoot->appendChild(pChild4);
-
- AutoPtr<Element> pChild11 = pDoc->createElement("child11");
- pFrag->appendChild(pChild11);
- pRoot->replaceChild(pFrag, pChild1);
- assert (pFrag->firstChild() == 0);
- assert (pFrag->lastChild() == 0);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild11);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild22 = pDoc->createElement("child22");
- pFrag->appendChild(pChild22);
- pRoot->replaceChild(pFrag, pChild2);
-
- assert (pChild2->previousSibling() == 0);
- assert (pChild2->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild11);
- assert (pChild22->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild22);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild33 = pDoc->createElement("child33");
- pFrag->appendChild(pChild33);
- pRoot->replaceChild(pFrag, pChild3);
-
- assert (pChild3->previousSibling() == 0);
- assert (pChild3->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild11);
- assert (pChild22->nextSibling() == pChild33);
- assert (pChild33->previousSibling() == pChild22);
- assert (pChild33->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild33);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild44 = pDoc->createElement("child44");
- pFrag->appendChild(pChild44);
- pRoot->replaceChild(pFrag, pChild4);
-
- assert (pChild4->previousSibling() == 0);
- assert (pChild4->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild44);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild11);
- assert (pChild22->nextSibling() == pChild33);
- assert (pChild33->previousSibling() == pChild22);
- assert (pChild33->nextSibling() == pChild44);
- assert (pChild44->previousSibling() == pChild33);
- assert (pChild44->nextSibling() == 0);
-}
-
-
-void NodeTest::testReplaceFragment2()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<DocumentFragment> pFrag = pDoc->createDocumentFragment();
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pRoot->appendChild(pChild1);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pRoot->appendChild(pChild2);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pRoot->appendChild(pChild3);
-
- AutoPtr<Element> pChild4 = pDoc->createElement("child4");
- pRoot->appendChild(pChild4);
-
- AutoPtr<Element> pChild11 = pDoc->createElement("child11");
- AutoPtr<Element> pChild12 = pDoc->createElement("child12");
- pFrag->appendChild(pChild11);
- pFrag->appendChild(pChild12);
- pRoot->replaceChild(pFrag, pChild1);
- assert (pFrag->firstChild() == 0);
- assert (pFrag->lastChild() == 0);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild12);
- assert (pChild12->previousSibling() == pChild11);
- assert (pChild12->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild12);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild21 = pDoc->createElement("child21");
- AutoPtr<Element> pChild22 = pDoc->createElement("child22");
- pFrag->appendChild(pChild21);
- pFrag->appendChild(pChild22);
- pRoot->replaceChild(pFrag, pChild2);
-
- assert (pChild2->previousSibling() == 0);
- assert (pChild2->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild12);
- assert (pChild12->previousSibling() == pChild11);
- assert (pChild12->nextSibling() == pChild21);
- assert (pChild21->previousSibling() == pChild12);
- assert (pChild21->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild21);
- assert (pChild22->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild22);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild31 = pDoc->createElement("child31");
- AutoPtr<Element> pChild32 = pDoc->createElement("child32");
- pFrag->appendChild(pChild31);
- pFrag->appendChild(pChild32);
- pRoot->replaceChild(pFrag, pChild3);
-
- assert (pChild3->previousSibling() == 0);
- assert (pChild3->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild12);
- assert (pChild12->previousSibling() == pChild11);
- assert (pChild12->nextSibling() == pChild21);
- assert (pChild21->previousSibling() == pChild12);
- assert (pChild21->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild21);
- assert (pChild22->nextSibling() == pChild31);
- assert (pChild31->previousSibling() == pChild22);
- assert (pChild31->nextSibling() == pChild32);
- assert (pChild32->previousSibling() == pChild31);
- assert (pChild32->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild32);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild41 = pDoc->createElement("child41");
- AutoPtr<Element> pChild42 = pDoc->createElement("child42");
- pFrag->appendChild(pChild41);
- pFrag->appendChild(pChild42);
- pRoot->replaceChild(pFrag, pChild4);
-
- assert (pChild4->previousSibling() == 0);
- assert (pChild4->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild42);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild12);
- assert (pChild12->previousSibling() == pChild11);
- assert (pChild12->nextSibling() == pChild21);
- assert (pChild21->previousSibling() == pChild12);
- assert (pChild21->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild21);
- assert (pChild22->nextSibling() == pChild31);
- assert (pChild31->previousSibling() == pChild22);
- assert (pChild31->nextSibling() == pChild32);
- assert (pChild32->previousSibling() == pChild31);
- assert (pChild32->nextSibling() == pChild41);
- assert (pChild41->previousSibling() == pChild32);
- assert (pChild41->nextSibling() == pChild42);
- assert (pChild42->previousSibling() == pChild41);
- assert (pChild42->nextSibling() == 0);
-}
-
-
-void NodeTest::testReplaceFragment3()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<DocumentFragment> pFrag = pDoc->createDocumentFragment();
-
- AutoPtr<Element> pChild1 = pDoc->createElement("child1");
- pRoot->appendChild(pChild1);
-
- AutoPtr<Element> pChild2 = pDoc->createElement("child2");
- pRoot->appendChild(pChild2);
-
- AutoPtr<Element> pChild3 = pDoc->createElement("child3");
- pRoot->appendChild(pChild3);
-
- AutoPtr<Element> pChild4 = pDoc->createElement("child4");
- pRoot->appendChild(pChild4);
-
- AutoPtr<Element> pChild11 = pDoc->createElement("child11");
- AutoPtr<Element> pChild12 = pDoc->createElement("child12");
- AutoPtr<Element> pChild13 = pDoc->createElement("child13");
- pFrag->appendChild(pChild11);
- pFrag->appendChild(pChild12);
- pFrag->appendChild(pChild13);
- pRoot->replaceChild(pFrag, pChild1);
- assert (pFrag->firstChild() == 0);
- assert (pFrag->lastChild() == 0);
-
- assert (pChild1->previousSibling() == 0);
- assert (pChild1->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild12);
- assert (pChild12->previousSibling() == pChild11);
- assert (pChild12->nextSibling() == pChild13);
- assert (pChild13->previousSibling() == pChild12);
- assert (pChild13->nextSibling() == pChild2);
- assert (pChild2->previousSibling() == pChild13);
- assert (pChild2->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild2);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild21 = pDoc->createElement("child21");
- AutoPtr<Element> pChild22 = pDoc->createElement("child22");
- AutoPtr<Element> pChild23 = pDoc->createElement("child23");
- pFrag->appendChild(pChild21);
- pFrag->appendChild(pChild22);
- pFrag->appendChild(pChild23);
- pRoot->replaceChild(pFrag, pChild2);
-
- assert (pChild2->previousSibling() == 0);
- assert (pChild2->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild12);
- assert (pChild12->previousSibling() == pChild11);
- assert (pChild12->nextSibling() == pChild13);
- assert (pChild13->previousSibling() == pChild12);
- assert (pChild13->nextSibling() == pChild21);
- assert (pChild21->previousSibling() == pChild13);
- assert (pChild21->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild21);
- assert (pChild22->nextSibling() == pChild23);
- assert (pChild23->previousSibling() == pChild22);
- assert (pChild23->nextSibling() == pChild3);
- assert (pChild3->previousSibling() == pChild23);
- assert (pChild3->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild3);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild31 = pDoc->createElement("child31");
- AutoPtr<Element> pChild32 = pDoc->createElement("child32");
- AutoPtr<Element> pChild33 = pDoc->createElement("child33");
- pFrag->appendChild(pChild31);
- pFrag->appendChild(pChild32);
- pFrag->appendChild(pChild33);
- pRoot->replaceChild(pFrag, pChild3);
-
- assert (pChild3->previousSibling() == 0);
- assert (pChild3->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild4);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild12);
- assert (pChild12->previousSibling() == pChild11);
- assert (pChild12->nextSibling() == pChild13);
- assert (pChild13->previousSibling() == pChild12);
- assert (pChild13->nextSibling() == pChild21);
- assert (pChild21->previousSibling() == pChild13);
- assert (pChild21->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild21);
- assert (pChild22->nextSibling() == pChild23);
- assert (pChild23->previousSibling() == pChild22);
- assert (pChild23->nextSibling() == pChild31);
- assert (pChild31->previousSibling() == pChild23);
- assert (pChild31->nextSibling() == pChild32);
- assert (pChild32->previousSibling() == pChild31);
- assert (pChild32->nextSibling() == pChild33);
- assert (pChild33->previousSibling() == pChild32);
- assert (pChild33->nextSibling() == pChild4);
- assert (pChild4->previousSibling() == pChild33);
- assert (pChild4->nextSibling() == 0);
-
- AutoPtr<Element> pChild41 = pDoc->createElement("child41");
- AutoPtr<Element> pChild42 = pDoc->createElement("child42");
- AutoPtr<Element> pChild43 = pDoc->createElement("child43");
- pFrag->appendChild(pChild41);
- pFrag->appendChild(pChild42);
- pFrag->appendChild(pChild43);
- pRoot->replaceChild(pFrag, pChild4);
-
- assert (pChild4->previousSibling() == 0);
- assert (pChild4->nextSibling() == 0);
- assert (pRoot->firstChild() == pChild11);
- assert (pRoot->lastChild() == pChild43);
- assert (pChild11->previousSibling() == 0);
- assert (pChild11->nextSibling() == pChild12);
- assert (pChild12->previousSibling() == pChild11);
- assert (pChild12->nextSibling() == pChild13);
- assert (pChild13->previousSibling() == pChild12);
- assert (pChild13->nextSibling() == pChild21);
- assert (pChild21->previousSibling() == pChild13);
- assert (pChild21->nextSibling() == pChild22);
- assert (pChild22->previousSibling() == pChild21);
- assert (pChild22->nextSibling() == pChild23);
- assert (pChild23->previousSibling() == pChild22);
- assert (pChild23->nextSibling() == pChild31);
- assert (pChild31->previousSibling() == pChild23);
- assert (pChild31->nextSibling() == pChild32);
- assert (pChild32->previousSibling() == pChild31);
- assert (pChild32->nextSibling() == pChild33);
- assert (pChild33->previousSibling() == pChild32);
- assert (pChild33->nextSibling() == pChild41);
- assert (pChild41->previousSibling() == pChild33);
- assert (pChild41->nextSibling() == pChild42);
- assert (pChild42->previousSibling() == pChild41);
- assert (pChild42->nextSibling() == pChild43);
- assert (pChild43->previousSibling() == pChild42);
- assert (pChild43->nextSibling() == 0);
-}
-
-
-void NodeTest::setUp()
-{
-}
-
-
-void NodeTest::tearDown()
-{
-}
-
-
-CppUnit::Test* NodeTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NodeTest");
-
- CppUnit_addTest(pSuite, NodeTest, testInsert);
- CppUnit_addTest(pSuite, NodeTest, testAppend);
- CppUnit_addTest(pSuite, NodeTest, testRemove);
- CppUnit_addTest(pSuite, NodeTest, testReplace);
- CppUnit_addTest(pSuite, NodeTest, testInsertFragment1);
- CppUnit_addTest(pSuite, NodeTest, testInsertFragment2);
- CppUnit_addTest(pSuite, NodeTest, testInsertFragment3);
- CppUnit_addTest(pSuite, NodeTest, testAppendFragment1);
- CppUnit_addTest(pSuite, NodeTest, testAppendFragment2);
- CppUnit_addTest(pSuite, NodeTest, testAppendFragment3);
- CppUnit_addTest(pSuite, NodeTest, testReplaceFragment1);
- CppUnit_addTest(pSuite, NodeTest, testReplaceFragment2);
- CppUnit_addTest(pSuite, NodeTest, testReplaceFragment3);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/NodeTest.h b/Utilities/Poco/XML/testsuite/src/NodeTest.h
deleted file mode 100755
index 59292f1728..0000000000
--- a/Utilities/Poco/XML/testsuite/src/NodeTest.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// NodeTest.h
-//
-// $Id$
-//
-// Definition of the NodeTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef NodeTest_INCLUDED
-#define NodeTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class NodeTest: public CppUnit::TestCase
-{
-public:
- NodeTest(const std::string& name);
- ~NodeTest();
-
- void testInsert();
- void testAppend();
- void testRemove();
- void testReplace();
- void testInsertFragment1();
- void testInsertFragment2();
- void testInsertFragment3();
- void testAppendFragment1();
- void testAppendFragment2();
- void testAppendFragment3();
- void testReplaceFragment1();
- void testReplaceFragment2();
- void testReplaceFragment3();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // NodeTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/ParserWriterTest.cpp b/Utilities/Poco/XML/testsuite/src/ParserWriterTest.cpp
deleted file mode 100755
index 56f0582af8..0000000000
--- a/Utilities/Poco/XML/testsuite/src/ParserWriterTest.cpp
+++ /dev/null
@@ -1,321 +0,0 @@
-//
-// ParserWriterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "ParserWriterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/DOMParser.h"
-#include "Poco/DOM/DOMWriter.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/AutoPtr.h"
-#include "Poco/SAX/InputSource.h"
-#include "Poco/XML/XMLWriter.h"
-#include <sstream>
-
-
-using Poco::XML::DOMParser;
-using Poco::XML::DOMWriter;
-using Poco::XML::XMLReader;
-using Poco::XML::XMLWriter;
-using Poco::XML::Document;
-using Poco::XML::AutoPtr;
-using Poco::XML::InputSource;
-
-
-ParserWriterTest::ParserWriterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ParserWriterTest::~ParserWriterTest()
-{
-}
-
-
-void ParserWriterTest::testParseWriteXHTML()
-{
- std::ostringstream ostr;
-
- DOMParser parser;
- parser.setFeature(XMLReader::FEATURE_NAMESPACE_PREFIXES, false);
- DOMWriter writer;
- AutoPtr<Document> pDoc = parser.parseString(XHTML);
- writer.writeNode(ostr, pDoc);
-
- std::string xml = ostr.str();
- assert (xml == XHTML);
-}
-
-
-void ParserWriterTest::testParseWriteXHTML2()
-{
- std::ostringstream ostr;
-
- DOMParser parser;
- parser.setFeature(XMLReader::FEATURE_NAMESPACE_PREFIXES, true);
- DOMWriter writer;
- AutoPtr<Document> pDoc = parser.parseString(XHTML2);
- writer.writeNode(ostr, pDoc);
-
- std::string xml = ostr.str();
- assert (xml == XHTML2);
-}
-
-
-void ParserWriterTest::testParseWriteWSDL()
-{
- std::istringstream istr(WSDL);
- std::ostringstream ostr;
-
- DOMParser parser;
- parser.setFeature(DOMParser::FEATURE_WHITESPACE, false);
- parser.setFeature(XMLReader::FEATURE_NAMESPACE_PREFIXES, false);
- DOMWriter writer;
- writer.setOptions(XMLWriter::CANONICAL | XMLWriter::PRETTY_PRINT);
- writer.setNewLine(XMLWriter::NEWLINE_LF);
- InputSource source(istr);
- AutoPtr<Document> pDoc = parser.parse(&source);
- writer.writeNode(ostr, pDoc);
-
- std::string xml = ostr.str();
- assert (xml == WSDL);
-}
-
-
-void ParserWriterTest::setUp()
-{
-}
-
-
-void ParserWriterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ParserWriterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ParserWriterTest");
-
- CppUnit_addTest(pSuite, ParserWriterTest, testParseWriteXHTML);
- CppUnit_addTest(pSuite, ParserWriterTest, testParseWriteXHTML2);
- CppUnit_addTest(pSuite, ParserWriterTest, testParseWriteWSDL);
-
- return pSuite;
-}
-
-
-const std::string ParserWriterTest::XHTML =
- "<!--\n"
- "\tThis is a comment.\n"
- "-->"
- "<ns1:html xml:lang=\"en\" xmlns:ns1=\"http://www.w3.org/1999/xhtml\">\n"
- "\t<ns1:head>\n"
- "\t\t<ns1:link href=\"styles.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
- "\t\t<?xml-stylesheet href=\"styles.css\" type=\"text/css\"?>\n"
- "\t\t<ns1:title>A XHTML Example</ns1:title>\n"
- "\t</ns1:head>\n"
- "\t<ns1:body>\n"
- "\t\t<ns1:h1>XHTML Example</ns1:h1>\n"
- "\t\t<ns1:p>This is a XHTML example page.</ns1:p>\n"
- "\t\t<ns1:img alt=\"Example Picture\" border=\"0\" height=\"192\" src=\"example.gif\" width=\"256\"/>\n"
- "\t\t<![CDATA[\n"
- "\t\tThe following <tag attr=\"value\">is inside a CDATA section</tag>.\n"
- "\t\t]]>\n"
- "\t</ns1:body>\n"
- "</ns1:html>";
-
-
-const std::string ParserWriterTest::XHTML2 =
- "<!--\n"
- "\tThis is a comment.\n"
- "-->"
- "<xns:html xml:lang=\"en\" xmlns:xns=\"http://www.w3.org/1999/xhtml\">\n"
- "\t<xns:head>\n"
- "\t\t<xns:link href=\"styles.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
- "\t\t<?xml-stylesheet href=\"styles.css\" type=\"text/css\"?>\n"
- "\t\t<xns:title>A XHTML Example</xns:title>\n"
- "\t</xns:head>\n"
- "\t<xns:body>\n"
- "\t\t<xns:h1>XHTML Example</xns:h1>\n"
- "\t\t<xns:p>This is a XHTML example page.</xns:p>\n"
- "\t\t<xns:img alt=\"Example Picture\" border=\"0\" height=\"192\" src=\"example.gif\" width=\"256\"/>\n"
- "\t\t<![CDATA[\n"
- "\t\tThe following <tag attr=\"value\">is inside a CDATA section</tag>.\n"
- "\t\t]]>\n"
- "\t</xns:body>\n"
- "</xns:html>";
-
-
-const std::string ParserWriterTest::WSDL =
- "<!-- WSDL description of the Google Web APIs.\n"
- " The Google Web APIs are in beta release. All interfaces are subject to\n"
- " change as we refine and extend our APIs. Please see the terms of use\n"
- " for more information. -->\n"
- "<!-- Revision 2002-08-16 -->\n"
- "<ns1:definitions name=\"GoogleSearch\" targetNamespace=\"urn:GoogleSearch\" xmlns:ns1=\"http://schemas.xmlsoap.org/wsdl/\">\n"
- "\t<!-- Types for search - result elements, directory categories -->\n"
- "\t<ns1:types>\n"
- "\t\t<ns2:schema targetNamespace=\"urn:GoogleSearch\" xmlns:ns2=\"http://www.w3.org/2001/XMLSchema\">\n"
- "\t\t\t<ns2:complexType name=\"GoogleSearchResult\">\n"
- "\t\t\t\t<ns2:all>\n"
- "\t\t\t\t\t<ns2:element name=\"documentFiltering\" type=\"xsd:boolean\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"searchComments\" type=\"xsd:string\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"estimatedTotalResultsCount\" type=\"xsd:int\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"estimateIsExact\" type=\"xsd:boolean\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"resultElements\" type=\"typens:ResultElementArray\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"searchQuery\" type=\"xsd:string\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"startIndex\" type=\"xsd:int\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"endIndex\" type=\"xsd:int\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"searchTips\" type=\"xsd:string\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"directoryCategories\" type=\"typens:DirectoryCategoryArray\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"searchTime\" type=\"xsd:double\"/>\n"
- "\t\t\t\t</ns2:all>\n"
- "\t\t\t</ns2:complexType>\n"
- "\t\t\t<ns2:complexType name=\"ResultElement\">\n"
- "\t\t\t\t<ns2:all>\n"
- "\t\t\t\t\t<ns2:element name=\"summary\" type=\"xsd:string\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"URL\" type=\"xsd:string\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"snippet\" type=\"xsd:string\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"title\" type=\"xsd:string\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"cachedSize\" type=\"xsd:string\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"relatedInformationPresent\" type=\"xsd:boolean\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"hostName\" type=\"xsd:string\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"directoryCategory\" type=\"typens:DirectoryCategory\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"directoryTitle\" type=\"xsd:string\"/>\n"
- "\t\t\t\t</ns2:all>\n"
- "\t\t\t</ns2:complexType>\n"
- "\t\t\t<ns2:complexType name=\"ResultElementArray\">\n"
- "\t\t\t\t<ns2:complexContent>\n"
- "\t\t\t\t\t<ns2:restriction base=\"soapenc:Array\">\n"
- "\t\t\t\t\t\t<ns2:attribute ns1:arrayType=\"typens:ResultElement[]\" ref=\"soapenc:arrayType\"/>\n"
- "\t\t\t\t\t</ns2:restriction>\n"
- "\t\t\t\t</ns2:complexContent>\n"
- "\t\t\t</ns2:complexType>\n"
- "\t\t\t<ns2:complexType name=\"DirectoryCategoryArray\">\n"
- "\t\t\t\t<ns2:complexContent>\n"
- "\t\t\t\t\t<ns2:restriction base=\"soapenc:Array\">\n"
- "\t\t\t\t\t\t<ns2:attribute ns1:arrayType=\"typens:DirectoryCategory[]\" ref=\"soapenc:arrayType\"/>\n"
- "\t\t\t\t\t</ns2:restriction>\n"
- "\t\t\t\t</ns2:complexContent>\n"
- "\t\t\t</ns2:complexType>\n"
- "\t\t\t<ns2:complexType name=\"DirectoryCategory\">\n"
- "\t\t\t\t<ns2:all>\n"
- "\t\t\t\t\t<ns2:element name=\"fullViewableName\" type=\"xsd:string\"/>\n"
- "\t\t\t\t\t<ns2:element name=\"specialEncoding\" type=\"xsd:string\"/>\n"
- "\t\t\t\t</ns2:all>\n"
- "\t\t\t</ns2:complexType>\n"
- "\t\t</ns2:schema>\n"
- "\t</ns1:types>\n"
- "\t<!-- Messages for Google Web APIs - cached page, search, spelling. -->\n"
- "\t<ns1:message name=\"doGetCachedPage\">\n"
- "\t\t<ns1:part name=\"key\" type=\"xsd:string\"/>\n"
- "\t\t<ns1:part name=\"url\" type=\"xsd:string\"/>\n"
- "\t</ns1:message>\n"
- "\t<ns1:message name=\"doGetCachedPageResponse\">\n"
- "\t\t<ns1:part name=\"return\" type=\"xsd:base64Binary\"/>\n"
- "\t</ns1:message>\n"
- "\t<ns1:message name=\"doSpellingSuggestion\">\n"
- "\t\t<ns1:part name=\"key\" type=\"xsd:string\"/>\n"
- "\t\t<ns1:part name=\"phrase\" type=\"xsd:string\"/>\n"
- "\t</ns1:message>\n"
- "\t<ns1:message name=\"doSpellingSuggestionResponse\">\n"
- "\t\t<ns1:part name=\"return\" type=\"xsd:string\"/>\n"
- "\t</ns1:message>\n"
- "\t<!-- note, ie and oe are ignored by server; all traffic is UTF-8. -->\n"
- "\t<ns1:message name=\"doGoogleSearch\">\n"
- "\t\t<ns1:part name=\"key\" type=\"xsd:string\"/>\n"
- "\t\t<ns1:part name=\"q\" type=\"xsd:string\"/>\n"
- "\t\t<ns1:part name=\"start\" type=\"xsd:int\"/>\n"
- "\t\t<ns1:part name=\"maxResults\" type=\"xsd:int\"/>\n"
- "\t\t<ns1:part name=\"filter\" type=\"xsd:boolean\"/>\n"
- "\t\t<ns1:part name=\"restrict\" type=\"xsd:string\"/>\n"
- "\t\t<ns1:part name=\"safeSearch\" type=\"xsd:boolean\"/>\n"
- "\t\t<ns1:part name=\"lr\" type=\"xsd:string\"/>\n"
- "\t\t<ns1:part name=\"ie\" type=\"xsd:string\"/>\n"
- "\t\t<ns1:part name=\"oe\" type=\"xsd:string\"/>\n"
- "\t</ns1:message>\n"
- "\t<ns1:message name=\"doGoogleSearchResponse\">\n"
- "\t\t<ns1:part name=\"return\" type=\"typens:GoogleSearchResult\"/>\n"
- "\t</ns1:message>\n"
- "\t<!-- Port for Google Web APIs, \"GoogleSearch\" -->\n"
- "\t<ns1:portType name=\"GoogleSearchPort\">\n"
- "\t\t<ns1:operation name=\"doGetCachedPage\">\n"
- "\t\t\t<ns1:input message=\"typens:doGetCachedPage\"/>\n"
- "\t\t\t<ns1:output message=\"typens:doGetCachedPageResponse\"/>\n"
- "\t\t</ns1:operation>\n"
- "\t\t<ns1:operation name=\"doSpellingSuggestion\">\n"
- "\t\t\t<ns1:input message=\"typens:doSpellingSuggestion\"/>\n"
- "\t\t\t<ns1:output message=\"typens:doSpellingSuggestionResponse\"/>\n"
- "\t\t</ns1:operation>\n"
- "\t\t<ns1:operation name=\"doGoogleSearch\">\n"
- "\t\t\t<ns1:input message=\"typens:doGoogleSearch\"/>\n"
- "\t\t\t<ns1:output message=\"typens:doGoogleSearchResponse\"/>\n"
- "\t\t</ns1:operation>\n"
- "\t</ns1:portType>\n"
- "\t<!-- Binding for Google Web APIs - RPC, SOAP over HTTP -->\n"
- "\t<ns1:binding name=\"GoogleSearchBinding\" type=\"typens:GoogleSearchPort\">\n"
- "\t\t<ns3:binding style=\"rpc\" transport=\"http://schemas.xmlsoap.org/soap/http\" xmlns:ns3=\"http://schemas.xmlsoap.org/wsdl/soap/\"/>\n"
- "\t\t<ns1:operation name=\"doGetCachedPage\" xmlns:ns3=\"http://schemas.xmlsoap.org/wsdl/soap/\">\n"
- "\t\t\t<ns3:operation soapAction=\"urn:GoogleSearchAction\"/>\n"
- "\t\t\t<ns1:input>\n"
- "\t\t\t\t<ns3:body encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" namespace=\"urn:GoogleSearch\" use=\"encoded\"/>\n"
- "\t\t\t</ns1:input>\n"
- "\t\t\t<ns1:output>\n"
- "\t\t\t\t<ns3:body encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" namespace=\"urn:GoogleSearch\" use=\"encoded\"/>\n"
- "\t\t\t</ns1:output>\n"
- "\t\t</ns1:operation>\n"
- "\t\t<ns1:operation name=\"doSpellingSuggestion\" xmlns:ns3=\"http://schemas.xmlsoap.org/wsdl/soap/\">\n"
- "\t\t\t<ns3:operation soapAction=\"urn:GoogleSearchAction\"/>\n"
- "\t\t\t<ns1:input>\n"
- "\t\t\t\t<ns3:body encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" namespace=\"urn:GoogleSearch\" use=\"encoded\"/>\n"
- "\t\t\t</ns1:input>\n"
- "\t\t\t<ns1:output>\n"
- "\t\t\t\t<ns3:body encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" namespace=\"urn:GoogleSearch\" use=\"encoded\"/>\n"
- "\t\t\t</ns1:output>\n"
- "\t\t</ns1:operation>\n"
- "\t\t<ns1:operation name=\"doGoogleSearch\" xmlns:ns3=\"http://schemas.xmlsoap.org/wsdl/soap/\">\n"
- "\t\t\t<ns3:operation soapAction=\"urn:GoogleSearchAction\"/>\n"
- "\t\t\t<ns1:input>\n"
- "\t\t\t\t<ns3:body encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" namespace=\"urn:GoogleSearch\" use=\"encoded\"/>\n"
- "\t\t\t</ns1:input>\n"
- "\t\t\t<ns1:output>\n"
- "\t\t\t\t<ns3:body encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" namespace=\"urn:GoogleSearch\" use=\"encoded\"/>\n"
- "\t\t\t</ns1:output>\n"
- "\t\t</ns1:operation>\n"
- "\t</ns1:binding>\n"
- "\t<!-- Endpoint for Google Web APIs -->\n"
- "\t<ns1:service name=\"GoogleSearchService\">\n"
- "\t\t<ns1:port binding=\"typens:GoogleSearchBinding\" name=\"GoogleSearchPort\">\n"
- "\t\t\t<ns4:address location=\"http://api.google.com/search/beta2\" xmlns:ns4=\"http://schemas.xmlsoap.org/wsdl/soap/\"/>\n"
- "\t\t</ns1:port>\n"
- "\t</ns1:service>\n"
- "</ns1:definitions>\n";
diff --git a/Utilities/Poco/XML/testsuite/src/ParserWriterTest.h b/Utilities/Poco/XML/testsuite/src/ParserWriterTest.h
deleted file mode 100755
index 196b8df1ef..0000000000
--- a/Utilities/Poco/XML/testsuite/src/ParserWriterTest.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// ParserWriterTest.h
-//
-// $Id$
-//
-// Definition of the ParserWriterTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef ParserWriterTest_INCLUDED
-#define ParserWriterTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class ParserWriterTest: public CppUnit::TestCase
-{
-public:
- ParserWriterTest(const std::string& name);
- ~ParserWriterTest();
-
- void testParseWriteXHTML();
- void testParseWriteXHTML2();
- void testParseWriteWSDL();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
- static const std::string XHTML;
- static const std::string XHTML2;
- static const std::string WSDL;
-};
-
-
-#endif // ParserWriterTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/SAXParserTest.cpp b/Utilities/Poco/XML/testsuite/src/SAXParserTest.cpp
deleted file mode 100755
index e147926275..0000000000
--- a/Utilities/Poco/XML/testsuite/src/SAXParserTest.cpp
+++ /dev/null
@@ -1,1036 +0,0 @@
-//
-// SAXParserTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "SAXParserTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/SAX/SAXParser.h"
-#include "Poco/SAX/InputSource.h"
-#include "Poco/SAX/EntityResolver.h"
-#include "Poco/SAX/SAXException.h"
-#include "Poco/SAX/WhitespaceFilter.h"
-#include "Poco/XML/XMLWriter.h"
-#include "Poco/Latin9Encoding.h"
-#include "Poco/FileStream.h"
-#include <sstream>
-
-
-using Poco::XML::SAXParser;
-using Poco::XML::XMLWriter;
-using Poco::XML::XMLReader;
-using Poco::XML::InputSource;
-using Poco::XML::EntityResolver;
-using Poco::XML::XMLString;
-using Poco::XML::SAXParseException;
-using Poco::XML::WhitespaceFilter;
-
-
-class TestEntityResolver: public EntityResolver
-{
-public:
- InputSource* resolveEntity(const XMLString* publicId, const XMLString& systemId)
- {
- if (systemId == "include.xml")
- {
- std::istringstream* istr = new std::istringstream(SAXParserTest::INCLUDE);
- InputSource* pIS = new InputSource(*istr);
- pIS->setSystemId(systemId);
- return pIS;
- }
- else if (systemId == "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent")
- {
- std::istringstream* istr = new std::istringstream(SAXParserTest::XHTML_LATIN1_ENTITIES);
- InputSource* pIS = new InputSource(*istr);
- pIS->setSystemId(systemId);
- return pIS;
- }
- return 0;
- }
-
- void releaseInputSource(InputSource* pSource)
- {
- delete pSource->getByteStream();
- delete pSource;
- }
-};
-
-
-SAXParserTest::SAXParserTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-SAXParserTest::~SAXParserTest()
-{
-}
-
-
-void SAXParserTest::testSimple1()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, SIMPLE1);
- assert (xml == "<foo/>");
-}
-
-
-void SAXParserTest::testSimple2()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, SIMPLE2);
- assert (xml == "<foo/>");
-}
-
-
-void SAXParserTest::testAttributes()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, ATTRIBUTES);
- assert (xml == ATTRIBUTES);
-}
-
-
-void SAXParserTest::testCDATA()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, CDATA);
- assert (xml == CDATA);
-}
-
-
-void SAXParserTest::testComment()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, COMMENT);
- assert (xml == COMMENT);
-}
-
-
-void SAXParserTest::testPI()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, PROCESSING_INSTRUCTION);
- assert (xml == PROCESSING_INSTRUCTION);
-}
-
-
-void SAXParserTest::testDTD()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, DTD);
- assert (xml == "<!DOCTYPE test SYSTEM \"test.dtd\"><foo/>");
-}
-
-
-void SAXParserTest::testInternalEntity()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, INTERNAL_ENTITY);
- assert (xml == "<!DOCTYPE sample><root>\n\t<company>Applied Informatics</company>\n</root>");
-}
-
-
-void SAXParserTest::testNotation()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, NOTATION);
- assert (xml == "<!DOCTYPE test [<!NOTATION mov SYSTEM \"quicktime\">"
- "<!NOTATION xml PUBLIC \"-//W3C//NOTATION XML 1.0//EN\">]>"
- "<foo/>");
-}
-
-
-void SAXParserTest::testExternalUnparsed()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, EXTERNAL_UNPARSED);
- assert (xml == "<!DOCTYPE test [<!NOTATION mov SYSTEM \"quicktime\">"
- "<!ENTITY movie SYSTEM \"movie.mov\" NDATA mov>]>"
- "<sample/>");
-}
-
-
-void SAXParserTest::testExternalParsed()
-{
- SAXParser parser;
- TestEntityResolver resolver;
- parser.setEntityResolver(&resolver);
- parser.setFeature(XMLReader::FEATURE_EXTERNAL_GENERAL_ENTITIES, true);
- std::string xml = parse(parser, XMLWriter::CANONICAL, EXTERNAL_PARSED);
- assert (xml == "<!DOCTYPE test><sample>\n\t<elem>\n\tAn external entity.\n</elem>\n\n</sample>");
-}
-
-
-void SAXParserTest::testDefaultNamespace()
-{
- SAXParser parser;
- std::string xml = parse(parser, XMLWriter::CANONICAL, DEFAULT_NAMESPACE);
- assert (xml == DEFAULT_NAMESPACE);
-}
-
-
-void SAXParserTest::testNamespaces()
-{
- SAXParser parser;
- parser.setFeature(XMLReader::FEATURE_NAMESPACES, true);
- parser.setFeature(XMLReader::FEATURE_NAMESPACE_PREFIXES, true);
- std::string xml = parse(parser, XMLWriter::CANONICAL, NAMESPACES);
- assert (xml == NAMESPACES);
-}
-
-
-void SAXParserTest::testNamespacesNoPrefixes()
-{
- SAXParser parser;
- parser.setFeature(XMLReader::FEATURE_NAMESPACES, true);
- parser.setFeature(XMLReader::FEATURE_NAMESPACE_PREFIXES, false);
- std::string xml = parse(parser, XMLWriter::CANONICAL, NAMESPACES);
- assert (xml == NAMESPACES);
-}
-
-
-void SAXParserTest::testNoNamespaces()
-{
- SAXParser parser;
- parser.setFeature(XMLReader::FEATURE_NAMESPACES, false);
- std::string xml = parse(parser, XMLWriter::CANONICAL, NAMESPACES);
- assert (xml == NAMESPACES);
-}
-
-
-void SAXParserTest::testUndeclaredNamespace()
-{
- SAXParser parser;
- parser.setFeature(XMLReader::FEATURE_NAMESPACES, true);
- parser.setFeature(XMLReader::FEATURE_NAMESPACE_PREFIXES, true);
- try
- {
- std::string xml = parse(parser, XMLWriter::CANONICAL, UNDECLARED_NAMESPACE);
- fail("undeclared namespace - must throw exception");
- }
- catch (SAXParseException&)
- {
- }
-}
-
-
-void SAXParserTest::testUndeclaredNamespaceNoPrefixes()
-{
- SAXParser parser;
- parser.setFeature(XMLReader::FEATURE_NAMESPACES, true);
- parser.setFeature(XMLReader::FEATURE_NAMESPACE_PREFIXES, false);
- try
- {
- std::string xml = parse(parser, XMLWriter::CANONICAL, UNDECLARED_NAMESPACE);
- fail("undeclared namespace - must throw exception");
- }
- catch (SAXParseException&)
- {
- }
-}
-
-
-void SAXParserTest::testUndeclaredNoNamespace()
-{
- SAXParser parser;
- parser.setFeature(XMLReader::FEATURE_NAMESPACES, false);
- std::string xml = parse(parser, XMLWriter::CANONICAL, UNDECLARED_NAMESPACE);
- assert (xml == UNDECLARED_NAMESPACE);
-}
-
-
-void SAXParserTest::testRSS()
-{
- SAXParser parser;
- WhitespaceFilter filter(&parser);
- TestEntityResolver resolver;
- filter.setEntityResolver(&resolver);
- parser.setFeature(XMLReader::FEATURE_EXTERNAL_GENERAL_ENTITIES, true);
- parser.setFeature(XMLReader::FEATURE_EXTERNAL_PARAMETER_ENTITIES, true);
-
- std::istringstream istr(RSS);
- Poco::FileOutputStream ostr("rss.xml");
- XMLWriter writer(ostr, XMLWriter::CANONICAL | XMLWriter::PRETTY_PRINT);
- filter.setContentHandler(&writer);
- filter.setDTDHandler(&writer);
- filter.setProperty(XMLReader::PROPERTY_LEXICAL_HANDLER, static_cast<Poco::XML::LexicalHandler*>(&writer));
- InputSource source(istr);
- filter.parse(&source);
-}
-
-
-void SAXParserTest::testEncoding()
-{
- SAXParser parser;
- Poco::Latin9Encoding encoding;
- parser.addEncoding("ISO-8859-15", &encoding);
-
- std::istringstream istr(ENCODING);
- std::ostringstream ostr;
- XMLWriter writer(ostr, XMLWriter::WRITE_XML_DECLARATION, "ISO-8859-15", encoding);
- parser.setContentHandler(&writer);
- parser.setDTDHandler(&writer);
- parser.setProperty(XMLReader::PROPERTY_LEXICAL_HANDLER, static_cast<Poco::XML::LexicalHandler*>(&writer));
- InputSource source(istr);
- parser.parse(&source);
-
- std::string xml = ostr.str();
- assert (xml == ENCODING);
-}
-
-
-void SAXParserTest::testCharacters()
-{
- static const XMLString xml("<textnode> TEXT &amp; AMPERSAND </textnode>");
- SAXParser parser;
- parser.setFeature(XMLReader::FEATURE_NAMESPACES, false);
- std::string result = parse(parser, XMLWriter::CANONICAL, xml);
- assert (result == xml);
-}
-
-
-void SAXParserTest::testParseMemory()
-{
- SAXParser parser;
- std::string xml = parseMemory(parser, XMLWriter::CANONICAL, ATTRIBUTES);
- assert (xml == ATTRIBUTES);
-}
-
-
-void SAXParserTest::setUp()
-{
-}
-
-
-void SAXParserTest::tearDown()
-{
-}
-
-
-std::string SAXParserTest::parse(XMLReader& reader, int options, const std::string& data)
-{
- std::istringstream istr(data);
- std::ostringstream ostr;
- XMLWriter writer(ostr, options);
- reader.setContentHandler(&writer);
- reader.setDTDHandler(&writer);
- reader.setProperty(XMLReader::PROPERTY_LEXICAL_HANDLER, static_cast<Poco::XML::LexicalHandler*>(&writer));
- InputSource source(istr);
- reader.parse(&source);
- return ostr.str();
-}
-
-
-std::string SAXParserTest::parseMemory(XMLReader& reader, int options, const std::string& data)
-{
- std::istringstream istr(data);
- std::ostringstream ostr;
- XMLWriter writer(ostr, options);
- reader.setContentHandler(&writer);
- reader.setDTDHandler(&writer);
- reader.setProperty(XMLReader::PROPERTY_LEXICAL_HANDLER, static_cast<Poco::XML::LexicalHandler*>(&writer));
- reader.parseMemoryNP(data.data(), data.size());
- return ostr.str();
-}
-
-
-CppUnit::Test* SAXParserTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SAXParserTest");
-
- CppUnit_addTest(pSuite, SAXParserTest, testSimple1);
- CppUnit_addTest(pSuite, SAXParserTest, testSimple2);
- CppUnit_addTest(pSuite, SAXParserTest, testAttributes);
- CppUnit_addTest(pSuite, SAXParserTest, testCDATA);
- CppUnit_addTest(pSuite, SAXParserTest, testComment);
- CppUnit_addTest(pSuite, SAXParserTest, testPI);
- CppUnit_addTest(pSuite, SAXParserTest, testDTD);
- CppUnit_addTest(pSuite, SAXParserTest, testInternalEntity);
- CppUnit_addTest(pSuite, SAXParserTest, testNotation);
- CppUnit_addTest(pSuite, SAXParserTest, testExternalUnparsed);
- CppUnit_addTest(pSuite, SAXParserTest, testExternalParsed);
- CppUnit_addTest(pSuite, SAXParserTest, testDefaultNamespace);
- CppUnit_addTest(pSuite, SAXParserTest, testNamespaces);
- CppUnit_addTest(pSuite, SAXParserTest, testNamespacesNoPrefixes);
- CppUnit_addTest(pSuite, SAXParserTest, testNoNamespaces);
- CppUnit_addTest(pSuite, SAXParserTest, testUndeclaredNamespace);
- CppUnit_addTest(pSuite, SAXParserTest, testUndeclaredNamespaceNoPrefixes);
- CppUnit_addTest(pSuite, SAXParserTest, testUndeclaredNoNamespace);
- CppUnit_addTest(pSuite, SAXParserTest, testRSS);
- CppUnit_addTest(pSuite, SAXParserTest, testEncoding);
- CppUnit_addTest(pSuite, SAXParserTest, testParseMemory);
- CppUnit_addTest(pSuite, SAXParserTest, testCharacters);
-
- return pSuite;
-}
-
-
-const std::string SAXParserTest::SIMPLE1 =
- "<foo/>\n";
-
-
-const std::string SAXParserTest::SIMPLE2 =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<foo/>\n";
-
-
-const std::string SAXParserTest::ATTRIBUTES =
- "<root a1=\"v1\">\n"
- "\t<elem a1=\"v1\" a2=\"v2\"/>\n"
- "</root>";
-
-
-const std::string SAXParserTest::CDATA =
- "<data>\n"
- "<![CDATA[\n"
- "\tThe following <tag attr=\"value\">is inside a CDATA section</tag>.\n"
- "]]>\n"
- "</data>";
-
-
-const std::string SAXParserTest::COMMENT =
- "<!--this is a comment-->"
- "<root>\n"
- "\t<!--another comment-->\n"
- "\t<elem/>\n"
- "</root>";
-
-
-const std::string SAXParserTest::PROCESSING_INSTRUCTION =
- "<html>\n"
- "\t<head>\n"
- "\t\t<?xml-stylesheet href=\"style.css\" type=\"text/css\"?>\n"
- "\t\t<title>test</title>\n"
- "\t</head>\n"
- "\t<body>\n"
- "\t\t<p>this is a test</p>\n"
- "\t</body>\n"
- "</html>";
-
-
-const std::string SAXParserTest::DTD =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE test SYSTEM \"test.dtd\">\n"
- "<foo/>";
-
-
-const std::string SAXParserTest::INTERNAL_ENTITY =
- "<!DOCTYPE sample [\n"
- "\t<!ENTITY appinf \"Applied Informatics\">\n"
- "]>\n"
- "<root>\n"
- "\t<company>&appinf;</company>\n"
- "</root>";
-
-
-const std::string SAXParserTest::NOTATION =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE test [\n"
- "\t<!NOTATION mov SYSTEM \"quicktime\">\n"
- "\t<!NOTATION xml PUBLIC \"-//W3C//NOTATION XML 1.0//EN\">\n"
- "]>\n"
- "<foo/>";
-
-
-const std::string SAXParserTest::EXTERNAL_UNPARSED =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE test [\n"
- "\t<!NOTATION mov SYSTEM \"quicktime\">\n"
- "\t<!ENTITY movie SYSTEM \"movie.mov\" NDATA mov>\n"
- "]>\n"
- "<sample/>";
-
-
-const std::string SAXParserTest::EXTERNAL_PARSED =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE test [\n"
- "\t<!ENTITY include SYSTEM \"include.xml\">\n"
- "]>\n"
- "<sample>\n"
- "\t&include;\n"
- "</sample>\n";
-
-
-const std::string SAXParserTest::INCLUDE =
- "<elem>\n"
- "\tAn external entity.\n"
- "</elem>\n";
-
-
-const std::string SAXParserTest::DEFAULT_NAMESPACE =
- "<root xmlns=\"urn:ns1\">\n"
- "\t<elem>data</elem>\n"
- "</root>";
-
-
-const std::string SAXParserTest::NAMESPACES =
- "<ns1:root xmlns:ns1=\"urn:ns1\" xmlns:ns2=\"urn:ns2\">\n"
- "\t<ns2:elem>data</ns2:elem>\n"
- "\t<ns3:elem a1=\"v1\" ns2:a2=\"v2\" xmlns:ns3=\"urn:ns3\">\n"
- "\t\tmore data\n"
- "\t</ns3:elem>\n"
- "</ns1:root>";
-
-
-const std::string SAXParserTest::UNDECLARED_NAMESPACE =
- "<ns1:root xmlns:ns1=\"urn:ns1\" xmlns:ns2=\"urn:ns2\">\n"
- "\t<ns2:elem>data</ns2:elem>\n"
- "\t<ns3:elem a1=\"v1\" ns2:a2=\"v2\" xmlns:ns3=\"urn:ns3\">\n"
- "\t\tmore data\n"
- "\t</ns3:elem>\n"
- "\t<ns4:elem/>\n"
- "</ns1:root>";
-
-
-const std::string SAXParserTest::XHTML_LATIN1_ENTITIES =
- "<!-- Portions (C) International Organization for Standardization 1986\n"
- " Permission to copy in any form is granted for use with\n"
- " conforming SGML systems and applications as defined in\n"
- " ISO 8879, provided this notice is included in all copies.\n"
- "-->\n"
- "<!-- Character entity set. Typical invocation:\n"
- " <!ENTITY % HTMLlat1 PUBLIC\n"
- " \"-//W3C//ENTITIES Latin 1 for XHTML//EN\"\n"
- " \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">\n"
- " %HTMLlat1;\n"
- "-->\n"
- "\n"
- "<!ENTITY nbsp \"&#160;\"> <!-- no-break space = non-breaking space,\n"
- " U+00A0 ISOnum -->\n"
- "<!ENTITY iexcl \"&#161;\"> <!-- inverted exclamation mark, U+00A1 ISOnum -->\n"
- "<!ENTITY cent \"&#162;\"> <!-- cent sign, U+00A2 ISOnum -->\n"
- "<!ENTITY pound \"&#163;\"> <!-- pound sign, U+00A3 ISOnum -->\n"
- "<!ENTITY curren \"&#164;\"> <!-- currency sign, U+00A4 ISOnum -->\n"
- "<!ENTITY yen \"&#165;\"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->\n"
- "<!ENTITY brvbar \"&#166;\"> <!-- broken bar = broken vertical bar,\n"
- " U+00A6 ISOnum -->\n"
- "<!ENTITY sect \"&#167;\"> <!-- section sign, U+00A7 ISOnum -->\n"
- "<!ENTITY uml \"&#168;\"> <!-- diaeresis = spacing diaeresis,\n"
- " U+00A8 ISOdia -->\n"
- "<!ENTITY copy \"&#169;\"> <!-- copyright sign, U+00A9 ISOnum -->\n"
- "<!ENTITY ordf \"&#170;\"> <!-- feminine ordinal indicator, U+00AA ISOnum -->\n"
- "<!ENTITY laquo \"&#171;\"> <!-- left-pointing double angle quotation mark\n"
- " = left pointing guillemet, U+00AB ISOnum -->\n"
- "<!ENTITY not \"&#172;\"> <!-- not sign = angled dash,\n"
- " U+00AC ISOnum -->\n"
- "<!ENTITY shy \"&#173;\"> <!-- soft hyphen = discretionary hyphen,\n"
- " U+00AD ISOnum -->\n"
- "<!ENTITY reg \"&#174;\"> <!-- registered sign = registered trade mark sign,\n"
- " U+00AE ISOnum -->\n"
- "<!ENTITY macr \"&#175;\"> <!-- macron = spacing macron = overline\n"
- " = APL overbar, U+00AF ISOdia -->\n"
- "<!ENTITY deg \"&#176;\"> <!-- degree sign, U+00B0 ISOnum -->\n"
- "<!ENTITY plusmn \"&#177;\"> <!-- plus-minus sign = plus-or-minus sign,\n"
- " U+00B1 ISOnum -->\n"
- "<!ENTITY sup2 \"&#178;\"> <!-- superscript two = superscript digit two\n"
- " = squared, U+00B2 ISOnum -->\n"
- "<!ENTITY sup3 \"&#179;\"> <!-- superscript three = superscript digit three\n"
- " = cubed, U+00B3 ISOnum -->\n"
- "<!ENTITY acute \"&#180;\"> <!-- acute accent = spacing acute,\n"
- " U+00B4 ISOdia -->\n"
- "<!ENTITY micro \"&#181;\"> <!-- micro sign, U+00B5 ISOnum -->\n"
- "<!ENTITY para \"&#182;\"> <!-- pilcrow sign = paragraph sign,\n"
- " U+00B6 ISOnum -->\n"
- "<!ENTITY middot \"&#183;\"> <!-- middle dot = Georgian comma\n"
- " = Greek middle dot, U+00B7 ISOnum -->\n"
- "<!ENTITY cedil \"&#184;\"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->\n"
- "<!ENTITY sup1 \"&#185;\"> <!-- superscript one = superscript digit one,\n"
- " U+00B9 ISOnum -->\n"
- "<!ENTITY ordm \"&#186;\"> <!-- masculine ordinal indicator,\n"
- " U+00BA ISOnum -->\n"
- "<!ENTITY raquo \"&#187;\"> <!-- right-pointing double angle quotation mark\n"
- " = right pointing guillemet, U+00BB ISOnum -->\n"
- "<!ENTITY frac14 \"&#188;\"> <!-- vulgar fraction one quarter\n"
- " = fraction one quarter, U+00BC ISOnum -->\n"
- "<!ENTITY frac12 \"&#189;\"> <!-- vulgar fraction one half\n"
- " = fraction one half, U+00BD ISOnum -->\n"
- "<!ENTITY frac34 \"&#190;\"> <!-- vulgar fraction three quarters\n"
- " = fraction three quarters, U+00BE ISOnum -->\n"
- "<!ENTITY iquest \"&#191;\"> <!-- inverted question mark\n"
- " = turned question mark, U+00BF ISOnum -->\n"
- "<!ENTITY Agrave \"&#192;\"> <!-- latin capital letter A with grave\n"
- " = latin capital letter A grave,\n"
- " U+00C0 ISOlat1 -->\n"
- "<!ENTITY Aacute \"&#193;\"> <!-- latin capital letter A with acute,\n"
- " U+00C1 ISOlat1 -->\n"
- "<!ENTITY Acirc \"&#194;\"> <!-- latin capital letter A with circumflex,\n"
- " U+00C2 ISOlat1 -->\n"
- "<!ENTITY Atilde \"&#195;\"> <!-- latin capital letter A with tilde,\n"
- " U+00C3 ISOlat1 -->\n"
- "<!ENTITY Auml \"&#196;\"> <!-- latin capital letter A with diaeresis,\n"
- " U+00C4 ISOlat1 -->\n"
- "<!ENTITY Aring \"&#197;\"> <!-- latin capital letter A with ring above\n"
- " = latin capital letter A ring,\n"
- " U+00C5 ISOlat1 -->\n"
- "<!ENTITY AElig \"&#198;\"> <!-- latin capital letter AE\n"
- " = latin capital ligature AE,\n"
- " U+00C6 ISOlat1 -->\n"
- "<!ENTITY Ccedil \"&#199;\"> <!-- latin capital letter C with cedilla,\n"
- " U+00C7 ISOlat1 -->\n"
- "<!ENTITY Egrave \"&#200;\"> <!-- latin capital letter E with grave,\n"
- " U+00C8 ISOlat1 -->\n"
- "<!ENTITY Eacute \"&#201;\"> <!-- latin capital letter E with acute,\n"
- " U+00C9 ISOlat1 -->\n"
- "<!ENTITY Ecirc \"&#202;\"> <!-- latin capital letter E with circumflex,\n"
- " U+00CA ISOlat1 -->\n"
- "<!ENTITY Euml \"&#203;\"> <!-- latin capital letter E with diaeresis,\n"
- " U+00CB ISOlat1 -->\n"
- "<!ENTITY Igrave \"&#204;\"> <!-- latin capital letter I with grave,\n"
- " U+00CC ISOlat1 -->\n"
- "<!ENTITY Iacute \"&#205;\"> <!-- latin capital letter I with acute,\n"
- " U+00CD ISOlat1 -->\n"
- "<!ENTITY Icirc \"&#206;\"> <!-- latin capital letter I with circumflex,\n"
- " U+00CE ISOlat1 -->\n"
- "<!ENTITY Iuml \"&#207;\"> <!-- latin capital letter I with diaeresis,\n"
- " U+00CF ISOlat1 -->\n"
- "<!ENTITY ETH \"&#208;\"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->\n"
- "<!ENTITY Ntilde \"&#209;\"> <!-- latin capital letter N with tilde,\n"
- " U+00D1 ISOlat1 -->\n"
- "<!ENTITY Ograve \"&#210;\"> <!-- latin capital letter O with grave,\n"
- " U+00D2 ISOlat1 -->\n"
- "<!ENTITY Oacute \"&#211;\"> <!-- latin capital letter O with acute,\n"
- " U+00D3 ISOlat1 -->\n"
- "<!ENTITY Ocirc \"&#212;\"> <!-- latin capital letter O with circumflex,\n"
- " U+00D4 ISOlat1 -->\n"
- "<!ENTITY Otilde \"&#213;\"> <!-- latin capital letter O with tilde,\n"
- " U+00D5 ISOlat1 -->\n"
- "<!ENTITY Ouml \"&#214;\"> <!-- latin capital letter O with diaeresis,\n"
- " U+00D6 ISOlat1 -->\n"
- "<!ENTITY times \"&#215;\"> <!-- multiplication sign, U+00D7 ISOnum -->\n"
- "<!ENTITY Oslash \"&#216;\"> <!-- latin capital letter O with stroke\n"
- " = latin capital letter O slash,\n"
- " U+00D8 ISOlat1 -->\n"
- "<!ENTITY Ugrave \"&#217;\"> <!-- latin capital letter U with grave,\n"
- " U+00D9 ISOlat1 -->\n"
- "<!ENTITY Uacute \"&#218;\"> <!-- latin capital letter U with acute,\n"
- " U+00DA ISOlat1 -->\n"
- "<!ENTITY Ucirc \"&#219;\"> <!-- latin capital letter U with circumflex,\n"
- " U+00DB ISOlat1 -->\n"
- "<!ENTITY Uuml \"&#220;\"> <!-- latin capital letter U with diaeresis,\n"
- " U+00DC ISOlat1 -->\n"
- "<!ENTITY Yacute \"&#221;\"> <!-- latin capital letter Y with acute,\n"
- " U+00DD ISOlat1 -->\n"
- "<!ENTITY THORN \"&#222;\"> <!-- latin capital letter THORN,\n"
- " U+00DE ISOlat1 -->\n"
- "<!ENTITY szlig \"&#223;\"> <!-- latin small letter sharp s = ess-zed,\n"
- " U+00DF ISOlat1 -->\n"
- "<!ENTITY agrave \"&#224;\"> <!-- latin small letter a with grave\n"
- " = latin small letter a grave,\n"
- " U+00E0 ISOlat1 -->\n"
- "<!ENTITY aacute \"&#225;\"> <!-- latin small letter a with acute,\n"
- " U+00E1 ISOlat1 -->\n"
- "<!ENTITY acirc \"&#226;\"> <!-- latin small letter a with circumflex,\n"
- " U+00E2 ISOlat1 -->\n"
- "<!ENTITY atilde \"&#227;\"> <!-- latin small letter a with tilde,\n"
- " U+00E3 ISOlat1 -->\n"
- "<!ENTITY auml \"&#228;\"> <!-- latin small letter a with diaeresis,\n"
- " U+00E4 ISOlat1 -->\n"
- "<!ENTITY aring \"&#229;\"> <!-- latin small letter a with ring above\n"
- " = latin small letter a ring,\n"
- " U+00E5 ISOlat1 -->\n"
- "<!ENTITY aelig \"&#230;\"> <!-- latin small letter ae\n"
- " = latin small ligature ae, U+00E6 ISOlat1 -->\n"
- "<!ENTITY ccedil \"&#231;\"> <!-- latin small letter c with cedilla,\n"
- " U+00E7 ISOlat1 -->\n"
- "<!ENTITY egrave \"&#232;\"> <!-- latin small letter e with grave,\n"
- " U+00E8 ISOlat1 -->\n"
- "<!ENTITY eacute \"&#233;\"> <!-- latin small letter e with acute,\n"
- " U+00E9 ISOlat1 -->\n"
- "<!ENTITY ecirc \"&#234;\"> <!-- latin small letter e with circumflex,\n"
- " U+00EA ISOlat1 -->\n"
- "<!ENTITY euml \"&#235;\"> <!-- latin small letter e with diaeresis,\n"
- " U+00EB ISOlat1 -->\n"
- "<!ENTITY igrave \"&#236;\"> <!-- latin small letter i with grave,\n"
- " U+00EC ISOlat1 -->\n"
- "<!ENTITY iacute \"&#237;\"> <!-- latin small letter i with acute,\n"
- " U+00ED ISOlat1 -->\n"
- "<!ENTITY icirc \"&#238;\"> <!-- latin small letter i with circumflex,\n"
- " U+00EE ISOlat1 -->\n"
- "<!ENTITY iuml \"&#239;\"> <!-- latin small letter i with diaeresis,\n"
- " U+00EF ISOlat1 -->\n"
- "<!ENTITY eth \"&#240;\"> <!-- latin small letter eth, U+00F0 ISOlat1 -->\n"
- "<!ENTITY ntilde \"&#241;\"> <!-- latin small letter n with tilde,\n"
- " U+00F1 ISOlat1 -->\n"
- "<!ENTITY ograve \"&#242;\"> <!-- latin small letter o with grave,\n"
- " U+00F2 ISOlat1 -->\n"
- "<!ENTITY oacute \"&#243;\"> <!-- latin small letter o with acute,\n"
- " U+00F3 ISOlat1 -->\n"
- "<!ENTITY ocirc \"&#244;\"> <!-- latin small letter o with circumflex,\n"
- " U+00F4 ISOlat1 -->\n"
- "<!ENTITY otilde \"&#245;\"> <!-- latin small letter o with tilde,\n"
- " U+00F5 ISOlat1 -->\n"
- "<!ENTITY ouml \"&#246;\"> <!-- latin small letter o with diaeresis,\n"
- " U+00F6 ISOlat1 -->\n"
- "<!ENTITY divide \"&#247;\"> <!-- division sign, U+00F7 ISOnum -->\n"
- "<!ENTITY oslash \"&#248;\"> <!-- latin small letter o with stroke,\n"
- " = latin small letter o slash,\n"
- " U+00F8 ISOlat1 -->\n"
- "<!ENTITY ugrave \"&#249;\"> <!-- latin small letter u with grave,\n"
- " U+00F9 ISOlat1 -->\n"
- "<!ENTITY uacute \"&#250;\"> <!-- latin small letter u with acute,\n"
- " U+00FA ISOlat1 -->\n"
- "<!ENTITY ucirc \"&#251;\"> <!-- latin small letter u with circumflex,\n"
- " U+00FB ISOlat1 -->\n"
- "<!ENTITY uuml \"&#252;\"> <!-- latin small letter u with diaeresis,\n"
- " U+00FC ISOlat1 -->\n"
- "<!ENTITY yacute \"&#253;\"> <!-- latin small letter y with acute,\n"
- " U+00FD ISOlat1 -->\n"
- "<!ENTITY thorn \"&#254;\"> <!-- latin small letter thorn,\n"
- " U+00FE ISOlat1 -->\n"
- "<!ENTITY yuml \"&#255;\"> <!-- latin small letter y with diaeresis,\n"
- " U+00FF ISOlat1 -->\n";
-
-const std::string SAXParserTest::RSS =
- "<?xml version=\"1.0\"?>\n"
- "\n"
- "<!DOCTYPE rdf:RDF [\n"
- "<!ENTITY % HTMLlat1 PUBLIC\n"
- " \"-//W3C//ENTITIES Latin 1 for XHTML//EN\"\n"
- " \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">\n"
- "%HTMLlat1;\n"
- "]>\n"
- "\n"
- "<rdf:RDF \n"
- " xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" \n"
- " xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n"
- " xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n"
- " xmlns=\"http://purl.org/rss/1.0/\"\n"
- "> \n"
- "\n"
- " <channel rdf:about=\"http://meerkat.oreillynet.com/\">\n"
- " <title>XML.com</title> \n"
- " <link>http://www.xml.com/</link>\n"
- " <description>XML.com features a rich mix of information and services for the XML community.</description>\n"
- " <sy:updatePeriod>hourly</sy:updatePeriod>\n"
- " <sy:updateFrequency>2</sy:updateFrequency>\n"
- " <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>\n"
- "\n"
- " <image rdf:resource=\"http://meerkat.oreillynet.com/icons/meerkat-powered.jpg\" />\n"
- "\n"
- " <items>\n"
- " <rdf:Seq>\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/02/09/xforms.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/02/09/cssorxsl.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/02/09/xml-http-request.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/02/02/xpath2.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/02/02/silent.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/02/02/xpath2.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/02/02/tmapi.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/01/26/formtax.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/01/26/hacking-ooo.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/01/26/simile.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/01/19/amara.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/01/19/print.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/01/19/review.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/01/12/saml2.html\" />\n"
- " <rdf:li rdf:resource=\"http://www.xml.com/pub/a/2005/01/12/comega.html\" />\n"
- " </rdf:Seq>\n"
- " </items>\n"
- " \n"
- " <textinput rdf:resource=\"http://meerkat.oreillynet.com/\" />\n"
- "\n"
- " </channel>\n"
- "\n"
- " <image rdf:about=\"http://meerkat.oreillynet.com/icons/meerkat-powered.jpg\">\n"
- " <title>Meerkat Powered!</title>\n"
- " <url>http://meerkat.oreillynet.com/icons/meerkat-powered.jpg</url>\n"
- " <link>http://meerkat.oreillynet.com</link>\n"
- " </image>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/02/09/xforms.html\">\n"
- " <title>Features: Top 10 XForms Engines</title>\n"
- " <link>http://www.xml.com/pub/a/2005/02/09/xforms.html</link>\n"
- " <description>\n"
- " Micah Dubinko, one of the gurus of XForms, offers a rundown on the state of XForms engines for 2005.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Micah Dubinko</dc:creator>\n"
- " <dc:subject>Web, Applications</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-02-09</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/02/09/cssorxsl.html\">\n"
- " <title>Features: Comparing CSS and XSL: A Reply from Norm Walsh</title>\n"
- " <link>http://www.xml.com/pub/a/2005/02/09/cssorxsl.html</link>\n"
- " <description>\n"
- " Norm Walsh responds to a recent article about CSS and XSL, explaining how and when and why you'd want to use XSLFO or CSS or XSLT.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Norman Walsh</dc:creator>\n"
- " <dc:subject>Style</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-02-09</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/02/09/xml-http-request.html\">\n"
- " <title>Features: Very Dynamic Web Interfaces</title>\n"
- " <link>http://www.xml.com/pub/a/2005/02/09/xml-http-request.html</link>\n"
- " <description>\n"
- " Drew McLellan explains how to use XMLHTTPRequest and Javascript to create web applications with very dynamic, smooth interfaces.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Drew McLellan</dc:creator>\n"
- " <dc:subject>Web Development, Instruction</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-02-09</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/02/02/xpath2.html\">\n"
- " <title>Transforming XML: The XPath 2.0 Data Model</title>\n"
- " <link>http://www.xml.com/pub/a/2005/02/02/xpath2.html</link>\n"
- " <description>\n"
- " Bob DuCharme, in his latest Transforming XML column, examines the XPath 2.0, hence the XSLT 2.0, data model.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Bob DuCharme</dc:creator>\n"
- " <dc:subject>Style, Style</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-02-02</dc:date>\n"
- " <dc:type>Transforming XML</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/02/02/silent.html\">\n"
- " <title>XML Tourist: The Silent Soundtrack</title>\n"
- " <link>http://www.xml.com/pub/a/2005/02/02/silent.html</link>\n"
- " <description>\n"
- " In this installation of XML Tourist, John E. Simpson presents an overview of the types of sound-to-text captioning available. Pinpointing closed captioning as the most suitable for use with computerized multimedia, he then explains how XML-based solutions address synchronization issues.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>John E. Simpson</dc:creator>\n"
- " <dc:subject>Graphics, Vertical Industries</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-02-02</dc:date>\n"
- " <dc:type>XML Tourist</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/02/02/xpath2.html\">\n"
- " <title>Transforming XML: The XML 2.0 Data Model</title>\n"
- " <link>http://www.xml.com/pub/a/2005/02/02/xpath2.html</link>\n"
- " <description>\n"
- " Bob DuCharme, in his latest Transforming XML column, examines the XPath 2.0, hence the XSLT 2.0, data model.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Bob DuCharme</dc:creator>\n"
- " <dc:subject>Style, Style</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-02-02</dc:date>\n"
- " <dc:type>Transforming XML</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/02/02/tmapi.html\">\n"
- " <title>Features: An Introduction to TMAPI</title>\n"
- " <link>http://www.xml.com/pub/a/2005/02/02/tmapi.html</link>\n"
- " <description>\n"
- " TMAPI, a Java Topic Map API, is the standard way to interact with XML Topic Maps programmatically from Java. This article provides a tutorial for TMAPI. \n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Robert Barta, Oliver Leimig</dc:creator>\n"
- " <dc:subject>Metadata, Metadata</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-02-02</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/01/26/formtax.html\">\n"
- " <title>Features: Formal Taxonomies for the U.S. Government</title>\n"
- " <link>http://www.xml.com/pub/a/2005/01/26/formtax.html</link>\n"
- " <description>\n"
- " Mike Daconta, Metadata Program Manager at the Department of Homeland Security, introduces the notion of a formal taxonomy in the context of the Federal Enteriprise Architecture's Data Reference Model.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Michael Daconta</dc:creator>\n"
- " <dc:subject>Metadata, Metadata</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-01-26</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/01/26/hacking-ooo.html\">\n"
- " <title>Features: Hacking Open Office</title>\n"
- " <link>http://www.xml.com/pub/a/2005/01/26/hacking-ooo.html</link>\n"
- " <description>\n"
- " Peter Sefton shows us how to use XML tools to hack Open Office file formats.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Peter Sefton</dc:creator>\n"
- " <dc:subject>Programming, Tools, Publishing</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-01-26</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/01/26/simile.html\">\n"
- " <title>Features: SIMILE: Practical Metadata for the Semantic Web</title>\n"
- " <link>http://www.xml.com/pub/a/2005/01/26/simile.html</link>\n"
- " <description>\n"
- " Digital libraries and generic metadata form part of the background assumptions and forward-looking goals of the Semantic Web. SIMILE is an interesting project aimed at realizing some of those goals.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Stephen Garland, Ryan Lee, Stefano Mazzocchi</dc:creator>\n"
- " <dc:subject>Semantic Web, Metadata</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-01-26</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/01/19/amara.html\">\n"
- " <title>Python and XML: Introducing the Amara XML Toolkit</title>\n"
- " <link>http://www.xml.com/pub/a/2005/01/19/amara.html</link>\n"
- " <description>\n"
- " Uche Ogbuji introduces Amara, his new collection of XML tools for Python.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Uche Ogbuji</dc:creator>\n"
- " <dc:subject>Programming, Programming</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-01-19</dc:date>\n"
- " <dc:type>Python and XML</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/01/19/print.html\">\n"
- " <title>Features: Printing XML: Why CSS Is Better than XSL</title>\n"
- " <link>http://www.xml.com/pub/a/2005/01/19/print.html</link>\n"
- " <description>\n"
- " One of the old school debates among XML developers is &amp;quot;CSS versus XSLT.&amp;quot; H&amp;aring;kun Wium Lie and Michael Day revive that debate with a shot across XSL's bow.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Michael Day, H&amp;aring;kon Wium Lie</dc:creator>\n"
- " <dc:subject>Style, Publishing</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-01-19</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/01/19/review.html\">\n"
- " <title>Features: Reviewing the Architecture of the World Wide Web</title>\n"
- " <link>http://www.xml.com/pub/a/2005/01/19/review.html</link>\n"
- " <description>\n"
- " Harry Halpin reviews the final published edition of the W3C TAG's Architecture of the World Wide Web document.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Harry Halpin</dc:creator>\n"
- " <dc:subject>Web, Perspectives</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-01-19</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/01/12/saml2.html\">\n"
- " <title>Features: SAML 2: The Building Blocks of Federated Identity</title>\n"
- " <link>http://www.xml.com/pub/a/2005/01/12/saml2.html</link>\n"
- " <description>\n"
- " Paul Madsen reports on the developments in web services security, including a new major release of SAML, which provides the basis for building federated identity.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Paul Madsen</dc:creator>\n"
- " <dc:subject>Web Services, Specifications</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-01-12</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- " <item rdf:about=\"http://www.xml.com/pub/a/2005/01/12/comega.html\">\n"
- " <title>Features: Introducing Comega</title>\n"
- " <link>http://www.xml.com/pub/a/2005/01/12/comega.html</link>\n"
- " <description>\n"
- " Dare Obasanjo explains some of the ways in which C&amp;omega;--a new language from Microsoft Research--makes XML processing easier and more natural.\n"
- " </description>\n"
- " <dc:source>XML.com</dc:source>\n"
- " <dc:creator>Dare Obasanjo</dc:creator>\n"
- " <dc:subject>Programming, Instruction</dc:subject>\n"
- " <dc:publisher>O'Reilly Media, Inc.</dc:publisher>\n"
- " <dc:date>2005-01-12</dc:date>\n"
- " <dc:type>Features</dc:type>\n"
- " <dc:format>text/html</dc:format>\n"
- " <dc:language>en-us</dc:language>\n"
- " <dc:rights>Copyright 2005, O'Reilly Media, Inc.</dc:rights>\n"
- " </item>\n"
- "\n"
- "\n"
- " <textinput rdf:about=\"http://meerkat.oreillynet.com/\">\n"
- " <title>Search</title>\n"
- " <description>Search Meerkat...</description>\n"
- " <name>s</name>\n"
- " <link>http://meerkat.oreillynet.com/</link>\n"
- " </textinput>\n"
- "\n"
- "</rdf:RDF>\n";
-
-
-const std::string SAXParserTest::ENCODING =
- "<?xml version=\"1.0\" encoding=\"ISO-8859-15\"?>"
- "<euro-sign>\244</euro-sign>";
diff --git a/Utilities/Poco/XML/testsuite/src/SAXParserTest.h b/Utilities/Poco/XML/testsuite/src/SAXParserTest.h
deleted file mode 100755
index 8c1c277280..0000000000
--- a/Utilities/Poco/XML/testsuite/src/SAXParserTest.h
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// SAXParserTest.h
-//
-// $Id$
-//
-// Definition of the SAXParserTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAXParserTest_INCLUDED
-#define SAXParserTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-#include "Poco/SAX/XMLReader.h"
-
-
-class SAXParserTest: public CppUnit::TestCase
-{
-public:
- SAXParserTest(const std::string& name);
- ~SAXParserTest();
-
- void testSimple1();
- void testSimple2();
- void testAttributes();
- void testCDATA();
- void testComment();
- void testPI();
- void testDTD();
- void testInternalEntity();
- void testNotation();
- void testExternalUnparsed();
- void testExternalParsed();
- void testDefaultNamespace();
- void testNamespaces();
- void testNamespacesNoPrefixes();
- void testNoNamespaces();
- void testUndeclaredNamespace();
- void testUndeclaredNamespaceNoPrefixes();
- void testUndeclaredNoNamespace();
- void testRSS();
- void testEncoding();
- void testParseMemory();
- void testCharacters();
-
- void setUp();
- void tearDown();
-
- std::string parse(Poco::XML::XMLReader& reader, int options, const std::string& data);
- std::string parseMemory(Poco::XML::XMLReader& reader, int options, const std::string& data);
-
- static CppUnit::Test* suite();
-
- static const std::string SIMPLE1;
- static const std::string SIMPLE2;
- static const std::string ATTRIBUTES;
- static const std::string CDATA;
- static const std::string COMMENT;
- static const std::string PROCESSING_INSTRUCTION;
- static const std::string DTD;
- static const std::string INTERNAL_ENTITY;
- static const std::string NOTATION;
- static const std::string EXTERNAL_UNPARSED;
- static const std::string EXTERNAL_PARSED;
- static const std::string INCLUDE;
- static const std::string DEFAULT_NAMESPACE;
- static const std::string NAMESPACES;
- static const std::string UNDECLARED_NAMESPACE;
- static const std::string XHTML_LATIN1_ENTITIES;
- static const std::string RSS;
- static const std::string ENCODING;
-};
-
-
-#endif // SAXParserTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/SAXTestSuite.cpp b/Utilities/Poco/XML/testsuite/src/SAXTestSuite.cpp
deleted file mode 100755
index 1d9c046919..0000000000
--- a/Utilities/Poco/XML/testsuite/src/SAXTestSuite.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// SAXTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "SAXTestSuite.h"
-#include "AttributesImplTest.h"
-#include "NamespaceSupportTest.h"
-#include "SAXParserTest.h"
-
-
-CppUnit::Test* SAXTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SAXTestSuite");
-
- pSuite->addTest(AttributesImplTest::suite());
- pSuite->addTest(NamespaceSupportTest::suite());
- pSuite->addTest(SAXParserTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/SAXTestSuite.h b/Utilities/Poco/XML/testsuite/src/SAXTestSuite.h
deleted file mode 100755
index 9f91858b49..0000000000
--- a/Utilities/Poco/XML/testsuite/src/SAXTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// SAXTestSuite.h
-//
-// $Id$
-//
-// Definition of the SAXTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef SAXTestSuite_INCLUDED
-#define SAXTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class SAXTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // SAXTestSuite_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/TextTest.cpp b/Utilities/Poco/XML/testsuite/src/TextTest.cpp
deleted file mode 100755
index 11f2a4e598..0000000000
--- a/Utilities/Poco/XML/testsuite/src/TextTest.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-//
-// TextTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TextTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/DOM/CDATASection.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-using Poco::XML::Text;
-using Poco::XML::CDATASection;
-using Poco::XML::Element;
-using Poco::XML::Document;
-using Poco::XML::AutoPtr;
-using Poco::XML::XMLString;
-
-
-TextTest::TextTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TextTest::~TextTest()
-{
-}
-
-
-void TextTest::testLength()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Text> pText1 = pDoc->createTextNode("");
- assert (pText1->length() == 0);
- AutoPtr<Text> pText2 = pDoc->createTextNode("foo bar");
- assert (pText2->length() == 7);
-}
-
-
-void TextTest::testSubstring()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Text> pText1 = pDoc->createTextNode("foo bar");
- XMLString str = pText1->substringData(0, 3);
- assert (str == "foo");
- str = pText1->substringData(4, 3);
- assert (str == "bar");
- str = pText1->substringData(3, 0);
- assert (str == "");
-}
-
-
-void TextTest::testAppend()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Text> pText1 = pDoc->createTextNode("foo");
- pText1->appendData("bar");
- assert (pText1->data() == "foobar");
-}
-
-
-void TextTest::testInsert()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Text> pText1 = pDoc->createTextNode("bar");
- pText1->insertData(0, "foo");
- assert (pText1->data() == "foobar");
- pText1->insertData(pText1->length(), "!");
- assert (pText1->data() == "foobar!");
- pText1->insertData(3, " ");
- assert (pText1->data() == "foo bar!");
-}
-
-
-void TextTest::testDelete()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Text> pText1 = pDoc->createTextNode("foo bar");
- pText1->deleteData(3, 1);
- assert (pText1->data() == "foobar");
- pText1->deleteData(0, 3);
- assert (pText1->data() == "bar");
- pText1->deleteData(1, 0);
- assert (pText1->data() == "bar");
- pText1->deleteData(0, pText1->length());
- assert (pText1->data() == "");
-}
-
-
-void TextTest::testReplace()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Text> pText1 = pDoc->createTextNode("foo bar");
- pText1->replaceData(0, 3, "FOO");
- assert (pText1->data() == "FOO bar");
- pText1->replaceData(4, 3, "BAR!!!");
- assert (pText1->data() == "FOO BAR!!!");
- pText1->replaceData(3, 1, "-");
- assert (pText1->data() == "FOO-BAR!!!");
- pText1->replaceData(3, 1, "---");
- assert (pText1->data() == "FOO---BAR!!!");
- pText1->replaceData(3, 3, " ");
- assert (pText1->data() == "FOO BAR!!!");
- pText1->replaceData(0, pText1->length(), "foo bar");
- assert (pText1->data() == "foo bar");
-}
-
-
-void TextTest::testSplit()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pElem = pDoc->createElement("elem");
- AutoPtr<Text> pText1 = pDoc->createCDATASection("foobar");
- pElem->appendChild(pText1);
- pText1->splitText(3);
- assert (pElem->firstChild()->nodeValue() == "foo");
- assert (pElem->lastChild()->nodeValue() == "bar");
-}
-
-
-void TextTest::testSplitCDATA()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pElem = pDoc->createElement("elem");
- AutoPtr<Text> pText1 = pDoc->createTextNode("foobar");
- pElem->appendChild(pText1);
- pText1->splitText(3);
- assert (pElem->firstChild()->nodeValue() == "foo");
- assert (pElem->lastChild()->nodeValue() == "bar");
-
-}
-
-
-void TextTest::setUp()
-{
-}
-
-
-void TextTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TextTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TextTest");
-
- CppUnit_addTest(pSuite, TextTest, testLength);
- CppUnit_addTest(pSuite, TextTest, testSubstring);
- CppUnit_addTest(pSuite, TextTest, testAppend);
- CppUnit_addTest(pSuite, TextTest, testInsert);
- CppUnit_addTest(pSuite, TextTest, testDelete);
- CppUnit_addTest(pSuite, TextTest, testReplace);
- CppUnit_addTest(pSuite, TextTest, testSplit);
- CppUnit_addTest(pSuite, TextTest, testSplitCDATA);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/TextTest.h b/Utilities/Poco/XML/testsuite/src/TextTest.h
deleted file mode 100755
index c30564089f..0000000000
--- a/Utilities/Poco/XML/testsuite/src/TextTest.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// TextTest.h
-//
-// $Id$
-//
-// Definition of the TextTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TextTest_INCLUDED
-#define TextTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class TextTest: public CppUnit::TestCase
-{
-public:
- TextTest(const std::string& name);
- ~TextTest();
-
- void testLength();
- void testSubstring();
- void testAppend();
- void testInsert();
- void testDelete();
- void testReplace();
- void testSplit();
- void testSplitCDATA();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TextTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/TreeWalkerTest.cpp b/Utilities/Poco/XML/testsuite/src/TreeWalkerTest.cpp
deleted file mode 100755
index 8b00fa414a..0000000000
--- a/Utilities/Poco/XML/testsuite/src/TreeWalkerTest.cpp
+++ /dev/null
@@ -1,329 +0,0 @@
-//
-// TreeWalkerTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "TreeWalkerTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/DOM/TreeWalker.h"
-#include "Poco/DOM/NodeFilter.h"
-#include "Poco/DOM/Document.h"
-#include "Poco/DOM/Element.h"
-#include "Poco/DOM/Text.h"
-#include "Poco/DOM/AutoPtr.h"
-
-
-using Poco::XML::TreeWalker;
-using Poco::XML::NodeFilter;
-using Poco::XML::Element;
-using Poco::XML::Document;
-using Poco::XML::Text;
-using Poco::XML::Node;
-using Poco::XML::AutoPtr;
-using Poco::XML::XMLString;
-
-
-namespace
-{
- class RejectNodeFilter: public NodeFilter
- {
- short acceptNode(Node* node)
- {
- if (node->nodeType() != Node::ELEMENT_NODE || node->innerText() == "text1" || node->nodeName() == "root")
- return NodeFilter::FILTER_ACCEPT;
- else
- return NodeFilter::FILTER_REJECT;
- }
- };
-
- class SkipNodeFilter: public NodeFilter
- {
- short acceptNode(Node* node)
- {
- if (node->nodeType() != Node::ELEMENT_NODE || node->innerText() == "text1")
- return NodeFilter::FILTER_ACCEPT;
- else
- return NodeFilter::FILTER_SKIP;
- }
- };
-}
-
-
-TreeWalkerTest::TreeWalkerTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-TreeWalkerTest::~TreeWalkerTest()
-{
-}
-
-
-void TreeWalkerTest::testShowAll()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text1");
- AutoPtr<Text> pText2 = pDoc->createTextNode("text2");
-
- pElem1->appendChild(pText1);
- pElem2->appendChild(pText2);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem2);
- pDoc->appendChild(pRoot);
-
- TreeWalker it(pRoot, NodeFilter::SHOW_ALL);
-
- assert (it.currentNode() == pRoot);
- assert (it.nextNode() == pElem1);
- assert (it.nextNode() == pText1);
- assert (it.nextNode() == pElem2);
- assert (it.nextNode() == pText2);
- assert (it.nextNode() == 0);
-
- assert (it.currentNode() == pText2);
- assert (it.previousNode() == pElem2);
- assert (it.previousNode() == pText1);
- assert (it.previousNode() == pElem1);
- assert (it.previousNode() == pRoot);
- assert (it.previousNode() == 0);
-
- assert (it.currentNode() == pRoot);
- assert (it.parentNode() == 0);
- assert (it.currentNode() == pRoot);
- assert (it.firstChild() == pElem1);
- assert (it.parentNode() == pRoot);
- assert (it.lastChild() == pElem2);
- assert (it.previousSibling() == pElem1);
- assert (it.previousSibling() == 0);
- assert (it.currentNode() == pElem1);
- assert (it.nextSibling() == pElem2);
- assert (it.nextSibling() == 0);
- assert (it.currentNode() == pElem2);
- assert (it.firstChild() == pText2);
- assert (it.nextSibling() == 0);
- assert (it.previousSibling() == 0);
- assert (it.parentNode() == pElem2);
- assert (it.lastChild() == pText2);
-}
-
-
-void TreeWalkerTest::testShowElements()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text1");
- AutoPtr<Text> pText2 = pDoc->createTextNode("text2");
-
- pElem1->appendChild(pText1);
- pElem2->appendChild(pText2);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem2);
- pDoc->appendChild(pRoot);
-
- TreeWalker it(pRoot, NodeFilter::SHOW_ELEMENT);
-
- assert (it.currentNode() == pRoot);
- assert (it.nextNode() == pElem1);
- assert (it.nextNode() == pElem2);
- assert (it.nextNode() == 0);
-
- assert (it.currentNode() == pElem2);
- assert (it.previousNode() == pElem1);
- assert (it.previousNode() == pRoot);
- assert (it.previousNode() == 0);
-
- assert (it.currentNode() == pRoot);
- assert (it.parentNode() == 0);
- assert (it.currentNode() == pRoot);
- assert (it.firstChild() == pElem1);
- assert (it.parentNode() == pRoot);
- assert (it.lastChild() == pElem2);
- assert (it.firstChild() == 0);
- assert (it.currentNode() == pElem2);
- assert (it.lastChild() == 0);
- assert (it.currentNode() == pElem2);
- assert (it.previousSibling() == pElem1);
- assert (it.firstChild() == 0);
- assert (it.lastChild() == 0);
- assert (it.parentNode() == pRoot);
-}
-
-
-void TreeWalkerTest::testFilter()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text1");
- AutoPtr<Text> pText2 = pDoc->createTextNode("text2");
-
- pElem1->appendChild(pText1);
- pElem2->appendChild(pText2);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem2);
- pDoc->appendChild(pRoot);
-
- SkipNodeFilter skipFilter;
- TreeWalker it1(pRoot, NodeFilter::SHOW_ELEMENT, &skipFilter);
-
- assert (it1.nextNode() == pElem1);
- assert (it1.nextNode() == 0);
-
- assert (it1.currentNode() == pElem1);
- assert (it1.previousNode() == 0);
-
- assert (it1.parentNode() == 0);
- assert (it1.firstChild() == 0);
- assert (it1.lastChild() == 0);
- assert (it1.nextSibling() == 0);
- assert (it1.previousSibling() == 0);
-
- TreeWalker it2(pRoot, NodeFilter::SHOW_ALL, &skipFilter);
-
- assert (it2.nextNode() == pElem1);
- assert (it2.nextNode() == pText1);
- assert (it2.nextNode() == pText2);
- assert (it2.nextNode() == 0);
-
- assert (it2.currentNode() == pText2);
- assert (it2.previousNode() == pText1);
- assert (it2.previousNode() == pElem1);
- assert (it2.previousNode() == 0);
-
- assert (it2.currentNode() == pElem1);
- assert (it2.parentNode() == 0);
- assert (it2.nextSibling() == 0);
- assert (it2.previousSibling() == 0);
- assert (it2.firstChild() == pText1);
- assert (it2.nextSibling() == 0);
- assert (it2.previousSibling() == 0);
- assert (it2.parentNode() == pElem1);
-
- RejectNodeFilter rejectFilter;
- TreeWalker it3(pRoot, NodeFilter::SHOW_ELEMENT, &rejectFilter);
-
- assert (it3.nextNode() == pElem1);
- assert (it3.nextNode() == 0);
-
- assert (it3.currentNode() == pElem1);
- assert (it3.previousNode() == pRoot);
- assert (it3.previousNode() == 0);
-
- assert (it3.currentNode() == pRoot);
- assert (it3.parentNode() == 0);
- assert (it3.firstChild() == pElem1);
- assert (it3.nextSibling() == 0);
- assert (it3.previousSibling() == 0);
- assert (it3.parentNode() == pRoot);
- assert (it3.lastChild() == pElem1);
-
- TreeWalker it4(pRoot, NodeFilter::SHOW_ALL, &rejectFilter);
-
- assert (it4.nextNode() == pElem1);
- assert (it4.nextNode() == pText1);
- assert (it4.nextNode() == 0);
-
- assert (it4.currentNode() == pText1);
- assert (it4.previousNode() == pElem1);
- assert (it4.previousNode() == pRoot);
- assert (it4.previousNode() == 0);
-
- assert (it4.currentNode() == pRoot);
- assert (it4.parentNode() == 0);
- assert (it4.firstChild() == pElem1);
- assert (it4.firstChild() == pText1);
- assert (it4.nextSibling() == 0);
- assert (it4.previousSibling() == 0);
- assert (it4.parentNode() == pElem1);
- assert (it4.lastChild() == pText1);
- assert (it4.parentNode() == pElem1);
- assert (it4.nextSibling() == 0);
- assert (it4.previousSibling() == 0);
- assert (it4.parentNode() == pRoot);
-}
-
-
-void TreeWalkerTest::testShowNothing()
-{
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pElem1 = pDoc->createElement("elem");
- AutoPtr<Element> pElem2 = pDoc->createElement("elem");
- AutoPtr<Text> pText1 = pDoc->createTextNode("text1");
- AutoPtr<Text> pText2 = pDoc->createTextNode("text2");
-
- pElem1->appendChild(pText1);
- pElem2->appendChild(pText2);
- pRoot->appendChild(pElem1);
- pRoot->appendChild(pElem2);
- pDoc->appendChild(pRoot);
-
- TreeWalker it(pRoot, 0);
-
- assert (it.nextNode() == 0);
-
- assert (it.previousNode() == 0);
-
- assert (it.currentNode() == pRoot);
- assert (it.firstChild() == 0);
- assert (it.lastChild() == 0);
- assert (it.nextSibling() == 0);
- assert (it.previousSibling() == 0);
-}
-
-
-void TreeWalkerTest::setUp()
-{
-}
-
-
-void TreeWalkerTest::tearDown()
-{
-}
-
-
-CppUnit::Test* TreeWalkerTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TreeWalkerTest");
-
- CppUnit_addTest(pSuite, TreeWalkerTest, testShowAll);
- CppUnit_addTest(pSuite, TreeWalkerTest, testShowElements);
- CppUnit_addTest(pSuite, TreeWalkerTest, testFilter);
- CppUnit_addTest(pSuite, TreeWalkerTest, testShowNothing);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/TreeWalkerTest.h b/Utilities/Poco/XML/testsuite/src/TreeWalkerTest.h
deleted file mode 100755
index 87b4028b32..0000000000
--- a/Utilities/Poco/XML/testsuite/src/TreeWalkerTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// TreeWalkerTest.h
-//
-// $Id$
-//
-// Definition of the TreeWalkerTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef TreeWalkerTest_INCLUDED
-#define TreeWalkerTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class TreeWalkerTest: public CppUnit::TestCase
-{
-public:
- TreeWalkerTest(const std::string& name);
- ~TreeWalkerTest();
-
- void testShowAll();
- void testShowElements();
- void testFilter();
- void testShowNothing();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // TreeWalkerTest_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/WinDriver.cpp b/Utilities/Poco/XML/testsuite/src/WinDriver.cpp
deleted file mode 100755
index 0c73c60792..0000000000
--- a/Utilities/Poco/XML/testsuite/src/WinDriver.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// WinDriver.cpp
-//
-// $Id$
-//
-// Windows test driver for Poco XML.
-//
-// Copyright (c) 2004-2006, 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 "WinTestRunner/WinTestRunner.h"
-#include "XMLTestSuite.h"
-
-
-class TestDriver: public CppUnit::WinTestRunnerApp
-{
- void TestMain()
- {
- CppUnit::WinTestRunner runner;
- runner.addTest(XMLTestSuite::suite());
- runner.run();
- }
-};
-
-
-TestDriver theDriver;
diff --git a/Utilities/Poco/XML/testsuite/src/XMLTestSuite.cpp b/Utilities/Poco/XML/testsuite/src/XMLTestSuite.cpp
deleted file mode 100755
index a66cb481f0..0000000000
--- a/Utilities/Poco/XML/testsuite/src/XMLTestSuite.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// XMLTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "XMLTestSuite.h"
-#include "NameTest.h"
-#include "NamePoolTest.h"
-#include "XMLWriterTest.h"
-#include "SAXTestSuite.h"
-#include "DOMTestSuite.h"
-
-
-CppUnit::Test* XMLTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("XMLTestSuite");
-
- pSuite->addTest(NameTest::suite());
- pSuite->addTest(NamePoolTest::suite());
- pSuite->addTest(XMLWriterTest::suite());
- pSuite->addTest(SAXTestSuite::suite());
- pSuite->addTest(DOMTestSuite::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/XMLTestSuite.h b/Utilities/Poco/XML/testsuite/src/XMLTestSuite.h
deleted file mode 100755
index 38c87aeeee..0000000000
--- a/Utilities/Poco/XML/testsuite/src/XMLTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// XMLTestSuite.h
-//
-// $Id$
-//
-// Definition of the XMLTestSuite class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XMLTestSuite_INCLUDED
-#define XMLTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class XMLTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // XMLTestSuite_INCLUDED
diff --git a/Utilities/Poco/XML/testsuite/src/XMLWriterTest.cpp b/Utilities/Poco/XML/testsuite/src/XMLWriterTest.cpp
deleted file mode 100755
index 6960814563..0000000000
--- a/Utilities/Poco/XML/testsuite/src/XMLWriterTest.cpp
+++ /dev/null
@@ -1,603 +0,0 @@
-//
-// XMLWriterTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2004-2006, 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 "XMLWriterTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/XML/XMLWriter.h"
-#include "Poco/SAX/AttributesImpl.h"
-#include "Poco/Exception.h"
-#include <sstream>
-
-
-using Poco::XML::XMLWriter;
-using Poco::XML::AttributesImpl;
-
-
-XMLWriterTest::XMLWriterTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-XMLWriterTest::~XMLWriterTest()
-{
-}
-
-
-void XMLWriterTest::testTrivial()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("", "", "foo");
- writer.endElement("", "", "foo");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<foo/>");
-}
-
-
-void XMLWriterTest::testTrivialDecl()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::WRITE_XML_DECLARATION);
- writer.startDocument();
- writer.startElement("", "", "foo");
- writer.endElement("", "", "foo");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo/>");
-}
-
-
-void XMLWriterTest::testTrivialDeclPretty()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::WRITE_XML_DECLARATION | XMLWriter::PRETTY_PRINT);
- writer.setNewLine("\n");
- writer.startDocument();
- writer.startElement("", "", "foo");
- writer.endElement("", "", "foo");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<foo/>\n");
-}
-
-
-void XMLWriterTest::testTrivialFragment()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startFragment();
- writer.startElement("", "", "foo");
- writer.endElement("", "", "foo");
- writer.endFragment();
- std::string xml = str.str();
- assert (xml == "<foo/>");
-}
-
-
-void XMLWriterTest::testTrivialFragmentPretty()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::WRITE_XML_DECLARATION | XMLWriter::PRETTY_PRINT);
- writer.setNewLine("\n");
- writer.startFragment();
- writer.startElement("", "", "foo");
- writer.endElement("", "", "foo");
- writer.endFragment();
- std::string xml = str.str();
- assert (xml == "<foo/>\n");
-}
-
-
-void XMLWriterTest::testDTDPretty()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::WRITE_XML_DECLARATION | XMLWriter::PRETTY_PRINT);
- writer.setNewLine("\n");
- writer.startDocument();
- writer.startDTD("test", "", "http://www.appinf.com/DTDs/test");
- writer.endDTD();
- writer.startElement("", "", "foo");
- writer.endElement("", "", "foo");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE test SYSTEM \"http://www.appinf.com/DTDs/test\">\n"
- "<foo/>\n");
-}
-
-
-void XMLWriterTest::testDTD()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::WRITE_XML_DECLARATION);
- writer.setNewLine("\n");
- writer.startDocument();
- writer.startDTD("test", "", "http://www.appinf.com/DTDs/test");
- writer.endDTD();
- writer.startElement("", "", "foo");
- writer.endElement("", "", "foo");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
- "<!DOCTYPE test SYSTEM \"http://www.appinf.com/DTDs/test\">"
- "<foo/>");
-}
-
-
-void XMLWriterTest::testDTDNotation()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::WRITE_XML_DECLARATION | XMLWriter::PRETTY_PRINT);
- writer.setNewLine("\n");
- writer.startDocument();
- writer.startDTD("test", "", "");
- std::string systemId("quicktime");
- writer.notationDecl("mov", 0, &systemId);
- std::string publicId("-//W3C//NOTATION XML 1.0//EN");
- writer.notationDecl("xml", &publicId, 0);
- writer.endDTD();
- writer.startElement("", "", "foo");
- writer.endElement("", "", "foo");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE test [\n"
- "\t<!NOTATION mov SYSTEM \"quicktime\">\n"
- "\t<!NOTATION xml PUBLIC \"-//W3C//NOTATION XML 1.0//EN\">\n"
- "]>\n"
- "<foo/>\n");
-}
-
-
-void XMLWriterTest::testDTDEntity()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::WRITE_XML_DECLARATION | XMLWriter::PRETTY_PRINT);
- writer.setNewLine("\n");
- writer.startDocument();
- writer.startDTD("test", "", "");
- std::string systemId("quicktime");
- writer.notationDecl("mov", 0, &systemId);
- std::string publicId("-//W3C//NOTATION XML 1.0//EN");
- writer.unparsedEntityDecl("movie", 0, "movie.mov", "mov");
- writer.endDTD();
- writer.startElement("", "", "foo");
- writer.endElement("", "", "foo");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE test [\n"
- "\t<!NOTATION mov SYSTEM \"quicktime\">\n"
- "\t<!ENTITY movie SYSTEM \"movie.mov\" NDATA mov>\n"
- "]>\n"
- "<foo/>\n");
-}
-
-
-void XMLWriterTest::testAttributes()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- AttributesImpl attrs;
- attrs.addAttribute("", "", "a1", "CDATA", "v1");
- attrs.addAttribute("", "", "a2", "CDATA", "v2");
- writer.startElement("", "", "el", attrs);
- writer.endElement("", "", "el");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<el a1=\"v1\" a2=\"v2\"/>");
-}
-
-
-void XMLWriterTest::testData()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.dataElement("", "", "d", "data", "a1", "v1", "a2", "v2", "a3", "v3");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<d a1=\"v1\" a2=\"v2\" a3=\"v3\">data</d>");
-}
-
-
-void XMLWriterTest::testEmptyData()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.dataElement("", "", "d", "", "a1", "v1", "a2", "v2", "a3", "v3");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<d a1=\"v1\" a2=\"v2\" a3=\"v3\"/>");
-}
-
-
-void XMLWriterTest::testDataPretty()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL | XMLWriter::PRETTY_PRINT);
- writer.setNewLine("\n");
- writer.startDocument();
- writer.startElement("", "", "r");
- writer.dataElement("", "", "d", "data", "a1", "v1", "a2", "v2", "a3", "v3");
- writer.endElement("", "", "r");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<r>\n\t<d a1=\"v1\" a2=\"v2\" a3=\"v3\">data</d>\n</r>\n");
-}
-
-
-void XMLWriterTest::testEmptyDataPretty()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL | XMLWriter::PRETTY_PRINT);
- writer.setNewLine("\n");
- writer.startDocument();
- writer.startElement("", "", "r");
- writer.dataElement("", "", "d", "", "a1", "v1", "a2", "v2", "a3", "v3");
- writer.endElement("", "", "r");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<r>\n\t<d a1=\"v1\" a2=\"v2\" a3=\"v3\"/>\n</r>\n");
-}
-
-
-void XMLWriterTest::testComment()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL | XMLWriter::PRETTY_PRINT);
- writer.setNewLine("\n");
- writer.startDocument();
- writer.comment("a comment", 0, 9);
- writer.startElement("", "", "r");
- writer.comment("<another comment>", 0, 17);
- writer.dataElement("", "", "d", "data");
- writer.endElement("", "", "r");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<!--a comment-->\n<r>\n\t<!--<another comment>-->\n\t<d>data</d>\n</r>\n");
-}
-
-
-void XMLWriterTest::testPI()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL | XMLWriter::PRETTY_PRINT);
- writer.setNewLine("\n");
- writer.startDocument();
- writer.processingInstruction("target", "a processing instruction");
- writer.startElement("", "", "r");
- writer.processingInstruction("target", "another processing instruction");
- writer.dataElement("", "", "d", "data");
- writer.endElement("", "", "r");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<?target a processing instruction?>\n<r>\n\t<?target another processing instruction?>\n\t<d>data</d>\n</r>\n");
-}
-
-
-void XMLWriterTest::testCharacters()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("", "", "r");
- writer.characters("some \"chars\" that <must> be & escaped");
- writer.endElement("", "", "r");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<r>some &quot;chars&quot; that &lt;must&gt; be &amp; escaped</r>");
-}
-
-
-void XMLWriterTest::testEmptyCharacters()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("", "", "r");
- writer.characters("");
- writer.endElement("", "", "r");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<r/>");
-}
-
-
-void XMLWriterTest::testCDATA()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("", "", "r");
- writer.startCDATA();
- writer.characters("some \"chars\" that <must> be & escaped");
- writer.endCDATA();
- writer.endElement("", "", "r");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<r><![CDATA[some \"chars\" that <must> be & escaped]]></r>");
-}
-
-
-void XMLWriterTest::testRawCharacters()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("", "", "r");
- writer.startCDATA();
- writer.rawCharacters("some \"chars\" that <must> be & escaped");
- writer.endCDATA();
- writer.endElement("", "", "r");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<r><![CDATA[some \"chars\" that <must> be & escaped]]></r>");
-}
-
-
-void XMLWriterTest::testDefaultNamespace()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startPrefixMapping("", "urn:ns");
- writer.startElement("", "", "r");
- writer.characters("data");
- writer.endElement("", "", "r");
- writer.endPrefixMapping("");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<r xmlns=\"urn:ns\">data</r>");
-}
-
-
-void XMLWriterTest::testQNamespaces()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("urn:ns", "r", "p:r");
- writer.characters("data");
- writer.endElement("urn:ns", "r", "p:r");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<p:r xmlns:p=\"urn:ns\">data</p:r>");
-}
-
-
-void XMLWriterTest::testQNamespacesNested()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("urn:ns", "r", "p:r");
- writer.startElement("urn:ns", "e", "p:e");
- writer.endElement("urn:ns", "e", "p:e");
- writer.endElement("urn:ns", "r", "p:r");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<p:r xmlns:p=\"urn:ns\"><p:e/></p:r>");
-}
-
-
-void XMLWriterTest::testNamespaces()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("urn:ns", "r", "");
- writer.characters("data");
- writer.endElement("urn:ns", "r", "");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<ns1:r xmlns:ns1=\"urn:ns\">data</ns1:r>");
-}
-
-void XMLWriterTest::testAttributeNamespaces()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- Poco::XML::AttributesImpl attrs;
- attrs.addAttribute("urn:other", "myattr", "", "", "attrValue");
- attrs.addAttribute("urn:ns", "myattr2", "", "", "attrValue2");
- writer.startDocument();
- writer.startElement("urn:ns", "r", "", attrs);
- writer.characters("data");
- writer.endElement("urn:ns", "r", "");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<ns1:r myattr2=\"attrValue2\" ns2:myattr=\"attrValue\" xmlns:ns1=\"urn:ns\" xmlns:ns2=\"urn:other\">data</ns1:r>");
-}
-
-
-void XMLWriterTest::testNamespacesNested()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("urn:ns1", "r", "");
- writer.startElement("urn:ns1", "e", "");
- writer.endElement("urn:ns1", "e", "");
- writer.startElement("urn:ns2", "f", "");
- writer.endElement("urn:ns2", "f", "");
- writer.endElement("urn:ns1", "r", "");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<ns1:r xmlns:ns1=\"urn:ns1\"><ns1:e/><ns2:f xmlns:ns2=\"urn:ns2\"/></ns1:r>");
-}
-
-
-void XMLWriterTest::testExplicitNamespaces()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startPrefixMapping("p1", "urn:ns1");
- writer.startPrefixMapping("p2", "urn:ns2");
- writer.startElement("urn:ns1", "r", "");
- writer.startElement("urn:ns2", "e", "");
- writer.endElement("urn:ns2", "e", "");
- writer.startPrefixMapping("p3", "urn:ns3");
- writer.startElement("urn:ns2", "e", "");
- writer.startElement("urn:ns3", "f", "");
- writer.endElement("urn:ns3", "f", "");
- writer.endElement("urn:ns2", "e", "");
- writer.endElement("urn:ns1", "r", "");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<p1:r xmlns:p1=\"urn:ns1\" xmlns:p2=\"urn:ns2\"><p2:e/><p2:e xmlns:p3=\"urn:ns3\"><p3:f/></p2:e></p1:r>");
-}
-
-
-void XMLWriterTest::testWellformed()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("", "", "foo");
- try
- {
- writer.endElement("", "", "bar");
- fail("not wellformed - must throw exception");
- }
- catch (Poco::Exception&)
- {
- }
-}
-
-
-void XMLWriterTest::testWellformedNested()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("", "", "foo");
- writer.startElement("", "", "bar");
- try
- {
- writer.endElement("", "", "foo");
- fail("not wellformed - must throw exception");
- }
- catch (Poco::Exception&)
- {
- }
-}
-
-
-void XMLWriterTest::testWellformedNamespace()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("urn:ns1", "foo", "");
- writer.startElement("urn:ns2", "bar", "");
- try
- {
- writer.endElement("urn:ns1", "bar", "");
- fail("not wellformed - must throw exception");
- }
- catch (Poco::Exception&)
- {
- }
-}
-
-
-void XMLWriterTest::testEmpty()
-{
- std::ostringstream str;
- XMLWriter writer(str, XMLWriter::CANONICAL);
- writer.startDocument();
- writer.startElement("", "", "foo");
- writer.startElement("", "", "bar");
- writer.emptyElement("", "", "empty");
- writer.endElement("", "", "bar");
- writer.endElement("", "", "foo");
- writer.endDocument();
- std::string xml = str.str();
- assert (xml == "<foo><bar><empty/></bar></foo>");
-}
-
-
-void XMLWriterTest::setUp()
-{
-}
-
-
-void XMLWriterTest::tearDown()
-{
-}
-
-
-CppUnit::Test* XMLWriterTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("XMLWriterTest");
-
- CppUnit_addTest(pSuite, XMLWriterTest, testTrivial);
- CppUnit_addTest(pSuite, XMLWriterTest, testTrivialDecl);
- CppUnit_addTest(pSuite, XMLWriterTest, testTrivialDeclPretty);
- CppUnit_addTest(pSuite, XMLWriterTest, testTrivialFragment);
- CppUnit_addTest(pSuite, XMLWriterTest, testTrivialFragmentPretty);
- CppUnit_addTest(pSuite, XMLWriterTest, testDTDPretty);
- CppUnit_addTest(pSuite, XMLWriterTest, testDTD);
- CppUnit_addTest(pSuite, XMLWriterTest, testDTDNotation);
- CppUnit_addTest(pSuite, XMLWriterTest, testDTDEntity);
- CppUnit_addTest(pSuite, XMLWriterTest, testAttributes);
- CppUnit_addTest(pSuite, XMLWriterTest, testData);
- CppUnit_addTest(pSuite, XMLWriterTest, testEmptyData);
- CppUnit_addTest(pSuite, XMLWriterTest, testDataPretty);
- CppUnit_addTest(pSuite, XMLWriterTest, testEmptyDataPretty);
- CppUnit_addTest(pSuite, XMLWriterTest, testComment);
- CppUnit_addTest(pSuite, XMLWriterTest, testPI);
- CppUnit_addTest(pSuite, XMLWriterTest, testCharacters);
- CppUnit_addTest(pSuite, XMLWriterTest, testEmptyCharacters);
- CppUnit_addTest(pSuite, XMLWriterTest, testCDATA);
- CppUnit_addTest(pSuite, XMLWriterTest, testRawCharacters);
- CppUnit_addTest(pSuite, XMLWriterTest, testDefaultNamespace);
- CppUnit_addTest(pSuite, XMLWriterTest, testQNamespaces);
- CppUnit_addTest(pSuite, XMLWriterTest, testQNamespacesNested);
- CppUnit_addTest(pSuite, XMLWriterTest, testNamespaces);
- CppUnit_addTest(pSuite, XMLWriterTest, testAttributeNamespaces);
- CppUnit_addTest(pSuite, XMLWriterTest, testNamespacesNested);
- CppUnit_addTest(pSuite, XMLWriterTest, testExplicitNamespaces);
- CppUnit_addTest(pSuite, XMLWriterTest, testWellformed);
- CppUnit_addTest(pSuite, XMLWriterTest, testWellformedNested);
- CppUnit_addTest(pSuite, XMLWriterTest, testWellformedNamespace);
- CppUnit_addTest(pSuite, XMLWriterTest, testEmpty);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/XML/testsuite/src/XMLWriterTest.h b/Utilities/Poco/XML/testsuite/src/XMLWriterTest.h
deleted file mode 100755
index 64d576f025..0000000000
--- a/Utilities/Poco/XML/testsuite/src/XMLWriterTest.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// XMLWriterTest.h
-//
-// $Id$
-//
-// Definition of the XMLWriterTest class.
-//
-// Copyright (c) 2004-2006, 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.
-//
-
-
-#ifndef XMLWriterTest_INCLUDED
-#define XMLWriterTest_INCLUDED
-
-
-#include "Poco/XML/XML.h"
-#include "CppUnit/TestCase.h"
-
-
-class XMLWriterTest: public CppUnit::TestCase
-{
-public:
- XMLWriterTest(const std::string& name);
- ~XMLWriterTest();
-
- void testTrivial();
- void testTrivialDecl();
- void testTrivialDeclPretty();
- void testTrivialFragment();
- void testTrivialFragmentPretty();
- void testDTDPretty();
- void testDTD();
- void testDTDNotation();
- void testDTDEntity();
- void testAttributes();
- void testData();
- void testEmptyData();
- void testDataPretty();
- void testEmptyDataPretty();
- void testComment();
- void testPI();
- void testCharacters();
- void testEmptyCharacters();
- void testCDATA();
- void testRawCharacters();
- void testDefaultNamespace();
- void testQNamespaces();
- void testQNamespacesNested();
- void testNamespaces();
- void testNamespacesNested();
- void testExplicitNamespaces();
- void testWellformed();
- void testWellformedNested();
- void testWellformedNamespace();
- void testAttributeNamespaces();
- void testEmpty();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // XMLWriterTest_INCLUDED
diff --git a/Utilities/Poco/Zip/CMakeLists.txt b/Utilities/Poco/Zip/CMakeLists.txt
deleted file mode 100644
index a468ae2362..0000000000
--- a/Utilities/Poco/Zip/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-set(LIBNAME "PocoZip")
-#set(LIBNAMED "${LIBNAME}d")
-
-aux_source_directory(src SRCS)
-
-add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
-set_target_properties( ${LIBNAME} PROPERTIES
- DEFINE_SYMBOL Zip_EXPORTS
-#COMPILE_FLAGS ${DEBUG_CXX_FLAGS}
- VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
- SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-target_link_libraries( ${LIBNAME} PocoUtil PocoXML PocoFoundation)
-
-#add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
-#set_target_properties( ${LIBNAMED}
-# PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}"
-# VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
-# SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-#target_link_libraries( ${LIBNAMED} PocoUtild PocoXMLd PocoFoundationd)
-
-#add_subdirectory(samples)
-#add_subdirectory(testsuite)
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/Add.h b/Utilities/Poco/Zip/include/Poco/Zip/Add.h
deleted file mode 100644
index a7a6dcd6c7..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/Add.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// Add.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: Add
-//
-// Definition of the Add class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_Add_INCLUDED
-#define Zip_Add_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipOperation.h"
-#include "Poco/Zip/ZipCommon.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API Add: public ZipOperation
- /// Operation Add adds a new file entry to an existing Zip File
-{
-public:
- Add(const std::string& zipPath, const std::string& localPath, ZipCommon::CompressionMethod cm, ZipCommon::CompressionLevel cl);
- /// Creates the Add.
-
- void execute(Compress& c, std::istream& input);
- /// Performs the add operation
-
-private:
- const std::string _zipPath;
- const std::string _localPath;
- const ZipCommon::CompressionMethod _cm;
- const ZipCommon::CompressionLevel _cl;
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_Add_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/AutoDetectStream.h b/Utilities/Poco/Zip/include/Poco/Zip/AutoDetectStream.h
deleted file mode 100644
index 412d41f5d4..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/AutoDetectStream.h
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-// AutoDetectStream.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: AutoDetectStream
-//
-// Definition of the AutoDetectStream class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_AutoDetectStream_INCLUDED
-#define Zip_AutoDetectStream_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/BufferedStreamBuf.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API AutoDetectStreamBuf: public Poco::BufferedStreamBuf
- /// A AutoDetectStreamBuf is a class that limits one view on an inputstream to a selected view range
-{
-public:
- AutoDetectStreamBuf(std::istream& in, const std::string& prefix, const std::string& postfix, bool reposition, Poco::UInt32 start);
- /// Creates the AutoDetectStream.
-
-
- AutoDetectStreamBuf(std::ostream& out);
- /// Creates the AutoDetectStream.
- /// If initStream is true the status of the stream will be cleared on the first access, and the stream will be repositioned
- /// to position start
-
- ~AutoDetectStreamBuf();
- /// Destroys the AutoDetectStream.
-
-protected:
- int readFromDevice(char* buffer, std::streamsize length);
-
- int writeToDevice(const char* buffer, std::streamsize length);
-
-private:
- enum
- {
- STREAM_BUFFER_SIZE = 1024
- };
-
- std::istream* _pIstr;
- std::ostream* _pOstr;
- bool _eofDetected;
- int _matchCnt;
- std::string _prefix;
- std::string _postfix;
- bool _reposition;
- Poco::UInt32 _start;
-};
-
-
-class Zip_API AutoDetectIOS: public virtual std::ios
- /// The base class for AutoDetectInputStream and AutoDetectOutputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- AutoDetectIOS(std::istream& istr, const std::string& prefix, const std::string& postfix, bool reposition, Poco::UInt32 start);
- /// Creates the basic stream and connects it
- /// to the given input stream.
-
- AutoDetectIOS(std::ostream& ostr);
- /// Creates the basic stream and connects it
- /// to the given output stream.
-
- ~AutoDetectIOS();
- /// Destroys the stream.
-
- AutoDetectStreamBuf* rdbuf();
- /// Returns a pointer to the underlying streambuf.
-
-protected:
- AutoDetectStreamBuf _buf;
-};
-
-
-class Zip_API AutoDetectInputStream: public AutoDetectIOS, public std::istream
- /// This stream copies all characters read through it
- /// to one or multiple output streams.
-{
-public:
- AutoDetectInputStream(std::istream& istr, const std::string& prefix = std::string(), const std::string& postfix = std::string(), bool reposition = false, Poco::UInt32 start = 0);
- /// Creates the AutoDetectInputStream and connects it
- /// to the given input stream. Bytes read are guaranteed to be in the range [start, end-1]
- /// If initStream is true the status of the stream will be cleared on the first access, and the stream will be repositioned
- /// to position start
-
- ~AutoDetectInputStream();
- /// Destroys the AutoDetectInputStream.
-};
-
-
-class Zip_API AutoDetectOutputStream: public AutoDetectIOS, public std::ostream
- /// This stream copies all characters written to it
- /// to one or multiple output streams.
-{
-public:
- AutoDetectOutputStream(std::ostream& ostr);
- /// Creates the AutoDetectOutputStream and connects it
- /// to the given input stream. Bytes written are guaranteed to be in the range [start, end-1]
- /// If initStream is true the status of the stream will be cleared on the first access, and the stream will be repositioned
- /// to position start
-
- ~AutoDetectOutputStream();
- /// Destroys the AutoDetectOutputStream.
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_AutoDetectStream_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/Compress.h b/Utilities/Poco/Zip/include/Poco/Zip/Compress.h
deleted file mode 100644
index d2e7b29042..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/Compress.h
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// Compress.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: Compress
-//
-// Definition of the Compress class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_Compress_INCLUDED
-#define Zip_Compress_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipArchive.h"
-#include "Poco/FIFOEvent.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API Compress
- /// Compresses a directory or files as zip.
-{
-public:
- Poco::FIFOEvent<const ZipLocalFileHeader> EDone;
-
- Compress(std::ostream& out, bool seekableOut);
- /// seekableOut determines how we write the zip, setting it to true is recommended for local files (smaller zip file),
- /// if you are compressing directly to a network, you MUST set it to false
-
- ~Compress();
-
- void addFile(std::istream& input, const Poco::DateTime& lastModifiedAt, const Poco::Path& fileName, ZipCommon::CompressionMethod cm = ZipCommon::CM_DEFLATE, ZipCommon::CompressionLevel cl = ZipCommon::CL_MAXIMUM);
- /// Adds a single file to the Zip File. fileName must not be a directory name.
-
- void addFile(const Poco::Path& file, const Poco::Path& fileName, ZipCommon::CompressionMethod cm = ZipCommon::CM_DEFLATE, ZipCommon::CompressionLevel cl = ZipCommon::CL_MAXIMUM);
- /// Adds a single file to the Zip File. fileName must not be a directory name. The file must exist physically!
-
- void addDirectory(const Poco::Path& entryName, const Poco::DateTime& lastModifiedAt);
- /// Adds a directory entry excluding all children to the Zip file, entryName must not be empty.
-
- void addRecursive(const Poco::Path& entry, ZipCommon::CompressionLevel cl = ZipCommon::CL_MAXIMUM, bool excludeRoot = true, const Poco::Path& name = Poco::Path());
- /// Adds a directory entry recursively to the zip file, set excludeRoot to false to exclude the parent directory.
- /// If excludeRoot is true you can specify an empty name to add the files as relative files
-
- ZipArchive close();
- /// Finalizes the ZipArchive, closes it.
-
-private:
- enum
- {
- COMPRESS_CHUNK_SIZE = 8192
- };
-
- Compress(const Compress&);
- Compress& operator=(const Compress&);
-
- void addEntry(std::istream& input, const Poco::DateTime& lastModifiedAt, const Poco::Path& fileName, ZipCommon::CompressionMethod cm = ZipCommon::CM_DEFLATE, ZipCommon::CompressionLevel cl = ZipCommon::CL_MAXIMUM);
- /// Either adds a file or a single directory entry (excluding subchildren) to the Zip file. the compression level will be ignored
- /// for directories.
-
- void addFileRaw(std::istream& in, const ZipLocalFileHeader& hdr, const Poco::Path& fileName);
- /// copys an already compressed ZipEntry from in
-
-private:
- std::ostream& _out;
- bool _seekableOut;
- ZipArchive::FileHeaders _files;
- ZipArchive::FileInfos _infos;
- ZipArchive::DirectoryInfos _dirs;
- Poco::UInt32 _offset;
-
- friend class Keep;
- friend class Rename;
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_Compress_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/Decompress.h b/Utilities/Poco/Zip/include/Poco/Zip/Decompress.h
deleted file mode 100644
index 2df7217a9b..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/Decompress.h
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// Decompress.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: Decompress
-//
-// Definition of the Decompress class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_Decompress_INCLUDED
-#define Zip_Decompress_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ParseCallback.h"
-#include "Poco/Zip/ZipArchive.h"
-#include "Poco/Path.h"
-#include "Poco/FIFOEvent.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class ZipArchive;
-
-
-class Zip_API Decompress: public ParseCallback
- /// Decompress extracts files from zip files, can be used to extract single files or all files
-{
-public:
- typedef std::map<std::string, Poco::Path> ZipMapping;
- /// Maps key of FileInfo entries to their local decompressed representation
- Poco::FIFOEvent<std::pair<const ZipLocalFileHeader, const std::string> > EError;
- /// Thrown whenever an error is detected when handling a ZipLocalFileHeader entry. The string contains an error message
- Poco::FIFOEvent<std::pair<const ZipLocalFileHeader, const Poco::Path> > EOk;
- /// Thrown whenever a file was successfully decompressed
-
- Decompress(std::istream& in, const Poco::Path& outputDir, bool flattenDirs = false, bool keepIncompleteFiles = false);
- /// Creates the Decompress. Note that istream must be good and at the very beginning of the file!
- /// Calling decompressAllFiles will cause the stream to be in state failed once the zip file is processed.
- /// outputDir must be a directory. If it doesn't exist yet, it will be automatically created.
- /// If flattenDirs is set to true, the directory structure of the zip file is not recreated.
- /// Instead, all files are extracted into one single directory.
-
- ~Decompress();
- /// Destroys the Decompress.
-
- ZipArchive decompressAllFiles();
- /// Decompresses all files stored in the zip File. Can only be called once per Decompress object.
- /// Use mapping to retrieve the location of the decompressed files
-
- bool handleZipEntry(std::istream& zipStream, const ZipLocalFileHeader& hdr);
-
- const ZipMapping& mapping() const;
- /// A ZipMapping stores as key the full name of the ZipFileInfo/ZipLocalFileHeader and as value the decompressed file
- /// If for a ZipFileInfo no mapping exists, there was an error during decompression and the entry is considered to be corrupt
-
-private:
- Decompress(const Decompress&);
- Decompress& operator=(const Decompress&);
-
- void onOk(const void*, std::pair<const ZipLocalFileHeader, const Poco::Path>& val);
-
-private:
- std::istream& _in;
- Poco::Path _outDir;
- bool _flattenDirs;
- bool _keepIncompleteFiles;
- ZipMapping _mapping;
-};
-
-
-inline const Decompress::ZipMapping& Decompress::mapping() const
-{
- return _mapping;
-}
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_Decompress_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/Delete.h b/Utilities/Poco/Zip/include/Poco/Zip/Delete.h
deleted file mode 100644
index df034403f2..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/Delete.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// Delete.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: Delete
-//
-// Definition of the Delete class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_Delete_INCLUDED
-#define Zip_Delete_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipOperation.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API Delete: public ZipOperation
- /// Delete Operation removes an entry from a Zip
-{
-public:
- Delete(const ZipLocalFileHeader& hdr);
- /// Creates the Delete.
-
- void execute(Compress& c, std::istream& input);
- /// Throws away the ZipEntry
-
-private:
- const ZipLocalFileHeader _hdr;
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_Delete_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/Keep.h b/Utilities/Poco/Zip/include/Poco/Zip/Keep.h
deleted file mode 100644
index da655ca8e8..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/Keep.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// Keep.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: Keep
-//
-// Definition of the Keep class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_Keep_INCLUDED
-#define Zip_Keep_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipOperation.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API Keep: public ZipOperation
- /// Keep simply forwards the compressed data stream from the input ZipArchive
- /// to the output zip archive
-{
-public:
- Keep(const ZipLocalFileHeader& hdr);
- /// Creates the Keep object.
-
- void execute(Compress& c, std::istream& input);
- ///Adds a copy of the compressed input file to the ZipArchive
-
-private:
- const ZipLocalFileHeader _hdr;
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_Keep_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ParseCallback.h b/Utilities/Poco/Zip/include/Poco/Zip/ParseCallback.h
deleted file mode 100644
index 07fa586372..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ParseCallback.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// ParseCallback.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ParseCallback
-//
-// Definition of the ParseCallback class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ParseCallback_INCLUDED
-#define Zip_ParseCallback_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include <istream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-class ZipLocalFileHeader;
-
-
-class Zip_API ParseCallback
- /// Interface for callbacks to handle ZipData
-{
-public:
- ParseCallback();
- /// Creates the ParseCallback.
-
- virtual ~ParseCallback();
- /// Destroys the ParseCallback.
-
- virtual bool handleZipEntry(std::istream& zipStream, const ZipLocalFileHeader& hdr) = 0;
- /// Handles parsing of the data of a single Zip Entry. zipStream is guaranteed to be at the very first data byte.
- /// Note that a callback class SHOULD consume all data inside a zip file, ie. after
- /// processing the next 4 bytes point the next ZipLocalFileHeader or the ZipDirectory.
- /// If it fails to do so, it must return false, otherwise true.
-
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ParseCallback_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/PartialStream.h b/Utilities/Poco/Zip/include/Poco/Zip/PartialStream.h
deleted file mode 100644
index 7b105b3b5c..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/PartialStream.h
+++ /dev/null
@@ -1,209 +0,0 @@
-//
-// PartialStream.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: PartialStream
-//
-// Definition of the PartialStream class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_PartialStream_INCLUDED
-#define Zip_PartialStream_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/BufferedStreamBuf.h"
-#include "Poco/Buffer.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API PartialStreamBuf: public Poco::BufferedStreamBuf
- /// A PartialStreamBuf is a class that limits one view on an inputstream to a selected view range
-{
-public:
- PartialStreamBuf(std::istream& in, std::ios::pos_type start, std::ios::pos_type end, const std::string& prefix, const std::string& postfix, bool initStream);
- /// Creates the PartialStream.
- /// If initStream is true the status of the stream will be cleared on the first access, and the stream will be repositioned
- /// to position start
-
- PartialStreamBuf(std::ostream& out, std::size_t start, std::size_t end, bool initStream);
- /// Creates the PartialStream.
- /// If initStream is true the status of the stream will be cleared on the first access.
- /// start and end acts as offset values for the written content. A start value greater than zero,
- /// means that the first bytes are not written but discarded instead,
- /// an end value not equal to zero means that the last end bytes are not written!
- /// Examples:
- /// start = 3; end = 1
- /// write("hello", 5) -> "l"
-
- ~PartialStreamBuf();
- /// Destroys the PartialStream.
-
- void close();
- /// Flushes a writing streambuf
-
- Poco::UInt64 bytesWritten() const;
-
-protected:
- int readFromDevice(char* buffer, std::streamsize length);
-
- int writeToDevice(const char* buffer, std::streamsize length);
-
-private:
- enum
- {
- STREAM_BUFFER_SIZE = 1024
- };
-
- bool _initialized;
- std::ios::pos_type _start;
- Poco::UInt64 _numBytes;
- Poco::UInt64 _bytesWritten;
- std::istream* _pIstr;
- std::ostream* _pOstr;
- std::string _prefix;
- std::string _postfix;
- std::size_t _ignoreStart;
- Poco::Buffer<char> _buffer;
- Poco::UInt32 _bufferOffset;
-};
-
-
-inline Poco::UInt64 PartialStreamBuf::bytesWritten() const
-{
- return _bytesWritten;
-}
-
-
-class Zip_API PartialIOS: public virtual std::ios
- /// The base class for PartialInputStream and PartialOutputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- PartialIOS(std::istream& istr, std::ios::pos_type start, std::ios::pos_type end, const std::string& prefix, const std::string& postfix, bool initStream);
- /// Creates the basic stream and connects it
- /// to the given input stream.
- /// If initStream is true the status of the stream will be cleared on the first access, and the stream will be repositioned
- /// to position start
-
- PartialIOS(std::ostream& ostr, std::size_t start, std::size_t end, bool initStream);
- /// Creates the basic stream and connects it
- /// to the given output stream.
- /// If initStream is true the status of the stream will be cleared on the first access.
- /// start and end acts as offset values for the written content. A start value greater than zero,
- /// means that the first bytes are not written but discarded instead,
- /// an end value not equal to zero means that the last end bytes are not written!
- /// Examples:
- /// start = 3; end = 1
- /// write("hello", 5) -> "l"
-
- ~PartialIOS();
- /// Destroys the stream.
-
- PartialStreamBuf* rdbuf();
- /// Returns a pointer to the underlying streambuf.
-
-protected:
- PartialStreamBuf _buf;
-};
-
-
-class Zip_API PartialInputStream: public PartialIOS, public std::istream
- /// This stream copies all characters read through it
- /// to one or multiple output streams.
-{
-public:
- PartialInputStream(std::istream& istr, std::ios::pos_type start, std::ios::pos_type end, bool initStream = true, const std::string& prefix = std::string(), const std::string& postfix = std::string());
- /// Creates the PartialInputStream and connects it
- /// to the given input stream. Bytes read are guaranteed to be in the range [start, end-1]
- /// If initStream is true the status of the stream will be cleared on the first access, and the stream will be repositioned
- /// to position start
-
- ~PartialInputStream();
- /// Destroys the PartialInputStream.
-};
-
-
-class Zip_API PartialOutputStream: public PartialIOS, public std::ostream
- /// This stream copies all characters written to it
- /// to one or multiple output streams.
-{
-public:
- PartialOutputStream(std::ostream& ostr, std::size_t start, std::size_t end, bool initStream = true);
- /// Creates the PartialOutputStream and connects it
- /// to the given output stream. Bytes written are guaranteed to be in the range [start, realEnd - end].
- /// If initStream is true the status of the stream will be cleared on the first access.
- /// start and end acts as offset values for the written content. A start value greater than zero,
- /// means that the first bytes are not written but discarded instead,
- /// an end value not equal to zero means that the last end bytes are not written!
- /// Examples:
- /// start = 3; end = 1
- /// write("hello", 5) -> "l"
- ///
- /// start = 3; end = 0
- /// write("hello", 5) -> "lo"
-
- ~PartialOutputStream();
- /// Destroys the PartialOutputStream.
-
- void close();
- /// must be called for the stream to properly terminate it
-
- Poco::UInt64 bytesWritten() const;
- /// Returns the number of bytes actually forwarded to the inner ostream
-};
-
-
-inline void PartialOutputStream::close()
-{
- flush();
- _buf.close();
-}
-
-
-inline Poco::UInt64 PartialOutputStream::bytesWritten() const
-{
- return _buf.bytesWritten();
-}
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_PartialStream_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/Rename.h b/Utilities/Poco/Zip/include/Poco/Zip/Rename.h
deleted file mode 100644
index 491ab70094..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/Rename.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// Rename.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: Rename
-//
-// Definition of the Rename class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_Rename_INCLUDED
-#define Zip_Rename_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipOperation.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API Rename: public ZipOperation
- /// Renames an existing Zip Entry
-{
-public:
- Rename(const ZipLocalFileHeader& hdr, const std::string& newZipEntryName);
- /// Creates the Rename.
-
- void execute(Compress& c, std::istream& input);
- /// Performs the rename operation
-
-private:
- const ZipLocalFileHeader _hdr;
- const std::string _newZipEntryName;
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_Rename_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/Replace.h b/Utilities/Poco/Zip/include/Poco/Zip/Replace.h
deleted file mode 100644
index 06e30bc5f4..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/Replace.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// Replace.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: Replace
-//
-// Definition of the Replace class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_Replace_INCLUDED
-#define Zip_Replace_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/Add.h"
-#include "Poco/Zip/Delete.h"
-#include "Poco/Zip/ZipOperation.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API Replace: public ZipOperation
- /// Operation Replace replaces the content of an existing entry with a new one
-{
-public:
- Replace(const ZipLocalFileHeader& hdr, const std::string& localPath);
- /// Creates the Replace.
-
- void execute(Compress& c, std::istream& input);
- /// Performs the replace operation
-
-private:
- Delete _del;
- Add _add;
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_Replace_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/SkipCallback.h b/Utilities/Poco/Zip/include/Poco/Zip/SkipCallback.h
deleted file mode 100644
index 1fd71a8a1c..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/SkipCallback.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// SkipCallback.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: SkipCallback
-//
-// Definition of the SkipCallback class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_SkipCallback_INCLUDED
-#define Zip_SkipCallback_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ParseCallback.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API SkipCallback: public ParseCallback
- /// A SkipCallback simply skips over the data
-{
-public:
- SkipCallback();
- /// Creates the SkipCallback.
-
- virtual ~SkipCallback();
- /// Destroys the SkipCallback.
-
- bool handleZipEntry(std::istream& zipStream, const ZipLocalFileHeader& hdr);
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_SkipCallback_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/Zip.h b/Utilities/Poco/Zip/include/Poco/Zip/Zip.h
deleted file mode 100644
index 813e04dd30..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/Zip.h
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// Zip.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: Zip
-//
-// Basic definitions for the Poco Zip library.
-// This file must be the first file included by every other Zip
-// header file.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_Zip_INCLUDED
-#define Zip_Zip_INCLUDED
-
-
-#include "Poco/Foundation.h"
-
-//
-// Ensure that POCO_DLL is default unless POCO_STATIC is defined
-//
-#if defined(_WIN32) && defined(_DLL)
-#if !defined(POCO_DLL) && !defined(POCO_STATIC)
-#define POCO_DLL
-#endif
-#endif
-
-//
-// The following block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the Zip_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// Zip_API functions as being imported from a DLL, wheras this DLL sees symbols
-// defined with this macro as being exported.
-//
-#if defined(_WIN32) && defined(POCO_DLL)
- #if defined(Zip_EXPORTS)
- #define Zip_API __declspec(dllexport)
- #else
- #define Zip_API __declspec(dllimport)
- #endif
-#endif
-
-
-#if !defined(Zip_API)
- #define Zip_API
-#endif
-
-
-//
-// Automatically link Zip library.
-//
-#if defined(_MSC_VER)
- #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Zip_EXPORTS)
- #if defined(POCO_DLL)
- #if defined(_DEBUG)
- #pragma comment(lib, "PocoZipd.lib")
- #else
- #pragma comment(lib, "PocoZip.lib")
- #endif
- #else
- #if defined(_DEBUG)
- #pragma comment(lib, "PocoZipmtd.lib")
- #else
- #pragma comment(lib, "PocoZipmt.lib")
- #endif
- #endif
- #endif
-#endif
-
-
-#endif // Zip_Zip_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipArchive.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipArchive.h
deleted file mode 100644
index c32d0c082b..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipArchive.h
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// ZipArchive.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipArchive
-//
-// Definition of the ZipArchive class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipArchive_INCLUDED
-#define Zip_ZipArchive_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-#include "Poco/Zip/ZipFileInfo.h"
-#include "Poco/Zip/ZipArchiveInfo.h"
-#include <istream>
-#include <map>
-
-
-namespace Poco {
-namespace Zip {
-
-
-class ParseCallback;
-class Compress;
-
-
-class Zip_API ZipArchive
- /// A ZipArchive contains information on the content of a zip file
-{
-public:
- typedef std::map<std::string, ZipLocalFileHeader> FileHeaders;
- typedef std::map<std::string, ZipFileInfo> FileInfos;
- typedef std::map<Poco::UInt16, ZipArchiveInfo> DirectoryInfos;
-
- ZipArchive(std::istream& in);
- /// Creates the ZipArchive from a file. Note that the in stream will be in state failed after the constructor is finished
-
- ZipArchive(std::istream& in, ParseCallback& callback);
- /// Creates the ZipArchive from a file or network stream. Note that the in stream will be in state failed after the constructor is finished
-
- ~ZipArchive();
- /// Destroys the ZipArchive.
-
- FileInfos::const_iterator fileInfoBegin() const;
-
- FileInfos::const_iterator fileInfoEnd() const;
-
- FileHeaders::const_iterator findHeader(const std::string& fileName) const;
-
- FileHeaders::const_iterator headerBegin() const;
-
- FileHeaders::const_iterator headerEnd() const;
-
-private:
- void parse(std::istream& in, ParseCallback& pc);
-
- ZipArchive(const FileHeaders& entries, const FileInfos& infos, const DirectoryInfos& dirs );
-
-private:
- FileHeaders _entries;
- /// Info generated by parsing the data block of the zip file
- FileInfos _infos;
- /// Info generated by parsing the directory block of the zip file
- DirectoryInfos _disks;
- /// Stores directory info for all found disks
-
- friend class Compress;
-};
-
-
-inline ZipArchive::FileInfos::const_iterator ZipArchive::fileInfoBegin() const
-{
- return _infos.begin();
-}
-
-
-inline ZipArchive::FileInfos::const_iterator ZipArchive::fileInfoEnd() const
-{
- return _infos.end();
-}
-
-
-inline ZipArchive::FileHeaders::const_iterator ZipArchive::findHeader(const std::string& fileName) const
-{
- return _entries.find(fileName);
-}
-
-
-inline ZipArchive::FileHeaders::const_iterator ZipArchive::headerBegin() const
-{
- return _entries.begin();
-}
-
-
-inline ZipArchive::FileHeaders::const_iterator ZipArchive::headerEnd() const
-{
- return _entries.end();
-}
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipArchive_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipArchiveInfo.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipArchiveInfo.h
deleted file mode 100644
index 4de1de349c..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipArchiveInfo.h
+++ /dev/null
@@ -1,210 +0,0 @@
-//
-// ZipArchiveInfo.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipArchiveInfo
-//
-// Definition of the ZipArchiveInfo class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipArchiveInfo_INCLUDED
-#define Zip_ZipArchiveInfo_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipCommon.h"
-#include "Poco/Zip/ZipUtil.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API ZipArchiveInfo
- /// A ZipArchiveInfo stores central directory info
-{
-public:
- static const char HEADER[ZipCommon::HEADER_SIZE];
-
- ZipArchiveInfo();
- /// Default constructor, everything set to zero or empty
-
- ZipArchiveInfo(std::istream& in, bool assumeHeaderRead);
- /// Creates the ZipArchiveInfo by parsing the input stream.
- /// If assumeHeaderRead is true we assume that the first 4 bytes were already read outside.
-
- ~ZipArchiveInfo();
- /// Destroys the ZipArchiveInfo.
-
- Poco::UInt16 getDiskNumber() const;
- /// Get the number of the disk where this header can be found
-
- Poco::UInt16 getFirstDiskForDirectoryHeader() const;
- /// Returns the number of the disk that contains the start of the directory header
-
- Poco::UInt16 getNumberOfEntries() const;
- /// Returns the number of entries on this disk
-
- Poco::UInt16 getTotalNumberOfEntries() const;
- /// Returns the total number of entries on all disks
-
- Poco::UInt32 getCentralDirectorySize() const;
- /// Returns the size of the central directory in bytes
-
- std::streamoff getHeaderOffset() const;
- /// Returns the offset of the header in relation to the begin of this disk
-
- const std::string& getZipComment() const;
- /// Returns the (optional) Zip Comment
-
- void setNumberOfEntries(Poco::UInt16 val);
- /// Returns the number of entries on this disk
-
- void setTotalNumberOfEntries(Poco::UInt16 val);
- /// Returns the total number of entries on all disks
-
- void setCentralDirectorySize(Poco::UInt32 val);
- /// Returns the size of the central directory in bytes
-
- void setHeaderOffset(Poco::UInt32 val);
-
- std::string createHeader() const;
- /// Creates a header
-
-private:
- void parse(std::istream& inp, bool assumeHeaderRead);
-
- Poco::UInt16 getZipCommentSize() const;
-
-private:
- enum
- {
- HEADER_POS = 0,
- NUMBEROFTHISDISK_POS = HEADER_POS + ZipCommon::HEADER_SIZE,
- NUMBEROFTHISDISK_SIZE = 2,
- NUMBEROFCENTRALDIRDISK_POS = NUMBEROFTHISDISK_POS + NUMBEROFTHISDISK_SIZE,
- NUMBEROFCENTRALDIRDISK_SIZE = 2,
- NUMENTRIESTHISDISK_POS = NUMBEROFCENTRALDIRDISK_POS + NUMBEROFCENTRALDIRDISK_SIZE,
- NUMENTRIESTHISDISK_SIZE = 2,
- TOTALNUMENTRIES_POS = NUMENTRIESTHISDISK_POS + NUMENTRIESTHISDISK_SIZE,
- TOTALNUMENTRIES_SIZE = 2,
- CENTRALDIRSIZE_POS = TOTALNUMENTRIES_POS + TOTALNUMENTRIES_SIZE,
- CENTRALDIRSIZE_SIZE = 4,
- CENTRALDIRSTARTOFFSET_POS = CENTRALDIRSIZE_POS + CENTRALDIRSIZE_SIZE,
- CENTRALDIRSTARTOFFSET_SIZE = 4,
- ZIPCOMMENT_LENGTH_POS = CENTRALDIRSTARTOFFSET_POS + CENTRALDIRSTARTOFFSET_SIZE,
- ZIPCOMMENT_LENGTH_SIZE = 2,
- FULLHEADER_SIZE = 22
- };
-
- char _rawInfo[FULLHEADER_SIZE];
- std::streamoff _startPos;
- std::string _comment;
-};
-
-
-inline Poco::UInt16 ZipArchiveInfo::getDiskNumber() const
-{
- return ZipUtil::get16BitValue(_rawInfo, NUMBEROFTHISDISK_POS);
-}
-
-
-inline Poco::UInt16 ZipArchiveInfo::getFirstDiskForDirectoryHeader() const
-{
- return ZipUtil::get16BitValue(_rawInfo, NUMBEROFCENTRALDIRDISK_POS);
-}
-
-
-inline Poco::UInt16 ZipArchiveInfo::getNumberOfEntries() const
-{
- return ZipUtil::get16BitValue(_rawInfo, NUMENTRIESTHISDISK_POS);
-}
-
-
-inline Poco::UInt16 ZipArchiveInfo::getTotalNumberOfEntries() const
-{
- return ZipUtil::get16BitValue(_rawInfo, TOTALNUMENTRIES_POS);
-}
-
-
-inline Poco::UInt32 ZipArchiveInfo::getCentralDirectorySize() const
-{
- return ZipUtil::get32BitValue(_rawInfo, CENTRALDIRSIZE_POS);
-}
-
-
-inline std::streamoff ZipArchiveInfo::getHeaderOffset() const
-{
- return _startPos;
-}
-
-
-inline Poco::UInt16 ZipArchiveInfo::getZipCommentSize() const
-{
- return ZipUtil::get16BitValue(_rawInfo, ZIPCOMMENT_LENGTH_POS);
-}
-
-
-inline const std::string& ZipArchiveInfo::getZipComment() const
-{
- return _comment;
-}
-
-
-inline void ZipArchiveInfo::setNumberOfEntries(Poco::UInt16 val)
-{
- ZipUtil::set16BitValue(val, _rawInfo, NUMENTRIESTHISDISK_POS);
-}
-
-
-inline void ZipArchiveInfo::setTotalNumberOfEntries(Poco::UInt16 val)
-{
- ZipUtil::set16BitValue(val, _rawInfo, TOTALNUMENTRIES_POS);
-}
-
-
-inline void ZipArchiveInfo::setCentralDirectorySize(Poco::UInt32 val)
-{
- ZipUtil::set32BitValue(val, _rawInfo, CENTRALDIRSIZE_POS);
-}
-
-
-inline void ZipArchiveInfo::setHeaderOffset(Poco::UInt32 val)
-{
- ZipUtil::set32BitValue(val, _rawInfo, CENTRALDIRSTARTOFFSET_POS);
-}
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipArchiveInfo_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipCommon.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipCommon.h
deleted file mode 100644
index ab693613be..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipCommon.h
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// ZipCommon.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipCommon
-//
-// Definition of the ZipCommon class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipCommon_INCLUDED
-#define Zip_ZipCommon_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API ZipCommon
- /// Common enums used in the Zip project
-{
-public:
- enum
- {
- HEADER_SIZE = 4
- };
-
- enum CompressionMethod
- {
- CM_STORE = 0,
- CM_SHRUNK = 1,
- CM_FACTOR1 = 2,
- CM_FACTOR2 = 3,
- CM_FACTOR3 = 4,
- CM_FACTOR4 = 5,
- CM_IMPLODE = 6,
- CM_TOKENIZE= 7,
- CM_DEFLATE = 8,
- CM_ENHANCEDDEFLATE = 9,
- CM_DATECOMPRIMPLODING = 10,
- CM_UNUSED = 11
- };
-
- enum CompressionLevel
- {
- CL_NORMAL = 0,
- CL_MAXIMUM = 1,
- CL_FAST = 2,
- CL_SUPERFAST = 3
- };
-
- enum HostSystem
- {
- HS_FAT = 0, // + PKZIPW 2.50 VFAT, NTFS
- HS_AMIGA = 1,
- HS_VMS = 2,
- HS_UNIX = 3,
- HS_VM_CMS = 4,
- HS_ATARI = 5,
- HS_HPFS = 6,
- HS_MACINTOSH = 7,
- HS_ZSYSTEM = 8,
- HS_CP_M = 9,
- HS_TOPS20 = 10, // used by pkzip2.5 to indicate ntfs
- HS_NTFS = 11,
- HS_SMS_QDOS = 12,
- HS_ACORN = 13,
- HS_VFAT = 14,
- HS_MVS = 15,
- HS_BEOS = 16,
- HS_TANDEM = 17,
- HS_UNUSED = 18
- };
-
- enum FileType
- {
- FT_BINARY= 0,
- FT_ASCII = 1
- };
-
- static const std::string ILLEGAL_PATH;
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipCommon_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipDataInfo.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipDataInfo.h
deleted file mode 100644
index 4feb3aade2..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipDataInfo.h
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// ZipDataInfo.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipDataInfo
-//
-// Definition of the ZipDataInfo class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipDataInfo_INCLUDED
-#define Zip_ZipDataInfo_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipCommon.h"
-#include "Poco/Zip/ZipUtil.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Zip_API ZipDataInfo
- /// A ZipDataInfo stores a Zip data descriptor
-{
-public:
- static const char HEADER[ZipCommon::HEADER_SIZE];
-
- ZipDataInfo();
- /// Creates a header with all fields (except the header field) set to 0
-
- ZipDataInfo(std::istream& in, bool assumeHeaderRead);
- /// Creates the ZipDataInfo.
-
- ~ZipDataInfo();
- /// Destroys the ZipDataInfo.
-
- bool isValid() const;
-
- Poco::UInt32 getCRC32() const;
-
- void setCRC32(Poco::UInt32 crc);
-
- Poco::UInt32 getCompressedSize() const;
-
- void setCompressedSize(Poco::UInt32 size);
-
- Poco::UInt32 getUncompressedSize() const;
-
- void setUncompressedSize(Poco::UInt32 size);
-
- static Poco::UInt32 getFullHeaderSize();
-
- const char* getRawHeader() const;
-
-private:
- enum
- {
- HEADER_POS = 0,
- CRC32_POS = HEADER_POS + ZipCommon::HEADER_SIZE,
- CRC32_SIZE = 4,
- COMPRESSED_POS = CRC32_POS + CRC32_SIZE,
- COMPRESSED_SIZE = 4,
- UNCOMPRESSED_POS = COMPRESSED_POS + COMPRESSED_SIZE,
- UNCOMPRESSED_SIZE = 4,
- FULLHEADER_SIZE = UNCOMPRESSED_POS + UNCOMPRESSED_SIZE
- };
-
- char _rawInfo[FULLHEADER_SIZE];
- bool _valid;
-};
-
-
-inline const char* ZipDataInfo::getRawHeader() const
-{
- return _rawInfo;
-}
-
-
-inline bool ZipDataInfo::isValid() const
-{
- return _valid;
-}
-
-
-inline Poco::UInt32 ZipDataInfo::getCRC32() const
-{
- return ZipUtil::get32BitValue(_rawInfo, CRC32_POS);
-}
-
-
-inline void ZipDataInfo::setCRC32(Poco::UInt32 crc)
-{
- return ZipUtil::set32BitValue(crc, _rawInfo, CRC32_POS);
-}
-
-
-inline Poco::UInt32 ZipDataInfo::getCompressedSize() const
-{
- return ZipUtil::get32BitValue(_rawInfo, COMPRESSED_POS);
-}
-
-
-inline void ZipDataInfo::setCompressedSize(Poco::UInt32 size)
-{
- return ZipUtil::set32BitValue(size, _rawInfo, COMPRESSED_POS);
-}
-
-
-inline Poco::UInt32 ZipDataInfo::getUncompressedSize() const
-{
- return ZipUtil::get32BitValue(_rawInfo, UNCOMPRESSED_POS);
-}
-
-
-inline void ZipDataInfo::setUncompressedSize(Poco::UInt32 size)
-{
- return ZipUtil::set32BitValue(size, _rawInfo, UNCOMPRESSED_POS);
-}
-
-
-inline Poco::UInt32 ZipDataInfo::getFullHeaderSize()
-{
- return FULLHEADER_SIZE;
-}
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipDataInfo_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipException.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipException.h
deleted file mode 100644
index afa2f1468f..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipException.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// ZipException.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipException
-//
-// Definition of the ZipException class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipException_INCLUDED
-#define Zip_ZipException_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Exception.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-POCO_DECLARE_EXCEPTION(Zip_API, ZipException, Poco::RuntimeException)
-POCO_DECLARE_EXCEPTION(Zip_API, ZipManipulationException, ZipException)
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipException_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipFileInfo.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipFileInfo.h
deleted file mode 100644
index f6df98891e..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipFileInfo.h
+++ /dev/null
@@ -1,484 +0,0 @@
-//
-// ZipFileInfo.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipFileInfo
-//
-// Definition of the ZipFileInfo class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipFileInfo_INCLUDED
-#define Zip_ZipFileInfo_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipCommon.h"
-#include "Poco/Zip/ZipUtil.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-class ZipLocalFileHeader;
-
-
-class Zip_API ZipFileInfo
- /// Stores a Zip directory entry of a file
-{
-public:
- static const char HEADER[ZipCommon::HEADER_SIZE];
-
- ZipFileInfo(const ZipLocalFileHeader& header);
- /// Creates a ZipFileInfo from a ZipLocalFileHeader
-
- ZipFileInfo(std::istream& in, bool assumeHeaderRead);
- /// Creates the ZipFileInfo by parsing the input stream.
- /// If assumeHeaderRead is true we assume that the first 4 bytes were already read outside.
-
- ~ZipFileInfo();
- /// Destroys the ZipFileInfo.
-
- Poco::UInt32 getRelativeOffsetOfLocalHeader() const;
- /// Where on the disk starts the localheader. Combined with the disk number gives the exact location of the header
-
- ZipCommon::CompressionMethod getCompressionMethod() const;
-
- bool isEncrypted() const;
-
- const Poco::DateTime& lastModifiedAt() const;
-
- Poco::UInt32 getCRC() const;
-
- Poco::UInt32 getHeaderSize() const;
- /// Returns the total size of the header including filename + other additional fields
-
- Poco::UInt32 getCompressedSize() const;
-
- Poco::UInt32 getUncompressedSize() const;
-
- const std::string& getFileName() const;
-
- bool isFile() const;
-
- bool isDirectory() const;
-
- bool hasExtraField() const;
-
- const std::string& getExtraField() const;
-
- const std::string& getFileComment() const;
-
- void getVersionMadeBy(int& major, int& minor);
- /// The ZIP version used to create the file
-
- void getRequiredVersion(int& major, int& minor);
- /// The minimum version required to extract the data
-
- ZipCommon::HostSystem getHostSystem() const;
-
- Poco::UInt16 getDiskNumberStart() const;
- /// The number of the disk on which this file begins (multidisk archives)
-
- ZipCommon::FileType getFileType() const;
- /// Binary or ASCII file?
-
- std::string createHeader() const;
-
- void setOffset(Poco::UInt32 val);
-
-private:
- void setCRC(Poco::UInt32 val);
-
- void setCompressedSize(Poco::UInt32 val);
-
- void setUncompressedSize(Poco::UInt32 val);
-
- void setCompressionMethod(ZipCommon::CompressionMethod cm);
-
- void setCompressionLevel(ZipCommon::CompressionLevel cl);
-
- void setRequiredVersion(int major, int minor);
-
- void setHostSystem(ZipCommon::HostSystem hs);
-
- void setLastModifiedAt(const Poco::DateTime& dt);
-
- void setEncryption(bool val);
-
- void setFileNameLength(Poco::UInt16 size);
-
- void setFileName(const std::string& str);
-
- void setExternalFileAttributes(Poco::UInt32 attrs);
-
- void parse(std::istream& in, bool assumeHeaderRead);
-
- void parseDateTime();
-
- Poco::UInt32 getCRCFromHeader() const;
-
- Poco::UInt32 getCompressedSizeFromHeader() const;
-
- Poco::UInt32 getUncompressedSizeFromHeader() const;
-
- Poco::UInt16 getFileNameLength() const;
-
- Poco::UInt16 getExtraFieldLength() const;
-
- Poco::UInt16 getFileCommentLength() const;
-
- Poco::UInt32 getExternalFileAttributes() const;
-
- void setUnixAttributes();
-
-private:
- enum
- {
- HEADER_POS = 0,
- VERSIONMADEBY_POS = HEADER_POS + ZipCommon::HEADER_SIZE,
- VERSIONMADEBY_SIZE = 2,
- VERSION_NEEDED_POS = VERSIONMADEBY_POS + VERSIONMADEBY_SIZE,
- VERSION_NEEDED_SIZE = 2,
- GENERAL_PURPOSE_POS = VERSION_NEEDED_POS + VERSION_NEEDED_SIZE,
- GENERAL_PURPOSE_SIZE = 2,
- COMPR_METHOD_POS = GENERAL_PURPOSE_POS + GENERAL_PURPOSE_SIZE,
- COMPR_METHOD_SIZE = 2,
- LASTMODFILETIME_POS = COMPR_METHOD_POS + COMPR_METHOD_SIZE,
- LASTMODFILETIME_SIZE = 2,
- LASTMODFILEDATE_POS = LASTMODFILETIME_POS + LASTMODFILETIME_SIZE,
- LASTMODFILEDATE_SIZE = 2,
- CRC32_POS = LASTMODFILEDATE_POS + LASTMODFILEDATE_SIZE,
- CRC32_SIZE = 4,
- COMPRESSED_SIZE_POS = CRC32_POS + CRC32_SIZE,
- COMPRESSED_SIZE_SIZE = 4,
- UNCOMPRESSED_SIZE_POS = COMPRESSED_SIZE_POS + COMPRESSED_SIZE_SIZE,
- UNCOMPRESSED_SIZE_SIZE = 4,
- FILENAME_LENGTH_POS = UNCOMPRESSED_SIZE_POS + UNCOMPRESSED_SIZE_SIZE,
- FILENAME_LENGTH_SIZE = 2,
- EXTRAFIELD_LENGTH_POS = FILENAME_LENGTH_POS + FILENAME_LENGTH_SIZE,
- EXTRAFIELD_LENGTH_SIZE = 2,
- FILECOMMENT_LENGTH_POS = EXTRAFIELD_LENGTH_POS + EXTRAFIELD_LENGTH_SIZE,
- FILECOMMENT_LENGTH_SIZE = 2,
- DISKNUMBERSTART_POS = FILECOMMENT_LENGTH_POS + FILECOMMENT_LENGTH_SIZE,
- DISKNUMBERSTART_SIZE = 2,
- INTERNALFILE_ATTR_POS = DISKNUMBERSTART_POS + DISKNUMBERSTART_SIZE,
- INTERNALFILE_ATTR_SIZE = 2,
- EXTERNALFILE_ATTR_POS = INTERNALFILE_ATTR_POS + INTERNALFILE_ATTR_SIZE,
- EXTERNALFILE_ATTR_SIZE = 4,
- RELATIVEOFFSETLOCALHEADER_POS = EXTERNALFILE_ATTR_POS + EXTERNALFILE_ATTR_SIZE,
- RELATIVEOFFSETLOCALHEADER_SIZE = 4,
- FULLHEADER_SIZE = 46
- };
-
- enum
- {
- DEFAULT_UNIX_FILE_MODE = 0640,
- DEFAULT_UNIX_DIR_MODE = 0755
- };
-
- char _rawInfo[FULLHEADER_SIZE];
- Poco::UInt32 _crc32;
- Poco::UInt32 _compressedSize;
- Poco::UInt32 _uncompressedSize;
- std::string _fileName;
- Poco::DateTime _lastModifiedAt;
- std::string _extraField;
- std::string _fileComment;
-};
-
-
-inline Poco::UInt32 ZipFileInfo::getRelativeOffsetOfLocalHeader() const
-{
- return ZipUtil::get32BitValue(_rawInfo, RELATIVEOFFSETLOCALHEADER_POS);
-}
-
-
-inline Poco::UInt32 ZipFileInfo::getCRCFromHeader() const
-{
- return ZipUtil::get32BitValue(_rawInfo, CRC32_POS);
-}
-
-
-inline Poco::UInt32 ZipFileInfo::getCompressedSizeFromHeader() const
-{
- return ZipUtil::get32BitValue(_rawInfo, COMPRESSED_SIZE_POS);
-}
-
-
-inline Poco::UInt32 ZipFileInfo::getUncompressedSizeFromHeader() const
-{
- return ZipUtil::get32BitValue(_rawInfo, UNCOMPRESSED_SIZE_POS);
-}
-
-
-inline void ZipFileInfo::parseDateTime()
-{
- _lastModifiedAt = ZipUtil::parseDateTime(_rawInfo, LASTMODFILETIME_POS, LASTMODFILEDATE_POS);
-}
-
-
-inline ZipCommon::CompressionMethod ZipFileInfo::getCompressionMethod() const
-{
- return static_cast<ZipCommon::CompressionMethod>(ZipUtil::get16BitValue(_rawInfo, COMPR_METHOD_POS));
-}
-
-
-inline bool ZipFileInfo::isEncrypted() const
-{
- // bit 0 indicates encryption
- return ((ZipUtil::get16BitValue(_rawInfo, GENERAL_PURPOSE_POS) & 0x0001) != 0);
-}
-
-
-inline const Poco::DateTime& ZipFileInfo::lastModifiedAt() const
-{
- return _lastModifiedAt;
-}
-
-
-inline Poco::UInt32 ZipFileInfo::getCRC() const
-{
- return _crc32;
-}
-
-
-inline Poco::UInt32 ZipFileInfo::getCompressedSize() const
-{
- return _compressedSize;
-}
-
-
-inline Poco::UInt32 ZipFileInfo::getUncompressedSize() const
-{
- return _uncompressedSize;
-}
-
-
-inline const std::string& ZipFileInfo::getFileName() const
-{
- return _fileName;
-}
-
-
-inline bool ZipFileInfo::isFile() const
-{
- return !isDirectory();
-}
-
-
-inline bool ZipFileInfo::isDirectory() const
-{
- poco_assert_dbg(!_fileName.empty());
- return getUncompressedSize() == 0 && getCompressionMethod() == ZipCommon::CM_STORE && _fileName[_fileName.length()-1] == '/';
-}
-
-
-inline Poco::UInt16 ZipFileInfo::getFileNameLength() const
-{
- return ZipUtil::get16BitValue(_rawInfo, FILENAME_LENGTH_POS);
-}
-
-
-inline Poco::UInt16 ZipFileInfo::getExtraFieldLength() const
-{
- return ZipUtil::get16BitValue(_rawInfo, EXTRAFIELD_LENGTH_POS);
-}
-
-
-inline bool ZipFileInfo::hasExtraField() const
-{
- return getExtraFieldLength() > 0;
-}
-
-
-inline const std::string& ZipFileInfo::getExtraField() const
-{
- return _extraField;
-}
-
-
-inline const std::string& ZipFileInfo::getFileComment() const
-{
- return _fileComment;
-}
-
-
-inline Poco::UInt16 ZipFileInfo::getFileCommentLength() const
-{
- return ZipUtil::get16BitValue(_rawInfo, FILECOMMENT_LENGTH_POS);
-}
-
-
-inline void ZipFileInfo::getVersionMadeBy(int& major, int& minor)
-{
- major = (_rawInfo[VERSIONMADEBY_POS]/10);
- minor = (_rawInfo[VERSIONMADEBY_POS]%10);
-}
-
-
-inline void ZipFileInfo::getRequiredVersion(int& major, int& minor)
-{
- major = (_rawInfo[VERSION_NEEDED_POS]/10);
- minor = (_rawInfo[VERSION_NEEDED_POS]%10);
-}
-
-
-inline ZipCommon::HostSystem ZipFileInfo::getHostSystem() const
-{
- return static_cast<ZipCommon::HostSystem>(_rawInfo[VERSION_NEEDED_POS + 1]);
-}
-
-
-inline Poco::UInt16 ZipFileInfo::getDiskNumberStart() const
-{
- return ZipUtil::get16BitValue(_rawInfo, DISKNUMBERSTART_POS);
-}
-
-
-inline ZipCommon::FileType ZipFileInfo::getFileType() const
-{
- return static_cast<ZipCommon::FileType>(_rawInfo[INTERNALFILE_ATTR_POS] & 0x01);
-}
-
-
-inline Poco::UInt32 ZipFileInfo::getExternalFileAttributes() const
-{
- return ZipUtil::get32BitValue(_rawInfo, EXTERNALFILE_ATTR_POS);
-}
-
-
-inline Poco::UInt32 ZipFileInfo::getHeaderSize() const
-{
- return FULLHEADER_SIZE + getFileNameLength() + getExtraFieldLength() + getFileCommentLength();
-}
-
-
-inline void ZipFileInfo::setCRC(Poco::UInt32 val)
-{
- _crc32 = val;
- ZipUtil::set32BitValue(val, _rawInfo, CRC32_POS);
-}
-
-
-inline void ZipFileInfo::setOffset(Poco::UInt32 val)
-{
- ZipUtil::set32BitValue(val, _rawInfo, RELATIVEOFFSETLOCALHEADER_POS);
-}
-
-
-inline void ZipFileInfo::setCompressedSize(Poco::UInt32 val)
-{
- _compressedSize = val;
- ZipUtil::set32BitValue(val, _rawInfo, COMPRESSED_SIZE_POS);
-}
-
-
-inline void ZipFileInfo::setUncompressedSize(Poco::UInt32 val)
-{
- _uncompressedSize = val;
- ZipUtil::set32BitValue(val, _rawInfo, UNCOMPRESSED_SIZE_POS);
-}
-
-
-inline void ZipFileInfo::setCompressionMethod(ZipCommon::CompressionMethod cm)
-{
- ZipUtil::set16BitValue(static_cast<Poco::UInt16>(cm), _rawInfo, COMPR_METHOD_POS);
-}
-
-
-inline void ZipFileInfo::setCompressionLevel(ZipCommon::CompressionLevel cl)
-{
- // bit 1 and 2 indicate the level
- Poco::UInt16 val = static_cast<Poco::UInt16>(cl);
- val <<= 1;
- Poco::UInt16 mask = 0xfff9;
- _rawInfo[GENERAL_PURPOSE_POS] = ((_rawInfo[GENERAL_PURPOSE_POS] & mask) | val);
-}
-
-
-inline void ZipFileInfo::setFileNameLength(Poco::UInt16 size)
-{
- ZipUtil::set16BitValue(size, _rawInfo, FILENAME_LENGTH_POS);
-}
-
-
-inline void ZipFileInfo::setHostSystem(ZipCommon::HostSystem hs)
-{
- _rawInfo[VERSIONMADEBY_POS + 1] = static_cast<char>(hs);
- _rawInfo[VERSION_NEEDED_POS + 1] = static_cast<char>(hs);
-}
-
-
-inline void ZipFileInfo::setRequiredVersion(int major, int minor)
-{
- poco_assert (minor < 10);
- poco_assert (major < 24);
- Poco::UInt8 val = static_cast<unsigned char>(major)*10+static_cast<unsigned char>(minor);
- _rawInfo[VERSIONMADEBY_POS] = static_cast<char>(val);
- _rawInfo[VERSION_NEEDED_POS] = static_cast<char>(val);
-}
-
-
-inline void ZipFileInfo::setLastModifiedAt(const Poco::DateTime& dt)
-{
- _lastModifiedAt = dt;
- ZipUtil::setDateTime(dt, _rawInfo, LASTMODFILETIME_POS, LASTMODFILEDATE_POS);
-}
-
-
-inline void ZipFileInfo::setEncryption(bool val)
-{
- if (val)
- _rawInfo[GENERAL_PURPOSE_POS] |= 0x01;
- else
- _rawInfo[GENERAL_PURPOSE_POS] &= 0xfe;
-}
-
-
-inline void ZipFileInfo::setFileName(const std::string& str)
-{
- _fileName = str;
- setFileNameLength(static_cast<Poco::UInt16>(str.size()));
-}
-
-
-inline void ZipFileInfo::setExternalFileAttributes(Poco::UInt32 attrs)
-{
- ZipUtil::set32BitValue(attrs, _rawInfo, EXTERNALFILE_ATTR_POS);
-}
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipFileInfo_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipLocalFileHeader.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipLocalFileHeader.h
deleted file mode 100644
index ab313e576f..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipLocalFileHeader.h
+++ /dev/null
@@ -1,486 +0,0 @@
-//
-// ZipLocalFileHeader.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipLocalFileHeader
-//
-// Definition of the ZipLocalFileHeader class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipLocalFileHeader_INCLUDED
-#define Zip_ZipLocalFileHeader_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipUtil.h"
-#include "Poco/Zip/ZipCommon.h"
-#include "Poco/DateTime.h"
-#include "Poco/Path.h"
-#include <istream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-class ParseCallback;
-
-
-class Zip_API ZipLocalFileHeader
- /// Stores a Zip local file header
-{
-public:
- static const char HEADER[ZipCommon::HEADER_SIZE];
-
- ZipLocalFileHeader(const Poco::Path& fileName, const Poco::DateTime& lastModifiedAt, ZipCommon::CompressionMethod cm, ZipCommon::CompressionLevel cl);
- /// Creates a zip file header from an absoluteFile. fileName is the name of the file in the zip, outputIsSeekable determines if we write
- /// CRC and file sizes to the LocalFileHeader or after data compression into a ZipDataInfo
-
- ZipLocalFileHeader(std::istream& inp, bool assumeHeaderRead, ParseCallback& callback);
- /// Creates the ZipLocalFileHeader by parsing the input stream.
- /// If assumeHeaderRead is true we assume that the first 4 bytes were already read outside.
- /// If skipOverDataBlock is true we position the stream after the data block (either at the next FileHeader or the Directory Entry)
-
- virtual ~ZipLocalFileHeader();
- /// Destroys the ZipLocalFileHeader.
-
- ZipCommon::HostSystem getHostSystem() const;
-
- int getMajorVersionNumber() const;
-
- int getMinorVersionNumber() const;
-
- void getRequiredVersion(int& major, int& minor);
- /// The minimum version required to extract the data
-
- Poco::UInt32 getHeaderSize() const;
- /// Returns the total size of the header including filename + extra field size
-
- void setStartPos(std::streamoff start);
- /// Sets the start position to start and the end position to start+compressedSize
-
- std::streamoff getStartPos() const;
- /// Returns the position of the first byte of the header in the file stream
-
- std::streamoff getEndPos() const;
- /// Points past the last byte of the file entry (ie. either the first byte of the next header, or the directory)
-
- std::streamoff getDataStartPos() const;
- /// Returns the streamoffset for the very first byte of data. Will be equal to DataEndPos if no data present
-
- std::streamoff getDataEndPos() const;
-
- ZipCommon::CompressionMethod getCompressionMethod() const;
-
- ZipCommon::CompressionLevel getCompressionLevel() const;
- /// Returns the compression level used. Only valid when the compression method is CM_DEFLATE
-
- bool isEncrypted() const;
-
- const Poco::DateTime& lastModifiedAt() const;
-
- Poco::UInt32 getCRC() const;
-
- Poco::UInt32 getCompressedSize() const;
-
- Poco::UInt32 getUncompressedSize() const;
-
- void setCRC(Poco::UInt32 val);
-
- void setCompressedSize(Poco::UInt32 val);
-
- void setUncompressedSize(Poco::UInt32 val);
-
- const std::string& getFileName() const;
-
- bool isFile() const;
-
- bool isDirectory() const;
-
- bool hasExtraField() const;
-
- const std::string& getExtraField() const;
-
- bool hasData() const;
-
- bool searchCRCAndSizesAfterData() const;
-
- void setSearchCRCAndSizesAfterData(bool val);
-
- void setFileName(const std::string& fileName, bool isDirectory);
-
- std::string createHeader() const;
- /// Creates a header
-
-private:
- void parse(std::istream& inp, bool assumeHeaderRead);
-
- void parseDateTime();
-
- void init(const Poco::Path& fileName, ZipCommon::CompressionMethod cm, ZipCommon::CompressionLevel cl);
-
- Poco::UInt16 getFileNameLength() const;
-
- Poco::UInt16 getExtraFieldLength() const;
-
- Poco::UInt32 getCRCFromHeader() const;
-
- Poco::UInt32 getCompressedSizeFromHeader() const;
-
- Poco::UInt32 getUncompressedSizeFromHeader() const;
-
- void setRequiredVersion(int major, int minor);
-
- void setHostSystem(ZipCommon::HostSystem hs);
-
- void setLastModifiedAt(const Poco::DateTime& dt);
-
- void setEncryption(bool val);
-
- void setFileNameLength(Poco::UInt16 size);
-
- void setExtraFieldSize(Poco::UInt16 size);
-
- void setCompressionMethod(ZipCommon::CompressionMethod cm);
-
- void setCompressionLevel(ZipCommon::CompressionLevel cl);
-
-private:
- enum
- {
- HEADER_POS = 0,
- VERSION_SIZE = 2,
- VERSION_POS = HEADER_POS+ZipCommon::HEADER_SIZE,
- GENERAL_PURPOSE_SIZE = 2,
- GENERAL_PURPOSE_POS = VERSION_POS + VERSION_SIZE,
- COMPR_METHOD_SIZE = 2,
- COMPR_METHOD_POS = GENERAL_PURPOSE_POS + GENERAL_PURPOSE_SIZE,
- LASTMODEFILETIME_SIZE = 2,
- LASTMODEFILETIME_POS = COMPR_METHOD_POS + COMPR_METHOD_SIZE,
- LASTMODEFILEDATE_SIZE = 2,
- LASTMODEFILEDATE_POS = LASTMODEFILETIME_POS + LASTMODEFILETIME_SIZE,
- CRC32_SIZE = 4,
- CRC32_POS = LASTMODEFILEDATE_POS + LASTMODEFILEDATE_SIZE,
- COMPRESSEDSIZE_SIZE = 4,
- COMPRESSEDSIZE_POS = CRC32_POS + CRC32_SIZE,
- UNCOMPRESSEDSIZE_SIZE = 4,
- UNCOMPRESSEDSIZE_POS = COMPRESSEDSIZE_POS + COMPRESSEDSIZE_SIZE,
- FILELENGTH_SIZE = 2,
- FILELENGTH_POS = UNCOMPRESSEDSIZE_POS + UNCOMPRESSEDSIZE_SIZE,
- EXTRAFIELD_LENGTH = 2,
- EXTRAFIELD_POS = FILELENGTH_POS + FILELENGTH_SIZE,
- FULLHEADER_SIZE = 30
- };
-
- char _rawHeader[FULLHEADER_SIZE];
- std::streamoff _startPos;
- std::streamoff _endPos;
- std::string _fileName;
- Poco::DateTime _lastModifiedAt;
- std::string _extraField;
- Poco::UInt32 _crc32;
- Poco::UInt32 _compressedSize;
- Poco::UInt32 _uncompressedSize;
-};
-
-
-inline void ZipLocalFileHeader::setFileNameLength(Poco::UInt16 size)
-{
- ZipUtil::set16BitValue(size, _rawHeader, FILELENGTH_POS);
-}
-
-
-inline void ZipLocalFileHeader::setExtraFieldSize(Poco::UInt16 size)
-{
- ZipUtil::set16BitValue(size, _rawHeader, EXTRAFIELD_POS);
-}
-
-
-inline ZipCommon::HostSystem ZipLocalFileHeader::getHostSystem() const
-{
- return static_cast<ZipCommon::HostSystem>(_rawHeader[VERSION_POS + 1]);
-}
-
-
-inline void ZipLocalFileHeader::setHostSystem(ZipCommon::HostSystem hs)
-{
- _rawHeader[VERSION_POS + 1] = static_cast<char>(hs);
-}
-
-
-inline int ZipLocalFileHeader::getMajorVersionNumber() const
-{
- return (_rawHeader[VERSION_POS]/10);
-}
-
-
-inline int ZipLocalFileHeader::getMinorVersionNumber() const
-{
- return (_rawHeader[VERSION_POS]%10);
-}
-
-
-inline void ZipLocalFileHeader::getRequiredVersion(int& major, int& minor)
-{
- major = getMajorVersionNumber();
- minor = getMinorVersionNumber();
-}
-
-
-inline void ZipLocalFileHeader::setRequiredVersion(int major, int minor)
-{
- poco_assert (minor < 10);
- poco_assert (major < 24);
- _rawHeader[VERSION_POS] = static_cast<char>(static_cast<unsigned char>(major)*10+static_cast<unsigned char>(minor));
-}
-
-inline Poco::UInt16 ZipLocalFileHeader::getFileNameLength() const
-{
- return ZipUtil::get16BitValue(_rawHeader, FILELENGTH_POS);
-}
-
-
-inline Poco::UInt16 ZipLocalFileHeader::getExtraFieldLength() const
-{
- return ZipUtil::get16BitValue(_rawHeader, EXTRAFIELD_POS);
-}
-
-
-inline Poco::UInt32 ZipLocalFileHeader::getHeaderSize() const
-{
- return FULLHEADER_SIZE+getExtraFieldLength()+getFileNameLength();
-}
-
-
-inline std::streamoff ZipLocalFileHeader::getStartPos() const
-{
- return _startPos;
-}
-
-
-inline void ZipLocalFileHeader::setStartPos(std::streamoff start)
-{
- _startPos = start;
- _endPos = start + getHeaderSize()+getCompressedSize();
-}
-
-
-inline std::streamoff ZipLocalFileHeader::getEndPos() const
-{
- return _endPos;
-}
-
-
-inline void ZipLocalFileHeader::parseDateTime()
-{
- _lastModifiedAt = ZipUtil::parseDateTime(_rawHeader, LASTMODEFILETIME_POS, LASTMODEFILEDATE_POS);
-}
-
-
-inline void ZipLocalFileHeader::setLastModifiedAt(const Poco::DateTime& dt)
-{
- _lastModifiedAt = dt;
- ZipUtil::setDateTime(dt, _rawHeader, LASTMODEFILETIME_POS, LASTMODEFILEDATE_POS);
-}
-
-
-inline ZipCommon::CompressionMethod ZipLocalFileHeader::getCompressionMethod() const
-{
- return static_cast<ZipCommon::CompressionMethod>(ZipUtil::get16BitValue(_rawHeader, COMPR_METHOD_POS));
-}
-
-
-inline ZipCommon::CompressionLevel ZipLocalFileHeader::getCompressionLevel() const
-{
- // bit 1 and 2 indicate the level
- return static_cast<ZipCommon::CompressionLevel>((ZipUtil::get16BitValue(_rawHeader, GENERAL_PURPOSE_POS)>>1) & 0x0003);
-}
-
-
-inline void ZipLocalFileHeader::setCompressionMethod(ZipCommon::CompressionMethod cm)
-{
- ZipUtil::set16BitValue(static_cast<Poco::UInt16>(cm), _rawHeader, COMPR_METHOD_POS);
-}
-
-
-inline void ZipLocalFileHeader::setCompressionLevel(ZipCommon::CompressionLevel cl)
-{
- // bit 1 and 2 indicate the level
- Poco::UInt16 val = static_cast<Poco::UInt16>(cl);
- val <<= 1;
- Poco::UInt16 mask = 0xfff9;
- _rawHeader[GENERAL_PURPOSE_POS] = ((_rawHeader[GENERAL_PURPOSE_POS] & mask) | val);
-}
-
-
-inline bool ZipLocalFileHeader::isEncrypted() const
-{
- // bit 0 indicates encryption
- return ((ZipUtil::get16BitValue(_rawHeader, GENERAL_PURPOSE_POS) & 0x0001) != 0);
-}
-
-
-inline void ZipLocalFileHeader::setEncryption(bool val)
-{
- if (val)
- _rawHeader[GENERAL_PURPOSE_POS] |= 0x01;
- else
- _rawHeader[GENERAL_PURPOSE_POS] &= 0xfe;
-}
-
-
-inline void ZipLocalFileHeader::setSearchCRCAndSizesAfterData(bool val)
-{
- //set bit 3 of general purpose reg
- if (val)
- _rawHeader[GENERAL_PURPOSE_POS] |= 0x08;
- else
- _rawHeader[GENERAL_PURPOSE_POS] &= 0xf7;
-}
-
-
-inline const Poco::DateTime& ZipLocalFileHeader::lastModifiedAt() const
-{
- return _lastModifiedAt;
-}
-
-
-inline Poco::UInt32 ZipLocalFileHeader::getCRC() const
-{
- return _crc32;
-}
-
-
-inline Poco::UInt32 ZipLocalFileHeader::getCompressedSize() const
-{
- return _compressedSize;
-}
-
-
-inline Poco::UInt32 ZipLocalFileHeader::getUncompressedSize() const
-{
- return _uncompressedSize;
-}
-
-
-inline void ZipLocalFileHeader::setCRC(Poco::UInt32 val)
-{
- _crc32 = val;
- ZipUtil::set32BitValue(val, _rawHeader, CRC32_POS);
-}
-
-
-inline void ZipLocalFileHeader::setCompressedSize(Poco::UInt32 val)
-{
- _compressedSize = val;
- ZipUtil::set32BitValue(val, _rawHeader, COMPRESSEDSIZE_POS);
-}
-
-
-inline void ZipLocalFileHeader::setUncompressedSize(Poco::UInt32 val)
-{
- _uncompressedSize = val;
- ZipUtil::set32BitValue(val, _rawHeader, UNCOMPRESSEDSIZE_POS);
-}
-
-
-inline Poco::UInt32 ZipLocalFileHeader::getCRCFromHeader() const
-{
- return ZipUtil::get32BitValue(_rawHeader, CRC32_POS);
-}
-
-
-inline Poco::UInt32 ZipLocalFileHeader::getCompressedSizeFromHeader() const
-{
- return ZipUtil::get32BitValue(_rawHeader, COMPRESSEDSIZE_POS);
-}
-
-
-inline Poco::UInt32 ZipLocalFileHeader::getUncompressedSizeFromHeader() const
-{
- return ZipUtil::get32BitValue(_rawHeader, UNCOMPRESSEDSIZE_POS);
-}
-
-
-inline const std::string& ZipLocalFileHeader::getFileName() const
-{
- return _fileName;
-}
-
-
-inline bool ZipLocalFileHeader::isFile() const
-{
- return !isDirectory();
-}
-
-
-inline bool ZipLocalFileHeader::isDirectory() const
-{
- poco_assert_dbg(!_fileName.empty());
- return getUncompressedSize() == 0 && getCompressionMethod() == ZipCommon::CM_STORE && _fileName[_fileName.length()-1] == '/';
-}
-
-
-inline bool ZipLocalFileHeader::hasExtraField() const
-{
- return getExtraFieldLength() > 0;
-}
-
-
-inline const std::string& ZipLocalFileHeader::getExtraField() const
-{
- return _extraField;
-}
-
-
-inline bool ZipLocalFileHeader::hasData() const
-{
- return (getCompressedSize() > 0);
-}
-
-
-inline std::streamoff ZipLocalFileHeader::getDataStartPos() const
-{
- return getStartPos() + getHeaderSize();
-}
-
-
-inline std::streamoff ZipLocalFileHeader::getDataEndPos() const
-{
- return getDataStartPos()+getCompressedSize();
-}
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipLocalFileHeader_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipManipulator.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipManipulator.h
deleted file mode 100644
index 7f3c3225df..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipManipulator.h
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// ZipManipulator.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: ZipManipulator
-//
-// Definition of the ZipManipulator class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipManipulator_INCLUDED
-#define Zip_ZipManipulator_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipArchive.h"
-#include "Poco/Zip/ZipCommon.h"
-#include "Poco/Zip/ZipOperation.h"
-#include "Poco/FIFOEvent.h"
-#include "Poco/SharedPtr.h"
-#include <map>
-
-
-namespace Poco {
-namespace Zip {
-
-
-class ZipArchive;
-
-
-class Zip_API ZipManipulator
- /// ZipManipulator allows to add/remove/update files inside zip files
-{
-public:
- Poco::FIFOEvent<const ZipLocalFileHeader> EDone;
- // Fired for each entry once commit is invoked
-
- ZipManipulator(const std::string& zipFile, bool backupOriginalFile);
- /// Creates the ZipManipulator.
-
- virtual ~ZipManipulator();
- /// Destroys the ZipManipulator.
-
- void deleteFile(const std::string& zipPath);
- /// Removes the given file from the Zip archive.
-
- void replaceFile(const std::string& zipPath, const std::string& localPath);
- /// Replaces the contents of the file in the archive with the contents
- /// from the file given by localPath.
-
- void renameFile(const std::string& zipPath, const std::string& newZipPath);
- /// Renames the file in the archive to newZipPath
-
- void addFile(const std::string& zipPath, const std::string& localPath, ZipCommon::CompressionMethod cm = ZipCommon::CM_DEFLATE, ZipCommon::CompressionLevel cl = ZipCommon::CL_MAXIMUM);
- /// Adds a file to the zip file.
-
- ZipArchive commit();
- /// Commits all changes and re-creates the Zip File with the changes applied.
- /// Returns the ZipArchive for the newly created archive
- ///
- /// Changes will be first written to a temporary file,
- /// then the originalfile will be either deleted or renamed to .bak,
- /// then, the temp file will be renamed to the original zip file name.
-
- const ZipArchive& originalArchive() const;
- /// Returns the original archive information
-
-private:
- const ZipLocalFileHeader& getForChange(const std::string& zipPath) const;
- /// Searches for the entry given by the zipPath.
- /// Throws an exception if the entry does not exist
- /// or if an entry already exists in the Changeslist
-
- void addOperation(const std::string& zipPath, ZipOperation::Ptr ptrOp);
- /// Adds the operation to the changes list. Throws an exception if an
- /// entry for the zipPath already exists
-
- void onEDone(const void* pSender, const ZipLocalFileHeader& hdr);
- /// Forwards the event to the EDone event
-
- ZipArchive compress(const std::string& outFile);
- /// Compresses the new file to outFile
-
-private:
- typedef std::map<std::string, ZipOperation::Ptr> Changes;
-
- const std::string _zipFile;
- bool _backupOriginalFile;
- Changes _changes;
- Poco::SharedPtr<ZipArchive> _in;
-};
-
-
-inline const ZipArchive& ZipManipulator::originalArchive() const
-{
- return *_in;
-}
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipManipulator_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipOperation.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipOperation.h
deleted file mode 100644
index 45bb3de69b..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipOperation.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// ZipOperation.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: ZipOperation
-//
-// Definition of the ZipOperation class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipOperation_INCLUDED
-#define Zip_ZipOperation_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/RefCountedObject.h"
-#include "Poco/AutoPtr.h"
-#include <ostream>
-#include <istream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-class Compress;
-
-
-class Zip_API ZipOperation: public Poco::RefCountedObject
- /// Abstract super class for operations on individual zip entries
-{
-public:
- typedef Poco::AutoPtr<ZipOperation> Ptr;
-
- ZipOperation();
- /// Creates the ZipOperation.
-
- virtual void execute(Compress& c, std::istream& input) = 0;
- /// Executes the operation
-
-protected:
- virtual ~ZipOperation();
- /// Destroys the ZipOperation.
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipOperation_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipStream.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipStream.h
deleted file mode 100644
index 3195bb3f08..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipStream.h
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// ZipStream.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipStream
-//
-// Definition of the ZipStream class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipStream_INCLUDED
-#define Zip_ZipStream_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/PartialStream.h"
-#include "Poco/SharedPtr.h"
-#include "Poco/BufferedStreamBuf.h"
-#include "Poco/Checksum.h"
-#include <istream>
-#include <ostream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-class ZipArchive;
-class ZipLocalFileHeader;
-
-
-class Zip_API ZipStreamBuf: public Poco::BufferedStreamBuf
- /// ZipStreamBuf is used to decompress single files from a Zip file.
-{
-public:
- ZipStreamBuf(std::istream& istr, const ZipLocalFileHeader& fileEntry, bool reposition);
- /// Creates the ZipStreamBuf. Set reposition to false, if you do on-the-fly decompression.
-
- ZipStreamBuf(std::ostream& ostr, ZipLocalFileHeader& fileEntry, bool reposition);
- /// Creates the ZipStreamBuf. Set reposition to false, if you do on-the-fly compression.
-
- virtual ~ZipStreamBuf();
- /// Destroys the ZipStreamBuf.
-
- void close();
- /// Informs a writing outputstream that writing is done for this stream
-
- bool crcValid() const;
- /// Call this method once all bytes were read from the input stream to determine if the CRC is valid
-
-protected:
- int readFromDevice(char* buffer, std::streamsize length);
-
- int writeToDevice(const char* buffer, std::streamsize length);
-
-private:
- enum
- {
- STREAM_BUFFER_SIZE = 1024
- };
-
- typedef Poco::SharedPtr<std::istream> PtrIStream;
- typedef Poco::SharedPtr<std::ostream> PtrOStream;
- std::istream* _pIstr;
- std::ostream* _pOstr;
- PtrIStream _ptrBuf;
- PtrOStream _ptrOBuf;
- PtrIStream _ptrHelper;
- Poco::SharedPtr<PartialOutputStream> _ptrOHelper;
- Poco::Checksum _crc32;
- Poco::UInt32 _expectedCrc32;
- bool _checkCRC;
- /// Note: we do not check crc if we decompress a streaming zip file and the crc is stored in the directory header
- Poco::UInt32 _bytesWritten;
- ZipLocalFileHeader* _pHeader;
-};
-
-
-class Zip_API ZipIOS: public virtual std::ios
- /// The base class for ZipInputStream and ZipOutputStream.
- ///
- /// This class is needed to ensure the correct initialization
- /// order of the stream buffer and base classes.
-{
-public:
- ZipIOS(std::istream& istr, const ZipLocalFileHeader& fileEntry, bool reposition);
- /// Creates the basic stream and connects it
- /// to the given input stream.
-
- ZipIOS(std::ostream& ostr, ZipLocalFileHeader& fileEntry, bool reposition);
- /// Creates the basic stream and connects it
- /// to the given output stream.
-
- ~ZipIOS();
- /// Destroys the stream.
-
- ZipStreamBuf* rdbuf();
- /// Returns a pointer to the underlying streambuf.
-
-protected:
- ZipStreamBuf _buf;
-};
-
-
-class Zip_API ZipInputStream: public ZipIOS, public std::istream
- /// This stream copies all characters read through it
- /// to one or multiple output streams.
-{
-public:
- ZipInputStream(std::istream& istr, const ZipLocalFileHeader& fileEntry, bool reposition = true);
- /// Creates the ZipInputStream and connects it
- /// to the given input stream.
-
- ~ZipInputStream();
- /// Destroys the ZipInputStream.
-
- bool crcValid() const;
- /// Call this method once all bytes were read from the input stream to determine if the CRC is valid
-};
-
-
-
-class Zip_API ZipOutputStream: public ZipIOS, public std::ostream
- /// This stream compresses all characters written through it
- /// to one output stream.
-{
-public:
- ZipOutputStream(std::ostream& ostr, ZipLocalFileHeader& fileEntry, bool seekableOutput);
- /// Creates the ZipOutputStream and connects it
- /// to the given output stream.
-
- ~ZipOutputStream();
- /// Destroys the ZipOutputStream.
-
- void close();
- /// Must be called for ZipOutputStreams!
-};
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipStream_INCLUDED
diff --git a/Utilities/Poco/Zip/include/Poco/Zip/ZipUtil.h b/Utilities/Poco/Zip/include/Poco/Zip/ZipUtil.h
deleted file mode 100644
index 992dbe0ac2..0000000000
--- a/Utilities/Poco/Zip/include/Poco/Zip/ZipUtil.h
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// ZipUtil.h
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipUtil
-//
-// Definition of the ZipUtil class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef Zip_ZipUtil_INCLUDED
-#define Zip_ZipUtil_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipCommon.h"
-#include "Poco/DateTime.h"
-#include "Poco/Path.h"
-#include <istream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-class ZipUtil
- /// A utility class used for parsing header information inside of zip files
-{
-public:
- static Poco::UInt16 get16BitValue(const char* pVal, const Poco::UInt32 pos);
-
- static Poco::UInt32 get32BitValue(const char* pVal, const Poco::UInt32 pos);
-
- static void set16BitValue(const Poco::UInt16 val, char* pVal, const Poco::UInt32 pos);
-
- static void set32BitValue(const Poco::UInt32 val, char* pVal, const Poco::UInt32 pos);
-
- static Poco::DateTime parseDateTime(const char* pVal, const Poco::UInt32 timePos, const Poco::UInt32 datePos);
-
- static void setDateTime(const Poco::DateTime& dt, char* pVal, const Poco::UInt32 timePos, const Poco::UInt32 datePos);
-
- static std::string fakeZLibInitString(ZipCommon::CompressionLevel cl);
-
- static void sync(std::istream& in);
- /// Searches the next valid header in the input stream, stops right before it
-
- static void verifyZipEntryFileName(const std::string& zipPath);
- /// Verifies that the name of the ZipEntry is a valid path
-
- static std::string validZipEntryFileName(const Poco::Path& entry);
-
-private:
- ZipUtil();
- ~ZipUtil();
- ZipUtil(const ZipUtil&);
- ZipUtil& operator=(const ZipUtil&);
-};
-
-
-inline Poco::UInt16 ZipUtil::get16BitValue(const char* pVal, const Poco::UInt32 pos)
-{
- return static_cast<Poco::UInt16>((unsigned char)pVal[pos])+ (static_cast<Poco::UInt16>((unsigned char)pVal[pos+1]) << 8);
-}
-
-
-inline Poco::UInt32 ZipUtil::get32BitValue(const char* pVal, const Poco::UInt32 pos)
-{
- return static_cast<Poco::UInt32>((unsigned char)pVal[pos])+ (static_cast<Poco::UInt32>((unsigned char)pVal[pos+1]) << 8)+
- (static_cast<Poco::UInt32>((unsigned char)pVal[pos+2]) << 16) + (static_cast<Poco::UInt32>((unsigned char)pVal[pos+3]) << 24);
-}
-
-
-inline void ZipUtil::set16BitValue(const Poco::UInt16 val, char* pVal, const Poco::UInt32 pos)
-{
- pVal[pos] = static_cast<char>(val);
- pVal[pos+1] = static_cast<char>(val>>8);
-}
-
-
-inline void ZipUtil::set32BitValue(const Poco::UInt32 val, char* pVal, const Poco::UInt32 pos)
-{
- pVal[pos] = static_cast<char>(val);
- pVal[pos+1] = static_cast<char>(val>>8);
- pVal[pos+2] = static_cast<char>(val>>16);
- pVal[pos+3] = static_cast<char>(val>>24);
-}
-
-
-} } // namespace Poco::Zip
-
-
-#endif // Zip_ZipUtil_INCLUDED
diff --git a/Utilities/Poco/Zip/src/Add.cpp b/Utilities/Poco/Zip/src/Add.cpp
deleted file mode 100644
index d6c9d5a5a2..0000000000
--- a/Utilities/Poco/Zip/src/Add.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// Add.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: Add
-//
-// Copyright (c) 2007, 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/Zip/Add.h"
-#include "Poco/Zip/Compress.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-Add::Add(const std::string& zipPath, const std::string& localPath, ZipCommon::CompressionMethod cm, ZipCommon::CompressionLevel cl):
- _zipPath(zipPath),
- _localPath(localPath),
- _cm(cm),
- _cl(cl)
-{
-}
-
-
-void Add::execute(Compress& c, std::istream& input)
-{
- c.addFile(Poco::Path(_localPath), Poco::Path(_zipPath), _cm, _cl);
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/AutoDetectStream.cpp b/Utilities/Poco/Zip/src/AutoDetectStream.cpp
deleted file mode 100644
index 0a49afda15..0000000000
--- a/Utilities/Poco/Zip/src/AutoDetectStream.cpp
+++ /dev/null
@@ -1,252 +0,0 @@
-//
-// AutoDetectStream.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: AutoDetectStream
-//
-// Copyright (c) 2007, 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/Zip/AutoDetectStream.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-#include "Poco/Zip/ZipArchiveInfo.h"
-#include "Poco/Zip/ZipDataInfo.h"
-#include "Poco/Zip/ZipFileInfo.h"
-#include "Poco/Exception.h"
-#include <cstring>
-
-
-namespace Poco {
-namespace Zip {
-
-
-AutoDetectStreamBuf::AutoDetectStreamBuf(std::istream& in, const std::string& pre, const std::string& post, bool reposition, Poco::UInt32 start):
- Poco::BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::in),
- _pIstr(&in),
- _pOstr(0),
- _eofDetected(false),
- _matchCnt(0),
- _prefix(pre),
- _postfix(post),
- _reposition(reposition),
- _start(start)
-{
-}
-
-
-AutoDetectStreamBuf::AutoDetectStreamBuf(std::ostream& out):
- Poco::BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::out),
- _pIstr(0),
- _pOstr(&out),
- _eofDetected(false),
- _matchCnt(0),
- _prefix(),
- _postfix(),
- _reposition(false),
- _start(0u)
-{
-}
-
-
-AutoDetectStreamBuf::~AutoDetectStreamBuf()
-{
-}
-
-
-int AutoDetectStreamBuf::readFromDevice(char* buffer, std::streamsize length)
-{
- poco_assert_dbg(length >= 8);
- if (_pIstr == 0 ||length == 0) return -1;
-
- if (_reposition)
- {
- _pIstr->seekg(_start, std::ios_base::beg);
- _reposition = false;
- }
-
- if (!_prefix.empty())
- {
- std::streamsize tmp = (_prefix.size() > length)? length: static_cast<std::streamsize>(_prefix.size());
- std::memcpy(buffer, _prefix.c_str(), tmp);
- _prefix = _prefix.substr(tmp);
- return tmp;
- }
-
- if (_eofDetected)
- {
- if (!_postfix.empty())
- {
- std::streamsize tmp = (_postfix.size() > length)? length: static_cast<std::streamsize>(_postfix.size());
- std::memcpy(buffer, _postfix.c_str(), tmp);
- _postfix = _postfix.substr(tmp);
- return tmp;
- }
- else
- return -1;
- }
-
- if (!_pIstr->good())
- return -1;
-
- char byte3('\x00');
- std::streamsize tempPos = 0;
- static std::istream::int_type eof = std::istream::traits_type::eof();
- while (_pIstr->good() && !_pIstr->eof() && (tempPos+4) < length)
- {
- std::istream::int_type c = _pIstr->get();
- if (c != eof)
- {
- // all zip headers start with the same 2byte prefix
- if (_matchCnt<2)
- {
- if (c == ZipLocalFileHeader::HEADER[_matchCnt])
- ++_matchCnt;
- else
- {
- // matchcnt was either 0 or 1 the headers have all unique chars -> safe to set to 0
- if (_matchCnt == 1)
- {
- buffer[tempPos++] = ZipLocalFileHeader::HEADER[0];
- }
- _matchCnt = 0;
-
- buffer[tempPos++] = static_cast<char>(c);
- }
- }
- else
- {
- //the upper 2 bytes differ: the lower one must be in range 1,3,5,7, the upper must be one larger: 2,4,6,8
- if (_matchCnt == 2)
- {
- if (ZipLocalFileHeader::HEADER[2] == c ||
- ZipArchiveInfo::HEADER[2] == c ||
- ZipFileInfo::HEADER[2] == c ||
- ZipDataInfo::HEADER[2] == c)
- {
- byte3 = static_cast<char>(c);;
- _matchCnt++;
- }
- else
- {
- buffer[tempPos++] = ZipLocalFileHeader::HEADER[0];
- buffer[tempPos++] = ZipLocalFileHeader::HEADER[1];
- buffer[tempPos++] = static_cast<char>(c);
- _matchCnt = 0;
- }
- }
- else if (_matchCnt == 3)
- {
- if (c-1 == byte3)
- {
- // a match, pushback
- _pIstr->putback(c);
- _pIstr->putback(byte3);
- _pIstr->putback(ZipLocalFileHeader::HEADER[1]);
- _pIstr->putback(ZipLocalFileHeader::HEADER[0]);
- _eofDetected = true;
- return tempPos;
- }
- else
- {
- buffer[tempPos++] = ZipLocalFileHeader::HEADER[0];
- buffer[tempPos++] = ZipLocalFileHeader::HEADER[1];
- buffer[tempPos++] = byte3;
- buffer[tempPos++] = c;
- _matchCnt = 0; //the headers have all unique chars -> safe to set to 0
- }
- }
- }
- }
- }
-
- return tempPos;
-
-}
-
-
-int AutoDetectStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
-{
- if (_pOstr == 0 || length == 0) return -1;
- _pOstr->write(buffer, length);
- if (_pOstr->good())
- return length;
- throw Poco::IOException("Failed to write to output stream");
-}
-
-
-AutoDetectIOS::AutoDetectIOS(std::istream& istr, const std::string& pre, const std::string& post, bool reposition, Poco::UInt32 start):
- _buf(istr, pre, post, reposition, start)
-{
- poco_ios_init(&_buf);
-}
-
-
-AutoDetectIOS::AutoDetectIOS(std::ostream& ostr): _buf(ostr)
-{
- poco_ios_init(&_buf);
-}
-
-
-AutoDetectIOS::~AutoDetectIOS()
-{
-}
-
-
-AutoDetectStreamBuf* AutoDetectIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-AutoDetectInputStream::AutoDetectInputStream(std::istream& istr, const std::string& pre, const std::string& post, bool reposition, Poco::UInt32 start):
- AutoDetectIOS(istr, pre, post, reposition, start),
- std::istream(&_buf)
-{
-}
-
-
-AutoDetectInputStream::~AutoDetectInputStream()
-{
-}
-
-
-AutoDetectOutputStream::AutoDetectOutputStream(std::ostream& ostr):
- AutoDetectIOS(ostr),
- std::ostream(&_buf)
-{
-}
-
-
-AutoDetectOutputStream::~AutoDetectOutputStream()
-{
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/Compress.cpp b/Utilities/Poco/Zip/src/Compress.cpp
deleted file mode 100644
index 3c747e3299..0000000000
--- a/Utilities/Poco/Zip/src/Compress.cpp
+++ /dev/null
@@ -1,315 +0,0 @@
-//
-// Compress.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: Compress
-//
-// Copyright (c) 2007, 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/Zip/Compress.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-#include "Poco/Zip/ZipStream.h"
-#include "Poco/Zip/ZipArchiveInfo.h"
-#include "Poco/Zip/ZipDataInfo.h"
-#include "Poco/Zip/ZipException.h"
-#include "Poco/StreamCopier.h"
-#include "Poco/File.h"
-#include <fstream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-Compress::Compress(std::ostream& out, bool seekableOut):
- _out(out),
- _seekableOut(seekableOut),
- _files(),
- _infos(),
- _dirs(),
- _offset(0)
-{
-}
-
-
-Compress::~Compress()
-{
-}
-
-
-void Compress::addEntry(std::istream& in, const Poco::DateTime& lastModifiedAt, const Poco::Path& fileName, ZipCommon::CompressionMethod cm, ZipCommon::CompressionLevel cl)
-{
- std::string fn = ZipUtil::validZipEntryFileName(fileName);
-
- if (_files.size() >= 65535)
- throw ZipException("Maximum number of entries for a ZIP file reached: 65535");
- if (!in.good())
- throw ZipException("Invalid input stream");
-
- std::streamoff localHeaderOffset = _offset;
- ZipLocalFileHeader hdr(fileName, lastModifiedAt, cm, cl);
- hdr.setStartPos(localHeaderOffset);
-
- ZipOutputStream zipOut(_out, hdr, _seekableOut);
- Poco::StreamCopier::copyStream(in, zipOut);
- zipOut.close();
- hdr.setStartPos(localHeaderOffset); // reset again now that compressed Size is known
- _offset = hdr.getEndPos();
- if (hdr.searchCRCAndSizesAfterData())
- _offset += ZipDataInfo::getFullHeaderSize();
- _files.insert(std::make_pair(fileName.toString(Poco::Path::PATH_UNIX), hdr));
- poco_assert (_out);
- ZipFileInfo nfo(hdr);
- nfo.setOffset(localHeaderOffset);
- _infos.insert(std::make_pair(fileName.toString(Poco::Path::PATH_UNIX), nfo));
- EDone.notify(this, hdr);
-}
-
-
-void Compress::addFileRaw(std::istream& in, const ZipLocalFileHeader& h, const Poco::Path& fileName)
-{
- std::string fn = ZipUtil::validZipEntryFileName(fileName);
- //bypass the header of the input stream and point to the first byte of the data payload
- in.seekg(h.getDataStartPos(), std::ios_base::beg);
-
- if (_files.size() >= 65535)
- throw ZipException("Maximum number of entries for a ZIP file reached: 65535");
- if (!in.good())
- throw ZipException("Invalid input stream");
-
- std::streamoff localHeaderOffset = _offset;
- ZipLocalFileHeader hdr(h);
- hdr.setFileName(fn, h.isDirectory());
- hdr.setStartPos(localHeaderOffset);
- //bypass zipoutputstream
- //write the header directly
- std::string header = hdr.createHeader();
- _out.write(header.c_str(), static_cast<std::streamsize>(header.size()));
- // now fwd the payload to _out in chunks of size CHUNKSIZE
- Poco::UInt32 totalSize = hdr.getCompressedSize();
- if (totalSize > 0)
- {
- Poco::Buffer<char> buffer(COMPRESS_CHUNK_SIZE);
- Poco::UInt32 remaining = totalSize;
- while(remaining > 0)
- {
- if (remaining > COMPRESS_CHUNK_SIZE)
- {
- in.read(buffer.begin(), COMPRESS_CHUNK_SIZE);
- std::streamsize n = in.gcount();
- poco_assert_dbg (n == COMPRESS_CHUNK_SIZE);
- _out.write(buffer.begin(), n);
- remaining -= COMPRESS_CHUNK_SIZE;
- }
- else
- {
- in.read(buffer.begin(), remaining);
- std::streamsize n = in.gcount();
- poco_assert_dbg (n == remaining);
- _out.write(buffer.begin(), n);
- remaining = 0;
- }
- }
- }
- //write optional block afterwards
- if (hdr.searchCRCAndSizesAfterData())
- {
- ZipDataInfo info(in, false);
- _out.write(info.getRawHeader(), static_cast<std::streamsize>(info.getFullHeaderSize()));
- }
- hdr.setStartPos(localHeaderOffset); // reset again now that compressed Size is known
- _offset = hdr.getEndPos();
- if (hdr.searchCRCAndSizesAfterData())
- _offset += ZipDataInfo::getFullHeaderSize();
- _files.insert(std::make_pair(fileName.toString(Poco::Path::PATH_UNIX), hdr));
- poco_assert (_out);
- ZipFileInfo nfo(hdr);
- nfo.setOffset(localHeaderOffset);
- _infos.insert(std::make_pair(fileName.toString(Poco::Path::PATH_UNIX), nfo));
- EDone.notify(this, hdr);
-}
-
-
-void Compress::addFile(std::istream& in, const Poco::DateTime& lastModifiedAt, const Poco::Path& fileName, ZipCommon::CompressionMethod cm, ZipCommon::CompressionLevel cl)
-{
- if (!fileName.isFile())
- throw ZipException("Not a file: "+ fileName.toString());
-
- if (fileName.depth() > 1)
- {
- addDirectory(fileName.parent(), lastModifiedAt);
- }
- addEntry(in, lastModifiedAt, fileName, cm, cl);
-}
-
-
-void Compress::addFile(const Poco::Path& file, const Poco::Path& fileName, ZipCommon::CompressionMethod cm, ZipCommon::CompressionLevel cl)
-{
- Poco::File aFile(file);
- std::ifstream in(file.toString().c_str(), std::ios::binary);
- if (!in.good())
- throw ZipException("Invalid input stream for " + aFile.path());
- if (fileName.depth() > 1)
- {
- Poco::File aParent(file.parent());
- addDirectory(fileName.parent(), aParent.getLastModified());
- }
- addFile(in, aFile.getLastModified(), fileName, cm, cl);
-}
-
-
-void Compress::addDirectory(const Poco::Path& entryName, const Poco::DateTime& lastModifiedAt)
-{
- if (!entryName.isDirectory())
- throw ZipException("Not a directory: "+ entryName.toString());
-
- std::string fileStr = entryName.toString(Poco::Path::PATH_UNIX);
- if (_files.find(fileStr) != _files.end())
- return; // ignore duplicate add
- if (_files.size() >= 65535)
- throw ZipException("Maximum number of entries for a ZIP file reached: 65535");
- if (fileStr == "/")
- throw ZipException("Illegal entry name /");
- if (fileStr.empty())
- throw ZipException("Illegal empty entry name");
- if (fileStr.find(ZipCommon::ILLEGAL_PATH) != std::string::npos)
- throw ZipException("Illegal entry name " + fileStr + " containing " + ZipCommon::ILLEGAL_PATH);
-
- if (entryName.depth() > 1)
- {
- addDirectory(entryName.parent(), lastModifiedAt);
- }
-
- std::streamoff localHeaderOffset = _offset;
- ZipCommon::CompressionMethod cm = ZipCommon::CM_STORE;
- ZipCommon::CompressionLevel cl = ZipCommon::CL_NORMAL;
- ZipLocalFileHeader hdr(entryName, lastModifiedAt, cm, cl);
- hdr.setStartPos(localHeaderOffset);
- ZipOutputStream zipOut(_out, hdr, _seekableOut);
- zipOut.close();
- hdr.setStartPos(localHeaderOffset); // reset again now that compressed Size is known
- _offset = hdr.getEndPos();
- if (hdr.searchCRCAndSizesAfterData())
- _offset += ZipDataInfo::getFullHeaderSize();
- _files.insert(std::make_pair(entryName.toString(Poco::Path::PATH_UNIX), hdr));
- poco_assert (_out);
- ZipFileInfo nfo(hdr);
- nfo.setOffset(localHeaderOffset);
- _infos.insert(std::make_pair(entryName.toString(Poco::Path::PATH_UNIX), nfo));
- EDone.notify(this, hdr);
-}
-
-
-void Compress::addRecursive(const Poco::Path& entry, ZipCommon::CompressionLevel cl, bool excludeRoot, const Poco::Path& name)
-{
- Poco::File aFile(entry);
- if (!aFile.isDirectory())
- throw ZipException("Not a directory: "+ entry.toString());
- Poco::Path aName(name);
- aName.makeDirectory();
- if (!excludeRoot)
- {
- if (aName.depth() == 0)
- {
- Poco::Path tmp(entry);
- tmp.makeAbsolute(); // eliminate ../
- aName = Poco::Path(tmp[tmp.depth()-1]);
- aName.makeDirectory();
- }
-
- addDirectory(aName, aFile.getLastModified());
- }
-
- // iterate over children
- std::vector<std::string> children;
- aFile.list(children);
- std::vector<std::string>::const_iterator it = children.begin();
- std::vector<std::string>::const_iterator itEnd = children.end();
- for (; it != itEnd; ++it)
- {
- Poco::Path realFile(entry, *it);
- Poco::Path renamedFile(aName, *it);
- Poco::File aFile(realFile);
- if (aFile.isDirectory())
- {
- realFile.makeDirectory();
- renamedFile.makeDirectory();
- addRecursive(realFile, cl, false, renamedFile);
- }
- else
- {
- realFile.makeFile();
- renamedFile.makeFile();
- addFile(realFile, renamedFile, ZipCommon::CM_DEFLATE, cl);
- }
- }
-}
-
-
-ZipArchive Compress::close()
-{
- if (!_dirs.empty())
- return ZipArchive(_files, _infos, _dirs);
-
- poco_assert (_infos.size() == _files.size());
- poco_assert (_files.size() < 65536);
- Poco::UInt32 centralDirStart = _offset;
- Poco::UInt32 centralDirSize = 0;
- // write all infos
- ZipArchive::FileInfos::const_iterator it = _infos.begin();
- ZipArchive::FileInfos::const_iterator itEnd = _infos.end();
- for (; it != itEnd; ++it)
- {
- const ZipFileInfo& nfo = it->second;
- std::string info(nfo.createHeader());
- _out.write(info.c_str(), static_cast<std::streamsize>(info.size()));
- Poco::UInt32 entrySize = static_cast<Poco::UInt32>(info.size());
- centralDirSize += entrySize;
- _offset += entrySize;
- }
- poco_assert (_out);
-
-
- Poco::UInt16 numEntries = static_cast<Poco::UInt16>(_infos.size());
- ZipArchiveInfo central;
- central.setCentralDirectorySize(centralDirSize);
- central.setNumberOfEntries(numEntries);
- central.setTotalNumberOfEntries(numEntries);
- central.setHeaderOffset(centralDirStart);
- std::string centr(central.createHeader());
- _out.write(centr.c_str(), static_cast<std::streamsize>(centr.size()));
- _out.flush();
- _dirs.insert(std::make_pair(0, central));
- return ZipArchive(_files, _infos, _dirs);
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/Decompress.cpp b/Utilities/Poco/Zip/src/Decompress.cpp
deleted file mode 100644
index 7539000ee9..0000000000
--- a/Utilities/Poco/Zip/src/Decompress.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-// Decompress.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: Decompress
-//
-// Copyright (c) 2007, 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/Zip/Decompress.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-#include "Poco/Zip/ZipArchive.h"
-#include "Poco/Zip/ZipStream.h"
-#include "Poco/Zip/ZipException.h"
-#include "Poco/File.h"
-#include "Poco/Exception.h"
-#include "Poco/StreamCopier.h"
-#include "Poco/Delegate.h"
-#include <fstream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-Decompress::Decompress(std::istream& in, const Poco::Path& outputDir, bool flattenDirs, bool keepIncompleteFiles):
- _in(in),
- _outDir(outputDir),
- _flattenDirs(flattenDirs),
- _keepIncompleteFiles(keepIncompleteFiles),
- _mapping()
-{
- _outDir.makeAbsolute();
- _outDir.makeDirectory();
- poco_assert (_in.good());
- Poco::File tmp(_outDir);
- if (!tmp.exists())
- {
- tmp.createDirectories();
- }
- if (!tmp.isDirectory())
- throw Poco::IOException("Failed to create/open directory: " + _outDir.toString());
- EOk += Poco::Delegate<Decompress, std::pair<const ZipLocalFileHeader, const Poco::Path> >(this, &Decompress::onOk);
-
-}
-
-
-Decompress::~Decompress()
-{
- EOk -= Poco::Delegate<Decompress, std::pair<const ZipLocalFileHeader, const Poco::Path> >(this, &Decompress::onOk);
-}
-
-
-ZipArchive Decompress::decompressAllFiles()
-{
- poco_assert (_mapping.empty());
- ZipArchive arch(_in, *this);
- return arch;
-}
-
-
-bool Decompress::handleZipEntry(std::istream& zipStream, const ZipLocalFileHeader& hdr)
-{
- if (hdr.isDirectory())
- {
- // directory have 0 size, nth to read
- if (!_flattenDirs)
- {
- std::string dirName = hdr.getFileName();
- if (dirName.find(ZipCommon::ILLEGAL_PATH) != std::string::npos)
- throw ZipException("Illegal entry name " + dirName + " containing " + ZipCommon::ILLEGAL_PATH);
- Poco::Path dir(_outDir, dirName);
- dir.makeDirectory();
- Poco::File aFile(dir);
- aFile.createDirectories();
- }
- return true;
- }
- try
- {
- std::string fileName = hdr.getFileName();
- if (_flattenDirs)
- {
- // remove path info
- Poco::Path p(fileName);
- p.makeFile();
- fileName = p.getFileName();
- }
-
- if (fileName.find(ZipCommon::ILLEGAL_PATH) != std::string::npos)
- throw ZipException("Illegal entry name " + fileName + " containing " + ZipCommon::ILLEGAL_PATH);
-
- Poco::Path file(fileName);
- file.makeFile();
- Poco::Path dest(_outDir, file);
- dest.makeFile();
- if (dest.depth() > 0)
- {
- Poco::File aFile(dest.parent());
- aFile.createDirectories();
- }
- std::ofstream out(dest.toString().c_str(), std::ios::binary);
- if (!out)
- {
- std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, "Failed to open output stream " + dest.toString());
- EError.notify(this, tmp);
- return false;
- }
- ZipInputStream inp(zipStream, hdr, false);
- Poco::StreamCopier::copyStream(inp, out);
- out.close();
- Poco::File aFile(dest.toString());
- if (!aFile.exists() || !aFile.isFile())
- {
- std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, "Failed to create output stream " + dest.toString());
- EError.notify(this, tmp);
- return false;
- }
-
- if (!inp.crcValid())
- {
- if (!_keepIncompleteFiles)
- aFile.remove();
- std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, "CRC mismatch. Corrupt file: " + dest.toString());
- EError.notify(this, tmp);
- return false;
- }
-
- // cannot check against hdr.getUnCompressedSize if CRC and size are not set in hdr but in a ZipDataInfo
- // crc is typically enough to detect errors
- if (aFile.getSize() != hdr.getUncompressedSize() && !hdr.searchCRCAndSizesAfterData())
- {
- if (!_keepIncompleteFiles)
- aFile.remove();
- std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, "Filesizes do not match. Corrupt file: " + dest.toString());
- EError.notify(this, tmp);
- return false;
- }
-
- std::pair<const ZipLocalFileHeader, const Poco::Path> tmp = std::make_pair(hdr, file);
- EOk.notify(this, tmp);
- }
- catch (Poco::Exception& e)
- {
- std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, std::string("Exception: " + e.displayText()));
- EError.notify(this, tmp);
- return false;
- }
- catch (...)
- {
- std::pair<const ZipLocalFileHeader, const std::string> tmp = std::make_pair(hdr, std::string("Unknown Exception"));
- EError.notify(this, tmp);
- return false;
- }
-
- return true;
-}
-
-
-void Decompress::onOk(const void*, std::pair<const ZipLocalFileHeader, const Poco::Path>& val)
-{
- _mapping.insert(std::make_pair(val.first.getFileName(), val.second));
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/Delete.cpp b/Utilities/Poco/Zip/src/Delete.cpp
deleted file mode 100644
index cf48d49aa2..0000000000
--- a/Utilities/Poco/Zip/src/Delete.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// Delete.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: Delete
-//
-// Copyright (c) 2007, 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/Zip/Delete.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-Delete::Delete(const ZipLocalFileHeader& hdr):
- _hdr(hdr)
-{
-}
-
-
-void Delete::execute(Compress& c, std::istream& input)
-{
- // due to absolute positioning in compress we don't need to do anything
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/Keep.cpp b/Utilities/Poco/Zip/src/Keep.cpp
deleted file mode 100644
index f46144bd77..0000000000
--- a/Utilities/Poco/Zip/src/Keep.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// Keep.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: Keep
-//
-// Copyright (c) 2007, 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/Zip/Keep.h"
-#include "Poco/Zip/Compress.h"
-#include "Poco/Buffer.h"
-#include "Poco/StreamCopier.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-Keep::Keep(const ZipLocalFileHeader& hdr):
- _hdr(hdr)
-{
-}
-
-
-void Keep::execute(Compress& c, std::istream& input)
-{
- c.addFileRaw(input, _hdr, _hdr.getFileName());
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ParseCallback.cpp b/Utilities/Poco/Zip/src/ParseCallback.cpp
deleted file mode 100644
index 6fefc71243..0000000000
--- a/Utilities/Poco/Zip/src/ParseCallback.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// ParseCallback.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ParseCallback
-//
-// Copyright (c) 2007, 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/Zip/ParseCallback.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-ParseCallback::ParseCallback()
-{
-}
-
-
-ParseCallback::~ParseCallback()
-{
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/PartialStream.cpp b/Utilities/Poco/Zip/src/PartialStream.cpp
deleted file mode 100644
index 3ff05dc9b4..0000000000
--- a/Utilities/Poco/Zip/src/PartialStream.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-//
-// PartialStream.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: PartialStream
-//
-// Copyright (c) 2007, 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/Zip/PartialStream.h"
-#include "Poco/Exception.h"
-#include <cstring>
-
-
-namespace Poco {
-namespace Zip {
-
-
-PartialStreamBuf::PartialStreamBuf(std::istream& in, std::ios::pos_type start, std::ios::pos_type end, const std::string& pre, const std::string& post, bool initStream):
- Poco::BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::in),
- _initialized(!initStream),
- _start(start),
- _numBytes(end-start),
- _bytesWritten(0),
- _pIstr(&in),
- _pOstr(0),
- _prefix(pre),
- _postfix(post),
- _ignoreStart(0),
- _buffer(0),
- _bufferOffset(0)
-{
-}
-
-
-PartialStreamBuf::PartialStreamBuf(std::ostream& out, std::size_t start, std::size_t end, bool initStream):
- Poco::BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::out),
- _initialized(!initStream),
- _start(0),
- _numBytes(0),
- _bytesWritten(0),
- _pIstr(0),
- _pOstr(&out),
- _ignoreStart(start),
- _buffer(end),
- _bufferOffset(0)
-{
-}
-
-
-PartialStreamBuf::~PartialStreamBuf()
-{
-}
-
-
-int PartialStreamBuf::readFromDevice(char* buffer, std::streamsize length)
-{
- if (_pIstr == 0 ||length == 0) return -1;
- if (!_initialized)
- {
- _initialized = true;
- _pIstr->clear();
- _pIstr->seekg(_start, std::ios_base::beg);
- if (_pIstr->fail())
- throw Poco::IOException("Failed to reposition in stream");
- }
- if (!_prefix.empty())
- {
- std::streamsize tmp = (_prefix.size() > length)? length: static_cast<std::streamsize>(_prefix.size());
- std::memcpy(buffer, _prefix.c_str(), tmp);
- _prefix = _prefix.substr(tmp);
- return tmp;
- }
-
- if (_numBytes == 0)
- {
- if (!_postfix.empty())
- {
- std::streamsize tmp = (_postfix.size() > length)? length: static_cast<std::streamsize>(_postfix.size());
- std::memcpy(buffer, _postfix.c_str(), tmp);
- _postfix = _postfix.substr(tmp);
- return tmp;
- }
- else
- return -1;
- }
-
- if (!_pIstr->good())
- return -1;
-
- if (_numBytes < length)
- length = static_cast<std::streamsize>(_numBytes);
-
- _pIstr->read(buffer, length);
- std::streamsize bytesRead = _pIstr->gcount();
- _numBytes -= bytesRead;
- return bytesRead;
-
-}
-
-
-int PartialStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
-{
- if (_pOstr == 0 || length == 0) return -1;
- if (!_initialized)
- {
- _initialized = true;
- _pOstr->clear();
- if (_pOstr->fail())
- throw Poco::IOException("Failed to clear stream status");
- }
-
- if (_ignoreStart > 0)
- {
- if (_ignoreStart > length)
- {
- _ignoreStart -= length;
- // fake return values
- return length;
- }
- else
- {
- std::streamsize cnt = static_cast<std::streamsize>(length - _ignoreStart - _buffer.size());
- if (cnt > 0)
- {
- _pOstr->write(buffer+_ignoreStart, cnt);
- _bytesWritten += cnt;
- }
-
- // copy the rest into buffer
- cnt += static_cast<std::streamsize>(_ignoreStart);
- _ignoreStart = 0;
- poco_assert (cnt < length);
- _bufferOffset = length - cnt;
- std::memcpy(_buffer.begin(), buffer + cnt, _bufferOffset);
-
- return length;
- }
- }
- if (_buffer.size() > 0)
- {
- // always treat each write as the potential last one
- // thus first fill the buffer with the last n bytes of the msg
-
- // how much of the already cached data do we need to write?
- Poco::Int32 cache = _bufferOffset + length - _buffer.size();
- if (cache > 0)
- {
- if (cache > _bufferOffset)
- cache = _bufferOffset;
- _pOstr->write(_buffer.begin(), cache);
- _bytesWritten += cache;
- _bufferOffset -= cache;
- if (_bufferOffset > 0)
- std::memmove(_buffer.begin(), _buffer.begin()+cache, _bufferOffset);
- }
-
- // now fill up _buffer with the last bytes from buffer
- Poco::Int32 pos = static_cast<Poco::Int32>(length - static_cast<Poco::Int32>(_buffer.size()) + _bufferOffset);
- if (pos <= 0)
- {
- // all of the message goes to _buffer
- std::memcpy(_buffer.begin() + _bufferOffset, buffer, length);
- }
- else
- {
- poco_assert (_bufferOffset == 0);
- std::memcpy(_buffer.begin(), buffer+pos, _buffer.size());
- _bufferOffset = static_cast<Poco::UInt32>(_buffer.size());
- // the rest is written
- _pOstr->write(buffer, static_cast<std::streamsize>(length - _buffer.size()));
- _bytesWritten += (length - _buffer.size());
- }
- }
- else
- {
- _pOstr->write(buffer, length);
- _bytesWritten += length;
- }
-
- if (_pOstr->good())
- return length;
-
- throw Poco::IOException("Failed to write to output stream");
-}
-
-
-void PartialStreamBuf::close()
-{
- // DONT write data from _buffer!
-}
-
-
-PartialIOS::PartialIOS(std::istream& istr, std::ios::pos_type start, std::ios::pos_type end, const std::string& pre, const std::string& post, bool initStream): _buf(istr, start, end, pre, post, initStream)
-{
- poco_ios_init(&_buf);
-}
-
-
-PartialIOS::PartialIOS(std::ostream& ostr, std::size_t start, std::size_t end, bool initStream): _buf(ostr, start, end, initStream)
-{
- poco_ios_init(&_buf);
-}
-
-
-PartialIOS::~PartialIOS()
-{
-}
-
-
-PartialStreamBuf* PartialIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-PartialInputStream::PartialInputStream(std::istream& istr, std::ios::pos_type start, std::ios::pos_type end, bool initStream, const std::string& pre, const std::string& post):
- PartialIOS(istr, start, end, pre, post, initStream),
- std::istream(&_buf)
-{
-}
-
-
-PartialInputStream::~PartialInputStream()
-{
-}
-
-
-PartialOutputStream::PartialOutputStream(std::ostream& ostr, std::size_t start, std::size_t end, bool initStream):
- PartialIOS(ostr, start, end, initStream),
- std::ostream(&_buf)
-{
-}
-
-
-PartialOutputStream::~PartialOutputStream()
-{
- close();
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/Rename.cpp b/Utilities/Poco/Zip/src/Rename.cpp
deleted file mode 100644
index ea7f33bbf7..0000000000
--- a/Utilities/Poco/Zip/src/Rename.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// Rename.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: Rename
-//
-// Copyright (c) 2007, 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/Zip/Rename.h"
-#include "Poco/Zip/Compress.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-Rename::Rename(const ZipLocalFileHeader& hdr, const std::string& newZipEntryName):
- _hdr(hdr),
- _newZipEntryName(newZipEntryName)
-{
-}
-
-
-void Rename::execute(Compress& c, std::istream& input)
-{
- c.addFileRaw(input, _hdr, _newZipEntryName);
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/Replace.cpp b/Utilities/Poco/Zip/src/Replace.cpp
deleted file mode 100644
index d4f1d8f5a6..0000000000
--- a/Utilities/Poco/Zip/src/Replace.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// Replace.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: Replace
-//
-// Copyright (c) 2007, 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/Zip/Replace.h"
-#include "Poco/Zip/Compress.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-Replace::Replace(const ZipLocalFileHeader& hdr, const std::string& localPath):
- _del(hdr),
- _add(hdr.getFileName(), localPath, hdr.getCompressionMethod(), hdr.getCompressionLevel())
-{
-}
-
-
-void Replace::execute(Compress& c, std::istream& input)
-{
- _del.execute(c, input);
- _add.execute(c, input);
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/SkipCallback.cpp b/Utilities/Poco/Zip/src/SkipCallback.cpp
deleted file mode 100644
index 4a438f342b..0000000000
--- a/Utilities/Poco/Zip/src/SkipCallback.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// SkipCallback.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: SkipCallback
-//
-// Copyright (c) 2007, 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/Zip/SkipCallback.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-#include "Poco/Zip/ZipUtil.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-SkipCallback::SkipCallback()
-{
-}
-
-
-SkipCallback::~SkipCallback()
-{
-}
-
-
-bool SkipCallback::handleZipEntry(std::istream& zipStream, const ZipLocalFileHeader& hdr)
-{
- if (!hdr.searchCRCAndSizesAfterData())
- zipStream.seekg(hdr.getCompressedSize(), std::ios_base::cur);
- else
- ZipUtil::sync(zipStream);
- return true;
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipArchive.cpp b/Utilities/Poco/Zip/src/ZipArchive.cpp
deleted file mode 100644
index 9ad0ffac7e..0000000000
--- a/Utilities/Poco/Zip/src/ZipArchive.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// ZipArchive.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipArchive
-//
-// Copyright (c) 2007, 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/Zip/ZipArchive.h"
-#include "Poco/Zip/SkipCallback.h"
-#include "Poco/Exception.h"
-#include <cstring>
-
-
-namespace Poco {
-namespace Zip {
-
-
-ZipArchive::ZipArchive(std::istream& in):
- _entries(),
- _infos(),
- _disks()
-{
- poco_assert_dbg (in);
- SkipCallback skip;
- parse(in, skip);
-}
-
-
-ZipArchive::ZipArchive(const FileHeaders& entries, const FileInfos& infos, const DirectoryInfos& dirs):
- _entries(entries),
- _infos(infos),
- _disks(dirs)
-{
-}
-
-
-ZipArchive::ZipArchive(std::istream& in, ParseCallback& pc):
- _entries(),
- _infos(),
- _disks()
-{
- poco_assert_dbg (in);
- parse(in, pc);
-}
-
-
-ZipArchive::~ZipArchive()
-{
-}
-
-
-void ZipArchive::parse(std::istream& in, ParseCallback& pc)
-{
- // read 4 bytes
- while (in.good() && !in.eof())
- {
- char header[ZipCommon::HEADER_SIZE]={'\x00', '\x00', '\x00', '\x00'};
- in.read(header, ZipCommon::HEADER_SIZE);
- if (in.eof())
- return;
- if (std::memcmp(header, ZipLocalFileHeader::HEADER, ZipCommon::HEADER_SIZE) == 0)
- {
- ZipLocalFileHeader entry(in, true, pc);
- poco_assert (_entries.insert(std::make_pair(entry.getFileName(), entry)).second);
- }
- else if (std::memcmp(header, ZipFileInfo::HEADER, ZipCommon::HEADER_SIZE) == 0)
- {
- ZipFileInfo info(in, true);
- FileHeaders::iterator it = _entries.find(info.getFileName());
- if (it != _entries.end())
- {
- it->second.setStartPos(info.getRelativeOffsetOfLocalHeader());
- }
- poco_assert (_infos.insert(std::make_pair(info.getFileName(), info)).second);
- }
- else if (std::memcmp(header, ZipArchiveInfo::HEADER, ZipCommon::HEADER_SIZE) == 0)
- {
- ZipArchiveInfo nfo(in, true);
- poco_assert (_disks.insert(std::make_pair(nfo.getDiskNumber(), nfo)).second);
- }
- else
- {
- if (_disks.empty())
- throw Poco::IllegalStateException("Illegal header in zip file");
- else
- throw Poco::IllegalStateException("Garbage after directory header");
- }
- }
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipArchiveInfo.cpp b/Utilities/Poco/Zip/src/ZipArchiveInfo.cpp
deleted file mode 100644
index dee2478345..0000000000
--- a/Utilities/Poco/Zip/src/ZipArchiveInfo.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// ZipArchiveInfo.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipArchiveInfo
-//
-// Copyright (c) 2007, 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/Zip/ZipArchiveInfo.h"
-#include "Poco/Buffer.h"
-#include <istream>
-#include <cstring>
-
-
-namespace Poco {
-namespace Zip {
-
-
-const char ZipArchiveInfo::HEADER[ZipCommon::HEADER_SIZE] = {'\x50', '\x4b', '\x05', '\x06'};
-
-
-ZipArchiveInfo::ZipArchiveInfo(std::istream& in, bool assumeHeaderRead):
- _rawInfo(),
- _startPos(in.tellg()),
- _comment()
-{
- if (assumeHeaderRead)
- _startPos -= ZipCommon::HEADER_SIZE;
- parse(in, assumeHeaderRead);
-}
-
-ZipArchiveInfo::ZipArchiveInfo():
- _rawInfo(),
- _startPos(0),
- _comment()
-{
- std::memset(_rawInfo, 0, FULLHEADER_SIZE);
- std::memcpy(_rawInfo, HEADER, ZipCommon::HEADER_SIZE);
-}
-
-
-ZipArchiveInfo::~ZipArchiveInfo()
-{
-}
-
-
-void ZipArchiveInfo::parse(std::istream& inp, bool assumeHeaderRead)
-{
- if (!assumeHeaderRead)
- {
- inp.read(_rawInfo, ZipCommon::HEADER_SIZE);
- }
- else
- {
- std::memcpy(_rawInfo, HEADER, ZipCommon::HEADER_SIZE);
- }
- poco_assert (std::memcmp(_rawInfo, HEADER, ZipCommon::HEADER_SIZE) == 0);
- // read the rest of the header
- inp.read(_rawInfo + ZipCommon::HEADER_SIZE, FULLHEADER_SIZE - ZipCommon::HEADER_SIZE);
- Poco::UInt16 len = getZipCommentSize();
- if (len > 0)
- {
- Poco::Buffer<char> buf(len);
- inp.read(buf.begin(), len);
- _comment = std::string(buf.begin(), len);
- }
-}
-
-
-std::string ZipArchiveInfo::createHeader() const
-{
- std::string result(_rawInfo, FULLHEADER_SIZE);
- result.append(_comment);
- return result;
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipCommon.cpp b/Utilities/Poco/Zip/src/ZipCommon.cpp
deleted file mode 100644
index ad13e41d22..0000000000
--- a/Utilities/Poco/Zip/src/ZipCommon.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// ZipCommon.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipCommon
-//
-// Copyright (c) 2007, 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/Zip/ZipCommon.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-const std::string ZipCommon::ILLEGAL_PATH("..");
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipDataInfo.cpp b/Utilities/Poco/Zip/src/ZipDataInfo.cpp
deleted file mode 100644
index b4e14053c7..0000000000
--- a/Utilities/Poco/Zip/src/ZipDataInfo.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// ZipDataInfo.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipDataInfo
-//
-// Copyright (c) 2007, 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/Zip/ZipDataInfo.h"
-#include <istream>
-#include <cstring>
-
-
-namespace Poco {
-namespace Zip {
-
-
-const char ZipDataInfo::HEADER[ZipCommon::HEADER_SIZE] = {'\x50', '\x4b', '\x07', '\x08'};
-
-
-ZipDataInfo::ZipDataInfo():
- _rawInfo(),
- _valid(true)
-{
- std::memcpy(_rawInfo, HEADER, ZipCommon::HEADER_SIZE);
- std::memset(_rawInfo+ZipCommon::HEADER_SIZE, 0, FULLHEADER_SIZE - ZipCommon::HEADER_SIZE);
- _valid = true;
-}
-
-
-ZipDataInfo::ZipDataInfo(std::istream& in, bool assumeHeaderRead):
- _rawInfo(),
- _valid(false)
-{
- if (assumeHeaderRead)
- std::memcpy(_rawInfo, HEADER, ZipCommon::HEADER_SIZE);
- else
- in.read(_rawInfo, ZipCommon::HEADER_SIZE);
- poco_assert (std::memcmp(_rawInfo, HEADER, ZipCommon::HEADER_SIZE) == 0);
- // now copy the rest of the header
- in.read(_rawInfo+ZipCommon::HEADER_SIZE, FULLHEADER_SIZE - ZipCommon::HEADER_SIZE);
- _valid = (!in.eof() && in.good());
-}
-
-
-ZipDataInfo::~ZipDataInfo()
-{
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipException.cpp b/Utilities/Poco/Zip/src/ZipException.cpp
deleted file mode 100644
index 1423c9cc71..0000000000
--- a/Utilities/Poco/Zip/src/ZipException.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// ZipException.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipException
-//
-// Copyright (c) 2007, 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/Zip/ZipException.h"
-#include <typeinfo>
-
-
-namespace Poco {
-namespace Zip {
-
-
-POCO_IMPLEMENT_EXCEPTION(ZipException, Poco::RuntimeException, "ZIP Exception")
-POCO_IMPLEMENT_EXCEPTION(ZipManipulationException, ZipException, "ZIP Manipulation Exception")
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipFileInfo.cpp b/Utilities/Poco/Zip/src/ZipFileInfo.cpp
deleted file mode 100644
index 19bffe5879..0000000000
--- a/Utilities/Poco/Zip/src/ZipFileInfo.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// ZipFileInfo.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipFileInfo
-//
-// Copyright (c) 2007, 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/Zip/ZipFileInfo.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-#include "Poco/Buffer.h"
-#include <istream>
-#include <cstring>
-
-
-namespace Poco {
-namespace Zip {
-
-
-const char ZipFileInfo::HEADER[ZipCommon::HEADER_SIZE] = {'\x50', '\x4b', '\x01', '\x02'};
-
-
-ZipFileInfo::ZipFileInfo(const ZipLocalFileHeader& header):
- _rawInfo(),
- _crc32(0),
- _compressedSize(0),
- _uncompressedSize(0),
- _fileName(),
- _lastModifiedAt(),
- _extraField()
-{
- std::memset(_rawInfo, 0, FULLHEADER_SIZE);
- std::memcpy(_rawInfo, HEADER, ZipCommon::HEADER_SIZE);
- setCompressedSize(header.getCompressedSize());
- setUncompressedSize(header.getUncompressedSize());
- setCRC(header.getCRC());
- setCompressionMethod(header.getCompressionMethod());
- setCompressionLevel(header.getCompressionLevel());
- setRequiredVersion(header.getMajorVersionNumber(), header.getMinorVersionNumber());
- setHostSystem(header.getHostSystem());
- setLastModifiedAt(header.lastModifiedAt());
- setEncryption(false);
- setFileName(header.getFileName());
-
- if (getHostSystem() == ZipCommon::HS_UNIX)
- setUnixAttributes();
-}
-
-
-ZipFileInfo::ZipFileInfo(std::istream& in, bool assumeHeaderRead):
- _rawInfo(),
- _crc32(0),
- _compressedSize(0),
- _uncompressedSize(0),
- _fileName(),
- _lastModifiedAt(),
- _extraField()
-{
- // sanity check
- poco_assert_dbg (RELATIVEOFFSETLOCALHEADER_POS + RELATIVEOFFSETLOCALHEADER_SIZE == FULLHEADER_SIZE);
- parse(in, assumeHeaderRead);
-}
-
-
-ZipFileInfo::~ZipFileInfo()
-{
-}
-
-
-void ZipFileInfo::parse(std::istream& inp, bool assumeHeaderRead)
-{
- if (!assumeHeaderRead)
- {
- inp.read(_rawInfo, ZipCommon::HEADER_SIZE);
- }
- else
- {
- std::memcpy(_rawInfo, HEADER, ZipCommon::HEADER_SIZE);
- }
- poco_assert (std::memcmp(_rawInfo, HEADER, ZipCommon::HEADER_SIZE) == 0);
- // read the rest of the header
- inp.read(_rawInfo + ZipCommon::HEADER_SIZE, FULLHEADER_SIZE - ZipCommon::HEADER_SIZE);
- _crc32 = getCRCFromHeader();
- _compressedSize = getCompressedSizeFromHeader();
- _uncompressedSize = getUncompressedSizeFromHeader();
- parseDateTime();
- Poco::UInt16 len = getFileNameLength();
- Poco::Buffer<char> buf(len);
- inp.read(buf.begin(), len);
- _fileName = std::string(buf.begin(), len);
- if (hasExtraField())
- {
- len = getExtraFieldLength();
- Poco::Buffer<char> xtra(len);
- inp.read(xtra.begin(), len);
- _extraField = std::string(xtra.begin(), len);
- }
- len = getFileCommentLength();
- if (len > 0)
- {
- Poco::Buffer<char> buf2(len);
- inp.read(buf2.begin(), len);
- _fileComment = std::string(buf2.begin(), len);
- }
-}
-
-
-std::string ZipFileInfo::createHeader() const
-{
- std::string result(_rawInfo, FULLHEADER_SIZE);
- result.append(_fileName);
- result.append(_extraField);
- result.append(_fileComment);
- return result;
-}
-
-
-void ZipFileInfo::setUnixAttributes()
-{
- bool isDir = isDirectory();
- int mode;
- if (isDir)
- mode = DEFAULT_UNIX_DIR_MODE;
- else
- mode = DEFAULT_UNIX_FILE_MODE;
- Poco::UInt32 attrs = (mode << 16) | (isDir ? 0x10 : 0);
- setExternalFileAttributes(attrs);
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipLocalFileHeader.cpp b/Utilities/Poco/Zip/src/ZipLocalFileHeader.cpp
deleted file mode 100644
index c7e3804fc2..0000000000
--- a/Utilities/Poco/Zip/src/ZipLocalFileHeader.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// ZipLocalFileHeader.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipLocalFileHeader
-//
-// Copyright (c) 2007, 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/Zip/ZipLocalFileHeader.h"
-#include "Poco/Zip/ZipDataInfo.h"
-#include "Poco/Zip/ParseCallback.h"
-#include "Poco/Buffer.h"
-#include "Poco/Exception.h"
-#include "Poco/File.h"
-#include <cstring>
-
-
-namespace Poco {
-namespace Zip {
-
-
-const char ZipLocalFileHeader::HEADER[ZipCommon::HEADER_SIZE] = {'\x50', '\x4b', '\x03', '\x04'};
-
-
-ZipLocalFileHeader::ZipLocalFileHeader(const Poco::Path& fileName,
- const Poco::DateTime& lastModifiedAt,
- ZipCommon::CompressionMethod cm,
- ZipCommon::CompressionLevel cl):
- _rawHeader(),
- _startPos(-1),
- _endPos(-1),
- _fileName(),
- _lastModifiedAt(),
- _extraField(),
- _crc32(0),
- _compressedSize(0),
- _uncompressedSize(0)
-{
- std::memcpy(_rawHeader, HEADER, ZipCommon::HEADER_SIZE);
- std::memset(_rawHeader+ZipCommon::HEADER_SIZE, 0, FULLHEADER_SIZE - ZipCommon::HEADER_SIZE);
- ZipCommon::HostSystem hs = ZipCommon::HS_FAT;
-
-#if (POCO_OS == POCO_OS_CYGWIN)
- hs = ZipCommon::HS_UNIX;
-#endif
-#if (POCO_OS == POCO_OS_VMS)
- hs = ZipCommon::HS_VMS;
-#endif
-#if defined(POCO_OS_FAMILY_UNIX)
- hs = ZipCommon::HS_UNIX;
-#endif
- setHostSystem(hs);
- setEncryption(false);
- setExtraFieldSize(0);
- setLastModifiedAt(lastModifiedAt);
- init(fileName, cm, cl);
-}
-
-
-ZipLocalFileHeader::ZipLocalFileHeader(std::istream& inp, bool assumeHeaderRead, ParseCallback& callback):
- _rawHeader(),
- _startPos(inp.tellg()),
- _endPos(-1),
- _fileName(),
- _lastModifiedAt(),
- _extraField(),
- _crc32(0),
- _compressedSize(0),
- _uncompressedSize(0)
-{
- poco_assert_dbg( (EXTRAFIELD_POS+EXTRAFIELD_LENGTH) == FULLHEADER_SIZE);
-
- if (assumeHeaderRead)
- _startPos -= ZipCommon::HEADER_SIZE;
-
- parse(inp, assumeHeaderRead);
-
- bool ok = callback.handleZipEntry(inp, *this);
-
- if (ok)
- {
- if (searchCRCAndSizesAfterData())
- {
- ZipDataInfo nfo(inp, false);
- setCRC(nfo.getCRC32());
- setCompressedSize(nfo.getCompressedSize());
- setUncompressedSize(nfo.getUncompressedSize());
- }
- }
- else
- {
- poco_assert_dbg(!searchCRCAndSizesAfterData());
- ZipUtil::sync(inp);
- }
- _endPos = _startPos + getHeaderSize() + _compressedSize; // exclude the data block!
-}
-
-
-ZipLocalFileHeader::~ZipLocalFileHeader()
-{
-}
-
-
-void ZipLocalFileHeader::parse(std::istream& inp, bool assumeHeaderRead)
-{
- if (!assumeHeaderRead)
- {
- inp.read(_rawHeader, ZipCommon::HEADER_SIZE);
- }
- else
- {
- std::memcpy(_rawHeader, HEADER, ZipCommon::HEADER_SIZE);
- }
- poco_assert (std::memcmp(_rawHeader, HEADER, ZipCommon::HEADER_SIZE) == 0);
- // read the rest of the header
- inp.read(_rawHeader + ZipCommon::HEADER_SIZE, FULLHEADER_SIZE - ZipCommon::HEADER_SIZE);
- poco_assert (_rawHeader[VERSION_POS + 1]>= ZipCommon::HS_FAT && _rawHeader[VERSION_POS + 1] < ZipCommon::HS_UNUSED);
- poco_assert (getMajorVersionNumber() <= 2);
- poco_assert (ZipUtil::get16BitValue(_rawHeader, COMPR_METHOD_POS) < ZipCommon::CM_UNUSED);
- parseDateTime();
- Poco::UInt16 len = getFileNameLength();
- Poco::Buffer<char> buf(len);
- inp.read(buf.begin(), len);
- _fileName = std::string(buf.begin(), len);
- if (hasExtraField())
- {
- len = getExtraFieldLength();
- Poco::Buffer<char> xtra(len);
- inp.read(xtra.begin(), len);
- _extraField = std::string(xtra.begin(), len);
- }
- if (!searchCRCAndSizesAfterData())
- {
- _crc32 = getCRCFromHeader();
- _compressedSize = getCompressedSizeFromHeader();
- _uncompressedSize = getUncompressedSizeFromHeader();
- }
-}
-
-
-bool ZipLocalFileHeader::searchCRCAndSizesAfterData() const
-{
- if (getCompressionMethod() == ZipCommon::CM_DEFLATE)
- {
- // check bit 3
- return ((ZipUtil::get16BitValue(_rawHeader, GENERAL_PURPOSE_POS) & 0x0008) != 0);
- }
- return false;
-}
-
-
-void ZipLocalFileHeader::setFileName(const std::string& fileName, bool isDirectory)
-{
- poco_assert (!fileName.empty());
- Poco::Path aPath(fileName);
-
- if (isDirectory)
- {
- aPath.makeDirectory();
- setCRC(0);
- setCompressedSize(0);
- setUncompressedSize(0);
- setCompressionMethod(ZipCommon::CM_STORE);
- setCompressionLevel(ZipCommon::CL_NORMAL);
- }
- else
- {
- aPath.makeFile();
- }
- _fileName = aPath.toString(Poco::Path::PATH_UNIX);
- if (_fileName[0] == '/')
- _fileName = _fileName.substr(1);
- if (isDirectory)
- {
- poco_assert_dbg (_fileName[_fileName.size()-1] == '/');
- }
- setFileNameLength(static_cast<Poco::UInt16>(_fileName.size()));
-}
-
-
-void ZipLocalFileHeader::init( const Poco::Path& fName,
- ZipCommon::CompressionMethod cm,
- ZipCommon::CompressionLevel cl)
-{
- poco_assert (_fileName.empty());
- setSearchCRCAndSizesAfterData(false);
- Poco::Path fileName(fName);
- fileName.setDevice(""); // clear device!
- setFileName(fileName.toString(Poco::Path::PATH_UNIX), fileName.isDirectory());
- setRequiredVersion(2, 0);
- if (fileName.isFile())
- {
- setCompressionMethod(cm);
- setCompressionLevel(cl);
- }
- else
- setCompressionMethod(ZipCommon::CM_STORE);
-}
-
-
-std::string ZipLocalFileHeader::createHeader() const
-{
- std::string result(_rawHeader, FULLHEADER_SIZE);
- result.append(_fileName);
- result.append(_extraField);
- return result;
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipManipulator.cpp b/Utilities/Poco/Zip/src/ZipManipulator.cpp
deleted file mode 100644
index 7fa241a980..0000000000
--- a/Utilities/Poco/Zip/src/ZipManipulator.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// ZipManipulator.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: ZipManipulator
-//
-// Copyright (c) 2007, 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/Zip/ZipManipulator.h"
-#include "Poco/Zip/ZipException.h"
-#include "Poco/Zip/ZipUtil.h"
-#include "Poco/Zip/Add.h"
-#include "Poco/Zip/Delete.h"
-#include "Poco/Zip/Keep.h"
-#include "Poco/Zip/Rename.h"
-#include "Poco/Zip/Replace.h"
-#include "Poco/Zip/Compress.h"
-#include "Poco/Delegate.h"
-#include "Poco/File.h"
-#include "Poco/FileStream.h"
-#include <fstream>
-
-
-namespace Poco {
-namespace Zip {
-
-
-ZipManipulator::ZipManipulator(const std::string& zipFile, bool backupOriginalFile):
- _zipFile(zipFile),
- _backupOriginalFile(backupOriginalFile),
- _changes(),
- _in(0)
-{
- std::ifstream in(zipFile.c_str(), std::ios::binary);
- _in = new ZipArchive(in);
-}
-
-
-ZipManipulator::~ZipManipulator()
-{
-}
-
-
-void ZipManipulator::deleteFile(const std::string& zipPath)
-{
- const ZipLocalFileHeader& entry = getForChange(zipPath);
- addOperation(zipPath, new Delete(entry));
-}
-
-
-void ZipManipulator::replaceFile(const std::string& zipPath, const std::string& localPath)
-{
- const ZipLocalFileHeader& entry = getForChange(zipPath);
- addOperation(zipPath, new Replace(entry, localPath));
-}
-
-
-void ZipManipulator::renameFile(const std::string& zipPath, const std::string& newZipPath)
-{
- const ZipLocalFileHeader& entry = getForChange(zipPath);
- // checked later in Compress too but the earlier one gets the error the better
- std::string fn = ZipUtil::validZipEntryFileName(newZipPath);
- addOperation(zipPath, new Rename(entry, fn));
-}
-
-
-void ZipManipulator::addFile(const std::string& zipPath, const std::string& localPath, ZipCommon::CompressionMethod cm, ZipCommon::CompressionLevel cl)
-{
- addOperation(zipPath, new Add(zipPath, localPath, cm, cl));
-}
-
-
-ZipArchive ZipManipulator::commit()
-{
- // write to a tmp file
- std::string outFile(_zipFile + ".tmp");
- ZipArchive retVal(compress(outFile));
- //renaming
- {
- Poco::File aFile(_zipFile);
- if (_backupOriginalFile)
- {
- Poco::File tmp(_zipFile+".bak");
- if (tmp.exists())
- tmp.remove();
- aFile.renameTo(_zipFile+".bak");
- }
- else
- aFile.remove();
- }
-
- {
- Poco::File resFile(outFile);
- Poco::File zipFile(_zipFile);
- if (zipFile.exists())
- zipFile.remove();
- resFile.renameTo(_zipFile);
- }
- return retVal;
-}
-
-
-const ZipLocalFileHeader& ZipManipulator::getForChange(const std::string& zipPath) const
-{
- ZipArchive::FileHeaders::const_iterator it = _in->findHeader(zipPath);
- if (it == _in->headerEnd())
- throw ZipManipulationException("entry not found: " + zipPath);
-
- if (_changes.find(zipPath) != _changes.end())
- throw ZipManipulationException("A change request exists already for entry " + zipPath);
-
- return it->second;
-}
-
-
-void ZipManipulator::addOperation(const std::string& zipPath, ZipOperation::Ptr ptrOp)
-{
- std::pair<Changes::iterator, bool> result = _changes.insert(std::make_pair(zipPath, ptrOp));
- if (!result.second)
- throw ZipManipulationException("A change request exists already for entry " + zipPath);
-}
-
-
-void ZipManipulator::onEDone(const void*, const ZipLocalFileHeader& hdr)
-{
- EDone(this, hdr);
-}
-
-
-ZipArchive ZipManipulator::compress(const std::string& outFile)
-{
- // write to a tmp file
- Poco::FileInputStream in(_zipFile);
- Poco::FileOutputStream out(outFile);
- Compress c(out, true);
- c.EDone += Poco::Delegate<ZipManipulator, const ZipLocalFileHeader>(this, &ZipManipulator::onEDone);
-
- ZipArchive::FileHeaders::const_iterator it = _in->headerBegin();
- for (; it != _in->headerEnd(); ++it)
- {
- Changes::iterator itC = _changes.find(it->first);
- if (itC != _changes.end())
- {
- itC->second->execute(c, in);
- _changes.erase(itC);
- }
- else
- {
- Keep k(it->second);
- k.execute(c, in);
- }
- }
- //Remaining files are add operations!
- Changes::iterator itC = _changes.begin();
- for (; itC != _changes.end(); ++itC)
- {
- itC->second->execute(c, in);
- }
- _changes.clear();
- c.EDone -= Poco::Delegate<ZipManipulator, const ZipLocalFileHeader>(this, &ZipManipulator::onEDone);
- in.close();
- return c.close();
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipOperation.cpp b/Utilities/Poco/Zip/src/ZipOperation.cpp
deleted file mode 100644
index b699f1c3ae..0000000000
--- a/Utilities/Poco/Zip/src/ZipOperation.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// ZipOperation.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Manipulation
-// Module: ZipOperation
-//
-// Copyright (c) 2007, 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/Zip/ZipOperation.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-ZipOperation::ZipOperation()
-{
-}
-
-
-ZipOperation::~ZipOperation()
-{
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipStream.cpp b/Utilities/Poco/Zip/src/ZipStream.cpp
deleted file mode 100644
index 56bcbe924a..0000000000
--- a/Utilities/Poco/Zip/src/ZipStream.cpp
+++ /dev/null
@@ -1,318 +0,0 @@
-//
-// ZipStream.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipStream
-//
-// Copyright (c) 2007, 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/Zip/ZipStream.h"
-#include "Poco/zlib.h"
-#include "Poco/Zip/ZipArchive.h"
-#include "Poco/Zip/AutoDetectStream.h"
-#include "Poco/Zip/PartialStream.h"
-#include "Poco/Zip/ZipDataInfo.h"
-#include "Poco/Zip/ZipException.h"
-#include "Poco/Exception.h"
-#include "Poco/InflatingStream.h"
-#include "Poco/DeflatingStream.h"
-
-
-namespace Poco {
-namespace Zip {
-
-
-ZipStreamBuf::ZipStreamBuf(std::istream& istr, const ZipLocalFileHeader& fileEntry, bool reposition):
- Poco::BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::in),
- _pIstr(&istr),
- _pOstr(0),
- _ptrBuf(),
- _ptrOBuf(),
- _ptrHelper(),
- _ptrOHelper(),
- _crc32(Poco::Checksum::TYPE_CRC32),
- _expectedCrc32(0),
- _checkCRC(true),
- _bytesWritten(0),
- _pHeader(0)
-{
- if (fileEntry.isDirectory())
- return;
- _expectedCrc32 = fileEntry.getCRC();
- std::streamoff start = fileEntry.getDataStartPos();
- std::streamoff end = fileEntry.getDataEndPos();
- _checkCRC = !fileEntry.searchCRCAndSizesAfterData();
- if (fileEntry.getCompressionMethod() == ZipCommon::CM_DEFLATE)
- {
- // Fake init bytes at beginning of stream
- std::string init = ZipUtil::fakeZLibInitString(fileEntry.getCompressionLevel());
-
- // Fake adler at end of stream: just some dummy value, not checked anway
- std::string crc(4, ' ');
- if (fileEntry.searchCRCAndSizesAfterData())
- {
- _ptrHelper = new AutoDetectInputStream(istr, init, crc, reposition, start);
- }
- else
- _ptrHelper = new PartialInputStream(istr, start, end, reposition, init, crc);
- _ptrBuf = new Poco::InflatingInputStream(*_ptrHelper, Poco::InflatingStreamBuf::STREAM_ZIP);
- }
- else if (fileEntry.getCompressionMethod() == ZipCommon::CM_STORE)
- {
- if (fileEntry.searchCRCAndSizesAfterData())
- {
- _ptrBuf = new AutoDetectInputStream(istr, "", "", reposition, start);
- }
- else
- _ptrBuf = new PartialInputStream(istr, start, end, reposition);
- }
- else
- {
- throw Poco::NotImplementedException("Unsupported compression method");
- }
-}
-
-
-ZipStreamBuf::ZipStreamBuf(std::ostream& ostr, ZipLocalFileHeader& fileEntry, bool reposition):
- Poco::BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::out),
- _pIstr(0),
- _pOstr(&ostr),
- _ptrBuf(),
- _ptrOBuf(),
- _ptrHelper(),
- _ptrOHelper(),
- _crc32(Poco::Checksum::TYPE_CRC32),
- _expectedCrc32(0),
- _checkCRC(false),
- _bytesWritten(0),
- _pHeader(&fileEntry)
-{
- if (fileEntry.isEncrypted())
- throw Poco::NotImplementedException("Encryption not supported");
-
- if (fileEntry.isDirectory())
- {
- // only header, no payload, zero crc
- fileEntry.setSearchCRCAndSizesAfterData(false);
- fileEntry.setCompressedSize(0);
- fileEntry.setUncompressedSize(0);
- fileEntry.setCRC(0);
- std::string header = fileEntry.createHeader();
- ostr.write(header.c_str(), static_cast<std::streamsize>(header.size()));
- }
- else
- {
- fileEntry.setSearchCRCAndSizesAfterData(!reposition);
- if (fileEntry.getCompressionMethod() == ZipCommon::CM_DEFLATE)
- {
- int level = Z_DEFAULT_COMPRESSION;
- if (fileEntry.getCompressionLevel() == ZipCommon::CL_FAST || fileEntry.getCompressionLevel() == ZipCommon::CL_SUPERFAST)
- level = Z_BEST_SPEED;
- else if (fileEntry.getCompressionLevel() == ZipCommon::CL_MAXIMUM)
- level = Z_BEST_COMPRESSION;
- // ignore the zlib init string which is of size 2 and also ignore the 4 byte adler32 value at the end of the stream!
- _ptrOHelper = new PartialOutputStream(*_pOstr, 2, 4, false);
- _ptrOBuf = new Poco::DeflatingOutputStream(*_ptrOHelper, DeflatingStreamBuf::STREAM_ZLIB, level);
- }
- else if (fileEntry.getCompressionMethod() == ZipCommon::CM_STORE)
- {
- _ptrOBuf = &ostr;
- }
- else
- {
- throw Poco::NotImplementedException("Unsupported compression method");
- }
- // now write the header to the ostr!
- std::string header = fileEntry.createHeader();
- ostr.write(header.c_str(), static_cast<std::streamsize>(header.size()));
- }
-}
-
-
-ZipStreamBuf::~ZipStreamBuf()
-{
-}
-
-
-int ZipStreamBuf::readFromDevice(char* buffer, std::streamsize length)
-{
- if (!_ptrBuf) return 0; // directory entry
- _ptrBuf->read(buffer, length);
- int cnt = _ptrBuf->gcount();
- if (cnt > 0)
- {
- _crc32.update(buffer, cnt);
- }
- else
- {
- if (_crc32.checksum() != _expectedCrc32)
- {
- if (_checkCRC)
- throw ZipException("CRC failure");
- else
- {
- // the CRC value is written directly after the data block
- // parse it directly from the input stream
- ZipDataInfo nfo(*_pIstr, false);
- // now push back the header to the stream, so that the ZipLocalFileHeader can read it
- Poco::Int32 size = static_cast<Poco::Int32>(nfo.getFullHeaderSize());
- _expectedCrc32 = nfo.getCRC32();
- const char* rawHeader = nfo.getRawHeader();
- for (Poco::Int32 i = size-1; i >= 0; --i)
- _pIstr->putback(rawHeader[i]);
- if (!crcValid())
- throw ZipException("CRC failure");
- }
- }
- }
- return cnt;
-}
-
-
-int ZipStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
-{
- if (!_ptrOBuf) return 0; // directory entry
- if (length == 0)
- return 0;
- _bytesWritten += length;
- _ptrOBuf->write(buffer, length);
- _crc32.update(buffer, length);
- return length;
-}
-
-
-void ZipStreamBuf::close()
-{
- if (_ptrOBuf && _pHeader)
- {
- _ptrOBuf->flush();
- DeflatingOutputStream* pDO = dynamic_cast<DeflatingOutputStream*>(_ptrOBuf.get());
- if (pDO)
- pDO->close();
- if (_ptrOHelper)
- {
- _ptrOHelper->flush();
- _ptrOHelper->close();
- }
- _ptrOBuf = 0;
- poco_assert (*_pOstr);
- // write an extra datablock if required
- // or fix the crc entries
- if (_pHeader->searchCRCAndSizesAfterData())
- {
- ZipDataInfo info;
- info.setCRC32(_crc32.checksum());
- info.setUncompressedSize(_bytesWritten);
- info.setCompressedSize(static_cast<Poco::UInt32>(_ptrOHelper->bytesWritten()));
- _pOstr->write(info.getRawHeader(), static_cast<std::streamsize>(info.getFullHeaderSize()));
- }
- else
- {
- poco_check_ptr (_pHeader);
- _pHeader->setCRC(_crc32.checksum());
- _pHeader->setUncompressedSize(_bytesWritten);
- _pHeader->setCompressedSize(static_cast<Poco::UInt32>(_ptrOHelper->bytesWritten()));
- _pOstr->seekp(_pHeader->getStartPos(), std::ios_base::beg);
- poco_assert (*_pOstr);
- std::string header = _pHeader->createHeader();
- _pOstr->write(header.c_str(), static_cast<std::streamsize>(header.size()));
- _pOstr->seekp(0, std::ios_base::end);
- poco_assert (*_pOstr);
- }
- _pHeader = 0;
- }
-}
-
-
-bool ZipStreamBuf::crcValid() const
-{
- if (!_ptrBuf) return true; // directory entry
- return _crc32.checksum() == _expectedCrc32;
-}
-
-
-ZipIOS::ZipIOS(std::istream& istr, const ZipLocalFileHeader& fileEntry, bool reposition): _buf(istr, fileEntry, reposition)
-{
- poco_ios_init(&_buf);
-}
-
-
-ZipIOS::ZipIOS(std::ostream& ostr, ZipLocalFileHeader& fileEntry, bool reposition): _buf(ostr, fileEntry, reposition)
-{
- poco_ios_init(&_buf);
-}
-
-
-ZipIOS::~ZipIOS()
-{
-}
-
-
-ZipStreamBuf* ZipIOS::rdbuf()
-{
- return &_buf;
-}
-
-
-ZipInputStream::ZipInputStream(std::istream& istr, const ZipLocalFileHeader& fileEntry, bool reposition): ZipIOS(istr, fileEntry, reposition), std::istream(&_buf)
-{
-}
-
-
-ZipInputStream::~ZipInputStream()
-{
-}
-
-
-bool ZipInputStream::crcValid() const
-{
- return _buf.crcValid();
-}
-
-
-ZipOutputStream::ZipOutputStream(std::ostream& ostr, ZipLocalFileHeader& fileEntry, bool seekableOutput): ZipIOS(ostr, fileEntry, seekableOutput), std::ostream(&_buf)
-{
-}
-
-
-ZipOutputStream::~ZipOutputStream()
-{
-}
-
-
-void ZipOutputStream::close()
-{
- flush();
- _buf.close();
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/src/ZipUtil.cpp b/Utilities/Poco/Zip/src/ZipUtil.cpp
deleted file mode 100644
index 15fb870e06..0000000000
--- a/Utilities/Poco/Zip/src/ZipUtil.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// ZipUtil.cpp
-//
-// $Id$
-//
-// Library: Zip
-// Package: Zip
-// Module: ZipUtil
-//
-// Copyright (c) 2007, 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/Zip/ZipUtil.h"
-#include "Poco/Zip/ZipException.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-#include "Poco/Zip/ZipFileInfo.h"
-#include "Poco/Zip/ZipDataInfo.h"
-#include "Poco/Zip/ZipArchiveInfo.h"
-#include <cstring>
-
-
-namespace Poco {
-namespace Zip {
-
-
-Poco::DateTime ZipUtil::parseDateTime(const char* pVal, const Poco::UInt32 timePos, const Poco::UInt32 datePos)
-{
- Poco::UInt16 time = ZipUtil::get16BitValue(pVal, timePos);
- Poco::UInt16 date = ZipUtil::get16BitValue(pVal, datePos);
- //TIME: second 0-4, minute 5-10, hour 11-15, second resolution is 2!
- int sec = 2*(time & 0x001fu); // 0000 0000 0001 1111
- int min = ((time & 0x07e0u) >> 5); // 0000 0111 1110 0000
- int hour= ((time & 0xf800u) >> 11); // 1111 1000 0000 0000
-
- //DATE: day 0-4, month 5-8, year (starting with 1980): 9-16
- int day = (date & 0x001fu); // 0000 0000 0001 1111
- int mon = ((date & 0x01e0u) >> 5); // 0000 0001 1110 0000
- int year= 1980+((date & 0xfe00u) >> 9); // 1111 1110 0000 0000
- return Poco::DateTime(year, mon, day, hour, min, sec);
-}
-
-
-void ZipUtil::setDateTime(const Poco::DateTime& dt, char* pVal, const Poco::UInt32 timePos, const Poco::UInt32 datePos)
-{
- //TIME: second 0-4, minute 5-10, hour 11-15
- Poco::UInt16 time = static_cast<Poco::UInt16>((dt.second()/2) + (dt.minute()<<5) + (dt.hour()<<11));
- //DATE: day 0-4, month 5-8, year (starting with 1980): 9-16
- int year = dt.year() - 1980;
- if (year<0)
- year = 0;
- Poco::UInt16 date = static_cast<Poco::UInt16>(dt.day() + (dt.month()<<5) + (year<<9));
- ZipUtil::set16BitValue(time, pVal, timePos);
- ZipUtil::set16BitValue(date, pVal, datePos);
-
-}
-
-
-std::string ZipUtil::fakeZLibInitString(ZipCommon::CompressionLevel cl)
-{
- std::string init(2, ' ');
-
- // compression info:
- // deflate is used, bit 0-3: 0x08
- // dictionary size is always 32k: calc ld2(32k)-8 = ld2(2^15) - 8 = 15 - 8 = 7 --> bit 4-7: 0x70
- init[0] = '\x78';
-
- // now fake flags
- // bits 0-4 check bits: set them so that init[0]*256+init[1] % 31 == 0
- // bit 5: preset dictionary? always no for us, set to 0
- // bits 6-7: compression level: 00 very fast, 01 fast, 10 normal, 11 best
- if (cl == ZipCommon::CL_SUPERFAST)
- init[1] = '\x00';
- else if (cl == ZipCommon::CL_FAST)
- init[1] = '\x40';
- else if (cl == ZipCommon::CL_NORMAL)
- init[1] = '\x80';
- else
- init[1] = '\xc0';
- // now set the last 5 bits
- Poco::UInt16 tmpVal = ((Poco::UInt16)init[0])*256+((unsigned char)init[1]);
- char checkBits = (31 - (char)(tmpVal%31));
- init[1] |= checkBits; // set the lower 5 bits
- tmpVal = ((Poco::UInt16)init[0])*256+((unsigned char)init[1]);
- poco_assert_dbg ((tmpVal % 31) == 0);
- return init;
-}
-
-
-void ZipUtil::sync(std::istream& in)
-{
- enum
- {
- PREFIX = 2,
- BUFFER_SIZE = 1024
- };
- char temp[BUFFER_SIZE];
- in.read(temp, PREFIX);
- std::size_t tempPos = PREFIX;
-
- while (in.good() && !in.eof())
- {
- // all zip headers start withe same 2byte prefix
- if(std::memcmp(ZipLocalFileHeader::HEADER, &temp[tempPos - PREFIX], PREFIX) == 0)
- {
- // we have a possible header!
- // read the next 2 bytes
- in.read(temp+tempPos, PREFIX);
- tempPos += PREFIX;
- if (std::memcmp(ZipLocalFileHeader::HEADER+PREFIX, &temp[tempPos - PREFIX], PREFIX) == 0 ||
- std::memcmp(ZipArchiveInfo::HEADER+PREFIX, &temp[tempPos - PREFIX], PREFIX) == 0 ||
- std::memcmp(ZipFileInfo::HEADER+PREFIX, &temp[tempPos - PREFIX], PREFIX) == 0 ||
- std::memcmp(ZipDataInfo::HEADER+PREFIX, &temp[tempPos - PREFIX], PREFIX) == 0)
- {
- if (std::memcmp(ZipLocalFileHeader::HEADER+PREFIX, &temp[tempPos - PREFIX], PREFIX) == 0)
- {
- in.putback(ZipLocalFileHeader::HEADER[3]);
- in.putback(ZipLocalFileHeader::HEADER[2]);
- in.putback(ZipLocalFileHeader::HEADER[1]);
- in.putback(ZipLocalFileHeader::HEADER[0]);
- }
- else if (std::memcmp(ZipArchiveInfo::HEADER+PREFIX, &temp[tempPos - PREFIX], PREFIX) == 0)
- {
- in.putback(ZipArchiveInfo::HEADER[3]);
- in.putback(ZipArchiveInfo::HEADER[2]);
- in.putback(ZipArchiveInfo::HEADER[1]);
- in.putback(ZipArchiveInfo::HEADER[0]);
- }
- else if (std::memcmp(ZipFileInfo::HEADER+PREFIX, &temp[tempPos - PREFIX], PREFIX) == 0)
- {
- in.putback(ZipFileInfo::HEADER[3]);
- in.putback(ZipFileInfo::HEADER[2]);
- in.putback(ZipFileInfo::HEADER[1]);
- in.putback(ZipFileInfo::HEADER[0]);
- }
- else
- {
- in.putback(ZipDataInfo::HEADER[3]);
- in.putback(ZipDataInfo::HEADER[2]);
- in.putback(ZipDataInfo::HEADER[1]);
- in.putback(ZipDataInfo::HEADER[0]);
- }
- return;
- }
- else
- {
- // we have read 2 bytes, should only be one: putback the last char
- in.putback(temp[tempPos - 1]);
- --tempPos;
- }
- }
- else
- {
- // read one byte
- in.read(temp + tempPos, 1);
- ++tempPos;
- }
-
- if (tempPos > (BUFFER_SIZE - ZipCommon::HEADER_SIZE))
- {
- std::memcpy(temp, &temp[tempPos - ZipCommon::HEADER_SIZE], ZipCommon::HEADER_SIZE);
- tempPos = ZipCommon::HEADER_SIZE;
- }
- }
-}
-
-
-void ZipUtil::verifyZipEntryFileName(const std::string& fn)
-{
- if (fn.find("\\") != std::string::npos)
- throw ZipException("Illegal entry name " + fn + " containing \\");
- if (fn == "/")
- throw ZipException("Illegal entry name /");
- if (fn.empty())
- throw ZipException("Illegal empty entry name");
- if (fn.find(ZipCommon::ILLEGAL_PATH) != std::string::npos)
- throw ZipException("Illegal entry name " + fn + " containing " + ZipCommon::ILLEGAL_PATH);
-}
-
-
-std::string ZipUtil::validZipEntryFileName(const Poco::Path& entry)
-{
- std::string fn = entry.toString(Poco::Path::PATH_UNIX);
- verifyZipEntryFileName(fn);
- return fn;
-}
-
-
-} } // namespace Poco::Zip
diff --git a/Utilities/Poco/Zip/testsuite/CMakeLists.txt b/Utilities/Poco/Zip/testsuite/CMakeLists.txt
deleted file mode 100644
index 042f021691..0000000000
--- a/Utilities/Poco/Zip/testsuite/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-include(files.cmake)
-
-add_executable(PocoTestRunnerZip ${CPP_FILES})
-target_link_libraries(PocoTestRunnerZip
- PocoUtil
- PocoZip
- PocoFoundation
- CppUnit)
-
-if(WIN32)
- target_link_libraries(PocoTestRunnerZip
- WinTestRunner
- )
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../CppUnit/WinTestRunner/include)
- add_definitions(-D_AFXDLL)
-endif(WIN32)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../Foundation/include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../XML/include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../Zip/include
- ${CMAKE_CURRENT_SOURCE_DIR}/../../CppUnit/include
-)
-
-set(_zipdata_files
- data.zip
- doc.zip
- java.zip
- test.zip
-)
-
-foreach(_zipdata ${_zipdata_files})
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/data/${_zipdata}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/data/${_zipdata}" COPYONLY)
-endforeach()
diff --git a/Utilities/Poco/Zip/testsuite/data/data.zip b/Utilities/Poco/Zip/testsuite/data/data.zip
deleted file mode 100644
index 82447bd6a8..0000000000
Binary files a/Utilities/Poco/Zip/testsuite/data/data.zip and /dev/null differ
diff --git a/Utilities/Poco/Zip/testsuite/data/doc.zip b/Utilities/Poco/Zip/testsuite/data/doc.zip
deleted file mode 100644
index 875eaf2f63..0000000000
Binary files a/Utilities/Poco/Zip/testsuite/data/doc.zip and /dev/null differ
diff --git a/Utilities/Poco/Zip/testsuite/data/java.zip b/Utilities/Poco/Zip/testsuite/data/java.zip
deleted file mode 100644
index 80ebc780d3..0000000000
Binary files a/Utilities/Poco/Zip/testsuite/data/java.zip and /dev/null differ
diff --git a/Utilities/Poco/Zip/testsuite/data/test.zip b/Utilities/Poco/Zip/testsuite/data/test.zip
deleted file mode 100644
index 82447bd6a8..0000000000
Binary files a/Utilities/Poco/Zip/testsuite/data/test.zip and /dev/null differ
diff --git a/Utilities/Poco/Zip/testsuite/files.cmake b/Utilities/Poco/Zip/testsuite/files.cmake
deleted file mode 100644
index 4b41c7f631..0000000000
--- a/Utilities/Poco/Zip/testsuite/files.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-set(CPP_BASE_FILENAMES
- CompressTest
- Driver
- PartialStreamTest
- ZipTest
- ZipTestSuite
-)
-
-if(WIN32)
- set(CPP_BASE_FILENAMES
- WinDriver
- ${CPP_BASE_FILENAMES}
- )
-endif(WIN32)
-
-set(CPP_FILES "")
-foreach(basename ${CPP_BASE_FILENAMES})
- set(CPP_FILES ${CPP_FILES} src/${basename})
-endforeach(basename ${CPP_BASE_FILENAMES})
diff --git a/Utilities/Poco/Zip/testsuite/src/CompressTest.cpp b/Utilities/Poco/Zip/testsuite/src/CompressTest.cpp
deleted file mode 100644
index fd4446f558..0000000000
--- a/Utilities/Poco/Zip/testsuite/src/CompressTest.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// CompressTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2007, 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 "CompressTest.h"
-#include "ZipTest.h"
-#include "Poco/Zip/Compress.h"
-#include "Poco/Zip/ZipManipulator.h"
-#include "Poco/File.h"
-#include "Poco/FileStream.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include <fstream>
-
-
-using namespace Poco::Zip;
-
-
-CompressTest::CompressTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-CompressTest::~CompressTest()
-{
-}
-
-
-void CompressTest::testSingleFile()
-{
- std::ofstream out("appinf.zip", std::ios::binary);
- Poco::Path theFile(ZipTest::getTestFile("test.zip"));
- Compress c(out, true);
- c.addFile(theFile, theFile.getFileName());
- ZipArchive a(c.close());
-}
-
-
-void CompressTest::testDirectory()
-{
- std::ofstream out("pocobin.zip", std::ios::binary);
- Poco::File aFile("some/");
- if (aFile.exists())
- aFile.remove(true);
- Poco::File aDir("some/recursive/dir/");
- aDir.createDirectories();
- Poco::File aDir2("some/other/recursive/dir/");
- aDir2.createDirectories();
- Poco::File aF("some/recursive/dir/test.file");
- aF.createFile();
- Poco::FileOutputStream fos(aF.path());
- fos << "just some test data";
- fos.close();
-
- Poco::Path theFile(aFile.path());
- theFile.makeDirectory();
- Compress c(out, true);
- c.addRecursive(theFile, ZipCommon::CL_MAXIMUM, false, theFile);
- ZipArchive a(c.close());
-}
-
-
-void CompressTest::testManipulator()
-{
- {
- std::ofstream out("appinf.zip", std::ios::binary);
- Poco::Path theFile(ZipTest::getTestFile("test.zip"));
- Compress c(out, true);
- c.addFile(theFile, theFile.getFileName());
- ZipArchive a(c.close());
- }
- ZipManipulator zm("appinf.zip", true);
- zm.renameFile("test.zip", "renamedtest.zip");
- zm.addFile("doc/othertest.zip", ZipTest::getTestFile("test.zip"));
- ZipArchive archive=zm.commit();
- assert (archive.findHeader("doc/othertest.zip") != archive.headerEnd());
-}
-
-
-void CompressTest::testManipulatorDel()
-{
- {
- std::ofstream out("appinf.zip", std::ios::binary);
- Poco::Path theFile(ZipTest::getTestFile("test.zip"));
- Compress c(out, true);
- c.addFile(theFile, theFile.getFileName());
- ZipArchive a(c.close());
- }
- ZipManipulator zm("appinf.zip", true);
- zm.deleteFile("test.zip");
- zm.addFile("doc/data.zip", ZipTest::getTestFile("data.zip"));
- ZipArchive archive=zm.commit();
- assert (archive.findHeader("test.zip") == archive.headerEnd());
- assert (archive.findHeader("doc/data.zip") != archive.headerEnd());
-}
-
-
-void CompressTest::testManipulatorReplace()
-{
- {
- std::ofstream out("appinf.zip", std::ios::binary);
- Poco::Path theFile(ZipTest::getTestFile("test.zip"));
- Compress c(out, true);
- c.addFile(theFile, theFile.getFileName());
- ZipArchive a(c.close());
- }
- ZipManipulator zm("appinf.zip", true);
- zm.replaceFile("test.zip", ZipTest::getTestFile("doc.zip"));
-
- ZipArchive archive=zm.commit();
- assert (archive.findHeader("test.zip") != archive.headerEnd());
- assert (archive.findHeader("doc.zip") == archive.headerEnd());
-}
-
-
-void CompressTest::setUp()
-{
-}
-
-
-void CompressTest::tearDown()
-{
-}
-
-
-CppUnit::Test* CompressTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CompressTest");
-
- CppUnit_addTest(pSuite, CompressTest, testSingleFile);
- CppUnit_addTest(pSuite, CompressTest, testDirectory);
- CppUnit_addTest(pSuite, CompressTest, testManipulator);
- CppUnit_addTest(pSuite, CompressTest, testManipulatorDel);
- CppUnit_addTest(pSuite, CompressTest, testManipulatorReplace);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Zip/testsuite/src/CompressTest.h b/Utilities/Poco/Zip/testsuite/src/CompressTest.h
deleted file mode 100644
index 5c3a39ba87..0000000000
--- a/Utilities/Poco/Zip/testsuite/src/CompressTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// CompressTest.h
-//
-// $Id$
-//
-// Definition of the CompressTest class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef CompressTest_INCLUDED
-#define CompressTest_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "CppUnit/TestCase.h"
-
-
-class CompressTest: public CppUnit::TestCase
-{
-public:
- CompressTest(const std::string& name);
- ~CompressTest();
-
- void testSingleFile();
- void testDirectory();
- void testManipulator();
- void testManipulatorDel();
- void testManipulatorReplace();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // CompressTest_INCLUDED
diff --git a/Utilities/Poco/Zip/testsuite/src/Driver.cpp b/Utilities/Poco/Zip/testsuite/src/Driver.cpp
deleted file mode 100644
index 3fa12557ba..0000000000
--- a/Utilities/Poco/Zip/testsuite/src/Driver.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Driver.cpp
-//
-// $Id$
-//
-// Console-based test driver for Poco Zip.
-//
-// Copyright (c) 2007, 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 "CppUnit/TestRunner.h"
-#include "ZipTestSuite.h"
-
-
-CppUnitMain(ZipTestSuite)
diff --git a/Utilities/Poco/Zip/testsuite/src/PartialStreamTest.cpp b/Utilities/Poco/Zip/testsuite/src/PartialStreamTest.cpp
deleted file mode 100644
index a9f7cc30f2..0000000000
--- a/Utilities/Poco/Zip/testsuite/src/PartialStreamTest.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// PartialStreamTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2007, 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 "PartialStreamTest.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include "Poco/Zip/PartialStream.h"
-#include <sstream>
-
-
-using namespace Poco::Zip;
-
-
-PartialStreamTest::PartialStreamTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-PartialStreamTest::~PartialStreamTest()
-{
-}
-
-
-void PartialStreamTest::testReading()
-{
- std::string message("some dummy message !");
- std::string prefix("pre ");
- std::string postfix(" post");
- std::string result(prefix+message+postfix);
- std::istringstream istr(message);
- PartialInputStream in(istr, 0, static_cast<std::streamoff>(message.length()), true, prefix, postfix);
- char buf[124];
- in.read(buf, 124);
- std::string res(buf, in.gcount());
- assert (res == result);
-}
-
-
-void PartialStreamTest::testWriting()
-{
- std::string prefix("X");
- std::string message("some test message");
- std::string postfix("YYY");
- std::string result(prefix+message+postfix);
- std::ostringstream ostr;
- PartialOutputStream out(ostr, prefix.size(), postfix.size());
- out.write(result.c_str(), static_cast<std::streamsize>(result.length()));
- assert (out.good());
- out.close();
- std::string res (ostr.str());
- assert (out.bytesWritten() == message.size());
- assert (message == res);
-}
-
-
-void PartialStreamTest::testWritingZero()
-{
- std::string prefix("X");
- std::string message;
- std::string postfix("YYY");
- std::string result(prefix+message+postfix);
- std::ostringstream ostr;
- PartialOutputStream out(ostr, prefix.size(), postfix.size());
- out.write(result.c_str(), static_cast<std::streamsize>(result.length()));
- assert (out.good());
- out.close();
- std::string res (ostr.str());
- assert (out.bytesWritten() == message.size());
- assert (message == res);
-}
-
-
-void PartialStreamTest::testWritingOne()
-{
- std::string prefix("X");
- std::string message("a");
- std::string postfix("YYY");
- std::string result(prefix+message+postfix);
- std::ostringstream ostr;
- PartialOutputStream out(ostr, prefix.size(), postfix.size());
- out.write(result.c_str(), static_cast<std::streamsize>(result.length()));
- assert (out.good());
- out.close();
- std::string res (ostr.str());
- assert (out.bytesWritten() == message.size());
- assert (message == res);
-}
-
-
-void PartialStreamTest::setUp()
-{
-}
-
-
-void PartialStreamTest::tearDown()
-{
-}
-
-
-CppUnit::Test* PartialStreamTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("PartialStreamTest");
-
- CppUnit_addTest(pSuite, PartialStreamTest, testReading);
- CppUnit_addTest(pSuite, PartialStreamTest, testWriting);
- CppUnit_addTest(pSuite, PartialStreamTest, testWritingZero);
- CppUnit_addTest(pSuite, PartialStreamTest, testWritingOne);
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Zip/testsuite/src/PartialStreamTest.h b/Utilities/Poco/Zip/testsuite/src/PartialStreamTest.h
deleted file mode 100644
index 9fb64416c6..0000000000
--- a/Utilities/Poco/Zip/testsuite/src/PartialStreamTest.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// PartialStreamTest.h
-//
-// $Id$
-//
-// Definition of the PartialStreamTest class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef PartialStreamTest_INCLUDED
-#define PartialStreamTest_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "CppUnit/TestCase.h"
-
-
-class PartialStreamTest: public CppUnit::TestCase
-{
-public:
- PartialStreamTest(const std::string& name);
- ~PartialStreamTest();
-
- void testReading();
- void testWriting();
- void testWritingZero();
- void testWritingOne();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
-private:
-};
-
-
-#endif // PartialStreamTest_INCLUDED
diff --git a/Utilities/Poco/Zip/testsuite/src/WinDriver.cpp b/Utilities/Poco/Zip/testsuite/src/WinDriver.cpp
deleted file mode 100644
index 54645bfefe..0000000000
--- a/Utilities/Poco/Zip/testsuite/src/WinDriver.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// WinDriver.cpp
-//
-// $Id$
-//
-// Windows test driver for Poco Zip.
-//
-// Copyright (c) 2007, 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 "WinTestRunner/WinTestRunner.h"
-#include "ZipTestSuite.h"
-
-
-class TestDriver: public CppUnit::WinTestRunnerApp
-{
- void TestMain()
- {
- CppUnit::WinTestRunner runner;
- runner.addTest(ZipTestSuite::suite());
- runner.run();
- }
-};
-
-
-TestDriver theDriver;
diff --git a/Utilities/Poco/Zip/testsuite/src/ZipTest.cpp b/Utilities/Poco/Zip/testsuite/src/ZipTest.cpp
deleted file mode 100644
index e3cd986e9e..0000000000
--- a/Utilities/Poco/Zip/testsuite/src/ZipTest.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-//
-// ZipTest.cpp
-//
-// $Id$
-//
-// Copyright (c) 2007, 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 "ZipTest.h"
-#include "Poco/Zip/SkipCallback.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-#include "Poco/Zip/ZipArchive.h"
-#include "Poco/Zip/ZipStream.h"
-#include "Poco/Zip/Decompress.h"
-#include "Poco/Zip/ZipCommon.h"
-#include "Poco/StreamCopier.h"
-#include "Poco/File.h"
-#include "Poco/URI.h"
-#include "Poco/Path.h"
-#include "Poco/Delegate.h"
-#include "Poco/StreamCopier.h"
-#include "CppUnit/TestCaller.h"
-#include "CppUnit/TestSuite.h"
-#include <fstream>
-#include <sstream>
-
-
-using namespace Poco::Zip;
-
-
-ZipTest::ZipTest(const std::string& name): CppUnit::TestCase(name)
-{
-}
-
-
-ZipTest::~ZipTest()
-{
-}
-
-
-void ZipTest::testSkipSingleFile()
-{
- std::string testFile = getTestFile("test.zip");
- std::ifstream inp(testFile.c_str(), std::ios::binary);
- assert (inp.good());
- SkipCallback skip;
- ZipLocalFileHeader hdr(inp, false, skip);
- assert (ZipCommon::HS_FAT == hdr.getHostSystem());
- int major = hdr.getMajorVersionNumber();
- int minor = hdr.getMinorVersionNumber();
- assert (major <= 2);
- std::size_t hdrSize = hdr.getHeaderSize();
- assert (hdrSize > 30);
- ZipCommon::CompressionMethod cm = hdr.getCompressionMethod();
- assert (!hdr.isEncrypted());
- Poco::DateTime aDate = hdr.lastModifiedAt();
- Poco::UInt32 cS = hdr.getCompressedSize();
- Poco::UInt32 uS = hdr.getUncompressedSize();
- const std::string& fileName = hdr.getFileName();
-}
-
-
-void ZipTest::testDecompressSingleFile()
-{
- std::string testFile = getTestFile("test.zip");
- std::ifstream inp(testFile.c_str(), std::ios::binary);
- assert (inp.good());
- ZipArchive arch(inp);
- ZipArchive::FileHeaders::const_iterator it = arch.findHeader("testfile.txt");
- assert (it != arch.headerEnd());
- ZipInputStream zipin (inp, it->second);
- std::ostringstream out(std::ios::binary);
- Poco::StreamCopier::copyStream(zipin, out);
- assert(!out.str().empty());
-}
-
-
-void ZipTest::testCrcAndSizeAfterData()
-{
- std::string testFile = getTestFile("data.zip");
- std::ifstream inp(testFile.c_str(), std::ios::binary);
- assert (inp.good());
- Decompress dec(inp, Poco::Path());
- dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
- dec.decompressAllFiles();
- dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
- assert (_errCnt == 0);
- assert (!dec.mapping().empty());
-}
-
-
-void ZipTest::testCrcAndSizeAfterDataWithArchive()
-{
- std::string testFile = getTestFile("data.zip");
- std::ifstream inp(testFile.c_str(), std::ios::binary);
- assert (inp.good());
- Poco::Zip::ZipArchive zip(inp);
- inp.clear();
- inp.seekg(0);
- Poco::Zip::ZipArchive::FileHeaders::const_iterator it = zip.headerBegin();
- for ( ; it!=zip.headerEnd(); ++it)
- {
- Poco::Zip::ZipInputStream zipis(inp,it->second);
- Poco::Path path(it->second.getFileName());
- if (path.isFile())
- {
- std::ofstream os("test.dat");
- Poco::StreamCopier::copyStream(zipis,os);
- }
- }
-}
-
-
-std::string ZipTest::getTestFile(const std::string& testFile)
-{
- Poco::Path root;
- root.makeAbsolute();
- Poco::Path result;
- while (!Poco::Path::find(root.toString(), "data", result))
- {
- root.makeParent();
- if (root.toString().empty() || root.toString() == "/")
- throw Poco::FileNotFoundException("Didn't find data subdir");
- }
- result.makeDirectory();
- result.setFileName(testFile);
- Poco::File aFile(result.toString());
- if (!aFile.exists() || (aFile.exists() && !aFile.isFile()))
- throw Poco::FileNotFoundException("Didn't find " + testFile);
-
- return result.toString();
-}
-
-
-void ZipTest::testDecompress()
-{
- std::string testFile = getTestFile("test.zip");
- std::ifstream inp(testFile.c_str(), std::ios::binary);
- assert (inp.good());
- Decompress dec(inp, Poco::Path());
- dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
- dec.decompressAllFiles();
- dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
- assert (_errCnt == 0);
- assert (!dec.mapping().empty());
-}
-
-
-void ZipTest::testDecompressFlat()
-{
- std::string testFile = getTestFile("test.zip");
- std::ifstream inp(testFile.c_str(), std::ios::binary);
- assert (inp.good());
- Decompress dec(inp, Poco::Path(), true);
- dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
- dec.decompressAllFiles();
- dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
- assert (_errCnt == 0);
- assert (!dec.mapping().empty());
-}
-
-
-void ZipTest::onDecompressError(const void* pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>& info)
-{
- ++_errCnt;
-}
-
-
-void ZipTest::setUp()
-{
- _errCnt = 0;
-}
-
-
-void ZipTest::tearDown()
-{
-}
-
-
-CppUnit::Test* ZipTest::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ZipTest");
-
- CppUnit_addTest(pSuite, ZipTest, testSkipSingleFile);
- CppUnit_addTest(pSuite, ZipTest, testDecompressSingleFile);
- CppUnit_addTest(pSuite, ZipTest, testDecompress);
- CppUnit_addTest(pSuite, ZipTest, testDecompressFlat);
- CppUnit_addTest(pSuite, ZipTest, testCrcAndSizeAfterData);
- CppUnit_addTest(pSuite, ZipTest, testCrcAndSizeAfterDataWithArchive);
- return pSuite;
-}
diff --git a/Utilities/Poco/Zip/testsuite/src/ZipTest.h b/Utilities/Poco/Zip/testsuite/src/ZipTest.h
deleted file mode 100644
index 8fedf13efa..0000000000
--- a/Utilities/Poco/Zip/testsuite/src/ZipTest.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// ZipTest.h
-//
-// $Id$
-//
-// Definition of the ZipTest class.
-//
-// Copyright (c) 2007, 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.
-//
-
-
-#ifndef ZipTest_INCLUDED
-#define ZipTest_INCLUDED
-
-
-#include "Poco/Zip/Zip.h"
-#include "Poco/Zip/ZipLocalFileHeader.h"
-#include "CppUnit/TestCase.h"
-
-
-class ZipTest: public CppUnit::TestCase
-{
-public:
- ZipTest(const std::string& name);
- ~ZipTest();
-
- void testSkipSingleFile();
- void testDecompressSingleFile();
- void testDecompress();
- void testCrcAndSizeAfterData();
- void testCrcAndSizeAfterDataWithArchive();
-
- void testDecompressFlat();
-
- void setUp();
- void tearDown();
-
- static CppUnit::Test* suite();
-
- static std::string getTestFile(const std::string& testFile);
-
-private:
- void onDecompressError(const void* pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>& info);
-
- int _errCnt;
-};
-
-
-#endif // ZipTest_INCLUDED
diff --git a/Utilities/Poco/Zip/testsuite/src/ZipTestSuite.cpp b/Utilities/Poco/Zip/testsuite/src/ZipTestSuite.cpp
deleted file mode 100644
index 1a974f1a75..0000000000
--- a/Utilities/Poco/Zip/testsuite/src/ZipTestSuite.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// ZipTestSuite.cpp
-//
-// $Id$
-//
-// Copyright (c) 2006, 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 "ZipTestSuite.h"
-#include "ZipTest.h"
-#include "PartialStreamTest.h"
-#include "CompressTest.h"
-
-
-CppUnit::Test* ZipTestSuite::suite()
-{
- CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ZipTestSuite");
-
- pSuite->addTest(ZipTest::suite());
- pSuite->addTest(PartialStreamTest::suite());
- pSuite->addTest(CompressTest::suite());
-
- return pSuite;
-}
diff --git a/Utilities/Poco/Zip/testsuite/src/ZipTestSuite.h b/Utilities/Poco/Zip/testsuite/src/ZipTestSuite.h
deleted file mode 100644
index 6f30fc48e8..0000000000
--- a/Utilities/Poco/Zip/testsuite/src/ZipTestSuite.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// ZipTestSuite.h
-//
-// $Id$
-//
-// Definition of the ZipTestSuite class.
-//
-// Copyright (c) 2006, 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.
-//
-
-
-#ifndef ZipTestSuite_INCLUDED
-#define ZipTestSuite_INCLUDED
-
-
-#include "CppUnit/TestSuite.h"
-
-
-class ZipTestSuite
-{
-public:
- static CppUnit::Test* suite();
-};
-
-
-#endif // ZipTestSuite_INCLUDED
diff --git a/Utilities/Poco/patches/Test.h.patch b/Utilities/Poco/patches/Test.h.patch
deleted file mode 100755
index 2ce9b841c0..0000000000
--- a/Utilities/Poco/patches/Test.h.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: Test.h
-===================================================================
---- Test.h (revision 25971)
-+++ Test.h (working copy)
-@@ -40,7 +40,7 @@
-
-
- // Runs a test and collects its result in a TestResult instance.
--inline void Test::run(TestResult *result)
-+inline void Test::run(TestResult */*result*/)
- {
- }
-
diff --git a/Utilities/Poco/version.txt b/Utilities/Poco/version.txt
deleted file mode 100755
index 015427500a..0000000000
--- a/Utilities/Poco/version.txt
+++ /dev/null
@@ -1 +0,0 @@
-POCO Version: 1.3.5

File Metadata

Mime Type
application/octet-stream
Expires
Wed, Oct 9, 11:17 AM (1 d, 21 h)
Storage Engine
chunks
Storage Format
Chunks
Storage Handle
zNIjd3rFfvf0
Default Alt Text
(7 MB)

Event Timeline