Skip to content

Commit

Permalink
Merge branch 'release/v0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
fktn-k committed Nov 19, 2023
2 parents 0b03184 + ba3fd37 commit 0c34ea4
Show file tree
Hide file tree
Showing 74 changed files with 2,461 additions and 1,645 deletions.
2 changes: 1 addition & 1 deletion .reuse/templates/fkYAML.commented.jinja2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// _______ __ __ __ _____ __ __ __
/// | __| |_/ | \_/ |/ _ \ / \/ \| | fkYAML: A C++ header-only YAML library
/// | __| _ < \_ _/| ___ | _ | |___ version 0.2.0
/// | __| _ < \_ _/| ___ | _ | |___ version 0.2.1
/// |__| |_| \__| |_| |_| |_|___||___|______| https://github.com/fktn-k/fkYAML
///
{% for copyright_line in copyright_lines %}
Expand Down
2 changes: 1 addition & 1 deletion .reuse/templates/fkYAML_support.jinja2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_______ __ __ __ _____ __ __ __
| __| |_/ | \_/ |/ _ \ / \/ \| | fkYAML: A C++ header-only YAML library (supporting code)
| __| _ < \_ _/| ___ | _ | |___ version 0.2.0
| __| _ < \_ _/| ___ | _ | |___ version 0.2.1
|__| |_| \__| |_| |_| |_|___||___|______| https://github.com/fktn-k/fkYAML

