From c7c60c8c77c5f8fdbd8bdb42fc5c56a14f506537 Mon Sep 17 00:00:00 2001 From: kmc7468 Date: Tue, 17 Mar 2020 22:34:14 +0900 Subject: [PATCH] =?UTF-8?q?SpaicCSS=20=EB=AA=A8=EB=93=88=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/spaic-css/CSS.hpp | 4 ++-- include/spaic-css/CssProperty.hpp | 3 ++- include/spaic-css/Unit.hpp | 6 ++++-- include/spaic-css/detail/CSS.hpp | 8 +++++++- include/spaic-css/detail/CssProperty.hpp | 5 ++--- include/spaic-css/detail/Unit.hpp | 9 +++++++++ 6 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 include/spaic-css/detail/Unit.hpp diff --git a/include/spaic-css/CSS.hpp b/include/spaic-css/CSS.hpp index f661ea1..708594f 100644 --- a/include/spaic-css/CSS.hpp +++ b/include/spaic-css/CSS.hpp @@ -5,9 +5,9 @@ namespace spaic::css { template -Stylesheet css(T... params); +Stylesheet css(T&&... params); template -Stylesheet keyframes(T... params); +Stylesheet keyframes(T&&... params); } // namespace spaic::css #include \ No newline at end of file diff --git a/include/spaic-css/CssProperty.hpp b/include/spaic-css/CssProperty.hpp index 12f6093..4a7b2d2 100644 --- a/include/spaic-css/CssProperty.hpp +++ b/include/spaic-css/CssProperty.hpp @@ -11,7 +11,8 @@ template class CssProperty { public: - AssignedCssProperty operator=(T value); + template + AssignedCssProperty operator=(U&& value); }; } // namespace spaic::css::prop diff --git a/include/spaic-css/Unit.hpp b/include/spaic-css/Unit.hpp index 0ea99c0..06c7599 100644 --- a/include/spaic-css/Unit.hpp +++ b/include/spaic-css/Unit.hpp @@ -58,7 +58,7 @@ class CssUnit long double value; public: - CssUnit(long double value) noexcept : value(value) {} + CssUnit(long double value) noexcept; std::string toCssValue(); }; @@ -99,4 +99,6 @@ defineUnitUDL(percent); } // namespace spaic::css::unit #undef defineUnitUDLRaw -#undef defineUnitUDL \ No newline at end of file +#undef defineUnitUDL + +#include \ No newline at end of file diff --git a/include/spaic-css/detail/CSS.hpp b/include/spaic-css/detail/CSS.hpp index cb4640e..bde1c6a 100644 --- a/include/spaic-css/detail/CSS.hpp +++ b/include/spaic-css/detail/CSS.hpp @@ -5,9 +5,15 @@ namespace spaic::css { template -Stylesheet css(T... params) +Stylesheet css(T&&... params) { // TODO: css(params) return Stylesheet(); } +template +Stylesheet keyframes(T&&... params) +{ + // TODO: keyframes(params) + return Stylesheet(); +} } // namespace spaic::css diff --git a/include/spaic-css/detail/CssProperty.hpp b/include/spaic-css/detail/CssProperty.hpp index 09fa61e..fd8947c 100644 --- a/include/spaic-css/detail/CssProperty.hpp +++ b/include/spaic-css/detail/CssProperty.hpp @@ -4,11 +4,10 @@ namespace spaic::css::prop { - template -AssignedCssProperty CssProperty::operator=(T value) +template +AssignedCssProperty CssProperty::operator=(U&& value) { return AssignedCssProperty(); } - } // namespace spaic::css::prop \ No newline at end of file diff --git a/include/spaic-css/detail/Unit.hpp b/include/spaic-css/detail/Unit.hpp new file mode 100644 index 0000000..5787d1d --- /dev/null +++ b/include/spaic-css/detail/Unit.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include + +namespace spaic::css::unit +{ + template + CssUnit::CssUnit(long double value) noexcept : value(value) {} +} // namespace spaic::css::unit