mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-20 22:31:31 +02:00
porting JSON to the Dynamic::Var
added to JSON to gmake build
This commit is contained in:
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
#include "Poco/JSON/JSON.h"
|
#include "Poco/JSON/JSON.h"
|
||||||
#include "Poco/SharedPtr.h"
|
#include "Poco/SharedPtr.h"
|
||||||
#include "Poco/DynamicAny.h"
|
#include "Poco/Dynamic/Var.h"
|
||||||
|
|
||||||
namespace Poco
|
namespace Poco
|
||||||
{
|
{
|
||||||
@@ -214,15 +214,18 @@ inline void Array::remove(unsigned int index)
|
|||||||
namespace Poco
|
namespace Poco
|
||||||
{
|
{
|
||||||
|
|
||||||
|
namespace Dynamic
|
||||||
|
{
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class DynamicAnyHolderImpl<JSON::Array::Ptr>: public DynamicAnyHolder
|
class VarHolderImpl<JSON::Array::Ptr>: public VarHolder
|
||||||
{
|
{
|
||||||
public:
|
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();
|
throw BadCastException();
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicAnyHolder* clone() const
|
VarHolder* clone() const
|
||||||
{
|
{
|
||||||
return new DynamicAnyHolderImpl(_val);
|
return new VarHolderImpl(_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
const JSON::Array::Ptr& value() const
|
const JSON::Array::Ptr& value() const
|
||||||
@@ -352,6 +355,7 @@ private:
|
|||||||
JSON::Array::Ptr _val;
|
JSON::Array::Ptr _val;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // Namespace Dynamic
|
||||||
} // Namespace Poco
|
} // Namespace Poco
|
||||||
|
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include "Poco/SharedPtr.h"
|
#include "Poco/SharedPtr.h"
|
||||||
#include "Poco/DynamicAny.h"
|
#include "Poco/Dynamic/Var.h"
|
||||||
|
|
||||||
#include "Poco/JSON/JSON.h"
|
#include "Poco/JSON/JSON.h"
|
||||||
#include "Poco/JSON/Array.h"
|
#include "Poco/JSON/Array.h"
|
||||||
@@ -216,15 +216,18 @@ inline void Object::remove(const std::string& key)
|
|||||||
namespace Poco
|
namespace Poco
|
||||||
{
|
{
|
||||||
|
|
||||||
|
namespace Dynamic
|
||||||
|
{
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class DynamicAnyHolderImpl<JSON::Object::Ptr>: public DynamicAnyHolder
|
class VarHolderImpl<JSON::Object::Ptr>: public VarHolder
|
||||||
{
|
{
|
||||||
public:
|
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();
|
//TODO: ts = _val.timestamp();
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicAnyHolder* clone() const
|
VarHolderImpl* clone() const
|
||||||
{
|
{
|
||||||
return new DynamicAnyHolderImpl(_val);
|
return new VarHolderImpl(_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
const JSON::Object::Ptr& value() const
|
const JSON::Object::Ptr& value() const
|
||||||
@@ -354,6 +357,7 @@ private:
|
|||||||
JSON::Object::Ptr _val;
|
JSON::Object::Ptr _val;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // JSON_Object_INCLUDED
|
#endif // JSON_Object_INCLUDED
|
||||||
|
20
Makefile
20
Makefile
@@ -24,7 +24,7 @@ endif
|
|||||||
all: libexecs tests samples
|
all: libexecs tests samples
|
||||||
|
|
||||||
INSTALLDIR = $(DESTDIR)$(POCO_PREFIX)
|
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:
|
cppunit:
|
||||||
$(MAKE) -C $(POCO_BASE)/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 f -exec cp -f {} $(INSTALLDIR)/lib \;
|
||||||
find $(POCO_BUILD)/lib -name "libPoco*" -type l -exec cp -Rf {} $(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
|
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
|
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
|
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: $(libexecs)
|
||||||
.PHONY: $(tests)
|
.PHONY: $(tests)
|
||||||
@@ -170,6 +170,15 @@ CppParser-libexec: Foundation-libexec
|
|||||||
CppParser-tests: CppParser-libexec
|
CppParser-tests: CppParser-libexec
|
||||||
$(MAKE) -C $(POCO_BASE)/CppParser/testsuite
|
$(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:
|
clean:
|
||||||
$(MAKE) -C $(POCO_BASE)/Foundation clean
|
$(MAKE) -C $(POCO_BASE)/Foundation clean
|
||||||
@@ -211,6 +220,9 @@ clean:
|
|||||||
$(MAKE) -C $(POCO_BASE)/CppParser clean
|
$(MAKE) -C $(POCO_BASE)/CppParser clean
|
||||||
$(MAKE) -C $(POCO_BASE)/CppParser/testsuite clean
|
$(MAKE) -C $(POCO_BASE)/CppParser/testsuite clean
|
||||||
$(MAKE) -C $(POCO_BASE)/CppUnit 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:
|
distclean:
|
||||||
rm -rf $(POCO_BUILD)/lib
|
rm -rf $(POCO_BUILD)/lib
|
||||||
|
@@ -17,4 +17,4 @@ PDF
|
|||||||
CppParser
|
CppParser
|
||||||
PocoDoc
|
PocoDoc
|
||||||
ProGen
|
ProGen
|
||||||
|
JSON
|
||||||
|
Reference in New Issue
Block a user