lordoffox / ajson Goto Github PK
View Code? Open in Web Editor NEWa utility for serialize C++ and json。
License: Boost Software License 1.0
a utility for serialize C++ and json。
License: Boost Software License 1.0
warning: result of comparison of constant 239 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
if (buffer[0] == 0xEF && buffer[1] == 0xBB && buffer[2] == 0xBF)
`template<typename T, typename = void>
struct has_emplace_back : std::false_type {};
template
struct has_emplace_back <T, decltype(std::declval().emplace_back(), void())> : std::true_type {};`
替换你那个is_emplace_back_able数值型元函数可好?
如题,很多人习惯是下载release版本的。
release 崩溃,debug正常;
修改release下的makefile.release文件,去掉优化 也正常;
使用的是mingw 64-bit编译器。
另外出问题的只是结构体转json的功能,其它没测。该结构体只有int、double、string(非QString)类型。
示例中给出的
string_stream ss;
save_to(ss,obj);
经过我测试,使用std::stringstream,在release下程序不崩溃。
类似这种3.0000000000000001e-05的浮点数反序列化报错
ajson_string_stream构造函数内申请了空间,但没用memset把内存块的内容全部置0
Hello,
Added Conan package for your library: https://github.com/bincrafters/conan-ajson/tree/testing/0.2.1
请问, boost::ajson 报错,说 "boost"不明确 是怎么回事?
VS2013, 配置了boost, rapidjson也有.
错误 3 error C2440: “=”: 无法从“rapidjson::GenericMemberIterator<false,Encoding,Allocator>”转换为“rapidjson::GenericMember<Encoding,Allocator> *” c:\users\administrator\documents\visual studio 2013\projects\outsourcing.solutions\55likemw\cxtrademw\cxtradespiimpl.cpp 16 1 CXTradeMW
5 IntelliSense: "boost" 不明确 c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Outsourcing.Solutions\55LikeMW\CXTradeMW\CXTradeSpiImpl.cpp 12 17 CXTradeMW
6 IntelliSense: 不存在从 "rapidjson::GenericMemberIterator<false, rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>" 到 "rapidjson::GenericMember<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>> *" 的适当转换函数 c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Outsourcing.Solutions\55LikeMW\CXTradeMW\CXTradeSpiImpl.cpp 16 1 CXTradeMW
为了支持tsl::robin_map, 在ajson.hpp的158行,添加is_template_instant_of<tsl::robin_map, T>::value ||
编译报错:
src/ajson/ajson.hpp:158:47: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<class ...> class U, class T> struct ajson::detail::is_template_instant_of’
158 | is_template_instant_of<tsl::robin_map, T>::value ||
| ^
src/ajson/ajson.hpp:158:47: note: expected a template of type ‘template<class ...> class U’, got ‘template<class Key, class T, class Hash, class KeyEqual, class Allocator, bool StoreHash, class GrowthPolicy> class tsl::robin_map’
似乎是is_template_instant_of不支持模板里有非类型模板参数, 怎么办?
没有加入wstring的支持
namespace bb{
struct ABC{
long a,b;
};
AJSON(ABC,a,b)
}
QString name = "";
QString uuid = "";
QString groupId = "";
测试代码:
int main() { const char* json = "{ \"Name\" : \"Boo\", \"Age\" : 28}"; field_list list = split_fields(json); for (auto it: list) { char arr[20] = {0}; std::memcpy(arr, it.str, it.len); printf("char* %s\n", arr); } return 0; }
测试结果:
char* { char* Name" char* "Boo" char* "Age" char* 28}
问题:
Name中,没有包含开始的"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.