https://github.com/SanaeProject/Json-for-cpp
https://github.com/SanaeProject/Json-for-cpp
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/SanaeProject/Json-for-cpp
- Owner: SanaeProject
- License: apache-2.0
- Archived: true
- Created: 2023-10-09T08:25:11.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-09T11:35:05.000Z (over 1 year ago)
- Last Synced: 2025-02-24T06:15:38.176Z (3 months ago)
- Language: C++
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Json for CPP
Reads data in json format and returns the value!Website: http://sanae.starfree.jp
Author: SanaeProject# Coding Convention
//Comment
ReturnClass Func
(
Argument1,
Argument2,
...
)
{
//Process
}# Declearation
namespace Sanae{
class json;
}# Sample code
## test.json{
"SanaeProject": {
"Version": 1,
"Author": [ "SanaeProject", "Huku" ],
"copyright": null
}
}## test.cpp
#include
#include "json.hpp"int main() {
Sanae::json hello("test.json");
printf("Version:%d\n",std::stoi(hello["SanaeProject::Version"])); //1
printf("Author:%s\n", hello["SanaeProject::Author[1]"].c_str()); //Huku
printf("Author:%s\n", hello["SanaeProject::copyright"].c_str()); //nullreturn 0;
}