[DEV] add missing API in the attribute element
This commit is contained in:
parent
b626465cca
commit
0e507add7e
@ -66,7 +66,16 @@ void exml::Attribute::clear() {
|
||||
static_cast<exml::internal::Attribute*>(m_data.get())->clear();
|
||||
}
|
||||
|
||||
std::pair<std::string, std::string> exml::Attribute::getPair() const {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR(" can not setName (nullptr) ...");
|
||||
return std::pair<std::string, std::string>("","");
|
||||
}
|
||||
return std::pair<std::string, std::string>(static_cast<exml::internal::Attribute*>(m_data.get())->getName(),
|
||||
static_cast<exml::internal::Attribute*>(m_data.get())->getValue());
|
||||
}
|
||||
|
||||
ememory::SharedPtr<exml::internal::Attribute> exml::Attribute::getInternalAttribute() {
|
||||
return std::static_pointer_cast<exml::internal::Attribute>(m_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,11 @@ namespace exml {
|
||||
* @return String of the attribute
|
||||
*/
|
||||
virtual const std::string& getName() const;
|
||||
/**
|
||||
* @brief get attribute name and value
|
||||
* @return Name and value of the attribute
|
||||
*/
|
||||
std::pair<std::string, std::string> getPair() const;
|
||||
public:
|
||||
void clear() override;
|
||||
friend class exml::AttributeListData;
|
||||
|
Loading…
x
Reference in New Issue
Block a user