diff --git a/CHANGELOG b/CHANGELOG
index c21c387c4..7d595257f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -23,6 +23,10 @@ Release 1.5.2 (2013-03-??)
- added ListMap (map-like container with preserving insertion order)
- MailMessage: attachments saving support and consistent read/write
- fixed GH #124: Possibile buffer overrun in Foundation/EventLogChannel
+- fixed GH #119: JSON::Object holds values in ordered map
+- added PrintHandler
+- renamed DefaultHandler to ParseHandler
+- redefined DefaultHandler as typedef to ParseHandler
Release 1.5.1 (2013-01-11)
==========================
diff --git a/Foundation/include/Poco/Platform.h b/Foundation/include/Poco/Platform.h
index ff5bc118c..f34f2777f 100644
--- a/Foundation/include/Poco/Platform.h
+++ b/Foundation/include/Poco/Platform.h
@@ -247,4 +247,11 @@
#endif
+#if defined(POCO_OS_FAMILY_WINDOWS)
+ #define POCO_DEFAULT_NEWLINE_CHARS "\r\n"
+#else
+ #define POCO_DEFAULT_NEWLINE_CHARS "\n"
+#endif
+
+
#endif // Foundation_Platform_INCLUDED
diff --git a/Foundation/src/LineEndingConverter.cpp b/Foundation/src/LineEndingConverter.cpp
index 396e8f45d..9ca1c1e55 100644
--- a/Foundation/src/LineEndingConverter.cpp
+++ b/Foundation/src/LineEndingConverter.cpp
@@ -40,13 +40,6 @@
namespace Poco {
-#if defined(_WIN32)
-#define POCO_DEFAULT_NEWLINE_CHARS "\r\n"
-#else
-#define POCO_DEFAULT_NEWLINE_CHARS "\n"
-#endif
-
-
const std::string LineEnding::NEWLINE_DEFAULT(POCO_DEFAULT_NEWLINE_CHARS);
const std::string LineEnding::NEWLINE_CR("\r");
const std::string LineEnding::NEWLINE_CRLF("\r\n");
diff --git a/JSON/JSON_CE_vs90.vcproj b/JSON/JSON_CE_vs90.vcproj
index 9600be84b..19e64d3f6 100644
--- a/JSON/JSON_CE_vs90.vcproj
+++ b/JSON/JSON_CE_vs90.vcproj
@@ -433,7 +433,7 @@
+ RelativePath=".\src\ParseHandler.cpp"/>
+
+
+
+
+
@@ -281,11 +283,12 @@
-
+
+
diff --git a/JSON/JSON_vs100.vcxproj.filters b/JSON/JSON_vs100.vcxproj.filters
index 90e41bf38..7b392ea7c 100644
--- a/JSON/JSON_vs100.vcxproj.filters
+++ b/JSON/JSON_vs100.vcxproj.filters
@@ -42,14 +42,17 @@
Header Files
+
+ Header Files
+
+
+ Header Files
+
Source Files
-
- Source Files
-
Source Files
@@ -74,5 +77,11 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
\ No newline at end of file
diff --git a/JSON/JSON_vs110.vcxproj b/JSON/JSON_vs110.vcxproj
index 52d1c01a2..e5abd65e2 100644
--- a/JSON/JSON_vs110.vcxproj
+++ b/JSON/JSON_vs110.vcxproj
@@ -274,11 +274,12 @@
-
+
+
@@ -292,6 +293,8 @@
+
+
diff --git a/JSON/JSON_vs110.vcxproj.filters b/JSON/JSON_vs110.vcxproj.filters
index 6e53552f9..c722da3db 100644
--- a/JSON/JSON_vs110.vcxproj.filters
+++ b/JSON/JSON_vs110.vcxproj.filters
@@ -12,7 +12,7 @@
Source Files
-
+
Source Files
@@ -27,6 +27,9 @@
Source Files
+
+ Source Files
+
Source Files
@@ -62,6 +65,12 @@
Header Files
+
+ Header Files
+
+
+ Header Files
+
Header Files
diff --git a/JSON/JSON_vs71.vcproj b/JSON/JSON_vs71.vcproj
index b9eaff778..c268e0007 100644
--- a/JSON/JSON_vs71.vcproj
+++ b/JSON/JSON_vs71.vcproj
@@ -365,7 +365,7 @@
+ RelativePath=".\src\ParseHandler.cpp"/>
+
+
+
+ RelativePath=".\src\ParseHandler.cpp"/>
+
+
+
+ RelativePath=".\src\ParseHandler.cpp"/>
+
+
+
-
+
+
@@ -290,6 +291,8 @@
+
+
diff --git a/JSON/JSON_x64_vs100.vcxproj.filters b/JSON/JSON_x64_vs100.vcxproj.filters
index 4578d5ef4..fc1a777c5 100644
--- a/JSON/JSON_x64_vs100.vcxproj.filters
+++ b/JSON/JSON_x64_vs100.vcxproj.filters
@@ -12,7 +12,7 @@
Source Files
-
+
Source Files
@@ -27,6 +27,9 @@
Source Files
+
+ Source Files
+
Source Files
@@ -62,6 +65,12 @@
Header Files
+
+ Header Files
+
+
+ Header Files
+
Header Files
diff --git a/JSON/JSON_x64_vs110.vcxproj b/JSON/JSON_x64_vs110.vcxproj
index 026253844..12d55e3ce 100644
--- a/JSON/JSON_x64_vs110.vcxproj
+++ b/JSON/JSON_x64_vs110.vcxproj
@@ -272,11 +272,12 @@
-
+
+
@@ -290,6 +291,8 @@
+
+
diff --git a/JSON/JSON_x64_vs110.vcxproj.filters b/JSON/JSON_x64_vs110.vcxproj.filters
index 4578d5ef4..fc1a777c5 100644
--- a/JSON/JSON_x64_vs110.vcxproj.filters
+++ b/JSON/JSON_x64_vs110.vcxproj.filters
@@ -12,7 +12,7 @@
Source Files
-
+
Source Files
@@ -27,6 +27,9 @@
Source Files
+
+ Source Files
+
Source Files
@@ -62,6 +65,12 @@
Header Files
+
+ Header Files
+
+
+ Header Files
+
Header Files
diff --git a/JSON/JSON_x64_vs90.vcproj b/JSON/JSON_x64_vs90.vcproj
index a26d8d8ca..e37f5197b 100644
--- a/JSON/JSON_x64_vs90.vcproj
+++ b/JSON/JSON_x64_vs90.vcproj
@@ -390,7 +390,7 @@
+ RelativePath=".\src\ParseHandler.cpp"/>
+
+
+
+#include "Poco/JSON/ParseHandler.h"
namespace Poco {
namespace JSON {
-class JSON_API DefaultHandler : public Handler
- /// Provides a default handler for the JSON parser.
- /// This handler will build up an object or array based
- /// on the handlers called by the parser.
-{
-public:
-
- DefaultHandler();
- /// Default Constructor
-
- virtual ~DefaultHandler();
- /// Destructor
-
- void startObject();
- /// Handles a {, meaning a new object will be read
-
- void endObject();
- /// Handles a }, meaning the object is read
-
- void startArray();
- /// Handles a [, meaning a new array will be read
-
- void endArray();
- /// Handles a ], meaning the array is read
-
- void key(const std::string& k);
- /// A key is read
-
- Dynamic::Var result() const;
- /// Returns the result of the parser. Which is an object or an array.
-
- virtual void value(int v);
- /// An integer value is read
-
- virtual void value(unsigned v);
- /// An unsigned value is read. This will only be triggered if the
- /// value cannot fit into a signed int.
-
-#if defined(POCO_HAVE_INT64)
- virtual void value(Int64 v);
- /// A 64-bit integer value is read
-
- virtual void value(UInt64 v);
- /// An unsigned 64-bit integer value is read. This will only be
- /// triggered if the value cannot fit into a signed 64-bit integer.
-#endif
-
- virtual void value(const std::string& s);
- /// A string value is read.
-
- virtual void value(double d);
- /// A double value is read
-
- virtual void value(bool b);
- /// A boolean value is read
-
- virtual void null();
- /// A null value is read
-
-private:
- void setValue(const Poco::Dynamic::Var& value);
-
- std::stack _stack;
- std::string _key;
- Dynamic::Var _result;
-};
-
-
-inline Dynamic::Var DefaultHandler::result() const
-{
- return _result;
-}
-
-
-inline void DefaultHandler::value(int v)
-{
- setValue(v);
-}
-
-
-inline void DefaultHandler::value(unsigned v)
-{
- setValue(v);
-}
-
-
-#if defined(POCO_HAVE_INT64)
-inline void DefaultHandler::value(Int64 v)
-{
- setValue(v);
-}
-
-
-inline void DefaultHandler::value(UInt64 v)
-{
- setValue(v);
-}
-#endif
-
-
-inline void DefaultHandler::value(const std::string& s)
-{
- setValue(s);
-}
-
-
-inline void DefaultHandler::value(double d)
-{
- setValue(d);
-}
-
-
-inline void DefaultHandler::value(bool b)
-{
- setValue(b);
-}
-
-
-inline void DefaultHandler::null()
-{
- Poco::Dynamic::Var empty;
- setValue(empty);
-}
+//@deprecated
+typedef ParseHandler DefaultHandler;
}} // namespace Poco::JSON
diff --git a/JSON/include/Poco/JSON/Handler.h b/JSON/include/Poco/JSON/Handler.h
index b8d3ed65d..bb3a0c797 100644
--- a/JSON/include/Poco/JSON/Handler.h
+++ b/JSON/include/Poco/JSON/Handler.h
@@ -51,6 +51,9 @@ namespace JSON {
class JSON_API Handler
{
public:
+ Handler();
+ /// Constructor;
+
virtual void startObject() = 0;
/// The parser has read a {, meaning a new object will be read
@@ -74,7 +77,7 @@ public:
virtual void value(unsigned v) = 0;
/// An unsigned value is read. This will only be triggered if the
- /// value cannot fit into a signed int.
+ /// value cannot fit into a signed int.
#if defined(POCO_HAVE_INT64)
virtual void value(Int64 v) = 0;
@@ -82,7 +85,7 @@ public:
virtual void value(UInt64 v) = 0;
/// An unsigned 64-bit integer value is read. This will only be
- /// triggered if the value cannot fit into a signed 64-bit integer.
+ /// triggered if the value cannot fit into a signed 64-bit integer.
#endif
virtual void value(const std::string& value) = 0;
@@ -94,6 +97,9 @@ public:
virtual void value(bool b) = 0;
/// A boolean value is read
+ virtual void comma();
+ /// A comma is read
+
protected:
virtual ~Handler();
diff --git a/JSON/include/Poco/JSON/Object.h b/JSON/include/Poco/JSON/Object.h
index 34dff1e38..b2c17e21b 100644
--- a/JSON/include/Poco/JSON/Object.h
+++ b/JSON/include/Poco/JSON/Object.h
@@ -46,6 +46,7 @@
#include "Poco/Dynamic/Var.h"
#include