aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/xml/document/xml-document-decl.h
diff options
context:
space:
mode:
authorartyasen <artyasen@yandex-team.com>2025-02-03 15:57:35 +0300
committerartyasen <artyasen@yandex-team.com>2025-02-03 16:35:09 +0300
commita19aaf0e98329e8fff4e16626c2f8212f7d87789 (patch)
treeb262bcd535c5f29e36b701c95fa91c8beb32fcb6 /library/cpp/xml/document/xml-document-decl.h
parentcafd6740c55721b602590b6371e271bb41355e36 (diff)
downloadydb-a19aaf0e98329e8fff4e16626c2f8212f7d87789.tar.gz
Получение XML аттрибута без исключений
add no exception methods commit_hash:245a52ca795a16ad57a9ac642b0cd00ca0122a32
Diffstat (limited to 'library/cpp/xml/document/xml-document-decl.h')
-rw-r--r--library/cpp/xml/document/xml-document-decl.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/library/cpp/xml/document/xml-document-decl.h b/library/cpp/xml/document/xml-document-decl.h
index bfda1fb7e6..643ba66468 100644
--- a/library/cpp/xml/document/xml-document-decl.h
+++ b/library/cpp/xml/document/xml-document-decl.h
@@ -328,6 +328,14 @@ namespace NXml {
/**
* get node attribute
* @param name: attribute name
+ * returns value if exists
+ */
+ template <class T>
+ TMaybe<T> TryAttr(TZtStringBuf name) const;
+
+ /**
+ * get node attribute
+ * @param name: attribute name
* returns default value if attribute not found
*/
template <class T>
@@ -600,6 +608,16 @@ namespace NXml {
/**
* get node attribute
* @param name: attribute name
+ * returns value if exists
+ */
+ template <class T>
+ TMaybe<T> TryAttr(TZtStringBuf name) const {
+ return ActualNode.TryAttr<T>(name);
+ }
+
+ /**
+ * get node attribute
+ * @param name: attribute name
* throws exception if attribute not found
*/
template <class T>