-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from Biglup/feat/add-json-writer
- Loading branch information
Showing
18 changed files
with
5,311 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
Next | ||
Next (V1.1.0) | ||
--------------------- | ||
- First release of cardano-c | ||
- Added `cardano_json_writer_t` to write JSON to a buffer. | ||
|
||
V1.0.0 | ||
--------------------- | ||
- First release of cardano-c | ||
- Address Parsing & Generation | ||
- Ed25519 Cryptography | ||
- Transaction Serialization & Deserialization | ||
- Powerful Transaction Builder | ||
- Full Conway era support, including registering DReps, voting on proposals, and submitting proposals. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
VERSION_MAJOR=1 | ||
VERSION_MINOR=0 | ||
VERSION_MINOR=1 | ||
VERSION_PATCH=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
JSON | ||
========================== | ||
|
||
JavaScript Object Notation (`JSON`_) is a text-based data serialization format that is widely used for its simplicity and readability. JSON's design is particularly suited for applications where human-readable structured data is required, making it a preferred choice for data interchange and configuration formats. | ||
|
||
This section of the documentation provides detailed information on each function offered by this library to both generate and parse `JSON`_ encoded data: | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
./json_writer | ||
./json_context | ||
./json_format | ||
|
||
.. _JSON: https://www.json.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
JSON Context | ||
========================== | ||
|
||
.. doxygenenum:: cardano_json_context_t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
JSON Format | ||
========================== | ||
|
||
.. doxygenenum:: cardano_json_format_t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
JSON Writer | ||
========================== | ||
|
||
.. doxygentypedef:: cardano_json_writer_t | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_new | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_property_name | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_bool | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_null | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_bigint | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_start_array | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_end_array | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_start_object | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_end_object | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_raw_value | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_uint | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_signed_int | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_double | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_write_string | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_get_context | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_get_encoded_size | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_encode | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_encode_in_buffer | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_reset | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_unref | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_ref | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_refcount | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_set_last_error | ||
|
||
------------ | ||
|
||
.. doxygenfunction:: cardano_json_writer_get_last_error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
* \file json_context.h | ||
* | ||
* \author angel.castillo | ||
* \date Dec 06, 2024 | ||
* | ||
* Copyright 2024 Biglup Labs | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef BIGLUP_LABS_INCLUDE_CARDANO_JSON_CONTEXT_H | ||
#define BIGLUP_LABS_INCLUDE_CARDANO_JSON_CONTEXT_H | ||
|
||
/* INCLUDES ******************************************************************/ | ||
|
||
#include <cardano/export.h> | ||
|
||
/* DECLARATIONS **************************************************************/ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif /* __cplusplus */ | ||
|
||
/** | ||
* \brief Enum representing the current context of the JSON writer. | ||
* | ||
* This enum defines the possible states of the JSON writer, indicating | ||
* whether it is at the root level, inside an object, or inside an array. | ||
*/ | ||
typedef enum | ||
{ | ||
/** | ||
* \brief The writer is at the root level (no context set). | ||
*/ | ||
CARDANO_JSON_CONTEXT_ROOT = 0, | ||
|
||
/** | ||
* \brief The writer is inside an object context. | ||
*/ | ||
CARDANO_JSON_CONTEXT_OBJECT = 1, | ||
|
||
/** | ||
* \brief The writer is inside an array context. | ||
*/ | ||
CARDANO_JSON_CONTEXT_ARRAY = 2 | ||
|
||
} cardano_json_context_t; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif /* __cplusplus */ | ||
|
||
#endif // BIGLUP_LABS_INCLUDE_CARDANO_JSON_CONTEXT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* \file json_format.h | ||
* | ||
* \author angel.castillo | ||
* \date Dec 06, 2024 | ||
* | ||
* Copyright 2024 Biglup Labs | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef BIGLUP_LABS_INCLUDE_CARDANO_JSON_FORMAT_H | ||
#define BIGLUP_LABS_INCLUDE_CARDANO_JSON_FORMAT_H | ||
|
||
/* INCLUDES ******************************************************************/ | ||
|
||
#include <cardano/export.h> | ||
|
||
/* DECLARATIONS **************************************************************/ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif /* __cplusplus */ | ||
|
||
/** | ||
* \brief Enum representing the format of the JSON output. | ||
* | ||
* This enum defines the possible formats for the JSON output, indicating | ||
* whether it should be compact (no extra spaces or line breaks) or pretty | ||
* (extra spaces and line breaks for readability). | ||
*/ | ||
typedef enum | ||
{ | ||
/** | ||
* \brief Compact JSON format (no extra spaces or line breaks). | ||
*/ | ||
CARDANO_JSON_FORMAT_COMPACT, | ||
|
||
/** | ||
* \brief Pretty JSON format (extra spaces and line breaks for readability). | ||
*/ | ||
CARDANO_JSON_FORMAT_PRETTY | ||
|
||
} cardano_json_format_t; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif /* __cplusplus */ | ||
|
||
#endif // BIGLUP_LABS_INCLUDE_CARDANO_JSON_FORMAT_H |
Oops, something went wrong.