-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 2517: add xslt render lib in cloud storage #2659
base: main
Are you sure you want to change the base?
Issue 2517: add xslt render lib in cloud storage #2659
Conversation
Hi! Thank you for contributing! |
@@ -0,0 +1,43 @@ | |||
#include "xslt-render.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
мы дефис в именах файлов не используем, используем _
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
исправил
return out.Str(); | ||
} | ||
|
||
void TestAddChilds(auto&& name, auto&& value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Childs -> Children
и не вижу поводов передавать rvalue reference - почему бы не сделать так, как мы в остальном коде делаем - pass by value, а дальше std::move
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это не rvalue, а forward reference
childs на children заменил
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
Y_UNIT_TEST_SUITE(XsltRenderTest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TXsltRenderTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
переименовал
@@ -0,0 +1,37 @@ | |||
#pragma once | |||
|
|||
#ifdef THROW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
если от этих дефайнов вообще никак невозможно избавиться, то нужно их спрятать в xml_document.cpp, чтобы они через хедер не проникали в остальной наш код
сделать TXmlNodeWrapper через какой-нибудь pimpl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну там проблема как раз в том, что есть хедеры, которые инклудят конфиги и вот это defs.h, где внутри тот же макрос THROW, поэтому раз я хочу использовать xml-document, то мне надо убрать макрос именно в хедере
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я могу конечно написать враппер для работы со всей либой cpp/xml/document, но звучит хуже, чем эта кучка ифдефов
xmlCleanupGlobals(); | ||
xmlCleanupParser(); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
пустой строки не хватает после };
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
добавил
|
||
#include "xml-document.h" | ||
|
||
#include <contrib/libs/libxml/include/libxml/globals.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
опять же лучше сделать через pimpl, чтоб этих жутких хедеров не было в наших хедерах - чтоб они в остальной код через include-ы не заезжали
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сделал
class TXmlNodeWrapper final | ||
{ | ||
public: | ||
enum ESource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum class?
|
||
explicit TXmlNodeWrapper(std::unique_ptr<TData> data); | ||
|
||
std::unique_ptr<TData> Data = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
явно инициализировать кажется нет смысла
#2517
часть от пр #2588
здесь создание либы для генерации xml
добавил тесты (тест кейс взял из репы либы https://github.com/GNOME/libxslt/blob/master/tests/REC/test-12.2-1.out)
добавил структуру TXslRenderer, чтобы можно было один раз передать и распрасить xslt