submitted 1.2.0

This commit is contained in:
Guenter Obiltschnig 2006-08-29 07:10:35 +00:00
parent f476bd6b32
commit 2d4078f392
1428 changed files with 25715 additions and 12456 deletions

103
CHANGELOG
View File

@ -1,9 +1,108 @@
This is the changelog file for the C++ Portable Components.
This is the changelog file for POCO - the C++ Portable Components.
Release 1.2.0 (2006-08-29)
==========================
- DateTime fixes: Julian Day is no longer stored internally.
Times (hours, minutes, seconds, ...) are now always taken from an utcValue (if available) and not from the Julian day.
The Julian day is only used for calculating year, month and day (except when the Julian day is the only thing we have)
This helps us get rid of rounding errors that the Julian Day arithmetic introduced.- on Windows, UUIDGenerator no longer uses Netbios, but GetAdaptersInfo instead
- The main Makefile now has correct dependencies
- updated poco-doc.pl with latest version by Caleb Epstein
- fixed SF #1542722: InflatingInputStream: buffer error
- improved Windows UTF-8 support
- added Logger::names()
- added configure script and make install target
- XMLWriter bugfix: pretty-print bug with characters() and rawCharacters()
- improvements to build system: support builds outside of source tree
- added header doc conversion tool contributed by Caleb Epstein
- fixed SF #1542618 (build/config/Linux patch)
- bugfix: BinaryReader/BinaryWriter BOM is now 16 bits, as documented
- fixed SF #1542247 (Compiler warning from OptionCallback)
- fixed SF #1542253 (ServerApplication::handleOption doesn't call Application::handleOption)
- added Application::stopOptionsProcessing()
- updated samples
- Util::Application command line handling now supports:
* argument validation (Option::validator(); see Validator, IntValidator, RegExpValidator)
* binding of argument values to config properties (Option::binding())
* callbacks for arguments (Option::callback())
* checking of required parameters
- changed header file locations:
Foundation headers are now in Poco (#include "Poco/Foundation.h")
XML headers are now in Poco/XML, Poco/SAX and Poco/DOM (#include "Poco/XML/XML.h")
Util headers are now in Poco/Util (#include "Poco/Util/Util.h")
etc.
Unfortunately, this change will break existing code. However, fixing the code is
a matter of a few global search/replace operations and can be done quickly.
On the plus side, POCO is now a much better citizen when used with other
libraries.
- changed namespaces:
Foundation is now Poco
XML is now Poco::XML
Util is now Poco::Util
Net is now Poco::Net
- removed namespace macros
- fixed some warnings reported by gcc -Wall -Wextra
- fixed AutoPtr and LayeredConfiguration documentation
- improved StreamSocket::receiveBytes() doc
- added Pipe and PipeStream classes
- added support for I/O redirection (pipes) to Process::launch()
- added LogStream class (ostream interface to Logger)
- improved Makefiles (no more double-building if clean all is specified)
- added CppUnit and DateTime testsuite contributions by Andrew Marlow
- improved Cygwin and minimal MinGW support
- FileChannel: gzip compression if archived files now runs in a background thread (SF #1537481)
- POCO now compiles with large (64-bit) file support on Linux (SF #1536634)
- added format() function, which provides typesafe sprintf-like functionality (SF #1327621)
- added File::isLink()
- bugfix: dangling symbolic links in a directory no longer cause recursive remove to fail with file not found error
- added Void class (useful as argument to ActiveMethod)
- ActiveResult now supports exceptions
- bugfix: Timezone::utcOffset() and Timezone::dst() returned wrong values on Unix platforms (SF #1535428)
- added ActiveDispatcher class
- added ActiveStarter class, which is a policy used by ActiveMethod for starting methods
- ActiveRunnable moved to its own header file
- ThreadPool: added startWithPriority(), which allows for running threads with a different priority
- added error handling to dir sample
- added additional test case to HTTPServer test suite- HTMLForm: should now work with request methods other than POST and GET (all non-POST requests are treated the same as GET)
- clarified HTMLForm documentation
- HTMLForm bugfix: uploaded files no longer end up in value; PartHandler is called instead
- NameValueCollection: added get(name, defaultValue)
- added HTTPFormServer sample
- added Foundation::HashTable and SimpleHashTable
- added Net::HTTPSessionFactory
- improvements to AutoPtr and SharedPtr
- improvements to namespaces handling in XMLWriter
- Foundation Cache: fixed add implementation to match the docu: a 2nd add will now simply overwrite existing entries
- added DateTime::isValid()
- added Exception::rethrow() (virtual, must be overridden by all subclasses)
- Timer can now use a user-supplied ThreadPool
- added rethrow() to exception classes
- Net: made some constructors explicit
- Net: added SocketAddress constructor to HTTPClientSession
- Net: added HTTPSession::networkException() to check for exceptions swallowed by stream classes
- Net: added single string argument constructor to SocketAddress.
- Net: improved HTTPClientSession error handling (no more "Invalid HTTP version string" exceptions when the server prematurely closes the connection due to too much load)
- Net: improved HTTPSession error handling. Exceptions while sending and receiving data are stored for later retrieval and no longer get lost since streambufs swallow them.
- Net: added HTTPLoadTest sample
- fixed a bug when opening logfiles on Unix platforms causing an existing logfile to be truncated
- bugfix: log file purge intervals given in months did not work, due to a stupid typo
- added RawSocket and ICMP classes
- UUID: fixed a doc formatting bug
- NetworkInterface::list() now includes loopback interface on Windows (SF #1460309)
- made Exception::message() and Exception::nested() inline
- added Net::UnsupportedRedirectException
- HTTPStreamFactory throws an UnsupportedRedirectException if it encounters a redirect to https
- HTTP: fixed bad 100 Continue handling in client and server code
- added CONTRIBUTORS file
Release 1.1.2 (2006-07-07)
==========================
- Changed license to Boost license
- DBlite and NetSSL have been removed from the Boost-licensed release.
Please contact Applied Informatics (info@appinf.com) if you're interested in them.
Release 1.1.1 (2006-04-03)
@ -367,4 +466,4 @@ building the libraries.
--
$Id: //poco/1.1.0/dist/CHANGELOG#3 $
$Id: //poco/1.2/dist/CHANGELOG#1 $

9
CONTRIBUTORS Normal file
View File

@ -0,0 +1,9 @@
Guenter Obiltschnig <guenter.obiltschnig@appinf.com>
Alex Fabijanic <aleskx@gmail.com>
Peter Schojer <peter.schojer@appinf.com>
Claus Dabringer <claus.dabringer@appinf.com>
Andrew Marlow (public@marlowa.plus.com)
Caleb Epstein (caleb.epstein@gmail.com)
--
$Id: //poco/1.2/dist/CONTRIBUTORS#1 $

View File

@ -1,7 +1,7 @@
#
# Makefile
#
# $Id: //poco/1.1.0/CppUnit/Makefile#1 $
# $Id: //poco/1.2/CppUnit/Makefile#1 $
#
# Makefile for Poco CppUnit
#

View File

@ -1,7 +1,7 @@
//
// WinTestRunner.h
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h#1 $
//
// Application shell for CppUnit's TestRunner dialog.
//
@ -18,17 +18,12 @@
#endif
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef STD_VECTOR_INCLUDED
#include <vector>
#define STD_VECTOR_INCLUDED
#endif
#include <afxwin.h>
CppUnit_BEGIN
namespace CppUnit {
class Test;
@ -61,7 +56,7 @@ public:
};
CppUnit_END
} // namespace CppUnit
#endif // WinTestRunner_H_INCLUDED

View File

@ -1,7 +1,7 @@
//
// ActiveTest.cpp
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/ActiveTest.cpp#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ActiveTest.cpp#1 $
//
@ -9,7 +9,7 @@
#include "ActiveTest.h"
CppUnit_BEGIN
namespace CppUnit {
// Spawn a thread to a test
@ -40,5 +40,5 @@ UINT ActiveTest::threadFunction(LPVOID thisInstance)
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,7 +1,7 @@
//
// ActiveTest.h
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/ActiveTest.h#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ActiveTest.h#1 $
//
@ -9,16 +9,12 @@
#define ActiveTest_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_TestDecorator_INCLUDED
#include "CppUnit/TestDecorator.h"
#endif
#include <afxmt.h>
CppUnit_BEGIN
namespace CppUnit {
/* A Microsoft-specific active test
@ -85,7 +81,7 @@ inline void ActiveTest::run()
}
CppUnit_END
} // namespace CppUnit
#endif // ActiveTest_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DLLMain.cpp
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/DLLMain.cpp#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/DLLMain.cpp#1 $
//

View File

@ -1,7 +1,7 @@
//
// GUITestResult.cpp
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/GUITestResult.cpp#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/GUITestResult.cpp#1 $
//
@ -9,7 +9,7 @@
#include "GUITestResult.h"
CppUnit_BEGIN
namespace CppUnit {
void GUITestResult::addError(Test *test, CppUnitException *e)
@ -39,5 +39,5 @@ void GUITestResult::endTest(Test *test)
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,7 +1,7 @@
//
// GUITestResult.h
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/GUITestResult.h#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/GUITestResult.h#1 $
//
@ -9,16 +9,12 @@
#define GuiTestResult_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_TestResult_INCLUDED
#include "CppUnit/TestResult.h"
#endif
#include <afxmt.h>
CppUnit_BEGIN
namespace CppUnit {
class TestRunnerDlg;
@ -80,7 +76,7 @@ inline void GUITestResult::stop()
}
CppUnit_END
} // namespace CppUnit
#endif // GuiTestResult_INCLUDED

View File

@ -1,14 +1,14 @@
//
// ProgressBar.cpp
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/ProgressBar.cpp#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ProgressBar.cpp#1 $
//
#include "ProgressBar.h"
CppUnit_BEGIN
namespace CppUnit {
// Paint the progress bar in response to a paint message
@ -137,4 +137,4 @@ void ProgressBar::reset ()
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,7 +1,7 @@
//
// ProgressBar.h
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/ProgressBar.h#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ProgressBar.h#1 $
//
@ -9,13 +9,11 @@
#define ProgressBar_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#include <afxwin.h>
CppUnit_BEGIN
namespace CppUnit {
/* A Simple ProgressBar for test execution display
@ -70,7 +68,7 @@ inline COLORREF ProgressBar::getStatusColor()
}
CppUnit_END
} // namespace CppUnit
#endif // ProgressBar_INCLUDED

View File

@ -1,7 +1,7 @@
//
// TestRunnerDlg.cpp
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp#1 $
//
@ -17,7 +17,7 @@
#include "TestRunnerDlg.h"
CppUnit_BEGIN
namespace CppUnit {
TestRunnerDlg::TestRunnerDlg(CWnd* pParent): CDialog(TestRunnerDlg::IDD, pParent)
@ -421,4 +421,4 @@ void TestRunnerDlg::addTest(Test* pTest, int level)
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,7 +1,7 @@
//
// TestRunnerDlg.h
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/TestRunnerDlg.h#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/TestRunnerDlg.h#1 $
//
@ -9,27 +9,16 @@
#define TestRunnerDlg_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_CppUnitException_INCLUDED
#include "CppUnit/CppUnitException.h"
#endif
#ifndef ActiveTest_INCLUDED
#include "ActiveTest.h"
#endif
#ifndef STD_VECTOR_INCLUDED
#include <vector>
#define STD_VECTOR_INCLUDED
#endif
#ifndef IDD_DIALOG_TESTRUNNER
#include "../res/Resource.h"
#endif
#include <afxwin.h>
#include "afxwin.h"
CppUnit_BEGIN
namespace CppUnit {
class ProgressBar;
@ -96,7 +85,7 @@ protected:
};
CppUnit_END
} // namespace CppUnit
#endif // TestRunnerDlg_INCLUDED

View File

@ -1,7 +1,7 @@
//
// WinTestRunner.cpp
//
// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/WinTestRunner.cpp#1 $
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/WinTestRunner.cpp#1 $
//
@ -9,7 +9,7 @@
#include "TestRunnerDlg.h"
CppUnit_BEGIN
namespace CppUnit {
WinTestRunner::WinTestRunner()
@ -61,4 +61,4 @@ void WinTestRunnerApp::TestMain()
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,7 +1,7 @@
//
// CppUnit.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/CppUnit.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/CppUnit.h#1 $
//
@ -27,7 +27,7 @@
// 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(__CYGWIN__)) && defined(POCO_DLL)
#if defined(_WIN32) && defined(POCO_DLL)
#if defined(CppUnit_EXPORTS)
#define CppUnit_API __declspec(dllexport)
#else
@ -41,13 +41,6 @@
#endif
//
// Macros to declare the namespace
//
#define CppUnit_BEGIN namespace CppUnit {
#define CppUnit_END }
// Turn off some annoying warnings
#ifdef _MSC_VER
#pragma warning(disable:4786) // identifier truncation warning

View File

@ -1,7 +1,7 @@
//
// CppUnitException.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/CppUnitException.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/CppUnitException.h#1 $
//
@ -9,20 +9,12 @@
#define CppUnit_CppUnitException_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef STD_EXCEPTION_INCLUDED
#include <exception>
#define STD_EXCEPTION_INCLUDED
#endif
#ifndef STD_STRING_INCLUDED
#include <string>
#define STD_STRING_INCLUDED
#endif
CppUnit_BEGIN
namespace CppUnit {
class CppUnit_API CppUnitException: public std::exception
@ -33,6 +25,15 @@ 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();
@ -41,6 +42,8 @@ public:
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;
@ -49,18 +52,33 @@ public:
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;
_fileName = other._fileName;
_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), _fileName(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)
{
}
@ -78,6 +96,8 @@ inline CppUnitException& CppUnitException::operator = (const CppUnitException& o
{
_message = other._message;
_lineNumber = other._lineNumber;
_data1lineNumber = other._data1lineNumber;
_data2lineNumber = other._data2lineNumber;
_fileName = other._fileName;
}
return *this;
@ -96,6 +116,18 @@ inline long CppUnitException::lineNumber() const
}
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
{
@ -103,8 +135,7 @@ inline const std::string& CppUnitException::fileName() const
}
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_CppUnitException_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Guards.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/Guards.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/Guards.h#1 $
//

View File

@ -1,7 +1,7 @@
//
// Orthodox.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/Orthodox.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/Orthodox.h#1 $
//
@ -9,15 +9,11 @@
#define CppUnit_Orthodox_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_TestCase_INCLUDED
#include "CppUnit/TestCase.h"
#endif
CppUnit_BEGIN
namespace CppUnit {
/*
@ -103,7 +99,7 @@ ClassUnderTest Orthodox<ClassUnderTest>::call(ClassUnderTest object)
}
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_Orthodox_INCLUDED

View File

@ -1,7 +1,7 @@
//
// RepeatedTest.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/RepeatedTest.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/RepeatedTest.h#1 $
//
@ -9,18 +9,12 @@
#define CppUnit_RepeatedTest_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_Guards_INCLUDED
#include "CppUnit/Guards.h"
#endif
#ifndef CppUnit_TestDecorator_INCLUDED
#include "CppUnit/TestDecorator.h"
#endif
CppUnit_BEGIN
namespace CppUnit {
class Test;
@ -53,14 +47,14 @@ private:
// Counts the number of test cases that will be run by this test.
inline RepeatedTest::countTestCases ()
{
return TestDecorator::countTestCases () * _timesRepeat;
return TestDecorator::countTestCases() * _timesRepeat;
}
// Returns the name of the test instance.
inline std::string RepeatedTest::toString()
{
return TestDecorator::toString () + " (repeated)";
return TestDecorator::toString() + " (repeated)";
}
@ -77,7 +71,7 @@ inline void RepeatedTest::run(TestResult *result)
}
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_RepeatedTest_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Test.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/Test.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/Test.h#1 $
//
@ -9,16 +9,11 @@
#define CppUnit_Test_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef STD_STRING_INCLUDED
#include <string>
#define STD_STRING_INCLUDED
#endif
CppUnit_BEGIN
namespace CppUnit {
class TestResult;
@ -64,7 +59,7 @@ inline std::string Test::toString()
}
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_Test_INCLUDED

View File

@ -1,7 +1,7 @@
//
// TestCaller.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/TestCaller.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestCaller.h#1 $
//
@ -9,22 +9,13 @@
#define CppUnit_TestCaller_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_Guards_INCLUDED
#include "Guards.h"
#endif
#ifndef CppUnit_TestCase_INCLUDED
#include "TestCase.h"
#endif
#ifndef STD_MEMORY_INCLUDED
#include <memory>
#define STD_MEMORY_INCLUDED
#endif
CppUnit_BEGIN
namespace CppUnit {
/*
@ -65,7 +56,10 @@ class TestCaller: public TestCase
typedef void (Fixture::*TestMethod)();
public:
TestCaller(const std::string& name, TestMethod test): TestCase(name), _fixture(new Fixture(name)), _test(test)
TestCaller(const std::string& name, TestMethod test):
TestCase(name),
_test(test),
_fixture(new Fixture(name))
{
}
@ -91,7 +85,7 @@ private:
};
CppUnit_END
} // namespace CppUnit
#define CppUnit_addTest(suite, cls, mth) \

View File

@ -1,7 +1,7 @@
//
// TestCase.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/TestCase.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestCase.h#1 $
//
@ -9,29 +9,15 @@
#define CppUnit_TestCase_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_Guards_INCLUDED
#include "CppUnit/Guards.h"
#endif
#ifndef CppUnit_Test_INCLUDED
#include "CppUnit/Test.h"
#endif
#ifndef CppUnit_CppUnitException_INCLUDED
#include "CppUnit/CppUnitException.h"
#endif
#ifndef STD_STRING_INCLUDED
#include <string>
#define STD_STRING_INCLUDED
#endif
#ifndef STD_TYPEINFO_INCLUDED
#include <typeinfo>
#define STD_TYPEINFO_INCLUDED
#endif
CppUnit_BEGIN
namespace CppUnit {
class TestResult;
@ -123,6 +109,19 @@ protected:
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,
@ -150,9 +149,9 @@ protected:
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);
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 = "",
@ -222,6 +221,12 @@ inline std::string TestCase::toString()
#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__))
@ -238,7 +243,7 @@ inline std::string TestCase::toString()
(this->fail(msg, __LINE__, __FILE__))
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_TestCase_INCLUDED

View File

@ -1,7 +1,7 @@
//
// TestDecorator.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/TestDecorator.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestDecorator.h#1 $
//
@ -9,18 +9,12 @@
#define CppUnit_TestDecorator_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_Guards_INCLUDED
#include "CppUnit/Guards.h"
#endif
#ifndef CppUnit_Test_INCLUDED
#include "CppUnit/Test.h"
#endif
CppUnit_BEGIN
namespace CppUnit {
class TestResult;
@ -52,7 +46,7 @@ protected:
};
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_TestDecorator_INCLUDED

View File

@ -1,7 +1,7 @@
//
// TestFailure.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/TestFailure.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestFailure.h#1 $
//
@ -9,18 +9,12 @@
#define CppUnit_TestFailure_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_CppUnitException_INCLUDED
#include "CppUnit/CppUnitException.h"
#endif
#ifndef CppUnit_Guards_INCLUDED
#include "CppUnit/Guards.h"
#endif
CppUnit_BEGIN
namespace CppUnit {
class Test;
@ -84,7 +78,7 @@ inline CppUnitException* TestFailure::thrownException()
}
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_TestFailure_INCLUDED

View File

@ -1,7 +1,7 @@
//
// TestResult.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/TestResult.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestResult.h#1 $
//
@ -9,22 +9,13 @@
#define CppUnit_TestResult_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_Guards_INCLUDED
#include "CppUnit/Guards.h"
#endif
#ifndef CppUnit_TestFailure_INCLUDED
#include "CppUnit/TestFailure.h"
#endif
#ifndef STD_VECTOR_INCLUDED
#include <vector>
#define STD_VECTOR_INCLUDED
#endif
CppUnit_BEGIN
namespace CppUnit {
class CppUnitException;
@ -234,7 +225,7 @@ inline void TestResult::setSynchronizationObject(SynchronizationObject* syncObje
}
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_TestResult_INCLUDED

View File

@ -1,7 +1,7 @@
//
// TestRunner.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/TestRunner.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestRunner.h#1 $
//
@ -9,20 +9,12 @@
#define CppUnit_TestRunner_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef STD_VECTOR_INCLUDED
#include <vector>
#define STD_VECTOR_INCLUDED
#endif
#ifndef STD_STRING_INCLUDED
#include <string>
#define STD_STRING_INCLUDED
#endif
CppUnit_BEGIN
namespace CppUnit {
class Test;
@ -65,7 +57,7 @@ private:
};
CppUnit_END
} // namespace CppUnit
#define CppUnitMain(testCase) \

View File

@ -1,7 +1,7 @@
//
// TestSetup.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/TestSetup.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestSetup.h#1 $
//
@ -9,18 +9,12 @@
#define CppUnit_TestSetup_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_Guards_INCLUDED
#include "CppUnit/Guards.h"
#endif
#ifndef CppUnit_TestDecorator_INCLUDED
#include "CppUnit/TestDecorator.h"
#endif
CppUnit_BEGIN
namespace CppUnit {
class Test;
@ -57,7 +51,7 @@ inline void TestSetup::run(TestResult* result)
}
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_TestSetup_INCLUDED

View File

@ -1,7 +1,7 @@
//
// TestSuite.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/TestSuite.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestSuite.h#1 $
//
@ -9,26 +9,14 @@
#define CppUnit_TestSuite_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_Guards_INCLUDED
#include "CppUnit/Guards.h"
#endif
#ifndef CppUnit_Test_INCLUDED
#include "CppUnit/Test.h"
#endif
#ifndef STD_VECTOR_INCLUDED
#include <vector>
#define STD_VECTOR_INCLUDED
#endif
#ifndef STD_STRING_INCLUDED
#include <string>
#define STD_STRING_INCLUDED
#endif
CppUnit_BEGIN
namespace CppUnit {
class TestResult;
@ -104,7 +92,7 @@ inline const std::vector<Test*> TestSuite::tests() const
}
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_TestSuite_INCLUDED

View File

@ -1,7 +1,7 @@
//
// TextTestResult.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/TextTestResult.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/TextTestResult.h#1 $
//
@ -9,19 +9,12 @@
#define CppUnit_TextTestResult_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef CppUnit_TestResult_INCLUDED
#include "CppUnit/TestResult.h"
#endif
#ifndef STD_OSTREAM_INCLUDED
#include <ostream>
#define STD_OSTREAM_INCLUDED
#endif
CppUnit_BEGIN
namespace CppUnit {
class CppUnit_API TextTestResult: public TestResult
@ -48,7 +41,7 @@ inline std::ostream& operator<< (std::ostream& stream, TextTestResult& result)
}
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_TextTestResult_INCLUDED

View File

@ -1,7 +1,7 @@
//
// estring.h
//
// $Id: //poco/1.1.0/CppUnit/include/CppUnit/estring.h#1 $
// $Id: //poco/1.2/CppUnit/include/CppUnit/estring.h#1 $
//
@ -9,20 +9,12 @@
#define CppUnit_estring_INCLUDED
#ifndef CppUnit_CppUnit_INCLUDED
#include "CppUnit/CppUnit.h"
#endif
#ifndef STD_STRING_INCLUDED
#include <string>
#define STD_STRING_INCLUDED
#endif
#ifndef STD_STDIO_INCLUDED
#include <stdio.h>
#define STD_STDIO_INCLUDED
#endif
CppUnit_BEGIN
namespace CppUnit {
// Create a std::string from a const char pointer
@ -75,7 +67,7 @@ inline std::string estring(const void* ptr)
}
CppUnit_END
} // namespace CppUnit
#endif // CppUnit_estring_INCLUDED

View File

@ -1,18 +1,18 @@
//
// CppUnitException.cpp
//
// $Id: //poco/1.1.0/CppUnit/src/CppUnitException.cpp#1 $
// $Id: //poco/1.2/CppUnit/src/CppUnitException.cpp#1 $
//
#include "CppUnit/CppUnitException.h"
CppUnit_BEGIN
namespace CppUnit {
const std::string CppUnitException::CPPUNIT_UNKNOWNFILENAME = "<unknown>";
const int CppUnitException::CPPUNIT_UNKNOWNLINENUMBER = -1;
CppUnit_END
} // namespace CppUnit

View File

@ -1,7 +1,7 @@
//
// TestCase.cpp
//
// $Id: //poco/1.1.0/CppUnit/src/TestCase.cpp#1 $
// $Id: //poco/1.2/CppUnit/src/TestCase.cpp#1 $
//
@ -16,7 +16,7 @@
using namespace std;
CppUnit_BEGIN
namespace CppUnit {
// Create a default TestResult
@ -34,6 +34,20 @@ void TestCase::assertImplementation(bool condition, const std::string& condition
}
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)
{
@ -165,4 +179,4 @@ std::string TestCase::notEqualsMessage(const std::string& expected, const std::s
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,14 +1,14 @@
//
// TestDecorator.cpp
//
// $Id: //poco/1.1.0/CppUnit/src/TestDecorator.cpp#1 $
// $Id: //poco/1.2/CppUnit/src/TestDecorator.cpp#1 $
//
#include "CppUnit/TestDecorator.h"
CppUnit_BEGIN
namespace CppUnit {
TestDecorator::TestDecorator(Test* test)
@ -40,4 +40,4 @@ std::string TestDecorator::toString()
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,7 +1,7 @@
//
// TestFailure.cpp
//
// $Id: //poco/1.1.0/CppUnit/src/TestFailure.cpp#1 $
// $Id: //poco/1.2/CppUnit/src/TestFailure.cpp#1 $
//
@ -9,7 +9,7 @@
#include "CppUnit/Test.h"
CppUnit_BEGIN
namespace CppUnit {
// Returns a short description of the failure.
@ -19,4 +19,4 @@ std::string TestFailure::toString()
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,14 +1,14 @@
//
// TestResult.cpp
//
// $Id: //poco/1.1.0/CppUnit/src/TestResult.cpp#1 $
// $Id: //poco/1.2/CppUnit/src/TestResult.cpp#1 $
//
#include "CppUnit/TestResult.h"
CppUnit_BEGIN
namespace CppUnit {
// Destroys a test result
@ -26,4 +26,4 @@ TestResult::~TestResult()
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,7 +1,7 @@
//
// TestRunner.cpp
//
// $Id: //poco/1.1.0/CppUnit/src/TestRunner.cpp#1 $
// $Id: //poco/1.2/CppUnit/src/TestRunner.cpp#1 $
//
@ -12,7 +12,7 @@
#include <iostream>
CppUnit_BEGIN
namespace CppUnit {
TestRunner::TestRunner()
@ -178,4 +178,4 @@ Test* TestRunner::find(const std::string& name, Test* pTest, const std::string&
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,7 +1,7 @@
//
// TestSuite.cpp
//
// $Id: //poco/1.1.0/CppUnit/src/TestSuite.cpp#1 $
// $Id: //poco/1.2/CppUnit/src/TestSuite.cpp#1 $
//
@ -9,7 +9,7 @@
#include "CppUnit/TestResult.h"
CppUnit_BEGIN
namespace CppUnit {
// Deletes all tests in the suite.
@ -46,4 +46,4 @@ int TestSuite::countTestCases()
}
CppUnit_END
} // namespace CppUnit

View File

@ -1,7 +1,7 @@
//
// TextTestResult.cpp
//
// $Id: //poco/1.1.0/CppUnit/src/TextTestResult.cpp#1 $
// $Id: //poco/1.2/CppUnit/src/TextTestResult.cpp#1 $
//
@ -13,7 +13,7 @@
#include <iomanip>
CppUnit_BEGIN
namespace CppUnit {
void TextTestResult::addError(Test* test, CppUnitException* e)
@ -42,6 +42,7 @@ void TextTestResult::printErrors(std::ostream& stream)
if (testErrors() != 0)
{
stream << "\n";
if (testErrors() == 1)
stream << "There was " << testErrors() << " error: " << std::endl;
else
@ -57,7 +58,27 @@ void TextTestResult::printErrors(std::ostream& stream)
<< ": "
<< failure->failedTest()->toString() << "\n"
<< " \"" << (e ? e->what() : "") << "\"\n"
<< " in \"" << (e ? e->fileName() : std::string()) << "\", line " << (e ? e->lineNumber() : 0) << "\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++;
}
}
@ -85,11 +106,31 @@ void TextTestResult::printFailures(std::ostream& stream)
<< ": "
<< failure->failedTest()->toString() << "\n"
<< " \"" << (e ? e->what() : "") << "\"\n"
<< " in \"" << (e ? e->fileName() : std::string()) << "\", line " << (e ? e->lineNumber() : 0) << "\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++;
}
}
}
@ -130,4 +171,4 @@ std::string TextTestResult::shortName(const std::string& testName)
}
CppUnit_END
} // namespace CppUnit

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
#
# Makefile
#
# $Id: //poco/1.1.0/Foundation/Makefile#1 $
# $Id: //poco/1.2/Foundation/Makefile#1 $
#
# Makefile for Poco Foundation
#
@ -15,7 +15,7 @@ objects = ArchiveStrategy ASCIIEncoding AsyncChannel Base64Decoder Base64Encoder
Environment Event EventArgs ErrorHandler Exception FPEnvironment File Glob \
FileChannel Formatter FormattingChannel HexBinaryDecoder LineEndingConverter \
HexBinaryEncoder InflatingStream Latin1Encoding Latin9Encoding LogFile Logger \
LoggingFactory LoggingRegistry NamedEvent NamedMutex NullChannel \
LoggingFactory LoggingRegistry LogStream NamedEvent NamedMutex NullChannel \
MemoryPool MD2Engine MD4Engine MD5Engine Manifest Message Mutex \
NestedDiagnosticContext Notification NotificationCenter \
NotificationQueue NullStream NumberFormatter NumberParser Observer \
@ -24,17 +24,18 @@ objects = ArchiveStrategy ASCIIEncoding AsyncChannel Base64Decoder Base64Encoder
SHA1Engine Semaphore SharedLibrary SimpleFileChannel \
SignalHandler SplitterChannel Stopwatch StreamChannel StreamConverter StreamCopier \
StreamTokenizer String StringTokenizer SynchronizedObject SyslogChannel \
Task TaskManager TaskNotification TeeStream \
Task TaskManager TaskNotification TeeStream HashStatistic\
TemporaryFile TextConverter TextEncoding TextIterator Thread ThreadLocal \
ThreadPool Timer Timespan Timestamp Timezone Token URI \
ThreadPool ActiveDispatcher Timer Timespan Timestamp Timezone Token URI \
FileStreamFactory URIStreamFactory URIStreamOpener UTF16Encoding Windows1252Encoding \
UTF8Encoding UnicodeConverter UUID UUIDGenerator \
UTF8Encoding UnicodeConverter UUID UUIDGenerator Void Format \
Pipe PipeImpl PipeStream \
adler32 chartables compress crc32 \
deflate get gzio infback inffast inflate inftrees maketables pcre study \
trees zutil
target = PocoFoundation
target_version = 1
target_version = $(LIBVERSION)
target_libs =
include $(POCO_BASE)/build/rules/lib

View File

@ -36,6 +36,7 @@ Glob
FileChannel
Formatter
FormattingChannel
HashStatistic
HexBinaryDecoder
HexBinaryEncoder
InflatingStream

View File

@ -1,7 +1,7 @@
//
// ASCIIEncoding.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/ASCIIEncoding.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/ASCIIEncoding.h#1 $
//
// Library: Foundation
// Package: Text
@ -40,15 +40,11 @@
#define Foundation_ASCIIEncoding_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_TextEncoding_INCLUDED
#include "Foundation/TextEncoding.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/TextEncoding.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API ASCIIEncoding: public TextEncoding
@ -66,7 +62,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_ASCIIEncoding_INCLUDED

View File

@ -1,7 +1,7 @@
//
// AbstractCache.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/AbstractCache.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/AbstractCache.h#1 $
//
// Library: Foundation
// Package: Cache
@ -40,20 +40,19 @@
#define Foundation_AbstractCache_INCLUDED
#include "Foundation/KeyValueArgs.h"
#include "Foundation/ValidArgs.h"
#include "Foundation/ScopedLock.h"
#include "Foundation/Mutex.h"
#include "Foundation/Exception.h"
#include "Foundation/BasicEvent.h"
#include "Foundation/EventArgs.h"
#include "Foundation/Delegate.h"
#include "Foundation/SharedPtr.h"
#include "Poco/KeyValueArgs.h"
#include "Poco/ValidArgs.h"
#include "Poco/Mutex.h"
#include "Poco/Exception.h"
#include "Poco/BasicEvent.h"
#include "Poco/EventArgs.h"
#include "Poco/Delegate.h"
#include "Poco/SharedPtr.h"
#include <map>
#include <set>
Foundation_BEGIN
namespace Poco {
template <class TKey, class TValue, class TStrategy>
@ -235,7 +234,7 @@ protected:
typename std::set<TKey>::const_iterator it = delMe.begin();
typename std::set<TKey>::const_iterator endIt = delMe.end();
for (it; it != endIt; ++it)
for (; it != endIt; ++it)
{
doRemove(*it);
}
@ -252,7 +251,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif

View File

@ -1,7 +1,7 @@
//
// AbstractDelegate.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/AbstractDelegate.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/AbstractDelegate.h#1 $
//
// Library: Foundation
// Package: Events
@ -40,10 +40,10 @@
#define Foundation_AbstractDelegate_INCLUDED
#include "Foundation/Foundation.h"
#include "Poco/Foundation.h"
Foundation_BEGIN
namespace Poco {
template <class TArgs>
@ -73,7 +73,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif

View File

@ -1,7 +1,7 @@
//
// AbstractEvent.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/AbstractEvent.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/AbstractEvent.h#1 $
//
// Library: Foundation
// Package: Events
@ -40,16 +40,15 @@
#define Foundation_AbstractFoundation_INCLUDED
#include "Foundation/Foundation.h"
#include "Foundation/SingletonHolder.h"
#include "Foundation/SharedPtr.h"
#include "Foundation/ActiveResult.h"
#include "Foundation/ActiveMethod.h"
#include "Foundation/ScopedLock.h"
#include "Foundation/Mutex.h"
#include "Poco/Foundation.h"
#include "Poco/SingletonHolder.h"
#include "Poco/SharedPtr.h"
#include "Poco/ActiveResult.h"
#include "Poco/ActiveMethod.h"
#include "Poco/Mutex.h"
Foundation_BEGIN
namespace Poco {
template <class TArgs, class TStrategy, class TDelegate>
@ -71,7 +70,7 @@ class AbstractEvent
/// class MyData
/// {
/// public:
/// Foundation::BasicEvent<int> AgeChanged;
/// Poco::BasicEvent<int> AgeChanged;
///
/// MyData();
/// ...
@ -136,15 +135,15 @@ class AbstractEvent
{
public:
AbstractEvent():
_enabled(true),
_executeAsync(this, &AbstractEvent::executeAsyncImpl)
_executeAsync(this, &AbstractEvent::executeAsyncImpl),
_enabled(true)
{
}
AbstractEvent(const TStrategy& strat):
_enabled(true),
_executeAsync(this, &AbstractEvent::executeAsyncImpl),
_strategy(strat),
_executeAsync(this, &AbstractEvent::executeAsyncImpl)
_enabled(true)
{
}
@ -181,7 +180,7 @@ public:
/// 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.
{
Foundation::SharedPtr<TStrategy> ptrStrat;
SharedPtr<TStrategy> ptrStrat;
bool enabled = false;
{
@ -202,7 +201,7 @@ public:
}
}
Foundation::ActiveResult<TArgs> notifyAsync(const void* pSender, const TArgs& 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.
@ -223,13 +222,13 @@ public:
// make a copy of the strategy here to guarantee that
// between notifyAsync and the execution of the method no changes can occur
params.ptrStrat = Foundation::SharedPtr<TStrategy>(new TStrategy(_strategy));
params.ptrStrat = SharedPtr<TStrategy>(new TStrategy(_strategy));
params.pSender = pSender;
params.args = args;
params.enabled = _enabled;
}
Foundation::ActiveResult<TArgs> result = _executeAsync(params);
ActiveResult<TArgs> result = _executeAsync(params);
return result;
}
@ -264,12 +263,12 @@ public:
protected:
struct NotifyAsyncParams
{
Foundation::SharedPtr<TStrategy> ptrStrat;
SharedPtr<TStrategy> ptrStrat;
const void* pSender;
TArgs args;
bool enabled;
};
Foundation::ActiveMethod<TArgs, NotifyAsyncParams, AbstractEvent> _executeAsync;
ActiveMethod<TArgs, NotifyAsyncParams, AbstractEvent> _executeAsync;
TArgs executeAsyncImpl(const NotifyAsyncParams& par)
{
@ -287,7 +286,7 @@ protected:
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 Foundation::FastMutex _mutex;
mutable FastMutex _mutex;
private:
AbstractEvent(const AbstractEvent& other);
@ -295,7 +294,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif

View File

@ -1,7 +1,7 @@
//
// AbstractPriorityDelegate.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/AbstractPriorityDelegate.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/AbstractPriorityDelegate.h#1 $
//
// Library: Foundation
// Package: Events
@ -40,10 +40,10 @@
#define Foundation_AbstractPriorityDelegate_INCLUDED
#include "Foundation/Foundation.h"
#include "Poco/Foundation.h"
Foundation_BEGIN
namespace Poco {
template <class TArgs>
@ -73,7 +73,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif

View File

@ -1,7 +1,7 @@
//
// AbstractStrategy.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/AbstractStrategy.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/AbstractStrategy.h#1 $
//
// Library: Foundation
// Package: Cache
@ -40,12 +40,12 @@
#define Foundation_AbstractStrategy_INCLUDED
#include "Foundation/KeyValueArgs.h"
#include "Foundation/ValidArgs.h"
#include "Foundation/EventArgs.h"
#include "Poco/KeyValueArgs.h"
#include "Poco/ValidArgs.h"
#include "Poco/EventArgs.h"
Foundation_BEGIN
namespace Poco {
template <class TKey, class TValue>
@ -85,7 +85,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif

View File

@ -0,0 +1,137 @@
//
// ActiveDispatcher.h
//
// $Id: //poco/1.2/Foundation/include/Poco/ActiveDispatcher.h#1 $
//
// Library: Foundation
// Package: Threading
// Module: ActiveObjects
//
// Definition of the ActiveDispatcher 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_ActiveDispatcher_INCLUDED
#define Foundation_ActiveDispatcher_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Runnable.h"
#include "Poco/Thread.h"
#include "Poco/ActiveStarter.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(Runnable* 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, Runnable* pRunnable)
{
pOwner->start(pRunnable);
}
};
} // namespace Poco
#endif // Foundation_ActiveDispatcher_INCLUDED

View File

@ -1,7 +1,7 @@
//
// ActiveMethod.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/ActiveMethod.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/ActiveMethod.h#1 $
//
// Library: Foundation
// Package: Threading
@ -40,75 +40,16 @@
#define Foundation_ActiveMethod_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_ActiveResult_INCLUDED
#include "Foundation/ActiveResult.h"
#endif
#ifndef Foundation_Runnable_INCLUDED
#include "Foundation/Runnable.h"
#endif
#ifndef Foundation_ThreadPool_INCLUDED
#include "Foundation/ThreadPool.h"
#endif
#ifndef Foundation_Exception_INCLUDED
#include "Foundation/Exception.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/ActiveResult.h"
#include "Poco/ActiveRunnable.h"
#include "Poco/ActiveStarter.h"
Foundation_BEGIN
namespace Poco {
template <class ResultType, class ArgType, class OwnerType>
class ActiveRunnable: public Runnable
/// 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()
{
try
{
_result.data() = (_pOwner->*_method)(_arg);
}
catch (Exception& e)
{
_result.error(e.message());
}
catch (std::exception& e)
{
_result.error(e.what());
}
catch (...)
{
_result.error("unknown exception");
}
_result.notify();
delete this;
}
private:
OwnerType* _pOwner;
Callback _method;
ArgType _arg;
ActiveResultType _result;
};
template <class ResultType, class ArgType, class OwnerType>
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
@ -141,6 +82,15 @@ class ActiveMethod
/// ...
/// 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&);
@ -160,7 +110,7 @@ public:
{
ActiveResultType result(new ActiveResultHolder<ResultType>());
ActiveRunnableType* pRunnable = new ActiveRunnableType(_pOwner, _method, arg, result);
ThreadPool::defaultPool().start(*pRunnable);
StarterType::start(_pOwner, pRunnable);
return result;
}
@ -174,7 +124,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_ActiveMethod_INCLUDED

View File

@ -1,7 +1,7 @@
//
// ActiveResult.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/ActiveResult.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/ActiveResult.h#1 $
//
// Library: Foundation
// Package: Threading
@ -40,21 +40,14 @@
#define Foundation_ActiveResult_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Mutex_INCLUDED
#include "Foundation/Mutex.h"
#endif
#ifndef Foundation_Event_INCLUDED
#include "Foundation/Event.h"
#endif
#ifndef Foundation_RefCountedObject_INCLUDED
#include "Foundation/RefCountedObject.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/Mutex.h"
#include "Poco/Event.h"
#include "Poco/RefCountedObject.h"
#include "Poco/Exception.h"
Foundation_BEGIN
namespace Poco {
template <class ResultType>
@ -67,7 +60,7 @@ class ActiveResultHolder: public RefCountedObject
{
public:
ActiveResultHolder():
_failed(false),
_pExc(0),
_event(false)
/// Creates an ActiveResultHolder.
{
@ -111,34 +104,51 @@ public:
/// Returns true if the active method failed (and threw an exception).
/// Information about the exception can be obtained by calling error().
{
return _failed;
return _pExc != 0;
}
const std::string& error() const
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 _error;
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 failed flag and the exception message.
/// Sets the exception.
{
_error = msg;
_failed = true;
delete _pExc;
_pExc = new UnhandledException(msg);
}
protected:
~ActiveResultHolder()
{
delete _pExc;
}
private:
ResultType _data;
std::string _error;
bool _failed;
Event _event;
ResultType _data;
Exception* _pExc;
Event _event;
};
@ -225,14 +235,21 @@ public:
return _pHolder->failed();
}
const std::string& error() const
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.
@ -252,6 +269,12 @@ public:
{
_pHolder->error(msg);
}
void error(const Exception& exc)
/// Sets the failed flag and the exception message.
{
_pHolder->error(exc);
}
private:
ActiveResult();
@ -260,7 +283,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_ActiveResult_INCLUDED

View File

@ -0,0 +1,103 @@
//
// ActiveRunnable.h
//
// $Id: //poco/1.2/Foundation/include/Poco/ActiveRunnable.h#1 $
//
// Library: Foundation
// Package: Threading
// Module: ActiveObjects
//
// Definition of the ActiveRunnable class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, 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/Exception.h"
namespace Poco {
template <class ResultType, class ArgType, class OwnerType>
class ActiveRunnable: public Runnable
/// 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()
{
try
{
_result.data() = (_pOwner->*_method)(_arg);
}
catch (Exception& e)
{
_result.error(e);
}
catch (std::exception& e)
{
_result.error(e.what());
}
catch (...)
{
_result.error("unknown exception");
}
_result.notify();
delete this;
}
private:
OwnerType* _pOwner;
Callback _method;
ArgType _arg;
ActiveResultType _result;
};
} // namespace Poco
#endif // Foundation_ActiveRunnable_INCLUDED

View File

@ -0,0 +1,71 @@
//
// ActiveStarter.h
//
// $Id: //poco/1.2/Foundation/include/Poco/ActiveStarter.h#1 $
//
// Library: Foundation
// Package: Threading
// Module: ActiveObjects
//
// Definition of the ActiveStarter 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_ActiveStarter_INCLUDED
#define Foundation_ActiveStarter_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/ThreadPool.h"
namespace Poco {
class Runnable;
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, Runnable* pRunnable)
{
ThreadPool::defaultPool().start(*pRunnable);
}
};
} // namespace Poco
#endif // Foundation_ActiveStarter_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Activity.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Activity.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Activity.h#1 $
//
// Library: Foundation
// Package: Threading
@ -40,24 +40,14 @@
#define Foundation_Activity_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_RunnableAdapter_INCLUDED
#include "Foundation/RunnableAdapter.h"
#endif
#ifndef Foundation_ThreadPool_INCLUDED
#include "Foundation/ThreadPool.h"
#endif
#ifndef Foundation_Event_INCLUDED
#include "Foundation/Event.h"
#endif
#ifndef Foundation_Mutex_INCLUDED
#include "Foundation/Mutex.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/RunnableAdapter.h"
#include "Poco/ThreadPool.h"
#include "Poco/Event.h"
#include "Poco/Mutex.h"
Foundation_BEGIN
namespace Poco {
template <class C>
@ -222,7 +212,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Activity_INCLUDED

View File

@ -1,24 +1,36 @@
//
// Any.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Any.h#1 $
// $Id: //poco/1.2/Foundation/include/Poco/Any.h#1 $
//
// 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
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// what: variant type boost::any
// who: contributed by Kevlin Henney,
// with features contributed and bugs found by
// Ed Brey, Mark Rodgers, Peter Dimov, and James Curran
// when: July 2001
// where: tested with BCC 5.5, MSVC 6.0, and g++ 2.95
// modified: 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.
//
@ -26,12 +38,12 @@
#define Foundation_Any_INCLUDED
#include "Foundation/Exception.h"
#include "Poco/Exception.h"
#include <algorithm>
#include <typeinfo>
Foundation_BEGIN
namespace Poco {
class Any
@ -39,7 +51,7 @@ class Any
/// 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. This file is under the BOOST license, see http://www.boost.org/LICENSE_1_0.txt
/// by Applied Informatics.
{
public:
Any():
@ -77,7 +89,7 @@ public:
return *this;
}
template<typename ValueType>
template <typename ValueType>
Any& operator = (const ValueType& rhs)
/// Assignment operator for all types != Any.
///
@ -123,7 +135,7 @@ private:
virtual Placeholder* clone() const = 0;
};
template<typename ValueType>
template <typename ValueType>
class Holder: public Placeholder
{
public:
@ -146,17 +158,17 @@ private:
};
private:
template<typename ValueType>
template <typename ValueType>
friend ValueType* AnyCast(Any*);
template<typename ValueType>
template <typename ValueType>
friend ValueType* UnsafeAnyCast(Any*);
Placeholder* _content;
};
template<typename ValueType>
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.
@ -171,7 +183,7 @@ ValueType* AnyCast(Any* operand)
}
template<typename ValueType>
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.
@ -184,43 +196,41 @@ const ValueType* AnyCast(const Any* operand)
}
template<typename ValueType>
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 Foundation::BadCastException if the cast fails.
/// 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");
if (!result) throw BadCastException("Failed to convert between const Any types");
return *result;
}
template<typename ValueType>
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 Foundation::BadCastException if the cast fails.
/// 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");
if (!result) throw BadCastException("Failed to convert between Any types");
return *result;
}
template<typename ValueType>
template <typename ValueType>
const ValueType& RefAnyCast(const Any & operand)
/// AnyCast operator used to return a const reference to the internal data.
///
@ -228,13 +238,12 @@ const ValueType& RefAnyCast(const Any & operand)
/// 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");
if (!result) throw BadCastException("RefAnyCast: Failed to convert between const Any types");
return *result;
}
template<typename ValueType>
template <typename ValueType>
ValueType& RefAnyCast(Any& operand)
/// AnyCast operator used to return a reference to the internal data.
///
@ -242,13 +251,12 @@ ValueType& RefAnyCast(Any& operand)
/// MyType& tmp = RefAnyCast<MyType>(anAny);
{
ValueType* result = AnyCast<ValueType>(&operand);
if(!result)
throw BadCastException("RefAnyCast: Failed to convert between Any types");
if (!result) throw BadCastException("RefAnyCast: Failed to convert between Any types");
return *result;
}
template<typename ValueType>
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
@ -260,7 +268,7 @@ ValueType* UnsafeAnyCast(Any* operand)
}
template<typename ValueType>
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
@ -272,7 +280,7 @@ const ValueType* UnsafeAnyCast(const Any* operand)
}
Foundation_END
} // namespace Poco
#endif

View File

@ -1,7 +1,7 @@
//
// ArchiveStrategy.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/ArchiveStrategy.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/ArchiveStrategy.h#1 $
//
// Library: Foundation
// Package: Logging
@ -40,21 +40,16 @@
#define Foundation_ArchiveStrategy_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_LogFile_INCLUDED
#include "Foundation/LogFile.h"
#endif
#ifndef Foundation_File_INCLUDED
#include "Foundation/File.h"
#endif
#ifndef Foundation_DateTimeFormatter_INCLUDED
#include "Foundation/DateTimeFormatter.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/LogFile.h"
#include "Poco/File.h"
#include "Poco/DateTimeFormatter.h"
Foundation_BEGIN
namespace Poco {
class ArchiveCompressor;
class Foundation_API ArchiveStrategy
@ -85,6 +80,7 @@ private:
ArchiveStrategy& operator = (const ArchiveStrategy&);
bool _compress;
ArchiveCompressor* _pCompressor;
};
@ -127,7 +123,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_ArchiveStrategy_INCLUDED

View File

@ -1,7 +1,7 @@
//
// AsyncChannel.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/AsyncChannel.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/AsyncChannel.h#1 $
//
// Library: Foundation
// Package: Logging
@ -40,27 +40,15 @@
#define Foundation_AsyncChannel_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Channel_INCLUDED
#include "Foundation/Channel.h"
#endif
#ifndef Foundation_Thread_INCLUDED
#include "Foundation/Thread.h"
#endif
#ifndef Foundation_Mutex_INCLUDED
#include "Foundation/Mutex.h"
#endif
#ifndef Foundation_Runnable_INCLUDED
#include "Foundation/Runnable.h"
#endif
#ifndef Foundation_NotificationQueue_INCLUDED
#include "Foundation/NotificationQueue.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/Channel.h"
#include "Poco/Thread.h"
#include "Poco/Mutex.h"
#include "Poco/Runnable.h"
#include "Poco/NotificationQueue.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API AsyncChannel: public Channel, public Runnable
@ -116,7 +104,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_AsyncChannel_INCLUDED

View File

@ -1,7 +1,7 @@
//
// AutoPtr.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/AutoPtr.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/AutoPtr.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,19 +40,12 @@
#define Foundation_AutoPtr_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Exception_INCLUDED
#include "Foundation/Exception.h"
#endif
#ifndef STD_ALGORITHM_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include <algorithm>
#define STD_ALGORITHM_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
template <class C>
@ -71,7 +64,8 @@ class AutoPtr
/// void release()
/// that decrements the reference count by one, and,
/// if the reference count reaches zero, deletes the
/// class.
/// 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),
@ -86,6 +80,7 @@ class AutoPtr
/// 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)
@ -155,6 +150,21 @@ public:
return *this;
}
template <class Other>
AutoPtr < Other > cast()
/// 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);
if (pOther)
pOther->duplicate();
return AutoPtr < Other > (pOther);
}
C* operator -> ()
{
if (_ptr)
@ -315,7 +325,7 @@ inline void swap(AutoPtr<C>& p1, AutoPtr<C>& p2)
}
Foundation_END
} // namespace Poco
#endif // Foundation_AutoPtr_INCLUDED

View File

@ -1,7 +1,7 @@
//
// AutoReleasePool.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/AutoReleasePool.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/AutoReleasePool.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,16 +40,11 @@
#define Foundation_AutoReleasePool_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef STD_LIST_INCLUDED
#include "Poco/Foundation.h"
#include <list>
#define STD_LIST_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
template <class C>
@ -107,7 +102,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_AutoReleasePool_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Base64Decoder.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Base64Decoder.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Base64Decoder.h#1 $
//
// Library: Foundation
// Package: Streams
@ -40,19 +40,12 @@
#define Foundation_Base64Decoder_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_UnbufferedStreamBuf_INCLUDED
#include "Foundation/UnbufferedStreamBuf.h"
#endif
#ifndef STD_ISTREAM_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/UnbufferedStreamBuf.h"
#include <istream>
#define STD_ISTREAM_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API Base64DecoderBuf: public UnbufferedStreamBuf
@ -103,7 +96,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Base64Decoder_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Base64Encoder.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Base64Encoder.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Base64Encoder.h#1 $
//
// Library: Foundation
// Package: Streams
@ -40,19 +40,12 @@
#define Foundation_Base64Encoder_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_UnbufferedStreamBuf_INCLUDED
#include "Foundation/UnbufferedStreamBuf.h"
#endif
#ifndef STD_OSTREAM_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/UnbufferedStreamBuf.h"
#include <ostream>
#define STD_OSTREAM_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API Base64EncoderBuf: public UnbufferedStreamBuf
@ -113,7 +106,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Base64Encoder_INCLUDED

View File

@ -1,7 +1,7 @@
//
// BasicEvent.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/BasicEvent.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/BasicEvent.h#1 $
//
// Library: Foundation
// Package: Events
@ -40,13 +40,13 @@
#define Foundation_BasicEvent_INCLUDED
#include "Foundation/AbstractEvent.h"
#include "Foundation/DefaultStrategy.h"
#include "Foundation/AbstractDelegate.h"
#include "Foundation/CompareFunctions.h"
#include "Poco/AbstractEvent.h"
#include "Poco/DefaultStrategy.h"
#include "Poco/AbstractDelegate.h"
#include "Poco/CompareFunctions.h"
Foundation_BEGIN
namespace Poco {
template <class TArgs>
@ -82,7 +82,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif

View File

@ -1,7 +1,7 @@
//
// BinaryReader.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/BinaryReader.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/BinaryReader.h#1 $
//
// Library: Foundation
// Package: Streams
@ -40,16 +40,11 @@
#define Foundation_BinaryReader_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef STD_ISTREAM_INCLUDED
#include "Poco/Foundation.h"
#include <istream>
#define STD_ISTREAM_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API BinaryReader
@ -186,7 +181,7 @@ inline BinaryReader::StreamByteOrder BinaryReader::byteOrder() const
}
Foundation_END
} // namespace Poco
#endif // Foundation_BinaryReader_INCLUDED

View File

@ -1,7 +1,7 @@
//
// BinaryWriter.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/BinaryWriter.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/BinaryWriter.h#1 $
//
// Library: Foundation
// Package: Streams
@ -40,16 +40,11 @@
#define Foundation_BinaryWriter_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef STD_OSTREAM_INCLUDED
#include "Poco/Foundation.h"
#include <ostream>
#define STD_OSTREAM_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API BinaryWriter
@ -198,7 +193,7 @@ inline BinaryWriter::StreamByteOrder BinaryWriter::byteOrder() const
}
Foundation_END
} // namespace Poco
#endif // Foundation_BinaryWriter_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Buffer.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Buffer.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Buffer.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,12 +40,10 @@
#define Foundation_Buffer_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#include "Poco/Foundation.h"
Foundation_BEGIN
namespace Poco {
template <class T>
@ -125,7 +123,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Buffer_INCLUDED

View File

@ -1,7 +1,7 @@
//
// BufferAllocator.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/BufferAllocator.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/BufferAllocator.h#1 $
//
// Library: Foundation
// Package: Streams
@ -40,16 +40,11 @@
#define Foundation_BufferAllocator_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef STD_IOS_INCLUDED
#include "Poco/Foundation.h"
#include <ios>
#define STD_IOS_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
template <typename ch>
@ -72,7 +67,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_BufferAllocator_INCLUDED

View File

@ -1,7 +1,7 @@
//
// BufferedBidirectionalStreamBuf.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/BufferedBidirectionalStreamBuf.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h#1 $
//
// Library: Foundation
// Package: Streams
@ -40,30 +40,15 @@
#define Foundation_BufferedBidirectionalStreamBuf_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_BufferAllocator_INCLUDED
#include "Foundation/BufferAllocator.h"
#endif
#ifndef Foundation_StreamUtil_INCLUDED
#include "Foundation/StreamUtil.h"
#endif
#ifndef STD_STREAMBUF_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/BufferAllocator.h"
#include "Poco/StreamUtil.h"
#include <streambuf>
#define STD_STREAMBUF_INCLUDED
#endif
#ifndef STD_IOSFWD_INCLUDED
#include <iosfwd>
#define STD_IOSFWD_INCLUDED
#endif
#ifndef STD_IOS_INCLUDED
#include <ios>
#define STD_IOS_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
template<typename ch, typename tr, typename ba = BufferAllocator<ch> >
@ -186,7 +171,7 @@ private:
typedef BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char> > BufferedBidirectionalStreamBuf;
Foundation_END
} // namespace Poco
#endif // Foundation_BufferedBidirectionalStreamBuf_INCLUDED

View File

@ -1,7 +1,7 @@
//
// BufferedStreamBuf.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/BufferedStreamBuf.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/BufferedStreamBuf.h#1 $
//
// Library: Foundation
// Package: Streams
@ -40,30 +40,15 @@
#define Foundation_BufferedStreamBuf_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_BufferAllocator_INCLUDED
#include "Foundation/BufferAllocator.h"
#endif
#ifndef Foundation_StreamUtil_INCLUDED
#include "Foundation/StreamUtil.h"
#endif
#ifndef STD_STREAMBUF_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/BufferAllocator.h"
#include "Poco/StreamUtil.h"
#include <streambuf>
#define STD_STREAMBUF_INCLUDED
#endif
#ifndef STD_IOSFWD_INCLUDED
#include <iosfwd>
#define STD_IOSFWD_INCLUDED
#endif
#ifndef STD_IOS_INCLUDED
#include <ios>
#define STD_IOS_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
template <typename ch, typename tr, typename ba = BufferAllocator<ch> >
@ -183,7 +168,7 @@ private:
typedef BasicBufferedStreamBuf<char, std::char_traits<char> > BufferedStreamBuf;
Foundation_END
} // namespace Poco
#endif // Foundation_BufferedStreamBuf_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Bugcheck.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Bugcheck.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Bugcheck.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,16 +40,11 @@
#define Foundation_Bugcheck_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef STD_STRING_INCLUDED
#include "Poco/Foundation.h"
#include <string>
#define STD_STRING_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API Bugcheck
@ -95,37 +90,37 @@ protected:
// useful macros (these automatically supply line number and file name)
//
#if defined(_DEBUG)
#define poco_assert_dbg(cond) if (!(cond)) Foundation::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
#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)) Foundation::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
#define poco_check_ptr(ptr) \
if (!(ptr)) Foundation::Bugcheck::nullPointer(#ptr, __FILE__, __LINE__); else (void) 0
if (!(ptr)) Poco::Bugcheck::nullPointer(#ptr, __FILE__, __LINE__); else (void) 0
#define poco_bugcheck() \
Foundation::Bugcheck::bugcheck(__FILE__, __LINE__)
Poco::Bugcheck::bugcheck(__FILE__, __LINE__)
#define poco_bugcheck_msg(msg) \
Foundation::Bugcheck::bugcheck(msg, __FILE__, __LINE__)
Poco::Bugcheck::bugcheck(msg, __FILE__, __LINE__)
#define poco_debugger() \
Foundation::Bugcheck::debugger(__FILE__, __LINE__)
Poco::Bugcheck::debugger(__FILE__, __LINE__)
#define poco_debugger_msg(msg) \
Foundation::Bugcheck::debugger(msg, __FILE__, __LINE__)
Poco::Bugcheck::debugger(msg, __FILE__, __LINE__)
Foundation_END
} // namespace Poco
#endif // Foundation_Bugcheck_INCLUDED

View File

@ -1,7 +1,7 @@
//
// ByteOrder.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/ByteOrder.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/ByteOrder.h#1 $
//
// Library: Foundation
// Package: Core
@ -38,15 +38,11 @@
#define Foundation_ByteOrder_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Types_INCLUDED
#include "Foundation/Types.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/Types.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API ByteOrder
@ -225,7 +221,7 @@ POCO_IMPLEMENT_BYTEORDER_LIT(toLittleEndian)
POCO_IMPLEMENT_BYTEORDER_LIT(fromLittleEndian)
Foundation_END
} // namespace Poco
#endif // Foundation_ByteOrder_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Channel.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Channel.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Channel.h#1 $
//
// Library: Foundation
// Package: Logging
@ -40,21 +40,13 @@
#define Foundation_Channel_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Configurable_INCLUDED
#include "Foundation/Configurable.h"
#endif
#ifndef Foundation_Mutex_INCLUDED
#include "Foundation/Mutex.h"
#endif
#ifndef Foundation_RefCountedObject_INCLUDED
#include "Foundation/RefCountedObject.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/Configurable.h"
#include "Poco/Mutex.h"
#include "Poco/RefCountedObject.h"
Foundation_BEGIN
namespace Poco {
class Message;
@ -98,7 +90,7 @@ protected:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Channel_INCLUDED

View File

@ -1,7 +1,7 @@
//
// ClassLibrary.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/ClassLibrary.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/ClassLibrary.h#1 $
//
// Library: Foundation
// Package: SharedLibrary
@ -40,16 +40,9 @@
#define Foundation_ClassLibrary_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Manifest_INCLUDED
#include "Foundation/Manifest.h"
#endif
#ifndef STD_TYPEINFO_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Manifest.h"
#include <typeinfo>
#define STD_TYPEINFO_INCLUDED
#endif
#if defined(_WIN32)
@ -64,7 +57,7 @@
//
extern "C"
{
bool POCO_LIBRARY_API pocoBuildManifest(Foundation::ManifestBase* pManifest);
bool POCO_LIBRARY_API pocoBuildManifest(Poco::ManifestBase* pManifest);
void POCO_LIBRARY_API pocoInitializeLibrary();
void POCO_LIBRARY_API pocoUninitializeLibrary();
}
@ -82,15 +75,15 @@ extern "C"
// POCO_END_MANIFEST
//
#define POCO_BEGIN_MANIFEST(base) \
bool pocoBuildManifest(Foundation::ManifestBase* pManifest_) \
bool pocoBuildManifest(Poco::ManifestBase* pManifest_) \
{ \
typedef base _Base; \
typedef Foundation::Manifest<_Base> _Manifest; \
typedef Poco::Manifest<_Base> _Manifest; \
std::string requiredType(typeid(_Manifest).name()); \
std::string actualType(pManifest_->className()); \
if (requiredType == actualType) \
{ \
Foundation::Manifest<_Base>* pManifest = static_cast<_Manifest*>(pManifest_);
Poco::Manifest<_Base>* pManifest = static_cast<_Manifest*>(pManifest_);
#define POCO_END_MANIFEST \
@ -101,11 +94,11 @@ extern "C"
#define POCO_EXPORT_CLASS(cls) \
pManifest->insert(new Foundation::MetaObject<cls, _Base>(#cls));
pManifest->insert(new Poco::MetaObject<cls, _Base>(#cls));
#define POCO_EXPORT_SINGLETON(cls) \
pManifest->insert(new Foundation::MetaSingleton<cls, _Base>(#cls));
pManifest->insert(new Poco::MetaSingleton<cls, _Base>(#cls));
#endif // Foundation_ClassLibrary_INCLUDED

View File

@ -1,7 +1,7 @@
//
// ClassLoader.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/ClassLoader.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/ClassLoader.h#1 $
//
// Library: Foundation
// Package: SharedLibrary
@ -40,31 +40,16 @@
#define Foundation_ClassLoader_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_MetaObject_INCLUDED
#include "Foundation/MetaObject.h"
#endif
#ifndef Foundation_Manifest_INCLUDED
#include "Foundation/Manifest.h"
#endif
#ifndef Foundation_SharedLibrary_INCLUDED
#include "Foundation/SharedLibrary.h"
#endif
#ifndef Foundation_Mutex_INCLUDED
#include "Foundation/Mutex.h"
#endif
#ifndef Foundation_Exception_INCLUDED
#include "Foundation/Exception.h"
#endif
#ifndef STD_MAP_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>
#define STD_MAP_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
template <class Base>
@ -367,7 +352,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_ClassLoader_INCLUDED

View File

@ -1,7 +1,7 @@
//
// CompareFunctions.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/CompareFunctions.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/CompareFunctions.h#1 $
//
// Library: Foundation
// Package: Events
@ -40,11 +40,11 @@
#define Foundation_CompareFunctions_INCLUDED
#include "Foundation/Foundation.h"
#include "Poco/Foundation.h"
#include <functional>
Foundation_BEGIN
namespace Poco {
template <class T>
@ -57,7 +57,7 @@ struct p_less: std::binary_function<T, T, bool>
};
Foundation_END
} // namespace Poco
#endif

View File

@ -0,0 +1,55 @@
//
// Config.h
//
// $Id: //poco/1.2/Foundation/include/Poco/Config.h#1 $
//
// Library: Foundation
// Package: Core
// Module: Foundation
//
// Feature configuration 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_Config_INCLUDED
#define Foundation_Config_INCLUDED
// Define to enable Windows Unicode (UTF-8) support.
#undef POCO_WIN32_UTF8
// Define to disable FPEnvironment support
#undef POCO_NO_FPENVIRONMENT
// Define if std::wstring is not available
#undef POCO_NO_WSTRING
#endif // Foundation_Config_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Configurable.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Configurable.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Configurable.h#1 $
//
// Library: Foundation
// Package: Logging
@ -40,12 +40,10 @@
#define Foundation_Configurable_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#include "Poco/Foundation.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API Configurable
@ -81,7 +79,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Configurable_INCLUDED

View File

@ -1,7 +1,7 @@
//
// ConsoleChannel.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/ConsoleChannel.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/ConsoleChannel.h#1 $
//
// Library: Foundation
// Package: Logging
@ -40,22 +40,13 @@
#define Foundation_ConsoleChannel_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Channel_INCLUDED
#include "Foundation/Channel.h"
#endif
#ifndef Foundation_Mutex_INCLUDED
#include "Foundation/Mutex.h"
#endif
#ifndef STD_OSTREAM_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Channel.h"
#include "Poco/Mutex.h"
#include <ostream>
#define STD_OSTREAM_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API ConsoleChannel: public Channel
@ -92,7 +83,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_ConsoleChannel_INCLUDED

View File

@ -1,7 +1,7 @@
//
// CountingStream.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/CountingStream.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/CountingStream.h#1 $
//
// Library: Foundation
// Package: Streams
@ -40,23 +40,13 @@
#define Foundation_CountingStream_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_UnbufferedStreamBuf_INCLUDED
#include "Foundation/UnbufferedStreamBuf.h"
#endif
#ifndef STD_ISTREAM_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/UnbufferedStreamBuf.h"
#include <istream>
#define STD_ISTREAM_INCLUDED
#endif
#ifndef STD_OSTREAM_INCLUDED
#include <ostream>
#define STD_OSTREAM_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API CountingStreamBuf: public UnbufferedStreamBuf
@ -245,7 +235,7 @@ inline int CountingIOS::getCurrentLineNumber() const
}
Foundation_END
} // namespace Poco
#endif // Foundation_CountingStream_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DateTime.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DateTime.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DateTime.h#1 $
//
// Library: Foundation
// Package: DateTime
@ -40,18 +40,12 @@
#define Foundation_DateTime_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Timestamp_INCLUDED
#include "Foundation/Timestamp.h"
#endif
#ifndef Foundation_Timespan_INCLUDED
#include "Foundation/Timespan.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/Timestamp.h"
#include "Poco/Timespan.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API DateTime
@ -65,10 +59,21 @@ class Foundation_API DateTime
/// collected and described by Peter Baum at
/// http://vsg.cape.com/~pbaum/date/date0.htm
///
/// Internally, this class stores a date/time in three
/// forms for performance reasons. Only use this
/// class for conversions between date/time representations.
/// 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
@ -99,7 +104,7 @@ public:
FRIDAY,
SATURDAY
};
DateTime();
/// Creates a DateTime for the current date and time.
@ -210,7 +215,7 @@ public:
/// Returns the microsecond (0 to 999)
double julianDay() const;
/// Returns the julian day for the date.
/// Returns the julian day for the date and time.
Timestamp timestamp() const;
/// Returns the date and time expressed as a Timestamp.
@ -240,29 +245,37 @@ public:
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, int minute, int second, int millisecond, int microsecond);
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();
/// Computes the Gregorian date for the stored 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;
double _julianDay;
short _year;
short _month;
short _day;
@ -360,12 +373,6 @@ inline int DateTime::microsecond() const
}
inline double DateTime::julianDay() const
{
return _julianDay;
}
inline bool DateTime::operator == (const DateTime& dateTime) const
{
return _utcTime == dateTime._utcTime;
@ -414,7 +421,7 @@ inline void swap(DateTime& d1, DateTime& d2)
}
Foundation_END
} // namespace Poco
#endif // Foundation_DateTime_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DateTimeFormat.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DateTimeFormat.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DateTimeFormat.h#1 $
//
// Library: Foundation
// Package: DateTime
@ -40,12 +40,10 @@
#define Foundation_DateTimeFormat_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#include "Poco/Foundation.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API DateTimeFormat
@ -119,7 +117,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_DateTimeFormat_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DateTimeFormatter.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DateTimeFormatter.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DateTimeFormatter.h#1 $
//
// Library: Foundation
// Package: DateTime
@ -40,12 +40,10 @@
#define Foundation_DateTimeFormatter_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#include "Poco/Foundation.h"
Foundation_BEGIN
namespace Poco {
class DateTime;
@ -133,7 +131,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_DateTimeFormatter_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DateTimeParser.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DateTimeParser.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DateTimeParser.h#1 $
//
// Library: Foundation
// Package: DateTime
@ -40,15 +40,11 @@
#define Foundation_DateTimeParser_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_DateTime_INCLUDED
#include "Foundation/DateTime.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/DateTime.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API DateTimeParser
@ -117,7 +113,7 @@ protected:
};
Foundation_END
} // namespace Poco
#endif // Foundation_DateTimeParser_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Debugger.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Debugger.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Debugger.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,12 +40,10 @@
#define Foundation_Debugger_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#include "Poco/Foundation.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API Debugger
@ -91,7 +89,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Debugger_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DefaultStrategy.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DefaultStrategy.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DefaultStrategy.h#1 $
//
// Library: Foundation
// Package: Events
@ -40,13 +40,13 @@
#define Foundation_DefaultStrategy_INCLUDED
#include "Foundation/NotificationStrategy.h"
#include "Poco/NotificationStrategy.h"
#include <memory>
#include <set>
#include <vector>
Foundation_BEGIN
namespace Poco {
template <class TArgs, class TDelegate, class TCompare>
@ -148,7 +148,7 @@ protected:
};
Foundation_END
} // namespace Poco
#endif

View File

@ -1,7 +1,7 @@
//
// DeflatingStream.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DeflatingStream.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DeflatingStream.h#1 $
//
// Library: Foundation
// Package: Streams
@ -40,26 +40,14 @@
#define Foundation_DeflatingStream_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_BufferedStreamBuf_INCLUDED
#include "Foundation/BufferedStreamBuf.h"
#endif
#ifndef STD_ISTREAM_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/BufferedStreamBuf.h"
#include <istream>
#define STD_ISTREAM_INCLUDED
#endif
#ifndef STD_OSTREAM_INCLUDED
#include <ostream>
#define STD_OSTREAM_INCLUDED
#endif
#ifndef ZLIB_H
#include "Foundation/zlib.h"
#endif
#include "Poco/zlib.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API DeflatingStreamBuf: public BufferedStreamBuf
@ -147,7 +135,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_DeflatingStream_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Delegate.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Delegate.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Delegate.h#1 $
//
// Library: Foundation
// Package: Events
@ -40,12 +40,12 @@
#define Foundation_Delegate_INCLUDED
#include "Foundation/Foundation.h"
#include "Foundation/AbstractDelegate.h"
#include "Foundation/Expire.h"
#include "Poco/Foundation.h"
#include "Poco/AbstractDelegate.h"
#include "Poco/Expire.h"
Foundation_BEGIN
namespace Poco {
template <class TObj, class TArgs>
@ -114,7 +114,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif

View File

@ -1,7 +1,7 @@
//
// DigestEngine.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DigestEngine.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DigestEngine.h#1 $
//
// Library: Foundation
// Package: Crypt
@ -40,16 +40,11 @@
#define Foundation_DigestEngine_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef STD_VECTOR_INCLUDED
#include "Poco/Foundation.h"
#include <vector>
#define STD_VECTOR_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API DigestEngine
@ -124,7 +119,7 @@ inline void DigestEngine::update(const std::string& data)
}
Foundation_END
} // namespace Poco
#endif // Foundation_DigestEngine_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DigestStream.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DigestStream.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DigestStream.h#1 $
//
// Library: Foundation
// Package: Crypt
@ -40,26 +40,14 @@
#define Foundation_DigestStream_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_BufferedStreamBuf_INCLUDED
#include "Foundation/BufferedStreamBuf.h"
#endif
#ifndef Foundation_DigestEngine_INCLUDED
#include "Foundation/DigestEngine.h"
#endif
#ifndef STD_ISTREAM_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/BufferedStreamBuf.h"
#include "Poco/DigestEngine.h"
#include <istream>
#define STD_ISTREAM_INCLUDED
#endif
#ifndef STD_OSTREAM_INCLUDED
#include <ostream>
#define STD_OSTREAM_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API DigestBuf: public BufferedStreamBuf
@ -128,7 +116,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_DigestStream_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DirectoryIterator.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DirectoryIterator.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DirectoryIterator.h#1 $
//
// Library: Foundation
// Package: Filesystem
@ -40,18 +40,12 @@
#define Foundation_DirectoryIterator_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_File_INCLUDED
#include "Foundation/File.h"
#endif
#ifndef Foundation_Path_INCLUDED
#include "Foundation/Path.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/File.h"
#include "Poco/Path.h"
Foundation_BEGIN
namespace Poco {
class DirectoryIteratorImpl;
@ -158,7 +152,7 @@ inline bool DirectoryIterator::operator != (const DirectoryIterator& iterator) c
}
Foundation_END
} // namespace Poco
#endif // Foundation_DirectoryIterator_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DirectoryIterator_UNIX.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DirectoryIterator_UNIX.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DirectoryIterator_UNIX.h#1 $
//
// Library: Foundation
// Package: Filesystem
@ -40,16 +40,11 @@
#define Foundation_DirectoryIterator_UNIX_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef STD_DIRENT_INCLUDED
#include "Poco/Foundation.h"
#include <dirent.h>
#define STD_DIRENT_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API DirectoryIteratorImpl
@ -93,7 +88,7 @@ inline void DirectoryIteratorImpl::release()
}
Foundation_END
} // namespace Poco
#endif // Foundation_DirectoryIterator_UNIX_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DirectoryIterator_VMS.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DirectoryIterator_VMS.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DirectoryIterator_VMS.h#1 $
//
// Library: Foundation
// Package: Filesystem
@ -40,16 +40,11 @@
#define Foundation_DirectoryIterator_VMS_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef SYS_RMS_INCLUDED
#include "Poco/Foundation.h"
#include <rms.h>
#define SYS_RMS_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API DirectoryIteratorImpl
@ -96,7 +91,7 @@ inline void DirectoryIteratorImpl::release()
}
Foundation_END
} // namespace Poco
#endif // Foundation_DirectoryIterator_VMS_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DirectoryIterator_WIN32.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DirectoryIterator_WIN32.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DirectoryIterator_WIN32.h#1 $
//
// Library: Foundation
// Package: Filesystem
@ -40,16 +40,11 @@
#define Foundation_DirectoryIterator_WIN32_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef STD_WINDOWS_INCLUDED
#include "Poco/Foundation.h"
#include <windows.h>
#define STD_WINDOWS_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API DirectoryIteratorImpl
@ -94,7 +89,7 @@ inline void DirectoryIteratorImpl::release()
}
Foundation_END
} // namespace Poco
#endif // Foundation_DirectoryIterator_WIN32_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DirectoryIterator_WIN32U.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DirectoryIterator_WIN32U.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DirectoryIterator_WIN32U.h#1 $
//
// Library: Foundation
// Package: Filesystem
@ -40,16 +40,11 @@
#define Foundation_DirectoryIterator_WIN32U_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef STD_WINDOWS_INCLUDED
#include "Poco/Foundation.h"
#include <windows.h>
#define STD_WINDOWS_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API DirectoryIteratorImpl
@ -94,7 +89,7 @@ inline void DirectoryIteratorImpl::release()
}
Foundation_END
} // namespace Poco
#endif // Foundation_DirectoryIterator_WIN32U_INCLUDED

View File

@ -1,7 +1,7 @@
//
// DynamicFactory.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/DynamicFactory.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/DynamicFactory.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,29 +40,15 @@
#define Foundation_DynamicFactory_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Instantiator_INCLUDED
#include "Foundation/Instantiator.h"
#endif
#ifndef Foundation_Exception_INCLUDED
#include "Foundation/Exception.h"
#endif
#ifndef Foundation_Mutex_INCLUDED
#include "Foundation/Mutex.h"
#endif
#ifndef STD_MAP_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Instantiator.h"
#include "Poco/Exception.h"
#include "Poco/Mutex.h"
#include <map>
#define STD_MAP_INCLUDED
#endif
#ifndef STD_MEMORY_INCLUDED
#include <memory>
#define STD_MEMORY_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
template <class Base>
@ -166,7 +152,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_DynamicFactory_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Environment.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Environment.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Environment.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,12 +40,10 @@
#define Foundation_Environment_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#include "Poco/Foundation.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API Environment
@ -80,7 +78,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Environment_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Environment_UNIX.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Environment_UNIX.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Environment_UNIX.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,19 +40,12 @@
#define Foundation_Environment_UNIX_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Mutex_INCLUDED
#include "Foundation/Mutex.h"
#endif
#ifndef STD_MAP_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Mutex.h"
#include <map>
#define STD_MAP_INCLUDED
#endif
Foundation_BEGIN
namespace Poco {
class Foundation_API EnvironmentImpl
@ -74,7 +67,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Environment_UNIX_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Environment_VMS.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Environment_VMS.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Environment_VMS.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,15 +40,11 @@
#define Foundation_Environment_VMS_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Mutex_INCLUDED
#include "Foundation/Mutex.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/Mutex.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API EnvironmentImpl
@ -72,7 +68,7 @@ private:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Environment_VMS_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Environment_WIN32.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Environment_WIN32.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Environment_WIN32.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,12 +40,10 @@
#define Foundation_Environment_WIN32_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#include "Poco/Foundation.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API EnvironmentImpl
@ -61,7 +59,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Environment_WIN32_INCLUDED

View File

@ -1,7 +1,7 @@
//
// Environment_WIN32U.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/Environment_WIN32U.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/Environment_WIN32U.h#1 $
//
// Library: Foundation
// Package: Core
@ -40,12 +40,10 @@
#define Foundation_Environment_WIN32U_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#include "Poco/Foundation.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API EnvironmentImpl
@ -61,7 +59,7 @@ public:
};
Foundation_END
} // namespace Poco
#endif // Foundation_Environment_WIN32U_INCLUDED

View File

@ -1,7 +1,7 @@
//
// ErrorHandler.h
//
// $Id: //poco/1.1.0/Foundation/include/Foundation/ErrorHandler.h#2 $
// $Id: //poco/1.2/Foundation/include/Poco/ErrorHandler.h#1 $
//
// Library: Foundation
// Package: Threading
@ -40,18 +40,12 @@
#define Foundation_ErrorHandler_INCLUDED
#ifndef Foundation_Foundation_INCLUDED
#include "Foundation/Foundation.h"
#endif
#ifndef Foundation_Exception_INCLUDED
#include "Foundation/Exception.h"
#endif
#ifndef Foundation_Mutex_INCLUDED
#include "Foundation/Mutex.h"
#endif
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include "Poco/Mutex.h"
Foundation_BEGIN
namespace Poco {
class Foundation_API ErrorHandler
@ -78,7 +72,7 @@ public:
/// Destroys the ErrorHandler.
virtual void exception(const Exception& exc);
/// Called when a Foundation::Exception (or a subclass)
/// Called when a Poco::Exception (or a subclass)
/// caused the thread to terminate.
///
/// This method should not throw any exception - it would
@ -97,7 +91,7 @@ public:
virtual void exception();
/// Called when an exception that is neither a
/// Foundation::Exception nor a std::exception caused
/// Poco::Exception nor a std::exception caused
/// the thread to terminate.
///
/// This method should not throw any exception - it would
@ -142,7 +136,7 @@ inline ErrorHandler* ErrorHandler::get()
}
Foundation_END
} // namespace Poco
#endif // Foundation_ErrorHandler_INCLUDED

Some files were not shown because too many files have changed in this diff Show More