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/09/19 16:44:43 UTC
cvs commit: xml-xalan/c/src/PlatformSupport AttributeListImpl.cpp AttributeListImpl.hpp DOMStringHelper.cpp DOMStringHelper.hpp DoubleSupport.cpp TextOutputStream.cpp TextOutputStream.hpp URISupport.cpp Writer.cpp Writer.hpp XalanAutoPtr.hpp XalanDecimalFormatSymbols.cpp XalanUnicode.hpp
dbertoni 00/09/19 07:44:41
Modified: c/src/PlatformSupport AttributeListImpl.cpp
AttributeListImpl.hpp DOMStringHelper.cpp
DOMStringHelper.hpp DoubleSupport.cpp
TextOutputStream.cpp TextOutputStream.hpp
URISupport.cpp Writer.cpp Writer.hpp
XalanAutoPtr.hpp XalanDecimalFormatSymbols.cpp
XalanUnicode.hpp
Log:
Changes for AIX port and for output transcoding.
Revision Changes Path
1.13 +37 -6 xml-xalan/c/src/PlatformSupport/AttributeListImpl.cpp
Index: AttributeListImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/AttributeListImpl.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- AttributeListImpl.cpp 2000/08/31 19:42:50 1.12
+++ AttributeListImpl.cpp 2000/09/19 14:43:19 1.13
@@ -74,7 +74,7 @@
m_AttributeKeyMap(),
m_AttributeVector()
{
- m_AttributeVector.reserve(eDefaultVectorSize);
+ m_AttributeVector.reserve(eDefaultVectorSize);
}
@@ -360,6 +360,10 @@
const XMLCh* type,
const XMLCh* value)
{
+#if !defined(XALAN_NO_NAMESPACES)
+ using std::copy;
+#endif
+
assert(name != 0);
assert(type != 0);
assert(value != 0);
@@ -373,12 +377,39 @@
if (i != m_AttributeKeyMap.end())
{
- // Create the new vectors, then swap them...
- XMLChVectorType theNewType(type, endArray(type) + 1);
- XMLChVectorType theNewValue(value, endArray(value) + 1);
+ // This is a special optimization for type, since it's (almost) always "CDATA".
+ if (equals(type, (*i).second->m_Type.begin()) == false)
+ {
+ // If necessary, create the a new vector and swap them. Otherwise,
+ // just copy the new data in.
+ const XMLCh* const theNewTypeEnd = endArray(type) + 1;
- theNewType.swap((*i).second->m_Type);
- theNewValue.swap((*i).second->m_Value);
+ if ((*i).second->m_Type.capacity() < XMLChVectorType::size_type(theNewTypeEnd - type))
+ {
+ XMLChVectorType theNewType(type, theNewTypeEnd);
+
+ theNewType.swap((*i).second->m_Type);
+ }
+ else
+ {
+ copy(type, theNewTypeEnd, (*i).second->m_Type.begin());
+ }
+ }
+
+ const XMLCh* const theNewValueEnd = endArray(value) + 1;
+
+ // If necessary, create the a new vector and swap them. Otherwise,
+ // just copy the new data in.
+ if ((*i).second->m_Value.capacity() < XMLChVectorType::size_type(theNewValueEnd - value))
+ {
+ XMLChVectorType theNewValue(value, theNewValueEnd);
+
+ theNewValue.swap((*i).second->m_Value);
+ }
+ else
+ {
+ copy(value, theNewValueEnd, (*i).second->m_Value.begin());
+ }
}
else
{
1.11 +12 -12 xml-xalan/c/src/PlatformSupport/AttributeListImpl.hpp
Index: AttributeListImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/AttributeListImpl.hpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AttributeListImpl.hpp 2000/08/31 19:42:50 1.10
+++ AttributeListImpl.hpp 2000/09/19 14:43:21 1.11
@@ -174,18 +174,6 @@
m_AttributeVector.reserve(theCount);
}
-protected:
-
- // This is not implemented.
- bool
- operator==(const AttributeListImpl&) const;
-
- // Default vector allocation size.
- enum
- {
- eDefaultVectorSize = 5
- };
-
// A struct to hold information about each attribute.
struct AttributeVectorEntry
{
@@ -230,6 +218,18 @@
AttributeVectorEntry*,
less_null_terminated_arrays<XMLCh> > AttributeKeyMapType;
#endif
+
+private:
+
+ // This is not implemented.
+ bool
+ operator==(const AttributeListImpl&) const;
+
+ // Default vector allocation size.
+ enum
+ {
+ eDefaultVectorSize = 5
+ };
// Helper function to delete entries...
static void
1.33 +257 -67 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.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- DOMStringHelper.cpp 2000/09/05 02:24:44 1.32
+++ DOMStringHelper.cpp 2000/09/19 14:43:22 1.33
@@ -61,6 +61,7 @@
#include <cassert>
#include <cmath>
+#include <cstdio>
#include <cstdlib>
#include <iosfwd>
@@ -80,7 +81,6 @@
using std::istrstream;
using std::ostream;
using std::ostrstream;
-using std::string;
using std::transform;
using std::vector;
#endif
@@ -239,7 +239,6 @@
-
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(unsigned int)
indexOf(
const XalanDOMString& theString,
@@ -406,14 +405,13 @@
-
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
OutputString(TextOutputStream& theStream,
- const XalanDOMString& theString)
+ const CharVectorType& theString)
{
- if (isEmpty(theString) == false)
+ if (theString.size() > 0)
{
- theStream << c_wstr(theString);
+ theStream.write(c_str(theString));
}
}
@@ -421,15 +419,43 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
OutputString(
- ostream& theStream,
- const XalanDOMString& theString)
+#if defined(XALAN_NO_NAMESPACES)
+ ostream& theStream,
+#else
+ std::ostream& theStream,
+#endif
+ const CharVectorType& theString)
+{
+ if (theString.size() > 0)
+ {
+ theStream << c_str(theString);
+ }
+}
+
+
+
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
+OutputString(TextOutputStream& theStream,
+ const XalanDOMChar* theString)
{
- char* const theTranscodedString =
- theString.transcode();
+ if (theString != 0)
+ {
+ theStream.write(theString);
+ }
+}
+
- const XalanArrayAutoPtr<char> theJanitor(theTranscodedString);
- theStream << theTranscodedString;
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
+OutputString(
+#if defined(XALAN_NO_NAMESPACES)
+ ostream& theStream,
+#else
+ std::ostream& theStream,
+#endif
+ const XalanDOMChar* theString)
+{
+ OutputString(theStream, TranscodeToLocalCodePage(theString));
}
@@ -731,13 +757,86 @@
+template <class Type>
+int
+doCompare(
+ const Type* theLHS,
+ unsigned int theLHSLength,
+ const Type* theRHS,
+ unsigned int theRHSLength)
+{
+ int theResult = 0;
+
+ if (theLHSLength != 0 || theRHSLength != 0)
+ {
+ Type theLHSChar = Type(0);
+ Type theRHSChar = Type(0);
+
+ unsigned int i = 0;
+
+ for(; i < theLHSLength && i < theRHSLength; i++)
+ {
+ theLHSChar = theLHS[i];
+ theRHSChar = theRHS[i];
+
+ if (theLHSChar != theRHSChar)
+ {
+ break;
+ }
+ }
+
+ if (i == theLHSLength)
+ {
+ // We reached the end of theLHS...
+ if (i != theRHSLength)
+ {
+ // but not the end of theRHS.
+ theResult = -1;
+ }
+ }
+ else if (i == theRHSLength)
+ {
+ // We reached the end of theRHS string...
+ if (i != theLHSLength)
+ {
+ // but not the end of theLHS string.
+ theResult = 1;
+ }
+ }
+ else
+ {
+ // We didn't reach the end of _either_ string, so
+ // return the difference between the two characters
+ // that caused the problem.
+ theResult = theLHSChar - theRHSChar;
+ }
+ }
+
+ return theResult;
+}
+
+
+
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
+compare(
+ const CharVectorType& theLHS,
+ const CharVectorType& theRHS)
+{
+ return doCompare(c_str(theLHS), theLHS.size(), c_str(theRHS), theRHS.size());
+}
+
+
+
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
compare(
const XalanDOMChar* theLHS,
const XalanDOMChar* theRHS)
{
- unsigned const int theLHSLength = length(theLHS);
- unsigned const int theRHSLength = length(theRHS);
+#if 1
+ return doCompare(theLHS, length(theLHS), theRHS, length(theRHS));
+#else
+ const unsigned int theLHSLength = length(theLHS);
+ const unsigned int theRHSLength = length(theRHS);
int theResult = 0;
@@ -787,10 +886,71 @@
}
return theResult;
+#endif
}
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
+compareIgnoreCase(
+ const XalanDOMChar* theLHS,
+ const XalanDOMChar* theRHS)
+{
+ unsigned const int theLHSLength = length(theLHS);
+ unsigned const int theRHSLength = length(theRHS);
+
+ int theResult = 0;
+
+ if (theLHSLength != 0 || theRHSLength != 0)
+ {
+ XalanDOMChar theLHSChar = 0;
+ XalanDOMChar theRHSChar = 0;
+
+ unsigned int i = 0;
+
+ for(; i < theLHSLength && i < theRHSLength; i++)
+ {
+ theLHSChar = towupper(theLHS[i]);
+ theRHSChar = towupper(theRHS[i]);
+
+ if (theLHSChar != theRHSChar)
+ {
+ break;
+ }
+ }
+
+ if (i == theLHSLength)
+ {
+ // We reached the end of theLHS...
+ if (i != theRHSLength)
+ {
+ // but not the end of theRHS.
+ theResult = -1;
+ }
+ }
+ else if (i == theRHSLength)
+ {
+ // We reached the end of theRHS string...
+ if (i != theLHSLength)
+ {
+ // but not the end of theLHS string.
+ theResult = 1;
+ }
+ }
+ else
+ {
+ // We didn't reach the end of _either_ string, so
+ // return the difference between the two characters
+ // that caused the problem.
+ theResult = theLHSChar - theRHSChar;
+ }
+ }
+
+ return theResult;
+}
+
+
+
struct WideStringLexicalCompare
{
int
@@ -804,6 +964,19 @@
+struct WideStringIgnoreCaseCompare
+{
+ int
+ operator()(
+ const XalanDOMChar* theLHS,
+ const XalanDOMChar* theRHS) const
+ {
+ return compareIgnoreCase(theLHS, theRHS);
+ }
+};
+
+
+
struct WideStringCollationCompare
{
int
@@ -873,6 +1046,18 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
+compareIgnoreCase(
+ const XalanDOMString& theLHS,
+ const XalanDOMString& theRHS)
+{
+ return DOMStringCompare(WideStringIgnoreCaseCompare(),
+ theLHS,
+ theRHS);
+}
+
+
+
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
collationCompare(
const XalanDOMString& theLHS,
const XalanDOMString& theRHS)
@@ -967,6 +1152,16 @@
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
+CopyStringToVector(
+ const char* theString,
+ CharVectorType& theVector)
+{
+ theVector.assign(theString, theString + strlen(theString) + 1);
+}
+
+
+
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
WideStringToInt(const XalanDOMChar* theString)
{
@@ -1352,78 +1547,73 @@
-XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(string)
-DOMStringToStdString(const XalanDOMString& domString)
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
+TranscodeToLocalCodePage(
+ const XalanDOMChar* sourceString,
+ CharVectorType& targetVector,
+ bool terminate)
{
- const XalanDOMChar* const toTranscode = c_wstr(domString);
- unsigned int len = domString.length();
-
-
- // Short circuit if its a null pointer
- if (!toTranscode || (!toTranscode[0]))
+ // Short circuit if it's a null pointer, or of length 0.
+ if (!sourceString || (!sourceString[0]))
{
- return string();
- }
-
- // See if our XalanDOMChar and wchar_t as the same on this platform
- const bool isSameSize = (sizeof(XalanDOMChar) == sizeof(wchar_t));
+ if (terminate == true)
+ {
+ targetVector.resize(1);
+ }
+ else
+ {
+ targetVector.resize(1);
+ }
- //
- // Get the actual number of chars. If the passed len is zero, its null
- // terminated. Else we have to use the len.
- //
- wchar_t realLen = (wchar_t)len;
+ return true;
+ }
- if (!realLen)
- {
- //
- // We cannot just assume we can use wcslen() because we don't know
- // if our XalanDOMChar is the same as wchar_t on this platform.
- //
- const XalanDOMChar* tmpPtr = toTranscode;
- while (*(tmpPtr++))
- realLen++;
- }
+ const unsigned int len = length(sourceString);
- //
- // If either the passed length was non-zero or our char sizes are not
- // same, we have to use a temp buffer. Since this is common in these
- // samples, we just do it anyway.
- //
- wchar_t* const tmpSource = new wchar_t[realLen + 1];
+ XalanArrayAutoPtr<wchar_t> tempSourceJanitor;
- const XalanArrayAutoPtr<wchar_t> tmpSourceJanitor(tmpSource);
+ const XalanDOMChar* tempSource = sourceString;
- if (isSameSize)
- {
- memcpy(tmpSource, toTranscode, realLen * sizeof(wchar_t));
- }
- else
+ // See if our XalanDOMChar and wchar_t as the same on this platform
+ if (sizeof(XalanDOMChar) != sizeof(wchar_t))
{
- for (unsigned int index = 0; index < realLen; index++)
+ //
+ // If either the passed length was non-zero or our char sizes are not
+ // same, we have to use a temp buffer.
+ //
+ tempSourceJanitor.reset(new wchar_t[len + 1]);
+
+ for (unsigned int index = 0; index < len; index++)
{
- tmpSource[index] = (wchar_t)toTranscode[index];
+ tempSourceJanitor[index] = wchar_t(sourceString[index]);
}
- }
- tmpSource[realLen] = 0;
+ tempSourceJanitor[len] = 0;
- // See now many chars we need to transcode this guy
- const unsigned int targetLen = ::wcstombs(0, tmpSource, 0);
+ tempSource = tempSourceJanitor.get();
+ }
- // Allocate out storage member
- char* const localForm = new char[targetLen + 1];
+ // See now many chars we need to transcode this guy
+ const unsigned int targetLen = ::wcstombs(0, tempSource, 0);
- const XalanArrayAutoPtr<char> localFormJanitor(localForm);
+ targetVector.resize(targetLen);
//
// And transcode our temp source buffer to the local buffer. Cap it
// off since the converter won't do it (because the null is beyond
// where the target will fill up.)
//
- wcstombs(localForm, tmpSource, targetLen);
-
- localForm[targetLen] = 0;
+ if (wcstombs(&targetVector[0], tempSource, targetLen) == size_t(-1))
+ {
+ return false;
+ }
+ else
+ {
+ if (terminate == true)
+ {
+ targetVector.resize(targetVector.size() + 1);
+ }
- return localForm;
+ return true;
+ }
}
1.29 +422 -33 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.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- DOMStringHelper.hpp 2000/09/05 02:24:45 1.28
+++ DOMStringHelper.hpp 2000/09/19 14:43:23 1.29
@@ -72,7 +72,6 @@
#include <iosfwd>
#endif
#include <vector>
-#include <string>
#if defined(XALAN_LSTRSUPPORT)
#include <cwchar>
@@ -153,8 +152,8 @@
theString.reserve(theCount);
}
-
-
+
+
/**
* Get the underlying representation of the target XalanDOMString as a
* null-terminated string
@@ -664,6 +663,70 @@
+// Standard vector of XalanDOMChars and chars
+#if defined(XALAN_NO_NAMESPACES)
+typedef vector<XalanDOMChar> XalanDOMCharVectorType;
+
+typedef vector<char> CharVectorType;
+#else
+typedef std::vector<XalanDOMChar> XalanDOMCharVectorType;
+
+typedef std::vector<char> CharVectorType;
+#endif
+
+
+
+/**
+ * Get the underlying representation of the target CharVectorType as a
+ * null-terminated string
+ *
+ * @param theString target string
+ * @return null-terminated string of chars
+ */
+inline const char*
+c_str(const CharVectorType& theString)
+{
+ const char* const ptr = &theString[0];
+
+ assert(!ptr || ptr[theString.size() - 1] == '\0');
+
+ return ptr;
+}
+
+
+
+/**
+ * Outputs the target string to the specified stream
+ *
+ * @param theStream output stream
+ * @param theString target string
+ * @see operator<<
+ */
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
+OutputString(
+ TextOutputStream& theStream,
+ const CharVectorType& theString);
+
+
+
+/**
+ * Outputs the target string to the specified stream
+ *
+ * @param theStream output stream
+ * @param theString target string
+ * @see operator<<
+ */
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
+OutputString(
+#if defined(XALAN_NO_NAMESPACES)
+ ostream& theStream,
+#else
+ std::ostream& theStream,
+#endif
+ const CharVectorType& theString);
+
+
+
/**
* Outputs the target string to the specified stream
*
@@ -674,7 +737,7 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
OutputString(
TextOutputStream& theStream,
- const XalanDOMString& theString);
+ const XalanDOMChar* theString);
@@ -687,12 +750,143 @@
*/
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
OutputString(
+#if defined(XALAN_NO_NAMESPACES)
+ ostream& theStream,
+#else
+ std::ostream& theStream,
+#endif
+ const XalanDOMChar* theString);
+
+
+
+/**
+ * Outputs the target string to the specified stream
+ *
+ * @param theStream output stream
+ * @param theString target string
+ * @see operator<<
+ */
+inline void
+OutputString(
+ TextOutputStream& theStream,
+ const XalanDOMString& theString)
+{
+ if (isEmpty(theString) == false)
+ {
+ OutputString(theStream, c_wstr(theString));
+ }
+}
+
+
+
+/**
+ * Outputs the target string to the specified stream
+ *
+ * @param theStream output stream
+ * @param theString target string
+ * @see operator<<
+ */
+inline void
+OutputString(
+#if defined(XALAN_NO_NAMESPACES)
+ ostream& theStream,
+#else
+ std::ostream& theStream,
+#endif
+ const XalanDOMString& theString)
+{
+ OutputString(theStream, c_wstr(theString));
+}
+
+
+
+/**
+ * Outputs the string to the specified stream
+ *
+ * @param theStream output stream
+ * @param theString the string to output
+ * @see OutputString
+ */
+inline TextOutputStream&
+operator<<(
+ TextOutputStream& theStream,
+ const CharVectorType& theString)
+{
+ OutputString(theStream, theString);
+
+ return theStream;
+}
+
+
+
+/**
+ * Outputs the string to the specified stream
+ *
+ * @param theStream output stream
+ * @param theString the string to output
+ * @see OutputString
+ */
+#if defined(XALAN_NO_NAMESPACES)
+inline ostream&
+operator<<(
+ ostream& theStream,
+#else
+inline std::ostream&
+operator<<(
+ std::ostream& theStream,
+#endif
+ const CharVectorType& theString)
+{
+ OutputString(theStream, theString);
+
+ return theStream;
+}
+
+
+
+/**
+ * Outputs the target string to the specified stream
+ *
+ * @param theStream output stream
+ * @param theString target string
+ * @see OutputString
+ */
+inline TextOutputStream&
+operator<<(
+ TextOutputStream& theStream,
+ const XalanDOMChar* theString)
+{
+ OutputString(theStream,
+ theString);
+
+ return theStream;
+}
+
+
+
+/**
+ * Outputs the target string to the specified stream
+ *
+ * @param theStream output stream
+ * @param theString target string
+ * @see OutputString
+ */
#if defined(XALAN_NO_NAMESPACES)
- ostream& theStream,
+inline ostream&
+operator<<(
+ ostream& theStream,
#else
- std::ostream& theStream,
+inline std::ostream&
+operator<<(
+ std::ostream& theStream,
#endif
- const XalanDOMString& theString);
+ const XalanDOMChar* theString)
+{
+ OutputString(theStream,
+ theString);
+
+ return theStream;
+}
@@ -903,6 +1097,22 @@
+/**
+ * Compare the contents of two strings.
+ *
+ * @param theLHS first string to compare
+ * @param theRHS second string to compare
+ * @return Returns 0 for equal strings, less than 0 if theLHS is less
+ * than theRHS, or greater than 0 if theRHS is greater than theLHS.
+ * @see operator<()
+ */
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
+compare(
+ const CharVectorType& theLHS,
+ const CharVectorType& theRHS);
+
+
+
// For the time being, we're using our own custom routine,
// since performance is better.
@@ -937,6 +1147,24 @@
+/**
+ * Compare the contents of two strings, in a case insensitive
+ * manner
+ *
+ * @param theLHS first string to compare
+ * @param theRHS second string to compare
+ * @return Returns 0 for equal strings, less than 0 if theLHS is less
+ * than theRHS, or greater than 0 if theRHS is greater than theLHS.
+ * @see operator<
+ * @see collationCompare
+ */
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
+compareIgnoreCase(
+ const XalanDOMChar* theLHS,
+ const XalanDOMChar* theRHS);
+
+
+
#if defined(XALAN_USE_WCHAR_SUPPORT)
/**
@@ -990,6 +1218,24 @@
/**
+ * Compare the contents of two strings, in a case insensitive
+ * manner
+ *
+ * @param theLHS first string to compare
+ * @param theRHS second string to compare
+ * @return Returns 0 for equal strings, less than 0 if theLHS is less
+ * than theRHS, or greater than 0 if theRHS is greater than theLHS.
+ * @see operator<
+ * @see collationCompare
+ */
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
+compareIgnoreCase(
+ const XalanDOMString& theLHS,
+ const XalanDOMString& theRHS);
+
+
+
+/**
* Compare the contents of two strings using the
* the collation settings of the current code page.
*
@@ -1158,6 +1404,25 @@
/**
+ * Implements operator< for CharVectorType.
+ *
+ * @param theLHS first string to compare
+ * @param theRHS second string to compare
+ * @return Returns true if theLHS is lexically
+ * less than theRHS
+ * @see compare
+ */
+inline bool
+operator<(
+ const CharVectorType& theLHS,
+ const CharVectorType& theRHS)
+{
+ return compare(theLHS, theRHS) < 0 ? true : false;
+}
+
+
+
+/**
* Implements operator< for DOMStrings.
*
* @param theLHS first string to compare
@@ -1223,19 +1488,6 @@
-// A standard vector of XalanChars
-#if defined(XALAN_NO_NAMESPACES)
-typedef vector<XalanDOMChar> XalanDOMCharVectorType;
-
-typedef vector<char> CharVectorType;
-#else
-typedef std::vector<XalanDOMChar> XalanDOMCharVectorType;
-
-typedef std::vector<char> CharVectorType;
-#endif
-
-
-
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
CopyWideStringToVector(
const XalanDOMChar* theString,
@@ -1243,6 +1495,13 @@
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
+CopyStringToVector(
+ const char* theString,
+ CharVectorType& theVector);
+
+
+
/**
* Get a pointer to the first element of the vector as
* a null-terminated string
@@ -1366,6 +1625,28 @@
/**
+ * Compare the contents of two XalanDOMCharVectorTypes, in a case insensitive
+ * manner
+ *
+ * @param theLHS first vector to compare
+ * @param theRHS second vector to compare
+ * @return Returns 0 for equal vectors, less than 0 if theLHS is less
+ * than theRHS, or greater than 0 if theRHS is greater than theLHS.
+ * @see operator<
+ * @see collationCompare
+ */
+inline int
+compareIgnoreCase(
+
+ const XalanDOMCharVectorType& theLHS,
+ const XalanDOMCharVectorType& theRHS)
+{
+ return compareIgnoreCase(&theLHS[0], &theRHS[0]);
+}
+
+
+
+/**
* Compare the contents of two vectors using the
* the collation settings of the current code page.
*
@@ -1521,6 +1802,29 @@
/**
+ * Case-insensitive equals functor for DOMStrings
+ *
+ * @param theLHS first string to compare
+ * @param theRHS second string to compare
+ * @return true if the contents of both strings are equal, without respect to case
+ */
+#if defined(XALAN_NO_NAMESPACES)
+struct DOMStringEqualsIgnoreCaseFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
+#else
+struct DOMStringEqualsIgnoreCaseFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
+#endif
+{
+ result_type
+ operator() (first_argument_type theLHS,
+ second_argument_type theRHS) const
+ {
+ return equalsIgnoreCase(theLHS, theRHS);
+ }
+};
+
+
+
+/**
* Not equals functor for DOMStrings
*
* @param theLHS first string to compare
@@ -1548,7 +1852,7 @@
*
* @param theLHS first string to compare
* @param theRHS second string to compare
- * @return true if the contents of both strings are identical
+ * @return true if the theLHS is less than theRHSl
*/
#if defined(XALAN_NO_NAMESPACES)
struct DOMStringLessThanFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
@@ -1567,11 +1871,34 @@
/**
+ * Less than functor for DOMStrings which ignores case
+ *
+ * @param theLHS first string to compare
+ * @param theRHS second string to compare
+ * @return true if the theLHS is less than theRHS, without respect to case.
+ */
+#if defined(XALAN_NO_NAMESPACES)
+struct DOMStringLessThanIgnoreCaseFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
+#else
+struct DOMStringLessThanIgnoreCaseFunction : public std::binary_function<const XalanDOMString&, const XalanDOMString&, bool>
+#endif
+{
+ result_type
+ operator() (first_argument_type theLHS,
+ second_argument_type theRHS) const
+ {
+ return compareIgnoreCase(theLHS, theRHS) < 0 ? true : false;
+ }
+};
+
+
+
+/**
* Less than or equal functor for DOMStrings
*
* @param theLHS first string to compare
* @param theRHS second string to compare
- * @return true if the contents of both strings are identical
+ * @return true if the theLHS is less than or equal to theRHS
*/
#if defined(XALAN_NO_NAMESPACES)
struct DOMStringLessThanOrEqualFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
@@ -1594,7 +1921,7 @@
*
* @param theLHS first string to compare
* @param theRHS second string to compare
- * @return true if the contents of both strings are identical
+ * @return true if the theLHS is greater than theRHS
*/
#if defined(XALAN_NO_NAMESPACES)
struct DOMStringGreaterThanFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
@@ -1617,7 +1944,7 @@
*
* @param theLHS first string to compare
* @param theRHS second string to compare
- * @return true if the contents of both strings are identical
+ * @return true if the theLHS is greater than or equal to theRHS
*/
#if defined(XALAN_NO_NAMESPACES)
struct DOMStringGreaterThanOrEqualFunction : public binary_function<const XalanDOMString&, const XalanDOMString&, bool>
@@ -1635,18 +1962,80 @@
+/**
+ * Convert XalanDOMString to C++ standard library
+ * vector, transcoding to the default local code
+ * page.
+ *
+ * @param sourceString The source string
+ * @param targetVector The target string
+ * @param terminate If true, the transcoded string will be null-terminated
+ * @return true if successful, false if not.
+ */
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
+TranscodeToLocalCodePage(
+ const XalanDOMChar* sourceString,
+ CharVectorType& targetVector,
+ bool terminate = false);
+
+
+
/**
- * Convert XalanDOMString to C++ standard library string
+ * Convert XalanDOMString to C++ standard library
+ * vector, transcoding to the default local code
+ * page. Null-terminate the sttring...
+ *
+ * @param theSourceString source string
+ * @return The transcoded string.
+ */
+inline const CharVectorType
+TranscodeToLocalCodePage(const XalanDOMChar* sourceString)
+{
+ CharVectorType theResult;
+
+ TranscodeToLocalCodePage(sourceString, theResult, true);
+
+ return theResult;
+}
+
+
+
+/**
+ * Convert XalanDOMString to C++ standard library
+ * vector, transcoding to the default local code
+ * page.
*
- * @param theString target string
- * @return C++ standard library string representation of target
+ * @param sourceString The source string
+ * @param targetVector The target string
+ * @return true if successful, false if not.
*/
-#if defined(XALAN_NO_NAMESPACES)
-XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(string)
-#else
-XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(std::string)
-#endif
-DOMStringToStdString(const XalanDOMString& domString);
+inline bool
+TranscodeToLocalCodePage(
+ const XalanDOMString& sourceString,
+ CharVectorType& targetVector)
+{
+ return TranscodeToLocalCodePage(c_wstr(sourceString), targetVector);
+}
+
+
+
+/**
+ * Convert XalanDOMString to C++ standard library
+ * vector, transcoding to the default local code
+ * page.
+ *
+ * @param theSourceString source string
+ * @return The transcoded string.
+ */
+inline const CharVectorType
+TranscodeToLocalCodePage(const XalanDOMString& sourceString)
+{
+ CharVectorType theResult;
+
+ TranscodeToLocalCodePage(sourceString, theResult);
+
+ return theResult;
+}
1.12 +26 -16 xml-xalan/c/src/PlatformSupport/DoubleSupport.cpp
Index: DoubleSupport.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DoubleSupport.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DoubleSupport.cpp 2000/09/05 02:24:45 1.11
+++ DoubleSupport.cpp 2000/09/19 14:43:24 1.12
@@ -58,15 +58,19 @@
#if defined(NO_STD_LIMITS)
-#if defined(__GNUC__)
-#include <math.h>
-#include <bits/nan.h>
+# if defined(__GNUC__)
+# include <math.h>
+# if defined(SOLARIS)
+# include <nan.h>
+# else
+# include <bits/nan.h>
+# endif
+# else
+# error Unsupported platform!!!
+# endif
#else
-#error Unsupported platform!!!
+# include <limits>
#endif
-#else
-#include <limits>
-#endif
@@ -76,13 +80,21 @@
#if defined(NO_STD_LIMITS)
-#if defined(__GNUC__)
-const double DoubleSupport::s_NaN = NAN;
-const double DoubleSupport::s_positiveInfinity = HUGE_VAL;
-const double DoubleSupport::s_negativeInfinity = -HUGE_VAL;
-#else
-#error Unsupported platform!!!
-#endif
+# if defined(__GNUC__)
+
+# if defined(SOLARIS)
+ static const unsigned char __nan_bits[] = { 0x7f, 0xf0,0xc0,0x0,0x0,0x0,0x0,0x0 };
+ const double DoubleSupport::s_NaN = *reinterpret_cast<const double*>(__nan_bits);
+# else
+ const double DoubleSupport::s_NaN = NAN;
+# endif
+
+ const double DoubleSupport::s_positiveInfinity = HUGE_VAL;
+ const double DoubleSupport::s_negativeInfinity = -HUGE_VAL;
+
+# else
+# error Unsupported platform!!!
+# endif
#else
#if defined(XALAN_NO_NAMESPACES)
@@ -375,8 +387,6 @@
{
assert(theString != 0);
assert(*theString != 0);
-
- double theResult = 0.0;
bool fError = false;
bool fGotDecimalPoint = false;
1.2 +237 -1 xml-xalan/c/src/PlatformSupport/TextOutputStream.cpp
Index: TextOutputStream.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/TextOutputStream.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TextOutputStream.cpp 2000/04/25 19:47:16 1.1
+++ TextOutputStream.cpp 2000/09/19 14:43:25 1.2
@@ -59,12 +59,248 @@
-TextOutputStream::TextOutputStream()
+#include <util/PlatformUtils.hpp>
+#include <util/TransService.hpp>
+#include <util/XMLString.hpp>
+
+
+
+TextOutputStream::TextOutputStream(unsigned int theTranscoderBlockSize) :
+ m_transcoderBlockSize(theTranscoderBlockSize),
+ m_encoding(),
+ m_transcoder(0)
{
+ assert(m_transcoderBlockSize > 0);
}
TextOutputStream::~TextOutputStream()
+{
+ delete m_transcoder;
+}
+
+
+
+void
+TextOutputStream::transcode(
+ const XalanDOMChar* theBuffer,
+ unsigned long theBufferLength,
+ TranscodeVectorType& theDestination)
+{
+ if (m_transcoder == 0)
+ {
+ if (TranscodeToLocalCodePage(
+ theBuffer,
+ theDestination) == false)
+ {
+ throw TranscodingException();
+ }
+ }
+ else
+ {
+ try
+ {
+ bool fDone = false;
+
+ // Keep track of the total bytes we've added to the
+ // destination vector, and the total bytes we've
+ // eaten from theBuffer.
+ unsigned int theTotalBytesFilled = 0;
+ unsigned int theTotalBytesEaten = 0;
+
+ // Keep track of the current position in the input buffer,
+ // and amount remaining in the buffer, since we may not be
+ // able to transcode it all at once.
+ const XalanDOMChar* theBufferPosition = theBuffer;
+ unsigned int theRemainingBufferLength = theBufferLength;
+
+ // Keep track of the destination size, and the target size, which is
+ // the size of the destination that has not yet been filled with
+ // transcoded characters...
+ unsigned int theDestinationSize = theBufferLength;
+ unsigned int theTargetSize = theDestinationSize;
+
+ do
+ {
+ // Resize the buffer...
+ theDestination.resize(theDestinationSize);
+
+ unsigned int theBytesEaten = 0;
+
+ // Transcode and accumulate theTotalBytesFilled...
+ theTotalBytesFilled +=
+ m_transcoder->transcodeTo(
+ theBufferPosition,
+ theRemainingBufferLength,
+#if defined(XALAN_OLD_STYLE_CASTS)
+ (XMLByte*)&theDestination[0] + theTotalBytesFilled,
+#else
+ reinterpret_cast<XMLByte*>(&theDestination[0]) + theTotalBytesFilled,
+#endif
+ theTargetSize,
+ theBytesEaten,
+ XMLTranscoder::UnRep_Throw);
+
+ theTotalBytesEaten += theBytesEaten;
+
+ if (theTotalBytesEaten == theBufferLength)
+ {
+ fDone = true;
+ }
+ else
+ {
+ assert(theTotalBytesEaten < theBufferLength);
+
+ // Update everything...
+ theBufferPosition += theBytesEaten;
+ theRemainingBufferLength -= theBytesEaten;
+
+ // The new target size will always be the
+ // current destination size, since we
+ // grow by a factor of 2. This will
+ // need to change if the factor is
+ // every changed.
+ theTargetSize = theDestinationSize;
+
+ // Grow the destination by a factor of
+ // two 2. See the previous comment if
+ // you want to change this.
+ theDestinationSize = theDestinationSize * 2;
+ }
+ } while(fDone == false);
+
+ // Resize things, if there are any extra bytes...
+ if (theDestination.size() != theTotalBytesFilled)
+ {
+ theDestination.resize(theTotalBytesFilled);
+ }
+ }
+ catch(const XMLException&)
+ {
+ throw TranscodingException();
+ }
+ }
+}
+
+
+
+const XalanDOMString&
+TextOutputStream::getOutputEncoding() const
+{
+ return m_encoding;
+}
+
+
+
+void
+TextOutputStream::setOutputEncoding(const XalanDOMString& theEncoding)
+{
+ // Disabled for now...
+#if 0
+ assert(XMLPlatformUtils::fgTransService != 0);
+
+ delete m_transcoder;
+
+ XMLTransService::Codes theCode = XMLTransService::Ok;
+
+ m_transcoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor(
+ c_wstr(theEncoding),
+ theCode,
+ m_transcoderBlockSize);
+
+ if (theCode == XMLTransService::UnsupportedEncoding)
+ {
+ throw UnsupportedEncodingException(theEncoding);
+ }
+ else if (theCode != XMLTransService::Ok)
+ {
+ throw TranscoderInternalFailureException(theEncoding);
+ }
+ else
+ {
+ assert(m_transcoder != 0);
+
+ m_encoding = theEncoding;
+ }
+#endif
+}
+
+
+
+TextOutputStream::TextOutputStreamException::TextOutputStreamException(
+ const XalanDOMString& theMessage,
+ const XalanDOMString& theType) :
+ XSLException(theMessage, theType)
+{
+}
+
+
+
+TextOutputStream::TextOutputStreamException::~TextOutputStreamException()
+{
+}
+
+
+
+TextOutputStream::UnknownEncodingException::UnknownEncodingException() :
+ TextOutputStreamException(
+ XALAN_STATIC_UCODE_STRING("Unknown error occurred while transcoding!"),
+ XALAN_STATIC_UCODE_STRING("UnknownEncodingException"))
+{
+}
+
+
+
+TextOutputStream::UnknownEncodingException::~UnknownEncodingException()
+{
+}
+
+
+
+TextOutputStream::UnsupportedEncodingException::UnsupportedEncodingException(const XalanDOMString& theEncoding) :
+ TextOutputStreamException(
+ XALAN_STATIC_UCODE_STRING("Unsupported encoding:") + theEncoding,
+ XALAN_STATIC_UCODE_STRING("UnsupportedEncodingException")),
+ m_encoding(theEncoding)
+{
+}
+
+
+
+TextOutputStream::UnsupportedEncodingException::~UnsupportedEncodingException()
+{
+}
+
+
+
+TextOutputStream::TranscoderInternalFailureException::TranscoderInternalFailureException(const XalanDOMString& theEncoding) :
+ TextOutputStreamException(
+ XALAN_STATIC_UCODE_STRING("Unknown error occurred while transcoding to ") +
+ theEncoding +
+ XALAN_STATIC_UCODE_STRING("!"),
+ XALAN_STATIC_UCODE_STRING("TranscoderInternalFailureException")),
+ m_encoding(theEncoding)
+{
+}
+
+
+
+TextOutputStream::TranscoderInternalFailureException::~TranscoderInternalFailureException()
+{
+}
+
+
+
+TextOutputStream::TranscodingException::TranscodingException() :
+ TextOutputStreamException(
+ XALAN_STATIC_UCODE_STRING("An error occurred while transcoding!"),
+ XALAN_STATIC_UCODE_STRING("TranscodingException"))
+{
+}
+
+
+
+TextOutputStream::TranscodingException::~TranscodingException()
{
}
1.2 +138 -7 xml-xalan/c/src/PlatformSupport/TextOutputStream.hpp
Index: TextOutputStream.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/TextOutputStream.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TextOutputStream.hpp 2000/04/25 19:47:16 1.1
+++ TextOutputStream.hpp 2000/09/19 14:43:25 1.2
@@ -64,16 +64,30 @@
+#include <vector>
+
+
+
#include <XalanDOM/XalanDOMString.hpp>
+#include <PlatformSupport/XSLException.hpp>
+
+
+
+class XMLTranscoder;
+
+
+
class XALAN_PLATFORMSUPPORT_EXPORT TextOutputStream
{
public :
+ enum { eDefaultBlockSize = 1024 };
+
explicit
- TextOutputStream();
+ TextOutputStream(unsigned int theTranscoderBlockSize = eDefaultBlockSize);
virtual
~TextOutputStream();
@@ -85,7 +99,8 @@
flush() = 0;
/**
- * Write a character to the output stream.
+ * Write a character to the output stream. The character
+ * will not be transcoded.
*
* @param theChar the character to write
*/
@@ -93,7 +108,8 @@
write(char theChar) = 0;
/**
- * Write a wide character to the output stream.
+ * Write a wide character to the output stream. The character
+ * will be transcoded, if an output encoding is specified.
*
* @param theChar the character to write
*/
@@ -101,7 +117,8 @@
write(XalanDOMChar theChar) = 0;
/**
- * Write a null-terminated string to the output file.
+ * Write a null-terminated string to the output file. The character
+ * will not be transcoded.
*
* @param theBuffer character buffer to write
*/
@@ -109,7 +126,8 @@
write(const char* theBuffer) = 0;
/**
- * Write a null-terminated wide string to the output file.
+ * Write a null-terminated wide string to the output file. The string
+ * will be transcoded, if an output encoding is specified.
*
* @param theBuffer character buffer to write
*/
@@ -117,7 +135,8 @@
write(const XalanDOMChar* theBuffer) = 0;
/**
- * Write a specified number of characters to the output stream.
+ * Write a specified number of characters to the output stream. The string
+ * will not be transcoded.
*
* @param theBuffer character buffer to write
* @param theBufferLength number of characters to write
@@ -128,7 +147,8 @@
unsigned long theBufferLength) = 0;
/**
- * Write a specified number of characters to the output stream.
+ * Write a specified number of characters to the output stream. The string
+ * will be transcoded, if an output encoding is specified.
*
* @param theBuffer character buffer to write
* @param theBufferLength number of characters to write
@@ -138,6 +158,110 @@
const XalanDOMChar* theBuffer,
unsigned long theBufferLength) = 0;
+ /**
+ * Get the output encoding for the stream.
+ *
+ * @return The encoding name
+ */
+ virtual const XalanDOMString&
+ getOutputEncoding() const;
+
+ /**
+ * Set the output encoding for the stream.
+ *
+ * @param theEncoding The encoding name
+ */
+ virtual void
+ setOutputEncoding(const XalanDOMString& theEncoding);
+
+ class TextOutputStreamException : public XSLException
+ {
+ public:
+
+ TextOutputStreamException(
+ const XalanDOMString& theMessage,
+ const XalanDOMString& theType);
+
+ virtual
+ ~TextOutputStreamException();
+ };
+
+ class UnknownEncodingException : public TextOutputStreamException
+ {
+ public:
+
+ explicit
+ UnknownEncodingException();
+
+ virtual
+ ~UnknownEncodingException();
+ };
+
+ class UnsupportedEncodingException : public TextOutputStreamException
+ {
+ public:
+
+ UnsupportedEncodingException(const XalanDOMString& theEncoding);
+
+ virtual
+ ~UnsupportedEncodingException();
+
+ const XalanDOMString&
+ getEncoding() const
+ {
+ return m_encoding;
+ }
+
+ private:
+
+ const XalanDOMString& m_encoding;
+ };
+
+ class TranscoderInternalFailureException : public TextOutputStreamException
+ {
+ public:
+
+ TranscoderInternalFailureException(const XalanDOMString& theEncoding);
+
+ virtual
+ ~TranscoderInternalFailureException();
+
+ const XalanDOMString&
+ getEncoding() const
+ {
+ return m_encoding;
+ }
+
+ private:
+
+ const XalanDOMString& m_encoding;
+ };
+
+ class TranscodingException : public TextOutputStreamException
+ {
+ public:
+
+ explicit
+ TranscodingException();
+
+ virtual
+ ~TranscodingException();
+ };
+
+protected:
+
+#if defined(XALAN_NO_NAMESPACES)
+ typedef vector<char> TranscodeVectorType;
+#else
+ typedef std::vector<char> TranscodeVectorType;
+#endif
+
+ void
+ transcode(
+ const XalanDOMChar* theBuffer,
+ unsigned long theBufferLength,
+ TranscodeVectorType& theDestination);
+
private:
// These are not implemented...
@@ -148,6 +272,13 @@
bool
operator==(const TextOutputStream&) const;
+
+
+ const unsigned int m_transcoderBlockSize;
+
+ XalanDOMString m_encoding;
+
+ XMLTranscoder* m_transcoder;
};
1.9 +4 -10 xml-xalan/c/src/PlatformSupport/URISupport.cpp
Index: URISupport.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/URISupport.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- URISupport.cpp 2000/09/05 02:24:45 1.8
+++ URISupport.cpp 2000/09/19 14:43:26 1.9
@@ -77,14 +77,8 @@
{
URLAutoPtrType url(new XMLURL);
- try
- {
- url->setURL(c_wstr(getURLStringFromString(urlString)));
- }
- catch (...)
- {
- throw ("Error! Cannot create url for: " + urlString);
- }
+ url->setURL(c_wstr(getURLStringFromString(urlString)));
+
return url;
}
@@ -267,8 +261,8 @@
replace(
theVector.begin(),
theVector.end(),
- XalanUnicode::charReverseSolidus,
- XalanUnicode::charSolidus);
+ XalanDOMCharVectorType::value_type(XalanUnicode::charReverseSolidus),
+ XalanDOMCharVectorType::value_type(XalanUnicode::charSolidus));
uriString = XalanDOMString(&theVector[0]);
}
1.2 +16 -0 xml-xalan/c/src/PlatformSupport/Writer.cpp
Index: Writer.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/Writer.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Writer.cpp 1999/12/18 19:47:50 1.1
+++ Writer.cpp 2000/09/19 14:43:48 1.2
@@ -68,3 +68,19 @@
Writer::~Writer()
{
}
+
+
+
+TextOutputStream*
+Writer::getStream()
+{
+ return 0;
+}
+
+
+
+const TextOutputStream*
+Writer::getStream() const
+{
+ return 0;
+}
1.9 +17 -0 xml-xalan/c/src/PlatformSupport/Writer.hpp
Index: Writer.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/Writer.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Writer.hpp 2000/04/11 14:35:31 1.8
+++ Writer.hpp 2000/09/19 14:43:49 1.9
@@ -73,6 +73,10 @@
+class TextOutputStream;
+
+
+
class XALAN_PLATFORMSUPPORT_EXPORT Writer
{
public:
@@ -93,6 +97,19 @@
*/
virtual void
flush() = 0;
+
+
+ /**
+ * Get the stream associated with the writer...
+ */
+ virtual TextOutputStream*
+ getStream();
+
+ /**
+ * Get the stream associated with the writer...
+ */
+ virtual const TextOutputStream*
+ getStream() const;
// Output functions
1.2 +2 -58 xml-xalan/c/src/PlatformSupport/XalanAutoPtr.hpp
Index: XalanAutoPtr.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanAutoPtr.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XalanAutoPtr.hpp 2000/08/22 20:18:30 1.1
+++ XalanAutoPtr.hpp 2000/09/19 14:43:50 1.2
@@ -81,34 +81,13 @@
{
}
-#if defined(XALAN_CANNOT_MUTATE_ANONYMOUS_OBJECT)
XalanAutoPtr(const XalanAutoPtr<Type>& theSource) :
m_pointer(((XalanAutoPtr<Type>&)theSource).release())
{
}
-#else
- XalanAutoPtr(XalanAutoPtr& theSource) :
- m_pointer(theSource.release())
- {
- }
-#endif
-#if defined(XALAN_CANNOT_MUTATE_ANONYMOUS_OBJECT)
XalanAutoPtr<Type>&
- operator=(const XalanAutoPtr<Type>& theRHS)
- {
- if (this != &theRHS)
- {
- delete m_pointer;
-
- m_pointer = ((XalanAutoPtr<Type>&)theRHS).release();
- }
-
- return *this;
- }
-#else
- XalanAutoPtr&
- operator=(XalanAutoPtr& theRHS)
+ operator=(XalanAutoPtr<Type>& theRHS)
{
if (this != &theRHS)
{
@@ -119,7 +98,6 @@
return *this;
}
-#endif
~XalanAutoPtr()
{
@@ -164,12 +142,6 @@
private:
-#if !defined(XALAN_CANNOT_MUTATE_ANONYMOUS_OBJECT)
- // Not defined...
- XalanAutoPtr&
- operator=(const XalanAutoPtr& theRHS);
-#endif
-
Type* m_pointer;
};
@@ -186,34 +158,13 @@
{
}
-#if defined(XALAN_CANNOT_MUTATE_ANONYMOUS_OBJECT)
XalanArrayAutoPtr(const XalanArrayAutoPtr<Type>& theSource) :
m_pointer(((XalanArrayAutoPtr<Type>&)theSource).release())
{
}
-#else
- XalanArrayAutoPtr(XalanArrayAutoPtr& theSource) :
- m_pointer(theSource.release())
- {
- }
-#endif
-#if defined(XALAN_CANNOT_MUTATE_ANONYMOUS_OBJECT)
XalanArrayAutoPtr<Type>&
- operator=(const XalanArrayAutoPtr<Type>& theRHS)
- {
- if (this != &theRHS)
- {
- delete [] m_pointer;
-
- m_pointer = ((XalanArrayAutoPtr<Type>&)theRHS).release();
- }
-
- return *this;
- }
-#else
- XalanArrayAutoPtr&
- operator=(XalanArrayAutoPtr& theRHS)
+ operator=(XalanArrayAutoPtr<Type>& theRHS)
{
if (this != &theRHS)
{
@@ -224,7 +175,6 @@
return *this;
}
-#endif
~XalanArrayAutoPtr()
{
@@ -268,12 +218,6 @@
}
private:
-
-#if !defined(XALAN_CANNOT_MUTATE_ANONYMOUS_OBJECT)
- // Not defined...
- XalanArrayAutoPtr&
- operator=(const XalanArrayAutoPtr& theRHS);
-#endif
Type* m_pointer;
};
1.3 +31 -3 xml-xalan/c/src/PlatformSupport/XalanDecimalFormatSymbols.cpp
Index: XalanDecimalFormatSymbols.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanDecimalFormatSymbols.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XalanDecimalFormatSymbols.cpp 2000/09/05 02:24:45 1.2
+++ XalanDecimalFormatSymbols.cpp 2000/09/19 14:43:50 1.3
@@ -60,9 +60,37 @@
-static XalanDOMChar theNaNDefault[] = { 0xFFFD, 0 };
-static XalanDOMChar theInfinityDefault[] = { 0x221E, 0 };
-static XalanDOMChar theCurrencySymbol[] = { XalanUnicode::charDollarSign, 0 };
+static XalanDOMChar theNaNDefault[] =
+{
+ XalanUnicode::charLetter_N,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_N,
+ 0
+};
+
+
+
+static XalanDOMChar theInfinityDefault[] =
+{
+ XalanUnicode::charLetter_I,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_f,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_y,
+ 0
+};
+
+
+
+static XalanDOMChar theCurrencySymbol[] =
+{
+ XalanUnicode::charDollarSign,
+ 0
+};
+
XalanDecimalFormatSymbols::XalanDecimalFormatSymbols() :
1.2 +2 -0 xml-xalan/c/src/PlatformSupport/XalanUnicode.hpp
Index: XalanUnicode.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanUnicode.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XalanUnicode.hpp 2000/09/05 02:24:45 1.1
+++ XalanUnicode.hpp 2000/09/19 14:43:51 1.2
@@ -186,6 +186,7 @@
charLetter_s = 0x73,
charLetter_t = 0x74,
charLetter_u = 0x75,
+ charLetter_y = 0x79,
charLeftCurlyBracket = 0x7B,
@@ -304,6 +305,7 @@
static const XalanDOMChar charLetter_s = 0x73;
static const XalanDOMChar charLetter_t = 0x74;
static const XalanDOMChar charLetter_u = 0x75;
+ static const XalanDOMChar charLetter_y = 0x79;
static const XalanDOMChar charLeftCurlyBracket = 0x7B;