latest changes from main repository; added eclipse cdt project files

This commit is contained in:
Guenter Obiltschnig
2007-04-28 09:34:20 +00:00
parent d30a402069
commit adfaac6703
46 changed files with 17664 additions and 11399 deletions

View File

@@ -1,7 +1,7 @@
//
// AsyncChannel.h
//
// $Id: //poco/Main/Foundation/include/Poco/AsyncChannel.h#2 $
// $Id: //poco/Main/Foundation/include/Poco/AsyncChannel.h#3 $
//
// Library: Foundation
// Package: Logging
@@ -9,7 +9,7 @@
//
// Definition of the AsyncChannel class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
@@ -62,7 +62,7 @@ class Foundation_API AsyncChannel: public Channel, public Runnable
/// then processed by a separate thread.
{
public:
AsyncChannel(Channel* pChannel = 0);
AsyncChannel(Channel* pChannel = 0, Thread::Priority prio = Thread::PRIO_NORMAL);
/// Creates the AsyncChannel and connects it to
/// the given channel.
@@ -88,13 +88,24 @@ public:
void setProperty(const std::string& name, const std::string& value);
/// Sets or changes a configuration property.
///
/// Only the "channel" property is supported, which allows
/// setting the target channel via the LoggingRegistry.
/// The "channel" property allows setting the target
/// channel via the LoggingRegistry.
/// The "channel" property is set-only.
///
/// The "priority" property allows setting the thread
/// priority. The following values are supported:
/// * lowest
/// * low
/// * normal (default)
/// * high
/// * highest
///
/// The "priority" property is set-only.
protected:
~AsyncChannel();
void run();
void setPriority(const std::string& value);
private:
Channel* _pChannel;

View File

@@ -1,7 +1,7 @@
//
// RegularExpression.h
//
// $Id: //poco/Main/Foundation/include/Poco/RegularExpression.h#5 $
// $Id: //poco/Main/Foundation/include/Poco/RegularExpression.h#7 $
//
// Library: Foundation
// Package: RegExp
@@ -67,9 +67,6 @@ class Foundation_API RegularExpression
/// Implemented using PCRE, the Perl Compatible
/// Regular Expressions library by Philip Hazel
/// (see http://www.pcre.org).
///
/// An overload of operator ^ is provided for
/// simple matching.
{
public:
enum Options // These must match the corresponsing options in pcre.h!
@@ -83,22 +80,31 @@ public:
///
/// See the PCRE documentation for more information.
{
RE_CASELESS = 0x00001, /// case insensitive matching (/i) [ctor]
RE_MULTILINE = 0x00002, /// enable multi-line mode; affects ^ and $ (/m) [ctor]
RE_DOTALL = 0x00004, /// dot matches all characters, including newline (/s) [ctor]
RE_EXTENDED = 0x00004, /// totally ignore whitespace (/x) [ctor]
RE_ANCHORED = 0x00010, /// treat pattern as if it starts with a ^ [ctor, match]
RE_DOLLAR_ENDONLY = 0x00020, /// dollar matches end-of-string only, not last newline in string [ctor]
RE_EXTRA = 0x00040, /// enable optional PCRE functionality [ctor]
RE_NOTBOL = 0x00080, /// circumflex does not match beginning of string [match]
RE_NOTEOL = 0x00100, /// $ does not match end of string [match]
RE_UNGREEDY = 0x00200, /// make quantifiers ungreedy [ctor]
RE_NOTEMPTY = 0x00400, /// empty string never matches [match]
RE_UTF8 = 0x00800, /// assume pattern and subject is UTF-8 encoded [ctor]
RE_NO_AUTO_CAPTURE = 0x01000, /// disable numbered capturing parentheses [ctor, match]
RE_NO_UTF8_CHECK = 0x02000, /// do not check validity of UTF-8 code sequences [match]
RE_GLOBAL = 0x10000, /// replace all occurences (/g) [subst]
RE_NO_VARS = 0x20000 /// treat dollar in replacement string as ordinary character [subst]
RE_CASELESS = 0x00000001, /// case insensitive matching (/i) [ctor]
RE_MULTILINE = 0x00000002, /// enable multi-line mode; affects ^ and $ (/m) [ctor]
RE_DOTALL = 0x00000004, /// dot matches all characters, including newline (/s) [ctor]
RE_EXTENDED = 0x00000004, /// totally ignore whitespace (/x) [ctor]
RE_ANCHORED = 0x00000010, /// treat pattern as if it starts with a ^ [ctor, match]
RE_DOLLAR_ENDONLY = 0x00000020, /// dollar matches end-of-string only, not last newline in string [ctor]
RE_EXTRA = 0x00000040, /// enable optional PCRE functionality [ctor]
RE_NOTBOL = 0x00000080, /// circumflex does not match beginning of string [match]
RE_NOTEOL = 0x00000100, /// $ does not match end of string [match]
RE_UNGREEDY = 0x00000200, /// make quantifiers ungreedy [ctor]
RE_NOTEMPTY = 0x00000400, /// empty string never matches [match]
RE_UTF8 = 0x00000800, /// assume pattern and subject is UTF-8 encoded [ctor]
RE_NO_AUTO_CAPTURE = 0x00001000, /// disable numbered capturing parentheses [ctor, match]
RE_NO_UTF8_CHECK = 0x00002000, /// do not check validity of UTF-8 code sequences [match]
RE_FIRSTLINE = 0x00040000, /// an unanchored pattern is required to match
/// before or at the first newline in the subject string,
/// though the matched text may continue over the newline [ctor]
RE_DUPNAMES = 0x00080000, /// names used to identify capturing subpatterns need not be unique [ctor]
RE_NEWLINE_CR = 0x00100000, /// assume newline is CR ('\r'), the default [ctor]
RE_NEWLINE_LF = 0x00200000, /// assume newline is LF ('\n') [ctor]
RE_NEWLINE_CRLF = 0x00300000, /// assume newline is CRLF ("\r\n") [ctor]
RE_NEWLINE_ANY = 0x00400000, /// assume newline is any valid Unicode newline character [ctor]
RE_NEWLINE_ANYCRLF = 0x00500000, /// assume newline is any of CR, LF, CRLF [ctor]
RE_GLOBAL = 0x10000000, /// replace all occurences (/g) [subst]
RE_NO_VARS = 0x20000000 /// treat dollar in replacement string as ordinary character [subst]
};
struct Match
@@ -153,6 +159,20 @@ public:
bool match(const std::string& subject, std::string::size_type offset, int options) const;
/// Returns true if and only if the subject matches the regular expression.
bool operator == (const std::string& subject) const;
/// Returns true if and only if the subject matches the regular expression.
///
/// Internally, this method sets the RE_ANCHORED and RE_NOTEMPTY options for
/// matching, which means that the empty string will never match and
/// the pattern is treated as if it starts with a ^.
bool operator != (const std::string& subject) const;
/// Returns true if and only if the subject does not match the regular expression.
///
/// Internally, this method sets the RE_ANCHORED and RE_NOTEMPTY options for
/// matching, which means that the empty string will never match and
/// the pattern is treated as if it starts with a ^.
int extract(const std::string& subject, std::string& str, int options = 0) const;
/// Matches the given subject string against the pattern.
/// Returns the captured string.
@@ -241,6 +261,18 @@ inline int RegularExpression::subst(std::string& subject, const std::string& rep
}
inline bool RegularExpression::operator == (const std::string& subject) const
{
return match(subject);
}
inline bool RegularExpression::operator != (const std::string& subject) const
{
return !match(subject);
}
} // namespace Poco

View File

@@ -1,7 +1,7 @@
//
// Thread.h
//
// $Id: //poco/Main/Foundation/include/Poco/Thread.h#3 $
// $Id: //poco/Main/Foundation/include/Poco/Thread.h#4 $
//
// Library: Foundation
// Package: Threading
@@ -41,6 +41,7 @@
#include "Poco/Foundation.h"
#include "Poco/Mutex.h"
#if defined(POCO_OS_FAMILY_WINDOWS)
@@ -64,6 +65,7 @@ class Foundation_API Thread: private ThreadImpl
/// Every Thread object gets a unique (within
/// its process) numeric thread ID.
/// Furthermore, a thread can be assigned a name.
/// The name of a thread can be changed at any time.
{
public:
enum Priority
@@ -88,9 +90,15 @@ public:
int id() const;
/// Returns the unique thread ID of the thread.
const std::string& name() const;
std::string name() const;
/// Returns the name of the thread.
std::string getName() const;
/// Returns teh name of the thread.
void setName(const std::string& name);
/// Sets the name of the thread.
void setPriority(Priority prio);
/// Sets the thread's priority.
///
@@ -145,9 +153,6 @@ protected:
static int uniqueId();
/// Creates and returns a unique id for a thread.
void setName(const std::string& name);
/// Sets the name of the thread.
private:
Thread(const Thread&);
Thread& operator = (const Thread&);
@@ -155,6 +160,7 @@ private:
int _id;
std::string _name;
ThreadLocalStorage* _pTLS;
mutable FastMutex _mutex;
friend class ThreadLocalStorage;
friend class PooledThread;
@@ -170,8 +176,18 @@ inline int Thread::id() const
}
inline const std::string& Thread::name() const
inline std::string Thread::name() const
{
FastMutex::ScopedLock lock(_mutex);
return _name;
}
inline std::string Thread::getName() const
{
FastMutex::ScopedLock lock(_mutex);
return _name;
}