|
From: <pat...@us...> - 2010-03-06 16:03:36
|
Revision: 638
http://xml-cppdom.svn.sourceforge.net/xml-cppdom/?rev=638&view=rev
Author: patrickh
Date: 2010-03-06 16:03:29 +0000 (Sat, 06 Mar 2010)
Log Message:
-----------
>From the patch submission:
cppdom::Attribute has (among others) the following c'tor:
template <class T>
Attribute(const T& val);
and an output operator:
std::ostream& operator<<(std::ostream& os, const Attribute& att);
together these two constructs will grab any type that does not have a
operator<< overload of its own and turn it into an infinite recursion at
runtime (because the above c'tor uses setValue<T>(val) which uses a
std::ostringstream to convert val into a string representation.
Bumped the version to 1.1.0.
Submited by: Carsten Neumann
Modified Paths:
--------------
trunk/ChangeLog
trunk/cppdom/cppdom.h
trunk/cppdom/version.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-03-06 16:00:44 UTC (rev 637)
+++ trunk/ChangeLog 2010-03-06 16:03:29 UTC (rev 638)
@@ -1,5 +1,11 @@
DATE AUTHOR CHANGE
---------- ----------- -------------------------------------------------------
+2010-03-06 patrickh Fixed conflicts with the operator<< overload for
+ std::ostream and implicit constructio of
+ cppdom::Attribute objects.
+ Submitted by: Carsten Neumann
+ VERSION: 1.1.1
+
[Version 1.0.0 released - 3.2.2009]============================================
2007-08-01 patrickh Updated for SConsAddons changes. On Windows, the
Modified: trunk/cppdom/cppdom.h
===================================================================
--- trunk/cppdom/cppdom.h 2010-03-06 16:00:44 UTC (rev 637)
+++ trunk/cppdom/cppdom.h 2010-03-06 16:03:29 UTC (rev 638)
@@ -335,7 +335,7 @@
#ifndef CPPDOM_NO_MEMBER_TEMPLATES
template<class T>
- Attribute(const T& val)
+ explicit Attribute(const T& val)
{
setValue<T>(val);
}
@@ -548,6 +548,24 @@
*/
void setAttribute(const std::string& attr, const Attribute& value);
+ /**
+ * Sets new attribute value.
+ *
+ * @post Element.attr is set to value. If it did not exist before, now
+ * it does.
+ *
+ * @param attr Attribute name to set. There must not be ANY spaces in
+ * this name.
+ * @param value Attribute value to set.
+ *
+ * @since 1.1.1
+ */
+ template<class T>
+ void setAttribute(const std::string& attr, const T& value)
+ {
+ setAttribute(attr, Attribute(value));
+ }
+
/** Direct access to attribute map. */
Attributes& attrib();
Modified: trunk/cppdom/version.h
===================================================================
--- trunk/cppdom/version.h 2010-03-06 16:00:44 UTC (rev 637)
+++ trunk/cppdom/version.h 2010-03-06 16:03:29 UTC (rev 638)
@@ -55,7 +55,7 @@
// The major/minor/patch version (up to 3 digits each).
#define CPPDOM_VERSION_MAJOR 1
#define CPPDOM_VERSION_MINOR 1
-#define CPPDOM_VERSION_PATCH 0
+#define CPPDOM_VERSION_PATCH 1
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|