Skip to content

Commit b526dd8

Browse files
committed
changes from main repository
1 parent ab8d8e3 commit b526dd8

47 files changed

Lines changed: 611 additions & 557 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Foundation/include/Poco/AbstractDelegate.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// AbstractDelegate.h
33
//
4-
// $Id: //poco/svn/Foundation/include/Poco/AbstractDelegate.h#2 $
4+
// $Id: //poco/svn/Foundation/include/Poco/AbstractDelegate.h#3 $
55
//
66
// Library: Foundation
77
// Package: Events

‎Foundation/include/Poco/ExpireStrategy.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// ExpireStrategy.h
33
//
4-
// $Id: //poco/svn/Foundation/include/Poco/ExpireStrategy.h#2 $
4+
// $Id: //poco/svn/Foundation/include/Poco/ExpireStrategy.h#3 $
55
//
66
// Library: Foundation
77
// Package: Cache
@@ -122,6 +122,8 @@ class ExpireStrategy: public AbstractStrategy<TKey, TValue>
122122
args.invalidate();
123123
}
124124
}
125+
else //not found: probably removed by onReplace
126+
args.invalidate();
125127
}
126128

127129
void onReplace(const void*, std::set<TKey>& elemsToRemove)

‎Foundation/include/Poco/File_UNIX.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// File_UNIX.h
33
//
4-
// $Id: //poco/svn/Foundation/include/Poco/File_UNIX.h#2 $
4+
// $Id: //poco/svn/Foundation/include/Poco/File_UNIX.h#3 $
55
//
66
// Library: Foundation
77
// Package: Filesystem
@@ -63,8 +63,8 @@ class FileImpl
6363
bool canExecuteImpl() const;
6464
bool isFileImpl() const;
6565
bool isDirectoryImpl() const;
66-
bool isHiddenImpl() const;
6766
bool isLinkImpl() const;
67+
bool isHiddenImpl() const;
6868
Timestamp createdImpl() const;
6969
Timestamp getLastModifiedImpl() const;
7070
void setLastModifiedImpl(const Timestamp& ts);

‎Foundation/include/Poco/File_VMS.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// File_VMS.h
33
//
4-
// $Id: //poco/svn/Foundation/include/Poco/File_VMS.h#2 $
4+
// $Id: //poco/svn/Foundation/include/Poco/File_VMS.h#3 $
55
//
66
// Library: Foundation
77
// Package: Filesystem
@@ -65,6 +65,7 @@ class FileImpl
6565
bool isFileImpl() const;
6666
bool isDirectoryImpl() const;
6767
bool isLinkImpl() const;
68+
bool isHiddenImpl() const;
6869
Timestamp createdImpl() const;
6970
Timestamp getLastModifiedImpl() const;
7071
void setLastModifiedImpl(const Timestamp& ts);

‎Foundation/include/Poco/File_WIN32.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// File_WIN32.h
33
//
4-
// $Id: //poco/svn/Foundation/include/Poco/File_WIN32.h#2 $
4+
// $Id: //poco/svn/Foundation/include/Poco/File_WIN32.h#3 $
55
//
66
// Library: Foundation
77
// Package: Filesystem
@@ -65,6 +65,7 @@ class Foundation_API FileImpl
6565
bool isFileImpl() const;
6666
bool isDirectoryImpl() const;
6767
bool isLinkImpl() const;
68+
bool isHiddenImpl() const;
6869
Timestamp createdImpl() const;
6970
Timestamp getLastModifiedImpl() const;
7071
void setLastModifiedImpl(const Timestamp& ts);

‎Foundation/include/Poco/File_WIN32U.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// File_WIN32U.h
33
//
4-
// $Id: //poco/svn/Foundation/include/Poco/File_WIN32U.h#2 $
4+
// $Id: //poco/svn/Foundation/include/Poco/File_WIN32U.h#3 $
55
//
66
// Library: Foundation
77
// Package: Filesystem

‎Foundation/include/Poco/HashFunction.h‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// HashFunction.h
33
//
4-
// $Id: //poco/svn/Foundation/include/Poco/HashFunction.h#2 $
4+
// $Id: //poco/svn/Foundation/include/Poco/HashFunction.h#3 $
55
//
66
// Library: Foundation
77
// Package: Hashing
@@ -60,6 +60,19 @@ struct HashFunction
6060
};
6161