{% for copyright_line in copyright_lines %}
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [v0.2.1](https://github.com/fktn-k/fkYAML/releases/tag/v0.2.1) (2023-11-19)

[Full Changelog](https://github.com/fktn-k/fkYAML/compare/v0.2.0...v0.2.1)

- \#209 support escaped unicode [\#215](https://github.com/fktn-k/fkYAML/pull/215) ([fktn-k](https://github.com/fktn-k))
- \#209 Support unescaped UTF-8 input characters in deserialization [\#210](https://github.com/fktn-k/fkYAML/pull/210) ([fktn-k](https://github.com/fktn-k))
- \#207 Support markers for the end of directives/documents [\#208](https://github.com/fktn-k/fkYAML/pull/208) ([fktn-k](https://github.com/fktn-k))
- \#190 Support specialization of deserialization for a vector of user-defined type objects [\#203](https://github.com/fktn-k/fkYAML/pull/203) ([fktn-k](https://github.com/fktn-k))
- \#195 Implement insertion/extraction operators for basic\_node template class [\#201](https://github.com/fktn-k/fkYAML/pull/201) ([fktn-k](https://github.com/fktn-k))

- \#211 Fix indentation handling [\#213](https://github.com/fktn-k/fkYAML/pull/213) ([fktn-k](https://github.com/fktn-k))
- \#211 fixed bug in parsing single quoted strings [\#212](https://github.com/fktn-k/fkYAML/pull/212) ([fktn-k](https://github.com/fktn-k))
- \#205 Detect duplicate keys as an error [\#206](https://github.com/fktn-k/fkYAML/pull/206) ([fktn-k](https://github.com/fktn-k))
- \#200 Allow a space in unquoted strings [\#202](https://github.com/fktn-k/fkYAML/pull/202) ([fktn-k](https://github.com/fktn-k))

- Unified doxygen comment style [\#204](https://github.com/fktn-k/fkYAML/pull/204) ([fktn-k](https://github.com/fktn-k))

## [v0.2.0](https://github.com/fktn-k/fkYAML/releases/tag/v0.2.0) (2023-11-06)

[Full Changelog](https://github.com/fktn-k/fkYAML/compare/v0.1.3...v0.2.0)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.8)

project(
fkYAML
VERSION 0.2.0
VERSION 0.2.1
LANGUAGES CXX)

#############################################################
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CMAKE_SCRIPTS = $(shell find . -type f \( -name 'CMakeLists.txt' -o -name '*.cma
# target version definition
TARGET_MAJOR_VERSION := 0
TARGET_MINOR_VERSION := 2
TARGET_PATCH_VERSION := 0
TARGET_PATCH_VERSION := 1
TARGET_VERSION_FULL := $(TARGET_MAJOR_VERSION).$(TARGET_MINOR_VERSION).$(TARGET_PATCH_VERSION)
VERSION_MACRO_FILE := include/fkYAML/detail/macros/version_macros.hpp

Expand Down
2 changes: 1 addition & 1 deletion docs/mkdocs/docs/api/basic_node/begin.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ An iterator to the first element of a container node value (either sequence or m
fkyaml::node n = {"foo", "bar"};
// get an iterator to the first element.
fkyaml::node::iterator it = n.begin();
std::cout << fkyaml::node::serialize(*it) << std::endl;
std::cout << *it << std::endl;
return 0;
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/mkdocs/docs/api/basic_node/const_iterator.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This iterator type is commonly used for sequence and mapping container values.
const fkyaml::node sequence_node = {1, 2, 3};
// get an iterator to the first sequence element.
fkyaml::node::const_iterator it = sequence_node.begin();
std::cout << fkyaml::node::serialize(*it) << std::endl;
std::cout << *it << std::endl;
return 0;
};
```
Expand Down
17 changes: 9 additions & 8 deletions docs/mkdocs/docs/api/basic_node/constructor.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The resulting basic_node has the [`node_t::NULL_OBJECT`](node_t.md) type.
int main()
{
fkyaml::node n;
std::cout << fkyaml::node::serialize(n) << std::endl;
std::cout << n << std::endl;
return 0;
}
```
Expand Down Expand Up @@ -80,7 +80,7 @@ The resulting basic_node has a default value for the given type.
int main()
{
fkyaml::node n(fkyaml::node::node_t::INTEGER);
std::cout << fkyaml::node::serialize(n) << std::endl;
std::cout << n << std::endl;
return 0;
}
```
Expand Down Expand Up @@ -113,7 +113,7 @@ The resulting basic_node has the same type and value as `rhs`.
{
fkyaml::node n(fkyaml::node::node_t::BOOLEAN);
fkyaml::node n2(n);
std::cout << fkyaml::node::serialize(n) << std::endl;
std::cout << n << std::endl;
return 0;
}
```
Expand Down Expand Up @@ -147,7 +147,7 @@ The value of the argument `rhs` after calling this move constructor, will be the
{
fkyaml::node n(fkyaml::node::node_t::BOOLEAN);
fkyaml::node n2(n);
std::cout << fkyaml::node::serialize(n) << std::endl;
std::cout << n << std::endl;
return 0;
}
```
Expand Down Expand Up @@ -195,7 +195,7 @@ The resulting basic_node has the value of `val` and the type which is associated
{
double pi = 3.141592;
fkyaml::node n = pi;
std::cout << fkyaml::node::serialize(n) << std::endl;
std::cout << n << std::endl;
return 0;
}
```
Expand Down Expand Up @@ -241,7 +241,7 @@ The resulting basic_node has the value of the referenced basic_node by `node_ref
int main()
{
fkyaml::node n({true, false});
std::cout << fkyaml::node::serialize(n) << std::endl;
std::cout << n << std::endl;
return 0;
}
```
Expand Down Expand Up @@ -276,10 +276,10 @@ If `init` contains a sequence of basic_node objects in which the number of basic
int main()
{
fkyaml::node n = {true, false};
std::cout << fkyaml::node::serialize(n) << std::endl;
std::cout << n << std::endl;
fkyaml::node n2 = {"foo", 1024};
std::cout << fkyaml::node::serialize(n2) << std::endl;
std::cout << n2 << std::endl;
return 0;
}
```
Expand All @@ -297,3 +297,4 @@ If `init` contains a sequence of basic_node objects in which the number of basic
## **See Also**

* [basic_node](index.md)
* [operator<<](insertion_operator.md)
5 changes: 3 additions & 2 deletions docs/mkdocs/docs/api/basic_node/end.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ An iterator to the past-the-last element of a container node value (either seque
fkyaml::node::iterator it = n.end();
// decrement the iterator to point to the last element.
--it;
std::cout << fkyaml::node::serialize(*it) << std::endl;
std::cout << *it << std::endl;
return 0;
}
```
Expand All @@ -46,4 +46,5 @@ An iterator to the past-the-last element of a container node value (either seque
* [node](node.md)
* [iterator](iterator.md)
* [const_iterator](const_iterator.md)
* [begin](begin.md)
* [begin](begin.md)
* [operator<<](insertion_operator.md)
62 changes: 62 additions & 0 deletions docs/mkdocs/docs/api/basic_node/extraction_operator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<small>Defined in header [`<fkYAML/node.hpp>`](https://github.com/fktn-k/fkYAML/blob/develop/include/fkYAML/node.hpp)</small>

# <small>fkyaml::</small>operator>>

```cpp
inline std::istream& operator>>(std::istream& is, basic_node& n);
```

Insertion operator for basic_node template class.
Deserializes an input stream into a [`basic_node`](index.md).
This API is a wrapper of [`basic_node::deserialize()`](deserialize.md) function for input streams to simplify the implementation in the user's code.

## **Parameters**

***`is`*** [in]
: An input stream object.

***`n`*** [in]
: A basic_node object.

## **Return Value**

Reference to the input stream object `is`.

???+ Example

```yaml title="input.yaml"
foo: true
bar: 123
baz: 3.14
```

```cpp
#include <fstream>
#include <iostream>
#include <fkYAML/node.hpp>

int main()
{
std::ifstream ifs("input.yaml");
fkyaml::node n;
ifs >> n;

// print the deserialization result.
std::cout << n << std::endl;

return 0;
}
```

```yaml
foo: true
bar: 123
baz: 3.14
```

### **See Also**

* [basic_node](index.md)
* [deserialize](deserialize.md)
* [serialize](serialize.md)
* [operator<<](insertion_operator.md)
14 changes: 8 additions & 6 deletions docs/mkdocs/docs/api/basic_node/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ This class provides features to handle YAML nodes.
| [is_string](is_string.md) | checks if a basic_node has a string node value. |
### Conversions
| Name | | Description |
| --------------------------------- | -------- | ------------------------------------------------------------------ |
| [deserialize](deserialize.md) | (static) | deserializes a YAML formatted string into a basic_node. |
| [serialize](serialize.md) | (static) | serializes a basic_node into a YAML formatted string. |
| [get_value](get_value.md) | | converts a basic_node into a target native data type. |
| [get_value_ref](get_value_ref.md) | | converts a basic_node into reference to a target native data type. |
| Name | | Description |
| ------------------------------------ | -------- | ------------------------------------------------------------------ |
| [deserialize](deserialize.md) | (static) | deserializes a YAML formatted string into a basic_node. |
| [operator>>](extraction_operator.md) | | deserializes an input stream into a basic_node. |
| [serialize](serialize.md) | (static) | serializes a basic_node into a YAML formatted string. |
| [operator<<](insertion_operator.md) | | serializes a basic_node into an output stream. |
| [get_value](get_value.md) | | converts a basic_node into a target native data type. |
| [get_value_ref](get_value_ref.md) | | converts a basic_node into reference to a target native data type. |
### Iterators
| Name | Description |
Expand Down
93 changes: 93 additions & 0 deletions docs/mkdocs/docs/api/basic_node/insertion_operator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<small>Defined in header [`<fkYAML/node.hpp>`](https://github.com/fktn-k/fkYAML/blob/develop/include/fkYAML/node.hpp)</small>

# <small>fkyaml::</small>operator<<

```cpp
inline std::ostream& operator<<(std::ostream& os, const basic_node& n);
```

Extraction operator for basic_node template class.
Serializes YAML node values into an output stream.
This API is a wrapper of [`basic_node::serialize()`](serialize.md) function to simplify the implementation in the user's code.
For more detailed descriptions, please visit the reference page for the [`basic_node::serialize()`](serialize.md) function.

## **Template Parameters**

***SequenceType***
: Type for sequence node value containers.

***MappingType***
: Type for mapping node value containers.

***BooleanType***
: Type for boolean node values.

***IntegerType***
: Type for integer node values.

***FloatNumberType***
: Type for float number node values.

***StringType***
: Type for string node values.

***ConverterType***
: Type for converters between nodes and values of native data types.

## **Parameters**

***`os`*** [in]
: An output stream object.

***`n`*** [in]
: A basic_node object.

## **Return Value**

Reference to the output stream object `os`.

???+ Example

```cpp
#include <iostream>
#include <fkYAML/node.hpp>

int main()
{
// create a basic_node object.
fkyaml::node n = {
{"foo", true},
{"bar", {1, 2, 3}},
{"baz", {
{"qux", 3.14},
{"corge", nullptr}
}}
};

// serialize the basic_node object with insertion operator.
// this is equivalent with:
// std::cout << fkyaml::node::serialize(n) << std::endl;
std::cout << n << std::endl;

return 0;
}
```

output:
```yaml
foo: true
bar:
- 1
- 2
- 3
baz:
qux: 3.14
corge: null
```

### **See Also**

* [basic_node](index.md)
* [serialize](serialize.md)
* [deserialize](deserialize.md)
* [operator>>](extraction_operator.md)
3 changes: 2 additions & 1 deletion docs/mkdocs/docs/api/basic_node/iterator.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This iterator type is commonly used for sequence and mapping container values.
fkyaml::node sequence_node = {1, 2, 3};
// get an iterator to the first sequence element.
fkyaml::node::iterator it = sequence_node.begin();
std::cout << fkyaml::node::serialize(*it) << std::endl;
std::cout << *it << std::endl;
return 0;
};
```
Expand All @@ -37,3 +37,4 @@ This iterator type is commonly used for sequence and mapping container values.
* [basic_node](index.md)
* [begin](begin.md)
* [const_iterator](const_iterator.md)
* [operator<<](insertion_operator.md)
3 changes: 2 additions & 1 deletion docs/mkdocs/docs/api/basic_node/mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The resulting basic_node has the [`node_t::MAPPING`](node_t.md) type.
{"bar", 3.14}
};
fkyaml::node n = fkyaml::node::mapping(m);
std::cout << fkyaml::node::serialize(n) << std::endl;
std::cout << n << std::endl;
return 0;
}
```
Expand All @@ -41,3 +41,4 @@ The resulting basic_node has the [`node_t::MAPPING`](node_t.md) type.

* [basic_node](index.md)
* [node_t](node_t.md)
* [operator<<](insertion_operator.md)
5 changes: 3 additions & 2 deletions docs/mkdocs/docs/api/basic_node/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This type is the default specialization of the [basic_node](index.md) class whic
n["qux"]["key"] = {"another", "value"};

// output a YAML formatted string.
std::cout << fkyaml::node::serialize(n) << std::endl;
std::cout << n << std::endl;
};
```

Expand All @@ -51,4 +51,5 @@ This type is the default specialization of the [basic_node](index.md) class whic

### **See Also**

* [basic_node](index.md)
* [basic_node](index.md)
* [operator<<](insertion_operator.md)
Loading

0 comments on commit 0c34ea4

Please sign in to comment.