@@ -18,7 +18,7 @@ JsonHashTable::JsonHashTable(char* json, jsmntok_t* tokens)
18
18
/*
19
19
* Returns the token for the value associated with the specified key
20
20
*/
21
- jsmntok_t * JsonHashTable::getToken (char * desiredKey)
21
+ jsmntok_t * JsonHashTable::getToken (const char * desiredKey)
22
22
{
23
23
// sanity check
24
24
if (json == 0 || tokens == 0 || desiredKey == 0 )
@@ -48,37 +48,37 @@ jsmntok_t* JsonHashTable::getToken(char* desiredKey)
48
48
return 0 ;
49
49
}
50
50
51
- bool JsonHashTable::containsKey (char * key)
51
+ bool JsonHashTable::containsKey (const char * key)
52
52
{
53
53
return getToken (key) != 0 ;
54
54
}
55
55
56
- JsonArray JsonHashTable::getArray (char * key)
56
+ JsonArray JsonHashTable::getArray (const char * key)
57
57
{
58
58
return JsonArray (json, getToken (key));
59
59
}
60
60
61
- bool JsonHashTable::getBool (char * key)
61
+ bool JsonHashTable::getBool (const char * key)
62
62
{
63
63
return getBoolFromToken (getToken (key));
64
64
}
65
65
66
- double JsonHashTable::getDouble (char * key)
66
+ double JsonHashTable::getDouble (const char * key)
67
67
{
68
68
return getDoubleFromToken (getToken (key));
69
69
}
70
70
71
- JsonHashTable JsonHashTable::getHashTable (char * key)
71
+ JsonHashTable JsonHashTable::getHashTable (const char * key)
72
72
{
73
73
return JsonHashTable (json, getToken (key));
74
74
}
75
75
76
- long JsonHashTable::getLong (char * key)
76
+ long JsonHashTable::getLong (const char * key)
77
77
{
78
78
return getLongFromToken (getToken (key));
79
79
}
80
80
81
- char * JsonHashTable::getString (char * key)
81
+ char * JsonHashTable::getString (const char * key)
82
82
{
83
83
return getStringFromToken (getToken (key));
84
84
}
0 commit comments