8000 Renamed JsonHashTable into JsonObject · rprand/ArduinoJson@b75d32e · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit b75d32e

Browse files
committed
Renamed JsonHashTable into JsonObject
1 parent daa62b3 commit b75d32e

12 files changed

+45
-47
lines changed

JsonParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// This file is here to help the Arduino IDE find the .cpp files
77

88
#include "JsonParser/JsonArray.cpp"
9-
#include "JsonParser/JsonHashTable.cpp"
9+
#include "JsonParser/JsonObject.cpp"
1010
#include "JsonParser/JsonParserBase.cpp"
1111
#include "JsonParser/JsonValue.cpp"
1212
#include "JsonParser/JsonToken.cpp"

JsonParser/JsonArray.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
*/
55

66
#include "JsonArray.h"
7-
#include "JsonHashTable.h"
7+
#include "JsonObject.h"
88

99
using namespace ArduinoJson::Parser;
1010
using namespace ArduinoJson::Internal;
1111

12-
DEPRECATED JsonHashTable JsonArray::getHashTable(int index)
12+
DEPRECATED JsonObject JsonArray::getHashTable(int index)
1313
{
14-
return (JsonHashTable) (*this)[index];
14+
return (JsonObject) (*this)[index];
1515
}
1616

1717
/*

JsonParser/JsonArray.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace ArduinoJson
1313
{
1414
namespace Parser
1515
{
16-
class JsonHashTable;
16+
class JsonObject;
1717

1818
class JsonArray
1919
{
@@ -73,7 +73,7 @@ namespace ArduinoJson
7373
return (double) (*this)[index];
7474
}
7575

76-
DEPRECATED JsonHashTable getHashTable(int index);
76+
DEPRECATED JsonObject getHashTable(int index);
7777

7878
DEPRECATED long getLong(int index)
7979
{

JsonParser/JsonArrayIterator.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ namespace ArduinoJson
1212
{
1313
namespace Parser
1414
{
15-
class JsonHashTable;
16-
1715
class JsonArrayIterator
1816
{
1917
public:

JsonParser/JsonHashTable.cpp renamed to JsonParser/JsonObject.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
*/
55

66
#include <string.h> // for strcmp()
7-
#include "JsonHashTable.h"
87
#include "JsonArray.h"
8+
#include "JsonObject.h"
99
#include "JsonValue.h"
1010

1111
using namespace ArduinoJson::Parser;
1212
using namespace ArduinoJson::Internal;
1313

14-
DEPRECATED JsonArray JsonHashTable::getArray(const char* key)
14+
DEPRECATED JsonArray JsonObject::getArray(const char* key)
1515
{
1616
return (*this)[key];
1717
}
1818

1919
/*
2020
* Returns the token for the value associated with the specified key
2121
*/
22-
JsonValue JsonHashTable::getValue(const char* desiredKey)
22+
JsonValue JsonObject::getValue(const char* desiredKey)
2323
{
2424
// sanity check
2525
if (desiredKey == 0 || !token.isObject())

JsonParser/JsonHashTable.h renamed to JsonParser/JsonObject.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ namespace ArduinoJson
1313
{
1414
class JsonArray;
1515

16-
class JsonHashTable
16+
class JsonObject
1717
{
18-
friend class JsonValue;
19-
2018
public:
2119

22-
JsonHashTable()
20+
JsonObject(char* json, Internal::JsonToken token)
21+
: json(json), token(token)
22+
{
23+
24+
}
25+
26+
JsonObject()
2327
: token(Internal::JsonToken::null())
2428
{
2529
}
@@ -51,7 +55,7 @@ namespace ArduinoJson
5155
return getValue(key);
5256
}
5357

54-
DEPRECATED JsonHashTable getHashTable(const char* key)
58+
DEPRECATED JsonObject getHashTable(const char* key)
5559
{
5660
return getValue(key);
5761
}
@@ -66,23 +70,19 @@ namespace ArduinoJson
6670
return getValue(key);
6771
}
6872

69-
static JsonHashTable null()
73+
static JsonObject null()
7074
{
71-
return JsonHashTable();
75+
return JsonObject();
7276
}
7377

7478
private:
7579

76-
JsonHashTable(char* json, Internal::JsonToken token)
77-
: json(json), token(token)
78-
{
79-
80-
}
81-
8280
char* json;
8381
Internal::JsonToken token;
8482

8583
JsonValue getValue(const char* key);
8684
};
85+
86+
typedef JsonObject JsonHashTable;
8787
}
8888
}

JsonParser/JsonParserBase.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
#pragma once
77

8-
#include "JsonHashTable.h"
98
#include "JsonArray.h"
9+
#include "JsonObject.h"
1010

1111
namespace ArduinoJson
1212
{
@@ -31,7 +31,7 @@ namespace ArduinoJson
3131
*/
3232
DEPRECATED JsonArray parseArray(char* json)
3333
{
34-
return (JsonArray)parse(json);
34+
return parse(json);
3535
}
3636

3737
/*
@@ -40,9 +40,9 @@ namespace ArduinoJson
4040
* The content of the string may be altered to add '\0' at the
4141
* end of string tokens
4242
*/
43-
DEPRECATED JsonHashTable parseHashTable(char* json)
43+
DEPRECATED JsonObject parseHashTable(char* json)
4444
{
45-
return (JsonHashTable)parse(json);
45+
return parse(json);
4646
}
4747

4848
private:

JsonParser/JsonValue.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <stdlib.h> // for strtol, strtod
77
#include "JsonArray.h"
8-
#include "JsonHashTable.h"
8+
#include "JsonObject.h"
99
#include "JsonValue.h"
1010

1111
using namespace ArduinoJson::Parser;
@@ -18,7 +18,7 @@ JsonValue JsonValue::operator[](int index)
1818

1919
JsonValue JsonValue::operator[](const char* key)
2020
{
21-
return JsonHashTable(json, token)[key];
21+
return JsonObject(json, token)[key];
2222
}
2323

2424
JsonValue::operator bool()
@@ -62,9 +62,9 @@ JsonValue::operator JsonArray()
6262
: JsonArray::null();
6363
}
6464

65-
JsonValue::operator JsonHashTable()
65+
JsonValue::operator JsonObject()
6666
{
6767
return token.isObject()
68-
? JsonHashTable(json, token)
69-
: JsonHashTable::null();
68+
? JsonObject(json, token)
69+
: JsonObject::null();
7070
}

JsonParser/JsonValue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace ArduinoJson
2222
namespace Parser
2323
{
2424
class JsonArray;
25-
class JsonHashTable;
25+
class JsonObject;
2626

2727
class JsonValue
2828
{
@@ -44,7 +44,7 @@ namespace ArduinoJson
4444
operator long();
4545
operator char*();
4646
operator JsonArray();
47-
operator JsonHashTable();
47+
operator JsonObject();
4848
JsonValue operator[](int index);
4949
JsonValue operator[](const char*key);
5050

0 commit comments

Comments
 (0)
0