FERS 0.1.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
xml_detail::XmlCharBuffer Class Reference

#include "libxml_wrapper.h"

Public Member Functions

 XmlCharBuffer (const std::string_view value)
 
const xmlCharc_str () const noexcept
 
int contentLength () const
 

Detailed Description

Definition at line 50 of file libxml_wrapper.h.

Constructor & Destructor Documentation

◆ XmlCharBuffer()

xml_detail::XmlCharBuffer::XmlCharBuffer ( const std::string_view  value)
explicit

Definition at line 55 of file libxml_wrapper.h.

56 {
57 _value.reserve(value.size() + 1);
58 for (const char character : value)
59 {
60 _value.push_back(static_cast<xmlChar>(static_cast<unsigned char>(character)));
61 }
62 _value.push_back(0);
63 }
math::Vec3 max

References max.

Member Function Documentation

◆ c_str()

const xmlChar * xml_detail::XmlCharBuffer::c_str ( ) const
noexcept

Definition at line 65 of file libxml_wrapper.h.

65{ return _value.data(); }

◆ contentLength()

int xml_detail::XmlCharBuffer::contentLength ( ) const

Definition at line 67 of file libxml_wrapper.h.

68 {
69 const auto length = _value.empty() ? static_cast<std::size_t>(0) : _value.size() - 1;
70 if (length > static_cast<std::size_t>(std::numeric_limits<int>::max()))
71 {
72 throw XmlException("XML string exceeds libxml2 length limit.");
73 }
74 return static_cast<int>(length);
75 }
Exception class for handling XML-related errors.

The documentation for this class was generated from the following file: