-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding TOML format * Initial TOML writing * More tests * Remove duplicates * Added to.hpp to remove duplicate code * Removing duplicate filesystem_path logic * Fix nested TOML output * More TOML write tests * Update toml_test.cpp
- Loading branch information
1 parent
fa4baa5
commit b45d81d
Showing
14 changed files
with
908 additions
and
120 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
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
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,42 @@ | ||
// Glaze Library | ||
// For the license information refer to glaze.hpp | ||
|
||
#pragma once | ||
|
||
#include "glaze/core/common.hpp" | ||
#include "glaze/core/opts.hpp" | ||
|
||
// Common behavior for `to` specializations, typically applies for all formats | ||
|
||
namespace glz::detail | ||
{ | ||
template <uint32_t Format> | ||
struct to<Format, hidden> | ||
{ | ||
template <auto Opts> | ||
static void op(auto&& value, auto&&...) noexcept | ||
{ | ||
static_assert(false_v<decltype(value)>, "hidden type should not be written"); | ||
} | ||
}; | ||
|
||
template <uint32_t Format> | ||
struct to<Format, skip> | ||
{ | ||
template <auto Opts> | ||
static void op(auto&& value, auto&&...) noexcept | ||
{ | ||
static_assert(false_v<decltype(value)>, "skip type should not be written"); | ||
} | ||
}; | ||
|
||
template <uint32_t Format, filesystem_path T> | ||
struct to<Format, T> | ||
{ | ||
template <auto Opts, class... Args> | ||
static void op(auto&& value, is_context auto&& ctx, Args&&... args) | ||
{ | ||
to<Format, decltype(value.string())>::template op<Opts>(value.string(), ctx, std::forward<Args>(args)...); | ||
} | ||
}; | ||
} |
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
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,6 @@ | ||
// Glaze Library | ||
// For the license information refer to glaze.hpp | ||
|
||
#pragma once | ||
|
||
#include "glaze/toml/write.hpp" |
Oops, something went wrong.