[cpp-xmltooling COMMIT] in /branches/REL_1/xmltooling: base.h encryption/Encryption.h
noreply at shibboleth.net
noreply at shibboleth.net
Wed Dec 21 19:33:17 GMT 2011
Author: scantor
Date: Wed Dec 21 19:33:16 2011
New Revision: 941
URL: http://svn.shibboleth.net/view/cpp-xmltooling?rev=941&view=rev
Log:
Eliminate printf usage in macros.
Modified:
branches/REL_1/xmltooling/base.h
branches/REL_1/xmltooling/encryption/Encryption.h
Modified: branches/REL_1/xmltooling/base.h
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltooling/base.h?rev=941&r1=940&r2=941&view=diff
==============================================================================
--- branches/REL_1/xmltooling/base.h (original)
+++ branches/REL_1/xmltooling/base.h Wed Dec 21 19:33:16 2011
@@ -697,10 +697,12 @@
m_##proper = prepareForAssignment(m_##proper,proper); \
} \
void set##proper(int proper) { \
- char buf##proper[64]; \
- std::sprintf(buf##proper,"%d",proper); \
- xmltooling::auto_ptr_XMLCh wide##proper(buf##proper); \
- set##proper(wide##proper.get()); \
+ try { \
+ xmltooling::xstring buf = boost::lexical_cast<xmltooling::xstring>(proper); \
+ set##proper(buf.c_str()); \
+ } \
+ catch (boost::bad_lexical_cast&) { \
+ } \
}
/**
@@ -1250,10 +1252,12 @@
} \
XMLTOOLING_DOXYGEN(Sets proper.) \
void set##proper(int proper) { \
- char buf[64]; \
- std::sprintf(buf,"%d",proper); \
- xmltooling::auto_ptr_XMLCh widebuf(buf); \
- setTextContent(widebuf.get()); \
+ try { \
+ xmltooling::xstring buf = boost::lexical_cast<xmltooling::xstring>(proper); \
+ setTextContent(buf.c_str()); \
+ } \
+ catch (boost::bad_lexical_cast&) { \
+ } \
} \
XMLTOOLING_DOXYGEN(Sets or clears proper.) \
void set##proper(const XMLCh* proper) { \
Modified: branches/REL_1/xmltooling/encryption/Encryption.h
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltooling/encryption/Encryption.h?rev=941&r1=940&r2=941&view=diff
==============================================================================
--- branches/REL_1/xmltooling/encryption/Encryption.h (original)
+++ branches/REL_1/xmltooling/encryption/Encryption.h Wed Dec 21 19:33:16 2011
@@ -32,6 +32,7 @@
#include <xmltooling/util/XMLConstants.h>
#include <cstdio>
+#include <boost/lexical_cast.hpp>
namespace xmlsignature {
class XMLTOOL_API KeyInfo;
More information about the commits
mailing list