2010-10-24 02:21 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
* harbour/rtl/hbjson.c
+ added support for date and timestamp type encoding
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2010-10-24 02:21 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
|
||||
* harbour/rtl/hbjson.c
|
||||
+ added support for date and timestamp type encoding
|
||||
|
||||
2010-10-24 02:10 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
|
||||
* harbour/rtl/hbjson.c
|
||||
+ added human readable JSON encoding support
|
||||
|
||||
@@ -262,6 +262,23 @@ static void _hb_jsonEncode( PHB_ITEM pValue, PHB_JSON_ENCODE_CTX pCtx, HB_SIZE n
|
||||
_hb_jsonCtxAdd( pCtx, "false", 5 );
|
||||
|
||||
}
|
||||
else if( HB_IS_DATE( pValue ) )
|
||||
{
|
||||
char szBuffer[ 10 ];
|
||||
|
||||
hb_itemGetDS( pValue, szBuffer + 1 );
|
||||
szBuffer[ 0 ] = '\"';
|
||||
szBuffer[ 9 ] = '\"';
|
||||
_hb_jsonCtxAdd( pCtx, szBuffer, 10 );
|
||||
}
|
||||
else if( HB_IS_TIMESTAMP( pValue ) )
|
||||
{
|
||||
char szBuffer[ 19 ];
|
||||
hb_itemGetTS( pValue, szBuffer + 1 );
|
||||
szBuffer[ 0 ] = '\"';
|
||||
szBuffer[ 18 ] = '\"';
|
||||
_hb_jsonCtxAdd( pCtx, szBuffer, 19 );
|
||||
}
|
||||
else if( HB_IS_ARRAY( pValue ) )
|
||||
{
|
||||
HB_SIZE nLen = hb_itemSize( pValue );
|
||||
|
||||
Reference in New Issue
Block a user