Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added example for sorting keys #1421

Merged
merged 2 commits into from
Feb 6, 2019

Conversation

sekyHC
Copy link
Contributor

@sekyHC sekyHC commented Dec 4, 2018

We needed a way to sort keys and lost a day to find out how to do it. That is why we are contributing back to this awesome library with an example

@coveralls
Copy link

coveralls commented Dec 4, 2018

Coverage Status

Coverage remained the same at 99.921% when pulling d018846 on HomeControlAS:sort_by_name_example into 30d92a6 on Tencent:master.

using namespace rapidjson;
using namespace std;

void printIt(Document &doc)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const Value& is sufficient

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good info 👍

@@ -0,0 +1,70 @@
#define RAPIDJSON_HAS_STDSTRING 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may be better to have this example without using std::string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed std::string

@miloyip
Copy link
Collaborator

miloyip commented Dec 10, 2018

It still cannot compile. Due to not supporting pre-C++11?

@sekyHC
Copy link
Contributor Author

sekyHC commented Dec 10, 2018

I am compiling it as per instructions here: https://github.com/Tencent/rapidjson#installation

output:

 ~/s/rapidjson   sort_by_name_example  build  make                                                                                               10:30
[  2%] Built target simplepullreader
[  5%] Built target tutorial
[  7%] Built target jsonx
[ 10%] Built target pretty
Scanning dependencies of target sortkeys
[ 11%] Building CXX object example/CMakeFiles/sortkeys.dir/sortkeys/sortkeys.cpp.o
[ 12%] Linking CXX executable ../bin/sortkeys
[ 12%] Built target sortkeys
[ 15%] Built target condense
[ 17%] Built target simpledom
[ 20%] Built target messagereader
[ 23%] Built target simplewriter
[ 25%] Built target filterkeydom
[ 28%] Built target filterkey
[ 30%] Built target lookaheadparser
[ 33%] Built target capitalize
[ 35%] Built target parsebyparts
[ 38%] Built target prettyauto
[ 41%] Built target schemavalidator
[ 43%] Built target simplereader
[ 46%] Built target serialize
[ 46%] Built target examples
[ 50%] Built target archivertest
[ 52%] Built target namespacetest
[ 55%] Built target gtest
[ 57%] Built target gtest_main
[ 92%] Built target unittest
[100%] Built target perftest
[100%] Built target tests

@miloyip miloyip merged commit 1892013 into Tencent:master Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants