summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-14 18:31:52 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-14 18:31:52 +0300
commit2d7fd070323ab3a9623702c67bece350fce4ab68 (patch)
tree93bddb3e8aa211b3b79302405da8779aa474aac5 /src
parent9039a597d913aaeadb8090622d06b6425dc34125 (diff)
tinyxml2: two wchar_t wrappers added
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/mir_core.def3
-rw-r--r--src/mir_core/src/mir_core64.def3
-rw-r--r--src/mir_core/src/tinyxml2.cpp14
-rw-r--r--src/mir_core/src/tinyxml2.h19
4 files changed, 32 insertions, 7 deletions
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 13f6a00b9e..5a39a144d7 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1410,3 +1410,6 @@ db_event_edit @1268
?_errorNames@XMLDocument@tinyxml2@@0PAPBDA @1623 NONAME
?writeBoolFalse@XMLUtil@tinyxml2@@0PBDB @1624 NONAME
?writeBoolTrue@XMLUtil@tinyxml2@@0PBDB @1625 NONAME
+?SetText@XMLElement@tinyxml2@@QAEXPB_W@Z @1626 NONAME
+?SetAttribute@XMLAttribute@tinyxml2@@QAEXPB_W@Z @1627 NONAME
+?SetAttribute@XMLElement@tinyxml2@@QAEXPBDPB_W@Z @1628 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 5be8e219d5..8df59970ba 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1410,3 +1410,6 @@ db_event_edit @1268
?_errorNames@XMLDocument@tinyxml2@@0PAPEBDA @1623 NONAME
?writeBoolFalse@XMLUtil@tinyxml2@@0PEBDEB @1624 NONAME
?writeBoolTrue@XMLUtil@tinyxml2@@0PEBDEB @1625 NONAME
+?SetText@XMLElement@tinyxml2@@QEAAXPEB_W@Z @1626 NONAME
+?SetAttribute@XMLAttribute@tinyxml2@@QEAAXPEB_W@Z @1627 NONAME
+?SetAttribute@XMLElement@tinyxml2@@QEAAXPEBDPEB_W@Z @1628 NONAME
diff --git a/src/mir_core/src/tinyxml2.cpp b/src/mir_core/src/tinyxml2.cpp
index cfeec08827..a7f94a0153 100644
--- a/src/mir_core/src/tinyxml2.cpp
+++ b/src/mir_core/src/tinyxml2.cpp
@@ -763,7 +763,7 @@ XMLNode::~XMLNode()
const char* XMLNode::Value() const
{
// Edge case: XMLDocuments don't have a Value. Return null.
- if ( this->ToDocument() )
+ if ( this == nullptr || this->ToDocument() )
return 0;
return _value.GetStr();
}
@@ -1447,6 +1447,12 @@ void XMLAttribute::SetAttribute( const char* v )
}
+void XMLAttribute::SetAttribute( const wchar_t* v )
+{
+ _value.SetStr( T2Utf(v).get() );
+}
+
+
void XMLAttribute::SetAttribute( int v )
{
char buf[BUF_SIZE];
@@ -1597,6 +1603,12 @@ void XMLElement::SetText( const char* inText )
}
+void XMLElement::SetText(const wchar_t* inText)
+{
+ SetText( T2Utf(inText).get() );
+}
+
+
void XMLElement::SetText( int v )
{
char buf[BUF_SIZE];
diff --git a/src/mir_core/src/tinyxml2.h b/src/mir_core/src/tinyxml2.h
index 7cd3127363..7cdd917a2d 100644
--- a/src/mir_core/src/tinyxml2.h
+++ b/src/mir_core/src/tinyxml2.h
@@ -1205,9 +1205,11 @@ public:
/// See QueryIntValue
XMLError QueryFloatValue( float* value ) const;
- /// Set the attribute to a string value.
- void SetAttribute( const char* value );
- /// Set the attribute to value.
+ /// Set the attribute to a string value.
+ void SetAttribute( const char* value );
+ /// Set the attribute to a wide string value.
+ void SetAttribute( const wchar_t* value );
+ /// Set the attribute to value.
void SetAttribute( int value );
/// Set the attribute to value.
void SetAttribute( unsigned value );
@@ -1430,7 +1432,11 @@ public:
XMLAttribute* a = FindOrCreateAttribute( name );
a->SetAttribute( value );
}
- /// Sets the named attribute to value.
+ void SetAttribute( const char* name, const wchar_t* value ) {
+ XMLAttribute* a = FindOrCreateAttribute( name );
+ a->SetAttribute( value );
+ }
+ /// Sets the named attribute to value.
void SetAttribute( const char* name, int value ) {
XMLAttribute* a = FindOrCreateAttribute( name );
a->SetAttribute( value );
@@ -1539,8 +1545,9 @@ public:
<foo>Hullaballoo!</foo>
@endverbatim
*/
- void SetText( const char* inText );
- /// Convenience method for setting text inside an element. See SetText() for important limitations.
+ void SetText( const char* inText );
+ void SetText( const wchar_t* inText );
+ /// Convenience method for setting text inside an element. See SetText() for important limitations.
void SetText( int value );
/// Convenience method for setting text inside an element. See SetText() for important limitations.
void SetText( unsigned value );