summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-12-06 15:39:23 +0100
committerSimons Kevin <kevin.simons@nokia.com>2011-12-06 17:11:23 +0100
commit5b0dfd8e2b5ed8c40a4b2accd15b2848e2ffec06 (patch)
tree0eae5e30b8bb1beef2eac4e2782e3c3c287e1fb8
parentf71f7cefb666469fc91105d63fe23427c460e18c (diff)
Remove references to binary in the name
This will become more generic Json support for Qt once a parser is in place. No need to use 'binary' everywhere. Change-Id: I4289622c0fe600994f7b47855df7b3ae9cd52b52 Reviewed-by: Hicks James <jamey.hicks@nokia.com> Reviewed-by: Simons Kevin <kevin.simons@nokia.com>
-rw-r--r--src/qjson_p.h (renamed from src/qbinaryjson_p.h)12
-rw-r--r--src/qjsonarray.cpp (renamed from src/qbinaryjsonarray.cpp)12
-rw-r--r--src/qjsonarray.h (renamed from src/qbinaryjsonarray.h)10
-rw-r--r--src/qjsonglobal.h (renamed from src/qbinaryjsonglobal.h)8
-rw-r--r--src/qjsonobject.cpp (renamed from src/qbinaryjsonobject.cpp)10
-rw-r--r--src/qjsonobject.h (renamed from src/qbinaryjsonobject.h)10
-rw-r--r--src/qjsonvalue.cpp (renamed from src/qbinaryjsonvalue.cpp)12
-rw-r--r--src/qjsonvalue.h (renamed from src/qbinaryjsonvalue.h)10
-rw-r--r--src/src.pro18
-rw-r--r--tests/auto/auto.pro6
-rw-r--r--tests/auto/tst_qtjson.cpp (renamed from tests/auto/tst_qtbinaryjson.cpp)56
11 files changed, 82 insertions, 82 deletions
diff --git a/src/qbinaryjson_p.h b/src/qjson_p.h
index ef62d4d..909b335 100644
--- a/src/qbinaryjson_p.h
+++ b/src/qjson_p.h
@@ -1,8 +1,8 @@
-#ifndef QBINARYSJON_P_H
-#define QBINARYSJON_P_H
+#ifndef QJSON_P_H
+#define QJSON_P_H
-#include <qbinaryjsonglobal.h>
-#include <qbinaryjsonobject.h>
+#include <qjsonglobal.h>
+#include <qjsonobject.h>
#include <qbasicatomic.h>
#include <qstring.h>
@@ -53,7 +53,7 @@
we end up using roughly 1kb. The uncompressed text file used roughly 500 bytes.
*/
-namespace QtBinaryJson
+namespace QtJson
{
typedef uint offset;
@@ -336,4 +336,4 @@ struct Data {
}
-#endif // QBINARYSJON_P_H
+#endif // QJSON_P_H
diff --git a/src/qbinaryjsonarray.cpp b/src/qjsonarray.cpp
index bd391e6..a161066 100644
--- a/src/qbinaryjsonarray.cpp
+++ b/src/qjsonarray.cpp
@@ -1,12 +1,12 @@
-#include <qbinaryjsonobject.h>
-#include <qbinaryjsonvalue.h>
-#include <qbinaryjsonarray.h>
-#include <qbinaryjson_p.h>
-#include <qbinaryjsonvalue.h>
+#include <qjsonobject.h>
+#include <qjsonvalue.h>
+#include <qjsonarray.h>
+#include <qjson_p.h>
+#include <qjsonvalue.h>
#include <qstringlist.h>
-using namespace QtBinaryJson;
+using namespace QtJson;
JsonArray::JsonArray()
: d(0), a(0)
diff --git a/src/qbinaryjsonarray.h b/src/qjsonarray.h
index a379436..946040e 100644
--- a/src/qbinaryjsonarray.h
+++ b/src/qjsonarray.h
@@ -1,11 +1,11 @@
-#ifndef QBINARYJSONARRAY_H
-#define QBINARYJSONARRAY_H
+#ifndef QJSONARRAY_H
+#define QJSONARRAY_H
-#include <qbinaryjsonglobal.h>
+#include <qjsonglobal.h>
#include <qvariant.h>
class QStringList;
-namespace QtBinaryJson
+namespace QtJson
{
class JsonArray
@@ -52,4 +52,4 @@ private:
}
-#endif // QBINARYJSONARRAY_H
+#endif // QJSONARRAY_H
diff --git a/src/qbinaryjsonglobal.h b/src/qjsonglobal.h
index 70481aa..ee5ef82 100644
--- a/src/qbinaryjsonglobal.h
+++ b/src/qjsonglobal.h
@@ -1,10 +1,10 @@
-#ifndef QBINARYJSONGLOBAL_H
-#define QBINARYJSONGLOBAL_H
+#ifndef QJSONGLOBAL_H
+#define QJSONGLOBAL_H
#include <qglobal.h>
#include <qstring.h>
-namespace QtBinaryJson
+namespace QtJson
{
// ### FIXME
// namespace Private {
@@ -30,4 +30,4 @@ namespace QtBinaryJson
}
-#endif // QBINARYJSONGLOBAL_H
+#endif // QJSONGLOBAL_H
diff --git a/src/qbinaryjsonobject.cpp b/src/qjsonobject.cpp
index 5bbe0ac..377a596 100644
--- a/src/qbinaryjsonobject.cpp
+++ b/src/qjsonobject.cpp
@@ -1,10 +1,10 @@
-#include <qbinaryjsonobject.h>
-#include <qbinaryjsonvalue.h>
-#include <qbinaryjsonarray.h>
-#include <qbinaryjson_p.h>
+#include <qjsonobject.h>
+#include <qjsonvalue.h>
+#include <qjsonarray.h>
+#include <qjson_p.h>
#include <qstringlist.h>
-using namespace QtBinaryJson;
+using namespace QtJson;
JsonObject::JsonObject()
: d(0), o(0)
diff --git a/src/qbinaryjsonobject.h b/src/qjsonobject.h
index b8b5fc1..21152e8 100644
--- a/src/qbinaryjsonobject.h
+++ b/src/qjsonobject.h
@@ -1,10 +1,10 @@
-#ifndef QBINARYSJONOBJECT_H
-#define QBINARYSJONOBJECT_H
+#ifndef QJSONOBJECT_H
+#define QJSONOBJECT_H
-#include <qbinaryjsonglobal.h>
+#include <qjsonglobal.h>
#include <qvariant.h>
-namespace QtBinaryJson {
+namespace QtJson {
class JsonObject
{
@@ -54,4 +54,4 @@ private:
}
-#endif // QBINARYSJONOBJECT_H
+#endif // QJSONOBJECT_H
diff --git a/src/qbinaryjsonvalue.cpp b/src/qjsonvalue.cpp
index 6ca2dfe..2dc6008 100644
--- a/src/qbinaryjsonvalue.cpp
+++ b/src/qjsonvalue.cpp
@@ -1,13 +1,13 @@
-#include <qbinaryjsonobject.h>
-#include <qbinaryjsonvalue.h>
-#include <qbinaryjsonarray.h>
-#include <qbinaryjson_p.h>
-#include <qbinaryjsonarray.h>
+#include <qjsonobject.h>
+#include <qjsonvalue.h>
+#include <qjsonarray.h>
+#include <qjson_p.h>
+#include <qjsonarray.h>
#include <qvariant.h>
#include <qstringlist.h>
-using namespace QtBinaryJson;
+using namespace QtJson;
JsonValue::JsonValue()
: d(0), v(0)
diff --git a/src/qbinaryjsonvalue.h b/src/qjsonvalue.h
index 630419e..16e5da4 100644
--- a/src/qbinaryjsonvalue.h
+++ b/src/qjsonvalue.h
@@ -1,11 +1,11 @@
-#ifndef QBINARYJSONVALUE_H
-#define QBINARYJSONVALUE_H
+#ifndef QJSONVALUE_H
+#define QJSONVALUE_H
-#include <qbinaryjsonglobal.h>
+#include <qjsonglobal.h>
class QVariant;
-namespace QtBinaryJson {
+namespace QtJson {
class JsonValue {
public:
@@ -60,4 +60,4 @@ private:
};
}
-#endif // QBINARYJSONVALUE_H
+#endif // QJSONVALUE_H
diff --git a/src/src.pro b/src/src.pro
index 99fab0e..d9f906b 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -2,20 +2,20 @@ TEMPLATE = lib
QT = core
-TARGET = qtbinaryjson
+TARGET = qtjson
DESTDIR = ../lib
HEADERS += \
- qbinaryjson_p.h \
- qbinaryjsonobject.h \
- qbinaryjsonglobal.h \
- qbinaryjsonvalue.h \
- qbinaryjsonarray.h
+ qjson_p.h \
+ qjsonobject.h \
+ qjsonglobal.h \
+ qjsonvalue.h \
+ qjsonarray.h
SOURCES += \
- qbinaryjsonobject.cpp \
- qbinaryjsonarray.cpp \
- qbinaryjsonvalue.cpp
+ qjsonobject.cpp \
+ qjsonarray.cpp \
+ qjsonvalue.cpp
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index aab2ab0..745d82f 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -1,7 +1,7 @@
-TARGET = tst_qtbinaryjson
+TARGET = tst_qtjson
QT = core testlib
-SOURCES += tst_qtbinaryjson.cpp
-LIBS += -L../../lib -lqtbinaryjson
+SOURCES += tst_qtjson.cpp
+LIBS += -L../../lib -lqtjson
INCLUDEPATH += ../../src
QMAKE_LFLAGS += "-Wl,-rpath,$$PWD/../../lib"
diff --git a/tests/auto/tst_qtbinaryjson.cpp b/tests/auto/tst_qtjson.cpp
index 4b5cb79..87ddfa4 100644
--- a/tests/auto/tst_qtbinaryjson.cpp
+++ b/tests/auto/tst_qtjson.cpp
@@ -38,17 +38,17 @@
****************************************************************************/
#include <QtTest>
-#include "qbinaryjsonarray.h"
-#include "qbinaryjsonobject.h"
-#include "qbinaryjsonvalue.h"
+#include "qjsonarray.h"
+#include "qjsonobject.h"
+#include "qjsonvalue.h"
-using namespace QtBinaryJson;
+using namespace QtJson;
-class TestQtBinaryJson: public QObject
+class TestQtJson: public QObject
{
Q_OBJECT
public:
- TestQtBinaryJson(QObject *parent = 0);
+ TestQtJson(QObject *parent = 0);
private Q_SLOTS:
void initTestCase();
@@ -76,27 +76,27 @@ private Q_SLOTS:
void toJson();
};
-TestQtBinaryJson::TestQtBinaryJson(QObject *parent) : QObject(parent)
+TestQtJson::TestQtJson(QObject *parent) : QObject(parent)
{
}
-void TestQtBinaryJson::initTestCase()
+void TestQtJson::initTestCase()
{
}
-void TestQtBinaryJson::cleanupTestCase()
+void TestQtJson::cleanupTestCase()
{
}
-void TestQtBinaryJson::init()
+void TestQtJson::init()
{
}
-void TestQtBinaryJson::cleanup()
+void TestQtJson::cleanup()
{
}
-void TestQtBinaryJson::testValueSimple()
+void TestQtJson::testValueSimple()
{
JsonValue value(true);
QCOMPARE(value.toNumber(), 0.);
@@ -140,7 +140,7 @@ void TestQtBinaryJson::testValueSimple()
}
-void TestQtBinaryJson::testObjectSimple()
+void TestQtJson::testObjectSimple()
{
JsonObject object;
object.insert("number", 999.);
@@ -175,7 +175,7 @@ void TestQtBinaryJson::testObjectSimple()
QVERIFY2(object.value("string").toString() != before, "value should have been updated");
}
-void TestQtBinaryJson::testArraySimple()
+void TestQtJson::testArraySimple()
{
JsonArray array;
array.append(999.);
@@ -214,7 +214,7 @@ void TestQtBinaryJson::testArraySimple()
QCOMPARE(array.at(array.size()), JsonValue());
}
-void TestQtBinaryJson::testValueObject()
+void TestQtJson::testValueObject()
{
JsonObject object;
object.insert("number", 999.);
@@ -232,7 +232,7 @@ void TestQtBinaryJson::testValueObject()
QVERIFY2(value.toObject() != object, "object should have detached");
}
-void TestQtBinaryJson::testValueArray()
+void TestQtJson::testValueArray()
{
JsonArray array;
array.append(999.);
@@ -250,7 +250,7 @@ void TestQtBinaryJson::testValueArray()
QVERIFY2(value.toArray() != array, "array should have detached");
}
-void TestQtBinaryJson::testObjectNested()
+void TestQtJson::testObjectNested()
{
JsonObject inner, outer;
inner.insert("number", 999.);
@@ -287,7 +287,7 @@ void TestQtBinaryJson::testObjectNested()
true);
}
-void TestQtBinaryJson::testArrayNested()
+void TestQtJson::testArrayNested()
{
JsonArray inner, outer;
inner.append(999.);
@@ -321,7 +321,7 @@ void TestQtBinaryJson::testArrayNested()
QCOMPARE(outer.last().toArray().last().toArray().at(0).toString(), QString("nested"));
}
-void TestQtBinaryJson::testArrayNestedEmpty()
+void TestQtJson::testArrayNestedEmpty()
{
JsonObject object;
JsonArray inner;
@@ -337,7 +337,7 @@ void TestQtBinaryJson::testArrayNestedEmpty()
QCOMPARE(object.value("inner").toArray().size(), 0);
}
-void TestQtBinaryJson::testObjectNestedEmpty()
+void TestQtJson::testObjectNestedEmpty()
{
JsonObject object;
JsonObject inner;
@@ -360,7 +360,7 @@ void TestQtBinaryJson::testObjectNestedEmpty()
QCOMPARE(reconstituted.value("inner2").type(), ObjectValue);
}
-void TestQtBinaryJson::nullValues()
+void TestQtJson::nullValues()
{
JsonArray array;
array.append(JsonValue());
@@ -375,7 +375,7 @@ void TestQtBinaryJson::nullValues()
QCOMPARE(object.value("key"), JsonValue());
}
-void TestQtBinaryJson::nullArrays()
+void TestQtJson::nullArrays()
{
JsonArray nullArray;
JsonArray nonNull;
@@ -406,7 +406,7 @@ void TestQtBinaryJson::nullArrays()
QCOMPARE(nullArray, JsonArray());
}
-void TestQtBinaryJson::nullObject()
+void TestQtJson::nullObject()
{
JsonObject nullObject;
JsonObject nonNull;
@@ -438,7 +438,7 @@ void TestQtBinaryJson::nullObject()
}
-void TestQtBinaryJson::fromVariantMap()
+void TestQtJson::fromVariantMap()
{
QVariantMap map;
map.insert(QLatin1String("key1"), QLatin1String("value1"));
@@ -470,7 +470,7 @@ void TestQtBinaryJson::fromVariantMap()
QCOMPARE(array.at(3).toString(), QLatin1String("foo"));
}
-void TestQtBinaryJson::toVariantMap()
+void TestQtJson::toVariantMap()
{
JsonObject object;
object.insert("Key", QString("Value"));
@@ -496,7 +496,7 @@ void TestQtBinaryJson::toVariantMap()
QCOMPARE(list.at(3), QVariant());
}
-void TestQtBinaryJson::toJson()
+void TestQtJson::toJson()
{
JsonObject object;
object.insert("\\Key\n", QString("Value"));
@@ -528,6 +528,6 @@ void TestQtBinaryJson::toJson()
-QTEST_MAIN(TestQtBinaryJson)
-#include "tst_qtbinaryjson.moc"
+QTEST_MAIN(TestQtJson)
+#include "tst_qtjson.moc"