File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,20 +171,18 @@ namespace geode::format {
171171 friend class FormatterImpl ;
172172 };
173173
174- GEODE_DLL void registerFormatImpl (std::string_view name, std:: unique_ptr<FormatBase> format);
174+ GEODE_DLL void registerFormatImpl (std::unique_ptr<FormatBase> format);
175175 GEODE_DLL geode::Result<std::string> handleFormatImpl (cocos2d::CCObject const * obj, std::string_view specifier);
176176
177177 template <class T , typename F>
178178 inline void registerFormat (F&& callback) {
179- constexpr auto name = arc::getTypename<T>();
180-
181179 using Callback = typename FormatType<T>::FormatCallback;
182180
183181 if constexpr (std::is_invocable_r_v<std::string, F, T*, std::string_view>) {
184- registerFormatImpl (std::string_view{name. first , name. second }, std:: make_unique<FormatType<T>>(std::forward<F>(callback)));
182+ registerFormatImpl (std::make_unique<FormatType<T>>(std::forward<F>(callback)));
185183 }
186184 else if constexpr (std::is_invocable_r_v<std::string, F, T*>) {
187- registerFormatImpl (std::string_view{name. first , name. second }, std:: make_unique<FormatType<T>>(Callback (
185+ registerFormatImpl (std::make_unique<FormatType<T>>(Callback (
188186 [f = std::forward<F>(callback)](T* obj, std::string_view) {
189187 return f (obj);
190188 }
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class geode::format::FormatterImpl {
1313 return s_instance;
1414 }
1515
16- void addFormat (std::string_view name, std:: unique_ptr<FormatBase> format) {
16+ void addFormat (std::unique_ptr<FormatBase> format) {
1717 m_formatCallbacks.push_back (std::move (format));
1818 }
1919
@@ -27,8 +27,8 @@ class geode::format::FormatterImpl {
2727 }
2828};
2929
30- void geode::format::registerFormatImpl (std::string_view name, std:: unique_ptr<FormatBase> format) {
31- FormatterImpl::get ()->addFormat (name, std::move (format));
30+ void geode::format::registerFormatImpl (std::unique_ptr<FormatBase> format) {
31+ FormatterImpl::get ()->addFormat (std::move (format));
3232}
3333
3434geode::Result<std::string> geode::format::handleFormatImpl (cocos2d::CCObject const * obj, std::string_view specifier) {
You can’t perform that action at this time.
0 commit comments