Merge remote-tracking branch 'origin/poco-1.8.0' into poco-1.8.0

This commit is contained in:
Francis ANDRE 2017-10-31 18:11:51 +01:00
commit 5591d10a21
310 changed files with 6021 additions and 1144 deletions

View File

@ -37,20 +37,24 @@ class Foundation_API Base64DecoderBuf: public UnbufferedStreamBuf
/// its streambuf.
{
public:
Base64DecoderBuf(std::istream& istr);
Base64DecoderBuf(std::istream& istr, int options = 0);
~Base64DecoderBuf();
private:
int readFromDevice();
int readOne();
int _options;
unsigned char _group[3];
int _groupLength;
int _groupIndex;
std::streambuf& _buf;
const unsigned char* _pInEncoding;
static unsigned char IN_ENCODING[256];
static bool IN_ENCODING_INIT;
static unsigned char IN_ENCODING_URL[256];
static bool IN_ENCODING_URL_INIT;
private:
Base64DecoderBuf(const Base64DecoderBuf&);
@ -65,7 +69,7 @@ class Foundation_API Base64DecoderIOS: public virtual std::ios
/// order of the stream buffer and base classes.
{
public:
Base64DecoderIOS(std::istream& istr);
Base64DecoderIOS(std::istream& istr, int options = 0);
~Base64DecoderIOS();
Base64DecoderBuf* rdbuf();
@ -89,7 +93,7 @@ class Foundation_API Base64Decoder: public Base64DecoderIOS, public std::istream
/// its streambuf.
{
public:
Base64Decoder(std::istream& istr);
Base64Decoder(std::istream& istr, int options = 0);
~Base64Decoder();
private:

View File

@ -26,6 +26,19 @@
namespace Poco {
enum Base64EncodingOptions
{
BASE64_URL_ENCODING = 0x01,
/// Use the URL and filename-safe alphabet,
/// replacing '+' with '-' and '/' with '_'.
///
/// Will also set line length to unlimited.
BASE64_NO_PADDING = 0x02
/// Do not append padding characters ('=') at end.
};
class Foundation_API Base64EncoderBuf: public UnbufferedStreamBuf
/// This streambuf base64-encodes all data written
/// to it and forwards it to a connected
@ -37,7 +50,7 @@ class Foundation_API Base64EncoderBuf: public UnbufferedStreamBuf
/// not updated to match the buffer's state.
{
public:
Base64EncoderBuf(std::ostream& ostr);
Base64EncoderBuf(std::ostream& ostr, int options = 0);
~Base64EncoderBuf();
int close();
@ -57,13 +70,16 @@ public:
private:
int writeToDevice(char c);
int _options;
unsigned char _group[3];
int _groupLength;
int _pos;
int _lineLength;
std::streambuf& _buf;
const unsigned char* _pOutEncoding;
static const unsigned char OUT_ENCODING[64];
static const unsigned char OUT_ENCODING_URL[64];
friend class Base64DecoderBuf;
@ -79,7 +95,7 @@ class Foundation_API Base64EncoderIOS: public virtual std::ios
/// order of the stream buffer and base classes.
{
public:
Base64EncoderIOS(std::ostream& ostr);
Base64EncoderIOS(std::ostream& ostr, int options = 0);
~Base64EncoderIOS();
int close();
Base64EncoderBuf* rdbuf();
@ -107,7 +123,7 @@ class Foundation_API Base64Encoder: public Base64EncoderIOS, public std::ostream
/// not updated to match the buffer's state.
{
public:
Base64Encoder(std::ostream& ostr);
Base64Encoder(std::ostream& ostr, int options = 0);
~Base64Encoder();
private:

View File

@ -1,8 +1,6 @@
//
// RecursiveDirectoryIteratorStategies.h
//
// $Id$
//
// Library: Foundation
// Package: Filesystem
// Module: RecursiveDirectoryIterator

View File

@ -1,8 +1,6 @@
//
// EventChannel.h
//
// $Id$
//
// Library: Foundation
// Package: Logging
// Module: EventChannel

View File

@ -1,8 +1,6 @@
//
// RecursiveDirectoryIterator.h
//
// $Id$
//
// Library: Foundation
// Package: Filesystem
// Module: RecursiveDirectoryIterator

View File

@ -1,8 +1,6 @@
//
// RecursiveDirectoryIteratorImpl.h
//
// $Id$
//
// Library: Foundation
// Package: Filesystem
// Module: RecursiveDirectoryIterator

View File

@ -1,8 +1,6 @@
//
// SortedDirectoryIterator.h
//
// $Id$
//
// Library: Foundation
// Package: Filesystem
// Module: DirectoryIterator

View File

@ -23,6 +23,8 @@ namespace Poco {
unsigned char Base64DecoderBuf::IN_ENCODING[256];
bool Base64DecoderBuf::IN_ENCODING_INIT = false;
unsigned char Base64DecoderBuf::IN_ENCODING_URL[256];
bool Base64DecoderBuf::IN_ENCODING_URL_INIT = false;
namespace
@ -31,12 +33,32 @@ namespace
}
Base64DecoderBuf::Base64DecoderBuf(std::istream& istr):
Base64DecoderBuf::Base64DecoderBuf(std::istream& istr, int options):
_options(options),
_groupLength(0),
_groupIndex(0),
_buf(*istr.rdbuf())
_buf(*istr.rdbuf()),
_pInEncoding((options & BASE64_URL_ENCODING) ? IN_ENCODING_URL : IN_ENCODING)
{
FastMutex::ScopedLock lock(mutex);
if (options & BASE64_URL_ENCODING)
{
if (!IN_ENCODING_URL_INIT)
{
for (unsigned i = 0; i < sizeof(IN_ENCODING_URL); i++)
{
IN_ENCODING_URL[i] = 0xFF;
}
for (unsigned i = 0; i < sizeof(Base64EncoderBuf::OUT_ENCODING_URL); i++)
{
IN_ENCODING_URL[Base64EncoderBuf::OUT_ENCODING_URL[i]] = i;
}
IN_ENCODING_URL[static_cast<unsigned char>('=')] = '\0';
IN_ENCODING_URL_INIT = true;
}
}
else
{
if (!IN_ENCODING_INIT)
{
for (unsigned i = 0; i < sizeof(IN_ENCODING); i++)
@ -50,6 +72,7 @@ Base64DecoderBuf::Base64DecoderBuf(std::istream& istr):
IN_ENCODING[static_cast<unsigned char>('=')] = '\0';
IN_ENCODING_INIT = true;
}
}
}
@ -70,20 +93,36 @@ int Base64DecoderBuf::readFromDevice()
int c;
if ((c = readOne()) == -1) return -1;
buffer[0] = (unsigned char) c;
if (IN_ENCODING[buffer[0]] == 0xFF) throw DataFormatException();
if ((c = readOne()) == -1) throw DataFormatException();
if (_pInEncoding[buffer[0]] == 0xFF) throw DataFormatException();
if ((c = readOne()) == -1) return -1;
buffer[1] = (unsigned char) c;
if (IN_ENCODING[buffer[1]] == 0xFF) throw DataFormatException();
if (_pInEncoding[buffer[1]] == 0xFF) throw DataFormatException();
if (_options & BASE64_NO_PADDING)
{
if ((c = readOne()) != -1)
buffer[2] = c;
else
buffer[2] = '=';
if (_pInEncoding[buffer[2]] == 0xFF) throw DataFormatException();
if ((c = readOne()) != -1)
buffer[3] = c;
else
buffer[3] = '=';
if (_pInEncoding[buffer[3]] == 0xFF) throw DataFormatException();
}
else
{
if ((c = readOne()) == -1) throw DataFormatException();
buffer[2] = c;
if (IN_ENCODING[buffer[2]] == 0xFF) throw DataFormatException();
if (_pInEncoding[buffer[2]] == 0xFF) throw DataFormatException();
if ((c = readOne()) == -1) throw DataFormatException();
buffer[3] = c;
if (IN_ENCODING[buffer[3]] == 0xFF) throw DataFormatException();
if (_pInEncoding[buffer[3]] == 0xFF) throw DataFormatException();
}
_group[0] = (IN_ENCODING[buffer[0]] << 2) | (IN_ENCODING[buffer[1]] >> 4);
_group[1] = ((IN_ENCODING[buffer[1]] & 0x0F) << 4) | (IN_ENCODING[buffer[2]] >> 2);
_group[2] = (IN_ENCODING[buffer[2]] << 6) | IN_ENCODING[buffer[3]];
_group[0] = (_pInEncoding[buffer[0]] << 2) | (_pInEncoding[buffer[1]] >> 4);
_group[1] = ((_pInEncoding[buffer[1]] & 0x0F) << 4) | (_pInEncoding[buffer[2]] >> 2);
_group[2] = (_pInEncoding[buffer[2]] << 6) | _pInEncoding[buffer[3]];
if (buffer[2] == '=')
_groupLength = 1;
@ -100,13 +139,16 @@ int Base64DecoderBuf::readFromDevice()
int Base64DecoderBuf::readOne()
{
int ch = _buf.sbumpc();
if (!(_options & BASE64_URL_ENCODING))
{
while (ch == ' ' || ch == '\r' || ch == '\t' || ch == '\n')
ch = _buf.sbumpc();
}
return ch;
}
Base64DecoderIOS::Base64DecoderIOS(std::istream& istr): _buf(istr)
Base64DecoderIOS::Base64DecoderIOS(std::istream& istr, int options): _buf(istr, options)
{
poco_ios_init(&_buf);
}
@ -123,7 +165,7 @@ Base64DecoderBuf* Base64DecoderIOS::rdbuf()
}
Base64Decoder::Base64Decoder(std::istream& istr): Base64DecoderIOS(istr), std::istream(&_buf)
Base64Decoder::Base64Decoder(std::istream& istr, int options): Base64DecoderIOS(istr, options), std::istream(&_buf)
{
}

View File

@ -31,11 +31,26 @@ const unsigned char Base64EncoderBuf::OUT_ENCODING[64] =
};
Base64EncoderBuf::Base64EncoderBuf(std::ostream& ostr):
const unsigned char Base64EncoderBuf::OUT_ENCODING_URL[64] =
{
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', '-', '_'
};
Base64EncoderBuf::Base64EncoderBuf(std::ostream& ostr, int options):
_options(options),
_groupLength(0),
_pos(0),
_lineLength(72),
_buf(*ostr.rdbuf())
_lineLength((options & BASE64_URL_ENCODING) ? 0 : 72),
_buf(*ostr.rdbuf()),
_pOutEncoding((options & BASE64_URL_ENCODING) ? OUT_ENCODING_URL : OUT_ENCODING)
{
}
@ -73,13 +88,13 @@ int Base64EncoderBuf::writeToDevice(char c)
{
unsigned char idx;
idx = _group[0] >> 2;
if (_buf.sputc(OUT_ENCODING[idx]) == eof) return eof;
if (_buf.sputc(_pOutEncoding[idx]) == eof) return eof;
idx = ((_group[0] & 0x03) << 4) | (_group[1] >> 4);
if (_buf.sputc(OUT_ENCODING[idx]) == eof) return eof;
if (_buf.sputc(_pOutEncoding[idx]) == eof) return eof;
idx = ((_group[1] & 0x0F) << 2) | (_group[2] >> 6);
if (_buf.sputc(OUT_ENCODING[idx]) == eof) return eof;
if (_buf.sputc(_pOutEncoding[idx]) == eof) return eof;
idx = _group[2] & 0x3F;
if (_buf.sputc(OUT_ENCODING[idx]) == eof) return eof;
if (_buf.sputc(_pOutEncoding[idx]) == eof) return eof;
_pos += 4;
if (_lineLength > 0 && _pos >= _lineLength)
{
@ -103,30 +118,36 @@ int Base64EncoderBuf::close()
_group[1] = 0;
unsigned char idx;
idx = _group[0] >> 2;
if (_buf.sputc(OUT_ENCODING[idx]) == eof) return eof;
if (_buf.sputc(_pOutEncoding[idx]) == eof) return eof;
idx = ((_group[0] & 0x03) << 4) | (_group[1] >> 4);
if (_buf.sputc(OUT_ENCODING[idx]) == eof) return eof;
if (_buf.sputc(_pOutEncoding[idx]) == eof) return eof;
if (!(_options & BASE64_NO_PADDING))
{
if (_buf.sputc('=') == eof) return eof;
if (_buf.sputc('=') == eof) return eof;
}
}
else if (_groupLength == 2)
{
_group[2] = 0;
unsigned char idx;
idx = _group[0] >> 2;
if (_buf.sputc(OUT_ENCODING[idx]) == eof) return eof;
if (_buf.sputc(_pOutEncoding[idx]) == eof) return eof;
idx = ((_group[0] & 0x03) << 4) | (_group[1] >> 4);
if (_buf.sputc(OUT_ENCODING[idx]) == eof) return eof;
if (_buf.sputc(_pOutEncoding[idx]) == eof) return eof;
idx = ((_group[1] & 0x0F) << 2) | (_group[2] >> 6);
if (_buf.sputc(OUT_ENCODING[idx]) == eof) return eof;
if (_buf.sputc(_pOutEncoding[idx]) == eof) return eof;
if (!(_options & BASE64_NO_PADDING))
{
if (_buf.sputc('=') == eof) return eof;
}
}
_groupLength = 0;
return _buf.pubsync();
}
Base64EncoderIOS::Base64EncoderIOS(std::ostream& ostr): _buf(ostr)
Base64EncoderIOS::Base64EncoderIOS(std::ostream& ostr, int options): _buf(ostr, options)
{
poco_ios_init(&_buf);
}
@ -149,7 +170,7 @@ Base64EncoderBuf* Base64EncoderIOS::rdbuf()
}
Base64Encoder::Base64Encoder(std::ostream& ostr): Base64EncoderIOS(ostr), std::ostream(&_buf)
Base64Encoder::Base64Encoder(std::ostream& ostr, int options): Base64EncoderIOS(ostr, options), std::ostream(&_buf)
{
}

View File

@ -1,8 +1,6 @@
//
// RecursiveDirectoryIteratorStategies.cpp
//
// $Id$
//
// Library: Foundation
// Package: Filesystem
// Module: RecursiveDirectoryIterator

View File

@ -1,8 +1,6 @@
//
// EventChannel.cpp
//
// $Id$
//
// Library: Foundation
// Package: Logging
// Module: EventChannel

View File

@ -1,8 +1,6 @@
//
// SortedDirectoryIterator.cpp
//
// $Id$
//
// Library: Foundation
// Package: Filesystem
// Module: DirectoryIterator

View File

@ -55,6 +55,79 @@ void Base64Test::testEncoder()
encoder.close();
assert (str.str() == "QUJDREVG");
}
{
std::ostringstream str;
Base64Encoder encoder(str);
encoder << "!@#$%^&*()_~<>";
encoder.close();
assert (str.str() == "IUAjJCVeJiooKV9+PD4=");
}
}
void Base64Test::testEncoderURL()
{
{
std::ostringstream str;
Base64Encoder encoder(str, Poco::BASE64_URL_ENCODING);
encoder << std::string("\00\01\02\03\04\05", 6);
encoder.close();
assert (str.str() == "AAECAwQF");
}
{
std::ostringstream str;
Base64Encoder encoder(str, Poco::BASE64_URL_ENCODING);
encoder << std::string("\00\01\02\03", 4);
encoder.close();
assert (str.str() == "AAECAw==");
}
{
std::ostringstream str;
Base64Encoder encoder(str, Poco::BASE64_URL_ENCODING);
encoder << "ABCDEF";
encoder.close();
assert (str.str() == "QUJDREVG");
}
{
std::ostringstream str;
Base64Encoder encoder(str, Poco::BASE64_URL_ENCODING);
encoder << "!@#$%^&*()_~<>";
encoder.close();
assert (str.str() == "IUAjJCVeJiooKV9-PD4=");
}
}
void Base64Test::testEncoderNoPadding()
{
{
std::ostringstream str;
Base64Encoder encoder(str, Poco::BASE64_URL_ENCODING | Poco::BASE64_NO_PADDING);
encoder << std::string("\00\01\02\03\04\05", 6);
encoder.close();
assert (str.str() == "AAECAwQF");
}
{
std::ostringstream str;
Base64Encoder encoder(str, Poco::BASE64_URL_ENCODING | Poco::BASE64_NO_PADDING);
encoder << std::string("\00\01\02\03", 4);
encoder.close();
assert (str.str() == "AAECAw");
}
{
std::ostringstream str;
Base64Encoder encoder(str, Poco::BASE64_URL_ENCODING | Poco::BASE64_NO_PADDING);
encoder << "ABCDEF";
encoder.close();
assert (str.str() == "QUJDREVG");
}
{
std::ostringstream str;
Base64Encoder encoder(str, Poco::BASE64_URL_ENCODING | Poco::BASE64_NO_PADDING);
encoder << "!@#$%^&*()_~<>";
encoder.close();
assert (str.str() == "IUAjJCVeJiooKV9-PD4");
}
}
@ -125,6 +198,115 @@ void Base64Test::testDecoder()
}
void Base64Test::testDecoderURL()
{
{
std::istringstream istr("AAECAwQF");
Base64Decoder decoder(istr, Poco::BASE64_URL_ENCODING);
assert (decoder.good() && decoder.get() == 0);
assert (decoder.good() && decoder.get() == 1);
assert (decoder.good() && decoder.get() == 2);
assert (decoder.good() && decoder.get() == 3);
assert (decoder.good() && decoder.get() == 4);
assert (decoder.good() && decoder.get() == 5);
assert (decoder.good() && decoder.get() == -1);
}
{
std::istringstream istr("AAECAwQ=");
Base64Decoder decoder(istr, Poco::BASE64_URL_ENCODING);
assert (decoder.good() && decoder.get() == 0);
assert (decoder.good() && decoder.get() == 1);
assert (decoder.good() && decoder.get() == 2);
assert (decoder.good() && decoder.get() == 3);
assert (decoder.good() && decoder.get() == 4);
assert (decoder.good() && decoder.get() == -1);
}
{
std::istringstream istr("AAECAw==", Poco::BASE64_URL_ENCODING);
Base64Decoder decoder(istr);
assert (decoder.good() && decoder.get() == 0);
assert (decoder.good() && decoder.get() == 1);
assert (decoder.good() && decoder.get() == 2);
assert (decoder.good() && decoder.get() == 3);
assert (decoder.good() && decoder.get() == -1);
}
{
std::istringstream istr("QUJDREVG", Poco::BASE64_URL_ENCODING);
Base64Decoder decoder(istr);
std::string s;
decoder >> s;
assert (s == "ABCDEF");
assert (decoder.eof());
assert (!decoder.fail());
}
{
std::istringstream istr("QUJ\r\nDRE\r\nVG");
Base64Decoder decoder(istr, Poco::BASE64_URL_ENCODING);
std::string s;
decoder >> s;
assert (decoder.bad());
}
{
std::istringstream istr("QUJD#REVG");
Base64Decoder decoder(istr, Poco::BASE64_URL_ENCODING);
std::string s;
try
{
decoder >> s;
assert (decoder.bad());
}
catch (DataFormatException&)
{
}
assert (!decoder.eof());
}
{
std::istringstream istr("IUAjJCVeJiooKV9-PD4=");
Base64Decoder decoder(istr, Poco::BASE64_URL_ENCODING);
std::string s;
decoder >> s;
assert (s == "!@#$%^&*()_~<>");
assert (decoder.eof());
assert (!decoder.fail());
}
}
void Base64Test::testDecoderNoPadding()
{
{
std::istringstream istr("AAECAwQF");
Base64Decoder decoder(istr, Poco::BASE64_NO_PADDING);
assert (decoder.good() && decoder.get() == 0);
assert (decoder.good() && decoder.get() == 1);
assert (decoder.good() && decoder.get() == 2);
assert (decoder.good() && decoder.get() == 3);
assert (decoder.good() && decoder.get() == 4);
assert (decoder.good() && decoder.get() == 5);
assert (decoder.good() && decoder.get() == -1);
}
{
std::istringstream istr("AAECAwQ");
Base64Decoder decoder(istr, Poco::BASE64_NO_PADDING);
assert (decoder.good() && decoder.get() == 0);
assert (decoder.good() && decoder.get() == 1);
assert (decoder.good() && decoder.get() == 2);
assert (decoder.good() && decoder.get() == 3);
assert (decoder.good() && decoder.get() == 4);
assert (decoder.good() && decoder.get() == -1);
}
{
std::istringstream istr("AAECAw");
Base64Decoder decoder(istr, Poco::BASE64_NO_PADDING);
assert (decoder.good() && decoder.get() == 0);
assert (decoder.good() && decoder.get() == 1);
assert (decoder.good() && decoder.get() == 2);
assert (decoder.good() && decoder.get() == 3);
assert (decoder.good() && decoder.get() == -1);
}
}
void Base64Test::testEncodeDecode()
{
{
@ -170,7 +352,11 @@ CppUnit::Test* Base64Test::suite()
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("Base64Test");
CppUnit_addTest(pSuite, Base64Test, testEncoder);
CppUnit_addTest(pSuite, Base64Test, testEncoderURL);
CppUnit_addTest(pSuite, Base64Test, testEncoderNoPadding);
CppUnit_addTest(pSuite, Base64Test, testDecoder);
CppUnit_addTest(pSuite, Base64Test, testDecoderURL);
CppUnit_addTest(pSuite, Base64Test, testDecoderNoPadding);
CppUnit_addTest(pSuite, Base64Test, testEncodeDecode);
return pSuite;

View File

@ -25,7 +25,11 @@ public:
~Base64Test();
void testEncoder();
void testEncoderURL();
void testEncoderNoPadding();
void testDecoder();
void testDecoderURL();
void testDecoderNoPadding();
void testEncodeDecode();
void setUp();

View File

@ -1,8 +1,6 @@
//
// Array.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Array

View File

@ -1,8 +1,6 @@
//
// Handler.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Handler

View File

@ -1,8 +1,6 @@
//
// JSON.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: JSON

View File

@ -1,8 +1,6 @@
//
// JSONException.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: JSONException

View File

@ -1,8 +1,6 @@
//
// Object.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Object

View File

@ -1,8 +1,6 @@
//
// ParseHandler.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: ParseHandler

View File

@ -1,8 +1,6 @@
//
// Parser.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Parser

View File

@ -1,8 +1,6 @@
//
// Parser.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: ParserImpl

View File

@ -1,8 +1,6 @@
//
// PrintHandler.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: PrintHandler

View File

@ -1,8 +1,6 @@
//
// Query.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Query

View File

@ -1,8 +1,6 @@
//
// Stringifier.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Stringifier

View File

@ -1,8 +1,6 @@
//
// Template.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Template

View File

@ -1,8 +1,6 @@
//
// TemplateCache.h
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: TemplateCache

View File

@ -1,8 +1,6 @@
//
// Benchmark.cpp
//
// $Id$
//
// This sample shows a benchmark of the JSON parser.
//
// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.

View File

@ -1,8 +1,6 @@
//
// Array.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Array

View File

@ -1,8 +1,6 @@
//
// Handler.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Handler

View File

@ -1,8 +1,6 @@
//
// JSONException.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: JSONException

View File

@ -1,8 +1,6 @@
//
// Object.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Object

View File

@ -1,8 +1,6 @@
//
// ParseHandler.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: ParseHandler

View File

@ -1,8 +1,6 @@
//
// Parser.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Parser

View File

@ -1,8 +1,6 @@
//
// Parser.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Parser

View File

@ -1,8 +1,6 @@
//
// PrintHandler.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: PrintHandler

View File

@ -1,8 +1,6 @@
//
// Query.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Query

View File

@ -1,8 +1,6 @@
//
// Stringifier.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Stringifier

View File

@ -1,8 +1,6 @@
//
// Template.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: Template

View File

@ -1,8 +1,6 @@
//
// TemplateCache.cpp
//
// $Id$
//
// Library: JSON
// Package: JSON
// Module: TemplateCache

View File

@ -3,7 +3,7 @@
#include <stdio.h>
#if defined(__cplusplus) && !defined(POCO_OS_FAMILY_WINDOWS)
#if defined(__cplusplus) && !(defined(_WIN32_WCE) || defined(_WIN32) || defined(_WIN64))
extern "C" {
#endif
@ -43,7 +43,7 @@ size_t json_get_position(json_stream *json);
size_t json_get_depth(json_stream *json);
const char *json_get_error(json_stream *json);
#if defined(__cplusplus) && !defined(POCO_OS_FAMILY_WINDOWS)
#if defined(__cplusplus) && !(defined(_WIN32_WCE) || defined(_WIN32) || defined(_WIN64))
}
#endif

View File

@ -6,10 +6,6 @@
#endif // __STDC_VERSION__
#include <stdio.h>
#if defined(__cplusplus) && !defined(POCO_OS_FAMILY_WINDOWS)
extern "C" {
#endif
struct json_source {
int (*get) (struct json_source *);
int (*peek) (struct json_source *);
@ -53,8 +49,4 @@ struct json_stream {
char errmsg[128];
};
#if defined(__cplusplus) && !defined(POCO_OS_FAMILY_WINDOWS)
}
#endif
#endif

View File

@ -1,8 +1,6 @@
//
// JSONTestSuite.h
//
// $Id$
//
// Definition of the JSONTestSuite class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.

View File

@ -1,8 +1,6 @@
//
// Array.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Array

View File

@ -1,8 +1,6 @@
//
// BSONReader.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: BSONReader

View File

@ -1,8 +1,6 @@
//
// BSONWriter.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: BSONWriter

View File

@ -1,8 +1,6 @@
//
// Binary.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Binary

View File

@ -1,8 +1,6 @@
//
// Connection.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Connection

View File

@ -1,8 +1,6 @@
//
// Cursor.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Cursor

View File

@ -1,8 +1,6 @@
//
// Database.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Database

View File

@ -1,8 +1,6 @@
//
// DeleteRequest.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: DeleteRequest

View File

@ -1,8 +1,6 @@
//
// Document.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Document

View File

@ -1,8 +1,6 @@
//
// Element.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Element

View File

@ -1,8 +1,6 @@
//
// GetMoreRequest.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: GetMoreRequest

View File

@ -1,8 +1,6 @@
//
// InsertRequest.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: InsertRequest

View File

@ -1,8 +1,6 @@
//
// JavaScriptCode.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: JavaScriptCode

View File

@ -1,8 +1,6 @@
//
// KillCursorsRequest.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: KillCursorsRequest

View File

@ -1,8 +1,6 @@
//
// Message.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Message

View File

@ -1,8 +1,6 @@
//
// MessageHeader.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: MessageHeader

View File

@ -1,8 +1,6 @@
//
// MongoDB.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: MongoDB

View File

@ -1,8 +1,6 @@
//
// Array.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: ObjectId

View File

@ -1,8 +1,6 @@
//
// PoolableConnectionFactory.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: PoolableConnectionFactory

View File

@ -1,8 +1,6 @@
//
// QueryRequest.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: QueryRequest

View File

@ -1,8 +1,6 @@
//
// RegularExpression.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: RegularExpression

View File

@ -1,8 +1,6 @@
//
// ReplicaSet.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: ReplicaSet

View File

@ -1,8 +1,6 @@
//
// RequestMessage.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: RequestMessage

View File

@ -1,8 +1,6 @@
//
// ResponseMessage.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: ResponseMessage

View File

@ -1,8 +1,6 @@
//
// UpdateRequest.h
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: UpdateRequest

View File

@ -1,8 +1,6 @@
//
// main.cpp
//
// $Id$
//
// This sample shows SQL to mongo Shell to C++ examples.
//
// Copyright (c) 2013, Applied Informatics Software Engineering GmbH.

View File

@ -1,8 +1,6 @@
//
// Array.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Array

View File

@ -1,8 +1,6 @@
//
// Binary.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Binary

View File

@ -1,8 +1,6 @@
//
// Connection.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Connection

View File

@ -1,8 +1,6 @@
//
// Cursor.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Cursor

View File

@ -1,8 +1,6 @@
//
// Database.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Database

View File

@ -1,8 +1,6 @@
//
// DeleteRequest.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: DeleteRequest

View File

@ -1,8 +1,6 @@
//
// Document.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Document

View File

@ -1,8 +1,6 @@
//
// Element.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Element

View File

@ -1,8 +1,6 @@
//
// GetMoreRequest.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: GetMoreRequest

View File

@ -1,8 +1,6 @@
//
// InsertRequest.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: InsertRequest

View File

@ -1,8 +1,6 @@
//
// JavaScriptCode.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: JavaScriptCode

View File

@ -1,8 +1,6 @@
//
// KillCursorsRequest.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: KillCursorsRequest

View File

@ -1,8 +1,6 @@
//
// Message.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: Message

View File

@ -1,8 +1,6 @@
//
// MessageHeader.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: MessageHeader

View File

@ -1,8 +1,6 @@
//
// ObjectId.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: ObjectId

View File

@ -1,8 +1,6 @@
//
// QueryRequest.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: QueryRequest

View File

@ -1,8 +1,6 @@
//
// RegularExpression.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: RegularExpression

View File

@ -1,8 +1,6 @@
//
// ReplicaSet.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: ReplicaSet

View File

@ -1,8 +1,6 @@
//
// RequestMessage.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: RequestMessage

View File

@ -1,8 +1,6 @@
//
// ResponseMessage.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: ResponseMessage

View File

@ -1,8 +1,6 @@
//
// UpdateRequest.cpp
//
// $Id$
//
// Library: MongoDB
// Package: MongoDB
// Module: UpdateRequest

View File

@ -1,8 +1,6 @@
//
// Driver.cpp
//
// $Id$
//
// Console-based test driver for Poco MongoDB.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.

View File

@ -1,8 +1,6 @@
//
// MongoDBTest.cpp
//
// $Id$
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//

View File

@ -1,8 +1,6 @@
//
// MongoDBTest.h
//
// $Id$
//
// Definition of the MongoDBTest class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.

View File

@ -1,8 +1,6 @@
//
// MongoDBTestSuite.cpp
//
// $Id$
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//

View File

@ -1,8 +1,6 @@
//
// MongoDBTestSuite.h
//
// $Id$
//
// Definition of the MongoDBTestSuite class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.

View File

@ -1,8 +1,6 @@
//
// WinCEDriver.cpp
//
// $Id$
//
// Console-based test driver for Windows CE.
//
// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH.

View File

@ -1,8 +1,6 @@
//
// WinDriver.cpp
//
// $Id$
//
// Windows test driver for Poco MongoDB.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.

View File

@ -32,9 +32,16 @@ class Net_API DatagramSocket: public Socket
{
public:
DatagramSocket();
/// Creates an unconnected IPv4 datagram socket.
/// Creates an unconnected, unbound datagram socket.
///
/// Before the datagram socket can be used, bind(),
/// bind6() or connect() must be called.
///
/// Notice: The behavior of this constructor has changed
/// in release 2.0. Previously, the constructor created
/// an unbound IPv4 datagram socket.
explicit DatagramSocket(IPAddress::Family family);
explicit DatagramSocket(SocketAddress::Family family);
/// Creates an unconnected datagram socket.
///
/// The socket will be created for the
@ -80,6 +87,20 @@ public:
///
/// Calls to connect cannot() come before calls to bind().
void bind(const SocketAddress& address, bool reuseAddress, bool reusePort);
/// Bind a local address to the socket.
///
/// This is usually only done when establishing a server
/// socket.
///
/// If reuseAddress is true, sets the SO_REUSEADDR
/// socket option.
///
/// If reusePort is true, sets the SO_REUSEPORT
/// socket option.
///
/// Calls to connect cannot() come before calls to bind().
int sendBytes(const void* buffer, int length, int flags = 0);
/// Sends the contents of the given buffer through
/// the socket.

View File

@ -33,7 +33,7 @@ public:
DatagramSocketImpl();
/// Creates an unconnected, unbound datagram socket.
explicit DatagramSocketImpl(IPAddress::Family family);
explicit DatagramSocketImpl(SocketAddress::Family family);
/// Creates an unconnected datagram socket.
///
/// The socket will be created for the

View File

@ -225,6 +225,24 @@ public:
/// to ensure a new connection will be set up
/// for the next request.
virtual bool peekResponse(HTTPResponse& response);
/// If the request contains a "Expect: 100-continue" header,
/// (see HTTPRequest::setExpectContinue()) this method can be
/// used to check whether the server has sent a 100 Continue response
/// before continuing with the request, i.e. sending the request body,
/// after calling sendRequest().
///
/// Returns true if the server has responded with 100 Continue,
/// otherwise false. The HTTPResponse object contains the
/// response sent by the server.
///
/// In any case, receiveResponse() must be called afterwards as well in
/// order to complete the request. The same HTTPResponse object
/// passed to peekResponse() must also be passed to receiveResponse().
///
/// This method should only be called if the request contains
/// a "Expect: 100-continue" header.
void reset();
/// Resets the session and closes the socket.
///
@ -289,6 +307,7 @@ private:
bool _reconnect;
bool _mustReconnect;
bool _expectResponseBody;
bool _responseReceived;
Poco::SharedPtr<std::ostream> _pRequestStream;
Poco::SharedPtr<std::istream> _pResponseStream;

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