diff options
| author | artyasen <[email protected]> | 2025-02-03 15:57:35 +0300 |
|---|---|---|
| committer | artyasen <[email protected]> | 2025-02-03 16:35:09 +0300 |
| commit | a19aaf0e98329e8fff4e16626c2f8212f7d87789 (patch) | |
| tree | b262bcd535c5f29e36b701c95fa91c8beb32fcb6 /library/cpp/xml/document/xml-document-decl.h | |
| parent | cafd6740c55721b602590b6371e271bb41355e36 (diff) | |
Получение 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.h | 18 |
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 bfda1fb7e6e..643ba664680 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> |