6262

63+
//@ deprecated
64+
template <>
65+
struct HashFunction<std::string>
66+
/// A generic hash function.
67+
{
68+
UInt32 operator () (const std::string& key, UInt32 maxValue) const
69+
/// Returns the hash value for the given key.
70+
{
71+
return ((UInt32) hash(key)) % maxValue;
72+
}
73+
};
74+
75+
6376
} // namespace Poco
6477

6578

‎Foundation/include/Poco/URIStreamFactory.h‎

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// URIStreamFactory.h
33
//
4-
// $Id: //poco/svn/Foundation/include/Poco/URIStreamFactory.h#2 $
4+
// $Id: //poco/svn/Foundation/include/Poco/URIStreamFactory.h#3 $
55
//
66
// Library: Foundation
77
// Package: URI
@@ -66,6 +66,9 @@ class Foundation_API URIStreamFactory
6666
///
6767
/// If the stream cannot be opened for whatever reason,
6868
/// an appropriate IOException must be thrown.
69+
///
70+
/// If opening the stream results in a redirect, a
71+
/// URIRedirection exception should be thrown.
6972

7073
protected:
7174
virtual ~URIStreamFactory();
@@ -79,6 +82,37 @@ class Foundation_API URIStreamFactory
7982
};
8083

8184

85+
class Foundation_API URIRedirection
86+
/// An instance of URIRedirection is thrown by a URIStreamFactory::open()
87+
/// if opening the original URI resulted in a redirection response
88+
/// (such as a MOVED PERMANENTLY in HTTP).
89+
{
90+
public:
91+
URIRedirection(const std::string& uri);
92+
URIRedirection(const URIRedirection& redir);
93+
94+
URIRedirection& operator = (const URIRedirection& redir);
95+
void swap(URIRedirection& redir);
96+
97+
const std::string& uri() const;
98+
/// Returns the new URI.
99+
100+
private:
101+
URIRedirection();
102+
103+
std::string _uri;
104+
};
105+
106+
107+
//
108+
// inlines
109+
//
110+
inline const std::string& URIRedirection::uri() const
111+
{
112+
return _uri;
113+
}
114+
115+
82116
} // namespace Poco
83117

84118

‎Foundation/include/Poco/URIStreamOpener.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// URIStreamOpener.h
33
//
4-
// $Id: //poco/svn/Foundation/include/Poco/URIStreamOpener.h#2 $
4+
// $Id: //poco/svn/Foundation/include/Poco/URIStreamOpener.h#3 $
55
//
66
// Library: Foundation
77
// Package: URI
@@ -62,6 +62,11 @@ class Foundation_API URIStreamOpener
6262
/// A FileStreamFactory is automatically registered for file URIs.
6363
{
6464
public:
65+
enum
66+
{
67+
MAX_REDIRECTS = 10
68+
};
69+
6570
URIStreamOpener();
6671
/// Creates the URIStreamOpener and registers a FileStreamFactory
6772
/// for file URIs.
@@ -133,6 +138,7 @@ class Foundation_API URIStreamOpener
133138

134139
protected:
135140
std::istream* openFile(const Path& path) const;
141+
std::istream* openURI(const std::string& scheme, const URI& uri) const;
136142

137143
private:
138144
URIStreamOpener(const URIStreamOpener&);

‎Foundation/include/Poco/UniqueAccessExpireStrategy.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// UniqueAccessExpireStrategy.h
33
//
4-
// $Id: //poco/svn/Foundation/include/Poco/UniqueAccessExpireStrategy.h#2 $
4+
// $Id: //poco/svn/Foundation/include/Poco/UniqueAccessExpireStrategy.h#3 $
55
//
66
// Library: Foundation
77
// Package: Cache
@@ -149,6 +149,8 @@ class UniqueAccessExpireStrategy: public AbstractStrategy<TKey, TValue>
149149
args.invalidate();
150150
}
151151
}
152+
else //not found: probably removed by onReplace
153+
args.invalidate();
152154
}
153155

154156
void onReplace(const void*, std::set<TKey>& elemsToRemove)

0 commit comments

Comments
 (0)