资源简介
json.rar
代码片段和文件信息
#include “reader.h“
#include “value.h“
#include
#include
#include
#include
#include
#include
#if _MSC_VER >= 1400 // VC++ 8.0
#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated.
#endif
namespace Json {
static inline bool
in( Reader::Char c Reader::Char c1 Reader::Char c2 Reader::Char c3 Reader::Char c4 )
{
return c == c1 || c == c2 || c == c3 || c == c4;
}
static inline bool
in( Reader::Char c Reader::Char c1 Reader::Char c2 Reader::Char c3 Reader::Char c4 Reader::Char c5 )
{
return c == c1 || c == c2 || c == c3 || c == c4 || c == c5;
}
static bool
containsNewLine( Reader::Location begin
Reader::Location end )
{
for ( ;begin < end; ++begin )
if ( *begin == ‘\n‘ || *begin == ‘\r‘ )
return true;
return false;
}
// Class Reader
// //////////////////////////////////////////////////////////////////
Reader::Reader()
{
}
bool
Reader::parse( const std::string &document
Value &root
bool collectComments )
{
document_ = document;
const char *begin = document_.c_str();
const char *end = begin + document_.length();
return parse( begin end root collectComments );
}
bool
Reader::parse( std::istream& sin
Value &root
bool collectComments )
{
//std::istream_iterator begin(sin);
//std::istream_iterator end;
// Those would allow streamed input from a file if parse() were a
// template function.
// Since std::string is reference-counted this at least does not
// create an extra copy.
std::string doc;
std::getline(sin doc (char)EOF);
return parse( doc root collectComments );
}
bool
Reader::parse( const char *beginDoc const char *endDoc
Value &root
bool collectComments )
{
begin_ = beginDoc;
end_ = endDoc;
collectComments_ = collectComments;
current_ = begin_;
lastValueEnd_ = 0;
lastValue_ = 0;
commentsBefore_ = ““;
errors_.clear();
while ( !nodes_.empty() )
nodes_.pop();
nodes_.push( &root );
bool successful = readValue();
Token token;
skipCommentTokens( token );
if ( collectComments_ && !commentsBefore_.empty() )
root.setComment( commentsBefore_ commentAfter );
return successful;
}
bool
Reader::readValue()
{
Token token;
skipCommentTokens( token );
bool successful = true;
if ( collectComments_ && !commentsBefore_.empty() )
{
currentValue().setComment( commentsBefore_ commentBefore );
commentsBefore_ = ““;
}
switch ( token.type_ )
{
case tokenobjectBegin:
successful = readobject( token );
break;
case tokenArrayBegin:
successful = readArray( token );
break;
case tokenNumber:
successful = decodeNumber( token );
break;
case tokenString:
successful = decodeString( token );
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 457 2010-11-19 10:31 json\autoli
....... 1429 2010-11-19 10:31 json\config.h
....... 648 2010-11-19 10:31 json\forwards.h
....... 186 2010-11-19 10:31 json\json.h
....... 4054 2010-11-19 10:31 json\json_batchallocator.h
....... 13117 2010-11-19 10:31 json\json_internalarray.inl
....... 16899 2010-11-19 10:31 json\json_internalmap.inl
....... 17582 2010-11-19 10:31 json\json_reader.cpp
....... 40412 2010-11-19 10:31 json\json_value.cpp
....... 6592 2010-11-19 10:31 json\json_valueiterator.inl
....... 19957 2010-11-19 10:31 json\json_writer.cpp
....... 5947 2010-11-19 10:31 json\reader.h
....... 34630 2010-11-19 10:31 json\value.h
....... 6376 2010-11-19 10:31 json\writer.h
目录 0 2010-11-19 10:37 json
----------- --------- ---------- ----- ----
168286 15
相关资源
- bootstrap-table动态加载json数据并且支持
- win ce 5.0 json解析
- newtonsoft.json源码
- jsjq对json对象增,删,改,查操作
- OA人员选择模块Js+JSON
- LitJson源码--cs文件
- echarts地图扩展中国分区域geoJSON地图数
- ECharts3中国地图json文件及全国省的j
- Unity3D插件-- LitJson.dll
- arcgis api for js +json 实现热力图
- Jsoncpp_0.6rc2修改版
- TCP收发json. 客户端和服务端
- node.js实现简单登录和注册
- stm32_cjson_demo.rar
- echarts湖南省json地图包含个市,县地图
- JsonViewer
- channel_v3.json亲测可用
- form数据与json对象的互相转换(完整版
-
Jsonob
ject.dll - 全国各高校学科、专业的json数据
- 全国省市区json
- jsonEditor离线版
- sublime插件必需文件channel_v3.json
- echarts地图全国省份json资源JSON版本
- json数据的转换工具
- janssonAPI翻译
- 中国地图的JSON文件
- 添加jsonMine类型
- Echarts地图合并了静安区和闸北区后的
- echarts4地图数据文件(含全国和省js文
评论
共有 条评论