You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/05/08 19:18:05 UTC
cvs commit: xml-xalan/c/src/PlatformSupport DOMStringHelper.cpp DOMStringHelper.hpp
dbertoni 00/05/08 10:18:05
Modified: c/src/PlatformSupport DOMStringHelper.cpp
DOMStringHelper.hpp
Log:
Added conversions from strings to unsigned longs.
Revision Changes Path
1.20 +23 -0 xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp
Index: DOMStringHelper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- DOMStringHelper.cpp 2000/05/05 15:04:59 1.19
+++ DOMStringHelper.cpp 2000/05/08 17:18:05 1.20
@@ -76,6 +76,7 @@
using std::back_inserter;
using std::copy;
using std::hex;
+using std::istrstream;
using std::ostream;
using std::ostrstream;
using std::string;
@@ -914,6 +915,28 @@
if (theVector.size() > 0)
{
theResult = atol(theVector.begin());
+ }
+
+ return theResult;
+}
+
+
+
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(unsigned long)
+WideStringToUnsignedLong(const XalanDOMChar* theString)
+{
+ unsigned long theResult = 0;
+
+ vector<char> theVector;
+
+ CopyWideStringToVector(theString,
+ theVector);
+
+ if (theVector.size() > 0)
+ {
+ istrstream theFormatter(&theVector[0]);
+
+ theFormatter >> theResult;
}
return theResult;
1.18 +25 -0 xml-xalan/c/src/PlatformSupport/DOMStringHelper.hpp
Index: DOMStringHelper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.hpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- DOMStringHelper.hpp 2000/05/03 21:09:33 1.17
+++ DOMStringHelper.hpp 2000/05/08 17:18:05 1.18
@@ -525,6 +525,17 @@
/**
+ * Converts a wide string into an unsigned long value
+ *
+ * @param theString target string
+ * @return unsigned long value of target string
+ */
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(unsigned long)
+WideStringToUnsignedLong(const XalanDOMChar* theString);
+
+
+
+/**
* Converts a wide string into a double value
*
* @param theString target string
@@ -559,6 +570,20 @@
DOMStringToLong(const XalanDOMString& theString)
{
return WideStringToLong(c_wstr(theString));
+}
+
+
+
+/**
+ * Converts a XalanDOMString into a long value
+ *
+ * @param theString target string
+ * @return unsigned long value of target string
+ */
+inline unsigned long
+DOMStringToUnsignedLong(const XalanDOMString& theString)
+{
+ return WideStringToUnsignedLong(c_wstr(theString));
}