porting JSON to the Dynamic::Var

added to JSON to gmake build
This commit is contained in:
Marian Krivos 2012-05-02 04:22:16 +00:00
parent 95c62c00df
commit dc42208ee8
4 changed files with 37 additions and 17 deletions

View File

@ -44,7 +44,7 @@
#include "Poco/JSON/JSON.h"
#include "Poco/SharedPtr.h"
#include "Poco/DynamicAny.h"
#include "Poco/Dynamic/Var.h"
namespace Poco
{
@ -214,15 +214,18 @@ inline void Array::remove(unsigned int index)
namespace Poco
{
namespace Dynamic
{
template <>
class DynamicAnyHolderImpl<JSON::Array::Ptr>: public DynamicAnyHolder
class VarHolderImpl<JSON::Array::Ptr>: public VarHolder
{
public:
DynamicAnyHolderImpl(const JSON::Array::Ptr& val): _val(val)
VarHolderImpl(const JSON::Array::Ptr& val): _val(val)
{
}
~DynamicAnyHolderImpl()
~VarHolderImpl()
{
}
@ -313,9 +316,9 @@ public:
throw BadCastException();
}
DynamicAnyHolder* clone() const
VarHolder* clone() const
{
return new DynamicAnyHolderImpl(_val);
return new VarHolderImpl(_val);
}
const JSON::Array::Ptr& value() const
@ -352,6 +355,7 @@ private:
JSON::Array::Ptr _val;
};
} // Namespace Dynamic
} // Namespace Poco

View File

@ -45,7 +45,7 @@
#include <sstream>
#include "Poco/SharedPtr.h"
#include "Poco/DynamicAny.h"
#include "Poco/Dynamic/Var.h"
#include "Poco/JSON/JSON.h"
#include "Poco/JSON/Array.h"
@ -216,15 +216,18 @@ inline void Object::remove(const std::string& key)
namespace Poco
{
namespace Dynamic
{
template <>
class DynamicAnyHolderImpl<JSON::Object::Ptr>: public DynamicAnyHolder
class VarHolderImpl<JSON::Object::Ptr>: public VarHolder
{
public:
DynamicAnyHolderImpl(const JSON::Object::Ptr& val): _val(val)
VarHolderImpl(const JSON::Object::Ptr& val): _val(val)
{
}
~DynamicAnyHolderImpl()
~VarHolderImpl()
{
}
@ -315,9 +318,9 @@ public:
//TODO: ts = _val.timestamp();
}
DynamicAnyHolder* clone() const
VarHolderImpl* clone() const
{
return new DynamicAnyHolderImpl(_val);
return new VarHolderImpl(_val);
}
const JSON::Object::Ptr& value() const
@ -354,6 +357,7 @@ private:
JSON::Object::Ptr _val;
};
}
}
#endif // JSON_Object_INCLUDED

View File

@ -24,7 +24,7 @@ endif
all: libexecs tests samples
INSTALLDIR = $(DESTDIR)$(POCO_PREFIX)
COMPONENTS = Foundation XML Util Net Crypto NetSSL_OpenSSL Data Data/SQLite Data/ODBC Data/MySQL Zip PageCompiler PageCompiler/File2Page PDF CppParser
COMPONENTS = Foundation XML Util Net Crypto NetSSL_OpenSSL Data Data/SQLite Data/ODBC Data/MySQL Zip PageCompiler PageCompiler/File2Page PDF CppParser JSON
cppunit:
$(MAKE) -C $(POCO_BASE)/CppUnit
@ -44,9 +44,9 @@ install: libexecs
find $(POCO_BUILD)/lib -name "libPoco*" -type f -exec cp -f {} $(INSTALLDIR)/lib \;
find $(POCO_BUILD)/lib -name "libPoco*" -type l -exec cp -Rf {} $(INSTALLDIR)/lib \;
libexecs = Foundation-libexec XML-libexec Util-libexec Net-libexec Crypto-libexec NetSSL_OpenSSL-libexec Data-libexec Data/SQLite-libexec Data/ODBC-libexec Data/MySQL-libexec Zip-libexec PageCompiler-libexec PageCompiler/File2Page-libexec PDF-libexec CppParser-libexec
tests = Foundation-tests XML-tests Util-tests Net-tests Crypto-tests NetSSL_OpenSSL-tests Data-tests Data/SQLite-tests Data/ODBC-tests Data/MySQL-tests Zip-tests PDF-tests CppParser-tests
samples = Foundation-samples XML-samples Util-samples Net-samples Crypto-samples NetSSL_OpenSSL-samples Data-samples Zip-samples PageCompiler-samples PDF-samples
libexecs = Foundation-libexec XML-libexec Util-libexec Net-libexec Crypto-libexec NetSSL_OpenSSL-libexec Data-libexec Data/SQLite-libexec Data/ODBC-libexec Data/MySQL-libexec Zip-libexec PageCompiler-libexec PageCompiler/File2Page-libexec PDF-libexec CppParser-libexec JSON-libexec
tests = Foundation-tests XML-tests Util-tests Net-tests Crypto-tests NetSSL_OpenSSL-tests Data-tests Data/SQLite-tests Data/ODBC-tests Data/MySQL-tests Zip-tests PDF-tests CppParser-tests JSON-tests
samples = Foundation-samples XML-samples Util-samples Net-samples Crypto-samples NetSSL_OpenSSL-samples Data-samples Zip-samples PageCompiler-samples PDF-samples JSON-samples
.PHONY: $(libexecs)
.PHONY: $(tests)
@ -170,6 +170,15 @@ CppParser-libexec: Foundation-libexec
CppParser-tests: CppParser-libexec
$(MAKE) -C $(POCO_BASE)/CppParser/testsuite
JSON-libexec: Foundation-libexec
$(MAKE) -C $(POCO_BASE)/JSON
#JSON-tests: JSON-libexec cppunit
# $(MAKE) -C $(POCO_BASE)/JSON/testsuite
#JSON-samples: JSON-libexec
# $(MAKE) -C $(POCO_BASE)/JSON/samples
clean:
$(MAKE) -C $(POCO_BASE)/Foundation clean
@ -211,6 +220,9 @@ clean:
$(MAKE) -C $(POCO_BASE)/CppParser clean
$(MAKE) -C $(POCO_BASE)/CppParser/testsuite clean
$(MAKE) -C $(POCO_BASE)/CppUnit clean
$(MAKE) -C $(POCO_BASE)/JSON clean
$(MAKE) -C $(POCO_BASE)/JSON/testsuite clean
$(MAKE) -C $(POCO_BASE)/JSON/samples clean
distclean:
rm -rf $(POCO_BUILD)/lib

View File

@ -17,4 +17,4 @@ PDF
CppParser
PocoDoc
ProGen
JSON